@appscode/design-system 2.5.10 → 2.6.0-node22

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.5.10",
3
+ "version": "2.6.0-node22",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -14,7 +14,7 @@ const route = useRoute();
14
14
 
15
15
  const pathReplaceWithParam = (path: string) => {
16
16
  //Split the path and remove the first and last empty block
17
- let splitPath = path.split("/").filter((element) => element !== "");
17
+ const splitPath = path.split("/").filter((element) => element !== "");
18
18
 
19
19
  //Replace all element with query params where the element start with ":"
20
20
  // Then again add them wthi "/" and return the path value
@@ -37,7 +37,7 @@ const createVal = (startIdx: number, paths: Array<string>) => {
37
37
 
38
38
  const createList = (paths: Array<string>) => {
39
39
  //Split all the path and remove all empty block
40
- let spath = paths.map((element) => {
40
+ const spath = paths.map((element) => {
41
41
  return element.split("/").filter((word) => word !== "");
42
42
  });
43
43
 
@@ -186,11 +186,11 @@ export default defineComponent({
186
186
  this.$emit("editorDidMount", this.editor);
187
187
  },
188
188
  _setValue(value) {
189
- let editor = this._getEditor();
189
+ const editor = this._getEditor();
190
190
  if (editor) return editor.setValue(value);
191
191
  },
192
192
  _getValue() {
193
- let editor = this._getEditor();
193
+ const editor = this._getEditor();
194
194
  if (!editor) return "";
195
195
  return editor.getValue();
196
196
  },
@@ -27,6 +27,9 @@ interface Props {
27
27
  saveNewItem?: Function;
28
28
  onDeleteItem: Function;
29
29
  initiallyHidden?: boolean;
30
+ showCustomMessage?: boolean;
31
+ buttonLabel?: string;
32
+ formLabel?: string;
30
33
  }
31
34
 
32
35
  const prop = withDefaults(defineProps<Props>(), {
@@ -45,6 +48,9 @@ const prop = withDefaults(defineProps<Props>(), {
45
48
  saveEditedItem: () => () => ({}),
46
49
  onDeleteItem: () => () => ({}),
47
50
  initiallyHidden: false,
51
+ showCustomMessage: false,
52
+ buttonLabel: "Add New",
53
+ formLabel: "",
48
54
  });
49
55
 
50
56
  const Accordion = defineAsyncComponent(() => import("./Accordion.vue"));
@@ -101,12 +107,12 @@ function collapseForm() {
101
107
  </script>
102
108
 
103
109
  <template>
104
- <div :class="{ 'ac-nested-elements': label }">
110
+ <div>
105
111
  <!-- Add New Form Start -->
106
112
  <template v-if="isSavingNewElement">
107
- <div class="is-flex is-aligned-item-center is-justify-content-space-between">
113
+ <div class="is-flex is-align-items-center is-justify-content-space-between">
108
114
  <accordion
109
- :label="`New ${label}`"
115
+ :label="formLabel || `New ${label}`"
110
116
  :isCollapsible="isCollapsible"
111
117
  :isRequired="isRequired"
112
118
  :errors="errors"
@@ -116,12 +122,14 @@ function collapseForm() {
116
122
  <div class="buttons pb-5">
117
123
  <!-- save button start -->
118
124
  <ac-button
119
- modifier-classes="is-small is-primary is-light"
125
+ modifier-classes="is-small is-primary"
120
126
  :disabled="disabled ? true : false"
121
127
  data-testid="single-step-form-array-item-save-button"
122
128
  @click.prevent="onSaveItem()"
129
+ title="Save"
130
+ icon-class="unplugin"
123
131
  >
124
- <span class="icon"><FluentSave28Regular /></span>
132
+ <template #icon> <FluentSave28Regular /> </template>
125
133
  </ac-button>
126
134
  <!-- save button end -->
127
135
  <!-- CLOSE button start -->
@@ -148,7 +156,7 @@ function collapseForm() {
148
156
 
149
157
  <!-- Label and Add New Button Start -->
150
158
  <template v-else>
151
- <div class="is-flex is-aligned-item-center is-justify-content-space-between">
159
+ <div class="is-flex is-align-items-center is-justify-content-space-between">
152
160
  <accordion
153
161
  :label="label"
154
162
  :isCollapsible="isCollapsible"
@@ -159,11 +167,11 @@ function collapseForm() {
159
167
  />
160
168
  <ac-button
161
169
  v-if="!isButtonsDisabled && !isCreateDisabled"
162
- modifier-classes="is-primary is-light is-outlined"
170
+ modifier-classes="is-primary is-small"
163
171
  data-testid="single-step-form-array-item-create-button"
164
172
  @click.prevent="onAddClick()"
165
173
  >
166
- <span class="icon"><HeroiconsPlus /> </span><span>Add New</span>
174
+ <span class="icon"><HeroiconsPlus /> </span><span>{{ buttonLabel }}</span>
167
175
  </ac-button>
168
176
  </div>
169
177
  <!-- Label and Add New Button End -->
@@ -177,8 +185,8 @@ function collapseForm() {
177
185
  >
178
186
  <!-- existing element start -->
179
187
 
180
- <div v-if="dataForTable.length" class="ac-table-container table-container my-4">
181
- <table class="table ac-table ac-striped is-fullwidth" data-testid="ac-table">
188
+ <div v-if="dataForTable.length" class="ac-table-container table-container my-2">
189
+ <table class="table ac-table ac-striped is-fullwidth b-1" data-testid="ac-table">
182
190
  <thead>
183
191
  <tr>
184
192
  <th v-for="(item, idx) in tableHeaders" :key="idx + item.name">
@@ -237,17 +245,19 @@ function collapseForm() {
237
245
  <tr v-if="editFieldIndex === idxRow" style="background-color: #f8f8f8">
238
246
  <td :colspan="itemRow.cells.length + 1">
239
247
  <!-- nested elements start -->
240
- <div class="mt-15 mb-15 is-flex is-aligned-item-center is-justify-content-space-between">
248
+ <div class="mt-15 mb-15 is-flex is-align-items-center is-justify-content-space-between">
241
249
  <accordion :label="`Edit ${label}`" :is-collapsible="false" />
242
250
  <div class="buttons pb-5">
243
251
  <!-- save button start -->
244
252
  <ac-button
245
- modifier-classes="is-small is-primary is-light"
253
+ modifier-classes="is-small is-primary"
246
254
  :disabled="disabled ? true : false"
247
255
  data-testid="single-step-form-array-item-save-button"
248
256
  @click.prevent="onSaveEditedItem(idxRow)"
257
+ icon-class="unplugin"
258
+ title="Save"
249
259
  >
250
- <span class="icon"> <FluentSave28Regular /> </span>
260
+ <template #icon> <FluentSave28Regular /> </template>
251
261
  </ac-button>
252
262
  <!-- save button end -->
253
263
  <!-- close button start -->
@@ -280,7 +290,8 @@ function collapseForm() {
280
290
  </table>
281
291
  </div>
282
292
  <div v-else class="label-action is-flex is-flex-wrap-wrap mb-5">
283
- <strong> No Item Found. </strong>
293
+ <slot v-if="showCustomMessage" name="custom-message" />
294
+ <strong v-else> No Item Found. </strong>
284
295
  </div>
285
296
  <!-- existing element end -->
286
297
  </div>
@@ -288,3 +299,11 @@ function collapseForm() {
288
299
  </template>
289
300
  </div>
290
301
  </template>
302
+ <style lang="scss">
303
+ .ac-striped {
304
+ &.table thead td,
305
+ &.table thead th {
306
+ border-width: 0 0 1px;
307
+ }
308
+ }
309
+ </style>
@@ -102,7 +102,7 @@ const filteredAppList = appListWithUrl.filter((element) => {
102
102
  if (element.name === props.currentApp) return false;
103
103
 
104
104
  // remove billing selfhost & learn from selfhost mode
105
- let selfHostList = ["billing", "selfhost", "learn"];
105
+ const selfHostList = ["billing", "selfhost", "learn"];
106
106
  if (isSelfHosted.value && selfHostList.includes(element.name)) return false;
107
107
 
108
108
  return true;
@@ -43,7 +43,7 @@ const noOfPageNos = computed(() => {
43
43
  });
44
44
 
45
45
  const pageRange = computed(() => {
46
- let o = { start: 1, end: 0 };
46
+ const o = { start: 1, end: 0 };
47
47
  if (noOfPageNos.value < 5) {
48
48
  o.start = 1;
49
49
  o.end = noOfPageNos.value;
@@ -63,9 +63,9 @@ const pageRange = computed(() => {
63
63
  });
64
64
 
65
65
  const pages = computed(() => {
66
- let ar = [];
67
- let start = pageRange.value.start;
68
- let end = pageRange.value.end;
66
+ const ar = [];
67
+ const start = pageRange.value.start;
68
+ const end = pageRange.value.end;
69
69
  for (let i = start; i <= end; i++) {
70
70
  ar.push(i);
71
71
  }
@@ -73,8 +73,8 @@ const pages = computed(() => {
73
73
  });
74
74
 
75
75
  const itemsRange = computed(() => {
76
- let start = (activePageNo.value - 1) * selectedItemCountPerPage.value;
77
- let end = Math.min(activePageNo.value * selectedItemCountPerPage.value, props.totalNoOfItems);
76
+ const start = (activePageNo.value - 1) * selectedItemCountPerPage.value;
77
+ const end = Math.min(activePageNo.value * selectedItemCountPerPage.value, props.totalNoOfItems);
78
78
 
79
79
  return { start, end };
80
80
  });