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.
Files changed (97) hide show
  1. package/dist/module.d.mts +38 -1
  2. package/dist/module.d.ts +38 -1
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +37 -33
  5. package/dist/runtime/assets/style/components/alert.css +20 -5
  6. package/dist/runtime/assets/style/components/avatar.css +21 -18
  7. package/dist/runtime/assets/style/components/button.css +198 -0
  8. package/dist/runtime/assets/style/components/checkbox.css +24 -24
  9. package/dist/runtime/assets/style/components/drawer.css +14 -18
  10. package/dist/runtime/assets/style/components/file.css +102 -33
  11. package/dist/runtime/assets/style/components/input.css +103 -23
  12. package/dist/runtime/assets/style/components/loading.css +43 -0
  13. package/dist/runtime/assets/style/components/radio.css +27 -27
  14. package/dist/runtime/assets/style/components/select.css +24 -19
  15. package/dist/runtime/assets/style/components/textarea.css +35 -35
  16. package/dist/runtime/assets/style/mixin.css +0 -0
  17. package/dist/runtime/components/G/Alert.vue +8 -28
  18. package/dist/runtime/components/G/Avatar.vue +5 -73
  19. package/dist/runtime/components/G/Breadcrumb.vue +7 -25
  20. package/dist/runtime/components/G/Button.vue +10 -152
  21. package/dist/runtime/components/G/Checkbox.vue +8 -124
  22. package/dist/runtime/components/G/CountDown.vue +33 -44
  23. package/dist/runtime/components/G/Drawer.vue +12 -101
  24. package/dist/runtime/components/G/Dropdown.vue +16 -11
  25. package/dist/runtime/components/G/ErrorText.vue +6 -11
  26. package/dist/runtime/components/G/File.vue +25 -117
  27. package/dist/runtime/components/G/Icon.vue +125 -0
  28. package/dist/runtime/components/G/Input.vue +28 -229
  29. package/dist/runtime/components/G/Loading.vue +4 -21
  30. package/dist/runtime/components/G/Modal.vue +13 -145
  31. package/dist/runtime/components/G/Paginate.vue +8 -44
  32. package/dist/runtime/components/G/Radio.vue +12 -163
  33. package/dist/runtime/components/G/Rating.vue +3 -30
  34. package/dist/runtime/components/G/Select.vue +7 -110
  35. package/dist/runtime/components/G/Switch.vue +5 -82
  36. package/dist/runtime/components/G/Tab.vue +6 -30
  37. package/dist/runtime/components/G/Table.vue +12 -131
  38. package/dist/runtime/components/G/textarea.vue +14 -119
  39. package/dist/runtime/components/G/timeline.vue +3 -59
  40. package/dist/runtime/components/helper.d.ts +2 -0
  41. package/dist/runtime/components/helper.mjs +25 -0
  42. package/dist/runtime/components/props/Alert.d.ts +8 -0
  43. package/dist/runtime/components/props/Alert.mjs +4 -0
  44. package/dist/runtime/components/props/Avatar.d.ts +12 -0
  45. package/dist/runtime/components/props/Avatar.mjs +9 -0
  46. package/dist/runtime/components/props/Breadcrumb.d.ts +26 -0
  47. package/dist/runtime/components/props/Breadcrumb.mjs +11 -0
  48. package/dist/runtime/components/props/Button.d.ts +47 -0
  49. package/dist/runtime/components/props/Button.mjs +14 -0
  50. package/dist/runtime/components/props/CheckBox.d.ts +23 -0
  51. package/dist/runtime/components/props/CheckBox.mjs +7 -0
  52. package/dist/runtime/components/props/CountDown.d.ts +7 -0
  53. package/dist/runtime/components/props/CountDown.mjs +6 -0
  54. package/dist/runtime/components/props/Drawer.d.ts +8 -0
  55. package/dist/runtime/components/props/Drawer.mjs +7 -0
  56. package/dist/runtime/components/props/ErrorText.d.ts +8 -0
  57. package/dist/runtime/components/props/ErrorText.mjs +4 -0
  58. package/dist/runtime/components/props/File.d.ts +28 -0
  59. package/dist/runtime/components/props/File.mjs +9 -0
  60. package/dist/runtime/components/props/Icon.d.ts +23 -0
  61. package/dist/runtime/components/props/Icon.mjs +7 -0
  62. package/dist/runtime/components/props/Input.d.ts +91 -0
  63. package/dist/runtime/components/props/Input.mjs +50 -0
  64. package/dist/runtime/components/props/Loading.d.ts +18 -0
  65. package/dist/runtime/components/props/Loading.mjs +6 -0
  66. package/dist/runtime/components/props/Modal.d.ts +48 -0
  67. package/dist/runtime/components/props/Modal.mjs +38 -0
  68. package/dist/runtime/components/props/Paginate.d.ts +18 -0
  69. package/dist/runtime/components/props/Paginate.mjs +17 -0
  70. package/dist/runtime/components/props/Radio.d.ts +33 -0
  71. package/dist/runtime/components/props/Radio.mjs +9 -0
  72. package/dist/runtime/components/props/Select.d.ts +61 -0
  73. package/dist/runtime/components/props/Select.mjs +23 -0
  74. package/dist/runtime/components/props/Switch.d.ts +13 -0
  75. package/dist/runtime/components/props/Switch.mjs +5 -0
  76. package/dist/runtime/components/props/Tab.d.ts +21 -0
  77. package/dist/runtime/components/props/Tab.mjs +7 -0
  78. package/dist/runtime/components/props/Table.d.ts +49 -0
  79. package/dist/runtime/components/props/Table.mjs +19 -0
  80. package/dist/runtime/components/props/Textarea.d.ts +38 -0
  81. package/dist/runtime/components/props/Textarea.mjs +14 -0
  82. package/dist/runtime/components/props/Timeline.d.ts +11 -0
  83. package/dist/runtime/components/props/Timeline.mjs +7 -0
  84. package/dist/runtime/components/props/common/index.d.ts +161 -0
  85. package/dist/runtime/components/props/common/index.mjs +147 -0
  86. package/dist/runtime/composables/useGloriousCore.d.ts +1 -1
  87. package/dist/runtime/composables/useGloriousCore.mjs +1 -1
  88. package/dist/runtime/composables/useGloriousFetch.mjs +0 -1
  89. package/dist/runtime/middlewares/AuthStrategy.mjs +1 -5
  90. package/dist/runtime/stores/GloriousStore.d.ts +0 -2
  91. package/dist/runtime/stores/GloriousStore.mjs +0 -20
  92. package/dist/types.d.mts +2 -10
  93. package/dist/types.d.ts +2 -10
  94. package/package.json +1 -1
  95. package/dist/runtime/assets/style/components/buttons.css +0 -107
  96. package/dist/runtime/components/G/BottomNavigation.vue +0 -3
  97. package/dist/runtime/components/G/Icon/index.vue +0 -143
@@ -1,48 +1,19 @@
1
1
  <script lang="ts" setup>
2
- const props = defineProps({
3
- modelValue: {
4
- required: false,
5
- default: true,
6
- type: [Boolean, String, Object],
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
- name: {
24
- required: true,
25
- type: String,
26
- },
27
- value: {
28
- required: false,
29
- default: "",
30
- type: String,
31
- },
32
- checked: {
33
- required: false,
34
- type: Boolean,
35
- },
36
- });
2
+ import _props from '../props/Radio'
3
+ const props = defineProps(_props)
4
+ const modelValue = defineModel()
37
5
 
38
- const emits = defineEmits(["update:modelValue"]);
39
-
40
- const inputFunction = (event: any) =>
41
- emits("update:modelValue", event.currentTarget.checked);
6
+ const inputFunction = (event: Event) => {
7
+ const target = event.currentTarget as HTMLInputElement
8
+ modelValue.value = target.checked
9
+ }
42
10
  </script>
43
11
 
44
12
  <template>
45
- <label class="glorious-radio" :class="[props.color, `size-${props.size}`]">
13
+ <label
14
+ class="glorious-radio"
15
+ :class="[props.color, `size-${props.size}`]"
16
+ >
46
17
  <input
47
18
  :name="props.name"
48
19
  type="radio"
@@ -55,126 +26,4 @@ const inputFunction = (event: any) =>
55
26
  </label>
56
27
  </template>
57
28
 
58
- <style>
59
- .glorious-radio {
60
- @apply block relative cursor-pointer;
61
- }
62
- .glorious-radio > input {
63
- @apply hidden;
64
- }
65
- .glorious-radio > input:checked ~ div {
66
- @apply border-none;
67
- }
68
- .glorious-radio > input:checked ~ div:after {
69
- content: "";
70
- @apply block w-1 h-1 bg-white rounded-full;
71
- }
72
- .glorious-radio > input:disabled ~ div {
73
- @apply cursor-not-allowed;
74
- }
75
- .glorious-radio > div:last-child {
76
- @apply border border-gray-500 rounded-full bg-white left-0 top-0 absolute hover:shadow-lg;
77
- }
78
- .glorious-radio > div:last-child > div:first-child {
79
- @apply hidden;
80
- }
81
- .glorious-radio > div:last-child:after {
82
- @apply absolute hidden right-0 top-0 left-0 bottom-0 m-auto w-10 h-10 bg-white rounded-full;
83
- }
84
- .glorious-radio.orange > input:checked ~ div {
85
- @apply bg-orange-500;
86
- }
87
- .glorious-radio.blue > input:checked ~ div {
88
- @apply bg-blue-500;
89
- }
90
- .glorious-radio.gray > input:checked ~ div {
91
- @apply bg-gray-500;
92
- }
93
- .glorious-radio.red > input:checked ~ div {
94
- @apply bg-red-500;
95
- }
96
- .glorious-radio.green > input:checked ~ div {
97
- @apply bg-green-500;
98
- }
99
- .glorious-radio.size-5xl {
100
- @apply w-[46px] h-[46px];
101
- }
102
- .glorious-radio.size-5xl > div:last-child {
103
- @apply w-[46px] h-[46px];
104
- }
105
- .glorious-radio.size-5xl > input:checked ~ div:after {
106
- @apply w-[36px] h-[36px];
107
- }
108
- .glorious-radio.size-4xl {
109
- @apply w-[42px] h-[42px];
110
- }
111
- .glorious-radio.size-4xl > div:last-child {
112
- @apply w-[42px] h-[42px];
113
- }
114
- .glorious-radio.size-4xl > input:checked ~ div:after {
115
- @apply w-[32px] h-[32px];
116
- }
117
- .glorious-radio.size-3xl {
118
- @apply w-[38px] h-[38px];
119
- }
120
- .glorious-radio.size-3xl > div:last-child {
121
- @apply w-[38px] h-[38px];
122
- }
123
- .glorious-radio.size-3xl > input:checked ~ div:after {
124
- @apply w-[28px] h-[28px];
125
- }
126
- .glorious-radio.size-2xl {
127
- @apply w-[34px] h-[34px];
128
- }
129
- .glorious-radio.size-2xl > div:last-child {
130
- @apply w-[34px] h-[34px];
131
- }
132
- .glorious-radio.size-2xl > input:checked ~ div:after {
133
- @apply w-[24px] h-[24px];
134
- }
135
- .glorious-radio.size-xl {
136
- @apply w-[30px] h-[30px];
137
- }
138
- .glorious-radio.size-xl > div:last-child {
139
- @apply w-[30px] h-[30px];
140
- }
141
- .glorious-radio.size-xl > input:checked ~ div:after {
142
- @apply w-[20px] h-[20px];
143
- }
144
- .glorious-radio.size-lg {
145
- @apply w-[26px] h-[26px];
146
- }
147
- .glorious-radio.size-lg > div:last-child {
148
- @apply w-[26px] h-[26px];
149
- }
150
- .glorious-radio.size-lg > input:checked ~ div:after {
151
- @apply w-[16px] h-[16px];
152
- }
153
- .glorious-radio.size-md {
154
- @apply w-[22px] h-[22px];
155
- }
156
- .glorious-radio.size-md > div:last-child {
157
- @apply w-[22px] h-[22px];
158
- }
159
- .glorious-radio.size-md > input:checked ~ div:after {
160
- @apply w-[12px] h-[12px];
161
- }
162
- .glorious-radio.size-sm {
163
- @apply w-[18px] h-[18px];
164
- }
165
- .glorious-radio.size-sm > div:last-child {
166
- @apply w-[18px] h-[18px];
167
- }
168
- .glorious-radio.size-sm > input:checked ~ div:after {
169
- @apply w-[8px] h-[8px];
170
- }
171
- .glorious-radio.size-xs {
172
- @apply w-[14px] h-[14px];
173
- }
174
- .glorious-radio.size-xs > div:last-child {
175
- @apply w-[14px] h-[14px];
176
- }
177
- .glorious-radio.size-xs > input:checked ~ div:after {
178
- @apply w-[4px] h-[4px];
179
- }
180
- </style>
29
+ <style lang="scss" src="../../assets/style/components/radio.scss" />
@@ -1,8 +1,8 @@
1
1
  <script lang="ts" setup>
2
- const emits = defineEmits(['update:modelValue'])
2
+ const modelValue = defineModel()
3
3
  const computeModelValue = (event: Event) => {
4
4
  const target = event.target as HTMLInputElement
5
- emits('update:modelValue', target.value)
5
+ modelValue.value = target.value
6
6
  }
7
7
 
8
8
  const id = useId()
@@ -27,31 +27,4 @@ const value = [5, 4, 3, 2, 1]
27
27
  </div>
28
28
  </template>
29
29
 
30
- <style scoped>
31
- @charset "UTF-8";
32
- .rating {
33
- display: inline-block;
34
- }
35
-
36
- .rating input {
37
- display: none;
38
- }
39
-
40
- .rating label {
41
- float: right;
42
- cursor: pointer;
43
- transition: color 0.3s;
44
- }
45
-
46
- .rating label:before {
47
- content: "★";
48
- font-size: 30px;
49
- }
50
-
51
- .rating input:checked ~ label,
52
- .rating label:hover,
53
- .rating label:hover ~ label {
54
- color: #ffd700;
55
- transition: color 0.3s;
56
- }
57
- </style>
30
+ <style scoped lang="scss" src="../../assets/style/components/rating.scss" />
@@ -1,62 +1,14 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref, watch } from '#imports'
3
- interface selectOptionsInterface {
4
- text: string
5
- value: [string, object]
6
- }
7
- const props: any = defineProps({
8
- modelValue: {
9
- required: false,
10
- default: null,
11
- type: [String, Number],
12
- },
13
- options: {
14
- required: true,
15
- default: [],
16
- type: Array<selectOptionsInterface>,
17
- },
18
- color: {
19
- required: false,
20
- default: 'primary',
21
- type: String,
22
- },
23
- size: {
24
- required: false,
25
- default: 'md',
26
- type: String,
27
- },
28
- title: {
29
- required: false,
30
- default: '',
31
- type: String,
32
- },
33
- error: {
34
- required: false,
35
- default: '|',
36
- type: String,
37
- },
38
- disabled: {
39
- required: false,
40
- default: false,
41
- type: Boolean,
42
- },
43
- placeholder: {
44
- required: false,
45
- default: '',
46
- type: String,
47
- },
48
- displayTextKey: {
49
- required: false,
50
- default: 'text',
51
- type: String,
52
- },
53
- })
3
+ import _props from '../props/Select'
4
+
5
+ const props: any = defineProps(_props)
6
+ const modelValue = defineModel()
54
7
  const selectValue: any = ref(null)
55
- const emits = defineEmits(['update:modelValue'])
56
8
  watch(
57
9
  () => selectValue.value,
58
10
  () => {
59
- emits('update:modelValue', selectValue.value)
11
+ modelValue.value = selectValue.value
60
12
  }
61
13
  )
62
14
 
@@ -69,7 +21,7 @@ watch(
69
21
  }
70
22
  )
71
23
 
72
- emits('update:modelValue', null)
24
+ modelValue.value = null
73
25
  selectValue.value = null
74
26
  </script>
75
27
 
@@ -103,59 +55,4 @@ selectValue.value = null
103
55
  </div>
104
56
  </template>
105
57
 
106
- <style>
107
- .xl.glorious-select-orange, .xl.glorious-select-blue, .xl.glorious-select-gray, .xl.glorious-select-red, .xl.glorious-select-primary {
108
- @apply py-[0.657rem];
109
- }
110
- .lg.glorious-select-orange, .lg.glorious-select-blue, .lg.glorious-select-gray, .lg.glorious-select-red, .lg.glorious-select-primary {
111
- @apply py-[0.532rem];
112
- }
113
- .md.glorious-select-orange, .md.glorious-select-blue, .md.glorious-select-gray, .md.glorious-select-red, .md.glorious-select-primary {
114
- @apply py-[0.407rem];
115
- }
116
- .sm.glorious-select-orange, .sm.glorious-select-blue, .sm.glorious-select-gray, .sm.glorious-select-red, .sm.glorious-select-primary {
117
- @apply py-[0.282rem];
118
- }
119
- .xsm.glorious-select-orange, .xsm.glorious-select-blue, .xsm.glorious-select-gray, .xsm.glorious-select-red, .xsm.glorious-select-primary {
120
- @apply py-[0.157rem];
121
- }
122
-
123
- .glorious-select-orange:focus-visible, .glorious-select-blue:focus-visible, .glorious-select-gray:focus-visible, .glorious-select-red:focus-visible, .glorious-select-primary:focus-visible {
124
- @apply outline-none ring-2;
125
- }
126
-
127
- .glorious-select-primary {
128
- @apply rounded-md ring-1 ring-green-500 px-3 text-gray-500 text-[14px];
129
- }
130
- .glorious-select-primary:disabled {
131
- @apply cursor-not-allowed;
132
- }
133
-
134
- .glorious-select-red {
135
- @apply rounded-md ring-1 ring-red-500 px-3;
136
- }
137
- .glorious-select-red:disabled {
138
- @apply cursor-not-allowed;
139
- }
140
-
141
- .glorious-select-gray {
142
- @apply rounded-md ring-1 ring-gray-500 px-3;
143
- }
144
- .glorious-select-gray:disabled {
145
- @apply cursor-not-allowed;
146
- }
147
-
148
- .glorious-select-blue {
149
- @apply rounded-md ring-1 ring-blue-500 px-3;
150
- }
151
- .glorious-select-blue:disabled {
152
- @apply cursor-not-allowed;
153
- }
154
-
155
- .glorious-select-orange {
156
- @apply rounded-md ring-1 ring-orange-500 px-3;
157
- }
158
- .glorious-select-orange:disabled {
159
- @apply cursor-not-allowed;
160
- }
161
- </style>
58
+ <style lang="scss" src="../../assets/style/components/select.scss" />
@@ -1,26 +1,11 @@
1
1
  <script lang="ts" setup>
2
- const props = defineProps({
3
- modelValue: {
4
- required: false,
5
- default: true,
6
- type: Boolean,
7
- },
8
- checked: {
9
- required: false,
10
- default: false,
11
- type: Boolean,
12
- },
13
- color: {
14
- required: false,
15
- default: 'green',
16
- type: String as () => 'orange' | 'blue' | 'gray' | 'red' | 'green',
17
- },
18
- })
2
+ import _props from '../props/Switch'
19
3
 
20
- const emits = defineEmits(['update:modelValue'])
4
+ const props = defineProps(_props)
5
+ const modelValue = defineModel()
21
6
  const input = (e: Event) => {
22
7
  const target = e.target as HTMLInputElement
23
- emits('update:modelValue', target.checked)
8
+ modelValue.value = target.checked
24
9
  }
25
10
  </script>
26
11
 
@@ -40,66 +25,4 @@ const input = (e: Event) => {
40
25
  </div>
41
26
  </template>
42
27
 
43
- <style>
44
- .switch {
45
- direction: ltr;
46
- --button-width: 3em;
47
- --button-height: 1.5em;
48
- --toggle-diameter: 1em;
49
- --button-toggle-offset: calc(
50
- (var(--button-height) - var(--toggle-diameter)) / 2
51
- );
52
- --toggle-shadow-offset: 10px;
53
- --toggle-wider: 3em;
54
- }
55
- .switch-slider {
56
- @apply bg-gray-300;
57
- display: inline-block;
58
- width: var(--button-width);
59
- height: var(--button-height);
60
- border-radius: calc(var(--button-height) / 2);
61
- position: relative;
62
- transition: 0.3s all ease-in-out;
63
- }
64
- .switch-slider::after {
65
- content: "";
66
- display: inline-block;
67
- width: var(--toggle-diameter);
68
- height: var(--toggle-diameter);
69
- background-color: #fff;
70
- border-radius: calc(var(--toggle-diameter) / 2);
71
- position: absolute;
72
- top: var(--button-toggle-offset);
73
- transform: translateX(var(--button-toggle-offset));
74
- box-shadow: var(--toggle-shadow-offset) 0 calc(var(--toggle-shadow-offset) * 4) rgba(0, 0, 0, 0.1);
75
- transition: 0.3s all ease-in-out;
76
- }
77
- .switch.color-orange input[type=checkbox]:checked + .switch-slider {
78
- background-color: theme("colors.orange.500");
79
- }
80
- .switch.color-blue input[type=checkbox]:checked + .switch-slider {
81
- background-color: theme("colors.blue.500");
82
- }
83
- .switch.color-gray input[type=checkbox]:checked + .switch-slider {
84
- background-color: theme("colors.gray.500");
85
- }
86
- .switch.color-red input[type=checkbox]:checked + .switch-slider {
87
- background-color: theme("colors.red.500");
88
- }
89
- .switch.color-green input[type=checkbox]:checked + .switch-slider {
90
- background-color: theme("colors.green.500");
91
- }
92
- .switch input[type=checkbox]:checked + .switch-slider::after {
93
- transform: translateX(calc(var(--button-width) - var(--toggle-diameter) - var(--button-toggle-offset)));
94
- box-shadow: calc(var(--toggle-shadow-offset) * -1) 0 calc(var(--toggle-shadow-offset) * 4) rgba(0, 0, 0, 0.1);
95
- }
96
- .switch input[type=checkbox] {
97
- display: none;
98
- }
99
- .switch input[type=checkbox]:active + .switch-slider::after {
100
- width: var(--toggle-wider);
101
- }
102
- .switch input[type=checkbox]:checked:active + .switch-slider::after {
103
- transform: translateX(calc(var(--button-width) - var(--toggle-wider) - var(--button-toggle-offset)));
104
- }
105
- </style>
28
+ <style lang="scss" src="../../assets/style/components/switch.scss" />
@@ -1,23 +1,9 @@
1
1
  <script lang="ts" setup>
2
- interface itemsType {
3
- active: boolean
4
- text: string
5
- key: string
6
- }
7
- const props = defineProps({
8
- items: {
9
- required: true,
10
- default: [],
11
- type: Array<itemsType>,
12
- },
13
- modelValue: {
14
- required: true,
15
- type: String,
16
- },
17
- })
18
- const emits = defineEmits(['update:modelValue'])
2
+ import _props from '../props/Tab'
3
+ const props: any = defineProps(_props)
4
+ const modelValue = defineModel()
19
5
  const tabClicked: any = (key: string, event: any) => {
20
- emits('update:modelValue', key)
6
+ modelValue.value = key
21
7
  Array.from(event.currentTarget.parentElement.parentElement.children).map(
22
8
  (item: any) => item.children[0].classList.remove('active')
23
9
  )
@@ -65,7 +51,7 @@ const scrollPrevious = (event: Event) => {
65
51
  <div class="glorious-tab relative">
66
52
  <div
67
53
  @click="scrollNext($event)"
68
- class="bg-green-700 absolute right-0 h-full top-0 w-8 justify-center items-center rounded-r-lg hidden cursor-auto"
54
+ class="bg-green-700 absolute right-0 h-full top-0 w-8 justify-center items-center rounded-r-lg hidden cursor-pointer"
69
55
  >
70
56
  <GIcon
71
57
  name="glorious-arrow"
@@ -104,14 +90,4 @@ const scrollPrevious = (event: Event) => {
104
90
  </div>
105
91
  </template>
106
92
 
107
- <style>
108
- .glorious-tab {
109
- @apply flex justify-between bg-green-100 rounded-lg gap-3 w-max max-w-full shadow-md;
110
- }
111
- .glorious-tab div > div > button {
112
- @apply text-gray-700 text-[14px] hover:bg-green-200 hover:text-gray-800 cursor-pointer px-2 py-1 rounded-lg;
113
- }
114
- .glorious-tab div > div > button.active {
115
- @apply font-bold text-white bg-green-700;
116
- }
117
- </style>
93
+ <style lang="scss" src="../../assets/style/components/tab.scss" />
@@ -1,33 +1,6 @@
1
1
  <script lang="ts" setup>
2
- const props = defineProps({
3
- color: {
4
- required: false,
5
- default: 'blue',
6
- type: String as () => 'orange' | 'blue' | 'gray' | 'red' | 'green',
7
- },
8
- header: {
9
- required: true,
10
- type: Object,
11
- },
12
- body: {
13
- required: true,
14
- type: [Object, 'undefined'],
15
- },
16
- loading: {
17
- required: false,
18
- default: false,
19
- type: Boolean,
20
- },
21
- loadingOption: {
22
- required: false,
23
- default: {
24
- color: 'green',
25
- },
26
- type: {
27
- color: String,
28
- },
29
- },
30
- })
2
+ import _props from '../props/Table'
3
+ const props = defineProps(_props)
31
4
  </script>
32
5
 
33
6
  <template>
@@ -47,7 +20,7 @@ const props = defineProps({
47
20
  </th>
48
21
  </tr>
49
22
  </thead>
50
- <tbody v-if="!props.loading && props.body !== 'undefined'">
23
+ <tbody v-if="!props.loading">
51
24
  <tr
52
25
  v-for="(bodyItem, bodyIndex) in props.body"
53
26
  :key="bodyIndex"
@@ -75,107 +48,15 @@ const props = defineProps({
75
48
  >
76
49
  <GLoading :color="props.loadingOption.color" />
77
50
  </div>
51
+ <div
52
+ class="flex justify-center mt-3"
53
+ v-if="!props.loading && props.body.length === 0"
54
+ >
55
+ <div class="bg-white shadow p-2 rounded w-max">
56
+ <span> {{ props.emptyText }} </span>
57
+ </div>
58
+ </div>
78
59
  </div>
79
60
  </template>
80
61
 
81
- <style>
82
- .glorious-table {
83
- @apply overflow-x-auto;
84
- }
85
- .glorious-table.color-orange > table > thead {
86
- @apply rounded-t-md overflow-hidden;
87
- }
88
- .glorious-table.color-orange > table > thead > tr > th:first-child {
89
- @apply rounded-r-lg bg-orange-400;
90
- }
91
- .glorious-table.color-orange > table > thead > tr > th {
92
- @apply bg-orange-400;
93
- }
94
- .glorious-table.color-orange > table > thead > tr > th:last-child {
95
- @apply rounded-l-lg bg-orange-400;
96
- }
97
- .glorious-table.color-orange > table > tbody > tr:nth-child(even) {
98
- @apply bg-orange-50;
99
- }
100
- .glorious-table.color-orange > table > tbody > tr > td {
101
- @apply px-4 py-2 text-center;
102
- }
103
- .glorious-table.color-blue > table > thead {
104
- @apply rounded-t-md overflow-hidden;
105
- }
106
- .glorious-table.color-blue > table > thead > tr > th:first-child {
107
- @apply rounded-r-lg bg-blue-400;
108
- }
109
- .glorious-table.color-blue > table > thead > tr > th {
110
- @apply bg-blue-400;
111
- }
112
- .glorious-table.color-blue > table > thead > tr > th:last-child {
113
- @apply rounded-l-lg bg-blue-400;
114
- }
115
- .glorious-table.color-blue > table > tbody > tr:nth-child(even) {
116
- @apply bg-blue-50;
117
- }
118
- .glorious-table.color-blue > table > tbody > tr > td {
119
- @apply px-4 py-2 text-center;
120
- }
121
- .glorious-table.color-gray > table > thead {
122
- @apply rounded-t-md overflow-hidden;
123
- }
124
- .glorious-table.color-gray > table > thead > tr > th:first-child {
125
- @apply rounded-r-lg bg-gray-400;
126
- }
127
- .glorious-table.color-gray > table > thead > tr > th {
128
- @apply bg-gray-400;
129
- }
130
- .glorious-table.color-gray > table > thead > tr > th:last-child {
131
- @apply rounded-l-lg bg-gray-400;
132
- }
133
- .glorious-table.color-gray > table > tbody > tr:nth-child(even) {
134
- @apply bg-gray-50;
135
- }
136
- .glorious-table.color-gray > table > tbody > tr > td {
137
- @apply px-4 py-2 text-center;
138
- }
139
- .glorious-table.color-red > table > thead {
140
- @apply rounded-t-md overflow-hidden;
141
- }
142
- .glorious-table.color-red > table > thead > tr > th:first-child {
143
- @apply rounded-r-lg bg-red-400;
144
- }
145
- .glorious-table.color-red > table > thead > tr > th {
146
- @apply bg-red-400;
147
- }
148
- .glorious-table.color-red > table > thead > tr > th:last-child {
149
- @apply rounded-l-lg bg-red-400;
150
- }
151
- .glorious-table.color-red > table > tbody > tr:nth-child(even) {
152
- @apply bg-red-50;
153
- }
154
- .glorious-table.color-red > table > tbody > tr > td {
155
- @apply px-4 py-2 text-center;
156
- }
157
- .glorious-table.color-green > table > thead {
158
- @apply rounded-t-md overflow-hidden;
159
- }
160
- .glorious-table.color-green > table > thead > tr > th:first-child {
161
- @apply rounded-r-lg bg-green-400;
162
- }
163
- .glorious-table.color-green > table > thead > tr > th {
164
- @apply bg-green-400;
165
- }
166
- .glorious-table.color-green > table > thead > tr > th:last-child {
167
- @apply rounded-l-lg bg-green-400;
168
- }
169
- .glorious-table.color-green > table > tbody > tr:nth-child(even) {
170
- @apply bg-green-50;
171
- }
172
- .glorious-table.color-green > table > tbody > tr > td {
173
- @apply px-4 py-2 text-center;
174
- }
175
- .glorious-table > table {
176
- @apply w-full;
177
- }
178
- .glorious-table > table > thead > tr > th {
179
- @apply px-4 py-2 text-center;
180
- }
181
- </style>
62
+ <style lang="scss" src="../../assets/style/components/table.scss" />