@nethserver/ns8-ui-lib 0.1.31 → 1.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 +65 -70
- package/dist/ns8-ui-lib.min.js +1 -1
- package/dist/ns8-ui-lib.ssr.js +76 -67
- package/package.json +1 -1
- package/src/lib-components/NsCheckbox.vue +7 -6
- package/src/lib-components/NsDangerDeleteModal.vue +22 -21
- package/src/lib-components/NsInfoCard.vue +3 -2
- package/src/lib-components/NsInlineNotification.vue +20 -16
- package/src/lib-components/NsPasswordInput.vue +29 -4
- package/src/lib-components/NsToastNotification.vue +18 -17
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
`${carbonPrefix}--inline-notification`,
|
|
11
11
|
`${carbonPrefix}--inline-notification--${kind.toLowerCase()}`,
|
|
12
12
|
{
|
|
13
|
-
[`${carbonPrefix}--inline-notification--low-contrast`]: lowContrast
|
|
14
|
-
}
|
|
13
|
+
[`${carbonPrefix}--inline-notification--low-contrast`]: lowContrast
|
|
14
|
+
}
|
|
15
15
|
]"
|
|
16
16
|
v-on="$listeners"
|
|
17
17
|
:role="isAlert ? 'alert' : false"
|
|
@@ -24,18 +24,22 @@
|
|
|
24
24
|
/>
|
|
25
25
|
<div :class="`${carbonPrefix}--inline-notification__text-wrapper`">
|
|
26
26
|
<p
|
|
27
|
-
v-if="title"
|
|
27
|
+
v-if="$slots.title || title"
|
|
28
28
|
:class="`${carbonPrefix}--inline-notification__title title`"
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
>
|
|
30
|
+
<slot v-if="$slots.title" name="title"></slot>
|
|
31
|
+
<span v-else>{{ title }}</span>
|
|
32
|
+
</p>
|
|
31
33
|
<p
|
|
32
|
-
v-if="description"
|
|
34
|
+
v-if="$slots.description || description"
|
|
33
35
|
:class="[
|
|
34
36
|
`${carbonPrefix}--inline-notification__subtitle`,
|
|
35
|
-
{ 'mg-right': loading || timer }
|
|
37
|
+
{ 'mg-right': loading || timer }
|
|
36
38
|
]"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
>
|
|
40
|
+
<slot v-if="$slots.description" name="description"></slot>
|
|
41
|
+
<span v-else>{{ description }}</span>
|
|
42
|
+
</p>
|
|
39
43
|
<p v-if="loading" class="loader"></p>
|
|
40
44
|
<p v-if="timer">
|
|
41
45
|
<NsCircleTimer
|
|
@@ -55,7 +59,7 @@
|
|
|
55
59
|
`${carbonPrefix}--btn`,
|
|
56
60
|
`${carbonPrefix}--btn--sm`,
|
|
57
61
|
`${carbonPrefix}--btn--ghost`,
|
|
58
|
-
'action-button'
|
|
62
|
+
'action-button'
|
|
59
63
|
]"
|
|
60
64
|
type="button"
|
|
61
65
|
>
|
|
@@ -85,7 +89,7 @@ export default {
|
|
|
85
89
|
props: {
|
|
86
90
|
showCloseButton: {
|
|
87
91
|
type: Boolean,
|
|
88
|
-
default: false
|
|
92
|
+
default: false
|
|
89
93
|
},
|
|
90
94
|
description: String,
|
|
91
95
|
actionLabel: { type: String, default: "" },
|
|
@@ -93,17 +97,17 @@ export default {
|
|
|
93
97
|
kind: {
|
|
94
98
|
type: String,
|
|
95
99
|
default: "info",
|
|
96
|
-
validator: (val) => ["error", "info", "warning", "success"].includes(val)
|
|
100
|
+
validator: (val) => ["error", "info", "warning", "success"].includes(val)
|
|
97
101
|
},
|
|
98
102
|
lowContrast: Boolean,
|
|
99
103
|
loading: {
|
|
100
104
|
type: Boolean,
|
|
101
|
-
default: false
|
|
105
|
+
default: false
|
|
102
106
|
},
|
|
103
107
|
timer: {
|
|
104
|
-
type: Number
|
|
105
|
-
}
|
|
106
|
-
}
|
|
108
|
+
type: Number
|
|
109
|
+
}
|
|
110
|
+
}
|
|
107
111
|
};
|
|
108
112
|
</script>
|
|
109
113
|
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
</NsTextInput>
|
|
24
24
|
<div class="password-meter">
|
|
25
25
|
<span
|
|
26
|
+
v-if="minLength !== 0"
|
|
26
27
|
:class="[
|
|
27
28
|
'requirement',
|
|
28
29
|
{
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
>{{ lengthLabel }}</span
|
|
35
36
|
>
|
|
36
37
|
<span
|
|
38
|
+
v-if="checkComplexity"
|
|
37
39
|
:class="[
|
|
38
40
|
'requirement',
|
|
39
41
|
{
|
|
@@ -45,6 +47,7 @@
|
|
|
45
47
|
>{{ lowercaseLabel }}</span
|
|
46
48
|
>
|
|
47
49
|
<span
|
|
50
|
+
v-if="checkComplexity"
|
|
48
51
|
:class="[
|
|
49
52
|
'requirement',
|
|
50
53
|
{
|
|
@@ -56,6 +59,7 @@
|
|
|
56
59
|
>{{ uppercaseLabel }}</span
|
|
57
60
|
>
|
|
58
61
|
<span
|
|
62
|
+
v-if="checkComplexity"
|
|
59
63
|
:class="[
|
|
60
64
|
'requirement',
|
|
61
65
|
{
|
|
@@ -67,6 +71,7 @@
|
|
|
67
71
|
>{{ numberLabel }}</span
|
|
68
72
|
>
|
|
69
73
|
<span
|
|
74
|
+
v-if="checkComplexity"
|
|
70
75
|
:class="[
|
|
71
76
|
'requirement',
|
|
72
77
|
{
|
|
@@ -138,6 +143,10 @@ export default {
|
|
|
138
143
|
default: undefined,
|
|
139
144
|
},
|
|
140
145
|
light: Boolean,
|
|
146
|
+
checkComplexity: {
|
|
147
|
+
type: Boolean,
|
|
148
|
+
default: true,
|
|
149
|
+
},
|
|
141
150
|
minLength: {
|
|
142
151
|
type: Number,
|
|
143
152
|
default: 8,
|
|
@@ -182,16 +191,32 @@ export default {
|
|
|
182
191
|
return this.value.length >= this.minLength;
|
|
183
192
|
},
|
|
184
193
|
isLowercaseOk() {
|
|
185
|
-
|
|
194
|
+
if (!this.checkComplexity) {
|
|
195
|
+
return true;
|
|
196
|
+
} else {
|
|
197
|
+
return /[a-z]/.test(this.value);
|
|
198
|
+
}
|
|
186
199
|
},
|
|
187
200
|
isUppercaseOk() {
|
|
188
|
-
|
|
201
|
+
if (!this.checkComplexity) {
|
|
202
|
+
return true;
|
|
203
|
+
} else {
|
|
204
|
+
return /[A-Z]/.test(this.value);
|
|
205
|
+
}
|
|
189
206
|
},
|
|
190
207
|
isNumberOk() {
|
|
191
|
-
|
|
208
|
+
if (!this.checkComplexity) {
|
|
209
|
+
return true;
|
|
210
|
+
} else {
|
|
211
|
+
return /\d/.test(this.value);
|
|
212
|
+
}
|
|
192
213
|
},
|
|
193
214
|
isSymbolOk() {
|
|
194
|
-
|
|
215
|
+
if (!this.checkComplexity) {
|
|
216
|
+
return true;
|
|
217
|
+
} else {
|
|
218
|
+
return /\W|_/.test(this.value);
|
|
219
|
+
}
|
|
195
220
|
},
|
|
196
221
|
isEqualOk() {
|
|
197
222
|
return this.value.length && this.value === this.confirmPassword;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
`${carbonPrefix}--toast-notification--${kind.toLowerCase()}`,
|
|
12
12
|
{ [`${carbonPrefix}--toast-notification--low-contrast`]: lowContrast },
|
|
13
13
|
`notification`,
|
|
14
|
-
{ 'notification-read': isRead }
|
|
14
|
+
{ 'notification-read': isRead }
|
|
15
15
|
]"
|
|
16
16
|
v-on="$listeners"
|
|
17
17
|
:role="isAlert ? 'alert' : undefined"
|
|
@@ -30,10 +30,11 @@
|
|
|
30
30
|
`${carbonPrefix}--toast-notification__subtitle`,
|
|
31
31
|
`notification-description-and-progress`,
|
|
32
32
|
`row`,
|
|
33
|
-
{ 'fix-margin-bottom': actionLabel || isProgressShown }
|
|
33
|
+
{ 'fix-margin-bottom': actionLabel || isProgressShown }
|
|
34
34
|
]"
|
|
35
35
|
>
|
|
36
|
-
<
|
|
36
|
+
<slot v-if="$slots.description" name="description"></slot>
|
|
37
|
+
<span v-else>{{ description }}</span>
|
|
37
38
|
|
|
38
39
|
<div v-if="isProgressShown" class="progress">
|
|
39
40
|
<NsProgressBar :value="progress" :indeterminate="!progress" />
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
:class="[
|
|
49
50
|
`${carbonPrefix}--toast-notification__caption`,
|
|
50
51
|
`action`,
|
|
51
|
-
`row
|
|
52
|
+
`row`
|
|
52
53
|
]"
|
|
53
54
|
>
|
|
54
55
|
<button
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
`${carbonPrefix}--btn`,
|
|
59
60
|
`${carbonPrefix}--btn--sm`,
|
|
60
61
|
{ 'bx--btn--ghost': !isConfirmCancelShown },
|
|
61
|
-
{ 'bx--btn--danger': isConfirmCancelShown }
|
|
62
|
+
{ 'bx--btn--danger': isConfirmCancelShown }
|
|
62
63
|
]"
|
|
63
64
|
:disabled="isCancelButtonDisabled"
|
|
64
65
|
type="button"
|
|
@@ -73,7 +74,7 @@
|
|
|
73
74
|
:class="[
|
|
74
75
|
`${carbonPrefix}--toast-notification__caption`,
|
|
75
76
|
`action`,
|
|
76
|
-
`row
|
|
77
|
+
`row`
|
|
77
78
|
]"
|
|
78
79
|
>
|
|
79
80
|
<button
|
|
@@ -82,7 +83,7 @@
|
|
|
82
83
|
`${carbonPrefix}--inline-notification__action-button`,
|
|
83
84
|
`${carbonPrefix}--btn`,
|
|
84
85
|
`${carbonPrefix}--btn--sm`,
|
|
85
|
-
`${carbonPrefix}--btn--ghost
|
|
86
|
+
`${carbonPrefix}--btn--ghost`
|
|
86
87
|
]"
|
|
87
88
|
type="button"
|
|
88
89
|
>
|
|
@@ -98,7 +99,7 @@
|
|
|
98
99
|
>
|
|
99
100
|
{{
|
|
100
101
|
formatDateDistance(timestamp, new Date(), {
|
|
101
|
-
addSuffix: true
|
|
102
|
+
addSuffix: true
|
|
102
103
|
})
|
|
103
104
|
}}
|
|
104
105
|
</cv-tooltip>
|
|
@@ -133,23 +134,23 @@ export default {
|
|
|
133
134
|
description: String,
|
|
134
135
|
showCloseButton: {
|
|
135
136
|
type: Boolean,
|
|
136
|
-
default: true
|
|
137
|
+
default: true
|
|
137
138
|
},
|
|
138
139
|
actionLabel: String,
|
|
139
140
|
action: Object,
|
|
140
141
|
isRead: {
|
|
141
142
|
type: Boolean,
|
|
142
|
-
default: false
|
|
143
|
+
default: false
|
|
143
144
|
},
|
|
144
145
|
progress: Number,
|
|
145
146
|
timestamp: Date,
|
|
146
147
|
isProgressShown: {
|
|
147
148
|
type: Boolean,
|
|
148
|
-
default: false
|
|
149
|
+
default: false
|
|
149
150
|
},
|
|
150
151
|
isCancelShown: {
|
|
151
152
|
type: Boolean,
|
|
152
|
-
default: false
|
|
153
|
+
default: false
|
|
153
154
|
},
|
|
154
155
|
cancelLabel: { type: String, default: "Abort" },
|
|
155
156
|
confirmCancelLabel: { type: String, default: "Confirm abort" },
|
|
@@ -157,14 +158,14 @@ export default {
|
|
|
157
158
|
kind: {
|
|
158
159
|
type: String,
|
|
159
160
|
default: "info",
|
|
160
|
-
validator: (val) => ["error", "info", "warning", "success"].includes(val)
|
|
161
|
+
validator: (val) => ["error", "info", "warning", "success"].includes(val)
|
|
161
162
|
},
|
|
162
|
-
lowContrast: Boolean
|
|
163
|
+
lowContrast: Boolean
|
|
163
164
|
},
|
|
164
165
|
data() {
|
|
165
166
|
return {
|
|
166
167
|
isConfirmCancelShown: false,
|
|
167
|
-
isCancelButtonDisabled: false
|
|
168
|
+
isCancelButtonDisabled: false
|
|
168
169
|
};
|
|
169
170
|
},
|
|
170
171
|
methods: {
|
|
@@ -181,8 +182,8 @@ export default {
|
|
|
181
182
|
this.$emit("cancelTask", this.id);
|
|
182
183
|
this.isCancelButtonDisabled = true;
|
|
183
184
|
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
186
187
|
};
|
|
187
188
|
</script>
|
|
188
189
|
|