@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.
Files changed (165) hide show
  1. package/base/utilities/_all.scss +7 -0
  2. package/base/utilities/_customize-bulma.scss +191 -0
  3. package/base/utilities/_default.scss +319 -110
  4. package/base/utilities/_derived-variables.scss +8 -15
  5. package/base/utilities/_grid.scss +29 -0
  6. package/base/utilities/_initial-variables.scss +111 -72
  7. package/base/utilities/_mixin.scss +90 -10
  8. package/base/utilities/_typography.scss +29 -19
  9. package/base/utilities/dark-theme.scss +26 -0
  10. package/components/_ac-accordion.scss +15 -5
  11. package/components/_ac-alert-box.scss +109 -26
  12. package/components/_ac-card.scss +71 -24
  13. package/components/_ac-code-highlight.scss +7 -1
  14. package/components/_ac-content-layout.scss +5 -5
  15. package/components/_ac-drag.scss +8 -6
  16. package/components/_ac-input.scss +196 -38
  17. package/components/_ac-modal.scss +6 -5
  18. package/components/_ac-multi-select.scss +281 -23
  19. package/components/_ac-options.scss +31 -16
  20. package/components/_ac-report.scss +53 -0
  21. package/components/_ac-select-box.scss +15 -5
  22. package/components/_ac-table.scss +160 -39
  23. package/components/_ac-tabs.scss +86 -23
  24. package/components/_ac-tags.scss +87 -2
  25. package/components/_ac-terminal.scss +270 -0
  26. package/components/_all.scss +28 -0
  27. package/components/_app-drawer.scss +134 -0
  28. package/components/_breadcumb.scss +8 -3
  29. package/components/_buttons.scss +96 -62
  30. package/components/_card-body-wrapper.scss +3 -3
  31. package/components/_dashboard-header.scss +33 -1
  32. package/components/_direct-deploy.scss +69 -0
  33. package/components/_go-to-top.scss +1 -1
  34. package/components/_graph.scss +45 -0
  35. package/components/_image-upload.scss +6 -4
  36. package/components/_left-sidebar-menu.scss +212 -52
  37. package/components/_monaco-editor.scss +1 -1
  38. package/components/_navbar.scss +193 -31
  39. package/components/_overview-info.scss +4 -4
  40. package/components/_overview-page.scss +1 -2
  41. package/components/_pagination.scss +45 -7
  42. package/components/_payment-card.scss +28 -12
  43. package/components/_preloader.scss +1 -1
  44. package/components/_preview-modal.scss +22 -9
  45. package/components/_pricing-table.scss +1 -1
  46. package/components/_progress-bar.scss +5 -5
  47. package/components/_subscription-card.scss +15 -8
  48. package/components/_table-of-content.scss +1 -1
  49. package/components/_tfa.scss +69 -0
  50. package/components/_transitions.scss +261 -0
  51. package/components/_widget-menu.scss +9 -9
  52. package/components/_wizard.scss +33 -20
  53. package/components/ac-toaster/_ac-toasted.scss +40 -8
  54. package/components/bbum/_all.scss +9 -0
  55. package/components/bbum/_card-team.scss +18 -10
  56. package/components/bbum/_information-center.scss +19 -5
  57. package/components/bbum/_mobile-desktop.scss +6 -6
  58. package/components/bbum/_post.scss +5 -4
  59. package/components/bbum/_sign-up-notification.scss +6 -6
  60. package/components/bbum/_single-post-preview.scss +10 -10
  61. package/components/bbum/_user-profile.scss +97 -90
  62. package/components/ui-builder/_ui-builder.scss +98 -21
  63. package/components/ui-builder/_vue-open-api.scss +104 -0
  64. package/layouts/_404.scss +159 -0
  65. package/layouts/_all.scss +2 -0
  66. package/layouts/_code-preview.scss +19 -8
  67. package/main.scss +6 -53
  68. package/package.json +4 -7
  69. package/plugins/caching.ts +243 -0
  70. package/plugins/theme.js +142 -0
  71. package/plugins/time-convert.js +49 -0
  72. package/plugins/vue-toaster.js +10 -6
  73. package/vue-components/v2/banner/Banner.vue +2 -2
  74. package/vue-components/v2/breadcrumbs/Breadcrumb.vue +97 -0
  75. package/vue-components/v2/button/Button.vue +10 -1
  76. package/vue-components/v2/button/DownloadBtn.vue +45 -0
  77. package/vue-components/v2/card/Card.vue +1 -0
  78. package/vue-components/v2/card/CardContent.vue +5 -0
  79. package/vue-components/v2/card/CardHeader.vue +12 -0
  80. package/vue-components/v2/card/OverviewCard.vue +10 -0
  81. package/vue-components/v2/card/OverviewCards.vue +5 -0
  82. package/vue-components/v2/card/PaymentCard.vue +69 -0
  83. package/vue-components/v2/card/PaymentCardOptionButtons.vue +35 -0
  84. package/vue-components/v2/card/PaymentCards.vue +44 -0
  85. package/vue-components/v2/content/ContentHeader.vue +9 -5
  86. package/vue-components/v2/content/ContentTable.vue +12 -7
  87. package/vue-components/v2/editor/Editor.vue +38 -5
  88. package/vue-components/v2/editor/FilteredFileEditor.vue +189 -0
  89. package/vue-components/v2/editor/MonacoEditor.vue +125 -0
  90. package/vue-components/v2/editor/ResourceKeyValueEditor.vue +209 -0
  91. package/vue-components/v2/form/Form.vue +12 -7
  92. package/vue-components/v2/form-fields/Input.vue +1 -1
  93. package/vue-components/v2/header/Header.vue +0 -1
  94. package/vue-components/v2/loaders/ResourceLoader.vue +101 -0
  95. package/vue-components/v2/loaders/SidebarLoader.vue +43 -0
  96. package/vue-components/v2/modal/Modal.vue +40 -7
  97. package/vue-components/v2/modals/DeleteConfirmationModal.vue +79 -0
  98. package/vue-components/v2/modals/JsonShowModal.vue +12 -3
  99. package/vue-components/v2/navbar/Appdrawer.vue +10 -9
  100. package/vue-components/v2/navbar/ThemeMode.vue +120 -0
  101. package/vue-components/v2/navbar/User.vue +229 -17
  102. package/vue-components/v2/notification/Notification.vue +101 -0
  103. package/vue-components/v2/notification/NotificationItem.vue +44 -0
  104. package/vue-components/v2/pagination/Pagination.vue +24 -4
  105. package/vue-components/v2/preloader/Preloader.vue +5 -5
  106. package/vue-components/v2/sidebar/ClusterSwitcher.vue +126 -0
  107. package/vue-components/v2/sidebar/SidebarItem.vue +24 -2
  108. package/vue-components/v2/sidebar/SidebarItemWithDropDown.vue +19 -20
  109. package/vue-components/v2/tab/TabItem.vue +1 -1
  110. package/vue-components/v2/table/FakeTableCell.vue +36 -0
  111. package/vue-components/v2/table/InfoTable.vue +13 -3
  112. package/vue-components/v2/table/NarrowTable.vue +0 -2
  113. package/vue-components/v2/table/Table.vue +170 -10
  114. package/vue-components/v2/table/TableRow.vue +29 -2
  115. package/vue-components/v2/table/table-cell/CellValue.vue +33 -4
  116. package/vue-components/v2/table/table-cell/GenericCell.vue +56 -0
  117. package/vue-components/v2/table/table-cell/ObjectCell.vue +4 -1
  118. package/vue-components/v2/tabs/EditorTabs.vue +1 -1
  119. package/vue-components/v3/button/Button.vue +78 -0
  120. package/vue-components/v3/content/ContentHeader.vue +55 -0
  121. package/vue-components/v3/content/ContentTable.vue +83 -0
  122. package/vue-components/v3/dropdown/DropdownDivider.vue +3 -0
  123. package/vue-components/v3/dropdown/DropdownItem.vue +5 -0
  124. package/vue-components/v3/dropdown/DropdownMenu.vue +111 -0
  125. package/vue-components/v3/editor/Editor.vue +160 -0
  126. package/vue-components/v3/editor/FilteredFileEditor.vue +186 -0
  127. package/vue-components/v3/editor/MonacoEditor.vue +131 -0
  128. package/vue-components/v3/editor/ResourceKeyValueEditor.vue +125 -0
  129. package/vue-components/v3/form/Form.vue +63 -0
  130. package/vue-components/v3/form-fields/Input.vue +22 -0
  131. package/vue-components/v3/header/Header.vue +45 -0
  132. package/vue-components/v3/header/HeaderItem.vue +5 -0
  133. package/vue-components/v3/header/HeaderItems.vue +5 -0
  134. package/vue-components/v3/loaders/ResourceLoader.vue +83 -0
  135. package/vue-components/v3/loaders/SidebarLoader.vue +34 -0
  136. package/vue-components/v3/long-running-tasks/LongRunningTaskItem.vue +92 -0
  137. package/vue-components/v3/modal/Modal.vue +158 -0
  138. package/vue-components/v3/modals/DeleteConfirmationModal.vue +85 -0
  139. package/vue-components/v3/modals/JsonShowModal.vue +96 -0
  140. package/vue-components/v3/modals/LongRunningTasksModal.vue +373 -0
  141. package/vue-components/v3/navbar/Appdrawer.vue +63 -0
  142. package/vue-components/v3/navbar/ThemeMode.vue +120 -0
  143. package/vue-components/v3/navbar/User.vue +288 -0
  144. package/vue-components/v3/notification/Notification.vue +98 -0
  145. package/vue-components/v3/notification/NotificationItem.vue +52 -0
  146. package/vue-components/v3/pagination/Pagination.vue +172 -0
  147. package/vue-components/v3/searchbars/SearchBar.vue +47 -0
  148. package/vue-components/v3/sidebar/ClusterSwitcher.vue +133 -0
  149. package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +120 -0
  150. package/vue-components/v3/tab/TabItem.vue +17 -0
  151. package/vue-components/v3/table/FakeTableCell.vue +39 -0
  152. package/vue-components/v3/table/InfoTable.vue +105 -0
  153. package/vue-components/v3/table/MultiInfoTable.vue +143 -0
  154. package/vue-components/v3/table/Table.vue +272 -0
  155. package/vue-components/v3/table/TableCell.vue +28 -0
  156. package/vue-components/v3/table/TableContainer.vue +34 -0
  157. package/vue-components/v3/table/TableRow.vue +147 -0
  158. package/vue-components/v3/table/table-cell/ArrayCell.vue +111 -0
  159. package/vue-components/v3/table/table-cell/CellValue.vue +133 -0
  160. package/vue-components/v3/table/table-cell/GenericCell.vue +75 -0
  161. package/vue-components/v3/table/table-cell/ObjectCell.vue +110 -0
  162. package/vue-components/v3/table/table-cell/ValueWithModal.vue +43 -0
  163. package/vue-components/v3/tabs/EditorTabs.vue +36 -0
  164. package/vue-components/v3/tag/Tag.vue +17 -0
  165. package/vue-components/v3/terminal/LongRunningTaskTerminal.vue +148 -0
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div class="sign-up-notification mb-20">
3
3
  <div class="notification-inner has-text-centered">
4
- <h3><slot name="banner-title" /></h3>
5
- <slot />
4
+ <h3><slot name="banner-title">Error!</slot></h3>
5
+ <slot><p>Oops!! There was an error while loading!</p></slot>
6
6
  </div>
7
7
  </div>
8
8
  </template>
@@ -0,0 +1,97 @@
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
+ const cutIndex =
58
+ cval.indexOf("?") !== -1 ? cval.indexOf("?") : cval.length;
59
+ return (pval += this.$route.params[cval.slice(1, cutIndex)] + "/");
60
+ } else return (pval += cval + "/");
61
+ }, "/");
62
+ },
63
+ createList(paths) {
64
+ //Split all the path and remove all empty block
65
+ let spath = paths.map(element => {
66
+ return element.split("/").filter(word => word !== "");
67
+ });
68
+
69
+ // Convert all the path arry in one arry where each element is the different fo previous element
70
+ return spath.reduce((prev, curr, currentIdx) => {
71
+ if (currentIdx === 0) return prev.concat([this.createVal(0, curr)]);
72
+ else
73
+ return prev.concat([
74
+ this.createVal(spath[currentIdx - 1].length, curr)
75
+ ]);
76
+ }, []);
77
+ },
78
+ createVal(startIdx, paths) {
79
+ return paths.reduce((prev, curr, idx) => {
80
+ if (idx >= startIdx) {
81
+ if (idx + 1 === paths.length) return (prev += curr);
82
+ else return (prev += curr + " / ");
83
+ } else return prev + "";
84
+ }, "");
85
+ }
86
+ },
87
+ watch: {
88
+ "$route.path": {
89
+ deep: true,
90
+ immediate: true,
91
+ handler(n) {
92
+ this.createBreadcrumbs(n);
93
+ }
94
+ }
95
+ }
96
+ };
97
+ </script>
@@ -4,6 +4,7 @@
4
4
  :class="`${modifierClasses}${isLoaderActive ? ' is-loading' : ''}`"
5
5
  :disabled="disabled"
6
6
  @click="handleClick"
7
+ :title="tooltip"
7
8
  >
8
9
  <span v-if="iconClass || iconImage" class="icon is-small">
9
10
  <img
@@ -14,7 +15,7 @@
14
15
  />
15
16
  <i v-else :class="`fa fa-${iconClass}`" aria-hidden="true" />
16
17
  </span>
17
- <span v-if="title">{{ title }}</span>
18
+ <span v-if="title" :class="titleModifierClass">{{ title }}</span>
18
19
  <slot />
19
20
  </button>
20
21
  </template>
@@ -27,6 +28,10 @@ export default {
27
28
  type: String,
28
29
  default: "",
29
30
  },
31
+ tooltip: {
32
+ type: String,
33
+ defualt: undefined
34
+ },
30
35
  // for loader
31
36
  isLoaderActive: {
32
37
  type: Boolean,
@@ -55,6 +60,10 @@ export default {
55
60
  type: String,
56
61
  default: "is-primary",
57
62
  },
63
+ titleModifierClass: {
64
+ type: String,
65
+ default: "",
66
+ },
58
67
  },
59
68
 
60
69
  methods: {
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <ac-button
3
+ modifier-classes="is-primary is-square"
4
+ icon-class="download"
5
+ :is-loader-active="isFetching"
6
+ @click="download()"
7
+ />
8
+ </template>
9
+
10
+ <script>
11
+ import downloadFunc from "downloadjs";
12
+
13
+ export default {
14
+ components: {
15
+ AcButton: () => import("./../button/Button.vue")
16
+ },
17
+ props: {
18
+ fileData: {
19
+ type: String,
20
+ default: ""
21
+ },
22
+ fileName: {
23
+ type: String,
24
+ default: ""
25
+ },
26
+ isFetching: {
27
+ type: Boolean,
28
+ default: false
29
+ }
30
+ },
31
+ data() {
32
+ return {
33
+ downloadIcon: "fa fa-cloud-download"
34
+ };
35
+ },
36
+ component: {
37
+ downloadFunc
38
+ },
39
+ methods: {
40
+ download() {
41
+ downloadFunc(this.fileData, this.fileName);
42
+ }
43
+ }
44
+ };
45
+ </script>
@@ -3,6 +3,7 @@
3
3
  class="ac-single-card has-text-centered style-three"
4
4
  :class="{ 'is-selected': isSelected }"
5
5
  @click="$emit('click', $event)"
6
+ data-testid="card-list-item"
6
7
  >
7
8
  <div class="ac-card-logo" v-if="hasLogo">
8
9
  <slot name="card-logo" />
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="ac-card-content b-1 b-t-n">
3
+ <slot />
4
+ </div>
5
+ </template>
@@ -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>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div class="card-data">
3
+ <p>
4
+ <slot name="card-label" />
5
+ </p>
6
+ <h5>
7
+ <slot name="card-value" />
8
+ </h5>
9
+ </div>
10
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="overview-card">
3
+ <slot />
4
+ </div>
5
+ </template>
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <div class="ac-payment-card" :class="bgClass">
3
+ <div class="payment-card-inner">
4
+ <!-- card header start -->
5
+ <div class="payment-card-header">
6
+ <div class="card-left">
7
+ <slot name="expire-section" />
8
+ </div>
9
+ <!-- header-right start -->
10
+ <div class="card-right">
11
+ <template v-if="showRightSection">
12
+ <p v-if="isDefaultCard" class="default-status">
13
+ <span>
14
+ <i class="fa fa-check-circle" aria-hidden="true" />
15
+ Default
16
+ </span>
17
+ </p>
18
+ <slot v-else name="option-button" />
19
+ </template>
20
+ </div>
21
+ <!-- header-right end -->
22
+ </div>
23
+ <!-- card header end -->
24
+ <!-- card body start -->
25
+ <div class="payment-card-body">
26
+ <p class="p-card-number is-star">****</p>
27
+ <p class="p-card-number is-star">****</p>
28
+ <p class="p-card-number is-star">****</p>
29
+ <p class="p-card-number"><slot name="card-number" /></p>
30
+ </div>
31
+ <!-- card body end -->
32
+ <!-- card footer start -->
33
+ <div class="payment-card-footer">
34
+ <div class="left-content">
35
+ <div class="p-card-expiry">
36
+ <p>
37
+ <slot name="card-expiry-date" />
38
+ </p>
39
+ </div>
40
+ <p class="user-name">
41
+ <slot name="card-holder-name" />
42
+ </p>
43
+ </div>
44
+ <div class="p-card-logo">
45
+ <slot name="card-logo" />
46
+ </div>
47
+ </div>
48
+ <!-- card footer end -->
49
+ </div>
50
+ </div>
51
+ </template>
52
+ <script>
53
+ export default {
54
+ props: {
55
+ bgClass: {
56
+ type: String,
57
+ default: "payment-bg-2",
58
+ },
59
+ isDefaultCard: {
60
+ type: Boolean,
61
+ default: false,
62
+ },
63
+ showRightSection: {
64
+ type: Boolean,
65
+ default: false,
66
+ },
67
+ },
68
+ };
69
+ </script>
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <div class="ac-options is-right" @click="handleClick">
3
+ <div class="option-dots">
4
+ <span></span>
5
+ <span></span>
6
+ <span></span>
7
+ </div>
8
+ <!-- dropdown Item start -->
9
+ <!-- use "is-hidden" class in the line below for hide dropdown element -->
10
+ <ul class="options-items" :class="{ 'is-hidden': isOptionButtonHidden }">
11
+ <li>
12
+ <slot name="make-default-button" />
13
+ </li>
14
+ <li>
15
+ <slot name="delete-card-button" />
16
+ </li>
17
+ </ul>
18
+ <!-- dropdown Item end -->
19
+ </div>
20
+ </template>
21
+ <script>
22
+ export default {
23
+ props: {
24
+ isOptionButtonHidden: {
25
+ type: Boolean,
26
+ default: false,
27
+ },
28
+ },
29
+ methods: {
30
+ handleClick(e) {
31
+ if (!this.disabled) this.$emit("click", e);
32
+ },
33
+ },
34
+ };
35
+ </script>
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <div class="ac-payment-card-wrapper">
3
+ <!-- loader start -->
4
+ <div v-if="isLoaderActive" class="ac-payment-card is-transparent-bg p-0">
5
+ <content-loader
6
+ :height="235"
7
+ :speed="2"
8
+ :primaryColor="primaryColor"
9
+ :secondaryColor="secondaryColor"
10
+ />
11
+ </div>
12
+ <!-- loader end -->
13
+ <template v-else>
14
+ <slot name="cards" />
15
+ </template>
16
+
17
+ <!-- single payment method start -->
18
+ <slot name="add-card" />
19
+ </div>
20
+ </template>
21
+ <script>
22
+ import { ContentLoader } from "vue-content-loader";
23
+ import {loaderLightThemePrimaryColor, loaderDarkThemePrimaryColor, loaderLightThemeSecondaryColor, loaderDarkThemeSecondaryColor} from "@appscode/design-system/plugins/theme";
24
+
25
+ export default {
26
+ components: {
27
+ ContentLoader,
28
+ },
29
+ props: {
30
+ isLoaderActive: {
31
+ type: Boolean,
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
+ }
42
+ }
43
+ };
44
+ </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="ac-content-header b-b-1">
2
+ <div class="ac-content-header" :class="{ 'b-b-1': !removeBorderBottom }">
3
3
  <!-- header left start -->
4
4
  <div class="ac-cheader-left">
5
5
  <!-- title -->
@@ -31,16 +31,20 @@ export default {
31
31
  props: {
32
32
  headerTitle: {
33
33
  type: String,
34
- default: "Content Header",
34
+ default: "Content Header"
35
35
  },
36
36
  headerSubTitle: {
37
37
  type: String,
38
- default: "",
38
+ default: ""
39
39
  },
40
+ removeBorderBottom: {
41
+ type: Boolean,
42
+ default: false
43
+ }
40
44
  },
41
45
 
42
46
  components: {
43
- HeaderItems: () => import("../header/HeaderItems.vue"),
44
- },
47
+ HeaderItems: () => import("../header/HeaderItems.vue")
48
+ }
45
49
  };
46
50
  </script>
@@ -2,6 +2,7 @@
2
2
  <content-layout>
3
3
  <template #content-header>
4
4
  <content-header
5
+ v-if="!hideHeader"
5
6
  :header-title="tableTitle"
6
7
  :header-sub-title="tableSubTitle"
7
8
  :class="{ 'pl-0 pr-0': removeTableHeaderPadding }"
@@ -21,32 +22,36 @@ export default {
21
22
  props: {
22
23
  removeTableHeaderPadding: {
23
24
  type: Boolean,
24
- default: false,
25
+ default: false
25
26
  },
26
27
  tableTitle: {
27
28
  type: String,
28
- default: "Table",
29
+ default: "Table"
29
30
  },
30
31
  tableSubTitle: {
31
32
  type: String,
32
- default: "",
33
+ default: ""
33
34
  },
34
35
  searchable: {
35
36
  type: Boolean,
36
- default: true,
37
+ default: true
37
38
  },
39
+ hideHeader: {
40
+ type: Boolean,
41
+ default: false
42
+ }
38
43
  },
39
44
  components: {
40
45
  ContentLayout: () => import("./ContentLayout.vue"),
41
46
  ContentHeader: () => import("./ContentHeader.vue"),
42
47
  HeaderItem: () => import("../header/HeaderItem.vue"),
43
- SearchBar: () => import("../searchbars/SearchBar.vue"),
48
+ SearchBar: () => import("../searchbars/SearchBar.vue")
44
49
  },
45
50
 
46
51
  data() {
47
52
  return {
48
- searchText: "",
53
+ searchText: ""
49
54
  };
50
- },
55
+ }
51
56
  };
52
57
  </script>
@@ -7,19 +7,22 @@
7
7
  />
8
8
  <monaco-editor
9
9
  v-if="activeTab === 'edit'"
10
- ref="monacoEditor"
11
10
  @editorDidMount="onEditorMount"
12
11
  key="edit"
13
12
  :class="`vh-${editorHeight} is-clipped`"
14
- v-model="editorContent"
13
+ :value="editorContent"
14
+ @change="onChange"
15
15
  :language="language"
16
16
  :options="{
17
17
  minimap: {
18
18
  enabled: calcShowMinimap,
19
19
  },
20
+ theme: theme,
20
21
  readOnly: readOnly,
22
+ wordWrap: wordWrap,
21
23
  scrollBeyondLastLine: false,
22
24
  }"
25
+ data-testid="monaco-editor-edit-section"
23
26
  />
24
27
  <monaco-editor
25
28
  v-if="activeTab === 'preview'"
@@ -31,16 +34,21 @@
31
34
  minimap: {
32
35
  enabled: calcShowMinimap,
33
36
  },
37
+ theme: theme,
34
38
  readOnly: true,
39
+ wordWrap: wordWrap,
35
40
  scrollBeyondLastLine: false,
36
41
  }"
37
42
  :original="originalEditorContent"
38
43
  :diff-editor="true"
44
+ data-testid="monaco-editor-preview-section"
39
45
  />
40
46
  </div>
41
47
  </template>
42
48
 
43
49
  <script>
50
+ import Preloader from "../preloader/Preloader.vue";
51
+ import Banner from "../banner/Banner.vue";
44
52
  export default {
45
53
  props: {
46
54
  value: {
@@ -67,10 +75,25 @@ export default {
67
75
  type: Number,
68
76
  default: 40,
69
77
  },
78
+ editorTheme: {
79
+ type: String,
80
+ default: "",
81
+ },
82
+ wordWrap: {
83
+ type: String,
84
+ default: "off",
85
+ },
70
86
  },
87
+
71
88
  components: {
72
89
  EditorTabs: () => import("../tabs/EditorTabs.vue"),
73
- MonacoEditor: () => import("vue-monaco"),
90
+ MonacoEditor: () => ({
91
+ component: import("./MonacoEditor.vue"),
92
+ loading: Preloader,
93
+ delay: 200,
94
+ error: Banner,
95
+ timeout: 100000,
96
+ }),
74
97
  },
75
98
 
76
99
  data() {
@@ -86,6 +109,14 @@ export default {
86
109
  const noOfLines = this.editorContent.split("\n").length;
87
110
  return this.showMinimap && noOfLines * 2 > this.editorHeight;
88
111
  },
112
+ theme() {
113
+ return (
114
+ this.editorTheme ||
115
+ (document.documentElement.classList.contains("is-dark-theme")
116
+ ? "vs-dark"
117
+ : "vs")
118
+ );
119
+ },
89
120
  },
90
121
 
91
122
  watch: {
@@ -108,8 +139,10 @@ export default {
108
139
  },
109
140
 
110
141
  methods: {
111
- onEditorMount() {
112
- const editor = this.$refs.monacoEditor.getEditor();
142
+ onChange(e) {
143
+ if (typeof e === "string") this.editorContent = e;
144
+ },
145
+ onEditorMount(editor) {
113
146
  // add event listeners
114
147
  editor.onDidBlurEditorText(() => {
115
148
  this.$emit("input", this.editorContent);