@appscode/design-system 0.0.21-alpha.2 → 0.4.27
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 +7 -0
- package/base/utilities/_customize-bulma.scss +191 -0
- package/base/utilities/_default.scss +319 -110
- package/base/utilities/_derived-variables.scss +8 -15
- package/base/utilities/_grid.scss +29 -0
- package/base/utilities/_initial-variables.scss +111 -72
- package/base/utilities/_mixin.scss +90 -10
- package/base/utilities/_typography.scss +29 -19
- package/base/utilities/dark-theme.scss +26 -0
- package/components/_ac-accordion.scss +15 -5
- package/components/_ac-alert-box.scss +109 -26
- package/components/_ac-card.scss +71 -24
- package/components/_ac-code-highlight.scss +7 -1
- package/components/_ac-content-layout.scss +5 -5
- package/components/_ac-drag.scss +8 -6
- package/components/_ac-input.scss +196 -38
- package/components/_ac-modal.scss +6 -5
- package/components/_ac-multi-select.scss +281 -23
- package/components/_ac-options.scss +31 -16
- package/components/_ac-report.scss +53 -0
- package/components/_ac-select-box.scss +15 -5
- package/components/_ac-table.scss +160 -39
- package/components/_ac-tabs.scss +86 -23
- package/components/_ac-tags.scss +87 -2
- package/components/_ac-terminal.scss +270 -0
- package/components/_all.scss +28 -0
- package/components/_app-drawer.scss +134 -0
- package/components/_breadcumb.scss +8 -3
- package/components/_buttons.scss +96 -62
- 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 +212 -52
- package/components/_monaco-editor.scss +1 -1
- package/components/_navbar.scss +193 -31
- package/components/_overview-info.scss +4 -4
- package/components/_overview-page.scss +1 -2
- package/components/_pagination.scss +45 -7
- package/components/_payment-card.scss +28 -12
- package/components/_preloader.scss +1 -1
- package/components/_preview-modal.scss +22 -9
- 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/_transitions.scss +261 -0
- package/components/_widget-menu.scss +9 -9
- package/components/_wizard.scss +33 -20
- package/components/ac-toaster/_ac-toasted.scss +40 -8
- package/components/bbum/_all.scss +9 -0
- package/components/bbum/_card-team.scss +18 -10
- package/components/bbum/_information-center.scss +19 -5
- 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 +10 -10
- package/components/bbum/_user-profile.scss +97 -90
- package/components/ui-builder/_ui-builder.scss +98 -21
- package/components/ui-builder/_vue-open-api.scss +104 -0
- package/layouts/_404.scss +159 -0
- package/layouts/_all.scss +2 -0
- package/layouts/_code-preview.scss +19 -8
- package/main.scss +6 -53
- package/package.json +4 -7
- package/plugins/caching.ts +243 -0
- package/plugins/theme.js +142 -0
- package/plugins/time-convert.js +49 -0
- package/plugins/vue-toaster.js +10 -6
- 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 +10 -1
- package/vue-components/v2/button/DownloadBtn.vue +45 -0
- package/vue-components/v2/card/Card.vue +1 -0
- package/vue-components/v2/card/CardContent.vue +5 -0
- package/vue-components/v2/card/CardHeader.vue +12 -0
- package/vue-components/v2/card/OverviewCard.vue +10 -0
- package/vue-components/v2/card/OverviewCards.vue +5 -0
- package/vue-components/v2/card/PaymentCard.vue +69 -0
- package/vue-components/v2/card/PaymentCardOptionButtons.vue +35 -0
- package/vue-components/v2/card/PaymentCards.vue +44 -0
- package/vue-components/v2/content/ContentHeader.vue +9 -5
- package/vue-components/v2/content/ContentTable.vue +12 -7
- package/vue-components/v2/editor/Editor.vue +38 -5
- package/vue-components/v2/editor/FilteredFileEditor.vue +189 -0
- package/vue-components/v2/editor/MonacoEditor.vue +125 -0
- package/vue-components/v2/editor/ResourceKeyValueEditor.vue +209 -0
- package/vue-components/v2/form/Form.vue +12 -7
- package/vue-components/v2/form-fields/Input.vue +1 -1
- package/vue-components/v2/header/Header.vue +0 -1
- package/vue-components/v2/loaders/ResourceLoader.vue +101 -0
- package/vue-components/v2/loaders/SidebarLoader.vue +43 -0
- package/vue-components/v2/modal/Modal.vue +40 -7
- package/vue-components/v2/modals/DeleteConfirmationModal.vue +79 -0
- package/vue-components/v2/modals/JsonShowModal.vue +12 -3
- 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 +229 -17
- package/vue-components/v2/notification/Notification.vue +101 -0
- package/vue-components/v2/notification/NotificationItem.vue +44 -0
- package/vue-components/v2/pagination/Pagination.vue +24 -4
- 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 +24 -2
- package/vue-components/v2/sidebar/SidebarItemWithDropDown.vue +19 -20
- package/vue-components/v2/tab/TabItem.vue +1 -1
- package/vue-components/v2/table/FakeTableCell.vue +36 -0
- package/vue-components/v2/table/InfoTable.vue +13 -3
- package/vue-components/v2/table/NarrowTable.vue +0 -2
- package/vue-components/v2/table/Table.vue +170 -10
- package/vue-components/v2/table/TableRow.vue +29 -2
- package/vue-components/v2/table/table-cell/CellValue.vue +33 -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 +78 -0
- package/vue-components/v3/content/ContentHeader.vue +55 -0
- package/vue-components/v3/content/ContentTable.vue +83 -0
- package/vue-components/v3/dropdown/DropdownDivider.vue +3 -0
- package/vue-components/v3/dropdown/DropdownItem.vue +5 -0
- package/vue-components/v3/dropdown/DropdownMenu.vue +111 -0
- package/vue-components/v3/editor/Editor.vue +160 -0
- package/vue-components/v3/editor/FilteredFileEditor.vue +186 -0
- package/vue-components/v3/editor/MonacoEditor.vue +131 -0
- package/vue-components/v3/editor/ResourceKeyValueEditor.vue +125 -0
- package/vue-components/v3/form/Form.vue +63 -0
- package/vue-components/v3/form-fields/Input.vue +22 -0
- package/vue-components/v3/header/Header.vue +45 -0
- package/vue-components/v3/header/HeaderItem.vue +5 -0
- package/vue-components/v3/header/HeaderItems.vue +5 -0
- package/vue-components/v3/loaders/ResourceLoader.vue +83 -0
- package/vue-components/v3/loaders/SidebarLoader.vue +34 -0
- package/vue-components/v3/long-running-tasks/LongRunningTaskItem.vue +92 -0
- package/vue-components/v3/modal/Modal.vue +158 -0
- package/vue-components/v3/modals/DeleteConfirmationModal.vue +85 -0
- package/vue-components/v3/modals/JsonShowModal.vue +96 -0
- package/vue-components/v3/modals/LongRunningTasksModal.vue +373 -0
- package/vue-components/v3/navbar/Appdrawer.vue +63 -0
- package/vue-components/v3/navbar/ThemeMode.vue +120 -0
- package/vue-components/v3/navbar/User.vue +288 -0
- package/vue-components/v3/notification/Notification.vue +98 -0
- package/vue-components/v3/notification/NotificationItem.vue +52 -0
- package/vue-components/v3/pagination/Pagination.vue +172 -0
- package/vue-components/v3/searchbars/SearchBar.vue +47 -0
- package/vue-components/v3/sidebar/ClusterSwitcher.vue +133 -0
- package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +120 -0
- package/vue-components/v3/tab/TabItem.vue +17 -0
- package/vue-components/v3/table/FakeTableCell.vue +39 -0
- package/vue-components/v3/table/InfoTable.vue +105 -0
- package/vue-components/v3/table/MultiInfoTable.vue +143 -0
- package/vue-components/v3/table/Table.vue +272 -0
- package/vue-components/v3/table/TableCell.vue +28 -0
- package/vue-components/v3/table/TableContainer.vue +34 -0
- package/vue-components/v3/table/TableRow.vue +147 -0
- package/vue-components/v3/table/table-cell/ArrayCell.vue +111 -0
- package/vue-components/v3/table/table-cell/CellValue.vue +133 -0
- package/vue-components/v3/table/table-cell/GenericCell.vue +75 -0
- package/vue-components/v3/table/table-cell/ObjectCell.vue +110 -0
- package/vue-components/v3/table/table-cell/ValueWithModal.vue +43 -0
- package/vue-components/v3/tabs/EditorTabs.vue +36 -0
- package/vue-components/v3/tag/Tag.vue +17 -0
- package/vue-components/v3/terminal/LongRunningTaskTerminal.vue +148 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="level inner-table-pagination" v-show="showPagination">
|
|
3
|
+
<div class="pagination-filter level-left">
|
|
4
|
+
<div
|
|
5
|
+
class="level-item"
|
|
6
|
+
v-show="
|
|
7
|
+
!hideRowsPerPageSelection &&
|
|
8
|
+
totalNoOfItems > preSelectedItemsCountPerPage
|
|
9
|
+
"
|
|
10
|
+
>
|
|
11
|
+
<label>Rows per page</label>
|
|
12
|
+
<select
|
|
13
|
+
v-model="selectedItemCountPerPage"
|
|
14
|
+
name="page"
|
|
15
|
+
data-testid="rows-per-page-selector"
|
|
16
|
+
>
|
|
17
|
+
<option :value="5">5</option>
|
|
18
|
+
<option :value="10" v-show="totalNoOfItems > 5">10</option>
|
|
19
|
+
<option :value="15" v-show="totalNoOfItems > 10">15</option>
|
|
20
|
+
<option :value="20" v-show="totalNoOfItems > 15">20</option>
|
|
21
|
+
<option :value="25" v-show="totalNoOfItems > 20">25</option>
|
|
22
|
+
<option :value="50" v-show="totalNoOfItems > 25">50</option>
|
|
23
|
+
</select>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<nav class="pagination-item level-right">
|
|
28
|
+
<p class="counting-page">
|
|
29
|
+
Showing
|
|
30
|
+
<span>{{ itemsRange.start + 1 }}</span
|
|
31
|
+
>to <span>{{ itemsRange.end }}</span
|
|
32
|
+
>of <span>{{ totalNoOfItems }}</span
|
|
33
|
+
>{{ totalNoOfItems > 1 ? "Items" : "Item" }}
|
|
34
|
+
</p>
|
|
35
|
+
|
|
36
|
+
<ul v-if="totalNoOfItems > selectedItemCountPerPage">
|
|
37
|
+
<li>
|
|
38
|
+
<a
|
|
39
|
+
class="previous"
|
|
40
|
+
@click.prevent="prevPage()"
|
|
41
|
+
data-testid="pagination-previous-page-button"
|
|
42
|
+
>
|
|
43
|
+
<i class="fa fa-angle-left" aria-hidden="true"></i>
|
|
44
|
+
</a>
|
|
45
|
+
</li>
|
|
46
|
+
<li v-for="page in pages" :key="`page-${page}`">
|
|
47
|
+
<a
|
|
48
|
+
@click.prevent="changePage(page)"
|
|
49
|
+
data-testid="pagination-page-switch-button"
|
|
50
|
+
:class="{ 'is-current': activePageNo === page }"
|
|
51
|
+
>{{ page }}</a
|
|
52
|
+
>
|
|
53
|
+
</li>
|
|
54
|
+
<li>
|
|
55
|
+
<a
|
|
56
|
+
class="next"
|
|
57
|
+
@click.prevent="nextPage()"
|
|
58
|
+
data-testid="pagination-next-page-button"
|
|
59
|
+
>
|
|
60
|
+
<i class="fa fa-angle-right" aria-hidden="true"></i>
|
|
61
|
+
</a>
|
|
62
|
+
</li>
|
|
63
|
+
</ul>
|
|
64
|
+
</nav>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script>
|
|
69
|
+
import { defineComponent } from "vue";
|
|
70
|
+
|
|
71
|
+
export default defineComponent({
|
|
72
|
+
props: {
|
|
73
|
+
hideRowsPerPageSelection: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false,
|
|
76
|
+
},
|
|
77
|
+
totalNoOfItems: {
|
|
78
|
+
type: Number,
|
|
79
|
+
default: 0,
|
|
80
|
+
},
|
|
81
|
+
preSelectedItemsCountPerPage: {
|
|
82
|
+
type: Number,
|
|
83
|
+
default: 5,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
emits: ["pagination:pagechange"],
|
|
87
|
+
|
|
88
|
+
data() {
|
|
89
|
+
return {
|
|
90
|
+
activePageNo: 1,
|
|
91
|
+
selectedItemCountPerPage: 5,
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
computed: {
|
|
96
|
+
noOfPages() {
|
|
97
|
+
return Math.ceil(this.totalNoOfItems / this.selectedItemCountPerPage);
|
|
98
|
+
},
|
|
99
|
+
noOfPageNos() {
|
|
100
|
+
return Math.min(this.noOfPages, 5);
|
|
101
|
+
},
|
|
102
|
+
pageRange() {
|
|
103
|
+
let o = { start: 1, end: 0 };
|
|
104
|
+
if (this.noOfPageNos < 5) {
|
|
105
|
+
o.start = 1;
|
|
106
|
+
o.end = this.noOfPageNos;
|
|
107
|
+
} else {
|
|
108
|
+
if (this.activePageNo < 3) {
|
|
109
|
+
o.start = 1;
|
|
110
|
+
o.end = 5;
|
|
111
|
+
} else if (this.activePageNo > this.noOfPages - 2) {
|
|
112
|
+
o.start = this.noOfPages - 4;
|
|
113
|
+
o.end = this.noOfPages;
|
|
114
|
+
} else {
|
|
115
|
+
o.start = this.activePageNo - 2;
|
|
116
|
+
o.end = this.activePageNo + 2;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return o;
|
|
120
|
+
},
|
|
121
|
+
pages() {
|
|
122
|
+
let ar = [];
|
|
123
|
+
let start = this.pageRange.start;
|
|
124
|
+
let end = this.pageRange.end;
|
|
125
|
+
for (let i = start; i <= end; i++) {
|
|
126
|
+
ar.push(i);
|
|
127
|
+
}
|
|
128
|
+
return ar;
|
|
129
|
+
},
|
|
130
|
+
itemsRange() {
|
|
131
|
+
let start = (this.activePageNo - 1) * this.selectedItemCountPerPage;
|
|
132
|
+
let end = Math.min(
|
|
133
|
+
this.activePageNo * this.selectedItemCountPerPage,
|
|
134
|
+
this.totalNoOfItems
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
return { start, end };
|
|
138
|
+
},
|
|
139
|
+
showPagination() {
|
|
140
|
+
return this.itemsRange.end > this.itemsRange.start;
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
created() {
|
|
145
|
+
this.selectedItemCountPerPage = this.preSelectedItemsCountPerPage;
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
methods: {
|
|
149
|
+
prevPage() {
|
|
150
|
+
this.activePageNo = Math.max(this.activePageNo - 1, 1);
|
|
151
|
+
},
|
|
152
|
+
changePage(page) {
|
|
153
|
+
this.activePageNo = page;
|
|
154
|
+
},
|
|
155
|
+
nextPage() {
|
|
156
|
+
this.activePageNo = Math.min(this.activePageNo + 1, this.noOfPages);
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
watch: {
|
|
161
|
+
itemsRange: {
|
|
162
|
+
deep: true,
|
|
163
|
+
handler(n) {
|
|
164
|
+
this.$emit("pagination:pagechange", n);
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
selectedItemCountPerPage() {
|
|
168
|
+
this.activePageNo = 1;
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
</script>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ac-single-input modifier-classes="is-extra-small width-200">
|
|
3
|
+
<template #button>
|
|
4
|
+
<button class="ac-search-button">
|
|
5
|
+
<i class="fa fa-search" aria-hidden="true"></i>
|
|
6
|
+
</button>
|
|
7
|
+
</template>
|
|
8
|
+
<ac-input
|
|
9
|
+
name="search"
|
|
10
|
+
placeholder="Search"
|
|
11
|
+
type="search"
|
|
12
|
+
class="ac-search"
|
|
13
|
+
v-model="searchText"
|
|
14
|
+
/>
|
|
15
|
+
</ac-single-input>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
20
|
+
|
|
21
|
+
export default defineComponent({
|
|
22
|
+
components: {
|
|
23
|
+
AcSingleInput: defineAsyncComponent(() =>
|
|
24
|
+
import("../../v2/form-fields/AcSingleInput.vue").then(
|
|
25
|
+
(module) => module.default
|
|
26
|
+
)
|
|
27
|
+
),
|
|
28
|
+
AcInput: defineAsyncComponent(() =>
|
|
29
|
+
import("../form-fields/Input.vue").then((module) => module.default)
|
|
30
|
+
),
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
emits: ["search"],
|
|
34
|
+
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
searchText: "",
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
watch: {
|
|
42
|
+
searchText(n) {
|
|
43
|
+
this.$emit("search", n);
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="sidebarCollapsed" class="is-cluster-logo">
|
|
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
|
+
deselect-label=""
|
|
19
|
+
select-label=""
|
|
20
|
+
selected-label=""
|
|
21
|
+
>
|
|
22
|
+
<template #singleLabel="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 #option="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
|
+
import { defineComponent, defineAsyncComponent } from 'vue'
|
|
52
|
+
export default defineComponent({
|
|
53
|
+
components: {
|
|
54
|
+
Multiselect: defineAsyncComponent(() =>
|
|
55
|
+
import('vue-multiselect').then((module) => module.default)
|
|
56
|
+
),
|
|
57
|
+
},
|
|
58
|
+
props: {
|
|
59
|
+
sidebarCollapsed: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
63
|
+
mouseHover: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false,
|
|
66
|
+
},
|
|
67
|
+
clusterOptions: {
|
|
68
|
+
type: Array,
|
|
69
|
+
default: () => [],
|
|
70
|
+
},
|
|
71
|
+
modelValue: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: '',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
emits: ['update:modelValue'],
|
|
78
|
+
|
|
79
|
+
data() {
|
|
80
|
+
return {
|
|
81
|
+
selectedCluster: null,
|
|
82
|
+
selectedClusterName: null,
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
watch: {
|
|
87
|
+
modelValue: {
|
|
88
|
+
immediate: true,
|
|
89
|
+
handler(n) {
|
|
90
|
+
this.selectedClusterName = n
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
selectedCluster: {
|
|
94
|
+
deep: true,
|
|
95
|
+
handler(n) {
|
|
96
|
+
if (this.selectedClusterName !== n.name) {
|
|
97
|
+
this.selectedClusterName = n.name
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
selectedClusterName(n) {
|
|
102
|
+
if (n !== this.selectedCluster.name) {
|
|
103
|
+
this.clusterOptions.forEach((item) => {
|
|
104
|
+
if (this.selectedClusterName === item.name) {
|
|
105
|
+
this.selectedCluster = item
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
this.$emit('update:modelValue', n)
|
|
111
|
+
},
|
|
112
|
+
clusterOptions: {
|
|
113
|
+
deep: true,
|
|
114
|
+
immediate: true,
|
|
115
|
+
async handler(list) {
|
|
116
|
+
if (list) {
|
|
117
|
+
list.forEach((item) => {
|
|
118
|
+
if (this.selectedClusterName === item.name) {
|
|
119
|
+
this.selectedCluster = item
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
methods: {
|
|
128
|
+
getProviderIcon(provider) {
|
|
129
|
+
return `https://cdn.appscode.com/images/cloud-provider-icons/${provider}.png`
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
})
|
|
133
|
+
</script>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<li :class="`is-${dropDownStatus}`">
|
|
3
|
+
<a class="ac-dropdown-button" :title="title" @click="toggleDropDownStatus">
|
|
4
|
+
<span>
|
|
5
|
+
<img :src="icon" alt="icon" />
|
|
6
|
+
</span>
|
|
7
|
+
<strong>{{ title || "-" }}</strong>
|
|
8
|
+
<span class="ac-arrow-down">
|
|
9
|
+
<i class="fa fa-angle-down" aria-hidden="true"> </i>
|
|
10
|
+
</span>
|
|
11
|
+
</a>
|
|
12
|
+
|
|
13
|
+
<ul ref="sectionItems" :style="{ maxHeight: dropDownSectionHeight }">
|
|
14
|
+
<slot />
|
|
15
|
+
</ul>
|
|
16
|
+
</li>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
import { defineComponent } from "vue";
|
|
21
|
+
|
|
22
|
+
export default defineComponent({
|
|
23
|
+
props: {
|
|
24
|
+
isDropDownOpen: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
title: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "Sidebar Item",
|
|
31
|
+
},
|
|
32
|
+
icon: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "@/assets/images/icons/basic.svg",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
emits: ["dropDownItemChange"],
|
|
39
|
+
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
dropDownStatus: "close",
|
|
43
|
+
dropDownSectionHeight: null,
|
|
44
|
+
isCompMounted: false,
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
mounted() {
|
|
49
|
+
this.isCompMounted = true;
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
// for expanding dropdown
|
|
52
|
+
if (this.isDropDownOpen) {
|
|
53
|
+
this.setDropdownMaxHeight("open");
|
|
54
|
+
} else {
|
|
55
|
+
this.setDropdownMaxHeight("close");
|
|
56
|
+
}
|
|
57
|
+
}, 700);
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
watch: {
|
|
61
|
+
title(n, o) {
|
|
62
|
+
if (n && this.isCompMounted) {
|
|
63
|
+
this.$nextTick(() => {
|
|
64
|
+
// for expanding dropdown
|
|
65
|
+
this.setDropdownMaxHeight("open");
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (o && this.isCompMounted) {
|
|
70
|
+
this.$nextTick(() => {
|
|
71
|
+
// for expanding dropdown
|
|
72
|
+
this.setDropdownMaxHeight("close");
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
isDropDownOpen: {
|
|
77
|
+
immediate: true,
|
|
78
|
+
handler(n) {
|
|
79
|
+
if (n) {
|
|
80
|
+
this.dropDownStatus = "open";
|
|
81
|
+
} else this.dropDownStatus = "close";
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
dropDownStatus: {
|
|
85
|
+
immediate: true,
|
|
86
|
+
handler(n) {
|
|
87
|
+
if (n === "open") {
|
|
88
|
+
// emit event to close other drop down items
|
|
89
|
+
this.$emit("dropDownItemChange");
|
|
90
|
+
|
|
91
|
+
this.$nextTick(() => {
|
|
92
|
+
const dropDownUl = this.$refs["sectionItems"];
|
|
93
|
+
// debugger;
|
|
94
|
+
if (dropDownUl)
|
|
95
|
+
this.dropDownSectionHeight = `${dropDownUl.scrollHeight}px`;
|
|
96
|
+
});
|
|
97
|
+
} else {
|
|
98
|
+
// emit event to close other drop down items
|
|
99
|
+
this.dropDownSectionHeight = null;
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
methods: {
|
|
106
|
+
setDropdownMaxHeight(mode) {
|
|
107
|
+
if (mode === "open") {
|
|
108
|
+
this.dropDownSectionHeight = `${this.$refs["sectionItems"].scrollHeight}px`;
|
|
109
|
+
} else {
|
|
110
|
+
this.dropDownSectionHeight = null;
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
toggleDropDownStatus() {
|
|
114
|
+
if (this.dropDownStatus === "open") {
|
|
115
|
+
this.dropDownStatus = "close";
|
|
116
|
+
} else this.dropDownStatus = "open";
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<li :class="{ 'is-active': isActive }" data-testid="tab-item">
|
|
3
|
+
<slot />
|
|
4
|
+
</li>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { defineComponent } from "vue";
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
props: {
|
|
11
|
+
isActive: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: false,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<th v-if="isHeaderCell" class="increase-width">
|
|
3
|
+
<div class="increase-innner" :style="dynamicColumnStyle" />
|
|
4
|
+
</th>
|
|
5
|
+
<table-cell v-else class="increase-width">
|
|
6
|
+
<div class="increase-innner" :style="dynamicColumnStyle" />
|
|
7
|
+
</table-cell>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
12
|
+
|
|
13
|
+
export default defineComponent({
|
|
14
|
+
props: {
|
|
15
|
+
isHeaderCell: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false,
|
|
18
|
+
},
|
|
19
|
+
fakeCellWidth: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
components: {
|
|
26
|
+
TableCell: defineAsyncComponent(() =>
|
|
27
|
+
import("./TableCell.vue").then((module) => module.default)
|
|
28
|
+
),
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
computed: {
|
|
32
|
+
dynamicColumnStyle() {
|
|
33
|
+
return {
|
|
34
|
+
right: `-${this.fakeCellWidth}px`,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<table-container>
|
|
3
|
+
<table
|
|
4
|
+
class="table ac-info-table is-fullwidth"
|
|
5
|
+
:class="{ 'pl-0 pr-0': removeContentPadding }"
|
|
6
|
+
>
|
|
7
|
+
<tbody v-if="isFullTableLoaderActive">
|
|
8
|
+
<table-row v-for="i in loaderCols" :key="i">
|
|
9
|
+
<table-cell>
|
|
10
|
+
<cell-value :is-loader-active="true" />
|
|
11
|
+
</table-cell>
|
|
12
|
+
<table-cell>
|
|
13
|
+
<cell-value :is-loader-active="true" />
|
|
14
|
+
</table-cell>
|
|
15
|
+
</table-row>
|
|
16
|
+
</tbody>
|
|
17
|
+
<tbody
|
|
18
|
+
v-else
|
|
19
|
+
:class="{
|
|
20
|
+
'no-data-available has-text-centered p-10': isTableEmpty,
|
|
21
|
+
'pl-0 pr-0': removeContentPadding,
|
|
22
|
+
}"
|
|
23
|
+
>
|
|
24
|
+
<template v-if="!isTableEmpty">
|
|
25
|
+
<table-row
|
|
26
|
+
v-for="(tableHeader, idx) in tableHeaders"
|
|
27
|
+
:key="tableHeader"
|
|
28
|
+
>
|
|
29
|
+
<table-cell>
|
|
30
|
+
<slot :name="`table-cell-icon-${idx}`" />
|
|
31
|
+
{{ tableHeader }}
|
|
32
|
+
</table-cell>
|
|
33
|
+
<table-cell v-if="isLoaderActive">
|
|
34
|
+
<cell-value :is-loader-active="true" />
|
|
35
|
+
</table-cell>
|
|
36
|
+
<table-cell v-else>
|
|
37
|
+
<slot :name="`slot-${idx}`" />
|
|
38
|
+
</table-cell>
|
|
39
|
+
</table-row>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<empty-table-info v-else />
|
|
43
|
+
</tbody>
|
|
44
|
+
</table>
|
|
45
|
+
</table-container>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
50
|
+
|
|
51
|
+
export default defineComponent({
|
|
52
|
+
props: {
|
|
53
|
+
isLoaderActive: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
isTableEmpty: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: true,
|
|
60
|
+
},
|
|
61
|
+
tableHeaders: {
|
|
62
|
+
type: Array,
|
|
63
|
+
default: () => [],
|
|
64
|
+
},
|
|
65
|
+
removeContentPadding: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
components: {
|
|
72
|
+
TableContainer: defineAsyncComponent(() =>
|
|
73
|
+
import("../../v2/table/TableContainer.vue").then(
|
|
74
|
+
(module) => module.default
|
|
75
|
+
)
|
|
76
|
+
),
|
|
77
|
+
EmptyTableInfo: defineAsyncComponent(() =>
|
|
78
|
+
import("../../v2/table/EmptyTableInfo.vue").then(
|
|
79
|
+
(module) => module.default
|
|
80
|
+
)
|
|
81
|
+
),
|
|
82
|
+
TableRow: defineAsyncComponent(() =>
|
|
83
|
+
import("./TableRow.vue").then((module) => module.default)
|
|
84
|
+
),
|
|
85
|
+
TableCell: defineAsyncComponent(() =>
|
|
86
|
+
import("./TableCell.vue").then((module) => module.default)
|
|
87
|
+
),
|
|
88
|
+
CellValue: defineAsyncComponent(() =>
|
|
89
|
+
import("./table-cell/CellValue.vue").then((module) => module.default)
|
|
90
|
+
),
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
data() {
|
|
94
|
+
return {
|
|
95
|
+
loaderCols: 5,
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
computed: {
|
|
100
|
+
isFullTableLoaderActive() {
|
|
101
|
+
return !this.tableHeaders.length;
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
</script>
|