@shwfed/nuxt 0.7.9 → 0.7.11

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 (108) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/app.d.vue.ts +7 -56
  3. package/dist/runtime/components/app.vue +17 -404
  4. package/dist/runtime/components/app.vue.d.ts +7 -56
  5. package/dist/runtime/components/fields.d.vue.ts +154 -132
  6. package/dist/runtime/components/fields.vue +30 -295
  7. package/dist/runtime/components/fields.vue.d.ts +154 -132
  8. package/dist/runtime/components/table.d.vue.ts +129 -59
  9. package/dist/runtime/components/table.vue +51 -617
  10. package/dist/runtime/components/table.vue.d.ts +129 -59
  11. package/dist/runtime/components/ui/app/App.d.vue.ts +86 -0
  12. package/dist/runtime/components/ui/app/App.vue +414 -0
  13. package/dist/runtime/components/ui/app/App.vue.d.ts +86 -0
  14. package/dist/runtime/components/ui/checkbox/Checkbox.vue +6 -2
  15. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuItem.vue +1 -1
  16. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +30 -0
  17. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +87 -0
  18. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +30 -0
  19. package/dist/runtime/components/ui/expression-editor/index.d.ts +1 -0
  20. package/dist/runtime/components/ui/expression-editor/index.js +1 -0
  21. package/dist/runtime/components/ui/field/FieldContent.vue +1 -1
  22. package/dist/runtime/components/ui/field/FieldError.vue +2 -2
  23. package/dist/runtime/components/ui/field/FieldLabel.vue +1 -1
  24. package/dist/runtime/components/ui/fields/Fields.d.vue.ts +376 -0
  25. package/dist/runtime/components/ui/fields/Fields.vue +441 -0
  26. package/dist/runtime/components/ui/fields/Fields.vue.d.ts +376 -0
  27. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +163 -0
  28. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue +363 -0
  29. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +163 -0
  30. package/dist/runtime/components/ui/icon-picker/IconPicker.d.vue.ts +15 -0
  31. package/dist/runtime/components/ui/icon-picker/IconPicker.vue +178 -0
  32. package/dist/runtime/components/ui/icon-picker/IconPicker.vue.d.ts +15 -0
  33. package/dist/runtime/components/ui/icon-picker/index.d.ts +1 -0
  34. package/dist/runtime/components/ui/icon-picker/index.js +1 -0
  35. package/dist/runtime/components/ui/input/Input.d.vue.ts +1 -0
  36. package/dist/runtime/components/ui/input/Input.vue +2 -0
  37. package/dist/runtime/components/ui/input/Input.vue.d.ts +1 -0
  38. package/dist/runtime/components/ui/input-group/InputGroupAddon.vue +4 -1
  39. package/dist/runtime/components/ui/input-group/InputGroupCombobox.d.vue.ts +8 -3
  40. package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue +8 -3
  41. package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue.d.ts +8 -3
  42. package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.d.vue.ts +8 -1
  43. package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.vue +11 -2
  44. package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.vue.d.ts +8 -1
  45. package/dist/runtime/components/ui/input-group/InputGroupInput.vue +1 -1
  46. package/dist/runtime/components/ui/input-group/InputGroupNumberField.d.vue.ts +5 -2
  47. package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue +10 -4
  48. package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue.d.ts +5 -2
  49. package/dist/runtime/components/ui/input-group/InputGroupTextarea.vue +1 -1
  50. package/dist/runtime/components/ui/input-group/index.js +1 -1
  51. package/dist/runtime/components/ui/locale/Locale.d.vue.ts +20 -0
  52. package/dist/runtime/components/ui/locale/Locale.vue +291 -0
  53. package/dist/runtime/components/ui/locale/Locale.vue.d.ts +20 -0
  54. package/dist/runtime/components/ui/locale/index.d.ts +1 -0
  55. package/dist/runtime/components/ui/locale/index.js +1 -0
  56. package/dist/runtime/components/ui/native-select/NativeSelect.d.vue.ts +2 -2
  57. package/dist/runtime/components/ui/native-select/NativeSelect.vue +1 -1
  58. package/dist/runtime/components/ui/native-select/NativeSelect.vue.d.ts +2 -2
  59. package/dist/runtime/components/ui/native-select/NativeSelectOption.d.vue.ts +1 -0
  60. package/dist/runtime/components/ui/native-select/NativeSelectOption.vue +4 -1
  61. package/dist/runtime/components/ui/native-select/NativeSelectOption.vue.d.ts +1 -0
  62. package/dist/runtime/components/ui/number-field/NumberFieldInput.vue +1 -1
  63. package/dist/runtime/components/ui/switch/Switch.vue +2 -2
  64. package/dist/runtime/components/ui/table/Table.d.vue.ts +147 -0
  65. package/dist/runtime/components/ui/table/Table.vue +952 -0
  66. package/dist/runtime/components/ui/table/Table.vue.d.ts +147 -0
  67. package/dist/runtime/components/ui/table/schema.d.ts +151 -0
  68. package/dist/runtime/components/ui/table/schema.js +142 -0
  69. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.d.vue.ts +128 -0
  70. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue +2719 -0
  71. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue.d.ts +128 -0
  72. package/dist/runtime/components/ui/table-configurator/menu.d.ts +37 -0
  73. package/dist/runtime/components/ui/table-configurator/menu.js +227 -0
  74. package/dist/runtime/components/ui/tabs/Tabs.d.vue.ts +24 -0
  75. package/dist/runtime/components/ui/tabs/Tabs.vue +30 -0
  76. package/dist/runtime/components/ui/tabs/Tabs.vue.d.ts +24 -0
  77. package/dist/runtime/components/ui/tabs/TabsContent.d.vue.ts +18 -0
  78. package/dist/runtime/components/ui/tabs/TabsContent.vue +23 -0
  79. package/dist/runtime/components/ui/tabs/TabsContent.vue.d.ts +18 -0
  80. package/dist/runtime/components/ui/tabs/TabsList.d.vue.ts +18 -0
  81. package/dist/runtime/components/ui/tabs/TabsList.vue +25 -0
  82. package/dist/runtime/components/ui/tabs/TabsList.vue.d.ts +18 -0
  83. package/dist/runtime/components/ui/tabs/TabsTrigger.d.vue.ts +18 -0
  84. package/dist/runtime/components/ui/tabs/TabsTrigger.vue +27 -0
  85. package/dist/runtime/components/ui/tabs/TabsTrigger.vue.d.ts +18 -0
  86. package/dist/runtime/components/ui/tabs/index.d.ts +4 -0
  87. package/dist/runtime/components/ui/tabs/index.js +4 -0
  88. package/dist/runtime/components/ui/textarea/Textarea.d.vue.ts +1 -0
  89. package/dist/runtime/components/ui/textarea/Textarea.vue +4 -2
  90. package/dist/runtime/components/ui/textarea/Textarea.vue.d.ts +1 -0
  91. package/dist/runtime/components/ui/toggle/Toggle.d.vue.ts +34 -0
  92. package/dist/runtime/components/ui/toggle/Toggle.vue +32 -0
  93. package/dist/runtime/components/ui/toggle/Toggle.vue.d.ts +34 -0
  94. package/dist/runtime/components/ui/toggle/index.d.ts +7 -0
  95. package/dist/runtime/components/ui/toggle/index.js +22 -0
  96. package/dist/runtime/composables/useTableRenderers.d.ts +2 -1
  97. package/dist/runtime/composables/useTableRenderers.js +2 -1
  98. package/dist/runtime/plugins/toast/index.d.ts +2 -2
  99. package/dist/runtime/style.css +1 -1
  100. package/dist/runtime/table-renderers/builtins.js +328 -137
  101. package/dist/runtime/table-renderers/registry.d.ts +2 -1
  102. package/dist/runtime/table-renderers/registry.js +3 -0
  103. package/dist/runtime/utils/coders.d.ts +29 -2
  104. package/dist/runtime/utils/coders.js +40 -2
  105. package/package.json +8 -6
  106. /package/dist/runtime/components/{logo.d.vue.ts → ui/logo/Logo.d.vue.ts} +0 -0
  107. /package/dist/runtime/components/{logo.vue → ui/logo/Logo.vue} +0 -0
  108. /package/dist/runtime/components/{logo.vue.d.ts → ui/logo/Logo.vue.d.ts} +0 -0
@@ -0,0 +1,291 @@
1
+ <script setup>
2
+ import { useVModel } from "@vueuse/core";
3
+ import { Icon } from "@iconify/vue";
4
+ import { computed } from "vue";
5
+ import { useI18n } from "vue-i18n";
6
+ import { cn } from "../../../utils/cn";
7
+ import { supportedLocales } from "../../../utils/coders";
8
+ import { Button } from "../button";
9
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../dropdown-menu";
10
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupTextarea } from "../input-group";
11
+ defineOptions({
12
+ inheritAttrs: false
13
+ });
14
+ const props = defineProps({
15
+ modelValue: { type: null, required: false },
16
+ class: { type: null, required: false },
17
+ multiline: { type: Boolean, required: false }
18
+ });
19
+ const emits = defineEmits(["update:modelValue"]);
20
+ const modelValue = useVModel(props, "modelValue", emits, {
21
+ passive: true,
22
+ defaultValue: createDefaultLocaleValue()
23
+ });
24
+ const { t } = useI18n();
25
+ const locales = computed(
26
+ () => [...modelValue.value ?? createDefaultLocaleValue()].sort((left, right) => {
27
+ if (left.locale === "zh") {
28
+ return -1;
29
+ }
30
+ if (right.locale === "zh") {
31
+ return 1;
32
+ }
33
+ return 0;
34
+ })
35
+ );
36
+ const hasRemainingLocales = computed(() => locales.value.length < supportedLocales.length);
37
+ const localeLabels = {
38
+ zh: "\u4E2D\u6587",
39
+ ja: "\u65E5\u672C\u8A9E",
40
+ en: "English",
41
+ ko: "\uD55C\uAD6D\uC5B4"
42
+ };
43
+ function createDefaultLocaleValue() {
44
+ return [{ locale: "zh", message: "" }];
45
+ }
46
+ function localeIcon(locale) {
47
+ return `circle-flags:lang-${locale}`;
48
+ }
49
+ function localeLabel(locale) {
50
+ return localeLabels[locale];
51
+ }
52
+ function availableLocales(index) {
53
+ const currentLocale = locales.value[index]?.locale;
54
+ return supportedLocales.filter((locale) => locale !== currentLocale && !locales.value.some((item) => item.locale === locale));
55
+ }
56
+ function updateMessage(index, message) {
57
+ modelValue.value = locales.value.map((item, itemIndex) => {
58
+ if (itemIndex !== index) {
59
+ return item;
60
+ }
61
+ return {
62
+ locale: item.locale,
63
+ message: String(message)
64
+ };
65
+ });
66
+ }
67
+ function updateLocale(index, locale) {
68
+ const currentItem = locales.value[index];
69
+ if (!currentItem || currentItem.locale === "zh" && locale !== "zh") {
70
+ return;
71
+ }
72
+ modelValue.value = locales.value.map((item, itemIndex) => {
73
+ if (itemIndex !== index) {
74
+ return item;
75
+ }
76
+ return {
77
+ locale,
78
+ message: item.message
79
+ };
80
+ });
81
+ }
82
+ function removeLocale(index) {
83
+ const currentItem = locales.value[index];
84
+ if (!currentItem || currentItem.locale === "zh") {
85
+ return;
86
+ }
87
+ modelValue.value = locales.value.filter((_, itemIndex) => itemIndex !== index);
88
+ }
89
+ function addLocale() {
90
+ const locale = supportedLocales.find((candidate) => !locales.value.some((item) => item.locale === candidate));
91
+ if (!locale) {
92
+ return;
93
+ }
94
+ const nextValue = [...locales.value];
95
+ nextValue.push({
96
+ locale,
97
+ message: ""
98
+ });
99
+ modelValue.value = nextValue;
100
+ }
101
+ function handleMessageUpdate(index, value) {
102
+ updateMessage(index, value);
103
+ }
104
+ </script>
105
+
106
+ <template>
107
+ <div
108
+ v-bind="$attrs"
109
+ data-slot="locale"
110
+ :class="cn('flex flex-col gap-2', props.class)"
111
+ >
112
+ <InputGroup
113
+ v-for="(item, index) in locales"
114
+ :key="item.locale"
115
+ data-slot="locale-row"
116
+ :data-locale="item.locale"
117
+ >
118
+ <InputGroupAddon
119
+ v-if="props.multiline"
120
+ align="block-start"
121
+ class="border-b border-zinc-200"
122
+ >
123
+ <div class="flex w-full items-center justify-between gap-3">
124
+ <DropdownMenu v-if="item.locale !== 'zh' && availableLocales(index).length > 0">
125
+ <DropdownMenuTrigger as-child>
126
+ <InputGroupButton
127
+ size="sm"
128
+ as-child
129
+ >
130
+ <button
131
+ type="button"
132
+ data-slot="locale-trigger"
133
+ class="text-zinc-500 transition-colors hover:text-zinc-700"
134
+ :aria-label="t('select-locale', { locale: localeLabel(item.locale) })"
135
+ >
136
+ <Icon :icon="localeIcon(item.locale)" />
137
+ <span>{{ localeLabel(item.locale) }}</span>
138
+ </button>
139
+ </InputGroupButton>
140
+ </DropdownMenuTrigger>
141
+ <DropdownMenuContent align="start">
142
+ <DropdownMenuItem
143
+ v-for="locale in availableLocales(index)"
144
+ :key="locale"
145
+ data-slot="locale-option"
146
+ :data-locale-option="locale"
147
+ @select="updateLocale(index, locale)"
148
+ >
149
+ <Icon :icon="localeIcon(locale)" />
150
+ <span>{{ localeLabel(locale) }}</span>
151
+ </DropdownMenuItem>
152
+ </DropdownMenuContent>
153
+ </DropdownMenu>
154
+
155
+ <span
156
+ v-else
157
+ data-slot="locale-icon"
158
+ class="flex items-center gap-2 text-zinc-500"
159
+ >
160
+ <Icon :icon="localeIcon(item.locale)" />
161
+ <span>{{ localeLabel(item.locale) }}</span>
162
+ </span>
163
+
164
+ <InputGroupButton
165
+ variant="destructive"
166
+ size="icon-xs"
167
+ as-child
168
+ >
169
+ <button
170
+ type="button"
171
+ data-slot="locale-delete"
172
+ :disabled="item.locale === 'zh'"
173
+ :aria-label="t('delete-locale', { locale: localeLabel(item.locale) })"
174
+ @click="removeLocale(index)"
175
+ >
176
+ <Icon icon="fluent:delete-20-regular" />
177
+ </button>
178
+ </InputGroupButton>
179
+ </div>
180
+ </InputGroupAddon>
181
+
182
+ <InputGroupAddon v-else>
183
+ <DropdownMenu v-if="item.locale !== 'zh' && availableLocales(index).length > 0">
184
+ <DropdownMenuTrigger as-child>
185
+ <InputGroupButton
186
+ size="icon-sm"
187
+ as-child
188
+ >
189
+ <button
190
+ type="button"
191
+ data-slot="locale-trigger"
192
+ class="text-zinc-500 transition-colors hover:text-zinc-700 [&_svg:not([class*='size-'])]:size-3.5"
193
+ :aria-label="t('select-locale', { locale: localeLabel(item.locale) })"
194
+ >
195
+ <Icon :icon="localeIcon(item.locale)" />
196
+ </button>
197
+ </InputGroupButton>
198
+ </DropdownMenuTrigger>
199
+ <DropdownMenuContent align="start">
200
+ <DropdownMenuItem
201
+ v-for="locale in availableLocales(index)"
202
+ :key="locale"
203
+ data-slot="locale-option"
204
+ :data-locale-option="locale"
205
+ @select="updateLocale(index, locale)"
206
+ >
207
+ <Icon :icon="localeIcon(locale)" />
208
+ <span>{{ localeLabel(locale) }}</span>
209
+ </DropdownMenuItem>
210
+ </DropdownMenuContent>
211
+ </DropdownMenu>
212
+ <span
213
+ v-else
214
+ data-slot="locale-icon"
215
+ class="-ml-[0.45rem] flex size-8 items-center justify-center text-zinc-500"
216
+ >
217
+ <Icon :icon="localeIcon(item.locale)" />
218
+ </span>
219
+ </InputGroupAddon>
220
+
221
+ <InputGroupInput
222
+ v-if="!props.multiline"
223
+ data-slot="locale-input"
224
+ :model-value="item.message"
225
+ :placeholder="localeLabel(item.locale)"
226
+ @update:model-value="handleMessageUpdate(index, $event)"
227
+ />
228
+
229
+ <InputGroupTextarea
230
+ v-else
231
+ data-slot="locale-textarea"
232
+ class="min-h-32"
233
+ :model-value="item.message"
234
+ :placeholder="localeLabel(item.locale)"
235
+ @update:model-value="handleMessageUpdate(index, $event)"
236
+ />
237
+
238
+ <InputGroupAddon
239
+ v-if="!props.multiline"
240
+ align="inline-end"
241
+ >
242
+ <InputGroupButton
243
+ variant="destructive"
244
+ size="icon-xs"
245
+ as-child
246
+ >
247
+ <button
248
+ type="button"
249
+ data-slot="locale-delete"
250
+ :disabled="item.locale === 'zh'"
251
+ :aria-label="t('delete-locale', { locale: localeLabel(item.locale) })"
252
+ @click="removeLocale(index)"
253
+ >
254
+ <Icon icon="fluent:delete-20-regular" />
255
+ </button>
256
+ </InputGroupButton>
257
+ </InputGroupAddon>
258
+ </InputGroup>
259
+
260
+ <Button
261
+ type="button"
262
+ data-slot="locale-add"
263
+ class="w-full justify-center"
264
+ :disabled="!hasRemainingLocales"
265
+ @click="addLocale"
266
+ >
267
+ <Icon icon="fluent:add-20-regular" />
268
+ <span>{{ t("add-language") }}</span>
269
+ </Button>
270
+ </div>
271
+ </template>
272
+
273
+ <i18n lang="json">
274
+ {
275
+ "zh": {
276
+ "add-language": "新增语言",
277
+ "select-locale": "选择语言:{locale}",
278
+ "delete-locale": "删除语言:{locale}"
279
+ },
280
+ "ja": {
281
+ "add-language": "言語を追加",
282
+ "select-locale": "言語を選択: {locale}",
283
+ "delete-locale": "言語を削除: {locale}"
284
+ },
285
+ "en": {
286
+ "add-language": "Add language",
287
+ "select-locale": "Select language: {locale}",
288
+ "delete-locale": "Delete language: {locale}"
289
+ }
290
+ }
291
+ </i18n>
@@ -0,0 +1,20 @@
1
+ import type { HTMLAttributes } from 'vue';
2
+ import { type LocaleValue } from '../../../utils/coders.js';
3
+ type __VLS_Props = {
4
+ modelValue?: LocaleValue;
5
+ class?: HTMLAttributes['class'];
6
+ multiline?: boolean;
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ "update:modelValue": (args_0: readonly {
10
+ locale: "zh" | "ja" | "en" | "ko";
11
+ message: string;
12
+ }[]) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ "onUpdate:modelValue"?: ((args_0: readonly {
15
+ locale: "zh" | "ja" | "en" | "ko";
16
+ message: string;
17
+ }[]) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as Locale } from './Locale.vue.js';
@@ -0,0 +1 @@
1
+ export { default as Locale } from "./Locale.vue";
@@ -9,9 +9,9 @@ type __VLS_Slots = {} & {
9
9
  default?: (props: typeof __VLS_1) => any;
10
10
  };
11
11
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
- "update:modelValue": () => any;
12
+ "update:modelValue": (args_0: AcceptableValue) => any;
13
13
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
- "onUpdate:modelValue"?: (() => any) | undefined;
14
+ "onUpdate:modelValue"?: ((args_0: AcceptableValue) => any) | undefined;
15
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
17
  declare const _default: typeof __VLS_export;
@@ -27,7 +27,7 @@ const delegatedProps = reactiveOmit(props, "class");
27
27
  v-model="modelValue"
28
28
  data-slot="native-select"
29
29
  :class="cn(
30
- 'border-zinc-200 placeholder:text-zinc-400 selection:bg-primary selection:text-primary-foreground dark:bg-zinc-200/30 dark:hover:bg-zinc-200/50 h-9 w-full min-w-0 appearance-none rounded-md border bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed',
30
+ 'border-zinc-200 placeholder:text-zinc-400 selection:bg-primary selection:text-primary-foreground h-9 w-full min-w-0 appearance-none rounded-md border bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed',
31
31
  'focus-visible:border-(--primary)',
32
32
  'aria-invalid:border-red-400',
33
33
  props.class
@@ -9,9 +9,9 @@ type __VLS_Slots = {} & {
9
9
  default?: (props: typeof __VLS_1) => any;
10
10
  };
11
11
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
- "update:modelValue": () => any;
12
+ "update:modelValue": (args_0: AcceptableValue) => any;
13
13
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
- "onUpdate:modelValue"?: (() => any) | undefined;
14
+ "onUpdate:modelValue"?: ((args_0: AcceptableValue) => any) | undefined;
15
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
17
  declare const _default: typeof __VLS_export;
@@ -1,6 +1,7 @@
1
1
  import type { HTMLAttributes } from 'vue';
2
2
  type __VLS_Props = {
3
3
  class?: HTMLAttributes['class'];
4
+ value?: string | number;
4
5
  };
5
6
  declare var __VLS_1: {};
6
7
  type __VLS_Slots = {} & {
@@ -1,13 +1,16 @@
1
1
  <script setup>
2
2
  import { cn } from "../../../utils/cn";
3
3
  const props = defineProps({
4
- class: { type: null, required: false }
4
+ class: { type: null, required: false },
5
+ value: { type: [String, Number], required: false }
5
6
  });
6
7
  </script>
7
8
 
8
9
  <template>
9
10
  <option
10
11
  data-slot="native-select-option"
12
+ :value="props.value"
13
+ v-bind="$attrs"
11
14
  :class="cn('bg-white text-zinc-700', props.class)"
12
15
  >
13
16
  <slot />
@@ -1,6 +1,7 @@
1
1
  import type { HTMLAttributes } from 'vue';
2
2
  type __VLS_Props = {
3
3
  class?: HTMLAttributes['class'];
4
+ value?: string | number;
4
5
  };
5
6
  declare var __VLS_1: {};
6
7
  type __VLS_Slots = {} & {
@@ -9,6 +9,6 @@ const props = defineProps({
9
9
  <template>
10
10
  <NumberFieldInput
11
11
  data-slot="input"
12
- :class="cn('flex h-9 w-full rounded border border-zinc-200 hover:border-zinc-300 focus-visible:border-[color-mix(in_srgb,var(--primary)_60%,white)] bg-transparent py-1 text-sm text-center shadow-sm transition-colors duration-180 placeholder:text-zinc-700 outline-none disabled:cursor-not-allowed disabled:opacity-50', props.class)"
12
+ :class="cn('flex h-9 w-full rounded border border-zinc-200 hover:border-zinc-300 focus-visible:border-[color-mix(in_srgb,var(--primary)_60%,white)] bg-transparent px-3 py-1 text-sm text-center shadow-xs transition-colors duration-180 placeholder:text-zinc-700 outline-none disabled:cursor-not-allowed disabled:opacity-50', props.class)"
13
13
  />
14
14
  </template>
@@ -29,13 +29,13 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
29
29
  data-slot="switch"
30
30
  v-bind="forwarded"
31
31
  :class="cn(
32
- 'peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-zinc-200 focus-visible:border-(--primary) dark:data-[state=unchecked]:bg-zinc-200/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none disabled:cursor-not-allowed disabled:opacity-50',
32
+ 'peer data-[state=checked]:bg-(--primary) data-[state=unchecked]:bg-zinc-200 focus-visible:border-(--primary) inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none disabled:cursor-not-allowed disabled:opacity-50',
33
33
  props.class
34
34
  )"
35
35
  >
36
36
  <SwitchThumb
37
37
  data-slot="switch-thumb"
38
- :class="cn('bg-zinc-50 dark:data-[state=unchecked]:bg-zinc-800 dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0')"
38
+ :class="cn('bg-zinc-50 pointer-events-none block size-4 rounded-full transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0')"
39
39
  >
40
40
  <slot
41
41
  name="thumb"
@@ -0,0 +1,147 @@
1
+ import { type CellContext } from '@tanstack/vue-table';
2
+ import { Effect } from 'effect';
3
+ import { type TableConfig } from './schema.js';
4
+ export type { Accessor, Column, Expression, Markdown, Render, TableConfig } from './schema.js';
5
+ export { AccessorC, ColumnC, RenderC, TableConfigC } from './schema.js';
6
+ declare module '@tanstack/vue-table' {
7
+ interface ColumnMeta<TData extends import('@tanstack/vue-table').RowData, TValue> {
8
+ tooltip?: string;
9
+ grow?: boolean;
10
+ accessor?: import('./schema').Accessor;
11
+ __types?: [TData, TValue];
12
+ }
13
+ }
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
17
+ config: Effect.Effect<TableConfig>;
18
+ data: Array<unknown>;
19
+ rowCount?: number;
20
+ }, import("@tanstack/table-core").Table<unknown>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ "update:config": (args_0: Readonly<{
22
+ getRowId?: import("./schema.js").Expression;
23
+ getSubRows?: import("./schema.js").Expression;
24
+ enableRowSelection?: import("./schema.js").Expression;
25
+ enableMultiRowSelection?: import("./schema.js").Expression;
26
+ columns: readonly Readonly<{
27
+ id?: string;
28
+ title?: import("../../../utils/coders.js").LocaleValue;
29
+ accessor?: import("./schema.js").Accessor;
30
+ renderer?: import("./schema.js").Render;
31
+ tooltip?: import("../../../utils/coders.js").LocaleValue;
32
+ size?: number;
33
+ enableSorting?: boolean;
34
+ enableMultiSorting?: boolean;
35
+ enablePinning?: boolean;
36
+ columns?: readonly Readonly</*elided*/ any>[];
37
+ grow?: boolean;
38
+ }>[];
39
+ cellStyles?: import("./schema.js").Expression;
40
+ props?: Readonly<{
41
+ [key: string]: unknown;
42
+ initialState?: Readonly<{
43
+ columnVisibility?: Record<string, boolean>;
44
+ columnOrder?: ReadonlyArray<string>;
45
+ columnPinning?: Readonly<{
46
+ left?: ReadonlyArray<string>;
47
+ right?: ReadonlyArray<string>;
48
+ }>;
49
+ rowPinning?: Readonly<{
50
+ top?: ReadonlyArray<string>;
51
+ bottom?: ReadonlyArray<string>;
52
+ }>;
53
+ columnFilters?: ReadonlyArray<Readonly<{
54
+ id: string;
55
+ value: unknown;
56
+ }>>;
57
+ globalFilter?: unknown;
58
+ sorting?: ReadonlyArray<Readonly<{
59
+ id: string;
60
+ desc: boolean;
61
+ }>>;
62
+ expanded?: boolean | Record<string, boolean>;
63
+ grouping?: ReadonlyArray<string>;
64
+ columnSizing?: Record<string, number>;
65
+ columnSizingInfo?: Record<string, unknown>;
66
+ pagination?: Readonly<{
67
+ pageIndex?: number;
68
+ pageSize?: number;
69
+ }>;
70
+ rowSelection?: Record<string, boolean>;
71
+ }>;
72
+ }>;
73
+ paginationLeft?: import("./schema.js").Markdown;
74
+ paginationRight?: import("./schema.js").Markdown;
75
+ paginationPageSizes?: ReadonlyArray<number>;
76
+ }>) => any;
77
+ }, string, import("vue").PublicProps, Readonly<{
78
+ config: Effect.Effect<TableConfig>;
79
+ data: Array<unknown>;
80
+ rowCount?: number;
81
+ }> & Readonly<{
82
+ "onUpdate:config"?: ((args_0: Readonly<{
83
+ getRowId?: import("./schema.js").Expression;
84
+ getSubRows?: import("./schema.js").Expression;
85
+ enableRowSelection?: import("./schema.js").Expression;
86
+ enableMultiRowSelection?: import("./schema.js").Expression;
87
+ columns: readonly Readonly<{
88
+ id?: string;
89
+ title?: import("../../../utils/coders.js").LocaleValue;
90
+ accessor?: import("./schema.js").Accessor;
91
+ renderer?: import("./schema.js").Render;
92
+ tooltip?: import("../../../utils/coders.js").LocaleValue;
93
+ size?: number;
94
+ enableSorting?: boolean;
95
+ enableMultiSorting?: boolean;
96
+ enablePinning?: boolean;
97
+ columns?: readonly Readonly</*elided*/ any>[];
98
+ grow?: boolean;
99
+ }>[];
100
+ cellStyles?: import("./schema.js").Expression;
101
+ props?: Readonly<{
102
+ [key: string]: unknown;
103
+ initialState?: Readonly<{
104
+ columnVisibility?: Record<string, boolean>;
105
+ columnOrder?: ReadonlyArray<string>;
106
+ columnPinning?: Readonly<{
107
+ left?: ReadonlyArray<string>;
108
+ right?: ReadonlyArray<string>;
109
+ }>;
110
+ rowPinning?: Readonly<{
111
+ top?: ReadonlyArray<string>;
112
+ bottom?: ReadonlyArray<string>;
113
+ }>;
114
+ columnFilters?: ReadonlyArray<Readonly<{
115
+ id: string;
116
+ value: unknown;
117
+ }>>;
118
+ globalFilter?: unknown;
119
+ sorting?: ReadonlyArray<Readonly<{
120
+ id: string;
121
+ desc: boolean;
122
+ }>>;
123
+ expanded?: boolean | Record<string, boolean>;
124
+ grouping?: ReadonlyArray<string>;
125
+ columnSizing?: Record<string, number>;
126
+ columnSizingInfo?: Record<string, unknown>;
127
+ pagination?: Readonly<{
128
+ pageIndex?: number;
129
+ pageSize?: number;
130
+ }>;
131
+ rowSelection?: Record<string, boolean>;
132
+ }>;
133
+ }>;
134
+ paginationLeft?: import("./schema.js").Markdown;
135
+ paginationRight?: import("./schema.js").Markdown;
136
+ paginationPageSizes?: ReadonlyArray<number>;
137
+ }>) => any) | undefined;
138
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
139
+ [key: string]: (props: Readonly<{
140
+ cell: CellContext<unknown, unknown>;
141
+ }>) => void;
142
+ }>;
143
+ type __VLS_WithSlots<T, S> = T & {
144
+ new (): {
145
+ $slots: S;
146
+ };
147
+ };