nuxt-hs-ui 1.0.2 → 1.0.3
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.json +1 -1
- package/dist/runtime/components/hs-fc/btn/index.vue +10 -8
- package/dist/runtime/components/hs-fc/btn/line-loading.vue +7 -3
- package/dist/runtime/components/hs-ui/accordion.vue +9 -6
- package/dist/runtime/components/hs-ui/aspect-box.vue +8 -3
- package/dist/runtime/components/hs-ui/block-loading.vue +12 -7
- package/dist/runtime/components/hs-ui/card-item.vue +12 -7
- package/dist/runtime/components/hs-ui/card.vue +8 -2
- package/dist/runtime/components/hs-ui/container.vue +7 -3
- package/dist/runtime/components/hs-ui/dialog/index.vue +24 -9
- package/dist/runtime/components/hs-ui/modal/bg.vue +11 -7
- package/dist/runtime/components/hs-ui/modal/index.vue +10 -7
- package/dist/runtime/components/hs-ui/toast/index.vue +32 -15
- package/dist/runtime/components/v-test.vue +7 -4
- package/dist/runtime/lib/prefix.d.ts +2 -2
- package/dist/runtime/lib/prefix.js +3 -5
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -9,7 +9,7 @@ HsFcBtnHsFcBtn
|
|
|
9
9
|
// [ vue ]
|
|
10
10
|
import { computed, ref } from 'vue';
|
|
11
11
|
// [ NUXT ]
|
|
12
|
-
import { useId } from '#imports';
|
|
12
|
+
import { useId, useRuntimeConfig } from '#imports';
|
|
13
13
|
// [ vueuse ]
|
|
14
14
|
import { useHsFormFocus } from '../../../composables/use-hs-form-focus';
|
|
15
15
|
// ----------------------------------------------------------------------------
|
|
@@ -20,9 +20,11 @@ import { GetPrefix, RemovePrefix } from '../../../lib/prefix';
|
|
|
20
20
|
// ----------------------------------------------------------------------------
|
|
21
21
|
import type { Theme } from '../../../lib/theme';
|
|
22
22
|
// ----------------------------------------------------------------------------
|
|
23
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
24
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
23
25
|
|
|
24
26
|
const twMerge = extendTailwindMerge({
|
|
25
|
-
prefix:
|
|
27
|
+
prefix: prefix,
|
|
26
28
|
});
|
|
27
29
|
|
|
28
30
|
// ----------------------------------------------------------------------------
|
|
@@ -69,7 +71,7 @@ emit('id', id);
|
|
|
69
71
|
// ----------------------------------------------------------------------------
|
|
70
72
|
// Base Design
|
|
71
73
|
// -----
|
|
72
|
-
const baseClass = RemovePrefix([
|
|
74
|
+
const baseClass = RemovePrefix(prefix, [
|
|
73
75
|
//
|
|
74
76
|
'relative',
|
|
75
77
|
'tw-relative',
|
|
@@ -96,7 +98,7 @@ const baseClass = RemovePrefix([
|
|
|
96
98
|
'disabled:pointer-events-none',
|
|
97
99
|
'tw-disabled:pointer-events-none',
|
|
98
100
|
]);
|
|
99
|
-
const baseClassForm = RemovePrefix([
|
|
101
|
+
const baseClassForm = RemovePrefix(prefix, [
|
|
100
102
|
//
|
|
101
103
|
'border',
|
|
102
104
|
'tw-border',
|
|
@@ -113,7 +115,7 @@ const baseClassForm = RemovePrefix([
|
|
|
113
115
|
]);
|
|
114
116
|
const variableStyle = computed(() => {
|
|
115
117
|
if (props.variant === 'outlined') {
|
|
116
|
-
return RemovePrefix([
|
|
118
|
+
return RemovePrefix(prefix, [
|
|
117
119
|
//
|
|
118
120
|
'border-[2px]',
|
|
119
121
|
'tw-border-[2px]',
|
|
@@ -125,20 +127,20 @@ const variableStyle = computed(() => {
|
|
|
125
127
|
});
|
|
126
128
|
const align = computed(() => {
|
|
127
129
|
if (props.textAlign === 'left') {
|
|
128
|
-
return RemovePrefix([
|
|
130
|
+
return RemovePrefix(prefix, [
|
|
129
131
|
//
|
|
130
132
|
'justify-start',
|
|
131
133
|
'tw-justify-start',
|
|
132
134
|
]);
|
|
133
135
|
}
|
|
134
136
|
if (props.textAlign === 'right') {
|
|
135
|
-
return RemovePrefix([
|
|
137
|
+
return RemovePrefix(prefix, [
|
|
136
138
|
//
|
|
137
139
|
'justify-end',
|
|
138
140
|
'tw-justify-end',
|
|
139
141
|
]);
|
|
140
142
|
}
|
|
141
|
-
return RemovePrefix([
|
|
143
|
+
return RemovePrefix(prefix, [
|
|
142
144
|
//
|
|
143
145
|
'justify-center',
|
|
144
146
|
'tw-justify-center',
|
|
@@ -8,14 +8,18 @@ HsFcBtnLineLoadingHsFcBtnLineLoading
|
|
|
8
8
|
|
|
9
9
|
// [ vue ]
|
|
10
10
|
import { computed } from 'vue';
|
|
11
|
+
// [ NUXT ]
|
|
12
|
+
import { useRuntimeConfig } from '#imports';
|
|
11
13
|
// // [ tailwind ]
|
|
12
14
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
13
15
|
import { type ClassType, ClassTypeToString } from '../../../lib/com';
|
|
14
16
|
import { GetPrefix, RemovePrefix } from '../../../lib/prefix';
|
|
15
|
-
|
|
17
|
+
// ----------------------------------------------------------------------------
|
|
18
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
19
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
16
20
|
// ----------------------------------------------------------------------------
|
|
17
21
|
const twMerge = extendTailwindMerge({
|
|
18
|
-
prefix:
|
|
22
|
+
prefix: prefix,
|
|
19
23
|
});
|
|
20
24
|
|
|
21
25
|
// ----------------------------------------------------------------------------
|
|
@@ -31,7 +35,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
31
35
|
class: '',
|
|
32
36
|
});
|
|
33
37
|
// ----------------------------------------------------------------------------
|
|
34
|
-
const baseClass = RemovePrefix([
|
|
38
|
+
const baseClass = RemovePrefix(prefix, [
|
|
35
39
|
//
|
|
36
40
|
'absolute',
|
|
37
41
|
'tw-absolute',
|
|
@@ -8,15 +8,18 @@ HsUiAccordionHsUiAccordion
|
|
|
8
8
|
|
|
9
9
|
// [ vue ]
|
|
10
10
|
import { computed, ref, watch, nextTick } from 'vue';
|
|
11
|
+
// [ NUXT ]
|
|
12
|
+
import { useRuntimeConfig } from '#imports';
|
|
11
13
|
// [ tailwind ]
|
|
12
14
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
13
15
|
import { type ClassType, ClassTypeToString } from '../../lib/class-style';
|
|
14
16
|
import { GetPrefix, RemovePrefix } from '../../lib/prefix';
|
|
15
|
-
|
|
16
17
|
// ----------------------------------------------------------------------------
|
|
17
|
-
|
|
18
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
19
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
20
|
+
// ----------------------------------------------------------------------------
|
|
18
21
|
const twMerge = extendTailwindMerge({
|
|
19
|
-
prefix:
|
|
22
|
+
prefix: prefix,
|
|
20
23
|
});
|
|
21
24
|
// ----------------------------------------------------------------------------
|
|
22
25
|
// [ Props ]
|
|
@@ -50,7 +53,7 @@ watch(
|
|
|
50
53
|
}
|
|
51
54
|
);
|
|
52
55
|
|
|
53
|
-
const baseClass = RemovePrefix([
|
|
56
|
+
const baseClass = RemovePrefix(prefix, [
|
|
54
57
|
//
|
|
55
58
|
'w-full',
|
|
56
59
|
'tw-w-full',
|
|
@@ -59,7 +62,7 @@ const baseClass = RemovePrefix([
|
|
|
59
62
|
const classStyle = computed(() => {
|
|
60
63
|
return twMerge(baseClass, ClassTypeToString(props.class));
|
|
61
64
|
});
|
|
62
|
-
const classOverflow = RemovePrefix([
|
|
65
|
+
const classOverflow = RemovePrefix(prefix, [
|
|
63
66
|
//
|
|
64
67
|
'overflow-y-hidden',
|
|
65
68
|
'tw-overflow-y-hidden',
|
|
@@ -77,7 +80,7 @@ const overflowClass = computed(() => {
|
|
|
77
80
|
:style="`--hsui-accordion-span:${props.span}ms`"
|
|
78
81
|
:aria-hidden="!props.open"
|
|
79
82
|
>
|
|
80
|
-
<div :class="overflowClass"><slot/></div>
|
|
83
|
+
<div :class="overflowClass"><slot /></div>
|
|
81
84
|
</div>
|
|
82
85
|
</template>
|
|
83
86
|
|
|
@@ -8,6 +8,8 @@ HsUiAspectBoxHsUiAspectBox
|
|
|
8
8
|
|
|
9
9
|
// [ vue ]
|
|
10
10
|
import { computed } from 'vue';
|
|
11
|
+
// [ NUXT ]
|
|
12
|
+
import { useRuntimeConfig } from '#imports';
|
|
11
13
|
// [ tailwind ]
|
|
12
14
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
13
15
|
import { type ClassType, ClassTypeToString } from '../../lib/class-style';
|
|
@@ -15,8 +17,11 @@ import { GetPrefix, RemovePrefix } from '../../lib/prefix';
|
|
|
15
17
|
// [ src > runtime > lib > * ]
|
|
16
18
|
import { Int } from '../../lib/number';
|
|
17
19
|
// ----------------------------------------------------------------------------
|
|
20
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
21
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
22
|
+
// ----------------------------------------------------------------------------
|
|
18
23
|
const twMerge = extendTailwindMerge({
|
|
19
|
-
prefix:
|
|
24
|
+
prefix: prefix,
|
|
20
25
|
});
|
|
21
26
|
// ----------------------------------------------------------------------------
|
|
22
27
|
type Props = {
|
|
@@ -28,7 +33,7 @@ type Props = {
|
|
|
28
33
|
* - 3:2 <- Default
|
|
29
34
|
* - 4:3
|
|
30
35
|
* - 16:9
|
|
31
|
-
|
|
36
|
+
*/
|
|
32
37
|
rate?: string;
|
|
33
38
|
};
|
|
34
39
|
|
|
@@ -43,7 +48,7 @@ const aspectRate = computed(() => {
|
|
|
43
48
|
return ((right / left) * 100).toFixed(3);
|
|
44
49
|
});
|
|
45
50
|
|
|
46
|
-
const baseClass = RemovePrefix([
|
|
51
|
+
const baseClass = RemovePrefix(prefix, [
|
|
47
52
|
//
|
|
48
53
|
'relative',
|
|
49
54
|
'tw-relative',
|
|
@@ -8,13 +8,18 @@ HsUiBlockLoadingHsUiBlockLoading
|
|
|
8
8
|
|
|
9
9
|
// [ vue ]
|
|
10
10
|
import { computed } from 'vue';
|
|
11
|
+
// [ NUXT ]
|
|
12
|
+
import { useRuntimeConfig } from '#imports';
|
|
11
13
|
// [ tailwind ]
|
|
12
14
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
13
15
|
import { type ClassType, ClassTypeToString } from '../../lib/class-style';
|
|
14
16
|
import { GetPrefix, RemovePrefix } from '../../lib/prefix';
|
|
15
17
|
// ----------------------------------------------------------------------------
|
|
18
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
19
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
20
|
+
// ----------------------------------------------------------------------------
|
|
16
21
|
const twMerge = extendTailwindMerge({
|
|
17
|
-
prefix:
|
|
22
|
+
prefix: prefix,
|
|
18
23
|
});
|
|
19
24
|
// ----------------------------------------------------------------------------
|
|
20
25
|
type Props = {
|
|
@@ -27,7 +32,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
27
32
|
show: false,
|
|
28
33
|
message: 'Loading',
|
|
29
34
|
});
|
|
30
|
-
const baseClass = RemovePrefix([
|
|
35
|
+
const baseClass = RemovePrefix(prefix, [
|
|
31
36
|
//
|
|
32
37
|
'px-2',
|
|
33
38
|
'tw-px-2',
|
|
@@ -59,7 +64,7 @@ const baseClass = RemovePrefix([
|
|
|
59
64
|
|
|
60
65
|
const variableStyle = computed(() => {
|
|
61
66
|
if (props.show) {
|
|
62
|
-
return RemovePrefix([
|
|
67
|
+
return RemovePrefix(prefix,[
|
|
63
68
|
//
|
|
64
69
|
'pointer-events-auto',
|
|
65
70
|
'tw-pointer-events-auto',
|
|
@@ -67,7 +72,7 @@ const variableStyle = computed(() => {
|
|
|
67
72
|
'tw-opacity-100',
|
|
68
73
|
]);
|
|
69
74
|
}
|
|
70
|
-
return RemovePrefix([
|
|
75
|
+
return RemovePrefix(prefix,[
|
|
71
76
|
//
|
|
72
77
|
'pointer-events-none',
|
|
73
78
|
'tw-pointer-events-none',
|
|
@@ -84,9 +89,9 @@ const classStyle = computed(() => {
|
|
|
84
89
|
<div class="HsUiBlockLoading" :class="[classStyle]">
|
|
85
90
|
<div class="loading-container">
|
|
86
91
|
<div class="loading-item">
|
|
87
|
-
<div class="loading-ball"/>
|
|
88
|
-
<div class="loading-ball"/>
|
|
89
|
-
<div class="loading-ball"/>
|
|
92
|
+
<div class="loading-ball" />
|
|
93
|
+
<div class="loading-ball" />
|
|
94
|
+
<div class="loading-ball" />
|
|
90
95
|
</div>
|
|
91
96
|
<div class="loading-text">{{ props.message }}</div>
|
|
92
97
|
</div>
|
|
@@ -8,15 +8,20 @@ HsUiCardItemHsUiCardItem
|
|
|
8
8
|
|
|
9
9
|
// [ vue ]
|
|
10
10
|
import { computed } from 'vue';
|
|
11
|
+
// [ NUXT ]
|
|
12
|
+
import { useRuntimeConfig } from '#imports';
|
|
11
13
|
// [ tailwind ]
|
|
12
14
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
13
15
|
import { type ClassType, ClassTypeToArray } from '../../lib/class-style';
|
|
14
16
|
import { GetPrefix, RemovePrefix } from '../../lib/prefix';
|
|
15
|
-
|
|
17
|
+
// ----------------------------------------------------------------------------
|
|
18
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
19
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
16
20
|
// ----------------------------------------------------------------------------
|
|
17
21
|
const twMerge = extendTailwindMerge({
|
|
18
|
-
prefix:
|
|
22
|
+
prefix: prefix,
|
|
19
23
|
});
|
|
24
|
+
|
|
20
25
|
// ----------------------------------------------------------------------------
|
|
21
26
|
|
|
22
27
|
interface Props {
|
|
@@ -42,7 +47,7 @@ const emit = defineEmits<Emits>();
|
|
|
42
47
|
|
|
43
48
|
// ----------------------------------------------------------------------------
|
|
44
49
|
|
|
45
|
-
const baseClass = RemovePrefix([
|
|
50
|
+
const baseClass = RemovePrefix(prefix, [
|
|
46
51
|
//
|
|
47
52
|
'relative',
|
|
48
53
|
'tw-relative',
|
|
@@ -52,7 +57,7 @@ const baseClass = RemovePrefix([
|
|
|
52
57
|
'tw-py-1',
|
|
53
58
|
]);
|
|
54
59
|
|
|
55
|
-
const baseClassHeaderFooter = RemovePrefix([
|
|
60
|
+
const baseClassHeaderFooter = RemovePrefix(prefix, [
|
|
56
61
|
//,,
|
|
57
62
|
'relative',
|
|
58
63
|
'tw-relative',
|
|
@@ -70,7 +75,7 @@ const baseClassHeaderFooter = RemovePrefix([
|
|
|
70
75
|
'tw-flex-none',
|
|
71
76
|
]);
|
|
72
77
|
|
|
73
|
-
const baseClassBody = RemovePrefix([
|
|
78
|
+
const baseClassBody = RemovePrefix(prefix, [
|
|
74
79
|
//
|
|
75
80
|
'relative',
|
|
76
81
|
'tw-relative',
|
|
@@ -84,13 +89,13 @@ const baseClassBody = RemovePrefix([
|
|
|
84
89
|
'tw-overflow-auto',
|
|
85
90
|
]);
|
|
86
91
|
|
|
87
|
-
const pe1 = RemovePrefix([
|
|
92
|
+
const pe1 = RemovePrefix(prefix, [
|
|
88
93
|
//
|
|
89
94
|
'pe-1',
|
|
90
95
|
'tw-pe-1',
|
|
91
96
|
]);
|
|
92
97
|
|
|
93
|
-
const showBtnStyle = RemovePrefix([
|
|
98
|
+
const showBtnStyle = RemovePrefix(prefix, [
|
|
94
99
|
//
|
|
95
100
|
'border-[1px]',
|
|
96
101
|
'tw-border-[1px]',
|
|
@@ -8,14 +8,20 @@ HsUiCardHsUiCard
|
|
|
8
8
|
|
|
9
9
|
// [ vue ]
|
|
10
10
|
import { computed } from 'vue';
|
|
11
|
+
// [ NUXT ]
|
|
12
|
+
import { useRuntimeConfig } from '#imports';
|
|
11
13
|
// [ tailwind ]
|
|
12
14
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
13
15
|
import { type ClassType, ClassTypeToString } from '../../lib/class-style';
|
|
14
16
|
import { GetPrefix, RemovePrefix } from '../../lib/prefix';
|
|
15
17
|
// ----------------------------------------------------------------------------
|
|
18
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
19
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
20
|
+
// ----------------------------------------------------------------------------
|
|
16
21
|
const twMerge = extendTailwindMerge({
|
|
17
|
-
prefix:
|
|
22
|
+
prefix: prefix,
|
|
18
23
|
});
|
|
24
|
+
|
|
19
25
|
// ----------------------------------------------------------------------------
|
|
20
26
|
interface Props {
|
|
21
27
|
class?: ClassType | undefined;
|
|
@@ -24,7 +30,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
24
30
|
class: '',
|
|
25
31
|
});
|
|
26
32
|
|
|
27
|
-
const baseClass = RemovePrefix([
|
|
33
|
+
const baseClass = RemovePrefix(prefix, [
|
|
28
34
|
//
|
|
29
35
|
'relative',
|
|
30
36
|
'tw-relative',
|
|
@@ -9,14 +9,18 @@ HsUiContainerHsUiContainer
|
|
|
9
9
|
// [ node_modules ]
|
|
10
10
|
// [ vue ]
|
|
11
11
|
import { computed } from 'vue';
|
|
12
|
+
// [ NUXT ]
|
|
13
|
+
import { useRuntimeConfig } from '#imports';
|
|
12
14
|
// [ tailwind ]
|
|
13
15
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
14
16
|
import { type ClassType, ClassTypeToString } from '../../lib/class-style';
|
|
15
17
|
import { GetPrefix, RemovePrefix } from '../../lib/prefix';
|
|
16
|
-
|
|
18
|
+
// ----------------------------------------------------------------------------
|
|
19
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
20
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
17
21
|
// ----------------------------------------------------------------------------
|
|
18
22
|
const twMerge = extendTailwindMerge({
|
|
19
|
-
prefix:
|
|
23
|
+
prefix: prefix,
|
|
20
24
|
});
|
|
21
25
|
// ----------------------------------------------------------------------------
|
|
22
26
|
interface Props {
|
|
@@ -25,7 +29,7 @@ interface Props {
|
|
|
25
29
|
const props = withDefaults(defineProps<Props>(), {
|
|
26
30
|
class: '',
|
|
27
31
|
});
|
|
28
|
-
const baseClass = RemovePrefix([
|
|
32
|
+
const baseClass = RemovePrefix(prefix, [
|
|
29
33
|
//
|
|
30
34
|
'container',
|
|
31
35
|
'tw-container',
|
|
@@ -8,8 +8,14 @@ HsUiDialogHsUiDialog
|
|
|
8
8
|
|
|
9
9
|
// [ vue ]
|
|
10
10
|
import { computed, watch, ref, nextTick } from 'vue';
|
|
11
|
+
// [ NUXT ]
|
|
12
|
+
import { useRuntimeConfig } from '#imports';
|
|
13
|
+
// ----------------------------------------------------------------------------
|
|
11
14
|
// [ tailwind ]
|
|
12
|
-
import {
|
|
15
|
+
// import { extendTailwindMerge } from 'tailwind-merge';
|
|
16
|
+
// import { type ClassType, ClassTypeToString } from '../../../lib/class-style';
|
|
17
|
+
import { GetPrefix, RemovePrefix } from '../../../lib/prefix';
|
|
18
|
+
|
|
13
19
|
// ----------------------------------------------------------------------------
|
|
14
20
|
import { DialogDefaultZIndex } from './index.type';
|
|
15
21
|
import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock';
|
|
@@ -17,6 +23,12 @@ import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock';
|
|
|
17
23
|
import { useHsUiDialog } from '../../../composables/use-hs-ui-dialog';
|
|
18
24
|
import { useHsMultiLang } from '../../../composables/use-hs-multi-lang';
|
|
19
25
|
// ----------------------------------------------------------------------------
|
|
26
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
27
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
28
|
+
// const twMerge = extendTailwindMerge({
|
|
29
|
+
// prefix: prefix,
|
|
30
|
+
// });
|
|
31
|
+
// ----------------------------------------------------------------------------
|
|
20
32
|
// [ nac-Stroe ]
|
|
21
33
|
const toast = useHsUiDialog();
|
|
22
34
|
const state = toast.state;
|
|
@@ -132,7 +144,7 @@ watch(isShow, (v) => {
|
|
|
132
144
|
}
|
|
133
145
|
});
|
|
134
146
|
|
|
135
|
-
const cancelBtnStyle = RemovePrefix([
|
|
147
|
+
const cancelBtnStyle = RemovePrefix(prefix, [
|
|
136
148
|
//
|
|
137
149
|
'px-2',
|
|
138
150
|
'tw-px-2',
|
|
@@ -148,14 +160,14 @@ const cancelBtnStyle = RemovePrefix([
|
|
|
148
160
|
'tw-h-full',
|
|
149
161
|
]);
|
|
150
162
|
|
|
151
|
-
const cancelBtnStyleInner = RemovePrefix([
|
|
163
|
+
const cancelBtnStyleInner = RemovePrefix(prefix, [
|
|
152
164
|
//
|
|
153
165
|
'flex',
|
|
154
166
|
'tw-flex',
|
|
155
167
|
'items-center',
|
|
156
168
|
'tw-items-center',
|
|
157
169
|
]);
|
|
158
|
-
const btnBaseStyle = RemovePrefix([
|
|
170
|
+
const btnBaseStyle = RemovePrefix(prefix, [
|
|
159
171
|
//
|
|
160
172
|
'grid',
|
|
161
173
|
'tw-grid',
|
|
@@ -164,14 +176,14 @@ const btnBaseStyle = RemovePrefix([
|
|
|
164
176
|
'gap-2',
|
|
165
177
|
'tw-gap-2',
|
|
166
178
|
]);
|
|
167
|
-
const btnStyle = RemovePrefix([
|
|
179
|
+
const btnStyle = RemovePrefix(prefix, [
|
|
168
180
|
//
|
|
169
181
|
'py-1',
|
|
170
182
|
'tw-py-1',
|
|
171
183
|
'w-full',
|
|
172
184
|
'tw-w-full',
|
|
173
185
|
]);
|
|
174
|
-
const titleStyle = RemovePrefix([
|
|
186
|
+
const titleStyle = RemovePrefix(prefix, [
|
|
175
187
|
//
|
|
176
188
|
'text-[14px]',
|
|
177
189
|
'tw-text-[14px]',
|
|
@@ -182,7 +194,7 @@ const titleStyle = RemovePrefix([
|
|
|
182
194
|
'text-wrap',
|
|
183
195
|
'tw-text-wrap',
|
|
184
196
|
]);
|
|
185
|
-
const messageStyle = RemovePrefix([
|
|
197
|
+
const messageStyle = RemovePrefix(prefix, [
|
|
186
198
|
//
|
|
187
199
|
'text-[14px]',
|
|
188
200
|
'tw-text-[14px]',
|
|
@@ -196,7 +208,7 @@ const messageStyle = RemovePrefix([
|
|
|
196
208
|
'pb-2',
|
|
197
209
|
'tw-pb-2',
|
|
198
210
|
]);
|
|
199
|
-
const cardStyle = RemovePrefix([
|
|
211
|
+
const cardStyle = RemovePrefix(prefix, [
|
|
200
212
|
//
|
|
201
213
|
'min-w-[300px]',
|
|
202
214
|
'tw-min-w-[300px]',
|
|
@@ -211,7 +223,10 @@ const cardStyle = RemovePrefix([
|
|
|
211
223
|
<HsUiModal ref="targetElm" :show="isShow" :z-index="zindex" focus-lock @close="clickCancel()">
|
|
212
224
|
<HsUiCard v-if="activeItem !== null" class="HsUiDialog" :class="cardStyle" @click.stop>
|
|
213
225
|
<HsUiCardItem
|
|
214
|
-
:class="[
|
|
226
|
+
:class="[
|
|
227
|
+
`theme-${activeItem.data.option.theme}`,
|
|
228
|
+
RemovePrefix(prefix, ['py-1', 'tw-py-1', 'pe-1', 'tw-pe-1']),
|
|
229
|
+
]"
|
|
215
230
|
variant="header"
|
|
216
231
|
>
|
|
217
232
|
<div :class="titleStyle">
|
|
@@ -8,18 +8,22 @@ HsUiModalBgHsUiModalBg
|
|
|
8
8
|
|
|
9
9
|
// [ vue ]
|
|
10
10
|
import { computed } from 'vue';
|
|
11
|
+
// [ NUXT ]
|
|
12
|
+
import { useRuntimeConfig } from '#imports';
|
|
11
13
|
// [ tailwind ]
|
|
12
14
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
13
15
|
import { type ClassType, ClassTypeToString } from '../../../lib/class-style';
|
|
14
16
|
import { GetPrefix, RemovePrefix } from '../../../lib/prefix';
|
|
15
|
-
|
|
16
17
|
// [ components > v-ui > modal > * ]
|
|
17
18
|
import { useStoreModal } from './use-ui-modal';
|
|
18
|
-
|
|
19
|
+
// ----------------------------------------------------------------------------
|
|
20
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
21
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
19
22
|
// ----------------------------------------------------------------------------
|
|
20
23
|
const twMerge = extendTailwindMerge({
|
|
21
|
-
prefix:
|
|
24
|
+
prefix: prefix,
|
|
22
25
|
});
|
|
26
|
+
|
|
23
27
|
// ----------------------------------------------------------------------------
|
|
24
28
|
|
|
25
29
|
type Props = {
|
|
@@ -41,7 +45,7 @@ const isShow = computed(() => {
|
|
|
41
45
|
return true;
|
|
42
46
|
});
|
|
43
47
|
|
|
44
|
-
const baseClass = RemovePrefix([
|
|
48
|
+
const baseClass = RemovePrefix(prefix, [
|
|
45
49
|
//
|
|
46
50
|
'transition-opacity',
|
|
47
51
|
'tw-transition-opacity',
|
|
@@ -57,7 +61,7 @@ const baseClass = RemovePrefix([
|
|
|
57
61
|
|
|
58
62
|
const variableStyle = computed(() => {
|
|
59
63
|
if (isShow.value) {
|
|
60
|
-
return RemovePrefix([
|
|
64
|
+
return RemovePrefix(prefix, [
|
|
61
65
|
//
|
|
62
66
|
'pointer-events-auto',
|
|
63
67
|
'tw-pointer-events-auto',
|
|
@@ -65,7 +69,7 @@ const variableStyle = computed(() => {
|
|
|
65
69
|
'tw-opacity-100',
|
|
66
70
|
]);
|
|
67
71
|
}
|
|
68
|
-
return RemovePrefix([
|
|
72
|
+
return RemovePrefix(prefix, [
|
|
69
73
|
//
|
|
70
74
|
'pointer-events-none',
|
|
71
75
|
'tw-pointer-events-none',
|
|
@@ -85,6 +89,6 @@ const closeAll = () => {
|
|
|
85
89
|
<template>
|
|
86
90
|
<Teleport to="body">
|
|
87
91
|
<!-- -->
|
|
88
|
-
<div class="VUiModalBg" :class="classStyle" :style="{ zIndex: zIndex }" @click.stop="closeAll()"/>
|
|
92
|
+
<div class="VUiModalBg" :class="classStyle" :style="{ zIndex: zIndex }" @click.stop="closeAll()" />
|
|
89
93
|
</Teleport>
|
|
90
94
|
</template>
|
|
@@ -8,7 +8,8 @@ HsUiModalHsUiModal
|
|
|
8
8
|
|
|
9
9
|
// [ vue ]
|
|
10
10
|
import { computed, ref, watch, nextTick, onUnmounted } from 'vue';
|
|
11
|
-
|
|
11
|
+
// [ NUXT ]
|
|
12
|
+
import { useId, useRuntimeConfig } from '#imports';
|
|
12
13
|
// [ tailwind ]
|
|
13
14
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
14
15
|
import { type ClassType, ClassTypeToString } from '../../../lib/class-style';
|
|
@@ -18,10 +19,12 @@ import { GetPrefix, RemovePrefix } from '../../../lib/prefix';
|
|
|
18
19
|
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap';
|
|
19
20
|
// [ components > v-ui > modal > * ]
|
|
20
21
|
import { useStoreModal } from './use-ui-modal';
|
|
21
|
-
|
|
22
|
+
// ----------------------------------------------------------------------------
|
|
23
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
24
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
22
25
|
// ----------------------------------------------------------------------------
|
|
23
26
|
const twMerge = extendTailwindMerge({
|
|
24
|
-
prefix:
|
|
27
|
+
prefix: prefix,
|
|
25
28
|
});
|
|
26
29
|
// ----------------------------------------------------------------------------
|
|
27
30
|
|
|
@@ -97,7 +100,7 @@ const mounted = computed(() => {
|
|
|
97
100
|
return false;
|
|
98
101
|
});
|
|
99
102
|
// 背景色は[VUiModalBg]が担当します
|
|
100
|
-
const baseClass = RemovePrefix([
|
|
103
|
+
const baseClass = RemovePrefix(prefix, [
|
|
101
104
|
//
|
|
102
105
|
'p-2',
|
|
103
106
|
'tw-p-2',
|
|
@@ -119,7 +122,7 @@ const classStyle = computed(() => {
|
|
|
119
122
|
return twMerge(baseClass, ClassTypeToString(props.class));
|
|
120
123
|
});
|
|
121
124
|
|
|
122
|
-
const innerClass = RemovePrefix([
|
|
125
|
+
const innerClass = RemovePrefix(prefix, [
|
|
123
126
|
//
|
|
124
127
|
'w-full',
|
|
125
128
|
'tw-w-full',
|
|
@@ -144,13 +147,13 @@ const innerClass = RemovePrefix([
|
|
|
144
147
|
]);
|
|
145
148
|
const variableStyle = computed(() => {
|
|
146
149
|
if (props.show) {
|
|
147
|
-
return RemovePrefix([
|
|
150
|
+
return RemovePrefix(prefix, [
|
|
148
151
|
//
|
|
149
152
|
'pointer-events-auto',
|
|
150
153
|
'tw-pointer-events-auto',
|
|
151
154
|
]);
|
|
152
155
|
}
|
|
153
|
-
return RemovePrefix([
|
|
156
|
+
return RemovePrefix(prefix, [
|
|
154
157
|
//
|
|
155
158
|
'pointer-events-none',
|
|
156
159
|
'tw-pointer-events-none',
|
|
@@ -8,12 +8,13 @@ HsUiToastHsUiToast
|
|
|
8
8
|
|
|
9
9
|
// [ vue ]
|
|
10
10
|
import { computed, watch } from 'vue';
|
|
11
|
-
|
|
11
|
+
// [ NUXT ]
|
|
12
|
+
import { useRuntimeConfig } from '#imports';
|
|
12
13
|
// [ vueuse ]
|
|
13
14
|
import { watchArray } from '@vueuse/core';
|
|
15
|
+
// ----------------------------------------------------------------------------
|
|
14
16
|
// [ tailwind ]
|
|
15
|
-
import { RemovePrefix } from '../../../lib/prefix';
|
|
16
|
-
|
|
17
|
+
import { GetPrefix, RemovePrefix } from '../../../lib/prefix';
|
|
17
18
|
// ----------------------------------------------------------------------------
|
|
18
19
|
// [ components > v-ui > toast > * ]
|
|
19
20
|
import { type Message } from './index.type';
|
|
@@ -24,6 +25,14 @@ import { Int } from '../../../lib/number';
|
|
|
24
25
|
import { useHsUiToast } from '../../../composables/use-hs-ui-toast';
|
|
25
26
|
import { useHsMultiLang } from '../../../composables/use-hs-multi-lang';
|
|
26
27
|
// ----------------------------------------------------------------------------
|
|
28
|
+
// ----------------------------------------------------------------------------
|
|
29
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
30
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
31
|
+
|
|
32
|
+
// const twMerge = extendTailwindMerge({
|
|
33
|
+
// prefix: prefix,
|
|
34
|
+
// });
|
|
35
|
+
|
|
27
36
|
// [ nac-Stroe ]
|
|
28
37
|
const toast = useHsUiToast();
|
|
29
38
|
const state = toast.state;
|
|
@@ -73,7 +82,7 @@ const style = (message: Message) => {
|
|
|
73
82
|
};
|
|
74
83
|
};
|
|
75
84
|
|
|
76
|
-
const closeBtnStyle = RemovePrefix([
|
|
85
|
+
const closeBtnStyle = RemovePrefix(prefix, [
|
|
77
86
|
//
|
|
78
87
|
'bg-transparent',
|
|
79
88
|
'tw-bg-transparent',
|
|
@@ -104,14 +113,19 @@ const closeBtnStyle = RemovePrefix([
|
|
|
104
113
|
<div
|
|
105
114
|
v-show="state.pendingList.length != 0"
|
|
106
115
|
class="HsUiToast-container"
|
|
107
|
-
:class="RemovePrefix(['grid', 'tw-grid', 'gap-1', 'tw-gap-1'])"
|
|
116
|
+
:class="RemovePrefix(prefix, ['grid', 'tw-grid', 'gap-1', 'tw-gap-1'])"
|
|
108
117
|
>
|
|
109
118
|
<template v-for="(message, index) in state.pendingList" :key="index">
|
|
110
119
|
<HsUiAccordion :span="hideSpan" :open="message.isShow">
|
|
111
120
|
<HsUiCard
|
|
112
121
|
class="HsUiToast"
|
|
113
122
|
:class="
|
|
114
|
-
RemovePrefix(
|
|
123
|
+
RemovePrefix(prefix, [
|
|
124
|
+
'drop-shadow-md',
|
|
125
|
+
'tw-drop-shadow-md',
|
|
126
|
+
'pointer-events-all',
|
|
127
|
+
'tw-pointer-events-all',
|
|
128
|
+
])
|
|
115
129
|
"
|
|
116
130
|
@click.stop=""
|
|
117
131
|
@mousedown.stop=""
|
|
@@ -121,18 +135,21 @@ const closeBtnStyle = RemovePrefix([
|
|
|
121
135
|
<HsUiCardItem
|
|
122
136
|
variant="header"
|
|
123
137
|
class="items-center"
|
|
124
|
-
:class="[`theme-${message.theme}`, RemovePrefix(['items-center', 'tw-items-center'])]"
|
|
138
|
+
:class="[`theme-${message.theme}`, RemovePrefix(prefix, ['items-center', 'tw-items-center'])]"
|
|
125
139
|
>
|
|
126
140
|
<div class="HsUiToast-title">
|
|
127
141
|
{{ MultiLangText(message.title) }}
|
|
128
142
|
</div>
|
|
129
143
|
<HsFcBtn :class="closeBtnStyle" theme="white" type="outlined" @click="deleteMessage(message)">
|
|
130
|
-
<i class="fas fa-times"/>
|
|
144
|
+
<i class="fas fa-times" />
|
|
131
145
|
</HsFcBtn>
|
|
132
146
|
</HsUiCardItem>
|
|
133
147
|
<HsUiCardItem
|
|
134
148
|
v-if="MultiLangText(message.message).length > 0"
|
|
135
|
-
:class="[
|
|
149
|
+
:class="[
|
|
150
|
+
`theme-${message.theme}`,
|
|
151
|
+
RemovePrefix(prefix, ['items-overflow-visible', 'tw-overflow-visible']),
|
|
152
|
+
]"
|
|
136
153
|
>
|
|
137
154
|
<div class="HsUiToast-message">
|
|
138
155
|
{{ MultiLangText(message.message) }}
|
|
@@ -143,7 +160,7 @@ const closeBtnStyle = RemovePrefix([
|
|
|
143
160
|
v-if="message.hideAfter != 0"
|
|
144
161
|
:class="[
|
|
145
162
|
`theme-${message.theme}`,
|
|
146
|
-
RemovePrefix([
|
|
163
|
+
RemovePrefix(prefix, [
|
|
147
164
|
'overflow-visible',
|
|
148
165
|
'tw-overflow-visible',
|
|
149
166
|
'p-0',
|
|
@@ -154,27 +171,27 @@ const closeBtnStyle = RemovePrefix([
|
|
|
154
171
|
]"
|
|
155
172
|
>
|
|
156
173
|
<div class="HsUiToast-bar-body" :class="[`${message.theme}`]">
|
|
157
|
-
<div class="HsUiToast-bar" :style="style(message)"/>
|
|
174
|
+
<div class="HsUiToast-bar" :style="style(message)" />
|
|
158
175
|
</div>
|
|
159
176
|
</HsUiCardItem>
|
|
160
177
|
</template>
|
|
161
178
|
<template v-else>
|
|
162
179
|
<HsUiCardItem
|
|
163
180
|
variant="header"
|
|
164
|
-
:class="[`theme-${message.theme}`, RemovePrefix(['items-center', 'tw-items-center'])]"
|
|
181
|
+
:class="[`theme-${message.theme}`, RemovePrefix(prefix, ['items-center', 'tw-items-center'])]"
|
|
165
182
|
>
|
|
166
183
|
<div class="HsUiToast-message">
|
|
167
184
|
{{ MultiLangText(message.message) }}
|
|
168
185
|
</div>
|
|
169
186
|
<HsFcBtn :class="closeBtnStyle" theme="white" variant="outlined" @click="deleteMessage(message)">
|
|
170
|
-
<i class="fas fa-times"/>
|
|
187
|
+
<i class="fas fa-times" />
|
|
171
188
|
</HsFcBtn>
|
|
172
189
|
</HsUiCardItem>
|
|
173
190
|
<HsUiCardItem
|
|
174
191
|
v-if="message.hideAfter != 0"
|
|
175
192
|
:class="[
|
|
176
193
|
`theme-${message.theme}`,
|
|
177
|
-
RemovePrefix([
|
|
194
|
+
RemovePrefix(prefix, [
|
|
178
195
|
'overflow-visible',
|
|
179
196
|
'tw-overflow-visible',
|
|
180
197
|
'p-0',
|
|
@@ -185,7 +202,7 @@ const closeBtnStyle = RemovePrefix([
|
|
|
185
202
|
]"
|
|
186
203
|
>
|
|
187
204
|
<div class="HsUiToast-bar-body" :class="[`${message.theme}`]">
|
|
188
|
-
<div class="HsUiToast-bar" :style="style(message)"/>
|
|
205
|
+
<div class="HsUiToast-bar" :style="style(message)" />
|
|
189
206
|
</div>
|
|
190
207
|
</HsUiCardItem>
|
|
191
208
|
</template>
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
// [ vue ]
|
|
3
|
-
|
|
4
3
|
import { computed, ref } from 'vue';
|
|
4
|
+
// [ NUXT ]
|
|
5
|
+
import { useRuntimeConfig } from '#imports';
|
|
5
6
|
// [ tailwind ]
|
|
6
7
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
7
8
|
import { type ClassType, ClassTypeToString } from '../lib/com';
|
|
8
9
|
import { GetPrefix, RemovePrefix } from '../lib/prefix';
|
|
9
|
-
|
|
10
|
+
// ----------------------------------------------------------------------------
|
|
11
|
+
const runtimeConfig: any = useRuntimeConfig();
|
|
12
|
+
const prefix = GetPrefix(runtimeConfig);
|
|
10
13
|
// ----------------------------------------------------------------------------
|
|
11
14
|
const twMerge = extendTailwindMerge({
|
|
12
|
-
prefix:
|
|
15
|
+
prefix: prefix,
|
|
13
16
|
});
|
|
14
17
|
// ----------------------------------------------------------------------------
|
|
15
18
|
|
|
@@ -22,7 +25,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
22
25
|
class: '',
|
|
23
26
|
});
|
|
24
27
|
|
|
25
|
-
const baseClass = RemovePrefix([
|
|
28
|
+
const baseClass = RemovePrefix(prefix, [
|
|
26
29
|
//
|
|
27
30
|
'bg-blue-400',
|
|
28
31
|
'tw-bg-blue-400',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const GetPrefix: () => "" | "tw-";
|
|
2
|
-
export declare const RemovePrefix: (arg: string[]) => string[];
|
|
1
|
+
export declare const GetPrefix: (runtimeConfig: any) => "" | "tw-";
|
|
2
|
+
export declare const RemovePrefix: (prefix: string, arg: string[]) => string[];
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const config = useRuntimeConfig().public.hsui;
|
|
1
|
+
export const GetPrefix = (runtimeConfig) => {
|
|
2
|
+
const config = runtimeConfig.public.hsui;
|
|
4
3
|
const prefix = config?.prefix || "";
|
|
5
4
|
if (prefix === "tw-")
|
|
6
5
|
return "tw-";
|
|
7
6
|
return "";
|
|
8
7
|
};
|
|
9
8
|
const checkReg = /(?:[ :!]|^|\n)tw-/;
|
|
10
|
-
export const RemovePrefix = (arg) => {
|
|
11
|
-
const prefix = GetPrefix();
|
|
9
|
+
export const RemovePrefix = (prefix, arg) => {
|
|
12
10
|
const ret = arg.reduce((ret2, row) => {
|
|
13
11
|
if (prefix === "" && !checkReg.test(row) || prefix !== "" && checkReg.test(row)) {
|
|
14
12
|
ret2.push(row);
|