@appscode/design-system 1.1.0-alpha.8 → 1.1.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/_video-player.scss +65 -0
- package/base/utilities/_all.scss +6 -5
- package/base/utilities/_colors.scss +408 -0
- package/base/utilities/_customize-bulma.scss +23 -27
- package/base/utilities/_extended.scss +9 -4
- package/base/utilities/{_default.scss → _global.scss} +185 -331
- package/base/utilities/_layouts.scss +157 -0
- package/base/utilities/_mixin.scss +11 -11
- package/base/utilities/_spacing.scss +96 -0
- package/base/utilities/_typography.scss +56 -24
- package/base/utilities/dark-theme.scss +1 -1
- package/components/_ac-accordion.scss +117 -117
- package/components/_ac-alert-box.scss +205 -263
- package/components/_ac-calendar.scss +4 -4
- package/components/_ac-card.scss +0 -597
- 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 +477 -452
- package/components/_ac-modal.scss +212 -212
- package/components/_ac-multi-select.scss +780 -751
- package/components/_ac-options.scss +122 -123
- package/components/_ac-select-box.scss +5 -5
- package/components/_ac-table.scss +503 -502
- package/components/_ac-tabs.scss +39 -38
- package/components/_ac-tags.scss +116 -116
- package/components/_ac-terminal.scss +95 -51
- package/components/_add-card.scss +3 -3
- package/components/_all.scss +29 -26
- package/components/_app-drawer.scss +0 -134
- package/components/_breadcumb.scss +0 -71
- package/components/_buttons.scss +779 -779
- package/components/_card-body-wrapper.scss +5 -5
- package/components/_dashboard-header.scss +0 -115
- package/components/_direct-deploy.scss +8 -8
- package/components/_go-to-top.scss +1 -1
- package/components/_image-upload.scss +5 -5
- package/components/_left-sidebar-menu.scss +448 -579
- package/components/_monaco-editor.scss +1 -1
- package/components/_navbar.scss +786 -752
- 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 +106 -124
- package/components/_payment-card.scss +21 -21
- 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 +247 -247
- package/components/_wizard.scss +557 -559
- package/components/ac-toaster/_ac-toasted.scss +7 -12
- 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 +515 -2
- package/layouts/_code-preview.scss +11 -11
- package/main.scss +26 -10
- package/package.json +1 -1
- package/plugins/theme.js +11 -9
- package/plugins/vue-toaster.js +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/importFlow.ts +16 -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/Card.vue +1 -1
- package/vue-components/v2/card/OverviewCards.vue +17 -2
- package/vue-components/v2/editor/FilteredFileEditor.vue +2 -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 +66 -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 +839 -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 +149 -0
- package/vue-components/v3/cards/Counter.vue +39 -0
- package/vue-components/v3/cards/FeatureCard.vue +71 -0
- package/vue-components/v3/cards/FeatureCards.vue +6 -0
- package/vue-components/v3/cards/InfoCard.vue +243 -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 +85 -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 +43 -62
- 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 +317 -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 +32 -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 +528 -0
- package/vue-components/v3/form-fields/Input.vue +19 -14
- package/vue-components/v3/header/Header.vue +119 -25
- 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/InfoCardLoader.vue +65 -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 +298 -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 +41 -44
- 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 +59 -34
- package/vue-components/v3/sidebar/AccentColorPicker.vue +97 -0
- package/vue-components/v3/sidebar/ClusterSwitcher.vue +835 -81
- package/vue-components/v3/sidebar/Sidebar.vue +267 -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/Steps.vue +152 -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 +89 -61
- package/vue-components/v3/table/MultiInfoTable.vue +72 -95
- package/vue-components/v3/table/Table.vue +589 -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/base/utilities/_derived-variables.scss +0 -25
- package/base/utilities/_initial-variables.scss +0 -215
- package/components/_basic-card.scss +0 -124
- package/mixins/stickyContent.js +0 -141
- package/plugins/caching.ts +0 -243
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
<slot />
|
|
4
|
-
</td>
|
|
5
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue";
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
interface Props {
|
|
5
|
+
cellWidth?: number | null;
|
|
6
|
+
}
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: Number,
|
|
14
|
-
default: null,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
8
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
9
|
+
cellWidth: null,
|
|
10
|
+
});
|
|
17
11
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return ob || {};
|
|
25
|
-
},
|
|
26
|
-
},
|
|
12
|
+
const styleOb = computed(() => {
|
|
13
|
+
const ob: { width?: string } = {};
|
|
14
|
+
if (props.cellWidth) {
|
|
15
|
+
ob.width = `${props.cellWidth}px`;
|
|
16
|
+
}
|
|
17
|
+
return ob || {};
|
|
27
18
|
});
|
|
28
19
|
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<td :style="styleOb">
|
|
23
|
+
<slot />
|
|
24
|
+
</td>
|
|
25
|
+
</template>
|
|
@@ -1,34 +1,56 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { nextTick, onMounted, ref } from "vue";
|
|
3
|
+
|
|
4
|
+
const tableContainer = ref<HTMLElement | null>(null);
|
|
5
|
+
|
|
6
|
+
const emit = defineEmits(["scroller"]);
|
|
7
|
+
|
|
8
|
+
const isScrollerShowing = () => {
|
|
9
|
+
if (tableContainer.value?.scrollWidth)
|
|
10
|
+
return (
|
|
11
|
+
tableContainer.value?.scrollWidth > tableContainer.value?.clientWidth
|
|
12
|
+
);
|
|
13
|
+
return false;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
onMounted(() => {
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
nextTick(() => {
|
|
19
|
+
emit("scroller", isScrollerShowing());
|
|
20
|
+
});
|
|
21
|
+
}, 50);
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
1
25
|
<template>
|
|
2
26
|
<div class="ac-table-container table-container" ref="tableContainer">
|
|
3
27
|
<slot />
|
|
4
28
|
</div>
|
|
5
29
|
</template>
|
|
6
30
|
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})
|
|
34
|
-
</script>
|
|
31
|
+
<style lang="scss">
|
|
32
|
+
.table-container {
|
|
33
|
+
&.ac-table-container {
|
|
34
|
+
&::-webkit-scrollbar {
|
|
35
|
+
height: 7px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Track */
|
|
39
|
+
&::-webkit-scrollbar-track {
|
|
40
|
+
background-color: #d1d4de;
|
|
41
|
+
border-radius: 10px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Handle */
|
|
45
|
+
&::-webkit-scrollbar-thumb {
|
|
46
|
+
background-color: $primary-95;
|
|
47
|
+
border-radius: 10px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Handle on hover */
|
|
51
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
52
|
+
background-color: $primary-95;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
@@ -1,3 +1,66 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineAsyncComponent, nextTick, ref } from "vue";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
link?: string;
|
|
6
|
+
isSelected?: boolean;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
fakeCellWidth?: number;
|
|
9
|
+
collapsible?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
withDefaults(defineProps<Props>(), {
|
|
13
|
+
link: "",
|
|
14
|
+
isSelected: false,
|
|
15
|
+
isDisabled: false,
|
|
16
|
+
fakeCellWidth: 0,
|
|
17
|
+
collapsible: false,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const emit = defineEmits(["rowselect", "rowexpand", "rowcollapse"]);
|
|
21
|
+
|
|
22
|
+
const collapsibleRow = ref(null as HTMLElement | null);
|
|
23
|
+
|
|
24
|
+
const TableCell = defineAsyncComponent(() => import("./TableCell.vue"));
|
|
25
|
+
const FakeTableCell = defineAsyncComponent(() => import("./FakeTableCell.vue"));
|
|
26
|
+
const CollapsibleButton = defineAsyncComponent(
|
|
27
|
+
() => import("../button/Button.vue")
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const isCollapsed = ref(true);
|
|
31
|
+
|
|
32
|
+
const collapseRow = () => {
|
|
33
|
+
isCollapsed.value = true;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const toggleCollapse = () => {
|
|
37
|
+
const newVal = !isCollapsed.value;
|
|
38
|
+
if (!newVal) {
|
|
39
|
+
isCollapsed.value = newVal;
|
|
40
|
+
// show expand animation
|
|
41
|
+
nextTick(() => {
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
if (collapsibleRow.value) {
|
|
44
|
+
collapsibleRow.value.classList.remove("is-closed");
|
|
45
|
+
collapsibleRow.value.classList.add("is-active");
|
|
46
|
+
}
|
|
47
|
+
emit("rowexpand", collapseRow);
|
|
48
|
+
}, 0);
|
|
49
|
+
});
|
|
50
|
+
} else {
|
|
51
|
+
if (collapsibleRow.value) {
|
|
52
|
+
collapsibleRow.value.classList.remove("is-active");
|
|
53
|
+
collapsibleRow.value.classList.add("is-closed");
|
|
54
|
+
}
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
// remove row after animation finish
|
|
57
|
+
isCollapsed.value = newVal;
|
|
58
|
+
emit("rowcollapse");
|
|
59
|
+
}, 100);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
</script>
|
|
63
|
+
|
|
1
64
|
<template>
|
|
2
65
|
<router-link
|
|
3
66
|
v-if="link"
|
|
@@ -60,88 +123,3 @@
|
|
|
60
123
|
</tr>
|
|
61
124
|
</transition>
|
|
62
125
|
</template>
|
|
63
|
-
|
|
64
|
-
<script>
|
|
65
|
-
import { defineComponent, defineAsyncComponent } from "vue";
|
|
66
|
-
|
|
67
|
-
export default defineComponent({
|
|
68
|
-
props: {
|
|
69
|
-
link: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: "",
|
|
72
|
-
},
|
|
73
|
-
isSelected: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
default: false,
|
|
76
|
-
},
|
|
77
|
-
isDisabled: {
|
|
78
|
-
type: Boolean,
|
|
79
|
-
default: false,
|
|
80
|
-
},
|
|
81
|
-
fakeCellWidth: {
|
|
82
|
-
type: Number,
|
|
83
|
-
default: 0,
|
|
84
|
-
},
|
|
85
|
-
collapsible: {
|
|
86
|
-
type: Boolean,
|
|
87
|
-
default: false,
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
emits: ["rowselect", "rowexpand", "rowcollapse"],
|
|
92
|
-
|
|
93
|
-
components: {
|
|
94
|
-
TableCell: defineAsyncComponent(() =>
|
|
95
|
-
import(
|
|
96
|
-
"@appscode/design-system/vue-components/v3/table/TableCell.vue"
|
|
97
|
-
).then((module) => module.default)
|
|
98
|
-
),
|
|
99
|
-
FakeTableCell: defineAsyncComponent(() =>
|
|
100
|
-
import(
|
|
101
|
-
"@appscode/design-system/vue-components/v3/table/FakeTableCell.vue"
|
|
102
|
-
).then((module) => module.default)
|
|
103
|
-
),
|
|
104
|
-
CollapsibleButton: defineAsyncComponent(() =>
|
|
105
|
-
import("@appscode/design-system/vue-components/v3/button/Button.vue")
|
|
106
|
-
),
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
data() {
|
|
110
|
-
return {
|
|
111
|
-
isCollapsed: true,
|
|
112
|
-
};
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
methods: {
|
|
116
|
-
toggleCollapse() {
|
|
117
|
-
const newVal = !this.isCollapsed;
|
|
118
|
-
if (!newVal) {
|
|
119
|
-
this.isCollapsed = newVal;
|
|
120
|
-
// show expand animation
|
|
121
|
-
this.$nextTick(() => {
|
|
122
|
-
setTimeout(() => {
|
|
123
|
-
if (this.$refs.collapsibleRow) {
|
|
124
|
-
this.$refs.collapsibleRow.classList.remove("is-closed");
|
|
125
|
-
this.$refs.collapsibleRow.classList.add("is-active");
|
|
126
|
-
}
|
|
127
|
-
this.$emit("rowexpand", this.collapseRow);
|
|
128
|
-
}, 0);
|
|
129
|
-
});
|
|
130
|
-
} else {
|
|
131
|
-
if (this.$refs.collapsibleRow) {
|
|
132
|
-
this.$refs.collapsibleRow.classList.remove("is-active");
|
|
133
|
-
this.$refs.collapsibleRow.classList.add("is-closed");
|
|
134
|
-
}
|
|
135
|
-
setTimeout(() => {
|
|
136
|
-
// remove row after animation finish
|
|
137
|
-
this.isCollapsed = newVal;
|
|
138
|
-
this.$emit("rowcollapse");
|
|
139
|
-
}, 100);
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
collapseRow() {
|
|
143
|
-
this.isCollapsed = true;
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
</script>
|
|
@@ -1,3 +1,70 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineAsyncComponent, ref, computed } from "vue";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
cellTitle?: string;
|
|
6
|
+
items?: Array<any>;
|
|
7
|
+
maxCharacterLength?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
11
|
+
cellTitle: "cell-title",
|
|
12
|
+
maxCharacterLength: 50,
|
|
13
|
+
items: () => [],
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const Tags = defineAsyncComponent(() => import("../../tag/Tags.vue"));
|
|
17
|
+
const Tag = defineAsyncComponent(() => import("../../tag/Tag.vue"));
|
|
18
|
+
const EllipsisIcon = defineAsyncComponent(
|
|
19
|
+
() => import("../../icons/Ellipsis.vue")
|
|
20
|
+
);
|
|
21
|
+
const JsonShowModal = defineAsyncComponent(
|
|
22
|
+
() => import("../../modals/JsonShowModal.vue")
|
|
23
|
+
);
|
|
24
|
+
const ValueWithModal = defineAsyncComponent(
|
|
25
|
+
() => import("../../table/table-cell/ValueWithModal.vue")
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const showFullData = ref(false);
|
|
29
|
+
|
|
30
|
+
const printableStringObjs = computed(() => {
|
|
31
|
+
return props.items.map((item) => {
|
|
32
|
+
const value = item as Record<string, unknown>;
|
|
33
|
+
let exceededLength = false;
|
|
34
|
+
let print: string | Record<string, unknown> = item;
|
|
35
|
+
if (typeof item === "object") {
|
|
36
|
+
exceededLength = true;
|
|
37
|
+
print =
|
|
38
|
+
(item["Name"] as string) ||
|
|
39
|
+
(item["name"] as string) ||
|
|
40
|
+
(item[Object.keys(item)[0]] as string);
|
|
41
|
+
} else {
|
|
42
|
+
const stringifiedValue = JSON.stringify(item);
|
|
43
|
+
exceededLength = stringifiedValue.length > 27;
|
|
44
|
+
print = exceededLength
|
|
45
|
+
? `${stringifiedValue.slice(0, 27)}...`
|
|
46
|
+
: stringifiedValue;
|
|
47
|
+
}
|
|
48
|
+
return { value, exceededLength, print };
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const indexOfCharacterLengthExceed = computed(() => {
|
|
53
|
+
let idx = -1;
|
|
54
|
+
let cumulativeLen = 0;
|
|
55
|
+
for (const [index, po] of printableStringObjs.value.entries()) {
|
|
56
|
+
const newLen = cumulativeLen + po.print.length;
|
|
57
|
+
if (newLen > props.maxCharacterLength) {
|
|
58
|
+
idx = index;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
cumulativeLen = newLen;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return idx === -1 ? printableStringObjs.value.length : idx;
|
|
65
|
+
});
|
|
66
|
+
</script>
|
|
67
|
+
|
|
1
68
|
<template>
|
|
2
69
|
<tags v-if="printableStringObjs.length">
|
|
3
70
|
<tag
|
|
@@ -30,82 +97,3 @@
|
|
|
30
97
|
</tags>
|
|
31
98
|
<p v-else>-</p>
|
|
32
99
|
</template>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
import { defineComponent, defineAsyncComponent } from "vue";
|
|
36
|
-
|
|
37
|
-
export default defineComponent({
|
|
38
|
-
props: {
|
|
39
|
-
cellTitle: {
|
|
40
|
-
type: String,
|
|
41
|
-
default: "Array",
|
|
42
|
-
},
|
|
43
|
-
items: {
|
|
44
|
-
type: Array,
|
|
45
|
-
default: () => [],
|
|
46
|
-
},
|
|
47
|
-
maxCharacterLength: {
|
|
48
|
-
type: Number,
|
|
49
|
-
default: undefined,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
components: {
|
|
53
|
-
Tags: defineAsyncComponent(() =>
|
|
54
|
-
import("../../../v2/tag/Tags.vue").then((module) => module.default)
|
|
55
|
-
),
|
|
56
|
-
Tag: defineAsyncComponent(() =>
|
|
57
|
-
import("../../tag/Tag.vue").then((module) => module.default)
|
|
58
|
-
),
|
|
59
|
-
EllipsisIcon: defineAsyncComponent(() =>
|
|
60
|
-
import("../../../v2/icons/Ellipsis.vue").then((module) => module.default)
|
|
61
|
-
),
|
|
62
|
-
JsonShowModal: defineAsyncComponent(() =>
|
|
63
|
-
import("../../modals/JsonShowModal.vue").then((module) => module.default)
|
|
64
|
-
),
|
|
65
|
-
ValueWithModal: defineAsyncComponent(() =>
|
|
66
|
-
import("./ValueWithModal.vue").then((module) => module.default)
|
|
67
|
-
),
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
data() {
|
|
71
|
-
return {
|
|
72
|
-
showFullData: false,
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
computed: {
|
|
77
|
-
printableStringObjs() {
|
|
78
|
-
return this.items.map((item) => {
|
|
79
|
-
const value = item;
|
|
80
|
-
let exceededLength = false;
|
|
81
|
-
let print = item;
|
|
82
|
-
if (typeof item === "object") {
|
|
83
|
-
exceededLength = true;
|
|
84
|
-
print = item["Name"] || item["name"] || item[Object.keys(item)[0]];
|
|
85
|
-
} else {
|
|
86
|
-
const stringifiedValue = JSON.stringify(item);
|
|
87
|
-
exceededLength = stringifiedValue.length > 27;
|
|
88
|
-
print = exceededLength
|
|
89
|
-
? `${stringifiedValue.slice(0, 27)}...`
|
|
90
|
-
: stringifiedValue;
|
|
91
|
-
}
|
|
92
|
-
return { value, exceededLength, print };
|
|
93
|
-
});
|
|
94
|
-
},
|
|
95
|
-
indexOfCharacterLengthExceed() {
|
|
96
|
-
let idx = -1;
|
|
97
|
-
let cumulativeLen = 0;
|
|
98
|
-
for (const [index, po] of this.printableStringObjs.entries()) {
|
|
99
|
-
const newLen = cumulativeLen + po.print.length;
|
|
100
|
-
if (newLen > this.maxCharacterLength) {
|
|
101
|
-
idx = index;
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
cumulativeLen = newLen;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return idx === -1 ? this.printableStringObjs.length : idx;
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
</script>
|
|
@@ -1,3 +1,98 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
computed,
|
|
4
|
+
defineAsyncComponent,
|
|
5
|
+
nextTick,
|
|
6
|
+
onMounted,
|
|
7
|
+
ref,
|
|
8
|
+
watch,
|
|
9
|
+
} from "vue";
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
isLoaderActive?: boolean;
|
|
13
|
+
cellTitle?: string;
|
|
14
|
+
value?: unknown;
|
|
15
|
+
tooltip?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
19
|
+
isLoaderActive: false,
|
|
20
|
+
cellTitle: "cell title",
|
|
21
|
+
tooltip: "",
|
|
22
|
+
value: () => ({}),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const ContentLoader = defineAsyncComponent(() =>
|
|
26
|
+
import("vue-content-loader").then(({ ContentLoader }) => ContentLoader)
|
|
27
|
+
);
|
|
28
|
+
const ObjectCell = defineAsyncComponent(
|
|
29
|
+
() => import("../../table/table-cell/ObjectCell.vue")
|
|
30
|
+
);
|
|
31
|
+
const ArrayCell = defineAsyncComponent(
|
|
32
|
+
() => import("../../table/table-cell/ArrayCell.vue")
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const loaderLightThemePrimaryColor = "#f5f7f9";
|
|
36
|
+
const loaderDarkThemePrimaryColor = "#2e323c";
|
|
37
|
+
const loaderLightThemeSecondaryColor = "#ecebeb";
|
|
38
|
+
const loaderDarkThemeSecondaryColor = "#21272e";
|
|
39
|
+
|
|
40
|
+
const computedCellWidth = ref(50);
|
|
41
|
+
const cellLoaderDiv = ref<HTMLElement | null>(null);
|
|
42
|
+
const cellDiv = ref<HTMLElement | null>(null);
|
|
43
|
+
|
|
44
|
+
const valueType = computed(() => {
|
|
45
|
+
if (typeof props.value === "object") {
|
|
46
|
+
if (props.value === null) return "null";
|
|
47
|
+
else if (Array.isArray(props.value)) return "array";
|
|
48
|
+
else return "object";
|
|
49
|
+
} else return typeof props.value;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const maxCharacterLength = computed(() => {
|
|
53
|
+
return Math.ceil(computedCellWidth.value / 8);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const primaryColor = computed(() => {
|
|
57
|
+
return document.documentElement.classList.contains("is-dark-theme")
|
|
58
|
+
? loaderDarkThemePrimaryColor
|
|
59
|
+
: loaderLightThemePrimaryColor;
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const secondaryColor = computed(() => {
|
|
63
|
+
return document.documentElement.classList.contains("is-dark-theme")
|
|
64
|
+
? loaderDarkThemeSecondaryColor
|
|
65
|
+
: loaderLightThemeSecondaryColor;
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const calcCellWidth = () => {
|
|
69
|
+
if (props.isLoaderActive) {
|
|
70
|
+
nextTick(() => {
|
|
71
|
+
if (cellLoaderDiv.value) {
|
|
72
|
+
computedCellWidth.value = cellLoaderDiv.value.offsetWidth;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
nextTick(() => {
|
|
77
|
+
if (cellDiv.value) {
|
|
78
|
+
computedCellWidth.value = cellDiv.value.offsetWidth;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
onMounted(() => {
|
|
85
|
+
calcCellWidth();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
watch(
|
|
89
|
+
() => props.isLoaderActive,
|
|
90
|
+
() => {
|
|
91
|
+
calcCellWidth();
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
</script>
|
|
95
|
+
|
|
1
96
|
<template>
|
|
2
97
|
<div v-if="isLoaderActive" ref="cellLoaderDiv" :style="{ maxWidth: '300px' }">
|
|
3
98
|
<content-loader
|
|
@@ -11,14 +106,14 @@
|
|
|
11
106
|
<div v-else ref="cellDiv">
|
|
12
107
|
<object-cell
|
|
13
108
|
v-if="valueType === 'object'"
|
|
14
|
-
:obj="value"
|
|
109
|
+
:obj="value as Record<string, unknown>"
|
|
15
110
|
:cell-title="cellTitle"
|
|
16
111
|
:max-character-length="maxCharacterLength"
|
|
17
112
|
data-testid="object-cell-value"
|
|
18
113
|
/>
|
|
19
114
|
<array-cell
|
|
20
115
|
v-else-if="valueType === 'array'"
|
|
21
|
-
:items="value"
|
|
116
|
+
:items="value as Array<unknown>"
|
|
22
117
|
:cell-title="cellTitle"
|
|
23
118
|
:max-character-length="maxCharacterLength"
|
|
24
119
|
data-testid="array-cell-value"
|
|
@@ -30,104 +125,3 @@
|
|
|
30
125
|
</template>
|
|
31
126
|
</div>
|
|
32
127
|
</template>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
import { defineComponent, defineAsyncComponent } from "vue";
|
|
36
|
-
import {
|
|
37
|
-
loaderLightThemePrimaryColor,
|
|
38
|
-
loaderDarkThemePrimaryColor,
|
|
39
|
-
loaderLightThemeSecondaryColor,
|
|
40
|
-
loaderDarkThemeSecondaryColor,
|
|
41
|
-
} from "@appscode/design-system/plugins/theme";
|
|
42
|
-
|
|
43
|
-
export default defineComponent({
|
|
44
|
-
props: {
|
|
45
|
-
isLoaderActive: {
|
|
46
|
-
type: Boolean,
|
|
47
|
-
default: false,
|
|
48
|
-
},
|
|
49
|
-
cellTitle: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: "Cell",
|
|
52
|
-
},
|
|
53
|
-
value: {
|
|
54
|
-
type: null,
|
|
55
|
-
default: "",
|
|
56
|
-
},
|
|
57
|
-
tooltip: {
|
|
58
|
-
type: String,
|
|
59
|
-
defualt: "",
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
components: {
|
|
63
|
-
ContentLoader: defineAsyncComponent(() =>
|
|
64
|
-
import("vue-content-loader").then(({ ContentLoader }) => ContentLoader)
|
|
65
|
-
),
|
|
66
|
-
ObjectCell: defineAsyncComponent(() =>
|
|
67
|
-
import("./ObjectCell.vue").then((module) => module.default)
|
|
68
|
-
),
|
|
69
|
-
ArrayCell: defineAsyncComponent(() =>
|
|
70
|
-
import("./ArrayCell.vue").then((module) => module.default)
|
|
71
|
-
),
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
computed: {
|
|
75
|
-
valueType() {
|
|
76
|
-
if (typeof this.value === "object") {
|
|
77
|
-
if (this.value === null) return "null";
|
|
78
|
-
else if (Array.isArray(this.value)) return "array";
|
|
79
|
-
else return "object";
|
|
80
|
-
} else return typeof this.value;
|
|
81
|
-
},
|
|
82
|
-
maxCharacterLength() {
|
|
83
|
-
return Math.ceil(this.computedCellWidth / 8);
|
|
84
|
-
},
|
|
85
|
-
primaryColor() {
|
|
86
|
-
return document.documentElement.classList.contains("is-dark-theme")
|
|
87
|
-
? loaderDarkThemePrimaryColor
|
|
88
|
-
: loaderLightThemePrimaryColor;
|
|
89
|
-
},
|
|
90
|
-
secondaryColor() {
|
|
91
|
-
return document.documentElement.classList.contains("is-dark-theme")
|
|
92
|
-
? loaderDarkThemeSecondaryColor
|
|
93
|
-
: loaderLightThemeSecondaryColor;
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
data() {
|
|
98
|
-
return {
|
|
99
|
-
computedCellWidth: null,
|
|
100
|
-
};
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
mounted() {
|
|
104
|
-
this.calcCellWidth();
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
watch: {
|
|
108
|
-
isLoaderActive() {
|
|
109
|
-
this.calcCellWidth();
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
methods: {
|
|
114
|
-
calcCellWidth() {
|
|
115
|
-
if (this.isLoaderActive) {
|
|
116
|
-
this.$nextTick(() => {
|
|
117
|
-
const cellLoaderDiv = this.$refs.cellLoaderDiv;
|
|
118
|
-
if (cellLoaderDiv) {
|
|
119
|
-
this.computedCellWidth = cellLoaderDiv.offsetWidth;
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
} else {
|
|
123
|
-
this.$nextTick(() => {
|
|
124
|
-
const cellDiv = this.$refs.cellDiv;
|
|
125
|
-
if (cellDiv) {
|
|
126
|
-
this.computedCellWidth = cellDiv.offsetWidth;
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
</script>
|