@hostlink/nuxt-light 1.52.3 → 1.53.0
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-input-select.d.vue.ts +35 -0
- package/dist/runtime/components/l-input-select.vue +121 -0
- package/dist/runtime/components/l-input-select.vue.d.ts +35 -0
- package/dist/runtime/components/l-table.vue +23 -7
- package/dist/runtime/formkit/InputSelect.d.vue.ts +22 -0
- package/dist/runtime/formkit/InputSelect.vue +41 -0
- package/dist/runtime/formkit/InputSelect.vue.d.ts +22 -0
- package/dist/runtime/formkit/index.js +6 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { QSelectProps } from 'quasar';
|
|
2
|
+
export interface LInputSelectProps extends QSelectProps {
|
|
3
|
+
}
|
|
4
|
+
type __VLS_Props = LInputSelectProps;
|
|
5
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
6
|
+
modelValue?: string | null;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_11: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_11) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (value: string | null | undefined) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((value: string | null | undefined) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
dark: boolean | null;
|
|
18
|
+
rounded: boolean;
|
|
19
|
+
square: boolean;
|
|
20
|
+
dense: boolean;
|
|
21
|
+
outlined: boolean;
|
|
22
|
+
filled: boolean;
|
|
23
|
+
stackLabel: boolean;
|
|
24
|
+
standout: string | boolean;
|
|
25
|
+
hideBottomSpace: boolean;
|
|
26
|
+
inputDebounce: string | number;
|
|
27
|
+
optionsDark: boolean | null;
|
|
28
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
name: { type: null, required: false },
|
|
5
|
+
virtualScrollHorizontal: { type: Boolean, required: false, skipCheck: true },
|
|
6
|
+
virtualScrollSliceSize: { type: null, required: false },
|
|
7
|
+
virtualScrollSliceRatioBefore: { type: null, required: false },
|
|
8
|
+
virtualScrollSliceRatioAfter: { type: null, required: false },
|
|
9
|
+
virtualScrollItemSize: { type: null, required: false },
|
|
10
|
+
virtualScrollStickySizeStart: { type: null, required: false },
|
|
11
|
+
virtualScrollStickySizeEnd: { type: null, required: false },
|
|
12
|
+
tableColspan: { type: null, required: false },
|
|
13
|
+
modelValue: { type: null, required: true },
|
|
14
|
+
error: { type: [Boolean, null], required: false, skipCheck: true },
|
|
15
|
+
errorMessage: { type: null, required: false },
|
|
16
|
+
noErrorIcon: { type: Boolean, required: false, skipCheck: true },
|
|
17
|
+
rules: { type: null, required: false },
|
|
18
|
+
reactiveRules: { type: Boolean, required: false, skipCheck: true },
|
|
19
|
+
lazyRules: { type: [Boolean, String], required: false, skipCheck: true },
|
|
20
|
+
label: { type: null, required: false },
|
|
21
|
+
stackLabel: { type: Boolean, required: false, skipCheck: true, default: void 0 },
|
|
22
|
+
hint: { type: null, required: false },
|
|
23
|
+
hideHint: { type: Boolean, required: false, skipCheck: true },
|
|
24
|
+
prefix: { type: null, required: false },
|
|
25
|
+
suffix: { type: null, required: false },
|
|
26
|
+
labelColor: { type: null, required: false },
|
|
27
|
+
color: { type: null, required: false },
|
|
28
|
+
bgColor: { type: null, required: false },
|
|
29
|
+
dark: { type: [Boolean, null], required: false, skipCheck: true, default: void 0 },
|
|
30
|
+
loading: { type: Boolean, required: false, skipCheck: true },
|
|
31
|
+
clearable: { type: Boolean, required: false, skipCheck: true },
|
|
32
|
+
clearIcon: { type: null, required: false },
|
|
33
|
+
filled: { type: Boolean, required: false, skipCheck: true, default: void 0 },
|
|
34
|
+
outlined: { type: Boolean, required: false, skipCheck: true, default: void 0 },
|
|
35
|
+
borderless: { type: Boolean, required: false, skipCheck: true },
|
|
36
|
+
standout: { type: [Boolean, String], required: false, skipCheck: true, default: void 0 },
|
|
37
|
+
labelSlot: { type: Boolean, required: false, skipCheck: true },
|
|
38
|
+
bottomSlots: { type: Boolean, required: false, skipCheck: true },
|
|
39
|
+
hideBottomSpace: { type: Boolean, required: false, skipCheck: true, default: true },
|
|
40
|
+
counter: { type: Boolean, required: false, skipCheck: true },
|
|
41
|
+
rounded: { type: Boolean, required: false, skipCheck: true, default: void 0 },
|
|
42
|
+
square: { type: Boolean, required: false, skipCheck: true, default: void 0 },
|
|
43
|
+
dense: { type: Boolean, required: false, skipCheck: true, default: void 0 },
|
|
44
|
+
itemAligned: { type: Boolean, required: false, skipCheck: true },
|
|
45
|
+
disable: { type: Boolean, required: false, skipCheck: true },
|
|
46
|
+
readonly: { type: Boolean, required: false, skipCheck: true },
|
|
47
|
+
autofocus: { type: Boolean, required: false, skipCheck: true },
|
|
48
|
+
for: { type: null, required: false },
|
|
49
|
+
multiple: { type: Boolean, required: false, skipCheck: true },
|
|
50
|
+
displayValue: { type: null, required: false },
|
|
51
|
+
displayValueHtml: { type: Boolean, required: false, skipCheck: true },
|
|
52
|
+
options: { type: null, required: false },
|
|
53
|
+
optionValue: { type: [Function, String], required: false, skipCheck: true },
|
|
54
|
+
optionLabel: { type: [Function, String], required: false, skipCheck: true },
|
|
55
|
+
optionDisable: { type: [Function, String], required: false, skipCheck: true },
|
|
56
|
+
hideSelected: { type: Boolean, required: false, skipCheck: true },
|
|
57
|
+
hideDropdownIcon: { type: Boolean, required: false, skipCheck: true },
|
|
58
|
+
dropdownIcon: { type: null, required: false },
|
|
59
|
+
maxValues: { type: null, required: false },
|
|
60
|
+
optionsDense: { type: Boolean, required: false, skipCheck: true },
|
|
61
|
+
optionsDark: { type: [Boolean, null], required: false, skipCheck: true, default: void 0 },
|
|
62
|
+
optionsSelectedClass: { type: null, required: false },
|
|
63
|
+
optionsHtml: { type: Boolean, required: false, skipCheck: true },
|
|
64
|
+
optionsCover: { type: Boolean, required: false, skipCheck: true },
|
|
65
|
+
menuShrink: { type: Boolean, required: false, skipCheck: true },
|
|
66
|
+
menuAnchor: { type: null, required: false },
|
|
67
|
+
menuSelf: { type: null, required: false },
|
|
68
|
+
menuOffset: { type: null, required: false },
|
|
69
|
+
popupContentClass: { type: null, required: false },
|
|
70
|
+
popupContentStyle: { type: null, required: false },
|
|
71
|
+
popupNoRouteDismiss: { type: Boolean, required: false, skipCheck: true },
|
|
72
|
+
useChips: { type: Boolean, required: false, skipCheck: true },
|
|
73
|
+
useInput: { type: Boolean, required: false, skipCheck: true },
|
|
74
|
+
maxlength: { type: null, required: false },
|
|
75
|
+
fillInput: { type: Boolean, required: false, skipCheck: true },
|
|
76
|
+
newValueMode: { type: null, required: false },
|
|
77
|
+
mapOptions: { type: Boolean, required: false, skipCheck: true },
|
|
78
|
+
disableTabSelection: { type: Boolean, required: false, skipCheck: true },
|
|
79
|
+
emitValue: { type: Boolean, required: false, skipCheck: true },
|
|
80
|
+
inputDebounce: { type: null, required: false, default: 0 },
|
|
81
|
+
inputClass: { type: null, required: false },
|
|
82
|
+
inputStyle: { type: null, required: false },
|
|
83
|
+
tabindex: { type: null, required: false },
|
|
84
|
+
autocomplete: { type: null, required: false },
|
|
85
|
+
transitionShow: { type: null, required: false },
|
|
86
|
+
transitionHide: { type: null, required: false },
|
|
87
|
+
transitionDuration: { type: null, required: false },
|
|
88
|
+
behavior: { type: null, required: false },
|
|
89
|
+
onVirtualScroll: { type: Function, required: false },
|
|
90
|
+
"onUpdate:modelValue": { type: Function, required: false },
|
|
91
|
+
onFocus: { type: Function, required: false },
|
|
92
|
+
onBlur: { type: Function, required: false },
|
|
93
|
+
onClear: { type: Function, required: false },
|
|
94
|
+
onInputValue: { type: Function, required: false },
|
|
95
|
+
onRemove: { type: Function, required: false },
|
|
96
|
+
onAdd: { type: Function, required: false },
|
|
97
|
+
onNewValue: { type: Function, required: false },
|
|
98
|
+
onFilter: { type: Function, required: false },
|
|
99
|
+
onFilterAbort: { type: Function, required: false },
|
|
100
|
+
onPopupShow: { type: Function, required: false },
|
|
101
|
+
onPopupHide: { type: Function, required: false }
|
|
102
|
+
});
|
|
103
|
+
const model = defineModel({ type: [String, null] });
|
|
104
|
+
const setModel = (val) => {
|
|
105
|
+
model.value = val;
|
|
106
|
+
};
|
|
107
|
+
const localOptions = ref(props.options || []);
|
|
108
|
+
const filterFn = (val, update, abort) => {
|
|
109
|
+
update(() => {
|
|
110
|
+
const needle = val.toLocaleLowerCase();
|
|
111
|
+
localOptions.value = props.options?.filter((v) => v.toLocaleLowerCase().indexOf(needle) > -1) || [];
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<template>
|
|
117
|
+
<q-select v-model="model" v-bind="$light.getInputProps($props)" :options="localOptions" use-input fill-input
|
|
118
|
+
hide-selected @filter="filterFn" @input-value="setModel">
|
|
119
|
+
<slot></slot>
|
|
120
|
+
</q-select>
|
|
121
|
+
</template>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { QSelectProps } from 'quasar';
|
|
2
|
+
export interface LInputSelectProps extends QSelectProps {
|
|
3
|
+
}
|
|
4
|
+
type __VLS_Props = LInputSelectProps;
|
|
5
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
6
|
+
modelValue?: string | null;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_11: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_11) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (value: string | null | undefined) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((value: string | null | undefined) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
dark: boolean | null;
|
|
18
|
+
rounded: boolean;
|
|
19
|
+
square: boolean;
|
|
20
|
+
dense: boolean;
|
|
21
|
+
outlined: boolean;
|
|
22
|
+
filled: boolean;
|
|
23
|
+
stackLabel: boolean;
|
|
24
|
+
standout: string | boolean;
|
|
25
|
+
hideBottomSpace: boolean;
|
|
26
|
+
inputDebounce: string | number;
|
|
27
|
+
optionsDark: boolean | null;
|
|
28
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -399,6 +399,9 @@ const onDelete = async (id) => {
|
|
|
399
399
|
};
|
|
400
400
|
const attrs = computed(() => {
|
|
401
401
|
const a = { ...light.styles.table, ...Object.fromEntries(Object.entries(props).filter(([key, value]) => value !== void 0)) };
|
|
402
|
+
if (props.name) {
|
|
403
|
+
a.visibleColumns = visibleColumns.value;
|
|
404
|
+
}
|
|
402
405
|
return {
|
|
403
406
|
...a,
|
|
404
407
|
loadingLabel: t(props.loadingLabel),
|
|
@@ -491,7 +494,21 @@ const showTopRight = computed(() => {
|
|
|
491
494
|
const hidableColumns = computed(() => {
|
|
492
495
|
return props.columns?.filter((c) => !c.required) || [];
|
|
493
496
|
});
|
|
494
|
-
const visibleColumns =
|
|
497
|
+
const visibleColumns = computed({
|
|
498
|
+
get() {
|
|
499
|
+
if (props.name) {
|
|
500
|
+
return useStorage("l-table-visible-columns-" + simpleRouteName.value + "-" + props.name, hidableColumns.value.map((c) => c.name)).value;
|
|
501
|
+
} else {
|
|
502
|
+
return null;
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
set(value) {
|
|
506
|
+
if (props.name) {
|
|
507
|
+
const storage = useStorage("l-table-visible-columns-" + simpleRouteName.value + "-" + props.name, hidableColumns.value.map((c) => c.name));
|
|
508
|
+
storage.value = value;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
});
|
|
495
512
|
watch(filters, () => {
|
|
496
513
|
onFilters();
|
|
497
514
|
}, { deep: true });
|
|
@@ -504,13 +521,12 @@ const hasFilters = computed(() => {
|
|
|
504
521
|
|
|
505
522
|
<template>
|
|
506
523
|
<q-table v-bind="attrs" :loading="loading" :rows="rows" ref="table" @request="onLocalRequest" :columns="columns"
|
|
507
|
-
v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected"
|
|
508
|
-
:visible-columns="visibleColumns">
|
|
524
|
+
v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected">
|
|
509
525
|
<template #header="props">
|
|
510
526
|
<q-tr :props="props">
|
|
511
|
-
<q-
|
|
512
|
-
<q-checkbox v-model="props.selected" />
|
|
513
|
-
</q-
|
|
527
|
+
<q-th v-if="selection != 'none'" auto-width>
|
|
528
|
+
<q-checkbox v-model="props.selected" :dense="table?.dense" />
|
|
529
|
+
</q-th>
|
|
514
530
|
<q-th v-if="hasRowExpand" auto-width></q-th>
|
|
515
531
|
<q-th v-if="hasActions" auto-width></q-th>
|
|
516
532
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">{{ col.label }}</q-th>
|
|
@@ -535,7 +551,7 @@ const hasFilters = computed(() => {
|
|
|
535
551
|
<template #body="props">
|
|
536
552
|
<q-tr :props="props">
|
|
537
553
|
<q-td v-if="selection != 'none'" auto-width>
|
|
538
|
-
<q-checkbox v-model="props.selected" />
|
|
554
|
+
<q-checkbox v-model="props.selected" :dense="table?.dense" />
|
|
539
555
|
</q-td>
|
|
540
556
|
<q-td v-if="hasRowExpand" auto-width>
|
|
541
557
|
<q-btn flat round size="sm" :icon="props.expand ? 'sym_o_expand_more' : 'sym_o_expand_less'"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare var __VLS_11: string | number, __VLS_12: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_11>]?: (props: typeof __VLS_12) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
|
+
context: {
|
|
7
|
+
type: ObjectConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
context: {
|
|
12
|
+
type: ObjectConstructor;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { getErrorMessage } from "formkit-quasar";
|
|
4
|
+
import { useI18n } from "vue-i18n";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
context: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: true
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const { t } = useI18n();
|
|
12
|
+
const { error, errorMessage } = getErrorMessage(props.context.node);
|
|
13
|
+
const value = computed({
|
|
14
|
+
get: () => props.context?.value,
|
|
15
|
+
set: (val) => props.context.node.input(val)
|
|
16
|
+
});
|
|
17
|
+
const onBlur = () => {
|
|
18
|
+
if (errorMessage.value) {
|
|
19
|
+
error.value = true;
|
|
20
|
+
} else {
|
|
21
|
+
error.value = false;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const label = computed(() => {
|
|
25
|
+
let l = t(props.context.label);
|
|
26
|
+
if (props.context.state.required) {
|
|
27
|
+
l = "* " + l;
|
|
28
|
+
}
|
|
29
|
+
return l;
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<l-input-select v-model="value" v-bind="context?.attrs" :label="label" :error="error" :error-message="errorMessage"
|
|
35
|
+
@blur="onBlur" :disable="context.disabled" :hint="context.help">
|
|
36
|
+
|
|
37
|
+
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
38
|
+
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
39
|
+
</template>
|
|
40
|
+
</l-input-select>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare var __VLS_11: string | number, __VLS_12: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_11>]?: (props: typeof __VLS_12) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
|
+
context: {
|
|
7
|
+
type: ObjectConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
context: {
|
|
12
|
+
type: ObjectConstructor;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -16,10 +16,16 @@ import EditorVue from "./Editor.vue";
|
|
|
16
16
|
import ToggleVue from "./Toggle.vue";
|
|
17
17
|
import GroupSelect from "./GroupSelect.vue";
|
|
18
18
|
import TextareaVue from "./Textarea.vue";
|
|
19
|
+
import InputSelect from "./InputSelect.vue";
|
|
19
20
|
export const createLightPlugin = () => {
|
|
20
21
|
return (node) => {
|
|
21
22
|
let type = node.props.type + "";
|
|
22
23
|
switch (type) {
|
|
24
|
+
case "l-input-select":
|
|
25
|
+
return node.define({
|
|
26
|
+
type: "input",
|
|
27
|
+
component: InputSelect
|
|
28
|
+
});
|
|
23
29
|
case "l-editor":
|
|
24
30
|
return node.define({
|
|
25
31
|
type: "input",
|