@appscode/design-system 1.0.43-alpha.16 → 1.0.43-alpha.162
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 +269 -4
- package/base/utilities/_derived-variables.scss +0 -1
- package/base/utilities/_initial-variables.scss +17 -176
- package/base/utilities/_mixin.scss +1 -17
- package/base/utilities/_typography.scss +14 -4
- package/base/utilities/dark-theme.scss +25 -0
- package/components/_ac-alert-box.scss +13 -5
- package/components/_ac-card.scss +44 -8
- package/components/_ac-code-highlight.scss +5 -1
- package/components/_ac-content-layout.scss +2 -2
- package/components/_ac-input.scss +63 -23
- package/components/_ac-multi-select.scss +187 -5
- package/components/_ac-options.scss +24 -9
- package/components/_ac-select-box.scss +14 -4
- package/components/_ac-table.scss +5 -3
- package/components/_ac-tabs.scss +39 -3
- package/components/_ac-terminal.scss +270 -0
- package/components/_app-drawer.scss +2 -2
- package/components/_breadcumb.scss +2 -0
- package/components/_buttons.scss +39 -7
- package/components/_card-body-wrapper.scss +2 -2
- package/components/_dashboard-header.scss +32 -0
- 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 +5 -3
- package/components/_left-sidebar-menu.scss +193 -39
- package/components/_monaco-editor.scss +1 -1
- package/components/_navbar.scss +108 -7
- package/components/_overview-info.scss +4 -4
- package/components/_pagination.scss +8 -0
- package/components/_payment-card.scss +10 -1
- package/components/_preview-modal.scss +15 -4
- package/components/_pricing-table.scss +1 -1
- package/components/_progress-bar.scss +4 -4
- package/components/_subscription-card.scss +12 -5
- package/components/_table-of-content.scss +1 -1
- package/components/_tfa.scss +69 -0
- package/components/_transitions.scss +261 -0
- package/components/_wizard.scss +15 -3
- package/components/ac-toaster/_ac-toasted.scss +1 -1
- package/components/bbum/_card-team.scss +15 -7
- package/components/bbum/_information-center.scss +15 -1
- package/components/bbum/_mobile-desktop.scss +1 -1
- package/components/bbum/_sign-up-notification.scss +3 -3
- package/components/bbum/_single-post-preview.scss +1 -1
- package/components/bbum/_user-profile.scss +97 -90
- package/components/ui-builder/_ui-builder.scss +19 -2
- package/components/ui-builder/_vue-open-api.scss +104 -0
- package/main.scss +4 -0
- package/package.json +2 -7
- package/plugins/theme.js +4 -0
- package/plugins/vue-toaster.js +3 -0
- 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 +36 -5
- package/vue-components/v2/editor/FilteredFileEditor.vue +188 -0
- package/vue-components/v2/editor/MonacoEditor.vue +125 -0
- package/vue-components/v2/editor/ResourceKeyValueEditor.vue +209 -0
- 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 +38 -13
- 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 +202 -19
- 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 +44 -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/content/ContentTable.vue +5 -0
- package/vue-components/v3/editor/Editor.vue +50 -30
- package/vue-components/v3/editor/FilteredFileEditor.vue +166 -0
- package/vue-components/v3/editor/MonacoEditor.vue +131 -0
- package/vue-components/v3/editor/ResourceKeyValueEditor.vue +124 -0
- package/vue-components/v3/form/Form.vue +63 -0
- package/vue-components/v3/form-fields/Input.vue +10 -10
- 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/modal/Modal.vue +39 -16
- package/vue-components/v3/modals/DeleteConfirmationModal.vue +83 -0
- package/vue-components/v3/modals/JsonShowModal.vue +25 -16
- package/vue-components/v3/navbar/Appdrawer.vue +12 -7
- package/vue-components/v3/navbar/ThemeMode.vue +123 -0
- package/vue-components/v3/navbar/User.vue +176 -16
- package/vue-components/v3/sidebar/ClusterSwitcher.vue +133 -0
- package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +120 -0
- package/vue-components/v3/table/MultiInfoTable.vue +143 -0
- package/vue-components/v3/table/Table.vue +34 -11
- package/vue-components/v3/table/TableContainer.vue +34 -0
- 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,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,143 @@
|
|
|
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="headerLabels[idx]"
|
|
28
|
+
>
|
|
29
|
+
<table-cell>
|
|
30
|
+
<slot :name="`table-cell-icon-${idx}`" />
|
|
31
|
+
{{ headerLabels[idx] }}
|
|
32
|
+
</table-cell>
|
|
33
|
+
<table-cell v-if="isLoaderActive">
|
|
34
|
+
<cell-value :is-loader-active="true" />
|
|
35
|
+
</table-cell>
|
|
36
|
+
<slot v-else :name="`slot-${idx}`" />
|
|
37
|
+
</table-row>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<empty-table-info v-else />
|
|
41
|
+
</tbody>
|
|
42
|
+
</table>
|
|
43
|
+
|
|
44
|
+
<!-- pagination start -->
|
|
45
|
+
<slot name="table-pagination" />
|
|
46
|
+
<!-- pagination end -->
|
|
47
|
+
</table-container>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
52
|
+
|
|
53
|
+
export default defineComponent({
|
|
54
|
+
props: {
|
|
55
|
+
isLoaderActive: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false,
|
|
58
|
+
},
|
|
59
|
+
isTableEmpty: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: true,
|
|
62
|
+
},
|
|
63
|
+
tableHeaders: {
|
|
64
|
+
type: Array,
|
|
65
|
+
default: () => [],
|
|
66
|
+
},
|
|
67
|
+
removeContentPadding: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
components: {
|
|
74
|
+
TableContainer: defineAsyncComponent(() =>
|
|
75
|
+
import("../../v2/table/TableContainer.vue").then(
|
|
76
|
+
(module) => module.default
|
|
77
|
+
)
|
|
78
|
+
),
|
|
79
|
+
EmptyTableInfo: defineAsyncComponent(() =>
|
|
80
|
+
import("../../v2/table/EmptyTableInfo.vue").then(
|
|
81
|
+
(module) => module.default
|
|
82
|
+
)
|
|
83
|
+
),
|
|
84
|
+
TableRow: defineAsyncComponent(() =>
|
|
85
|
+
import("./TableRow.vue").then((module) => module.default)
|
|
86
|
+
),
|
|
87
|
+
TableCell: defineAsyncComponent(() =>
|
|
88
|
+
import("./TableCell.vue").then((module) => module.default)
|
|
89
|
+
),
|
|
90
|
+
CellValue: defineAsyncComponent(() =>
|
|
91
|
+
import("./table-cell/CellValue.vue").then((module) => module.default)
|
|
92
|
+
),
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
data() {
|
|
96
|
+
return {
|
|
97
|
+
loaderCols: 5,
|
|
98
|
+
headerSortables: [],
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
computed: {
|
|
103
|
+
isFullTableLoaderActive() {
|
|
104
|
+
return !this.tableHeaders.length;
|
|
105
|
+
},
|
|
106
|
+
headerLabels() {
|
|
107
|
+
return this.tableHeaders.map((th) =>
|
|
108
|
+
typeof th === "string" ? th : th?.name || "Label"
|
|
109
|
+
);
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
watch: {
|
|
114
|
+
tableHeaders: {
|
|
115
|
+
immediate: true,
|
|
116
|
+
handler(n) {
|
|
117
|
+
if (this.headerSortables.length === n.length) {
|
|
118
|
+
n.forEach((th, idx) => {
|
|
119
|
+
if (this.headerSortables[idx].enabled !== !!th?.sort?.enable) {
|
|
120
|
+
this.headerSortables[idx].enabled = !!th?.sort?.enable;
|
|
121
|
+
this.headerSortables[idx].mode = "";
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
} else {
|
|
125
|
+
this.headerSortables = n.map((th) => {
|
|
126
|
+
if (typeof th === "string") {
|
|
127
|
+
return {
|
|
128
|
+
enabled: false,
|
|
129
|
+
mode: "",
|
|
130
|
+
};
|
|
131
|
+
} else {
|
|
132
|
+
return {
|
|
133
|
+
enabled: !!th?.sort?.enable,
|
|
134
|
+
mode: "",
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<table-container>
|
|
2
|
+
<table-container ref="ac-table-container" @scroller="handleScroller">
|
|
3
3
|
<table
|
|
4
4
|
ref="ac-table"
|
|
5
5
|
class="table ac-table ac-striped"
|
|
@@ -25,10 +25,33 @@
|
|
|
25
25
|
sorting: headerSortables[idx].enabled,
|
|
26
26
|
'sorting-desc': headerSortables[idx].mode === 'desc',
|
|
27
27
|
'sorting-asc': headerSortables[idx].mode === 'asc',
|
|
28
|
+
'has-text-centered':
|
|
29
|
+
typeof tableHeader === 'string'
|
|
30
|
+
? false
|
|
31
|
+
: tableHeader.textAlign === 'center',
|
|
32
|
+
'has-text-left':
|
|
33
|
+
typeof tableHeader === 'string'
|
|
34
|
+
? false
|
|
35
|
+
: tableHeader.textAlign === 'left',
|
|
36
|
+
'has-text-right':
|
|
37
|
+
typeof tableHeader === 'string'
|
|
38
|
+
? false
|
|
39
|
+
: tableHeader.textAlign === 'right',
|
|
28
40
|
}"
|
|
29
41
|
@click.prevent="headerSortables[idx].enabled && emitSortEvent(idx)"
|
|
30
42
|
>
|
|
31
43
|
{{ headerLabels[idx] }}
|
|
44
|
+
<span
|
|
45
|
+
v-if="
|
|
46
|
+
tableHeader.dashboard &&
|
|
47
|
+
tableHeader.dashboard.status &&
|
|
48
|
+
tableHeader.dashboard.status !== 'Success'
|
|
49
|
+
"
|
|
50
|
+
:title="tableHeader.dashboard && tableHeader.dashboard.message"
|
|
51
|
+
class="icon has-text-danger"
|
|
52
|
+
>
|
|
53
|
+
<i class="fa fa-exclamation-triangle" />
|
|
54
|
+
</span>
|
|
32
55
|
</th>
|
|
33
56
|
<th
|
|
34
57
|
ref="action-section"
|
|
@@ -117,12 +140,10 @@ export default defineComponent({
|
|
|
117
140
|
default: 1920,
|
|
118
141
|
},
|
|
119
142
|
},
|
|
120
|
-
emits: ["sort"],
|
|
143
|
+
emits: ["sort", "scroller"],
|
|
121
144
|
components: {
|
|
122
145
|
TableContainer: defineAsyncComponent(() =>
|
|
123
|
-
import("
|
|
124
|
-
(module) => module.default
|
|
125
|
-
)
|
|
146
|
+
import("./TableContainer.vue").then((module) => module.default)
|
|
126
147
|
),
|
|
127
148
|
TableRow: defineAsyncComponent(() =>
|
|
128
149
|
import("./TableRow.vue").then((module) => module.default)
|
|
@@ -165,7 +186,7 @@ export default defineComponent({
|
|
|
165
186
|
},
|
|
166
187
|
headerLabels() {
|
|
167
188
|
return this.tableHeaders.map((th) =>
|
|
168
|
-
typeof th === "string" ? th : th?.
|
|
189
|
+
typeof th === "string" ? th : th?.name || "Label"
|
|
169
190
|
);
|
|
170
191
|
},
|
|
171
192
|
},
|
|
@@ -176,8 +197,8 @@ export default defineComponent({
|
|
|
176
197
|
handler(n) {
|
|
177
198
|
if (this.headerSortables.length === n.length) {
|
|
178
199
|
n.forEach((th, idx) => {
|
|
179
|
-
if (this.headerSortables[idx].enabled !== !!th?.
|
|
180
|
-
this.headerSortables[idx].enabled = !!th?.
|
|
200
|
+
if (this.headerSortables[idx].enabled !== !!th?.sort?.enable) {
|
|
201
|
+
this.headerSortables[idx].enabled = !!th?.sort?.enable;
|
|
181
202
|
this.headerSortables[idx].mode = "";
|
|
182
203
|
}
|
|
183
204
|
});
|
|
@@ -190,7 +211,7 @@ export default defineComponent({
|
|
|
190
211
|
};
|
|
191
212
|
} else {
|
|
192
213
|
return {
|
|
193
|
-
enabled: !!th?.
|
|
214
|
+
enabled: !!th?.sort?.enable,
|
|
194
215
|
mode: "",
|
|
195
216
|
};
|
|
196
217
|
}
|
|
@@ -199,7 +220,6 @@ export default defineComponent({
|
|
|
199
220
|
},
|
|
200
221
|
},
|
|
201
222
|
},
|
|
202
|
-
|
|
203
223
|
updated() {
|
|
204
224
|
this.$nextTick(() => {
|
|
205
225
|
this.onWindowResize();
|
|
@@ -207,6 +227,9 @@ export default defineComponent({
|
|
|
207
227
|
},
|
|
208
228
|
|
|
209
229
|
methods: {
|
|
230
|
+
handleScroller(value) {
|
|
231
|
+
this.$emit("scroller", value);
|
|
232
|
+
},
|
|
210
233
|
onWindowResize() {
|
|
211
234
|
if (this.$refs["ac-table"] && this.isDynamicWidthTable) {
|
|
212
235
|
const tableWidth = this.$refs["ac-table"].clientWidth;
|
|
@@ -217,7 +240,7 @@ export default defineComponent({
|
|
|
217
240
|
emitSortEvent(index) {
|
|
218
241
|
const emitValue = {
|
|
219
242
|
index,
|
|
220
|
-
label: this.tableHeaders[index].
|
|
243
|
+
label: this.tableHeaders[index].name,
|
|
221
244
|
mode: "",
|
|
222
245
|
};
|
|
223
246
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ac-table-container table-container" ref="tableContainer">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { emit } from 'process'
|
|
9
|
+
import { defineComponent, ref, onMounted, nextTick } from 'vue'
|
|
10
|
+
|
|
11
|
+
export default defineComponent({
|
|
12
|
+
emits: ['scroller'],
|
|
13
|
+
|
|
14
|
+
setup(props, { emit }) {
|
|
15
|
+
const tableContainer = ref(null)
|
|
16
|
+
|
|
17
|
+
function isScrollerShowing() {
|
|
18
|
+
return tableContainer.value.scrollWidth > tableContainer.value.clientWidth
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
onMounted(() => {
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
nextTick(() => {
|
|
24
|
+
emit('scroller', isScrollerShowing())
|
|
25
|
+
})
|
|
26
|
+
}, 50)
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
tableContainer,
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
</script>
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
:view-box="`0 0 ${computedCellWidth || 300} 10`"
|
|
5
5
|
:speed="2"
|
|
6
6
|
:key="computedCellWidth"
|
|
7
|
+
:primaryColor="primaryColor"
|
|
8
|
+
:secondaryColor="secondaryColor"
|
|
7
9
|
/>
|
|
8
10
|
</div>
|
|
9
|
-
<div v-else
|
|
11
|
+
<div v-else ref="cellDiv">
|
|
10
12
|
<object-cell
|
|
11
13
|
v-if="valueType === 'object'"
|
|
12
14
|
:obj="value"
|
|
@@ -20,7 +22,7 @@
|
|
|
20
22
|
:max-character-length="maxCharacterLength"
|
|
21
23
|
/>
|
|
22
24
|
<template v-else>
|
|
23
|
-
<span class="is-ellipsis-1" :title="
|
|
25
|
+
<span class="is-ellipsis-1" :title="tooltip">{{
|
|
24
26
|
value || (value === 0 ? 0 : "-")
|
|
25
27
|
}}</span>
|
|
26
28
|
</template>
|
|
@@ -29,6 +31,12 @@
|
|
|
29
31
|
|
|
30
32
|
<script>
|
|
31
33
|
import { defineComponent, defineAsyncComponent } from "vue";
|
|
34
|
+
import {
|
|
35
|
+
loaderLightThemePrimaryColor,
|
|
36
|
+
loaderDarkThemePrimaryColor,
|
|
37
|
+
loaderLightThemeSecondaryColor,
|
|
38
|
+
loaderDarkThemeSecondaryColor,
|
|
39
|
+
} from "@appscode/design-system/plugins/theme";
|
|
32
40
|
|
|
33
41
|
export default defineComponent({
|
|
34
42
|
props: {
|
|
@@ -44,6 +52,10 @@ export default defineComponent({
|
|
|
44
52
|
type: null,
|
|
45
53
|
default: "",
|
|
46
54
|
},
|
|
55
|
+
tooltip: {
|
|
56
|
+
type: String,
|
|
57
|
+
defualt: "",
|
|
58
|
+
},
|
|
47
59
|
},
|
|
48
60
|
components: {
|
|
49
61
|
ContentLoader: defineAsyncComponent(() =>
|
|
@@ -60,13 +72,24 @@ export default defineComponent({
|
|
|
60
72
|
computed: {
|
|
61
73
|
valueType() {
|
|
62
74
|
if (typeof this.value === "object") {
|
|
63
|
-
if (
|
|
75
|
+
if (this.value === null) return "null";
|
|
76
|
+
else if (Array.isArray(this.value)) return "array";
|
|
64
77
|
else return "object";
|
|
65
78
|
} else return typeof this.value;
|
|
66
79
|
},
|
|
67
80
|
maxCharacterLength() {
|
|
68
81
|
return Math.ceil(this.computedCellWidth / 8);
|
|
69
82
|
},
|
|
83
|
+
primaryColor() {
|
|
84
|
+
return document.documentElement.classList.contains("is-dark-theme")
|
|
85
|
+
? loaderDarkThemePrimaryColor
|
|
86
|
+
: loaderLightThemePrimaryColor;
|
|
87
|
+
},
|
|
88
|
+
secondaryColor() {
|
|
89
|
+
return document.documentElement.classList.contains("is-dark-theme")
|
|
90
|
+
? loaderDarkThemeSecondaryColor
|
|
91
|
+
: loaderLightThemeSecondaryColor;
|
|
92
|
+
},
|
|
70
93
|
},
|
|
71
94
|
|
|
72
95
|
data() {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
:class="{
|
|
4
|
+
'is-flex': cellDescriptor.type !== 'object',
|
|
5
|
+
'is-align-items-center': cellValue.icon,
|
|
6
|
+
'is-justify-content-center': cellDescriptor.textAlign === 'center',
|
|
7
|
+
'is-justify-content-left': cellDescriptor.textAlign === 'left',
|
|
8
|
+
'is-justify-content-right': cellDescriptor.textAlign === 'right'
|
|
9
|
+
}"
|
|
10
|
+
>
|
|
11
|
+
<span v-if="cellValue.icon" class="icon p-0 mr-10">
|
|
12
|
+
<img width="15" :src="cellValue.icon" />
|
|
13
|
+
</span>
|
|
14
|
+
<router-link v-if="cellValue.link" :to="getCellLink(cellValue)">
|
|
15
|
+
{{ cellValue.data }}
|
|
16
|
+
</router-link>
|
|
17
|
+
<tag v-else-if="cellValue.color" :class="`is-${cellValue.color}`">
|
|
18
|
+
{{ cellValue.data }}
|
|
19
|
+
</tag>
|
|
20
|
+
<cell-value
|
|
21
|
+
v-else
|
|
22
|
+
:cell-title="cellDescriptor.name"
|
|
23
|
+
:value="cellValue.data || '-'"
|
|
24
|
+
:tooltip="cellValue.tooltip || JSON.stringify(cellValue.data)"
|
|
25
|
+
/>
|
|
26
|
+
</span>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
import { defineAsyncComponent, defineComponent } from "vue";
|
|
31
|
+
import { useRoute } from "vue-router";
|
|
32
|
+
|
|
33
|
+
export default defineComponent({
|
|
34
|
+
components: {
|
|
35
|
+
Tag: defineAsyncComponent(() => import("../../tag/Tag.vue")),
|
|
36
|
+
CellValue: defineAsyncComponent(() => import("../table-cell/CellValue.vue"))
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
cellDescriptor: {
|
|
40
|
+
type: Object,
|
|
41
|
+
default: () => ({})
|
|
42
|
+
},
|
|
43
|
+
cellValue: {
|
|
44
|
+
type: Object,
|
|
45
|
+
default: () => ({})
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
setup() {
|
|
49
|
+
function getCellLink(cell) {
|
|
50
|
+
const route = useRoute();
|
|
51
|
+
const inject = (str, obj) => str.replace(/\${(.*?)}/g, (x, g) => obj[g]);
|
|
52
|
+
const { user, cluster } = route.params;
|
|
53
|
+
const link = inject(cell.link || "", {
|
|
54
|
+
username: user,
|
|
55
|
+
clustername: cluster
|
|
56
|
+
});
|
|
57
|
+
return link;
|
|
58
|
+
}
|
|
59
|
+
return { getCellLink };
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
</script>
|
|
@@ -79,7 +79,10 @@ export default defineComponent({
|
|
|
79
79
|
},
|
|
80
80
|
printableStringObjs() {
|
|
81
81
|
return this.objKeys.map((key) => {
|
|
82
|
-
|
|
82
|
+
let value = this.obj[key];
|
|
83
|
+
if (typeof value === "object" && value !== null) {
|
|
84
|
+
value = JSON.stringify(value);
|
|
85
|
+
}
|
|
83
86
|
const keyValue = `${key}: ${value}`;
|
|
84
87
|
const exceededLength = keyValue.length > 30;
|
|
85
88
|
const print = exceededLength ? key : keyValue;
|
|
@@ -103,3 +106,4 @@ export default defineComponent({
|
|
|
103
106
|
},
|
|
104
107
|
});
|
|
105
108
|
</script>
|
|
109
|
+
|