@nethserver/ns8-ui-lib 0.0.24 → 0.0.29
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 +7526 -255
- package/dist/ns8-ui-lib.min.js +1 -1
- package/dist/ns8-ui-lib.ssr.js +7488 -245
- package/package.json +2 -1
- package/src/lib-components/NsDangerDeleteModal.vue +113 -0
- package/src/lib-components/NsEmptyState.vue +5 -1
- package/src/lib-components/NsInfoCard.vue +3 -0
- package/src/lib-components/NsProgressBar.vue +2 -1
- package/src/lib-components/pictograms/Group.vue +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nethserver/ns8-ui-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"description": "Vue.js library for NethServer 8 UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nethserver",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"node": ">=12"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
61
62
|
"core-js": "^3.15.2",
|
|
62
63
|
"date-fns": "^2.23.0",
|
|
63
64
|
"date-fns-tz": "^1.1.6"
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<cv-modal
|
|
3
|
+
kind="danger"
|
|
4
|
+
size="default"
|
|
5
|
+
:visible="isShown"
|
|
6
|
+
@modal-hidden="onModalHidden"
|
|
7
|
+
@primary-click="confirmDelete"
|
|
8
|
+
:primary-button-disabled="name !== userInput"
|
|
9
|
+
>
|
|
10
|
+
<template slot="title">{{ title }}</template>
|
|
11
|
+
<template slot="content">
|
|
12
|
+
<NsInlineNotification
|
|
13
|
+
kind="warning"
|
|
14
|
+
:title="warning"
|
|
15
|
+
:showCloseButton="false"
|
|
16
|
+
/>
|
|
17
|
+
<div class="mg-bottom-md" v-html="description"></div>
|
|
18
|
+
<div v-html="typeToConfirmMessage"></div>
|
|
19
|
+
<cv-form @submit.prevent="confirmDelete">
|
|
20
|
+
<cv-text-input
|
|
21
|
+
v-model="userInput"
|
|
22
|
+
class="mg-bottom-md"
|
|
23
|
+
ref="userInput"
|
|
24
|
+
></cv-text-input>
|
|
25
|
+
</cv-form>
|
|
26
|
+
</template>
|
|
27
|
+
<template slot="secondary-button">{{ cancelLabel }}</template>
|
|
28
|
+
<template slot="primary-button">{{ deleteLabel }}</template>
|
|
29
|
+
</cv-modal>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import UtilService from "../lib-mixins/util.js";
|
|
34
|
+
import IconService from "../lib-mixins/util.js";
|
|
35
|
+
import NsInlineNotification from "./NsInlineNotification.vue";
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
name: "NsDangerDeleteModal",
|
|
39
|
+
//component added for storybook to work
|
|
40
|
+
components: { NsInlineNotification },
|
|
41
|
+
mixins: [UtilService, IconService],
|
|
42
|
+
props: {
|
|
43
|
+
isShown: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true,
|
|
46
|
+
},
|
|
47
|
+
name: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: true,
|
|
50
|
+
},
|
|
51
|
+
title: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: "Confirm deletion",
|
|
54
|
+
},
|
|
55
|
+
warning: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: "Please read carefully",
|
|
58
|
+
},
|
|
59
|
+
description: {
|
|
60
|
+
type: String,
|
|
61
|
+
default:
|
|
62
|
+
"Do you really want to delete this object? This action is irreversible",
|
|
63
|
+
},
|
|
64
|
+
typeToConfirm: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "",
|
|
67
|
+
},
|
|
68
|
+
cancelLabel: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: "Cancel",
|
|
71
|
+
},
|
|
72
|
+
deleteLabel: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: "I understand, delete",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
data() {
|
|
78
|
+
return {
|
|
79
|
+
userInput: "",
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
computed: {
|
|
83
|
+
typeToConfirmMessage() {
|
|
84
|
+
if (this.typeToConfirm) {
|
|
85
|
+
return this.typeToConfirm;
|
|
86
|
+
} else {
|
|
87
|
+
return `Type <strong>${this.name}</strong> to confirm deletion`;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
watch: {
|
|
92
|
+
isShown: function () {
|
|
93
|
+
if (this.isShown) {
|
|
94
|
+
setTimeout(() => {
|
|
95
|
+
this.focusElement("userInput");
|
|
96
|
+
}, 300);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
methods: {
|
|
101
|
+
onModalHidden() {
|
|
102
|
+
this.$emit("hide");
|
|
103
|
+
},
|
|
104
|
+
confirmDelete() {
|
|
105
|
+
if (this.name == this.userInput) {
|
|
106
|
+
this.$emit("confirmDelete");
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<style scoped lang="scss"></style>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:animationData="animationData"
|
|
6
6
|
:refName="animationTitle"
|
|
7
7
|
:animateOnHover="true"
|
|
8
|
-
:loop="
|
|
8
|
+
:loop="loop"
|
|
9
9
|
:autoPlay="true"
|
|
10
10
|
class="animation image"
|
|
11
11
|
/>
|
|
@@ -42,6 +42,10 @@ export default {
|
|
|
42
42
|
},
|
|
43
43
|
animationData: Object,
|
|
44
44
|
animationTitle: String,
|
|
45
|
+
loop: {
|
|
46
|
+
type: [Boolean, Number],
|
|
47
|
+
default: 1,
|
|
48
|
+
},
|
|
45
49
|
},
|
|
46
50
|
computed: {
|
|
47
51
|
hasPictogramSlot() {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<path
|
|
3
|
+
id="group"
|
|
4
|
+
d="M24.36,31h-0.72v-7.5c0-3.552-2.414-6.604-5.872-7.424c-0.15-0.036-0.261-0.163-0.275-0.316
|
|
5
|
+
c-0.015-0.154,0.071-0.3,0.212-0.363c1.517-0.675,2.496-2.181,2.496-3.836c0-2.316-1.884-4.201-4.2-4.201S11.8,9.244,11.8,11.561
|
|
6
|
+
c0,1.655,0.98,3.162,2.496,3.836c0.141,0.063,0.227,0.209,0.212,0.363c-0.014,0.153-0.125,0.281-0.275,0.316
|
|
7
|
+
c-3.458,0.82-5.872,3.872-5.872,7.424V31H7.64v-7.5c0-3.592,2.257-6.718,5.585-7.879c-1.326-0.907-2.146-2.421-2.146-4.061
|
|
8
|
+
c0-1.964,1.157-3.664,2.826-4.452C14.101,6.617,14.2,6.097,14.2,5.561c0-2.316-1.884-4.201-4.2-4.201S5.799,3.244,5.799,5.561
|
|
9
|
+
c0,1.656,0.98,3.162,2.496,3.836C8.437,9.46,8.521,9.606,8.507,9.76c-0.014,0.153-0.125,0.281-0.275,0.316
|
|
10
|
+
C4.774,10.896,2.36,13.948,2.36,17.5V25H1.64v-7.5c0-3.592,2.257-6.718,5.585-7.879C5.899,8.714,5.08,7.2,5.08,5.561
|
|
11
|
+
c0-2.713,2.207-4.92,4.92-4.92s4.92,2.207,4.92,4.92c0,0.422-0.052,0.836-0.157,1.237c0.791-0.205,1.683-0.205,2.473,0
|
|
12
|
+
c-0.104-0.401-0.157-0.815-0.157-1.237c0-2.713,2.208-4.92,4.921-4.92s4.921,2.207,4.921,4.92c0,1.64-0.82,3.154-2.146,4.061
|
|
13
|
+
c3.329,1.161,5.586,4.287,5.586,7.879V25H29.64v-7.5c0-3.552-2.414-6.604-5.872-7.424c-0.15-0.036-0.261-0.163-0.275-0.316
|
|
14
|
+
c-0.015-0.154,0.071-0.3,0.212-0.363C25.221,8.722,26.2,7.216,26.2,5.561c0-2.316-1.884-4.201-4.2-4.201s-4.2,1.884-4.2,4.201
|
|
15
|
+
c0,0.536,0.099,1.056,0.295,1.548c1.669,0.789,2.826,2.488,2.826,4.452c0,1.64-0.82,3.154-2.146,4.061
|
|
16
|
+
c3.329,1.161,5.586,4.287,5.586,7.879L24.36,31L24.36,31z"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|