@capillarytech/blaze-ui 5.20.0 → 5.22.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 (189) hide show
  1. package/CapAskAira/CapAiMediaGeneration/saga.js +1446 -0
  2. package/CapAskAira/CapAiMediaGeneration/saga.js.map +1 -0
  3. package/CapCollapsibleLeftNavigation/saga.js +1441 -0
  4. package/CapCollapsibleLeftNavigation/saga.js.map +1 -0
  5. package/CapLanguageProvider/actions.js +125 -0
  6. package/CapLanguageProvider/actions.js.map +1 -0
  7. package/CapLanguageProvider/constants.js +37 -0
  8. package/CapLanguageProvider/constants.js.map +1 -0
  9. package/CapLanguageProvider/reducer.js +130 -0
  10. package/CapLanguageProvider/reducer.js.map +1 -0
  11. package/CapLanguageProvider/saga.js +1457 -0
  12. package/CapLanguageProvider/saga.js.map +1 -0
  13. package/CapLanguageProvider/selector.js +186 -0
  14. package/CapLanguageProvider/selector.js.map +1 -0
  15. package/CapSupportVideosWrapper/utils.js +34 -0
  16. package/CapSupportVideosWrapper/utils.js.map +1 -0
  17. package/package.json +1 -1
  18. package/CapActionBar/README.md +0 -11
  19. package/CapAdvancedIcon/README.md +0 -185
  20. package/CapAdvancedIcon/use-cases.md +0 -44
  21. package/CapAlert/README.md +0 -144
  22. package/CapAppNotEnabled/README.md +0 -84
  23. package/CapAskAira/README.md +0 -328
  24. package/CapBanner/README.md +0 -4
  25. package/CapBlock/README.md +0 -175
  26. package/CapBorderedBox/Status.md +0 -40
  27. package/CapCSVFileUploader/README.md +0 -124
  28. package/CapCSVFileUploader/Status.md +0 -47
  29. package/CapCard/README.md +0 -85
  30. package/CapCard/Status.md +0 -41
  31. package/CapCardBox/README.md +0 -169
  32. package/CapCardBox/Status.md +0 -52
  33. package/CapCarousel/README.md +0 -190
  34. package/CapCarousel/Status.md +0 -73
  35. package/CapCheckbox/README.md +0 -254
  36. package/CapCheckbox/Status.md +0 -41
  37. package/CapColorPicker/README.md +0 -112
  38. package/CapColorPicker/Status.md +0 -52
  39. package/CapColorPicker/tests/USE_CASES_ANALYSIS.md +0 -92
  40. package/CapColoredTag/README.md +0 -167
  41. package/CapColoredTag/Status.md +0 -49
  42. package/CapConditionPreview/MIGRATION_ANALYSIS.md +0 -70
  43. package/CapConditionPreview/README.md +0 -40
  44. package/CapConditionPreview/tests/USE_CASES_CapConditionPreview.md +0 -65
  45. package/CapCustomCard/README.md +0 -182
  46. package/CapCustomCard/Status.md +0 -40
  47. package/CapCustomCarousel/Status.md +0 -69
  48. package/CapCustomCheckboxList/README.md +0 -178
  49. package/CapCustomCheckboxList/Status.md +0 -52
  50. package/CapCustomCheckboxList/tests/USE_CASES_ANALYSIS.md +0 -174
  51. package/CapCustomList/README.md +0 -117
  52. package/CapCustomList/Status.md +0 -77
  53. package/CapCustomList/tests/USE_CASES_ANALYSIS.md +0 -124
  54. package/CapCustomSelect/README.md +0 -38
  55. package/CapDatePicker/README.md +0 -139
  56. package/CapDateRangePicker/README.md +0 -159
  57. package/CapDateTimePicker/README.md +0 -136
  58. package/CapDateTimeRangePicker/README.md +0 -243
  59. package/CapDivider/README.md +0 -122
  60. package/CapDrawer/README.md +0 -207
  61. package/CapDrawer/Status.md +0 -52
  62. package/CapDrawer/tests/MISSING_USE_CASES.md +0 -170
  63. package/CapDropdown/README.md +0 -515
  64. package/CapDropdown/Status.md +0 -45
  65. package/CapDropdown/tests/USE_CASES_ANALYSIS.md +0 -137
  66. package/CapError/README.md +0 -88
  67. package/CapErrorBoundary/CapErrorBoundary-use-cases.md +0 -89
  68. package/CapErrorBoundary/README.md +0 -150
  69. package/CapErrorStateIllustration/README.md +0 -222
  70. package/CapErrorStateIllustration/USE_CASES.md +0 -33
  71. package/CapExpressionEditor/README.md +0 -32
  72. package/CapForm/README.md +0 -132
  73. package/CapForm/Status.md +0 -40
  74. package/CapForm/tests/PHASE1_UNFULFILLED_USE_CASES.md +0 -113
  75. package/CapForm/tests/USE_CASES_ANALYSIS.md +0 -119
  76. package/CapFormItem/README.md +0 -320
  77. package/CapFormItem/Status.md +0 -73
  78. package/CapFormItem/tests/USE_CASES_ANALYSIS.md +0 -84
  79. package/CapGraph/README.md +0 -69
  80. package/CapGraph/USE_CASES.md +0 -66
  81. package/CapHamburgerMenu/README.md +0 -234
  82. package/CapHamburgerMenu/USE_CASES.md +0 -48
  83. package/CapHeader/Status.md +0 -41
  84. package/CapHeading/README.md +0 -220
  85. package/CapHeading/Status.md +0 -41
  86. package/CapIcon/README.md +0 -207
  87. package/CapIllustration/Status.md +0 -41
  88. package/CapImage/README.md +0 -50
  89. package/CapImportMFEComponent/README.md +0 -121
  90. package/CapInfoNote/Status.md +0 -40
  91. package/CapInfoNote/tests/USE_CASES_ANALYSIS.md +0 -114
  92. package/CapInput/README.md +0 -196
  93. package/CapInput/Status.md +0 -123
  94. package/CapInput/tests/USE_CASES_ANALYSIS.md +0 -169
  95. package/CapLanguageProvider/CapLanguageProvider-use-cases.md +0 -56
  96. package/CapLanguageProvider/README.md +0 -206
  97. package/CapLevelGraphRenderer/CapLevelGraphRenderer-test-cases.md +0 -50
  98. package/CapLevelGraphRenderer/README.md +0 -123
  99. package/CapLevelGraphRenderer/Tooltip_MIGRATION_ANALYSIS.md +0 -120
  100. package/CapLink/README.md +0 -203
  101. package/CapLink/Status.md +0 -32
  102. package/CapLink/tests/CapLink.missingUseCases.md +0 -95
  103. package/CapList/README.md +0 -129
  104. package/CapList/Status.md +0 -69
  105. package/CapListLayout/README.md +0 -7
  106. package/CapLogin/README.md +0 -7
  107. package/CapMenu/README.md +0 -86
  108. package/CapModal/README.md +0 -357
  109. package/CapModal/Status.md +0 -52
  110. package/CapModal/tests/USE_CASES_GAPS.md +0 -207
  111. package/CapMultiSelect/README.md +0 -170
  112. package/CapMultiSelect/tests/USE_CASES_ANALYSIS.md +0 -29
  113. package/CapMultiSelectDatePicker/README.md +0 -11
  114. package/CapNavigation/README.md +0 -72
  115. package/CapNotification/README.md +0 -228
  116. package/CapNotificationDropdown/README.md +0 -5
  117. package/CapPopover/README.md +0 -234
  118. package/CapProgress/Status.md +0 -40
  119. package/CapRadio/Status.md +0 -54
  120. package/CapRadioButton/README.md +0 -152
  121. package/CapRadioButton/Status.md +0 -70
  122. package/CapRadioButton/tests/USE_CASES_ANALYSIS.md +0 -120
  123. package/CapRadioCard/README.md +0 -161
  124. package/CapRadioCard/Status.md +0 -78
  125. package/CapRadioGroup/README.md +0 -141
  126. package/CapRadioGroup/Status.md +0 -59
  127. package/CapReorderComponent/README.md +0 -179
  128. package/CapReorderComponent/Status.md +0 -41
  129. package/CapRoadMap/README.md +0 -126
  130. package/CapRoadMap/Status.md +0 -53
  131. package/CapRoadMap/tests/USE_CASE_GAPS.md +0 -92
  132. package/CapRow/README.md +0 -424
  133. package/CapSKUUploader/README.md +0 -189
  134. package/CapSKUUploader/Status.md +0 -66
  135. package/CapSecondaryTopBar/README.md +0 -7
  136. package/CapSelect/README.md +0 -243
  137. package/CapSelectFilter/README.md +0 -121
  138. package/CapShape/README.md +0 -96
  139. package/CapShape/Status.md +0 -36
  140. package/CapShape/tests/USE_CASES_ANALYSIS.md +0 -120
  141. package/CapSideBar/README.md +0 -298
  142. package/CapSideBar/Status.md +0 -5
  143. package/CapSlideBox/README.md +0 -68
  144. package/CapSlider/README.md +0 -423
  145. package/CapSlider/Status.md +0 -48
  146. package/CapSlider/tests/TEST_COVERAGE.md +0 -118
  147. package/CapSnackBar/README.md +0 -222
  148. package/CapSnackBar/Status.md +0 -41
  149. package/CapSomethingWentWrong/README.md +0 -97
  150. package/CapSplit/README.md +0 -19
  151. package/CapStatisticCard/README.md +0 -138
  152. package/CapStatus/README.md +0 -148
  153. package/CapStatus/Status.md +0 -40
  154. package/CapSteps/Status.md +0 -40
  155. package/CapStepsAccordian/README.md +0 -305
  156. package/CapStepsAccordian/Status.md +0 -48
  157. package/CapSupportVideosWrapper/README.md +0 -14
  158. package/CapSwitch/README.md +0 -351
  159. package/CapTab/README.md +0 -406
  160. package/CapTab/Status.md +0 -104
  161. package/CapTab/tests/USE_CASE_GAPS.md +0 -143
  162. package/CapTabV3/ANALYSIS.md +0 -60
  163. package/CapTabV3/README.md +0 -156
  164. package/CapTabV3/Status.md +0 -52
  165. package/CapTabV3/tests/USE_CASE_GAPS.md +0 -149
  166. package/CapTable/README.md +0 -160
  167. package/CapTable/Status.md +0 -41
  168. package/CapTag/README.md +0 -16
  169. package/CapTagDropdown/README.md +0 -171
  170. package/CapTagDropdown/Status.md +0 -55
  171. package/CapTimePicker/README.md +0 -170
  172. package/CapTooltip/README.md +0 -336
  173. package/CapTooltipWithInfo/Status.md +0 -75
  174. package/CapTopBar/README.md +0 -146
  175. package/CapTree/README.md +0 -124
  176. package/CapTree/Status.md +0 -48
  177. package/CapTree/tests/STATUS.md +0 -154
  178. package/CapTreeSelect/README.md +0 -217
  179. package/CapTreeSelect/Status.md +0 -52
  180. package/CapTruncateList/README.md +0 -13
  181. package/CapUnifiedSelect/README.md +0 -40
  182. package/CapUploader/README.md +0 -313
  183. package/CapUploader/Status.md +0 -76
  184. package/CapUploader/tests/USE_CASES_ANALYSIS.md +0 -225
  185. package/CapUserProfile/README.md +0 -105
  186. package/CapUserProfile/Status.md +0 -95
  187. package/CapVirtualList/README.md +0 -162
  188. package/CapVirtualList/Status.md +0 -71
  189. package/assets/HOCs/ComponentWithLabelHOC/README.md +0 -230
package/CapForm/README.md DELETED
@@ -1,132 +0,0 @@
1
- # CapForm Migration: Ant Design v3 → v6
2
-
3
- ## Migration Summary
4
-
5
- CapForm has been migrated from Ant Design v3 to v6. This component is a thin wrapper around Ant Design's Form component that provides consistent styling and layout defaults.
6
-
7
- ## Breaking Changes
8
-
9
- ### Form.create() No Longer Exported
10
-
11
- **Breaking Change:** The original `cap-ui-library` component exported `Form.create` as part of its API. This is **no longer exported** in the migrated component.
12
-
13
- **Before (cap-ui-library):**
14
- ```javascript
15
- import CapForm from '@capillarytech/cap-ui-library/CapForm';
16
-
17
- // Form.create was available
18
- const WrappedForm = CapForm.create()(MyComponent);
19
- ```
20
-
21
- **After (blaze-ui):**
22
- ```tsx
23
- import { Form } from 'antd-v5';
24
- import CapForm from '@capillarytech/blaze-ui';
25
-
26
- // Use Form.useForm() hook instead
27
- const [form] = Form.useForm();
28
-
29
- <CapForm form={form}>
30
- {/* form content */}
31
- </CapForm>
32
- ```
33
-
34
- **Migration:** Replace `Form.create()` HOC pattern with `Form.useForm()` hook pattern, which is the recommended approach in Ant Design v6.
35
-
36
- ### All Other Props
37
-
38
- All other CapForm props maintain full backward compatibility. All Ant Design Form props are passed through unchanged.
39
-
40
- ## Deprecated Props
41
-
42
- ### Ant Design Form Component Props
43
-
44
- **Status:** ✅ **No deprecated props**
45
-
46
- The Ant Design `Form` component does not have any deprecated props in v6 that require backward compatibility mapping. Unlike other Ant Design components (Dropdown, Tooltip, Tabs, etc.), the Form component's prop API remained stable during the v3 → v6 migration.
47
-
48
- **Verified Ant Design Form Props (All Supported):**
49
- - `layout` - Form layout type (`'horizontal' | 'vertical' | 'inline'`)
50
- - `labelCol` - Label layout configuration
51
- - `wrapperCol` - Wrapper layout configuration
52
- - `colon` - Whether to show colon after label
53
- - `preserve` - Whether to preserve field values
54
- - `scrollToFirstError` - Whether to scroll to first error on submit
55
- - `size` - Form size (`'small' | 'middle' | 'large'`)
56
- - `requiredMark` - Required mark style
57
- - `form` - Form instance (from `Form.useForm()`)
58
- - All other `FormProps` from Ant Design v6
59
-
60
- **Note:** The Form component API changed from using `Form.create()` HOC to `Form.useForm()` hook, but this is an API pattern change, not a prop deprecation.
61
-
62
- ## API Changes
63
-
64
- CapForm maintains full compatibility with Ant Design v6 Form API:
65
- - Uses `Form.useForm()` hook pattern (recommended in v6)
66
- - Passes through all `FormProps` from Ant Design v6
67
- - Maintains the same prop interface (except `Form.create` export)
68
-
69
- ## Styling Migration
70
-
71
- ### Before (v3/v5)
72
- - Used `:global` SCSS blocks to override Ant Design form styles
73
- - Multiple `.ant-form-*` class overrides for spacing and layout
74
-
75
- ### After (v6)
76
- - All form styling migrated to theme tokens in `getCapThemeConfig.ts`
77
- - Removed all `:global` blocks and `.ant-*` selectors from `styles.scss`
78
- - Form spacing controlled via Ant Design design tokens:
79
- - `components.Form.itemMarginBottom` - Form item spacing (24px)
80
- - `components.Form.labelColonMarginInlineEnd` - Label padding (16px)
81
-
82
- ### Custom Styles
83
-
84
- The component now only includes minimal wrapper styles. All Ant Design form styling is handled through the theme configuration system.
85
-
86
- ## Usage
87
-
88
- ```tsx
89
- import CapForm from '@capillarytech/blaze-ui';
90
- import { Form } from 'antd-v5';
91
-
92
- // Basic usage
93
- <CapForm layout="vertical">
94
- <Form.Item name="username">
95
- <Input />
96
- </Form.Item>
97
- </CapForm>
98
-
99
- // With form instance (v6 recommended pattern)
100
- const [form] = Form.useForm();
101
-
102
- <CapForm form={form} layout="horizontal">
103
- <Form.Item name="email">
104
- <Input />
105
- </Form.Item>
106
- </CapForm>
107
- ```
108
-
109
- ## Theme Configuration
110
-
111
- Form styling is controlled via `getCapThemeConfig()`. To customize form appearance:
112
-
113
- ```tsx
114
- import { getCapThemeConfig } from '@capillarytech/blaze-ui/utils';
115
-
116
- const customTheme = getCapThemeConfig({
117
- components: {
118
- Form: {
119
- itemMarginBottom: 32, // Custom spacing
120
- labelColonMarginInlineEnd: 20, // Custom label padding
121
- },
122
- },
123
- });
124
- ```
125
-
126
- ## Migration Notes
127
-
128
- - **Breaking Change:** If you were using `CapForm.create()`, you must migrate to `Form.useForm()` hook pattern
129
- - **No prop changes required** - All Form props work identically to v5/v6
130
- - Form validation, layout, and styling work identically to v5
131
- - Component is fully compatible with Ant Design v6 Form API
132
- - All Ant Design Form props are passed through unchanged (no deprecated props to handle)
package/CapForm/Status.md DELETED
@@ -1,40 +0,0 @@
1
- # Migration Status: CapForm
2
-
3
- **Last Updated**: 2026-01-31 19:17:58
4
-
5
- ## Migration Steps
6
-
7
- - [x] **Step 0**: Setup branch and remote tracking
8
- - [x] **Step 1**: Migration Prompt 1 (Main migration)
9
- - [x] **Step 2**: Migration Prompt 2 (Storybook support)
10
- - [x] **Step 3**: Migration Prompt 3 (Unit tests)
11
- - [x] **Step 4**: Migration Prompt 4 (Visual test cases)
12
- - [x] **Step 5**: Linting (ESLint)
13
- - [x] **Step 6**: Pre-build Validation
14
- - [] **Step 7**: Build blaze-ui
15
- - [] **Step 8**: Visual Testing
16
- - [] **Step 9**: CSS Analysis (if mismatches found)
17
- - [] **Step 9.5**: CSS Analysis Completed
18
- - [] **Step 10**: Git Commit & Push to branch (pre-commit hook will run tests)
19
- - [] **Step 11**: Create Pull Request
20
-
21
- ## Visual Testing Results
22
-
23
- **Last Test**: 2026-01-31 19:17:58
24
- **Maximum Mismatch**: 0%
25
-
26
- ### Mismatched Variants:
27
- -
28
-
29
-
30
- ## CSS Fixes Applied
31
-
32
- **Date**: 2026-01-31 12:41:18
33
- **Summary**: CSS fixes applied based on visual testing analysis.
34
-
35
- _See full analysis in: `/Users/sarahkhader/repos/migration/blaze-ui/tools/visual-testing/report/CapForm/css-fix-analysis.md`_
36
-
37
-
38
- ## Notes
39
-
40
- _No notes yet._
@@ -1,113 +0,0 @@
1
- # Phase 1: CapForm Use Cases NOT Currently Fulfilled
2
-
3
- ## Overview
4
- This document identifies use cases that CapForm component does **NOT** currently fulfill or support out-of-the-box.
5
-
6
- ## ⚠️ Use Cases NOT Fulfilled
7
-
8
- ### 1. Form Instance Access via Ref Forwarding
9
- **Status**: ❌ **NOT Supported**
10
- - **Issue**: Component doesn't expose Form instance methods via ref forwarding
11
- - **Current Behavior**:
12
- - Users must use `Form.useForm()` hook separately
13
- - No `ref` prop that forwards to Form instance
14
- - Cannot access form methods directly from parent component via ref
15
- - **Workaround**: Users must use `Form.useForm()` hook and pass `form` prop
16
- - **Impact**: Medium - Requires additional boilerplate code
17
- - **Recommendation**: Consider adding `React.forwardRef` to expose form instance methods
18
-
19
- ### 2. Built-in Loading State Management
20
- **Status**: ❌ **NOT Built-in**
21
- - **Issue**: No built-in loading state management during form submission
22
- - **Current Behavior**:
23
- - Users must manage loading state manually
24
- - No `loading` prop on CapForm
25
- - Form doesn't automatically disable during async submission
26
- - **Expected Behavior** (if required):
27
- - Add `loading` prop that disables form fields during submission
28
- - Or provide loading state management helper
29
- - **Impact**: Low - Typically handled at application level
30
- - **Recommendation**: This is typically handled at application level, but could be a convenience feature
31
-
32
- ### 3. Nested Forms Support
33
- **Status**: ❌ **NOT Supported/Recommended**
34
- - **Issue**: Ant Design doesn't officially support nested forms, and CapForm doesn't prevent or handle this
35
- - **Current Behavior**:
36
- - Nested forms may cause unexpected behavior
37
- - Not tested or documented
38
- - No validation or prevention mechanism
39
- - **Impact**: Low - Nested forms are anti-pattern
40
- - **Recommendation**: Document that nested forms are not supported and may cause issues
41
-
42
- ### 4. Form.create() HOC Pattern
43
- **Status**: ❌ **NOT Supported** (Breaking Change from v3)
44
- - **Issue**: Original `cap-ui-library` component exported `Form.create` HOC, which is no longer available
45
- - **Current Behavior**:
46
- - `Form.create()` is not exported
47
- - Must use `Form.useForm()` hook pattern instead
48
- - **Migration Required**: Replace `Form.create()` HOC with `Form.useForm()` hook
49
- - **Impact**: High - Breaking change for existing codebases
50
- - **Recommendation**: Document migration path clearly
51
-
52
- ## ✅ Use Cases Supported (But Require Explicit Implementation)
53
-
54
- The following use cases ARE supported via Ant Design FormProps passthrough, but require users to implement them explicitly:
55
-
56
- ### 5. Form List/Dynamic Fields
57
- **Status**: ✅ Supported (via Ant Design Form.List)
58
- - **Note**: Component passes through all FormProps, so Form.List works
59
- - **Requirement**: Users must implement Form.List manually
60
- - **Test Coverage**: ✅ Now tested
61
-
62
- ### 6. Form Field Dependencies
63
- **Status**: ✅ Supported (via Ant Design Form.Item dependencies)
64
- - **Note**: Component passes through FormProps, so dependencies work
65
- - **Requirement**: Users must implement `shouldUpdate` or `dependencies` manually
66
- - **Test Coverage**: ✅ Now tested
67
-
68
- ### 7. Custom Validation Rules
69
- **Status**: ✅ Supported (via Ant Design Form.Item rules)
70
- - **Note**: Component passes through FormProps, so custom validation rules work
71
- - **Requirement**: Users must implement custom validators manually
72
- - **Test Coverage**: ✅ Now tested
73
-
74
- ### 8. Form Reset Functionality
75
- **Status**: ✅ Supported (via Ant Design Form instance methods)
76
- - **Note**: Form reset is available via form instance methods
77
- - **Requirement**: Users must call `form.resetFields()` manually
78
- - **Test Coverage**: ✅ Now tested
79
-
80
- ### 9. Form Field Value Watching
81
- **Status**: ✅ Supported (via Ant Design Form.Item shouldUpdate or Form.useWatch)
82
- - **Note**: Component supports this via Ant Design APIs
83
- - **Requirement**: Users must implement `Form.useWatch` or `shouldUpdate` manually
84
- - **Test Coverage**: ✅ Now tested
85
-
86
- ### 10. Form Validation Feedback Timing
87
- **Status**: ✅ Supported (via Ant Design validateTrigger)
88
- - **Note**: Component passes through FormProps, so validateTrigger works
89
- - **Requirement**: Users must set `validateTrigger` prop manually
90
- - **Test Coverage**: ✅ Now tested
91
-
92
- ## Summary
93
-
94
- ### Critical Gaps (Must Address)
95
- 1. **Form.create() HOC removal** - Breaking change requiring migration
96
- 2. **No ref forwarding** - Cannot access form instance via ref
97
-
98
- ### Nice-to-Have Features
99
- 1. **Built-in loading state** - Convenience feature, typically handled at app level
100
- 2. **Nested forms prevention** - Documentation/warning needed
101
-
102
- ### Well-Supported (Via Passthrough)
103
- - All Ant Design Form features work via FormProps passthrough
104
- - Form instance methods available via `Form.useForm()` hook
105
- - Dynamic fields, dependencies, validation all supported
106
- - Test coverage now comprehensive
107
-
108
- ## Recommendations
109
-
110
- 1. **High Priority**: Document `Form.create()` migration path clearly
111
- 2. **Medium Priority**: Consider adding ref forwarding for form instance access
112
- 3. **Low Priority**: Add `loading` prop if commonly needed across codebase
113
- 4. **Low Priority**: Add warning/documentation for nested forms anti-pattern
@@ -1,119 +0,0 @@
1
- # CapForm Use Cases Analysis
2
-
3
- ## Component Overview
4
- CapForm is a wrapper around Ant Design v5 Form component that adds:
5
- - Custom wrapper div with styling (`cap-form-wrapper`)
6
- - Default layout of 'vertical'
7
- - Custom className support
8
- - Passes through all Ant Design FormProps
9
-
10
- ## Phase 1: Use Cases NOT Currently Fulfilled
11
-
12
- ### 1. Form Instance Access
13
- **Status**: ⚠️ Not Explicitly Documented/Tested
14
- **Issue**: Component doesn't expose Form instance methods (getFieldsValue, setFieldsValue, validateFields, etc.) in a convenient way
15
- **Current Behavior**:
16
- - Form instance is available via `Form.useForm()` hook, but CapForm doesn't provide a ref or instance prop
17
- - Users must use Ant Design's Form.useForm() hook separately
18
-
19
- **Expected Behavior** (if required):
20
- - Provide form instance via ref forwarding
21
- - Or expose form methods through a prop
22
-
23
- **Recommendation**: Document that users should use `Form.useForm()` hook and pass `form` prop to CapForm, or add ref forwarding if needed.
24
-
25
- ### 2. Form List/Dynamic Fields
26
- **Status**: ✅ Supported (via Ant Design Form.List)
27
- **Note**: Component passes through all FormProps, so Form.List should work, but it's not explicitly tested or documented in CapForm context.
28
-
29
- **Recommendation**: Add test cases and examples for Form.List usage.
30
-
31
- ### 3. Form Dependencies (shouldUpdate, dependencies)
32
- **Status**: ✅ Supported (via Ant Design Form.Item dependencies)
33
- **Note**: Component passes through FormProps, so dependencies work, but not explicitly tested.
34
-
35
- **Recommendation**: Add test cases for form field dependencies.
36
-
37
- ### 4. Custom Validation Rules
38
- **Status**: ✅ Supported (via Ant Design Form.Item rules)
39
- **Note**: Component passes through FormProps, so custom validation rules work via Form.Item, but not explicitly tested at CapForm level.
40
-
41
- **Recommendation**: Add test cases demonstrating custom validation.
42
-
43
- ### 5. Form Reset Functionality
44
- **Status**: ✅ Supported (via Ant Design Form instance methods)
45
- **Note**: Form reset is available via form instance methods, but not explicitly tested.
46
-
47
- **Recommendation**: Add test cases for form reset scenarios.
48
-
49
- ### 6. Form Field Value Watching
50
- **Status**: ✅ Supported (via Ant Design Form.Item shouldUpdate or Form.useWatch)
51
- **Note**: Component supports this via Ant Design APIs, but not explicitly tested.
52
-
53
- **Recommendation**: Add test cases for value watching scenarios.
54
-
55
- ### 7. Form Submission Loading State
56
- **Status**: ⚠️ Not Built-in
57
- **Issue**: No built-in loading state management during form submission
58
- **Current Behavior**:
59
- - Users must manage loading state manually
60
- - No `loading` prop on CapForm
61
-
62
- **Expected Behavior** (if required):
63
- - Add `loading` prop that disables form during submission
64
- - Or provide loading state management helper
65
-
66
- **Recommendation**: This is typically handled at application level, but could be a convenience feature.
67
-
68
- ### 8. Form Validation Feedback Timing
69
- **Status**: ✅ Supported (via Ant Design validateTrigger)
70
- **Note**: Component passes through FormProps, so validateTrigger works, but not explicitly tested.
71
-
72
- **Recommendation**: Add test cases for different validation trigger scenarios (onChange, onBlur, onSubmit).
73
-
74
- ### 9. Nested Forms
75
- **Status**: ⚠️ Not Recommended/Tested
76
- **Issue**: Ant Design doesn't officially support nested forms, and CapForm doesn't prevent or handle this
77
- **Current Behavior**:
78
- - Nested forms may cause unexpected behavior
79
- - Not tested or documented
80
-
81
- **Recommendation**: Document that nested forms are not supported and may cause issues.
82
-
83
- ### 10. Form Field Array Operations
84
- **Status**: ✅ Supported (via Ant Design Form.List)
85
- **Note**: Component supports Form.List for dynamic fields, but array operations (add, remove, move) are not explicitly tested.
86
-
87
- **Recommendation**: Add test cases for Form.List add/remove/move operations.
88
-
89
- ## Test Coverage Summary
90
-
91
- The comprehensive test suite covers:
92
- ✅ Default rendering and initialization
93
- ✅ Layout variations (horizontal, vertical, inline)
94
- ✅ Custom className application
95
- ✅ Form callbacks (onFinish, onFinishFailed)
96
- ✅ Initial values handling
97
- ✅ Form props passthrough (size, requiredMark, colon, preserve, labelCol, wrapperCol, scrollToFirstError)
98
- ✅ User interactions (form submission, input changes)
99
- ✅ Edge cases (empty form, null/undefined children, multiple classNames)
100
- ✅ Accessibility (form role, ARIA attributes, keyboard navigation)
101
- ✅ Data flow and state management (re-renders, initialValues changes)
102
- ✅ Conditional rendering
103
-
104
- ## Recommendations
105
-
106
- 1. **High Priority**: Add test cases for Form.List (dynamic fields)
107
- 2. **High Priority**: Add test cases for form instance methods (getFieldsValue, setFieldsValue, validateFields, resetFields)
108
- 3. **Medium Priority**: Add test cases for form field dependencies
109
- 4. **Medium Priority**: Add test cases for custom validation rules
110
- 5. **Low Priority**: Consider adding loading state prop if commonly needed
111
- 6. **Low Priority**: Document form instance usage patterns
112
- 7. **Low Priority**: Add test cases for validateTrigger variations
113
-
114
- ## Notes
115
-
116
- - CapForm is a thin wrapper around Ant Design Form
117
- - Most functionality comes from Ant Design FormProps passthrough
118
- - Component focuses on styling and default layout configuration
119
- - All Ant Design Form features are available but may need explicit testing/documentation