@mouseless/baked 0.19.1 → 0.19.2
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/module.mjs +8 -1
- package/dist/runtime/assets/overrides.css +1 -1
- package/dist/runtime/components/DataTable.vue +2 -2
- package/dist/runtime/components/DefaultLayout.vue +4 -1
- package/dist/runtime/components/Layout.vue +1 -1
- package/dist/runtime/components/PageTitle.vue +1 -1
- package/dist/runtime/components/Parameters.vue +15 -14
- package/dist/runtime/components/QueryParameters.vue +9 -3
- package/dist/runtime/components/SideMenu.vue +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -102,7 +102,14 @@ const module = defineNuxtModule({
|
|
|
102
102
|
_nuxt.options.tailwindcss = {
|
|
103
103
|
config: {
|
|
104
104
|
theme: {
|
|
105
|
-
screens: _options.composables.useBreakpoints.screens
|
|
105
|
+
screens: _options.composables.useBreakpoints.screens,
|
|
106
|
+
extend: {
|
|
107
|
+
colors: {
|
|
108
|
+
zinc: {
|
|
109
|
+
925: "#121214"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
106
113
|
}
|
|
107
114
|
}
|
|
108
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
html{@apply max-xs:text-[smaller]}.bg-body{
|
|
1
|
+
html{@apply max-xs:text-[smaller]}.bg-body,html{@apply bg-white}.p-datatable-tbody td.p-datatable-frozen-column{background:inherit}.p-popover-content>div{@apply max-sm:p-0}@media (prefers-color-scheme:dark){.bg-body,html{@apply bg-zinc-925}}
|
|
@@ -160,8 +160,8 @@ const value = computed(() => {
|
|
|
160
160
|
const result = [];
|
|
161
161
|
for (const itemRow of items) {
|
|
162
162
|
const resultRow = { $getRow: () => itemRow };
|
|
163
|
-
for (const
|
|
164
|
-
resultRow[
|
|
163
|
+
for (const key in itemRow) {
|
|
164
|
+
resultRow[key] = { value: itemRow[key], $getRow: () => itemRow };
|
|
165
165
|
}
|
|
166
166
|
result.push(resultRow);
|
|
167
167
|
}
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
<slot />
|
|
25
25
|
</article>
|
|
26
26
|
</div>
|
|
27
|
-
<ScrollTop
|
|
27
|
+
<ScrollTop
|
|
28
|
+
v-bind="scrollTopOptions"
|
|
29
|
+
/>
|
|
28
30
|
</template>
|
|
29
31
|
|
|
30
32
|
<script setup>
|
|
@@ -37,6 +39,7 @@ const { schema } = defineProps({
|
|
|
37
39
|
data: { type: null, default: null }
|
|
38
40
|
});
|
|
39
41
|
const { header, sideMenu } = schema;
|
|
42
|
+
const scrollTopOptions = { threshold: 250, ...schema.scrollTopOptions };
|
|
40
43
|
</script>
|
|
41
44
|
|
|
42
45
|
<style>
|
|
@@ -80,7 +80,6 @@
|
|
|
80
80
|
<PersistentPopover
|
|
81
81
|
ref="popover"
|
|
82
82
|
fixed
|
|
83
|
-
class="!z-[1002]"
|
|
84
83
|
>
|
|
85
84
|
<div
|
|
86
85
|
class="
|
|
@@ -143,6 +142,7 @@ onMounted(() => {
|
|
|
143
142
|
"border-slate-300",
|
|
144
143
|
"dark:border-zinc-800",
|
|
145
144
|
"drop-shadow",
|
|
145
|
+
"z-[9]",
|
|
146
146
|
"md:max-xl:pt-4",
|
|
147
147
|
"max-md:pt-2"
|
|
148
148
|
]
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<!--
|
|
3
|
-
[!NOTE]
|
|
4
|
-
|
|
5
|
-
unlike the usual way to pass model, `.model` is not enough here in below.
|
|
6
|
-
for some reason vue rewraps the model which is already a ref, causing a
|
|
7
|
-
double ref. that's why `.model.value` is passed instead of `.model`
|
|
8
|
-
-->
|
|
9
2
|
<div class="flex gap-2 max-md:flex-col max-md:min-w-24">
|
|
10
3
|
<Bake
|
|
11
4
|
v-for="parameter in parameters"
|
|
12
5
|
:key="parameter.name"
|
|
13
|
-
v-model="values[parameter.name]
|
|
6
|
+
v-model="values[parameter.name]"
|
|
14
7
|
:name="`parameters/${parameter.name}`"
|
|
15
8
|
:descriptor="parameter.component"
|
|
16
9
|
class="max-md:w-full"
|
|
@@ -19,7 +12,7 @@
|
|
|
19
12
|
</template>
|
|
20
13
|
|
|
21
14
|
<script setup>
|
|
22
|
-
import { onMounted, ref, watch } from "vue";
|
|
15
|
+
import { onMounted, ref, watch, reactive } from "vue";
|
|
23
16
|
import { Bake } from "#components";
|
|
24
17
|
import { useContext, useDataFetcher } from "#imports";
|
|
25
18
|
const dataFetcher = useDataFetcher();
|
|
@@ -29,10 +22,16 @@ const { parameters } = defineProps({
|
|
|
29
22
|
});
|
|
30
23
|
const emit = defineEmits(["ready", "changed"]);
|
|
31
24
|
const injectedData = context.injectData();
|
|
32
|
-
const values = {};
|
|
25
|
+
const values = reactive({});
|
|
33
26
|
for (const parameter of parameters) {
|
|
34
27
|
values[parameter.name] = ref(dataFetcher.get({ data: parameter.default, injectedData }));
|
|
35
28
|
}
|
|
29
|
+
function checkValue(value) {
|
|
30
|
+
if (typeof value === "string") {
|
|
31
|
+
return value !== "";
|
|
32
|
+
}
|
|
33
|
+
return value !== void 0 && value !== null;
|
|
34
|
+
}
|
|
36
35
|
onMounted(async () => {
|
|
37
36
|
for (const parameter of parameters) {
|
|
38
37
|
if (!dataFetcher.shouldLoad(parameter.default?.type)) {
|
|
@@ -40,20 +39,22 @@ onMounted(async () => {
|
|
|
40
39
|
}
|
|
41
40
|
values[parameter.name].value = await dataFetcher.fetch({ data: parameter.default, injectedData });
|
|
42
41
|
}
|
|
42
|
+
emitChanged();
|
|
43
|
+
emitReady();
|
|
43
44
|
});
|
|
44
|
-
watch(
|
|
45
|
+
watch(values, async () => {
|
|
45
46
|
emitChanged();
|
|
46
47
|
emitReady();
|
|
47
|
-
}, {
|
|
48
|
+
}, { deep: true });
|
|
48
49
|
function emitReady() {
|
|
49
50
|
emit(
|
|
50
51
|
"ready",
|
|
51
|
-
parameters.filter((p) => p.required).reduce((result, p) => result && values[p.name]
|
|
52
|
+
parameters.filter((p) => p.required).reduce((result, p) => result && checkValue(values[p.name]), true)
|
|
52
53
|
);
|
|
53
54
|
}
|
|
54
55
|
function emitChanged() {
|
|
55
56
|
emit("changed", {
|
|
56
|
-
uniqueKey:
|
|
57
|
+
uniqueKey: parameters.map((p) => values[p.name]).filter(checkValue).join("-"),
|
|
57
58
|
values
|
|
58
59
|
});
|
|
59
60
|
}
|
|
@@ -35,11 +35,17 @@ for (const parameter of parameters) {
|
|
|
35
35
|
const model = ref(query.value);
|
|
36
36
|
values[parameter.name] = { query, model };
|
|
37
37
|
}
|
|
38
|
+
function checkValue(value) {
|
|
39
|
+
if (typeof value === "string") {
|
|
40
|
+
return value !== "";
|
|
41
|
+
}
|
|
42
|
+
return value !== void 0 && value !== null;
|
|
43
|
+
}
|
|
38
44
|
onMounted(async () => await setDefaults());
|
|
39
45
|
watchEffect(() => {
|
|
40
46
|
const queryValues = Object.values(values).map((p) => p.query.value);
|
|
41
|
-
const isReady = parameters.filter((p) => p.required).every((p) => values[p.name].query.value
|
|
42
|
-
const uniqueKey = queryValues.filter(
|
|
47
|
+
const isReady = parameters.filter((p) => p.required).every((p) => checkValue(values[p.name].query.value));
|
|
48
|
+
const uniqueKey = queryValues.filter(checkValue).join("-");
|
|
43
49
|
emit("ready", isReady);
|
|
44
50
|
emit("changed", uniqueKey);
|
|
45
51
|
});
|
|
@@ -68,7 +74,7 @@ watch(
|
|
|
68
74
|
const shouldReplace = parameters.filter((p) => p.required && (p.default || p.defaultSelfManaged)).some((p) => !values[p.name].query.value);
|
|
69
75
|
const query = parameters.reduce((result, param, i) => {
|
|
70
76
|
const value = newValues[i];
|
|
71
|
-
if (value) {
|
|
77
|
+
if (checkValue(value)) {
|
|
72
78
|
result[param.name] = value;
|
|
73
79
|
}
|
|
74
80
|
return result;
|