@cobre-npm/ds-v3 0.126.0 → 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/README.md +50 -31
- package/dist/cobre-ds-v3-lib.es.js +22 -12
- package/dist/style.css +1 -1
- package/dist/types/components/atoms/CobreAlert/CobreAlert.vue.d.ts +6 -0
- package/dist/types/components/atoms/CobreButton/CobreButton.vue.d.ts +6 -0
- package/dist/types/components/atoms/CobreCheckbox/CobreCheckbox.vue.d.ts +5 -0
- package/dist/types/components/atoms/CobreEmptyState/CobreEmptyState.vue.d.ts +6 -0
- package/dist/types/components/atoms/CobreRowActions/interfaces/CobreRowActions.interface.d.ts +8 -0
- package/dist/types/components/atoms/CobreToastAlert/CobreToastAlert.vue.d.ts +6 -0
- package/dist/types/components/molecules/CobreBadge/CobreBadge.vue.d.ts +5 -0
- package/dist/types/components/molecules/CobreChips/CobreChips.vue.d.ts +5 -0
- package/dist/types/components/molecules/CobreDrawer/CobreDrawer.vue.d.ts +8 -0
- package/dist/types/components/molecules/CobreDropdownButton/CobreDropdownButton.vue.d.ts +7 -0
- package/dist/types/components/molecules/CobreInput/CobreInput.vue.d.ts +6 -0
- package/dist/types/components/molecules/CobreModal/CobreModal.vue.d.ts +7 -0
- package/dist/types/components/molecules/CobreSelect/CobreSelect.vue.d.ts +8 -0
- package/dist/types/components/molecules/CobreSnackBar/CobreSnackBar.vue.d.ts +5 -0
- package/dist/types/components/molecules/CobreTextArea/CobreTextArea.vue.d.ts +6 -0
- package/dist/types/components/organisms/CobreAccountPickerModal/CobreAccountPickerModal.vue.d.ts +7 -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 +5 -1
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
type IconType = "danger" | "success" | "warning" | "info" | null;
|
|
2
|
+
/**
|
|
3
|
+
* CobreAlert — inline alert banner that surfaces a contextual status message.
|
|
4
|
+
* Use to highlight success, error, warning, or info states within page content.
|
|
5
|
+
* Optionally shows a close button (emits `close`) and a `contentComponent` slot
|
|
6
|
+
* for extra content below the message.
|
|
7
|
+
*/
|
|
2
8
|
interface Props {
|
|
3
9
|
type?: IconType;
|
|
4
10
|
content?: string;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { ButtonThemes, ButtonColors } from '../../../types/button.types';
|
|
2
2
|
type Sizes = 'big' | 'medium' | 'small' | 'auto';
|
|
3
|
+
/**
|
|
4
|
+
* CobreButton — the primary action button for the Cobre platform.
|
|
5
|
+
* Use for form submits, primary/secondary actions, toolbar actions, and icon-only
|
|
6
|
+
* buttons. For navigation that looks like inline text, use the `link` theme.
|
|
7
|
+
* Provides `start`, `end`, and `content` slots for icons or custom content.
|
|
8
|
+
*/
|
|
3
9
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
10
|
theme: {
|
|
5
11
|
type: () => ButtonThemes;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CobreCheckbox — a single checkbox with optional label, helper description and tooltip.
|
|
3
|
+
* Use for boolean toggles in forms; binds via v-model and also emits 'changed'.
|
|
4
|
+
* Provides an `option` slot rendered after the label (e.g. an extra icon or control).
|
|
5
|
+
*/
|
|
1
6
|
interface Props {
|
|
2
7
|
modelValue: any;
|
|
3
8
|
disabled?: boolean;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CobreEmptyState — a placeholder panel for empty or zero-data screens.
|
|
3
|
+
* Use to fill a section that has no content yet, pairing a descriptive message
|
|
4
|
+
* with an illustration on a subtle tinted background. Provides a `content` slot
|
|
5
|
+
* for the heading/text shown beside the image.
|
|
6
|
+
*/
|
|
1
7
|
type __VLS_Props = {
|
|
2
8
|
image: string;
|
|
3
9
|
};
|
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,4 +1,10 @@
|
|
|
1
1
|
type IconType = 'danger' | 'success' | 'warning' | 'info' | null;
|
|
2
|
+
/**
|
|
3
|
+
* CobreToastAlert — a self-contained toast-style status notification.
|
|
4
|
+
* Use to display a transient success, error, warning, or info message with an
|
|
5
|
+
* icon, title, and content. For an inline page banner with a close button, use
|
|
6
|
+
* CobreAlert instead.
|
|
7
|
+
*/
|
|
2
8
|
interface Props {
|
|
3
9
|
type: IconType;
|
|
4
10
|
content: string;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CobreBadge — a compact pill for statuses, labels and filter chips.
|
|
3
|
+
* Use to surface state (success/error/warning/status-*), tags, or removable filters.
|
|
4
|
+
* Provides `start`, `content` and `end` slots; `content` replaces the default `text`.
|
|
5
|
+
*/
|
|
1
6
|
interface Props {
|
|
2
7
|
type: string;
|
|
3
8
|
isSelected?: boolean;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CobreChips — a filter chip built on CobreButton's `filter` theme.
|
|
3
|
+
* Use to display an applied or selectable filter; shows a leading plus, icon, or a
|
|
4
|
+
* removable divider/close button that emits 'close' when a filter value is set.
|
|
5
|
+
*/
|
|
1
6
|
interface Props {
|
|
2
7
|
label?: string;
|
|
3
8
|
filterText?: string;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
type Positions = 'left' | 'right';
|
|
2
|
+
/**
|
|
3
|
+
* CobreDrawer — a side panel that slides in from the left or right edge of the screen.
|
|
4
|
+
* Use for secondary flows, filters, or detail views that overlay the page without
|
|
5
|
+
* fully blocking it. Open/close via the exposed `toggleModal` ref; closes on Escape
|
|
6
|
+
* and (optionally) on outside click. Emits `close` (auto/outside) and `close-button`
|
|
7
|
+
* (close icon). Provides `content`, `footer`, and `onlyWrapper` slots.
|
|
8
|
+
* For a centered modal dialog, use CobreModal instead.
|
|
9
|
+
*/
|
|
2
10
|
interface Props {
|
|
3
11
|
id?: string;
|
|
4
12
|
position: Positions;
|
|
@@ -2,6 +2,13 @@ interface Option {
|
|
|
2
2
|
text: string;
|
|
3
3
|
id: string;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* CobreDropdownButton — a split button that pairs a primary action with a
|
|
7
|
+
* chevron toggle that opens a dropdown action list.
|
|
8
|
+
* Use when a button has one main action plus a menu of related options.
|
|
9
|
+
* Emits `button-click` for the primary action and `clickOption` for menu selections.
|
|
10
|
+
* Provides a `content` slot to customize the primary button's label area.
|
|
11
|
+
*/
|
|
5
12
|
interface Props {
|
|
6
13
|
actionListOptions: Array<Option>;
|
|
7
14
|
label?: string;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CobreInput — the standard single-line text field for the Cobre platform.
|
|
3
|
+
* Use for form text entry with built-in validation (length, numeric, letters,
|
|
4
|
+
* alphanumeric, email) and inline error/info messaging. Set `isSearchable` to
|
|
5
|
+
* render the compact search variant. For multi-line input use CobreTextArea.
|
|
6
|
+
*/
|
|
1
7
|
interface Props {
|
|
2
8
|
modelValue: string | undefined | null;
|
|
3
9
|
errorMsg?: string;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CobreModal — a centered overlay dialog rendered over a dimmed backdrop.
|
|
3
|
+
* Use for focused interactions (confirmations, forms, details) that block the
|
|
4
|
+
* page until dismissed. Open/close via the exposed `toggleModal` ref; emits
|
|
5
|
+
* `close` when the close button is pressed. Provides a `content` slot.
|
|
6
|
+
* For a side panel that slides in from an edge, use CobreDrawer instead.
|
|
7
|
+
*/
|
|
1
8
|
interface Props {
|
|
2
9
|
size?: 'xs' | 'md' | 'lg';
|
|
3
10
|
hasCloseButton?: boolean;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import 'vue-select/dist/vue-select.css';
|
|
2
|
+
/**
|
|
3
|
+
* CobreSelect — the platform dropdown select, built on vue-select.
|
|
4
|
+
* Use for choosing from a list of options, with optional search, custom option
|
|
5
|
+
* rendering (bank logos, country flags, balances, badges) and a no-options state.
|
|
6
|
+
* Forwards extra vue-select props via attrs. Provides `option`, `selected-option`,
|
|
7
|
+
* `open-indicator`, `no-options`, `no-results`, `deselect`, `list-header`,
|
|
8
|
+
* `list-footer`, and `spinner` slots for full customization.
|
|
9
|
+
*/
|
|
2
10
|
interface Props {
|
|
3
11
|
labelName?: string;
|
|
4
12
|
isRequired?: boolean;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CobreSnackBar — a compact single-line snackbar for brief, transient feedback.
|
|
3
|
+
* Use for confirmations or errors, optionally with an inline action button and a
|
|
4
|
+
* close button. For a richer banner with a title, use CobreAlert/CobreToastAlert.
|
|
5
|
+
*/
|
|
1
6
|
interface Props {
|
|
2
7
|
closeToast: (e?: MouseEvent) => void;
|
|
3
8
|
message: string;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CobreTextArea — the standard multi-line text field for the Cobre platform.
|
|
3
|
+
* Use for longer free-form input with built-in length validation and inline
|
|
4
|
+
* error/info messaging. The height is configurable via `height`. For single-line
|
|
5
|
+
* input use CobreInput.
|
|
6
|
+
*/
|
|
1
7
|
interface Props {
|
|
2
8
|
modelValue: string | undefined | null;
|
|
3
9
|
id?: string;
|
package/dist/types/components/organisms/CobreAccountPickerModal/CobreAccountPickerModal.vue.d.ts
CHANGED
|
@@ -2,6 +2,13 @@ import { type CobreSelectableItem } from '../../molecules/CobreAccountOptionSele
|
|
|
2
2
|
import type { AlertConfig, FilterConfig, TabConfigItem } from './interfaces/account-selector-modal.interface';
|
|
3
3
|
export type { AlertType, AlertConfig, TabConfigItem, FilterOptionItem, FilterConfig } from './interfaces/account-selector-modal.interface';
|
|
4
4
|
type AccountItem = CobreSelectableItem;
|
|
5
|
+
/**
|
|
6
|
+
* CobreAccountPickerModal — a modal for searching and selecting an account or
|
|
7
|
+
* counterparty, with optional search, tabs, multi-option filters, and a balance
|
|
8
|
+
* visibility toggle. Use when the user must pick one account from a list.
|
|
9
|
+
* Open/close it via the exposed `toggleModal()`; emits `select` on choice.
|
|
10
|
+
* Provides a `custom-actions` slot for extra controls below the filters.
|
|
11
|
+
*/
|
|
5
12
|
interface Props {
|
|
6
13
|
title: string;
|
|
7
14
|
searchPlaceholder: string;
|
|
@@ -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;
|