shared-ritm 1.2.66 → 1.2.68
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 +103 -103
- package/dist/index.css +1 -1
- package/dist/shared-ritm.es.js +27926 -8480
- package/dist/shared-ritm.umd.js +3834 -7
- package/dist/types/api/services/PhotoService.d.ts +41 -0
- package/dist/types/api/services/UserService.d.ts +11 -0
- package/dist/types/api/settings/ApiService.d.ts +0 -1
- package/dist/types/api/types/Api_Instruments.d.ts +1 -35
- package/dist/types/api/types/Api_User.d.ts +42 -0
- package/dist/types/index.d.ts +6 -4
- package/dist/types/utils/helpers.d.ts +1 -0
- package/package.json +64 -63
- package/src/api/services/ControlsService.ts +65 -64
- package/src/api/services/FileService.ts +2 -1
- package/src/api/services/GanttService.ts +17 -17
- package/src/api/services/InstrumentsService.ts +22 -22
- package/src/api/services/MetricsService.ts +110 -109
- package/src/api/services/PhotoService.ts +137 -0
- package/src/api/services/ProjectsService.ts +68 -67
- package/src/api/services/RepairsService.ts +101 -100
- package/src/api/services/SearchService.ts +2 -1
- package/src/api/services/TasksService.ts +2 -1
- package/src/api/services/UserService.ts +19 -0
- package/src/api/services/VideoService.ts +14 -14
- package/src/api/settings/ApiService.ts +0 -10
- package/src/api/types/Api_Controls.ts +72 -72
- package/src/api/types/Api_Files.ts +1 -1
- package/src/api/types/Api_Instruments.ts +98 -133
- package/src/api/types/Api_Projects.ts +55 -55
- package/src/api/types/Api_Repairs.ts +93 -93
- package/src/api/types/Api_Service.ts +9 -0
- package/src/api/types/Api_Tasks.ts +155 -155
- package/src/api/types/Api_User.ts +44 -0
- package/src/common/app-checkbox/AppCheckbox.vue +26 -26
- package/src/common/app-dialogs/AppConfirmDialog.vue +99 -99
- package/src/common/app-dropdown/AppDropdown.vue +31 -31
- package/src/common/app-input/AppInput.vue +148 -148
- package/src/common/app-select/AppSelect.vue +157 -157
- package/src/common/app-sheet/AppSheet.vue +120 -120
- package/src/common/app-sidebar/components/SidebarMenuItem.vue +148 -148
- package/src/common/app-table/AppTable.vue +250 -250
- package/src/common/app-table/AppTableLayout.vue +111 -111
- package/src/common/app-table/components/ModalSelect.vue +264 -264
- package/src/common/app-table/components/TableModal.vue +329 -329
- package/src/common/app-table/components/TablePagination.vue +152 -152
- package/src/common/app-table/components/TableSearch.vue +76 -76
- package/src/common/app-table/controllers/useBaseTable.ts +42 -42
- package/src/common/app-table/controllers/useColumnSelector.ts +38 -38
- package/src/common/app-table/controllers/useTableModel.ts +93 -93
- package/src/common/app-toggle/AppToggle.vue +23 -23
- package/src/common/app-wrapper/AppWrapper.vue +28 -28
- package/src/icons/components/table-filter-icon.vue +30 -30
- package/src/icons/dialogs/RemoveIcon.vue +12 -12
- package/src/icons/dialogs/SafetyIcon.vue +12 -12
- package/src/icons/task/attention-icon.vue +13 -13
- package/src/icons/task/clock-icon.vue +10 -10
- package/src/icons/task/delete-icon.vue +10 -10
- package/src/icons/task/fire-icon.vue +16 -16
- package/src/index.ts +7 -0
- package/src/main.ts +28 -28
- package/src/shared/styles/general.css +125 -125
- package/src/styles/variables.sass +12 -12
- package/src/utils/confirm.ts +12 -12
- package/src/utils/helpers.ts +58 -39
- package/src/utils/notification.ts +9 -9
- package/dist/types/api/services/SearchService.d.ts +0 -7
- package/dist/types/api/types/Api_Search.d.ts +0 -43
- package/dist/types/api/types/Api_Users.d.ts +0 -43
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-checkbox v-model="value" :class="$style['app-checkbox']" />
|
|
3
|
-
</template>
|
|
4
|
-
<script setup lang="ts">
|
|
5
|
-
import { computed } from 'vue'
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
modelValue: any
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const props = defineProps<Props>()
|
|
12
|
-
const emit = defineEmits(['update:modelValue', 'number'])
|
|
13
|
-
|
|
14
|
-
const value = computed({
|
|
15
|
-
get: () => props.modelValue,
|
|
16
|
-
set: (newValue: any) => emit('update:modelValue', newValue),
|
|
17
|
-
})
|
|
18
|
-
</script>
|
|
19
|
-
<style module lang="scss">
|
|
20
|
-
.app-checkbox {
|
|
21
|
-
:global(.q-checkbox__bg) {
|
|
22
|
-
border-radius: 6px;
|
|
23
|
-
border-color: white;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<q-checkbox v-model="value" :class="$style['app-checkbox']" />
|
|
3
|
+
</template>
|
|
4
|
+
<script setup lang="ts">
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
modelValue: any
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = defineProps<Props>()
|
|
12
|
+
const emit = defineEmits(['update:modelValue', 'number'])
|
|
13
|
+
|
|
14
|
+
const value = computed({
|
|
15
|
+
get: () => props.modelValue,
|
|
16
|
+
set: (newValue: any) => emit('update:modelValue', newValue),
|
|
17
|
+
})
|
|
18
|
+
</script>
|
|
19
|
+
<style module lang="scss">
|
|
20
|
+
.app-checkbox {
|
|
21
|
+
:global(.q-checkbox__bg) {
|
|
22
|
+
border-radius: 6px;
|
|
23
|
+
border-color: white;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-dialog ref="dialogRef" persistent transition-show="slide-up" transition-hide="slide-down" :class="$style.dialog">
|
|
3
|
-
<q-card :class="$style.modal">
|
|
4
|
-
<q-card-section :class="$style['modal__content']">
|
|
5
|
-
<div :class="$style['modal__content__header']">
|
|
6
|
-
<safety-icon v-if="type === 'edit'" />
|
|
7
|
-
<remove-icon v-if="type === 'delete'" />
|
|
8
|
-
</div>
|
|
9
|
-
<p>{{ content }}</p>
|
|
10
|
-
</q-card-section>
|
|
11
|
-
<q-card-section :class="$style.footer">
|
|
12
|
-
<app-button :class="$style['footer__btn--ok']" label="Подтвердить" @click="onDialogOK" />
|
|
13
|
-
<app-button :class="$style['footer__btn--cancel']" label="Отменить" @click="onDialogHide" />
|
|
14
|
-
</q-card-section>
|
|
15
|
-
</q-card>
|
|
16
|
-
</q-dialog>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script setup lang="ts">
|
|
20
|
-
import { useDialogPluginComponent } from 'quasar'
|
|
21
|
-
import AppButton from '@/common/app-button/AppButton.vue'
|
|
22
|
-
import SafetyIcon from '@/icons/dialogs/SafetyIcon.vue'
|
|
23
|
-
import RemoveIcon from '@/icons/dialogs/RemoveIcon.vue'
|
|
24
|
-
|
|
25
|
-
const { onDialogHide, onDialogOK, dialogRef } = useDialogPluginComponent()
|
|
26
|
-
|
|
27
|
-
interface Props {
|
|
28
|
-
content: string
|
|
29
|
-
type: 'delete' | 'edit'
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const props = defineProps<Props>()
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<style lang="scss" module>
|
|
36
|
-
.modal {
|
|
37
|
-
font-family: NunitoSansFont, sans-serif;
|
|
38
|
-
display: flex;
|
|
39
|
-
flex-direction: column;
|
|
40
|
-
width: 400px;
|
|
41
|
-
border-radius: 8px !important;
|
|
42
|
-
justify-content: space-between;
|
|
43
|
-
&__content {
|
|
44
|
-
margin: 0 auto;
|
|
45
|
-
padding: 0;
|
|
46
|
-
flex-grow: 1;
|
|
47
|
-
&__header {
|
|
48
|
-
width: 100%;
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
justify-content: center;
|
|
52
|
-
flex-direction: column;
|
|
53
|
-
gap: 16px;
|
|
54
|
-
padding-top: 18px;
|
|
55
|
-
h4 {
|
|
56
|
-
font-size: 24px;
|
|
57
|
-
font-weight: 600;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
p {
|
|
62
|
-
margin: 0;
|
|
63
|
-
font-size: 16px;
|
|
64
|
-
text-align: center;
|
|
65
|
-
padding: 18px;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.footer {
|
|
70
|
-
display: flex;
|
|
71
|
-
gap: 12px;
|
|
72
|
-
align-items: center;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
border-radius: 0px 0px 2px 2px;
|
|
75
|
-
background: #F4F9FD;
|
|
76
|
-
padding: 18px 12px;
|
|
77
|
-
&__btn--ok,
|
|
78
|
-
&__btn--cancel {
|
|
79
|
-
background-color: #3f8cff;
|
|
80
|
-
border-radius: 4px;
|
|
81
|
-
color: white;
|
|
82
|
-
font-size: 16px;
|
|
83
|
-
font-weight: bold;
|
|
84
|
-
width: 165px;
|
|
85
|
-
height: 48px;
|
|
86
|
-
cursor: pointer;
|
|
87
|
-
span {
|
|
88
|
-
color: white;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
&__btn--cancel {
|
|
92
|
-
background-color: white;
|
|
93
|
-
border: 1px solid #3f8cff;
|
|
94
|
-
span {
|
|
95
|
-
color: #3f8cff;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<q-dialog ref="dialogRef" persistent transition-show="slide-up" transition-hide="slide-down" :class="$style.dialog">
|
|
3
|
+
<q-card :class="$style.modal">
|
|
4
|
+
<q-card-section :class="$style['modal__content']">
|
|
5
|
+
<div :class="$style['modal__content__header']">
|
|
6
|
+
<safety-icon v-if="type === 'edit'" />
|
|
7
|
+
<remove-icon v-if="type === 'delete'" />
|
|
8
|
+
</div>
|
|
9
|
+
<p>{{ content }}</p>
|
|
10
|
+
</q-card-section>
|
|
11
|
+
<q-card-section :class="$style.footer">
|
|
12
|
+
<app-button :class="$style['footer__btn--ok']" label="Подтвердить" @click="onDialogOK" />
|
|
13
|
+
<app-button :class="$style['footer__btn--cancel']" label="Отменить" @click="onDialogHide" />
|
|
14
|
+
</q-card-section>
|
|
15
|
+
</q-card>
|
|
16
|
+
</q-dialog>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { useDialogPluginComponent } from 'quasar'
|
|
21
|
+
import AppButton from '@/common/app-button/AppButton.vue'
|
|
22
|
+
import SafetyIcon from '@/icons/dialogs/SafetyIcon.vue'
|
|
23
|
+
import RemoveIcon from '@/icons/dialogs/RemoveIcon.vue'
|
|
24
|
+
|
|
25
|
+
const { onDialogHide, onDialogOK, dialogRef } = useDialogPluginComponent()
|
|
26
|
+
|
|
27
|
+
interface Props {
|
|
28
|
+
content: string
|
|
29
|
+
type: 'delete' | 'edit'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const props = defineProps<Props>()
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<style lang="scss" module>
|
|
36
|
+
.modal {
|
|
37
|
+
font-family: NunitoSansFont, sans-serif;
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
width: 400px;
|
|
41
|
+
border-radius: 8px !important;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
&__content {
|
|
44
|
+
margin: 0 auto;
|
|
45
|
+
padding: 0;
|
|
46
|
+
flex-grow: 1;
|
|
47
|
+
&__header {
|
|
48
|
+
width: 100%;
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
gap: 16px;
|
|
54
|
+
padding-top: 18px;
|
|
55
|
+
h4 {
|
|
56
|
+
font-size: 24px;
|
|
57
|
+
font-weight: 600;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
p {
|
|
62
|
+
margin: 0;
|
|
63
|
+
font-size: 16px;
|
|
64
|
+
text-align: center;
|
|
65
|
+
padding: 18px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.footer {
|
|
70
|
+
display: flex;
|
|
71
|
+
gap: 12px;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
border-radius: 0px 0px 2px 2px;
|
|
75
|
+
background: #F4F9FD;
|
|
76
|
+
padding: 18px 12px;
|
|
77
|
+
&__btn--ok,
|
|
78
|
+
&__btn--cancel {
|
|
79
|
+
background-color: #3f8cff;
|
|
80
|
+
border-radius: 4px;
|
|
81
|
+
color: white;
|
|
82
|
+
font-size: 16px;
|
|
83
|
+
font-weight: bold;
|
|
84
|
+
width: 165px;
|
|
85
|
+
height: 48px;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
span {
|
|
88
|
+
color: white;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
&__btn--cancel {
|
|
92
|
+
background-color: white;
|
|
93
|
+
border: 1px solid #3f8cff;
|
|
94
|
+
span {
|
|
95
|
+
color: #3f8cff;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</style>
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-btn-dropdown :color="color" :content-style="{ width: width || '200px', minWidth: height || '200px' }">
|
|
3
|
-
<template #label>
|
|
4
|
-
<slot name="label">
|
|
5
|
-
{{ label }}
|
|
6
|
-
</slot>
|
|
7
|
-
</template>
|
|
8
|
-
<template #default>
|
|
9
|
-
<slot name="content" />
|
|
10
|
-
</template>
|
|
11
|
-
</q-btn-dropdown>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
interface Props {
|
|
16
|
-
label?: string
|
|
17
|
-
color?: string
|
|
18
|
-
width?: number
|
|
19
|
-
height?: number
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const props = defineProps<Props>()
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<style scoped lang="scss">
|
|
26
|
-
.q-btn {
|
|
27
|
-
&:before {
|
|
28
|
-
box-shadow: none;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<q-btn-dropdown :color="color" :content-style="{ width: width || '200px', minWidth: height || '200px' }">
|
|
3
|
+
<template #label>
|
|
4
|
+
<slot name="label">
|
|
5
|
+
{{ label }}
|
|
6
|
+
</slot>
|
|
7
|
+
</template>
|
|
8
|
+
<template #default>
|
|
9
|
+
<slot name="content" />
|
|
10
|
+
</template>
|
|
11
|
+
</q-btn-dropdown>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
interface Props {
|
|
16
|
+
label?: string
|
|
17
|
+
color?: string
|
|
18
|
+
width?: number
|
|
19
|
+
height?: number
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const props = defineProps<Props>()
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<style scoped lang="scss">
|
|
26
|
+
.q-btn {
|
|
27
|
+
&:before {
|
|
28
|
+
box-shadow: none;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-input
|
|
3
|
-
v-model="value"
|
|
4
|
-
:class="[inputClasses, $style['app-input']]"
|
|
5
|
-
standout
|
|
6
|
-
outlined
|
|
7
|
-
dense
|
|
8
|
-
:rules="rules"
|
|
9
|
-
:type="inputType"
|
|
10
|
-
autocomplete="h87h58g7h8hd"
|
|
11
|
-
:readonly="readonly || field"
|
|
12
|
-
:disable="disabled"
|
|
13
|
-
:placeholder="placeholder"
|
|
14
|
-
>
|
|
15
|
-
</q-input>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script lang="ts" setup>
|
|
19
|
-
import { defineProps, defineEmits, computed, ref, withDefaults } from 'vue'
|
|
20
|
-
|
|
21
|
-
interface AppQInputProps {
|
|
22
|
-
name?: string | undefined
|
|
23
|
-
mask?: string | undefined
|
|
24
|
-
fillMask?: boolean | string | undefined
|
|
25
|
-
reverseFillMask?: boolean | undefined
|
|
26
|
-
unmaskedValue?: boolean | undefined
|
|
27
|
-
modelValue: string | number | null | undefined
|
|
28
|
-
error?: boolean | undefined
|
|
29
|
-
errorMessage?: string | undefined
|
|
30
|
-
noErrorIcon?: boolean | undefined
|
|
31
|
-
rules?: any | undefined
|
|
32
|
-
reactiveRules?: boolean | undefined
|
|
33
|
-
lazyRules?: boolean | 'ondemand' | undefined
|
|
34
|
-
label?: string | undefined
|
|
35
|
-
stackLabel?: boolean | undefined
|
|
36
|
-
hint?: string | undefined
|
|
37
|
-
hideHint?: boolean | undefined
|
|
38
|
-
prefix?: string | undefined
|
|
39
|
-
suffix?: string | undefined
|
|
40
|
-
labelColor?: string | undefined
|
|
41
|
-
color?: string | undefined
|
|
42
|
-
bgColor?: string | undefined
|
|
43
|
-
dark?: boolean | undefined
|
|
44
|
-
loading?: boolean | undefined
|
|
45
|
-
clearable?: boolean | undefined
|
|
46
|
-
clearIcon?: string | undefined
|
|
47
|
-
filled?: boolean | undefined
|
|
48
|
-
outlined?: boolean | undefined
|
|
49
|
-
borderless?: boolean | undefined
|
|
50
|
-
standout?: boolean | string | undefined
|
|
51
|
-
labelSlot?: boolean | undefined
|
|
52
|
-
bottomSlots?: boolean | undefined
|
|
53
|
-
hideBottomSpace?: boolean | undefined
|
|
54
|
-
counter?: boolean | undefined
|
|
55
|
-
rounded?: boolean | undefined
|
|
56
|
-
square?: boolean | undefined
|
|
57
|
-
dense?: boolean | undefined
|
|
58
|
-
itemAligned?: boolean | undefined
|
|
59
|
-
disable?: boolean | undefined
|
|
60
|
-
readonly?: boolean | undefined
|
|
61
|
-
autofocus?: boolean | undefined
|
|
62
|
-
for?: string | undefined
|
|
63
|
-
shadowText?: string | undefined
|
|
64
|
-
type?:
|
|
65
|
-
| 'text'
|
|
66
|
-
| 'password'
|
|
67
|
-
| 'textarea'
|
|
68
|
-
| 'email'
|
|
69
|
-
| 'search'
|
|
70
|
-
| 'tel'
|
|
71
|
-
| 'file'
|
|
72
|
-
| 'number'
|
|
73
|
-
| 'url'
|
|
74
|
-
| 'time'
|
|
75
|
-
| 'date'
|
|
76
|
-
| undefined
|
|
77
|
-
debounce?: string | number | undefined
|
|
78
|
-
disabled?: boolean | undefined
|
|
79
|
-
maxlength?: string | number | undefined
|
|
80
|
-
autogrow?: boolean | undefined
|
|
81
|
-
inputClass?: any | undefined
|
|
82
|
-
inputStyle?: any | undefined
|
|
83
|
-
onClear?: (value: any) => void
|
|
84
|
-
'onUpdate:modelValue'?: (value: string | number | null) => void
|
|
85
|
-
onFocus?: (evt: Event) => void
|
|
86
|
-
onBlur?: (evt: Event) => void
|
|
87
|
-
onClick?: (evt: Event) => void
|
|
88
|
-
placeholder?: string | undefined
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
interface AppInputProps extends AppQInputProps {
|
|
92
|
-
field?: boolean
|
|
93
|
-
required?: boolean
|
|
94
|
-
datePicker?: boolean
|
|
95
|
-
timePicker?: boolean
|
|
96
|
-
withIcon?: boolean
|
|
97
|
-
withButton?: boolean
|
|
98
|
-
withArrow?: boolean
|
|
99
|
-
borderColor?: string
|
|
100
|
-
borderRadius?: string
|
|
101
|
-
borderWidth?: string
|
|
102
|
-
width?: string
|
|
103
|
-
height?: string
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const props = withDefaults(defineProps<AppInputProps>(), {
|
|
107
|
-
dense: true,
|
|
108
|
-
outlined: true,
|
|
109
|
-
error: undefined,
|
|
110
|
-
modelValue: '',
|
|
111
|
-
borderRadius: '8px',
|
|
112
|
-
borderWidth: '1px',
|
|
113
|
-
width: 'auto',
|
|
114
|
-
height: 'auto',
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
const emit = defineEmits(['update:modelValue', 'button-click', 'clear', 'focus', 'blur', 'click'])
|
|
118
|
-
const passwordVisibility = ref(false)
|
|
119
|
-
const inputType = computed(() => {
|
|
120
|
-
if (props.type === 'password') return passwordVisibility.value ? 'text' : 'password'
|
|
121
|
-
return props.type || 'text'
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
const value = computed({
|
|
125
|
-
get: () =>
|
|
126
|
-
props.modelValue !== null && props.modelValue !== undefined && props.type === 'number'
|
|
127
|
-
? +props.modelValue
|
|
128
|
-
: props.modelValue,
|
|
129
|
-
set: (newValue: any) => emit('update:modelValue', props.type === 'number' ? +newValue : newValue),
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
const inputClasses = computed(() => {
|
|
133
|
-
return {
|
|
134
|
-
'app-input': true,
|
|
135
|
-
'--required': props.required,
|
|
136
|
-
'--field': props.field,
|
|
137
|
-
'input-number-without-arrow': inputType.value === 'number' && !props.withArrow,
|
|
138
|
-
}
|
|
139
|
-
})
|
|
140
|
-
</script>
|
|
141
|
-
|
|
142
|
-
<style module lang="scss">
|
|
143
|
-
.app-input {
|
|
144
|
-
&:global(.q-field--dense .q-field__control) {
|
|
145
|
-
height: v-bind(height);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<q-input
|
|
3
|
+
v-model="value"
|
|
4
|
+
:class="[inputClasses, $style['app-input']]"
|
|
5
|
+
standout
|
|
6
|
+
outlined
|
|
7
|
+
dense
|
|
8
|
+
:rules="rules"
|
|
9
|
+
:type="inputType"
|
|
10
|
+
autocomplete="h87h58g7h8hd"
|
|
11
|
+
:readonly="readonly || field"
|
|
12
|
+
:disable="disabled"
|
|
13
|
+
:placeholder="placeholder"
|
|
14
|
+
>
|
|
15
|
+
</q-input>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { defineProps, defineEmits, computed, ref, withDefaults } from 'vue'
|
|
20
|
+
|
|
21
|
+
interface AppQInputProps {
|
|
22
|
+
name?: string | undefined
|
|
23
|
+
mask?: string | undefined
|
|
24
|
+
fillMask?: boolean | string | undefined
|
|
25
|
+
reverseFillMask?: boolean | undefined
|
|
26
|
+
unmaskedValue?: boolean | undefined
|
|
27
|
+
modelValue: string | number | null | undefined
|
|
28
|
+
error?: boolean | undefined
|
|
29
|
+
errorMessage?: string | undefined
|
|
30
|
+
noErrorIcon?: boolean | undefined
|
|
31
|
+
rules?: any | undefined
|
|
32
|
+
reactiveRules?: boolean | undefined
|
|
33
|
+
lazyRules?: boolean | 'ondemand' | undefined
|
|
34
|
+
label?: string | undefined
|
|
35
|
+
stackLabel?: boolean | undefined
|
|
36
|
+
hint?: string | undefined
|
|
37
|
+
hideHint?: boolean | undefined
|
|
38
|
+
prefix?: string | undefined
|
|
39
|
+
suffix?: string | undefined
|
|
40
|
+
labelColor?: string | undefined
|
|
41
|
+
color?: string | undefined
|
|
42
|
+
bgColor?: string | undefined
|
|
43
|
+
dark?: boolean | undefined
|
|
44
|
+
loading?: boolean | undefined
|
|
45
|
+
clearable?: boolean | undefined
|
|
46
|
+
clearIcon?: string | undefined
|
|
47
|
+
filled?: boolean | undefined
|
|
48
|
+
outlined?: boolean | undefined
|
|
49
|
+
borderless?: boolean | undefined
|
|
50
|
+
standout?: boolean | string | undefined
|
|
51
|
+
labelSlot?: boolean | undefined
|
|
52
|
+
bottomSlots?: boolean | undefined
|
|
53
|
+
hideBottomSpace?: boolean | undefined
|
|
54
|
+
counter?: boolean | undefined
|
|
55
|
+
rounded?: boolean | undefined
|
|
56
|
+
square?: boolean | undefined
|
|
57
|
+
dense?: boolean | undefined
|
|
58
|
+
itemAligned?: boolean | undefined
|
|
59
|
+
disable?: boolean | undefined
|
|
60
|
+
readonly?: boolean | undefined
|
|
61
|
+
autofocus?: boolean | undefined
|
|
62
|
+
for?: string | undefined
|
|
63
|
+
shadowText?: string | undefined
|
|
64
|
+
type?:
|
|
65
|
+
| 'text'
|
|
66
|
+
| 'password'
|
|
67
|
+
| 'textarea'
|
|
68
|
+
| 'email'
|
|
69
|
+
| 'search'
|
|
70
|
+
| 'tel'
|
|
71
|
+
| 'file'
|
|
72
|
+
| 'number'
|
|
73
|
+
| 'url'
|
|
74
|
+
| 'time'
|
|
75
|
+
| 'date'
|
|
76
|
+
| undefined
|
|
77
|
+
debounce?: string | number | undefined
|
|
78
|
+
disabled?: boolean | undefined
|
|
79
|
+
maxlength?: string | number | undefined
|
|
80
|
+
autogrow?: boolean | undefined
|
|
81
|
+
inputClass?: any | undefined
|
|
82
|
+
inputStyle?: any | undefined
|
|
83
|
+
onClear?: (value: any) => void
|
|
84
|
+
'onUpdate:modelValue'?: (value: string | number | null) => void
|
|
85
|
+
onFocus?: (evt: Event) => void
|
|
86
|
+
onBlur?: (evt: Event) => void
|
|
87
|
+
onClick?: (evt: Event) => void
|
|
88
|
+
placeholder?: string | undefined
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
interface AppInputProps extends AppQInputProps {
|
|
92
|
+
field?: boolean
|
|
93
|
+
required?: boolean
|
|
94
|
+
datePicker?: boolean
|
|
95
|
+
timePicker?: boolean
|
|
96
|
+
withIcon?: boolean
|
|
97
|
+
withButton?: boolean
|
|
98
|
+
withArrow?: boolean
|
|
99
|
+
borderColor?: string
|
|
100
|
+
borderRadius?: string
|
|
101
|
+
borderWidth?: string
|
|
102
|
+
width?: string
|
|
103
|
+
height?: string
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const props = withDefaults(defineProps<AppInputProps>(), {
|
|
107
|
+
dense: true,
|
|
108
|
+
outlined: true,
|
|
109
|
+
error: undefined,
|
|
110
|
+
modelValue: '',
|
|
111
|
+
borderRadius: '8px',
|
|
112
|
+
borderWidth: '1px',
|
|
113
|
+
width: 'auto',
|
|
114
|
+
height: 'auto',
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
const emit = defineEmits(['update:modelValue', 'button-click', 'clear', 'focus', 'blur', 'click'])
|
|
118
|
+
const passwordVisibility = ref(false)
|
|
119
|
+
const inputType = computed(() => {
|
|
120
|
+
if (props.type === 'password') return passwordVisibility.value ? 'text' : 'password'
|
|
121
|
+
return props.type || 'text'
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
const value = computed({
|
|
125
|
+
get: () =>
|
|
126
|
+
props.modelValue !== null && props.modelValue !== undefined && props.type === 'number'
|
|
127
|
+
? +props.modelValue
|
|
128
|
+
: props.modelValue,
|
|
129
|
+
set: (newValue: any) => emit('update:modelValue', props.type === 'number' ? +newValue : newValue),
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
const inputClasses = computed(() => {
|
|
133
|
+
return {
|
|
134
|
+
'app-input': true,
|
|
135
|
+
'--required': props.required,
|
|
136
|
+
'--field': props.field,
|
|
137
|
+
'input-number-without-arrow': inputType.value === 'number' && !props.withArrow,
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
<style module lang="scss">
|
|
143
|
+
.app-input {
|
|
144
|
+
&:global(.q-field--dense .q-field__control) {
|
|
145
|
+
height: v-bind(height);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
</style>
|