@hinen/pro-element-plus 1.7.17 → 1.8.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/dist/components/DataTable/DataTable.vue.d.ts +24 -6
- package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/components/DataTable/props.d.ts +11 -2
- package/dist/components/DataTable/props.d.ts.map +1 -1
- package/dist/components/DataTable/types.d.ts +14 -1
- package/dist/components/DataTable/types.d.ts.map +1 -1
- package/dist/components/DataTable/useDataTable.d.ts.map +1 -1
- package/dist/components/FormFields/FormCascadeSelect/FormCascadeSelect.test.d.ts +2 -0
- package/dist/components/FormFields/FormCascadeSelect/FormCascadeSelect.test.d.ts.map +1 -0
- package/dist/components/FormFields/FormCascadeSelect/FormCascadeSelect.vue.d.ts +136 -146
- package/dist/components/FormFields/FormCascadeSelect/FormCascadeSelect.vue.d.ts.map +1 -1
- package/dist/components/FormFields/FormCascadeSelect/props.d.ts +112 -114
- package/dist/components/FormFields/FormCascadeSelect/props.d.ts.map +1 -1
- package/dist/components/FormFields/FormCascadeSelect/types.d.ts +24 -1
- package/dist/components/FormFields/FormCascadeSelect/types.d.ts.map +1 -1
- package/dist/components/FormFields/FormTagInput/FormTagInput.vue.d.ts.map +1 -1
- package/dist/components/FormFields/FormTreeSelect/props.d.ts +3 -1
- package/dist/components/FormFields/FormTreeSelect/props.d.ts.map +1 -1
- package/dist/index.cjs +14 -14
- package/dist/index.js +2613 -2203
- package/dist/skills/building-form-workflows/SKILL.md +77 -0
- package/dist/skills/building-form-workflows/references/examples.md +47 -0
- package/dist/skills/building-form-workflows/references/field-selection.md +16 -0
- package/dist/skills/building-form-workflows/references/gotchas.md +10 -0
- package/dist/skills/building-form-workflows/references/workflow.md +21 -0
- package/dist/skills/building-modal-workflows/SKILL.md +79 -0
- package/dist/skills/building-modal-workflows/references/examples.md +104 -0
- package/dist/skills/building-modal-workflows/references/gotchas.md +19 -0
- package/dist/skills/building-modal-workflows/references/workflow.md +17 -0
- package/dist/skills/building-query-pages/SKILL.md +81 -0
- package/dist/skills/building-query-pages/references/examples.md +64 -0
- package/dist/skills/building-query-pages/references/field-selection.md +24 -0
- package/dist/skills/building-query-pages/references/gotchas.md +10 -0
- package/dist/skills/building-query-pages/references/workflow.md +22 -0
- package/dist/skills/building-selection-inputs/SKILL.md +85 -0
- package/dist/skills/building-selection-inputs/references/examples.md +87 -0
- package/dist/skills/building-selection-inputs/references/gotchas.md +19 -0
- package/dist/skills/building-selection-inputs/references/selection-guide.md +47 -0
- package/dist/skills/choosing-components/SKILL.md +78 -0
- package/dist/skills/choosing-components/references/component-groups.md +37 -0
- package/dist/skills/choosing-components/references/examples.md +91 -0
- package/dist/skills/choosing-components/references/gotchas.md +10 -0
- package/dist/skills/choosing-components/references/selection-guide.md +40 -0
- package/dist/skills/optimizing-component-skills/REVIEW.md +775 -0
- package/dist/skills/using-checkbox-group/SKILL.md +91 -0
- package/dist/skills/using-checkbox-group/references/examples.md +55 -0
- package/dist/skills/using-checkbox-group/references/gotchas.md +13 -0
- package/dist/skills/using-checkbox-group/references/props.md +83 -0
- package/dist/skills/using-config-provider/SKILL.md +96 -0
- package/dist/skills/using-config-provider/references/examples.md +38 -0
- package/dist/skills/using-config-provider/references/gotchas.md +13 -0
- package/dist/skills/using-config-provider/references/props.md +38 -0
- package/dist/skills/using-data-select/SKILL.md +127 -0
- package/dist/skills/using-data-select/references/examples.md +67 -0
- package/dist/skills/using-data-select/references/gotchas.md +19 -0
- package/dist/skills/using-data-select/references/props.md +126 -0
- package/dist/skills/using-data-table/SKILL.md +289 -0
- package/dist/skills/using-data-table/references/examples.md +347 -0
- package/dist/skills/using-data-table/references/gotchas.md +114 -0
- package/dist/skills/using-data-table/references/props.md +375 -0
- package/dist/skills/using-drawer/SKILL.md +104 -0
- package/dist/skills/using-drawer/references/examples.md +109 -0
- package/dist/skills/using-drawer/references/gotchas.md +16 -0
- package/dist/skills/using-drawer/references/props.md +105 -0
- package/dist/skills/using-ellipsis-text/SKILL.md +105 -0
- package/dist/skills/using-ellipsis-text/references/examples.md +71 -0
- package/dist/skills/using-ellipsis-text/references/gotchas.md +19 -0
- package/dist/skills/using-ellipsis-text/references/props.md +97 -0
- package/dist/skills/using-form-autocomplete/SKILL.md +87 -0
- package/dist/skills/using-form-autocomplete/references/examples.md +62 -0
- package/dist/skills/using-form-autocomplete/references/gotchas.md +13 -0
- package/dist/skills/using-form-autocomplete/references/props.md +100 -0
- package/dist/skills/using-form-cascade-select/SKILL.md +82 -0
- package/dist/skills/using-form-cascade-select/references/examples.md +59 -0
- package/dist/skills/using-form-cascade-select/references/gotchas.md +13 -0
- package/dist/skills/using-form-cascade-select/references/props.md +138 -0
- package/dist/skills/using-form-checkbox-group/SKILL.md +83 -0
- package/dist/skills/using-form-checkbox-group/references/examples.md +61 -0
- package/dist/skills/using-form-checkbox-group/references/gotchas.md +13 -0
- package/dist/skills/using-form-checkbox-group/references/props.md +85 -0
- package/dist/skills/using-form-date-picker/SKILL.md +79 -0
- package/dist/skills/using-form-date-picker/references/examples.md +54 -0
- package/dist/skills/using-form-date-picker/references/gotchas.md +10 -0
- package/dist/skills/using-form-date-picker/references/props.md +99 -0
- package/dist/skills/using-form-fields/SKILL.md +101 -0
- package/dist/skills/using-form-fields/references/examples.md +45 -0
- package/dist/skills/using-form-fields/references/gotchas.md +6 -0
- package/dist/skills/using-form-fields/references/props.md +57 -0
- package/dist/skills/using-form-item/SKILL.md +92 -0
- package/dist/skills/using-form-item/references/examples.md +59 -0
- package/dist/skills/using-form-item/references/gotchas.md +13 -0
- package/dist/skills/using-form-item/references/props.md +85 -0
- package/dist/skills/using-form-number/SKILL.md +82 -0
- package/dist/skills/using-form-number/references/examples.md +66 -0
- package/dist/skills/using-form-number/references/gotchas.md +13 -0
- package/dist/skills/using-form-number/references/props.md +82 -0
- package/dist/skills/using-form-radio-group/SKILL.md +83 -0
- package/dist/skills/using-form-radio-group/references/examples.md +53 -0
- package/dist/skills/using-form-radio-group/references/gotchas.md +13 -0
- package/dist/skills/using-form-radio-group/references/props.md +81 -0
- package/dist/skills/using-form-rate/SKILL.md +86 -0
- package/dist/skills/using-form-rate/references/examples.md +60 -0
- package/dist/skills/using-form-rate/references/gotchas.md +16 -0
- package/dist/skills/using-form-rate/references/props.md +88 -0
- package/dist/skills/using-form-select/SKILL.md +94 -0
- package/dist/skills/using-form-select/references/examples.md +67 -0
- package/dist/skills/using-form-select/references/gotchas.md +13 -0
- package/dist/skills/using-form-select/references/props.md +87 -0
- package/dist/skills/using-form-switch/SKILL.md +81 -0
- package/dist/skills/using-form-switch/references/examples.md +54 -0
- package/dist/skills/using-form-switch/references/gotchas.md +10 -0
- package/dist/skills/using-form-switch/references/props.md +83 -0
- package/dist/skills/using-form-tag-input/SKILL.md +83 -0
- package/dist/skills/using-form-tag-input/references/examples.md +53 -0
- package/dist/skills/using-form-tag-input/references/gotchas.md +13 -0
- package/dist/skills/using-form-tag-input/references/props.md +80 -0
- package/dist/skills/using-form-text/SKILL.md +82 -0
- package/dist/skills/using-form-text/references/examples.md +66 -0
- package/dist/skills/using-form-text/references/gotchas.md +13 -0
- package/dist/skills/using-form-text/references/props.md +98 -0
- package/dist/skills/using-form-time-picker/SKILL.md +78 -0
- package/dist/skills/using-form-time-picker/references/examples.md +53 -0
- package/dist/skills/using-form-time-picker/references/gotchas.md +10 -0
- package/dist/skills/using-form-time-picker/references/props.md +89 -0
- package/dist/skills/using-form-tree-select/SKILL.md +82 -0
- package/dist/skills/using-form-tree-select/references/examples.md +55 -0
- package/dist/skills/using-form-tree-select/references/gotchas.md +13 -0
- package/dist/skills/using-form-tree-select/references/props.md +86 -0
- package/dist/skills/using-image/SKILL.md +88 -0
- package/dist/skills/using-image/references/examples.md +31 -0
- package/dist/skills/using-image/references/gotchas.md +13 -0
- package/dist/skills/using-image/references/props.md +91 -0
- package/dist/skills/using-modal/SKILL.md +113 -0
- package/dist/skills/using-modal/references/examples.md +122 -0
- package/dist/skills/using-modal/references/gotchas.md +16 -0
- package/dist/skills/using-modal/references/props.md +100 -0
- package/dist/skills/using-query-form/SKILL.md +134 -0
- package/dist/skills/using-query-form/references/examples.md +103 -0
- package/dist/skills/using-query-form/references/gotchas.md +19 -0
- package/dist/skills/using-query-form/references/props.md +146 -0
- package/dist/skills/using-radio-group/SKILL.md +91 -0
- package/dist/skills/using-radio-group/references/examples.md +55 -0
- package/dist/skills/using-radio-group/references/gotchas.md +13 -0
- package/dist/skills/using-radio-group/references/props.md +83 -0
- package/dist/skills/using-select/SKILL.md +93 -0
- package/dist/skills/using-select/references/examples.md +50 -0
- package/dist/skills/using-select/references/gotchas.md +13 -0
- package/dist/skills/using-select/references/props.md +90 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# FormNumber props
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
`FormNumber` combines `FormItem` props with Element Plus input-number props.
|
|
6
|
+
|
|
7
|
+
Use it when numeric-control semantics should stay inside the standard form-wrapper family.
|
|
8
|
+
|
|
9
|
+
## Minimum setup
|
|
10
|
+
|
|
11
|
+
Typical useful props:
|
|
12
|
+
|
|
13
|
+
- `label`
|
|
14
|
+
- `prop`
|
|
15
|
+
- `modelValue`
|
|
16
|
+
|
|
17
|
+
Numeric-control props often worth deciding early:
|
|
18
|
+
|
|
19
|
+
- `min`
|
|
20
|
+
- `max`
|
|
21
|
+
- `step`
|
|
22
|
+
- `precision`
|
|
23
|
+
|
|
24
|
+
## Core props
|
|
25
|
+
|
|
26
|
+
### Wrapper props from `FormItem`
|
|
27
|
+
|
|
28
|
+
Includes wrapper-level props such as:
|
|
29
|
+
|
|
30
|
+
- `label`
|
|
31
|
+
- `prop`
|
|
32
|
+
- `rules`
|
|
33
|
+
- `required`
|
|
34
|
+
- `tooltip`
|
|
35
|
+
|
|
36
|
+
### Numeric-field props from `ElInputNumber`
|
|
37
|
+
|
|
38
|
+
Commonly useful field props include:
|
|
39
|
+
|
|
40
|
+
- `modelValue`
|
|
41
|
+
- `min`
|
|
42
|
+
- `max`
|
|
43
|
+
- `step`
|
|
44
|
+
- `precision`
|
|
45
|
+
- `disabled`
|
|
46
|
+
- `size`
|
|
47
|
+
|
|
48
|
+
These are the props that usually determine whether this wrapper is the correct abstraction.
|
|
49
|
+
|
|
50
|
+
## Slots
|
|
51
|
+
|
|
52
|
+
The wrapper supports both wrapper-level and numeric-field slots.
|
|
53
|
+
|
|
54
|
+
Most important wrapper slots remain:
|
|
55
|
+
|
|
56
|
+
- `label`
|
|
57
|
+
- `error`
|
|
58
|
+
|
|
59
|
+
## Instance API
|
|
60
|
+
|
|
61
|
+
The exposed instance combines:
|
|
62
|
+
|
|
63
|
+
- `formItem`
|
|
64
|
+
- `field`
|
|
65
|
+
|
|
66
|
+
Use this when parent code needs wrapper validation methods and direct access to the numeric input instance.
|
|
67
|
+
|
|
68
|
+
## Events
|
|
69
|
+
|
|
70
|
+
Important events include:
|
|
71
|
+
|
|
72
|
+
- `update:modelValue`
|
|
73
|
+
- `change`
|
|
74
|
+
- `input`
|
|
75
|
+
- `focus`
|
|
76
|
+
- `blur`
|
|
77
|
+
|
|
78
|
+
## Import
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import { FormNumber } from '@hinen/pro-element-plus';
|
|
82
|
+
```
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-form-radio-group
|
|
3
|
+
description: Use when a wrapped field should combine FormItem semantics with single-choice radio-group behavior inside the Form* wrapper family.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Using FormRadioGroup
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Use `FormRadioGroup` for a **single-choice wrapped field** that combines `FormItem` behavior with the package’s `RadioGroup` abstraction.
|
|
11
|
+
|
|
12
|
+
It fits fields where the user should pick exactly one option from a fixed set while staying inside the shared form-wrapper family.
|
|
13
|
+
|
|
14
|
+
## Use it when
|
|
15
|
+
|
|
16
|
+
- a schema-driven field should expose one-of-many choice behavior
|
|
17
|
+
- you want radio-group options plus built-in form labels, rules, and tooltip support
|
|
18
|
+
- options can come from `options` or lightweight `valueEnum` mappings
|
|
19
|
+
- the field should expose both `formItem` and radio-group `field` refs together
|
|
20
|
+
|
|
21
|
+
## Prefer something else when
|
|
22
|
+
|
|
23
|
+
- you need the raw radio-group component outside FormFields
|
|
24
|
+
→ use `../using-radio-group/SKILL.md`
|
|
25
|
+
- the field should allow multiple checked values
|
|
26
|
+
→ use `../using-form-checkbox-group/SKILL.md`
|
|
27
|
+
- the field is really a binary toggle
|
|
28
|
+
→ use `../using-form-switch/SKILL.md`
|
|
29
|
+
|
|
30
|
+
## Decision guide
|
|
31
|
+
|
|
32
|
+
Use `FormRadioGroup` if the answer is yes for **two or more** of these:
|
|
33
|
+
|
|
34
|
+
- Should the user choose exactly one option from a fixed set?
|
|
35
|
+
- Is the option set local enough for `options` or `valueEnum`?
|
|
36
|
+
- Should the field stay inside the shared form-wrapper family?
|
|
37
|
+
- Do you want wrapper validation access and radio-group instance access together?
|
|
38
|
+
|
|
39
|
+
If not, `FormCheckboxGroup`, `FormSwitch`, or another wrapper may fit better.
|
|
40
|
+
|
|
41
|
+
## Start with
|
|
42
|
+
|
|
43
|
+
1. Decide whether the field is single-choice, multi-choice, or binary.
|
|
44
|
+
2. Add the normal `FormItem` props such as `label`, `prop`, and `rules`.
|
|
45
|
+
3. Choose `options` or `valueEnum` after the wrapper choice is clear.
|
|
46
|
+
4. Use checkbox groups or switches instead if the interaction is not really one-of-many.
|
|
47
|
+
|
|
48
|
+
## Minimal patterns
|
|
49
|
+
|
|
50
|
+
### Standard wrapped radio group
|
|
51
|
+
|
|
52
|
+
```vue
|
|
53
|
+
<FormRadioGroup label="Status" prop="status" :options="options" />
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Enum-backed wrapped radio group
|
|
57
|
+
|
|
58
|
+
Use `valueEnum` when a compact mapping is clearer than an explicit options array.
|
|
59
|
+
|
|
60
|
+
### Custom option rendering
|
|
61
|
+
|
|
62
|
+
Use slots when the option body should render as custom radio buttons or richer content.
|
|
63
|
+
|
|
64
|
+
## Common mistakes
|
|
65
|
+
|
|
66
|
+
- using `FormRadioGroup` when many values can be selected
|
|
67
|
+
- using it for a true or false toggle that should be a switch instead
|
|
68
|
+
- forgetting that `valueEnum` is converted into local options by the wrapper
|
|
69
|
+
|
|
70
|
+
## Related skills
|
|
71
|
+
|
|
72
|
+
- Selection-control router above this wrapped choice: `../building-selection-inputs/SKILL.md`
|
|
73
|
+
- Wrapper-family selection: `../using-form-fields/SKILL.md`
|
|
74
|
+
- Base wrapper only: `../using-form-item/SKILL.md`
|
|
75
|
+
- Raw radio group: `../using-radio-group/SKILL.md`
|
|
76
|
+
- Wrapped checkbox group: `../using-form-checkbox-group/SKILL.md`
|
|
77
|
+
- Wrapped switch: `../using-form-switch/SKILL.md`
|
|
78
|
+
|
|
79
|
+
## References
|
|
80
|
+
|
|
81
|
+
- Props: `./references/props.md`
|
|
82
|
+
- Examples: `./references/examples.md`
|
|
83
|
+
- Gotchas: `./references/gotchas.md`
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# FormRadioGroup examples
|
|
2
|
+
|
|
3
|
+
## 1. Standard one-of-many field
|
|
4
|
+
|
|
5
|
+
Use `FormRadioGroup` when a wrapped form field should allow exactly one choice from a fixed local set.
|
|
6
|
+
|
|
7
|
+
Minimal pattern:
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<FormRadioGroup label="Status" prop="status" :options="statusOptions" />
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Typical fit:
|
|
14
|
+
|
|
15
|
+
- status
|
|
16
|
+
- mode selection
|
|
17
|
+
- plan choice
|
|
18
|
+
|
|
19
|
+
## 2. Enum-backed radio field
|
|
20
|
+
|
|
21
|
+
Use `valueEnum` when a compact value-to-label mapping is clearer than an explicit options array.
|
|
22
|
+
|
|
23
|
+
Minimal pattern:
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<FormRadioGroup label="Mode" prop="mode" :value-enum="modeEnum" />
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Typical fit:
|
|
30
|
+
|
|
31
|
+
- small status enums
|
|
32
|
+
- compact configuration modes
|
|
33
|
+
- admin-only choice sets
|
|
34
|
+
|
|
35
|
+
## 3. Custom radio rendering
|
|
36
|
+
|
|
37
|
+
Use slots when the option body should render as radio buttons or richer content instead of default labels.
|
|
38
|
+
|
|
39
|
+
Minimal pattern:
|
|
40
|
+
|
|
41
|
+
```vue
|
|
42
|
+
<FormRadioGroup label="Plan" prop="plan" :options="planOptions">
|
|
43
|
+
<template #default="{ option }">
|
|
44
|
+
<span>{{ option.label }}</span>
|
|
45
|
+
</template>
|
|
46
|
+
</FormRadioGroup>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Typical fit:
|
|
50
|
+
|
|
51
|
+
- branded choices
|
|
52
|
+
- icon-backed options
|
|
53
|
+
- explanatory option labels
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# FormRadioGroup gotchas
|
|
2
|
+
|
|
3
|
+
- Radio groups are for one-of-many choice
|
|
4
|
+
If many values can be checked, use `../using-form-checkbox-group/SKILL.md`.
|
|
5
|
+
|
|
6
|
+
- A switch is often clearer for binary state
|
|
7
|
+
If the field is really just on or off, `../using-form-switch/SKILL.md` is usually a better fit.
|
|
8
|
+
|
|
9
|
+
- `valueEnum` becomes local options
|
|
10
|
+
It is a convenience input, not a separate remote option-loading mode.
|
|
11
|
+
|
|
12
|
+
- This wrapped field is still part of the selection family
|
|
13
|
+
If you are not yet sure whether the field should be radio, checkbox, select, or autocomplete, route back up through `../building-selection-inputs/SKILL.md` before locking into this wrapper.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# FormRadioGroup props
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
`FormRadioGroup` combines `FormItem` props with the package’s `RadioGroup` props and adds `valueEnum` as a compact option source.
|
|
6
|
+
|
|
7
|
+
Use it when single-choice behavior should stay inside the shared form-wrapper family.
|
|
8
|
+
|
|
9
|
+
## Minimum setup
|
|
10
|
+
|
|
11
|
+
A minimal working setup is usually just:
|
|
12
|
+
|
|
13
|
+
```vue
|
|
14
|
+
<FormRadioGroup label="Status" prop="status" :options="statusOptions" />
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
That works because the wrapper already combines `FormItem` semantics with radio-group behavior.
|
|
18
|
+
|
|
19
|
+
Typical useful props:
|
|
20
|
+
|
|
21
|
+
- `label`
|
|
22
|
+
- `prop`
|
|
23
|
+
- one of `options` or `valueEnum`
|
|
24
|
+
|
|
25
|
+
## Core props
|
|
26
|
+
|
|
27
|
+
### Wrapper props from `FormItem`
|
|
28
|
+
|
|
29
|
+
Includes wrapper-level props such as:
|
|
30
|
+
|
|
31
|
+
- `label`
|
|
32
|
+
- `prop`
|
|
33
|
+
- `rules`
|
|
34
|
+
- `required`
|
|
35
|
+
- `tooltip`
|
|
36
|
+
|
|
37
|
+
`label` and `prop` are the minimum wrapper-level anchors in most schema-driven usage.
|
|
38
|
+
|
|
39
|
+
### Radio-group props
|
|
40
|
+
|
|
41
|
+
Useful field props include:
|
|
42
|
+
|
|
43
|
+
- `options`
|
|
44
|
+
- `modelValue`
|
|
45
|
+
- disabled-state and layout props from the wrapped radio-group abstraction
|
|
46
|
+
|
|
47
|
+
Use `options` for the normal local-choice case. Treat `modelValue` as the selected stored value for the field, not as a visual-only toggle.
|
|
48
|
+
|
|
49
|
+
### `valueEnum`
|
|
50
|
+
|
|
51
|
+
Compact mapping from value to label.
|
|
52
|
+
|
|
53
|
+
The wrapper converts this into local radio options when `options` is not provided.
|
|
54
|
+
|
|
55
|
+
Use either `options` or `valueEnum` as the option source of truth. `valueEnum` is a compact local mapping, not a remote-loading mode.
|
|
56
|
+
|
|
57
|
+
## Slots
|
|
58
|
+
|
|
59
|
+
Useful slots include wrapper-level `label` and `error`, plus radio option-rendering slots from the wrapped radio-group abstraction.
|
|
60
|
+
|
|
61
|
+
Reach for slots after the one-of-many field semantics are already correct.
|
|
62
|
+
|
|
63
|
+
## Instance API
|
|
64
|
+
|
|
65
|
+
The exposed instance combines:
|
|
66
|
+
|
|
67
|
+
- `formItem`
|
|
68
|
+
- `field`
|
|
69
|
+
|
|
70
|
+
## Events
|
|
71
|
+
|
|
72
|
+
Important events include:
|
|
73
|
+
|
|
74
|
+
- `update:modelValue`
|
|
75
|
+
- `change`
|
|
76
|
+
|
|
77
|
+
## Import
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { FormRadioGroup } from '@hinen/pro-element-plus';
|
|
81
|
+
```
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-form-rate
|
|
3
|
+
description: Use when a wrapped field should combine FormItem semantics with rating-style input behavior inside the Form* wrapper family.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Using FormRate
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Use `FormRate` for a **rating-style wrapped field** that combines `FormItem` behavior with Element Plus rate behavior.
|
|
11
|
+
|
|
12
|
+
It fits fields where the value represents a score or rating and the interaction should feel like rating input rather than selecting from named options.
|
|
13
|
+
|
|
14
|
+
## Use it when
|
|
15
|
+
|
|
16
|
+
- a field captures rating semantics rather than a named enum
|
|
17
|
+
- you want Element Plus rate behavior plus built-in `FormItem` labels and validation
|
|
18
|
+
- score text, half values, or icon customization are part of the field contract
|
|
19
|
+
- the field should expose both `formItem` and rate `field` refs together
|
|
20
|
+
|
|
21
|
+
## Prefer something else when
|
|
22
|
+
|
|
23
|
+
- the value should be a labeled option instead of stars or scores
|
|
24
|
+
→ use `../using-form-radio-group/SKILL.md`
|
|
25
|
+
- the field should allow several checked values instead of one interpreted score
|
|
26
|
+
→ use `../using-form-checkbox-group/SKILL.md`
|
|
27
|
+
- the field is really a numeric control with step or bounds semantics
|
|
28
|
+
→ use `../using-form-number/SKILL.md`
|
|
29
|
+
- you only need wrapper behavior around custom content
|
|
30
|
+
→ use `../using-form-item/SKILL.md`
|
|
31
|
+
|
|
32
|
+
## Decision guide
|
|
33
|
+
|
|
34
|
+
Use `FormRate` if the answer is yes for **two or more** of these:
|
|
35
|
+
|
|
36
|
+
- Is the value fundamentally a rating or score rather than a named option?
|
|
37
|
+
- Should the interaction feel like stars, icons, or a visual score input?
|
|
38
|
+
- Should the field stay inside the shared form-wrapper family?
|
|
39
|
+
- Do you want wrapper validation access and rate instance access together?
|
|
40
|
+
|
|
41
|
+
If not, `FormRadioGroup`, `FormNumber`, or another wrapper may fit better.
|
|
42
|
+
|
|
43
|
+
## Start with
|
|
44
|
+
|
|
45
|
+
1. Decide whether the field is truly rating-like or just another numeric or option value.
|
|
46
|
+
2. Add the normal `FormItem` props such as `label`, `prop`, and `rules`.
|
|
47
|
+
3. Add rate-specific props such as `allowHalf`, `showText`, or icon customization after the wrapper choice is clear.
|
|
48
|
+
4. Use radio or numeric wrappers instead if the interaction is not really a rating.
|
|
49
|
+
|
|
50
|
+
## Minimal patterns
|
|
51
|
+
|
|
52
|
+
### Standard wrapped rating field
|
|
53
|
+
|
|
54
|
+
```vue
|
|
55
|
+
<FormRate label="Satisfaction" prop="satisfaction" />
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Text-backed or score-backed rating
|
|
59
|
+
|
|
60
|
+
Use `showText` or `showScore` when the control should explain the rating value more explicitly.
|
|
61
|
+
|
|
62
|
+
### Icon-customized rating
|
|
63
|
+
|
|
64
|
+
Use custom icons or colors when the rating UI should communicate a domain-specific scale.
|
|
65
|
+
|
|
66
|
+
## Common mistakes
|
|
67
|
+
|
|
68
|
+
- using `FormRate` when the value is really a named choice that should be radios
|
|
69
|
+
- treating rating input like a generic numeric field
|
|
70
|
+
- forgetting that visual icon or text configuration changes how users interpret the score
|
|
71
|
+
|
|
72
|
+
## Related skills
|
|
73
|
+
|
|
74
|
+
- Business-form workflow router: `../building-form-workflows/SKILL.md`
|
|
75
|
+
- Selection-control router when rating is still one candidate among several choice patterns: `../building-selection-inputs/SKILL.md`
|
|
76
|
+
- Wrapper-family selection: `../using-form-fields/SKILL.md`
|
|
77
|
+
- Base wrapper only: `../using-form-item/SKILL.md`
|
|
78
|
+
- Wrapped radio group: `../using-form-radio-group/SKILL.md`
|
|
79
|
+
- Wrapped checkbox group: `../using-form-checkbox-group/SKILL.md`
|
|
80
|
+
- Wrapped number field: `../using-form-number/SKILL.md`
|
|
81
|
+
|
|
82
|
+
## References
|
|
83
|
+
|
|
84
|
+
- Props: `./references/props.md`
|
|
85
|
+
- Examples: `./references/examples.md`
|
|
86
|
+
- Gotchas: `./references/gotchas.md`
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# FormRate examples
|
|
2
|
+
|
|
3
|
+
## 1. Standard rating field
|
|
4
|
+
|
|
5
|
+
Use `FormRate` when the field stores a visual score or rating inside a wrapped form flow.
|
|
6
|
+
|
|
7
|
+
Minimal pattern:
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<FormRate label="Satisfaction" prop="satisfaction" />
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Typical fit:
|
|
14
|
+
|
|
15
|
+
- satisfaction ratings
|
|
16
|
+
- review scores
|
|
17
|
+
- feedback quality scores
|
|
18
|
+
|
|
19
|
+
## 2. Text-backed or score-backed rating
|
|
20
|
+
|
|
21
|
+
Use `showText` or `showScore` when the rating should explain its value more explicitly.
|
|
22
|
+
|
|
23
|
+
Minimal pattern:
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<FormRate label="Quality" prop="quality" show-text />
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Typical fit:
|
|
30
|
+
|
|
31
|
+
- user surveys
|
|
32
|
+
- service-quality feedback
|
|
33
|
+
- evaluation forms
|
|
34
|
+
|
|
35
|
+
## 3. Custom icon rating
|
|
36
|
+
|
|
37
|
+
Use custom icons or colors when the rating scale should match a domain-specific visual language.
|
|
38
|
+
|
|
39
|
+
Minimal pattern:
|
|
40
|
+
|
|
41
|
+
```vue
|
|
42
|
+
<FormRate label="Mood" prop="mood" :icons="icons" :colors="colors" />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Typical fit:
|
|
46
|
+
|
|
47
|
+
- mood scales
|
|
48
|
+
- reaction scales
|
|
49
|
+
- branded review UIs
|
|
50
|
+
|
|
51
|
+
## 4. Wrapped rating in a mixed business form
|
|
52
|
+
|
|
53
|
+
Use `FormRate` alongside text, number, or select wrappers when one field is truly a score while the rest of the form still follows the shared wrapper family.
|
|
54
|
+
|
|
55
|
+
Minimal pattern:
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<FormText label="Comment" prop="comment" />
|
|
59
|
+
<FormRate label="Rating" prop="rating" />
|
|
60
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# FormRate gotchas
|
|
2
|
+
|
|
3
|
+
- Ratings are not the same as named choices
|
|
4
|
+
If users are choosing among explicit labeled options, `../using-form-radio-group/SKILL.md` is usually clearer.
|
|
5
|
+
|
|
6
|
+
- Ratings are not many-of-many selection
|
|
7
|
+
If users may intentionally choose several values at once, `../using-form-checkbox-group/SKILL.md` is usually a better fit.
|
|
8
|
+
|
|
9
|
+
- Ratings are not just generic numbers
|
|
10
|
+
If the field needs step, min, max, or precision semantics rather than a visual score UI, prefer `../using-form-number/SKILL.md`.
|
|
11
|
+
|
|
12
|
+
- Visual customization changes meaning
|
|
13
|
+
Icons, colors, and text affect how users interpret the scale, so treat them as part of the field contract.
|
|
14
|
+
|
|
15
|
+
- This wrapped field is still part of the selection family
|
|
16
|
+
If you are not yet sure whether the field should be rating, radio, checkbox, or another choice pattern, route back up through `../building-selection-inputs/SKILL.md` before locking into this wrapper.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# FormRate props
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
`FormRate` combines `FormItem` props with Element Plus rate props.
|
|
6
|
+
|
|
7
|
+
Use it when rating-style interaction should stay inside the shared form-wrapper family.
|
|
8
|
+
|
|
9
|
+
## Minimum setup
|
|
10
|
+
|
|
11
|
+
A minimal working setup is usually just:
|
|
12
|
+
|
|
13
|
+
```vue
|
|
14
|
+
<FormRate label="Satisfaction" prop="satisfaction" />
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
That is enough when the field stores one visual score inside a wrapped form flow.
|
|
18
|
+
|
|
19
|
+
Typical useful props:
|
|
20
|
+
|
|
21
|
+
- `label`
|
|
22
|
+
- `prop`
|
|
23
|
+
- `modelValue`
|
|
24
|
+
|
|
25
|
+
Common optional field props:
|
|
26
|
+
|
|
27
|
+
- `allowHalf`
|
|
28
|
+
- `showText`
|
|
29
|
+
- `showScore`
|
|
30
|
+
- `clearable`
|
|
31
|
+
|
|
32
|
+
## Core props
|
|
33
|
+
|
|
34
|
+
### Wrapper props from `FormItem`
|
|
35
|
+
|
|
36
|
+
Includes wrapper-level props such as:
|
|
37
|
+
|
|
38
|
+
- `label`
|
|
39
|
+
- `prop`
|
|
40
|
+
- `rules`
|
|
41
|
+
- `required`
|
|
42
|
+
- `tooltip`
|
|
43
|
+
|
|
44
|
+
### Common rate props
|
|
45
|
+
|
|
46
|
+
Useful field props include:
|
|
47
|
+
|
|
48
|
+
- `modelValue`
|
|
49
|
+
- `max`
|
|
50
|
+
- `allowHalf`
|
|
51
|
+
- `showText`
|
|
52
|
+
- `showScore`
|
|
53
|
+
- `clearable`
|
|
54
|
+
|
|
55
|
+
Treat `modelValue` as the current score for the field. `allowHalf`, `showText`, and `showScore` all change how users understand the rating contract, not just how it looks.
|
|
56
|
+
|
|
57
|
+
### Visual customization props
|
|
58
|
+
|
|
59
|
+
Use visual props when the score UI should communicate a domain-specific scale:
|
|
60
|
+
|
|
61
|
+
- `icons`
|
|
62
|
+
- `voidIcon`
|
|
63
|
+
- `colors`
|
|
64
|
+
- `texts`
|
|
65
|
+
|
|
66
|
+
## Slots
|
|
67
|
+
|
|
68
|
+
Useful slots include wrapper-level `label` and `error`.
|
|
69
|
+
|
|
70
|
+
## Instance API
|
|
71
|
+
|
|
72
|
+
The exposed instance combines:
|
|
73
|
+
|
|
74
|
+
- `formItem`
|
|
75
|
+
- `field`
|
|
76
|
+
|
|
77
|
+
## Events
|
|
78
|
+
|
|
79
|
+
Important events include:
|
|
80
|
+
|
|
81
|
+
- `update:modelValue`
|
|
82
|
+
- `change`
|
|
83
|
+
|
|
84
|
+
## Import
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import { FormRate } from '@hinen/pro-element-plus';
|
|
88
|
+
```
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-form-select
|
|
3
|
+
description: Use when a wrapped field should combine FormItem semantics with local select behavior, grouped options, or lightweight valueEnum mapping inside the Form* wrapper family.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Using FormSelect
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Use `FormSelect` for a **select-style wrapped field** that combines `FormItem` wrapper behavior with the local-option `Select` component.
|
|
11
|
+
|
|
12
|
+
It is the right fit when choice input should stay inside the `Form*` wrapper family and the option source is local enough to be represented by `options` or `valueEnum`.
|
|
13
|
+
|
|
14
|
+
## Use it when
|
|
15
|
+
|
|
16
|
+
- a form or query schema needs select behavior plus wrapper-managed label, rules, and help text
|
|
17
|
+
- static options can come from `options` or lightweight `valueEnum` mappings
|
|
18
|
+
- the field should expose both `formItem` and select `field` refs together
|
|
19
|
+
- grouped options or common select slots may be useful while keeping wrapper-family behavior
|
|
20
|
+
|
|
21
|
+
## Prefer something else when
|
|
22
|
+
|
|
23
|
+
- you are still choosing among several wrapped field families rather than deciding one select field in isolation
|
|
24
|
+
→ use `../using-form-fields/SKILL.md` or `../building-form-workflows/SKILL.md`
|
|
25
|
+
- you need the raw select component outside the wrapper family
|
|
26
|
+
→ use `../using-select/SKILL.md`
|
|
27
|
+
- option data is remote-first and lookup-oriented
|
|
28
|
+
→ use `../using-data-select/SKILL.md`
|
|
29
|
+
- typing should drive callback-based suggestions instead of choosing from a local option set
|
|
30
|
+
→ use `../using-form-autocomplete/SKILL.md`
|
|
31
|
+
- the choice should stay visible as radios or checkboxes instead of living in a dropdown
|
|
32
|
+
→ use `../using-form-radio-group/SKILL.md` or `../using-form-checkbox-group/SKILL.md`
|
|
33
|
+
- the field is fundamentally text-like or numeric rather than choice-based
|
|
34
|
+
→ use `../using-form-text/SKILL.md` or `../using-form-number/SKILL.md`
|
|
35
|
+
|
|
36
|
+
## Decision guide
|
|
37
|
+
|
|
38
|
+
Use `FormSelect` if the answer is yes for **two or more** of these:
|
|
39
|
+
|
|
40
|
+
- Is the field fundamentally a local-choice input?
|
|
41
|
+
- Should the field stay inside the shared form-wrapper family?
|
|
42
|
+
- Are `options` or `valueEnum` enough for the option source?
|
|
43
|
+
- Do you want wrapper and select instance access exposed together?
|
|
44
|
+
- Would grouped options or standard select slots help without moving to a request-aware select?
|
|
45
|
+
|
|
46
|
+
If not, `Select`, `DataSelect`, or another wrapped field may fit better.
|
|
47
|
+
|
|
48
|
+
## Start with
|
|
49
|
+
|
|
50
|
+
1. Decide whether the option source should be `options` or `valueEnum`.
|
|
51
|
+
2. Add the normal `FormItem` props such as `label`, `prop`, and `rules`.
|
|
52
|
+
3. Use grouped options or slots only after the field choice is clearly correct.
|
|
53
|
+
4. Move to `DataSelect` or `Select` if the wrapper boundary or option-loading boundary is different.
|
|
54
|
+
|
|
55
|
+
## Minimal patterns
|
|
56
|
+
|
|
57
|
+
### Standard wrapped select
|
|
58
|
+
|
|
59
|
+
```vue
|
|
60
|
+
<FormSelect label="Status" prop="status" :options="options" />
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Enum-backed wrapped select
|
|
64
|
+
|
|
65
|
+
Use `valueEnum` when a compact mapping is clearer than an explicit options array.
|
|
66
|
+
|
|
67
|
+
### Grouped local options
|
|
68
|
+
|
|
69
|
+
Use grouped options when categories matter but the field should remain local-option-driven.
|
|
70
|
+
|
|
71
|
+
## Common mistakes
|
|
72
|
+
|
|
73
|
+
- using `FormSelect` when the select should actually live outside the wrapper family
|
|
74
|
+
- using `FormSelect` for remote lookup behavior that belongs in `DataSelect`
|
|
75
|
+
- forgetting that `valueEnum` is converted into local options by the wrapper
|
|
76
|
+
- overlooking the special `input-label` slot name used to avoid conflicting with wrapper label slots
|
|
77
|
+
|
|
78
|
+
## Related skills
|
|
79
|
+
|
|
80
|
+
- Business-form workflow router: `../building-form-workflows/SKILL.md`
|
|
81
|
+
- Wrapper-family selection: `../using-form-fields/SKILL.md`
|
|
82
|
+
- Base wrapper only: `../using-form-item/SKILL.md`
|
|
83
|
+
- Raw local select component: `../using-select/SKILL.md`
|
|
84
|
+
- Request-aware select component: `../using-data-select/SKILL.md`
|
|
85
|
+
- Wrapped autocomplete field: `../using-form-autocomplete/SKILL.md`
|
|
86
|
+
- Wrapped visible choice fields: `../using-form-radio-group/SKILL.md`, `../using-form-checkbox-group/SKILL.md`
|
|
87
|
+
- Text-style wrapped field: `../using-form-text/SKILL.md`
|
|
88
|
+
- Numeric wrapped field: `../using-form-number/SKILL.md`
|
|
89
|
+
|
|
90
|
+
## References
|
|
91
|
+
|
|
92
|
+
- Props: `./references/props.md`
|
|
93
|
+
- Examples: `./references/examples.md`
|
|
94
|
+
- Gotchas: `./references/gotchas.md`
|