@appscode/design-system 1.0.43-alpha.22 → 1.0.43-alpha.221

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 (134) 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 +286 -126
  4. package/base/utilities/_derived-variables.scss +6 -1
  5. package/base/utilities/_grid.scss +29 -0
  6. package/base/utilities/_initial-variables.scss +27 -17
  7. package/base/utilities/_mixin.scss +1 -17
  8. package/base/utilities/_typography.scss +18 -14
  9. package/base/utilities/dark-theme.scss +9 -145
  10. package/components/_ac-accordion.scss +14 -5
  11. package/components/_ac-alert-box.scss +41 -7
  12. package/components/_ac-card.scss +48 -10
  13. package/components/_ac-code-highlight.scss +5 -1
  14. package/components/_ac-content-layout.scss +2 -2
  15. package/components/_ac-drag.scss +2 -0
  16. package/components/_ac-input.scss +64 -23
  17. package/components/_ac-modal.scss +1 -1
  18. package/components/_ac-multi-select.scss +247 -9
  19. package/components/_ac-options.scss +24 -9
  20. package/components/_ac-select-box.scss +13 -3
  21. package/components/_ac-table.scss +15 -5
  22. package/components/_ac-tabs.scss +46 -5
  23. package/components/_ac-tags.scss +85 -0
  24. package/components/_ac-terminal.scss +270 -0
  25. package/components/_all.scss +28 -0
  26. package/components/_app-drawer.scss +2 -2
  27. package/components/_breadcumb.scss +2 -0
  28. package/components/_buttons.scss +50 -37
  29. package/components/_card-body-wrapper.scss +2 -2
  30. package/components/_dashboard-header.scss +32 -0
  31. package/components/_direct-deploy.scss +69 -0
  32. package/components/_go-to-top.scss +1 -1
  33. package/components/_graph.scss +45 -0
  34. package/components/_image-upload.scss +5 -3
  35. package/components/_left-sidebar-menu.scss +121 -69
  36. package/components/_monaco-editor.scss +1 -1
  37. package/components/_navbar.scss +170 -10
  38. package/components/_overview-info.scss +3 -3
  39. package/components/_pagination.scss +8 -0
  40. package/components/_payment-card.scss +10 -1
  41. package/components/_preview-modal.scss +18 -5
  42. package/components/_pricing-table.scss +1 -1
  43. package/components/_progress-bar.scss +4 -4
  44. package/components/_subscription-card.scss +11 -4
  45. package/components/_table-of-content.scss +1 -1
  46. package/components/_tfa.scss +69 -0
  47. package/components/_transitions.scss +261 -0
  48. package/components/_wizard.scss +16 -3
  49. package/components/bbum/_all.scss +9 -0
  50. package/components/bbum/_card-team.scss +1 -1
  51. package/components/bbum/_information-center.scss +15 -1
  52. package/components/bbum/_sign-up-notification.scss +1 -1
  53. package/components/bbum/_single-post-preview.scss +2 -2
  54. package/components/bbum/_user-profile.scss +2 -3
  55. package/components/ui-builder/_ui-builder.scss +76 -1
  56. package/components/ui-builder/_vue-open-api.scss +104 -0
  57. package/layouts/_all.scss +2 -0
  58. package/layouts/_code-preview.scss +5 -2
  59. package/main.scss +6 -54
  60. package/package.json +4 -7
  61. package/plugins/caching.ts +243 -0
  62. package/plugins/theme.js +4 -0
  63. package/plugins/time-convert.js +49 -0
  64. package/plugins/vue-toaster.js +3 -0
  65. package/vue-components/v2/banner/Banner.vue +2 -2
  66. package/vue-components/v2/breadcrumbs/Breadcrumb.vue +97 -0
  67. package/vue-components/v2/button/Button.vue +5 -0
  68. package/vue-components/v2/button/DownloadBtn.vue +45 -0
  69. package/vue-components/v2/card/Card.vue +1 -0
  70. package/vue-components/v2/card/PaymentCards.vue +11 -2
  71. package/vue-components/v2/content/ContentTable.vue +12 -7
  72. package/vue-components/v2/editor/Editor.vue +43 -24
  73. package/vue-components/v2/editor/FilteredFileEditor.vue +189 -0
  74. package/vue-components/v2/editor/MonacoEditor.vue +125 -0
  75. package/vue-components/v2/editor/ResourceKeyValueEditor.vue +209 -0
  76. package/vue-components/v2/form-fields/Input.vue +1 -1
  77. package/vue-components/v2/loaders/ResourceLoader.vue +101 -0
  78. package/vue-components/v2/loaders/SidebarLoader.vue +43 -0
  79. package/vue-components/v2/modal/Modal.vue +38 -4
  80. package/vue-components/v2/modals/DeleteConfirmationModal.vue +79 -0
  81. package/vue-components/v2/modals/JsonShowModal.vue +12 -2
  82. package/vue-components/v2/navbar/Appdrawer.vue +10 -9
  83. package/vue-components/v2/navbar/ThemeMode.vue +50 -44
  84. package/vue-components/v2/navbar/User.vue +229 -17
  85. package/vue-components/v2/notification/Notification.vue +101 -0
  86. package/vue-components/v2/notification/NotificationItem.vue +44 -0
  87. package/vue-components/v2/pagination/Pagination.vue +16 -3
  88. package/vue-components/v2/preloader/Preloader.vue +5 -5
  89. package/vue-components/v2/sidebar/ClusterSwitcher.vue +126 -0
  90. package/vue-components/v2/sidebar/SidebarItem.vue +23 -1
  91. package/vue-components/v2/sidebar/SidebarItemWithDropDown.vue +19 -20
  92. package/vue-components/v2/tab/TabItem.vue +1 -1
  93. package/vue-components/v2/table/Table.vue +44 -8
  94. package/vue-components/v2/table/TableRow.vue +12 -2
  95. package/vue-components/v2/table/table-cell/CellValue.vue +33 -4
  96. package/vue-components/v2/table/table-cell/GenericCell.vue +56 -0
  97. package/vue-components/v2/table/table-cell/ObjectCell.vue +4 -1
  98. package/vue-components/v2/tabs/EditorTabs.vue +1 -1
  99. package/vue-components/v3/button/Button.vue +6 -1
  100. package/vue-components/v3/content/ContentHeader.vue +2 -1
  101. package/vue-components/v3/content/ContentTable.vue +20 -2
  102. package/vue-components/v3/editor/Editor.vue +42 -33
  103. package/vue-components/v3/editor/FilteredFileEditor.vue +186 -0
  104. package/vue-components/v3/editor/MonacoEditor.vue +131 -0
  105. package/vue-components/v3/editor/ResourceKeyValueEditor.vue +125 -0
  106. package/vue-components/v3/form/Form.vue +63 -0
  107. package/vue-components/v3/form-fields/Input.vue +11 -10
  108. package/vue-components/v3/header/HeaderItem.vue +5 -0
  109. package/vue-components/v3/header/HeaderItems.vue +5 -0
  110. package/vue-components/v3/loaders/ResourceLoader.vue +83 -0
  111. package/vue-components/v3/loaders/SidebarLoader.vue +34 -0
  112. package/vue-components/v3/long-running-tasks/LongRunningTaskItem.vue +92 -0
  113. package/vue-components/v3/modal/Modal.vue +38 -6
  114. package/vue-components/v3/modals/DeleteConfirmationModal.vue +85 -0
  115. package/vue-components/v3/modals/JsonShowModal.vue +25 -16
  116. package/vue-components/v3/modals/LongRunningTasksModal.vue +337 -0
  117. package/vue-components/v3/navbar/Appdrawer.vue +12 -7
  118. package/vue-components/v3/navbar/ThemeMode.vue +49 -47
  119. package/vue-components/v3/navbar/User.vue +242 -18
  120. package/vue-components/v3/notification/Notification.vue +98 -0
  121. package/vue-components/v3/notification/NotificationItem.vue +52 -0
  122. package/vue-components/v3/pagination/Pagination.vue +16 -3
  123. package/vue-components/v3/sidebar/ClusterSwitcher.vue +133 -0
  124. package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +120 -0
  125. package/vue-components/v3/tab/TabItem.vue +1 -1
  126. package/vue-components/v3/table/MultiInfoTable.vue +143 -0
  127. package/vue-components/v3/table/Table.vue +47 -13
  128. package/vue-components/v3/table/TableContainer.vue +34 -0
  129. package/vue-components/v3/table/TableRow.vue +64 -3
  130. package/vue-components/v3/table/table-cell/CellValue.vue +28 -3
  131. package/vue-components/v3/table/table-cell/GenericCell.vue +75 -0
  132. package/vue-components/v3/table/table-cell/ObjectCell.vue +7 -2
  133. package/vue-components/v3/tabs/EditorTabs.vue +1 -1
  134. package/vue-components/v3/terminal/LongRunningTaskTerminal.vue +148 -0
@@ -7,7 +7,6 @@
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`"
@@ -16,12 +15,14 @@
16
15
  :language="language"
17
16
  :options="{
18
17
  minimap: {
19
- enabled: calcShowMinimap
18
+ enabled: calcShowMinimap,
20
19
  },
21
20
  theme: theme,
22
21
  readOnly: readOnly,
23
- scrollBeyondLastLine: false
22
+ wordWrap: wordWrap,
23
+ scrollBeyondLastLine: false,
24
24
  }"
25
+ data-testid="monaco-editor-edit-section"
25
26
  />
26
27
  <monaco-editor
27
28
  v-if="activeTab === 'preview'"
@@ -31,73 +32,82 @@
31
32
  :language="language"
32
33
  :options="{
33
34
  minimap: {
34
- enabled: calcShowMinimap
35
+ enabled: calcShowMinimap,
35
36
  },
36
37
  theme: theme,
37
38
  readOnly: true,
38
- scrollBeyondLastLine: false
39
+ wordWrap: wordWrap,
40
+ scrollBeyondLastLine: false,
39
41
  }"
40
42
  :original="originalEditorContent"
41
43
  :diff-editor="true"
44
+ data-testid="monaco-editor-preview-section"
42
45
  />
43
46
  </div>
44
47
  </template>
45
48
 
46
49
  <script>
47
50
  import { defineComponent, defineAsyncComponent, h } from "vue";
51
+ import Preloader from "../../v2/preloader/Preloader.vue";
52
+ import Banner from "../../v2/banner/Banner.vue";
48
53
  export default defineComponent({
49
54
  props: {
50
- value: {
55
+ modelValue: {
51
56
  type: String,
52
- default: ""
57
+ default: "",
53
58
  },
54
59
  originalValue: {
55
60
  type: String,
56
- default: ""
61
+ default: "",
57
62
  },
58
63
  readOnly: {
59
64
  type: Boolean,
60
- default: false
65
+ default: false,
61
66
  },
62
67
  language: {
63
68
  type: String,
64
- default: "yaml"
69
+ default: "yaml",
65
70
  },
66
71
  showMinimap: {
67
72
  type: Boolean,
68
- default: true
73
+ default: true,
69
74
  },
70
75
  editorHeight: {
71
76
  type: Number,
72
- default: 40
77
+ default: 40,
73
78
  },
74
79
  editorTheme: {
75
80
  type: String,
76
- default: ""
77
- }
81
+ default: "",
82
+ },
83
+ wordWrap: {
84
+ type: String,
85
+ default: "off",
86
+ },
78
87
  },
79
88
 
80
89
  emits: ["update:modelValue"],
81
90
 
82
91
  components: {
83
92
  EditorTabs: defineAsyncComponent(() =>
84
- import("../tabs/EditorTabs.vue").then(module => module.default)
93
+ import("../tabs/EditorTabs.vue").then((module) => module.default)
85
94
  ),
86
- MonacoEditor: defineAsyncComponent(() =>
87
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
88
- // @ts-ignore
89
- import("vue-monaco").then(module => {
90
- module.default.render = () => h("div");
91
- return module.default;
92
- })
93
- )
95
+ MonacoEditor: defineAsyncComponent({
96
+ loader: () =>
97
+ import("./MonacoEditor.vue").then((module) => module.default),
98
+
99
+ loadingComponent: Preloader,
100
+ delay: 200,
101
+ errorComponent: Banner,
102
+ timeout: 100000,
103
+ }),
94
104
  },
95
105
 
96
106
  data() {
97
107
  return {
98
108
  activeTab: "edit",
99
109
  editorContent: "",
100
- originalEditorContent: ""
110
+ originalEditorContent: "",
101
111
  };
102
112
  },
103
113
 
@@ -113,17 +123,17 @@ export default defineComponent({
113
123
  ? "vs-dark"
114
124
  : "vs")
115
125
  );
116
- }
126
+ },
117
127
  },
118
128
 
119
129
  watch: {
120
- value: {
130
+ modelValue: {
121
131
  immediate: true,
122
132
  handler(n) {
123
133
  if (this.editorContent !== n) {
124
134
  this.editorContent = n;
125
135
  }
126
- }
136
+ },
127
137
  },
128
138
  originalValue: {
129
139
  immediate: true,
@@ -131,21 +141,20 @@ export default defineComponent({
131
141
  if (this.originalEditorContent !== n) {
132
142
  this.originalEditorContent = n;
133
143
  }
134
- }
135
- }
144
+ },
145
+ },
136
146
  },
137
147
 
138
148
  methods: {
139
149
  onChange(e) {
140
150
  if (typeof e === "string") this.editorContent = e;
141
151
  },
142
- onEditorMount() {
143
- const editor = this.$refs.monacoEditor.getEditor();
152
+ onEditorMount(editor) {
144
153
  // add event listeners
145
154
  editor.onDidBlurEditorText(() => {
146
155
  this.$emit("update:modelValue", this.editorContent);
147
156
  });
148
- }
149
- }
157
+ },
158
+ },
150
159
  });
151
160
  </script>
@@ -0,0 +1,186 @@
1
+ <template>
2
+ <div class="ac-preview is-active is-not-fixed">
3
+ <div class="ac-preview-inner">
4
+ <!-- preview body start -->
5
+ <div
6
+ class="ac-preview-body mt-0 pt-20"
7
+ :class="{
8
+ 'is-justify-content-center': isYamlsEmpty && !isPreviewLoading,
9
+ }"
10
+ >
11
+ <strong v-if="isYamlsEmpty && !isPreviewLoading">
12
+ No Data Available
13
+ <i class="pl-5 fa fa-exclamation-circle" aria-hidden="true"></i>
14
+ </strong>
15
+ <template v-else>
16
+ <div v-if="!isPreviewLoading && previewYamls" class="left-content">
17
+ <div class="ac-files ac-hscrollbar pt-0">
18
+ <ul v-if="!isPreviewLoading">
19
+ <li
20
+ v-for="(previewYaml, idx) in filteredYamls"
21
+ :key="previewYaml.name + idx"
22
+ :class="{ 'is-active': activeKey === previewYaml.uid }"
23
+ :title="previewYaml.name"
24
+ data-testid="filtered-file-editor-file-name"
25
+ >
26
+ <a @click.prevent="setActivePreview(previewYaml.uid)">
27
+ <span>
28
+ <img
29
+ src="~@appscode/design-system-images/icons/file-icon.svg"
30
+ alt=""
31
+ />
32
+ </span>
33
+ <span>{{ previewYaml.name }}</span>
34
+ </a>
35
+ </li>
36
+ </ul>
37
+ <sidebar-loader v-else />
38
+ </div>
39
+ </div>
40
+ <div class="right-content" data-testid="filtered-file-editor-content">
41
+ <resource-loader v-if="isPreviewLoading" />
42
+ <strong v-else-if="isYamlsNotSelected"
43
+ >Selecet a data from sidebar</strong
44
+ >
45
+ <strong v-else-if="hideValue"> *************** </strong>
46
+ <editor
47
+ v-else
48
+ v-model="activeFile.content"
49
+ :original-value="originalValue"
50
+ :language="activeFile.format"
51
+ :read-only="isEditorReadOnly"
52
+ :editor-height="editorHeight"
53
+ :show-minimap="showMinimap"
54
+ />
55
+ </div>
56
+ </template>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </template>
61
+ <script>
62
+ import { defineComponent, defineAsyncComponent } from "vue";
63
+ import Preloader from "../../v2/preloader/Preloader.vue";
64
+ import Banner from "../../v2/banner/Banner.vue";
65
+ export default defineComponent({
66
+ components: {
67
+ Editor: defineAsyncComponent({
68
+ loader: () =>
69
+ import("../editor/Editor.vue").then((module) => module.default),
70
+ loadingComponent: Preloader,
71
+ delay: 200,
72
+ errorComponent: Banner,
73
+ timeout: 100000,
74
+ }),
75
+ ResourceLoader: defineAsyncComponent(() =>
76
+ import("../loaders/ResourceLoader.vue")
77
+ ),
78
+ SidebarLoader: defineAsyncComponent(() =>
79
+ import("../loaders/SidebarLoader.vue")
80
+ ),
81
+ },
82
+ props: {
83
+ searchText: {
84
+ type: String,
85
+ default: "",
86
+ },
87
+ toggleHideValue: {
88
+ type: Boolean,
89
+ default: true,
90
+ },
91
+ isPreviewLoading: {
92
+ type: Boolean,
93
+ default: false,
94
+ },
95
+ isEditorReadOnly: {
96
+ type: Boolean,
97
+ default: false,
98
+ },
99
+ previewYamls: {
100
+ type: Array,
101
+ default: () => {
102
+ [];
103
+ },
104
+ },
105
+ showMinimap: {
106
+ type: Boolean,
107
+ default: false,
108
+ },
109
+ editorHeight: {
110
+ type: Number,
111
+ default: 60,
112
+ },
113
+ },
114
+ emits: ["setActiveKey"],
115
+ data() {
116
+ return {
117
+ activeKey: "",
118
+ hideValue: "",
119
+ };
120
+ },
121
+ computed: {
122
+ activeFile() {
123
+ const activeFile = this.filteredYamls.find(
124
+ (element) => element.uid === this.activeKey
125
+ );
126
+ return activeFile || { content: "", format: "yaml" };
127
+ },
128
+ originalValue() {
129
+ const activeFile = this.filteredYamls.find(
130
+ (element) => element.uid === this.activeKey
131
+ );
132
+ return (activeFile && activeFile.initContent) || "";
133
+ },
134
+ filteredYamls() {
135
+ if (this.searchText) {
136
+ return this.previewYamls.filter(
137
+ (element) => JSON.stringify(element).search(this.searchText) > -1
138
+ );
139
+ } else return this.previewYamls;
140
+ },
141
+ isKeyAvailable() {
142
+ const val = this.previewYamls.find((element) => {
143
+ return element.uid === this.activeKey;
144
+ });
145
+ return val === undefined ? false : true;
146
+ },
147
+ isYamlsEmpty() {
148
+ return this.filteredYamls.length === 0;
149
+ },
150
+ isYamlsNotSelected() {
151
+ const val = this.filteredYamls.find((element) => {
152
+ return element.uid === this.activeKey;
153
+ });
154
+ return val === undefined;
155
+ },
156
+ },
157
+ methods: {
158
+ initActivePreview() {
159
+ if (!this.isKeyAvailable) {
160
+ this.activeKey = this.previewYamls[0].uid;
161
+ this.hideValue = this.activeFile.isSecret;
162
+ this.$emit("setActiveKey", this.activeKey);
163
+ }
164
+ },
165
+ setActivePreview(uid) {
166
+ this.activeKey = uid;
167
+ this.hideValue = this.activeFile.isSecret;
168
+ this.$emit("setActiveKey", this.activeKey);
169
+ },
170
+ },
171
+ watch: {
172
+ previewYamls: {
173
+ deep: true,
174
+ immediate: true,
175
+ handler(n) {
176
+ if (n.length) {
177
+ this.initActivePreview();
178
+ }
179
+ },
180
+ },
181
+ toggleHideValue(n) {
182
+ this.hideValue = n;
183
+ },
184
+ },
185
+ });
186
+ </script>
@@ -0,0 +1,131 @@
1
+ <template>
2
+ <div class="monaco-editor-vue3" :style="style"></div>
3
+ </template>
4
+
5
+ <script>
6
+ import { defineComponent, computed, toRefs } from "vue";
7
+ import * as monaco from "monaco-editor";
8
+
9
+ export default defineComponent({
10
+ name: "MonacoEditor",
11
+ props: {
12
+ diffEditor: { type: Boolean, default: false },
13
+ width: { type: [String, Number], default: "100%" },
14
+ height: { type: [String, Number], default: "100%" },
15
+ original: String,
16
+ value: String,
17
+ language: { type: String, default: "javascript" },
18
+ theme: { type: String, default: "vs" },
19
+ options: {
20
+ type: Object,
21
+ default() {
22
+ return {};
23
+ },
24
+ },
25
+ },
26
+ emits: ["editorWillMount", "editorDidMount", "change"],
27
+ setup(props) {
28
+ const { width, height } = toRefs(props);
29
+ const style = computed(() => {
30
+ const fixedWidth = width.value.toString().includes("%")
31
+ ? width.value
32
+ : `${width.value}px`;
33
+ const fixedHeight = height.value.toString().includes("%")
34
+ ? height.value
35
+ : `${height.value}px`;
36
+ return {
37
+ width: fixedWidth,
38
+ height: fixedHeight,
39
+ "text-align": "left",
40
+ };
41
+ });
42
+ return {
43
+ style,
44
+ };
45
+ },
46
+ mounted() {
47
+ this.initMonaco();
48
+ },
49
+ beforeUnmount() {
50
+ this.editor && this.editor.dispose();
51
+ },
52
+ methods: {
53
+ initMonaco() {
54
+ this.$emit("editorWillMount", this.monaco);
55
+ const { value, language, theme, options } = this;
56
+ this.editor = monaco.editor[
57
+ this.diffEditor ? "createDiffEditor" : "create"
58
+ ](this.$el, {
59
+ value: value,
60
+ language: language,
61
+ theme: theme,
62
+ ...options,
63
+ });
64
+ this.diffEditor && this._setModel(this.value, this.original);
65
+
66
+ // @event `change`
67
+ const editor = this._getEditor();
68
+ editor.onDidChangeModelContent((event) => {
69
+ const value = editor.getValue();
70
+ if (this.value !== value) {
71
+ this.$emit("change", value, event);
72
+ }
73
+ });
74
+
75
+ this.$emit("editorDidMount", this.editor);
76
+ },
77
+ _setModel(value, original) {
78
+ const { language } = this;
79
+ const originalModel = monaco.editor.createModel(original, language);
80
+ const modifiedModel = monaco.editor.createModel(value, language);
81
+ this.editor.setModel({
82
+ original: originalModel,
83
+ modified: modifiedModel,
84
+ });
85
+ },
86
+ _setValue(value) {
87
+ let editor = this._getEditor();
88
+ if (editor) return editor.setValue(value);
89
+ },
90
+ _getValue() {
91
+ let editor = this._getEditor();
92
+ if (!editor) return "";
93
+ return editor.getValue();
94
+ },
95
+ _getEditor() {
96
+ if (!this.editor) return null;
97
+ return this.diffEditor ? this.editor.getModifiedEditor() : this.editor;
98
+ },
99
+ _setOriginal() {
100
+ const { original } = this.editor.getModel();
101
+ original.setValue(this.original);
102
+ },
103
+ },
104
+ watch: {
105
+ options: {
106
+ deep: true,
107
+ handler(options) {
108
+ this.editor.updateOptions(options);
109
+ },
110
+ },
111
+ value() {
112
+ this.value !== this._getValue() && this._setValue(this.value);
113
+ },
114
+ original() {
115
+ this._setOriginal();
116
+ },
117
+ language() {
118
+ if (!this.editor) return;
119
+ if (this.diffEditor) {
120
+ const { original, modified } = this.editor.getModel();
121
+ monaco.editor.setModelLanguage(original, this.language);
122
+ monaco.editor.setModelLanguage(modified, this.language);
123
+ } else
124
+ monaco.editor.setModelLanguage(this.editor.getModel(), this.language);
125
+ },
126
+ theme() {
127
+ monaco.editor.setTheme(this.theme);
128
+ },
129
+ },
130
+ });
131
+ </script>
@@ -0,0 +1,125 @@
1
+ <template>
2
+ <content-table
3
+ :table-title="title"
4
+ :searchable="isSearchable"
5
+ :hide-header="hideHeader"
6
+ >
7
+ <template #content-right-controls>
8
+ <header-item v-if="showHideBtn">
9
+ <ac-button
10
+ modifier-classes="is-square is-primary"
11
+ :icon-class="toggleHideValue ? 'eye-slash' : 'eye'"
12
+ :disabled="previewYamls.length === 0"
13
+ @click.prevent="toggleHideValue = !toggleHideValue"
14
+ />
15
+ </header-item>
16
+ <slot name="content-action" />
17
+ </template>
18
+ <template #content="{ searchText }">
19
+ <filtered-file-editor
20
+ :search-text="searchText"
21
+ :toggle-hide-value="toggleHideValue"
22
+ :is-preview-loading="isPreviewLoading"
23
+ :is-editor-read-only="isEditorReadOnly"
24
+ :preview-yamls="previewYamls"
25
+ :show-minimap="showMinimap"
26
+ :editor-height="editorHeight"
27
+ @setActiveKey="setActiveKey"
28
+ />
29
+ </template>
30
+ </content-table>
31
+ </template>
32
+ <script>
33
+ import { defineComponent, defineAsyncComponent } from "vue";
34
+ export default defineComponent({
35
+ components: {
36
+ AcButton: defineAsyncComponent(() => import("../button/Button.vue")),
37
+ ContentTable: defineAsyncComponent(() =>
38
+ import("../content/ContentTable.vue")
39
+ ),
40
+ HeaderItem: defineAsyncComponent(() => import("../header/HeaderItem.vue")),
41
+ FilteredFileEditor: defineAsyncComponent(() =>
42
+ import("./FilteredFileEditor.vue")
43
+ )
44
+ },
45
+ props: {
46
+ title: {
47
+ type: String,
48
+ default: "Title"
49
+ },
50
+ isSearchable: {
51
+ type: Boolean,
52
+ default: false
53
+ },
54
+ isPreviewLoading: {
55
+ type: Boolean,
56
+ default: false
57
+ },
58
+ isEditorReadOnly: {
59
+ type: Boolean,
60
+ default: false
61
+ },
62
+ previewYamls: {
63
+ type: Array,
64
+ default: () => {
65
+ [];
66
+ }
67
+ },
68
+ showHideBtn: {
69
+ type: Boolean,
70
+ default: false,
71
+ },
72
+ showMinimap: {
73
+ type: Boolean,
74
+ default: false
75
+ },
76
+ isUpdateActive: {
77
+ type: Boolean,
78
+ default: false
79
+ },
80
+ deleteModalStatus: {
81
+ type: String,
82
+ default: "closed"
83
+ },
84
+ editorHeight: {
85
+ type: Number,
86
+ default: 60
87
+ },
88
+ hideHeader: {
89
+ type: Boolean,
90
+ default: false
91
+ }
92
+ },
93
+ emits: ["activeKey"],
94
+ data() {
95
+ return {
96
+ activeKey: "",
97
+ toggleHideValue: "",
98
+ showDeleteDataModal: false
99
+ };
100
+ },
101
+ computed: {
102
+ activeFile() {
103
+ const activeFile = this.previewYamls.find(
104
+ element => element.uid === this.activeKey
105
+ );
106
+ return activeFile || { content: "", format: "yaml" };
107
+ },
108
+ },
109
+ methods: {
110
+ setActiveKey(key) {
111
+ this.activeKey = key;
112
+ this.toggleHideValue = this.activeFile.isSecret;
113
+ }
114
+ },
115
+ watch: {
116
+ activeKey:{
117
+ immediate: true,
118
+ handler(n){
119
+ this.$emit("activeKey",this.activeKey);
120
+ }
121
+ }
122
+
123
+ }
124
+ });
125
+ </script>
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <div class="form-wrapper">
3
+ <div
4
+ :class="{
5
+ 'pt-20': !reducePaddingTop,
6
+ 'pt-10': reducePaddingTop,
7
+ 'pl-20': !isContainer,
8
+ 'form-content': !isContainer,
9
+ container: isContainer,
10
+ }"
11
+ >
12
+ <slot />
13
+ </div>
14
+ <div
15
+ class="form-footer b-t-1 pt-10 pb-10 pl-20 pr-20 mt-15"
16
+ v-if="hasFooter"
17
+ >
18
+ <div
19
+ class="ac-vcentered"
20
+ :class="{
21
+ 'form-content': !isContainer,
22
+ container: isContainer,
23
+ }"
24
+ >
25
+ <form-footer-controls>
26
+ <slot name="form-left-controls" />
27
+ </form-footer-controls>
28
+ <form-footer-controls>
29
+ <slot name="form-right-controls" />
30
+ </form-footer-controls>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </template>
35
+
36
+ <script>
37
+ import { defineComponent, defineAsyncComponent, h } from "vue";
38
+
39
+ export default defineComponent({
40
+ props: {
41
+ isContainer: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ hasFooter: {
46
+ type: Boolean,
47
+ default: true,
48
+ },
49
+ reducePaddingTop: {
50
+ type: Boolean,
51
+ default: false,
52
+ },
53
+ },
54
+
55
+ components: {
56
+ FormFooterControls: defineAsyncComponent(() =>
57
+ import("../../v2/form/FormFooterControl.vue").then(
58
+ (module) => module.default
59
+ )
60
+ ),
61
+ },
62
+ });
63
+ </script>