@finema/core 2.30.0 â 2.31.1
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/README.md +377 -46
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Form/Fields.vue +5 -1
- package/dist/runtime/components/Form/InputComponent/index.vue +23 -0
- package/dist/runtime/components/Form/InputComponent/index.vue.d.ts +3 -0
- package/dist/runtime/components/Form/InputComponent/types.d.ts +6 -0
- package/dist/runtime/components/Form/InputComponent/types.js +0 -0
- package/dist/runtime/components/Form/types.d.ts +2 -1
- package/dist/runtime/helpers/apiPageHelper.js +0 -3
- package/package.json +1 -1
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
|
-
-->
|
|
1
|
+
# @finema/core
|
|
9
2
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
[![npm version][npm-version-src]][npm-version-href]
|
|
13
|
-
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
3
|
+
[![bun version][bun-version-src]][bun-version-href]
|
|
4
|
+
[![bun downloads][bun-downloads-src]][bun-downloads-href]
|
|
14
5
|
[![License][license-src]][license-href]
|
|
15
6
|
[![Nuxt][nuxt-src]][nuxt-href]
|
|
16
7
|
|
|
17
|
-
|
|
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.
|
|
18
11
|
|
|
19
|
-
|
|
20
|
-
- [đ Storybook](https://your-storybook-url.com) <!-- Add a link to your Storybook -->
|
|
21
|
-
- [đšī¸ Playground](#playground)
|
|
12
|
+
## ⨠Features
|
|
22
13
|
|
|
23
|
-
|
|
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
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
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
|
|
30
32
|
|
|
31
33
|
## đ Installation
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
### Prerequisites
|
|
36
|
+
- **Nuxt 3** (Vue 3, Vite)
|
|
37
|
+
- **Node.js 22+** (recommended)
|
|
38
|
+
|
|
39
|
+
### Install Package
|
|
34
40
|
|
|
35
41
|
```bash
|
|
36
|
-
|
|
42
|
+
# bun
|
|
43
|
+
bun install @finema/core
|
|
44
|
+
|
|
45
|
+
# yarn
|
|
46
|
+
yarn add @finema/core
|
|
47
|
+
|
|
48
|
+
# pnpm
|
|
49
|
+
pnpm add @finema/core
|
|
37
50
|
```
|
|
38
51
|
|
|
39
|
-
|
|
52
|
+
### Setup Module
|
|
40
53
|
|
|
41
|
-
|
|
42
|
-
|
|
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
|
+
})
|
|
43
63
|
```
|
|
44
64
|
|
|
45
|
-
|
|
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>
|
|
46
235
|
|
|
47
|
-
|
|
236
|
+
<script setup lang="ts">
|
|
237
|
+
const dialog = useDialog()
|
|
238
|
+
const notification = useNotification()
|
|
48
239
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
+
```
|
|
55
332
|
|
|
56
333
|
## đšī¸ Playground
|
|
57
334
|
|
|
58
|
-
|
|
335
|
+
Explore live examples and experiment with components in the playground:
|
|
59
336
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
|
64
382
|
|
|
65
383
|
## đ¤ Contributing
|
|
66
384
|
|
|
67
|
-
|
|
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.
|
|
68
399
|
|
|
69
400
|
<!--
|
|
70
401
|
Badge URLs - Keep these at the bottom of the file for better readability
|
|
71
402
|
-->
|
|
72
|
-
[
|
|
73
|
-
[
|
|
74
|
-
[
|
|
75
|
-
[
|
|
76
|
-
[license-src]: https://img.shields.io/
|
|
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
|
|
77
408
|
[license-href]: https://npmjs.com/package/@finema/core
|
|
78
409
|
[nuxt-src]: https://img.shields.io/badge/Nuxt-00DC82?logo=nuxt.js
|
|
79
410
|
[nuxt-href]: https://nuxt.com
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -29,6 +29,7 @@ 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";
|
|
34
35
|
import FormInputTime from "./InputTime/index.vue";
|
|
@@ -76,7 +77,10 @@ const componentMap = {
|
|
|
76
77
|
props: {}
|
|
77
78
|
},
|
|
78
79
|
// For INPUT_TYPES.COMPONENT, it will use option.component directly from the template
|
|
79
|
-
[INPUT_TYPES.COMPONENT]:
|
|
80
|
+
[INPUT_TYPES.COMPONENT]: {
|
|
81
|
+
component: FormInputComponent,
|
|
82
|
+
props: {}
|
|
83
|
+
},
|
|
80
84
|
// Add other INPUT_TYPES here if they have dedicated components not covered by option.component
|
|
81
85
|
[INPUT_TYPES.NUMBER]: {
|
|
82
86
|
component: FormInputNumber,
|
|
@@ -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, {}>;
|
|
File without changes
|
|
@@ -15,6 +15,7 @@ import type { IDateTimeField } from '#core/components/Form/InputDateTime/date_ti
|
|
|
15
15
|
import type { ITimeField } from '#core/components/Form/InputTime/types';
|
|
16
16
|
import type { IRadioField } from '#core/components/Form/InputRadio/types';
|
|
17
17
|
import type { IWYSIWYGField } from '#core/components/Form/InputWYSIWYG/types';
|
|
18
|
+
import type { IComponentField } from '#core/components/Form/InputComponent/types';
|
|
18
19
|
export declare enum INPUT_TYPES {
|
|
19
20
|
TEXT = "TEXT",
|
|
20
21
|
SEARCH = "SEARCH",
|
|
@@ -69,7 +70,7 @@ export interface IFormFieldBase<I extends INPUT_TYPES, P extends IFieldProps, O>
|
|
|
69
70
|
props: P;
|
|
70
71
|
on?: O;
|
|
71
72
|
}
|
|
72
|
-
export type IFormField = ITextField | ISearchField | INumberField | ITextareaField | IToggleField | ISelectField | ICheckboxField | ISelectMultipleField | IRadioField | IDateTimeField | ITimeField | IDateTimeRangeField | IUploadDropzoneField | IUploadDropzoneAutoField | IWYSIWYGField | IFormFieldBase<INPUT_TYPES.COMPONENT, any, any>;
|
|
73
|
+
export type IFormField = ITextField | ISearchField | INumberField | ITextareaField | IToggleField | ISelectField | ICheckboxField | ISelectMultipleField | IRadioField | IDateTimeField | ITimeField | IDateTimeRangeField | IUploadDropzoneField | IUploadDropzoneAutoField | IWYSIWYGField | IComponentField | IFormFieldBase<INPUT_TYPES.COMPONENT, any, any>;
|
|
73
74
|
export interface IFileValue {
|
|
74
75
|
url: string;
|
|
75
76
|
path?: string;
|
|
@@ -28,9 +28,6 @@ export const apiAddHelper = async (state, onUpdateStatus, onUpdateOptions, onUpd
|
|
|
28
28
|
{
|
|
29
29
|
onSuccess: (item, status) => {
|
|
30
30
|
onUpdateData(item);
|
|
31
|
-
if (state().items) {
|
|
32
|
-
onUpdateItems([item, ...state().items]);
|
|
33
|
-
}
|
|
34
31
|
onUpdateStatus(updateLoaderState.setSuccess(state().status));
|
|
35
32
|
onUpdateOptions({
|
|
36
33
|
_timestamp: Date.now(),
|