@hostlink/nuxt-light 1.48.4 → 1.48.5
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/module.json +1 -1
- package/dist/runtime/components/l-btn.d.vue.ts +2 -2
- package/dist/runtime/components/l-btn.vue +14 -9
- package/dist/runtime/components/l-btn.vue.d.ts +2 -2
- package/dist/runtime/components/l-table.d.vue.ts +10 -6
- package/dist/runtime/components/l-table.vue +9 -8
- package/dist/runtime/components/l-table.vue.d.ts +10 -6
- package/dist/runtime/composables/defineLightModel.d.ts +4 -20
- package/dist/runtime/formkit/Form.vue +0 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { QBtnProps } from "quasar";
|
|
2
|
-
export
|
|
2
|
+
export type LBtnProps = QBtnProps & {
|
|
3
3
|
permission?: string;
|
|
4
4
|
confirmMessage?: string;
|
|
5
5
|
confirmTitle?: string;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
declare var __VLS_10: {};
|
|
8
8
|
type __VLS_Slots = {} & {
|
|
9
9
|
default?: (props: typeof __VLS_10) => any;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useQuasar, QBtn } from "quasar";
|
|
3
|
+
import { computed } from "vue";
|
|
3
4
|
const props = defineProps({
|
|
4
|
-
permission: { type: String, required: false, default: "" },
|
|
5
|
-
confirmMessage: { type: String, required: false, default: "" },
|
|
6
|
-
confirmTitle: { type: String, required: false, default: "Confirm" },
|
|
7
5
|
size: { type: null, required: false },
|
|
8
6
|
type: { type: null, required: false },
|
|
9
7
|
to: { type: null, required: false },
|
|
@@ -38,11 +36,14 @@ const props = defineProps({
|
|
|
38
36
|
round: { type: Boolean, required: false, skipCheck: true },
|
|
39
37
|
percentage: { type: null, required: false },
|
|
40
38
|
darkPercentage: { type: Boolean, required: false, skipCheck: true },
|
|
41
|
-
onClick: { type: Function, required: false }
|
|
39
|
+
onClick: { type: Function, required: false },
|
|
40
|
+
permission: { type: String, required: false, default: "" },
|
|
41
|
+
confirmMessage: { type: String, required: false, default: "" },
|
|
42
|
+
confirmTitle: { type: String, required: false, default: "Confirm" }
|
|
42
43
|
});
|
|
43
44
|
const $q = useQuasar();
|
|
44
|
-
const { onClick
|
|
45
|
-
const handleClick = function() {
|
|
45
|
+
const { onClick } = props;
|
|
46
|
+
const handleClick = function(evt) {
|
|
46
47
|
if (props.confirmMessage) {
|
|
47
48
|
$q.dialog({
|
|
48
49
|
title: props.confirmTitle,
|
|
@@ -50,17 +51,21 @@ const handleClick = function() {
|
|
|
50
51
|
ok: "Yes",
|
|
51
52
|
cancel: "No"
|
|
52
53
|
}).onOk(() => {
|
|
53
|
-
onClick?.();
|
|
54
|
+
onClick?.(evt);
|
|
54
55
|
});
|
|
55
56
|
} else {
|
|
56
|
-
onClick?.();
|
|
57
|
+
onClick?.(evt);
|
|
57
58
|
}
|
|
58
59
|
};
|
|
60
|
+
const filteredProps = computed(() => {
|
|
61
|
+
const { onClick: onClick2, ...rest } = props;
|
|
62
|
+
return rest;
|
|
63
|
+
});
|
|
59
64
|
</script>
|
|
60
65
|
|
|
61
66
|
<template>
|
|
62
67
|
<q-btn v-if="$light.isGranted($props.permission)" @click="handleClick"
|
|
63
|
-
v-bind="
|
|
68
|
+
v-bind="{ ...filteredProps, ...$light.getButtonProps(filteredProps) }">
|
|
64
69
|
<slot></slot>
|
|
65
70
|
</q-btn>
|
|
66
71
|
</template>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { QBtnProps } from "quasar";
|
|
2
|
-
export
|
|
2
|
+
export type LBtnProps = QBtnProps & {
|
|
3
3
|
permission?: string;
|
|
4
4
|
confirmMessage?: string;
|
|
5
5
|
confirmTitle?: string;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
declare var __VLS_10: {};
|
|
8
8
|
type __VLS_Slots = {} & {
|
|
9
9
|
default?: (props: typeof __VLS_10) => any;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
1
2
|
import { Dialog } from 'quasar';
|
|
2
3
|
import type { QTableColumn, QTableProps } from 'quasar';
|
|
3
|
-
export
|
|
4
|
+
export type LTableColumn = QTableColumn & {
|
|
5
|
+
searchType?: "date" | "text" | "number" | "select";
|
|
4
6
|
searchable?: boolean;
|
|
5
|
-
|
|
6
|
-
searchOptions?: Array<any> | Function;
|
|
7
|
+
searchOptions?: Record<string, any>[] | Function;
|
|
7
8
|
searchMultiple?: boolean;
|
|
8
9
|
searchIndex?: string;
|
|
10
|
+
component?: Component;
|
|
11
|
+
componentProps?: any;
|
|
9
12
|
gql?: Record<string, any>;
|
|
10
13
|
/**
|
|
11
14
|
* @deprecated use gql instead
|
|
@@ -13,10 +16,10 @@ export interface LTableColumn extends QTableColumn {
|
|
|
13
16
|
gqlField?: string | Array<string> | Object;
|
|
14
17
|
backgroundColor?: string | Function;
|
|
15
18
|
searchMethod?: string;
|
|
16
|
-
}
|
|
19
|
+
};
|
|
17
20
|
export type LTableProps = QTableProps & {
|
|
18
21
|
columns?: Array<LTableColumn>;
|
|
19
|
-
actions?: Array<
|
|
22
|
+
actions?: Array<'view' | 'edit' | 'delete' | 'update'>;
|
|
20
23
|
sortBy?: any;
|
|
21
24
|
rowKey?: string;
|
|
22
25
|
modelName?: any;
|
|
@@ -27,6 +30,7 @@ export type LTableProps = QTableProps & {
|
|
|
27
30
|
addComponentProps?: any;
|
|
28
31
|
rows?: Array<any>;
|
|
29
32
|
name?: string;
|
|
33
|
+
searchStyle?: string;
|
|
30
34
|
};
|
|
31
35
|
export interface LTableRequest {
|
|
32
36
|
sort: string;
|
|
@@ -91,7 +95,7 @@ declare const __VLS_component: import("vue").DefineComponent<LTableProps, {
|
|
|
91
95
|
bordered: boolean;
|
|
92
96
|
fullscreen: boolean;
|
|
93
97
|
selected: any[];
|
|
94
|
-
actions: Array<
|
|
98
|
+
actions: Array<"view" | "edit" | "delete" | "update">;
|
|
95
99
|
pagination: {
|
|
96
100
|
sortBy?: string | null;
|
|
97
101
|
descending?: boolean;
|
|
@@ -104,7 +104,8 @@ const props = defineProps({
|
|
|
104
104
|
onRequestData: { type: Function, required: false },
|
|
105
105
|
addComponent: { type: Object, required: false },
|
|
106
106
|
addComponentProps: { type: null, required: false },
|
|
107
|
-
name: { type: String, required: false }
|
|
107
|
+
name: { type: String, required: false },
|
|
108
|
+
searchStyle: { type: String, required: false }
|
|
108
109
|
});
|
|
109
110
|
const isServerSide = props.rows == void 0;
|
|
110
111
|
const light = useLight();
|
|
@@ -138,7 +139,7 @@ let actionView = false;
|
|
|
138
139
|
let actionDelete = false;
|
|
139
140
|
if (props.actions.length > 0) {
|
|
140
141
|
actionView = props.actions.includes("view");
|
|
141
|
-
activeEdit = props.actions.includes("edit");
|
|
142
|
+
activeEdit = props.actions.includes("edit") || props.actions.includes("update");
|
|
142
143
|
actionDelete = props.actions.includes("delete");
|
|
143
144
|
}
|
|
144
145
|
if (props.sortBy) {
|
|
@@ -514,8 +515,7 @@ const visibleColumns = props.name ? useStorage("l-table-visible-columns-" + simp
|
|
|
514
515
|
<q-checkbox v-model="props.selected" />
|
|
515
516
|
</q-td>
|
|
516
517
|
<q-td v-if="hasRowExpand" auto-width>
|
|
517
|
-
<q-btn :
|
|
518
|
-
:icon="props.expand ? 'sym_o_expand_more' : 'sym_o_expand_less'"
|
|
518
|
+
<q-btn flat round size="sm" :icon="props.expand ? 'sym_o_expand_more' : 'sym_o_expand_less'"
|
|
519
519
|
@click="props.expand = !props.expand"></q-btn>
|
|
520
520
|
</q-td>
|
|
521
521
|
|
|
@@ -610,7 +610,7 @@ const visibleColumns = props.name ? useStorage("l-table-visible-columns-" + simp
|
|
|
610
610
|
<template v-if="col.searchType == 'number'">
|
|
611
611
|
<q-input style="min-width: 80px;" dense clearable filled square
|
|
612
612
|
v-model.number="filters[col.name]" @keydown.enter.prevent="onFilters" @clear="onFilters"
|
|
613
|
-
mask="##########" :enterkeyhint="$t('search')"></q-input>
|
|
613
|
+
mask="##########" :enterkeyhint="$t('search')" :style="col.searchStyle"></q-input>
|
|
614
614
|
</template>
|
|
615
615
|
|
|
616
616
|
<template v-if="col.searchType == 'select'">
|
|
@@ -619,18 +619,19 @@ const visibleColumns = props.name ? useStorage("l-table-visible-columns-" + simp
|
|
|
619
619
|
emit-value map-options :multiple="col.searchMultiple" :color="$light.color" use-input
|
|
620
620
|
input-debounce="0" @filter="(val, update) => {
|
|
621
621
|
searchSelectFilter(val, update, col.name);
|
|
622
|
-
}" />
|
|
622
|
+
}" :style="col.searchStyle" />
|
|
623
623
|
</template>
|
|
624
624
|
|
|
625
625
|
<template v-if="col.searchType == 'date'">
|
|
626
626
|
<l-date-picker dense clearable filled square :outlined="false" hide-bottom-space
|
|
627
|
-
v-model="filters[col.name]" @update:model-value="onFilters" range @clear="onFilters"
|
|
627
|
+
v-model="filters[col.name]" @update:model-value="onFilters" range @clear="onFilters"
|
|
628
|
+
:style="col.searchStyle" />
|
|
628
629
|
</template>
|
|
629
630
|
|
|
630
631
|
<template v-if="!col.searchType || col.searchType == 'text'">
|
|
631
632
|
<q-input style="min-width: 80px;" dense clearable filled square v-model="filters[col.name]"
|
|
632
633
|
@keydown.enter.prevent="onFilters" @clear="onFilters" :enterkeyhint="$t('search')"
|
|
633
|
-
:color="$light.color"></q-input>
|
|
634
|
+
:color="$light.color" :style="col.searchStyle"></q-input>
|
|
634
635
|
|
|
635
636
|
</template>
|
|
636
637
|
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
1
2
|
import { Dialog } from 'quasar';
|
|
2
3
|
import type { QTableColumn, QTableProps } from 'quasar';
|
|
3
|
-
export
|
|
4
|
+
export type LTableColumn = QTableColumn & {
|
|
5
|
+
searchType?: "date" | "text" | "number" | "select";
|
|
4
6
|
searchable?: boolean;
|
|
5
|
-
|
|
6
|
-
searchOptions?: Array<any> | Function;
|
|
7
|
+
searchOptions?: Record<string, any>[] | Function;
|
|
7
8
|
searchMultiple?: boolean;
|
|
8
9
|
searchIndex?: string;
|
|
10
|
+
component?: Component;
|
|
11
|
+
componentProps?: any;
|
|
9
12
|
gql?: Record<string, any>;
|
|
10
13
|
/**
|
|
11
14
|
* @deprecated use gql instead
|
|
@@ -13,10 +16,10 @@ export interface LTableColumn extends QTableColumn {
|
|
|
13
16
|
gqlField?: string | Array<string> | Object;
|
|
14
17
|
backgroundColor?: string | Function;
|
|
15
18
|
searchMethod?: string;
|
|
16
|
-
}
|
|
19
|
+
};
|
|
17
20
|
export type LTableProps = QTableProps & {
|
|
18
21
|
columns?: Array<LTableColumn>;
|
|
19
|
-
actions?: Array<
|
|
22
|
+
actions?: Array<'view' | 'edit' | 'delete' | 'update'>;
|
|
20
23
|
sortBy?: any;
|
|
21
24
|
rowKey?: string;
|
|
22
25
|
modelName?: any;
|
|
@@ -27,6 +30,7 @@ export type LTableProps = QTableProps & {
|
|
|
27
30
|
addComponentProps?: any;
|
|
28
31
|
rows?: Array<any>;
|
|
29
32
|
name?: string;
|
|
33
|
+
searchStyle?: string;
|
|
30
34
|
};
|
|
31
35
|
export interface LTableRequest {
|
|
32
36
|
sort: string;
|
|
@@ -91,7 +95,7 @@ declare const __VLS_component: import("vue").DefineComponent<LTableProps, {
|
|
|
91
95
|
bordered: boolean;
|
|
92
96
|
fullscreen: boolean;
|
|
93
97
|
selected: any[];
|
|
94
|
-
actions: Array<
|
|
98
|
+
actions: Array<"view" | "edit" | "delete" | "update">;
|
|
95
99
|
pagination: {
|
|
96
100
|
sortBy?: string | null;
|
|
97
101
|
descending?: boolean;
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
import type { Component } from "vue";
|
|
2
1
|
import { type Field } from "@hostlink/light";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
sortable?: boolean;
|
|
6
|
-
searchable?: boolean;
|
|
7
|
-
autoWidth?: boolean;
|
|
8
|
-
searchType?: "date" | "text" | "number" | "select";
|
|
2
|
+
import { type LTableColumn } from "../components/l-table.vue.js";
|
|
3
|
+
export type LightModelField = Omit<LTableColumn, "name" | "field"> & Field & {
|
|
9
4
|
name?: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
gqlField?: Record<string, any>;
|
|
14
|
-
to?: (row: any) => string;
|
|
15
|
-
field?: (row: any) => string;
|
|
16
|
-
component?: Component;
|
|
17
|
-
componentProps?: any;
|
|
18
|
-
format?: (value: any, row: any) => any;
|
|
19
|
-
style?: any;
|
|
20
|
-
align?: "left" | "center" | "right";
|
|
21
|
-
searchOptions?: Record<string, any>[];
|
|
22
|
-
}
|
|
5
|
+
field?: string | ((row: any) => any);
|
|
6
|
+
};
|
|
23
7
|
export interface LightModel {
|
|
24
8
|
name: string;
|
|
25
9
|
fields: Record<string, LightModelField>;
|
|
@@ -101,7 +101,6 @@ const localClass = computed(() => {
|
|
|
101
101
|
<q-card-section :class="localClass">
|
|
102
102
|
<slot v-bind="context"></slot>
|
|
103
103
|
</q-card-section>
|
|
104
|
-
|
|
105
104
|
<q-card-actions align="right" v-if="context.actions">
|
|
106
105
|
<l-btn icon="sym_o_check" :label="context.submitLabel ?? 'Submit'" @click="onSubmit"
|
|
107
106
|
:disabled="!isNoDirtyCheck && !context.state.dirty" :loading="context.state.loading"></l-btn>
|