@shwfed/nuxt 0.7.7 → 0.7.9

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.
Files changed (100) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +22 -32
  3. package/dist/runtime/components/app.d.vue.ts +0 -2
  4. package/dist/runtime/components/app.vue +1 -7
  5. package/dist/runtime/components/app.vue.d.ts +0 -2
  6. package/dist/runtime/components/fields.d.vue.ts +155 -0
  7. package/dist/runtime/components/fields.vue +312 -0
  8. package/dist/runtime/components/fields.vue.d.ts +155 -0
  9. package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.vue +1 -1
  10. package/dist/runtime/components/ui/button-group/ButtonGroupText.vue +1 -1
  11. package/dist/runtime/components/ui/calendar/Calendar.d.vue.ts +5 -12
  12. package/dist/runtime/components/ui/calendar/Calendar.vue +77 -92
  13. package/dist/runtime/components/ui/calendar/Calendar.vue.d.ts +5 -12
  14. package/dist/runtime/components/ui/calendar/CalendarCellTrigger.vue +1 -1
  15. package/dist/runtime/components/ui/calendar/index.d.ts +1 -1
  16. package/dist/runtime/components/ui/command/CommandGroup.vue +4 -0
  17. package/dist/runtime/components/ui/dialog/DialogOverlay.vue +1 -1
  18. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
  19. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
  20. package/dist/runtime/components/ui/field/FieldDescription.vue +1 -1
  21. package/dist/runtime/components/ui/field/FieldError.vue +1 -1
  22. package/dist/runtime/components/ui/field/FieldLabel.vue +1 -1
  23. package/dist/runtime/components/ui/field/FieldSeparator.vue +1 -1
  24. package/dist/runtime/components/ui/field/index.js +7 -5
  25. package/dist/runtime/components/ui/input/Input.vue +1 -1
  26. package/dist/runtime/components/ui/input-group/InputGroup.vue +3 -0
  27. package/dist/runtime/components/ui/input-group/InputGroupCombobox.d.vue.ts +4 -1
  28. package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue +10 -4
  29. package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue.d.ts +4 -1
  30. package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.vue +3 -1
  31. package/dist/runtime/components/ui/input-group/InputGroupInput.vue +1 -1
  32. package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue +1 -1
  33. package/dist/runtime/components/ui/input-group/InputGroupText.vue +1 -1
  34. package/dist/runtime/components/ui/input-group/InputGroupTextarea.vue +1 -1
  35. package/dist/runtime/components/ui/input-group/index.js +1 -1
  36. package/dist/runtime/components/ui/label/Label.vue +1 -1
  37. package/dist/runtime/components/ui/native-select/NativeSelect.vue +3 -3
  38. package/dist/runtime/components/ui/navigation-menu/NavigationMenuLink.vue +1 -1
  39. package/dist/runtime/components/ui/navigation-menu/NavigationMenuViewport.vue +1 -1
  40. package/dist/runtime/components/ui/range-calendar/RangeCalendarCell.vue +1 -1
  41. package/dist/runtime/components/ui/range-calendar/RangeCalendarCellTrigger.vue +1 -1
  42. package/dist/runtime/components/ui/sheet/SheetOverlay.vue +1 -1
  43. package/dist/runtime/components/ui/switch/Switch.d.vue.ts +24 -0
  44. package/dist/runtime/components/ui/switch/Switch.vue +46 -0
  45. package/dist/runtime/components/ui/switch/Switch.vue.d.ts +24 -0
  46. package/dist/runtime/components/ui/switch/index.d.ts +1 -0
  47. package/dist/runtime/components/ui/switch/index.js +1 -0
  48. package/dist/runtime/components/ui/textarea/Textarea.vue +1 -1
  49. package/dist/runtime/plugins/cel/env.d.ts +2 -2
  50. package/dist/runtime/plugins/cel/env.js +5 -4
  51. package/dist/runtime/plugins/cel/index.d.ts +3 -3
  52. package/dist/runtime/plugins/cel/index.js +7 -3
  53. package/dist/runtime/plugins/markdown/index.d.ts +1 -1
  54. package/dist/runtime/utils/coders.d.ts +7 -0
  55. package/dist/runtime/utils/coders.js +39 -0
  56. package/dist/runtime/vendor/cel/index.d.ts +17 -0
  57. package/dist/runtime/vendor/cel/index.js +10 -0
  58. package/dist/runtime/vendor/cel-js/LICENSE +21 -0
  59. package/dist/runtime/vendor/cel-js/UPSTREAM.md +17 -0
  60. package/dist/runtime/vendor/cel-js/lib/errors.d.ts +21 -0
  61. package/dist/runtime/vendor/cel-js/lib/errors.js +97 -0
  62. package/dist/runtime/vendor/cel-js/lib/evaluator.d.ts +4 -0
  63. package/dist/runtime/vendor/cel-js/lib/evaluator.js +192 -0
  64. package/dist/runtime/vendor/cel-js/lib/functions.d.ts +53 -0
  65. package/dist/runtime/vendor/cel-js/lib/functions.js +513 -0
  66. package/dist/runtime/vendor/cel-js/lib/globals.d.ts +27 -0
  67. package/dist/runtime/vendor/cel-js/lib/globals.js +33 -0
  68. package/dist/runtime/vendor/cel-js/lib/index.d.ts +469 -0
  69. package/dist/runtime/vendor/cel-js/lib/index.js +18 -0
  70. package/dist/runtime/vendor/cel-js/lib/macros.d.ts +1 -0
  71. package/dist/runtime/vendor/cel-js/lib/macros.js +230 -0
  72. package/dist/runtime/vendor/cel-js/lib/operators.d.ts +117 -0
  73. package/dist/runtime/vendor/cel-js/lib/operators.js +739 -0
  74. package/dist/runtime/vendor/cel-js/lib/optional.d.ts +14 -0
  75. package/dist/runtime/vendor/cel-js/lib/optional.js +161 -0
  76. package/dist/runtime/vendor/cel-js/lib/options.d.ts +23 -0
  77. package/dist/runtime/vendor/cel-js/lib/options.js +47 -0
  78. package/dist/runtime/vendor/cel-js/lib/overloads.d.ts +1 -0
  79. package/dist/runtime/vendor/cel-js/lib/overloads.js +214 -0
  80. package/dist/runtime/vendor/cel-js/lib/parser.d.ts +56 -0
  81. package/dist/runtime/vendor/cel-js/lib/parser.js +827 -0
  82. package/dist/runtime/vendor/cel-js/lib/registry.d.ts +279 -0
  83. package/dist/runtime/vendor/cel-js/lib/registry.js +1596 -0
  84. package/dist/runtime/vendor/cel-js/lib/serialize.d.ts +1 -0
  85. package/dist/runtime/vendor/cel-js/lib/serialize.js +259 -0
  86. package/dist/runtime/vendor/cel-js/lib/type-checker.d.ts +26 -0
  87. package/dist/runtime/vendor/cel-js/lib/type-checker.js +81 -0
  88. package/package.json +7 -4
  89. package/dist/runtime/components/locale.d.vue.ts +0 -14
  90. package/dist/runtime/components/locale.vue +0 -89
  91. package/dist/runtime/components/locale.vue.d.ts +0 -14
  92. package/dist/runtime/components/query.d.vue.ts +0 -30
  93. package/dist/runtime/components/query.vue +0 -266
  94. package/dist/runtime/components/query.vue.d.ts +0 -30
  95. package/dist/runtime/utilities/query-config/global.d.ts +0 -4
  96. package/dist/runtime/utilities/query-config/global.js +0 -18
  97. package/dist/runtime/utilities/query-config/index.d.ts +0 -3
  98. package/dist/runtime/utilities/query-config/index.js +0 -14
  99. package/dist/runtime/utilities/query-config/schema.d.ts +0 -96
  100. package/dist/runtime/utilities/query-config/schema.js +0 -51
@@ -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
- };