@v1nt1248/3nclient-lib 0.3.48 → 0.3.50
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/README.md +44 -1
- package/dist/chunks/{plugins-keys-CmrMlx3F.js → plugins-keys-DdadrIAg.js} +84 -77
- package/dist/chunks/ui3n-notification-o0tuhTpO.js +272 -0
- package/dist/mixins.scss +0 -23
- package/dist/src/components/ui3n-autocomplete/types.d.ts +12 -0
- package/dist/src/components/ui3n-input/ui3n-input.d.ts +2 -2
- package/dist/src/components/ui3n-notification/types.d.ts +5 -0
- package/dist/src/components/ui3n-notification/ui3n-notification.d.ts +1 -0
- package/dist/src/components/ui3n-text/ui3n-text.d.ts +2 -2
- package/dist/src/components/ui3n-tooltip/ui3n-tooltip.d.ts +1 -1
- package/dist/src/constants/plugins-keys.d.ts +2 -0
- package/dist/src/directives/ui3n-ripple.d.ts +2 -1
- package/dist/src/directives/ui3n-title.d.ts +1 -1
- package/dist/src/plugins/index.d.ts +4 -1
- package/dist/src/plugins/theme/store-theme.d.ts +4 -0
- package/dist/src/plugins/theme/theme.d.ts +10 -0
- package/dist/src/plugins/theme/types.d.ts +12 -0
- package/dist/src/ui3n-plugins.d.ts +5 -3
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/ui/to-css-length.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/ui3n-components.js +1239 -1199
- package/dist/ui3n-plugins.js +83 -34
- package/dist/ui3n-utils.js +4 -4
- package/dist/variables.css +5 -91
- package/package.json +1 -1
- package/src/components/ui3n-autocomplete/types.ts +12 -0
- package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +49 -7
- package/src/components/ui3n-checkbox/ui3n-checkbox.vue +6 -9
- package/src/components/ui3n-notification/types.ts +5 -0
- package/src/components/ui3n-notification/ui3n-notification.vue +38 -16
- package/src/components/ui3n-radio-group/ui3n-radio.vue +9 -6
- package/src/components/ui3n-switch/ui3n-switch.vue +2 -1
- package/src/components/ui3n-tabs/ui3n-tabs.vue +0 -3
- package/dist/chunks/ui3n-notification-DPC5Ke4b.js +0 -278
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, onMounted, onBeforeUnmount,
|
|
2
|
+
import { computed, onMounted, onBeforeUnmount, useCssModule } from 'vue';
|
|
3
3
|
import Ui3nIcon from '../ui3n-icon/ui3n-icon.vue';
|
|
4
4
|
import Ui3nButton from '../ui3n-button/ui3n-button.vue';
|
|
5
|
+
import { toCssLength } from '../../utils/ui/to-css-length';
|
|
5
6
|
import type { Ui3nNotificationProps } from './types';
|
|
6
7
|
|
|
7
8
|
const props = withDefaults(defineProps<Ui3nNotificationProps>(), {
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
position: 'center',
|
|
10
11
|
duration: 0,
|
|
11
12
|
withIcon: true,
|
|
13
|
+
borderRadius: 8,
|
|
12
14
|
onOpen: () => {},
|
|
13
15
|
onClose: () => {},
|
|
14
16
|
});
|
|
@@ -20,25 +22,21 @@
|
|
|
20
22
|
const currentTypeConfig = computed(() => {
|
|
21
23
|
const stylesByTypes = {
|
|
22
24
|
success: {
|
|
23
|
-
color: 'var(--success-content-default)',
|
|
24
25
|
icon: 'round-check-circle',
|
|
25
26
|
iconColor: 'var(--success-fill-default)',
|
|
26
27
|
iconRotate: 0,
|
|
27
28
|
},
|
|
28
29
|
warning: {
|
|
29
|
-
color: 'var(--warning-content-default)',
|
|
30
30
|
icon: 'round-warning',
|
|
31
31
|
iconColor: 'var(--warning-fill-default)',
|
|
32
32
|
iconRotate: 0,
|
|
33
33
|
},
|
|
34
34
|
info: {
|
|
35
|
-
color: 'var(--info-content-default)',
|
|
36
35
|
icon: 'round-info',
|
|
37
36
|
iconColor: 'var(--info-fill-default)',
|
|
38
37
|
iconRotate: 180,
|
|
39
38
|
},
|
|
40
39
|
error: {
|
|
41
|
-
color: 'var(--error-content-default)',
|
|
42
40
|
icon: 'round-info',
|
|
43
41
|
iconColor: 'var(--error-fill-default)',
|
|
44
42
|
iconRotate: 180,
|
|
@@ -53,6 +51,10 @@
|
|
|
53
51
|
return val;
|
|
54
52
|
});
|
|
55
53
|
|
|
54
|
+
const inlineStyles = computed(() => ({
|
|
55
|
+
'--ui3n-notification-border-radius': toCssLength(props.borderRadius, '8px'),
|
|
56
|
+
}));
|
|
57
|
+
|
|
56
58
|
function closeNotification() {
|
|
57
59
|
if (props.onClose) {
|
|
58
60
|
props.onClose();
|
|
@@ -82,6 +84,7 @@
|
|
|
82
84
|
<div
|
|
83
85
|
:id="id"
|
|
84
86
|
:class="mainCssClasses"
|
|
87
|
+
:style="inlineStyles"
|
|
85
88
|
>
|
|
86
89
|
<div
|
|
87
90
|
v-if="withIcon"
|
|
@@ -105,7 +108,6 @@
|
|
|
105
108
|
size="small"
|
|
106
109
|
color="transparent"
|
|
107
110
|
icon="round-close"
|
|
108
|
-
:icon-color="currentTypeConfig.color"
|
|
109
111
|
icon-size="16"
|
|
110
112
|
:class="$style.closeBtn"
|
|
111
113
|
@click="closeNotification"
|
|
@@ -117,22 +119,24 @@
|
|
|
117
119
|
.ui3nNotification {
|
|
118
120
|
--ui3n-notification-width: 380px;
|
|
119
121
|
--ui3n-notification-font-size: 12px;
|
|
120
|
-
--ui3n-notification-border-radius:
|
|
122
|
+
--ui3n-notification-border-radius: 8px;
|
|
121
123
|
--ui3n-notification-margin-bottom: 4px;
|
|
122
124
|
--ui3n-notification-icon-size: 32px;
|
|
125
|
+
--ui3n-notification-text-color: var(--default-content-default);
|
|
123
126
|
|
|
124
127
|
display: flex;
|
|
125
128
|
position: relative;
|
|
126
129
|
box-sizing: border-box;
|
|
127
130
|
z-index: 5000;
|
|
128
131
|
border-radius: var(--ui3n-notification-border-radius);
|
|
129
|
-
outline: 1px solid var(--color-border-
|
|
132
|
+
outline: 1px solid var(--color-border-block-primary-default);
|
|
130
133
|
padding: var(--spacing-m);
|
|
131
134
|
max-width: var(--ui3n-notification-width);
|
|
132
135
|
margin-bottom: var(--ui3n-notification-margin-bottom);
|
|
133
136
|
justify-content: center;
|
|
134
137
|
align-items: center;
|
|
135
138
|
gap: 8px;
|
|
139
|
+
color: var(--ui3n-notification-text-color);
|
|
136
140
|
}
|
|
137
141
|
|
|
138
142
|
.withIcon {
|
|
@@ -159,6 +163,7 @@
|
|
|
159
163
|
font-weight: 500;
|
|
160
164
|
line-height: 1.33;
|
|
161
165
|
padding-right: 20px;
|
|
166
|
+
color: var(--ui3n-notification-text-color);
|
|
162
167
|
}
|
|
163
168
|
|
|
164
169
|
.closeBtn {
|
|
@@ -166,53 +171,70 @@
|
|
|
166
171
|
z-index: 1;
|
|
167
172
|
top: 6px;
|
|
168
173
|
right: 6px;
|
|
174
|
+
color: var(--ui3n-notification-text-color);
|
|
169
175
|
}
|
|
170
176
|
|
|
171
177
|
.infoType {
|
|
178
|
+
--ui3n-notification-text-color: var(--info-content-default);
|
|
179
|
+
|
|
172
180
|
background-color: var(--info-fill-default);
|
|
173
181
|
|
|
174
182
|
.ui3nNotificationIcon {
|
|
175
183
|
background-color: var(--info-content-default);
|
|
176
184
|
}
|
|
177
185
|
|
|
178
|
-
.
|
|
179
|
-
|
|
186
|
+
:global(.dark-theme) &,
|
|
187
|
+
:global(.midnight-theme) &,
|
|
188
|
+
:global(.dark2-theme) & {
|
|
189
|
+
--ui3n-notification-text-color: oklch(from var(--info-content-default) calc(l + 0.15) c h);
|
|
180
190
|
}
|
|
181
191
|
}
|
|
182
192
|
|
|
183
193
|
.successType {
|
|
194
|
+
--ui3n-notification-text-color: var(--success-content-default);
|
|
195
|
+
|
|
184
196
|
background-color: var(--success-fill-default);
|
|
185
197
|
|
|
186
198
|
.ui3nNotificationIcon {
|
|
187
199
|
background-color: var(--success-content-default);
|
|
188
200
|
}
|
|
189
201
|
|
|
190
|
-
.
|
|
191
|
-
|
|
202
|
+
:global(.dark-theme) &,
|
|
203
|
+
:global(.midnight-theme) &,
|
|
204
|
+
:global(.dark2-theme) & {
|
|
205
|
+
--ui3n-notification-text-color: oklch(from var(--success-content-default) calc(l + 0.15) c h);
|
|
192
206
|
}
|
|
193
207
|
}
|
|
194
208
|
|
|
195
209
|
.warningType {
|
|
210
|
+
--ui3n-notification-text-color: var(--warning-content-default);
|
|
211
|
+
|
|
196
212
|
background-color: var(--warning-fill-default);
|
|
197
213
|
|
|
198
214
|
.ui3nNotificationIcon {
|
|
199
215
|
background-color: var(--warning-content-default);
|
|
200
216
|
}
|
|
201
217
|
|
|
202
|
-
.
|
|
203
|
-
|
|
218
|
+
:global(.dark-theme) &,
|
|
219
|
+
:global(.midnight-theme) &,
|
|
220
|
+
:global(.dark2-theme) & {
|
|
221
|
+
--ui3n-notification-text-color: color-mix(in oklch, var(--warning-content-default) 45%, white);
|
|
204
222
|
}
|
|
205
223
|
}
|
|
206
224
|
|
|
207
225
|
.errorType {
|
|
226
|
+
--ui3n-notification-text-color: var(--error-content-default);
|
|
227
|
+
|
|
208
228
|
background-color: var(--error-fill-default);
|
|
209
229
|
|
|
210
230
|
.ui3nNotificationIcon {
|
|
211
231
|
background-color: var(--error-content-default);
|
|
212
232
|
}
|
|
213
233
|
|
|
214
|
-
.
|
|
215
|
-
|
|
234
|
+
:global(.dark-theme) &,
|
|
235
|
+
:global(.midnight-theme) &,
|
|
236
|
+
:global(.dark2-theme) & {
|
|
237
|
+
--ui3n-notification-text-color: color-mix(in oklch, var(--error-content-default) 45%, white);
|
|
216
238
|
}
|
|
217
239
|
}
|
|
218
240
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed,
|
|
2
|
+
import { computed, inject, onBeforeMount, ref, useSlots, watch } from 'vue';
|
|
3
3
|
import type { ComputedRef } from 'vue';
|
|
4
|
+
import Ui3nRipple from '../../directives/ui3n-ripple';
|
|
5
|
+
import { toCssLength } from '../../utils/ui/to-css-length';
|
|
4
6
|
import type { Ui3nRadioEmits, Ui3nRadioProps, Ui3nRadioSlots, Ui3nRadioValue, Ui3nRadioExpose } from './types';
|
|
5
7
|
|
|
8
|
+
const vUi3nRipple = Ui3nRipple;
|
|
9
|
+
|
|
6
10
|
const props = withDefaults(defineProps<Ui3nRadioProps>(), {
|
|
7
11
|
name: undefined,
|
|
8
12
|
modelValue: false,
|
|
@@ -38,7 +42,7 @@
|
|
|
38
42
|
});
|
|
39
43
|
|
|
40
44
|
const radioStyle = computed(() => ({
|
|
41
|
-
'--ui3n-radio-size':
|
|
45
|
+
'--ui3n-radio-size': toCssLength(props.size),
|
|
42
46
|
'--ui3n-radio-color': props.color,
|
|
43
47
|
}));
|
|
44
48
|
|
|
@@ -120,6 +124,7 @@
|
|
|
120
124
|
/>
|
|
121
125
|
|
|
122
126
|
<div
|
|
127
|
+
v-ui3n-ripple
|
|
123
128
|
:class="[$style.body, disabled && $style.bodyDisabled]"
|
|
124
129
|
:tabindex="disabled ? -1 : 0"
|
|
125
130
|
@keydown.enter="change"
|
|
@@ -168,8 +173,6 @@
|
|
|
168
173
|
</template>
|
|
169
174
|
|
|
170
175
|
<style lang="scss" module>
|
|
171
|
-
@use '../../assets/styles/mixins' as mixins;
|
|
172
|
-
|
|
173
176
|
.ui3nRadio {
|
|
174
177
|
--ui3n-radio-min-height: 24px;
|
|
175
178
|
|
|
@@ -206,11 +209,11 @@
|
|
|
206
209
|
justify-content: center;
|
|
207
210
|
align-items: center;
|
|
208
211
|
border-radius: 50%;
|
|
212
|
+
overflow: hidden;
|
|
209
213
|
|
|
210
214
|
&:hover {
|
|
211
215
|
cursor: pointer;
|
|
212
|
-
background-color:
|
|
213
|
-
@include mixins.ripple(oklch(from transparent calc(l - 0.1) c h));
|
|
216
|
+
background-color: color-mix(in oklch, var(--ui3n-radio-color) 16%, transparent);
|
|
214
217
|
}
|
|
215
218
|
}
|
|
216
219
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { computed, ref, watch, useSlots } from 'vue';
|
|
3
|
+
import { toCssLength } from '../../utils/ui/to-css-length';
|
|
3
4
|
import type { Ui3nSwitchEmits, Ui3nSwitchProps, Ui3nSwitchSlots, Ui3nSwitchExpose } from './types';
|
|
4
5
|
|
|
5
6
|
const props = withDefaults(defineProps<Ui3nSwitchProps>(), {
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
|
|
18
19
|
const switchStyle = computed(() => ({
|
|
19
20
|
'--ui3n-switch-color': props.color,
|
|
20
|
-
'--ui3n-switch-size':
|
|
21
|
+
'--ui3n-switch-size': toCssLength(props.size),
|
|
21
22
|
}));
|
|
22
23
|
|
|
23
24
|
function change(ev: Event) {
|
|
@@ -98,8 +98,6 @@
|
|
|
98
98
|
</template>
|
|
99
99
|
|
|
100
100
|
<style lang="scss" module>
|
|
101
|
-
@use '../../assets/styles/mixins' as mixins;
|
|
102
|
-
|
|
103
101
|
.ui3nTabs {
|
|
104
102
|
--ui3n-tabs-height: 48px;
|
|
105
103
|
|
|
@@ -116,7 +114,6 @@
|
|
|
116
114
|
position: relative;
|
|
117
115
|
user-select: none;
|
|
118
116
|
color: var(--ui3n-tabs-inactive-color);
|
|
119
|
-
@include mixins.ripple(var(--color-bg-control-secondary-default));
|
|
120
117
|
|
|
121
118
|
&:hover {
|
|
122
119
|
background-color: var(--color-bg-control-secondary-default);
|
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, mergeProps as s, normalizeClass as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderSlot as p, toDisplayString as m, unref as h, useCssModule as g, watch as _, withDirectives as v, withKeys as y } from "vue";
|
|
2
|
-
//#region src/directives/ui3n-ripple.ts
|
|
3
|
-
var b = {}, x = "";
|
|
4
|
-
function S({ el: e, duration: t }) {
|
|
5
|
-
let n = document.createElement("div"), r = Math.max(e.clientWidth, e.clientHeight), i = r / 2;
|
|
6
|
-
n.style.width = n.style.height = `${r}px`, n.style.left = `${Math.round(e.clientWidth / 2 - i)}px`, n.style.top = `${Math.round(e.clientHeight / 2 - i)}px`, n.classList.add("ui3n-ripple"), x && n.style.setProperty("--ui3n-ripple-bg-color", x), t && n.style.setProperty("--ui3n-ripple-duration", `${t}ms`);
|
|
7
|
-
let a = e.getElementsByClassName("ui3n-ripple")[0];
|
|
8
|
-
a && a.remove(), e.appendChild(n);
|
|
9
|
-
}
|
|
10
|
-
function C({ eventName: e, el: t, duration: n }) {
|
|
11
|
-
["click", "keydown"].includes(e) && (b[e] = new AbortController(), t.addEventListener(e, function() {
|
|
12
|
-
S({
|
|
13
|
-
el: t,
|
|
14
|
-
duration: n
|
|
15
|
-
});
|
|
16
|
-
}, { signal: b[e].signal }));
|
|
17
|
-
}
|
|
18
|
-
var w = {
|
|
19
|
-
mounted(e, t) {
|
|
20
|
-
let { color: n, duration: r, eventsTriggers: i = [], disabled: a = !1 } = t.value || {};
|
|
21
|
-
x = n || "", !a && ((!i.length || i.length && i.includes("click")) && C({
|
|
22
|
-
eventName: "click",
|
|
23
|
-
el: e,
|
|
24
|
-
duration: r
|
|
25
|
-
}), i.length && i.includes("enter") && C({
|
|
26
|
-
eventName: "keydown",
|
|
27
|
-
el: e,
|
|
28
|
-
duration: r
|
|
29
|
-
}));
|
|
30
|
-
},
|
|
31
|
-
beforeUnmount() {
|
|
32
|
-
Object.keys(b).forEach((e) => {
|
|
33
|
-
b[e].abort();
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}, T = ["id", "title"], E = /* @__PURE__ */ o({
|
|
37
|
-
__name: "ui3n-icon",
|
|
38
|
-
props: {
|
|
39
|
-
id: {},
|
|
40
|
-
icon: {},
|
|
41
|
-
title: { default: "" },
|
|
42
|
-
size: {},
|
|
43
|
-
width: {},
|
|
44
|
-
height: {},
|
|
45
|
-
color: { default: "var(--color-icon-control-primary-default)" },
|
|
46
|
-
horizontalFlip: { type: Boolean },
|
|
47
|
-
verticalFlip: { type: Boolean },
|
|
48
|
-
rotate: { default: 0 }
|
|
49
|
-
},
|
|
50
|
-
emits: ["click"],
|
|
51
|
-
setup(t, { emit: n }) {
|
|
52
|
-
let i = t, a = n, o = e(() => i.size || i.width || 16), c = e(() => i.size || i.height || 16), l = e(() => {
|
|
53
|
-
let e = {
|
|
54
|
-
"--ui3n-icon-width": u(o.value),
|
|
55
|
-
"--ui3n-icon-height": u(c.value),
|
|
56
|
-
"--ui3n-icon-color": i.color
|
|
57
|
-
}, t = [];
|
|
58
|
-
return i.horizontalFlip && t.push("rotateY(180deg)"), i.verticalFlip && t.push("rotateX(180deg)"), i.rotate && t.push(`rotate(${i.rotate}deg)`), t.length && (e.transform = t.join(" ")), e;
|
|
59
|
-
});
|
|
60
|
-
function u(e) {
|
|
61
|
-
return isNaN(Number(e)) ? String(e) : `${e}px`;
|
|
62
|
-
}
|
|
63
|
-
return (e, n) => (d(), r("div", s({
|
|
64
|
-
id: t.id,
|
|
65
|
-
class: e.$style.ui3nIcon,
|
|
66
|
-
title: t.title,
|
|
67
|
-
style: l.value
|
|
68
|
-
}, { "data-icon": t.icon }, { onClick: n[0] ||= (e) => a("click", e) }), null, 16, T));
|
|
69
|
-
}
|
|
70
|
-
}), D = { ui3nIcon: "_ui3nIcon_10yhz_1" }, O = (e, t) => {
|
|
71
|
-
let n = e.__vccOpts || e;
|
|
72
|
-
for (let [e, r] of t) n[e] = r;
|
|
73
|
-
return n;
|
|
74
|
-
}, k = /* @__PURE__ */ O(E, [["__cssModules", { $style: D }]]), A = {
|
|
75
|
-
small: 12,
|
|
76
|
-
regular: 16,
|
|
77
|
-
large: 24
|
|
78
|
-
}, j = ["id", "disabled"], M = /* @__PURE__ */ O(/* @__PURE__ */ o({
|
|
79
|
-
__name: "ui3n-button",
|
|
80
|
-
props: {
|
|
81
|
-
id: {},
|
|
82
|
-
type: { default: "primary" },
|
|
83
|
-
size: { default: "regular" },
|
|
84
|
-
square: { type: Boolean },
|
|
85
|
-
block: { type: Boolean },
|
|
86
|
-
textColor: {},
|
|
87
|
-
color: {},
|
|
88
|
-
elevation: { type: Boolean },
|
|
89
|
-
icon: {},
|
|
90
|
-
iconSize: {},
|
|
91
|
-
iconColor: {},
|
|
92
|
-
iconPosition: { default: "right" },
|
|
93
|
-
disabled: {
|
|
94
|
-
type: Boolean,
|
|
95
|
-
default: !1
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
emits: [
|
|
99
|
-
"init",
|
|
100
|
-
"click",
|
|
101
|
-
"enter",
|
|
102
|
-
"focus",
|
|
103
|
-
"blur"
|
|
104
|
-
],
|
|
105
|
-
setup(i, { emit: a }) {
|
|
106
|
-
let o = w, s = i, l = a, m = g(), b = f(null), x = e(() => {
|
|
107
|
-
let e = [
|
|
108
|
-
m.ui3nButton,
|
|
109
|
-
m[s.size],
|
|
110
|
-
m[s.type]
|
|
111
|
-
];
|
|
112
|
-
return s.block && s.type !== "icon" && e.push(m.block), s.square && e.push(m.square), s.icon && e.push(m[`withIcon-${s.iconPosition}`]), s.elevation && e.push(m.elevation), e;
|
|
113
|
-
}), S = e(() => s.iconSize ? s.iconSize : A[s.size]), C = e(() => s.iconColor ? s.iconColor : "inherit");
|
|
114
|
-
async function T(e, t) {
|
|
115
|
-
["init", "enter"].includes(e) ? l(e, b.value) : l(e, t);
|
|
116
|
-
}
|
|
117
|
-
return _([() => s.color, () => s.textColor], (e, t) => {
|
|
118
|
-
if (!b.value) return;
|
|
119
|
-
let [n, r] = t, [i, a] = e;
|
|
120
|
-
(s.type === "custom" || s.type === "icon") && i !== n && b.value.style.setProperty("--ui3n-button-bg-color", i ?? "var(--color-bg-button-primary-default)"), (s.type === "custom" || s.type === "icon") && a !== r && b.value.style.setProperty("--ui3n-button-text-color", a ?? "var(--color-text-button-primary-default)");
|
|
121
|
-
}), u(() => {
|
|
122
|
-
b.value && ((s.type === "custom" || s.type === "icon") && s.color && b.value.style.setProperty("--ui3n-button-bg-color", s.color), s.type === "custom" && s.textColor && b.value.style.setProperty("--ui3n-button-text-color", s.textColor), T("init"));
|
|
123
|
-
}), (e, a) => v((d(), r("button", {
|
|
124
|
-
ref_key: "buttonEl",
|
|
125
|
-
ref: b,
|
|
126
|
-
id: i.id,
|
|
127
|
-
class: c(x.value),
|
|
128
|
-
type: "button",
|
|
129
|
-
disabled: i.disabled,
|
|
130
|
-
onClick: a[0] ||= (e) => T("click", e),
|
|
131
|
-
onFocusin: a[1] ||= (e) => T("focus", e),
|
|
132
|
-
onFocusout: a[2] ||= (e) => T("blur", e),
|
|
133
|
-
onKeydown: a[3] ||= y((e) => T("enter"), ["enter"])
|
|
134
|
-
}, [i.icon ? (d(), t(k, {
|
|
135
|
-
key: 0,
|
|
136
|
-
class: c(e.$style.buttonIcon),
|
|
137
|
-
icon: i.icon,
|
|
138
|
-
size: S.value,
|
|
139
|
-
color: C.value
|
|
140
|
-
}, null, 8, [
|
|
141
|
-
"class",
|
|
142
|
-
"icon",
|
|
143
|
-
"size",
|
|
144
|
-
"color"
|
|
145
|
-
])) : n("", !0), i.type === "icon" ? n("", !0) : (d(), r("span", {
|
|
146
|
-
key: 1,
|
|
147
|
-
class: c(e.$style.text)
|
|
148
|
-
}, [p(e.$slots, "default")], 2))], 42, j)), [[h(o)]]);
|
|
149
|
-
}
|
|
150
|
-
}), [["__cssModules", { $style: {
|
|
151
|
-
ui3nButton: "_ui3nButton_5lm0q_3",
|
|
152
|
-
"withIcon-left": "_withIcon-left_5lm0q_35",
|
|
153
|
-
"withIcon-right": "_withIcon-right_5lm0q_38",
|
|
154
|
-
square: "_square_5lm0q_41",
|
|
155
|
-
regular: "_regular_5lm0q_48",
|
|
156
|
-
small: "_small_5lm0q_55",
|
|
157
|
-
large: "_large_5lm0q_62",
|
|
158
|
-
block: "_block_5lm0q_69",
|
|
159
|
-
primary: "_primary_5lm0q_73",
|
|
160
|
-
elevation: "_elevation_5lm0q_96",
|
|
161
|
-
text: "_text_5lm0q_101",
|
|
162
|
-
secondary: "_secondary_5lm0q_133",
|
|
163
|
-
tertiary: "_tertiary_5lm0q_187",
|
|
164
|
-
outline: "_outline_5lm0q_242",
|
|
165
|
-
icon: "_icon_5lm0q_270",
|
|
166
|
-
custom: "_custom_5lm0q_290",
|
|
167
|
-
buttonIcon: "_buttonIcon_5lm0q_319"
|
|
168
|
-
} }]]), N = ["id"], P = /* @__PURE__ */ O(/* @__PURE__ */ o({
|
|
169
|
-
__name: "ui3n-notification",
|
|
170
|
-
props: {
|
|
171
|
-
id: {},
|
|
172
|
-
type: { default: "info" },
|
|
173
|
-
content: {},
|
|
174
|
-
position: { default: "center" },
|
|
175
|
-
duration: { default: 0 },
|
|
176
|
-
withIcon: {
|
|
177
|
-
type: Boolean,
|
|
178
|
-
default: !0
|
|
179
|
-
},
|
|
180
|
-
onOpen: {
|
|
181
|
-
type: Function,
|
|
182
|
-
default: () => {}
|
|
183
|
-
},
|
|
184
|
-
onClose: {
|
|
185
|
-
type: Function,
|
|
186
|
-
default: () => {}
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
setup(o) {
|
|
190
|
-
let s = o, f = null, p = g(), _ = e(() => ({
|
|
191
|
-
success: {
|
|
192
|
-
color: "var(--success-content-default)",
|
|
193
|
-
icon: "round-check-circle",
|
|
194
|
-
iconColor: "var(--success-fill-default)",
|
|
195
|
-
iconRotate: 0
|
|
196
|
-
},
|
|
197
|
-
warning: {
|
|
198
|
-
color: "var(--warning-content-default)",
|
|
199
|
-
icon: "round-warning",
|
|
200
|
-
iconColor: "var(--warning-fill-default)",
|
|
201
|
-
iconRotate: 0
|
|
202
|
-
},
|
|
203
|
-
info: {
|
|
204
|
-
color: "var(--info-content-default)",
|
|
205
|
-
icon: "round-info",
|
|
206
|
-
iconColor: "var(--info-fill-default)",
|
|
207
|
-
iconRotate: 180
|
|
208
|
-
},
|
|
209
|
-
error: {
|
|
210
|
-
color: "var(--error-content-default)",
|
|
211
|
-
icon: "round-info",
|
|
212
|
-
iconColor: "var(--error-fill-default)",
|
|
213
|
-
iconRotate: 180
|
|
214
|
-
}
|
|
215
|
-
})[s.type || "info"]), v = e(() => {
|
|
216
|
-
let e = [
|
|
217
|
-
p.ui3nNotification,
|
|
218
|
-
p[`${s.type}Type`],
|
|
219
|
-
p[`${s.position}Position`]
|
|
220
|
-
];
|
|
221
|
-
return s.withIcon && e.push(p.withIcon), e;
|
|
222
|
-
});
|
|
223
|
-
function y() {
|
|
224
|
-
s.onClose && s.onClose();
|
|
225
|
-
}
|
|
226
|
-
return u(() => {
|
|
227
|
-
s.onOpen && s.onOpen(), s.duration > 0 && (f = setTimeout(() => {
|
|
228
|
-
y();
|
|
229
|
-
}, s.duration));
|
|
230
|
-
}), l(() => {
|
|
231
|
-
f && clearTimeout(f);
|
|
232
|
-
}), (e, s) => (d(), r("div", {
|
|
233
|
-
id: o.id,
|
|
234
|
-
class: c(v.value)
|
|
235
|
-
}, [
|
|
236
|
-
o.withIcon ? (d(), r("div", {
|
|
237
|
-
key: 0,
|
|
238
|
-
class: c(h(p).ui3nNotificationIcon)
|
|
239
|
-
}, [a(k, {
|
|
240
|
-
icon: _.value.icon,
|
|
241
|
-
size: "16",
|
|
242
|
-
rotate: _.value.iconRotate,
|
|
243
|
-
color: _.value.iconColor
|
|
244
|
-
}, null, 8, [
|
|
245
|
-
"icon",
|
|
246
|
-
"rotate",
|
|
247
|
-
"color"
|
|
248
|
-
])], 2)) : n("", !0),
|
|
249
|
-
i("div", { class: c(h(p).ui3nNotificationContent) }, m(o.content), 3),
|
|
250
|
-
o.duration ? n("", !0) : (d(), t(M, {
|
|
251
|
-
key: 1,
|
|
252
|
-
type: "icon",
|
|
253
|
-
size: "small",
|
|
254
|
-
color: "transparent",
|
|
255
|
-
icon: "round-close",
|
|
256
|
-
"icon-color": _.value.color,
|
|
257
|
-
"icon-size": "16",
|
|
258
|
-
class: c(h(p).closeBtn),
|
|
259
|
-
onClick: y
|
|
260
|
-
}, null, 8, ["icon-color", "class"]))
|
|
261
|
-
], 10, N));
|
|
262
|
-
}
|
|
263
|
-
}), [["__cssModules", { $style: {
|
|
264
|
-
ui3nNotification: "_ui3nNotification_1iczq_1",
|
|
265
|
-
withIcon: "_withIcon_1iczq_21",
|
|
266
|
-
ui3nNotificationIcon: "_ui3nNotificationIcon_1iczq_25",
|
|
267
|
-
ui3nNotificationContent: "_ui3nNotificationContent_1iczq_38",
|
|
268
|
-
closeBtn: "_closeBtn_1iczq_47",
|
|
269
|
-
infoType: "_infoType_1iczq_54",
|
|
270
|
-
successType: "_successType_1iczq_64",
|
|
271
|
-
warningType: "_warningType_1iczq_74",
|
|
272
|
-
errorType: "_errorType_1iczq_84",
|
|
273
|
-
leftPosition: "_leftPosition_1iczq_94",
|
|
274
|
-
centerPosition: "_centerPosition_1iczq_99",
|
|
275
|
-
rightPosition: "_rightPosition_1iczq_104"
|
|
276
|
-
} }]]);
|
|
277
|
-
//#endregion
|
|
278
|
-
export { w as a, O as i, M as n, k as r, P as t };
|