@community-release/nx-ui 0.0.18 → 0.0.20
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/module.d.mts +226 -5
- package/dist/module.d.ts +226 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +6 -2
- package/dist/runtime/components/accordion/index.vue +73 -0
- package/dist/runtime/components/accordion/item.vue +191 -0
- package/dist/runtime/components/accordion/props.json +4 -0
- package/dist/runtime/components/button/index.vue.d.ts +100 -80
- package/dist/runtime/components/grid.vue.d.ts +66 -55
- package/dist/runtime/components/impulse-indicator.vue.d.ts +16 -19
- package/dist/runtime/components/map/store.d.ts +1 -25
- package/dist/runtime/plugins/methods.mjs +23 -20
- package/dist/runtime/plugins/variables.mjs +21 -17
- package/dist/types.d.mts +2 -10
- package/dist/types.d.ts +2 -10
- package/package.json +10 -10
- package/dist/runtime/components/accordion.vue +0 -221
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="component-ui-accordion-item"
|
|
3
|
+
:class="{'tag-active': accordionData.activeItem.value === id, 'tag-icon': accordionData.haveIcon}"
|
|
4
|
+
>
|
|
5
|
+
<div class="header" @click="accordionData.activeItem.value = id">
|
|
6
|
+
<i class="icon"></i>
|
|
7
|
+
<div class="title">{{ title }}</div>
|
|
8
|
+
<div class="btn-toggle"></div>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="text">
|
|
11
|
+
<div><slot /></div>
|
|
12
|
+
</div>
|
|
13
|
+
</section>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
// Import
|
|
18
|
+
import { inject } from 'vue'
|
|
19
|
+
|
|
20
|
+
// Data
|
|
21
|
+
const accordionData = inject('accordionData', null);
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
title: String,
|
|
24
|
+
text: String,
|
|
25
|
+
});
|
|
26
|
+
const id = accordionData.itemCounter.value++;
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<style lang="less">
|
|
30
|
+
@import (less) '../styles/components.less';
|
|
31
|
+
|
|
32
|
+
// Misc
|
|
33
|
+
@com-icon-size: 30px;
|
|
34
|
+
@com-icon-size-small: 26px;
|
|
35
|
+
@com-btn-size: 20px;
|
|
36
|
+
@com-btn-width: 2px;
|
|
37
|
+
@com-btn-padding: 40px;
|
|
38
|
+
@com-btn-padding-small: 35px;
|
|
39
|
+
|
|
40
|
+
@com-ani-time: var(--ui-ani-time);
|
|
41
|
+
@com-ani-ease: var(--ui-ani-ease);
|
|
42
|
+
|
|
43
|
+
@com-text-line-height: var(--ui-text-line-height);
|
|
44
|
+
|
|
45
|
+
// Padding
|
|
46
|
+
@com-space-default: var(--ui-space-default);
|
|
47
|
+
@com-space-small: var(--ui-space-small);
|
|
48
|
+
@com-space-mini: var(--ui-space-mini);
|
|
49
|
+
|
|
50
|
+
// Colors
|
|
51
|
+
@com-color-border: var(--ui-color-border);
|
|
52
|
+
@com-color-header-text: var(--ui-color-header-text);
|
|
53
|
+
|
|
54
|
+
// Text
|
|
55
|
+
@com-text-medium: var(--ui-text-medium);
|
|
56
|
+
@com-text-default: var(--ui-text-default);
|
|
57
|
+
|
|
58
|
+
// Font
|
|
59
|
+
@com-font-header: var(--ui-font-header);
|
|
60
|
+
|
|
61
|
+
.component-ui-accordion-item {
|
|
62
|
+
--ui-accordion-icon-size: 0;
|
|
63
|
+
--ui-accordion-btn-padding: @com-btn-padding;
|
|
64
|
+
|
|
65
|
+
padding-bottom: @com-space-small;
|
|
66
|
+
margin-top: @com-space-small;
|
|
67
|
+
border-bottom: 1px solid @com-color-border;
|
|
68
|
+
font-size: @com-text-medium;
|
|
69
|
+
|
|
70
|
+
.header {
|
|
71
|
+
position: relative;
|
|
72
|
+
padding: @com-space-small var(--ui-accordion-btn-padding) @com-space-small calc(var(--ui-accordion-icon-size) + @com-space-default);
|
|
73
|
+
margin-bottom: @com-space-mini;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.icon,
|
|
78
|
+
.btn-toggle {
|
|
79
|
+
transform: translateY(-50%);
|
|
80
|
+
position: absolute;
|
|
81
|
+
top: 50%;
|
|
82
|
+
width: @com-icon-size;
|
|
83
|
+
height: @com-icon-size;
|
|
84
|
+
line-height: @com-icon-size;
|
|
85
|
+
text-align: center;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.icon {
|
|
89
|
+
left: 0;
|
|
90
|
+
background-position: center;
|
|
91
|
+
background-size: contain;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.title {
|
|
95
|
+
font-family: @com-font-header;
|
|
96
|
+
font-weight: 600;
|
|
97
|
+
color: @com-color-header-text;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.btn-toggle {
|
|
101
|
+
right: 0;
|
|
102
|
+
|
|
103
|
+
&:before,
|
|
104
|
+
&:after {
|
|
105
|
+
content: '';
|
|
106
|
+
|
|
107
|
+
transition: all @com-ani-time @com-ani-ease;
|
|
108
|
+
transform-origin: center;
|
|
109
|
+
position: absolute;
|
|
110
|
+
background: @com-color-header-text;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// |
|
|
114
|
+
&:before {
|
|
115
|
+
top: (@com-icon-size/2) - (@com-btn-size / 2);
|
|
116
|
+
left: (@com-icon-size/2) - (@com-btn-width / 2);
|
|
117
|
+
width: @com-btn-width;
|
|
118
|
+
height: @com-btn-size;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// —
|
|
122
|
+
&:after {
|
|
123
|
+
top: (@com-icon-size/2) - (@com-btn-width / 2);
|
|
124
|
+
left: (@com-icon-size/2) - (@com-btn-size / 2);
|
|
125
|
+
width: @com-btn-size;
|
|
126
|
+
height: @com-btn-width;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.text {
|
|
131
|
+
transition: grid-template-rows @com-ani-time @com-ani-ease;
|
|
132
|
+
display: grid;
|
|
133
|
+
grid-template-rows: 0fr;
|
|
134
|
+
line-height: @com-text-line-height;
|
|
135
|
+
font-size: @com-text-default;
|
|
136
|
+
|
|
137
|
+
div {
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
&:last-child {
|
|
144
|
+
border-bottom: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Active state
|
|
148
|
+
&.tag-active {
|
|
149
|
+
.text {
|
|
150
|
+
grid-template-rows: 1fr;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.btn-toggle {
|
|
154
|
+
&:before,
|
|
155
|
+
&:after {
|
|
156
|
+
transform: rotate(90deg);
|
|
157
|
+
}
|
|
158
|
+
&:after {
|
|
159
|
+
opacity: 0;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&.tag-icon {
|
|
165
|
+
// .header {
|
|
166
|
+
// position: relative;
|
|
167
|
+
// padding: @com-space-small var(--ui-accordion-btn-padding) @com-space-small calc(var(--ui-accordion-icon-size) + @com-space-default);
|
|
168
|
+
// margin-bottom: @com-space-mini;
|
|
169
|
+
// cursor: pointer;
|
|
170
|
+
// }
|
|
171
|
+
--ui-accordion-icon-size: @com-icon-size;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@media only screen and (max-width: 500px) {
|
|
176
|
+
.component-ui-accordion-item {
|
|
177
|
+
&.tag-icon {
|
|
178
|
+
--ui-accordion-icon-size: @com-icon-size-small;
|
|
179
|
+
}
|
|
180
|
+
//--ui-accordion-icon-size: @com-icon-size-small;
|
|
181
|
+
--ui-accordion-btn-padding: @com-btn-padding-small;
|
|
182
|
+
|
|
183
|
+
font-size: @com-text-default;
|
|
184
|
+
|
|
185
|
+
.icon {
|
|
186
|
+
width: 26px;
|
|
187
|
+
height: 26px;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
</style>
|
|
@@ -1,81 +1,101 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
color: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: any;
|
|
5
|
+
};
|
|
6
|
+
size: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: any;
|
|
9
|
+
};
|
|
10
|
+
variant: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: any;
|
|
13
|
+
};
|
|
14
|
+
shape: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: any;
|
|
17
|
+
};
|
|
18
|
+
href: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
type: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
block: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
30
|
+
loading: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
disabled: {
|
|
35
|
+
type: (BooleanConstructor | NumberConstructor)[];
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
}, any, {
|
|
39
|
+
impulse: boolean;
|
|
40
|
+
}, {
|
|
41
|
+
computedType(): any;
|
|
42
|
+
classes(): string[];
|
|
43
|
+
stylesHoverColor(): string;
|
|
44
|
+
styles(): {
|
|
45
|
+
background: string;
|
|
46
|
+
color: string;
|
|
47
|
+
};
|
|
48
|
+
buttonBgStyle(): {
|
|
49
|
+
background: string;
|
|
50
|
+
};
|
|
51
|
+
}, {
|
|
52
|
+
handleClick(e: any): void;
|
|
53
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
54
|
+
color: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
default: any;
|
|
57
|
+
};
|
|
58
|
+
size: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: any;
|
|
61
|
+
};
|
|
62
|
+
variant: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: any;
|
|
65
|
+
};
|
|
66
|
+
shape: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
default: any;
|
|
69
|
+
};
|
|
70
|
+
href: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
74
|
+
type: {
|
|
75
|
+
type: StringConstructor;
|
|
76
|
+
default: string;
|
|
77
|
+
};
|
|
78
|
+
block: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
default: boolean;
|
|
81
|
+
};
|
|
82
|
+
loading: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
86
|
+
disabled: {
|
|
87
|
+
type: (BooleanConstructor | NumberConstructor)[];
|
|
88
|
+
default: boolean;
|
|
89
|
+
};
|
|
90
|
+
}>>, {
|
|
91
|
+
type: string;
|
|
92
|
+
loading: boolean;
|
|
93
|
+
color: string;
|
|
94
|
+
size: string;
|
|
95
|
+
variant: string;
|
|
96
|
+
shape: string;
|
|
97
|
+
href: string;
|
|
98
|
+
block: boolean;
|
|
99
|
+
disabled: number | boolean;
|
|
100
|
+
}, {}>;
|
|
81
101
|
export default _default;
|
|
@@ -1,56 +1,67 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
textAlign: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
gap: {
|
|
7
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
gridTemplateColumns: {
|
|
11
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
gapTop: {
|
|
15
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
gapBottom: {
|
|
19
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
}, any, {
|
|
23
|
+
timeout: null;
|
|
24
|
+
windowWidth: number;
|
|
25
|
+
}, {
|
|
26
|
+
getClasses(): string[];
|
|
27
|
+
getStyle(): {
|
|
28
|
+
'grid-gap': any;
|
|
29
|
+
'grid-template-columns': any;
|
|
30
|
+
'padding-top': any;
|
|
31
|
+
'padding-bottom': any;
|
|
32
|
+
};
|
|
33
|
+
computedItemMaxWidth(): number;
|
|
34
|
+
computedGridTemplateColumns(): any;
|
|
35
|
+
computedGap(): any;
|
|
36
|
+
}, {
|
|
37
|
+
handleResize(): void;
|
|
38
|
+
onResize(): void;
|
|
39
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
textAlign: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
gap: {
|
|
45
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
gridTemplateColumns: {
|
|
49
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
gapTop: {
|
|
53
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
gapBottom: {
|
|
57
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
58
|
+
default: boolean;
|
|
59
|
+
};
|
|
60
|
+
}>>, {
|
|
61
|
+
textAlign: string;
|
|
62
|
+
gap: string | Record<string, any>;
|
|
63
|
+
gridTemplateColumns: string | Record<string, any>;
|
|
64
|
+
gapTop: string | boolean;
|
|
65
|
+
gapBottom: string | boolean;
|
|
66
|
+
}, {}>;
|
|
56
67
|
export default _default;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export let type: (ObjectConstructor | BooleanConstructor)[];
|
|
6
|
-
let _default: boolean;
|
|
7
|
-
export { _default as default };
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
function data(): {
|
|
11
|
-
impulseArray: never[];
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
impulse: {
|
|
3
|
+
type: (ObjectConstructor | BooleanConstructor)[];
|
|
4
|
+
default: boolean;
|
|
12
5
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
}, any, {
|
|
7
|
+
impulseArray: never[];
|
|
8
|
+
}, {}, {
|
|
9
|
+
addImpulse(options: any): void;
|
|
10
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
impulse: {
|
|
12
|
+
type: (ObjectConstructor | BooleanConstructor)[];
|
|
13
|
+
default: boolean;
|
|
14
|
+
};
|
|
15
|
+
}>>, {
|
|
16
|
+
impulse: boolean | Record<string, any>;
|
|
17
|
+
}, {}>;
|
|
21
18
|
export default _default;
|
|
@@ -16,31 +16,7 @@ export const useMapStore: import("pinia").StoreDefinition<"map", {
|
|
|
16
16
|
* @param {string|number} id
|
|
17
17
|
* @returns MapMarker
|
|
18
18
|
*/
|
|
19
|
-
getMarker(state:
|
|
20
|
-
coord: never[];
|
|
21
|
-
zoom: number;
|
|
22
|
-
zoomMin: number;
|
|
23
|
-
zoomMax: number;
|
|
24
|
-
deviceZoom: boolean;
|
|
25
|
-
markerImage: string;
|
|
26
|
-
markerActiveImage: string;
|
|
27
|
-
markerDisabledImage: string;
|
|
28
|
-
markers: never[];
|
|
29
|
-
selectedMarker: null;
|
|
30
|
-
disabledMarkers: never[];
|
|
31
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
|
32
|
-
coord: never[];
|
|
33
|
-
zoom: number;
|
|
34
|
-
zoomMin: number;
|
|
35
|
-
zoomMax: number;
|
|
36
|
-
deviceZoom: boolean;
|
|
37
|
-
markerImage: string;
|
|
38
|
-
markerActiveImage: string;
|
|
39
|
-
markerDisabledImage: string;
|
|
40
|
-
markers: never[];
|
|
41
|
-
selectedMarker: null;
|
|
42
|
-
disabledMarkers: never[];
|
|
43
|
-
}>): (id: any) => null;
|
|
19
|
+
getMarker(state: any): (id: any) => any;
|
|
44
20
|
}, {
|
|
45
21
|
/**
|
|
46
22
|
* Set map zoom
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from
|
|
2
|
-
import { useUINoticeStore } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
1
|
+
import { defineNuxtPlugin } from '#app';
|
|
2
|
+
import { useUINoticeStore } from '../components/notice/store.mjs';
|
|
3
|
+
|
|
4
|
+
export default defineNuxtPlugin(function (nuxt) {
|
|
5
|
+
const noticeStore = useUINoticeStore();
|
|
6
|
+
|
|
7
|
+
return {
|
|
8
|
+
provide: {
|
|
9
|
+
showNotice(duration = 8000, templateComponent, templateProps = {}) {
|
|
10
|
+
const id = noticeStore.add({
|
|
11
|
+
duration,
|
|
12
|
+
templateComponent,
|
|
13
|
+
templateProps
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
return id;
|
|
17
|
+
},
|
|
18
|
+
hideNotice(id) {
|
|
19
|
+
noticeStore.remove(id);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
});
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { computed } from
|
|
2
|
-
import { defineNuxtPlugin } from
|
|
3
|
-
import { useHead } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import { defineNuxtPlugin } from '#app';
|
|
3
|
+
import { useHead } from '#imports';
|
|
4
|
+
|
|
5
|
+
import style from '#build/ui.style.mjs';
|
|
6
|
+
|
|
7
|
+
export default defineNuxtPlugin(function(nuxt) {
|
|
8
|
+
const computedStyle = computed(() => style);
|
|
9
|
+
|
|
10
|
+
const headData = {
|
|
11
|
+
style: [
|
|
12
|
+
{
|
|
13
|
+
innerHTML: () => computedStyle.value,
|
|
14
|
+
tagPriority: -2,
|
|
15
|
+
id: 'nuxt-ui-style',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
useHead(headData);
|
|
21
|
+
});
|
package/dist/types.d.mts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import type {
|
|
2
|
+
import type { } from './module.js'
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
declare module '@nuxt/schema' {
|
|
6
|
-
interface NuxtConfig { ['ui']?: Partial<ModuleOptions> }
|
|
7
|
-
interface NuxtOptions { ['ui']?: ModuleOptions }
|
|
8
|
-
}
|
|
9
5
|
|
|
10
|
-
declare module 'nuxt/schema' {
|
|
11
|
-
interface NuxtConfig { ['ui']?: Partial<ModuleOptions> }
|
|
12
|
-
interface NuxtOptions { ['ui']?: ModuleOptions }
|
|
13
|
-
}
|
|
14
6
|
|
|
15
7
|
|
|
16
|
-
export type {
|
|
8
|
+
export type { default } from './module.js'
|