shared-ritm 1.1.15 → 1.1.17
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 +14404 -4675
- package/dist/shared-ritm.umd.js +12 -7
- package/dist/types/index.d.ts +2 -1
- package/dist/types/utils/confirm.d.ts +1 -0
- package/dist/types/utils/notification.d.ts +2 -5
- package/package.json +1 -1
- package/src/App.vue +18 -2
- package/src/common/app-dialogs/AppConfirmDialog.vue +100 -0
- package/src/icons/dialogs/RemoveIcon.vue +12 -0
- package/src/icons/dialogs/SafetyIcon.vue +12 -0
- package/src/index.ts +2 -0
- package/src/main.ts +2 -2
- package/src/utils/confirm.ts +12 -0
- package/src/utils/notification.ts +7 -10
package/dist/types/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import AppSheet from '@/common/app-sheet/AppSheet.vue';
|
|
|
12
12
|
import AppSidebar from '@/common/app-sidebar/AppSidebar.vue';
|
|
13
13
|
import AppToggle from '@/common/app-toggle/AppToggle.vue';
|
|
14
14
|
import AppWrapper from '@/common/app-wrapper/AppWrapper.vue';
|
|
15
|
+
import AppConfirmDialog from '@/common/app-dialogs/AppConfirmDialog.vue';
|
|
15
16
|
import useGanttService from '@/api/services/GanttService';
|
|
16
17
|
import useMetricsService from '@/api/services/MetricsService';
|
|
17
18
|
import useProjectsService from '@/api/services/ProjectsService';
|
|
@@ -19,7 +20,7 @@ import useRepairsService from '@/api/services/RepairsService';
|
|
|
19
20
|
import useTasksService from '@/api/services/TasksService';
|
|
20
21
|
import useAuthService from '@/api/services/AuthService';
|
|
21
22
|
import ApiService from '@/api/settings/ApiService';
|
|
22
|
-
export { AppButton, AppCheckbox, AppDatePicker, AppInput, AppInputSearch, AppLayout, AppLayoutHeader, AppLoader, AppSelect, AppSheet, AppSidebar, AppToggle, AppWrapper, };
|
|
23
|
+
export { AppButton, AppCheckbox, AppDatePicker, AppInput, AppInputSearch, AppLayout, AppLayoutHeader, AppLoader, AppSelect, AppSheet, AppSidebar, AppToggle, AppWrapper, AppConfirmDialog, };
|
|
23
24
|
export { ApiService, useAuthService, useGanttService, useMetricsService, useProjectsService, useRepairsService, useTasksService, };
|
|
24
25
|
export type { NotificationType } from './utils/notification';
|
|
25
26
|
export { notificationSettings } from './utils/notification';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const appConfirm: (content: string, type: "delete" | "edit") => import("quasar").DialogChainObject;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
+
import { QNotifyCreateOptions } from 'quasar';
|
|
1
2
|
export type NotificationType = 'danger' | 'success' | 'warning' | 'info' | 'default';
|
|
2
|
-
export declare const notificationSettings: (type: NotificationType, message: string) =>
|
|
3
|
-
message: string;
|
|
4
|
-
color: string;
|
|
5
|
-
position: string;
|
|
6
|
-
};
|
|
3
|
+
export declare const notificationSettings: (type: NotificationType, message: string) => QNotifyCreateOptions;
|
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -7,21 +7,30 @@
|
|
|
7
7
|
<app-sidebar :is-drawer="true" :menu-items="menuItems" />
|
|
8
8
|
</template>
|
|
9
9
|
<div class="wrapper">
|
|
10
|
-
<app-button
|
|
10
|
+
<app-button
|
|
11
|
+
label="asad"
|
|
12
|
+
color="primary"
|
|
13
|
+
@click="openConfirm('После подтверждения проект будет удалён', 'delete')"
|
|
14
|
+
/>
|
|
11
15
|
<app-input v-model="test" type="text" />
|
|
12
16
|
</div>
|
|
13
17
|
</app-layout>
|
|
14
18
|
</template>
|
|
15
19
|
|
|
16
20
|
<script setup lang="ts">
|
|
21
|
+
import { useQuasar } from 'quasar'
|
|
17
22
|
import AppButton from '@/common/app-button/AppButton.vue'
|
|
18
23
|
import AppInput from '@/common/app-input/AppInput.vue'
|
|
19
|
-
import { ref } from 'vue'
|
|
24
|
+
import { defineAsyncComponent, ref } from 'vue'
|
|
20
25
|
import AppSidebar from '@/common/app-sidebar/AppSidebar.vue'
|
|
21
26
|
import AppLayout from '@/common/app-layout/AppLayout.vue'
|
|
22
27
|
import AppLayoutHeader from '@/common/app-layout/components/AppLayoutHeader.vue'
|
|
23
28
|
const test = ref('sdf')
|
|
24
29
|
|
|
30
|
+
const $q = useQuasar()
|
|
31
|
+
|
|
32
|
+
const AppConfirmDialog = defineAsyncComponent(() => import('@/common/app-dialogs/AppConfirmDialog.vue'))
|
|
33
|
+
|
|
25
34
|
const userData = {
|
|
26
35
|
id: '9d340f1a-8d46-4606-b102-76d0a8a70e10',
|
|
27
36
|
last_name: 'Савин',
|
|
@@ -2402,6 +2411,13 @@ const menuItems = ref([
|
|
|
2402
2411
|
{ name: 'notification', icon: 'notification-icon', label: 'Уведомления', to: '/notification' },
|
|
2403
2412
|
{ name: 'sign-out', icon: 'logout-icon', label: 'Выход', to: '/sign-out' },
|
|
2404
2413
|
])
|
|
2414
|
+
|
|
2415
|
+
const openConfirm = (content: string, type: 'delete' | 'edit') => {
|
|
2416
|
+
return $q.dialog({
|
|
2417
|
+
component: AppConfirmDialog,
|
|
2418
|
+
componentProps: { content, type },
|
|
2419
|
+
})
|
|
2420
|
+
}
|
|
2405
2421
|
</script>
|
|
2406
2422
|
<style lang="scss">
|
|
2407
2423
|
.wrapper {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-dialog ref="dialogRef" persistent transition-show="slide-up" transition-hide="slide-down" :class="$style.dialog">
|
|
3
|
+
<q-card :class="$style.modal">
|
|
4
|
+
<q-card-section :class="$style['modal__content']">
|
|
5
|
+
<div :class="$style['modal__content__header']">
|
|
6
|
+
<safety-icon v-if="type === 'edit'" />
|
|
7
|
+
<remove-icon v-if="type === 'delete'" />
|
|
8
|
+
<h4>Подтвердить ?</h4>
|
|
9
|
+
</div>
|
|
10
|
+
<p>{{ content }}</p>
|
|
11
|
+
</q-card-section>
|
|
12
|
+
<q-card-section :class="$style.footer">
|
|
13
|
+
<app-button :class="$style['footer__btn--ok']" label="Подтвердить" @click="onDialogOK" />
|
|
14
|
+
<app-button :class="$style['footer__btn--cancel']" label="Отменить" @click="onDialogHide" />
|
|
15
|
+
</q-card-section>
|
|
16
|
+
</q-card>
|
|
17
|
+
</q-dialog>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import { useDialogPluginComponent } from 'quasar'
|
|
22
|
+
import { AppButton } from 'shared-ritm'
|
|
23
|
+
import SafetyIcon from '@/icons/dialogs/SafetyIcon.vue'
|
|
24
|
+
import RemoveIcon from '@/icons/dialogs/RemoveIcon.vue'
|
|
25
|
+
|
|
26
|
+
const { onDialogHide, onDialogOK, dialogRef } = useDialogPluginComponent()
|
|
27
|
+
|
|
28
|
+
interface Props {
|
|
29
|
+
content: string
|
|
30
|
+
type: 'delete' | 'edit'
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const props = defineProps<Props>()
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style lang="scss" module>
|
|
37
|
+
.modal {
|
|
38
|
+
font-family: NunitoSansFont, sans-serif;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
width: 400px;
|
|
42
|
+
height: 409px;
|
|
43
|
+
border-radius: 24px !important;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
padding: 40px;
|
|
46
|
+
&__content {
|
|
47
|
+
margin: auto;
|
|
48
|
+
flex-grow: 1;
|
|
49
|
+
&__header {
|
|
50
|
+
width: 100%;
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 16px;
|
|
56
|
+
h4 {
|
|
57
|
+
font-size: 24px;
|
|
58
|
+
font-weight: 600;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
p {
|
|
63
|
+
margin-top: 14px;
|
|
64
|
+
margin-bottom: 0;
|
|
65
|
+
font-size: 16px;
|
|
66
|
+
text-align: center;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.footer {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
gap: 12px;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
//height: 146px;
|
|
77
|
+
padding: 0;
|
|
78
|
+
&__btn--ok,
|
|
79
|
+
&__btn--cancel {
|
|
80
|
+
background-color: #3f8cff;
|
|
81
|
+
border-radius: 9px;
|
|
82
|
+
color: white;
|
|
83
|
+
font-size: 16px;
|
|
84
|
+
font-weight: bold;
|
|
85
|
+
width: 300px;
|
|
86
|
+
height: 48px;
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
span {
|
|
89
|
+
color: white;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
&__btn--cancel {
|
|
93
|
+
background-color: white;
|
|
94
|
+
border: 1px solid #3f8cff;
|
|
95
|
+
span {
|
|
96
|
+
color: #3f8cff;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60" fill="none">
|
|
3
|
+
<path
|
|
4
|
+
fill-rule="evenodd"
|
|
5
|
+
clip-rule="evenodd"
|
|
6
|
+
d="M35 2.5C38.9942 2.5 42.2592 5.6223 42.4873 9.55932L42.5 10V12.5H47.5H52.5C53.8807 12.5 55 13.6193 55 15C55 16.2821 54.0349 17.3388 52.7916 17.4832L52.5 17.5H50V50C50 53.9942 46.8777 57.2592 42.9407 57.4873L42.5 57.5H17.5C13.5058 57.5 10.2408 54.3777 10.0127 50.4407L10 50V17.5H7.5C6.11929 17.5 5 16.3807 5 15C5 13.7179 5.9651 12.6612 7.20845 12.5168L7.5 12.5H12.5H17.5V10C17.5 6.0058 20.6223 2.74085 24.5593 2.51273L25 2.5H35ZM15 17.5V50C15 51.2821 15.9651 52.3388 17.2084 52.4832L17.5 52.5H42.5C43.7821 52.5 44.8388 51.5349 44.9832 50.2916L45 50V17.5H40H20H15ZM37.5 12.5H22.5V10L22.5168 9.70845C22.6612 8.4651 23.7179 7.5 25 7.5H35L35.2916 7.51682C36.5349 7.66123 37.5 8.71791 37.5 10V12.5ZM25 25C26.2821 25 27.3388 25.9651 27.4832 27.2084L27.5 27.5V42.5C27.5 43.8807 26.3807 45 25 45C23.7179 45 22.6612 44.0349 22.5168 42.7916L22.5 42.5V27.5C22.5 26.1193 23.6193 25 25 25ZM37.4832 27.2084C37.3388 25.9651 36.2821 25 35 25C33.6193 25 32.5 26.1193 32.5 27.5V42.5L32.5168 42.7916C32.6612 44.0349 33.7179 45 35 45C36.3807 45 37.5 43.8807 37.5 42.5V27.5L37.4832 27.2084Z"
|
|
7
|
+
fill="#F65160"
|
|
8
|
+
/>
|
|
9
|
+
</svg>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path
|
|
4
|
+
fill-rule="evenodd"
|
|
5
|
+
clip-rule="evenodd"
|
|
6
|
+
d="M47.5 2.5H12.5C6.97715 2.5 2.5 6.97715 2.5 12.5V25C2.5 35.9165 9.14893 45.4216 22.0963 53.4484C26.938 56.45 33.062 56.45 37.9037 53.4484L38.8284 52.8657C51.1712 44.9576 57.5 35.6473 57.5 25V12.5C57.5 6.97715 53.0228 2.5 47.5 2.5ZM12.5 7.5H47.5C50.2614 7.5 52.5 9.73858 52.5 12.5V25C52.5 33.7331 47.1592 41.5899 36.1469 48.6456L35.2535 49.2085C32.0413 51.1999 27.9586 51.1999 24.7309 49.1988C13.1268 42.0048 7.5 33.9609 7.5 25V12.5C7.5 9.73858 9.73858 7.5 12.5 7.5ZM44.2833 15.7258C43.3072 14.7492 41.7243 14.7488 40.7477 15.7248L27.5 28.9625L21.7783 23.2302L21.543 23.0221C20.5629 22.2587 19.1448 22.3268 18.2428 23.2273C17.2657 24.2028 17.2643 25.7857 18.2398 26.7628L25.7308 34.2663L25.9662 34.4745C26.9467 35.2382 28.3655 35.1696 29.2673 34.2682L44.2823 19.2613L44.4904 19.0258C45.2532 18.0453 45.1842 16.6272 44.2833 15.7258Z"
|
|
7
|
+
fill="#00D097"
|
|
8
|
+
/>
|
|
9
|
+
</svg>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<style scoped lang="scss"></style>
|
package/src/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ import AppSheet from '@/common/app-sheet/AppSheet.vue'
|
|
|
12
12
|
import AppSidebar from '@/common/app-sidebar/AppSidebar.vue'
|
|
13
13
|
import AppToggle from '@/common/app-toggle/AppToggle.vue'
|
|
14
14
|
import AppWrapper from '@/common/app-wrapper/AppWrapper.vue'
|
|
15
|
+
import AppConfirmDialog from '@/common/app-dialogs/AppConfirmDialog.vue'
|
|
15
16
|
|
|
16
17
|
import useGanttService from '@/api/services/GanttService'
|
|
17
18
|
import useMetricsService from '@/api/services/MetricsService'
|
|
@@ -35,6 +36,7 @@ export {
|
|
|
35
36
|
AppSidebar,
|
|
36
37
|
AppToggle,
|
|
37
38
|
AppWrapper,
|
|
39
|
+
AppConfirmDialog,
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
export {
|
package/src/main.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createApp } from 'vue'
|
|
2
|
-
import { Quasar } from 'quasar'
|
|
2
|
+
import { Quasar, quasarUserOptions } from './quasar-user-options'
|
|
3
3
|
|
|
4
4
|
import '@quasar/extras/material-icons/material-icons.css'
|
|
5
5
|
import 'quasar/src/css/index.sass'
|
|
@@ -11,5 +11,5 @@ import App from './App.vue'
|
|
|
11
11
|
const app = createApp(App)
|
|
12
12
|
|
|
13
13
|
//@ts-ignore
|
|
14
|
-
app.use(Quasar,
|
|
14
|
+
app.use(Quasar, quasarUserOptions)
|
|
15
15
|
app.mount('#app')
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineAsyncComponent } from 'vue'
|
|
2
|
+
import { useQuasar } from 'quasar'
|
|
3
|
+
const $q = useQuasar()
|
|
4
|
+
|
|
5
|
+
const AppConfirmDialog = defineAsyncComponent(() => import('@/common/app-dialogs/AppConfirmDialog.vue'))
|
|
6
|
+
|
|
7
|
+
export const appConfirm = (content: string, type: 'delete' | 'edit') => {
|
|
8
|
+
return $q.dialog({
|
|
9
|
+
component: AppConfirmDialog,
|
|
10
|
+
componentProps: { content, type },
|
|
11
|
+
})
|
|
12
|
+
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
import { QNotifyCreateOptions } from 'quasar'
|
|
2
|
+
|
|
1
3
|
export type NotificationType = 'danger' | 'success' | 'warning' | 'info' | 'default'
|
|
2
4
|
|
|
3
|
-
export const notificationSettings = (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
message,
|
|
9
|
-
color: type === 'danger' ? 'red' : type === 'success' ? 'green' : type === 'warning' ? 'orange' : 'white',
|
|
10
|
-
position: 'top-right',
|
|
11
|
-
}
|
|
12
|
-
}
|
|
5
|
+
export const notificationSettings = (type: NotificationType, message: string): QNotifyCreateOptions => ({
|
|
6
|
+
message,
|
|
7
|
+
color: type === 'danger' ? 'red' : type === 'success' ? 'green' : type === 'warning' ? 'orange' : 'white',
|
|
8
|
+
position: 'top-right',
|
|
9
|
+
})
|