@capillarytech/blaze-ui 5.21.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.
- package/CapLanguageProvider/actions.js +125 -0
- package/CapLanguageProvider/actions.js.map +1 -0
- package/CapLanguageProvider/constants.js +37 -0
- package/CapLanguageProvider/constants.js.map +1 -0
- package/package.json +1 -1
- package/CapActionBar/README.md +0 -11
- package/CapAdvancedIcon/README.md +0 -185
- package/CapAdvancedIcon/use-cases.md +0 -44
- package/CapAlert/README.md +0 -144
- package/CapAppNotEnabled/README.md +0 -84
- package/CapAskAira/README.md +0 -328
- package/CapBanner/README.md +0 -4
- package/CapBlock/README.md +0 -175
- package/CapBorderedBox/Status.md +0 -40
- package/CapCSVFileUploader/README.md +0 -124
- package/CapCSVFileUploader/Status.md +0 -47
- package/CapCard/README.md +0 -85
- package/CapCard/Status.md +0 -41
- package/CapCardBox/README.md +0 -169
- package/CapCardBox/Status.md +0 -52
- package/CapCarousel/README.md +0 -190
- package/CapCarousel/Status.md +0 -73
- package/CapCheckbox/README.md +0 -254
- package/CapCheckbox/Status.md +0 -41
- package/CapColorPicker/README.md +0 -112
- package/CapColorPicker/Status.md +0 -52
- package/CapColorPicker/tests/USE_CASES_ANALYSIS.md +0 -92
- package/CapColoredTag/README.md +0 -167
- package/CapColoredTag/Status.md +0 -49
- package/CapConditionPreview/MIGRATION_ANALYSIS.md +0 -70
- package/CapConditionPreview/README.md +0 -40
- package/CapConditionPreview/tests/USE_CASES_CapConditionPreview.md +0 -65
- package/CapCustomCard/README.md +0 -182
- package/CapCustomCard/Status.md +0 -40
- package/CapCustomCarousel/Status.md +0 -69
- package/CapCustomCheckboxList/README.md +0 -178
- package/CapCustomCheckboxList/Status.md +0 -52
- package/CapCustomCheckboxList/tests/USE_CASES_ANALYSIS.md +0 -174
- package/CapCustomList/README.md +0 -117
- package/CapCustomList/Status.md +0 -77
- package/CapCustomList/tests/USE_CASES_ANALYSIS.md +0 -124
- package/CapCustomSelect/README.md +0 -38
- package/CapDatePicker/README.md +0 -139
- package/CapDateRangePicker/README.md +0 -159
- package/CapDateTimePicker/README.md +0 -136
- package/CapDateTimeRangePicker/README.md +0 -243
- package/CapDivider/README.md +0 -122
- package/CapDrawer/README.md +0 -207
- package/CapDrawer/Status.md +0 -52
- package/CapDrawer/tests/MISSING_USE_CASES.md +0 -170
- package/CapDropdown/README.md +0 -515
- package/CapDropdown/Status.md +0 -45
- package/CapDropdown/tests/USE_CASES_ANALYSIS.md +0 -137
- package/CapError/README.md +0 -88
- package/CapErrorBoundary/CapErrorBoundary-use-cases.md +0 -89
- package/CapErrorBoundary/README.md +0 -150
- package/CapErrorStateIllustration/README.md +0 -222
- package/CapErrorStateIllustration/USE_CASES.md +0 -33
- package/CapExpressionEditor/README.md +0 -32
- package/CapForm/README.md +0 -132
- package/CapForm/Status.md +0 -40
- package/CapForm/tests/PHASE1_UNFULFILLED_USE_CASES.md +0 -113
- package/CapForm/tests/USE_CASES_ANALYSIS.md +0 -119
- package/CapFormItem/README.md +0 -320
- package/CapFormItem/Status.md +0 -73
- package/CapFormItem/tests/USE_CASES_ANALYSIS.md +0 -84
- package/CapGraph/README.md +0 -69
- package/CapGraph/USE_CASES.md +0 -66
- package/CapHamburgerMenu/README.md +0 -234
- package/CapHamburgerMenu/USE_CASES.md +0 -48
- package/CapHeader/Status.md +0 -41
- package/CapHeading/README.md +0 -220
- package/CapHeading/Status.md +0 -41
- package/CapIcon/README.md +0 -207
- package/CapIllustration/Status.md +0 -41
- package/CapImage/README.md +0 -50
- package/CapImportMFEComponent/README.md +0 -121
- package/CapInfoNote/Status.md +0 -40
- package/CapInfoNote/tests/USE_CASES_ANALYSIS.md +0 -114
- package/CapInput/README.md +0 -196
- package/CapInput/Status.md +0 -123
- package/CapInput/tests/USE_CASES_ANALYSIS.md +0 -169
- package/CapLanguageProvider/CapLanguageProvider-use-cases.md +0 -56
- package/CapLanguageProvider/README.md +0 -206
- package/CapLevelGraphRenderer/CapLevelGraphRenderer-test-cases.md +0 -50
- package/CapLevelGraphRenderer/README.md +0 -123
- package/CapLevelGraphRenderer/Tooltip_MIGRATION_ANALYSIS.md +0 -120
- package/CapLink/README.md +0 -203
- package/CapLink/Status.md +0 -32
- package/CapLink/tests/CapLink.missingUseCases.md +0 -95
- package/CapList/README.md +0 -129
- package/CapList/Status.md +0 -69
- package/CapListLayout/README.md +0 -7
- package/CapLogin/README.md +0 -7
- package/CapMenu/README.md +0 -86
- package/CapModal/README.md +0 -357
- package/CapModal/Status.md +0 -52
- package/CapModal/tests/USE_CASES_GAPS.md +0 -207
- package/CapMultiSelect/README.md +0 -170
- package/CapMultiSelect/tests/USE_CASES_ANALYSIS.md +0 -29
- package/CapMultiSelectDatePicker/README.md +0 -11
- package/CapNavigation/README.md +0 -72
- package/CapNotification/README.md +0 -228
- package/CapNotificationDropdown/README.md +0 -5
- package/CapPopover/README.md +0 -234
- package/CapProgress/Status.md +0 -40
- package/CapRadio/Status.md +0 -54
- package/CapRadioButton/README.md +0 -152
- package/CapRadioButton/Status.md +0 -70
- package/CapRadioButton/tests/USE_CASES_ANALYSIS.md +0 -120
- package/CapRadioCard/README.md +0 -161
- package/CapRadioCard/Status.md +0 -78
- package/CapRadioGroup/README.md +0 -141
- package/CapRadioGroup/Status.md +0 -59
- package/CapReorderComponent/README.md +0 -179
- package/CapReorderComponent/Status.md +0 -41
- package/CapRoadMap/README.md +0 -126
- package/CapRoadMap/Status.md +0 -53
- package/CapRoadMap/tests/USE_CASE_GAPS.md +0 -92
- package/CapRow/README.md +0 -424
- package/CapSKUUploader/README.md +0 -189
- package/CapSKUUploader/Status.md +0 -66
- package/CapSecondaryTopBar/README.md +0 -7
- package/CapSelect/README.md +0 -243
- package/CapSelectFilter/README.md +0 -121
- package/CapShape/README.md +0 -96
- package/CapShape/Status.md +0 -36
- package/CapShape/tests/USE_CASES_ANALYSIS.md +0 -120
- package/CapSideBar/README.md +0 -298
- package/CapSideBar/Status.md +0 -5
- package/CapSlideBox/README.md +0 -68
- package/CapSlider/README.md +0 -423
- package/CapSlider/Status.md +0 -48
- package/CapSlider/tests/TEST_COVERAGE.md +0 -118
- package/CapSnackBar/README.md +0 -222
- package/CapSnackBar/Status.md +0 -41
- package/CapSomethingWentWrong/README.md +0 -97
- package/CapSplit/README.md +0 -19
- package/CapStatisticCard/README.md +0 -138
- package/CapStatus/README.md +0 -148
- package/CapStatus/Status.md +0 -40
- package/CapSteps/Status.md +0 -40
- package/CapStepsAccordian/README.md +0 -305
- package/CapStepsAccordian/Status.md +0 -48
- package/CapSupportVideosWrapper/README.md +0 -14
- package/CapSwitch/README.md +0 -351
- package/CapTab/README.md +0 -406
- package/CapTab/Status.md +0 -104
- package/CapTab/tests/USE_CASE_GAPS.md +0 -143
- package/CapTabV3/ANALYSIS.md +0 -60
- package/CapTabV3/README.md +0 -156
- package/CapTabV3/Status.md +0 -52
- package/CapTabV3/tests/USE_CASE_GAPS.md +0 -149
- package/CapTable/README.md +0 -160
- package/CapTable/Status.md +0 -41
- package/CapTag/README.md +0 -16
- package/CapTagDropdown/README.md +0 -171
- package/CapTagDropdown/Status.md +0 -55
- package/CapTimePicker/README.md +0 -170
- package/CapTooltip/README.md +0 -336
- package/CapTooltipWithInfo/Status.md +0 -75
- package/CapTopBar/README.md +0 -146
- package/CapTree/README.md +0 -124
- package/CapTree/Status.md +0 -48
- package/CapTree/tests/STATUS.md +0 -154
- package/CapTreeSelect/README.md +0 -217
- package/CapTreeSelect/Status.md +0 -52
- package/CapTruncateList/README.md +0 -13
- package/CapUnifiedSelect/README.md +0 -40
- package/CapUploader/README.md +0 -313
- package/CapUploader/Status.md +0 -76
- package/CapUploader/tests/USE_CASES_ANALYSIS.md +0 -225
- package/CapUserProfile/README.md +0 -105
- package/CapUserProfile/Status.md +0 -95
- package/CapVirtualList/README.md +0 -162
- package/CapVirtualList/Status.md +0 -71
- package/assets/HOCs/ComponentWithLabelHOC/README.md +0 -230
package/CapMultiSelect/README.md
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
# CapMultiSelect
|
|
2
|
-
|
|
3
|
-
Multi-select with tree or flat options. Implemented as a thin wrapper over **CapUnifiedSelect** for backward compatibility with the legacy cap-ui-library API.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Relationship to CapUnifiedSelect
|
|
8
|
-
|
|
9
|
-
- **CapMultiSelect** accepts the legacy prop set (`treeData`, `appliedKeys`, `onSelect`, `searchKey`, etc.) and maps them to **CapUnifiedSelect**.
|
|
10
|
-
- For new code or when you need more control (e.g. `showSearch`, `allowClear`, `headerLabel`, `onConfirm`), use **CapUnifiedSelect** directly with `type={SELECT_TYPES.MULTI_SELECT}` or `SELECT_TYPES.MULTI_TREE_SELECT`. See [Using CapUnifiedSelect directly](#using-capunifiedselect-directly) below.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Props: CapMultiSelect vs original (cap-ui-library)
|
|
15
|
-
|
|
16
|
-
The original **cap-ui-library** `CapMultiSelect` used Ant Design v3 (Popover + Tree + Checkbox) and had many props. The **blaze-ui** version keeps the same public prop names where possible but only **maps** a subset to CapUnifiedSelect; the rest are typed for compatibility but have no effect in the current implementation.
|
|
17
|
-
|
|
18
|
-
### Props that are mapped and supported
|
|
19
|
-
|
|
20
|
-
| CapMultiSelect (blaze-ui) | Type | Default | Maps to CapUnifiedSelect | Notes |
|
|
21
|
-
|---------------------------|------|--------|---------------------------|-------|
|
|
22
|
-
| `treeData` | `TreeDataItem[]` | — | `options` | Converted via `treeDataToOptions()` (see [Data mapping](#data-mapping-treedataitem--optiondata)). |
|
|
23
|
-
| `appliedKeys` | `(string \| number)[]` | — | `value` | Selected values. |
|
|
24
|
-
| `onSelect` | `(keys: (string \| number)[]) => void` | — | `onChange` and `onConfirm` | Fired when selection is applied. |
|
|
25
|
-
| `placeholder` | `string` | — | `placeholder` | |
|
|
26
|
-
| `searchKey` | `'title' \| 'key' \| 'value'` | `'title'` | `searchBasedOn` | `'title'` → `'label'`, `'key'` → `'key'`, `'value'` → `'value'`. |
|
|
27
|
-
| `getPopupContainer` | `(node: HTMLElement) => HTMLElement` | `() => document.body` | `getPopupContainer` | |
|
|
28
|
-
| `triggerClassName` | `string` | — | `containerClassName` | |
|
|
29
|
-
| `popoverClassName` | `string` | — | `popoverClassName` | Merged with default `cap-multi-select-v2-popover`. |
|
|
30
|
-
| `disabled` | `boolean` | — | `disabled` | |
|
|
31
|
-
| `width` | `string` | `'100%'` | `style.width` + wrapper `style` | |
|
|
32
|
-
| `closeText` | `string` | — | `clearText` | |
|
|
33
|
-
| `noResultsFoundText` | `string` | — | `noResultCustomText` | |
|
|
34
|
-
|
|
35
|
-
### Props present in types but not mapped (no-op in current implementation)
|
|
36
|
-
|
|
37
|
-
These exist on **CapMultiSelectProps** for backward compatibility or future use but are **not** passed through to CapUnifiedSelect in the current implementation:
|
|
38
|
-
|
|
39
|
-
- `searchPlaceholder`, `selectedText`, `selectAllText`, `selectAllSearchResultsText`, `moreText`
|
|
40
|
-
- `selectText`, `disableSelectAll`, `maxValuesToSelect`
|
|
41
|
-
- `selectTooltipText`, `showSelectButtonToolTip`, `selectTooltipPlacement`
|
|
42
|
-
- `showFooter`, `searchFocusOnMount`, `alwaysShowFocusOnSearch`, `showSelectAllText`
|
|
43
|
-
- `enableVirtualizedRendering`, `isPossibleTitles`, `isPossibleValues`
|
|
44
|
-
- `target`, `collapseOnSelect`, `allSelectedText`
|
|
45
|
-
|
|
46
|
-
Behavioral differences vs original:
|
|
47
|
-
|
|
48
|
-
- **No footer**: Original had Apply/Cancel and “X selected”; blaze-ui CapMultiSelect uses CapUnifiedSelect with **immediate apply** (no footer).
|
|
49
|
-
- **No “Select all”**: Original could show a “Select all” row; current wrapper does not expose this.
|
|
50
|
-
- **No custom target**: Original `target` let you render a custom trigger; current wrapper always renders the default trigger.
|
|
51
|
-
- **No virtualization toggle**: Original had `enableVirtualizedRendering`; CapUnifiedSelect uses antd’s built-in virtual list by default (see CapUnifiedSelect README).
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## Data mapping: TreeDataItem → OptionData
|
|
56
|
-
|
|
57
|
-
CapMultiSelect uses **TreeDataItem** for `treeData`. This is converted to CapUnifiedSelect’s **OptionData** as follows:
|
|
58
|
-
|
|
59
|
-
| TreeDataItem (input) | OptionData (internal) |
|
|
60
|
-
|----------------------|------------------------|
|
|
61
|
-
| `key` | `value`, `key` |
|
|
62
|
-
| `title` | `label`, `title` |
|
|
63
|
-
| `children` | `children` (recursively converted) |
|
|
64
|
-
| `info` | `optionTooltipInfo` |
|
|
65
|
-
| `className` | `className` |
|
|
66
|
-
|
|
67
|
-
Nested structure is preserved. If any item has `children` with length > 0, the component uses **multi-tree** mode (`SELECT_TYPES.MULTI_TREE_SELECT`); otherwise **multi-select** (`SELECT_TYPES.MULTI_SELECT`).
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## TreeDataItem
|
|
72
|
-
|
|
73
|
-
```ts
|
|
74
|
-
interface TreeDataItem {
|
|
75
|
-
key: string;
|
|
76
|
-
title: React.ReactNode;
|
|
77
|
-
children?: TreeDataItem[];
|
|
78
|
-
info?: React.ReactNode;
|
|
79
|
-
className?: string;
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## Usage (CapMultiSelect)
|
|
86
|
-
|
|
87
|
-
```tsx
|
|
88
|
-
import { CapMultiSelect } from '@capillarytech/blaze-ui';
|
|
89
|
-
|
|
90
|
-
<CapMultiSelect
|
|
91
|
-
treeData={[
|
|
92
|
-
{ key: '1', title: 'Option 1' },
|
|
93
|
-
{ key: '2', title: 'Option 2', children: [{ key: '2-1', title: 'Child' }] },
|
|
94
|
-
]}
|
|
95
|
-
appliedKeys={selectedKeys}
|
|
96
|
-
onSelect={setSelectedKeys}
|
|
97
|
-
placeholder="Select..."
|
|
98
|
-
/>
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## Using CapUnifiedSelect directly
|
|
104
|
-
|
|
105
|
-
To avoid the legacy API and use CapUnifiedSelect’s full API (e.g. `showSearch`, `allowClear`, `onConfirm`, `headerLabel`), use **CapUnifiedSelect** with the same options shape and multi type.
|
|
106
|
-
|
|
107
|
-
1. **Import** CapUnifiedSelect from the main package; constants and types from the component path (they are not re-exported from the package root):
|
|
108
|
-
|
|
109
|
-
```tsx
|
|
110
|
-
import { CapUnifiedSelect } from '@capillarytech/blaze-ui';
|
|
111
|
-
// Constants and types: use the component path (e.g. in a monorepo or from node_modules)
|
|
112
|
-
import { SELECT_TYPES } from '@capillarytech/blaze-ui/components/CapUnifiedSelect/constants';
|
|
113
|
-
import type { OptionData } from '@capillarytech/blaze-ui/components/CapUnifiedSelect/types';
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
2. **Build options** in **OptionData** shape (instead of TreeDataItem):
|
|
117
|
-
|
|
118
|
-
```tsx
|
|
119
|
-
const options: OptionData[] = [
|
|
120
|
-
{ value: '1', key: '1', label: 'Option 1', title: 'Option 1' },
|
|
121
|
-
{
|
|
122
|
-
value: '2',
|
|
123
|
-
key: '2',
|
|
124
|
-
label: 'Option 2',
|
|
125
|
-
title: 'Option 2',
|
|
126
|
-
children: [{ value: '2-1', key: '2-1', label: 'Child', title: 'Child' }],
|
|
127
|
-
},
|
|
128
|
-
];
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
3. **Render** with `type` set to multi-select or multi-tree-select:
|
|
132
|
-
|
|
133
|
-
```tsx
|
|
134
|
-
// Flat multi-select
|
|
135
|
-
<CapUnifiedSelect
|
|
136
|
-
type={SELECT_TYPES.MULTI_SELECT}
|
|
137
|
-
options={options}
|
|
138
|
-
value={selectedKeys}
|
|
139
|
-
onChange={setSelectedKeys}
|
|
140
|
-
onConfirm={setSelectedKeys}
|
|
141
|
-
placeholder="Select..."
|
|
142
|
-
showSearch
|
|
143
|
-
searchBasedOn="label"
|
|
144
|
-
/>
|
|
145
|
-
|
|
146
|
-
// Multi-select with tree (nested options)
|
|
147
|
-
<CapUnifiedSelect
|
|
148
|
-
type={SELECT_TYPES.MULTI_TREE_SELECT}
|
|
149
|
-
options={optionsWithChildren}
|
|
150
|
-
value={selectedKeys}
|
|
151
|
-
onChange={setSelectedKeys}
|
|
152
|
-
onConfirm={setSelectedKeys}
|
|
153
|
-
placeholder="Select..."
|
|
154
|
-
showSearch
|
|
155
|
-
searchBasedOn="label"
|
|
156
|
-
/>
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
4. **Optional**: Use `optionTooltipInfo` for per-option tooltip (replaces legacy `info` on TreeDataItem), `clearText`, `noResultCustomText`, `containerClassName`, `popoverClassName`, `getPopupContainer`, etc. as needed.
|
|
160
|
-
|
|
161
|
-
**Note:** CapUnifiedSelect is wrapped with `injectIntl`; your app should be under React Intl’s `IntlProvider` (e.g. via CapLanguageProvider) so locale messages work.
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## Migration (Antd v3 → v6)
|
|
166
|
-
|
|
167
|
-
- **PropTypes removed**: All props are typed in `types.ts`.
|
|
168
|
-
- **defaultProps removed**: Defaults applied via destructuring in the component (`searchKey = 'title'`, `getPopupContainer = () => document.body`).
|
|
169
|
-
- **Theme**: No `getCapThemeConfig` changes; ant overrides are layout/structure (hide Popover arrow, Tree switcher, custom padding) with no design tokens. SCSS uses `:global` blocks with `// OVERRIDE:` comments and `$CAP_G20` instead of hardcoded `#c2c2c2`.
|
|
170
|
-
- **API**: Uses `popoverClassName` (no `dropdownClassName`). Default popover class `cap-multi-select-v2-popover` is applied so existing SCSS overrides continue to apply.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# CapMultiSelect – Use cases analysis
|
|
2
|
-
|
|
3
|
-
## Phase 0: Use cases (derived from component API and README)
|
|
4
|
-
|
|
5
|
-
- Default rendering with placeholder and wrapper (`cap-multi-select`, width).
|
|
6
|
-
- Flat `treeData` → multi-select; `treeData` with `children` → multi-tree-select.
|
|
7
|
-
- `appliedKeys` displayed as selected labels; `onSelect` called on selection change.
|
|
8
|
-
- Props: `placeholder`, `triggerClassName`, `popoverClassName`, `disabled`, `width`, `closeText`, `noResultsFoundText`, `searchKey`, `getPopupContainer`.
|
|
9
|
-
- Edge cases: empty/undefined `treeData`; items with `info` and `className`.
|
|
10
|
-
|
|
11
|
-
## Phase 1: Use cases the component is NOT fulfilling
|
|
12
|
-
|
|
13
|
-
The following props are declared in `CapMultiSelectProps` (types.ts) for backward compatibility but are **not** passed through to `CapUnifiedSelect` and therefore have no effect:
|
|
14
|
-
|
|
15
|
-
- `searchPlaceholder`
|
|
16
|
-
- `selectedText`, `selectAllText`, `selectAllSearchResultsText`, `moreText`, `selectText`
|
|
17
|
-
- `disableSelectAll`
|
|
18
|
-
- `maxValuesToSelect`
|
|
19
|
-
- `selectTooltipText`, `showSelectButtonToolTip`, `selectTooltipPlacement`
|
|
20
|
-
- `showFooter`
|
|
21
|
-
- `searchFocusOnMount`, `alwaysShowFocusOnSearch`
|
|
22
|
-
- `showSelectAllText`
|
|
23
|
-
- `enableVirtualizedRendering`
|
|
24
|
-
- `isPossibleTitles`, `isPossibleValues`
|
|
25
|
-
- `target`
|
|
26
|
-
- `collapseOnSelect`
|
|
27
|
-
- `allSelectedText`
|
|
28
|
-
|
|
29
|
-
Consumers relying on these props will not see the corresponding behavior until they are wired in the component implementation.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# CapMultiSelectDatePicker
|
|
2
|
-
|
|
3
|
-
A custom date picker component that allows users to select multiple days of the month (1-31) and optionally the last day of the month. This component renders a table-based calendar interface for day selection.
|
|
4
|
-
|
|
5
|
-
## Migration from Class Component to Functional Component
|
|
6
|
-
|
|
7
|
-
This component has been migrated from a class component to a functional component with TypeScript support and CSS Modules.
|
|
8
|
-
|
|
9
|
-
### Breaking Changes
|
|
10
|
-
|
|
11
|
-
None - The component maintains full backward compatibility with the previous API.
|
package/CapNavigation/README.md
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# CapNavigation
|
|
2
|
-
|
|
3
|
-
A comprehensive navigation component that provides topbar, sidebar, and secondary topbar functionality for Capillary applications.
|
|
4
|
-
|
|
5
|
-
## Migration Notes
|
|
6
|
-
|
|
7
|
-
This component has been migrated from `cap-ui-library` to `blaze-ui` with the following changes:
|
|
8
|
-
|
|
9
|
-
- ✅ Converted to TypeScript with full type definitions
|
|
10
|
-
- ✅ Removed PropTypes in favor of TypeScript interfaces
|
|
11
|
-
- ✅ Removed defaultProps in favor of default parameters
|
|
12
|
-
- ✅ Preserved exact DOM structure and behavior
|
|
13
|
-
- ✅ No Ant Design API changes (component uses other Cap components)
|
|
14
|
-
|
|
15
|
-
## Breaking Changes
|
|
16
|
-
|
|
17
|
-
**None** - This component maintains full backward compatibility. All props work exactly as before.
|
|
18
|
-
|
|
19
|
-
## Deprecated Props
|
|
20
|
-
|
|
21
|
-
**None** - No props have been deprecated in this migration.
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
```tsx
|
|
26
|
-
import CapNavigation from '@capillarytech/blaze-ui/CapNavigation';
|
|
27
|
-
import type { CapNavigationProps } from '@capillarytech/blaze-ui/CapNavigation/types';
|
|
28
|
-
|
|
29
|
-
const MyComponent = () => {
|
|
30
|
-
return (
|
|
31
|
-
<CapNavigation
|
|
32
|
-
userData={userData}
|
|
33
|
-
topbarMenuData={topbarMenuData}
|
|
34
|
-
sidebarMenuData={sidebarMenuData}
|
|
35
|
-
showContent
|
|
36
|
-
>
|
|
37
|
-
{/* Your content */}
|
|
38
|
-
</CapNavigation>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Props
|
|
44
|
-
|
|
45
|
-
See `types.ts` for complete TypeScript interface definitions. Key props include:
|
|
46
|
-
|
|
47
|
-
- `userData` - User information, organization details, and current org details
|
|
48
|
-
- `topbarMenuData` - Array of topbar menu items
|
|
49
|
-
- `sidebarMenuData` - Array of sidebar menu items
|
|
50
|
-
- `dropdownMenuProps` - Array of dropdown menu items
|
|
51
|
-
- `showContent` - Whether to show the content area
|
|
52
|
-
- `showSecondaryTopBar` - Whether to show secondary topbar instead of main topbar
|
|
53
|
-
- `isLatestLeftNavigationEnabled` - Whether to enable latest left navigation (deprecated feature)
|
|
54
|
-
|
|
55
|
-
## Component Structure
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
CapNavigation
|
|
59
|
-
├── CapTopBar / CapSecondaryTopBar (conditional)
|
|
60
|
-
├── Content Wrapper (conditional: showContent)
|
|
61
|
-
│ ├── Component Wrapper
|
|
62
|
-
│ │ └── Left Navbar Controller
|
|
63
|
-
│ │ ├── CapSideBar (conditional: showSidebar)
|
|
64
|
-
│ │ └── children
|
|
65
|
-
└── CapUserProfile (conditional: showUserProfile)
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Notes
|
|
69
|
-
|
|
70
|
-
- The `CapCollapsibleLeftNavigation` component usage has been commented out as it's deprecated, but the component structure is preserved for backward compatibility
|
|
71
|
-
- All styling and behavior matches the original component exactly
|
|
72
|
-
- The component uses other Cap components (CapTopBar, CapSideBar, etc.) which handle their own Ant Design integration
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
# CapNotification
|
|
2
|
-
|
|
3
|
-
A wrapper component around Ant Design's Notification component that provides consistent styling and a simplified API for showing notification messages in Capillary applications.
|
|
4
|
-
|
|
5
|
-
## Migration from Ant Design v3 to v6
|
|
6
|
-
|
|
7
|
-
This component has been migrated from Ant Design v3 to v6 with the following changes:
|
|
8
|
-
|
|
9
|
-
### Breaking Changes
|
|
10
|
-
|
|
11
|
-
#### 1. API Changes
|
|
12
|
-
|
|
13
|
-
| v3 API | v6 API | Status | Migration Guide |
|
|
14
|
-
|--------|--------|--------|-----------------|
|
|
15
|
-
| `message` | `title` | Deprecated | Replace `message` with `title`. Backward compatibility maintained. |
|
|
16
|
-
| `btn` | `actions` | Deprecated | Replace `btn` with `actions`. Backward compatibility maintained. |
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
### Backward Compatibility
|
|
20
|
-
|
|
21
|
-
The component maintains backward compatibility for deprecated props:
|
|
22
|
-
|
|
23
|
-
- **`message` prop**: Still works but logs a deprecation warning in development. Use `title` instead.
|
|
24
|
-
- **`btn` prop**: Still works but logs a deprecation warning in development. Use `actions` instead.
|
|
25
|
-
|
|
26
|
-
### Style Changes
|
|
27
|
-
|
|
28
|
-
**Approach**: The component now calls the appropriate notification method (`notification.success()`, `notification.error()`, etc.) which automatically applies the correct background colors through the theme tokens.
|
|
29
|
-
|
|
30
|
-
### Code Improvements
|
|
31
|
-
|
|
32
|
-
1. **Removed styled-components dependency**: Replaced with SCSS class `notification-heading`
|
|
33
|
-
2. **Using legacy warning utility**: Now uses `logDeprecationWarning` utility for consistent deprecation warnings
|
|
34
|
-
3. **Improved backward compatibility**: Deprecated props are mapped using nullish coalescing (`??`) for cleaner code
|
|
35
|
-
4. **Tokenization over CSS overrides**: Background colors are now controlled through Ant Design theme tokens instead of custom CSS
|
|
36
|
-
|
|
37
|
-
### What Stayed the Same
|
|
38
|
-
|
|
39
|
-
- All notification methods (`success`, `error`, `info`, `warning`, `custom`)
|
|
40
|
-
- Custom icon support
|
|
41
|
-
- Word-break behavior for long text
|
|
42
|
-
- API surface area (backward compatible)
|
|
43
|
-
- Custom border color support for `custom` type
|
|
44
|
-
|
|
45
|
-
### What Changed
|
|
46
|
-
|
|
47
|
-
- **Removed**: `styled-components` dependency
|
|
48
|
-
- **Removed**: CSS overrides for background colors (now uses tokens)
|
|
49
|
-
- **Removed**: `::before` pseudo-elements for colored borders
|
|
50
|
-
- **Added**: SCSS module with `styles[]` syntax for minimal styling
|
|
51
|
-
- **Added**: `logDeprecationWarning` utility for consistent warnings
|
|
52
|
-
- **Added**: Theme tokens for notification background colors
|
|
53
|
-
- **Improved**: Calls correct notification method (`success`, `error`, etc.) for proper token application
|
|
54
|
-
|
|
55
|
-
## Usage
|
|
56
|
-
|
|
57
|
-
### Basic Usage
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
import CapNotification from '@capillarytech/blaze-ui/components/CapNotification';
|
|
61
|
-
|
|
62
|
-
// Success notification
|
|
63
|
-
CapNotification.success({
|
|
64
|
-
title: 'Success',
|
|
65
|
-
description: 'Your action was completed successfully!',
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// Error notification
|
|
69
|
-
CapNotification.error({
|
|
70
|
-
title: 'Error',
|
|
71
|
-
description: 'Something went wrong. Please try again.',
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// Info notification
|
|
75
|
-
CapNotification.info({
|
|
76
|
-
title: 'Information',
|
|
77
|
-
description: 'Here is some important information.',
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
// Warning notification
|
|
81
|
-
CapNotification.warning({
|
|
82
|
-
title: 'Warning',
|
|
83
|
-
description: 'Please be careful with this action.',
|
|
84
|
-
});
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Custom Notification
|
|
88
|
-
|
|
89
|
-
```typescript
|
|
90
|
-
// Custom notification with custom icon and border color
|
|
91
|
-
CapNotification.custom({
|
|
92
|
-
title: 'Custom Notification',
|
|
93
|
-
description: 'This is a custom styled notification.',
|
|
94
|
-
icon: <YourCustomIcon />,
|
|
95
|
-
bgColor: '#ff5722',
|
|
96
|
-
});
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### With Custom Actions (v6 API)
|
|
100
|
-
|
|
101
|
-
```typescript
|
|
102
|
-
CapNotification.success({
|
|
103
|
-
title: 'Action Required',
|
|
104
|
-
description: 'Please confirm your action.',
|
|
105
|
-
actions: (
|
|
106
|
-
<Button type="primary" size="small" onClick={handleAction}>
|
|
107
|
-
Confirm
|
|
108
|
-
</Button>
|
|
109
|
-
),
|
|
110
|
-
});
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### Advanced Configuration
|
|
114
|
-
|
|
115
|
-
```typescript
|
|
116
|
-
CapNotification.open(
|
|
117
|
-
{
|
|
118
|
-
title: 'Custom Notification',
|
|
119
|
-
description: 'This notification has custom settings.',
|
|
120
|
-
duration: 10, // Auto-close after 10 seconds
|
|
121
|
-
placement: 'topRight',
|
|
122
|
-
showProgress: true, // Show progress bar
|
|
123
|
-
pauseOnHover: true, // Pause auto-close on hover
|
|
124
|
-
key: 'unique-key', // Unique identifier for updating/closing
|
|
125
|
-
onClick: () => console.log('Notification clicked'),
|
|
126
|
-
onClose: () => console.log('Notification closed'),
|
|
127
|
-
},
|
|
128
|
-
'info'
|
|
129
|
-
);
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### Closing Notifications
|
|
133
|
-
|
|
134
|
-
```typescript
|
|
135
|
-
// Close specific notification by key
|
|
136
|
-
CapNotification.close('unique-key');
|
|
137
|
-
|
|
138
|
-
// Destroy all notifications
|
|
139
|
-
CapNotification.destroy();
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
## API
|
|
143
|
-
|
|
144
|
-
### CapNotification Methods
|
|
145
|
-
|
|
146
|
-
- `CapNotification.success(config)` - Show success notification
|
|
147
|
-
- `CapNotification.error(config)` - Show error notification
|
|
148
|
-
- `CapNotification.info(config)` - Show info notification
|
|
149
|
-
- `CapNotification.warning(config)` - Show warning notification
|
|
150
|
-
- `CapNotification.warn(config)` - Show warning notification (alias)
|
|
151
|
-
- `CapNotification.custom(config)` - Show custom notification with custom icon and border
|
|
152
|
-
- `CapNotification.open(config, type)` - Show notification with specified type
|
|
153
|
-
- `CapNotification.close(key)` - Close notification by key
|
|
154
|
-
- `CapNotification.destroy()` - Destroy all notifications
|
|
155
|
-
|
|
156
|
-
### NotificationConfig
|
|
157
|
-
|
|
158
|
-
| Property | Description | Type | Default |
|
|
159
|
-
|----------|-------------|------|---------|
|
|
160
|
-
| title | The title of notification box | ReactNode | - |
|
|
161
|
-
| message | **Deprecated.** Use `title` instead | ReactNode | - |
|
|
162
|
-
| description | The content of notification box | ReactNode | - |
|
|
163
|
-
| icon | Customized icon | ReactNode | - |
|
|
164
|
-
| bgColor | Custom background color for left border (custom type only) | string | - |
|
|
165
|
-
| duration | Time in seconds before auto-close. Set to 0 or false to never auto-close | number \| false | 4.5 |
|
|
166
|
-
| key | Unique identifier of the notification | string | - |
|
|
167
|
-
| placement | Position of notification | 'top' \| 'topLeft' \| 'topRight' \| 'bottom' \| 'bottomLeft' \| 'bottomRight' | 'topRight' |
|
|
168
|
-
| style | Customized inline style | React.CSSProperties | - |
|
|
169
|
-
| className | Customized CSS class | string | - |
|
|
170
|
-
| onClick | Callback when notification is clicked | () => void | - |
|
|
171
|
-
| onClose | Callback when notification is closed | () => void | - |
|
|
172
|
-
| actions | Customized action buttons (v6 API) | ReactNode | - |
|
|
173
|
-
| btn | **Deprecated.** Use `actions` instead | ReactNode | - |
|
|
174
|
-
| showProgress | Show progress bar for auto-closing | boolean | false |
|
|
175
|
-
| pauseOnHover | Pause auto-close timer on hover | boolean | true |
|
|
176
|
-
|
|
177
|
-
## TypeScript
|
|
178
|
-
|
|
179
|
-
The component exports TypeScript types:
|
|
180
|
-
|
|
181
|
-
```typescript
|
|
182
|
-
import { NotificationConfig, NotificationType, CapNotificationAPI } from '@capillarytech/blaze-ui/components/CapNotification';
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
## Migration Checklist
|
|
186
|
-
|
|
187
|
-
If you're migrating existing code to use the v6 version:
|
|
188
|
-
|
|
189
|
-
- [ ] Replace `message` prop with `title`
|
|
190
|
-
- [ ] Replace `btn` prop with `actions`
|
|
191
|
-
- [ ] Test all notification types (success, error, info, warning, custom)
|
|
192
|
-
- [ ] Verify custom styling still works
|
|
193
|
-
- [ ] Check that notifications display correctly in all placements
|
|
194
|
-
- [ ] Ensure no console warnings in development mode
|
|
195
|
-
|
|
196
|
-
## Notes
|
|
197
|
-
|
|
198
|
-
- The component uses SCSS modules with `styles[]` syntax for minimal styling (word-break only)
|
|
199
|
-
- Background colors for different notification types are controlled via Ant Design theme tokens in `getCapThemeConfig.ts`
|
|
200
|
-
- Custom icons from CapIcon are used for success/error notifications with color styling
|
|
201
|
-
- Custom border color support maintained for `custom` type notifications via inline styles
|
|
202
|
-
- All deprecated props maintain backward compatibility using `logDeprecationWarning` utility
|
|
203
|
-
- The component calls the appropriate notification method (`notification.success()`, `notification.error()`, etc.) to ensure correct token application
|
|
204
|
-
- Deprecated props will be removed in v10.0.0
|
|
205
|
-
|
|
206
|
-
## Theme Customization
|
|
207
|
-
|
|
208
|
-
To customize notification colors, update the theme tokens in your ConfigProvider:
|
|
209
|
-
|
|
210
|
-
```typescript
|
|
211
|
-
import { ConfigProvider } from 'antd-v5';
|
|
212
|
-
import { getCapThemeConfig } from '@capillarytech/blaze-ui/utils';
|
|
213
|
-
|
|
214
|
-
const customTheme = getCapThemeConfig({
|
|
215
|
-
components: {
|
|
216
|
-
Notification: {
|
|
217
|
-
colorSuccessBg: '#your-success-color',
|
|
218
|
-
colorErrorBg: '#your-error-color',
|
|
219
|
-
colorInfoBg: '#your-info-color',
|
|
220
|
-
colorWarningBg: '#your-warning-color',
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
<ConfigProvider theme={customTheme}>
|
|
226
|
-
<YourApp />
|
|
227
|
-
</ConfigProvider>
|
|
228
|
-
```
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# CapNotificationDropdown
|
|
2
|
-
|
|
3
|
-
A dropdown component that displays a list of notifications using Ant Design's Menu component, providing consistent styling and behavior for notification lists in Capillary applications.
|
|
4
|
-
|
|
5
|
-
**No API breaking changes**: The component uses `CapMenu` which is already v6-compatible, and doesn't use any deprecated Ant Design APIs.
|