@nethserver/ns8-ui-lib 0.0.36 → 0.0.40
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 +591 -355
- package/dist/ns8-ui-lib.min.js +1 -1
- package/dist/ns8-ui-lib.ssr.js +475 -334
- package/package.json +1 -1
- package/src/lib-components/NsDangerDeleteModal.vue +9 -5
- package/src/lib-components/NsDropdownAction.vue +98 -0
- package/src/lib-components/pictograms/HardDrive.vue +12 -0
package/package.json
CHANGED
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
:title="warning"
|
|
15
15
|
:showCloseButton="false"
|
|
16
16
|
/>
|
|
17
|
-
<div
|
|
18
|
-
<
|
|
17
|
+
<div v-html="description"></div>
|
|
18
|
+
<slot name="explanation"></slot>
|
|
19
|
+
<div class="type-to-confirm" v-html="typeToConfirmMessage"></div>
|
|
19
20
|
<cv-form @submit.prevent="confirmDelete">
|
|
20
21
|
<cv-text-input
|
|
21
22
|
v-model="userInput"
|
|
@@ -31,14 +32,13 @@
|
|
|
31
32
|
|
|
32
33
|
<script>
|
|
33
34
|
import UtilService from "../lib-mixins/util.js";
|
|
34
|
-
import IconService from "../lib-mixins/util.js";
|
|
35
35
|
import NsInlineNotification from "./NsInlineNotification.vue";
|
|
36
36
|
|
|
37
37
|
export default {
|
|
38
38
|
name: "NsDangerDeleteModal",
|
|
39
39
|
//component added for storybook to work
|
|
40
40
|
components: { NsInlineNotification },
|
|
41
|
-
mixins: [UtilService
|
|
41
|
+
mixins: [UtilService],
|
|
42
42
|
props: {
|
|
43
43
|
isShown: {
|
|
44
44
|
type: Boolean,
|
|
@@ -112,4 +112,8 @@ export default {
|
|
|
112
112
|
};
|
|
113
113
|
</script>
|
|
114
114
|
|
|
115
|
-
<style scoped lang="scss"
|
|
115
|
+
<style scoped lang="scss">
|
|
116
|
+
.type-to-confirm {
|
|
117
|
+
margin-top: 2rem;
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div data-overflow-menu :class="[`cv-overflow-menu`]" :id="uid">
|
|
3
|
+
<button
|
|
4
|
+
:class="[
|
|
5
|
+
`bx--btn--${lowerCaseKind}`,
|
|
6
|
+
'bx--btn',
|
|
7
|
+
'bx--btn--field',
|
|
8
|
+
{
|
|
9
|
+
[`${carbonPrefix}--overflow-menu--open`]: open,
|
|
10
|
+
},
|
|
11
|
+
]"
|
|
12
|
+
aria-haspopup
|
|
13
|
+
type="button"
|
|
14
|
+
:aria-expanded="open ? 'true' : 'false'"
|
|
15
|
+
:aria-controls="`${uid}-menu`"
|
|
16
|
+
:id="`${uid}-trigger`"
|
|
17
|
+
ref="trigger"
|
|
18
|
+
@click="doToggle"
|
|
19
|
+
@keydown.space.prevent
|
|
20
|
+
@keyup.space.prevent="doToggle"
|
|
21
|
+
@keydown.enter.prevent="doToggle"
|
|
22
|
+
@keydown.tab="onOverflowMenuTab"
|
|
23
|
+
>
|
|
24
|
+
<slot name="trigger"> </slot>
|
|
25
|
+
<NsSvg :svg="ChevronDown20" :class="`${carbonPrefix}--btn__icon`" />
|
|
26
|
+
</button>
|
|
27
|
+
<div
|
|
28
|
+
:class="[
|
|
29
|
+
`${carbonPrefix}--overflow-menu-options`,
|
|
30
|
+
{
|
|
31
|
+
[`${carbonPrefix}--overflow-menu-options--open`]: open,
|
|
32
|
+
},
|
|
33
|
+
]"
|
|
34
|
+
tabindex="-1"
|
|
35
|
+
ref="popup"
|
|
36
|
+
:aria-labelledby="`${uid}-trigger`"
|
|
37
|
+
:id="`${uid}-menu`"
|
|
38
|
+
:style="{ left: left + 'px', top: top + 'px' }"
|
|
39
|
+
@focusout="checkFocusOut"
|
|
40
|
+
@mousedown.prevent="preventFocusOut"
|
|
41
|
+
>
|
|
42
|
+
<ul :class="`${carbonPrefix}--overflow-menu-options__content`">
|
|
43
|
+
<slot></slot>
|
|
44
|
+
</ul>
|
|
45
|
+
<div
|
|
46
|
+
class="cv-overflow-menu__after-content"
|
|
47
|
+
ref="afterContent"
|
|
48
|
+
tabindex="0"
|
|
49
|
+
style="position: absolute; height: 1px; width: 1px; left: -9999px"
|
|
50
|
+
@focus="focusAfterContent"
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<script>
|
|
57
|
+
import { CvOverflowMenu } from "@carbon/vue";
|
|
58
|
+
import NsSvg from "./NsSvg.vue";
|
|
59
|
+
import IconService from "../lib-mixins/icon.js";
|
|
60
|
+
|
|
61
|
+
export default {
|
|
62
|
+
name: "NsDropdownAction",
|
|
63
|
+
extends: CvOverflowMenu,
|
|
64
|
+
components: { NsSvg },
|
|
65
|
+
mixins: [IconService],
|
|
66
|
+
props: {
|
|
67
|
+
kind: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "secondary",
|
|
70
|
+
validator: (val) =>
|
|
71
|
+
[
|
|
72
|
+
"default",
|
|
73
|
+
"primary",
|
|
74
|
+
"secondary",
|
|
75
|
+
"tertiary",
|
|
76
|
+
"ghost",
|
|
77
|
+
"danger",
|
|
78
|
+
"danger--ghost",
|
|
79
|
+
"danger--tertiary",
|
|
80
|
+
].includes(val),
|
|
81
|
+
},
|
|
82
|
+
up: Boolean,
|
|
83
|
+
offset: {
|
|
84
|
+
type: Object,
|
|
85
|
+
validator(value) {
|
|
86
|
+
return value && value.left !== undefined && value.top !== undefined;
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
computed: {
|
|
91
|
+
lowerCaseKind() {
|
|
92
|
+
return this.kind.toLowerCase();
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<path
|
|
3
|
+
id="hard--drive"
|
|
4
|
+
d="M26,6c-0.552,0-1-0.448-1-1s0.448-1,1-1s1,0.448,1,1S26.552,6,26,6z M27,16c0-0.552-0.448-1-1-1
|
|
5
|
+
s-1,0.448-1,1s0.448,1,1,1S27,16.552,27,16z M27,27c0-0.552-0.448-1-1-1s-1,0.448-1,1s0.448,1,1,1S27,27.552,27,27z M31,31.36H1
|
|
6
|
+
c-0.199,0-0.36-0.161-0.36-0.36v-8c0-0.199,0.161-0.36,0.36-0.36h30c0.199,0,0.36,0.161,0.36,0.36v8
|
|
7
|
+
C31.36,31.199,31.199,31.36,31,31.36z M1.36,30.64h29.28v-7.28H1.36V30.64z M31,20.36H1c-0.199,0-0.36-0.161-0.36-0.36v-8
|
|
8
|
+
c0-0.199,0.161-0.36,0.36-0.36h30c0.199,0,0.36,0.161,0.36,0.36v8C31.36,20.199,31.199,20.36,31,20.36z M1.36,19.64h29.28v-7.28
|
|
9
|
+
H1.36V19.64z M31,9.36H1C0.801,9.36,0.64,9.199,0.64,9V1c0-0.199,0.161-0.36,0.36-0.36h30c0.199,0,0.36,0.161,0.36,0.36v8
|
|
10
|
+
C31.36,9.199,31.199,9.36,31,9.36z M1.36,8.64h29.28V1.36H1.36V8.64z"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|