@shwfed/nuxt 0.7.8 → 0.7.10
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/app.d.vue.ts +7 -58
- package/dist/runtime/components/app.vue +18 -411
- package/dist/runtime/components/app.vue.d.ts +7 -58
- package/dist/runtime/components/fields.d.vue.ts +177 -0
- package/dist/runtime/components/fields.vue +47 -0
- package/dist/runtime/components/fields.vue.d.ts +177 -0
- package/dist/runtime/components/table.d.vue.ts +63 -59
- package/dist/runtime/components/table.vue +52 -617
- package/dist/runtime/components/table.vue.d.ts +63 -59
- package/dist/runtime/components/ui/app/App.d.vue.ts +86 -0
- package/dist/runtime/components/ui/app/App.vue +414 -0
- package/dist/runtime/components/ui/app/App.vue.d.ts +86 -0
- package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.vue +1 -1
- package/dist/runtime/components/ui/button-group/ButtonGroupText.vue +1 -1
- package/dist/runtime/components/ui/calendar/Calendar.d.vue.ts +5 -12
- package/dist/runtime/components/ui/calendar/Calendar.vue +77 -92
- package/dist/runtime/components/ui/calendar/Calendar.vue.d.ts +5 -12
- package/dist/runtime/components/ui/calendar/CalendarCellTrigger.vue +1 -1
- package/dist/runtime/components/ui/calendar/index.d.ts +1 -1
- package/dist/runtime/components/ui/checkbox/Checkbox.vue +6 -2
- package/dist/runtime/components/ui/command/CommandGroup.vue +4 -0
- package/dist/runtime/components/ui/dialog/DialogOverlay.vue +1 -1
- package/dist/runtime/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
- package/dist/runtime/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +30 -0
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +87 -0
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +30 -0
- package/dist/runtime/components/ui/expression-editor/index.d.ts +1 -0
- package/dist/runtime/components/ui/expression-editor/index.js +1 -0
- package/dist/runtime/components/ui/field/FieldContent.vue +1 -1
- package/dist/runtime/components/ui/field/FieldDescription.vue +1 -1
- package/dist/runtime/components/ui/field/FieldError.vue +2 -2
- package/dist/runtime/components/ui/field/FieldLabel.vue +1 -1
- package/dist/runtime/components/ui/field/FieldSeparator.vue +1 -1
- package/dist/runtime/components/ui/field/index.js +7 -5
- package/dist/runtime/components/ui/fields/Fields.d.vue.ts +376 -0
- package/dist/runtime/components/ui/fields/Fields.vue +441 -0
- package/dist/runtime/components/ui/fields/Fields.vue.d.ts +376 -0
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +163 -0
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue +363 -0
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +163 -0
- package/dist/runtime/components/ui/input/Input.d.vue.ts +1 -0
- package/dist/runtime/components/ui/input/Input.vue +3 -1
- package/dist/runtime/components/ui/input/Input.vue.d.ts +1 -0
- package/dist/runtime/components/ui/input-group/InputGroup.vue +3 -0
- package/dist/runtime/components/ui/input-group/InputGroupAddon.vue +4 -1
- package/dist/runtime/components/ui/input-group/InputGroupCombobox.d.vue.ts +11 -3
- package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue +16 -5
- package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue.d.ts +11 -3
- package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.d.vue.ts +8 -1
- package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.vue +12 -1
- package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.vue.d.ts +8 -1
- package/dist/runtime/components/ui/input-group/InputGroupInput.vue +1 -1
- package/dist/runtime/components/ui/input-group/InputGroupNumberField.d.vue.ts +5 -2
- package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue +10 -4
- package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue.d.ts +5 -2
- package/dist/runtime/components/ui/input-group/InputGroupText.vue +1 -1
- package/dist/runtime/components/ui/input-group/InputGroupTextarea.vue +1 -1
- package/dist/runtime/components/ui/input-group/index.js +2 -2
- package/dist/runtime/components/ui/label/Label.vue +1 -1
- package/dist/runtime/components/ui/locale/Locale.d.vue.ts +20 -0
- package/dist/runtime/components/ui/locale/Locale.vue +291 -0
- package/dist/runtime/components/ui/locale/Locale.vue.d.ts +20 -0
- package/dist/runtime/components/ui/locale/index.d.ts +1 -0
- package/dist/runtime/components/ui/locale/index.js +1 -0
- package/dist/runtime/components/ui/native-select/NativeSelect.vue +3 -3
- package/dist/runtime/components/ui/native-select/NativeSelectOption.d.vue.ts +1 -0
- package/dist/runtime/components/ui/native-select/NativeSelectOption.vue +4 -1
- package/dist/runtime/components/ui/native-select/NativeSelectOption.vue.d.ts +1 -0
- package/dist/runtime/components/ui/navigation-menu/NavigationMenuLink.vue +1 -1
- package/dist/runtime/components/ui/navigation-menu/NavigationMenuViewport.vue +1 -1
- package/dist/runtime/components/ui/number-field/NumberFieldInput.vue +1 -1
- package/dist/runtime/components/ui/range-calendar/RangeCalendarCell.vue +1 -1
- package/dist/runtime/components/ui/range-calendar/RangeCalendarCellTrigger.vue +1 -1
- package/dist/runtime/components/ui/sheet/SheetOverlay.vue +1 -1
- package/dist/runtime/components/ui/switch/Switch.d.vue.ts +24 -0
- package/dist/runtime/components/ui/switch/Switch.vue +46 -0
- package/dist/runtime/components/ui/switch/Switch.vue.d.ts +24 -0
- package/dist/runtime/components/ui/switch/index.d.ts +1 -0
- package/dist/runtime/components/ui/switch/index.js +1 -0
- package/dist/runtime/components/ui/table/Table.d.vue.ts +81 -0
- package/dist/runtime/components/ui/table/Table.vue +792 -0
- package/dist/runtime/components/ui/table/Table.vue.d.ts +81 -0
- package/dist/runtime/components/ui/table/schema.d.ts +48 -0
- package/dist/runtime/components/ui/table/schema.js +126 -0
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.d.vue.ts +62 -0
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue +2233 -0
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue.d.ts +62 -0
- package/dist/runtime/components/ui/table-configurator/menu.d.ts +37 -0
- package/dist/runtime/components/ui/table-configurator/menu.js +227 -0
- package/dist/runtime/components/ui/tabs/Tabs.d.vue.ts +24 -0
- package/dist/runtime/components/ui/tabs/Tabs.vue +30 -0
- package/dist/runtime/components/ui/tabs/Tabs.vue.d.ts +24 -0
- package/dist/runtime/components/ui/tabs/TabsContent.d.vue.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsContent.vue +23 -0
- package/dist/runtime/components/ui/tabs/TabsContent.vue.d.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsList.d.vue.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsList.vue +25 -0
- package/dist/runtime/components/ui/tabs/TabsList.vue.d.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsTrigger.d.vue.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsTrigger.vue +27 -0
- package/dist/runtime/components/ui/tabs/TabsTrigger.vue.d.ts +18 -0
- package/dist/runtime/components/ui/tabs/index.d.ts +4 -0
- package/dist/runtime/components/ui/tabs/index.js +4 -0
- package/dist/runtime/components/ui/textarea/Textarea.d.vue.ts +1 -0
- package/dist/runtime/components/ui/textarea/Textarea.vue +4 -2
- package/dist/runtime/components/ui/textarea/Textarea.vue.d.ts +1 -0
- package/dist/runtime/components/ui/toggle/Toggle.d.vue.ts +34 -0
- package/dist/runtime/components/ui/toggle/Toggle.vue +32 -0
- package/dist/runtime/components/ui/toggle/Toggle.vue.d.ts +34 -0
- package/dist/runtime/components/ui/toggle/index.d.ts +7 -0
- package/dist/runtime/components/ui/toggle/index.js +22 -0
- package/dist/runtime/composables/useTableRenderers.d.ts +2 -1
- package/dist/runtime/composables/useTableRenderers.js +2 -1
- package/dist/runtime/plugins/cel/env.d.ts +2 -2
- package/dist/runtime/plugins/cel/env.js +5 -4
- package/dist/runtime/plugins/cel/index.d.ts +3 -3
- package/dist/runtime/plugins/cel/index.js +7 -3
- package/dist/runtime/plugins/markdown/index.d.ts +1 -1
- package/dist/runtime/style.css +1 -1
- package/dist/runtime/table-renderers/builtins.js +213 -98
- package/dist/runtime/table-renderers/registry.d.ts +1 -0
- package/dist/runtime/table-renderers/registry.js +3 -0
- package/dist/runtime/utils/coders.d.ts +32 -0
- package/dist/runtime/utils/coders.js +64 -0
- package/dist/runtime/vendor/cel/index.d.ts +17 -0
- package/dist/runtime/vendor/cel/index.js +10 -0
- package/dist/runtime/vendor/cel-js/LICENSE +21 -0
- package/dist/runtime/vendor/cel-js/UPSTREAM.md +17 -0
- package/dist/runtime/vendor/cel-js/lib/errors.d.ts +21 -0
- package/dist/runtime/vendor/cel-js/lib/errors.js +97 -0
- package/dist/runtime/vendor/cel-js/lib/evaluator.d.ts +4 -0
- package/dist/runtime/vendor/cel-js/lib/evaluator.js +192 -0
- package/dist/runtime/vendor/cel-js/lib/functions.d.ts +53 -0
- package/dist/runtime/vendor/cel-js/lib/functions.js +513 -0
- package/dist/runtime/vendor/cel-js/lib/globals.d.ts +27 -0
- package/dist/runtime/vendor/cel-js/lib/globals.js +33 -0
- package/dist/runtime/vendor/cel-js/lib/index.d.ts +469 -0
- package/dist/runtime/vendor/cel-js/lib/index.js +18 -0
- package/dist/runtime/vendor/cel-js/lib/macros.d.ts +1 -0
- package/dist/runtime/vendor/cel-js/lib/macros.js +230 -0
- package/dist/runtime/vendor/cel-js/lib/operators.d.ts +117 -0
- package/dist/runtime/vendor/cel-js/lib/operators.js +739 -0
- package/dist/runtime/vendor/cel-js/lib/optional.d.ts +14 -0
- package/dist/runtime/vendor/cel-js/lib/optional.js +161 -0
- package/dist/runtime/vendor/cel-js/lib/options.d.ts +23 -0
- package/dist/runtime/vendor/cel-js/lib/options.js +47 -0
- package/dist/runtime/vendor/cel-js/lib/overloads.d.ts +1 -0
- package/dist/runtime/vendor/cel-js/lib/overloads.js +214 -0
- package/dist/runtime/vendor/cel-js/lib/parser.d.ts +56 -0
- package/dist/runtime/vendor/cel-js/lib/parser.js +827 -0
- package/dist/runtime/vendor/cel-js/lib/registry.d.ts +279 -0
- package/dist/runtime/vendor/cel-js/lib/registry.js +1596 -0
- package/dist/runtime/vendor/cel-js/lib/serialize.d.ts +1 -0
- package/dist/runtime/vendor/cel-js/lib/serialize.js +259 -0
- package/dist/runtime/vendor/cel-js/lib/type-checker.d.ts +26 -0
- package/dist/runtime/vendor/cel-js/lib/type-checker.js +81 -0
- package/package.json +9 -4
- package/dist/runtime/components/locale.d.vue.ts +0 -14
- package/dist/runtime/components/locale.vue +0 -89
- package/dist/runtime/components/locale.vue.d.ts +0 -14
- package/dist/runtime/components/query.d.vue.ts +0 -30
- package/dist/runtime/components/query.vue +0 -266
- package/dist/runtime/components/query.vue.d.ts +0 -30
- package/dist/runtime/utilities/query-config/global.d.ts +0 -4
- package/dist/runtime/utilities/query-config/global.js +0 -18
- package/dist/runtime/utilities/query-config/index.d.ts +0 -3
- package/dist/runtime/utilities/query-config/index.js +0 -14
- package/dist/runtime/utilities/query-config/schema.d.ts +0 -96
- package/dist/runtime/utilities/query-config/schema.js +0 -51
- /package/dist/runtime/components/{logo.d.vue.ts → ui/logo/Logo.d.vue.ts} +0 -0
- /package/dist/runtime/components/{logo.vue → ui/logo/Logo.vue} +0 -0
- /package/dist/runtime/components/{logo.vue.d.ts → ui/logo/Logo.vue.d.ts} +0 -0
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Icon } from "@iconify/vue";
|
|
3
|
-
import { Field, FieldLabel } from "./ui/field";
|
|
4
|
-
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupCombobox, InputGroupNumberField } from "./ui/input-group";
|
|
5
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
|
|
6
|
-
import { useI18n } from "vue-i18n";
|
|
7
|
-
import { deleteProperty, getProperty, hasProperty, setProperty } from "dot-prop";
|
|
8
|
-
import { CommandGroup, CommandItem } from "./ui/command";
|
|
9
|
-
import { useCheating, useId } from "#imports";
|
|
10
|
-
import { defu } from "defu";
|
|
11
|
-
import { Dialog, DialogScrollContent, DialogHeader, DialogTitle, DialogDescription } from "./ui/dialog";
|
|
12
|
-
import { Skeleton } from "./ui/skeleton";
|
|
13
|
-
import { ref, useTemplateRef, watch } from "vue";
|
|
14
|
-
import { Effect, Either, Schema } from "effect";
|
|
15
|
-
import { computedAsync, createReusableTemplate } from "@vueuse/core";
|
|
16
|
-
import { getRead } from "../utilities/query-config/global";
|
|
17
|
-
import { useSortable } from "@vueuse/integrations/useSortable";
|
|
18
|
-
import { FieldSchema } from "../utilities/query-config/schema";
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<script setup>
|
|
22
|
-
const id = useId();
|
|
23
|
-
const props = defineProps({
|
|
24
|
-
identifier: { type: String, required: true }
|
|
25
|
-
});
|
|
26
|
-
const read = getRead();
|
|
27
|
-
const fields = computedAsync(
|
|
28
|
-
() => Effect.gen(function* () {
|
|
29
|
-
const result = yield* read(props.identifier).pipe(Effect.either);
|
|
30
|
-
return yield* Either.match(result, {
|
|
31
|
-
onLeft: () => Effect.succeed([]),
|
|
32
|
-
onRight: (data) => Schema.decodeUnknown(Schema.Array(FieldSchema))(data).pipe(
|
|
33
|
-
Effect.either,
|
|
34
|
-
Effect.map(
|
|
35
|
-
(decodeResult) => Either.match(decodeResult, {
|
|
36
|
-
onLeft: () => [],
|
|
37
|
-
onRight: (fields2) => fields2
|
|
38
|
-
})
|
|
39
|
-
)
|
|
40
|
-
)
|
|
41
|
-
});
|
|
42
|
-
}).pipe(Effect.runPromise)
|
|
43
|
-
);
|
|
44
|
-
const { t, mergeLocaleMessage } = useI18n();
|
|
45
|
-
watch(fields, (fields2) => {
|
|
46
|
-
if (fields2 === void 0) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const messages = fields2.reduce((acc, field, i) => {
|
|
50
|
-
const fieldMessages = Object.fromEntries(
|
|
51
|
-
Object.entries(field.label).map(([locale, message]) => [
|
|
52
|
-
locale,
|
|
53
|
-
{ [`${id}-${i}`]: message }
|
|
54
|
-
])
|
|
55
|
-
);
|
|
56
|
-
return defu(acc, fieldMessages);
|
|
57
|
-
}, {});
|
|
58
|
-
for (const [locale, messageMap] of Object.entries(messages)) {
|
|
59
|
-
mergeLocaleMessage(locale, messageMap);
|
|
60
|
-
}
|
|
61
|
-
}, { immediate: true });
|
|
62
|
-
const modelValue = defineModel("modelValue", { type: Object, ...{
|
|
63
|
-
default: () => ({})
|
|
64
|
-
} });
|
|
65
|
-
const isCheating = useCheating();
|
|
66
|
-
const isDialogOpen = ref(false);
|
|
67
|
-
const [DefineTextConfiguration, TextConfiguration] = createReusableTemplate();
|
|
68
|
-
const [DefineNumberConfiguration, NumberConfiguration] = createReusableTemplate();
|
|
69
|
-
const sortableFields = useTemplateRef("sortableFields");
|
|
70
|
-
useSortable(sortableFields, [], {});
|
|
71
|
-
</script>
|
|
72
|
-
|
|
73
|
-
<template>
|
|
74
|
-
<div
|
|
75
|
-
:class="[
|
|
76
|
-
'relative p-1 border border-dashed',
|
|
77
|
-
isCheating ? 'border-(--primary)/20 rounded hover:border-(--primary)/40 transition-colors duration-150 group cursor-pointer' : 'border-transparent'
|
|
78
|
-
]"
|
|
79
|
-
>
|
|
80
|
-
<button
|
|
81
|
-
v-if="isCheating"
|
|
82
|
-
type="button"
|
|
83
|
-
class="absolute inset-0 z-10 w-full h-full bg-transparent cursor-pointer"
|
|
84
|
-
@click="isDialogOpen = true"
|
|
85
|
-
>
|
|
86
|
-
<span class="sr-only">Edit query fields</span>
|
|
87
|
-
</button>
|
|
88
|
-
|
|
89
|
-
<Dialog v-model:open="isDialogOpen">
|
|
90
|
-
<DialogScrollContent class="w-80%">
|
|
91
|
-
<DialogHeader>
|
|
92
|
-
<DialogTitle>配置搜索项</DialogTitle>
|
|
93
|
-
</DialogHeader>
|
|
94
|
-
<DialogDescription class="sr-only">
|
|
95
|
-
<DialogTitle>Configure query fields dynamically</DialogTitle>
|
|
96
|
-
</DialogDescription>
|
|
97
|
-
<ul
|
|
98
|
-
ref="sortableFields"
|
|
99
|
-
class="flex flex-col gap-2"
|
|
100
|
-
>
|
|
101
|
-
<template
|
|
102
|
-
v-for="field of fields"
|
|
103
|
-
:key="field.path"
|
|
104
|
-
>
|
|
105
|
-
<TextConfiguration
|
|
106
|
-
v-if="field.type === 'string'"
|
|
107
|
-
v-bind="field"
|
|
108
|
-
/>
|
|
109
|
-
<NumberConfiguration
|
|
110
|
-
v-if="field.type === 'number'"
|
|
111
|
-
v-bind="field"
|
|
112
|
-
/>
|
|
113
|
-
</template>
|
|
114
|
-
</ul>
|
|
115
|
-
</DialogScrollContent>
|
|
116
|
-
</Dialog>
|
|
117
|
-
|
|
118
|
-
<Skeleton
|
|
119
|
-
v-if="fields === void 0"
|
|
120
|
-
class="absolute inset-0 z-10 w-full h-full"
|
|
121
|
-
/>
|
|
122
|
-
|
|
123
|
-
<DefineTextConfiguration #="{ path }">
|
|
124
|
-
<InputGroup>
|
|
125
|
-
<InputGroupAddon>
|
|
126
|
-
<Icon
|
|
127
|
-
icon="fluent:re-order-dots-20-regular"
|
|
128
|
-
/>
|
|
129
|
-
</InputGroupAddon>
|
|
130
|
-
<InputGroupInput
|
|
131
|
-
:model-value="path"
|
|
132
|
-
class="font-mono"
|
|
133
|
-
/>
|
|
134
|
-
</InputGroup>
|
|
135
|
-
</DefineTextConfiguration>
|
|
136
|
-
|
|
137
|
-
<DefineNumberConfiguration #="{ path }">
|
|
138
|
-
<InputGroup>
|
|
139
|
-
<InputGroupAddon>
|
|
140
|
-
<Icon
|
|
141
|
-
icon="fluent:re-order-dots-20-regular"
|
|
142
|
-
/>
|
|
143
|
-
</InputGroupAddon>
|
|
144
|
-
<InputGroupInput
|
|
145
|
-
:model-value="path"
|
|
146
|
-
class="font-mono"
|
|
147
|
-
/>
|
|
148
|
-
</InputGroup>
|
|
149
|
-
</DefineNumberConfiguration>
|
|
150
|
-
|
|
151
|
-
<Field
|
|
152
|
-
v-for="(field, i) in fields"
|
|
153
|
-
:key="field.path"
|
|
154
|
-
:style="field.style"
|
|
155
|
-
>
|
|
156
|
-
<InputGroup>
|
|
157
|
-
<InputGroupInput
|
|
158
|
-
v-if="field.type === 'string'"
|
|
159
|
-
:treat-empty-as-different-state-from-null="field.treatEmptyAsDifferentStateFromNull"
|
|
160
|
-
:model-value="getProperty(modelValue, field.path)"
|
|
161
|
-
@update:model-value="(value) => {
|
|
162
|
-
if (!value && !field.treatEmptyAsDifferentStateFromNull) {
|
|
163
|
-
deleteProperty(modelValue, field.path);
|
|
164
|
-
} else {
|
|
165
|
-
setProperty(modelValue, field.path, value);
|
|
166
|
-
}
|
|
167
|
-
}"
|
|
168
|
-
/>
|
|
169
|
-
<InputGroupCombobox
|
|
170
|
-
v-if="field.type === 'select'"
|
|
171
|
-
>
|
|
172
|
-
<CommandGroup
|
|
173
|
-
v-for="group in field.options"
|
|
174
|
-
:key="group.value"
|
|
175
|
-
>
|
|
176
|
-
<CommandItem
|
|
177
|
-
v-for="option in group.options"
|
|
178
|
-
:key="option.value"
|
|
179
|
-
:value="option.value"
|
|
180
|
-
>
|
|
181
|
-
<slot
|
|
182
|
-
name="option"
|
|
183
|
-
:option="option"
|
|
184
|
-
>
|
|
185
|
-
<Icon
|
|
186
|
-
v-if="option.icon"
|
|
187
|
-
:icon="option.icon"
|
|
188
|
-
/>
|
|
189
|
-
<span>{{ option.label }}</span>
|
|
190
|
-
</slot>
|
|
191
|
-
</CommandItem>
|
|
192
|
-
</CommandGroup>
|
|
193
|
-
</InputGroupCombobox>
|
|
194
|
-
<InputGroupNumberField
|
|
195
|
-
v-if="field.type === 'number'"
|
|
196
|
-
:model-value="getProperty(modelValue, field.path) ?? null"
|
|
197
|
-
:min="field.min"
|
|
198
|
-
:max="field.max"
|
|
199
|
-
:step="field.step"
|
|
200
|
-
@update:model-value="(value) => {
|
|
201
|
-
if (!value && value !== 0) {
|
|
202
|
-
deleteProperty(modelValue, field.path);
|
|
203
|
-
} else {
|
|
204
|
-
setProperty(modelValue, field.path, value);
|
|
205
|
-
}
|
|
206
|
-
}"
|
|
207
|
-
/>
|
|
208
|
-
<InputGroupAddon v-if="field.icon">
|
|
209
|
-
<Icon
|
|
210
|
-
:icon="field.icon"
|
|
211
|
-
/>
|
|
212
|
-
</InputGroupAddon>
|
|
213
|
-
<InputGroupAddon
|
|
214
|
-
v-if="hasProperty(modelValue, field.path)"
|
|
215
|
-
align="inline-end"
|
|
216
|
-
>
|
|
217
|
-
<Tooltip :delay-duration="800">
|
|
218
|
-
<TooltipTrigger>
|
|
219
|
-
<InputGroupButton as-child>
|
|
220
|
-
<button
|
|
221
|
-
type="button"
|
|
222
|
-
@click="deleteProperty(modelValue, field.path)"
|
|
223
|
-
>
|
|
224
|
-
<Icon
|
|
225
|
-
icon="fluent:dismiss-20-regular"
|
|
226
|
-
/>
|
|
227
|
-
</button>
|
|
228
|
-
</InputGroupButton>
|
|
229
|
-
</TooltipTrigger>
|
|
230
|
-
<TooltipContent>
|
|
231
|
-
{{ t("clear") }}
|
|
232
|
-
</TooltipContent>
|
|
233
|
-
</Tooltip>
|
|
234
|
-
</InputGroupAddon>
|
|
235
|
-
</InputGroup>
|
|
236
|
-
<FieldLabel
|
|
237
|
-
v-if="isCheating"
|
|
238
|
-
class="flex items-center gap-1"
|
|
239
|
-
>
|
|
240
|
-
<span class="font-mono">
|
|
241
|
-
{{ field.path }}
|
|
242
|
-
</span>
|
|
243
|
-
<span class="text-zinc-500">
|
|
244
|
-
({{ t(`${id}-${i}`) }})
|
|
245
|
-
</span>
|
|
246
|
-
</FieldLabel>
|
|
247
|
-
<FieldLabel v-else>
|
|
248
|
-
{{ t(`${id}-${i}`) }}
|
|
249
|
-
</FieldLabel>
|
|
250
|
-
</Field>
|
|
251
|
-
</div>
|
|
252
|
-
</template>
|
|
253
|
-
|
|
254
|
-
<i18n lang="json">
|
|
255
|
-
{
|
|
256
|
-
"zh": {
|
|
257
|
-
"clear": "清空"
|
|
258
|
-
},
|
|
259
|
-
"ja": {
|
|
260
|
-
"clear": "クリア"
|
|
261
|
-
},
|
|
262
|
-
"en": {
|
|
263
|
-
"clear": "Clear"
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
</i18n>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
declare const _default: typeof __VLS_export;
|
|
2
|
-
export default _default;
|
|
3
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
4
|
-
identifier: string;
|
|
5
|
-
} & {
|
|
6
|
-
modelValue?: Record<string, unknown>;
|
|
7
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
-
"update:modelValue": (value: Record<string, unknown>) => any;
|
|
9
|
-
}, string, import("vue").PublicProps, Readonly<{
|
|
10
|
-
identifier: string;
|
|
11
|
-
} & {
|
|
12
|
-
modelValue?: Record<string, unknown>;
|
|
13
|
-
}> & Readonly<{
|
|
14
|
-
"onUpdate:modelValue"?: ((value: Record<string, unknown>) => any) | undefined;
|
|
15
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
16
|
-
option?: (props: {
|
|
17
|
-
option: {
|
|
18
|
-
readonly label: {
|
|
19
|
-
readonly [x: string]: string;
|
|
20
|
-
};
|
|
21
|
-
readonly value: string | number;
|
|
22
|
-
readonly icon?: string | undefined;
|
|
23
|
-
};
|
|
24
|
-
}) => any;
|
|
25
|
-
}>;
|
|
26
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
-
new (): {
|
|
28
|
-
$slots: S;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Effect } from 'effect';
|
|
2
|
-
export declare function setQueryConfigAccessors(read: <T>(identity: string) => Effect.Effect<T>, write: <T>(identity: string, value: T) => Effect.Effect<void>): void;
|
|
3
|
-
export declare function getRead(): <T>(identity: string) => Effect.Effect<T>;
|
|
4
|
-
export declare function getWrite(): <T>(identity: string, value: T) => Effect.Effect<void>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
let readFn;
|
|
2
|
-
let writeFn;
|
|
3
|
-
export function setQueryConfigAccessors(read, write) {
|
|
4
|
-
readFn = read;
|
|
5
|
-
writeFn = write;
|
|
6
|
-
}
|
|
7
|
-
export function getRead() {
|
|
8
|
-
if (readFn === void 0) {
|
|
9
|
-
throw new Error("Query config accessors not set. Ensure app.vue receives read and write props.");
|
|
10
|
-
}
|
|
11
|
-
return readFn;
|
|
12
|
-
}
|
|
13
|
-
export function getWrite() {
|
|
14
|
-
if (writeFn === void 0) {
|
|
15
|
-
throw new Error("Query config accessors not set. Ensure app.vue receives read and write props.");
|
|
16
|
-
}
|
|
17
|
-
return writeFn;
|
|
18
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { I18nLabelSchema, OptionSchema, OptionsGroupSchema, TextFieldSchema, SelectFieldSchema, NumberFieldSchema, FieldSchema, } from './schema.js';
|
|
2
|
-
export type { I18nLabel, Option, OptionsGroup, TextField, SelectField, NumberField, Field, } from './schema.js';
|
|
3
|
-
export { setQueryConfigAccessors, getRead, getWrite, } from './global.js';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
I18nLabelSchema,
|
|
3
|
-
OptionSchema,
|
|
4
|
-
OptionsGroupSchema,
|
|
5
|
-
TextFieldSchema,
|
|
6
|
-
SelectFieldSchema,
|
|
7
|
-
NumberFieldSchema,
|
|
8
|
-
FieldSchema
|
|
9
|
-
} from "./schema.js";
|
|
10
|
-
export {
|
|
11
|
-
setQueryConfigAccessors,
|
|
12
|
-
getRead,
|
|
13
|
-
getWrite
|
|
14
|
-
} from "./global.js";
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Schema } from 'effect';
|
|
2
|
-
declare const I18nLabelSchema: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
3
|
-
declare const OptionSchema: Schema.Struct<{
|
|
4
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
5
|
-
value: Schema.Union<[typeof Schema.String, typeof Schema.Number]>;
|
|
6
|
-
icon: Schema.optional<typeof Schema.String>;
|
|
7
|
-
}>;
|
|
8
|
-
declare const OptionsGroupSchema: Schema.Struct<{
|
|
9
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
10
|
-
value: Schema.Union<[typeof Schema.String, typeof Schema.Number]>;
|
|
11
|
-
options: Schema.Array$<Schema.Struct<{
|
|
12
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
13
|
-
value: Schema.Union<[typeof Schema.String, typeof Schema.Number]>;
|
|
14
|
-
icon: Schema.optional<typeof Schema.String>;
|
|
15
|
-
}>>;
|
|
16
|
-
}>;
|
|
17
|
-
declare const TextFieldSchema: Schema.Struct<{
|
|
18
|
-
type: Schema.Literal<["string"]>;
|
|
19
|
-
path: typeof Schema.String;
|
|
20
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
21
|
-
initial: Schema.optional<typeof Schema.String>;
|
|
22
|
-
icon: Schema.optional<typeof Schema.String>;
|
|
23
|
-
style: Schema.optional<typeof Schema.Object>;
|
|
24
|
-
treatEmptyAsDifferentStateFromNull: Schema.optional<typeof Schema.Boolean>;
|
|
25
|
-
}>;
|
|
26
|
-
declare const SelectFieldSchema: Schema.Struct<{
|
|
27
|
-
type: Schema.Literal<["select"]>;
|
|
28
|
-
path: typeof Schema.String;
|
|
29
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
30
|
-
initial: Schema.optional<typeof Schema.String>;
|
|
31
|
-
icon: Schema.optional<typeof Schema.String>;
|
|
32
|
-
options: Schema.Array$<Schema.Struct<{
|
|
33
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
34
|
-
value: Schema.Union<[typeof Schema.String, typeof Schema.Number]>;
|
|
35
|
-
options: Schema.Array$<Schema.Struct<{
|
|
36
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
37
|
-
value: Schema.Union<[typeof Schema.String, typeof Schema.Number]>;
|
|
38
|
-
icon: Schema.optional<typeof Schema.String>;
|
|
39
|
-
}>>;
|
|
40
|
-
}>>;
|
|
41
|
-
style: Schema.optional<typeof Schema.Object>;
|
|
42
|
-
}>;
|
|
43
|
-
declare const NumberFieldSchema: Schema.Struct<{
|
|
44
|
-
type: Schema.Literal<["number"]>;
|
|
45
|
-
path: typeof Schema.String;
|
|
46
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
47
|
-
initial: Schema.optional<typeof Schema.String>;
|
|
48
|
-
icon: Schema.optional<typeof Schema.String>;
|
|
49
|
-
style: Schema.optional<typeof Schema.Object>;
|
|
50
|
-
min: Schema.optional<typeof Schema.Number>;
|
|
51
|
-
max: Schema.optional<typeof Schema.Number>;
|
|
52
|
-
step: Schema.optional<typeof Schema.Number>;
|
|
53
|
-
}>;
|
|
54
|
-
declare const FieldSchema: Schema.Union<[Schema.Struct<{
|
|
55
|
-
type: Schema.Literal<["string"]>;
|
|
56
|
-
path: typeof Schema.String;
|
|
57
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
58
|
-
initial: Schema.optional<typeof Schema.String>;
|
|
59
|
-
icon: Schema.optional<typeof Schema.String>;
|
|
60
|
-
style: Schema.optional<typeof Schema.Object>;
|
|
61
|
-
treatEmptyAsDifferentStateFromNull: Schema.optional<typeof Schema.Boolean>;
|
|
62
|
-
}>, Schema.Struct<{
|
|
63
|
-
type: Schema.Literal<["select"]>;
|
|
64
|
-
path: typeof Schema.String;
|
|
65
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
66
|
-
initial: Schema.optional<typeof Schema.String>;
|
|
67
|
-
icon: Schema.optional<typeof Schema.String>;
|
|
68
|
-
options: Schema.Array$<Schema.Struct<{
|
|
69
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
70
|
-
value: Schema.Union<[typeof Schema.String, typeof Schema.Number]>;
|
|
71
|
-
options: Schema.Array$<Schema.Struct<{
|
|
72
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
73
|
-
value: Schema.Union<[typeof Schema.String, typeof Schema.Number]>;
|
|
74
|
-
icon: Schema.optional<typeof Schema.String>;
|
|
75
|
-
}>>;
|
|
76
|
-
}>>;
|
|
77
|
-
style: Schema.optional<typeof Schema.Object>;
|
|
78
|
-
}>, Schema.Struct<{
|
|
79
|
-
type: Schema.Literal<["number"]>;
|
|
80
|
-
path: typeof Schema.String;
|
|
81
|
-
label: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
82
|
-
initial: Schema.optional<typeof Schema.String>;
|
|
83
|
-
icon: Schema.optional<typeof Schema.String>;
|
|
84
|
-
style: Schema.optional<typeof Schema.Object>;
|
|
85
|
-
min: Schema.optional<typeof Schema.Number>;
|
|
86
|
-
max: Schema.optional<typeof Schema.Number>;
|
|
87
|
-
step: Schema.optional<typeof Schema.Number>;
|
|
88
|
-
}>]>;
|
|
89
|
-
export { I18nLabelSchema, OptionSchema, OptionsGroupSchema, TextFieldSchema, SelectFieldSchema, NumberFieldSchema, FieldSchema, };
|
|
90
|
-
export type I18nLabel = Schema.Schema.Type<typeof I18nLabelSchema>;
|
|
91
|
-
export type Option = Schema.Schema.Type<typeof OptionSchema>;
|
|
92
|
-
export type OptionsGroup = Schema.Schema.Type<typeof OptionsGroupSchema>;
|
|
93
|
-
export type TextField = Schema.Schema.Type<typeof TextFieldSchema>;
|
|
94
|
-
export type SelectField = Schema.Schema.Type<typeof SelectFieldSchema>;
|
|
95
|
-
export type NumberField = Schema.Schema.Type<typeof NumberFieldSchema>;
|
|
96
|
-
export type Field = Schema.Schema.Type<typeof FieldSchema>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
const I18nLabelSchema = Schema.Record({ key: Schema.String, value: Schema.String });
|
|
3
|
-
const OptionSchema = Schema.Struct({
|
|
4
|
-
label: I18nLabelSchema,
|
|
5
|
-
value: Schema.Union(Schema.String, Schema.Number),
|
|
6
|
-
icon: Schema.optional(Schema.String)
|
|
7
|
-
});
|
|
8
|
-
const OptionsGroupSchema = Schema.Struct({
|
|
9
|
-
label: I18nLabelSchema,
|
|
10
|
-
value: Schema.Union(Schema.String, Schema.Number),
|
|
11
|
-
options: Schema.Array(OptionSchema)
|
|
12
|
-
});
|
|
13
|
-
const TextFieldSchema = Schema.Struct({
|
|
14
|
-
type: Schema.Literal("string"),
|
|
15
|
-
path: Schema.String,
|
|
16
|
-
label: I18nLabelSchema,
|
|
17
|
-
initial: Schema.optional(Schema.String),
|
|
18
|
-
icon: Schema.optional(Schema.String),
|
|
19
|
-
style: Schema.optional(Schema.Object),
|
|
20
|
-
treatEmptyAsDifferentStateFromNull: Schema.optional(Schema.Boolean)
|
|
21
|
-
});
|
|
22
|
-
const SelectFieldSchema = Schema.Struct({
|
|
23
|
-
type: Schema.Literal("select"),
|
|
24
|
-
path: Schema.String,
|
|
25
|
-
label: I18nLabelSchema,
|
|
26
|
-
initial: Schema.optional(Schema.String),
|
|
27
|
-
icon: Schema.optional(Schema.String),
|
|
28
|
-
options: Schema.Array(OptionsGroupSchema),
|
|
29
|
-
style: Schema.optional(Schema.Object)
|
|
30
|
-
});
|
|
31
|
-
const NumberFieldSchema = Schema.Struct({
|
|
32
|
-
type: Schema.Literal("number"),
|
|
33
|
-
path: Schema.String,
|
|
34
|
-
label: I18nLabelSchema,
|
|
35
|
-
initial: Schema.optional(Schema.String),
|
|
36
|
-
icon: Schema.optional(Schema.String),
|
|
37
|
-
style: Schema.optional(Schema.Object),
|
|
38
|
-
min: Schema.optional(Schema.Number),
|
|
39
|
-
max: Schema.optional(Schema.Number),
|
|
40
|
-
step: Schema.optional(Schema.Number)
|
|
41
|
-
});
|
|
42
|
-
const FieldSchema = Schema.Union(TextFieldSchema, SelectFieldSchema, NumberFieldSchema);
|
|
43
|
-
export {
|
|
44
|
-
I18nLabelSchema,
|
|
45
|
-
OptionSchema,
|
|
46
|
-
OptionsGroupSchema,
|
|
47
|
-
TextFieldSchema,
|
|
48
|
-
SelectFieldSchema,
|
|
49
|
-
NumberFieldSchema,
|
|
50
|
-
FieldSchema
|
|
51
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|