@appscode/design-system 1.0.3-alpha.8 → 1.0.43-alpha.101
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 +285 -23
- package/base/utilities/_derived-variables.scss +2 -15
- package/base/utilities/_initial-variables.scss +99 -64
- package/base/utilities/_mixin.scss +90 -10
- 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 +47 -11
- 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 +140 -38
- package/components/_ac-modal.scss +5 -4
- package/components/_ac-multi-select.scss +220 -18
- package/components/_ac-options.scss +31 -16
- package/components/_ac-select-box.scss +15 -5
- package/components/_ac-table.scss +88 -47
- 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 +8 -3
- package/components/_buttons.scss +86 -33
- package/components/_card-body-wrapper.scss +3 -3
- package/components/_dashboard-header.scss +1 -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 +206 -46
- package/components/_monaco-editor.scss +1 -1
- package/components/_navbar.scss +104 -27
- 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 +8 -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 +32 -20
- package/components/ac-toaster/_ac-toasted.scss +40 -8
- 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 +9 -9
- package/components/bbum/_user-profile.scss +97 -90
- package/components/ui-builder/_ui-builder.scss +31 -12
- package/components/ui-builder/_vue-open-api.scss +98 -0
- package/layouts/_404.scss +2 -1
- package/layouts/_code-preview.scss +14 -6
- package/main.scss +4 -0
- package/package.json +2 -7
- package/plugins/theme.js +142 -0
- package/plugins/vue-toaster.js +7 -6
- package/vue-components/v2/breadcrumbs/Breadcrumb.vue +95 -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/PaymentCards.vue +16 -10
- package/vue-components/v2/content/ContentHeader.vue +1 -1
- package/vue-components/v2/editor/Editor.vue +37 -17
- package/vue-components/v2/editor/ResourceKeyValueEditor.vue +232 -0
- package/vue-components/v2/header/Header.vue +0 -1
- package/vue-components/v2/modal/Modal.vue +32 -14
- package/vue-components/v2/modals/JsonShowModal.vue +0 -1
- package/vue-components/v2/navbar/Appdrawer.vue +9 -6
- package/vue-components/v2/navbar/ThemeMode.vue +120 -0
- package/vue-components/v2/pagination/Pagination.vue +8 -1
- 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/table/InfoTable.vue +13 -3
- package/vue-components/v2/table/Table.vue +75 -5
- package/vue-components/v2/table/TableRow.vue +17 -8
- package/vue-components/v2/table/table-cell/CellValue.vue +10 -1
- package/vue-components/v2/tabs/EditorTabs.vue +1 -1
- package/vue-components/v3/button/Button.vue +73 -0
- package/vue-components/v3/content/ContentHeader.vue +54 -0
- package/vue-components/v3/content/ContentTable.vue +65 -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 +157 -0
- package/vue-components/v3/form-fields/Input.vue +21 -0
- package/vue-components/v3/header/Header.vue +45 -0
- package/vue-components/v3/modal/Modal.vue +135 -0
- package/vue-components/v3/modals/JsonShowModal.vue +87 -0
- package/vue-components/v3/navbar/Appdrawer.vue +63 -0
- package/vue-components/v3/navbar/ThemeMode.vue +128 -0
- package/vue-components/v3/navbar/User.vue +64 -0
- package/vue-components/v3/pagination/Pagination.vue +159 -0
- package/vue-components/v3/searchbars/SearchBar.vue +47 -0
- package/vue-components/v3/sidebar/ClusterSwitcher.vue +133 -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/Table.vue +238 -0
- package/vue-components/v3/table/TableCell.vue +28 -0
- package/vue-components/v3/table/TableRow.vue +60 -0
- package/vue-components/v3/table/table-cell/ArrayCell.vue +111 -0
- package/vue-components/v3/table/table-cell/CellValue.vue +117 -0
- package/vue-components/v3/table/table-cell/ObjectCell.vue +105 -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/plugins/theme.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
export function HSLToHex(h, s, l) {
|
|
2
|
+
s /= 100;
|
|
3
|
+
l /= 100;
|
|
4
|
+
|
|
5
|
+
const c = (1 - Math.abs(2 * l - 1)) * s,
|
|
6
|
+
x = c * (1 - Math.abs(((h / 60) % 2) - 1)),
|
|
7
|
+
m = l - c / 2;
|
|
8
|
+
|
|
9
|
+
let r = 0,
|
|
10
|
+
g = 0,
|
|
11
|
+
b = 0;
|
|
12
|
+
|
|
13
|
+
if (0 <= h && h < 60) {
|
|
14
|
+
r = c;
|
|
15
|
+
g = x;
|
|
16
|
+
b = 0;
|
|
17
|
+
} else if (60 <= h && h < 120) {
|
|
18
|
+
r = x;
|
|
19
|
+
g = c;
|
|
20
|
+
b = 0;
|
|
21
|
+
} else if (120 <= h && h < 180) {
|
|
22
|
+
r = 0;
|
|
23
|
+
g = c;
|
|
24
|
+
b = x;
|
|
25
|
+
} else if (180 <= h && h < 240) {
|
|
26
|
+
r = 0;
|
|
27
|
+
g = x;
|
|
28
|
+
b = c;
|
|
29
|
+
} else if (240 <= h && h < 300) {
|
|
30
|
+
r = x;
|
|
31
|
+
g = 0;
|
|
32
|
+
b = c;
|
|
33
|
+
} else if (300 <= h && h < 360) {
|
|
34
|
+
r = c;
|
|
35
|
+
g = 0;
|
|
36
|
+
b = x;
|
|
37
|
+
}
|
|
38
|
+
// Having obtained RGB, convert channels to hex
|
|
39
|
+
r = Math.round((r + m) * 255).toString(16);
|
|
40
|
+
g = Math.round((g + m) * 255).toString(16);
|
|
41
|
+
b = Math.round((b + m) * 255).toString(16);
|
|
42
|
+
|
|
43
|
+
// Prepend 0s, if necessary
|
|
44
|
+
if (r.length == 1) r = "0" + r;
|
|
45
|
+
if (g.length == 1) g = "0" + g;
|
|
46
|
+
if (b.length == 1) b = "0" + b;
|
|
47
|
+
|
|
48
|
+
return "#" + r + g + b;
|
|
49
|
+
}
|
|
50
|
+
export function HexToHSL(H) {
|
|
51
|
+
// Convert hex to RGB first
|
|
52
|
+
let r = 0,
|
|
53
|
+
g = 0,
|
|
54
|
+
b = 0;
|
|
55
|
+
if (H.length == 4) {
|
|
56
|
+
r = parseInt("0x" + H[1] + H[1]);
|
|
57
|
+
g = parseInt("0x" + H[2] + H[2]);
|
|
58
|
+
b = parseInt("0x" + H[3] + H[3]);
|
|
59
|
+
} else if (H.length == 7) {
|
|
60
|
+
r = parseInt("0x" + H[1] + H[2]);
|
|
61
|
+
g = parseInt("0x" + H[3] + H[4]);
|
|
62
|
+
b = parseInt("0x" + H[5] + H[6]);
|
|
63
|
+
}
|
|
64
|
+
// Then to HSL
|
|
65
|
+
r /= 255;
|
|
66
|
+
g /= 255;
|
|
67
|
+
b /= 255;
|
|
68
|
+
const cmin = Math.min(r, g, b),
|
|
69
|
+
cmax = Math.max(r, g, b),
|
|
70
|
+
delta = cmax - cmin;
|
|
71
|
+
let h = 0,
|
|
72
|
+
s = 0,
|
|
73
|
+
l = 0;
|
|
74
|
+
|
|
75
|
+
if (delta == 0) h = 0;
|
|
76
|
+
else if (cmax == r) h = ((g - b) / delta) % 6;
|
|
77
|
+
else if (cmax == g) h = (b - r) / delta + 2;
|
|
78
|
+
else h = (r - g) / delta + 4;
|
|
79
|
+
|
|
80
|
+
h = Math.round(h * 60);
|
|
81
|
+
|
|
82
|
+
if (h < 0) h += 360;
|
|
83
|
+
|
|
84
|
+
l = (cmax + cmin) / 2;
|
|
85
|
+
s = delta == 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));
|
|
86
|
+
s = +(s * 100).toFixed(1);
|
|
87
|
+
l = +(l * 100).toFixed(1);
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
hue: `${h}`,
|
|
91
|
+
saturation: `${s}%`,
|
|
92
|
+
lightness: `${l}%`,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export function getThemeHSL() {
|
|
96
|
+
const hue = getComputedStyle(document.documentElement).getPropertyValue(
|
|
97
|
+
"--hsl-hue"
|
|
98
|
+
);
|
|
99
|
+
const saturation = getComputedStyle(
|
|
100
|
+
document.documentElement
|
|
101
|
+
).getPropertyValue("--hsl-saturation");
|
|
102
|
+
const lightness = getComputedStyle(
|
|
103
|
+
document.documentElement
|
|
104
|
+
).getPropertyValue("--hsl-lightness");
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
hue,
|
|
108
|
+
saturation,
|
|
109
|
+
lightness,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export function setThemeHSL(h, s, l) {
|
|
113
|
+
document.documentElement.style.setProperty("--hsl-hue", h);
|
|
114
|
+
document.documentElement.style.setProperty("--hsl-saturation", s);
|
|
115
|
+
document.documentElement.style.setProperty("--hsl-lightness", l);
|
|
116
|
+
}
|
|
117
|
+
export function setFontHSL(h, s, l) {
|
|
118
|
+
document.documentElement.style.setProperty("--font-hsl-hue", h);
|
|
119
|
+
document.documentElement.style.setProperty("--font-hsl-saturation", s);
|
|
120
|
+
document.documentElement.style.setProperty("--font-hsl-lightness", l);
|
|
121
|
+
}
|
|
122
|
+
export function getFontHSL() {
|
|
123
|
+
const hue = getComputedStyle(document.documentElement).getPropertyValue(
|
|
124
|
+
"--font-hsl-hue"
|
|
125
|
+
);
|
|
126
|
+
const saturation = getComputedStyle(
|
|
127
|
+
document.documentElement
|
|
128
|
+
).getPropertyValue("--font-hsl-saturation");
|
|
129
|
+
const lightness = getComputedStyle(
|
|
130
|
+
document.documentElement
|
|
131
|
+
).getPropertyValue("--font-hsl-lightness");
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
hue,
|
|
135
|
+
saturation,
|
|
136
|
+
lightness,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
export const loaderLightThemePrimaryColor = "#f5f7f9";
|
|
140
|
+
export const loaderDarkThemePrimaryColor = "#2e323c";
|
|
141
|
+
export const loaderLightThemeSecondaryColor = "#ecebeb";
|
|
142
|
+
export const loaderDarkThemeSecondaryColor = "#21272e";
|
package/plugins/vue-toaster.js
CHANGED
|
@@ -2,9 +2,9 @@ module.exports = {
|
|
|
2
2
|
position: "top-center",
|
|
3
3
|
theme: "toasted-primary",
|
|
4
4
|
iconPack: "fontawesome",
|
|
5
|
-
className: "ac-
|
|
5
|
+
className: "ac-toast",
|
|
6
6
|
action: {
|
|
7
|
-
|
|
7
|
+
icon: "close",
|
|
8
8
|
class: "ac-toast-action",
|
|
9
9
|
onClick: (e, toastObject) => {
|
|
10
10
|
toastObject.goAway(0);
|
|
@@ -26,7 +26,7 @@ module.exports = {
|
|
|
26
26
|
icon: "fa-check",
|
|
27
27
|
duration: 2500,
|
|
28
28
|
type: "success",
|
|
29
|
-
className: "ac-
|
|
29
|
+
className: "ac-toast is-success",
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
{
|
|
@@ -34,6 +34,7 @@ module.exports = {
|
|
|
34
34
|
message: (payload) => {
|
|
35
35
|
if (payload) {
|
|
36
36
|
if (typeof payload === "string") return payload;
|
|
37
|
+
else if (payload.response && payload.response.data && payload.response.data.message) return payload.response.data.message;
|
|
37
38
|
else if (payload.message) return payload.message;
|
|
38
39
|
else return "Something Went Wrong";
|
|
39
40
|
} else return "Something Went Wrong";
|
|
@@ -41,7 +42,7 @@ module.exports = {
|
|
|
41
42
|
options: {
|
|
42
43
|
icon: "fa-warning",
|
|
43
44
|
type: "error",
|
|
44
|
-
className: "ac-
|
|
45
|
+
className: "ac-toast is-error",
|
|
45
46
|
},
|
|
46
47
|
},
|
|
47
48
|
{
|
|
@@ -56,7 +57,7 @@ module.exports = {
|
|
|
56
57
|
options: {
|
|
57
58
|
icon: "fa-info",
|
|
58
59
|
type: "info",
|
|
59
|
-
className: "ac-
|
|
60
|
+
className: "ac-toast is-info",
|
|
60
61
|
},
|
|
61
62
|
},
|
|
62
63
|
{
|
|
@@ -73,7 +74,7 @@ module.exports = {
|
|
|
73
74
|
options: {
|
|
74
75
|
icon: "fa-warning",
|
|
75
76
|
type: "error",
|
|
76
|
-
className: "ac-
|
|
77
|
+
className: "ac-toast is-warning",
|
|
77
78
|
},
|
|
78
79
|
},
|
|
79
80
|
],
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ac-breadcrumb">
|
|
3
|
+
<nav aria-label="breadcrumbs" class="breadcrumb">
|
|
4
|
+
<ul>
|
|
5
|
+
<li
|
|
6
|
+
v-for="(item, idx) in list"
|
|
7
|
+
:key="idx"
|
|
8
|
+
:class="{ 'is-active': idx === list.length - 1 }"
|
|
9
|
+
>
|
|
10
|
+
<router-link
|
|
11
|
+
class="router-link-active"
|
|
12
|
+
:class="{ 'is-active': idx === list.length - 1 }"
|
|
13
|
+
:to="item.path"
|
|
14
|
+
>{{ item.name }}
|
|
15
|
+
</router-link>
|
|
16
|
+
</li>
|
|
17
|
+
</ul>
|
|
18
|
+
</nav>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
<script>
|
|
22
|
+
export default {
|
|
23
|
+
data() {
|
|
24
|
+
return {
|
|
25
|
+
list: [],
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
methods: {
|
|
29
|
+
createBreadcrumbs(n) {
|
|
30
|
+
//Adding dynamic path to the route
|
|
31
|
+
const listPaths = this.$route.matched.map((element) =>
|
|
32
|
+
this.pathReplaceWithParam(element.path)
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
//Removing the last duplicate value from the listpaths array
|
|
36
|
+
listPaths.pop();
|
|
37
|
+
|
|
38
|
+
//Createing the breadcrumb name
|
|
39
|
+
const listName = this.createList(listPaths);
|
|
40
|
+
|
|
41
|
+
//Set the new breadcrumb name and path value to list
|
|
42
|
+
this.list = listName.map((element, index) => {
|
|
43
|
+
return {
|
|
44
|
+
name: element,
|
|
45
|
+
path: listPaths[index],
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
pathReplaceWithParam(path) {
|
|
50
|
+
//Split the path and remove the first and last empty block
|
|
51
|
+
let splitPath = path.split("/").filter((element) => element !== "");
|
|
52
|
+
|
|
53
|
+
//Replace all element with query params where the element start with ":"
|
|
54
|
+
// Then again add them wthi "/" and return the path value
|
|
55
|
+
return splitPath.reduce((pval, cval) => {
|
|
56
|
+
if (cval[0] === ":")
|
|
57
|
+
return (pval += this.$route.params[cval.slice(1, cval.length)] + "/");
|
|
58
|
+
else return (pval += cval + "/");
|
|
59
|
+
}, "/");
|
|
60
|
+
},
|
|
61
|
+
createList(paths) {
|
|
62
|
+
//Split all the path and remove all empty block
|
|
63
|
+
let spath = paths.map((element) => {
|
|
64
|
+
return element.split("/").filter((word) => word !== "");
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Convert all the path arry in one arry where each element is the different fo previous element
|
|
68
|
+
return spath.reduce((prev, curr, currentIdx) => {
|
|
69
|
+
if (currentIdx === 0) return prev.concat([this.createVal(0, curr)]);
|
|
70
|
+
else
|
|
71
|
+
return prev.concat([
|
|
72
|
+
this.createVal(spath[currentIdx - 1].length, curr),
|
|
73
|
+
]);
|
|
74
|
+
}, []);
|
|
75
|
+
},
|
|
76
|
+
createVal(startIdx, paths) {
|
|
77
|
+
return paths.reduce((prev, curr, idx) => {
|
|
78
|
+
if (idx >= startIdx) {
|
|
79
|
+
if (idx + 1 === paths.length) return (prev += curr);
|
|
80
|
+
else return (prev += curr + " / ");
|
|
81
|
+
} else return prev + "";
|
|
82
|
+
}, "");
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
watch: {
|
|
86
|
+
"$route.path": {
|
|
87
|
+
deep: true,
|
|
88
|
+
immediate: true,
|
|
89
|
+
handler(n) {
|
|
90
|
+
this.createBreadcrumbs(n);
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="is-flex is-justify-content-space-between pt-8 pb-8 pl-20 pr-20 b-1"
|
|
4
|
+
>
|
|
5
|
+
<div class="header-left-content">
|
|
6
|
+
<slot name="card-header-left" />
|
|
7
|
+
</div>
|
|
8
|
+
<div class="header-right-content">
|
|
9
|
+
<slot name="card-header-right" />
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<!-- card start -->
|
|
3
2
|
<div class="ac-payment-card-wrapper">
|
|
4
3
|
<!-- loader start -->
|
|
5
4
|
<div v-if="isLoaderActive" class="ac-payment-card is-transparent-bg p-0">
|
|
6
5
|
<content-loader
|
|
7
6
|
:height="235"
|
|
8
7
|
:speed="2"
|
|
9
|
-
:
|
|
10
|
-
:
|
|
8
|
+
:primaryColor="primaryColor"
|
|
9
|
+
:secondaryColor="secondaryColor"
|
|
11
10
|
/>
|
|
12
11
|
</div>
|
|
13
12
|
<!-- loader end -->
|
|
@@ -15,24 +14,31 @@
|
|
|
15
14
|
<slot name="cards" />
|
|
16
15
|
</template>
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<slot name="add-card" />
|
|
21
|
-
</div>
|
|
17
|
+
<!-- single payment method start -->
|
|
18
|
+
<slot name="add-card" />
|
|
22
19
|
</div>
|
|
23
20
|
</template>
|
|
24
21
|
<script>
|
|
25
22
|
import { ContentLoader } from "vue-content-loader";
|
|
23
|
+
import {loaderLightThemePrimaryColor, loaderDarkThemePrimaryColor, loaderLightThemeSecondaryColor, loaderDarkThemeSecondaryColor} from "@appscode/design-system/plugins/theme";
|
|
26
24
|
|
|
27
25
|
export default {
|
|
28
26
|
components: {
|
|
29
|
-
ContentLoader
|
|
27
|
+
ContentLoader,
|
|
30
28
|
},
|
|
31
29
|
props: {
|
|
32
30
|
isLoaderActive: {
|
|
33
31
|
type: Boolean,
|
|
34
|
-
default: false
|
|
35
|
-
}
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
computed: {
|
|
36
|
+
primaryColor() {
|
|
37
|
+
return document.documentElement.classList.contains("is-dark-theme") ? loaderDarkThemePrimaryColor : loaderLightThemePrimaryColor;
|
|
38
|
+
},
|
|
39
|
+
secondaryColor() {
|
|
40
|
+
return document.documentElement.classList.contains("is-dark-theme") ? loaderDarkThemeSecondaryColor : loaderLightThemeSecondaryColor;
|
|
41
|
+
}
|
|
36
42
|
}
|
|
37
43
|
};
|
|
38
44
|
</script>
|
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
:language="language"
|
|
16
16
|
:options="{
|
|
17
17
|
minimap: {
|
|
18
|
-
enabled: calcShowMinimap
|
|
18
|
+
enabled: calcShowMinimap
|
|
19
19
|
},
|
|
20
|
+
theme: theme,
|
|
20
21
|
readOnly: readOnly,
|
|
21
|
-
|
|
22
|
+
wordWrap: wordWrap,
|
|
23
|
+
scrollBeyondLastLine: false
|
|
22
24
|
}"
|
|
23
25
|
/>
|
|
24
26
|
<monaco-editor
|
|
@@ -29,10 +31,12 @@
|
|
|
29
31
|
:language="language"
|
|
30
32
|
:options="{
|
|
31
33
|
minimap: {
|
|
32
|
-
enabled: calcShowMinimap
|
|
34
|
+
enabled: calcShowMinimap
|
|
33
35
|
},
|
|
36
|
+
theme: theme,
|
|
34
37
|
readOnly: true,
|
|
35
|
-
|
|
38
|
+
wordWrap: wordWrap,
|
|
39
|
+
scrollBeyondLastLine: false
|
|
36
40
|
}"
|
|
37
41
|
:original="originalEditorContent"
|
|
38
42
|
:diff-editor="true"
|
|
@@ -45,39 +49,47 @@ export default {
|
|
|
45
49
|
props: {
|
|
46
50
|
value: {
|
|
47
51
|
type: String,
|
|
48
|
-
default: ""
|
|
52
|
+
default: ""
|
|
49
53
|
},
|
|
50
54
|
originalValue: {
|
|
51
55
|
type: String,
|
|
52
|
-
default: ""
|
|
56
|
+
default: ""
|
|
53
57
|
},
|
|
54
58
|
readOnly: {
|
|
55
59
|
type: Boolean,
|
|
56
|
-
default: false
|
|
60
|
+
default: false
|
|
57
61
|
},
|
|
58
62
|
language: {
|
|
59
63
|
type: String,
|
|
60
|
-
default: "yaml"
|
|
64
|
+
default: "yaml"
|
|
61
65
|
},
|
|
62
66
|
showMinimap: {
|
|
63
67
|
type: Boolean,
|
|
64
|
-
default: true
|
|
68
|
+
default: true
|
|
65
69
|
},
|
|
66
70
|
editorHeight: {
|
|
67
71
|
type: Number,
|
|
68
|
-
default: 40
|
|
72
|
+
default: 40
|
|
73
|
+
},
|
|
74
|
+
editorTheme: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: ""
|
|
77
|
+
},
|
|
78
|
+
wordWrap: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: "off"
|
|
69
81
|
},
|
|
70
82
|
},
|
|
71
83
|
components: {
|
|
72
84
|
EditorTabs: () => import("../tabs/EditorTabs.vue"),
|
|
73
|
-
MonacoEditor: () => import("vue-monaco")
|
|
85
|
+
MonacoEditor: () => import("vue-monaco")
|
|
74
86
|
},
|
|
75
87
|
|
|
76
88
|
data() {
|
|
77
89
|
return {
|
|
78
90
|
activeTab: "edit",
|
|
79
91
|
editorContent: "",
|
|
80
|
-
originalEditorContent: ""
|
|
92
|
+
originalEditorContent: ""
|
|
81
93
|
};
|
|
82
94
|
},
|
|
83
95
|
|
|
@@ -86,6 +98,14 @@ export default {
|
|
|
86
98
|
const noOfLines = this.editorContent.split("\n").length;
|
|
87
99
|
return this.showMinimap && noOfLines * 2 > this.editorHeight;
|
|
88
100
|
},
|
|
101
|
+
theme() {
|
|
102
|
+
return (
|
|
103
|
+
this.editorTheme ||
|
|
104
|
+
(document.documentElement.classList.contains("is-dark-theme")
|
|
105
|
+
? "vs-dark"
|
|
106
|
+
: "vs")
|
|
107
|
+
);
|
|
108
|
+
}
|
|
89
109
|
},
|
|
90
110
|
|
|
91
111
|
watch: {
|
|
@@ -95,7 +115,7 @@ export default {
|
|
|
95
115
|
if (this.editorContent !== n) {
|
|
96
116
|
this.editorContent = n;
|
|
97
117
|
}
|
|
98
|
-
}
|
|
118
|
+
}
|
|
99
119
|
},
|
|
100
120
|
originalValue: {
|
|
101
121
|
immediate: true,
|
|
@@ -103,8 +123,8 @@ export default {
|
|
|
103
123
|
if (this.originalEditorContent !== n) {
|
|
104
124
|
this.originalEditorContent = n;
|
|
105
125
|
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
108
128
|
},
|
|
109
129
|
|
|
110
130
|
methods: {
|
|
@@ -114,7 +134,7 @@ export default {
|
|
|
114
134
|
editor.onDidBlurEditorText(() => {
|
|
115
135
|
this.$emit("input", this.editorContent);
|
|
116
136
|
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
119
139
|
};
|
|
120
140
|
</script>
|