shared-ritm 1.2.56 → 1.2.57

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.
Files changed (78) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared-ritm.es.js +5338 -5334
  3. package/dist/shared-ritm.umd.js +6 -6
  4. package/dist/types/utils/helpers.d.ts +17 -0
  5. package/package.json +1 -1
  6. package/src/App.vue +2461 -2461
  7. package/src/api/services/AuthService.ts +58 -58
  8. package/src/api/services/ControlsService.ts +64 -64
  9. package/src/api/services/FileService.ts +15 -15
  10. package/src/api/services/TasksService.ts +137 -137
  11. package/src/api/settings/ApiService.ts +128 -128
  12. package/src/api/types/Api_Controls.ts +72 -72
  13. package/src/common/app-button/AppButton.vue +173 -173
  14. package/src/common/app-date-picker/AppDatePicker.vue +81 -81
  15. package/src/common/app-icon/AppIcon.vue +108 -108
  16. package/src/common/app-input/AppInput.vue +147 -147
  17. package/src/common/app-input-search/AppInputSearch.vue +174 -174
  18. package/src/common/app-layout/AppLayout.vue +84 -84
  19. package/src/common/app-layout/components/AppLayoutHeader.vue +246 -246
  20. package/src/common/app-layout/components/AppLayoutPage.vue +16 -16
  21. package/src/common/app-loader/index.vue +43 -43
  22. package/src/common/app-page-layout/AppPageLayout.vue +122 -122
  23. package/src/common/app-sidebar/AppSidebar.vue +168 -168
  24. package/src/common/app-sidebar/components/SidebarMenu.vue +37 -37
  25. package/src/common/app-table/AppTable.vue +241 -244
  26. package/src/common/app-table/AppTableLayout.vue +102 -104
  27. package/src/common/app-table/components/ModalSelect.vue +264 -264
  28. package/src/common/app-table/components/TableModal.vue +329 -357
  29. package/src/common/app-table/components/TablePagination.vue +150 -151
  30. package/src/common/app-table/components/TableSearch.vue +76 -78
  31. package/src/common/app-table/controllers/useBaseTable.ts +42 -42
  32. package/src/common/app-table/controllers/useTableModel.ts +93 -93
  33. package/src/global.d.ts +1 -1
  34. package/src/icons/components/arrow-down-icon.vue +25 -25
  35. package/src/icons/components/arrow-frame-icon.vue +19 -19
  36. package/src/icons/components/arrow-square.vue +22 -22
  37. package/src/icons/header/NotificationIcon.vue +18 -18
  38. package/src/icons/header/PersonIcon.vue +11 -11
  39. package/src/icons/header/SettingIcon.vue +14 -14
  40. package/src/icons/header/flashIcon.vue +24 -24
  41. package/src/icons/header/searchStatusIcon.vue +24 -24
  42. package/src/icons/header/smallCapsIcon.vue +34 -34
  43. package/src/icons/sidebar/assign-module-icon.vue +36 -36
  44. package/src/icons/sidebar/instrument-history-icon.vue +32 -32
  45. package/src/icons/sidebar/instrument-order-icon.vue +38 -38
  46. package/src/icons/sidebar/instrument-work-zone-icon.vue +18 -18
  47. package/src/icons/sidebar/instruments-icon.vue +45 -45
  48. package/src/icons/sidebar/logo-icon.vue +15 -15
  49. package/src/icons/sidebar/logout-icon.vue +13 -13
  50. package/src/icons/sidebar/modules-icon.vue +16 -16
  51. package/src/icons/sidebar/notifications-icon.vue +24 -24
  52. package/src/icons/sidebar/order-icon.vue +44 -44
  53. package/src/icons/sidebar/pass-icon.vue +38 -38
  54. package/src/icons/sidebar/positions-icon.vue +42 -42
  55. package/src/icons/sidebar/preorder-icon.vue +19 -19
  56. package/src/icons/sidebar/projects-icon.vue +31 -31
  57. package/src/icons/sidebar/repair-object-icon.vue +18 -18
  58. package/src/icons/sidebar/repairs-icon.vue +20 -20
  59. package/src/icons/sidebar/roles-icon.vue +26 -26
  60. package/src/icons/sidebar/status-history-icon.vue +24 -24
  61. package/src/icons/sidebar/tasks-icon.vue +28 -28
  62. package/src/icons/sidebar/tasks_tasks-icon.vue +39 -39
  63. package/src/icons/sidebar/tasks_today-icon.vue +27 -27
  64. package/src/icons/sidebar/teams-icon.vue +32 -32
  65. package/src/icons/sidebar/user-icon.vue +18 -18
  66. package/src/icons/sidebar/users-icon.vue +46 -46
  67. package/src/icons/sidebar/videosources-icon.vue +19 -19
  68. package/src/icons/sidebar/videowall-icon.vue +13 -13
  69. package/src/icons/sidebar/videozones-icon.vue +21 -21
  70. package/src/icons/sidebar/warehouses-icon.vue +43 -43
  71. package/src/icons/sidebar/workshop-icon.vue +100 -100
  72. package/src/icons/sidebar/workzones-icon.vue +22 -22
  73. package/src/index.ts +84 -84
  74. package/src/main.ts +28 -28
  75. package/src/quasar-user-options.ts +17 -17
  76. package/src/router/index.ts +10 -10
  77. package/src/shims-vue.d.ts +5 -5
  78. package/src/utils/helpers.ts +39 -0
@@ -1,151 +1,150 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
- import { defineProps, defineEmits } from 'vue'
4
-
5
- const props = defineProps<{
6
- modelValue: number
7
- totalPages: number
8
- }>()
9
-
10
- const emit = defineEmits<{
11
- (e: 'update:modelValue', value: number): void
12
- (e: 'page-change', value: number): void
13
- }>()
14
-
15
- const currentPage = computed({
16
- get: () => props.modelValue,
17
- set: (val: number) => {
18
- emit('update:modelValue', val)
19
- emit('page-change', val)
20
- },
21
- })
22
-
23
- const pageArray = computed(() => {
24
- const maxPagesToShow = 5
25
- let startPage = 1
26
- let endPage = props.totalPages
27
- const pages: (number | string)[] = []
28
-
29
- if (props.totalPages <= maxPagesToShow) {
30
- for (let i = 1; i <= props.totalPages; i++) pages.push(i)
31
- } else {
32
- if (props.modelValue <= 3) {
33
- startPage = 1
34
- endPage = maxPagesToShow - 1
35
- } else if (props.modelValue + 2 >= props.totalPages) {
36
- startPage = props.totalPages - (maxPagesToShow - 2)
37
- endPage = props.totalPages
38
- } else {
39
- startPage = props.modelValue - 2
40
- endPage = props.modelValue + 2
41
- }
42
-
43
- for (let i = startPage; i <= endPage; i++) pages.push(i)
44
-
45
- if (startPage > 1) {
46
- pages.unshift('...')
47
- pages.unshift(1)
48
- }
49
- if (endPage < props.totalPages) {
50
- pages.push('...')
51
- pages.push(props.totalPages)
52
- }
53
- }
54
-
55
- return pages
56
- })
57
-
58
- function changePage(page: number | string) {
59
- if (typeof page === 'number' && page !== props.modelValue) {
60
- currentPage.value = page
61
- }
62
- }
63
-
64
- function prevPage() {
65
- if (props.modelValue > 1) currentPage.value = props.modelValue - 1
66
- }
67
-
68
- function nextPage() {
69
- if (props.modelValue < props.totalPages) currentPage.value = props.modelValue + 1
70
- }
71
- </script>
72
-
73
- <template>
74
- <div class="table-pagination">
75
- <button class="arrow-button" :disabled="modelValue <= 1" @click="prevPage">
76
- <q-icon name="mdi-chevron-left" :color="modelValue <= 1 ? 'grey-4' : 'primary'" />
77
- </button>
78
-
79
- <div class="pages">
80
- <button
81
- v-for="page in pageArray"
82
- :key="page"
83
- class="page-button"
84
- :class="{ selected: page === modelValue, ellipsis: page === '...' }"
85
- :disabled="page === modelValue || page === '...'"
86
- @click="changePage(page)"
87
- >
88
- {{ page }}
89
- </button>
90
- </div>
91
-
92
- <button class="arrow-button" :disabled="modelValue >= totalPages" @click="nextPage">
93
- <q-icon name="mdi-chevron-right" :color="modelValue >= totalPages ? 'grey-4' : 'primary'" />
94
- </button>
95
- </div>
96
- </template>
97
-
98
- <style scoped lang="scss">
99
- .pages {
100
- display: flex;
101
- gap: 20px;
102
- }
103
- .table-pagination {
104
- display: flex;
105
- justify-content: start;
106
- align-items: center;
107
- gap: 20px;
108
- flex-wrap: wrap;
109
- margin-top: 17px;
110
- margin-bottom: 15px;
111
- .arrow-button,
112
- .page-button {
113
- width: 34px;
114
- height: 34px;
115
- border-radius: 4px;
116
- background: white;
117
- border: none;
118
- cursor: pointer;
119
- font-weight: 500;
120
- color: #3f8cff;
121
- font-size: 16px;
122
- transition: all 0.2s ease;
123
- }
124
-
125
- .page-button.selected {
126
- background: #3f8cff;
127
- color: white;
128
- cursor: not-allowed;
129
- }
130
-
131
- .page-button.ellipsis {
132
- cursor: default;
133
- color: #aab2c8;
134
- font-weight: 400;
135
- }
136
-
137
- .arrow-button:disabled {
138
- cursor: not-allowed;
139
- background: white;
140
- }
141
-
142
- @media (max-width: 768px) {
143
- .arrow-button,
144
- .page-button {
145
- width: 32px;
146
- height: 32px;
147
- font-size: 14px;
148
- }
149
- }
150
- }
151
- </style>
1
+ <template>
2
+ <div class="table-pagination">
3
+ <button class="arrow-button" :disabled="modelValue <= 1" @click="prevPage">
4
+ <q-icon name="mdi-chevron-left" :color="modelValue <= 1 ? 'grey-4' : 'primary'" />
5
+ </button>
6
+
7
+ <div class="pages">
8
+ <button
9
+ v-for="page in pageArray"
10
+ :key="page"
11
+ class="page-button"
12
+ :class="{ selected: page === modelValue, ellipsis: page === '...' }"
13
+ :disabled="page === modelValue || page === '...'"
14
+ @click="changePage(page)"
15
+ >
16
+ {{ page }}
17
+ </button>
18
+ </div>
19
+
20
+ <button class="arrow-button" :disabled="modelValue >= totalPages" @click="nextPage">
21
+ <q-icon name="mdi-chevron-right" :color="modelValue >= totalPages ? 'grey-4' : 'primary'" />
22
+ </button>
23
+ </div>
24
+ </template>
25
+ <script setup lang="ts">
26
+ import { computed } from 'vue'
27
+ import { defineProps, defineEmits } from 'vue'
28
+
29
+ const props = defineProps<{
30
+ modelValue: number
31
+ totalPages: number
32
+ }>()
33
+
34
+ const emit = defineEmits<{
35
+ (e: 'update:modelValue', value: number): void
36
+ (e: 'page-change', value: number): void
37
+ }>()
38
+
39
+ const currentPage = computed({
40
+ get: () => props.modelValue,
41
+ set: (val: number) => {
42
+ emit('update:modelValue', val)
43
+ emit('page-change', val)
44
+ },
45
+ })
46
+
47
+ const pageArray = computed(() => {
48
+ const maxPagesToShow = 5
49
+ let startPage = 1
50
+ let endPage = props.totalPages
51
+ const pages: (number | string)[] = []
52
+
53
+ if (props.totalPages <= maxPagesToShow) {
54
+ for (let i = 1; i <= props.totalPages; i++) pages.push(i)
55
+ } else {
56
+ if (props.modelValue <= 3) {
57
+ startPage = 1
58
+ endPage = maxPagesToShow - 1
59
+ } else if (props.modelValue + 2 >= props.totalPages) {
60
+ startPage = props.totalPages - (maxPagesToShow - 2)
61
+ endPage = props.totalPages
62
+ } else {
63
+ startPage = props.modelValue - 2
64
+ endPage = props.modelValue + 2
65
+ }
66
+
67
+ for (let i = startPage; i <= endPage; i++) pages.push(i)
68
+
69
+ if (startPage > 1) {
70
+ pages.unshift('...')
71
+ pages.unshift(1)
72
+ }
73
+ if (endPage < props.totalPages) {
74
+ pages.push('...')
75
+ pages.push(props.totalPages)
76
+ }
77
+ }
78
+
79
+ return pages
80
+ })
81
+
82
+ function changePage(page: number | string) {
83
+ if (typeof page === 'number' && page !== props.modelValue) {
84
+ currentPage.value = page
85
+ }
86
+ }
87
+
88
+ function prevPage() {
89
+ if (props.modelValue > 1) currentPage.value = props.modelValue - 1
90
+ }
91
+
92
+ function nextPage() {
93
+ if (props.modelValue < props.totalPages) currentPage.value = props.modelValue + 1
94
+ }
95
+ </script>
96
+
97
+ <style scoped lang="scss">
98
+ .pages {
99
+ display: flex;
100
+ gap: 20px;
101
+ }
102
+ .table-pagination {
103
+ display: flex;
104
+ justify-content: start;
105
+ align-items: center;
106
+ gap: 20px;
107
+ flex-wrap: wrap;
108
+ margin-top: 17px;
109
+ margin-bottom: 15px;
110
+ .arrow-button,
111
+ .page-button {
112
+ width: 34px;
113
+ height: 34px;
114
+ border-radius: 4px;
115
+ background: white;
116
+ border: none;
117
+ cursor: pointer;
118
+ font-weight: 500;
119
+ color: #3f8cff;
120
+ font-size: 16px;
121
+ transition: all 0.2s ease;
122
+ }
123
+
124
+ .page-button.selected {
125
+ background: #3f8cff;
126
+ color: white;
127
+ cursor: not-allowed;
128
+ }
129
+
130
+ .page-button.ellipsis {
131
+ cursor: default;
132
+ color: #aab2c8;
133
+ font-weight: 400;
134
+ }
135
+
136
+ .arrow-button:disabled {
137
+ cursor: not-allowed;
138
+ background: white;
139
+ }
140
+
141
+ @media (max-width: 768px) {
142
+ .arrow-button,
143
+ .page-button {
144
+ width: 32px;
145
+ height: 32px;
146
+ font-size: 14px;
147
+ }
148
+ }
149
+ }
150
+ </style>
@@ -1,78 +1,76 @@
1
- <script setup lang="ts">
2
- import { defineProps, defineEmits, ref, watch } from 'vue'
3
-
4
- const props = defineProps<{
5
- modelValue: string
6
- placeholder: string
7
- }>()
8
-
9
- const emit = defineEmits<{
10
- (e: 'update:modelValue', value: string): void
11
- (e: 'search', value: string): void
12
- }>()
13
-
14
- const input = ref(props.modelValue)
15
- let debounceTimer: ReturnType<typeof setTimeout>
16
-
17
- watch(
18
- () => props.modelValue,
19
- val => {
20
- input.value = val
21
- },
22
- )
23
-
24
- watch(input, val => {
25
- emit('update:modelValue', val)
26
- clearTimeout(debounceTimer)
27
- debounceTimer = setTimeout(() => {
28
- emit('search', val)
29
- }, 400)
30
- })
31
-
32
- const clearInput = () => {
33
- input.value = ''
34
- emit('search', '')
35
- }
36
- </script>
37
-
38
- <template>
39
- <q-input v-model="input" :placeholder="placeholder" dense outlined>
40
- <template v-if="input" #append>
41
- <q-icon name="✕" class="cursor-pointer" @click.stop="clearInput" />
42
- </template>
43
- </q-input>
44
- </template>
45
-
46
- <style scoped lang="scss">
47
- .q-field {
48
- background: #fff;
49
- border-radius: 4px;
50
- outline: none;
51
- border-color: #f2f7fb;
52
-
53
- ::v-deep(.q-field__control) {
54
- height: 52px;
55
- display: flex;
56
- align-items: center;
57
- }
58
-
59
- ::v-deep(.q-field__native) {
60
- font-family: NunitoSansFont, sans-serif;
61
- color: #1d425d;
62
- padding-left: 8px;
63
- }
64
-
65
- ::v-deep(.q-field__native::placeholder) {
66
- color: rgba(184, 184, 184, 0.87);
67
- }
68
-
69
- ::v-deep(.q-icon.cursor-pointer) {
70
- color: #1d425d;
71
- font-size: 20px;
72
- line-height: 15px;
73
- }
74
- ::v-deep(.q-field__control:hover:before) {
75
- border-color: #3f8cff;
76
- }
77
- }
78
- </style>
1
+ <template>
2
+ <q-input v-model="input" :placeholder="placeholder" dense outlined>
3
+ <template v-if="input" #append>
4
+ <q-icon name="✕" class="cursor-pointer" @click.stop="clearInput" />
5
+ </template>
6
+ </q-input>
7
+ </template>
8
+
9
+ <script setup lang="ts">
10
+ import { defineProps, defineEmits, ref, watch } from 'vue'
11
+
12
+ const props = defineProps<{
13
+ modelValue: string
14
+ placeholder: string
15
+ }>()
16
+
17
+ const emit = defineEmits<{
18
+ (e: 'update:modelValue', value: string): void
19
+ (e: 'search', value: string): void
20
+ }>()
21
+
22
+ const input = ref(props.modelValue)
23
+ let debounceTimer: ReturnType<typeof setTimeout>
24
+ const clearInput = () => {
25
+ input.value = ''
26
+ emit('search', '')
27
+ }
28
+ watch(
29
+ () => props.modelValue,
30
+ val => {
31
+ input.value = val
32
+ },
33
+ )
34
+
35
+ watch(input, val => {
36
+ emit('update:modelValue', val)
37
+ clearTimeout(debounceTimer)
38
+ debounceTimer = setTimeout(() => {
39
+ emit('search', val)
40
+ }, 400)
41
+ })
42
+ </script>
43
+
44
+ <style scoped lang="scss">
45
+ .q-field {
46
+ background: #fff;
47
+ border-radius: 4px;
48
+ outline: none;
49
+ border-color: #f2f7fb;
50
+
51
+ ::v-deep(.q-field__control) {
52
+ height: 52px;
53
+ display: flex;
54
+ align-items: center;
55
+ }
56
+
57
+ ::v-deep(.q-field__native) {
58
+ font-family: NunitoSansFont, sans-serif;
59
+ color: #1d425d;
60
+ padding-left: 8px;
61
+ }
62
+
63
+ ::v-deep(.q-field__native::placeholder) {
64
+ color: rgba(184, 184, 184, 0.87);
65
+ }
66
+
67
+ ::v-deep(.q-icon.cursor-pointer) {
68
+ color: #1d425d;
69
+ font-size: 20px;
70
+ line-height: 15px;
71
+ }
72
+ ::v-deep(.q-field__control:hover:before) {
73
+ border-color: #3f8cff;
74
+ }
75
+ }
76
+ </style>
@@ -1,42 +1,42 @@
1
- import { ref, watch, onMounted, Ref } from 'vue'
2
-
3
- export function useBaseTable(model: {
4
- initialize: (params: { search: string; page: number }) => Promise<void>
5
- loading: Ref<boolean>
6
- columnFilters: Ref<Record<string, any>>
7
- }) {
8
- const search = ref('')
9
- const currentPage = ref(1)
10
-
11
- const loadTable = async (searchVal = '', pageVal = 1) => {
12
- await model.initialize({ search: searchVal, page: pageVal })
13
- }
14
-
15
- const handleSearch = async (val: string) => {
16
- search.value = val
17
- currentPage.value = 1
18
- await loadTable(val, currentPage.value)
19
- }
20
-
21
- const handlePageChange = async (page: number) => {
22
- currentPage.value = page
23
- await loadTable(search.value, page)
24
- }
25
-
26
- watch(
27
- () => model.columnFilters.value,
28
- () => loadTable(search.value, currentPage.value),
29
- { deep: true },
30
- )
31
-
32
- onMounted(() => loadTable(search.value, currentPage.value))
33
-
34
- return {
35
- search,
36
- currentPage,
37
- loading: model.loading,
38
- handleSearch,
39
- handlePageChange,
40
- loadTable,
41
- }
42
- }
1
+ import { ref, watch, onMounted, Ref } from 'vue'
2
+
3
+ export function useBaseTable(model: {
4
+ initialize: (params: { search: string; page: number }) => Promise<void>
5
+ loading: Ref<boolean>
6
+ columnFilters: Ref<Record<string, any>>
7
+ }) {
8
+ const search = ref('')
9
+ const currentPage = ref(1)
10
+
11
+ const loadTable = async (searchVal = '', pageVal = 1) => {
12
+ await model.initialize({ search: searchVal, page: pageVal })
13
+ }
14
+
15
+ const handleSearch = async (val: string) => {
16
+ search.value = val
17
+ currentPage.value = 1
18
+ await loadTable(val, currentPage.value)
19
+ }
20
+
21
+ const handlePageChange = async (page: number) => {
22
+ currentPage.value = page
23
+ await loadTable(search.value, page)
24
+ }
25
+
26
+ watch(
27
+ () => model.columnFilters.value,
28
+ () => loadTable(search.value, currentPage.value),
29
+ { deep: true },
30
+ )
31
+
32
+ onMounted(() => loadTable(search.value, currentPage.value))
33
+
34
+ return {
35
+ search,
36
+ currentPage,
37
+ loading: model.loading,
38
+ handleSearch,
39
+ handlePageChange,
40
+ loadTable,
41
+ }
42
+ }