nuxt-glorious 1.3.3 → 1.9.0-dev
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/module.mjs +5 -23
- package/dist/runtime/components/G/Alert.vue +2 -3
- package/dist/runtime/components/G/Avatar.vue +9 -4
- package/dist/runtime/components/G/Breadcrumb.vue +4 -3
- package/dist/runtime/components/G/Button.vue +10 -11
- package/dist/runtime/components/G/Checkbox.vue +7 -5
- package/dist/runtime/components/G/Drawer.vue +6 -3
- package/dist/runtime/components/G/File.vue +11 -8
- package/dist/runtime/components/G/Icon.vue +37 -70
- package/dist/runtime/components/G/Input.vue +43 -25
- package/dist/runtime/components/G/Loading.vue +8 -4
- package/dist/runtime/components/G/Modal.vue +7 -6
- package/dist/runtime/components/G/Paginate.vue +41 -13
- package/dist/runtime/components/G/Radio.vue +8 -5
- package/dist/runtime/components/G/Rating.vue +0 -2
- package/dist/runtime/components/G/Select.vue +9 -9
- package/dist/runtime/components/G/Switch.vue +0 -2
- package/dist/runtime/components/G/Tab.vue +1 -2
- package/dist/runtime/components/G/Table.vue +0 -2
- package/dist/runtime/components/G/Tooltip.vue +17 -0
- package/dist/runtime/components/G/Wizard.vue +71 -25
- package/dist/runtime/components/G/textarea.vue +10 -9
- package/dist/runtime/components/G/timeline.vue +0 -2
- package/dist/runtime/components/helper.d.ts +1 -0
- package/dist/runtime/components/helper.mjs +13 -2
- package/dist/runtime/components/props/Alert.d.ts +1 -1
- package/dist/runtime/components/props/Avatar.d.ts +9 -0
- package/dist/runtime/components/props/Avatar.mjs +4 -6
- package/dist/runtime/components/props/Button.d.ts +1 -1
- package/dist/runtime/components/props/CheckBox.d.ts +1 -1
- package/dist/runtime/components/props/File.d.ts +1 -1
- package/dist/runtime/components/props/Icon.d.ts +4 -0
- package/dist/runtime/components/props/Icon.mjs +5 -1
- package/dist/runtime/components/props/Input.d.ts +1 -1
- package/dist/runtime/components/props/Loading.d.ts +1 -1
- package/dist/runtime/components/props/Modal.d.ts +1 -1
- package/dist/runtime/components/props/Paginate.d.ts +5 -0
- package/dist/runtime/components/props/Paginate.mjs +2 -0
- package/dist/runtime/components/props/Radio.d.ts +1 -1
- package/dist/runtime/components/props/Select.d.ts +1 -1
- package/dist/runtime/components/props/Switch.d.ts +1 -1
- package/dist/runtime/components/props/Table.d.ts +1 -1
- package/dist/runtime/components/props/Textarea.d.ts +1 -6
- package/dist/runtime/components/props/Textarea.mjs +0 -2
- package/dist/runtime/components/props/Timeline.d.ts +1 -1
- package/dist/runtime/components/props/common/index.d.ts +14 -2
- package/dist/runtime/components/props/common/index.mjs +13 -1
- package/dist/runtime/composables/helper/useGloriousFetch/functionComputeAuth.d.ts +2 -0
- package/dist/runtime/composables/helper/useGloriousFetch/functionComputeAuth.mjs +8 -0
- package/dist/runtime/composables/helper/useGloriousFetch/functionComputeFormData.d.ts +3 -0
- package/dist/runtime/composables/helper/useGloriousFetch/functionComputeFormData.mjs +14 -0
- package/dist/runtime/composables/helper/useGloriousFetch/functionComputeGKey.d.ts +2 -0
- package/dist/runtime/composables/helper/useGloriousFetch/functionComputeGKey.mjs +3 -0
- package/dist/runtime/composables/helper/useGloriousFetch/functionComputeHeaderFetch.d.ts +2 -0
- package/dist/runtime/composables/helper/useGloriousFetch/functionComputeHeaderFetch.mjs +9 -0
- package/dist/runtime/composables/helper/useGloriousFetch/functionComputeParams.d.ts +2 -0
- package/dist/runtime/composables/helper/useGloriousFetch/functionComputeParams.mjs +7 -0
- package/dist/runtime/composables/helper/useGloriousFetch/functionComputeValidation.d.ts +2 -0
- package/dist/runtime/composables/helper/useGloriousFetch/functionComputeValidation.mjs +30 -0
- package/dist/runtime/composables/helper/useGloriousFetch/gloriousFetchDefaultOptions.d.ts +3 -0
- package/dist/runtime/composables/helper/useGloriousFetch/gloriousFetchDefaultOptions.mjs +15 -0
- package/dist/runtime/composables/helper/useGloriousFetch/gloriousFetchOptionsInterface.d.ts +15 -0
- package/dist/runtime/composables/useGloriousCore.d.ts +0 -1
- package/dist/runtime/composables/useGloriousCore.mjs +1 -3
- package/dist/runtime/composables/useGloriousFetch.d.ts +1 -15
- package/dist/runtime/composables/useGloriousFetch.mjs +11 -57
- package/dist/runtime/composables/useGloriousHead.mjs +1 -1
- package/dist/runtime/middlewares/AuthStrategy.mjs +1 -9
- package/dist/runtime/plugins/InputComponent.mjs +0 -2
- package/dist/runtime/style/components/drawer.css +4 -35
- package/dist/runtime/style/components/dropdown.css +17 -15
- package/dist/{runtime/style/components → scss}/alert.scss +7 -7
- package/dist/scss/avatar.scss +13 -0
- package/dist/scss/breadcrumb.scss +6 -0
- package/dist/{runtime/style/components → scss}/button.scss +30 -30
- package/dist/{runtime/style/components → scss}/checkbox.scss +1 -1
- package/dist/scss/drawer.scss +64 -0
- package/dist/{runtime/style/components → scss}/file.scss +2 -2
- package/dist/scss/glorious.scss +22 -0
- package/dist/{runtime/style/components → scss}/input.scss +9 -3
- package/dist/{runtime/style → scss}/mixin.scss +1 -1
- package/dist/scss/modal.scss +76 -0
- package/dist/scss/paginate.scss +28 -0
- package/dist/{runtime/style/components → scss}/radio.scss +1 -1
- package/dist/{runtime/style/components → scss}/select.scss +2 -2
- package/dist/{runtime/style/components → scss}/switch.scss +1 -1
- package/dist/{runtime/style/components → scss}/tab.scss +1 -1
- package/dist/{runtime/style/components → scss}/table.scss +1 -1
- package/dist/{runtime/style/components → scss}/textarea.scss +2 -2
- package/dist/{runtime/style/components → scss}/timeline.scss +2 -2
- package/dist/scss/tooltip.scss +14 -0
- package/package.json +9 -7
- package/dist/runtime/style/components/alert.css +0 -33
- package/dist/runtime/style/components/avatar.css +0 -57
- package/dist/runtime/style/components/avatar.scss +0 -13
- package/dist/runtime/style/components/breadcrumb.css +0 -6
- package/dist/runtime/style/components/breadcrumb.scss +0 -6
- package/dist/runtime/style/components/drawer.scss +0 -57
- package/dist/runtime/style/components/dropdown.scss +0 -19
- package/dist/runtime/style/components/editor.scss +0 -4
- package/dist/runtime/style/components/input.css +0 -184
- package/dist/runtime/style/components/loading.css +0 -43
- package/dist/runtime/style/components/modal.css +0 -66
- package/dist/runtime/style/components/modal.scss +0 -76
- package/dist/runtime/style/components/paginate.css +0 -17
- package/dist/runtime/style/components/paginate.scss +0 -18
- package/dist/runtime/style/components/radio.css +0 -121
- package/dist/runtime/style/components/rating.css +0 -30
- package/dist/runtime/style/components/select.css +0 -49
- package/dist/runtime/style/components/switch.css +0 -61
- package/dist/runtime/style/components/table.css +0 -99
- package/dist/runtime/style/components/textarea.css +0 -67
- /package/dist/{runtime/style/components → scss}/loading.scss +0 -0
- /package/dist/{runtime/style/components → scss}/rating.scss +0 -0
- /package/dist/{runtime/style → scss}/variable.scss +0 -0
@@ -1,13 +1,14 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { watch, ref } from '#imports'
|
3
3
|
import _props from '../props/Paginate'
|
4
|
+
import { getAttribute } from '../helper'
|
4
5
|
|
5
6
|
const props = defineProps(_props)
|
6
7
|
const modelValue = defineModel()
|
7
8
|
const emits = defineEmits(['change'])
|
8
9
|
|
9
10
|
const emit = (item: any) => {
|
10
|
-
if (props.currentPage !== item) {
|
11
|
+
if (getAttribute(props.currentPage, 'paginate', 'currentPage') !== item) {
|
11
12
|
modelValue.value = item
|
12
13
|
emits('change', { page: item })
|
13
14
|
}
|
@@ -17,37 +18,57 @@ const listPage = ref<Array<Number>>([])
|
|
17
18
|
|
18
19
|
const computeListPage = () => {
|
19
20
|
listPage.value = []
|
20
|
-
let firstPage =
|
21
|
-
|
21
|
+
let firstPage =
|
22
|
+
getAttribute(props.currentPage, 'paginate', 'currentPage') -
|
23
|
+
getAttribute(props.numberSuggestPage, 'paginate', 'numberSuggestPage')
|
24
|
+
const endPage =
|
25
|
+
getAttribute(props.currentPage, 'paginate', 'currentPage') +
|
26
|
+
(getAttribute(props.numberSuggestPage, 'paginate', 'numberSuggestPage') + 1)
|
22
27
|
|
23
28
|
while (firstPage <= endPage) {
|
24
|
-
if (
|
29
|
+
if (
|
30
|
+
firstPage > 0 &&
|
31
|
+
firstPage <= getAttribute(props.lastPage, 'paginate', 'lastPage')
|
32
|
+
)
|
25
33
|
listPage.value.push(firstPage)
|
26
34
|
firstPage++
|
27
35
|
}
|
28
36
|
}
|
29
37
|
computeListPage()
|
30
38
|
watch(
|
31
|
-
() => props.currentPage,
|
39
|
+
() => getAttribute(props.currentPage, 'paginate', 'currentPage'),
|
32
40
|
() => computeListPage()
|
33
41
|
)
|
34
42
|
|
35
43
|
const arrowPrevious = () => {
|
36
|
-
if (props.currentPage
|
44
|
+
if (getAttribute(props.currentPage, 'paginate', 'currentPage') !== 1)
|
45
|
+
emit(getAttribute(props.currentPage, 'paginate', 'currentPage') - 1)
|
37
46
|
}
|
38
47
|
const arrowNext = () => {
|
39
|
-
if (
|
48
|
+
if (
|
49
|
+
getAttribute(props.currentPage, 'paginate', 'currentPage') !==
|
50
|
+
getAttribute(props.lastPage, 'paginate', 'lastPage')
|
51
|
+
)
|
52
|
+
emit(getAttribute(props.currentPage, 'paginate', 'currentPage') + 1)
|
40
53
|
}
|
41
54
|
</script>
|
42
55
|
|
43
56
|
<template>
|
44
57
|
<div
|
45
|
-
v-if="
|
58
|
+
v-if="
|
59
|
+
getAttribute(props.currentPage, 'paginate', 'currentPage') &&
|
60
|
+
getAttribute(props.lastPage, 'paginate', 'lastPage') !== 1
|
61
|
+
"
|
46
62
|
class="w-max glorious-paginate"
|
63
|
+
:class="[`color-${getAttribute(props.color, 'paginate', 'color')}`]"
|
47
64
|
>
|
48
65
|
<div>
|
49
66
|
<GIcon
|
50
|
-
:color="
|
67
|
+
:color="
|
68
|
+
getAttribute(props.currentPage, 'paginate', 'currentPage') !== 1
|
69
|
+
? '#000'
|
70
|
+
: '#cbd5e1'
|
71
|
+
"
|
51
72
|
class="ml-2 cursor-pointer"
|
52
73
|
name="glorious-arrow"
|
53
74
|
:size="15"
|
@@ -58,14 +79,23 @@ const arrowNext = () => {
|
|
58
79
|
v-for="(item, index) in listPage"
|
59
80
|
:key="index"
|
60
81
|
class="w-6 h-6 rounded-lg flex items-center justify-center paginate font-bold"
|
61
|
-
:class="[
|
82
|
+
:class="[
|
83
|
+
getAttribute(props.currentPage, 'paginate', 'currentPage') === item
|
84
|
+
? 'active'
|
85
|
+
: 'cursor-pointer',
|
86
|
+
]"
|
62
87
|
@click="emit(item)"
|
63
88
|
>
|
64
89
|
{{ item }}
|
65
90
|
</div>
|
66
91
|
|
67
92
|
<GIcon
|
68
|
-
:color="
|
93
|
+
:color="
|
94
|
+
getAttribute(props.currentPage, 'paginate', 'currentPage') !==
|
95
|
+
getAttribute(props.lastPage, 'paginate', 'lastPage')
|
96
|
+
? '#000'
|
97
|
+
: '#cbd5e1'
|
98
|
+
"
|
69
99
|
name="glorious-arrow"
|
70
100
|
class="mr-2 cursor-pointer"
|
71
101
|
:size="15"
|
@@ -74,5 +104,3 @@ const arrowNext = () => {
|
|
74
104
|
</div>
|
75
105
|
</div>
|
76
106
|
</template>
|
77
|
-
|
78
|
-
<style lang="scss" src="../../style/components/paginate.scss" />
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import _props from '../props/Radio'
|
3
|
+
import { getAttribute } from '../helper'
|
4
|
+
|
3
5
|
const props = defineProps(_props)
|
4
6
|
const modelValue = defineModel()
|
5
7
|
|
@@ -12,18 +14,19 @@ const inputFunction = (event: Event) => {
|
|
12
14
|
<template>
|
13
15
|
<label
|
14
16
|
class="glorious-radio"
|
15
|
-
:class="[
|
17
|
+
:class="[
|
18
|
+
getAttribute(props.color, 'radio', 'color'),
|
19
|
+
`size-${getAttribute(props.size, 'radio', 'size')}`,
|
20
|
+
]"
|
16
21
|
>
|
17
22
|
<input
|
18
|
-
:name="props.
|
23
|
+
:name="getAttribute(props.checked, 'radio', 'checked')"
|
19
24
|
type="radio"
|
20
25
|
:disabled="props.disabled"
|
21
26
|
:value="props.value"
|
22
|
-
:checked="props.checked"
|
27
|
+
:checked="getAttribute(props.checked, 'radio', 'checked')"
|
23
28
|
@input="inputFunction($event)"
|
24
29
|
/>
|
25
30
|
<div></div>
|
26
31
|
</label>
|
27
32
|
</template>
|
28
|
-
|
29
|
-
<style lang="scss" src="../../style/components/radio.scss" />
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { ref, watch } from '#imports'
|
3
3
|
import _props from '../props/Select'
|
4
|
-
import { hasValidationError } from '../helper'
|
4
|
+
import { hasValidationError, getAttribute } from '../helper'
|
5
5
|
|
6
6
|
const props: any = defineProps(_props)
|
7
7
|
const modelValue = defineModel()
|
@@ -32,7 +32,7 @@ const firstVal = selectValue.value
|
|
32
32
|
<span class="glorious-title text-sm font-medium text-gray-500">
|
33
33
|
{{ props.title }}
|
34
34
|
<span
|
35
|
-
v-if="props.required"
|
35
|
+
v-if="getAttribute(props.required, 'select', 'required')"
|
36
36
|
class="text-red-500"
|
37
37
|
>
|
38
38
|
*
|
@@ -42,11 +42,11 @@ const firstVal = selectValue.value
|
|
42
42
|
<select
|
43
43
|
v-model="selectValue"
|
44
44
|
aria-label="glorious select"
|
45
|
-
:disabled="props.disabled"
|
45
|
+
:disabled="getAttribute(props.disabled, 'select', 'disabled')"
|
46
46
|
class="grow glorious-select"
|
47
47
|
:class="[
|
48
|
-
`color-${props.color}`,
|
49
|
-
props.size,
|
48
|
+
`color-${getAttribute(props.color, 'select', 'color')}`,
|
49
|
+
getAttribute(props.size, 'select', 'size'),
|
50
50
|
hasValidationError(props.error) ? 'validation-error' : '',
|
51
51
|
selectValue === null || selectValue === ''
|
52
52
|
? 'text-gray-500'
|
@@ -66,14 +66,14 @@ const firstVal = selectValue.value
|
|
66
66
|
<option
|
67
67
|
v-for="(item, index) in props.options"
|
68
68
|
:key="index"
|
69
|
-
:value="item[props.keyOfValue]"
|
69
|
+
:value="item[getAttribute(props.keyOfValue, 'select', 'keyOfValue')]"
|
70
70
|
>
|
71
|
-
{{
|
71
|
+
{{
|
72
|
+
item[getAttribute(props.displayTextKey, 'select', 'displayTextKey')]
|
73
|
+
}}
|
72
74
|
</option>
|
73
75
|
</select>
|
74
76
|
</div>
|
75
77
|
<GErrorText :error="props.error" />
|
76
78
|
</div>
|
77
79
|
</template>
|
78
|
-
|
79
|
-
<style lang="scss" src="../../style/components/select.scss" />
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import _props from '../props/Tab'
|
3
|
+
|
3
4
|
const props: any = defineProps(_props)
|
4
5
|
const modelValue = defineModel()
|
5
6
|
const tabClicked: any = (key: string, event: any) => {
|
@@ -89,5 +90,3 @@ const scrollPrevious = (event: Event) => {
|
|
89
90
|
</div>
|
90
91
|
</div>
|
91
92
|
</template>
|
92
|
-
|
93
|
-
<style lang="scss" src="../../style/components/tab.scss" />
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
const props = defineProps({
|
3
|
+
text: {
|
4
|
+
required: true,
|
5
|
+
type: String,
|
6
|
+
},
|
7
|
+
})
|
8
|
+
</script>
|
9
|
+
|
10
|
+
<template>
|
11
|
+
<div class="glorious-tooltip">
|
12
|
+
<div class="tooltip-slot">
|
13
|
+
<slot />
|
14
|
+
</div>
|
15
|
+
<div class="tooltip-content">{{ props.text }}</div>
|
16
|
+
</div>
|
17
|
+
</template>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
import { watch, onMounted } from
|
2
|
+
import { watch, onMounted } from '#imports'
|
3
3
|
const props = defineProps({
|
4
4
|
items: {
|
5
5
|
required: true,
|
@@ -12,67 +12,70 @@ const props = defineProps({
|
|
12
12
|
},
|
13
13
|
progressColor: {
|
14
14
|
required: false,
|
15
|
-
default:
|
15
|
+
default: '#00ff00',
|
16
16
|
type: String,
|
17
17
|
},
|
18
18
|
bgColor: {
|
19
19
|
required: false,
|
20
|
-
default:
|
20
|
+
default: '#0000ff',
|
21
21
|
type: String,
|
22
22
|
},
|
23
|
-
})
|
23
|
+
})
|
24
24
|
|
25
25
|
const methods = {
|
26
26
|
computeWizardMobile: () => {
|
27
|
-
const circularProgress = document.querySelectorAll(
|
27
|
+
const circularProgress = document.querySelectorAll('.circular-progress')
|
28
28
|
Array.from(circularProgress).forEach((progressBar: any) => {
|
29
|
-
const progressValue: any = progressBar.querySelector(
|
30
|
-
const innerCircle: any = progressBar.querySelector(
|
31
|
-
const eachStep = (1 / props.items.length) * 100
|
29
|
+
const progressValue: any = progressBar.querySelector('.percentage')
|
30
|
+
const innerCircle: any = progressBar.querySelector('.inner-circle')
|
31
|
+
const eachStep = (1 / props.items.length) * 100
|
32
32
|
|
33
33
|
let startValue =
|
34
|
-
Number(progressBar.getAttribute(
|
34
|
+
Number(progressBar.getAttribute('data-percentage')) - eachStep < 0
|
35
35
|
? 0
|
36
|
-
: Number(progressBar.getAttribute(
|
36
|
+
: Number(progressBar.getAttribute('data-percentage'))
|
37
37
|
|
38
38
|
const endValue: any =
|
39
39
|
props.step === 0
|
40
40
|
? 0
|
41
|
-
: Number(progressBar.getAttribute(
|
42
|
-
progressColor = progressBar.getAttribute(
|
41
|
+
: Number(progressBar.getAttribute('data-percentage')) + eachStep,
|
42
|
+
progressColor = progressBar.getAttribute('data-progress-color')
|
43
43
|
|
44
44
|
const progress = setInterval(() => {
|
45
|
-
progressValue.textContent = props.step + 1
|
45
|
+
progressValue.textContent = props.step + 1
|
46
46
|
|
47
47
|
innerCircle.style.backgroundColor = `${progressBar.getAttribute(
|
48
|
-
|
49
|
-
)}
|
48
|
+
'data-inner-circle-color'
|
49
|
+
)}`
|
50
50
|
|
51
51
|
progressBar.style.background = `conic-gradient(${progressColor} ${
|
52
52
|
startValue * 3.6
|
53
|
-
}deg,${progressBar.getAttribute(
|
53
|
+
}deg,${progressBar.getAttribute('data-bg-color')} 0deg)`
|
54
54
|
|
55
55
|
if (Math.floor(startValue) == Math.floor(endValue))
|
56
|
-
clearInterval(progress)
|
56
|
+
clearInterval(progress)
|
57
57
|
|
58
|
-
startValue
|
59
|
-
}, 10)
|
60
|
-
})
|
58
|
+
startValue++
|
59
|
+
}, 10)
|
60
|
+
})
|
61
61
|
},
|
62
|
-
}
|
62
|
+
}
|
63
63
|
|
64
|
-
onMounted(() => methods.computeWizardMobile())
|
64
|
+
onMounted(() => methods.computeWizardMobile())
|
65
65
|
|
66
66
|
watch(
|
67
67
|
() => props.step,
|
68
68
|
() => methods.computeWizardMobile()
|
69
|
-
)
|
69
|
+
)
|
70
70
|
</script>
|
71
71
|
|
72
72
|
<template>
|
73
73
|
<div class="glorious-wizard">
|
74
74
|
<div class="glorious-wizard-desktop">
|
75
|
-
<div
|
75
|
+
<div
|
76
|
+
v-for="(item, index) in props.items"
|
77
|
+
:key="index"
|
78
|
+
>
|
76
79
|
<div
|
77
80
|
class="circle"
|
78
81
|
:class="parseInt(index) < props.step ? 'checked' : ''"
|
@@ -119,5 +122,48 @@ watch(
|
|
119
122
|
</template>
|
120
123
|
|
121
124
|
<style scoped>
|
122
|
-
|
125
|
+
/*
|
126
|
+
.glorious-wizard {
|
127
|
+
@apply md:w-full w-max;
|
128
|
+
}
|
129
|
+
.glorious-wizard-desktop {
|
130
|
+
@apply md:flex hidden flex-wrap gap-[3%] w-full justify-center;
|
131
|
+
}
|
132
|
+
.glorious-wizard-desktop div {
|
133
|
+
@apply flex flex-col items-center;
|
134
|
+
}
|
135
|
+
.glorious-wizard-desktop > div > div.circle {
|
136
|
+
@apply rounded-full border border-blue-200 w-12 h-12 flex justify-center items-center;
|
137
|
+
}
|
138
|
+
.glorious-wizard-desktop > div > div.circle.checked {
|
139
|
+
@apply border-green-500 bg-green-500;
|
140
|
+
}
|
141
|
+
.glorious-wizard-mobile {
|
142
|
+
@apply w-max md:hidden flex flex-col items-center;
|
143
|
+
}
|
144
|
+
.glorious-wizard-mobile > span {
|
145
|
+
@apply text-gray-500 text-[12px];
|
146
|
+
}
|
147
|
+
.circular-progress {
|
148
|
+
align-items: center;
|
149
|
+
border-radius: 50%;
|
150
|
+
display: flex;
|
151
|
+
justify-content: center;
|
152
|
+
}
|
153
|
+
.circular-progress p,
|
154
|
+
.circular-progress > div {
|
155
|
+
@apply z-[25] text-gray-500;
|
156
|
+
}
|
157
|
+
.inner-circle {
|
158
|
+
background-color: #fff;
|
159
|
+
border-radius: 50%;
|
160
|
+
position: absolute;
|
161
|
+
}
|
162
|
+
.inner-circle.checked {
|
163
|
+
@apply bg-green-500;
|
164
|
+
}
|
165
|
+
.percentage {
|
166
|
+
font-size: 1rem;
|
167
|
+
position: relative;
|
168
|
+
}*/
|
123
169
|
</style>
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<script setup lang="ts">
|
2
2
|
import { ref, watch } from '#imports'
|
3
3
|
import _props from '../props/Textarea'
|
4
|
-
import { hasValidationError } from '../helper'
|
4
|
+
import { hasValidationError, getAttribute } from '../helper'
|
5
|
+
|
5
6
|
const props = defineProps(_props)
|
6
7
|
const modelValue = defineModel()
|
7
8
|
|
@@ -20,9 +21,9 @@ watch(
|
|
20
21
|
<template>
|
21
22
|
<div class="flex flex-col">
|
22
23
|
<span class="glorious-title text-sm font-medium text-gray-500">
|
23
|
-
{{ props.title }}
|
24
|
+
{{ getAttribute(props.title, 'textarea', 'title') }}
|
24
25
|
<span
|
25
|
-
v-if="props.required"
|
26
|
+
v-if="getAttribute(props.required, 'textarea', 'required')"
|
26
27
|
class="text-red-500"
|
27
28
|
>
|
28
29
|
*
|
@@ -32,16 +33,16 @@ watch(
|
|
32
33
|
<textarea
|
33
34
|
v-model="inputValue"
|
34
35
|
:class="[
|
35
|
-
`glorious-textarea-${props.color}`,
|
36
|
+
`glorious-textarea-${getAttribute(props.color, 'textarea', 'color')}`,
|
36
37
|
hasValidationError(props.error) ? 'validation-error' : '',
|
37
38
|
]"
|
38
|
-
:placeholder="
|
39
|
-
|
40
|
-
|
39
|
+
:placeholder="
|
40
|
+
getAttribute(props.placeholder, 'textarea', 'placeholder')
|
41
|
+
"
|
42
|
+
:disabled="getAttribute(props.disabled, 'textarea', 'disabled')"
|
43
|
+
:rows="getAttribute(props.rows, 'textarea', 'rows')"
|
41
44
|
/>
|
42
45
|
<GErrorText :error="props.error" />
|
43
46
|
</div>
|
44
47
|
</div>
|
45
48
|
</template>
|
46
|
-
|
47
|
-
<style lang="scss" src="../../style/components/textarea.scss" />
|
@@ -1,3 +1,4 @@
|
|
1
1
|
export declare const createBlurDom: (callback: Function) => void;
|
2
2
|
export declare const removeBlurDom: () => void;
|
3
3
|
export declare const hasValidationError: (errorProp: string) => boolean;
|
4
|
+
export declare const getAttribute: (propsValue: any, componentName: string, prop: string) => any;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { useRuntimeConfig } from "#app";
|
1
2
|
import { GloriousStore } from "../stores/GloriousStore.mjs";
|
2
3
|
export const createBlurDom = (callback) => {
|
3
4
|
const div = document.createElement("div");
|
@@ -5,9 +6,9 @@ export const createBlurDom = (callback) => {
|
|
5
6
|
"fixed",
|
6
7
|
"top-0",
|
7
8
|
"right-0",
|
8
|
-
"backdrop-blur-
|
9
|
+
"backdrop-blur-xl",
|
9
10
|
"bg-gray-500",
|
10
|
-
"
|
11
|
+
"opacity-75",
|
11
12
|
"h-full",
|
12
13
|
"w-full",
|
13
14
|
"z-[40]",
|
@@ -35,3 +36,13 @@ export const hasValidationError = (errorProp) => {
|
|
35
36
|
);
|
36
37
|
return condition;
|
37
38
|
};
|
39
|
+
export const getAttribute = (propsValue, componentName, prop) => {
|
40
|
+
let mount;
|
41
|
+
if (import.meta.client) {
|
42
|
+
const config = useRuntimeConfig();
|
43
|
+
return config.public?.glorious?.components?.[componentName]?.props?.[prop] || propsValue;
|
44
|
+
} else {
|
45
|
+
mount = propsValue;
|
46
|
+
}
|
47
|
+
return mount;
|
48
|
+
};
|
@@ -3,7 +3,16 @@ declare const _default: {
|
|
3
3
|
required: boolean;
|
4
4
|
type: StringConstructor;
|
5
5
|
};
|
6
|
+
alt: {
|
7
|
+
required: boolean;
|
8
|
+
type: StringConstructor;
|
9
|
+
};
|
6
10
|
size: {
|
11
|
+
required: boolean;
|
12
|
+
default: import("../../../types").sizes;
|
13
|
+
type: () => import("../../../types").sizes;
|
14
|
+
};
|
15
|
+
rounded: {
|
7
16
|
required: boolean;
|
8
17
|
default: string;
|
9
18
|
type: () => import("../../../types").rounded;
|