@cobre-npm/ds-v3 0.126.2 → 0.126.3
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/types/components/atoms/CobreRowActions/interfaces/CobreRowActions.interface.d.ts +8 -0
- package/dist/types/components/organisms/CobreAccountPickerModal/interfaces/account-selector-modal.interface.d.ts +11 -1
- package/dist/types/components/organisms/CobreDynamicForm/interfaces/currencies.interface.d.ts +4 -0
- package/dist/types/components/organisms/CobreDynamicForm/interfaces/field.interface.d.ts +25 -0
- package/dist/types/components/organisms/CobreFilterPanel/interfaces/filter.interface.d.ts +26 -0
- package/dist/types/components/organisms/CobreSideMenu/interfaces/menu.interface.d.ts +15 -0
- package/dist/types/types/button.types.d.ts +5 -0
- package/dist/types/types/icon.types.d.ts +1 -0
- package/dist/types/utils/banksList.d.ts +1 -0
- package/dist/types/utils/index.d.ts +14 -0
- package/dist/types/utils/indicativesList.d.ts +1 -0
- package/package.json +1 -1
package/dist/types/components/atoms/CobreRowActions/interfaces/CobreRowActions.interface.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
/** A single action button rendered by CobreRowActions for a table row, generic over the row's data type T. */
|
|
1
2
|
export interface RowAction<T = unknown> {
|
|
2
3
|
id: string;
|
|
3
4
|
label?: string;
|
|
4
5
|
icon: string;
|
|
6
|
+
/** Tooltip text shown on hover. */
|
|
5
7
|
tooltipText?: string;
|
|
8
|
+
/** Handler invoked with the row's data when the action is clicked. */
|
|
6
9
|
onClick?: (rowData: T) => void | undefined | Promise<void>;
|
|
10
|
+
/** Name of the event emitted instead of (or alongside) calling onClick. */
|
|
7
11
|
eventName?: string;
|
|
12
|
+
/** Whether to show visual feedback after the action runs. */
|
|
8
13
|
feedback?: boolean;
|
|
14
|
+
/** Visual style of the action. */
|
|
9
15
|
type?: 'default' | 'info';
|
|
16
|
+
/** Whether the action is visible; can be a predicate evaluated against the row's data. */
|
|
10
17
|
show?: boolean | ((rowData: T) => boolean);
|
|
18
|
+
/** Whether the action shows a loading state; can be a predicate evaluated against the row's data. */
|
|
11
19
|
isLoading?: boolean | ((rowData: T) => boolean);
|
|
12
20
|
}
|
|
@@ -1,25 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
/** Severity level of an alert shown in the account picker modal. */
|
|
2
|
+
export type AlertType = 'danger' | 'success' | 'warning' | 'info';
|
|
3
|
+
/** An alert message and its severity displayed in the account picker modal. */
|
|
2
4
|
export interface AlertConfig {
|
|
3
5
|
type: AlertType;
|
|
4
6
|
text: string;
|
|
5
7
|
}
|
|
8
|
+
/** A tab in the account picker modal's tab bar. */
|
|
6
9
|
export interface TabConfigItem {
|
|
7
10
|
id: string;
|
|
8
11
|
name: string;
|
|
9
12
|
icon?: string;
|
|
10
13
|
}
|
|
14
|
+
/** A selectable option within an account picker filter. */
|
|
11
15
|
export interface FilterOptionItem {
|
|
12
16
|
id: number;
|
|
13
17
|
label: string;
|
|
14
18
|
value: string;
|
|
15
19
|
}
|
|
20
|
+
/** Configuration for a single filter in the account picker modal. */
|
|
16
21
|
export interface FilterConfig {
|
|
22
|
+
/** Query/parameter key the filter writes to. */
|
|
17
23
|
param: string;
|
|
18
24
|
label: string;
|
|
25
|
+
/** Heading shown above the filter's option list. */
|
|
19
26
|
optionsTitle: string;
|
|
20
27
|
options: FilterOptionItem[];
|
|
28
|
+
/** Currently selected option value(s). */
|
|
21
29
|
value?: string[];
|
|
30
|
+
/** Custom width for the filter's dropdown box (CSS length). */
|
|
22
31
|
customBoxWidth?: string;
|
|
32
|
+
/** Max characters before the displayed label is truncated. */
|
|
23
33
|
maxTextLength?: number;
|
|
24
34
|
disabled?: boolean;
|
|
25
35
|
}
|
package/dist/types/components/organisms/CobreDynamicForm/interfaces/currencies.interface.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
/** A selectable currency option used by CobreDynamicForm currency fields. */
|
|
1
2
|
export interface Currency {
|
|
2
3
|
id: number;
|
|
3
4
|
label: string;
|
|
5
|
+
/** Currency code (e.g. ISO 4217 like 'USD', 'COP'). */
|
|
4
6
|
code: string;
|
|
5
7
|
value: string;
|
|
8
|
+
/** Geographic/region identifier associated with the currency. */
|
|
6
9
|
geo: string;
|
|
10
|
+
/** Minimum amount allowed for this currency. */
|
|
7
11
|
minAmount: number;
|
|
8
12
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { ComputedRef, Component, Ref } from 'vue';
|
|
2
2
|
import { Currency } from './currencies.interface';
|
|
3
|
+
/** Character/validation constraint applied to a CobreDynamicForm input field's value. */
|
|
3
4
|
export type InputType = 'email' | 'anyCharacter' | 'alphanumeric' | 'numeric' | 'letters' | 'password';
|
|
5
|
+
/** Widget rendered for a CobreDynamicForm field. */
|
|
4
6
|
export type FieldType = 'input' | 'select' | 'radio' | 'currency' | 'phone' | 'checkbox' | 'date' | 'url';
|
|
7
|
+
/** Imperative handle exposing a CobreDynamicForm field's validation state and reset action. */
|
|
5
8
|
export interface FieldRef {
|
|
6
9
|
isValid: boolean;
|
|
7
10
|
isDirty: boolean;
|
|
@@ -15,53 +18,75 @@ export interface FieldRef {
|
|
|
15
18
|
areValidLetters: boolean;
|
|
16
19
|
reset: () => void;
|
|
17
20
|
}
|
|
21
|
+
/** Configuration for a single field rendered by CobreDynamicForm, including its widget type, value, validation, and per-widget props. */
|
|
18
22
|
export interface Field {
|
|
19
23
|
id: string;
|
|
20
24
|
type: FieldType;
|
|
25
|
+
/** Reactive handle to the field's validation state (see FieldRef). */
|
|
21
26
|
ref?: Ref<Partial<FieldRef | null>>;
|
|
22
27
|
label: string;
|
|
23
28
|
placeholder?: string;
|
|
24
29
|
name?: string;
|
|
25
30
|
value: any;
|
|
26
31
|
required: boolean;
|
|
32
|
+
/** Whether the field is shown in the form. */
|
|
27
33
|
visible: boolean;
|
|
34
|
+
/** Number of grid columns the field spans in the form layout. */
|
|
28
35
|
colSpan?: number;
|
|
36
|
+
/** CSS class applied to the field's wrapper element. */
|
|
29
37
|
parentClass?: string;
|
|
38
|
+
/** CSS class applied to the field's control element. */
|
|
30
39
|
className?: string;
|
|
40
|
+
/** Validation rules and custom validity check applied to the field's value. */
|
|
31
41
|
validation?: {
|
|
32
42
|
minLength?: number | ComputedRef<number>;
|
|
33
43
|
maxLength?: number | ComputedRef<number>;
|
|
34
44
|
minAmount?: number;
|
|
35
45
|
type?: InputType;
|
|
46
|
+
/** Message displayed when the field is invalid. */
|
|
36
47
|
errorMessage?: ComputedRef<string>;
|
|
48
|
+
/** Custom validity predicate; returns true when the value is valid. */
|
|
37
49
|
isValid?: () => boolean;
|
|
38
50
|
};
|
|
51
|
+
/** Options for choice-based fields (select, radio). */
|
|
39
52
|
options?: any[];
|
|
53
|
+
/** Widget-specific props forwarded to the underlying field component. */
|
|
40
54
|
props?: {
|
|
41
55
|
currencySelected?: string;
|
|
42
56
|
searchable?: boolean;
|
|
43
57
|
disabled?: boolean;
|
|
44
58
|
currencies?: Currency[];
|
|
59
|
+
/** Maps an option object to the value stored for the field (vue-select style). */
|
|
45
60
|
reduce?: (item: any) => any;
|
|
46
61
|
clearable?: boolean;
|
|
47
62
|
label?: string;
|
|
63
|
+
/** Custom component rendered for each option in a select. */
|
|
48
64
|
optionSlot?: Component;
|
|
65
|
+
/** Custom component rendered for the selected option in a select. */
|
|
49
66
|
selectedOptionSlot?: Component;
|
|
50
67
|
multiple?: boolean;
|
|
68
|
+
/** Tooltip text shown next to the field label. */
|
|
51
69
|
labelTooltip?: string;
|
|
70
|
+
/** Informational helper text shown for the field. */
|
|
52
71
|
infoLabel?: string;
|
|
53
72
|
isCurrencyDisabled?: boolean;
|
|
73
|
+
/** Available country dialing-code options for a phone field. */
|
|
54
74
|
indicativeOptions?: Array<{
|
|
55
75
|
code: string;
|
|
56
76
|
geo: string;
|
|
57
77
|
country: string;
|
|
58
78
|
}>;
|
|
79
|
+
/** Currently selected dialing code for a phone field. */
|
|
59
80
|
indicativeModelValue?: string;
|
|
60
81
|
maxDate?: Date;
|
|
61
82
|
minDate?: Date;
|
|
83
|
+
/** Date display/parse format string. */
|
|
62
84
|
format?: string;
|
|
85
|
+
/** Locale used to render the date picker. */
|
|
63
86
|
locale?: string;
|
|
87
|
+
/** When true, the date picker selects a date range instead of a single date. */
|
|
64
88
|
range?: boolean;
|
|
65
89
|
};
|
|
90
|
+
/** Callback invoked when the field's value changes. */
|
|
66
91
|
onUpdate?: (value: any) => void;
|
|
67
92
|
}
|
|
@@ -1,38 +1,54 @@
|
|
|
1
|
+
/** Kind of control rendered for a CobreFilterPanel filter. */
|
|
1
2
|
export type FilterType = 'checkbox' | 'radio' | 'input' | 'amount-range' | 'select';
|
|
3
|
+
/** A selectable option within a choice-based filter (checkbox, radio, select). */
|
|
2
4
|
export interface FilterOption {
|
|
3
5
|
label: string;
|
|
4
6
|
value: string | number;
|
|
7
|
+
/** URL of a logo/icon image shown beside the option. */
|
|
5
8
|
logoURL?: string;
|
|
6
9
|
disabled?: boolean;
|
|
7
10
|
}
|
|
11
|
+
/** Lower/upper bounds of an amount-range filter; null means unbounded on that end. */
|
|
8
12
|
export interface AmountRangeValue {
|
|
9
13
|
from: number | null;
|
|
10
14
|
to: number | null;
|
|
11
15
|
}
|
|
16
|
+
/** Shared shape for every filter, parameterized by its FilterType; concrete filters extend this. */
|
|
12
17
|
export interface BaseFilter<T extends FilterType> {
|
|
18
|
+
/** Unique identifier used to read/write the filter's value. */
|
|
13
19
|
key: string;
|
|
14
20
|
type: T;
|
|
15
21
|
label: string;
|
|
16
22
|
icon?: string;
|
|
23
|
+
/** Number of active selections, shown as a badge. */
|
|
17
24
|
count?: number;
|
|
25
|
+
/** Whether the filter's options are currently loading. */
|
|
18
26
|
loading?: boolean;
|
|
27
|
+
/** Empty-state configuration shown when there are no options. */
|
|
19
28
|
empty?: {
|
|
20
29
|
show: boolean;
|
|
21
30
|
text?: string;
|
|
22
31
|
icon?: 'cards' | 'box' | 'error';
|
|
23
32
|
};
|
|
24
33
|
}
|
|
34
|
+
/** Shared validation hooks mixed into filter definitions. */
|
|
25
35
|
export interface CommonValidation {
|
|
36
|
+
/** Custom validity predicate; returns true when the filter value is valid. */
|
|
26
37
|
isValid?: () => boolean;
|
|
27
38
|
errorMessage?: string;
|
|
28
39
|
}
|
|
40
|
+
/** Shared disabled-state props mixed into filter `props`. */
|
|
29
41
|
export interface CommonDisabledProps {
|
|
30
42
|
disabled?: boolean;
|
|
43
|
+
/** Tooltip text shown next to the filter label. */
|
|
31
44
|
labelTooltip?: string;
|
|
32
45
|
}
|
|
46
|
+
/** Character/validation constraint applied to a filter's text input. */
|
|
33
47
|
export type CobreInputType = 'anyCharacter' | 'alphanumeric' | 'numeric' | 'letters' | 'email';
|
|
48
|
+
/** Shared search-box props mixed into filters whose options can be searched. */
|
|
34
49
|
export interface CommonSearchProps {
|
|
35
50
|
searchable?: boolean;
|
|
51
|
+
/** Configuration for the option search box. */
|
|
36
52
|
search?: {
|
|
37
53
|
placeholder?: string;
|
|
38
54
|
disabled?: boolean;
|
|
@@ -40,18 +56,21 @@ export interface CommonSearchProps {
|
|
|
40
56
|
inputType?: CobreInputType;
|
|
41
57
|
};
|
|
42
58
|
}
|
|
59
|
+
/** A multi-select checkbox-group filter; value holds the selected option values. */
|
|
43
60
|
export interface CheckboxFilter extends BaseFilter<'checkbox'> {
|
|
44
61
|
value: (string | number)[];
|
|
45
62
|
options: FilterOption[];
|
|
46
63
|
props?: CommonDisabledProps & CommonSearchProps;
|
|
47
64
|
validation?: CommonValidation;
|
|
48
65
|
}
|
|
66
|
+
/** A single-select radio-group filter; value is the chosen option or null. */
|
|
49
67
|
export interface RadioFilter extends BaseFilter<'radio'> {
|
|
50
68
|
value: string | number | null;
|
|
51
69
|
options: FilterOption[];
|
|
52
70
|
props?: CommonDisabledProps & CommonSearchProps;
|
|
53
71
|
validation?: CommonValidation;
|
|
54
72
|
}
|
|
73
|
+
/** A free-text input filter with optional length validation. */
|
|
55
74
|
export interface InputFilter extends BaseFilter<'input'> {
|
|
56
75
|
value: string;
|
|
57
76
|
props?: CommonDisabledProps & {
|
|
@@ -63,10 +82,13 @@ export interface InputFilter extends BaseFilter<'input'> {
|
|
|
63
82
|
maxLength?: number;
|
|
64
83
|
};
|
|
65
84
|
}
|
|
85
|
+
/** A numeric from/to range filter with optional min/max amount validation. */
|
|
66
86
|
export interface AmountRangeFilter extends BaseFilter<'amount-range'> {
|
|
67
87
|
value: AmountRangeValue;
|
|
68
88
|
props: CommonDisabledProps & {
|
|
89
|
+
/** Label for the lower-bound (from) input. */
|
|
69
90
|
fromLabel: string;
|
|
91
|
+
/** Label for the upper-bound (to) input. */
|
|
70
92
|
toLabel: string;
|
|
71
93
|
fromPlaceholder?: string;
|
|
72
94
|
toPlaceholder?: string;
|
|
@@ -76,6 +98,7 @@ export interface AmountRangeFilter extends BaseFilter<'amount-range'> {
|
|
|
76
98
|
maxAmount?: number;
|
|
77
99
|
};
|
|
78
100
|
}
|
|
101
|
+
/** A dropdown select filter; value is the chosen option (or array when multiple) or null. */
|
|
79
102
|
export interface SelectFilter extends BaseFilter<'select'> {
|
|
80
103
|
value: string | number | null;
|
|
81
104
|
options: FilterOption[];
|
|
@@ -84,9 +107,12 @@ export interface SelectFilter extends BaseFilter<'select'> {
|
|
|
84
107
|
searchable?: boolean;
|
|
85
108
|
clearable?: boolean;
|
|
86
109
|
multiple?: boolean;
|
|
110
|
+
/** Maps an option object to the value stored for the filter (vue-select style). */
|
|
87
111
|
reduce?: (item: any) => any;
|
|
112
|
+
/** Key on the option object used as its display label. */
|
|
88
113
|
optionLabel?: string;
|
|
89
114
|
};
|
|
90
115
|
validation?: CommonValidation;
|
|
91
116
|
}
|
|
117
|
+
/** Discriminated union of every filter type accepted by CobreFilterPanel. */
|
|
92
118
|
export type Filter = CheckboxFilter | RadioFilter | InputFilter | AmountRangeFilter | SelectFilter;
|
|
@@ -1,23 +1,38 @@
|
|
|
1
|
+
/** A nested sub-entry of a CobreSideMenu item, linking to a route. */
|
|
1
2
|
export interface Items {
|
|
2
3
|
id: string;
|
|
4
|
+
/** Display label of the sub-entry. */
|
|
3
5
|
text: string;
|
|
6
|
+
/** Route path the sub-entry navigates to. */
|
|
4
7
|
path: string;
|
|
8
|
+
/** Whether the sub-entry is shown in the menu. */
|
|
5
9
|
show: boolean;
|
|
6
10
|
icon?: string;
|
|
7
11
|
}
|
|
12
|
+
/** A top-level CobreSideMenu entry, optionally with sub-items or an expanded sub-page. */
|
|
8
13
|
export interface MenuItem {
|
|
9
14
|
id: string;
|
|
15
|
+
/** Display label of the menu entry. */
|
|
10
16
|
name: string;
|
|
17
|
+
/** Route path the entry navigates to. */
|
|
11
18
|
path?: string;
|
|
12
19
|
icon?: string;
|
|
20
|
+
/** Whether the entry is shown in the menu. */
|
|
13
21
|
show?: boolean;
|
|
22
|
+
/** Child entries rendered under this item. */
|
|
14
23
|
subItems?: Items[];
|
|
24
|
+
/** Whether this entry opens an expanded sub-page panel. */
|
|
15
25
|
inSubPage?: boolean;
|
|
26
|
+
/** Nested sub-page layout shown when the entry is expanded. */
|
|
16
27
|
subPage?: {
|
|
17
28
|
name: string;
|
|
29
|
+
/** Menu items shown in the top section of the sub-page. */
|
|
18
30
|
itemsTop: MenuItem[];
|
|
31
|
+
/** Menu items shown in the bottom section of the sub-page. */
|
|
19
32
|
itemsBottom?: MenuItem[];
|
|
33
|
+
/** Heading text for the top section. */
|
|
20
34
|
textTopItems?: string;
|
|
35
|
+
/** Heading text for the bottom section. */
|
|
21
36
|
textBottomItems?: string;
|
|
22
37
|
};
|
|
23
38
|
}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visual style variants for CobreButton. Each value is applied as a
|
|
3
|
+
* `co-btn-v3--<variant>` CSS class. See CobreButton.vue for usage.
|
|
4
|
+
*/
|
|
1
5
|
export type ButtonThemes = 'primary' | 'secondary' | 'ghost' | 'ghost-small' | 'ghost-teal' | 'ghost-warning' | 'link' | 'single' | 'filter' | 'secondary-cloudy' | 'secondary-cloudy-warning' | 'icon' | 'icon-cloudy' | 'toolbar' | 'primary-warning' | 'chip';
|
|
6
|
+
/** Color emphasis applied on top of a CobreButton theme via `co-btn-v3--color-<color>`. */
|
|
2
7
|
export type ButtonColors = 'default' | 'light';
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
+
/** Map of bank identifier codes to human-readable bank names (re-exported from banksList). */
|
|
1
2
|
export { banks } from './banksList';
|
|
3
|
+
/** Base URL of the S3 bucket hosting Cobre portal static assets (images, icons, etc.). */
|
|
2
4
|
export declare const STATIC_ASSETS_BASE_URL = "https://cobre-portal-static-assets-prod.s3.us-east-1.amazonaws.com";
|
|
5
|
+
/**
|
|
6
|
+
* Parses the query-string parameters of a URL into a key/value object.
|
|
7
|
+
* @param url - The URL to parse; defaults to the current page (`window.location.href`).
|
|
8
|
+
* @returns An object mapping each query parameter name to its string value.
|
|
9
|
+
*/
|
|
3
10
|
export declare const getParams: (url?: string) => {
|
|
4
11
|
[x: string]: string;
|
|
5
12
|
};
|
|
13
|
+
/** Locks page scrolling by setting `document.body` overflow to `hidden` (e.g. when a modal opens). */
|
|
6
14
|
export declare const makeBodyNotScrollable: () => string;
|
|
15
|
+
/** Restores page scrolling by setting `document.body` overflow back to `auto`. */
|
|
7
16
|
export declare const makeBodyScrollable: () => string;
|
|
17
|
+
/**
|
|
18
|
+
* Masks a string for display, revealing only its last 4 characters in parentheses.
|
|
19
|
+
* @param data - The value to mask (e.g. an account number).
|
|
20
|
+
* @returns A string like `(···1234)`, or `'-'` when `data` is empty.
|
|
21
|
+
*/
|
|
8
22
|
export declare const maskString: (data: string) => string;
|