shared-ritm 1.1.8 → 1.1.10
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/types/index.d.ts +3 -3
- package/package.json +10 -9
- package/src/App.vue +2411 -0
- package/src/api/services/AuthService.ts +41 -0
- package/src/api/services/GanttService.ts +17 -0
- package/src/api/services/MetricsService.ts +101 -0
- package/src/api/services/ProjectsService.ts +57 -0
- package/src/api/services/RepairsService.ts +82 -0
- package/src/api/services/TasksService.ts +27 -0
- package/src/api/settings/ApiService.ts +124 -0
- package/src/api/types/Api_Metrics.ts +0 -0
- package/src/api/types/Api_Projects.ts +33 -0
- package/src/api/types/Api_Repairs.ts +57 -0
- package/src/api/types/Api_Tasks.ts +124 -0
- package/src/common/app-button/AppButton.vue +173 -0
- package/src/common/app-checkbox/AppCheckbox.vue +26 -0
- package/src/common/app-date-picker/AppDatePicker.vue +66 -0
- package/src/common/app-icon/AppIcon.vue +104 -0
- package/src/common/app-input/AppInput.vue +147 -0
- package/src/common/app-input-search/AppInputSearch.vue +170 -0
- package/src/common/app-layout/AppLayout.vue +62 -0
- package/src/common/app-layout/components/AppLayoutHeader.vue +124 -0
- package/src/common/app-loader/index.vue +43 -0
- package/src/common/app-page-layout/AppPageLayout.vue +122 -0
- package/src/common/app-select/AppSelect.vue +157 -0
- package/src/common/app-sheet/AppSheet.vue +114 -0
- package/src/common/app-sidebar/AppSidebar.vue +167 -0
- package/src/common/app-sidebar/components/SidebarMenu.vue +29 -0
- package/src/common/app-sidebar/components/SidebarMenuItem.vue +137 -0
- package/src/common/app-toggle/AppToggle.vue +23 -0
- package/src/common/app-wrapper/AppWrapper.vue +28 -0
- package/src/global.d.ts +1 -0
- package/src/icons/components/arrow-down-icon.vue +25 -0
- package/src/icons/components/arrow-frame-icon.vue +19 -0
- package/src/icons/components/arrow-square.vue +22 -0
- package/src/icons/header/flashIcon.vue +24 -0
- package/src/icons/header/notificationIcon.vue +18 -0
- package/src/icons/header/searchStatusIcon.vue +24 -0
- package/src/icons/header/smallCapsIcon.vue +34 -0
- package/src/icons/sidebar/assign-module-icon.vue +36 -0
- package/src/icons/sidebar/instrument-history-icon.vue +32 -0
- package/src/icons/sidebar/instrument-order-icon.vue +38 -0
- package/src/icons/sidebar/instrument-work-zone-icon.vue +18 -0
- package/src/icons/sidebar/instruments-icon.vue +45 -0
- package/src/icons/sidebar/logo-icon.vue +15 -0
- package/src/icons/sidebar/logout-icon.vue +13 -0
- package/src/icons/sidebar/modules-icon.vue +16 -0
- package/src/icons/sidebar/notifications-icon.vue +24 -0
- package/src/icons/sidebar/order-icon.vue +44 -0
- package/src/icons/sidebar/pass-icon.vue +38 -0
- package/src/icons/sidebar/positions-icon.vue +42 -0
- package/src/icons/sidebar/preorder-icon.vue +19 -0
- package/src/icons/sidebar/projects-icon.vue +31 -0
- package/src/icons/sidebar/repair-object-icon.vue +18 -0
- package/src/icons/sidebar/repairs-icon.vue +20 -0
- package/src/icons/sidebar/roles-icon.vue +26 -0
- package/src/icons/sidebar/status-history-icon.vue +24 -0
- package/src/icons/sidebar/tasks-icon.vue +28 -0
- package/src/icons/sidebar/tasks_tasks-icon.vue +39 -0
- package/src/icons/sidebar/tasks_today-icon.vue +27 -0
- package/src/icons/sidebar/teams-icon.vue +32 -0
- package/src/icons/sidebar/user-icon.vue +18 -0
- package/src/icons/sidebar/users-icon.vue +46 -0
- package/src/icons/sidebar/videosources-icon.vue +19 -0
- package/src/icons/sidebar/videowall-icon.vue +13 -0
- package/src/icons/sidebar/videozones-icon.vue +21 -0
- package/src/icons/sidebar/warehouses-icon.vue +43 -0
- package/src/icons/sidebar/workshop-icon.vue +100 -0
- package/src/icons/sidebar/workzones-icon.vue +22 -0
- package/src/index.ts +57 -0
- package/src/main.ts +15 -0
- package/src/quasar-user-options.ts +17 -0
- package/src/shared/fonts/Montserrat-Bold.ttf +0 -0
- package/src/shared/fonts/Montserrat.ttf +0 -0
- package/src/shared/fonts/NunitoSansFont.ttf +0 -0
- package/src/shared/fonts/NunitoSans_7pt-Bold.ttf +0 -0
- package/src/shared/styles/general.css +96 -0
- package/src/shims-vue.d.ts +5 -0
- package/src/styles/variables.sass +12 -0
- package/src/utils/notification.ts +13 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-btn
|
|
3
|
+
v-bind="$props"
|
|
4
|
+
:class="[$style.wrapper]"
|
|
5
|
+
:disable="isDisabled"
|
|
6
|
+
:no-caps="!uppercase"
|
|
7
|
+
:no-wrap="!wrap"
|
|
8
|
+
class="hover-bg-secondary hover-text-black"
|
|
9
|
+
@click="onClick"
|
|
10
|
+
>
|
|
11
|
+
<slot></slot>
|
|
12
|
+
<q-badge
|
|
13
|
+
v-if="badge"
|
|
14
|
+
style="padding: 6px; top: -10px; right: -10px; font-size: 12px"
|
|
15
|
+
:color="badgeColor"
|
|
16
|
+
:floating="!badgeInline"
|
|
17
|
+
:rounded="true"
|
|
18
|
+
>{{ badgeText }}</q-badge
|
|
19
|
+
>
|
|
20
|
+
<q-tooltip v-if="tooltip" class="text-body2" :delay="400">{{ tooltip }}</q-tooltip>
|
|
21
|
+
</q-btn>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script lang="ts" setup>
|
|
25
|
+
import { computed, defineProps, defineEmits } from 'vue'
|
|
26
|
+
|
|
27
|
+
interface QBtnProps {
|
|
28
|
+
size?: string | undefined
|
|
29
|
+
type?: string | undefined
|
|
30
|
+
to?: string | any | undefined
|
|
31
|
+
replace?: boolean | undefined
|
|
32
|
+
href?: string | undefined
|
|
33
|
+
target?: string | undefined
|
|
34
|
+
label?: string | number | undefined
|
|
35
|
+
icon?: string | undefined
|
|
36
|
+
iconRight?: string | undefined
|
|
37
|
+
outline?: boolean | undefined
|
|
38
|
+
flat?: boolean | undefined
|
|
39
|
+
unelevated?: boolean | undefined
|
|
40
|
+
rounded?: boolean | undefined
|
|
41
|
+
push?: boolean | undefined
|
|
42
|
+
square?: boolean | undefined
|
|
43
|
+
glossy?: boolean | undefined
|
|
44
|
+
fab?: boolean | undefined
|
|
45
|
+
fabMini?: boolean | undefined
|
|
46
|
+
padding?: string | undefined
|
|
47
|
+
color?: string | undefined
|
|
48
|
+
textColor?: string | undefined
|
|
49
|
+
noCaps?: boolean | undefined
|
|
50
|
+
noWrap?: boolean | undefined
|
|
51
|
+
dense?: boolean | undefined
|
|
52
|
+
ripple?: boolean | any | undefined
|
|
53
|
+
tabindex?: number | string | undefined
|
|
54
|
+
align?: 'left' | 'right' | 'center' | 'around' | 'between' | 'evenly' | undefined
|
|
55
|
+
stack?: boolean | undefined
|
|
56
|
+
stretch?: boolean | undefined
|
|
57
|
+
loading?: boolean | undefined
|
|
58
|
+
round?: boolean | undefined
|
|
59
|
+
percentage?: number | undefined
|
|
60
|
+
darkPercentage?: boolean | undefined
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface Props extends QBtnProps {
|
|
64
|
+
disable?: boolean | ((...args: any[]) => boolean)
|
|
65
|
+
tooltip?: string
|
|
66
|
+
uppercase?: boolean
|
|
67
|
+
xSmall?: boolean
|
|
68
|
+
small?: boolean
|
|
69
|
+
large?: boolean
|
|
70
|
+
fullWidth?: boolean
|
|
71
|
+
wrap?: boolean
|
|
72
|
+
largeIcon?: boolean
|
|
73
|
+
modelValue?: boolean
|
|
74
|
+
badge?: string | boolean | number
|
|
75
|
+
badgeColor?: string
|
|
76
|
+
badgeInline?: boolean
|
|
77
|
+
link?: boolean
|
|
78
|
+
borderColor?: string
|
|
79
|
+
borderRadius?: string
|
|
80
|
+
borderWidth?: string
|
|
81
|
+
width?: string
|
|
82
|
+
height?: string
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
86
|
+
borderRadius: '16px',
|
|
87
|
+
borderWidth: '1px',
|
|
88
|
+
width: 'auto',
|
|
89
|
+
height: 'auto',
|
|
90
|
+
disable: false,
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
const emit = defineEmits(['update:modelValue', 'click'])
|
|
94
|
+
|
|
95
|
+
function onClick(event: any) {
|
|
96
|
+
emit('click', event)
|
|
97
|
+
emit('update:modelValue', !props.modelValue)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const badgeText = computed(() => {
|
|
101
|
+
if (props.badge === undefined || props.badge === false) return ''
|
|
102
|
+
if (props.badge === true || props.badge === '') return ''
|
|
103
|
+
return props.badge
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
// const btnClasses = computed(() => {
|
|
107
|
+
// return {
|
|
108
|
+
// '--icon': props.icon && !props.label,
|
|
109
|
+
// '--width-left-icon': props.icon && props.label,
|
|
110
|
+
// '--width-right-icon': props.iconRight && props.label,
|
|
111
|
+
// '--default': !props.small && !props.large && !props.xSmall,
|
|
112
|
+
// '--x-small': props.xSmall,
|
|
113
|
+
// '--small': props.small,
|
|
114
|
+
// '--large': props.large,
|
|
115
|
+
// '--full-width': props.fullWidth,
|
|
116
|
+
// '--large-icon': props.largeIcon,
|
|
117
|
+
// '--is-active': props.modelValue,
|
|
118
|
+
// '--link': props.link,
|
|
119
|
+
// '--loading': props.loading,
|
|
120
|
+
// }
|
|
121
|
+
// })
|
|
122
|
+
|
|
123
|
+
const isDisabled = computed(() => {
|
|
124
|
+
return typeof props.disable === 'function' ? props.disable() : props.disable
|
|
125
|
+
})
|
|
126
|
+
</script>
|
|
127
|
+
|
|
128
|
+
<style lang="scss" module>
|
|
129
|
+
.wrapper {
|
|
130
|
+
flex: 0 0 auto;
|
|
131
|
+
width: v-bind(width);
|
|
132
|
+
height: v-bind(height);
|
|
133
|
+
&:global(.q-btn--rounded) {
|
|
134
|
+
border-radius: v-bind(borderRadius);
|
|
135
|
+
}
|
|
136
|
+
&:global(.q-btn--outline:before) {
|
|
137
|
+
border-width: v-bind(borderWidth);
|
|
138
|
+
}
|
|
139
|
+
&:global(.q-btn) {
|
|
140
|
+
color: #0a1629;
|
|
141
|
+
font-size: 16px;
|
|
142
|
+
font-style: normal;
|
|
143
|
+
font-weight: 700;
|
|
144
|
+
font-family: NunitoSansFont, sans-serif;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&:global(.--loading) {
|
|
148
|
+
span:has(> svg) {
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:global(.q-icon) {
|
|
154
|
+
font-size: 1.2em;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&:global(.--large-icon .q-icon) {
|
|
158
|
+
font-size: 1.715em;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&:global(.--full-width) {
|
|
162
|
+
width: 100%;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&:global(.--link) {
|
|
166
|
+
padding: 0 8px;
|
|
167
|
+
display: inline;
|
|
168
|
+
min-height: unset;
|
|
169
|
+
font-size: inherit;
|
|
170
|
+
text-decoration: underline;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
</style>
|
|
@@ -0,0 +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>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="date-picker">
|
|
3
|
+
<app-button
|
|
4
|
+
class="button"
|
|
5
|
+
outline
|
|
6
|
+
size="20px"
|
|
7
|
+
padding="10px"
|
|
8
|
+
border-radius="8px"
|
|
9
|
+
border-width="2px"
|
|
10
|
+
rounded
|
|
11
|
+
text-color="primary"
|
|
12
|
+
icon="event"
|
|
13
|
+
>
|
|
14
|
+
<q-popup-proxy anchor="top left" self="top left" transition-show="scale-up" transition-hide="scale-down">
|
|
15
|
+
<q-date v-model="model" mask="YYYY-MM-DD" minimal />
|
|
16
|
+
</q-popup-proxy>
|
|
17
|
+
</app-button>
|
|
18
|
+
<div class="date-picker__content">
|
|
19
|
+
<p>{{ label }}<span> * </span></p>
|
|
20
|
+
<span>{{ model || 'Выберите дату' }}</span>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import { computed } from 'vue'
|
|
27
|
+
import AppButton from '@/common/app-button/AppButton.vue'
|
|
28
|
+
|
|
29
|
+
interface Props {
|
|
30
|
+
label: string
|
|
31
|
+
modelValue: string
|
|
32
|
+
}
|
|
33
|
+
const emits = defineEmits(['update:modelValue'])
|
|
34
|
+
const props = defineProps<Props>()
|
|
35
|
+
|
|
36
|
+
const model = computed({
|
|
37
|
+
get() {
|
|
38
|
+
return props.modelValue
|
|
39
|
+
},
|
|
40
|
+
set(value: string) {
|
|
41
|
+
emits('update:modelValue', value)
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<style scoped lang="scss">
|
|
47
|
+
.date-picker {
|
|
48
|
+
display: flex;
|
|
49
|
+
gap: 14px;
|
|
50
|
+
&__content {
|
|
51
|
+
color: #7d8592;
|
|
52
|
+
font-weight: 500;
|
|
53
|
+
p {
|
|
54
|
+
margin: 0;
|
|
55
|
+
font-weight: 700;
|
|
56
|
+
span {
|
|
57
|
+
color: red;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
span {
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
.button {
|
|
65
|
+
}
|
|
66
|
+
</style>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="sideBarIcon" :tag="tag" :class="[$style['app-icon']]" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import ProjectsIcon from '@/icons/sidebar/projects-icon.vue'
|
|
7
|
+
import RepairsIcon from '@/icons/sidebar/repairs-icon.vue'
|
|
8
|
+
import InstrumentHistoryIcon from '@/icons/sidebar/instrument-history-icon.vue'
|
|
9
|
+
import RepairObjectIcon from '@/icons/sidebar/repair-object-icon.vue'
|
|
10
|
+
import StatusHistoryIcon from '@/icons/sidebar/status-history-icon.vue'
|
|
11
|
+
import PassIcon from '@/icons/sidebar/pass-icon.vue'
|
|
12
|
+
import AssignModuleIcon from '@/icons/sidebar/assign-module-icon.vue'
|
|
13
|
+
import UsersIcon from '@/icons/sidebar/users-icon.vue'
|
|
14
|
+
import UserIcon from '@/icons/sidebar/user-icon.vue'
|
|
15
|
+
import WorkzonesIcon from '@/icons/sidebar/workzones-icon.vue'
|
|
16
|
+
import LogoutIcon from '@/icons/sidebar/logout-icon.vue'
|
|
17
|
+
import LogoIcon from '@/icons/sidebar/logo-icon.vue'
|
|
18
|
+
import TasksIcon from '@/icons/sidebar/tasks-icon.vue'
|
|
19
|
+
import InstrumentsIcon from '@/icons/sidebar/instruments-icon.vue'
|
|
20
|
+
import OrderIcon from '@/icons/sidebar/order-icon.vue'
|
|
21
|
+
import ModulesIcon from '@/icons/sidebar/modules-icon.vue'
|
|
22
|
+
import NotificationsIcon from '@/icons/sidebar/notifications-icon.vue'
|
|
23
|
+
import VideozonesIcon from '@/icons/sidebar/videozones-icon.vue'
|
|
24
|
+
import InstrumentWorkZoneIcon from '@/icons/sidebar/instrument-work-zone-icon.vue'
|
|
25
|
+
import WorkshopIcon from '@/icons/sidebar/workshop-icon.vue'
|
|
26
|
+
import WarehousesIcon from '@/icons/sidebar/warehouses-icon.vue'
|
|
27
|
+
import TeamsIcon from '@/icons/sidebar/teams-icon.vue'
|
|
28
|
+
import RolesIcon from '@/icons/sidebar/roles-icon.vue'
|
|
29
|
+
import PositionsIcon from '@/icons/sidebar/positions-icon.vue'
|
|
30
|
+
import InstrumentOrderIcon from '@/icons/sidebar/instrument-order-icon.vue'
|
|
31
|
+
import PreorderIcon from '@/icons/sidebar/preorder-icon.vue'
|
|
32
|
+
import VideowallIcon from '@/icons/sidebar/videowall-icon.vue'
|
|
33
|
+
import VideosourcesIcon from '@/icons/sidebar/videosources-icon.vue'
|
|
34
|
+
import Tasks_tasksIcon from '@/icons/sidebar/tasks_tasks-icon.vue'
|
|
35
|
+
import Tasks_todayIcon from '@/icons/sidebar/tasks_today-icon.vue'
|
|
36
|
+
import ArrowFrameIcon from '@/icons/components/arrow-frame-icon.vue'
|
|
37
|
+
|
|
38
|
+
import { computed, defineProps } from 'vue'
|
|
39
|
+
|
|
40
|
+
interface Props {
|
|
41
|
+
size?: string | undefined
|
|
42
|
+
tag?: string | undefined
|
|
43
|
+
name: string
|
|
44
|
+
color?: string | undefined
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
48
|
+
tag: '',
|
|
49
|
+
name: '',
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
function toPascalCase(str: string): string {
|
|
53
|
+
if (!str) return ''
|
|
54
|
+
return str
|
|
55
|
+
.split('-')
|
|
56
|
+
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
57
|
+
.join('')
|
|
58
|
+
}
|
|
59
|
+
const sideBarIcon = computed(
|
|
60
|
+
() =>
|
|
61
|
+
({
|
|
62
|
+
ProjectsIcon,
|
|
63
|
+
RepairsIcon,
|
|
64
|
+
RepairObjectIcon,
|
|
65
|
+
InstrumentHistoryIcon,
|
|
66
|
+
StatusHistoryIcon,
|
|
67
|
+
PassIcon,
|
|
68
|
+
AssignModuleIcon,
|
|
69
|
+
UsersIcon,
|
|
70
|
+
UserIcon,
|
|
71
|
+
WorkzonesIcon,
|
|
72
|
+
LogoutIcon,
|
|
73
|
+
LogoIcon,
|
|
74
|
+
TasksIcon,
|
|
75
|
+
InstrumentsIcon,
|
|
76
|
+
OrderIcon,
|
|
77
|
+
ModulesIcon,
|
|
78
|
+
NotificationsIcon,
|
|
79
|
+
VideozonesIcon,
|
|
80
|
+
InstrumentWorkZoneIcon,
|
|
81
|
+
WorkshopIcon,
|
|
82
|
+
WarehousesIcon,
|
|
83
|
+
TeamsIcon,
|
|
84
|
+
RolesIcon,
|
|
85
|
+
PositionsIcon,
|
|
86
|
+
InstrumentOrderIcon,
|
|
87
|
+
PreorderIcon,
|
|
88
|
+
VideowallIcon,
|
|
89
|
+
VideosourcesIcon,
|
|
90
|
+
Tasks_tasksIcon,
|
|
91
|
+
Tasks_todayIcon,
|
|
92
|
+
ArrowFrameIcon,
|
|
93
|
+
}[toPascalCase(props.name)]),
|
|
94
|
+
)
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<style module lang="scss">
|
|
98
|
+
.app-icon {
|
|
99
|
+
stroke: v-bind(color);
|
|
100
|
+
fill: none;
|
|
101
|
+
width: v-bind(size);
|
|
102
|
+
height: v-bind(size);
|
|
103
|
+
}
|
|
104
|
+
</style>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-input
|
|
3
|
+
v-model="value"
|
|
4
|
+
:class="[inputClasses, $style['app-input']]"
|
|
5
|
+
standout
|
|
6
|
+
outlined
|
|
7
|
+
dense
|
|
8
|
+
:type="inputType"
|
|
9
|
+
autocomplete="h87h58g7h8hd"
|
|
10
|
+
:readonly="readonly || field"
|
|
11
|
+
:disable="disabled"
|
|
12
|
+
:placeholder="placeholder"
|
|
13
|
+
>
|
|
14
|
+
</q-input>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import { defineProps, defineEmits, computed, ref, withDefaults } from 'vue'
|
|
19
|
+
|
|
20
|
+
interface AppQInputProps {
|
|
21
|
+
name?: string | undefined
|
|
22
|
+
mask?: string | undefined
|
|
23
|
+
fillMask?: boolean | string | undefined
|
|
24
|
+
reverseFillMask?: boolean | undefined
|
|
25
|
+
unmaskedValue?: boolean | undefined
|
|
26
|
+
modelValue: string | number | null | undefined
|
|
27
|
+
error?: boolean | undefined
|
|
28
|
+
errorMessage?: string | undefined
|
|
29
|
+
noErrorIcon?: boolean | undefined
|
|
30
|
+
rules?: any | undefined
|
|
31
|
+
reactiveRules?: boolean | undefined
|
|
32
|
+
lazyRules?: boolean | 'ondemand' | undefined
|
|
33
|
+
label?: string | undefined
|
|
34
|
+
stackLabel?: boolean | undefined
|
|
35
|
+
hint?: string | undefined
|
|
36
|
+
hideHint?: boolean | undefined
|
|
37
|
+
prefix?: string | undefined
|
|
38
|
+
suffix?: string | undefined
|
|
39
|
+
labelColor?: string | undefined
|
|
40
|
+
color?: string | undefined
|
|
41
|
+
bgColor?: string | undefined
|
|
42
|
+
dark?: boolean | undefined
|
|
43
|
+
loading?: boolean | undefined
|
|
44
|
+
clearable?: boolean | undefined
|
|
45
|
+
clearIcon?: string | undefined
|
|
46
|
+
filled?: boolean | undefined
|
|
47
|
+
outlined?: boolean | undefined
|
|
48
|
+
borderless?: boolean | undefined
|
|
49
|
+
standout?: boolean | string | undefined
|
|
50
|
+
labelSlot?: boolean | undefined
|
|
51
|
+
bottomSlots?: boolean | undefined
|
|
52
|
+
hideBottomSpace?: boolean | undefined
|
|
53
|
+
counter?: boolean | undefined
|
|
54
|
+
rounded?: boolean | undefined
|
|
55
|
+
square?: boolean | undefined
|
|
56
|
+
dense?: boolean | undefined
|
|
57
|
+
itemAligned?: boolean | undefined
|
|
58
|
+
disable?: boolean | undefined
|
|
59
|
+
readonly?: boolean | undefined
|
|
60
|
+
autofocus?: boolean | undefined
|
|
61
|
+
for?: string | undefined
|
|
62
|
+
shadowText?: string | undefined
|
|
63
|
+
type?:
|
|
64
|
+
| 'text'
|
|
65
|
+
| 'password'
|
|
66
|
+
| 'textarea'
|
|
67
|
+
| 'email'
|
|
68
|
+
| 'search'
|
|
69
|
+
| 'tel'
|
|
70
|
+
| 'file'
|
|
71
|
+
| 'number'
|
|
72
|
+
| 'url'
|
|
73
|
+
| 'time'
|
|
74
|
+
| 'date'
|
|
75
|
+
| undefined
|
|
76
|
+
debounce?: string | number | undefined
|
|
77
|
+
disabled?: boolean | undefined
|
|
78
|
+
maxlength?: string | number | undefined
|
|
79
|
+
autogrow?: boolean | undefined
|
|
80
|
+
inputClass?: any | undefined
|
|
81
|
+
inputStyle?: any | undefined
|
|
82
|
+
onClear?: (value: any) => void
|
|
83
|
+
'onUpdate:modelValue'?: (value: string | number | null) => void
|
|
84
|
+
onFocus?: (evt: Event) => void
|
|
85
|
+
onBlur?: (evt: Event) => void
|
|
86
|
+
onClick?: (evt: Event) => void
|
|
87
|
+
placeholder?: string | undefined
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface AppInputProps extends AppQInputProps {
|
|
91
|
+
field?: boolean
|
|
92
|
+
required?: boolean
|
|
93
|
+
datePicker?: boolean
|
|
94
|
+
timePicker?: boolean
|
|
95
|
+
withIcon?: boolean
|
|
96
|
+
withButton?: boolean
|
|
97
|
+
withArrow?: boolean
|
|
98
|
+
borderColor?: string
|
|
99
|
+
borderRadius?: string
|
|
100
|
+
borderWidth?: string
|
|
101
|
+
width?: string
|
|
102
|
+
height?: string
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const props = withDefaults(defineProps<AppInputProps>(), {
|
|
106
|
+
dense: true,
|
|
107
|
+
outlined: true,
|
|
108
|
+
error: undefined,
|
|
109
|
+
modelValue: '',
|
|
110
|
+
borderRadius: '8px',
|
|
111
|
+
borderWidth: '1px',
|
|
112
|
+
width: 'auto',
|
|
113
|
+
height: 'auto',
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
const emit = defineEmits(['update:modelValue', 'button-click', 'clear', 'focus', 'blur', 'click'])
|
|
117
|
+
const passwordVisibility = ref(false)
|
|
118
|
+
const inputType = computed(() => {
|
|
119
|
+
if (props.type === 'password') return passwordVisibility.value ? 'text' : 'password'
|
|
120
|
+
return props.type || 'text'
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
const value = computed({
|
|
124
|
+
get: () =>
|
|
125
|
+
props.modelValue !== null && props.modelValue !== undefined && props.type === 'number'
|
|
126
|
+
? +props.modelValue
|
|
127
|
+
: props.modelValue,
|
|
128
|
+
set: (newValue: any) => emit('update:modelValue', props.type === 'number' ? +newValue : newValue),
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
const inputClasses = computed(() => {
|
|
132
|
+
return {
|
|
133
|
+
'app-input': true,
|
|
134
|
+
'--required': props.required,
|
|
135
|
+
'--field': props.field,
|
|
136
|
+
'input-number-without-arrow': inputType.value === 'number' && !props.withArrow,
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
</script>
|
|
140
|
+
|
|
141
|
+
<style module lang="scss">
|
|
142
|
+
.app-input {
|
|
143
|
+
&:global(.q-field--dense .q-field__control) {
|
|
144
|
+
height: v-bind(height);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
</style>
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-input
|
|
3
|
+
v-model="value"
|
|
4
|
+
standout
|
|
5
|
+
outlined
|
|
6
|
+
clearable
|
|
7
|
+
dense
|
|
8
|
+
bg-color="white"
|
|
9
|
+
:class="[$style['app-input'], itemClasses]"
|
|
10
|
+
:type="type"
|
|
11
|
+
:readonly="readonly || field"
|
|
12
|
+
:placeholder="label"
|
|
13
|
+
>
|
|
14
|
+
<template #prepend>
|
|
15
|
+
<q-icon>
|
|
16
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
17
|
+
<path
|
|
18
|
+
d="M11.5 21C16.7467 21 21 16.7467 21 11.5C21 6.25329 16.7467 2 11.5 2C6.25329 2 2 6.25329 2 11.5C2 16.7467 6.25329 21 11.5 21Z"
|
|
19
|
+
stroke="#404650"
|
|
20
|
+
stroke-width="1.5"
|
|
21
|
+
stroke-linecap="round"
|
|
22
|
+
stroke-linejoin="round"
|
|
23
|
+
/>
|
|
24
|
+
<path d="M22 22L20 20" stroke="#3F8CFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
25
|
+
</svg>
|
|
26
|
+
</q-icon>
|
|
27
|
+
</template>
|
|
28
|
+
</q-input>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script lang="ts" setup>
|
|
32
|
+
import { defineProps, defineEmits, computed, withDefaults } from 'vue'
|
|
33
|
+
|
|
34
|
+
import { ValidationRule, VueClassProp, VueStyleProp } from 'quasar/dist/types/api'
|
|
35
|
+
|
|
36
|
+
interface AppQInputProps {
|
|
37
|
+
height?: string
|
|
38
|
+
name?: string | undefined
|
|
39
|
+
mask?: string | undefined
|
|
40
|
+
fillMask?: boolean | string | undefined
|
|
41
|
+
reverseFillMask?: boolean | undefined
|
|
42
|
+
unmaskedValue?: boolean | undefined
|
|
43
|
+
modelValue: string | number | null | undefined
|
|
44
|
+
error?: boolean | undefined
|
|
45
|
+
errorMessage?: string | undefined
|
|
46
|
+
noErrorIcon?: boolean | undefined
|
|
47
|
+
rules?: ValidationRule[] | undefined
|
|
48
|
+
reactiveRules?: boolean | undefined
|
|
49
|
+
lazyRules?: boolean | 'ondemand' | undefined
|
|
50
|
+
label?: string | undefined
|
|
51
|
+
stackLabel?: boolean | undefined
|
|
52
|
+
hint?: string | undefined
|
|
53
|
+
hideHint?: boolean | undefined
|
|
54
|
+
prefix?: string | undefined
|
|
55
|
+
suffix?: string | undefined
|
|
56
|
+
labelColor?: string | undefined
|
|
57
|
+
color?: string | undefined
|
|
58
|
+
bgColor?: string | undefined
|
|
59
|
+
dark?: boolean | undefined
|
|
60
|
+
loading?: boolean | undefined
|
|
61
|
+
clearable?: boolean | undefined
|
|
62
|
+
clearIcon?: string | undefined
|
|
63
|
+
filled?: boolean | undefined
|
|
64
|
+
outlined?: boolean | undefined
|
|
65
|
+
borderless?: boolean | undefined
|
|
66
|
+
bordered?: boolean | undefined
|
|
67
|
+
standout?: boolean | string | undefined
|
|
68
|
+
labelSlot?: boolean | undefined
|
|
69
|
+
bottomSlots?: boolean | undefined
|
|
70
|
+
hideBottomSpace?: boolean | undefined
|
|
71
|
+
counter?: boolean | undefined
|
|
72
|
+
rounded?: boolean | undefined
|
|
73
|
+
square?: boolean | undefined
|
|
74
|
+
dense?: boolean | undefined
|
|
75
|
+
itemAligned?: boolean | undefined
|
|
76
|
+
disable?: boolean | undefined
|
|
77
|
+
readonly?: boolean | undefined
|
|
78
|
+
autofocus?: boolean | undefined
|
|
79
|
+
for?: string | undefined
|
|
80
|
+
shadowText?: string | undefined
|
|
81
|
+
type?:
|
|
82
|
+
| 'text'
|
|
83
|
+
| 'password'
|
|
84
|
+
| 'textarea'
|
|
85
|
+
| 'email'
|
|
86
|
+
| 'search'
|
|
87
|
+
| 'tel'
|
|
88
|
+
| 'file'
|
|
89
|
+
| 'number'
|
|
90
|
+
| 'url'
|
|
91
|
+
| 'time'
|
|
92
|
+
| 'date'
|
|
93
|
+
| undefined
|
|
94
|
+
debounce?: string | number | undefined
|
|
95
|
+
maxlength?: string | number | undefined
|
|
96
|
+
autogrow?: boolean | undefined
|
|
97
|
+
inputClass?: VueClassProp | undefined
|
|
98
|
+
inputStyle?: VueStyleProp | undefined
|
|
99
|
+
onClear?: (value: any) => void
|
|
100
|
+
'onUpdate:modelValue'?: (value: string | number | null) => void
|
|
101
|
+
onFocus?: (evt: Event) => void
|
|
102
|
+
onBlur?: (evt: Event) => void
|
|
103
|
+
onClick?: (evt: Event) => void
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface AppInputProps extends AppQInputProps {
|
|
107
|
+
field?: boolean
|
|
108
|
+
required?: boolean
|
|
109
|
+
datePicker?: boolean
|
|
110
|
+
timePicker?: boolean
|
|
111
|
+
dateLocale?: any
|
|
112
|
+
withIcon?: boolean
|
|
113
|
+
iconName?: string
|
|
114
|
+
iconColor?: string
|
|
115
|
+
withButton?: boolean
|
|
116
|
+
buttonIcon?: string
|
|
117
|
+
buttonTooltip?: string
|
|
118
|
+
clearTooltip?: string
|
|
119
|
+
withArrow?: boolean
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const props = withDefaults(defineProps<AppInputProps>(), {
|
|
123
|
+
dense: true,
|
|
124
|
+
height: '48px',
|
|
125
|
+
outlined: true,
|
|
126
|
+
error: undefined,
|
|
127
|
+
modelValue: '',
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
const emit = defineEmits(['update:modelValue', 'button-click', 'clear', 'focus', 'blur', 'click'])
|
|
131
|
+
|
|
132
|
+
const value = computed({
|
|
133
|
+
get: () =>
|
|
134
|
+
props.modelValue !== null && props.modelValue !== undefined && props.type === 'number'
|
|
135
|
+
? +props.modelValue
|
|
136
|
+
: props.modelValue,
|
|
137
|
+
set: (newValue: any) => emit('update:modelValue', props.type === 'number' ? +newValue : newValue),
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
const itemClasses = computed(() => ({
|
|
141
|
+
'--dense': props.dense,
|
|
142
|
+
'--bordered': props.bordered,
|
|
143
|
+
}))
|
|
144
|
+
</script>
|
|
145
|
+
|
|
146
|
+
<style lang="scss" module>
|
|
147
|
+
.app-input {
|
|
148
|
+
&:global(.q-field--outlined .q-field__control) {
|
|
149
|
+
border-radius: 14px;
|
|
150
|
+
height: v-bind(height);
|
|
151
|
+
align-items: center;
|
|
152
|
+
padding: 0 16px;
|
|
153
|
+
color: #87caff;
|
|
154
|
+
}
|
|
155
|
+
:global(.q-field__control-container) {
|
|
156
|
+
margin-left: 8px;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
@media (max-width: 1440px) {
|
|
160
|
+
.app-input {
|
|
161
|
+
&:global(.q-field--outlined .q-field__control) {
|
|
162
|
+
height: 40px;
|
|
163
|
+
padding: 0 12px;
|
|
164
|
+
}
|
|
165
|
+
:global(.q-field__control-container) {
|
|
166
|
+
margin-left: 6px;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
</style>
|