shared-ritm 1.3.99 → 1.3.101
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 +26 -20
- package/dist/shared-ritm.umd.js +3 -3
- package/dist/types/api/services/GanttService.d.ts +6 -0
- package/package.json +1 -1
- package/src/api/services/BrigadesService.ts +32 -32
- package/src/api/services/CommentsService.ts +24 -24
- package/src/api/services/FileService.ts +17 -17
- package/src/api/services/GanttService.ts +58 -47
- package/src/api/services/ModulesService.ts +27 -27
- package/src/api/services/ProjectsService.ts +83 -83
- package/src/api/services/ScheduleService.ts +69 -69
- package/src/api/services/SearchService.ts +22 -22
- package/src/api/services/TasksService.ts +157 -157
- package/src/api/settings/ApiService.ts +184 -184
- package/src/api/types/Api_Brigades.ts +36 -36
- package/src/api/types/Api_Comment.ts +40 -40
- package/src/api/types/Api_Files.ts +7 -7
- package/src/api/types/Api_Modules.ts +21 -21
- package/src/api/types/Api_Projects.ts +62 -62
- package/src/api/types/Api_Schedule.ts +64 -64
- package/src/api/types/Api_Service.ts +9 -9
- package/src/common/app-button/AppButton.vue +173 -173
- package/src/common/app-date-picker/AppDatePicker.vue +81 -81
- package/src/common/app-datepicker/AppDatepicker.vue +218 -218
- package/src/common/app-dropdown/AppDropdown.vue +37 -37
- package/src/common/app-file/AppFile.vue +80 -80
- package/src/common/app-input/AppInput.vue +150 -150
- 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/AppLayoutPage.vue +16 -16
- package/src/common/app-loader/index.vue +43 -43
- package/src/common/app-page-layout/AppPageLayout.vue +122 -122
- package/src/common/app-sheet/AppSheet.vue +120 -120
- package/src/common/app-sheet-new/AppSheetNew.vue +244 -244
- 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/AppTableLayout.vue +137 -137
- 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/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/main.ts +28 -28
- package/src/quasar-user-options.ts +17 -17
- package/src/router/index.ts +10 -10
- package/src/shims-vue.d.ts +5 -5
- package/src/utils/confirm.ts +12 -12
- package/src/utils/faceApiHelper.ts +132 -132
- package/src/utils/notification.ts +9 -9
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
export type Api_Project_Repair = {
|
|
2
|
-
id: string
|
|
3
|
-
name: string
|
|
4
|
-
start_date: null | string
|
|
5
|
-
end_date: null | string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export type Api_Project_Team = {
|
|
9
|
-
id: string
|
|
10
|
-
name: string
|
|
11
|
-
display_name: string
|
|
12
|
-
description: string
|
|
13
|
-
created_at: string
|
|
14
|
-
updated_at: string
|
|
15
|
-
pivot: {
|
|
16
|
-
project_id: string
|
|
17
|
-
team_id: string
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export type Api_Project_Category = {
|
|
22
|
-
code: number
|
|
23
|
-
display_name: string
|
|
24
|
-
name: string
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type Api_Project_Status = {
|
|
28
|
-
id: string
|
|
29
|
-
name: string
|
|
30
|
-
title: string
|
|
31
|
-
description: string
|
|
32
|
-
created_at: string | null
|
|
33
|
-
updated_at: string | null
|
|
34
|
-
deleted_at: string | null
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type Api_Project_Dto = {
|
|
38
|
-
id: string
|
|
39
|
-
name: string
|
|
40
|
-
description: null
|
|
41
|
-
image: null
|
|
42
|
-
plan_date: string | null
|
|
43
|
-
deadline: string | null
|
|
44
|
-
fact_start_date: string | null
|
|
45
|
-
fact_end_date: string | null
|
|
46
|
-
planned_start: string | null
|
|
47
|
-
planned_end: string | null
|
|
48
|
-
deleted_at: string | null
|
|
49
|
-
completed_at: string | null
|
|
50
|
-
total_tasks: number
|
|
51
|
-
is_archive: boolean
|
|
52
|
-
teams: Api_Project_Team[]
|
|
53
|
-
status: Api_Project_Status
|
|
54
|
-
category: Api_Project_Category
|
|
55
|
-
repair: Api_Project_Repair | null
|
|
56
|
-
schedule_id: string | null
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export type Api_Project_Add_Root_Intervals_Payload = {
|
|
60
|
-
history: number
|
|
61
|
-
with_status_in_progress: number
|
|
62
|
-
}
|
|
1
|
+
export type Api_Project_Repair = {
|
|
2
|
+
id: string
|
|
3
|
+
name: string
|
|
4
|
+
start_date: null | string
|
|
5
|
+
end_date: null | string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type Api_Project_Team = {
|
|
9
|
+
id: string
|
|
10
|
+
name: string
|
|
11
|
+
display_name: string
|
|
12
|
+
description: string
|
|
13
|
+
created_at: string
|
|
14
|
+
updated_at: string
|
|
15
|
+
pivot: {
|
|
16
|
+
project_id: string
|
|
17
|
+
team_id: string
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type Api_Project_Category = {
|
|
22
|
+
code: number
|
|
23
|
+
display_name: string
|
|
24
|
+
name: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type Api_Project_Status = {
|
|
28
|
+
id: string
|
|
29
|
+
name: string
|
|
30
|
+
title: string
|
|
31
|
+
description: string
|
|
32
|
+
created_at: string | null
|
|
33
|
+
updated_at: string | null
|
|
34
|
+
deleted_at: string | null
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type Api_Project_Dto = {
|
|
38
|
+
id: string
|
|
39
|
+
name: string
|
|
40
|
+
description: null
|
|
41
|
+
image: null
|
|
42
|
+
plan_date: string | null
|
|
43
|
+
deadline: string | null
|
|
44
|
+
fact_start_date: string | null
|
|
45
|
+
fact_end_date: string | null
|
|
46
|
+
planned_start: string | null
|
|
47
|
+
planned_end: string | null
|
|
48
|
+
deleted_at: string | null
|
|
49
|
+
completed_at: string | null
|
|
50
|
+
total_tasks: number
|
|
51
|
+
is_archive: boolean
|
|
52
|
+
teams: Api_Project_Team[]
|
|
53
|
+
status: Api_Project_Status
|
|
54
|
+
category: Api_Project_Category
|
|
55
|
+
repair: Api_Project_Repair | null
|
|
56
|
+
schedule_id: string | null
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type Api_Project_Add_Root_Intervals_Payload = {
|
|
60
|
+
history: number
|
|
61
|
+
with_status_in_progress: number
|
|
62
|
+
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
export type Api_Schedule_Shift_Template = {
|
|
2
|
-
id: string
|
|
3
|
-
name: string
|
|
4
|
-
from: string
|
|
5
|
-
to: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export type Api_Schedule_Config = {
|
|
9
|
-
shift_templates: Api_Schedule_Shift_Template[]
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type Api_Schedule_Complete_Brigade = {
|
|
13
|
-
brigade_id: string
|
|
14
|
-
initial_first: string
|
|
15
|
-
initial_last: string
|
|
16
|
-
shift_template_id: string
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type Api_Schedule_Table_Brigade = {
|
|
20
|
-
id: string
|
|
21
|
-
name: string
|
|
22
|
-
initial_first: string
|
|
23
|
-
initial_last: string
|
|
24
|
-
initial_shift_template: Api_Schedule_Shift_Template
|
|
25
|
-
assigned_positions: number
|
|
26
|
-
total_positions: number
|
|
27
|
-
task_master: unknown | null
|
|
28
|
-
is_deleted: boolean
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type Api_Schedule_Add_Shift = {
|
|
32
|
-
brigade_id: string
|
|
33
|
-
dates: string[]
|
|
34
|
-
shift_template_id: string
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type Api_Schedule_Swap_Shifts = {
|
|
38
|
-
brigade_id: string
|
|
39
|
-
shifts: string[]
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export type Api_Schedule_Edit_Shifts = {
|
|
43
|
-
brigade_id: string
|
|
44
|
-
shift_ids: string[]
|
|
45
|
-
shift_template_id: string
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export type Api_Schedule_Shift = {
|
|
49
|
-
id: string
|
|
50
|
-
from: string
|
|
51
|
-
to: string
|
|
52
|
-
shift_template: Api_Schedule_Shift_Template
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export type Api_Schedule_Item = {
|
|
56
|
-
brigade: Api_Schedule_Table_Brigade
|
|
57
|
-
shifts: { date: string; shift: Api_Schedule_Shift }[]
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export type Api_Schedule_Brigade_To_Swap = {
|
|
61
|
-
id: string
|
|
62
|
-
name: string
|
|
63
|
-
shift_template: Api_Schedule_Shift_Template
|
|
64
|
-
}
|
|
1
|
+
export type Api_Schedule_Shift_Template = {
|
|
2
|
+
id: string
|
|
3
|
+
name: string
|
|
4
|
+
from: string
|
|
5
|
+
to: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type Api_Schedule_Config = {
|
|
9
|
+
shift_templates: Api_Schedule_Shift_Template[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type Api_Schedule_Complete_Brigade = {
|
|
13
|
+
brigade_id: string
|
|
14
|
+
initial_first: string
|
|
15
|
+
initial_last: string
|
|
16
|
+
shift_template_id: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type Api_Schedule_Table_Brigade = {
|
|
20
|
+
id: string
|
|
21
|
+
name: string
|
|
22
|
+
initial_first: string
|
|
23
|
+
initial_last: string
|
|
24
|
+
initial_shift_template: Api_Schedule_Shift_Template
|
|
25
|
+
assigned_positions: number
|
|
26
|
+
total_positions: number
|
|
27
|
+
task_master: unknown | null
|
|
28
|
+
is_deleted: boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type Api_Schedule_Add_Shift = {
|
|
32
|
+
brigade_id: string
|
|
33
|
+
dates: string[]
|
|
34
|
+
shift_template_id: string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type Api_Schedule_Swap_Shifts = {
|
|
38
|
+
brigade_id: string
|
|
39
|
+
shifts: string[]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type Api_Schedule_Edit_Shifts = {
|
|
43
|
+
brigade_id: string
|
|
44
|
+
shift_ids: string[]
|
|
45
|
+
shift_template_id: string
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type Api_Schedule_Shift = {
|
|
49
|
+
id: string
|
|
50
|
+
from: string
|
|
51
|
+
to: string
|
|
52
|
+
shift_template: Api_Schedule_Shift_Template
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type Api_Schedule_Item = {
|
|
56
|
+
brigade: Api_Schedule_Table_Brigade
|
|
57
|
+
shifts: { date: string; shift: Api_Schedule_Shift }[]
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type Api_Schedule_Brigade_To_Swap = {
|
|
61
|
+
id: string
|
|
62
|
+
name: string
|
|
63
|
+
shift_template: Api_Schedule_Shift_Template
|
|
64
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type ResponseApi<T> = {
|
|
2
|
-
count: number
|
|
3
|
-
current_page: number
|
|
4
|
-
data: T
|
|
5
|
-
per_page: number
|
|
6
|
-
total: number
|
|
7
|
-
total_pages: number
|
|
8
|
-
filter_value?: Record<string, any[]>
|
|
9
|
-
}
|
|
1
|
+
export type ResponseApi<T> = {
|
|
2
|
+
count: number
|
|
3
|
+
current_page: number
|
|
4
|
+
data: T
|
|
5
|
+
per_page: number
|
|
6
|
+
total: number
|
|
7
|
+
total_pages: number
|
|
8
|
+
filter_value?: Record<string, any[]>
|
|
9
|
+
}
|
|
@@ -1,173 +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>
|
|
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>
|