@nethserver/ns8-ui-lib 1.12.3 → 2.0.0
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/dist/ns8-ui-lib.esm.js +216 -1297
- package/dist/ns8-ui-lib.min.js +1 -1
- package/dist/ns8-ui-lib.ssr.js +341 -1155
- package/package.json +10 -6
- package/src/lib-components/NsToastNotification.vue +69 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nethserver/ns8-ui-lib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Vue.js library for NethServer 8 UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nethserver",
|
|
@@ -47,20 +47,24 @@
|
|
|
47
47
|
"@rollup/plugin-commonjs": "^17.0.0",
|
|
48
48
|
"@rollup/plugin-node-resolve": "^11.0.1",
|
|
49
49
|
"@rollup/plugin-replace": "^2.3.4",
|
|
50
|
-
"@
|
|
51
|
-
"@vue/cli-
|
|
50
|
+
"@rollup/plugin-terser": "^0.4.0",
|
|
51
|
+
"@vue/cli-plugin-babel": "^4.5.19",
|
|
52
|
+
"@vue/cli-service": "^4.5.19",
|
|
52
53
|
"cross-env": "^7.0.3",
|
|
53
54
|
"mark.js": "^8.11.1",
|
|
54
55
|
"minimist": "^1.2.5",
|
|
55
56
|
"rollup": "^2.53.2",
|
|
56
|
-
"@rollup/plugin-terser": "^0.4.0",
|
|
57
57
|
"rollup-plugin-vue": "^5.1.9",
|
|
58
|
-
"vue": "^2.
|
|
59
|
-
"vue-template-compiler": "^2.
|
|
58
|
+
"vue": "^2.7.16",
|
|
59
|
+
"vue-template-compiler": "^2.7.16"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"vue": "^2.6.12"
|
|
63
63
|
},
|
|
64
|
+
"overrides": {
|
|
65
|
+
"vue-loader": "^15.10.0",
|
|
66
|
+
"vue-template-compiler": "^2.7.16"
|
|
67
|
+
},
|
|
64
68
|
"engines": {
|
|
65
69
|
"node": ">=12"
|
|
66
70
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
<!-- cancel button -->
|
|
47
47
|
<div
|
|
48
|
-
v-if="isCancelShown && isProgressShown"
|
|
48
|
+
v-if="isCancelShown && isProgressShown && !isConfirmCancelShown"
|
|
49
49
|
:class="[
|
|
50
50
|
`${carbonPrefix}--toast-notification__caption`,
|
|
51
51
|
`action`,
|
|
@@ -58,16 +58,50 @@
|
|
|
58
58
|
`${carbonPrefix}--inline-notification__action-button`,
|
|
59
59
|
`${carbonPrefix}--btn`,
|
|
60
60
|
`${carbonPrefix}--btn--sm`,
|
|
61
|
-
|
|
62
|
-
{ 'bx--btn--danger': isConfirmCancelShown }
|
|
61
|
+
`bx--btn--ghost`,
|
|
63
62
|
]"
|
|
64
|
-
:disabled="isCancelButtonDisabled"
|
|
65
63
|
type="button"
|
|
66
64
|
>
|
|
67
|
-
{{
|
|
65
|
+
{{ cancelLabel }}
|
|
68
66
|
</button>
|
|
69
67
|
</div>
|
|
70
68
|
|
|
69
|
+
<!-- cancel confirmation -->
|
|
70
|
+
<div
|
|
71
|
+
v-else-if="isCancelShown && isProgressShown && isConfirmCancelShown"
|
|
72
|
+
class="cancel-confirmation"
|
|
73
|
+
>
|
|
74
|
+
<p class="cancel-confirmation__text">{{ confirmCancelText }}</p>
|
|
75
|
+
<div class="cancel-confirmation__buttons">
|
|
76
|
+
<button
|
|
77
|
+
@click="handleKeepRunning"
|
|
78
|
+
:class="[
|
|
79
|
+
`${carbonPrefix}--inline-notification__action-button`,
|
|
80
|
+
`${carbonPrefix}--btn`,
|
|
81
|
+
`${carbonPrefix}--btn--sm`,
|
|
82
|
+
`bx--btn--ghost`,
|
|
83
|
+
]"
|
|
84
|
+
type="button"
|
|
85
|
+
:disabled="isKeepRunningButtonDisabled"
|
|
86
|
+
>
|
|
87
|
+
{{ keepRunningLabel }}
|
|
88
|
+
</button>
|
|
89
|
+
<button
|
|
90
|
+
@click="confirmCancelTask"
|
|
91
|
+
:class="[
|
|
92
|
+
`${carbonPrefix}--inline-notification__action-button`,
|
|
93
|
+
`${carbonPrefix}--btn`,
|
|
94
|
+
`${carbonPrefix}--btn--sm`,
|
|
95
|
+
`bx--btn--danger`,
|
|
96
|
+
]"
|
|
97
|
+
:disabled="isCancelButtonDisabled"
|
|
98
|
+
type="button"
|
|
99
|
+
>
|
|
100
|
+
{{ confirmCancelLabel }}
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
71
105
|
<!-- action button -->
|
|
72
106
|
<div
|
|
73
107
|
v-else-if="actionLabel"
|
|
@@ -153,7 +187,12 @@ export default {
|
|
|
153
187
|
default: false
|
|
154
188
|
},
|
|
155
189
|
cancelLabel: { type: String, default: "Abort" },
|
|
156
|
-
|
|
190
|
+
confirmCancelText: {
|
|
191
|
+
type: String,
|
|
192
|
+
default: "Abort this task? This action can't be undone",
|
|
193
|
+
},
|
|
194
|
+
keepRunningLabel: { type: String, default: "Keep running" },
|
|
195
|
+
confirmCancelLabel: { type: String, default: "Yes, abort" },
|
|
157
196
|
closeAriaLabel: { type: String, default: "Dismiss notification" },
|
|
158
197
|
kind: {
|
|
159
198
|
type: String,
|
|
@@ -165,25 +204,23 @@ export default {
|
|
|
165
204
|
data() {
|
|
166
205
|
return {
|
|
167
206
|
isConfirmCancelShown: false,
|
|
168
|
-
isCancelButtonDisabled: false
|
|
207
|
+
isCancelButtonDisabled: false,
|
|
208
|
+
isKeepRunningButtonDisabled: false,
|
|
169
209
|
};
|
|
170
210
|
},
|
|
171
211
|
methods: {
|
|
172
212
|
cancelTask() {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
213
|
+
this.isConfirmCancelShown = true;
|
|
214
|
+
},
|
|
215
|
+
handleKeepRunning() {
|
|
216
|
+
this.isConfirmCancelShown = false;
|
|
217
|
+
},
|
|
218
|
+
confirmCancelTask() {
|
|
219
|
+
this.$emit("cancelTask", this.id);
|
|
220
|
+
this.isCancelButtonDisabled = true;
|
|
221
|
+
this.isKeepRunningButtonDisabled = true;
|
|
222
|
+
},
|
|
223
|
+
},
|
|
187
224
|
};
|
|
188
225
|
</script>
|
|
189
226
|
|
|
@@ -198,6 +235,17 @@ export default {
|
|
|
198
235
|
margin-bottom: 0;
|
|
199
236
|
}
|
|
200
237
|
|
|
238
|
+
.cancel-confirmation {
|
|
239
|
+
margin-top: 1rem;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.cancel-confirmation__buttons {
|
|
243
|
+
margin-top: 0.5rem;
|
|
244
|
+
margin-bottom: 1.5rem;
|
|
245
|
+
display: flex;
|
|
246
|
+
gap: 2rem;
|
|
247
|
+
}
|
|
248
|
+
|
|
201
249
|
.bx--toast-notification .bx--inline-notification__action-button {
|
|
202
250
|
// following rule uses branding color so it's inside core _core.scss
|
|
203
251
|
// color: $inverse-link;
|