@mythpe/quasar-ui-qui 0.0.82 → 0.0.84

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mythpe/quasar-ui-qui",
3
- "version": "0.0.82",
3
+ "version": "0.0.84",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -10,7 +10,7 @@
10
10
  lang="ts"
11
11
  setup
12
12
  >
13
- import type { ButtonLoadingOptions, MBtnProps } from '../../types'
13
+ import type { MBtnProps } from '../../types'
14
14
  import { computed } from 'vue'
15
15
  import { useBindInput, useMyth } from '../../composable'
16
16
 
@@ -41,9 +41,9 @@ const getAriaLabel = computed<string | undefined>(() => {
41
41
  })
42
42
  const hasLabel = computed<boolean>(() => !!getLabel.value)
43
43
 
44
- const loadingOptions = computed(() => theme.value.buttonLoading as ButtonLoadingOptions)
45
- const loadingSize = computed<string | undefined>(() => loadingOptions.value.size)
46
- const loadingColor = computed<string | undefined>(() => loadingOptions.value.color)
44
+ const loadingOptions = computed(() => theme.value.buttonLoading)
45
+ const loadingSize = computed<string | undefined>(() => loadingOptions.value ? loadingOptions.value.size : undefined)
46
+ const loadingColor = computed<string | undefined>(() => loadingOptions.value ? loadingOptions.value.color : undefined)
47
47
 
48
48
  defineOptions({
49
49
  name: 'MBtn',
@@ -59,163 +59,178 @@ defineOptions({
59
59
  ariaLabel: getAriaLabel,
60
60
  ...$attrs,
61
61
  loading,
62
- label: loading && getLabel ? `${getLabel} ...` : getLabel,
62
+ label2: loading && getLabel && loadingOptions ? `${getLabel} ...` : getLabel,
63
+ label: getLabel,
63
64
  }"
64
65
  >
65
- <template #loading>
66
- <slot name="loading">
66
+ <template
67
+ v-if="!!$slots.loading"
68
+ #loading
69
+ >
70
+ <slot name="loading" />
71
+ </template>
72
+ <template
73
+ v-else-if="loadingOptions"
74
+ #loading
75
+ >
76
+ <slot
77
+ v-if="loadingOptions"
78
+ name="loading"
79
+ >
67
80
  <q-spinner-audio
68
81
  v-if="loadingOptions.type === 'audio'"
69
- :class="{'on-left': hasLabel}"
82
+ :class="{'on-left2': hasLabel}"
70
83
  :color="loadingColor"
71
84
  :size="loadingSize"
72
85
  />
73
86
  <q-spinner-ball
74
87
  v-if="loadingOptions.type === 'ball'"
75
- :class="{'on-left': hasLabel}"
88
+ :class="{'on-left2': hasLabel}"
76
89
  :color="loadingColor"
77
90
  :size="loadingSize"
78
91
  />
79
92
  <q-spinner-bars
80
93
  v-if="loadingOptions.type === 'bars'"
81
- :class="{'on-left': hasLabel}"
94
+ :class="{'on-left2': hasLabel}"
82
95
  :color="loadingColor"
83
96
  :size="loadingSize"
84
97
  />
85
98
  <q-spinner-box
86
99
  v-if="loadingOptions.type === 'box'"
87
- :class="{'on-left': hasLabel}"
100
+ :class="{'on-left2': hasLabel}"
88
101
  :color="loadingColor"
89
102
  :size="loadingSize"
90
103
  />
91
104
  <q-spinner-clock
92
105
  v-if="loadingOptions.type === 'clock'"
93
- :class="{'on-left': hasLabel}"
106
+ :class="{'on-left2': hasLabel}"
94
107
  :color="loadingColor"
95
108
  :size="loadingSize"
96
109
  />
97
110
  <q-spinner-comment
98
111
  v-if="loadingOptions.type === 'comment'"
99
- :class="{'on-left': hasLabel}"
112
+ :class="{'on-left2': hasLabel}"
100
113
  :color="loadingColor"
101
114
  :size="loadingSize"
102
115
  />
103
116
  <q-spinner-cube
104
117
  v-if="loadingOptions.type === 'cube'"
105
- :class="{'on-left': hasLabel}"
118
+ :class="{'on-left2': hasLabel}"
106
119
  :color="loadingColor"
107
120
  :size="loadingSize"
108
121
  />
109
122
  <q-spinner-dots
110
123
  v-if="loadingOptions.type === 'dots'"
111
- :class="{'on-left': hasLabel}"
124
+ :class="{'on-left2': hasLabel}"
112
125
  :color="loadingColor"
113
126
  :size="loadingSize"
114
127
  />
115
128
  <q-spinner-facebook
116
129
  v-if="loadingOptions.type === 'facebook'"
117
- :class="{'on-left': hasLabel}"
130
+ :class="{'on-left2': hasLabel}"
118
131
  :color="loadingColor"
119
132
  :size="loadingSize"
120
133
  />
121
134
  <q-spinner-gears
122
135
  v-if="loadingOptions.type === 'gears'"
123
- :class="{'on-left': hasLabel}"
136
+ :class="{'on-left2': hasLabel}"
124
137
  :color="loadingColor"
125
138
  :size="loadingSize"
126
139
  />
127
140
  <q-spinner-grid
128
141
  v-if="loadingOptions.type === 'grid'"
129
- :class="{'on-left': hasLabel}"
142
+ :class="{'on-left2': hasLabel}"
130
143
  :color="loadingColor"
131
144
  :size="loadingSize"
132
145
  />
133
146
  <q-spinner-hearts
134
147
  v-if="loadingOptions.type === 'hearts'"
135
- :class="{'on-left': hasLabel}"
148
+ :class="{'on-left2': hasLabel}"
136
149
  :color="loadingColor"
137
150
  :size="loadingSize"
138
151
  />
139
152
  <q-spinner-hearts
140
153
  v-if="loadingOptions.type === 'hearts'"
141
- :class="{'on-left': hasLabel}"
154
+ :class="{'on-left2': hasLabel}"
142
155
  :color="loadingColor"
143
156
  :size="loadingSize"
144
157
  />
145
158
  <q-spinner-hourglass
146
159
  v-if="loadingOptions.type === 'hourglass'"
147
- :class="{'on-left': hasLabel}"
160
+ :class="{'on-left2': hasLabel}"
148
161
  :color="loadingColor"
149
162
  :size="loadingSize"
150
163
  />
151
164
  <q-spinner-infinity
152
165
  v-if="loadingOptions.type === 'infinity'"
153
- :class="{'on-left': hasLabel}"
166
+ :class="{'on-left2': hasLabel}"
154
167
  :color="loadingColor"
155
168
  :size="loadingSize"
156
169
  />
157
170
  <q-spinner-ios
158
171
  v-if="loadingOptions.type === 'ios'"
159
- :class="{'on-left': hasLabel}"
172
+ :class="{'on-left2': hasLabel}"
160
173
  :color="loadingColor"
161
174
  :size="loadingSize"
162
175
  />
163
176
  <q-spinner-orbit
164
177
  v-if="loadingOptions.type === 'orbit'"
165
- :class="{'on-left': hasLabel}"
178
+ :class="{'on-left2': hasLabel}"
166
179
  :color="loadingColor"
167
180
  :size="loadingSize"
168
181
  />
169
182
  <q-spinner-oval
170
183
  v-if="loadingOptions.type === 'oval'"
171
- :class="{'on-left': hasLabel}"
184
+ :class="{'on-left2': hasLabel}"
172
185
  :color="loadingColor"
173
186
  :size="loadingSize"
174
187
  />
175
188
  <q-spinner-pie
176
189
  v-if="loadingOptions.type === 'pie'"
177
- :class="{'on-left': hasLabel}"
190
+ :class="{'on-left2': hasLabel}"
178
191
  :color="loadingColor"
179
192
  :size="loadingSize"
180
193
  />
181
194
  <q-spinner-puff
182
195
  v-if="loadingOptions.type === 'puff'"
183
- :class="{'on-left': hasLabel}"
196
+ :class="{'on-left2': hasLabel}"
184
197
  :color="loadingColor"
185
198
  :size="loadingSize"
186
199
  />
187
200
  <q-spinner-radio
188
201
  v-if="loadingOptions.type === 'radio'"
189
- :class="{'on-left': hasLabel}"
202
+ :class="{'on-left2': hasLabel}"
190
203
  :color="loadingColor"
191
204
  :size="loadingSize"
192
205
  />
193
206
  <q-spinner-rings
194
207
  v-if="loadingOptions.type === 'rings'"
195
- :class="{'on-left': hasLabel}"
208
+ :class="{'on-left2': hasLabel}"
196
209
  :color="loadingColor"
197
210
  :size="loadingSize"
198
211
  />
199
212
  <q-spinner-tail
200
213
  v-if="loadingOptions.type === 'tail'"
201
- :class="{'on-left': hasLabel}"
214
+ :class="{'on-left2': hasLabel}"
202
215
  :color="loadingColor"
203
216
  :size="loadingSize"
204
217
  />
205
218
  <q-spinner
206
219
  v-if="loadingOptions.type === 'spinner'"
207
- :class="{'on-left': hasLabel}"
220
+ :class="{'on-left2': hasLabel}"
208
221
  :color="loadingColor"
209
222
  :size="loadingSize"
210
223
  />
211
- <template v-if="loadingOptions.noLabel !== !1 && getLabel">
212
- <span>{{ getLabel }}</span>
213
- </template>
224
+ <!--<template v-if="loadingOptions.label === !0 && getLabel">-->
225
+ <!-- <span>{{ getLabel }}</span>-->
226
+ <!--</template>-->
214
227
  </slot>
215
228
  </template>
216
-
217
- <template #default>
218
- <slot name="default" />
229
+ <template
230
+ v-if="!!$slots.default"
231
+ #default
232
+ >
233
+ <slot />
219
234
  </template>
220
235
  </q-btn>
221
236
  </template>
@@ -53,7 +53,7 @@ export type ButtonLoadingOptions = {
53
53
  type: 'audio' | 'ball' | 'bars' | 'box' | 'clock' | 'comment' | 'cube' | 'dots' | 'facebook' | 'gears' | 'grid' | 'hearts' | 'hourglass' | 'infinity' | 'ios' | 'orbit' | 'oval' | 'pie' | 'puff' | 'radio' | 'rings' | 'tail' | 'spinner';
54
54
  color?: string | undefined;
55
55
  size?: string | undefined;
56
- noLabel?: boolean;
56
+ label?: boolean;
57
57
  }
58
58
 
59
59
  export interface ThemeContext {
@@ -24,6 +24,7 @@ export const createMyth = (options: InstallOptions) => {
24
24
  },
25
25
  buttonLoading: {
26
26
  type: 'spinner',
27
+ label: !1,
27
28
  color: undefined,
28
29
  size: undefined
29
30
  } as MythApi['theme']['buttonLoading']