@mouseless/baked 1.4.3 → 1.5.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/Bake.vue +14 -12
- package/dist/runtime/components/{ServerPaginator.d.vue.ts → DataContainer.d.vue.ts} +0 -8
- package/dist/runtime/components/DataContainer.vue +73 -0
- package/dist/runtime/components/{ServerPaginator.vue.d.ts → DataContainer.vue.d.ts} +0 -8
- package/dist/runtime/components/DataPanel.vue +1 -1
- package/dist/runtime/components/DataTable.vue +7 -33
- package/dist/runtime/components/FormPage.vue +6 -3
- package/dist/runtime/components/Input.vue +13 -10
- package/dist/runtime/components/InputNumber.vue +11 -8
- package/dist/runtime/components/InputText.vue +11 -8
- package/dist/runtime/components/Labeler.d.vue.ts +65 -0
- package/dist/runtime/components/Labeler.vue +49 -0
- package/dist/runtime/components/Labeler.vue.d.ts +65 -0
- package/dist/runtime/components/PageSize.d.vue.ts +33 -0
- package/dist/runtime/components/PageSize.vue +28 -0
- package/dist/runtime/components/PageSize.vue.d.ts +33 -0
- package/dist/runtime/components/Paginator.d.vue.ts +25 -0
- package/dist/runtime/components/Paginator.vue +53 -0
- package/dist/runtime/components/Paginator.vue.d.ts +25 -0
- package/dist/runtime/components/Select.vue +11 -17
- package/dist/runtime/components/SelectButton.vue +31 -13
- package/package.json +8 -8
- package/dist/runtime/components/ServerPaginator.vue +0 -78
package/dist/module.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
|
-
:is="
|
|
3
|
+
:is="componentTemplate"
|
|
4
4
|
v-if="visible"
|
|
5
5
|
:key="loading"
|
|
6
6
|
:class="classes"
|
|
7
|
+
v-bind="getComponentProps()"
|
|
7
8
|
>
|
|
8
9
|
<slot v-if="$slots.default" />
|
|
9
10
|
</component>
|
|
10
11
|
</template>
|
|
11
12
|
|
|
12
13
|
<script setup>
|
|
13
|
-
import {
|
|
14
|
+
import { nextTick, onBeforeUnmount, onMounted, ref } from "vue";
|
|
14
15
|
import { useActionExecuter, useComponentResolver, useContext, useDataFetcher, useFormat, useReactionHandler } from "#imports";
|
|
15
16
|
const actionExecuter = useActionExecuter();
|
|
16
17
|
const componentResolver = useComponentResolver();
|
|
@@ -28,7 +29,7 @@ const parentPath = context.injectPath();
|
|
|
28
29
|
const path = parentPath && parentPath !== "" ? `${parentPath}/${name}` : name;
|
|
29
30
|
const events = context.injectEvents();
|
|
30
31
|
const contextData = context.injectContextData();
|
|
31
|
-
const
|
|
32
|
+
const componentTemplate = componentResolver.resolve(descriptor.type, "MissingComponent");
|
|
32
33
|
const componentProps = buildComponentProps();
|
|
33
34
|
const data = ref(dataFetcher.get({ data: descriptor.data, contextData }));
|
|
34
35
|
const shouldLoad = dataFetcher.shouldLoad(descriptor.data);
|
|
@@ -82,26 +83,27 @@ function buildComponentProps() {
|
|
|
82
83
|
if (descriptor.schema) {
|
|
83
84
|
result.schema = descriptor.schema;
|
|
84
85
|
}
|
|
85
|
-
if (
|
|
86
|
+
if (componentTemplate.emits?.includes("submit")) {
|
|
86
87
|
result.onSubmit = onModelUpdate;
|
|
87
88
|
}
|
|
88
|
-
if (
|
|
89
|
+
if (componentTemplate.props?.modelValue) {
|
|
89
90
|
result["onUpdate:modelValue"] = onModelUpdate;
|
|
90
|
-
nextTick(() => onModelUpdate(model.value));
|
|
91
91
|
}
|
|
92
92
|
return result;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function getComponentProps() {
|
|
95
|
+
const result = { ...componentProps };
|
|
95
96
|
if (descriptor.data) {
|
|
96
|
-
|
|
97
|
+
result.data = data.value;
|
|
97
98
|
}
|
|
98
|
-
if (
|
|
99
|
-
|
|
99
|
+
if (componentTemplate.props?.modelValue) {
|
|
100
|
+
result.modelValue = model.value;
|
|
101
|
+
nextTick(() => onModelUpdate(model.value));
|
|
100
102
|
}
|
|
101
|
-
return
|
|
103
|
+
return result;
|
|
102
104
|
}
|
|
103
105
|
async function onModelUpdate(newModel) {
|
|
104
|
-
if (
|
|
106
|
+
if (componentTemplate.props?.modelValue) {
|
|
105
107
|
model.value = newModel;
|
|
106
108
|
}
|
|
107
109
|
if (!descriptor.action) {
|
|
@@ -5,17 +5,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
5
5
|
type: null;
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
|
-
data: {
|
|
9
|
-
type: null;
|
|
10
|
-
required: true;
|
|
11
|
-
};
|
|
12
8
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
9
|
schema: {
|
|
14
10
|
type: null;
|
|
15
11
|
required: true;
|
|
16
12
|
};
|
|
17
|
-
data: {
|
|
18
|
-
type: null;
|
|
19
|
-
required: true;
|
|
20
|
-
};
|
|
21
13
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="
|
|
4
|
+
block bg-transparent
|
|
5
|
+
border rounded border-1
|
|
6
|
+
border-slate-200 dark:border-slate-700
|
|
7
|
+
"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
class="
|
|
11
|
+
px-2 py-4
|
|
12
|
+
bg-transparent border-b
|
|
13
|
+
dark:bg-zinc-900 dark:border-zinc-800
|
|
14
|
+
rounded-none text-sm
|
|
15
|
+
flex gap-4 items-center justify-end
|
|
16
|
+
"
|
|
17
|
+
>
|
|
18
|
+
<Inputs
|
|
19
|
+
v-if="inputs.length > 0"
|
|
20
|
+
:inputs="inputs"
|
|
21
|
+
@ready="onReady"
|
|
22
|
+
@changed="onChanged"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="pt-0 [contain:inline-size]">
|
|
26
|
+
<Bake
|
|
27
|
+
v-if="loaded && ready"
|
|
28
|
+
:key="uniqueKey"
|
|
29
|
+
name="content"
|
|
30
|
+
:descriptor="content"
|
|
31
|
+
/>
|
|
32
|
+
<Message
|
|
33
|
+
v-else-if="!ready"
|
|
34
|
+
severity="info"
|
|
35
|
+
>
|
|
36
|
+
<i class="pi pi-info-circle" />
|
|
37
|
+
<span class="ml-3">{{ lc("Select required values to view this data") }}</span>
|
|
38
|
+
</Message>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup>
|
|
44
|
+
import { ref } from "vue";
|
|
45
|
+
import { Message } from "primevue";
|
|
46
|
+
import { useContext, useLocalization } from "#imports";
|
|
47
|
+
import { Bake, Inputs } from "#components";
|
|
48
|
+
const context = useContext();
|
|
49
|
+
const { localize: lc } = useLocalization({ group: "DataContainer" });
|
|
50
|
+
const { schema } = defineProps({
|
|
51
|
+
schema: { type: null, required: true }
|
|
52
|
+
});
|
|
53
|
+
const { content, inputs } = schema;
|
|
54
|
+
const contextData = context.injectContextData();
|
|
55
|
+
const loaded = ref(true);
|
|
56
|
+
const ready = ref(inputs.length === 0);
|
|
57
|
+
const uniqueKey = ref("");
|
|
58
|
+
const values = ref({});
|
|
59
|
+
if (inputs.length > 0) {
|
|
60
|
+
contextData.parent["container-parameters"] = values;
|
|
61
|
+
}
|
|
62
|
+
function onReady(value) {
|
|
63
|
+
ready.value = value;
|
|
64
|
+
}
|
|
65
|
+
function onChanged(event) {
|
|
66
|
+
uniqueKey.value = event.uniqueKey;
|
|
67
|
+
values.value = event.values;
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<style>
|
|
72
|
+
.p-panel-content:has(.b-component--DataContainer) .b-component--DataContainer{@apply border-none rounded-none}.b-component--DataContainer div{@apply [&:has(.p-datatable)]:p-0}
|
|
73
|
+
</style>
|
|
@@ -5,17 +5,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
5
5
|
type: null;
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
|
-
data: {
|
|
9
|
-
type: null;
|
|
10
|
-
required: true;
|
|
11
|
-
};
|
|
12
8
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
9
|
schema: {
|
|
14
10
|
type: null;
|
|
15
11
|
required: true;
|
|
16
12
|
};
|
|
17
|
-
data: {
|
|
18
|
-
type: null;
|
|
19
|
-
required: true;
|
|
20
|
-
};
|
|
21
13
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -22,33 +22,6 @@
|
|
|
22
22
|
<template #empty>
|
|
23
23
|
{{ lc("No records found") }}
|
|
24
24
|
</template>
|
|
25
|
-
<div
|
|
26
|
-
v-if="sort || (!paginator && serverPaginatorOptions)"
|
|
27
|
-
class="
|
|
28
|
-
b-Header
|
|
29
|
-
flex flex-row items-center justify-end
|
|
30
|
-
gap-4 mb-2 py-4 px-2
|
|
31
|
-
"
|
|
32
|
-
>
|
|
33
|
-
<div
|
|
34
|
-
v-if="sort"
|
|
35
|
-
class="flex items-end justify-end"
|
|
36
|
-
>
|
|
37
|
-
<Bake
|
|
38
|
-
name="sort"
|
|
39
|
-
:descriptor="sort"
|
|
40
|
-
/>
|
|
41
|
-
</div>
|
|
42
|
-
<div
|
|
43
|
-
v-if="!paginator && serverPaginatorOptions"
|
|
44
|
-
class="flex justify-end"
|
|
45
|
-
>
|
|
46
|
-
<ServerPaginator
|
|
47
|
-
:schema="serverPaginatorOptions"
|
|
48
|
-
:data="data"
|
|
49
|
-
/>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
25
|
<Column
|
|
53
26
|
v-for="column in visibleColumns"
|
|
54
27
|
:key="column.key"
|
|
@@ -174,7 +147,7 @@ import Column from "primevue/column";
|
|
|
174
147
|
import { Button, ColumnGroup, DataTable, Menu, Row } from "primevue";
|
|
175
148
|
import { useRuntimeConfig } from "#app";
|
|
176
149
|
import { useComposableResolver, useContext, useDataFetcher, useLocalization } from "#imports";
|
|
177
|
-
import { AwaitLoading, Bake, ProvideParentContext
|
|
150
|
+
import { AwaitLoading, Bake, ProvideParentContext } from "#components";
|
|
178
151
|
const context = useContext();
|
|
179
152
|
const composableResolver = useComposableResolver();
|
|
180
153
|
const dataFetcher = useDataFetcher();
|
|
@@ -185,7 +158,7 @@ const { schema, data } = defineProps({
|
|
|
185
158
|
schema: { type: null, required: true },
|
|
186
159
|
data: { type: null, required: true }
|
|
187
160
|
});
|
|
188
|
-
const { actions, columns, dataKey, footerTemplate, itemsProp, paginator, rows, rowsWhenLoading, scrollHeight
|
|
161
|
+
const { actions, columns, dataKey, dataLengthContextKey, footerTemplate, itemsProp, paginator, rows, rowsWhenLoading, scrollHeight } = schema;
|
|
189
162
|
const exportOptions = schema.exportOptions && {
|
|
190
163
|
buttonIcon: "pi pi-download",
|
|
191
164
|
...schema.exportOptions
|
|
@@ -217,6 +190,9 @@ const visibleColumns = computed(() => columns.filter((c) => !c.hidden));
|
|
|
217
190
|
const footerColSpan = computed(() => columns.length - footerTemplate?.columns.length);
|
|
218
191
|
const exportFilename = ref(exportOptions?.fileName ? l(exportOptions.fileName) : null);
|
|
219
192
|
let formatter = null;
|
|
193
|
+
if (dataLengthContextKey && data) {
|
|
194
|
+
contextData.page[dataLengthContextKey] = data?.length;
|
|
195
|
+
}
|
|
220
196
|
if (exportOptions) {
|
|
221
197
|
headerActions.value.push({
|
|
222
198
|
label: l(exportOptions.buttonLabel),
|
|
@@ -280,10 +256,8 @@ function exportFunction({ data: data2, field }) {
|
|
|
280
256
|
</script>
|
|
281
257
|
|
|
282
258
|
<style>
|
|
283
|
-
.p-panel-content:has(.b-component--DataTable) .b-component--DataTable{@apply border-none rounded-none}.
|
|
259
|
+
.b-component--DataContainer:has(.b-component--DataTable) .b-component--DataTable,.p-panel-content:has(.b-component--DataTable) .b-component--DataTable{@apply border-none rounded-none}.b-component--DataContainer:has(.b-component--DataTable) .b-component--DataTable .p-datatable-table-container,.p-panel-content:has(.b-component--DataTable) .b-component--DataTable .p-datatable-table-container{@apply border-none}.b-component--DataTable{@apply border border-slate-200 dark:border-zinc-700
|
|
284
260
|
justify-self-center w-full
|
|
285
|
-
rounded-[--p-border-radius-md]}.b-component--DataTable .p-datatable-table-container{@apply border-none rounded-
|
|
286
|
-
dark:bg-zinc-900 mb-0
|
|
287
|
-
rounded-t-[--p-border-radius-md]}.b-component--DataTable:has(.b-Header) .p-datatable-table-container{@apply rounded-b-[--p-border-radius-md]}.b-component--DataTable:has(:not(.b-Header)) .p-datatable-table-container{@apply rounded-[--p-border-radius-md]}.b-component--DataTable:has(.p-datatable-paginator-bottom) .p-datatable-paginator-bottom{@apply border-t rounded-t-none
|
|
261
|
+
rounded-[--p-border-radius-md]}.b-component--DataTable .p-datatable-table-container{@apply border-none rounded-[--p-border-radius-md]}.b-component--DataTable:has(.p-datatable-paginator-bottom) .p-datatable-paginator-bottom{@apply border-t rounded-t-none
|
|
288
262
|
rounded-b-[--p-border-radius-md] border-b-0}.b-component--DataTable:has(.p-datatable-paginator-bottom) .p-datatable-table-container{@apply rounded-b-none}.b-component--DataTable tbody>tr:last-child>td{@apply border-b-0}.b-component--DataTable tfoot>tr>td{@apply border-t}.b-component--DataTable .b-label-column--wide{@apply 3xl:w-[30%] 2xl:w-[20%] xl:w-[15%]}.b-component--DataTable .b-label-column--narrow{@apply 3xl:w-[40%] 2xl:w-[30%] xl:w-[20%]}.b-component--DataTable a{@apply text-sm}.b-component--DataTable .p-button{@apply -my-2}.b-component--DataTable td.p-datatable-frozen-column{@apply z-[1]}.b-component--DataTable .p-datatable-thead{@apply z-[2]}
|
|
289
263
|
</style>
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
</template>
|
|
14
14
|
</PageTitle>
|
|
15
15
|
<div class="flex justify-center">
|
|
16
|
-
<Contents
|
|
16
|
+
<Contents
|
|
17
|
+
v-focustrap
|
|
18
|
+
class="gap-6"
|
|
19
|
+
>
|
|
17
20
|
<div
|
|
18
21
|
v-for="section in sections"
|
|
19
22
|
:key="section.key"
|
|
@@ -51,7 +54,7 @@
|
|
|
51
54
|
<div
|
|
52
55
|
v-for="inputGroup in inputGroups"
|
|
53
56
|
:key="inputGroup.key"
|
|
54
|
-
class="w-full flex gap-4 max-md:flex-col"
|
|
57
|
+
class="w-full flex gap-4 max-md:flex-col self-end"
|
|
55
58
|
:class="{
|
|
56
59
|
'col-span-2': inputGroup.wide,
|
|
57
60
|
'reset-min-w': inputGroup.inputs.length > 1
|
|
@@ -98,7 +101,7 @@ function splitByWide(inputGroups) {
|
|
|
98
101
|
cur = [];
|
|
99
102
|
}
|
|
100
103
|
result.push(cur);
|
|
101
|
-
return result;
|
|
104
|
+
return result.filter((r) => r.length);
|
|
102
105
|
}
|
|
103
106
|
function onReady(key, value) {
|
|
104
107
|
Object.assign(readyData.value, { [key]: value });
|
|
@@ -23,7 +23,7 @@ const query = schema.queryBound ? computed(() => route.query[schema.name]) : voi
|
|
|
23
23
|
onAfterMountData(async () => {
|
|
24
24
|
if (!checkValue(model.value)) {
|
|
25
25
|
if (schema.queryBound && checkValue(query.value)) {
|
|
26
|
-
|
|
26
|
+
setModel(query.value);
|
|
27
27
|
} else {
|
|
28
28
|
await set(defaultValue.value);
|
|
29
29
|
}
|
|
@@ -31,11 +31,11 @@ onAfterMountData(async () => {
|
|
|
31
31
|
if (schema.queryBound) {
|
|
32
32
|
watch(() => route.query, async (newQuery) => {
|
|
33
33
|
const newValue = newQuery[schema.name];
|
|
34
|
-
if (!checkValue(newValue) && schema.required && defaultValue.value) {
|
|
34
|
+
if (!checkValue(newValue) && schema.required && checkValue(defaultValue.value)) {
|
|
35
35
|
await set(defaultValue.value);
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
setModel(newValue);
|
|
39
39
|
}, { immediate: true });
|
|
40
40
|
}
|
|
41
41
|
watch(model, async (newValue) => {
|
|
@@ -46,8 +46,13 @@ onAfterMountData(async () => {
|
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
48
|
async function set(value) {
|
|
49
|
-
if (schema.queryBound) {
|
|
50
|
-
if (value
|
|
49
|
+
if (!schema.queryBound) {
|
|
50
|
+
if (!checkValue(value)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
setModel(value);
|
|
54
|
+
} else {
|
|
55
|
+
if (String(value) === String(query.value)) {
|
|
51
56
|
return;
|
|
52
57
|
}
|
|
53
58
|
await router.push({
|
|
@@ -59,11 +64,6 @@ async function set(value) {
|
|
|
59
64
|
// prevents extra browser history when setting default value of input
|
|
60
65
|
replace: schema.required && (schema.default || schema.defaultSelfManaged) && !query.value
|
|
61
66
|
});
|
|
62
|
-
} else {
|
|
63
|
-
if (!value) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
model.value = value;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
function checkValue(value) {
|
|
@@ -72,4 +72,7 @@ function checkValue(value) {
|
|
|
72
72
|
}
|
|
73
73
|
return value !== void 0 && value !== null;
|
|
74
74
|
}
|
|
75
|
+
function setModel(value) {
|
|
76
|
+
model.value = schema.numeric ? Number(value) : value;
|
|
77
|
+
}
|
|
75
78
|
</script>
|
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
<Skeleton class="min-h-10" />
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
|
-
<
|
|
8
|
+
<Labeler
|
|
9
|
+
:label
|
|
10
|
+
:path
|
|
11
|
+
:mode="labelMode"
|
|
12
|
+
:variant="labelVariant"
|
|
13
|
+
>
|
|
9
14
|
<InputNumber
|
|
10
15
|
v-model="model"
|
|
11
16
|
v-bind="$attrs"
|
|
@@ -13,22 +18,20 @@
|
|
|
13
18
|
class="min-w-60"
|
|
14
19
|
@input="onInput"
|
|
15
20
|
/>
|
|
16
|
-
|
|
17
|
-
</FloatLabel>
|
|
21
|
+
</Labeler>
|
|
18
22
|
</AwaitLoading>
|
|
19
23
|
</template>
|
|
20
24
|
|
|
21
25
|
<script setup>
|
|
22
|
-
import {
|
|
23
|
-
import { useContext
|
|
24
|
-
import { AwaitLoading } from "#components";
|
|
26
|
+
import { InputNumber, Skeleton } from "primevue";
|
|
27
|
+
import { useContext } from "#imports";
|
|
28
|
+
import { AwaitLoading, Labeler } from "#components";
|
|
25
29
|
const context = useContext();
|
|
26
|
-
const { localize: l } = useLocalization();
|
|
27
30
|
const { schema } = defineProps({
|
|
28
31
|
schema: { type: null, required: true }
|
|
29
32
|
});
|
|
30
33
|
const model = defineModel({ type: null, required: true });
|
|
31
|
-
const { label, noGrouping } = schema;
|
|
34
|
+
const { label, labelMode, labelVariant, noGrouping } = schema;
|
|
32
35
|
const path = context.injectPath();
|
|
33
36
|
function onInput(event) {
|
|
34
37
|
model.value = event.value;
|
|
@@ -5,30 +5,33 @@
|
|
|
5
5
|
<Skeleton class="min-h-10" />
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
|
-
<
|
|
8
|
+
<Labeler
|
|
9
|
+
:label
|
|
10
|
+
:path
|
|
11
|
+
:mode="labelMode"
|
|
12
|
+
:variant="labelVariant"
|
|
13
|
+
>
|
|
9
14
|
<InputText
|
|
10
15
|
v-model="input"
|
|
11
16
|
v-bind="$attrs"
|
|
12
17
|
class="min-w-60"
|
|
13
18
|
@update:model-value="onUpdate"
|
|
14
19
|
/>
|
|
15
|
-
|
|
16
|
-
</FloatLabel>
|
|
20
|
+
</Labeler>
|
|
17
21
|
</AwaitLoading>
|
|
18
22
|
</template>
|
|
19
23
|
|
|
20
24
|
<script setup>
|
|
21
25
|
import { ref } from "vue";
|
|
22
|
-
import {
|
|
23
|
-
import { useContext
|
|
24
|
-
import { AwaitLoading } from "#components";
|
|
26
|
+
import { InputText, Skeleton } from "primevue";
|
|
27
|
+
import { useContext } from "#imports";
|
|
28
|
+
import { AwaitLoading, Labeler } from "#components";
|
|
25
29
|
const context = useContext();
|
|
26
|
-
const { localize: l } = useLocalization();
|
|
27
30
|
const { schema } = defineProps({
|
|
28
31
|
schema: { type: null, required: true }
|
|
29
32
|
});
|
|
30
33
|
const model = defineModel({ type: null, required: true });
|
|
31
|
-
const { label, targetProp } = schema;
|
|
34
|
+
const { label, labelMode, labelVariant, targetProp } = schema;
|
|
32
35
|
const path = context.injectPath();
|
|
33
36
|
const input = ref("");
|
|
34
37
|
function onUpdate(value) {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
4
|
+
type __VLS_WithSlots<T, S> = T & (new () => {
|
|
5
|
+
$slots: S;
|
|
6
|
+
});
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
label: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
path: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
mode: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: null;
|
|
19
|
+
};
|
|
20
|
+
variant: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
pt: {
|
|
25
|
+
type: ObjectConstructor;
|
|
26
|
+
default: () => void;
|
|
27
|
+
};
|
|
28
|
+
dt: {
|
|
29
|
+
type: ObjectConstructor;
|
|
30
|
+
default: () => void;
|
|
31
|
+
};
|
|
32
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
+
label: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
path: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
mode: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
default: null;
|
|
44
|
+
};
|
|
45
|
+
variant: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
default: string;
|
|
48
|
+
};
|
|
49
|
+
pt: {
|
|
50
|
+
type: ObjectConstructor;
|
|
51
|
+
default: () => void;
|
|
52
|
+
};
|
|
53
|
+
dt: {
|
|
54
|
+
type: ObjectConstructor;
|
|
55
|
+
default: () => void;
|
|
56
|
+
};
|
|
57
|
+
}>> & Readonly<{}>, {
|
|
58
|
+
variant: string;
|
|
59
|
+
dt: Record<string, any>;
|
|
60
|
+
pt: Record<string, any>;
|
|
61
|
+
mode: string;
|
|
62
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
63
|
+
type __VLS_Slots = {
|
|
64
|
+
default?: ((props: {}) => any) | undefined;
|
|
65
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="labelComponent"
|
|
4
|
+
:dt
|
|
5
|
+
:pt
|
|
6
|
+
:variant
|
|
7
|
+
>
|
|
8
|
+
<template #default>
|
|
9
|
+
<slot />
|
|
10
|
+
<label
|
|
11
|
+
v-if="labelComponent !== 'div'"
|
|
12
|
+
class="max-sm:truncate max-sm:w-5/6"
|
|
13
|
+
:for="path"
|
|
14
|
+
>
|
|
15
|
+
{{ l(label) }}
|
|
16
|
+
</label>
|
|
17
|
+
</template>
|
|
18
|
+
</component>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup>
|
|
22
|
+
import { computed } from "vue";
|
|
23
|
+
import { FloatLabel, IftaLabel } from "primevue";
|
|
24
|
+
import { useLocalization } from "#imports";
|
|
25
|
+
const { localize: l } = useLocalization();
|
|
26
|
+
const { label, mode } = defineProps({
|
|
27
|
+
label: { type: String, required: true },
|
|
28
|
+
path: { type: String, required: true },
|
|
29
|
+
mode: { type: String, default: null },
|
|
30
|
+
variant: { type: String, default: "on" },
|
|
31
|
+
pt: { type: Object, default: () => {
|
|
32
|
+
} },
|
|
33
|
+
dt: { type: Object, default: () => {
|
|
34
|
+
} }
|
|
35
|
+
});
|
|
36
|
+
const labelComponent = computed(() => {
|
|
37
|
+
if (!label) {
|
|
38
|
+
return "div";
|
|
39
|
+
}
|
|
40
|
+
switch (mode) {
|
|
41
|
+
case "ifta":
|
|
42
|
+
return IftaLabel;
|
|
43
|
+
case "float":
|
|
44
|
+
return FloatLabel;
|
|
45
|
+
default:
|
|
46
|
+
return "div";
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
4
|
+
type __VLS_WithSlots<T, S> = T & (new () => {
|
|
5
|
+
$slots: S;
|
|
6
|
+
});
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
label: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
path: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
mode: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: null;
|
|
19
|
+
};
|
|
20
|
+
variant: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
pt: {
|
|
25
|
+
type: ObjectConstructor;
|
|
26
|
+
default: () => void;
|
|
27
|
+
};
|
|
28
|
+
dt: {
|
|
29
|
+
type: ObjectConstructor;
|
|
30
|
+
default: () => void;
|
|
31
|
+
};
|
|
32
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
+
label: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
path: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
mode: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
default: null;
|
|
44
|
+
};
|
|
45
|
+
variant: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
default: string;
|
|
48
|
+
};
|
|
49
|
+
pt: {
|
|
50
|
+
type: ObjectConstructor;
|
|
51
|
+
default: () => void;
|
|
52
|
+
};
|
|
53
|
+
dt: {
|
|
54
|
+
type: ObjectConstructor;
|
|
55
|
+
default: () => void;
|
|
56
|
+
};
|
|
57
|
+
}>> & Readonly<{}>, {
|
|
58
|
+
variant: string;
|
|
59
|
+
dt: Record<string, any>;
|
|
60
|
+
pt: Record<string, any>;
|
|
61
|
+
mode: string;
|
|
62
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
63
|
+
type __VLS_Slots = {
|
|
64
|
+
default?: ((props: {}) => any) | undefined;
|
|
65
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
schema: {
|
|
5
|
+
type: null;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
data: {
|
|
9
|
+
type: null;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: import("vue").PropType<any>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
"update:modelValue": (value: any) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
schema: {
|
|
20
|
+
type: null;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
data: {
|
|
24
|
+
type: null;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: import("vue").PropType<any>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
}>> & Readonly<{
|
|
32
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
33
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Select
|
|
3
|
+
v-if="isXs"
|
|
4
|
+
v-model="model"
|
|
5
|
+
:schema
|
|
6
|
+
:data
|
|
7
|
+
class="
|
|
8
|
+
shadow-none rounded-md
|
|
9
|
+
bg-slate-100 border-slate-100
|
|
10
|
+
dark:bg-zinc-950 dark:border-zinc-950
|
|
11
|
+
"
|
|
12
|
+
/>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup>
|
|
16
|
+
import { useBreakpoints } from "#imports";
|
|
17
|
+
import { Select } from "#components";
|
|
18
|
+
const { isXs } = useBreakpoints();
|
|
19
|
+
defineProps({
|
|
20
|
+
schema: { type: null, required: true },
|
|
21
|
+
data: { type: null, required: true }
|
|
22
|
+
});
|
|
23
|
+
const model = defineModel({ type: null, required: true });
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<style>
|
|
27
|
+
.b-component--PageSize .p-select-label{font-size:inherit}
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
schema: {
|
|
5
|
+
type: null;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
data: {
|
|
9
|
+
type: null;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: import("vue").PropType<any>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
"update:modelValue": (value: any) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
schema: {
|
|
20
|
+
type: null;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
data: {
|
|
24
|
+
type: null;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: import("vue").PropType<any>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
}>> & Readonly<{
|
|
32
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
33
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
data: {
|
|
5
|
+
type: null;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: import("vue").PropType<any>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (value: any) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
data: {
|
|
16
|
+
type: null;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
modelValue: {
|
|
20
|
+
type: import("vue").PropType<any>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
}>> & Readonly<{
|
|
24
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<AwaitLoading>
|
|
3
|
+
<div class="flex items-center justify-center gap-1">
|
|
4
|
+
<span class="whitespace-nowrap text-xs max-xs:hidden">{{ lc("Page {page}", { page }) }}</span>
|
|
5
|
+
<Button
|
|
6
|
+
rounded
|
|
7
|
+
variant="text"
|
|
8
|
+
icon="pi pi-chevron-left"
|
|
9
|
+
:disabled="!allowPrevious"
|
|
10
|
+
severity="secondary"
|
|
11
|
+
size="small"
|
|
12
|
+
@click="page--"
|
|
13
|
+
/>
|
|
14
|
+
<Button
|
|
15
|
+
rounded
|
|
16
|
+
variant="text"
|
|
17
|
+
icon="pi pi-chevron-right"
|
|
18
|
+
severity="secondary"
|
|
19
|
+
size="small"
|
|
20
|
+
:disabled="!allowNext"
|
|
21
|
+
@click="page++"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
</AwaitLoading>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup>
|
|
28
|
+
import { computed } from "vue";
|
|
29
|
+
import { Button } from "primevue";
|
|
30
|
+
import { useContext, useLocalization } from "#imports";
|
|
31
|
+
import { AwaitLoading } from "#components";
|
|
32
|
+
const context = useContext();
|
|
33
|
+
const { localize: lc } = useLocalization({ group: "Paginator" });
|
|
34
|
+
const { data } = defineProps({
|
|
35
|
+
data: { type: null, required: true }
|
|
36
|
+
});
|
|
37
|
+
const model = defineModel({ type: null, required: true });
|
|
38
|
+
const path = context.injectPath();
|
|
39
|
+
const takeStateKey = path + ".take";
|
|
40
|
+
const contextData = context.injectContextData();
|
|
41
|
+
const allowPrevious = computed(() => !Number.isNaN(page.value) && page.value > 1);
|
|
42
|
+
const allowNext = computed(() => !Number.isNaN(page.value) && data.length >= data.take);
|
|
43
|
+
const page = computed({
|
|
44
|
+
get: () => Number(model.value) / Number(data.take) + 1,
|
|
45
|
+
set: (value) => {
|
|
46
|
+
model.value = (value - 1) * Number(data.take);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
if (data && contextData.page[takeStateKey] !== data.take) {
|
|
50
|
+
contextData.page[takeStateKey] = data.take;
|
|
51
|
+
page.value = 1;
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
data: {
|
|
5
|
+
type: null;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: import("vue").PropType<any>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (value: any) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
data: {
|
|
16
|
+
type: null;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
modelValue: {
|
|
20
|
+
type: import("vue").PropType<any>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
}>> & Readonly<{
|
|
24
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
<Skeleton class="min-h-10" />
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
|
-
<
|
|
9
|
-
:
|
|
10
|
-
|
|
8
|
+
<Labeler
|
|
9
|
+
:label
|
|
10
|
+
:path
|
|
11
|
+
:mode="labelMode"
|
|
12
|
+
:variant="labelVariant"
|
|
11
13
|
>
|
|
12
14
|
<Select
|
|
13
15
|
v-bind="$attrs"
|
|
@@ -31,21 +33,15 @@
|
|
|
31
33
|
<span>{{ getOptionLabel(slotProps) }}</span>
|
|
32
34
|
</template>
|
|
33
35
|
</Select>
|
|
34
|
-
|
|
35
|
-
v-if="!noFloatLabel"
|
|
36
|
-
:for="path"
|
|
37
|
-
>
|
|
38
|
-
{{ l(label) }}
|
|
39
|
-
</label>
|
|
40
|
-
</component>
|
|
36
|
+
</Labeler>
|
|
41
37
|
</AwaitLoading>
|
|
42
38
|
</template>
|
|
43
39
|
|
|
44
40
|
<script setup>
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
41
|
+
import { ref, watch } from "vue";
|
|
42
|
+
import { Select, Skeleton } from "primevue";
|
|
47
43
|
import { useContext, useUiStates, useLocalization } from "#imports";
|
|
48
|
-
import { AwaitLoading } from "#components";
|
|
44
|
+
import { AwaitLoading, Labeler } from "#components";
|
|
49
45
|
const context = useContext();
|
|
50
46
|
const { localize: l } = useLocalization();
|
|
51
47
|
const { value: { selectStates } } = useUiStates();
|
|
@@ -54,11 +50,9 @@ const { schema, data } = defineProps({
|
|
|
54
50
|
data: { type: null, required: true }
|
|
55
51
|
});
|
|
56
52
|
const model = defineModel({ type: null, required: true });
|
|
57
|
-
const { filter, label,
|
|
53
|
+
const { filter, label, labelMode, labelVariant, localizeLabel, optionLabel, optionValue, showClear, stateful, targetProp } = schema;
|
|
58
54
|
const path = context.injectPath();
|
|
59
55
|
const selected = ref();
|
|
60
|
-
const labelComponent = computed(() => noFloatLabel ? "div" : FloatLabel);
|
|
61
|
-
const labelProps = computed(() => noFloatLabel ? {} : { variant: "on" });
|
|
62
56
|
watch(
|
|
63
57
|
[() => data, getModel],
|
|
64
58
|
([_data, _model]) => {
|
|
@@ -104,5 +98,5 @@ function setSelected(value) {
|
|
|
104
98
|
</script>
|
|
105
99
|
|
|
106
100
|
<style>
|
|
107
|
-
.b-component--Select .p-placeholder{
|
|
101
|
+
.b-component--Select .p-placeholder{opacity:0}.b-component--Select .p-select-label{font-size:inherit}
|
|
108
102
|
</style>
|
|
@@ -5,16 +5,21 @@
|
|
|
5
5
|
<Skeleton class="min-h-10" />
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
<Labeler
|
|
9
|
+
:label
|
|
10
|
+
:path
|
|
11
|
+
:mode="labelMode == 'ifta' ? labelMode : null"
|
|
12
|
+
:dt="{
|
|
13
|
+
colorScheme: {
|
|
14
|
+
light: {
|
|
15
|
+
top: '-1rem',
|
|
16
|
+
},
|
|
17
|
+
dark: {
|
|
18
|
+
top: '-1rem'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}"
|
|
22
|
+
>
|
|
18
23
|
<SelectButton
|
|
19
24
|
v-if="data"
|
|
20
25
|
v-model="selected"
|
|
@@ -28,7 +33,7 @@
|
|
|
28
33
|
<span>{{ getOptionLabel(slotProps) }}</span>
|
|
29
34
|
</template>
|
|
30
35
|
</SelectButton>
|
|
31
|
-
</
|
|
36
|
+
</Labeler>
|
|
32
37
|
</AwaitLoading>
|
|
33
38
|
</template>
|
|
34
39
|
|
|
@@ -36,7 +41,7 @@
|
|
|
36
41
|
import { ref, watch } from "vue";
|
|
37
42
|
import { SelectButton, Skeleton } from "primevue";
|
|
38
43
|
import { useContext, useLocalization, useUiStates } from "#imports";
|
|
39
|
-
import { AwaitLoading } from "#components";
|
|
44
|
+
import { AwaitLoading, Labeler } from "#components";
|
|
40
45
|
const context = useContext();
|
|
41
46
|
const { localize: l } = useLocalization();
|
|
42
47
|
const { value: { selectButtonStates } } = useUiStates();
|
|
@@ -45,7 +50,16 @@ const { schema, data } = defineProps({
|
|
|
45
50
|
data: { type: null, required: true }
|
|
46
51
|
});
|
|
47
52
|
const model = defineModel({ type: null, required: true });
|
|
48
|
-
const {
|
|
53
|
+
const {
|
|
54
|
+
allowEmpty = false,
|
|
55
|
+
label,
|
|
56
|
+
labelMode,
|
|
57
|
+
localizeLabel,
|
|
58
|
+
optionLabel,
|
|
59
|
+
optionValue,
|
|
60
|
+
stateful,
|
|
61
|
+
targetProp
|
|
62
|
+
} = schema;
|
|
49
63
|
const path = context.injectPath();
|
|
50
64
|
const selected = ref();
|
|
51
65
|
watch(
|
|
@@ -91,3 +105,7 @@ function setSelected(value) {
|
|
|
91
105
|
<style>
|
|
92
106
|
.p-togglebutton-content{@apply whitespace-nowrap}.p-popover-content .b-component--SelectButton .p-selectbutton{@apply max-sm:flex max-sm:flex-col}.p-popover-content .b-component--SelectButton .p-selectbutton .p-togglebutton:first-child{@apply max-sm:rounded-t-lg max-sm:rounded-es-none}.p-popover-content .b-component--SelectButton .p-selectbutton .p-togglebutton:last-child{@apply max-sm:rounded-b-lg max-sm:rounded-se-none}
|
|
93
107
|
</style>
|
|
108
|
+
|
|
109
|
+
<style scoped>
|
|
110
|
+
&:has(.p-iftalabel) .p-iftalabel{@apply mt-2}
|
|
111
|
+
</style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mouseless/baked",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Baked is an opinionated framework for .NET and Vue. This is the UI package of Baked project.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"baked",
|
|
@@ -61,14 +61,14 @@
|
|
|
61
61
|
"sass": "1.99.0",
|
|
62
62
|
"typescript": "6.0.3",
|
|
63
63
|
"vitest": "4.1.5",
|
|
64
|
-
"vue-tsc": "3.2.
|
|
64
|
+
"vue-tsc": "3.2.8"
|
|
65
65
|
},
|
|
66
66
|
"optionalDependencies": {
|
|
67
|
-
"@oxc-parser/binding-darwin-arm64": "0.
|
|
68
|
-
"@oxc-parser/binding-linux-arm64-gnu": "0.
|
|
69
|
-
"@oxc-parser/binding-linux-arm64-musl": "0.
|
|
70
|
-
"@oxc-parser/binding-linux-x64-gnu": "0.
|
|
71
|
-
"@oxc-parser/binding-linux-x64-musl": "0.
|
|
72
|
-
"@oxc-parser/binding-win32-x64-msvc": "0.
|
|
67
|
+
"@oxc-parser/binding-darwin-arm64": "0.129.0",
|
|
68
|
+
"@oxc-parser/binding-linux-arm64-gnu": "0.129.0",
|
|
69
|
+
"@oxc-parser/binding-linux-arm64-musl": "0.129.0",
|
|
70
|
+
"@oxc-parser/binding-linux-x64-gnu": "0.129.0",
|
|
71
|
+
"@oxc-parser/binding-linux-x64-musl": "0.129.0",
|
|
72
|
+
"@oxc-parser/binding-win32-x64-msvc": "0.129.0"
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex items-center justify-center gap-1">
|
|
3
|
-
<Bake
|
|
4
|
-
v-if="takeComponent && isXs"
|
|
5
|
-
v-model="take"
|
|
6
|
-
name="take"
|
|
7
|
-
class="
|
|
8
|
-
mr-2 shadow-none rounded-md
|
|
9
|
-
bg-slate-100 border-slate-100
|
|
10
|
-
dark:bg-zinc-950 dark:border-zinc-950
|
|
11
|
-
"
|
|
12
|
-
:descriptor="takeComponent"
|
|
13
|
-
/>
|
|
14
|
-
<span class="whitespace-nowrap text-xs max-xs:hidden">{{ lc("Page {page}", { page }) }}</span>
|
|
15
|
-
<Button
|
|
16
|
-
rounded
|
|
17
|
-
variant="text"
|
|
18
|
-
icon="pi pi-chevron-left"
|
|
19
|
-
:disabled="page <= 1"
|
|
20
|
-
severity="secondary"
|
|
21
|
-
size="small"
|
|
22
|
-
@click="page--"
|
|
23
|
-
/>
|
|
24
|
-
<Button
|
|
25
|
-
rounded
|
|
26
|
-
variant="text"
|
|
27
|
-
icon="pi pi-chevron-right"
|
|
28
|
-
severity="secondary"
|
|
29
|
-
size="small"
|
|
30
|
-
:disabled="!allowNext"
|
|
31
|
-
@click="page++"
|
|
32
|
-
/>
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<script setup>
|
|
37
|
-
import { computed, ref, watch } from "vue";
|
|
38
|
-
import { Button } from "primevue";
|
|
39
|
-
import { useRoute, useRouter } from "#app";
|
|
40
|
-
import { useBreakpoints, useContext, useLocalization } from "#imports";
|
|
41
|
-
import { Bake } from "#components";
|
|
42
|
-
const route = useRoute();
|
|
43
|
-
const router = useRouter();
|
|
44
|
-
const { isXs } = useBreakpoints();
|
|
45
|
-
const context = useContext();
|
|
46
|
-
const { localize: lc } = useLocalization({ group: "ServerPaginator" });
|
|
47
|
-
const { schema, data } = defineProps({
|
|
48
|
-
schema: { type: null, required: true },
|
|
49
|
-
data: { type: null, required: true }
|
|
50
|
-
});
|
|
51
|
-
const { take: takeComponent, takeParameterName = "take", skipParameterName = "skip", pageChangeEventName = "page-changed" } = schema;
|
|
52
|
-
const events = context.injectEvents();
|
|
53
|
-
context.provideLoading(false);
|
|
54
|
-
const take = ref(Number(route.query[takeParameterName]) || 10);
|
|
55
|
-
const allowNext = computed(() => data?.length >= take.value);
|
|
56
|
-
const skip = computed(() => Number(route.query[skipParameterName]) || 0);
|
|
57
|
-
const page = computed({
|
|
58
|
-
get: () => skip.value / take.value + 1 || 1,
|
|
59
|
-
set: (value) => {
|
|
60
|
-
router.push({
|
|
61
|
-
query: {
|
|
62
|
-
...route.query,
|
|
63
|
-
[skipParameterName]: (value - 1) * take.value,
|
|
64
|
-
[takeParameterName]: take.value
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
watch(take, (newTake, oldTake) => {
|
|
70
|
-
if (oldTake === newTake) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
page.value = 1;
|
|
74
|
-
});
|
|
75
|
-
watch([() => route.query[skipParameterName], () => route.query[takeParameterName]], () => {
|
|
76
|
-
events.publish(pageChangeEventName, page.value);
|
|
77
|
-
});
|
|
78
|
-
</script>
|