nuxt-glorious 1.2.3-8 → 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 +12 -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,115 +1,13 @@
|
|
1
1
|
<script setup lang="ts">
|
2
2
|
import { computed, ref, watch } from '#imports'
|
3
3
|
import { useGloriousCore } from '../../composables/useGloriousCore'
|
4
|
-
|
5
|
-
modelValue: {
|
6
|
-
required: false,
|
7
|
-
default: '',
|
8
|
-
type: [String, Array<String>, Number],
|
9
|
-
},
|
10
|
-
color: {
|
11
|
-
required: false,
|
12
|
-
default: 'primary',
|
13
|
-
type: String as () => 'orange' | 'blue' | 'gray' | 'red' | 'primary',
|
14
|
-
},
|
15
|
-
placeholder: {
|
16
|
-
required: false,
|
17
|
-
default: '',
|
18
|
-
type: String,
|
19
|
-
},
|
20
|
-
title: {
|
21
|
-
required: false,
|
22
|
-
default: '',
|
23
|
-
type: String,
|
24
|
-
},
|
25
|
-
size: {
|
26
|
-
required: false,
|
27
|
-
default: 'md',
|
28
|
-
type: String as () => 'xl' | 'lg' | 'md' | 'sm' | 'xsm',
|
29
|
-
},
|
30
|
-
error: {
|
31
|
-
required: false,
|
32
|
-
default: '|',
|
33
|
-
type: String,
|
34
|
-
},
|
35
|
-
icon: {
|
36
|
-
required: false,
|
37
|
-
default: '',
|
38
|
-
type: String,
|
39
|
-
},
|
40
|
-
disabled: {
|
41
|
-
required: false,
|
42
|
-
default: false,
|
43
|
-
type: Boolean,
|
44
|
-
},
|
45
|
-
type: {
|
46
|
-
required: false,
|
47
|
-
default: 'text',
|
48
|
-
type: String as () =>
|
49
|
-
| 'button'
|
50
|
-
| 'checkbox'
|
51
|
-
| 'color'
|
52
|
-
| 'date'
|
53
|
-
| 'email'
|
54
|
-
| 'file'
|
55
|
-
| 'hidden'
|
56
|
-
| 'password'
|
57
|
-
| 'radio'
|
58
|
-
| 'range'
|
59
|
-
| 'tel'
|
60
|
-
| 'text'
|
61
|
-
| 'url'
|
62
|
-
| 'number',
|
63
|
-
},
|
64
|
-
autocomplete: {
|
65
|
-
required: false,
|
66
|
-
default: 'off',
|
67
|
-
type: String as () => 'off' | 'on' | 'new-password',
|
68
|
-
},
|
69
|
-
display: {
|
70
|
-
required: false,
|
71
|
-
default: '',
|
72
|
-
type: String as () => 'price',
|
73
|
-
},
|
74
|
-
inputMode: {
|
75
|
-
required: false,
|
76
|
-
default: 'text',
|
77
|
-
type: String as () =>
|
78
|
-
| 'text'
|
79
|
-
| 'none'
|
80
|
-
| 'decimal'
|
81
|
-
| 'numeric'
|
82
|
-
| 'tel'
|
83
|
-
| 'search'
|
84
|
-
| 'email'
|
85
|
-
| 'url',
|
86
|
-
},
|
87
|
-
mode: {
|
88
|
-
required: false,
|
89
|
-
default: 'normal',
|
90
|
-
type: String as () => 'normal' | 'tag',
|
91
|
-
},
|
92
|
-
tagLockOption: {
|
93
|
-
required: false,
|
94
|
-
default: false,
|
95
|
-
type: Boolean,
|
96
|
-
},
|
97
|
-
options: {
|
98
|
-
required: false,
|
99
|
-
default: [],
|
100
|
-
type: Array<object>,
|
101
|
-
},
|
102
|
-
loadingOptions: {
|
103
|
-
required: false,
|
104
|
-
default: false,
|
105
|
-
type: Boolean,
|
106
|
-
},
|
107
|
-
})
|
4
|
+
import _props from '../props/Input'
|
108
5
|
|
6
|
+
const props: any = defineProps(_props)
|
7
|
+
const modelValue = defineModel()
|
8
|
+
modelValue.value = ''
|
109
9
|
const inputValue: any = ref(null)
|
110
10
|
|
111
|
-
const emits = defineEmits(['update:modelValue'])
|
112
|
-
|
113
11
|
watch(
|
114
12
|
() => inputValue.value,
|
115
13
|
() => {
|
@@ -117,16 +15,13 @@ watch(
|
|
117
15
|
|
118
16
|
switch (props.display) {
|
119
17
|
case 'price':
|
120
|
-
inputValue.value = useGloriousCore.
|
18
|
+
inputValue.value = useGloriousCore.numbersWithSeparateSamePrice(
|
121
19
|
inputValue.value
|
122
20
|
)
|
123
|
-
|
124
|
-
'update:modelValue',
|
125
|
-
inputValue.value.toString().replaceAll(',', '')
|
126
|
-
)
|
21
|
+
modelValue.value = inputValue.value.toString().replaceAll(',', '')
|
127
22
|
break
|
128
23
|
default:
|
129
|
-
|
24
|
+
modelValue.value = inputValue.value
|
130
25
|
break
|
131
26
|
}
|
132
27
|
}
|
@@ -148,7 +43,7 @@ const computeIconSize = computed(() => {
|
|
148
43
|
case 'sm':
|
149
44
|
iconSize = 23
|
150
45
|
break
|
151
|
-
case '
|
46
|
+
case 'xs':
|
152
47
|
iconSize = 20
|
153
48
|
break
|
154
49
|
default:
|
@@ -170,7 +65,7 @@ const addTag = (event: any) => {
|
|
170
65
|
if (props.mode !== 'tag') return
|
171
66
|
const value: any = event.target.value
|
172
67
|
tags.value.push(value)
|
173
|
-
|
68
|
+
modelValue.value = tags.value
|
174
69
|
inputValue.value = ''
|
175
70
|
}
|
176
71
|
|
@@ -180,27 +75,27 @@ const addTagViaOption = (option: any, event: any) => {
|
|
180
75
|
|
181
76
|
const value: any = option
|
182
77
|
tags.value.push(value)
|
183
|
-
|
78
|
+
modelValue.value = tags.value
|
184
79
|
inputValue.value = ''
|
185
80
|
}
|
186
81
|
|
187
82
|
const removeTag = (tag: string) => {
|
188
83
|
tags.value = tags.value.filter((item: any) => item !== tag)
|
189
|
-
|
84
|
+
modelValue.value = tags.value
|
190
85
|
}
|
191
86
|
|
192
87
|
// -------------------------------------- init value
|
193
88
|
const initValue = () => {
|
194
89
|
if (props.mode === 'tag') {
|
195
|
-
tags.value =
|
90
|
+
tags.value = modelValue.value
|
196
91
|
return
|
197
92
|
}
|
198
93
|
|
199
|
-
inputValue.value =
|
94
|
+
inputValue.value = modelValue.value
|
200
95
|
}
|
201
96
|
initValue()
|
202
97
|
watch(
|
203
|
-
() =>
|
98
|
+
() => modelValue.value,
|
204
99
|
() => initValue()
|
205
100
|
)
|
206
101
|
|
@@ -232,7 +127,7 @@ const inputClicked = (event: any) => {
|
|
232
127
|
:autocomplete="props.autocomplete"
|
233
128
|
class="w-full glorious-input-field"
|
234
129
|
:class="[
|
235
|
-
props.size
|
130
|
+
`size-${props.size}`,
|
236
131
|
`glorious-input-${props.color}`,
|
237
132
|
props.type === 'password' ? 'pl-[30px] pr-3' : 'px-3',
|
238
133
|
]"
|
@@ -262,7 +157,10 @@ const inputClicked = (event: any) => {
|
|
262
157
|
class="glorious-input-options hidden"
|
263
158
|
:class="[`size-${props.size}`]"
|
264
159
|
>
|
265
|
-
<div
|
160
|
+
<div
|
161
|
+
v-if="props.loadingOptions"
|
162
|
+
class="flex justify-center"
|
163
|
+
>
|
266
164
|
<GLoading color="green" />
|
267
165
|
</div>
|
268
166
|
<template v-else>
|
@@ -276,8 +174,14 @@ const inputClicked = (event: any) => {
|
|
276
174
|
</template>
|
277
175
|
</div>
|
278
176
|
</div>
|
279
|
-
<div
|
280
|
-
|
177
|
+
<div
|
178
|
+
v-if="tags.length !== 0"
|
179
|
+
class="glorious-input-tag"
|
180
|
+
>
|
181
|
+
<div
|
182
|
+
v-for="(item, index) in tags"
|
183
|
+
:key="index"
|
184
|
+
>
|
281
185
|
{{ typeof item === 'object' ? item.text : item }}
|
282
186
|
<GIcon
|
283
187
|
name="glorious-x"
|
@@ -298,109 +202,4 @@ const inputClicked = (event: any) => {
|
|
298
202
|
</div>
|
299
203
|
</template>
|
300
204
|
|
301
|
-
<style
|
302
|
-
.xl.glorious-input-orange, .xl.glorious-input-blue, .xl.glorious-input-gray, .xl.glorious-input-red, .xl.glorious-input-primary {
|
303
|
-
@apply py-2.5;
|
304
|
-
}
|
305
|
-
.lg.glorious-input-orange, .lg.glorious-input-blue, .lg.glorious-input-gray, .lg.glorious-input-red, .lg.glorious-input-primary {
|
306
|
-
@apply py-2;
|
307
|
-
}
|
308
|
-
.md.glorious-input-orange, .md.glorious-input-blue, .md.glorious-input-gray, .md.glorious-input-red, .md.glorious-input-primary {
|
309
|
-
@apply py-1.5;
|
310
|
-
}
|
311
|
-
.sm.glorious-input-orange, .sm.glorious-input-blue, .sm.glorious-input-gray, .sm.glorious-input-red, .sm.glorious-input-primary {
|
312
|
-
@apply py-1;
|
313
|
-
}
|
314
|
-
.xsm.glorious-input-orange, .xsm.glorious-input-blue, .xsm.glorious-input-gray, .xsm.glorious-input-red, .xsm.glorious-input-primary {
|
315
|
-
@apply py-0.5;
|
316
|
-
}
|
317
|
-
|
318
|
-
.glorious-input-orange:focus-visible, .glorious-input-blue:focus-visible, .glorious-input-gray:focus-visible, .glorious-input-red:focus-visible, .glorious-input-primary:focus-visible {
|
319
|
-
@apply outline-none ring-2;
|
320
|
-
}
|
321
|
-
|
322
|
-
.glorious-input-primary {
|
323
|
-
@apply rounded-md ring-1 ring-green-500;
|
324
|
-
}
|
325
|
-
.glorious-input-primary:disabled {
|
326
|
-
@apply bg-green-100 cursor-not-allowed;
|
327
|
-
}
|
328
|
-
|
329
|
-
.glorious-input-red {
|
330
|
-
@apply rounded-md ring-1 ring-red-500;
|
331
|
-
}
|
332
|
-
.glorious-input-red:disabled {
|
333
|
-
@apply cursor-not-allowed;
|
334
|
-
}
|
335
|
-
|
336
|
-
.glorious-input-gray {
|
337
|
-
@apply rounded-md ring-1 ring-gray-500;
|
338
|
-
}
|
339
|
-
.glorious-input-gray:disabled {
|
340
|
-
@apply cursor-not-allowed;
|
341
|
-
}
|
342
|
-
|
343
|
-
.glorious-input-blue {
|
344
|
-
@apply rounded-md ring-1 ring-blue-500;
|
345
|
-
}
|
346
|
-
.glorious-input-blue:disabled {
|
347
|
-
@apply cursor-not-allowed;
|
348
|
-
}
|
349
|
-
|
350
|
-
.glorious-input-orange {
|
351
|
-
@apply rounded-md ring-1 ring-orange-500;
|
352
|
-
}
|
353
|
-
.glorious-input-orange:disabled {
|
354
|
-
@apply cursor-not-allowed;
|
355
|
-
}
|
356
|
-
|
357
|
-
.glorious-input {
|
358
|
-
@apply relative w-full;
|
359
|
-
}
|
360
|
-
.glorious-input > input {
|
361
|
-
@apply w-full;
|
362
|
-
}
|
363
|
-
.glorious-input > input::placeholder {
|
364
|
-
@apply text-[14px];
|
365
|
-
}
|
366
|
-
.glorious-input.icon-xl > input {
|
367
|
-
@apply rtl:pr-9 ltr:pl-9;
|
368
|
-
}
|
369
|
-
.glorious-input.icon-lg > input {
|
370
|
-
@apply rtl:pr-9 ltr:pl-8;
|
371
|
-
}
|
372
|
-
.glorious-input.icon-md > input {
|
373
|
-
@apply rtl:pr-9 ltr:pl-8;
|
374
|
-
}
|
375
|
-
.glorious-input.icon-sm > input {
|
376
|
-
@apply rtl:pr-8 ltr:pl-8;
|
377
|
-
}
|
378
|
-
.glorious-input.icon-xsm > input {
|
379
|
-
@apply rtl:pr-8 ltr:pl-7;
|
380
|
-
}
|
381
|
-
|
382
|
-
.glorious-input-icon {
|
383
|
-
@apply absolute h-max top-0 bottom-0 my-auto rtl:right-1 ltr:left-1;
|
384
|
-
}
|
385
|
-
|
386
|
-
/* ----------------------------------------------- TAG */
|
387
|
-
.glorious-input-tag {
|
388
|
-
@apply mt-3 gap-2 flex flex-wrap;
|
389
|
-
}
|
390
|
-
.glorious-input-tag > div {
|
391
|
-
@apply bg-green-500 px-1 rounded text-white flex items-center gap-2 cursor-pointer;
|
392
|
-
}
|
393
|
-
|
394
|
-
.glorious-input-options {
|
395
|
-
@apply p-1 shadow-lg absolute w-full bg-white rounded border-gray-200 border max-h-[200px] overflow-y-auto z-40;
|
396
|
-
}
|
397
|
-
.glorious-input-options > div {
|
398
|
-
@apply py-2 hover:bg-gray-100 cursor-pointer rounded px-2;
|
399
|
-
}
|
400
|
-
.glorious-input-options.size-md {
|
401
|
-
@apply top-11;
|
402
|
-
}
|
403
|
-
.glorious-input div > input::placeholder {
|
404
|
-
@apply text-gray-500;
|
405
|
-
}
|
406
|
-
</style>
|
205
|
+
<style lang="scss" src="../../assets/style/components/input.scss" />
|
@@ -1,27 +1,12 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
|
3
|
-
|
4
|
-
required: false,
|
5
|
-
default: "#fff",
|
6
|
-
type: String,
|
7
|
-
},
|
8
|
-
size: {
|
9
|
-
required: false,
|
10
|
-
default: 30,
|
11
|
-
type: Number,
|
12
|
-
},
|
13
|
-
stroke: {
|
14
|
-
required: false,
|
15
|
-
default: 3,
|
16
|
-
type: Number,
|
17
|
-
},
|
18
|
-
});
|
2
|
+
import _props from '../props/Loading'
|
3
|
+
const props: any = defineProps(_props)
|
19
4
|
</script>
|
20
5
|
|
21
6
|
<template>
|
22
7
|
<div class="inline">
|
23
8
|
<div
|
24
|
-
class="
|
9
|
+
class="glorious-loading"
|
25
10
|
:style="{
|
26
11
|
width: `${props.size}px`,
|
27
12
|
border: `${props.stroke}px solid ${props.color}`,
|
@@ -30,6 +15,4 @@ const props = defineProps({
|
|
30
15
|
</div>
|
31
16
|
</template>
|
32
17
|
|
33
|
-
<style
|
34
|
-
.loader{animation:l20-1 .8s linear infinite alternate,l20-2 1.6s linear infinite;aspect-ratio:1;border-radius:50%}@keyframes l20-1{0%{clip-path:polygon(50% 50%,0 0,50% 0,50% 0,50% 0,50% 0,50% 0)}12.5%{clip-path:polygon(50% 50%,0 0,50% 0,100% 0,100% 0,100% 0,100% 0)}25%{clip-path:polygon(50% 50%,0 0,50% 0,100% 0,100% 100%,100% 100%,100% 100%)}50%{clip-path:polygon(50% 50%,0 0,50% 0,100% 0,100% 100%,50% 100%,0 100%)}62.5%{clip-path:polygon(50% 50%,100% 0,100% 0,100% 0,100% 100%,50% 100%,0 100%)}75%{clip-path:polygon(50% 50%,100% 100%,100% 100%,100% 100%,100% 100%,50% 100%,0 100%)}to{clip-path:polygon(50% 50%,50% 100%,50% 100%,50% 100%,50% 100%,50% 100%,0 100%)}}@keyframes l20-2{0%{transform:scaleY(1) rotate(0deg)}49.99%{transform:scaleY(1) rotate(135deg)}50%{transform:scaleY(-1) rotate(0deg)}to{transform:scaleY(-1) rotate(-135deg)}}
|
35
|
-
</style>
|
18
|
+
<style src="../../assets/style/components/loading.scss" />
|
@@ -1,93 +1,28 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { watch } from '#imports'
|
3
|
+
import { createBlurDom, removeBlurDom } from '../helper'
|
4
|
+
import _props from '../props/Modal'
|
3
5
|
|
4
|
-
const props = defineProps(
|
5
|
-
|
6
|
-
|
7
|
-
default: false,
|
8
|
-
type: Boolean,
|
9
|
-
},
|
10
|
-
size: {
|
11
|
-
required: false,
|
12
|
-
default: 'md',
|
13
|
-
type: String as () => 'xl' | 'lg' | 'md' | 'sm' | 'full',
|
14
|
-
},
|
15
|
-
title: {
|
16
|
-
required: false,
|
17
|
-
default: '',
|
18
|
-
type: String,
|
19
|
-
},
|
20
|
-
okBtn: {
|
21
|
-
required: false,
|
22
|
-
default: '',
|
23
|
-
type: String,
|
24
|
-
},
|
25
|
-
okBtnLoading: {
|
26
|
-
required: false,
|
27
|
-
default: false,
|
28
|
-
type: Boolean,
|
29
|
-
},
|
30
|
-
closeBtn: {
|
31
|
-
required: false,
|
32
|
-
default: '',
|
33
|
-
type: String,
|
34
|
-
},
|
35
|
-
rtl: {
|
36
|
-
required: false,
|
37
|
-
default: 'rtl',
|
38
|
-
type: String as () => 'rtl' | 'ltr',
|
39
|
-
},
|
40
|
-
blur: {
|
41
|
-
required: false,
|
42
|
-
default: true,
|
43
|
-
type: Boolean,
|
44
|
-
},
|
45
|
-
blurClose: {
|
46
|
-
required: false,
|
47
|
-
default: true,
|
48
|
-
type: Boolean,
|
49
|
-
},
|
50
|
-
colorBtn: {
|
51
|
-
required: false,
|
52
|
-
default: 'primary',
|
53
|
-
type: String as () => 'orange' | 'blue' | 'gray' | 'red' | 'primary',
|
54
|
-
},
|
55
|
-
})
|
56
|
-
|
57
|
-
const emits = defineEmits(['ok', 'close', 'update:modelValue'])
|
58
|
-
|
59
|
-
const addBlurBackground = (): void => {
|
60
|
-
const backgroundBlur = document.createElement('div')
|
61
|
-
backgroundBlur.classList.add('glorious-scaffold-modal-bg-blur')
|
62
|
-
const nuxt: any = document.getElementById('__nuxt')
|
63
|
-
nuxt.appendChild(backgroundBlur)
|
64
|
-
backgroundBlur.addEventListener('click', () => {
|
65
|
-
if (props.blurClose) {
|
66
|
-
emits('update:modelValue', false)
|
67
|
-
backgroundBlur.remove()
|
68
|
-
}
|
69
|
-
})
|
70
|
-
}
|
6
|
+
const props = defineProps(_props)
|
7
|
+
const emits = defineEmits(['ok', 'close'])
|
8
|
+
const modelValue = defineModel()
|
71
9
|
|
72
10
|
watch(
|
73
|
-
() =>
|
11
|
+
() => modelValue.value,
|
74
12
|
() => {
|
75
13
|
const modals = document.querySelectorAll('.glorious-scaffold-modal')
|
76
|
-
if (
|
77
|
-
|
14
|
+
if (modelValue.value && props.blur) {
|
15
|
+
createBlurDom(() => (modelValue.value = false))
|
78
16
|
setTimeout(() => {
|
79
17
|
modals.forEach((el: any) => {
|
80
18
|
el.classList.remove('animation')
|
81
19
|
})
|
82
20
|
}, 500)
|
83
21
|
} else {
|
84
|
-
const blur: any = document.querySelector(
|
85
|
-
'.glorious-scaffold-modal-bg-blur'
|
86
|
-
)
|
87
22
|
modals.forEach((el: any) => {
|
88
23
|
el.classList.add('animation')
|
89
24
|
})
|
90
|
-
|
25
|
+
removeBlurDom()
|
91
26
|
}
|
92
27
|
}
|
93
28
|
)
|
@@ -96,7 +31,7 @@ watch(
|
|
96
31
|
<template>
|
97
32
|
<div
|
98
33
|
class="glorious-scaffold-modal animation"
|
99
|
-
:class="[
|
34
|
+
:class="[modelValue ? 'open' : 'close', `size-${props.size}`]"
|
100
35
|
>
|
101
36
|
<!-- header -->
|
102
37
|
<div
|
@@ -108,7 +43,7 @@ watch(
|
|
108
43
|
class="flex justify-center items-center w-6 h-6"
|
109
44
|
size="sm"
|
110
45
|
color="red"
|
111
|
-
@click="
|
46
|
+
@click="modelValue = false"
|
112
47
|
>
|
113
48
|
<GIcon
|
114
49
|
name="glorious-x"
|
@@ -143,7 +78,7 @@ watch(
|
|
143
78
|
:color="props.colorBtn"
|
144
79
|
v-show="props.closeBtn !== ''"
|
145
80
|
outline
|
146
|
-
@click="
|
81
|
+
@click="modelValue = false"
|
147
82
|
>
|
148
83
|
{{ props.closeBtn }}
|
149
84
|
</GButton>
|
@@ -152,71 +87,4 @@ watch(
|
|
152
87
|
</div>
|
153
88
|
</template>
|
154
89
|
|
155
|
-
<style
|
156
|
-
.glorious-scaffold-modal {
|
157
|
-
@apply fixed bg-white md:top-[15%] z-50 right-0 left-0 mx-auto p-3 md:rounded-md rounded-t-md md:bottom-0 bottom-0 overflow-y-auto;
|
158
|
-
}
|
159
|
-
.glorious-scaffold-modal-header {
|
160
|
-
@apply flex justify-between items-center;
|
161
|
-
}
|
162
|
-
.glorious-scaffold-modal-footer {
|
163
|
-
@apply flex justify-center gap-3 mt-3;
|
164
|
-
}
|
165
|
-
.glorious-scaffold-modal-footer > button {
|
166
|
-
@apply min-w-24;
|
167
|
-
}
|
168
|
-
.glorious-scaffold-modal-bg-blur {
|
169
|
-
@apply fixed top-0 right-0 backdrop-blur-sm bg-gray-500 bg-opacity-50 h-full w-full z-[40];
|
170
|
-
}
|
171
|
-
.glorious-scaffold-modal.size-full {
|
172
|
-
@apply w-full h-full top-0 rounded-none;
|
173
|
-
}
|
174
|
-
.glorious-scaffold-modal.size-xl {
|
175
|
-
@apply md:w-[70%] w-full md:h-max max-h-[calc(100%-15%)];
|
176
|
-
}
|
177
|
-
.glorious-scaffold-modal.size-lg {
|
178
|
-
@apply md:w-[60%] w-full md:h-max max-h-[calc(100%-15%)];
|
179
|
-
}
|
180
|
-
.glorious-scaffold-modal.size-md {
|
181
|
-
@apply md:w-[50%] w-full md:h-max max-h-[calc(100%-15%)];
|
182
|
-
}
|
183
|
-
.glorious-scaffold-modal.size-sm {
|
184
|
-
@apply lg:w-[25%] md:w-[35%] w-full md:h-max max-h-[calc(100%-15%)];
|
185
|
-
}
|
186
|
-
.glorious-scaffold-modal.close {
|
187
|
-
@apply hidden;
|
188
|
-
}
|
189
|
-
.glorious-scaffold-modal.open.animation {
|
190
|
-
animation: animationMobile 0.3s normal forwards;
|
191
|
-
}
|
192
|
-
@screen md {
|
193
|
-
.glorious-scaffold-modal.open.animation {
|
194
|
-
animation: animationOpacity 0.3s normal forwards;
|
195
|
-
}
|
196
|
-
}
|
197
|
-
@keyframes animationOpacity {
|
198
|
-
0% {
|
199
|
-
transform: scale(0.1);
|
200
|
-
opacity: 0;
|
201
|
-
}
|
202
|
-
99% {
|
203
|
-
transform: scale(1);
|
204
|
-
opacity: 1;
|
205
|
-
}
|
206
|
-
100% {
|
207
|
-
transform: unset;
|
208
|
-
opacity: 1;
|
209
|
-
}
|
210
|
-
}
|
211
|
-
@keyframes animationMobile {
|
212
|
-
0% {
|
213
|
-
transform: translateY(100%);
|
214
|
-
}
|
215
|
-
99% {
|
216
|
-
transform: translateY(0);
|
217
|
-
}
|
218
|
-
100% {
|
219
|
-
transform: translateY(0);
|
220
|
-
}
|
221
|
-
}
|
222
|
-
</style>
|
90
|
+
<style lang="scss" src="../../assets/style/components/modal.scss" />
|
@@ -1,32 +1,14 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { watch, ref } from '#imports'
|
3
|
-
|
4
|
-
currentPage: {
|
5
|
-
required: true,
|
6
|
-
type: Number,
|
7
|
-
default: 1,
|
8
|
-
},
|
9
|
-
lastPage: {
|
10
|
-
required: true,
|
11
|
-
type: Number,
|
12
|
-
default: 1,
|
13
|
-
},
|
14
|
-
numberSugestPage: {
|
15
|
-
required: false,
|
16
|
-
type: Number,
|
17
|
-
default: 3,
|
18
|
-
},
|
19
|
-
modelValue: {
|
20
|
-
required: false,
|
21
|
-
type: Number,
|
22
|
-
},
|
23
|
-
})
|
3
|
+
import _props from '../props/Paginate'
|
24
4
|
|
25
|
-
const
|
5
|
+
const props = defineProps(_props)
|
6
|
+
const modelValue = defineModel()
|
7
|
+
const emits = defineEmits(['change'])
|
26
8
|
|
27
9
|
const emit = (item: any) => {
|
28
10
|
if (props.currentPage !== item) {
|
29
|
-
|
11
|
+
modelValue.value = item
|
30
12
|
emits('change', { page: item })
|
31
13
|
}
|
32
14
|
}
|
@@ -35,8 +17,8 @@ const listPage = ref<Array<Number>>([])
|
|
35
17
|
|
36
18
|
const computeListPage = () => {
|
37
19
|
listPage.value = []
|
38
|
-
let firstPage = props.currentPage - props.
|
39
|
-
const endPage = props.currentPage + (props.
|
20
|
+
let firstPage = props.currentPage - props.numberSuggestPage
|
21
|
+
const endPage = props.currentPage + (props.numberSuggestPage + 1)
|
40
22
|
|
41
23
|
while (firstPage <= endPage) {
|
42
24
|
if (firstPage > 0 && firstPage <= props.lastPage)
|
@@ -93,22 +75,4 @@ const arrowNext = () => {
|
|
93
75
|
</div>
|
94
76
|
</template>
|
95
77
|
|
96
|
-
<style
|
97
|
-
.glorious-paginate > div {
|
98
|
-
@apply border border-gray-50 rounded-xl h-8 flex items-center px-1 bg-white shadow-md gap-1 w-max;
|
99
|
-
direction: rtl;
|
100
|
-
}
|
101
|
-
.glorious-paginate > div > div {
|
102
|
-
@apply px-2;
|
103
|
-
}
|
104
|
-
.glorious-paginate > div > div:last-child {
|
105
|
-
@apply rotate-[180deg];
|
106
|
-
}
|
107
|
-
|
108
|
-
.paginate {
|
109
|
-
@apply text-[13px];
|
110
|
-
}
|
111
|
-
.paginate.active {
|
112
|
-
@apply bg-green-500 rounded-lg text-white font-bold text-[13px];
|
113
|
-
}
|
114
|
-
</style>
|
78
|
+
<style lang="scss" src="../../assets/style/components/paginate.scss" />
|