shared-ritm 1.2.65 → 1.2.66
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/dist/index.css +1 -1
- package/dist/shared-ritm.es.js +1381 -1371
- package/dist/shared-ritm.umd.js +7 -7
- package/dist/types/api/services/SearchService.d.ts +7 -0
- package/dist/types/api/settings/ApiService.d.ts +1 -0
- package/dist/types/api/types/Api_Search.d.ts +43 -0
- package/dist/types/api/types/Api_Users.d.ts +43 -0
- package/dist/types/index.d.ts +4 -2
- package/package.json +1 -1
- package/src/api/services/SearchService.ts +15 -0
- package/src/api/settings/ApiService.ts +1 -0
- package/src/api/types/Api_Controls.ts +72 -72
- package/src/api/types/Api_Search.ts +48 -0
- package/src/common/app-input/AppInput.vue +148 -148
- package/src/index.ts +92 -89
- package/src/main.ts +28 -28
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import ApiService, { ResponseApi } from '@/api/settings/ApiService';
|
|
2
|
+
import { Api_Search_User } from '@/api/types/Api_Search';
|
|
3
|
+
declare class SearchService extends ApiService {
|
|
4
|
+
fetchSearchUsers(params: any): Promise<ResponseApi<Api_Search_User>>;
|
|
5
|
+
}
|
|
6
|
+
export default function useSearchService(): SearchService;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type Api_Search_User_Passes = {
|
|
2
|
+
id: string;
|
|
3
|
+
type: string;
|
|
4
|
+
uuid: string;
|
|
5
|
+
};
|
|
6
|
+
export type Api_Search_User_Positions = {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
display_name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
export type Api_Search_User_Roles = {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
display_name: string;
|
|
16
|
+
};
|
|
17
|
+
export type Api_Search_User_Teams = {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
display_name: string;
|
|
21
|
+
roles: Api_Search_User_Roles[];
|
|
22
|
+
};
|
|
23
|
+
export type Api_Search_User_Photos = {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
path: string;
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
export type Api_Search_User = {
|
|
30
|
+
id: string;
|
|
31
|
+
full_name: string;
|
|
32
|
+
last_name: string;
|
|
33
|
+
first_name: string;
|
|
34
|
+
patronymic: string;
|
|
35
|
+
email: string;
|
|
36
|
+
phone: string;
|
|
37
|
+
divisions: string;
|
|
38
|
+
personnel_number: string;
|
|
39
|
+
passes: Api_Search_User_Passes[];
|
|
40
|
+
positions: Api_Search_User_Positions[];
|
|
41
|
+
teams: Api_Search_User_Teams[];
|
|
42
|
+
photos: Api_Search_User_Photos[];
|
|
43
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type Api_Search_User_Passes = {
|
|
2
|
+
id: string;
|
|
3
|
+
type: string;
|
|
4
|
+
uuid: string;
|
|
5
|
+
};
|
|
6
|
+
export type Api_Search_User_Positions = {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
display_name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
export type Api_Search_User_Roles = {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
display_name: string;
|
|
16
|
+
};
|
|
17
|
+
export type Api_Search_User_Teams = {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
display_name: string;
|
|
21
|
+
roles: Api_Search_User_Roles[];
|
|
22
|
+
};
|
|
23
|
+
export type Api_Search_User_Photos = {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
path: string;
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
export type Api_Search_User = {
|
|
30
|
+
id: string;
|
|
31
|
+
full_name: string;
|
|
32
|
+
last_name: string;
|
|
33
|
+
first_name: string;
|
|
34
|
+
patronymic: string;
|
|
35
|
+
email: string;
|
|
36
|
+
phone: string;
|
|
37
|
+
divisions: string;
|
|
38
|
+
personnel_number: string;
|
|
39
|
+
passes: Api_Search_User_Passes[];
|
|
40
|
+
positions: Api_Search_User_Positions[];
|
|
41
|
+
teams: Api_Search_User_Teams[];
|
|
42
|
+
photos: Api_Search_User_Photos[];
|
|
43
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ import AppTableModal from '@/common/app-table/components/TableModal.vue';
|
|
|
21
21
|
import AppTable from '@/common/app-table/AppTable.vue';
|
|
22
22
|
import AppTableLayout from '@/common/app-table/AppTableLayout.vue';
|
|
23
23
|
import AppModalSelect from '@/common/app-table/components/ModalSelect.vue';
|
|
24
|
+
import ApiService from '@/api/settings/ApiService';
|
|
24
25
|
import useGanttService from '@/api/services/GanttService';
|
|
25
26
|
import useMetricsService from '@/api/services/MetricsService';
|
|
26
27
|
import useProjectsService from '@/api/services/ProjectsService';
|
|
@@ -30,10 +31,10 @@ import useAuthService from '@/api/services/AuthService';
|
|
|
30
31
|
import useFileService from '@/api/services/FileService';
|
|
31
32
|
import useVideoService from '@/api/services/VideoService';
|
|
32
33
|
import useInstrumentsService from '@/api/services/InstrumentsService';
|
|
33
|
-
import ApiService from '@/api/settings/ApiService';
|
|
34
34
|
import useControlsService from '@/api/services/ControlsService';
|
|
35
|
+
import useSearchService from '@/api/services/SearchService';
|
|
35
36
|
export { AppButton, AppCheckbox, AppDatePicker, AppInput, AppInputSearch, AppLayout, AppLayoutHeader, AppLayoutPage, AppLoader, AppSelect, AppSheet, AppSidebar, AppToggle, AppWrapper, AppConfirmDialog, AppDropdown, AppTablePagination, AppTableSearch, AppTableModal, AppTable, AppTableLayout, AppModalSelect, };
|
|
36
|
-
export { ApiService, useAuthService, useGanttService, useMetricsService, useProjectsService, useRepairsService, useTasksService, useFileService, useControlsService, useVideoService, useInstrumentsService, };
|
|
37
|
+
export { ApiService, useAuthService, useGanttService, useMetricsService, useProjectsService, useRepairsService, useTasksService, useFileService, useControlsService, useVideoService, useInstrumentsService, useSearchService, };
|
|
37
38
|
export { useBaseTable } from './common/app-table/controllers/useBaseTable';
|
|
38
39
|
export { useTableModel } from './common/app-table/controllers/useTableModel';
|
|
39
40
|
export { useColumnSelector } from './common/app-table/controllers/useColumnSelector';
|
|
@@ -45,3 +46,4 @@ export * from './api/types/Api_Repairs';
|
|
|
45
46
|
export * from './api/types/Api_Projects';
|
|
46
47
|
export * from './api/types/Api_Controls';
|
|
47
48
|
export * from './api/types/Api_Instruments';
|
|
49
|
+
export * from './api/types/Api_Search';
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import ApiService, { ResponseApi } from '@/api/settings/ApiService'
|
|
2
|
+
import { Api_Search_User } from '@/api/types/Api_Search'
|
|
3
|
+
|
|
4
|
+
class SearchService extends ApiService {
|
|
5
|
+
public fetchSearchUsers(params: any): Promise<ResponseApi<Api_Search_User>> {
|
|
6
|
+
return this.get('search/users', { params })
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let api: SearchService
|
|
11
|
+
|
|
12
|
+
export default function useSearchService() {
|
|
13
|
+
if (!api) api = new SearchService()
|
|
14
|
+
return api
|
|
15
|
+
}
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
export type Api_User_Dto = {
|
|
2
|
-
id: string
|
|
3
|
-
full_name: string
|
|
4
|
-
}
|
|
5
|
-
export type Api_ControlZones_Dto = {
|
|
6
|
-
id: string
|
|
7
|
-
name: string
|
|
8
|
-
inventory_number: string
|
|
9
|
-
uuid: string
|
|
10
|
-
controller_zone: string
|
|
11
|
-
users?: Api_User_Dto[]
|
|
12
|
-
}
|
|
13
|
-
export type ControlsParams = {
|
|
14
|
-
search?: string
|
|
15
|
-
page?: number
|
|
16
|
-
filter?: Record<string, string[]>
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface ControlMeta {
|
|
20
|
-
total: number
|
|
21
|
-
perPage: number
|
|
22
|
-
totalPages: number
|
|
23
|
-
currentPage: number
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type FiltersValue = {
|
|
27
|
-
users?: {
|
|
28
|
-
users: Api_User_Dto[]
|
|
29
|
-
}
|
|
30
|
-
controller?: {
|
|
31
|
-
controller: Api_User_Dto[]
|
|
32
|
-
}
|
|
33
|
-
responsible?: {
|
|
34
|
-
responsible: Api_User_Dto[]
|
|
35
|
-
}
|
|
36
|
-
status?: {
|
|
37
|
-
status: boolean
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export type Api_Instrument_Dto = {
|
|
41
|
-
id: string
|
|
42
|
-
name: string
|
|
43
|
-
storage_id?: string
|
|
44
|
-
}
|
|
45
|
-
export type Api_Warehouse_Dto = {
|
|
46
|
-
id: string
|
|
47
|
-
invoice_ref_key: string
|
|
48
|
-
inventory_number: string
|
|
49
|
-
instrument: Api_Instrument_Dto[]
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export type Api_ControlLogs_Dto = {
|
|
53
|
-
id: string
|
|
54
|
-
automatically: string
|
|
55
|
-
in_zone: string
|
|
56
|
-
uuid: string
|
|
57
|
-
controller_zone: string
|
|
58
|
-
controller: Api_User_Dto[]
|
|
59
|
-
user: Api_User_Dto[]
|
|
60
|
-
frame: Api_ControlZones_Dto[]
|
|
61
|
-
warehouse: Api_Warehouse_Dto[]
|
|
62
|
-
}
|
|
63
|
-
export type Api_New_Items = {
|
|
64
|
-
title: string
|
|
65
|
-
inventory_numbers: string
|
|
66
|
-
storage_id: string
|
|
67
|
-
}
|
|
68
|
-
export type Api_ManualEntry_Dto = {
|
|
69
|
-
user: string
|
|
70
|
-
items?: string[]
|
|
71
|
-
new_items?: Api_New_Items[]
|
|
72
|
-
}
|
|
1
|
+
export type Api_User_Dto = {
|
|
2
|
+
id: string
|
|
3
|
+
full_name: string
|
|
4
|
+
}
|
|
5
|
+
export type Api_ControlZones_Dto = {
|
|
6
|
+
id: string
|
|
7
|
+
name: string
|
|
8
|
+
inventory_number: string
|
|
9
|
+
uuid: string
|
|
10
|
+
controller_zone: string
|
|
11
|
+
users?: Api_User_Dto[]
|
|
12
|
+
}
|
|
13
|
+
export type ControlsParams = {
|
|
14
|
+
search?: string
|
|
15
|
+
page?: number
|
|
16
|
+
filter?: Record<string, string[]>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ControlMeta {
|
|
20
|
+
total: number
|
|
21
|
+
perPage: number
|
|
22
|
+
totalPages: number
|
|
23
|
+
currentPage: number
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type FiltersValue = {
|
|
27
|
+
users?: {
|
|
28
|
+
users: Api_User_Dto[]
|
|
29
|
+
}
|
|
30
|
+
controller?: {
|
|
31
|
+
controller: Api_User_Dto[]
|
|
32
|
+
}
|
|
33
|
+
responsible?: {
|
|
34
|
+
responsible: Api_User_Dto[]
|
|
35
|
+
}
|
|
36
|
+
status?: {
|
|
37
|
+
status: boolean
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export type Api_Instrument_Dto = {
|
|
41
|
+
id: string
|
|
42
|
+
name: string
|
|
43
|
+
storage_id?: string
|
|
44
|
+
}
|
|
45
|
+
export type Api_Warehouse_Dto = {
|
|
46
|
+
id: string
|
|
47
|
+
invoice_ref_key: string
|
|
48
|
+
inventory_number: string
|
|
49
|
+
instrument: Api_Instrument_Dto[]
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type Api_ControlLogs_Dto = {
|
|
53
|
+
id: string
|
|
54
|
+
automatically: string
|
|
55
|
+
in_zone: string
|
|
56
|
+
uuid: string
|
|
57
|
+
controller_zone: string
|
|
58
|
+
controller: Api_User_Dto[]
|
|
59
|
+
user: Api_User_Dto[]
|
|
60
|
+
frame: Api_ControlZones_Dto[]
|
|
61
|
+
warehouse: Api_Warehouse_Dto[]
|
|
62
|
+
}
|
|
63
|
+
export type Api_New_Items = {
|
|
64
|
+
title: string
|
|
65
|
+
inventory_numbers: string
|
|
66
|
+
storage_id: string
|
|
67
|
+
}
|
|
68
|
+
export type Api_ManualEntry_Dto = {
|
|
69
|
+
user: string
|
|
70
|
+
items?: string[]
|
|
71
|
+
new_items?: Api_New_Items[]
|
|
72
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type Api_Search_User_Passes = {
|
|
2
|
+
id: string
|
|
3
|
+
type: string
|
|
4
|
+
uuid: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type Api_Search_User_Positions = {
|
|
8
|
+
id: string
|
|
9
|
+
name: string
|
|
10
|
+
display_name: string
|
|
11
|
+
description: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type Api_Search_User_Roles = {
|
|
15
|
+
id: string
|
|
16
|
+
name: string
|
|
17
|
+
display_name: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type Api_Search_User_Teams = {
|
|
21
|
+
id: string
|
|
22
|
+
name: string
|
|
23
|
+
display_name: string
|
|
24
|
+
roles: Api_Search_User_Roles[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type Api_Search_User_Photos = {
|
|
28
|
+
id: string
|
|
29
|
+
name: string
|
|
30
|
+
path: string
|
|
31
|
+
type: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type Api_Search_User = {
|
|
35
|
+
id: string
|
|
36
|
+
full_name: string
|
|
37
|
+
last_name: string
|
|
38
|
+
first_name: string
|
|
39
|
+
patronymic: string
|
|
40
|
+
email: string
|
|
41
|
+
phone: string
|
|
42
|
+
divisions: string
|
|
43
|
+
personnel_number: string
|
|
44
|
+
passes: Api_Search_User_Passes[]
|
|
45
|
+
positions: Api_Search_User_Positions[]
|
|
46
|
+
teams: Api_Search_User_Teams[]
|
|
47
|
+
photos: Api_Search_User_Photos[]
|
|
48
|
+
}
|
|
@@ -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>
|