@appscode/design-system 1.0.43-alpha.13 → 1.0.43-alpha.130
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/_default.scss +283 -21
- package/base/utilities/_derived-variables.scss +0 -13
- package/base/utilities/_initial-variables.scss +78 -56
- package/base/utilities/_mixin.scss +10 -17
- package/base/utilities/_typography.scss +23 -7
- package/base/utilities/dark-theme.scss +25 -0
- package/components/_ac-accordion.scss +1 -0
- package/components/_ac-alert-box.scss +18 -10
- package/components/_ac-card.scss +55 -20
- package/components/_ac-code-highlight.scss +7 -1
- package/components/_ac-content-layout.scss +4 -4
- package/components/_ac-drag.scss +6 -6
- package/components/_ac-input.scss +74 -40
- package/components/_ac-modal.scss +5 -4
- package/components/_ac-multi-select.scss +195 -13
- package/components/_ac-options.scss +31 -16
- package/components/_ac-select-box.scss +15 -5
- package/components/_ac-table.scss +42 -36
- package/components/_ac-tabs.scss +72 -23
- package/components/_ac-tags.scss +2 -2
- package/components/_ac-terminal.scss +272 -0
- package/components/_app-drawer.scss +6 -6
- package/components/_breadcumb.scss +7 -2
- package/components/_buttons.scss +60 -27
- package/components/_card-body-wrapper.scss +3 -3
- package/components/_dashboard-header.scss +33 -1
- package/components/_direct-deploy.scss +69 -0
- package/components/_go-to-top.scss +1 -1
- package/components/_graph.scss +45 -0
- package/components/_image-upload.scss +6 -4
- package/components/_left-sidebar-menu.scss +200 -46
- package/components/_monaco-editor.scss +1 -1
- package/components/_navbar.scss +103 -26
- package/components/_overview-info.scss +4 -4
- package/components/_overview-page.scss +1 -2
- package/components/_pagination.scss +10 -2
- package/components/_payment-card.scss +28 -12
- package/components/_preview-modal.scss +19 -8
- package/components/_pricing-table.scss +1 -1
- package/components/_progress-bar.scss +5 -5
- package/components/_subscription-card.scss +15 -8
- package/components/_table-of-content.scss +1 -1
- package/components/_tfa.scss +69 -0
- package/components/_widget-menu.scss +9 -9
- package/components/_wizard.scss +31 -19
- package/components/ac-toaster/_ac-toasted.scss +5 -5
- package/components/bbum/_card-team.scss +18 -10
- package/components/bbum/_information-center.scss +17 -3
- package/components/bbum/_mobile-desktop.scss +6 -6
- package/components/bbum/_post.scss +5 -4
- package/components/bbum/_sign-up-notification.scss +6 -6
- package/components/bbum/_single-post-preview.scss +9 -9
- package/components/bbum/_user-profile.scss +97 -90
- package/components/ui-builder/_ui-builder.scss +29 -10
- package/components/ui-builder/_vue-open-api.scss +98 -0
- package/layouts/_404.scss +2 -1
- package/layouts/_code-preview.scss +14 -7
- package/main.scss +4 -0
- package/package.json +2 -7
- package/plugins/theme.js +130 -128
- package/vue-components/v2/banner/Banner.vue +2 -2
- package/vue-components/v2/breadcrumbs/Breadcrumb.vue +97 -0
- package/vue-components/v2/button/Button.vue +5 -0
- package/vue-components/v2/button/DownloadBtn.vue +45 -0
- package/vue-components/v2/card/PaymentCards.vue +11 -2
- package/vue-components/v2/content/ContentTable.vue +12 -7
- package/vue-components/v2/editor/Editor.vue +29 -1
- package/vue-components/v2/editor/FilteredFileEditor.vue +153 -0
- package/vue-components/v2/editor/ResourceKeyValueEditor.vue +196 -0
- package/vue-components/v2/loaders/ResourceLoader.vue +90 -0
- package/vue-components/v2/loaders/SidebarLoader.vue +32 -0
- package/vue-components/v2/modal/Modal.vue +33 -12
- package/vue-components/v2/modals/DeleteConfirmationModal.vue +77 -0
- package/vue-components/v2/modals/JsonShowModal.vue +12 -2
- package/vue-components/v2/navbar/Appdrawer.vue +10 -9
- package/vue-components/v2/navbar/ThemeMode.vue +120 -0
- package/vue-components/v2/navbar/User.vue +3 -0
- package/vue-components/v2/preloader/Preloader.vue +5 -5
- package/vue-components/v2/sidebar/ClusterSwitcher.vue +126 -0
- package/vue-components/v2/sidebar/SidebarItem.vue +23 -1
- package/vue-components/v2/sidebar/SidebarItemWithDropDown.vue +19 -20
- package/vue-components/v2/table/Table.vue +33 -8
- package/vue-components/v2/table/TableRow.vue +17 -8
- package/vue-components/v2/table/table-cell/CellValue.vue +31 -4
- package/vue-components/v2/table/table-cell/GenericCell.vue +56 -0
- package/vue-components/v2/table/table-cell/ObjectCell.vue +4 -1
- package/vue-components/v2/tabs/EditorTabs.vue +1 -1
- package/vue-components/v3/button/Button.vue +5 -0
- package/vue-components/v3/dropdown/DropdownMenu.vue +1 -1
- package/vue-components/v3/editor/Editor.vue +32 -11
- package/vue-components/v3/modal/Modal.vue +10 -1
- package/vue-components/v3/modals/JsonShowModal.vue +13 -4
- package/vue-components/v3/navbar/Appdrawer.vue +12 -7
- package/vue-components/v3/navbar/ThemeMode.vue +128 -0
- package/vue-components/v3/sidebar/ClusterSwitcher.vue +133 -0
- package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +120 -0
- package/vue-components/v3/table/Table.vue +17 -5
- package/vue-components/v3/table/TableRow.vue +1 -1
- package/vue-components/v3/table/table-cell/CellValue.vue +26 -3
- package/vue-components/v3/table/table-cell/GenericCell.vue +62 -0
- package/vue-components/v3/table/table-cell/ObjectCell.vue +5 -1
- package/vue-components/v3/tabs/EditorTabs.vue +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- modal start -->
|
|
3
|
+
<modal
|
|
4
|
+
:title="title"
|
|
5
|
+
modifier-classes="is-normal"
|
|
6
|
+
:open="open"
|
|
7
|
+
@closemodal="closeModal"
|
|
8
|
+
>
|
|
9
|
+
<!-- freedom content start -->
|
|
10
|
+
<div class="action-message pt-35 pb-35 has-text-centered">
|
|
11
|
+
<h5 class="is-message">{{ message }} {{ itemName ? "" : "?" }}</h5>
|
|
12
|
+
<p class="is-description">{{ itemName }} {{ itemName ? "?" : "" }}</p>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<!-- freedom content end -->
|
|
16
|
+
|
|
17
|
+
<!-- modal footer start -->
|
|
18
|
+
<template #modal-footer-controls>
|
|
19
|
+
<ac-button
|
|
20
|
+
@click.stop="closeModal"
|
|
21
|
+
title="Cancel"
|
|
22
|
+
modifier-classes="is-outlined"
|
|
23
|
+
/>
|
|
24
|
+
<ac-button
|
|
25
|
+
modifier-classes="is-danger"
|
|
26
|
+
:is-loader-active="isDeleteActive"
|
|
27
|
+
title="Yes"
|
|
28
|
+
@click.stop="confirm(true)"
|
|
29
|
+
/>
|
|
30
|
+
</template>
|
|
31
|
+
</modal>
|
|
32
|
+
<!-- modal end -->
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
export default {
|
|
37
|
+
components: {
|
|
38
|
+
Modal: () => import("./../modal/Modal.vue"),
|
|
39
|
+
AcButton: () => import("./../button/Button.vue")
|
|
40
|
+
},
|
|
41
|
+
props: {
|
|
42
|
+
open: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
title: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: ""
|
|
49
|
+
},
|
|
50
|
+
message: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: ""
|
|
53
|
+
},
|
|
54
|
+
itemName: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ""
|
|
57
|
+
},
|
|
58
|
+
isLoading: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
isDeleteActive: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
confirm(response) {
|
|
69
|
+
this.$emit("delete-confirmation-modal$confirm", response);
|
|
70
|
+
},
|
|
71
|
+
closeModal() {
|
|
72
|
+
this.confirm(false);
|
|
73
|
+
this.$emit("closemodal", true);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
</script>
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
<ac-button
|
|
11
11
|
modifier-classes="is-square is-primary"
|
|
12
12
|
icon-class="copy"
|
|
13
|
-
v-clipboard:copy="
|
|
13
|
+
v-clipboard:copy="
|
|
14
|
+
`${editorTitle}: ${JSON.stringify(parsedContent, null, 4)}`
|
|
15
|
+
"
|
|
14
16
|
v-clipboard:success="onCopy"
|
|
15
17
|
v-clipboard:error="onError"
|
|
16
18
|
/>
|
|
@@ -26,6 +28,8 @@
|
|
|
26
28
|
</template>
|
|
27
29
|
|
|
28
30
|
<script>
|
|
31
|
+
import Preloader from "../preloader/Preloader.vue";
|
|
32
|
+
import Banner from "../banner/Banner.vue";
|
|
29
33
|
export default {
|
|
30
34
|
props: {
|
|
31
35
|
open: {
|
|
@@ -43,7 +47,13 @@ export default {
|
|
|
43
47
|
},
|
|
44
48
|
components: {
|
|
45
49
|
Modal: () => import("../modal/Modal.vue"),
|
|
46
|
-
Editor: () =>
|
|
50
|
+
Editor: () => ({
|
|
51
|
+
component: import("../editor/Editor.vue"),
|
|
52
|
+
loading: Preloader,
|
|
53
|
+
delay: 200,
|
|
54
|
+
error: Banner,
|
|
55
|
+
timeout: 20000,
|
|
56
|
+
}),
|
|
47
57
|
AcButton: () => import("../button/Button.vue"),
|
|
48
58
|
HeaderItem: () => import("../header/HeaderItem.vue"),
|
|
49
59
|
},
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="app-drawer-wrapper
|
|
3
|
-
<div
|
|
2
|
+
<div class="app-drawer-wrapper is-flex">
|
|
3
|
+
<div
|
|
4
|
+
class="drawer-icon is-flex is-justify-content-center is-align-items-center"
|
|
5
|
+
>
|
|
4
6
|
<svg
|
|
5
7
|
class="gb_We"
|
|
6
8
|
focusable="false"
|
|
7
9
|
viewBox="0 0 24 24"
|
|
10
|
+
style="width: 22px;margin-top: 2px;"
|
|
8
11
|
:style="{ fill: 'white' }"
|
|
9
12
|
>
|
|
10
13
|
<path
|
|
@@ -20,16 +23,14 @@
|
|
|
20
23
|
<article class="media">
|
|
21
24
|
<figure class="media-left">
|
|
22
25
|
<p class="image">
|
|
23
|
-
<img
|
|
24
|
-
:src="app.icon_url"
|
|
25
|
-
/>
|
|
26
|
+
<img :src="app.icon_url" />
|
|
26
27
|
</p>
|
|
27
28
|
</figure>
|
|
28
29
|
<div class="media-content">
|
|
29
30
|
<div class="content">
|
|
30
31
|
<p>
|
|
31
|
-
<strong>{{app.title}}</strong>
|
|
32
|
-
<span>{{app.sub_title}}</span>
|
|
32
|
+
<strong>{{ app.title }}</strong>
|
|
33
|
+
<span>{{ app.sub_title }}</span>
|
|
33
34
|
</p>
|
|
34
35
|
</div>
|
|
35
36
|
</div>
|
|
@@ -50,7 +51,7 @@ export default {
|
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
53
|
components: {
|
|
53
|
-
NavbarItemContent: () => import("./NavbarItemContent.vue")
|
|
54
|
-
}
|
|
54
|
+
NavbarItemContent: () => import("./NavbarItemContent.vue")
|
|
55
|
+
}
|
|
55
56
|
};
|
|
56
57
|
</script>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<button
|
|
4
|
+
v-if="themeMode"
|
|
5
|
+
class="button ac-nav-button"
|
|
6
|
+
style="color: #ffffff; font-size: 15px;"
|
|
7
|
+
@click="toggleTheme"
|
|
8
|
+
:title="themeModes[themeMode].displayName"
|
|
9
|
+
>
|
|
10
|
+
<i :class="`fa ${themeModes[themeMode].iconClass}`" />
|
|
11
|
+
</button>
|
|
12
|
+
<div class="ac-menu-content theme-choice">
|
|
13
|
+
<ul class="is-flex is-flex-direction-row is-justify-content-space-around">
|
|
14
|
+
<li
|
|
15
|
+
v-for="theme of Object.keys(themeModes)"
|
|
16
|
+
:title="themeModes[theme].displayName"
|
|
17
|
+
@click="themeMode = theme"
|
|
18
|
+
:class="{'is-active': themeMode === theme}"
|
|
19
|
+
:key="theme"
|
|
20
|
+
>
|
|
21
|
+
<i :class="['fa', themeModes[theme].iconClass]" />
|
|
22
|
+
</li>
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
<script>
|
|
28
|
+
export default {
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
themeMode: "",
|
|
32
|
+
themeModes: {
|
|
33
|
+
system: {
|
|
34
|
+
displayName: "System Theme",
|
|
35
|
+
iconClass: "fa-desktop",
|
|
36
|
+
},
|
|
37
|
+
light: {
|
|
38
|
+
displayName: "Light Theme",
|
|
39
|
+
iconClass: "fa-sun-o",
|
|
40
|
+
},
|
|
41
|
+
dark: {
|
|
42
|
+
displayName: "Dark Theme",
|
|
43
|
+
iconClass: "fa-moon-o",
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
mounted() {
|
|
50
|
+
// get theme mode from localStorage or set default one
|
|
51
|
+
this.themeMode = localStorage.getItem("themeMode") || "light";
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
destroyed() {
|
|
55
|
+
this.removeColorSchemeEventListener();
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
watch: {
|
|
59
|
+
themeMode: {
|
|
60
|
+
handler(n) {
|
|
61
|
+
this.onThemeModeChange(n);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
methods: {
|
|
67
|
+
// handle theme mode button click
|
|
68
|
+
toggleTheme() {
|
|
69
|
+
if (this.themeMode === "light") this.themeMode = "dark";
|
|
70
|
+
else if (this.themeMode === "dark") this.themeMode = "system";
|
|
71
|
+
else if (this.themeMode === "system") this.themeMode = "light";
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
// triggered when theme mode is updated
|
|
75
|
+
onThemeModeChange(n) {
|
|
76
|
+
localStorage.setItem("themeMode", n);
|
|
77
|
+
|
|
78
|
+
let theme = n;
|
|
79
|
+
if (n === "system") {
|
|
80
|
+
const isDarkMode =
|
|
81
|
+
window.matchMedia &&
|
|
82
|
+
window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
83
|
+
this.addColorSchemeEventListener();
|
|
84
|
+
theme = isDarkMode ? "dark" : "light";
|
|
85
|
+
} else {
|
|
86
|
+
this.removeColorSchemeEventListener();
|
|
87
|
+
}
|
|
88
|
+
this.$emit("set:theme", theme);
|
|
89
|
+
this.handleDarkThemeClass(theme);
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
// add proper css class to update the ui theme
|
|
93
|
+
handleDarkThemeClass(currentTheme) {
|
|
94
|
+
if (currentTheme === "light") {
|
|
95
|
+
document.documentElement.classList.remove("is-dark-theme");
|
|
96
|
+
} else {
|
|
97
|
+
document.documentElement.classList.add("is-dark-theme");
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
// add system theme listener event
|
|
102
|
+
addColorSchemeEventListener() {
|
|
103
|
+
window
|
|
104
|
+
.matchMedia("(prefers-color-scheme: dark)")
|
|
105
|
+
.addEventListener("change", this.handleSystemThemeChange);
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
// remove system theme listener event
|
|
109
|
+
removeColorSchemeEventListener() {
|
|
110
|
+
window
|
|
111
|
+
.matchMedia("(prefers-color-scheme: dark)")
|
|
112
|
+
.removeEventListener("change", this.handleSystemThemeChange);
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
handleSystemThemeChange() {
|
|
116
|
+
this.onThemeModeChange(this.themeMode);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="is-flex is-justify-content-center is-align-items-center is-flex-direction-column"
|
|
3
|
+
class="is-flex is-justify-content-center is-align-items-center is-flex-direction-column ac-preloader"
|
|
4
4
|
style="height: calc(100vh - 200px);"
|
|
5
5
|
>
|
|
6
6
|
<span v-if="showSpinner" class="spinner"></span>
|
|
@@ -15,12 +15,12 @@ export default {
|
|
|
15
15
|
props: {
|
|
16
16
|
showSpinner: {
|
|
17
17
|
type: Boolean,
|
|
18
|
-
default: true
|
|
18
|
+
default: true
|
|
19
19
|
},
|
|
20
20
|
message: {
|
|
21
21
|
type: String,
|
|
22
|
-
default: "
|
|
23
|
-
}
|
|
24
|
-
}
|
|
22
|
+
default: "Loading ..."
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
25
|
};
|
|
26
26
|
</script>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="is-cluster-logo" v-if="sidebarCollapsed">
|
|
3
|
+
<img
|
|
4
|
+
width="40"
|
|
5
|
+
:src="getProviderIcon(selectedCluster && selectedCluster.provider)"
|
|
6
|
+
onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
|
|
7
|
+
alt="provider-icon"
|
|
8
|
+
/>
|
|
9
|
+
</div>
|
|
10
|
+
<multiselect
|
|
11
|
+
v-else
|
|
12
|
+
v-model="selectedCluster"
|
|
13
|
+
placeholder="Selected Cluster"
|
|
14
|
+
label="name"
|
|
15
|
+
track-by="name"
|
|
16
|
+
:options="clusterOptions"
|
|
17
|
+
:allow-empty="false"
|
|
18
|
+
deselectLabel=""
|
|
19
|
+
selectLabel=""
|
|
20
|
+
selectedLabel=""
|
|
21
|
+
>
|
|
22
|
+
<template slot="singleLabel" slot-scope="props">
|
|
23
|
+
<div class="is-flex is-align-items-center">
|
|
24
|
+
<img
|
|
25
|
+
:src="getProviderIcon(props.option.provider)"
|
|
26
|
+
onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
|
|
27
|
+
alt="No cluster selected"
|
|
28
|
+
/><span
|
|
29
|
+
><span>{{ props.option.displayName }}</span></span
|
|
30
|
+
>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
<template slot="option" slot-scope="props">
|
|
34
|
+
<div class="is-flex is-align-items-center">
|
|
35
|
+
<img
|
|
36
|
+
class="mr-15"
|
|
37
|
+
:src="getProviderIcon(props.option.provider)"
|
|
38
|
+
onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
|
|
39
|
+
alt="No cluster selected"
|
|
40
|
+
/>
|
|
41
|
+
<div>
|
|
42
|
+
<p>{{ props.option.displayName }}</p>
|
|
43
|
+
<p class="location">{{ props.option.location }}</p>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
</multiselect>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
export default {
|
|
52
|
+
props: {
|
|
53
|
+
sidebarCollapsed: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
mouseHover: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
61
|
+
clusterOptions: {
|
|
62
|
+
type: Array,
|
|
63
|
+
default: [],
|
|
64
|
+
},
|
|
65
|
+
value: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: "",
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
components: {
|
|
72
|
+
Multiselect: () => import("vue-multiselect"),
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
data() {
|
|
76
|
+
return {
|
|
77
|
+
selectedCluster: null,
|
|
78
|
+
selectedClusterName: "",
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
methods: {
|
|
83
|
+
getProviderIcon(provider) {
|
|
84
|
+
return `https://cdn.appscode.com/images/cloud-provider-icons/${provider}.png`;
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
watch: {
|
|
89
|
+
value: {
|
|
90
|
+
immediate: true,
|
|
91
|
+
handler(n) {
|
|
92
|
+
this.selectedClusterName = n;
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
selectedCluster: {
|
|
96
|
+
deep: true,
|
|
97
|
+
handler(n) {
|
|
98
|
+
this.selectedClusterName = n.name;
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
selectedClusterName(n) {
|
|
102
|
+
if (this.selectedCluster && n !== this.selectedCluster.name) {
|
|
103
|
+
this.clusterOptions.forEach((item) => {
|
|
104
|
+
if (this.selectedClusterName === item.name) {
|
|
105
|
+
this.selectedCluster = item;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
this.$emit("input", n);
|
|
110
|
+
},
|
|
111
|
+
clusterOptions: {
|
|
112
|
+
deep: true,
|
|
113
|
+
immediate: true,
|
|
114
|
+
async handler(list) {
|
|
115
|
+
if (list) {
|
|
116
|
+
list.forEach(async (item) => {
|
|
117
|
+
if(item.name === this.selectedClusterName) {
|
|
118
|
+
this.selectedCluster = item;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<li>
|
|
2
|
+
<li ref="sidebarItem">
|
|
3
3
|
<router-link
|
|
4
4
|
:id="id"
|
|
5
5
|
:title="title"
|
|
@@ -38,5 +38,27 @@ export default {
|
|
|
38
38
|
default: "@/assets/images/icons/basic.svg",
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
|
+
watch: {
|
|
42
|
+
isActive: {
|
|
43
|
+
immediate: true,
|
|
44
|
+
handler(n) {
|
|
45
|
+
if (n) {
|
|
46
|
+
this.$nextTick(() => {
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
const top = (this.$refs.sidebarItem && this.$refs.sidebarItem.getBoundingClientRect().top) || 0;
|
|
49
|
+
// preventing scroll to options that are already visible
|
|
50
|
+
if (top > window.innerHeight - 200) {
|
|
51
|
+
// scroll to selected option item
|
|
52
|
+
this.$refs.sidebarItem.scrollIntoView({
|
|
53
|
+
behavior: 'smooth',
|
|
54
|
+
block: "center"
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}, 500);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
41
63
|
};
|
|
42
64
|
</script>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</span>
|
|
11
11
|
</a>
|
|
12
12
|
|
|
13
|
-
<ul
|
|
13
|
+
<ul ref="sectionItems" :style="{ maxHeight: dropDownSectionHeight }">
|
|
14
14
|
<slot />
|
|
15
15
|
</ul>
|
|
16
16
|
</li>
|
|
@@ -23,10 +23,6 @@ export default {
|
|
|
23
23
|
type: Boolean,
|
|
24
24
|
default: false,
|
|
25
25
|
},
|
|
26
|
-
isLoaderActive: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: false,
|
|
29
|
-
},
|
|
30
26
|
title: {
|
|
31
27
|
type: String,
|
|
32
28
|
default: "Sidebar Item",
|
|
@@ -41,27 +37,32 @@ export default {
|
|
|
41
37
|
return {
|
|
42
38
|
dropDownStatus: "close",
|
|
43
39
|
dropDownSectionHeight: null,
|
|
40
|
+
isCompMounted: false,
|
|
44
41
|
};
|
|
45
42
|
},
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
mounted() {
|
|
45
|
+
this.isCompMounted = true;
|
|
46
|
+
setTimeout(() => {
|
|
47
|
+
// for expanding dropdown
|
|
48
|
+
if (this.isDropDownOpen) {
|
|
49
|
+
this.setDropdownMaxHeight("open");
|
|
50
|
+
} else {
|
|
51
|
+
this.setDropdownMaxHeight("close");
|
|
54
52
|
}
|
|
55
|
-
},
|
|
53
|
+
}, 700);
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
watch: {
|
|
56
57
|
title(n, o) {
|
|
57
|
-
if (n &&
|
|
58
|
+
if (n && this.isCompMounted) {
|
|
58
59
|
this.$nextTick(() => {
|
|
59
60
|
// for expanding dropdown
|
|
60
61
|
this.setDropdownMaxHeight("open");
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
if (o &&
|
|
65
|
+
if (o && this.isCompMounted) {
|
|
65
66
|
this.$nextTick(() => {
|
|
66
67
|
// for expanding dropdown
|
|
67
68
|
this.setDropdownMaxHeight("close");
|
|
@@ -84,7 +85,7 @@ export default {
|
|
|
84
85
|
this.$emit("dropDownItemChange");
|
|
85
86
|
|
|
86
87
|
this.$nextTick(() => {
|
|
87
|
-
const dropDownUl = this.$refs[
|
|
88
|
+
const dropDownUl = this.$refs["sectionItems"];
|
|
88
89
|
if (dropDownUl)
|
|
89
90
|
this.dropDownSectionHeight = `${dropDownUl.scrollHeight}px`;
|
|
90
91
|
});
|
|
@@ -99,11 +100,9 @@ export default {
|
|
|
99
100
|
methods: {
|
|
100
101
|
setDropdownMaxHeight(mode) {
|
|
101
102
|
if (mode === "open") {
|
|
102
|
-
this
|
|
103
|
-
this.$refs[this.title][0].scrollHeight
|
|
104
|
-
}px`;
|
|
103
|
+
this.dropDownSectionHeight = `${this.$refs["sectionItems"].scrollHeight}px`;
|
|
105
104
|
} else {
|
|
106
|
-
this
|
|
105
|
+
this.dropDownSectionHeight = null;
|
|
107
106
|
}
|
|
108
107
|
},
|
|
109
108
|
toggleDropDownStatus() {
|
|
@@ -23,10 +23,28 @@
|
|
|
23
23
|
:key="idx"
|
|
24
24
|
:class="{
|
|
25
25
|
sorting: headerSortables[idx] && headerSortables[idx].enabled,
|
|
26
|
-
'sorting-desc':
|
|
27
|
-
|
|
26
|
+
'sorting-desc':
|
|
27
|
+
headerSortables[idx] && headerSortables[idx].mode === 'desc',
|
|
28
|
+
'sorting-asc':
|
|
29
|
+
headerSortables[idx] && headerSortables[idx].mode === 'asc',
|
|
30
|
+
'has-text-centered':
|
|
31
|
+
typeof tableHeader === 'string'
|
|
32
|
+
? false
|
|
33
|
+
: tableHeader.textAlign === 'center',
|
|
34
|
+
'has-text-left':
|
|
35
|
+
typeof tableHeader === 'string'
|
|
36
|
+
? false
|
|
37
|
+
: tableHeader.textAlign === 'left',
|
|
38
|
+
'has-text-right':
|
|
39
|
+
typeof tableHeader === 'string'
|
|
40
|
+
? false
|
|
41
|
+
: tableHeader.textAlign === 'right',
|
|
28
42
|
}"
|
|
29
|
-
@click.prevent="
|
|
43
|
+
@click.prevent="
|
|
44
|
+
headerSortables[idx] &&
|
|
45
|
+
headerSortables[idx].enabled &&
|
|
46
|
+
emitSortEvent(idx)
|
|
47
|
+
"
|
|
30
48
|
>
|
|
31
49
|
{{ headerLabels[idx] }}
|
|
32
50
|
</th>
|
|
@@ -146,7 +164,7 @@ export default {
|
|
|
146
164
|
},
|
|
147
165
|
headerLabels() {
|
|
148
166
|
return this.tableHeaders.map((th) =>
|
|
149
|
-
typeof th === "string" ? th : th.
|
|
167
|
+
typeof th === "string" ? th : th.name || "Label"
|
|
150
168
|
);
|
|
151
169
|
},
|
|
152
170
|
},
|
|
@@ -157,8 +175,15 @@ export default {
|
|
|
157
175
|
handler(n) {
|
|
158
176
|
if (this.headerSortables.length === n.length) {
|
|
159
177
|
n.forEach((th, idx) => {
|
|
160
|
-
if (
|
|
161
|
-
this.headerSortables[idx].enabled
|
|
178
|
+
if (
|
|
179
|
+
this.headerSortables[idx].enabled !==
|
|
180
|
+
!!(th && th.sort && th.sort.enable)
|
|
181
|
+
) {
|
|
182
|
+
this.headerSortables[idx].enabled = !!(
|
|
183
|
+
th &&
|
|
184
|
+
th.sort &&
|
|
185
|
+
th.sort.enable
|
|
186
|
+
);
|
|
162
187
|
this.headerSortables[idx].mode = "";
|
|
163
188
|
}
|
|
164
189
|
});
|
|
@@ -171,7 +196,7 @@ export default {
|
|
|
171
196
|
};
|
|
172
197
|
} else {
|
|
173
198
|
return {
|
|
174
|
-
enabled: !!th.
|
|
199
|
+
enabled: !!(th && th.sort && th.sort.enable),
|
|
175
200
|
mode: "",
|
|
176
201
|
};
|
|
177
202
|
}
|
|
@@ -198,7 +223,7 @@ export default {
|
|
|
198
223
|
emitSortEvent(index) {
|
|
199
224
|
const emitValue = {
|
|
200
225
|
index,
|
|
201
|
-
label: this.tableHeaders[index].
|
|
226
|
+
label: this.tableHeaders[index].name,
|
|
202
227
|
mode: "",
|
|
203
228
|
};
|
|
204
229
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
custom
|
|
7
7
|
v-slot="{ navigate }"
|
|
8
8
|
>
|
|
9
|
-
<tr @click="navigate">
|
|
9
|
+
<tr class="is-link" @click="navigate">
|
|
10
10
|
<slot />
|
|
11
11
|
<fake-table-cell
|
|
12
12
|
v-if="fakeCellWidth > 0"
|
|
@@ -14,9 +14,14 @@
|
|
|
14
14
|
/>
|
|
15
15
|
</tr>
|
|
16
16
|
</router-link>
|
|
17
|
+
|
|
17
18
|
<tr
|
|
18
19
|
v-else
|
|
19
|
-
:class="{
|
|
20
|
+
:class="{
|
|
21
|
+
'is-selected': isSelected,
|
|
22
|
+
'is-hoverless': !isSelected,
|
|
23
|
+
'is-disabled': isDisabled
|
|
24
|
+
}"
|
|
20
25
|
@click.prevent="$emit('rowselect', true)"
|
|
21
26
|
>
|
|
22
27
|
<slot />
|
|
@@ -32,21 +37,25 @@ export default {
|
|
|
32
37
|
props: {
|
|
33
38
|
link: {
|
|
34
39
|
type: String,
|
|
35
|
-
default: ""
|
|
40
|
+
default: ""
|
|
36
41
|
},
|
|
37
42
|
isSelected: {
|
|
38
43
|
type: Boolean,
|
|
39
|
-
default: false
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
isDisabled: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
40
49
|
},
|
|
41
50
|
fakeCellWidth: {
|
|
42
51
|
type: Number,
|
|
43
|
-
default: 0
|
|
44
|
-
}
|
|
52
|
+
default: 0
|
|
53
|
+
}
|
|
45
54
|
},
|
|
46
55
|
|
|
47
56
|
components: {
|
|
48
57
|
TableCell: () => import("./TableCell.vue"),
|
|
49
|
-
FakeTableCell: () => import("./FakeTableCell.vue")
|
|
50
|
-
}
|
|
58
|
+
FakeTableCell: () => import("./FakeTableCell.vue")
|
|
59
|
+
}
|
|
51
60
|
};
|
|
52
61
|
</script>
|