@codemonster-ru/vueforge 0.58.0 → 0.60.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.
- package/README.md +122 -2
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.ts.mjs +4030 -3748
- package/dist/index.ts.umd.js +3 -3
- package/dist/package/components/__tests__/form.test.d.ts +1 -0
- package/dist/package/components/__tests__/input-group.test.d.ts +1 -0
- package/dist/package/components/accordion.vue.d.ts +1 -1
- package/dist/package/components/file-upload.vue.d.ts +1 -1
- package/dist/package/components/filter-chips.vue.d.ts +1 -1
- package/dist/package/components/form.vue.d.ts +79 -0
- package/dist/package/components/input-addon.vue.d.ts +22 -0
- package/dist/package/components/input-group.vue.d.ts +28 -0
- package/dist/package/components/radio-group.vue.d.ts +1 -1
- package/dist/package/components/segmented-control.vue.d.ts +1 -1
- package/dist/package/components/tree.vue.d.ts +1 -1
- package/dist/package/config/theme-core.d.ts +28 -0
- package/dist/package/themes/default/components/form-field.d.ts +2 -0
- package/dist/package/themes/default/components/form.d.ts +6 -0
- package/dist/package/themes/default/components/input-group.d.ts +20 -0
- package/dist/package/themes/default/index.d.ts +26 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,8 @@ import {
|
|
|
27
27
|
DefaultTheme,
|
|
28
28
|
Button,
|
|
29
29
|
Input,
|
|
30
|
+
InputGroup,
|
|
31
|
+
InputAddon,
|
|
30
32
|
InlineEdit,
|
|
31
33
|
SearchInput,
|
|
32
34
|
MentionInput,
|
|
@@ -35,6 +37,7 @@ import {
|
|
|
35
37
|
ColorPicker,
|
|
36
38
|
MaskedInput,
|
|
37
39
|
NumberInput,
|
|
40
|
+
Form,
|
|
38
41
|
FormField,
|
|
39
42
|
Textarea,
|
|
40
43
|
FileUpload,
|
|
@@ -89,9 +92,28 @@ app.use(VueForge, {
|
|
|
89
92
|
|
|
90
93
|
```vue
|
|
91
94
|
<Button label="Hello" severity="primary" />
|
|
95
|
+
<Form v-model="formValues" :validate="validateForm" @submit="onSubmit">
|
|
96
|
+
<template #default="{ values, errors, touched, setFieldValue, setFieldTouched }">
|
|
97
|
+
<FormField label="Email" :error="touched.email ? errors.email : ''">
|
|
98
|
+
<template #default>
|
|
99
|
+
<Input
|
|
100
|
+
:model-value="String(values.email ?? '')"
|
|
101
|
+
@update:model-value="value => setFieldValue('email', value)"
|
|
102
|
+
@blur="() => setFieldTouched('email', true)"
|
|
103
|
+
/>
|
|
104
|
+
</template>
|
|
105
|
+
</FormField>
|
|
106
|
+
<Button type="submit" label="Submit" />
|
|
107
|
+
</template>
|
|
108
|
+
</Form>
|
|
92
109
|
<FormField label="Name" hint="Required field">
|
|
93
110
|
<Input v-model="name" placeholder="Your name" />
|
|
94
111
|
</FormField>
|
|
112
|
+
<InputGroup>
|
|
113
|
+
<InputAddon>$</InputAddon>
|
|
114
|
+
<NumberInput v-model="price" :min="0" :step="0.5" />
|
|
115
|
+
<InputAddon>.00</InputAddon>
|
|
116
|
+
</InputGroup>
|
|
95
117
|
<InlineEdit v-model="name" placeholder="No name" />
|
|
96
118
|
<SearchInput v-model="query" placeholder="Search components" clearable />
|
|
97
119
|
<MentionInput v-model="message" :suggestions="mentionSuggestions" placeholder="Type @name" />
|
|
@@ -210,6 +232,8 @@ app.use(VueForge, {
|
|
|
210
232
|
- ToastContainer
|
|
211
233
|
- Alert
|
|
212
234
|
- Input
|
|
235
|
+
- InputGroup
|
|
236
|
+
- InputAddon
|
|
213
237
|
- InlineEdit
|
|
214
238
|
- SearchInput
|
|
215
239
|
- MentionInput
|
|
@@ -218,6 +242,7 @@ app.use(VueForge, {
|
|
|
218
242
|
- ColorPicker
|
|
219
243
|
- MaskedInput
|
|
220
244
|
- NumberInput
|
|
245
|
+
- Form
|
|
221
246
|
- FormField
|
|
222
247
|
- Textarea
|
|
223
248
|
- FileUpload
|
|
@@ -260,9 +285,10 @@ app.use(VueForge, {
|
|
|
260
285
|
- TreeSelect
|
|
261
286
|
- VirtualScroller
|
|
262
287
|
|
|
263
|
-
Input / Search / Password / Textarea (quick API):
|
|
288
|
+
Input / InputGroup / Search / Password / Textarea (quick API):
|
|
264
289
|
|
|
265
290
|
- `Input`: single-line control, supports `v-model`, `size`, `variant`, `disabled`, `readonly`.
|
|
291
|
+
- `InputGroup`: horizontal control combiner for field/addon/button layouts with unified corners and borders.
|
|
266
292
|
- `InlineEdit`: inline value editing with view/edit states, save/cancel actions, and text/number modes.
|
|
267
293
|
- `SearchInput`: search-focused control with `debounce`, `clearable`, `loading`, `size`, and `variant`.
|
|
268
294
|
- `MentionInput`: text input with `@`/`#` triggers, suggestions panel, keyboard selection, and mention insertion events.
|
|
@@ -276,6 +302,60 @@ Input / Search / Password / Textarea (quick API):
|
|
|
276
302
|
- `FilterChips`: compact chip-based filter toggles with single/multiple selection modes and optional clear action.
|
|
277
303
|
- `SearchInput`, `MentionInput`, `InlineEdit`, `OtpInput`, `ColorPicker`, `MaskedInput`, `Checkbox`, `Select`, `Autocomplete`, `MultiSelect`, `TagInput`, `DatePicker`, `Calendar`, `DateRangePicker`, `DateTimePicker`, `Pagination`, `DataTable`, `SegmentedControl`, and `TreeSelect` also support `variant: 'filled' | 'outlined'`.
|
|
278
304
|
|
|
305
|
+
## Form
|
|
306
|
+
|
|
307
|
+
Props:
|
|
308
|
+
|
|
309
|
+
- `modelValue?: Record<string, unknown>` (v-model)
|
|
310
|
+
- `initialValues?: Record<string, unknown>`
|
|
311
|
+
- `validate?: (values) => Record<string, string> | string | boolean | null | Promise<...>`
|
|
312
|
+
- `validateOn?: 'submit' | 'input' | 'change' | 'blur' | Array<'submit' | 'input' | 'change' | 'blur'>` (default `submit`)
|
|
313
|
+
- `disabled?: boolean`
|
|
314
|
+
- `novalidate?: boolean` (default `true`)
|
|
315
|
+
- `id?: string`
|
|
316
|
+
- `ariaLabel?: string`
|
|
317
|
+
- `ariaLabelledby?: string`
|
|
318
|
+
|
|
319
|
+
Events:
|
|
320
|
+
|
|
321
|
+
- `update:modelValue`
|
|
322
|
+
- `change`
|
|
323
|
+
- `blur`
|
|
324
|
+
- `validate`
|
|
325
|
+
- `submit`
|
|
326
|
+
- `invalidSubmit`
|
|
327
|
+
- `reset`
|
|
328
|
+
|
|
329
|
+
Slots:
|
|
330
|
+
|
|
331
|
+
- `default` - form helpers:
|
|
332
|
+
`{ values, errors, touched, isValid, isDirty, isSubmitting, setFieldValue, setFieldTouched, setFieldError, validate, submit, reset }`
|
|
333
|
+
|
|
334
|
+
Example:
|
|
335
|
+
|
|
336
|
+
```vue
|
|
337
|
+
<Form v-model="values" :validate="validateForm" validate-on="blur" @submit="send">
|
|
338
|
+
<template #default="{ values, errors, touched, setFieldValue, setFieldTouched }">
|
|
339
|
+
<FormField label="Email" :error="touched.email ? errors.email : ''">
|
|
340
|
+
<template #default>
|
|
341
|
+
<Input
|
|
342
|
+
:model-value="String(values.email ?? '')"
|
|
343
|
+
@update:model-value="value => setFieldValue('email', value)"
|
|
344
|
+
@blur="() => setFieldTouched('email', true)"
|
|
345
|
+
/>
|
|
346
|
+
</template>
|
|
347
|
+
</FormField>
|
|
348
|
+
<Button type="submit" label="Send" />
|
|
349
|
+
</template>
|
|
350
|
+
</Form>
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Form tokens
|
|
354
|
+
|
|
355
|
+
Component tokens (override via `theme.overrides.components.form`):
|
|
356
|
+
|
|
357
|
+
- `gap`, `textColor`, `disabledOpacity`
|
|
358
|
+
|
|
279
359
|
## FormField
|
|
280
360
|
|
|
281
361
|
Props:
|
|
@@ -305,6 +385,46 @@ Example:
|
|
|
305
385
|
</FormField>
|
|
306
386
|
```
|
|
307
387
|
|
|
388
|
+
When `error` is set, `FormField` applies invalid-state border highlighting to nested form controls.
|
|
389
|
+
Customize these colors via `theme.overrides.components.formField.errorBorderColor` and `errorFocusBorderColor`.
|
|
390
|
+
|
|
391
|
+
## InputGroup / InputAddon
|
|
392
|
+
|
|
393
|
+
Props (`InputGroup`):
|
|
394
|
+
|
|
395
|
+
- `size?: 'small' | 'normal' | 'large'` (default `normal`)
|
|
396
|
+
- `variant?: 'filled' | 'outlined'` (default `filled`)
|
|
397
|
+
- `disabled?: boolean` (default `false`)
|
|
398
|
+
|
|
399
|
+
Props (`InputAddon`):
|
|
400
|
+
|
|
401
|
+
- `as?: string` (default `span`)
|
|
402
|
+
|
|
403
|
+
Slots:
|
|
404
|
+
|
|
405
|
+
- `default` - group controls/addons content
|
|
406
|
+
|
|
407
|
+
Example:
|
|
408
|
+
|
|
409
|
+
```vue
|
|
410
|
+
<InputGroup>
|
|
411
|
+
<InputAddon>$</InputAddon>
|
|
412
|
+
<NumberInput v-model="price" :min="0" :step="0.5" />
|
|
413
|
+
<Button label="Apply" />
|
|
414
|
+
</InputGroup>
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### InputGroup tokens
|
|
418
|
+
|
|
419
|
+
Component tokens (override via `theme.overrides.components.inputGroup`):
|
|
420
|
+
|
|
421
|
+
- `gap`, `borderRadius`
|
|
422
|
+
- `addonPadding`, `addonFontSize`
|
|
423
|
+
- `addonBackgroundColor`, `addonOutlinedBackgroundColor`
|
|
424
|
+
- `addonTextColor`, `addonBorderColor`, `disabledOpacity`
|
|
425
|
+
- `small.addonPadding`, `small.addonFontSize`
|
|
426
|
+
- `large.addonPadding`, `large.addonFontSize`
|
|
427
|
+
|
|
308
428
|
## InlineEdit
|
|
309
429
|
|
|
310
430
|
Props:
|
|
@@ -2439,7 +2559,7 @@ VueForge exposes design tokens as CSS variables generated from the theme preset.
|
|
|
2439
2559
|
Typed tokens:
|
|
2440
2560
|
|
|
2441
2561
|
- `ThemeTokens`/`ThemeOptions`/`ThemePreset` are exported for type-safe theming in TS.
|
|
2442
|
-
- `components.*` accepts component-specific tokens (typed keys: button/card/checkbox/radio/tabs/accordion/toast/alert/input/inlineEdit/searchInput/mentionInput/passwordInput/otpInput/colorPicker/maskedInput/numberInput/formField/textarea/link/breadcrumbs/menu/modal/confirmDialog/drawer/popover/dropdown/contextMenu/commandPalette/select/autocomplete/combobox/multiselect/taginput/datepicker/calendar/daterangepicker/timepicker/datetimepicker/pagination/switch/segmentedControl/tooltip/skeleton/progress/badge/chip/filterChips/avatar/datatable/slider/stepper/rating/tree/treeselect/virtualScroller).
|
|
2562
|
+
- `components.*` accepts component-specific tokens (typed keys: button/card/checkbox/radio/tabs/accordion/toast/alert/input/inputGroup/inlineEdit/searchInput/mentionInput/passwordInput/otpInput/colorPicker/maskedInput/numberInput/form/formField/textarea/link/breadcrumbs/menu/modal/confirmDialog/drawer/popover/dropdown/contextMenu/commandPalette/select/autocomplete/combobox/multiselect/taginput/datepicker/calendar/daterangepicker/timepicker/datetimepicker/pagination/switch/segmentedControl/tooltip/skeleton/progress/badge/chip/filterChips/avatar/datatable/slider/stepper/rating/tree/treeselect/virtualScroller).
|
|
2443
2563
|
|
|
2444
2564
|
Default core values (from `DefaultTheme`):
|
|
2445
2565
|
|