@appscode/design-system 1.0.43-alpha.227 → 1.0.43-alpha.229

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.
@@ -0,0 +1,53 @@
1
+ .report-charts {
2
+ display: flex;
3
+ flex-direction: row;
4
+ justify-content: space-between;
5
+ padding-top: 20px;
6
+ gap: 20px;
7
+ align-items: center;
8
+ align-content: stretch;
9
+ }
10
+ .report-charts > * {
11
+ flex: 1;
12
+ }
13
+ .vulnerability-chart {
14
+ height: 250px;
15
+ width: 250px;
16
+ margin-right: 20px;
17
+ }
18
+
19
+ // tr {
20
+ // .vulnerability-chart {
21
+ // height: 200px;
22
+ // width: 200px;
23
+ // margin-right: 20px;
24
+ // }
25
+ // .vulnerability-table {
26
+ // height: 200px;
27
+ // }
28
+ // }
29
+ .vulnerability-table {
30
+ height: 250px;
31
+ thead {
32
+ tr {
33
+ th {
34
+ border: none;
35
+ padding: 4px 8px !important;
36
+ }
37
+ }
38
+ }
39
+ tbody {
40
+ tr {
41
+ td {
42
+ vertical-align: middle;
43
+ padding: 4px 8px;
44
+ }
45
+ }
46
+ }
47
+ }
48
+ .color-div {
49
+ height: 10px;
50
+ width: 10px;
51
+ display: inline-block;
52
+ margin-right: 5px;
53
+ }
@@ -207,6 +207,23 @@
207
207
  border-radius: 50%;
208
208
  }
209
209
  }
210
+
211
+ .collapsible-row {
212
+ max-height: 0;
213
+ overflow-y: hidden;
214
+
215
+ &.is-active {
216
+ max-height: 60vh;
217
+ overflow-y: overlay;
218
+ animation: expand 0.5s ease-in-out;
219
+ }
220
+
221
+ &.is-closed {
222
+ max-height: 0;
223
+ overflow-y: hidden;
224
+ animation: collapse 0.5s ease-in-out;
225
+ }
226
+ }
210
227
  }
211
228
 
212
229
  .options-items {
@@ -418,12 +435,45 @@
418
435
  color: $ac-primary;
419
436
  }
420
437
 
421
- // table inner shadow
438
+ // table inner shadow
422
439
  .table-inner-shadow {
423
440
  border-radius: 0px;
424
441
  background: $ac-white-lighter;
425
- box-shadow: inset 5px 5px 10px #e3e6e9,
426
- inset -5px -5px 10px #ffffff;
442
+ box-shadow: inset 5px 5px 10px #e3e6e9, inset -5px -5px 10px #ffffff;
443
+ }
444
+
445
+ @keyframes expand {
446
+ from {
447
+ max-height: 0;
448
+ overflow-y: hidden;
449
+ }
450
+ 1% {
451
+ overflow-y: hidden;
452
+ }
453
+ 99% {
454
+ overflow-y: hidden;
455
+ }
456
+ to {
457
+ max-height: 60vh;
458
+ overflow-y: overlay;
459
+ }
460
+ }
461
+
462
+ @keyframes collapse {
463
+ from {
464
+ max-height: 60vh;
465
+ overflow-y: overlay;
466
+ }
467
+ 1% {
468
+ overflow-y: hidden;
469
+ }
470
+ 99% {
471
+ overflow-y: hidden;
472
+ }
473
+ to {
474
+ max-height: 0;
475
+ overflow-y: hidden;
476
+ }
427
477
  }
428
478
 
429
479
  // GENERAL TABLE END
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "1.0.43-alpha.227",
3
+ "version": "1.0.43-alpha.229",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -255,15 +255,23 @@ onBeforeUnmount(() => {
255
255
  const longRunningTaskStatus = computed(() => {
256
256
  let successTaskCount = 0;
257
257
  let failedTaskCount = 0;
258
+
259
+ // get count of success and failed task
258
260
  tasks.value.forEach((task) => {
259
261
  if (task?.status === "Success") successTaskCount++;
260
262
  else if (task?.status === "Failed") failedTaskCount++;
261
263
  });
262
264
 
263
265
  if (tasks.value.length === 0) return "NotStarted";
266
+ // if all the task has been successful
264
267
  else if (successTaskCount === tasks.value.length) {
265
268
  return "Success";
266
- } else if (failedTaskCount === tasks.value.length) {
269
+ }
270
+ // if all the task has been completed and some tasks are failed
271
+ else if (
272
+ failedTaskCount &&
273
+ successTaskCount + failedTaskCount === tasks.value.length
274
+ ) {
267
275
  return "Failed";
268
276
  } else return "Pending";
269
277
  });
@@ -1,22 +1,22 @@
1
1
  <template>
2
2
  <router-link
3
3
  v-if="link"
4
+ v-slot="{ navigate }"
4
5
  event="click"
5
6
  :to="link"
6
7
  custom
7
- v-slot="{ navigate }"
8
8
  >
9
9
  <tr
10
10
  class="is-link"
11
- @click="navigate"
12
11
  v-bind="$attrs"
13
12
  data-testid="ac-table-row"
13
+ @click="navigate"
14
14
  >
15
15
  <table-cell v-if="collapsible">
16
16
  <collapsible-button
17
- @click.stop="toggleCollapse"
18
17
  modifier-classes="is-square is-light height-20 width-20 is-rounded is-size-7"
19
18
  :icon-class="isCollapsed ? 'chevron-right' : 'chevron-down'"
19
+ @click.stop="toggleCollapse"
20
20
  />
21
21
  </table-cell>
22
22
  <slot />
@@ -39,9 +39,9 @@
39
39
  >
40
40
  <table-cell v-if="collapsible">
41
41
  <collapsible-button
42
- @click.stop="toggleCollapse"
43
42
  modifier-classes="is-square is-light height-20 width-20 is-rounded is-size-7"
44
43
  :icon-class="isCollapsed ? 'chevron-right' : 'chevron-down'"
44
+ @click.stop="toggleCollapse"
45
45
  />
46
46
  </table-cell>
47
47
  <slot />
@@ -50,11 +50,15 @@
50
50
  :fake-cell-width="fakeCellWidth"
51
51
  />
52
52
  </tr>
53
- <tr v-if="collapsible && !isCollapsed" v-bind="$attrs">
54
- <table-cell colspan="1000" class="table-inner-shadow">
55
- <slot name="collapsible-content" />
56
- </table-cell>
57
- </tr>
53
+ <transition name="slide-down" mode="out-in" appear>
54
+ <tr v-if="collapsible && !isCollapsed" v-bind="$attrs">
55
+ <table-cell colspan="1000" class="table-inner-shadow">
56
+ <div ref="collapsibleRow" class="collapsible-row">
57
+ <slot name="collapsible-content" />
58
+ </div>
59
+ </table-cell>
60
+ </tr>
61
+ </transition>
58
62
  </template>
59
63
 
60
64
  <script>
@@ -88,13 +92,17 @@ export default defineComponent({
88
92
 
89
93
  components: {
90
94
  TableCell: defineAsyncComponent(() =>
91
- import("./TableCell.vue").then((module) => module.default)
95
+ import(
96
+ "@appscode/design-system/vue-components/v3/table/TableCell.vue"
97
+ ).then((module) => module.default)
92
98
  ),
93
99
  FakeTableCell: defineAsyncComponent(() =>
94
- import("./FakeTableCell.vue").then((module) => module.default)
100
+ import(
101
+ "@appscode/design-system/vue-components/v3/table/FakeTableCell.vue"
102
+ ).then((module) => module.default)
95
103
  ),
96
104
  CollapsibleButton: defineAsyncComponent(() =>
97
- import("../button/Button.vue")
105
+ import("@appscode/design-system/vue-components/v3/button/Button.vue")
98
106
  ),
99
107
  },
100
108
 
@@ -106,11 +114,29 @@ export default defineComponent({
106
114
 
107
115
  methods: {
108
116
  toggleCollapse() {
109
- this.isCollapsed = !this.isCollapsed;
110
- if (!this.isCollapsed) {
111
- this.$emit("rowexpand", this.collapseRow);
117
+ const newVal = !this.isCollapsed;
118
+ if (!newVal) {
119
+ this.isCollapsed = newVal;
120
+ // show expand animation
121
+ this.$nextTick(() => {
122
+ setTimeout(() => {
123
+ if (this.$refs.collapsibleRow) {
124
+ this.$refs.collapsibleRow.classList.remove("is-closed");
125
+ this.$refs.collapsibleRow.classList.add("is-active");
126
+ }
127
+ this.$emit("rowexpand", this.collapseRow);
128
+ }, 0);
129
+ });
112
130
  } else {
113
- this.$emit("rowcollapse");
131
+ if (this.$refs.collapsibleRow) {
132
+ this.$refs.collapsibleRow.classList.remove("is-active");
133
+ this.$refs.collapsibleRow.classList.add("is-closed");
134
+ }
135
+ setTimeout(() => {
136
+ // remove row after animation finish
137
+ this.isCollapsed = newVal;
138
+ this.$emit("rowcollapse");
139
+ }, 100);
114
140
  }
115
141
  },
116
142
  collapseRow() {