@appscode/design-system 1.0.43-alpha.101 → 1.0.43-alpha.105

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "1.0.43-alpha.101",
3
+ "version": "1.0.43-alpha.105",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -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>
@@ -103,66 +103,58 @@
103
103
  <script>
104
104
  export default {
105
105
  components: {
106
- AcButton: () =>
107
- import("@appscode/design-system/vue-components/v2/button/Button"),
108
- Editor: () =>
109
- import("@appscode/design-system/vue-components/v2/editor/Editor.vue"),
110
- ContentTable: () =>
111
- import(
112
- "@appscode/design-system/vue-components/v2/content/ContentTable.vue"
113
- ),
114
- HeaderItem: () =>
115
- import("@appscode/design-system/vue-components/v2/header/HeaderItem.vue"),
116
- AcButton: () =>
117
- import("@appscode/design-system/vue-components/v2/button/Button"),
118
- DownloadBtn: () => import("@/components/buttons/DownloadBtn.vue"),
106
+ AcButton: () => import("./../button/Button.vue"),
107
+ Editor: () => import("./../editor/Editor.vue"),
108
+ ContentTable: () => import("./../content/ContentTable.vue"),
109
+ HeaderItem: () => import("./../header/HeaderItem.vue"),
110
+ DownloadBtn: () => import("./../button/DownloadBtn.vue"),
119
111
  DeleteConfirmationModal: () =>
120
- import("@/components/modals/DeleteConfirmationModal.vue"),
121
- ResourceLoader: () => import("@/components/loaders/ResourceLoader.vue"),
122
- SidebarLoader: () => import("@/components/loaders/SidebarLoader.vue"),
112
+ import("./../modals/DeleteConfirmationModal.vue"),
113
+ ResourceLoader: () => import("./../loaders/ResourceLoader.vue"),
114
+ SidebarLoader: () => import("./../loaders/SidebarLoader.vue")
123
115
  },
124
116
  props: {
125
117
  title: {
126
118
  type: String,
127
- default: "Title",
119
+ default: "Title"
128
120
  },
129
121
  isSearchable: {
130
122
  type: Boolean,
131
- default: false,
123
+ default: false
132
124
  },
133
125
  isPreviewLoading: {
134
126
  type: Boolean,
135
- default: false,
127
+ default: false
136
128
  },
137
129
  isEditorReadOnly: {
138
130
  type: Boolean,
139
- default: false,
131
+ default: false
140
132
  },
141
133
  previewYamls: {
142
134
  type: Array,
143
135
  default: () => {
144
136
  [];
145
- },
137
+ }
146
138
  },
147
139
  visibleBtn: {
148
140
  type: Object,
149
141
  default: () => {
150
142
  return {};
151
- },
152
- },
143
+ }
144
+ }
153
145
  },
154
146
  data() {
155
147
  return {
156
148
  activePreview: "",
157
149
  activeKey: 0,
158
150
  hideValue: "",
159
- showDeleteDataModal: false,
151
+ showDeleteDataModal: false
160
152
  };
161
153
  },
162
154
  computed: {
163
155
  activeFile() {
164
156
  const activeFile = this.previewYamls.find(
165
- (p) => p.name === this.activePreview
157
+ p => p.name === this.activePreview
166
158
  );
167
159
 
168
160
  return activeFile || { content: "", format: "yaml" };
@@ -186,7 +178,7 @@ export default {
186
178
  showDeleteBtn() {
187
179
  if (this.visibleBtn.showDeleteBtn) return true;
188
180
  else return false;
189
- },
181
+ }
190
182
  },
191
183
  methods: {
192
184
  initActivePreview() {
@@ -215,7 +207,7 @@ export default {
215
207
  },
216
208
  confirmDelete(flag) {
217
209
  if (flag) this.$emit("deleteResource", this.activeKey);
218
- },
210
+ }
219
211
  },
220
212
  watch: {
221
213
  previewYamls: {
@@ -225,8 +217,8 @@ export default {
225
217
  if (n.length) {
226
218
  this.initActivePreview();
227
219
  }
228
- },
229
- },
230
- },
220
+ }
221
+ }
222
+ }
231
223
  };
232
224
  </script>
@@ -0,0 +1,90 @@
1
+ <template>
2
+ <div>
3
+ <content-loader
4
+ :width="100"
5
+ :height="40"
6
+ :speed="2"
7
+ :primaryColor="'#f5f7f9'"
8
+ >
9
+ <rect x="1" y="1" rx="1" ry="1" width="14" height="1" />
10
+ <rect x="17" y="1" rx="1" ry="1" width="13" height="1" />
11
+ <rect x="32" y="1" rx="1" ry="1" width="8" height="1" />
12
+
13
+ <rect x="7" y="3" rx="1" ry="1" width="14" height="1" />
14
+ <rect x="23" y="3" rx="1" ry="1" width="13" height="1" />
15
+ <rect x="38" y="3" rx="1" ry="1" width="8" height="1" />
16
+
17
+ <rect x="13" y="5" rx="1" ry="1" width="8" height="1" />
18
+ <rect x="23" y="5" rx="1" ry="1" width="15" height="1" />
19
+ <rect x="40" y="5" rx="1" ry="1" width="4" height="1" />
20
+
21
+ <rect x="13" y="7" rx="1" ry="1" width="10" height="1" />
22
+ <rect x="25" y="7" rx="1" ry="1" width="20" height="1" />
23
+
24
+ <rect x="7" y="10" rx="1" ry="1" width="14" height="1" />
25
+ <rect x="23" y="10" rx="1" ry="1" width="13" height="1" />
26
+ <rect x="38" y="10" rx="1" ry="1" width="8" height="1" />
27
+
28
+ <rect x="13" y="12" rx="1" ry="1" width="8" height="1" />
29
+ <rect x="23" y="12" rx="1" ry="1" width="15" height="1" />
30
+ <rect x="40" y="12" rx="1" ry="1" width="4" height="1" />
31
+
32
+ <rect x="13" y="14" rx="1" ry="1" width="10" height="1" />
33
+ <rect x="25" y="14" rx="1" ry="1" width="20" height="1" />
34
+
35
+ <rect x="7" y="17" rx="1" ry="1" width="14" height="1" />
36
+ <rect x="23" y="17" rx="1" ry="1" width="13" height="1" />
37
+ <rect x="38" y="17" rx="1" ry="1" width="8" height="1" />
38
+
39
+ <rect x="13" y="19" rx="1" ry="1" width="8" height="1" />
40
+ <rect x="23" y="19" rx="1" ry="1" width="15" height="1" />
41
+ <rect x="40" y="19" rx="1" ry="1" width="4" height="1" />
42
+
43
+ <rect x="7" y="22" rx="1" ry="1" width="14" height="1" />
44
+ <rect x="23" y="22" rx="1" ry="1" width="13" height="1" />
45
+ <rect x="38" y="22" rx="1" ry="1" width="8" height="1" />
46
+
47
+ <rect x="13" y="24" rx="1" ry="1" width="8" height="1" />
48
+ <rect x="23" y="24" rx="1" ry="1" width="15" height="1" />
49
+ <rect x="40" y="24" rx="1" ry="1" width="4" height="1" />
50
+
51
+ <rect x="1" y="26" rx="1" ry="1" width="14" height="1" />
52
+ <rect x="17" y="26" rx="1" ry="1" width="13" height="1" />
53
+ <rect x="32" y="26" rx="1" ry="1" width="8" height="1" />
54
+
55
+ <rect x="7" y="29" rx="1" ry="1" width="14" height="1" />
56
+ <rect x="23" y="29" rx="1" ry="1" width="13" height="1" />
57
+ <rect x="38" y="29" rx="1" ry="1" width="8" height="1" />
58
+
59
+ <rect x="13" y="31" rx="1" ry="1" width="8" height="1" />
60
+ <rect x="23" y="31" rx="1" ry="1" width="15" height="1" />
61
+ <rect x="40" y="31" rx="1" ry="1" width="4" height="1" />
62
+
63
+ <rect x="7" y="33" rx="1" ry="1" width="14" height="1" />
64
+ <rect x="23" y="33" rx="1" ry="1" width="13" height="1" />
65
+ <rect x="38" y="33" rx="1" ry="1" width="8" height="1" />
66
+
67
+ <rect x="13" y="35" rx="1" ry="1" width="8" height="1" />
68
+ <rect x="23" y="35" rx="1" ry="1" width="15" height="1" />
69
+ <rect x="40" y="35" rx="1" ry="1" width="4" height="1" />
70
+
71
+ <rect x="13" y="37" rx="1" ry="1" width="8" height="1" />
72
+ <rect x="23" y="37" rx="1" ry="1" width="15" height="1" />
73
+ <rect x="40" y="37" rx="1" ry="1" width="4" height="1" />
74
+
75
+ <rect x="1" y="39" rx="1" ry="1" width="14" height="1" />
76
+ <rect x="17" y="39" rx="1" ry="1" width="13" height="1" />
77
+ <rect x="32" y="39" rx="1" ry="1" width="8" height="1" />
78
+ </content-loader>
79
+ </div>
80
+ </template>
81
+
82
+ <script>
83
+ import { ContentLoader } from "vue-content-loader";
84
+
85
+ export default {
86
+ components: {
87
+ ContentLoader,
88
+ },
89
+ };
90
+ </script>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <div>
3
+ <content-loader
4
+ :width="100"
5
+ :height="175"
6
+ :speed="2"
7
+ :primaryColor="'#dcdee6'"
8
+ >
9
+ <rect x="2" y="1" rx="3" ry="3" width="96" height="20" />
10
+ <rect x="15" y="23" rx="3" ry="3" width="83" height="15" />
11
+ <rect x="15" y="40" rx="3" ry="3" width="83" height="15" />
12
+ <rect x="15" y="57" rx="3" ry="3" width="83" height="15" />
13
+
14
+ <rect x="2" y="78" rx="3" ry="3" width="96" height="20" />
15
+ <rect x="15" y="100" rx="3" ry="3" width="83" height="15" />
16
+ <rect x="15" y="117" rx="3" ry="3" width="83" height="15" />
17
+ <rect x="15" y="134" rx="3" ry="3" width="83" height="15" />
18
+
19
+ <rect x="2" y="155" rx="3" ry="3" width="96" height="20" />
20
+ </content-loader>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ import { ContentLoader } from "vue-content-loader";
26
+
27
+ export default {
28
+ components: {
29
+ ContentLoader,
30
+ },
31
+ };
32
+ </script>
@@ -0,0 +1,77 @@
1
+ <template>
2
+ <!-- modal start -->
3
+ <modal
4
+ :title="title"
5
+ modifier-classes="is-normal"
6
+ :open="open"
7
+ @closemodal="closeModal"
8
+ >
9
+ <!-- freedom content start -->
10
+ <div class="action-message pt-35 pb-35 has-text-centered">
11
+ <h5 class="is-message">{{ message }} {{ itemName ? "" : "?" }}</h5>
12
+ <p class="is-description">{{ itemName }} {{ itemName ? "?" : "" }}</p>
13
+ </div>
14
+
15
+ <!-- freedom content end -->
16
+
17
+ <!-- modal footer start -->
18
+ <template #modal-footer-controls>
19
+ <ac-button
20
+ @click.stop="closeModal"
21
+ title="Cancel"
22
+ modifier-classes="is-outlined"
23
+ />
24
+ <ac-button
25
+ modifier-classes="is-danger"
26
+ :is-loader-active="isDeleteActive"
27
+ title="Yes"
28
+ @click.stop="confirm(true)"
29
+ />
30
+ </template>
31
+ </modal>
32
+ <!-- modal end -->
33
+ </template>
34
+
35
+ <script>
36
+ export default {
37
+ components: {
38
+ Modal: () => import("./../modal/Modal.vue"),
39
+ AcButton: () => import("./../button/Button.vue")
40
+ },
41
+ props: {
42
+ open: {
43
+ type: Boolean,
44
+ default: false
45
+ },
46
+ title: {
47
+ type: String,
48
+ default: ""
49
+ },
50
+ message: {
51
+ type: String,
52
+ default: ""
53
+ },
54
+ itemName: {
55
+ type: String,
56
+ default: ""
57
+ },
58
+ isLoading: {
59
+ type: Boolean,
60
+ default: false
61
+ },
62
+ isDeleteActive: {
63
+ type: Boolean,
64
+ default: false
65
+ }
66
+ },
67
+ methods: {
68
+ confirm(response) {
69
+ this.$emit("delete-confirmation-modal$confirm", response);
70
+ },
71
+ closeModal() {
72
+ this.confirm(false);
73
+ this.$emit("closemodal", true);
74
+ }
75
+ }
76
+ };
77
+ </script>
@@ -28,6 +28,9 @@
28
28
  <a :href="`${serverDomain}/admin`"> Site Administration </a>
29
29
  </li>
30
30
  </template>
31
+ <li>
32
+ <a :href="`${serverDomain}/dashboard`"> Dashboard </a>
33
+ </li>
31
34
  <li>
32
35
  <a :href="`${serverDomain}/user/logout`"> Sign out </a>
33
36
  </li>
@@ -0,0 +1,120 @@
1
+ <template>
2
+ <li :class="`is-${dropDownStatus}`">
3
+ <a class="ac-dropdown-button" :title="title" @click="toggleDropDownStatus">
4
+ <span>
5
+ <img :src="icon" alt="icon" />
6
+ </span>
7
+ <strong>{{ title || "-" }}</strong>
8
+ <span class="ac-arrow-down">
9
+ <i class="fa fa-angle-down" aria-hidden="true"> </i>
10
+ </span>
11
+ </a>
12
+
13
+ <ul ref="sectionItems" :style="{ maxHeight: dropDownSectionHeight }">
14
+ <slot />
15
+ </ul>
16
+ </li>
17
+ </template>
18
+
19
+ <script>
20
+ import { defineComponent } from "vue";
21
+
22
+ export default defineComponent({
23
+ props: {
24
+ isDropDownOpen: {
25
+ type: Boolean,
26
+ default: false,
27
+ },
28
+ title: {
29
+ type: String,
30
+ default: "Sidebar Item",
31
+ },
32
+ icon: {
33
+ type: String,
34
+ default: "@/assets/images/icons/basic.svg",
35
+ },
36
+ },
37
+
38
+ emits: ["dropDownItemChange"],
39
+
40
+ data() {
41
+ return {
42
+ dropDownStatus: "close",
43
+ dropDownSectionHeight: null,
44
+ isCompMounted: false,
45
+ };
46
+ },
47
+
48
+ mounted() {
49
+ this.isCompMounted = true;
50
+ setTimeout(() => {
51
+ // for expanding dropdown
52
+ if (this.isDropDownOpen) {
53
+ this.setDropdownMaxHeight("open");
54
+ } else {
55
+ this.setDropdownMaxHeight("close");
56
+ }
57
+ }, 700);
58
+ },
59
+
60
+ watch: {
61
+ title(n, o) {
62
+ if (n && this.isCompMounted) {
63
+ this.$nextTick(() => {
64
+ // for expanding dropdown
65
+ this.setDropdownMaxHeight("open");
66
+ });
67
+ }
68
+
69
+ if (o && this.isCompMounted) {
70
+ this.$nextTick(() => {
71
+ // for expanding dropdown
72
+ this.setDropdownMaxHeight("close");
73
+ });
74
+ }
75
+ },
76
+ isDropDownOpen: {
77
+ immediate: true,
78
+ handler(n) {
79
+ if (n) {
80
+ this.dropDownStatus = "open";
81
+ } else this.dropDownStatus = "close";
82
+ },
83
+ },
84
+ dropDownStatus: {
85
+ immediate: true,
86
+ handler(n) {
87
+ if (n === "open") {
88
+ // emit event to close other drop down items
89
+ this.$emit("dropDownItemChange");
90
+
91
+ this.$nextTick(() => {
92
+ const dropDownUl = this.$refs["sectionItems"];
93
+ // debugger;
94
+ if (dropDownUl)
95
+ this.dropDownSectionHeight = `${dropDownUl.scrollHeight}px`;
96
+ });
97
+ } else {
98
+ // emit event to close other drop down items
99
+ this.dropDownSectionHeight = null;
100
+ }
101
+ },
102
+ },
103
+ },
104
+
105
+ methods: {
106
+ setDropdownMaxHeight(mode) {
107
+ if (mode === "open") {
108
+ this.dropDownSectionHeight = `${this.$refs["sectionItems"].scrollHeight}px`;
109
+ } else {
110
+ this.dropDownSectionHeight = null;
111
+ }
112
+ },
113
+ toggleDropDownStatus() {
114
+ if (this.dropDownStatus === "open") {
115
+ this.dropDownStatus = "close";
116
+ } else this.dropDownStatus = "open";
117
+ },
118
+ },
119
+ });
120
+ </script>