@mythpe/quasar-ui-qui 0.3.71 → 0.3.73

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.3.71",
3
+ "version": "0.3.73",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -23,6 +23,7 @@ import MDtColorColumn from './MDtColorColumn.vue'
23
23
  import MDtSarColumn from './MDtSarColumn.vue'
24
24
  import MDtCopyColumn from './MDtCopyColumn.vue'
25
25
  import { useRouter } from 'vue-router'
26
+ import MDtContextmenuItems from './MDtContextmenuItems.vue'
26
27
 
27
28
  type Props = {
28
29
  controlKey?: MDatatableProps['controlKey'];
@@ -474,13 +475,33 @@ const mainAttrs = computed(() => ({
474
475
  wrapCells: wrapCellsRef.value
475
476
  }))
476
477
  const attrs = useAttrs()
477
- console.log(attrs)
478
478
  const bindAttr = computed(() => ({
479
479
  virtualScroll: !0,
480
480
  ...pluginOptions.value.datatable as any,
481
481
  ...attrs as any,
482
482
  ...mainAttrs.value as any
483
483
  }))
484
+ const showIfContext = (contextBtn: GenericMDtBtn): boolean => {
485
+ contextBtn = toValue(contextBtn)
486
+ if (selected.value.length === 0) {
487
+ const per = typeof contextBtn.showIf === 'function' ? contextBtn.showIf(selected.value[0], 0) : contextBtn.showIf === !0
488
+ const single = (!!contextBtn.click || !!contextBtn.attr?.to)
489
+ const multi = !!contextBtn.multiClick
490
+ return per && (single || multi)
491
+ }
492
+ if (!contextBtn.multiClick) {
493
+ return !1
494
+ }
495
+ // console.log(typeof contextBtn.showIf, contextBtn.name)
496
+ for (let idx = 0; idx < selected.value.length; idx++) {
497
+ const item = toValue(selected.value[idx])
498
+ const per = typeof contextBtn.showIf === 'function' ? contextBtn.showIf(item, idx) : contextBtn.showIf === !0
499
+ if (per) {
500
+ return !0
501
+ }
502
+ }
503
+ return !1
504
+ }
484
505
  defineOptions({
485
506
  name: 'MDatatable',
486
507
  inheritAttrs: !1
@@ -1151,8 +1172,7 @@ defineExpose({
1151
1172
  :key="`top-s-${i}`"
1152
1173
  >
1153
1174
  <MDtBtn
1154
- v-if="(typeof contextBtn.showIf === 'function' ? contextBtn.showIf(selected[0],0) : contextBtn.showIf !==!1) && ( ((!!contextBtn.click || !!contextBtn.attr?.to) && isSingleSelectedItem)
1155
- || (contextBtn.multiClick && !isSingleSelectedItem) )"
1175
+ v-if="showIfContext(contextBtn)"
1156
1176
  :tooltip="contextBtn.tooltip?__(contextBtn.tooltip):(contextBtn.label?(te(`labels.${contextBtn.label}`) ?
1157
1177
  __(`labels.${contextBtn.label}`) : __(contextBtn.label) ):undefined)"
1158
1178
  v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn as any,...contextBtn as any,...contextBtn.attr as any,to: typeof contextBtn.attr?.to === 'function' ? contextBtn.attr.to(selected[0],0) : contextBtn.attr?.to}"
@@ -233,21 +233,23 @@ defineOptions({
233
233
  >
234
234
  <MColumn :class="contentClass">
235
235
  <slot name="top" />
236
- <MTransitionGroup>
237
- <div
236
+ <MTransition
237
+ in="fadeIn"
238
+ out="fadeOut"
239
+ >
240
+ <MRow
238
241
  v-if="label !== undefined"
239
242
  key="label"
240
- class="row items-center"
243
+ class="items-center q-mb-md"
241
244
  >
242
245
  <q-skeleton
243
246
  v-if="loading"
244
- class="q-mb-md"
245
247
  height="22px"
246
248
  width="80px"
247
249
  />
248
250
  <div
249
251
  v-else
250
- :class="`text-h6 q-px-sm rounded-borders q-mb-sm ${!!errorMessage ? 'text-negative' : ''}`"
252
+ :class="`text-h6 q-px-sm rounded-borders ${!!errorMessage ? 'text-negative' : ''}`"
251
253
  >
252
254
  {{ label ? __(label) : label }}
253
255
  <span
@@ -260,20 +262,25 @@ defineOptions({
260
262
  :text="help"
261
263
  tooltip
262
264
  />
263
- </div>
264
- <slot name="hint">
265
- <div
266
- v-if="hint !== undefined && !loading"
267
- key="hint"
268
- class="m-input__hint"
269
- v-bind="hintProps"
270
- >
271
- <span>{{ hint ? __(hint) : hint }}</span>
272
- </div>
273
- </slot>
265
+ </MRow>
266
+ </MTransition>
267
+ <slot name="hint">
274
268
  <div
275
- key="avatar"
276
- :class="`rounded-borders q-mb-sm ${!!errorMessage ? 'q-pa-xs' : ''}`"
269
+ v-if="hint !== undefined && !loading"
270
+ key="hint"
271
+ class="m-input__hint q-mb-md"
272
+ v-bind="hintProps"
273
+ >
274
+ <span>{{ hint ? __(hint) : hint }}</span>
275
+ </div>
276
+ </slot>
277
+ <div
278
+ key="avatar"
279
+ :class="['rounded-borders q-mb-md',{'q-pa-xs': !!errorMessage}]"
280
+ >
281
+ <MTransition
282
+ in="fadeIn"
283
+ out="fadeOut"
277
284
  >
278
285
  <q-skeleton
279
286
  v-if="loading"
@@ -281,7 +288,7 @@ defineOptions({
281
288
  type="QAvatar"
282
289
  />
283
290
  <q-avatar
284
- v-if="!loading"
291
+ v-else-if="!loading"
285
292
  :color="errorMessage ? 'negative' : ((!isLoaded || !hasSrc || isFile || isFileNotImage) ? emptyColor : undefined)"
286
293
  :icon="isFileNotImage && !url ? 'o_description' : undefined"
287
294
  :rounded="rounded"
@@ -309,21 +316,29 @@ defineOptions({
309
316
  v-text="getAvatarText"
310
317
  />
311
318
  </q-avatar>
312
- </div>
319
+ </MTransition>
320
+ </div>
321
+ <MTransitionGroup
322
+ in="fadeIn"
323
+ out="fadeOut"
324
+ >
313
325
  <div
314
326
  v-if="!readonly"
315
327
  key="btn"
316
- class="q-mt-lg"
328
+ class="q-mb-md"
317
329
  >
318
- <q-skeleton
319
- v-if="loading"
320
- type="QBtn"
321
- />
322
- <MTransition>
330
+ <MTransition
331
+ in="fadeIn"
332
+ out="fadeOut"
333
+ >
334
+ <q-skeleton
335
+ v-if="loading"
336
+ type="QBtn"
337
+ />
323
338
  <div
324
- v-if="!loading && !!modelValue"
339
+ v-else-if="!loading && !!modelValue"
325
340
  key="uploaded-text"
326
- class="text-center q-mb-lg text-positive"
341
+ class="text-center q-mb-md text-positive"
327
342
  >
328
343
  <q-icon name="ion-checkmark" />
329
344
  {{ __('labels.uploaded') }}
@@ -347,18 +362,18 @@ defineOptions({
347
362
  >
348
363
  <span class="text-body2 text-negative">{{ errorMessage }}</span>
349
364
  </div>
350
- <div
351
- v-if="isFileNotImage && url"
352
- key="btn-download"
353
- class="q-mt-lg"
354
- >
355
- <MBtn
356
- icon="ion-cloud-download"
357
- label="labels.download"
358
- @click="openWindow(url)"
359
- />
360
- </div>
361
365
  </MTransitionGroup>
366
+ <div
367
+ v-if="isFileNotImage && url"
368
+ key="btn-download"
369
+ class="q-mb-md"
370
+ >
371
+ <MBtn
372
+ icon="ion-cloud-download"
373
+ label="labels.download"
374
+ @click="openWindow(url)"
375
+ />
376
+ </div>
362
377
  <slot name="caption">
363
378
  <div
364
379
  v-if="!!caption"