@usssa/component-library 1.0.0-alpha.168 → 1.0.0-alpha.169
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/README.md +1 -1
- package/package.json +1 -1
- package/src/components/core/UModal.vue +33 -13
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, onMounted, onUnmounted, ref, useSlots, watch } from 'vue'
|
|
3
|
-
import { useScreenType } from '../../composables/useScreenType'
|
|
4
3
|
import { useQuasar } from 'quasar'
|
|
4
|
+
import { useScreenType } from '../../composables/useScreenType'
|
|
5
5
|
import UBtnStd from './UBtnStd.vue'
|
|
6
6
|
|
|
7
7
|
const emit = defineEmits(['onBackIconClick', 'hideDialog'])
|
|
8
8
|
const model = defineModel()
|
|
9
9
|
const props = defineProps({
|
|
10
|
+
class: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: 'filter-dialog-modal',
|
|
13
|
+
},
|
|
10
14
|
closeIcon: String,
|
|
11
15
|
closeIconLabel: String,
|
|
12
16
|
customSize: {
|
|
@@ -16,6 +20,10 @@ const props = defineProps({
|
|
|
16
20
|
type: String,
|
|
17
21
|
default: 'modal',
|
|
18
22
|
},
|
|
23
|
+
dataTestIdCloseIcon: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: 'modal-close',
|
|
26
|
+
},
|
|
19
27
|
divider: Boolean,
|
|
20
28
|
heading: {
|
|
21
29
|
type: String,
|
|
@@ -54,6 +62,10 @@ const dialogStyle = computed(() => ({
|
|
|
54
62
|
const headerClass = computed(() => {
|
|
55
63
|
return props.divider ? 'divider' : ''
|
|
56
64
|
})
|
|
65
|
+
|
|
66
|
+
const className = computed(() => {
|
|
67
|
+
return props.class ? props.class: 'filter-dialog-modal'
|
|
68
|
+
})
|
|
57
69
|
const isDesktop = computed(() => $screen.value.isDesktop)
|
|
58
70
|
const isMobile = computed(() => $screen.value.isMobile)
|
|
59
71
|
const isSmallWidthDevices = computed(() => $q.screen.width < 400)
|
|
@@ -86,7 +98,7 @@ const getActionsWrapperFlex = () => {
|
|
|
86
98
|
}
|
|
87
99
|
}
|
|
88
100
|
if (isTablet.value) {
|
|
89
|
-
if (slotsLength.value >=
|
|
101
|
+
if (slotsLength.value >= 2) {
|
|
90
102
|
return 'nowrap'
|
|
91
103
|
} else {
|
|
92
104
|
return 'wrap'
|
|
@@ -120,7 +132,7 @@ const getDialogHeaderheight = () => {
|
|
|
120
132
|
if (dialogWrapper) {
|
|
121
133
|
dialogWrapper?.setAttribute(
|
|
122
134
|
'style',
|
|
123
|
-
`max-height: ${$q.screen.height - 50
|
|
135
|
+
`max-height: ${ !isTablet.value ? $q.screen.height - 50+ 'px !important' : ($q.screen.height/2)- 50+ 'px !important'}`
|
|
124
136
|
)
|
|
125
137
|
}
|
|
126
138
|
|
|
@@ -128,7 +140,7 @@ const getDialogHeaderheight = () => {
|
|
|
128
140
|
props.showActionButtons && props.showSecondaryButtons
|
|
129
141
|
? $q.screen.height - 80
|
|
130
142
|
: props.showActionButtons || props.showSecondaryButtons
|
|
131
|
-
? $q.screen.height - 50
|
|
143
|
+
? !isTablet.value ? $q.screen.height - 50+ 'px !important' : ($q.screen.height/2)- 50+ 'px !important'
|
|
132
144
|
: $q.screen.height - 10
|
|
133
145
|
|
|
134
146
|
dialogMaxHeight.value =
|
|
@@ -240,7 +252,7 @@ watch(
|
|
|
240
252
|
<q-dialog
|
|
241
253
|
v-bind="$attrs"
|
|
242
254
|
v-model="model"
|
|
243
|
-
:class="`filter-dialog-${isMobile ? 'full' : size} filter-dialog`"
|
|
255
|
+
:class="`filter-dialog-${isMobile ? 'full' : (isTablet ? 'tab' : size )} filter-dialog ${className}`"
|
|
244
256
|
:dataTestId="dataTestId"
|
|
245
257
|
full-width
|
|
246
258
|
no-backdrop-dismiss
|
|
@@ -252,7 +264,7 @@ watch(
|
|
|
252
264
|
:class="`dialog-wrapper${!isMobile ? ' full-height' : ''}`"
|
|
253
265
|
:style="{
|
|
254
266
|
height: isMobile ? currentDialogHeight + 'px !important' : 'auto',
|
|
255
|
-
overflow:
|
|
267
|
+
overflow: 'auto',
|
|
256
268
|
}"
|
|
257
269
|
>
|
|
258
270
|
<div
|
|
@@ -309,6 +321,7 @@ watch(
|
|
|
309
321
|
<UBtnStd
|
|
310
322
|
class="dialog-action-icons"
|
|
311
323
|
:aria-label="closeIconLabel"
|
|
324
|
+
:data-test-id="dataTestIdCloseIcon"
|
|
312
325
|
:flat="true"
|
|
313
326
|
tabindex="0"
|
|
314
327
|
@click="dialogRef.hide()"
|
|
@@ -328,10 +341,10 @@ watch(
|
|
|
328
341
|
|
|
329
342
|
<q-card-section
|
|
330
343
|
:class="[
|
|
331
|
-
`
|
|
344
|
+
` main-content-dialog scroll q-px-ba${
|
|
332
345
|
isMobile ? ' scrollable-content' : ''
|
|
333
|
-
|
|
334
|
-
{ mobile: isMobile, desktop: isDesktop
|
|
346
|
+
} `,
|
|
347
|
+
{ mobile: isMobile, desktop: isDesktop ,tablet: isTablet },
|
|
335
348
|
]"
|
|
336
349
|
:style="{
|
|
337
350
|
'margin-top': `${
|
|
@@ -339,7 +352,7 @@ watch(
|
|
|
339
352
|
}px`,
|
|
340
353
|
'margin-bottom': `${getContentBottomSpace()}rem !important`,
|
|
341
354
|
height:
|
|
342
|
-
isTablet || isDesktop
|
|
355
|
+
isTablet || isDesktop || isMobile
|
|
343
356
|
? 'auto'
|
|
344
357
|
: currentDialogHeight -
|
|
345
358
|
(scrollableMarginHeight +
|
|
@@ -429,7 +442,7 @@ watch(
|
|
|
429
442
|
</template>
|
|
430
443
|
|
|
431
444
|
<style lang="sass">
|
|
432
|
-
.filter-dialog-default, .filter-dialog-half
|
|
445
|
+
.filter-dialog-default, .filter-dialog-half, .filter-dialog-tab
|
|
433
446
|
.q-dialog__inner--left, .q-dialog__inner--right
|
|
434
447
|
.dialog-wrapper
|
|
435
448
|
max-height: 100vh !important
|
|
@@ -445,6 +458,12 @@ watch(
|
|
|
445
458
|
margin: auto
|
|
446
459
|
width: 50% !important
|
|
447
460
|
|
|
461
|
+
.filter-dialog-tab
|
|
462
|
+
.q-dialog__inner
|
|
463
|
+
padding: $ba 0
|
|
464
|
+
margin: auto
|
|
465
|
+
width: 75% !important
|
|
466
|
+
|
|
448
467
|
.filter-dialog-custom
|
|
449
468
|
.q-dialog__inner
|
|
450
469
|
padding: $ba 0
|
|
@@ -468,7 +487,7 @@ watch(
|
|
|
468
487
|
border-radius: 0 !important
|
|
469
488
|
.main-content-dialog
|
|
470
489
|
&.mobile
|
|
471
|
-
padding: $xs $ba
|
|
490
|
+
padding: 0 $ba $xs $ba
|
|
472
491
|
&.desktop
|
|
473
492
|
padding: $ms $ms
|
|
474
493
|
padding-bottom: 0
|
|
@@ -506,7 +525,8 @@ watch(
|
|
|
506
525
|
color: $dark
|
|
507
526
|
|
|
508
527
|
.heading-section
|
|
509
|
-
padding: $ba
|
|
528
|
+
padding: $ba $ms
|
|
529
|
+
flex-grow: 0 !important
|
|
510
530
|
|
|
511
531
|
.dialog-wrapper
|
|
512
532
|
border-radius: $xs !important
|