@finema/core 2.29.0 → 2.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +410 -79
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -1
  4. package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
  5. package/dist/runtime/components/Form/Fields.vue +23 -14
  6. package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
  7. package/dist/runtime/components/Form/InputComponent/index.vue +23 -0
  8. package/dist/runtime/components/Form/InputComponent/index.vue.d.ts +3 -0
  9. package/dist/runtime/components/Form/InputComponent/types.d.ts +6 -0
  10. package/dist/runtime/components/Form/InputComponent/types.js +0 -0
  11. package/dist/runtime/components/Form/InputDateTime/index.vue +51 -51
  12. package/dist/runtime/components/Form/InputNumber/index.vue +20 -20
  13. package/dist/runtime/components/Form/InputSelectMultiple/index.vue +43 -43
  14. package/dist/runtime/components/Form/InputTextarea/index.vue +18 -18
  15. package/dist/runtime/components/Form/InputTime/index.vue +106 -0
  16. package/dist/runtime/components/Form/InputTime/index.vue.d.ts +11 -0
  17. package/dist/runtime/components/Form/InputTime/types.d.ts +17 -0
  18. package/dist/runtime/components/Form/InputTime/types.js +0 -0
  19. package/dist/runtime/components/Form/InputToggle/index.vue +17 -17
  20. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +30 -30
  21. package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
  22. package/dist/runtime/components/Form/fileState/FailedState.vue +33 -33
  23. package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
  24. package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
  25. package/dist/runtime/components/Form/index.vue +5 -5
  26. package/dist/runtime/components/Form/types.d.ts +4 -1
  27. package/dist/runtime/components/Form/types.js +1 -0
  28. package/dist/runtime/components/Image.vue +28 -28
  29. package/dist/runtime/components/Log/index.vue +17 -17
  30. package/dist/runtime/components/Table/ColumnDate.vue +1 -1
  31. package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
  32. package/dist/runtime/components/Table/ColumnImage.vue +4 -4
  33. package/dist/runtime/components/Table/ColumnText.vue +1 -1
  34. package/dist/runtime/server/tsconfig.json +3 -3
  35. package/dist/runtime/utils/TimeHelper.d.ts +3 -3
  36. package/dist/runtime/utils/TimeHelper.js +6 -6
  37. package/package.json +2 -2
package/README.md CHANGED
@@ -1,79 +1,410 @@
1
- <!--
2
- Get your module up and running quickly.
3
-
4
- Find and replace all on all files (CMD+SHIFT+F):
5
- - Name: Finema UI Kit (Note: package.json has name: @finema/core, consider aligning these)
6
- - Package name: @finema/core
7
- - Description: A comprehensive UI kit for Finema projects.
8
- -->
9
-
10
- # Finema UI Kit
11
-
12
- [![npm version][npm-version-src]][npm-version-href]
13
- [![npm downloads][npm-downloads-src]][npm-downloads-href]
14
- [![License][license-src]][license-href]
15
- [![Nuxt][nuxt-src]][nuxt-href]
16
-
17
- A comprehensive UI kit for building consistent and beautiful user interfaces for Finema projects, designed to integrate seamlessly with Nuxt. This package is named `@finema/core` on npm.
18
-
19
- - [✨ &nbsp;Release Notes](/CHANGELOG.md)
20
- - [📖 &nbsp;Storybook](https://your-storybook-url.com) <!-- Add a link to your Storybook -->
21
- - [đŸ•šī¸ &nbsp;Playground](#playground)
22
-
23
- ## Features
24
-
25
- <!-- Highlight some of the features your UI kit provides here -->
26
- - 🎨 &nbsp;Wide range of customizable components, built for Vue and Nuxt
27
- - 📱 &nbsp;Responsive design out-of-the-box
28
- - â™ŋ &nbsp;Accessibility focused
29
- - đŸ› ī¸ &nbsp;Easy to integrate and use with Nuxt auto-import capabilities
30
-
31
- ## 🚀 Installation
32
-
33
- Install the UI kit in your project using npm or yarn:
34
-
35
- ```bash
36
- npm install @finema/core
37
- ```
38
-
39
- or
40
-
41
- ```bash
42
- yarn add @finema/core
43
- ```
44
-
45
- ## đŸ› ī¸ Available Scripts
46
-
47
- In the project directory, you can run the following scripts:
48
-
49
- - `npm run dev` or `yarn dev`: Runs the playground app in development mode.
50
- - `npm run dev:build` or `yarn dev:build`: Builds the playground app.
51
- - `npm run dev:prepare` or `yarn dev:prepare`: Prepares the development environment.
52
- - `npm run lint` or `yarn lint`: Lints the codebase.
53
- - `npm run test` or `yarn test`: Runs tests.
54
- - `npm run release` or `yarn release`: Creates a new release (lints, tests, builds, publishes).
55
-
56
- ## đŸ•šī¸ Playground
57
-
58
- This project includes a `playground` directory that you can use to test and experiment with the UI components.
59
-
60
- To run the playground:
61
- 1. Navigate to the `playground` directory.
62
- 2. Install dependencies if you haven't already (`npm install` or `yarn install`).
63
- 3. Run `npm run dev` or `yarn dev`.
64
-
65
- ## 🤝 Contributing
66
-
67
- Contributions are welcome! Please refer to the `CONTRIBUTING.md` file for guidelines. (You'll need to create this file).
68
-
69
- <!--
70
- Badge URLs - Keep these at the bottom of the file for better readability
71
- -->
72
- [npm-version-src]: https://img.shields.io/npm/v/@finema/core.svg
73
- [npm-version-href]: https://npmjs.com/package/@finema/core
74
- [npm-downloads-src]: https://img.shields.io/npm/dm/@finema/core.svg
75
- [npm-downloads-href]: https://npmjs.com/package/@finema/core
76
- [license-src]: https://img.shields.io/npm/l/@finema/core.svg
77
- [license-href]: https://npmjs.com/package/@finema/core
78
- [nuxt-src]: https://img.shields.io/badge/Nuxt-00DC82?logo=nuxt.js
79
- [nuxt-href]: https://nuxt.com
1
+ # @finema/core
2
+
3
+ [![bun version][bun-version-src]][bun-version-href]
4
+ [![bun downloads][bun-downloads-src]][bun-downloads-href]
5
+ [![License][license-src]][license-href]
6
+ [![Nuxt][nuxt-src]][nuxt-href]
7
+
8
+ > Enterprise-grade Vue.js UI component library for Nuxt applications
9
+
10
+ A comprehensive, production-ready UI kit that provides 20+ auto-registered components, composables, and utilities for building consistent and beautiful user interfaces. Designed specifically for Nuxt 3 with TypeScript support, automatic validation, and seamless theming.
11
+
12
+ ## ✨ Features
13
+
14
+ - 🎨 **20+ Auto-registered Components** - Forms, tables, dialogs, loaders, and more
15
+ - 🔧 **Auto-imported Composables** - Dialog, notifications, form helpers, data loaders
16
+ - ✅ **Integrated Validation** - vee-validate + valibot with Thai localization
17
+ - 🎭 **Theming System** - Built on @nuxt/ui and Tailwind CSS
18
+ - đŸ“Ļ **Quality-of-life Features** - Lodash auto-imports, masked inputs, and more
19
+ - 📱 **Mobile-first Design** - Responsive components out-of-the-box
20
+ - â™ŋ **Accessibility Focused** - ARIA labels, keyboard navigation, screen reader support
21
+ - ⚡ **Performance Optimized** - Tree-shaking, lazy loading, virtual scrolling
22
+ - 🔒 **Type Safe** - Full TypeScript support with auto-generated types
23
+
24
+ ## 📋 Quick Links
25
+
26
+ - [📖 Getting Started Guide](./docs/getting-started.md) - Complete setup and usage guide
27
+ - [🎮 Playground Examples](./playground/) - Live examples and demos
28
+ - [📚 Component Documentation](./docs/components/) - Detailed component API
29
+ - [🔧 Composables Guide](./docs/composables/) - Available utilities and helpers
30
+ - [🎨 Theming Guide](./docs/theming.md) - Customize colors and styling
31
+ - [✨ Release Notes](./CHANGELOG.md) - What's new in each version
32
+
33
+ ## 🚀 Installation
34
+
35
+ ### Prerequisites
36
+ - **Nuxt 3** (Vue 3, Vite)
37
+ - **Node.js 22+** (recommended)
38
+
39
+ ### Install Package
40
+
41
+ ```bash
42
+ # bun
43
+ bun install @finema/core
44
+
45
+ # yarn
46
+ yarn add @finema/core
47
+
48
+ # pnpm
49
+ pnpm add @finema/core
50
+ ```
51
+
52
+ ### Setup Module
53
+
54
+ Add the module to your `nuxt.config.ts`:
55
+
56
+ ```ts
57
+ // nuxt.config.ts
58
+ export default defineNuxtConfig({
59
+ modules: [
60
+ '@finema/core'
61
+ ]
62
+ })
63
+ ```
64
+
65
+ That's it! All components and composables are now auto-imported and ready to use.
66
+
67
+ ## đŸŽ¯ Quick Start
68
+
69
+ ### Simple Form Example
70
+
71
+ ```vue
72
+ <template>
73
+ <div class="max-w-md mx-auto p-6">
74
+ <h1 class="text-2xl font-bold mb-6">Contact Form</h1>
75
+
76
+ <Form @submit="onSubmit">
77
+ <FormFields :options="formFields" />
78
+
79
+ <Button type="submit" :loading="isSubmitting" class="mt-6">
80
+ Submit
81
+ </Button>
82
+ </Form>
83
+ </div>
84
+ </template>
85
+
86
+ <script setup lang="ts">
87
+ // Form validation schema using valibot
88
+ const form = useForm({
89
+ validationSchema: toTypedSchema(
90
+ v.object({
91
+ name: v.pipe(v.string(), v.minLength(2)),
92
+ email: v.pipe(v.string(), v.email()),
93
+ message: v.pipe(v.string(), v.minLength(10))
94
+ })
95
+ )
96
+ })
97
+
98
+ // Form fields configuration
99
+ const formFields = createFormFields(() => [
100
+ {
101
+ type: INPUT_TYPES.TEXT,
102
+ props: {
103
+ name: 'name',
104
+ label: 'Full Name',
105
+ required: true
106
+ }
107
+ },
108
+ {
109
+ type: INPUT_TYPES.TEXT,
110
+ props: {
111
+ name: 'email',
112
+ label: 'Email',
113
+ type: 'email',
114
+ required: true
115
+ }
116
+ },
117
+ {
118
+ type: INPUT_TYPES.TEXTAREA,
119
+ props: {
120
+ name: 'message',
121
+ label: 'Message',
122
+ rows: 4,
123
+ required: true
124
+ }
125
+ }
126
+ ])
127
+
128
+ const isSubmitting = ref(false)
129
+ const notification = useNotification()
130
+
131
+ const onSubmit = form.handleSubmit(async (values) => {
132
+ isSubmitting.value = true
133
+
134
+ try {
135
+ await $fetch('/api/contact', {
136
+ method: 'POST',
137
+ body: values
138
+ })
139
+
140
+ notification.success({
141
+ title: 'Success!',
142
+ description: 'Your message has been sent.'
143
+ })
144
+
145
+ form.resetForm()
146
+ } catch (error) {
147
+ notification.error({
148
+ title: 'Error',
149
+ description: 'Failed to send message.'
150
+ })
151
+ } finally {
152
+ isSubmitting.value = false
153
+ }
154
+ }, moveToError)
155
+ </script>
156
+ ```
157
+
158
+ ### Data Table Example
159
+
160
+ ```vue
161
+ <template>
162
+ <div class="space-y-6">
163
+ <div class="flex justify-between items-center">
164
+ <h1 class="text-2xl font-bold">Users</h1>
165
+ <Button @click="refreshData">Refresh</Button>
166
+ </div>
167
+
168
+ <Table
169
+ :options="tableOptions"
170
+ @pageChange="store.fetchPageChange"
171
+ @search="store.fetchSearch"
172
+ />
173
+ </div>
174
+ </template>
175
+
176
+ <script setup lang="ts">
177
+ import { COLUMN_TYPES } from '#core/components/Table/types'
178
+
179
+ // Set up data store
180
+ const store = usePageLoader({
181
+ url: '/api/users',
182
+ transform: (response) => response.data
183
+ })
184
+
185
+ // Configure table
186
+ const tableOptions = useTable({
187
+ repo: store,
188
+ options: {
189
+ isEnabledSearch: true
190
+ },
191
+ columns: () => [
192
+ {
193
+ accessorKey: 'name',
194
+ header: 'Name'
195
+ },
196
+ {
197
+ accessorKey: 'email',
198
+ header: 'Email',
199
+ type: COLUMN_TYPES.TEXT,
200
+ meta: { max: 30 }
201
+ },
202
+ {
203
+ accessorKey: 'avatar',
204
+ header: 'Avatar',
205
+ type: COLUMN_TYPES.IMAGE
206
+ },
207
+ {
208
+ accessorKey: 'createdAt',
209
+ header: 'Created',
210
+ type: COLUMN_TYPES.DATE_TIME
211
+ }
212
+ ]
213
+ })
214
+
215
+ // Load initial data
216
+ onMounted(() => {
217
+ store.fetchPage()
218
+ })
219
+
220
+ const refreshData = () => {
221
+ store.fetchPage()
222
+ }
223
+ </script>
224
+ ```
225
+
226
+ ### Dialog and Notification Example
227
+
228
+ ```vue
229
+ <template>
230
+ <div class="space-y-4">
231
+ <Button @click="showDialog">Show Dialog</Button>
232
+ <Button @click="showNotification">Show Notification</Button>
233
+ </div>
234
+ </template>
235
+
236
+ <script setup lang="ts">
237
+ const dialog = useDialog()
238
+ const notification = useNotification()
239
+
240
+ const showDialog = async () => {
241
+ const confirmed = await dialog.confirm({
242
+ title: 'Confirm Action',
243
+ description: 'Are you sure you want to proceed?',
244
+ confirmText: 'Yes, proceed',
245
+ cancelText: 'Cancel'
246
+ })
247
+
248
+ if (confirmed) {
249
+ notification.success({
250
+ title: 'Action Confirmed',
251
+ description: 'The action was completed successfully.'
252
+ })
253
+ }
254
+ }
255
+
256
+ const showNotification = () => {
257
+ notification.info({
258
+ title: 'Information',
259
+ description: 'This is an informational message.',
260
+ duration: 5000
261
+ })
262
+ }
263
+ </script>
264
+ ```
265
+
266
+ ## 🧩 Available Components
267
+
268
+ ### Form Components
269
+ - **Form** - Main form wrapper with validation
270
+ - **FormFields** - Dynamic field renderer
271
+ - **Input Types** - Text, Number, Select, Date, File Upload, WYSIWYG, and more
272
+
273
+ ### Data Display
274
+ - **Table** - Advanced data tables with sorting, pagination, and search
275
+ - **FlexDeck** - Flexible grid layouts with pagination
276
+ - **Image** - Optimized image component with loading states
277
+
278
+ ### Feedback
279
+ - **Dialog** - Modal dialogs for confirmations and alerts
280
+ - **Notification** - Toast notifications
281
+ - **Loader** - Loading indicators
282
+ - **Empty** - Empty state components
283
+
284
+ ### Layout
285
+ - **App** - Application wrapper with global configuration
286
+
287
+ ## 🔧 Available Composables
288
+
289
+ ### UI Composables
290
+ - **useDialog()** - Modal dialog management
291
+ - **useNotification()** - Toast notification system
292
+ - **useApp()** - Global app state management
293
+
294
+ ### Form Composables
295
+ - **useForm()** - Form state and validation (vee-validate)
296
+ - **createFormFields()** - Reactive field configuration
297
+ - **moveToError()** - Navigate to validation errors
298
+
299
+ ### Data Loading
300
+ - **usePageLoader()** - Server-side pagination and CRUD operations
301
+ - **useListLoader()** - Client-side list operations
302
+ - **useObjectLoader()** - Single object operations
303
+ - **useTable()** - Table configuration and state
304
+
305
+ ### Configuration
306
+ - **useCoreConfig()** - Access app configuration
307
+ - **useUiConfig()** - Theme configuration utilities
308
+
309
+ ## 🎨 Theming
310
+
311
+ The UI kit is built on top of @nuxt/ui and Tailwind CSS, providing extensive theming capabilities:
312
+
313
+ ```ts
314
+ // nuxt.config.ts
315
+ export default defineNuxtConfig({
316
+ modules: ['@finema/core'],
317
+
318
+ appConfig: {
319
+ core: {
320
+ site_name: 'My App',
321
+ color: '#3B82F6'
322
+ },
323
+ ui: {
324
+ colors: {
325
+ primary: 'blue',
326
+ secondary: 'gray'
327
+ }
328
+ }
329
+ }
330
+ })
331
+ ```
332
+
333
+ ## đŸ•šī¸ Playground
334
+
335
+ Explore live examples and experiment with components in the playground:
336
+
337
+ ```bash
338
+ # Clone the repository
339
+ git clone <repository-url>
340
+ cd ui-kit
341
+
342
+ # Install dependencies
343
+ bun install
344
+
345
+ # Run playground
346
+ bun run dev
347
+ ```
348
+
349
+ Visit the playground at different routes:
350
+ - `/` - Component overview
351
+ - `/form` - Form examples
352
+ - `/table` - Table examples
353
+ - `/dialog` - Dialog examples
354
+ - `/notification` - Notification examples
355
+
356
+ ## đŸ› ī¸ Development Scripts
357
+
358
+ ```bash
359
+ # Development
360
+ bun run dev # Run playground in development
361
+ bun run dev:build # Build playground
362
+ bun run dev:prepare # Prepare development environment
363
+
364
+ # Quality
365
+ bun run lint # Lint codebase
366
+ bun run lint:fix # Fix linting issues
367
+ bun run test # Run tests
368
+ bun run test:watch # Run tests in watch mode
369
+ bun run test:types # Type checking
370
+
371
+ # Release
372
+ bun run release # Create new release (lint, test, build, publish)
373
+ ```
374
+
375
+ ## 📚 Documentation
376
+
377
+ - [📖 Getting Started](./docs/getting-started.md) - Complete setup guide
378
+ - [📋 Form System](./docs/forms.md) - Comprehensive form building guide
379
+ - [📊 Table System](./docs/tables.md) - Advanced table features and patterns
380
+ - [🎨 Theming Guide](./docs/theming.md) - Customization and styling
381
+ - [🔧 API Reference](./docs/components/) - Detailed component documentation
382
+
383
+ ## 🤝 Contributing
384
+
385
+ We welcome contributions! Please see our contributing guidelines for details on:
386
+
387
+ - Code style and conventions
388
+ - Development workflow
389
+ - Testing requirements
390
+ - Pull request process
391
+
392
+ ## 📄 License
393
+
394
+ [MIT License](./LICENSE) - see the [LICENSE](./LICENSE) file for details.
395
+
396
+ ## đŸĸ About Finema
397
+
398
+ This UI kit is developed and maintained by the Finema Dev Core Team for building consistent, accessible, and beautiful user interfaces across all Finema projects.
399
+
400
+ <!--
401
+ Badge URLs - Keep these at the bottom of the file for better readability
402
+ -->
403
+ [bun-version-src]: https://img.shields.io/bun/v/@finema/core.svg
404
+ [bun-version-href]: https://npmjs.com/package/@finema/core
405
+ [bun-downloads-src]: https://img.shields.io/bun/dm/@finema/core.svg
406
+ [bun-downloads-href]: https://npmjs.com/package/@finema/core
407
+ [license-src]: https://img.shields.io/bun/l/@finema/core.svg
408
+ [license-href]: https://npmjs.com/package/@finema/core
409
+ [nuxt-src]: https://img.shields.io/badge/Nuxt-00DC82?logo=nuxt.js
410
+ [nuxt-href]: https://nuxt.com
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.29.0",
3
+ "version": "2.31.0",
4
4
  "configKey": "core",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
package/dist/module.mjs CHANGED
@@ -4,7 +4,7 @@ import * as lodash from 'lodash-es';
4
4
  import * as theme from '../dist/runtime/theme/index.js';
5
5
 
6
6
  const name = "@finema/core";
7
- const version = "2.29.0";
7
+ const version = "2.31.0";
8
8
 
9
9
  const nuxtAppOptions = {
10
10
  head: {
@@ -1,17 +1,17 @@
1
1
  <template>
2
- <FormField
3
- :label="label"
4
- :name="name"
5
- :description="description"
6
- :hint="hint"
7
- :data-testid="name"
8
- :help="help"
9
- :error="errorMessage"
10
- :required="!!required"
11
- :ui="containerUi"
12
- >
13
- <slot />
14
- </FormField>
2
+ <FormField
3
+ :label="label"
4
+ :name="name"
5
+ :description="description"
6
+ :hint="hint"
7
+ :data-testid="name"
8
+ :help="help"
9
+ :error="errorMessage"
10
+ :required="!!required"
11
+ :ui="containerUi"
12
+ >
13
+ <slot />
14
+ </FormField>
15
15
  </template>
16
16
 
17
17
  <script setup>
@@ -1,22 +1,22 @@
1
1
  <template>
2
- <div
2
+ <div
3
3
  :class="[theme.base({
4
4
  class: [$props.class, ui?.base]
5
- })]"
6
- >
7
- <component
8
- :is="componentMap[option.type]?.component"
9
- v-for="option in options.filter((item) => !item.isHide)"
10
- :key="option.props.name"
11
- :class="option.class"
12
- :form="form"
5
+ })]"
6
+ >
7
+ <component
8
+ :is="componentMap[option.type]?.component"
9
+ v-for="option in options.filter((item) => !item.isHide)"
10
+ :key="option.props.name"
11
+ :class="option.class"
12
+ :form="form"
13
13
  v-bind="{
14
14
  ...getFieldBinding(option),
15
15
  ...componentMap[option.type]?.props
16
- }"
17
- v-on="option.on ?? {}"
18
- />
19
- </div>
16
+ }"
17
+ v-on="option.on ?? {}"
18
+ />
19
+ </div>
20
20
  </template>
21
21
 
22
22
  <script setup>
@@ -29,8 +29,10 @@ import FormInputToggle from "./InputToggle/index.vue";
29
29
  import FormInputCheckbox from "./InputCheckbox/index.vue";
30
30
  import FormInputSelect from "./InputSelect/index.vue";
31
31
  import FormInputSelectMultiple from "./InputSelectMultiple/index.vue";
32
+ import FormInputComponent from "./InputComponent/index.vue";
32
33
  import FormInputRadio from "./InputRadio/index.vue";
33
34
  import FormInputDateTime from "./InputDateTime/index.vue";
35
+ import FormInputTime from "./InputTime/index.vue";
34
36
  import FormInputDateTimeRange from "./InputDateTimeRange/index.vue";
35
37
  import FormInputUploadDropzoneAuto from "./InputUploadDropzoneAuto/index.vue";
36
38
  import FormInputUploadDropzone from "./InputUploadDropzone/index.vue";
@@ -75,7 +77,10 @@ const componentMap = {
75
77
  props: {}
76
78
  },
77
79
  // For INPUT_TYPES.COMPONENT, it will use option.component directly from the template
78
- [INPUT_TYPES.COMPONENT]: void 0,
80
+ [INPUT_TYPES.COMPONENT]: {
81
+ component: FormInputComponent,
82
+ props: {}
83
+ },
79
84
  // Add other INPUT_TYPES here if they have dedicated components not covered by option.component
80
85
  [INPUT_TYPES.NUMBER]: {
81
86
  component: FormInputNumber,
@@ -103,6 +108,10 @@ const componentMap = {
103
108
  component: FormInputDateTime,
104
109
  props: {}
105
110
  },
111
+ [INPUT_TYPES.TIME]: {
112
+ component: FormInputTime,
113
+ props: {}
114
+ },
106
115
  [INPUT_TYPES.DATE]: {
107
116
  component: FormInputDateTime,
108
117
  props: {
@@ -1,22 +1,22 @@
1
1
  <template>
2
- <FieldWrapper
3
- v-bind="wrapperProps"
4
- label=""
5
- description=""
6
- >
7
- <Checkbox
8
- :model-value="value"
9
- :disabled="wrapperProps.disabled"
10
- :name="name"
11
- :label="label"
12
- :description="description"
13
- :required="required"
14
- :variant="variant"
15
- :indicator="indicator"
16
- :ui="ui"
17
- @update:modelValue="onChange"
18
- />
19
- </FieldWrapper>
2
+ <FieldWrapper
3
+ v-bind="wrapperProps"
4
+ label=""
5
+ description=""
6
+ >
7
+ <Checkbox
8
+ :model-value="value"
9
+ :disabled="wrapperProps.disabled"
10
+ :name="name"
11
+ :label="label"
12
+ :description="description"
13
+ :required="required"
14
+ :variant="variant"
15
+ :indicator="indicator"
16
+ :ui="ui"
17
+ @update:modelValue="onChange"
18
+ />
19
+ </FieldWrapper>
20
20
  </template>
21
21
 
22
22
  <script setup>
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <component :is="props.component" :value="value" v-bind="props"/>
3
+ </template>
4
+
5
+ <script setup>
6
+ const props = defineProps({
7
+ component: { type: null, required: true },
8
+ form: { type: Object, required: false },
9
+ name: { type: String, required: true },
10
+ errorMessage: { type: String, required: false },
11
+ label: { type: null, required: false },
12
+ description: { type: String, required: false },
13
+ hint: { type: String, required: false },
14
+ rules: { type: null, required: false },
15
+ autoFocus: { type: Boolean, required: false },
16
+ placeholder: { type: String, required: false },
17
+ disabled: { type: Boolean, required: false },
18
+ readonly: { type: Boolean, required: false },
19
+ required: { type: Boolean, required: false },
20
+ help: { type: String, required: false },
21
+ ui: { type: null, required: false }
22
+ });
23
+ </script>
@@ -0,0 +1,3 @@
1
+ import type { IComponentFieldProps } from '#core/components/Form/InputComponent/types';
2
+ declare const _default: import("vue").DefineComponent<IComponentFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IComponentFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import type { IFieldProps, IFormFieldBase, INPUT_TYPES } from '#core/components/Form/types';
2
+ import type { DefineComponent } from 'vue';
3
+ export interface IComponentFieldProps extends IFieldProps {
4
+ component: string | DefineComponent | any;
5
+ }
6
+ export type IComponentField = IFormFieldBase<INPUT_TYPES.COMPONENT, IComponentFieldProps, {}>;