@appscode/design-system 2.5.10 → 2.5.11
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
|
@@ -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
|
|
110
|
+
<div>
|
|
105
111
|
<!-- Add New Form Start -->
|
|
106
112
|
<template v-if="isSavingNewElement">
|
|
107
|
-
<div class="is-flex is-
|
|
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
|
|
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
|
-
<
|
|
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-
|
|
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-
|
|
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>
|
|
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-
|
|
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-
|
|
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
|
|
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
|
-
<
|
|
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
|
-
<
|
|
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>
|