adminforth 2.4.0-next.116 → 2.4.0-next.118
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.
|
@@ -108,9 +108,9 @@
|
|
|
108
108
|
:min="getFilterMinValue(c.name)"
|
|
109
109
|
:max="getFilterMaxValue(c.name)"
|
|
110
110
|
:valueStart="getFilterItem({ column: c, operator: 'gte' })"
|
|
111
|
-
@update:valueStart="onFilterInput[c.name]({ column: c, operator: 'gte', value: $event
|
|
111
|
+
@update:valueStart="onFilterInput[c.name]({ column: c, operator: 'gte', value: ($event !== '' && $event !== null) ? $event : undefined })"
|
|
112
112
|
:valueEnd="getFilterItem({ column: c, operator: 'lte' })"
|
|
113
|
-
@update:valueEnd="onFilterInput[c.name]({ column: c, operator: 'lte', value: $event
|
|
113
|
+
@update:valueEnd="onFilterInput[c.name]({ column: c, operator: 'lte', value: ($event !== '' && $event !== null) ? $event : undefined })"
|
|
114
114
|
/>
|
|
115
115
|
|
|
116
116
|
<div v-else-if="['integer', 'decimal', 'float'].includes(c.type)" class="flex gap-2">
|
|
@@ -118,14 +118,14 @@
|
|
|
118
118
|
type="number"
|
|
119
119
|
aria-describedby="helper-text-explanation"
|
|
120
120
|
:placeholder="$t('From')"
|
|
121
|
-
@update:modelValue="onFilterInput[c.name]({ column: c, operator: 'gte', value: $event
|
|
121
|
+
@update:modelValue="onFilterInput[c.name]({ column: c, operator: 'gte', value: ($event !== '' && $event !== null) ? $event : undefined })"
|
|
122
122
|
:modelValue="getFilterItem({ column: c, operator: 'gte' })"
|
|
123
123
|
/>
|
|
124
124
|
<Input
|
|
125
125
|
type="number"
|
|
126
126
|
aria-describedby="helper-text-explanation"
|
|
127
127
|
:placeholder="$t('To')"
|
|
128
|
-
@update:modelValue="onFilterInput[c.name]({ column: c, operator: 'lte', value: $event
|
|
128
|
+
@update:modelValue="onFilterInput[c.name]({ column: c, operator: 'lte', value: ($event !== '' && $event !== null) ? $event : undefined })"
|
|
129
129
|
:modelValue="getFilterItem({ column: c, operator: 'lte' })"
|
|
130
130
|
/>
|
|
131
131
|
</div>
|
|
@@ -269,7 +269,7 @@ const onSearchInput = computed(() => {
|
|
|
269
269
|
function setFilterItem({ column, operator, value }) {
|
|
270
270
|
|
|
271
271
|
const index = filtersStore.filters.findIndex(f => f.field === column.name && f.operator === operator);
|
|
272
|
-
if (value === undefined) {
|
|
272
|
+
if (value === undefined || value === '' || value === null) {
|
|
273
273
|
if (index !== -1) {
|
|
274
274
|
filtersStore.filters.splice(index, 1);
|
|
275
275
|
}
|
|
@@ -284,7 +284,8 @@ function setFilterItem({ column, operator, value }) {
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
function getFilterItem({ column, operator }) {
|
|
287
|
-
|
|
287
|
+
const filterValue = filtersStore.filters.find(f => f.field === column.name && f.operator === operator)?.value;
|
|
288
|
+
return filterValue !== undefined ? filterValue : '';
|
|
288
289
|
}
|
|
289
290
|
|
|
290
291
|
async function clear() {
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
<ul class="py-2 text-sm text-lightThreeDotsMenuBodyText dark:text-darkThreeDotsMenuBodyText" aria-labelledby="dropdownMenuIconButton">
|
|
17
17
|
<li v-for="item in threeDotsDropdownItems" :key="`dropdown-item-${item.label}`">
|
|
18
18
|
<a href="#"
|
|
19
|
-
class="block px-4 py-2 hover:bg-lightThreeDotsMenuBodyBackgroundHover hover:text-lightThreeDotsMenuBodyTextHover dark:hover:bg-darkThreeDotsMenuBodyBackgroundHover dark:hover:text-darkThreeDotsMenuBodyTextHover"
|
|
19
|
+
class="block px-4 py-2 hover:bg-lightThreeDotsMenuBodyBackgroundHover hover:text-lightThreeDotsMenuBodyTextHover dark:hover:bg-darkThreeDotsMenuBodyBackgroundHover dark:hover:text-darkThreeDotsMenuBodyTextHover"
|
|
20
20
|
:class="{
|
|
21
|
-
'pointer-events-none':
|
|
22
|
-
'opacity-50':
|
|
23
|
-
'cursor-not-allowed':
|
|
21
|
+
'pointer-events-none': checkboxes && checkboxes.length === 0 && item.meta?.disabledWhenNoCheckboxes,
|
|
22
|
+
'opacity-50': checkboxes && checkboxes.length === 0 && item.meta?.disabledWhenNoCheckboxes,
|
|
23
|
+
'cursor-not-allowed': checkboxes && checkboxes.length === 0 && item.meta?.disabledWhenNoCheckboxes,
|
|
24
24
|
}">
|
|
25
25
|
<component :is="getCustomComponent(item)"
|
|
26
26
|
:meta="item.meta"
|
|
@@ -115,7 +115,6 @@ const readonlyColumns = ref([]);
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
async function onUpdateRecord(newRecord: any) {
|
|
118
|
-
console.log('newRecord', newRecord);
|
|
119
118
|
record.value = newRecord;
|
|
120
119
|
}
|
|
121
120
|
|
|
@@ -143,7 +142,6 @@ onMounted(async () => {
|
|
|
143
142
|
});
|
|
144
143
|
|
|
145
144
|
async function saveRecord() {
|
|
146
|
-
console.log('saveRecord isValid', isValid.value);
|
|
147
145
|
if (!isValid.value) {
|
|
148
146
|
validating.value = true;
|
|
149
147
|
return;
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
<Teleport to="body">
|
|
4
4
|
<Filters
|
|
5
5
|
:columns="coreStore.resource?.columns"
|
|
6
|
-
:columnsMinMax="columnsMinMax"
|
|
6
|
+
:columnsMinMax="columnsMinMax"
|
|
7
|
+
:show="filtersShow"
|
|
7
8
|
@hide="filtersShow = false"
|
|
8
9
|
/>
|
|
9
10
|
</Teleport>
|
|
@@ -448,7 +449,7 @@ watch(() => filtersStore.filters, async (to, from) => {
|
|
|
448
449
|
const query = {};
|
|
449
450
|
const currentQ = currentQuery();
|
|
450
451
|
filtersStore.filters.forEach(f => {
|
|
451
|
-
if (f.value) {
|
|
452
|
+
if (f.value !== undefined && f.value !== null && f.value !== '') {
|
|
452
453
|
query[`filter__${f.field}__${f.operator}`] = encodeURIComponent(JSON.stringify(f.value));
|
|
453
454
|
}
|
|
454
455
|
});
|