@appscode/design-system 2.2.42 → 2.2.44

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": "2.2.42",
3
+ "version": "2.2.44",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -7,6 +7,23 @@
7
7
  left: 0;
8
8
  top: 0;
9
9
  z-index: 99999;
10
+ &.is-side-panel-modal {
11
+ margin: 0;
12
+ padding: 0;
13
+ min-height: 100vh;
14
+ left: auto;
15
+ right: 0;
16
+ .ac-modal-inner {
17
+ margin: 0 0 0 auto;
18
+ height: 100vh;
19
+ border-radius: 0;
20
+ max-width: 1200px;
21
+ .ac-modal-body {
22
+ height: calc(100vh - 110px);
23
+ max-height: inherit;
24
+ }
25
+ }
26
+ }
10
27
  .ac-button {
11
28
  &.is-white {
12
29
  margin-right: -10px;
@@ -111,4 +111,7 @@
111
111
  // is-warning
112
112
  .ac-notification.is-warning {
113
113
  @include acNotification($warning);
114
+ p {
115
+ color: $yellow-5 !important;
116
+ }
114
117
  }
@@ -167,7 +167,7 @@
167
167
  }
168
168
  }
169
169
 
170
- .multiselect__tags>span {
170
+ .multiselect__tags > span {
171
171
  font-size: 13px;
172
172
  line-height: 1.6;
173
173
  color: $color-heading;
@@ -349,7 +349,6 @@
349
349
  }
350
350
 
351
351
  &.is-danger {
352
-
353
352
  input,
354
353
  .ac-card,
355
354
  textarea {
@@ -362,7 +361,6 @@
362
361
  }
363
362
 
364
363
  &.is-loading {
365
-
366
364
  input,
367
365
  .ac-card,
368
366
  textarea {
@@ -464,7 +462,6 @@ li {
464
462
 
465
463
  .multi-select-wrapper.is-small {
466
464
  .multiselect .multiselect__tags {
467
-
468
465
  .multiselect__input,
469
466
  .multiselect__single {
470
467
  top: 3.5px !important;
@@ -516,8 +513,19 @@ li {
516
513
  }
517
514
  }
518
515
  }
516
+ .multiselect__tags {
517
+ .multiselect__single {
518
+ overflow: hidden;
519
+ text-overflow: ellipsis;
520
+ display: -webkit-box;
521
+ line-clamp: 1;
522
+ -webkit-line-clamp: 1;
523
+ box-orient: vertical;
524
+ -webkit-box-orient: vertical;
525
+ }
526
+ }
519
527
 
520
- // clear
528
+ // clear
521
529
  &.has-clear-button {
522
530
  &.has-refresh-button {
523
531
  .multiselect__select {
@@ -562,7 +570,9 @@ li {
562
570
  z-index: 99;
563
571
  right: 0px;
564
572
  }
565
-
573
+ .multiselect__tags {
574
+ padding: 3px 60px 4px 20px !important;
575
+ }
566
576
  .button {
567
577
  &.is-clear {
568
578
  right: 30px;
@@ -570,11 +580,9 @@ li {
570
580
  }
571
581
  }
572
582
 
573
- // clear
574
-
583
+ // clear
575
584
 
576
585
  .button {
577
-
578
586
  &.is-information,
579
587
  &.is-refresh,
580
588
  &.is-clear {
@@ -673,16 +681,21 @@ li {
673
681
  Responsive Classes
674
682
  *****************************************/
675
683
  // Extra small devices (portrait phones, less than 576px)
676
- @media (max-width: 575.98px) {}
684
+ @media (max-width: 575.98px) {
685
+ }
677
686
 
678
687
  // Small devices (landscape phones, 576px and up)
679
- @media (min-width: 576px) and (max-width: 767.98px) {}
688
+ @media (min-width: 576px) and (max-width: 767.98px) {
689
+ }
680
690
 
681
691
  // Medium devices (tablets, 768px and up)
682
- @media (min-width: 768px) and (max-width: 991.98px) {}
692
+ @media (min-width: 768px) and (max-width: 991.98px) {
693
+ }
683
694
 
684
695
  // Large devices (desktops, 992px and up)
685
- @media (min-width: 992px) and (max-width: 1199.98px) {}
696
+ @media (min-width: 992px) and (max-width: 1199.98px) {
697
+ }
686
698
 
687
699
  // Extra large devices (large desktops, 1200px and up)
688
- @media (min-width: 1200px) {}
700
+ @media (min-width: 1200px) {
701
+ }
@@ -9,6 +9,8 @@ import HeroiconsTrash from "~icons/heroicons/trash";
9
9
  import HeroiconsChevronDownSolid from "~icons/heroicons/chevron-down-solid";
10
10
  import HeroiconsChevronUpSolid from "~icons/heroicons/chevron-up-solid";
11
11
 
12
+ const JsonModal = defineAsyncComponent(() => import("../modals/JsonShowModal.vue"));
13
+
12
14
  interface Props {
13
15
  disabled?: boolean;
14
16
  isCreateDisabled?: boolean;
@@ -49,6 +51,8 @@ const editFieldIndex = ref(-1);
49
51
  const isFormHidden = ref(true);
50
52
  const isSavingNewElement = ref(false);
51
53
  const dataForTable = defineModel<Array<AcTableRow>>({ required: true });
54
+ const isOpen = ref(false);
55
+ const fullNamespaceList = ref<string[]>([]);
52
56
 
53
57
  function onAddClick() {
54
58
  isSavingNewElement.value = true;
@@ -85,12 +89,33 @@ function onDetailsClick(row: number) {
85
89
  editFieldIndex.value = -1;
86
90
  }
87
91
 
88
- function readableTime(utcTime: string) {
89
- return new Date(utcTime).toLocaleString();
92
+ function readableTime(utcTime: unknown) {
93
+ if (typeof utcTime === "string") return new Date(utcTime).toLocaleString();
94
+ else return utcTime;
95
+ }
96
+ function truncatedNamespaces(namespaces: string[]): string {
97
+ if (namespaces.length <= 1) {
98
+ return namespaces[0];
99
+ }
100
+ return namespaces.slice(0, 1).join(", ") + ` (+${namespaces.length - 1})`;
101
+ }
102
+
103
+ function showFullNamespaceList(namespaces: string[]): void {
104
+ isOpen.value = true;
105
+
106
+ fullNamespaceList.value = namespaces;
90
107
  }
91
108
  </script>
92
109
 
93
110
  <template>
111
+ <json-modal
112
+ v-if="isOpen"
113
+ :open="isOpen"
114
+ :title="'Namespace List'"
115
+ :editor-content="fullNamespaceList"
116
+ @closemodal="isOpen = false"
117
+ ></json-modal>
118
+
94
119
  <div :class="{ 'ac-nested-elements': label }">
95
120
  <!-- Add New Form Start -->
96
121
  <template v-if="isSavingNewElement">
@@ -181,12 +206,23 @@ function readableTime(utcTime: string) {
181
206
  <tbody>
182
207
  <template v-for="(itemRow, idxRow) in dataForTable" :key="idxRow">
183
208
  <tr data-testid="ac-table-row">
184
- <td
185
- v-for="(itemColumn, idx) in itemRow.cells"
186
- :key="itemColumn.data as string || 'namespace' + idx"
187
- >
209
+ <td v-for="(itemColumn, idx) in itemRow.cells" :key="tableHeaders[idx].name + idx">
188
210
  <template v-if="tableHeaders[idx].type === 'date'">
189
- {{ readableTime(itemColumn.data as string) }}
211
+ {{ readableTime(itemColumn.data) }}
212
+ </template>
213
+ <template
214
+ v-else-if="tableHeaders[idx].name.toLowerCase() === 'namespace' && Array.isArray(itemColumn.data)"
215
+ >
216
+ <span
217
+ >{{ truncatedNamespaces(itemColumn.data) }}
218
+ <div
219
+ v-if="itemColumn.data.length > 1"
220
+ class="tag is-secondary is-light"
221
+ @click="showFullNamespaceList(itemColumn.data)"
222
+ >
223
+ <a>More </a>
224
+ </div></span
225
+ >
190
226
  </template>
191
227
  <template v-else>
192
228
  {{ itemColumn.data }}
@@ -104,9 +104,7 @@ const handleCancel = (event: Event) => {
104
104
 
105
105
  <div class="ac-modal-body ac-vscrollbar" data-testid="ac-modal-content-with-scroll">
106
106
  <div class="ac-modal-content">
107
- <div class="action-message pt-35 pb-35 has-text-centered">
108
- <slot />
109
- </div>
107
+ <slot />
110
108
  </div>
111
109
  </div>
112
110
 
@@ -0,0 +1,70 @@
1
+ <script setup lang="ts">
2
+ import { defineAsyncComponent } from "vue";
3
+
4
+ interface Props {
5
+ title?: string;
6
+ message?: string;
7
+ itemName?: string;
8
+ modifierClasses?: string;
9
+ isDeleteActive?: boolean;
10
+ disableModalClose?: boolean;
11
+ ignoreOutsideClick?: boolean;
12
+ hideActionFooter?: boolean;
13
+ }
14
+
15
+ withDefaults(defineProps<Props>(), {
16
+ title: "Sidebar Modal",
17
+ message: "Side Panel modal message",
18
+ itemName: "",
19
+ modifierClasses: "is-side-panel-modal",
20
+ isDeleteActive: false,
21
+ disableModalClose: false,
22
+ ignoreOutsideClick: false,
23
+ hideActionFooter: false,
24
+ });
25
+
26
+ defineEmits(["onDelete"]);
27
+
28
+ const open = defineModel({ type: Boolean });
29
+
30
+ const Modal = defineAsyncComponent(() => import("./DialogModal.vue"));
31
+ const AcButton = defineAsyncComponent(() => import("./../button/Button.vue"));
32
+ </script>
33
+
34
+ <template>
35
+ <!-- modal start -->
36
+
37
+ <modal
38
+ v-model="open"
39
+ :title="title"
40
+ :class="modifierClasses"
41
+ :hide-action-footer="hideActionFooter"
42
+ :disable-modal-close="disableModalClose"
43
+ :ignore-outside-click="ignoreOutsideClick"
44
+ >
45
+ <!-- freedom content start -->
46
+ <h1>Lorem ipsum dolor sit amet consectetur adipisicing elit. beatae.</h1>
47
+ <!-- freedom content end -->
48
+
49
+ <!-- modal footer start -->
50
+ <template #modal-footer-left>
51
+ <div class="buttons">
52
+ <ac-button
53
+ title="Yes, Do this"
54
+ modifier-classes="is-primary"
55
+ :is-loader-active="isDeleteActive"
56
+ @click.stop="$emit('onDelete', itemName)"
57
+ data-testid="delete-confirmation-modal-confirm-button"
58
+ />
59
+ <ac-button
60
+ @click.stop="open = false"
61
+ title="Cancel"
62
+ modifier-classes="is-outlined"
63
+ :disabled="isDeleteActive || disableModalClose"
64
+ data-testid="delete-confirmation-modal-close-button"
65
+ />
66
+ </div>
67
+ </template>
68
+ </modal>
69
+ <!-- modal end -->
70
+ </template>
@@ -39,12 +39,9 @@ withDefaults(defineProps<Props>(), {
39
39
  <!-- brand logo -->
40
40
  <router-link class="is-flex brand-logo" :to="url">
41
41
  <img :src="brandLogo" alt="brand-logo" :class="modifierClasses" />
42
+ <span v-if="productName" class="brand-tag">{{ productName }}</span>
42
43
  </router-link>
43
44
  <!-- brand logo -->
44
-
45
- <!-- brand logo -->
46
- <span v-if="productName" class="brand-tag">{{ productName }}</span>
47
- <!-- brand logo -->
48
45
  </div>
49
46
  </template>
50
47