nuxt-glorious 1.2.3-9 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/module.d.mts +38 -1
- package/dist/module.d.ts +38 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +37 -33
- package/dist/runtime/assets/style/components/alert.css +20 -5
- package/dist/runtime/assets/style/components/avatar.css +21 -18
- package/dist/runtime/assets/style/components/button.css +198 -0
- package/dist/runtime/assets/style/components/checkbox.css +24 -24
- package/dist/runtime/assets/style/components/drawer.css +14 -18
- package/dist/runtime/assets/style/components/file.css +102 -33
- package/dist/runtime/assets/style/components/input.css +103 -23
- package/dist/runtime/assets/style/components/loading.css +43 -0
- package/dist/runtime/assets/style/components/radio.css +27 -27
- package/dist/runtime/assets/style/components/select.css +24 -19
- package/dist/runtime/assets/style/components/textarea.css +35 -35
- package/dist/runtime/assets/style/mixin.css +0 -0
- package/dist/runtime/components/G/Alert.vue +8 -28
- package/dist/runtime/components/G/Avatar.vue +5 -73
- package/dist/runtime/components/G/Breadcrumb.vue +7 -25
- package/dist/runtime/components/G/Button.vue +10 -152
- package/dist/runtime/components/G/Checkbox.vue +8 -124
- package/dist/runtime/components/G/CountDown.vue +33 -44
- package/dist/runtime/components/G/Drawer.vue +12 -101
- package/dist/runtime/components/G/Dropdown.vue +16 -11
- package/dist/runtime/components/G/ErrorText.vue +6 -11
- package/dist/runtime/components/G/File.vue +25 -117
- package/dist/runtime/components/G/Icon.vue +125 -0
- package/dist/runtime/components/G/Input.vue +28 -229
- package/dist/runtime/components/G/Loading.vue +4 -21
- package/dist/runtime/components/G/Modal.vue +13 -145
- package/dist/runtime/components/G/Paginate.vue +8 -44
- package/dist/runtime/components/G/Radio.vue +12 -163
- package/dist/runtime/components/G/Rating.vue +3 -30
- package/dist/runtime/components/G/Select.vue +7 -110
- package/dist/runtime/components/G/Switch.vue +5 -82
- package/dist/runtime/components/G/Tab.vue +6 -30
- package/dist/runtime/components/G/Table.vue +11 -131
- package/dist/runtime/components/G/textarea.vue +14 -119
- package/dist/runtime/components/G/timeline.vue +3 -59
- package/dist/runtime/components/helper.d.ts +2 -0
- package/dist/runtime/components/helper.mjs +25 -0
- package/dist/runtime/components/props/Alert.d.ts +8 -0
- package/dist/runtime/components/props/Alert.mjs +4 -0
- package/dist/runtime/components/props/Avatar.d.ts +12 -0
- package/dist/runtime/components/props/Avatar.mjs +9 -0
- package/dist/runtime/components/props/Breadcrumb.d.ts +26 -0
- package/dist/runtime/components/props/Breadcrumb.mjs +11 -0
- package/dist/runtime/components/props/Button.d.ts +47 -0
- package/dist/runtime/components/props/Button.mjs +14 -0
- package/dist/runtime/components/props/CheckBox.d.ts +23 -0
- package/dist/runtime/components/props/CheckBox.mjs +7 -0
- package/dist/runtime/components/props/CountDown.d.ts +7 -0
- package/dist/runtime/components/props/CountDown.mjs +6 -0
- package/dist/runtime/components/props/Drawer.d.ts +8 -0
- package/dist/runtime/components/props/Drawer.mjs +7 -0
- package/dist/runtime/components/props/ErrorText.d.ts +8 -0
- package/dist/runtime/components/props/ErrorText.mjs +4 -0
- package/dist/runtime/components/props/File.d.ts +28 -0
- package/dist/runtime/components/props/File.mjs +9 -0
- package/dist/runtime/components/props/Icon.d.ts +23 -0
- package/dist/runtime/components/props/Icon.mjs +7 -0
- package/dist/runtime/components/props/Input.d.ts +91 -0
- package/dist/runtime/components/props/Input.mjs +50 -0
- package/dist/runtime/components/props/Loading.d.ts +18 -0
- package/dist/runtime/components/props/Loading.mjs +6 -0
- package/dist/runtime/components/props/Modal.d.ts +48 -0
- package/dist/runtime/components/props/Modal.mjs +38 -0
- package/dist/runtime/components/props/Paginate.d.ts +18 -0
- package/dist/runtime/components/props/Paginate.mjs +17 -0
- package/dist/runtime/components/props/Radio.d.ts +33 -0
- package/dist/runtime/components/props/Radio.mjs +9 -0
- package/dist/runtime/components/props/Select.d.ts +61 -0
- package/dist/runtime/components/props/Select.mjs +23 -0
- package/dist/runtime/components/props/Switch.d.ts +13 -0
- package/dist/runtime/components/props/Switch.mjs +5 -0
- package/dist/runtime/components/props/Tab.d.ts +21 -0
- package/dist/runtime/components/props/Tab.mjs +7 -0
- package/dist/runtime/components/props/Table.d.ts +49 -0
- package/dist/runtime/components/props/Table.mjs +19 -0
- package/dist/runtime/components/props/Textarea.d.ts +38 -0
- package/dist/runtime/components/props/Textarea.mjs +14 -0
- package/dist/runtime/components/props/Timeline.d.ts +11 -0
- package/dist/runtime/components/props/Timeline.mjs +7 -0
- package/dist/runtime/components/props/common/index.d.ts +161 -0
- package/dist/runtime/components/props/common/index.mjs +147 -0
- package/dist/runtime/composables/useGloriousCore.d.ts +1 -1
- package/dist/runtime/composables/useGloriousCore.mjs +1 -1
- package/dist/runtime/composables/useGloriousFetch.mjs +0 -1
- package/dist/runtime/middlewares/AuthStrategy.mjs +1 -5
- package/dist/runtime/stores/GloriousStore.d.ts +0 -2
- package/dist/runtime/stores/GloriousStore.mjs +0 -20
- package/dist/types.d.mts +2 -10
- package/dist/types.d.ts +2 -10
- package/package.json +1 -1
- package/dist/runtime/assets/style/components/buttons.css +0 -107
- package/dist/runtime/components/G/BottomNavigation.vue +0 -3
- package/dist/runtime/components/G/Icon/index.vue +0 -143
@@ -1,36 +1,16 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
default: "blue",
|
6
|
-
type: String as () => "orange" | "blue" | "gray" | "red" | "green",
|
7
|
-
},
|
8
|
-
});
|
2
|
+
import _props from './../props/Alert'
|
3
|
+
|
4
|
+
const props = defineProps(_props)
|
9
5
|
</script>
|
10
6
|
|
11
7
|
<template>
|
12
|
-
<div
|
8
|
+
<div
|
9
|
+
class="glorious-alert"
|
10
|
+
:class="[`color-${props.color}`]"
|
11
|
+
>
|
13
12
|
<slot />
|
14
13
|
</div>
|
15
14
|
</template>
|
16
15
|
|
17
|
-
<style
|
18
|
-
.glorious-alert {
|
19
|
-
@apply p-3 rounded shadow;
|
20
|
-
}
|
21
|
-
.glorious-alert.color-orange {
|
22
|
-
@apply border border-orange-300 bg-orange-100;
|
23
|
-
}
|
24
|
-
.glorious-alert.color-blue {
|
25
|
-
@apply border border-blue-300 bg-blue-100;
|
26
|
-
}
|
27
|
-
.glorious-alert.color-gray {
|
28
|
-
@apply border border-gray-300 bg-gray-100;
|
29
|
-
}
|
30
|
-
.glorious-alert.color-red {
|
31
|
-
@apply border border-red-300 bg-red-100;
|
32
|
-
}
|
33
|
-
.glorious-alert.color-green {
|
34
|
-
@apply border border-green-300 bg-green-100;
|
35
|
-
}
|
36
|
-
</style>
|
16
|
+
<style lang="scss" src="../../assets/style/components/alert.scss" />
|
@@ -1,84 +1,16 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
type: String,
|
6
|
-
},
|
7
|
-
size: {
|
8
|
-
required: false,
|
9
|
-
default: "md",
|
10
|
-
type: String as () => "xl" | "lg" | "md" | "sm" | "xs",
|
11
|
-
},
|
12
|
-
rounded: {
|
13
|
-
required: false,
|
14
|
-
default: "md",
|
15
|
-
type: String as () => "xl" | "lg" | "md" | "sm" | "xs" | "full",
|
16
|
-
},
|
17
|
-
});
|
2
|
+
import _props from '../props/Avatar'
|
3
|
+
|
4
|
+
const props: any = defineProps(_props)
|
18
5
|
</script>
|
19
6
|
|
20
7
|
<template>
|
21
8
|
<div
|
22
|
-
class="glorious-avatar
|
9
|
+
class="glorious-avatar"
|
23
10
|
:class="[`size-${props.size}`, `rounded-${props.rounded}`]"
|
24
11
|
>
|
25
12
|
<img :src="props.src" />
|
26
13
|
</div>
|
27
14
|
</template>
|
28
15
|
|
29
|
-
<style
|
30
|
-
.glorious-avatar.size-5xl {
|
31
|
-
@apply w-[64px] h-[64px];
|
32
|
-
}
|
33
|
-
.glorious-avatar.size-5xl > img {
|
34
|
-
@apply w-[64px] h-[64px];
|
35
|
-
}
|
36
|
-
.glorious-avatar.size-4xl {
|
37
|
-
@apply w-[60px] h-[60px];
|
38
|
-
}
|
39
|
-
.glorious-avatar.size-4xl > img {
|
40
|
-
@apply w-[60px] h-[60px];
|
41
|
-
}
|
42
|
-
.glorious-avatar.size-3xl {
|
43
|
-
@apply w-[56px] h-[56px];
|
44
|
-
}
|
45
|
-
.glorious-avatar.size-3xl > img {
|
46
|
-
@apply w-[56px] h-[56px];
|
47
|
-
}
|
48
|
-
.glorious-avatar.size-2xl {
|
49
|
-
@apply w-[52px] h-[52px];
|
50
|
-
}
|
51
|
-
.glorious-avatar.size-2xl > img {
|
52
|
-
@apply w-[52px] h-[52px];
|
53
|
-
}
|
54
|
-
.glorious-avatar.size-xl {
|
55
|
-
@apply w-[48px] h-[48px];
|
56
|
-
}
|
57
|
-
.glorious-avatar.size-xl > img {
|
58
|
-
@apply w-[48px] h-[48px];
|
59
|
-
}
|
60
|
-
.glorious-avatar.size-lg {
|
61
|
-
@apply w-[44px] h-[44px];
|
62
|
-
}
|
63
|
-
.glorious-avatar.size-lg > img {
|
64
|
-
@apply w-[44px] h-[44px];
|
65
|
-
}
|
66
|
-
.glorious-avatar.size-md {
|
67
|
-
@apply w-[40px] h-[40px];
|
68
|
-
}
|
69
|
-
.glorious-avatar.size-md > img {
|
70
|
-
@apply w-[40px] h-[40px];
|
71
|
-
}
|
72
|
-
.glorious-avatar.size-sm {
|
73
|
-
@apply w-[36px] h-[36px];
|
74
|
-
}
|
75
|
-
.glorious-avatar.size-sm > img {
|
76
|
-
@apply w-[36px] h-[36px];
|
77
|
-
}
|
78
|
-
.glorious-avatar.size-xs {
|
79
|
-
@apply w-[32px] h-[32px];
|
80
|
-
}
|
81
|
-
.glorious-avatar.size-xs > img {
|
82
|
-
@apply w-[32px] h-[32px];
|
83
|
-
}
|
84
|
-
</style>
|
16
|
+
<style lang="scss" src="../../assets/style/components/avatar.scss" />
|
@@ -1,21 +1,7 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
|
3
|
-
text: String;
|
4
|
-
icon?: String;
|
5
|
-
to?: String;
|
6
|
-
}
|
2
|
+
import _props from '../props/Breadcrumb'
|
7
3
|
|
8
|
-
const props = defineProps(
|
9
|
-
items: {
|
10
|
-
required: true,
|
11
|
-
type: Array<breadcrumbInterface>,
|
12
|
-
},
|
13
|
-
divider: {
|
14
|
-
required: false,
|
15
|
-
type: String,
|
16
|
-
default: "/",
|
17
|
-
},
|
18
|
-
});
|
4
|
+
const props: any = defineProps(_props)
|
19
5
|
</script>
|
20
6
|
|
21
7
|
<template>
|
@@ -25,7 +11,10 @@ const props = defineProps({
|
|
25
11
|
:key="index"
|
26
12
|
class="flex items-center gap-1 flex-wrap"
|
27
13
|
>
|
28
|
-
<GIcon
|
14
|
+
<GIcon
|
15
|
+
v-if="item.icon"
|
16
|
+
:name="`${item.icon}`"
|
17
|
+
/>
|
29
18
|
<nuxt-link
|
30
19
|
v-if="item.to"
|
31
20
|
class="glorious-breadcrumb-link"
|
@@ -45,11 +34,4 @@ const props = defineProps({
|
|
45
34
|
</div>
|
46
35
|
</template>
|
47
36
|
|
48
|
-
<style
|
49
|
-
.glorious-breadcrumb {
|
50
|
-
@apply text-xs;
|
51
|
-
}
|
52
|
-
.glorious-breadcrumb .end-text {
|
53
|
-
@apply font-bold;
|
54
|
-
}
|
55
|
-
</style>
|
37
|
+
<style lang="scss" src="../../assets/style/components/breadcrumb.scss" />
|
@@ -1,41 +1,7 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
default: "primary",
|
6
|
-
type: String as () => "orange" | "blue" | "gray" | "red" | "primary",
|
7
|
-
},
|
8
|
-
size: {
|
9
|
-
required: false,
|
10
|
-
default: "md",
|
11
|
-
type: String as () => "xl" | "lg" | "md" | "sm" | "xsm",
|
12
|
-
},
|
13
|
-
outline: {
|
14
|
-
required: false,
|
15
|
-
default: false,
|
16
|
-
type: Boolean,
|
17
|
-
},
|
18
|
-
disabled: {
|
19
|
-
required: false,
|
20
|
-
default: false,
|
21
|
-
type: Boolean,
|
22
|
-
},
|
23
|
-
loading: {
|
24
|
-
requried: false,
|
25
|
-
default: false,
|
26
|
-
type: Boolean,
|
27
|
-
},
|
28
|
-
to: {
|
29
|
-
requried: false,
|
30
|
-
default: "",
|
31
|
-
type: String,
|
32
|
-
},
|
33
|
-
ariaLabel: {
|
34
|
-
requried: false,
|
35
|
-
default: "",
|
36
|
-
type: String,
|
37
|
-
},
|
38
|
-
});
|
2
|
+
import _props from '../props/Button'
|
3
|
+
|
4
|
+
const props: any = defineProps(_props)
|
39
5
|
</script>
|
40
6
|
|
41
7
|
<template>
|
@@ -44,12 +10,15 @@ const props = defineProps({
|
|
44
10
|
:aria-label="props.ariaLabel"
|
45
11
|
:class="[
|
46
12
|
`glorious-button-${props.color}`,
|
47
|
-
props.size
|
13
|
+
`size-${props.size}`,
|
48
14
|
props.outline ? 'outline' : '',
|
49
15
|
]"
|
50
16
|
:disabled="props.disabled"
|
51
17
|
>
|
52
|
-
<div
|
18
|
+
<div
|
19
|
+
v-if="props.loading"
|
20
|
+
class="loading"
|
21
|
+
>
|
53
22
|
<GLoading />
|
54
23
|
</div>
|
55
24
|
<slot v-else />
|
@@ -64,119 +33,8 @@ const props = defineProps({
|
|
64
33
|
]"
|
65
34
|
:disabled="props.disabled"
|
66
35
|
>
|
67
|
-
<
|
68
|
-
<GLoading />
|
69
|
-
</div>
|
70
|
-
<slot v-else />
|
36
|
+
<slot />
|
71
37
|
</NuxtLink>
|
72
38
|
</template>
|
73
39
|
|
74
|
-
<style
|
75
|
-
button:focus-visible {
|
76
|
-
@apply outline-none;
|
77
|
-
}
|
78
|
-
|
79
|
-
.xl.glorious-button-orange, .xl.glorious-button-blue, .xl.glorious-button-gray, .xl.glorious-button-red, .xl.glorious-button-primary {
|
80
|
-
@apply py-2.5;
|
81
|
-
}
|
82
|
-
.xl.glorious-button-orange > div.loading > div > div, .xl.glorious-button-blue > div.loading > div > div, .xl.glorious-button-gray > div.loading > div > div, .xl.glorious-button-red > div.loading > div > div, .xl.glorious-button-primary > div.loading > div > div {
|
83
|
-
@apply w-[24px] !important;
|
84
|
-
}
|
85
|
-
.lg.glorious-button-orange, .lg.glorious-button-blue, .lg.glorious-button-gray, .lg.glorious-button-red, .lg.glorious-button-primary {
|
86
|
-
@apply py-2;
|
87
|
-
}
|
88
|
-
.lg.glorious-button-orange > div.loading > div > div, .lg.glorious-button-blue > div.loading > div > div, .lg.glorious-button-gray > div.loading > div > div, .lg.glorious-button-red > div.loading > div > div, .lg.glorious-button-primary > div.loading > div > div {
|
89
|
-
@apply w-[24px] !important;
|
90
|
-
}
|
91
|
-
.md.glorious-button-orange, .md.glorious-button-blue, .md.glorious-button-gray, .md.glorious-button-red, .md.glorious-button-primary {
|
92
|
-
@apply py-1.5;
|
93
|
-
}
|
94
|
-
.md.glorious-button-orange > div.loading > div > div, .md.glorious-button-blue > div.loading > div > div, .md.glorious-button-gray > div.loading > div > div, .md.glorious-button-red > div.loading > div > div, .md.glorious-button-primary > div.loading > div > div {
|
95
|
-
@apply w-[24px] !important;
|
96
|
-
}
|
97
|
-
.sm.glorious-button-orange, .sm.glorious-button-blue, .sm.glorious-button-gray, .sm.glorious-button-red, .sm.glorious-button-primary {
|
98
|
-
@apply py-1;
|
99
|
-
}
|
100
|
-
.sm.glorious-button-orange > div.loading > div > div, .sm.glorious-button-blue > div.loading > div > div, .sm.glorious-button-gray > div.loading > div > div, .sm.glorious-button-red > div.loading > div > div, .sm.glorious-button-primary > div.loading > div > div {
|
101
|
-
@apply w-[24px] !important;
|
102
|
-
}
|
103
|
-
.xsm.glorious-button-orange, .xsm.glorious-button-blue, .xsm.glorious-button-gray, .xsm.glorious-button-red, .xsm.glorious-button-primary {
|
104
|
-
@apply py-0.5;
|
105
|
-
}
|
106
|
-
.xsm.glorious-button-orange > div.loading > div > div, .xsm.glorious-button-blue > div.loading > div > div, .xsm.glorious-button-gray > div.loading > div > div, .xsm.glorious-button-red > div.loading > div > div, .xsm.glorious-button-primary > div.loading > div > div {
|
107
|
-
@apply w-[24px] !important;
|
108
|
-
}
|
109
|
-
|
110
|
-
.outline.glorious-button-orange, .outline.glorious-button-blue, .outline.glorious-button-gray, .outline.glorious-button-red, .outline.glorious-button-primary {
|
111
|
-
@apply bg-transparent border outline-none;
|
112
|
-
}
|
113
|
-
|
114
|
-
.glorious-button-orange > div.loading, .glorious-button-blue > div.loading, .glorious-button-gray > div.loading, .glorious-button-red > div.loading, .glorious-button-primary > div.loading {
|
115
|
-
@apply flex justify-center items-center;
|
116
|
-
}
|
117
|
-
|
118
|
-
.glorious-button-primary {
|
119
|
-
@apply bg-green-700 hover:bg-green-600 rounded-md text-white border-green-500 px-3;
|
120
|
-
}
|
121
|
-
.glorious-button-primary.outline {
|
122
|
-
@apply text-gray-500 hover:bg-green-100;
|
123
|
-
}
|
124
|
-
.glorious-button-primary:disabled {
|
125
|
-
@apply cursor-not-allowed;
|
126
|
-
}
|
127
|
-
.glorious-button-primary:disabled:not(:disabled) {
|
128
|
-
@apply bg-green-300;
|
129
|
-
}
|
130
|
-
|
131
|
-
.glorious-button-red {
|
132
|
-
@apply bg-red-500 hover:bg-red-600 rounded-md text-white border-red-500 px-3;
|
133
|
-
}
|
134
|
-
.glorious-button-red.outline {
|
135
|
-
@apply text-gray-500 hover:bg-red-100;
|
136
|
-
}
|
137
|
-
.glorious-button-red:disabled {
|
138
|
-
@apply cursor-not-allowed;
|
139
|
-
}
|
140
|
-
.glorious-button-red:disabled:not(:disabled) {
|
141
|
-
@apply bg-red-300;
|
142
|
-
}
|
143
|
-
|
144
|
-
.glorious-button-gray {
|
145
|
-
@apply bg-gray-500 hover:bg-gray-600 rounded-md text-white border-gray-500 px-3;
|
146
|
-
}
|
147
|
-
.glorious-button-gray.outline {
|
148
|
-
@apply text-gray-500 hover:bg-gray-100;
|
149
|
-
}
|
150
|
-
.glorious-button-gray:disabled {
|
151
|
-
@apply cursor-not-allowed;
|
152
|
-
}
|
153
|
-
.glorious-button-gray:disabled:not(:disabled) {
|
154
|
-
@apply bg-gray-300;
|
155
|
-
}
|
156
|
-
|
157
|
-
.glorious-button-blue {
|
158
|
-
@apply bg-blue-500 hover:bg-blue-600 rounded-md text-white border-blue-500 px-3;
|
159
|
-
}
|
160
|
-
.glorious-button-blue.outline {
|
161
|
-
@apply text-gray-500 hover:bg-blue-100;
|
162
|
-
}
|
163
|
-
.glorious-button-blue:disabled {
|
164
|
-
@apply cursor-not-allowed;
|
165
|
-
}
|
166
|
-
.glorious-button-blue:disabled:not(:disabled) {
|
167
|
-
@apply bg-blue-300;
|
168
|
-
}
|
169
|
-
|
170
|
-
.glorious-button-orange {
|
171
|
-
@apply bg-orange-500 hover:bg-orange-600 rounded-md text-white border-orange-500 px-3;
|
172
|
-
}
|
173
|
-
.glorious-button-orange.outline {
|
174
|
-
@apply text-gray-500 hover:bg-orange-100;
|
175
|
-
}
|
176
|
-
.glorious-button-orange:disabled {
|
177
|
-
@apply cursor-not-allowed;
|
178
|
-
}
|
179
|
-
.glorious-button-orange:disabled:not(:disabled) {
|
180
|
-
@apply bg-orange-300;
|
181
|
-
}
|
182
|
-
</style>
|
40
|
+
<style lang="scss" src="../../assets/style/components/button.scss" />
|
@@ -1,42 +1,21 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
|
3
|
-
modelValue: {
|
4
|
-
required: false,
|
5
|
-
default: true,
|
6
|
-
type: Boolean,
|
7
|
-
},
|
8
|
-
color: {
|
9
|
-
required: false,
|
10
|
-
default: 'green',
|
11
|
-
type: String as () => 'orange' | 'blue' | 'gray' | 'red' | 'green',
|
12
|
-
},
|
13
|
-
size: {
|
14
|
-
required: false,
|
15
|
-
default: 'md',
|
16
|
-
type: String as () => 'xl' | 'lg' | 'md' | 'sm' | 'xs',
|
17
|
-
},
|
18
|
-
disabled: {
|
19
|
-
required: false,
|
20
|
-
default: false,
|
21
|
-
type: Boolean,
|
22
|
-
},
|
23
|
-
})
|
2
|
+
import _props from '../props/CheckBox'
|
24
3
|
|
25
|
-
const
|
4
|
+
const props: any = defineProps(_props)
|
5
|
+
const model = defineModel()
|
6
|
+
const inputFunction = (event: any) => (model.value = event.target.checked)
|
26
7
|
|
27
|
-
|
28
|
-
emits('update:modelValue', event.currentTarget.checked)
|
29
|
-
|
30
|
-
emits('update:modelValue', false)
|
8
|
+
model.value = props.checked
|
31
9
|
</script>
|
32
10
|
|
33
11
|
<template>
|
34
12
|
<label
|
35
13
|
class="glorious-checkbox"
|
36
|
-
:class="[props.color
|
14
|
+
:class="[`color-${props.color}`, `size-${props.size}`]"
|
37
15
|
>
|
38
16
|
<input
|
39
17
|
type="checkbox"
|
18
|
+
:checked="props.checked"
|
40
19
|
:disabled="props.disabled"
|
41
20
|
@input="inputFunction($event)"
|
42
21
|
/>
|
@@ -44,99 +23,4 @@ emits('update:modelValue', false)
|
|
44
23
|
</label>
|
45
24
|
</template>
|
46
25
|
|
47
|
-
<style
|
48
|
-
.glorious-checkbox {
|
49
|
-
@apply block relative cursor-pointer;
|
50
|
-
}
|
51
|
-
.glorious-checkbox > input {
|
52
|
-
@apply hidden;
|
53
|
-
}
|
54
|
-
.glorious-checkbox > input:checked ~ div {
|
55
|
-
@apply border-none;
|
56
|
-
}
|
57
|
-
.glorious-checkbox > input:checked ~ div:after {
|
58
|
-
@apply block h-max w-max;
|
59
|
-
}
|
60
|
-
.glorious-checkbox > input:disabled ~ div {
|
61
|
-
@apply cursor-not-allowed;
|
62
|
-
}
|
63
|
-
.glorious-checkbox > div:last-child {
|
64
|
-
@apply border border-gray-500 rounded bg-white left-0 top-0 absolute hover:shadow-lg;
|
65
|
-
}
|
66
|
-
.glorious-checkbox > div:last-child > div:first-child {
|
67
|
-
@apply hidden;
|
68
|
-
}
|
69
|
-
.glorious-checkbox > div:last-child:after {
|
70
|
-
content: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzFfNDg2MTQpIj4KPHBhdGggZD0iTTkuOTk5OTkgMTUuMTcyTDE5LjE5MiA1Ljk3OUwyMC42MDcgNy4zOTNMOS45OTk5OSAxOEwzLjYzNTk5IDExLjYzNkw1LjA0OTk5IDEwLjIyMkw5Ljk5OTk5IDE1LjE3MloiIGZpbGw9IndoaXRlIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDBfMV80ODYxNCI+CjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K);
|
71
|
-
@apply absolute hidden top-1 right-0 left-0 bottom-0 m-auto;
|
72
|
-
}
|
73
|
-
.glorious-checkbox.orange > input:checked ~ div {
|
74
|
-
@apply bg-orange-500;
|
75
|
-
}
|
76
|
-
.glorious-checkbox.blue > input:checked ~ div {
|
77
|
-
@apply bg-blue-500;
|
78
|
-
}
|
79
|
-
.glorious-checkbox.gray > input:checked ~ div {
|
80
|
-
@apply bg-gray-500;
|
81
|
-
}
|
82
|
-
.glorious-checkbox.red > input:checked ~ div {
|
83
|
-
@apply bg-red-500;
|
84
|
-
}
|
85
|
-
.glorious-checkbox.green > input:checked ~ div {
|
86
|
-
@apply bg-green-500;
|
87
|
-
}
|
88
|
-
.glorious-checkbox.size-5xl {
|
89
|
-
@apply w-[60px] h-[60px];
|
90
|
-
}
|
91
|
-
.glorious-checkbox.size-5xl > div:last-child {
|
92
|
-
@apply w-[60px] h-[60px];
|
93
|
-
}
|
94
|
-
.glorious-checkbox.size-4xl {
|
95
|
-
@apply w-[56px] h-[56px];
|
96
|
-
}
|
97
|
-
.glorious-checkbox.size-4xl > div:last-child {
|
98
|
-
@apply w-[56px] h-[56px];
|
99
|
-
}
|
100
|
-
.glorious-checkbox.size-3xl {
|
101
|
-
@apply w-[52px] h-[52px];
|
102
|
-
}
|
103
|
-
.glorious-checkbox.size-3xl > div:last-child {
|
104
|
-
@apply w-[52px] h-[52px];
|
105
|
-
}
|
106
|
-
.glorious-checkbox.size-2xl {
|
107
|
-
@apply w-[48px] h-[48px];
|
108
|
-
}
|
109
|
-
.glorious-checkbox.size-2xl > div:last-child {
|
110
|
-
@apply w-[48px] h-[48px];
|
111
|
-
}
|
112
|
-
.glorious-checkbox.size-xl {
|
113
|
-
@apply w-[44px] h-[44px];
|
114
|
-
}
|
115
|
-
.glorious-checkbox.size-xl > div:last-child {
|
116
|
-
@apply w-[44px] h-[44px];
|
117
|
-
}
|
118
|
-
.glorious-checkbox.size-lg {
|
119
|
-
@apply w-[40px] h-[40px];
|
120
|
-
}
|
121
|
-
.glorious-checkbox.size-lg > div:last-child {
|
122
|
-
@apply w-[40px] h-[40px];
|
123
|
-
}
|
124
|
-
.glorious-checkbox.size-md {
|
125
|
-
@apply w-[36px] h-[36px];
|
126
|
-
}
|
127
|
-
.glorious-checkbox.size-md > div:last-child {
|
128
|
-
@apply w-[36px] h-[36px];
|
129
|
-
}
|
130
|
-
.glorious-checkbox.size-sm {
|
131
|
-
@apply w-[32px] h-[32px];
|
132
|
-
}
|
133
|
-
.glorious-checkbox.size-sm > div:last-child {
|
134
|
-
@apply w-[32px] h-[32px];
|
135
|
-
}
|
136
|
-
.glorious-checkbox.size-xs {
|
137
|
-
@apply w-[28px] h-[28px];
|
138
|
-
}
|
139
|
-
.glorious-checkbox.size-xs > div:last-child {
|
140
|
-
@apply w-[28px] h-[28px];
|
141
|
-
}
|
142
|
-
</style>
|
26
|
+
<style lang="scss" src="../../assets/style/components/checkbox.scss" />
|
@@ -1,70 +1,59 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
import { onMounted, ref, useId, useSlots } from
|
2
|
+
import { onMounted, ref, useId, useSlots } from '#imports'
|
3
|
+
import _props from '../props/CountDown'
|
4
|
+
|
5
|
+
const isEnd = ref<Boolean>(false)
|
6
|
+
const props = defineProps(_props)
|
7
|
+
const slot = useSlots()
|
8
|
+
const id = useId()
|
3
9
|
|
4
|
-
const isEnd = ref<Boolean>(false);
|
5
|
-
const props = defineProps({
|
6
|
-
second: {
|
7
|
-
required: true,
|
8
|
-
type: Number,
|
9
|
-
},
|
10
|
-
className: {
|
11
|
-
required: true,
|
12
|
-
type: String,
|
13
|
-
default: "flex text-gray-500 font-medium",
|
14
|
-
},
|
15
|
-
});
|
16
|
-
const slot = useSlots();
|
17
|
-
const id = useId();
|
18
10
|
onMounted(() => {
|
19
|
-
|
20
|
-
let second = props.second;
|
11
|
+
let second = <number>props.second
|
21
12
|
const countInterval = setInterval(() => {
|
22
13
|
try {
|
23
|
-
second
|
24
|
-
let timeString =
|
14
|
+
second--
|
15
|
+
let timeString = ''
|
25
16
|
|
26
|
-
if (
|
17
|
+
if (<number>props.second <= 60)
|
27
18
|
timeString =
|
28
|
-
|
19
|
+
'00:' + (second.toString().length === 1 ? '0' + second : second)
|
29
20
|
else {
|
30
|
-
let minute: number | string = Math.floor(second / 60)
|
21
|
+
let minute: number | string = Math.floor(second / 60)
|
31
22
|
if (minute >= 1) {
|
32
|
-
const computeSecond = second - minute * 60
|
23
|
+
const computeSecond = second - minute * 60
|
33
24
|
const computeSecond2 =
|
34
25
|
computeSecond.toString().length === 1
|
35
|
-
?
|
36
|
-
: computeSecond
|
37
|
-
minute = minute.toString().length === 1 ?
|
38
|
-
timeString = minute +
|
26
|
+
? '0' + computeSecond
|
27
|
+
: computeSecond
|
28
|
+
minute = minute.toString().length === 1 ? '0' + minute : minute
|
29
|
+
timeString = minute + ':' + computeSecond2
|
39
30
|
} else {
|
40
31
|
timeString =
|
41
|
-
|
32
|
+
'00:' + (second.toString().length === 1 ? '0' + second : second)
|
42
33
|
}
|
43
34
|
}
|
44
35
|
|
45
|
-
const countDownElement: any = document.getElementById(
|
46
|
-
countDownElement.innerText = timeString
|
36
|
+
const countDownElement: any = document.getElementById('countDown' + id)
|
37
|
+
countDownElement.innerText = timeString
|
47
38
|
|
48
39
|
if (second === 0) {
|
49
|
-
isEnd.value = true
|
50
|
-
clearInterval(countInterval)
|
40
|
+
isEnd.value = true
|
41
|
+
clearInterval(countInterval)
|
51
42
|
}
|
52
43
|
} catch (e) {
|
53
|
-
clearInterval(countInterval)
|
44
|
+
clearInterval(countInterval)
|
54
45
|
}
|
55
|
-
}, 1000)
|
56
|
-
})
|
46
|
+
}, 1000)
|
47
|
+
})
|
57
48
|
</script>
|
58
49
|
<template>
|
59
|
-
<div>
|
60
|
-
<span
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
<slot v-if="isEnd" name="end" />
|
67
|
-
<div v-else :class="props.className">
|
50
|
+
<div class="glorious-count-down">
|
51
|
+
<span v-if="isEnd && typeof slot.end === 'undefined'"> 00:00 </span>
|
52
|
+
<slot
|
53
|
+
v-if="isEnd"
|
54
|
+
name="end"
|
55
|
+
/>
|
56
|
+
<div v-else>
|
68
57
|
<slot name="one"></slot>
|
69
58
|
<div :id="`countDown` + id" />
|
70
59
|
<slot name="two"></slot>
|