@mythpe/quasar-ui-qui 0.0.81 → 0.0.83

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.81",
3
+ "version": "0.0.83",
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',
@@ -52,6 +52,11 @@ defineOptions({
52
52
  </script>
53
53
 
54
54
  <template>
55
+ <div>
56
+ <div>
57
+ <pre>{{ loadingOptions }}</pre>
58
+ </div>
59
+ </div>
55
60
  <q-btn
56
61
  v-bind="{
57
62
  ...btnTheme,
@@ -59,163 +64,178 @@ defineOptions({
59
64
  ariaLabel: getAriaLabel,
60
65
  ...$attrs,
61
66
  loading,
62
- label: loading && getLabel ? `${getLabel} ...` : getLabel,
67
+ label2: loading && getLabel && loadingOptions ? `${getLabel} ...` : getLabel,
68
+ label: getLabel,
63
69
  }"
64
70
  >
65
- <template #loading>
66
- <slot name="loading">
71
+ <template
72
+ v-if="!!$slots.loading"
73
+ #loading
74
+ >
75
+ <slot name="loading" />
76
+ </template>
77
+ <template
78
+ v-else-if="loadingOptions"
79
+ #loading
80
+ >
81
+ <slot
82
+ v-if="loadingOptions"
83
+ name="loading"
84
+ >
67
85
  <q-spinner-audio
68
86
  v-if="loadingOptions.type === 'audio'"
69
- :class="{'on-left': hasLabel}"
87
+ :class="{'on-left2': hasLabel}"
70
88
  :color="loadingColor"
71
89
  :size="loadingSize"
72
90
  />
73
91
  <q-spinner-ball
74
92
  v-if="loadingOptions.type === 'ball'"
75
- :class="{'on-left': hasLabel}"
93
+ :class="{'on-left2': hasLabel}"
76
94
  :color="loadingColor"
77
95
  :size="loadingSize"
78
96
  />
79
97
  <q-spinner-bars
80
98
  v-if="loadingOptions.type === 'bars'"
81
- :class="{'on-left': hasLabel}"
99
+ :class="{'on-left2': hasLabel}"
82
100
  :color="loadingColor"
83
101
  :size="loadingSize"
84
102
  />
85
103
  <q-spinner-box
86
104
  v-if="loadingOptions.type === 'box'"
87
- :class="{'on-left': hasLabel}"
105
+ :class="{'on-left2': hasLabel}"
88
106
  :color="loadingColor"
89
107
  :size="loadingSize"
90
108
  />
91
109
  <q-spinner-clock
92
110
  v-if="loadingOptions.type === 'clock'"
93
- :class="{'on-left': hasLabel}"
111
+ :class="{'on-left2': hasLabel}"
94
112
  :color="loadingColor"
95
113
  :size="loadingSize"
96
114
  />
97
115
  <q-spinner-comment
98
116
  v-if="loadingOptions.type === 'comment'"
99
- :class="{'on-left': hasLabel}"
117
+ :class="{'on-left2': hasLabel}"
100
118
  :color="loadingColor"
101
119
  :size="loadingSize"
102
120
  />
103
121
  <q-spinner-cube
104
122
  v-if="loadingOptions.type === 'cube'"
105
- :class="{'on-left': hasLabel}"
123
+ :class="{'on-left2': hasLabel}"
106
124
  :color="loadingColor"
107
125
  :size="loadingSize"
108
126
  />
109
127
  <q-spinner-dots
110
128
  v-if="loadingOptions.type === 'dots'"
111
- :class="{'on-left': hasLabel}"
129
+ :class="{'on-left2': hasLabel}"
112
130
  :color="loadingColor"
113
131
  :size="loadingSize"
114
132
  />
115
133
  <q-spinner-facebook
116
134
  v-if="loadingOptions.type === 'facebook'"
117
- :class="{'on-left': hasLabel}"
135
+ :class="{'on-left2': hasLabel}"
118
136
  :color="loadingColor"
119
137
  :size="loadingSize"
120
138
  />
121
139
  <q-spinner-gears
122
140
  v-if="loadingOptions.type === 'gears'"
123
- :class="{'on-left': hasLabel}"
141
+ :class="{'on-left2': hasLabel}"
124
142
  :color="loadingColor"
125
143
  :size="loadingSize"
126
144
  />
127
145
  <q-spinner-grid
128
146
  v-if="loadingOptions.type === 'grid'"
129
- :class="{'on-left': hasLabel}"
147
+ :class="{'on-left2': hasLabel}"
130
148
  :color="loadingColor"
131
149
  :size="loadingSize"
132
150
  />
133
151
  <q-spinner-hearts
134
152
  v-if="loadingOptions.type === 'hearts'"
135
- :class="{'on-left': hasLabel}"
153
+ :class="{'on-left2': hasLabel}"
136
154
  :color="loadingColor"
137
155
  :size="loadingSize"
138
156
  />
139
157
  <q-spinner-hearts
140
158
  v-if="loadingOptions.type === 'hearts'"
141
- :class="{'on-left': hasLabel}"
159
+ :class="{'on-left2': hasLabel}"
142
160
  :color="loadingColor"
143
161
  :size="loadingSize"
144
162
  />
145
163
  <q-spinner-hourglass
146
164
  v-if="loadingOptions.type === 'hourglass'"
147
- :class="{'on-left': hasLabel}"
165
+ :class="{'on-left2': hasLabel}"
148
166
  :color="loadingColor"
149
167
  :size="loadingSize"
150
168
  />
151
169
  <q-spinner-infinity
152
170
  v-if="loadingOptions.type === 'infinity'"
153
- :class="{'on-left': hasLabel}"
171
+ :class="{'on-left2': hasLabel}"
154
172
  :color="loadingColor"
155
173
  :size="loadingSize"
156
174
  />
157
175
  <q-spinner-ios
158
176
  v-if="loadingOptions.type === 'ios'"
159
- :class="{'on-left': hasLabel}"
177
+ :class="{'on-left2': hasLabel}"
160
178
  :color="loadingColor"
161
179
  :size="loadingSize"
162
180
  />
163
181
  <q-spinner-orbit
164
182
  v-if="loadingOptions.type === 'orbit'"
165
- :class="{'on-left': hasLabel}"
183
+ :class="{'on-left2': hasLabel}"
166
184
  :color="loadingColor"
167
185
  :size="loadingSize"
168
186
  />
169
187
  <q-spinner-oval
170
188
  v-if="loadingOptions.type === 'oval'"
171
- :class="{'on-left': hasLabel}"
189
+ :class="{'on-left2': hasLabel}"
172
190
  :color="loadingColor"
173
191
  :size="loadingSize"
174
192
  />
175
193
  <q-spinner-pie
176
194
  v-if="loadingOptions.type === 'pie'"
177
- :class="{'on-left': hasLabel}"
195
+ :class="{'on-left2': hasLabel}"
178
196
  :color="loadingColor"
179
197
  :size="loadingSize"
180
198
  />
181
199
  <q-spinner-puff
182
200
  v-if="loadingOptions.type === 'puff'"
183
- :class="{'on-left': hasLabel}"
201
+ :class="{'on-left2': hasLabel}"
184
202
  :color="loadingColor"
185
203
  :size="loadingSize"
186
204
  />
187
205
  <q-spinner-radio
188
206
  v-if="loadingOptions.type === 'radio'"
189
- :class="{'on-left': hasLabel}"
207
+ :class="{'on-left2': hasLabel}"
190
208
  :color="loadingColor"
191
209
  :size="loadingSize"
192
210
  />
193
211
  <q-spinner-rings
194
212
  v-if="loadingOptions.type === 'rings'"
195
- :class="{'on-left': hasLabel}"
213
+ :class="{'on-left2': hasLabel}"
196
214
  :color="loadingColor"
197
215
  :size="loadingSize"
198
216
  />
199
217
  <q-spinner-tail
200
218
  v-if="loadingOptions.type === 'tail'"
201
- :class="{'on-left': hasLabel}"
219
+ :class="{'on-left2': hasLabel}"
202
220
  :color="loadingColor"
203
221
  :size="loadingSize"
204
222
  />
205
223
  <q-spinner
206
224
  v-if="loadingOptions.type === 'spinner'"
207
- :class="{'on-left': hasLabel}"
225
+ :class="{'on-left2': hasLabel}"
208
226
  :color="loadingColor"
209
227
  :size="loadingSize"
210
228
  />
211
- <template v-if="loadingOptions.noLabel !== !1 && getLabel">
212
- <span>{{ getLabel }}</span>
213
- </template>
229
+ <!--<template v-if="loadingOptions.label === !0 && getLabel">-->
230
+ <!-- <span>{{ getLabel }}</span>-->
231
+ <!--</template>-->
214
232
  </slot>
215
233
  </template>
216
-
217
- <template #default>
218
- <slot name="default" />
234
+ <template
235
+ v-if="!!$slots.default"
236
+ #default
237
+ >
238
+ <slot />
219
239
  </template>
220
240
  </q-btn>
221
241
  </template>
@@ -104,7 +104,7 @@ const deleteMedia = (media: MUploaderMediaItem) => {
104
104
  confirmMessage().onOk(() => {
105
105
  const model = modelValue.value as MUploaderMediaItem
106
106
  let r = !1
107
- const method = (typeof props.service === 'string' ? api[props.service] : props.service) as MUploaderServiceType
107
+ const method = (typeof props.service === 'string' ? api.value[props.service] : props.service) as MUploaderServiceType
108
108
  if (method) {
109
109
  deleting.value = !0
110
110
  q.loading.show()
@@ -131,7 +131,7 @@ const deleteUploaderFile = (file: File) => {
131
131
  }
132
132
  const onUpdateField = (data: any) => {
133
133
  const model = modelValue.value as MUploaderMediaItem
134
- const method = (typeof props.service === 'string' ? api[props.service] : props.service) as MUploaderServiceType
134
+ const method = (typeof props.service === 'string' ? api.value[props.service] : props.service) as MUploaderServiceType
135
135
  if (method) {
136
136
  deleting.value = !0
137
137
  q.loading.show()
@@ -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']