@appscode/design-system 1.0.43-alpha.16 → 1.0.43-alpha.162

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/base/utilities/_default.scss +269 -4
  2. package/base/utilities/_derived-variables.scss +0 -1
  3. package/base/utilities/_initial-variables.scss +17 -176
  4. package/base/utilities/_mixin.scss +1 -17
  5. package/base/utilities/_typography.scss +14 -4
  6. package/base/utilities/dark-theme.scss +25 -0
  7. package/components/_ac-alert-box.scss +13 -5
  8. package/components/_ac-card.scss +44 -8
  9. package/components/_ac-code-highlight.scss +5 -1
  10. package/components/_ac-content-layout.scss +2 -2
  11. package/components/_ac-input.scss +63 -23
  12. package/components/_ac-multi-select.scss +187 -5
  13. package/components/_ac-options.scss +24 -9
  14. package/components/_ac-select-box.scss +14 -4
  15. package/components/_ac-table.scss +5 -3
  16. package/components/_ac-tabs.scss +39 -3
  17. package/components/_ac-terminal.scss +270 -0
  18. package/components/_app-drawer.scss +2 -2
  19. package/components/_breadcumb.scss +2 -0
  20. package/components/_buttons.scss +39 -7
  21. package/components/_card-body-wrapper.scss +2 -2
  22. package/components/_dashboard-header.scss +32 -0
  23. package/components/_direct-deploy.scss +69 -0
  24. package/components/_go-to-top.scss +1 -1
  25. package/components/_graph.scss +45 -0
  26. package/components/_image-upload.scss +5 -3
  27. package/components/_left-sidebar-menu.scss +193 -39
  28. package/components/_monaco-editor.scss +1 -1
  29. package/components/_navbar.scss +108 -7
  30. package/components/_overview-info.scss +4 -4
  31. package/components/_pagination.scss +8 -0
  32. package/components/_payment-card.scss +10 -1
  33. package/components/_preview-modal.scss +15 -4
  34. package/components/_pricing-table.scss +1 -1
  35. package/components/_progress-bar.scss +4 -4
  36. package/components/_subscription-card.scss +12 -5
  37. package/components/_table-of-content.scss +1 -1
  38. package/components/_tfa.scss +69 -0
  39. package/components/_transitions.scss +261 -0
  40. package/components/_wizard.scss +15 -3
  41. package/components/ac-toaster/_ac-toasted.scss +1 -1
  42. package/components/bbum/_card-team.scss +15 -7
  43. package/components/bbum/_information-center.scss +15 -1
  44. package/components/bbum/_mobile-desktop.scss +1 -1
  45. package/components/bbum/_sign-up-notification.scss +3 -3
  46. package/components/bbum/_single-post-preview.scss +1 -1
  47. package/components/bbum/_user-profile.scss +97 -90
  48. package/components/ui-builder/_ui-builder.scss +19 -2
  49. package/components/ui-builder/_vue-open-api.scss +104 -0
  50. package/main.scss +4 -0
  51. package/package.json +2 -7
  52. package/plugins/theme.js +4 -0
  53. package/plugins/vue-toaster.js +3 -0
  54. package/vue-components/v2/banner/Banner.vue +2 -2
  55. package/vue-components/v2/breadcrumbs/Breadcrumb.vue +97 -0
  56. package/vue-components/v2/button/Button.vue +5 -0
  57. package/vue-components/v2/button/DownloadBtn.vue +45 -0
  58. package/vue-components/v2/card/PaymentCards.vue +11 -2
  59. package/vue-components/v2/content/ContentTable.vue +12 -7
  60. package/vue-components/v2/editor/Editor.vue +36 -5
  61. package/vue-components/v2/editor/FilteredFileEditor.vue +188 -0
  62. package/vue-components/v2/editor/MonacoEditor.vue +125 -0
  63. package/vue-components/v2/editor/ResourceKeyValueEditor.vue +209 -0
  64. package/vue-components/v2/loaders/ResourceLoader.vue +101 -0
  65. package/vue-components/v2/loaders/SidebarLoader.vue +43 -0
  66. package/vue-components/v2/modal/Modal.vue +38 -13
  67. package/vue-components/v2/modals/DeleteConfirmationModal.vue +77 -0
  68. package/vue-components/v2/modals/JsonShowModal.vue +12 -2
  69. package/vue-components/v2/navbar/Appdrawer.vue +10 -9
  70. package/vue-components/v2/navbar/ThemeMode.vue +120 -0
  71. package/vue-components/v2/navbar/User.vue +202 -19
  72. package/vue-components/v2/preloader/Preloader.vue +5 -5
  73. package/vue-components/v2/sidebar/ClusterSwitcher.vue +126 -0
  74. package/vue-components/v2/sidebar/SidebarItem.vue +23 -1
  75. package/vue-components/v2/sidebar/SidebarItemWithDropDown.vue +19 -20
  76. package/vue-components/v2/table/Table.vue +44 -8
  77. package/vue-components/v2/table/TableRow.vue +17 -8
  78. package/vue-components/v2/table/table-cell/CellValue.vue +31 -4
  79. package/vue-components/v2/table/table-cell/GenericCell.vue +56 -0
  80. package/vue-components/v2/table/table-cell/ObjectCell.vue +4 -1
  81. package/vue-components/v2/tabs/EditorTabs.vue +1 -1
  82. package/vue-components/v3/button/Button.vue +5 -0
  83. package/vue-components/v3/content/ContentTable.vue +5 -0
  84. package/vue-components/v3/editor/Editor.vue +50 -30
  85. package/vue-components/v3/editor/FilteredFileEditor.vue +166 -0
  86. package/vue-components/v3/editor/MonacoEditor.vue +131 -0
  87. package/vue-components/v3/editor/ResourceKeyValueEditor.vue +124 -0
  88. package/vue-components/v3/form/Form.vue +63 -0
  89. package/vue-components/v3/form-fields/Input.vue +10 -10
  90. package/vue-components/v3/header/HeaderItem.vue +5 -0
  91. package/vue-components/v3/header/HeaderItems.vue +5 -0
  92. package/vue-components/v3/loaders/ResourceLoader.vue +83 -0
  93. package/vue-components/v3/loaders/SidebarLoader.vue +34 -0
  94. package/vue-components/v3/modal/Modal.vue +39 -16
  95. package/vue-components/v3/modals/DeleteConfirmationModal.vue +83 -0
  96. package/vue-components/v3/modals/JsonShowModal.vue +25 -16
  97. package/vue-components/v3/navbar/Appdrawer.vue +12 -7
  98. package/vue-components/v3/navbar/ThemeMode.vue +123 -0
  99. package/vue-components/v3/navbar/User.vue +176 -16
  100. package/vue-components/v3/sidebar/ClusterSwitcher.vue +133 -0
  101. package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +120 -0
  102. package/vue-components/v3/table/MultiInfoTable.vue +143 -0
  103. package/vue-components/v3/table/Table.vue +34 -11
  104. package/vue-components/v3/table/TableContainer.vue +34 -0
  105. package/vue-components/v3/table/TableRow.vue +1 -1
  106. package/vue-components/v3/table/table-cell/CellValue.vue +26 -3
  107. package/vue-components/v3/table/table-cell/GenericCell.vue +62 -0
  108. package/vue-components/v3/table/table-cell/ObjectCell.vue +5 -1
  109. package/vue-components/v3/tabs/EditorTabs.vue +1 -1
@@ -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,124 @@
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
+ @click.prevent="toggleHideValue = !toggleHideValue"
13
+ />
14
+ </header-item>
15
+ <slot name="content-action" />
16
+ </template>
17
+ <template #content="{ searchText }">
18
+ <filtered-file-editor
19
+ :search-text="searchText"
20
+ :toggle-hide-value="toggleHideValue"
21
+ :is-preview-loading="isPreviewLoading"
22
+ :is-editor-read-only="isEditorReadOnly"
23
+ :preview-yamls="previewYamls"
24
+ :show-minimap="showMinimap"
25
+ :editor-height="editorHeight"
26
+ @setActiveKey="setActiveKey"
27
+ />
28
+ </template>
29
+ </content-table>
30
+ </template>
31
+ <script>
32
+ import { defineComponent, defineAsyncComponent } from "vue";
33
+ export default defineComponent({
34
+ components: {
35
+ AcButton: defineAsyncComponent(() => import("../button/Button.vue")),
36
+ ContentTable: defineAsyncComponent(() =>
37
+ import("../content/ContentTable.vue")
38
+ ),
39
+ HeaderItem: defineAsyncComponent(() => import("../header/HeaderItem.vue")),
40
+ FilteredFileEditor: defineAsyncComponent(() =>
41
+ import("./FilteredFileEditor.vue")
42
+ )
43
+ },
44
+ props: {
45
+ title: {
46
+ type: String,
47
+ default: "Title"
48
+ },
49
+ isSearchable: {
50
+ type: Boolean,
51
+ default: false
52
+ },
53
+ isPreviewLoading: {
54
+ type: Boolean,
55
+ default: false
56
+ },
57
+ isEditorReadOnly: {
58
+ type: Boolean,
59
+ default: false
60
+ },
61
+ previewYamls: {
62
+ type: Array,
63
+ default: () => {
64
+ [];
65
+ }
66
+ },
67
+ showHideBtn: {
68
+ type: Boolean,
69
+ default: false,
70
+ },
71
+ showMinimap: {
72
+ type: Boolean,
73
+ default: false
74
+ },
75
+ isUpdateActive: {
76
+ type: Boolean,
77
+ default: false
78
+ },
79
+ deleteModalStatus: {
80
+ type: String,
81
+ default: "closed"
82
+ },
83
+ editorHeight: {
84
+ type: Number,
85
+ default: 60
86
+ },
87
+ hideHeader: {
88
+ type: Boolean,
89
+ default: false
90
+ }
91
+ },
92
+ emits: ["activeKey"],
93
+ data() {
94
+ return {
95
+ activeKey: "",
96
+ toggleHideValue: "",
97
+ showDeleteDataModal: false
98
+ };
99
+ },
100
+ computed: {
101
+ activeFile() {
102
+ const activeFile = this.previewYamls.find(
103
+ element => element.uid === this.activeKey
104
+ );
105
+ return activeFile || { content: "", format: "yaml" };
106
+ },
107
+ },
108
+ methods: {
109
+ setActiveKey(key) {
110
+ this.activeKey = key;
111
+ this.toggleHideValue = this.activeFile.isSecret;
112
+ }
113
+ },
114
+ watch: {
115
+ activeKey:{
116
+ immediate: true,
117
+ handler(n){
118
+ this.$emit("activeKey",this.activeKey);
119
+ }
120
+ }
121
+
122
+ }
123
+ });
124
+ </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>
@@ -1,21 +1,21 @@
1
1
  <template>
2
- <input class="ac-input" v-bind="inputListeners" />
2
+ <input
3
+ class="ac-input"
4
+ :value="modelValue"
5
+ @input="$emit('update:modelValue', $event.target.value)"
6
+ />
3
7
  </template>
4
8
 
5
9
  <script>
6
10
  import { defineComponent } from "vue";
7
11
 
8
12
  export default defineComponent({
9
- inheritAttrs: false,
10
- emits: ["update:modelValue"],
11
- computed: {
12
- inputListeners() {
13
- return Object.assign({}, this.$attrs, {
14
- onInput: (event) => {
15
- this.$emit("update:modelValue", event.target.value);
16
- },
17
- });
13
+ props: {
14
+ modelValue: {
15
+ type: null,
16
+ default: "",
18
17
  },
19
18
  },
19
+ emits: ["update:modelValue"],
20
20
  });
21
21
  </script>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="header-item">
3
+ <slot />
4
+ </div>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="header-items is-flex is-align-items-center">
3
+ <slot />
4
+ </div>
5
+ </template>
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <div>
3
+ <content-loader>
4
+ <rect x="21" y="6" rx="3" ry="3" width="42" height="3" />
5
+ <rect x="69" y="6" rx="3" ry="3" width="39" height="3" />
6
+ <rect x="114" y="6" rx="3" ry="3" width="24" height="3" />
7
+
8
+ <rect x="39" y="12" rx="3" ry="3" width="24" height="3" />
9
+ <rect x="69" y="12" rx="3" ry="3" width="45" height="3" />
10
+ <rect x="120" y="12" rx="3" ry="3" width="12" height="3" />
11
+
12
+ <rect x="39" y="18" rx="3" ry="3" width="30" height="3" />
13
+ <rect x="75" y="18" rx="3" ry="3" width="60" height="3" />
14
+
15
+ <rect x="21" y="27" rx="3" ry="3" width="42" height="3" />
16
+ <rect x="69" y="27" rx="3" ry="3" width="39" height="3" />
17
+ <rect x="114" y="27" rx="3" ry="3" width="24" height="3" />
18
+
19
+ <rect x="39" y="33" rx="3" ry="3" width="24" height="3" />
20
+ <rect x="69" y="33" rx="3" ry="3" width="45" height="3" />
21
+ <rect x="120" y="33" rx="3" ry="3" width="12" height="3" />
22
+
23
+ <rect x="39" y="39" rx="3" ry="3" width="30" height="3" />
24
+ <rect x="75" y="39" rx="3" ry="3" width="60" height="3" />
25
+
26
+ <rect x="21" y="48" rx="3" ry="3" width="42" height="3" />
27
+ <rect x="69" y="48" rx="3" ry="3" width="39" height="3" />
28
+ <rect x="114" y="48" rx="3" ry="3" width="24" height="3" />
29
+
30
+ <rect x="39" y="54" rx="3" ry="3" width="24" height="3" />
31
+ <rect x="69" y="54" rx="3" ry="3" width="45" height="3" />
32
+ <rect x="120" y="54" rx="3" ry="3" width="12" height="3" />
33
+
34
+ <rect x="39" y="60" rx="3" ry="3" width="30" height="3" />
35
+ <rect x="75" y="60" rx="3" ry="3" width="60" height="3" />
36
+
37
+ <rect x="21" y="69" rx="3" ry="3" width="42" height="3" />
38
+ <rect x="69" y="69" rx="3" ry="3" width="39" height="3" />
39
+ <rect x="114" y="69" rx="3" ry="3" width="24" height="3" />
40
+
41
+ <rect x="39" y="75" rx="3" ry="3" width="24" height="3" />
42
+ <rect x="69" y="75" rx="3" ry="3" width="45" height="3" />
43
+ <rect x="120" y="75" rx="3" ry="3" width="12" height="3" />
44
+
45
+ <rect x="39" y="81" rx="3" ry="3" width="30" height="3" />
46
+ <rect x="75" y="81" rx="3" ry="3" width="60" height="3" />
47
+
48
+ <rect x="21" y="90" rx="3" ry="3" width="42" height="3" />
49
+ <rect x="69" y="90" rx="3" ry="3" width="39" height="3" />
50
+ <rect x="114" y="90" rx="3" ry="3" width="24" height="3" />
51
+
52
+ <rect x="39" y="96" rx="3" ry="3" width="24" height="3" />
53
+ <rect x="69" y="96" rx="3" ry="3" width="45" height="3" />
54
+ <rect x="120" y="96" rx="3" ry="3" width="12" height="3" />
55
+
56
+ <rect x="39" y="102" rx="3" ry="3" width="30" height="3" />
57
+ <rect x="75" y="102" rx="3" ry="3" width="60" height="3" />
58
+
59
+ <rect x="21" y="111" rx="3" ry="3" width="42" height="3" />
60
+ <rect x="69" y="111" rx="3" ry="3" width="39" height="3" />
61
+ <rect x="114" y="111" rx="3" ry="3" width="24" height="3" />
62
+
63
+ <rect x="39" y="117" rx="3" ry="3" width="24" height="3" />
64
+ <rect x="69" y="117" rx="3" ry="3" width="45" height="3" />
65
+ <rect x="120" y="117" rx="3" ry="3" width="12" height="3" />
66
+
67
+ <rect x="39" y="123" rx="3" ry="3" width="30" height="3" />
68
+ <rect x="75" y="123" rx="3" ry="3" width="60" height="3" />
69
+ </content-loader>
70
+ </div>
71
+ </template>
72
+
73
+ <script>
74
+ import { defineAsyncComponent, defineComponent } from 'vue'
75
+ export default defineComponent({
76
+ name: 'LoaderElement',
77
+ components: {
78
+ ContentLoader: defineAsyncComponent(() =>
79
+ import('vue-content-loader').then((module) => module.ContentLoader)
80
+ ),
81
+ },
82
+ })
83
+ </script>
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <div>
3
+ <content-loader :width="200" :height="350" :speed="2">
4
+ <rect x="0" y="24" rx="3" ry="3" width="200" height="20" />
5
+ <rect x="20" y="49" rx="3" ry="3" width="200" height="20" />
6
+ <rect x="20" y="74" rx="3" ry="3" width="200" height="20" />
7
+ <rect x="20" y="124" rx="3" ry="3" width="200" height="20" />
8
+
9
+ <rect x="0" y="149" rx="3" ry="3" width="200" height="20" />
10
+ <rect x="20" y="174" rx="3" ry="3" width="200" height="20" />
11
+ <rect x="20" y="199" rx="3" ry="3" width="200" height="20" />
12
+ <rect x="20" y="249" rx="3" ry="3" width="200" height="20" />
13
+
14
+ <rect x="0" y="274" rx="3" ry="3" width="200" height="20" />
15
+ <rect x="20" y="299" rx="3" ry="3" width="200" height="20" />
16
+ <rect x="20" y="324" rx="3" ry="3" width="200" height="20" />
17
+ <rect x="20" y="349" rx="3" ry="3" width="200" height="20" />
18
+
19
+ <rect x="0" y="374" rx="3" ry="3" width="200" height="20" />
20
+ </content-loader>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ import { defineAsyncComponent, defineComponent } from 'vue'
26
+ export default defineComponent({
27
+ name: 'LoaderElement',
28
+ components: {
29
+ ContentLoader: defineAsyncComponent(() =>
30
+ import('vue-content-loader').then((module) => module.ContentLoader)
31
+ ),
32
+ },
33
+ })
34
+ </script>
@@ -6,7 +6,7 @@
6
6
  v-if="showModal"
7
7
  class="ac-modal is-middle-alignment"
8
8
  :class="modifierClasses"
9
- @click.self="destroyModal"
9
+ @click.self="onModalOutsideClick"
10
10
  >
11
11
  <div class="ac-modal-inner">
12
12
  <!-- modal header start -->
@@ -17,6 +17,7 @@
17
17
  <header-item>
18
18
  <ac-button
19
19
  modifier-classes="is-square is-transparent"
20
+ :disabled="isCloseOptionDisabled"
20
21
  :icon-image="crossIcon"
21
22
  @click.stop="destroyModal"
22
23
  />
@@ -26,7 +27,7 @@
26
27
  <!-- modal header end -->
27
28
 
28
29
  <!-- modal body start -->
29
- <div class="ac-modal-body">
30
+ <div class="ac-modal-body ac-vscrollbar">
30
31
  <div class="ac-modal-content">
31
32
  <!-- freedom content start -->
32
33
  <slot />
@@ -36,7 +37,12 @@
36
37
  <!-- modal body end -->
37
38
 
38
39
  <!-- modal footer start -->
39
- <div class="ac-modal-footer action-footer">
40
+ <div v-if="!hideActionFooter"
41
+ class="ac-modal-footer action-footer is-flex is-align-items-center is-justify-content-space-between"
42
+ >
43
+ <div>
44
+ <slot name="modal-footer-left" />
45
+ </div>
40
46
  <buttons class="has-text-right is-block">
41
47
  <slot name="modal-footer-controls" />
42
48
  </buttons>
@@ -54,32 +60,44 @@ export default defineComponent({
54
60
  props: {
55
61
  open: {
56
62
  type: Boolean,
57
- default: false,
63
+ default: false
58
64
  },
59
65
  title: {
60
66
  type: String,
61
- default: "Modal",
67
+ default: "Modal"
62
68
  },
63
69
  modifierClasses: {
64
70
  type: String,
65
- default: "",
71
+ default: ""
72
+ },
73
+ isCloseOptionDisabled: {
74
+ type: Boolean,
75
+ default: false
66
76
  },
77
+ ignoreOutsideClick: {
78
+ type: Boolean,
79
+ default: false
80
+ },
81
+ hideActionFooter: {
82
+ type: Boolean,
83
+ default: false
84
+ }
67
85
  },
68
86
  emits: ["closemodal"],
69
87
 
70
88
  components: {
71
89
  HeaderItems: defineAsyncComponent(() =>
72
- import("../../v2/header/HeaderItems.vue").then((module) => module.default)
90
+ import("../../v2/header/HeaderItems.vue").then(module => module.default)
73
91
  ),
74
92
  HeaderItem: defineAsyncComponent(() =>
75
- import("../../v2/header/HeaderItem.vue").then((module) => module.default)
93
+ import("../../v2/header/HeaderItem.vue").then(module => module.default)
76
94
  ),
77
95
  Buttons: defineAsyncComponent(() =>
78
- import("../../v2/button/Buttons.vue").then((module) => module.default)
96
+ import("../../v2/button/Buttons.vue").then(module => module.default)
79
97
  ),
80
98
  AcButton: defineAsyncComponent(() =>
81
- import("../button/Button.vue").then((module) => module.default)
82
- ),
99
+ import("../button/Button.vue").then(module => module.default)
100
+ )
83
101
  },
84
102
 
85
103
  data() {
@@ -87,7 +105,7 @@ export default defineComponent({
87
105
  showModal: false,
88
106
  crossIcon: import.meta.globEager(
89
107
  "/src/assets/icons/modal/close-icon.svg"
90
- )["/src/assets/icons/modal/close-icon.svg"].default,
108
+ )["/src/assets/icons/modal/close-icon.svg"].default
91
109
  };
92
110
  },
93
111
 
@@ -100,8 +118,8 @@ export default defineComponent({
100
118
  } else {
101
119
  this.destroyModal();
102
120
  }
103
- },
104
- },
121
+ }
122
+ }
105
123
  },
106
124
 
107
125
  methods: {
@@ -115,12 +133,17 @@ export default defineComponent({
115
133
  this.showModal = true;
116
134
  document.addEventListener("keydown", this.onKeyDown);
117
135
  },
136
+ onModalOutsideClick() {
137
+ if (this.ignoreOutsideClick) return;
138
+ this.destroyModal();
139
+ },
118
140
  destroyModal() {
141
+ if (this.isCloseOptionDisabled) return;
119
142
  this.showModal = false;
120
143
  document.removeEventListener("keydown", this.onKeyDown);
121
144
 
122
145
  this.$emit("closemodal", true);
123
- },
124
- },
146
+ }
147
+ }
125
148
  });
126
149
  </script>