@hinen/pro-element-plus 1.7.17 → 1.8.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 (148) hide show
  1. package/dist/components/DataTable/DataTable.vue.d.ts +24 -6
  2. package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
  3. package/dist/components/DataTable/props.d.ts +11 -2
  4. package/dist/components/DataTable/props.d.ts.map +1 -1
  5. package/dist/components/DataTable/types.d.ts +13 -1
  6. package/dist/components/DataTable/types.d.ts.map +1 -1
  7. package/dist/components/DataTable/useDataTable.d.ts.map +1 -1
  8. package/dist/components/FormFields/FormCascadeSelect/FormCascadeSelect.vue.d.ts +136 -146
  9. package/dist/components/FormFields/FormCascadeSelect/FormCascadeSelect.vue.d.ts.map +1 -1
  10. package/dist/components/FormFields/FormCascadeSelect/props.d.ts +112 -114
  11. package/dist/components/FormFields/FormCascadeSelect/props.d.ts.map +1 -1
  12. package/dist/components/FormFields/FormCascadeSelect/types.d.ts +24 -1
  13. package/dist/components/FormFields/FormCascadeSelect/types.d.ts.map +1 -1
  14. package/dist/components/FormFields/FormTagInput/FormTagInput.vue.d.ts.map +1 -1
  15. package/dist/components/FormFields/FormTreeSelect/props.d.ts +3 -1
  16. package/dist/components/FormFields/FormTreeSelect/props.d.ts.map +1 -1
  17. package/dist/index.cjs +32 -32
  18. package/dist/index.js +2947 -2570
  19. package/dist/skills/building-form-workflows/SKILL.md +77 -0
  20. package/dist/skills/building-form-workflows/references/examples.md +47 -0
  21. package/dist/skills/building-form-workflows/references/field-selection.md +16 -0
  22. package/dist/skills/building-form-workflows/references/gotchas.md +10 -0
  23. package/dist/skills/building-form-workflows/references/workflow.md +21 -0
  24. package/dist/skills/building-modal-workflows/SKILL.md +79 -0
  25. package/dist/skills/building-modal-workflows/references/examples.md +104 -0
  26. package/dist/skills/building-modal-workflows/references/gotchas.md +19 -0
  27. package/dist/skills/building-modal-workflows/references/workflow.md +17 -0
  28. package/dist/skills/building-query-pages/SKILL.md +81 -0
  29. package/dist/skills/building-query-pages/references/examples.md +64 -0
  30. package/dist/skills/building-query-pages/references/field-selection.md +24 -0
  31. package/dist/skills/building-query-pages/references/gotchas.md +10 -0
  32. package/dist/skills/building-query-pages/references/workflow.md +22 -0
  33. package/dist/skills/building-selection-inputs/SKILL.md +85 -0
  34. package/dist/skills/building-selection-inputs/references/examples.md +87 -0
  35. package/dist/skills/building-selection-inputs/references/gotchas.md +19 -0
  36. package/dist/skills/building-selection-inputs/references/selection-guide.md +47 -0
  37. package/dist/skills/choosing-components/SKILL.md +78 -0
  38. package/dist/skills/choosing-components/references/component-groups.md +37 -0
  39. package/dist/skills/choosing-components/references/examples.md +91 -0
  40. package/dist/skills/choosing-components/references/gotchas.md +10 -0
  41. package/dist/skills/choosing-components/references/selection-guide.md +40 -0
  42. package/dist/skills/optimizing-component-skills/REVIEW.md +775 -0
  43. package/dist/skills/using-checkbox-group/SKILL.md +91 -0
  44. package/dist/skills/using-checkbox-group/references/examples.md +55 -0
  45. package/dist/skills/using-checkbox-group/references/gotchas.md +13 -0
  46. package/dist/skills/using-checkbox-group/references/props.md +83 -0
  47. package/dist/skills/using-config-provider/SKILL.md +96 -0
  48. package/dist/skills/using-config-provider/references/examples.md +38 -0
  49. package/dist/skills/using-config-provider/references/gotchas.md +13 -0
  50. package/dist/skills/using-config-provider/references/props.md +38 -0
  51. package/dist/skills/using-data-select/SKILL.md +127 -0
  52. package/dist/skills/using-data-select/references/examples.md +67 -0
  53. package/dist/skills/using-data-select/references/gotchas.md +19 -0
  54. package/dist/skills/using-data-select/references/props.md +126 -0
  55. package/dist/skills/using-data-table/SKILL.md +289 -0
  56. package/dist/skills/using-data-table/references/examples.md +347 -0
  57. package/dist/skills/using-data-table/references/gotchas.md +114 -0
  58. package/dist/skills/using-data-table/references/props.md +375 -0
  59. package/dist/skills/using-drawer/SKILL.md +104 -0
  60. package/dist/skills/using-drawer/references/examples.md +109 -0
  61. package/dist/skills/using-drawer/references/gotchas.md +16 -0
  62. package/dist/skills/using-drawer/references/props.md +105 -0
  63. package/dist/skills/using-ellipsis-text/SKILL.md +105 -0
  64. package/dist/skills/using-ellipsis-text/references/examples.md +71 -0
  65. package/dist/skills/using-ellipsis-text/references/gotchas.md +19 -0
  66. package/dist/skills/using-ellipsis-text/references/props.md +97 -0
  67. package/dist/skills/using-form-autocomplete/SKILL.md +87 -0
  68. package/dist/skills/using-form-autocomplete/references/examples.md +62 -0
  69. package/dist/skills/using-form-autocomplete/references/gotchas.md +13 -0
  70. package/dist/skills/using-form-autocomplete/references/props.md +100 -0
  71. package/dist/skills/using-form-cascade-select/SKILL.md +82 -0
  72. package/dist/skills/using-form-cascade-select/references/examples.md +59 -0
  73. package/dist/skills/using-form-cascade-select/references/gotchas.md +13 -0
  74. package/dist/skills/using-form-cascade-select/references/props.md +138 -0
  75. package/dist/skills/using-form-checkbox-group/SKILL.md +83 -0
  76. package/dist/skills/using-form-checkbox-group/references/examples.md +61 -0
  77. package/dist/skills/using-form-checkbox-group/references/gotchas.md +13 -0
  78. package/dist/skills/using-form-checkbox-group/references/props.md +85 -0
  79. package/dist/skills/using-form-date-picker/SKILL.md +79 -0
  80. package/dist/skills/using-form-date-picker/references/examples.md +54 -0
  81. package/dist/skills/using-form-date-picker/references/gotchas.md +10 -0
  82. package/dist/skills/using-form-date-picker/references/props.md +99 -0
  83. package/dist/skills/using-form-fields/SKILL.md +101 -0
  84. package/dist/skills/using-form-fields/references/examples.md +45 -0
  85. package/dist/skills/using-form-fields/references/gotchas.md +6 -0
  86. package/dist/skills/using-form-fields/references/props.md +57 -0
  87. package/dist/skills/using-form-item/SKILL.md +92 -0
  88. package/dist/skills/using-form-item/references/examples.md +59 -0
  89. package/dist/skills/using-form-item/references/gotchas.md +13 -0
  90. package/dist/skills/using-form-item/references/props.md +85 -0
  91. package/dist/skills/using-form-number/SKILL.md +82 -0
  92. package/dist/skills/using-form-number/references/examples.md +66 -0
  93. package/dist/skills/using-form-number/references/gotchas.md +13 -0
  94. package/dist/skills/using-form-number/references/props.md +82 -0
  95. package/dist/skills/using-form-radio-group/SKILL.md +83 -0
  96. package/dist/skills/using-form-radio-group/references/examples.md +53 -0
  97. package/dist/skills/using-form-radio-group/references/gotchas.md +13 -0
  98. package/dist/skills/using-form-radio-group/references/props.md +81 -0
  99. package/dist/skills/using-form-rate/SKILL.md +86 -0
  100. package/dist/skills/using-form-rate/references/examples.md +60 -0
  101. package/dist/skills/using-form-rate/references/gotchas.md +16 -0
  102. package/dist/skills/using-form-rate/references/props.md +88 -0
  103. package/dist/skills/using-form-select/SKILL.md +94 -0
  104. package/dist/skills/using-form-select/references/examples.md +67 -0
  105. package/dist/skills/using-form-select/references/gotchas.md +13 -0
  106. package/dist/skills/using-form-select/references/props.md +87 -0
  107. package/dist/skills/using-form-switch/SKILL.md +81 -0
  108. package/dist/skills/using-form-switch/references/examples.md +54 -0
  109. package/dist/skills/using-form-switch/references/gotchas.md +10 -0
  110. package/dist/skills/using-form-switch/references/props.md +83 -0
  111. package/dist/skills/using-form-tag-input/SKILL.md +83 -0
  112. package/dist/skills/using-form-tag-input/references/examples.md +53 -0
  113. package/dist/skills/using-form-tag-input/references/gotchas.md +13 -0
  114. package/dist/skills/using-form-tag-input/references/props.md +80 -0
  115. package/dist/skills/using-form-text/SKILL.md +82 -0
  116. package/dist/skills/using-form-text/references/examples.md +66 -0
  117. package/dist/skills/using-form-text/references/gotchas.md +13 -0
  118. package/dist/skills/using-form-text/references/props.md +98 -0
  119. package/dist/skills/using-form-time-picker/SKILL.md +78 -0
  120. package/dist/skills/using-form-time-picker/references/examples.md +53 -0
  121. package/dist/skills/using-form-time-picker/references/gotchas.md +10 -0
  122. package/dist/skills/using-form-time-picker/references/props.md +89 -0
  123. package/dist/skills/using-form-tree-select/SKILL.md +82 -0
  124. package/dist/skills/using-form-tree-select/references/examples.md +55 -0
  125. package/dist/skills/using-form-tree-select/references/gotchas.md +13 -0
  126. package/dist/skills/using-form-tree-select/references/props.md +86 -0
  127. package/dist/skills/using-image/SKILL.md +88 -0
  128. package/dist/skills/using-image/references/examples.md +31 -0
  129. package/dist/skills/using-image/references/gotchas.md +13 -0
  130. package/dist/skills/using-image/references/props.md +91 -0
  131. package/dist/skills/using-modal/SKILL.md +113 -0
  132. package/dist/skills/using-modal/references/examples.md +122 -0
  133. package/dist/skills/using-modal/references/gotchas.md +16 -0
  134. package/dist/skills/using-modal/references/props.md +100 -0
  135. package/dist/skills/using-query-form/SKILL.md +134 -0
  136. package/dist/skills/using-query-form/references/examples.md +103 -0
  137. package/dist/skills/using-query-form/references/gotchas.md +19 -0
  138. package/dist/skills/using-query-form/references/props.md +146 -0
  139. package/dist/skills/using-radio-group/SKILL.md +91 -0
  140. package/dist/skills/using-radio-group/references/examples.md +55 -0
  141. package/dist/skills/using-radio-group/references/gotchas.md +13 -0
  142. package/dist/skills/using-radio-group/references/props.md +83 -0
  143. package/dist/skills/using-select/SKILL.md +93 -0
  144. package/dist/skills/using-select/references/examples.md +50 -0
  145. package/dist/skills/using-select/references/gotchas.md +13 -0
  146. package/dist/skills/using-select/references/props.md +90 -0
  147. package/dist/style.css +1 -1
  148. package/package.json +1 -1
@@ -0,0 +1,86 @@
1
+ # FormTreeSelect props
2
+
3
+ ## Overview
4
+
5
+ `FormTreeSelect` combines `FormItem` props with Element Plus tree-select props.
6
+
7
+ Use it when visible tree-node selection should stay inside the shared form-wrapper family.
8
+
9
+ ## Minimum setup
10
+
11
+ Typical useful props:
12
+
13
+ - `label`
14
+ - `prop`
15
+ - `data`
16
+
17
+ Common optional field props:
18
+
19
+ - `props`
20
+ - `showCheckbox`
21
+ - `multiple`
22
+ - `filterable`
23
+ - `lazy`
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
+ ### `data`
38
+
39
+ The tree node source.
40
+
41
+ Use this when the visible tree structure is known up front.
42
+
43
+ ### Tree interaction props
44
+
45
+ Useful field props include:
46
+
47
+ - `showCheckbox`
48
+ - `checkStrictly`
49
+ - `multiple`
50
+ - `filterable`
51
+ - `renderContent`
52
+
53
+ ### Mapping and lazy-loading props
54
+
55
+ Use tree mapping and lazy-loading props when the node shape or loading strategy needs configuration.
56
+
57
+ ## Slots
58
+
59
+ Useful slots include wrapper-level `label` and `error`, plus tree node customization slots for richer node rendering.
60
+
61
+ ## Instance API
62
+
63
+ The exposed instance combines:
64
+
65
+ - `formItem`
66
+ - `field`
67
+
68
+ ## Events
69
+
70
+ Important events include:
71
+
72
+ - `update:modelValue`
73
+ - `change`
74
+ - `focus`
75
+ - `blur`
76
+ - `clear`
77
+ - `visibleChange`
78
+ - `removeTag`
79
+ - `popupScroll`
80
+ - tree node interaction events such as `nodeClick`, `checkChange`, `check`, `nodeExpand`, and `nodeCollapse`
81
+
82
+ ## Import
83
+
84
+ ```ts
85
+ import { FormTreeSelect } from '@hinen/pro-element-plus';
86
+ ```
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: using-image
3
+ description: Use when you need richer image loading, preview, placeholder, and failure handling than a bare image tag provides.
4
+ ---
5
+
6
+ # Using Image
7
+
8
+ ## Overview
9
+
10
+ Use `Image` for a **stateful image primitive** that keeps Element Plus image behavior while adding preview defaults, a built-in reload affordance after failure, and empty-state handling when no source is present.
11
+
12
+ It is strongest when image loading, preview, failure recovery, or placeholder behavior are part of the product flow rather than afterthoughts.
13
+
14
+ ## Use it when
15
+
16
+ Use `Image` when several of these are true:
17
+
18
+ - images need preview behavior
19
+ - failure and reload states matter to the workflow
20
+ - loading, preview, or error UI needs slot-level customization
21
+ - empty-state behavior matters when `src` may be missing
22
+ - the default reload control and preview affordances are useful
23
+
24
+ Strong signals this skill applies:
25
+
26
+ - thumbnail galleries
27
+ - avatar or cover-image cards
28
+ - image-heavy detail views
29
+ - media lists with recoverable load failures
30
+
31
+ ## Prefer something else when
32
+
33
+ - you only need text truncation around media metadata
34
+ → use `../using-ellipsis-text/SKILL.md`
35
+ - a plain browser image tag is sufficient and preview or retry behavior does not matter
36
+
37
+ ## Decision guide
38
+
39
+ Use `Image` if the answer is yes for **two or more** of these:
40
+
41
+ - Should the image support preview or gallery viewing?
42
+ - Should failed loads offer an in-place reload action?
43
+ - Do placeholder, error, or empty states need customization?
44
+ - Is missing or unstable image data part of normal usage?
45
+
46
+ If not, a plain image element may be enough.
47
+
48
+ ## Start with
49
+
50
+ 1. Decide whether preview is part of the workflow.
51
+ 2. Decide whether the default error text and reload control are enough.
52
+ 3. Set `src` and optional `previewSrcList` first.
53
+ 4. Add slots only when the default states do not fit the product requirement.
54
+
55
+ ## Minimal patterns
56
+
57
+ ### Thumbnail with preview
58
+
59
+ ```vue
60
+ <Image :src="src" :preview="true" />
61
+ ```
62
+
63
+ ### Failed image with reload
64
+
65
+ Use the built-in reload affordance when users should be able to retry a failed asset without reloading the page.
66
+
67
+ ### Empty image placeholder
68
+
69
+ Use the empty state when `src` may be missing and the layout should still reserve image space cleanly.
70
+
71
+ ## Common mistakes
72
+
73
+ - turning off the built-in reload control and then expecting users to recover from load failures in place
74
+ - overlooking that preview is enabled by default here
75
+ - treating empty `src` and failed `src` as the same state
76
+ - adding custom slots before confirming whether the built-in image states already fit
77
+
78
+ When reading package-facing docs, prefer the documented behavior over memorizing one term: this component's public story is about a reload control after failure, even if different docs use slightly different labels for that control.
79
+
80
+ ## Related skills
81
+
82
+ - Truncating related long text content: `../using-ellipsis-text/SKILL.md`
83
+
84
+ ## References
85
+
86
+ - Props: `./references/props.md`
87
+ - Examples: `./references/examples.md`
88
+ - Gotchas: `./references/gotchas.md`
@@ -0,0 +1,31 @@
1
+ # Image examples
2
+
3
+ ## 1. Thumbnail with preview
4
+
5
+ Use `preview` and `previewSrcList` when the same image should expand into a viewer or gallery flow.
6
+
7
+ Typical fit:
8
+
9
+ - product galleries
10
+ - avatar preview
11
+ - image-heavy detail pages
12
+
13
+ ## 2. Retryable image load
14
+
15
+ Keep `showRefresh` enabled when users should be able to retry a failed asset without reloading the page.
16
+
17
+ Typical fit:
18
+
19
+ - unstable remote assets
20
+ - user-uploaded content
21
+ - CDN-backed thumbnails
22
+
23
+ ## 3. Custom failure or empty state
24
+
25
+ Use the `error`, `refreshButton`, `placeholder`, or `empty` slots when the fallback UI needs product-specific language or styling.
26
+
27
+ Typical fit:
28
+
29
+ - branded empty states
30
+ - custom retry buttons
31
+ - loading placeholders matched to layout skeletons
@@ -0,0 +1,13 @@
1
+ # Image gotchas
2
+
3
+ - `preview` defaults to `true` here
4
+ If preview should be disabled, set it explicitly.
5
+
6
+ - `previewTeleported` defaults to `true`
7
+ This affects where the preview viewer renders.
8
+
9
+ - Setting `showRefresh` to `false` removes the retry affordance
10
+ After a failed load, users will have no built-in recovery action.
11
+
12
+ - Empty `src` and failed `src` are different states
13
+ Missing source shows the empty-state path; failed source shows the error-state path.
@@ -0,0 +1,91 @@
1
+ # Image props
2
+
3
+ ## Overview
4
+
5
+ `Image` extends Element Plus image behavior with retry, preview defaults, and explicit empty-state handling.
6
+
7
+ Use it when loading-state behavior is part of the component choice, not just the image URL itself.
8
+
9
+ ## Minimum setup
10
+
11
+ Typical useful props:
12
+
13
+ - `src`
14
+
15
+ Common optional props:
16
+
17
+ - `preview`
18
+ - `previewSrcList`
19
+ - `showRefresh`
20
+ - `showError`
21
+ - `errorText`
22
+
23
+ ## Core props
24
+
25
+ ### `src`
26
+
27
+ The image source URL.
28
+
29
+ If `src` is empty, the component renders its empty state instead of trying to load an image.
30
+
31
+ ### `preview`
32
+
33
+ Toggles preview behavior.
34
+
35
+ Default: `true`
36
+
37
+ ### `previewSrcList`
38
+
39
+ Preview gallery source list.
40
+
41
+ If preview is enabled and no list is provided, the component falls back to the current computed source.
42
+
43
+ ### `showRefresh`
44
+
45
+ Shows a reload action after failure.
46
+
47
+ Default: `true`
48
+
49
+ ### `showError`
50
+
51
+ Controls whether the error text is shown.
52
+
53
+ Default: `true`
54
+
55
+ ### `errorText`
56
+
57
+ Overrides the default localized error text.
58
+
59
+ ### `previewTeleported`
60
+
61
+ Controls preview viewer teleport behavior.
62
+
63
+ Default: `true`
64
+
65
+ ## Slots
66
+
67
+ Useful slots include:
68
+
69
+ - `error`
70
+ - `refreshButton`
71
+ - `placeholder`
72
+ - `empty`
73
+ - `viewer`
74
+ - `progress`
75
+ - `toolbar`
76
+
77
+ ## Events
78
+
79
+ Important events include:
80
+
81
+ - `load`
82
+ - `error`
83
+ - `switch`
84
+ - `close`
85
+ - `show`
86
+
87
+ ## Import
88
+
89
+ ```ts
90
+ import { Image } from '@hinen/pro-element-plus';
91
+ ```
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: using-modal
3
+ description: Use when a centered overlay should keep Element Plus dialog behavior while adding standard confirm and cancel actions, confirm loading state, and size presets.
4
+ ---
5
+
6
+ # Using Modal
7
+
8
+ ## Overview
9
+
10
+ Use `Modal` for a **centered dialog workflow** that should keep Element Plus dialog behavior while adding a standard footer, size presets, confirm loading state, and scroll-shadow treatment for long content.
11
+
12
+ It is best for short, focused overlay flows where confirm and cancel are first-class actions. It is not just a visual wrapper around `ElDialog`; it adds a stronger default action model.
13
+
14
+ ## Use it when
15
+
16
+ Use `Modal` when several of these are true:
17
+
18
+ - the interaction fits a centered dialog
19
+ - the flow should expose standard confirm and cancel buttons
20
+ - async submit state should appear on the confirm button
21
+ - size presets are preferable to ad hoc widths
22
+ - the content may overflow and still needs a stable shell
23
+
24
+ Strong signals this skill applies:
25
+
26
+ - confirmation dialogs with meaningful body content
27
+ - small record editors
28
+ - detail review dialogs
29
+ - one-step approval or submit flows
30
+
31
+ ## Prefer something else when
32
+
33
+ - the workflow needs a side panel or should stay anchored to the viewport edge
34
+ → use `../using-drawer/SKILL.md`
35
+ - you are still choosing the right overlay pattern
36
+ → use `../building-modal-workflows/SKILL.md`
37
+ - the interaction is so small that plain Element Plus dialog usage is clearer than the added footer semantics
38
+ - the feature needs highly custom actions with no confirm/cancel model
39
+
40
+ ## Decision guide
41
+
42
+ Use `Modal` if the answer is yes for **two or more** of these:
43
+
44
+ - Should the overlay be centered rather than edge-attached?
45
+ - Do confirm and cancel represent the core business actions?
46
+ - Should submit loading live on the confirm button?
47
+ - Will a `small`, `default`, or `large` preset be enough for sizing?
48
+ - Should the feature keep standard dialog lifecycle events while gaining a stronger footer contract?
49
+
50
+ If not, `Drawer` or a lower-level dialog composition may fit better.
51
+
52
+ ## Start with
53
+
54
+ 1. Control visibility through `modelValue`.
55
+ 2. Use the built-in footer for standard confirm and cancel flows.
56
+ 3. Choose `size` before reaching for explicit `width`.
57
+ 4. Keep close behavior in business code by handling `cancel`, `ok`, and `update:modelValue` explicitly.
58
+
59
+ ## Minimal patterns
60
+
61
+ ### Standard confirm and cancel flow
62
+
63
+ ```vue
64
+ <Modal
65
+ :model-value="visible"
66
+ title="Edit User"
67
+ :confirm-loading="saving"
68
+ @update:model-value="visible = $event"
69
+ @cancel="visible = false"
70
+ @ok="handleSubmit"
71
+ >
72
+ <UserForm />
73
+ </Modal>
74
+ ```
75
+
76
+ ### Hide the default footer
77
+
78
+ Use this when the content manages its own actions.
79
+
80
+ ```vue
81
+ <Modal
82
+ :model-value="visible"
83
+ :footer="false"
84
+ @update:model-value="visible = $event"
85
+ >
86
+ <CustomWorkflow />
87
+ </Modal>
88
+ ```
89
+
90
+ ### Custom footer slot
91
+
92
+ Use the slot only when the default two-button action model is not enough.
93
+
94
+ ## Common mistakes
95
+
96
+ - assuming `ok` or `cancel` automatically closes the modal
97
+ - using exact `width` immediately instead of trying `size` first
98
+ - forgetting that `okButtonProps.type` can override `okType`
99
+ - rebuilding footer actions from scratch for a standard submit flow
100
+ - using `Modal` for long, panel-like workflows that should really be drawers
101
+
102
+ ## Related skills
103
+
104
+ - Side-panel workflow shell: `../using-drawer/SKILL.md`
105
+ - Overlay-pattern selection: `../building-modal-workflows/SKILL.md`
106
+ - Form workflow when the body is an editor or wrapped form: `../building-form-workflows/SKILL.md`
107
+ - Query or list shells when the body is filter-plus-results content: `../using-query-form/SKILL.md`, `../using-data-table/SKILL.md`
108
+
109
+ ## References
110
+
111
+ - Props: `./references/props.md`
112
+ - Examples: `./references/examples.md`
113
+ - Gotchas: `./references/gotchas.md`
@@ -0,0 +1,122 @@
1
+ # Modal examples
2
+
3
+ ## 1. Standard confirm dialog
4
+
5
+ Use `Modal` when the main job is confirming or cancelling a short workflow with meaningful body content.
6
+
7
+ Minimal pattern:
8
+
9
+ ```vue
10
+ <Modal
11
+ :model-value="visible"
12
+ title="Confirm"
13
+ @cancel="visible = false"
14
+ @ok="handleConfirm"
15
+ />
16
+ ```
17
+
18
+ Typical fit:
19
+
20
+ - delete confirmations with extra context
21
+ - approval dialogs
22
+ - one-step submit flows
23
+
24
+ Recommended pattern:
25
+
26
+ - keep the default footer
27
+ - wire `cancel` and `ok` in parent code
28
+ - use `confirmLoading` for async work
29
+
30
+ ## 2. Small record editor
31
+
32
+ Use `Modal` when a compact editor should stay centered and focused.
33
+
34
+ Minimal pattern:
35
+
36
+ ```vue
37
+ <Modal
38
+ :model-value="visible"
39
+ title="Rename"
40
+ @cancel="visible = false"
41
+ @ok="handleSave"
42
+ >
43
+ <RenameForm />
44
+ </Modal>
45
+ ```
46
+
47
+ Typical fit:
48
+
49
+ - rename dialogs
50
+ - status-change dialogs
51
+ - lightweight metadata editors
52
+
53
+ Recommended pattern:
54
+
55
+ - start with `size="small"` or `size="default"`
56
+ - keep the form inside the body slot
57
+ - close on successful submit, not on button click alone
58
+
59
+ ## 3. Overflowing long-form content
60
+
61
+ Use `Modal` when the body may scroll but the shell should stay stable.
62
+
63
+ Minimal pattern:
64
+
65
+ ```vue
66
+ <Modal
67
+ :model-value="visible"
68
+ title="Review Terms"
69
+ @cancel="visible = false"
70
+ @ok="handleAccept"
71
+ >
72
+ <LongContent />
73
+ </Modal>
74
+ ```
75
+
76
+ Typical fit:
77
+
78
+ - policy review dialogs
79
+ - long explanations with a final confirm action
80
+ - large read-only detail content that still behaves like a dialog
81
+
82
+ The component already handles scrollable body rendering and header or footer shadow transitions.
83
+
84
+ ## 4. Custom action layout
85
+
86
+ Use the `footer` slot when the default two-button pattern cannot express the workflow.
87
+
88
+ Minimal pattern:
89
+
90
+ ```vue
91
+ <Modal :model-value="visible">
92
+ <template #footer>
93
+ <CustomActions />
94
+ </template>
95
+ </Modal>
96
+ ```
97
+
98
+ Typical fit:
99
+
100
+ - three-way decision flows
101
+ - secondary destructive action next to save
102
+ - multi-step footer controls
103
+
104
+ Prefer the built-in footer until the product flow genuinely needs more than confirm and cancel.
105
+
106
+ ## 5. Modal with query or list content
107
+
108
+ Use `Modal` when the overlay stays centered, but the inner body is really a query/list workflow rather than a simple editor.
109
+
110
+ Minimal pattern:
111
+
112
+ ```vue
113
+ <Modal :model-value="visible" title="Choose User" @cancel="visible = false">
114
+ <QueryForm :items="items" @search="handleSearch" />
115
+ </Modal>
116
+ ```
117
+
118
+ Typical fit:
119
+
120
+ - centered search-and-pick dialogs
121
+ - short review-history overlays
122
+ - quick filter panels that should not become full drawers
@@ -0,0 +1,16 @@
1
+ # Modal gotchas
2
+
3
+ - `size` is a library-level preset
4
+ It is not part of Element Plus dialog props, so treat it as the preferred convenience layer here.
5
+
6
+ - `width` and `size` are not the same decision
7
+ Reach for `width` only when the presets do not match product intent.
8
+
9
+ - `ok` and `cancel` do not close the modal automatically
10
+ Parent code still needs to update `modelValue` or handle the dialog lifecycle explicitly.
11
+
12
+ - `okButtonProps` can override `okType`
13
+ If the confirm button style looks wrong, check both values.
14
+
15
+ - Hiding the footer removes the built-in action model
16
+ Once `footer` is `false` or the slot replaces it, your own content must provide the workflow affordances.
@@ -0,0 +1,100 @@
1
+ # Modal props
2
+
3
+ ## Overview
4
+
5
+ `Modal` extends Element Plus dialog props and adds a standard footer contract, size presets, and button-level loading state.
6
+
7
+ Choose the action model first, then choose sizing.
8
+
9
+ ## Minimum setup
10
+
11
+ Required in normal usage:
12
+
13
+ - `modelValue`
14
+
15
+ Typical optional props:
16
+
17
+ - `title`
18
+ - `size`
19
+ - `footer`
20
+ - `confirmLoading`
21
+
22
+ ## Core props
23
+
24
+ ### `modelValue`
25
+
26
+ Controls visibility.
27
+
28
+ Use `update:modelValue` to keep parent state in sync.
29
+
30
+ ### `size`
31
+
32
+ Library-level preset sizing.
33
+
34
+ Supported values:
35
+
36
+ - `small`
37
+ - `default`
38
+ - `large`
39
+
40
+ Default: `default`
41
+
42
+ If `width` is provided, use that intentionally instead of relying on the preset alone.
43
+
44
+ ### `width`
45
+
46
+ Inherited from Element Plus dialog props.
47
+
48
+ Use this only when the preset sizes are not sufficient.
49
+
50
+ ### `footer`
51
+
52
+ Controls whether the default footer is rendered.
53
+
54
+ Default: `true`
55
+
56
+ ### `confirmLoading`
57
+
58
+ Shows loading on the built-in confirm button.
59
+
60
+ Default: `false`
61
+
62
+ ### `okText` and `cancelText`
63
+
64
+ Override the localized button labels.
65
+
66
+ ### `okType`
67
+
68
+ Sets the built-in confirm button type.
69
+
70
+ Default: `primary`
71
+
72
+ ### `okButtonProps` and `cancelButtonProps`
73
+
74
+ Pass partial Element Plus button props into the built-in footer actions.
75
+
76
+ Use these for fine-grained button overrides without replacing the whole footer.
77
+
78
+ ## Events
79
+
80
+ `Modal` keeps Element Plus dialog events and adds:
81
+
82
+ - `ok`
83
+ - `cancel`
84
+
85
+ These are business-action events. They do not automatically close the modal.
86
+
87
+ ## Slots
88
+
89
+ Useful slots:
90
+
91
+ - default body slot
92
+ - `footer`
93
+
94
+ All other dialog slots still pass through.
95
+
96
+ ## Import
97
+
98
+ ```ts
99
+ import { Modal } from '@hinen/pro-element-plus';
100
+ ```