shared-ritm 1.2.62 → 1.2.64
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 +1714 -1700
- package/dist/shared-ritm.umd.js +6 -6
- package/dist/types/common/app-table/controllers/useTableModel.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/common/app-table/AppTable.vue +12 -3
- package/src/common/app-table/AppTableLayout.vue +16 -7
- package/src/common/app-table/components/TablePagination.vue +4 -2
- package/src/common/app-table/controllers/useTableModel.ts +1 -1
- package/src/index.ts +1 -0
|
@@ -6,7 +6,7 @@ export interface TableColumn {
|
|
|
6
6
|
headerStyle?: string;
|
|
7
7
|
field: string | ((row: any) => any);
|
|
8
8
|
sortable?: boolean;
|
|
9
|
-
filterType
|
|
9
|
+
filterType?: 'single' | 'multi' | null;
|
|
10
10
|
align?: 'left' | 'center' | 'right';
|
|
11
11
|
badge?: {
|
|
12
12
|
true?: string;
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-page class="flex flex-col" style="min-height: 100%">
|
|
2
|
+
<q-page class="flex flex-col" style="height: 100%; min-height: 100%">
|
|
3
3
|
<q-table
|
|
4
4
|
v-model:selected="selected"
|
|
5
5
|
:rows="rows.value"
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
class="full-width"
|
|
12
12
|
:rows-per-page-options="[0]"
|
|
13
13
|
:selection="props.enableMultiSelect ? 'multiple' : 'none'"
|
|
14
|
+
style="height: 100%"
|
|
14
15
|
@row-click="(_, row) => emit('row-click', row)"
|
|
15
16
|
>
|
|
16
17
|
<template #header-selection="scope">
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
</template>
|
|
23
24
|
|
|
24
25
|
<template #body-cell-index="props">
|
|
25
|
-
<q-td :props="props" class="text-center">
|
|
26
|
+
<q-td :props="props" class="text-center" :class="{ 'q-td--no-hover': noHover }">
|
|
26
27
|
{{ props.rowIndex + 1 + (meta.value.currentPage - 1) * meta.value.perPage }}
|
|
27
28
|
</q-td>
|
|
28
29
|
</template>
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
</template>
|
|
91
92
|
|
|
92
93
|
<template #body-cell="props">
|
|
93
|
-
<q-td :props="props">
|
|
94
|
+
<q-td :props="props" :class="{ 'q-td--no-hover': noHover }">
|
|
94
95
|
<q-badge
|
|
95
96
|
v-if="props.col.badge && typeof props.value === 'boolean'"
|
|
96
97
|
:color="
|
|
@@ -140,6 +141,7 @@ const props = defineProps<{
|
|
|
140
141
|
filtersOptions: Record<string, FilterOption[]>
|
|
141
142
|
meta: Ref<{ currentPage: number; perPage: number }>
|
|
142
143
|
enableMultiSelect?: boolean
|
|
144
|
+
noHover?: boolean
|
|
143
145
|
selectedRows: any[]
|
|
144
146
|
}>()
|
|
145
147
|
const emit = defineEmits<TableEmits>()
|
|
@@ -209,7 +211,10 @@ watch(
|
|
|
209
211
|
}
|
|
210
212
|
|
|
211
213
|
::v-deep(.q-table thead) {
|
|
214
|
+
position: sticky;
|
|
215
|
+
top: 0;
|
|
212
216
|
background: #f2f7fb;
|
|
217
|
+
z-index: 1;
|
|
213
218
|
}
|
|
214
219
|
|
|
215
220
|
::v-deep(.q-table th) {
|
|
@@ -227,6 +232,10 @@ watch(
|
|
|
227
232
|
font-size: 14px;
|
|
228
233
|
}
|
|
229
234
|
|
|
235
|
+
.q-td--no-hover {
|
|
236
|
+
cursor: default;
|
|
237
|
+
}
|
|
238
|
+
|
|
230
239
|
::v-deep(.q-table tbody) {
|
|
231
240
|
font-family: NunitoSansFont, sans-serif;
|
|
232
241
|
border-color: #d7e0ef;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="table-layout">
|
|
3
|
-
<div class="table-controls">
|
|
2
|
+
<div class="table-layout" :class="{ 'hide-search': !actionsSlot && hideSearch }">
|
|
3
|
+
<div v-if="actionsSlot || !hideSearch" class="table-controls">
|
|
4
4
|
<app-table-search
|
|
5
|
+
v-if="!hideSearch"
|
|
5
6
|
:model-value="props.search"
|
|
6
7
|
class="search-input"
|
|
7
8
|
placeholder="Введите наименование"
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
<app-table
|
|
15
16
|
v-bind="props.tableProps"
|
|
16
17
|
:selected-rows="props.selectedRows"
|
|
18
|
+
:no-hover="noHover"
|
|
17
19
|
v-on="props.tableEvents"
|
|
18
20
|
@update:selectedRows="rows => emit('update:selectedRows', rows)"
|
|
19
21
|
/>
|
|
@@ -48,6 +50,8 @@ const props = defineProps<{
|
|
|
48
50
|
onPageChange: (page: number) => void
|
|
49
51
|
actionsSlot?: boolean
|
|
50
52
|
modalSlot?: boolean
|
|
53
|
+
hideSearch?: boolean
|
|
54
|
+
noHover?: boolean
|
|
51
55
|
selectedRows: any[]
|
|
52
56
|
}>()
|
|
53
57
|
const emit = defineEmits<{
|
|
@@ -56,17 +60,22 @@ const emit = defineEmits<{
|
|
|
56
60
|
</script>
|
|
57
61
|
<style scoped lang="scss">
|
|
58
62
|
.table-layout {
|
|
59
|
-
height:
|
|
60
|
-
display:
|
|
61
|
-
|
|
63
|
+
height: 100%;
|
|
64
|
+
display: grid;
|
|
65
|
+
grid-template-rows: auto 1fr auto;
|
|
66
|
+
gap: 1.25rem;
|
|
62
67
|
box-sizing: border-box;
|
|
68
|
+
overflow: auto;
|
|
69
|
+
|
|
70
|
+
&.hide-search {
|
|
71
|
+
grid-template-rows: 1fr auto;
|
|
72
|
+
}
|
|
63
73
|
}
|
|
64
74
|
.table-controls {
|
|
65
75
|
display: flex;
|
|
66
76
|
align-items: center;
|
|
67
77
|
justify-content: space-between;
|
|
68
|
-
gap:
|
|
69
|
-
margin-bottom: 20px;
|
|
78
|
+
gap: 1.25rem;
|
|
70
79
|
|
|
71
80
|
.search-input {
|
|
72
81
|
flex: 1;
|
|
@@ -105,10 +105,12 @@ function nextPage() {
|
|
|
105
105
|
align-items: center;
|
|
106
106
|
gap: 20px;
|
|
107
107
|
flex-wrap: wrap;
|
|
108
|
-
|
|
109
|
-
margin-bottom: 15px;
|
|
108
|
+
|
|
110
109
|
.arrow-button,
|
|
111
110
|
.page-button {
|
|
111
|
+
display: flex;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
align-items: center;
|
|
112
114
|
width: 34px;
|
|
113
115
|
height: 34px;
|
|
114
116
|
border-radius: 4px;
|
package/src/index.ts
CHANGED