shared-ritm 1.3.14 → 1.3.15
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 +4291 -4257
- package/dist/shared-ritm.umd.js +154 -154
- package/dist/types/api/services/PhotoService.d.ts +40 -0
- package/dist/types/api/services/RepairsService.d.ts +1 -1
- package/dist/types/api/settings/ApiService.d.ts +1 -1
- package/package.json +65 -65
- package/src/App.vue +2461 -2461
- package/src/api/services/AuthService.ts +53 -53
- package/src/api/services/BrigadesService.ts +32 -32
- package/src/api/services/CommentsService.ts +24 -24
- package/src/api/services/ControlsService.ts +96 -96
- package/src/api/services/EquipmentService.ts +29 -29
- package/src/api/services/FileService.ts +17 -17
- package/src/api/services/GanttService.ts +17 -17
- package/src/api/services/InstrumentsService.ts +68 -68
- package/src/api/services/MetricsService.ts +110 -110
- package/src/api/services/ModulesService.ts +27 -27
- package/src/api/services/ProjectsService.ts +83 -83
- package/src/api/services/RepairsService.ts +124 -124
- package/src/api/services/ScheduleService.ts +69 -69
- package/src/api/services/SearchService.ts +22 -22
- package/src/api/services/TasksService.ts +150 -150
- package/src/api/services/UserService.ts +119 -119
- package/src/api/services/VideoService.ts +108 -108
- package/src/api/settings/ApiService.ts +124 -124
- package/src/api/types/Api_Auth.ts +105 -105
- package/src/api/types/Api_Brigades.ts +36 -36
- package/src/api/types/Api_Comment.ts +40 -40
- package/src/api/types/Api_Controls.ts +111 -111
- package/src/api/types/Api_Equipment.ts +3 -3
- package/src/api/types/Api_Files.ts +7 -7
- package/src/api/types/Api_Instruments.ts +156 -156
- package/src/api/types/Api_Modules.ts +21 -21
- package/src/api/types/Api_Projects.ts +62 -62
- package/src/api/types/Api_Repairs.ts +140 -140
- package/src/api/types/Api_Schedule.ts +64 -64
- package/src/api/types/Api_Search.ts +80 -80
- package/src/api/types/Api_Service.ts +9 -9
- package/src/api/types/Api_Tasks.ts +371 -371
- package/src/api/types/Api_User.ts +146 -146
- package/src/api/types/Api_Video.ts +198 -198
- package/src/common/app-button/AppButton.vue +173 -173
- package/src/common/app-checkbox/AppCheckbox.vue +26 -26
- package/src/common/app-date-picker/AppDatePicker.vue +81 -81
- package/src/common/app-datepicker/AppDatepicker.vue +218 -218
- package/src/common/app-dialogs/AppConfirmDialog.vue +99 -99
- package/src/common/app-dropdown/AppDropdown.vue +37 -37
- package/src/common/app-file/AppFile.vue +80 -80
- package/src/common/app-icon/AppIcon.vue +108 -108
- package/src/common/app-input/AppInput.vue +148 -148
- package/src/common/app-input-new/AppInputNew.vue +179 -179
- package/src/common/app-input-search/AppInputSearch.vue +174 -174
- package/src/common/app-layout/AppLayout.vue +84 -84
- package/src/common/app-layout/components/AppLayoutHeader.vue +273 -273
- package/src/common/app-layout/components/AppLayoutPage.vue +16 -16
- package/src/common/app-loader/index.vue +43 -43
- package/src/common/app-modal/index.vue +96 -96
- package/src/common/app-page-layout/AppPageLayout.vue +122 -122
- package/src/common/app-select/AppSelect.vue +157 -157
- package/src/common/app-sheet/AppSheet.vue +120 -120
- package/src/common/app-sheet-new/AppSheetNew.vue +244 -244
- package/src/common/app-sidebar/AppSidebar.vue +174 -168
- package/src/common/app-sidebar/components/SidebarMenu.vue +37 -37
- package/src/common/app-sidebar/components/SidebarMenuItem.vue +149 -149
- package/src/common/app-table/AppTable.vue +308 -308
- package/src/common/app-table/AppTableLayout.vue +137 -137
- package/src/common/app-table/components/ModalSelect.vue +294 -294
- package/src/common/app-table/components/TableModal.vue +356 -356
- 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 +45 -45
- package/src/common/app-table/controllers/useColumnSelector.ts +38 -38
- package/src/common/app-table/controllers/useTableModel.ts +102 -102
- package/src/common/app-toggle/AppToggle.vue +24 -24
- package/src/common/app-wrapper/AppWrapper.vue +28 -28
- package/src/global.d.ts +1 -1
- package/src/icons/components/arrow-down-icon.vue +25 -25
- package/src/icons/components/arrow-frame-icon.vue +19 -19
- package/src/icons/components/arrow-square.vue +22 -22
- 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/header/NotificationIcon.vue +18 -18
- package/src/icons/header/PersonIcon.vue +11 -11
- package/src/icons/header/SettingIcon.vue +14 -14
- package/src/icons/header/flashIcon.vue +24 -24
- package/src/icons/header/searchStatusIcon.vue +24 -24
- package/src/icons/header/smallCapsIcon.vue +34 -34
- package/src/icons/sidebar/assign-module-icon.vue +36 -36
- package/src/icons/sidebar/instrument-history-icon.vue +32 -32
- package/src/icons/sidebar/instrument-order-icon.vue +38 -38
- package/src/icons/sidebar/instrument-work-zone-icon.vue +18 -18
- package/src/icons/sidebar/instruments-icon.vue +45 -45
- package/src/icons/sidebar/logo-icon.vue +15 -15
- package/src/icons/sidebar/logout-icon.vue +13 -13
- package/src/icons/sidebar/modules-icon.vue +16 -16
- package/src/icons/sidebar/notifications-icon.vue +24 -24
- package/src/icons/sidebar/order-icon.vue +44 -44
- package/src/icons/sidebar/pass-icon.vue +38 -38
- package/src/icons/sidebar/positions-icon.vue +42 -42
- package/src/icons/sidebar/preorder-icon.vue +19 -19
- package/src/icons/sidebar/projects-icon.vue +31 -31
- package/src/icons/sidebar/repair-object-icon.vue +18 -18
- package/src/icons/sidebar/repairs-icon.vue +20 -20
- package/src/icons/sidebar/roles-icon.vue +26 -26
- package/src/icons/sidebar/status-history-icon.vue +24 -24
- package/src/icons/sidebar/tasks-icon.vue +28 -28
- package/src/icons/sidebar/tasks_tasks-icon.vue +39 -39
- package/src/icons/sidebar/tasks_today-icon.vue +27 -27
- package/src/icons/sidebar/teams-icon.vue +32 -32
- package/src/icons/sidebar/user-icon.vue +18 -18
- package/src/icons/sidebar/users-icon.vue +46 -46
- package/src/icons/sidebar/videosources-icon.vue +19 -19
- package/src/icons/sidebar/videowall-icon.vue +13 -13
- package/src/icons/sidebar/videozones-icon.vue +21 -21
- package/src/icons/sidebar/warehouses-icon.vue +43 -43
- package/src/icons/sidebar/workshop-icon.vue +100 -100
- package/src/icons/sidebar/workzones-icon.vue +22 -22
- 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 +131 -131
- package/src/main.ts +28 -28
- package/src/quasar-user-options.ts +17 -17
- package/src/router/index.ts +10 -10
- package/src/shared/styles/general.css +124 -124
- package/src/shims-vue.d.ts +5 -5
- package/src/styles/variables.sass +12 -12
- package/src/utils/confirm.ts +12 -12
- package/src/utils/faceApiHelper.ts +132 -132
- package/src/utils/files.ts +19 -19
- package/src/utils/helpers.ts +59 -59
- package/src/utils/notification.ts +9 -9
|
@@ -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>
|
|
@@ -1,179 +1,179 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="app-input-new">
|
|
3
|
-
<label v-if="label" class="app-input-new__label">
|
|
4
|
-
{{ label }}
|
|
5
|
-
<span v-if="required" class="required">*</span>
|
|
6
|
-
</label>
|
|
7
|
-
|
|
8
|
-
<q-input
|
|
9
|
-
v-model="model"
|
|
10
|
-
filled
|
|
11
|
-
:type="inputType"
|
|
12
|
-
:rules="rules"
|
|
13
|
-
:placeholder="placeholder"
|
|
14
|
-
:disable="disable"
|
|
15
|
-
:readonly="readonly"
|
|
16
|
-
:class="inputClass"
|
|
17
|
-
:error="error"
|
|
18
|
-
:autocomplete="autocomplete"
|
|
19
|
-
:debounce="debounce"
|
|
20
|
-
:loading="loading"
|
|
21
|
-
@blur="emit('blur')"
|
|
22
|
-
>
|
|
23
|
-
<slot />
|
|
24
|
-
<template #append>
|
|
25
|
-
<slot name="append" />
|
|
26
|
-
<q-icon
|
|
27
|
-
v-if="type === 'password'"
|
|
28
|
-
:name="isVisiblePass ? 'visibility' : 'visibility_off'"
|
|
29
|
-
color="primary"
|
|
30
|
-
class="cursor-pointer"
|
|
31
|
-
@click="isVisiblePass = !isVisiblePass"
|
|
32
|
-
/>
|
|
33
|
-
<q-icon
|
|
34
|
-
v-if="clearable && (model || model === 0)"
|
|
35
|
-
name="close"
|
|
36
|
-
class="cursor-pointer clear-input"
|
|
37
|
-
@click="model = null"
|
|
38
|
-
/>
|
|
39
|
-
<q-btn
|
|
40
|
-
v-if="uuid && !disable && !readonly"
|
|
41
|
-
flat
|
|
42
|
-
no-caps
|
|
43
|
-
label="UUID"
|
|
44
|
-
size="sm"
|
|
45
|
-
class="q-ml-sm uuid-btn"
|
|
46
|
-
@click="model = uuidv4()"
|
|
47
|
-
/>
|
|
48
|
-
<q-icon
|
|
49
|
-
v-if="copyable"
|
|
50
|
-
name="content_copy"
|
|
51
|
-
class="cursor-pointer q-ml-sm copy-icon"
|
|
52
|
-
color="primary"
|
|
53
|
-
:disable="!model"
|
|
54
|
-
@click="copyToClipboard"
|
|
55
|
-
/>
|
|
56
|
-
</template>
|
|
57
|
-
</q-input>
|
|
58
|
-
</div>
|
|
59
|
-
</template>
|
|
60
|
-
|
|
61
|
-
<script setup lang="ts">
|
|
62
|
-
import { defineEmits, defineProps, computed, ref } from 'vue'
|
|
63
|
-
import { uuidv4 } from '@/utils/helpers'
|
|
64
|
-
import { notificationSettings } from '@/utils/notification'
|
|
65
|
-
import { QInputProps, useQuasar } from 'quasar'
|
|
66
|
-
|
|
67
|
-
const props = defineProps<
|
|
68
|
-
QInputProps & {
|
|
69
|
-
modelValue?: string | number | null
|
|
70
|
-
label?: string
|
|
71
|
-
placeholder?: string
|
|
72
|
-
rules?: ((val: string | number | null | undefined) => boolean | string)[]
|
|
73
|
-
inputClass?: string
|
|
74
|
-
required?: boolean
|
|
75
|
-
readonly?: boolean
|
|
76
|
-
disable?: boolean
|
|
77
|
-
uuid?: boolean
|
|
78
|
-
clearable?: boolean
|
|
79
|
-
copyable?: boolean
|
|
80
|
-
error?: boolean
|
|
81
|
-
autocomplete?: string
|
|
82
|
-
debounce?: number
|
|
83
|
-
loading?: boolean
|
|
84
|
-
}
|
|
85
|
-
>()
|
|
86
|
-
|
|
87
|
-
const emit = defineEmits<{
|
|
88
|
-
(e: 'update:modelValue', val?: string | number | null): void
|
|
89
|
-
(e: 'blur', val?: string | number | null): void
|
|
90
|
-
}>()
|
|
91
|
-
|
|
92
|
-
const $q = useQuasar()
|
|
93
|
-
|
|
94
|
-
const isVisiblePass = ref(false)
|
|
95
|
-
|
|
96
|
-
const model = computed({
|
|
97
|
-
get: () => getValue(props.modelValue),
|
|
98
|
-
set: (newValue?: string | number | null) => emit('update:modelValue', getValue(newValue)),
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
const inputType = computed(() => (props.type === 'password' && isVisiblePass.value ? 'text' : props.type))
|
|
102
|
-
|
|
103
|
-
const getValue = (value?: string | number | null) => {
|
|
104
|
-
if (props.type === 'number') return value ? +value : value
|
|
105
|
-
|
|
106
|
-
return value
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const copyToClipboard = () => {
|
|
110
|
-
if (!model.value && model.value !== 0) return
|
|
111
|
-
|
|
112
|
-
navigator.clipboard.writeText(model.value.toString()).then(() => {
|
|
113
|
-
$q.notify(notificationSettings('success', 'Данные скопированы'))
|
|
114
|
-
})
|
|
115
|
-
}
|
|
116
|
-
</script>
|
|
117
|
-
|
|
118
|
-
<style scoped lang="scss">
|
|
119
|
-
.app-input-new {
|
|
120
|
-
display: flex;
|
|
121
|
-
flex-direction: column;
|
|
122
|
-
margin-bottom: 15px;
|
|
123
|
-
|
|
124
|
-
&__label {
|
|
125
|
-
font-size: 14px;
|
|
126
|
-
font-weight: 700;
|
|
127
|
-
color: #7d8592;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.required {
|
|
131
|
-
color: #f65160;
|
|
132
|
-
font-weight: bold;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.clear-input {
|
|
136
|
-
color: #d8e0f0;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.uuid-btn {
|
|
140
|
-
height: 32px;
|
|
141
|
-
padding: 0 10px;
|
|
142
|
-
border: 1px solid #3f8cff;
|
|
143
|
-
color: #3f8cff;
|
|
144
|
-
font-weight: 700;
|
|
145
|
-
font-size: 14px;
|
|
146
|
-
background: white;
|
|
147
|
-
border-radius: 6px;
|
|
148
|
-
|
|
149
|
-
:deep(.block) {
|
|
150
|
-
line-height: normal;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
:deep(.q-placeholder) {
|
|
155
|
-
color: #7d8592;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
:deep(.q-field__control) {
|
|
159
|
-
min-height: 58px;
|
|
160
|
-
border-radius: 8px;
|
|
161
|
-
border: 1px solid #d8e0f0;
|
|
162
|
-
background: #fff;
|
|
163
|
-
box-shadow: 0 1px 2px 0 rgba(184, 200, 224, 0.22);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
:deep(.q-field--filled .q-field__control:before) {
|
|
167
|
-
background: #fff !important;
|
|
168
|
-
border: none;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
:deep(.q-field--with-bottom) {
|
|
172
|
-
padding-bottom: 0;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
:deep(.q-field__bottom) {
|
|
176
|
-
padding: 0;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-input-new">
|
|
3
|
+
<label v-if="label" class="app-input-new__label">
|
|
4
|
+
{{ label }}
|
|
5
|
+
<span v-if="required" class="required">*</span>
|
|
6
|
+
</label>
|
|
7
|
+
|
|
8
|
+
<q-input
|
|
9
|
+
v-model="model"
|
|
10
|
+
filled
|
|
11
|
+
:type="inputType"
|
|
12
|
+
:rules="rules"
|
|
13
|
+
:placeholder="placeholder"
|
|
14
|
+
:disable="disable"
|
|
15
|
+
:readonly="readonly"
|
|
16
|
+
:class="inputClass"
|
|
17
|
+
:error="error"
|
|
18
|
+
:autocomplete="autocomplete"
|
|
19
|
+
:debounce="debounce"
|
|
20
|
+
:loading="loading"
|
|
21
|
+
@blur="emit('blur')"
|
|
22
|
+
>
|
|
23
|
+
<slot />
|
|
24
|
+
<template #append>
|
|
25
|
+
<slot name="append" />
|
|
26
|
+
<q-icon
|
|
27
|
+
v-if="type === 'password'"
|
|
28
|
+
:name="isVisiblePass ? 'visibility' : 'visibility_off'"
|
|
29
|
+
color="primary"
|
|
30
|
+
class="cursor-pointer"
|
|
31
|
+
@click="isVisiblePass = !isVisiblePass"
|
|
32
|
+
/>
|
|
33
|
+
<q-icon
|
|
34
|
+
v-if="clearable && (model || model === 0)"
|
|
35
|
+
name="close"
|
|
36
|
+
class="cursor-pointer clear-input"
|
|
37
|
+
@click="model = null"
|
|
38
|
+
/>
|
|
39
|
+
<q-btn
|
|
40
|
+
v-if="uuid && !disable && !readonly"
|
|
41
|
+
flat
|
|
42
|
+
no-caps
|
|
43
|
+
label="UUID"
|
|
44
|
+
size="sm"
|
|
45
|
+
class="q-ml-sm uuid-btn"
|
|
46
|
+
@click="model = uuidv4()"
|
|
47
|
+
/>
|
|
48
|
+
<q-icon
|
|
49
|
+
v-if="copyable"
|
|
50
|
+
name="content_copy"
|
|
51
|
+
class="cursor-pointer q-ml-sm copy-icon"
|
|
52
|
+
color="primary"
|
|
53
|
+
:disable="!model"
|
|
54
|
+
@click="copyToClipboard"
|
|
55
|
+
/>
|
|
56
|
+
</template>
|
|
57
|
+
</q-input>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import { defineEmits, defineProps, computed, ref } from 'vue'
|
|
63
|
+
import { uuidv4 } from '@/utils/helpers'
|
|
64
|
+
import { notificationSettings } from '@/utils/notification'
|
|
65
|
+
import { QInputProps, useQuasar } from 'quasar'
|
|
66
|
+
|
|
67
|
+
const props = defineProps<
|
|
68
|
+
QInputProps & {
|
|
69
|
+
modelValue?: string | number | null
|
|
70
|
+
label?: string
|
|
71
|
+
placeholder?: string
|
|
72
|
+
rules?: ((val: string | number | null | undefined) => boolean | string)[]
|
|
73
|
+
inputClass?: string
|
|
74
|
+
required?: boolean
|
|
75
|
+
readonly?: boolean
|
|
76
|
+
disable?: boolean
|
|
77
|
+
uuid?: boolean
|
|
78
|
+
clearable?: boolean
|
|
79
|
+
copyable?: boolean
|
|
80
|
+
error?: boolean
|
|
81
|
+
autocomplete?: string
|
|
82
|
+
debounce?: number
|
|
83
|
+
loading?: boolean
|
|
84
|
+
}
|
|
85
|
+
>()
|
|
86
|
+
|
|
87
|
+
const emit = defineEmits<{
|
|
88
|
+
(e: 'update:modelValue', val?: string | number | null): void
|
|
89
|
+
(e: 'blur', val?: string | number | null): void
|
|
90
|
+
}>()
|
|
91
|
+
|
|
92
|
+
const $q = useQuasar()
|
|
93
|
+
|
|
94
|
+
const isVisiblePass = ref(false)
|
|
95
|
+
|
|
96
|
+
const model = computed({
|
|
97
|
+
get: () => getValue(props.modelValue),
|
|
98
|
+
set: (newValue?: string | number | null) => emit('update:modelValue', getValue(newValue)),
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
const inputType = computed(() => (props.type === 'password' && isVisiblePass.value ? 'text' : props.type))
|
|
102
|
+
|
|
103
|
+
const getValue = (value?: string | number | null) => {
|
|
104
|
+
if (props.type === 'number') return value ? +value : value
|
|
105
|
+
|
|
106
|
+
return value
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const copyToClipboard = () => {
|
|
110
|
+
if (!model.value && model.value !== 0) return
|
|
111
|
+
|
|
112
|
+
navigator.clipboard.writeText(model.value.toString()).then(() => {
|
|
113
|
+
$q.notify(notificationSettings('success', 'Данные скопированы'))
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<style scoped lang="scss">
|
|
119
|
+
.app-input-new {
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
margin-bottom: 15px;
|
|
123
|
+
|
|
124
|
+
&__label {
|
|
125
|
+
font-size: 14px;
|
|
126
|
+
font-weight: 700;
|
|
127
|
+
color: #7d8592;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.required {
|
|
131
|
+
color: #f65160;
|
|
132
|
+
font-weight: bold;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.clear-input {
|
|
136
|
+
color: #d8e0f0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.uuid-btn {
|
|
140
|
+
height: 32px;
|
|
141
|
+
padding: 0 10px;
|
|
142
|
+
border: 1px solid #3f8cff;
|
|
143
|
+
color: #3f8cff;
|
|
144
|
+
font-weight: 700;
|
|
145
|
+
font-size: 14px;
|
|
146
|
+
background: white;
|
|
147
|
+
border-radius: 6px;
|
|
148
|
+
|
|
149
|
+
:deep(.block) {
|
|
150
|
+
line-height: normal;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
:deep(.q-placeholder) {
|
|
155
|
+
color: #7d8592;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:deep(.q-field__control) {
|
|
159
|
+
min-height: 58px;
|
|
160
|
+
border-radius: 8px;
|
|
161
|
+
border: 1px solid #d8e0f0;
|
|
162
|
+
background: #fff;
|
|
163
|
+
box-shadow: 0 1px 2px 0 rgba(184, 200, 224, 0.22);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
:deep(.q-field--filled .q-field__control:before) {
|
|
167
|
+
background: #fff !important;
|
|
168
|
+
border: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
:deep(.q-field--with-bottom) {
|
|
172
|
+
padding-bottom: 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
:deep(.q-field__bottom) {
|
|
176
|
+
padding: 0;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
</style>
|