@chayns-components/core 5.2.8-alpha.0 → 5.3.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/lib/cjs/components/combobox/ComboBox.constants.js +15 -0
- package/lib/cjs/components/combobox/ComboBox.constants.js.map +1 -0
- package/lib/cjs/components/combobox/ComboBox.js +28 -78
- package/lib/cjs/components/combobox/ComboBox.js.map +1 -1
- package/lib/cjs/components/combobox/ComboBox.styles.js +16 -11
- package/lib/cjs/components/combobox/ComboBox.styles.js.map +1 -1
- package/lib/cjs/components/combobox/ComboBox.types.js +24 -0
- package/lib/cjs/components/combobox/ComboBox.types.js.map +1 -1
- package/lib/cjs/components/combobox/ComboBox.utils.js +88 -0
- package/lib/cjs/components/combobox/ComboBox.utils.js.map +1 -0
- package/lib/cjs/components/dropdown-body-wrapper/DropdownBodyWrapper.js +10 -7
- package/lib/cjs/components/dropdown-body-wrapper/DropdownBodyWrapper.js.map +1 -1
- package/lib/cjs/components/dropdown-body-wrapper/DropdownBodyWrapper.styles.js +10 -4
- package/lib/cjs/components/dropdown-body-wrapper/DropdownBodyWrapper.styles.js.map +1 -1
- package/lib/cjs/components/filter/filter-content/FilterContent.constants.js +8 -0
- package/lib/cjs/components/filter/filter-content/FilterContent.constants.js.map +1 -0
- package/lib/cjs/components/filter/filter-content/FilterContent.js +6 -27
- package/lib/cjs/components/filter/filter-content/FilterContent.js.map +1 -1
- package/lib/cjs/components/filter/filter-content/FilterContent.styles.js +10 -24
- package/lib/cjs/components/filter/filter-content/FilterContent.styles.js.map +1 -1
- package/lib/cjs/components/filter/filter-content/FilterContent.types.js +6 -0
- package/lib/cjs/components/filter/filter-content/FilterContent.types.js.map +1 -0
- package/lib/cjs/components/filter/filter-content/FilterContent.utils.js +17 -0
- package/lib/cjs/components/filter/filter-content/FilterContent.utils.js.map +1 -0
- package/lib/cjs/components/search-box/SearchBox.js +0 -1
- package/lib/cjs/components/search-box/SearchBox.js.map +1 -1
- package/lib/cjs/components/skeleton/base-skeleton/BaseSkeleton.styles.js +0 -2
- package/lib/cjs/components/skeleton/base-skeleton/BaseSkeleton.styles.js.map +1 -1
- package/lib/cjs/types/filter.js +24 -0
- package/lib/cjs/types/filter.js.map +1 -1
- package/lib/esm/components/combobox/ComboBox.constants.js +9 -0
- package/lib/esm/components/combobox/ComboBox.constants.js.map +1 -0
- package/lib/esm/components/combobox/ComboBox.js +28 -77
- package/lib/esm/components/combobox/ComboBox.js.map +1 -1
- package/lib/esm/components/combobox/ComboBox.styles.js +16 -11
- package/lib/esm/components/combobox/ComboBox.styles.js.map +1 -1
- package/lib/esm/components/combobox/ComboBox.types.js +29 -0
- package/lib/esm/components/combobox/ComboBox.types.js.map +1 -1
- package/lib/esm/components/combobox/ComboBox.utils.js +81 -0
- package/lib/esm/components/combobox/ComboBox.utils.js.map +1 -0
- package/lib/esm/components/dropdown-body-wrapper/DropdownBodyWrapper.js +11 -8
- package/lib/esm/components/dropdown-body-wrapper/DropdownBodyWrapper.js.map +1 -1
- package/lib/esm/components/dropdown-body-wrapper/DropdownBodyWrapper.styles.js +10 -4
- package/lib/esm/components/dropdown-body-wrapper/DropdownBodyWrapper.styles.js.map +1 -1
- package/lib/esm/components/filter/filter-content/FilterContent.constants.js +2 -0
- package/lib/esm/components/filter/filter-content/FilterContent.constants.js.map +1 -0
- package/lib/esm/components/filter/filter-content/FilterContent.js +8 -29
- package/lib/esm/components/filter/filter-content/FilterContent.js.map +1 -1
- package/lib/esm/components/filter/filter-content/FilterContent.styles.js +9 -23
- package/lib/esm/components/filter/filter-content/FilterContent.styles.js.map +1 -1
- package/lib/esm/components/filter/filter-content/FilterContent.types.js +2 -0
- package/lib/esm/components/filter/filter-content/FilterContent.types.js.map +1 -0
- package/lib/esm/components/filter/filter-content/FilterContent.utils.js +10 -0
- package/lib/esm/components/filter/filter-content/FilterContent.utils.js.map +1 -0
- package/lib/esm/components/search-box/SearchBox.js +0 -1
- package/lib/esm/components/search-box/SearchBox.js.map +1 -1
- package/lib/esm/components/skeleton/base-skeleton/BaseSkeleton.styles.js +0 -2
- package/lib/esm/components/skeleton/base-skeleton/BaseSkeleton.styles.js.map +1 -1
- package/lib/esm/types/filter.js +31 -0
- package/lib/esm/types/filter.js.map +1 -1
- package/lib/types/components/combobox/ComboBox.constants.d.ts +8 -0
- package/lib/types/components/combobox/ComboBox.styles.d.ts +4 -8
- package/lib/types/components/combobox/ComboBox.types.d.ts +102 -0
- package/lib/types/components/combobox/ComboBox.utils.d.ts +23 -0
- package/lib/types/components/dropdown-body-wrapper/DropdownBodyWrapper.d.ts +2 -2
- package/lib/types/components/dropdown-body-wrapper/DropdownBodyWrapper.styles.d.ts +2 -2
- package/lib/types/components/filter/filter-content/FilterContent.constants.d.ts +1 -0
- package/lib/types/components/filter/filter-content/FilterContent.d.ts +1 -9
- package/lib/types/components/filter/filter-content/FilterContent.styles.d.ts +3 -14
- package/lib/types/components/filter/filter-content/FilterContent.types.d.ts +30 -0
- package/lib/types/components/filter/filter-content/FilterContent.utils.d.ts +3 -0
- package/lib/types/types/filter.d.ts +51 -0
- package/package.json +3 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ChaynsReactFunctions, ChaynsReactValues } from 'chayns-api';
|
|
2
|
+
import type { IComboBoxItem, IComboBoxItems } from './ComboBox.types';
|
|
3
|
+
export type ComboBoxWidthOptions = {
|
|
4
|
+
functions: ChaynsReactFunctions;
|
|
5
|
+
internalSelectedItem?: IComboBoxItem;
|
|
6
|
+
lists: IComboBoxItems[];
|
|
7
|
+
parentWidth: number;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
prefix?: string;
|
|
10
|
+
prefixMinWidth?: number;
|
|
11
|
+
selectedItem?: IComboBoxItem;
|
|
12
|
+
shouldDropDownUseMaxItemWidth?: boolean;
|
|
13
|
+
shouldShowBigImage?: boolean;
|
|
14
|
+
shouldShowClearIcon?: boolean;
|
|
15
|
+
shouldUseCurrentItemWidth?: boolean;
|
|
16
|
+
shouldUseFullWidth?: boolean;
|
|
17
|
+
values: ChaynsReactValues;
|
|
18
|
+
};
|
|
19
|
+
export type ComboBoxWidthResult = {
|
|
20
|
+
minWidth?: number;
|
|
21
|
+
bodyMinWidth: number;
|
|
22
|
+
};
|
|
23
|
+
export declare const getComboBoxWidthResult: ({ functions, internalSelectedItem, lists, parentWidth, placeholder, prefix, prefixMinWidth, selectedItem, shouldDropDownUseMaxItemWidth, shouldShowBigImage, shouldShowClearIcon, shouldUseCurrentItemWidth, shouldUseFullWidth, values, }: ComboBoxWidthOptions) => ComboBoxWidthResult;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { DropdownDirection } from '../../types/dropdown';
|
|
3
3
|
import { DelayedDropdownContentProps } from './delayed-dropdown-content/DelayedDropdownContent';
|
|
4
4
|
interface DropdownBodyWrapperProps {
|
|
@@ -56,5 +56,5 @@ interface DropdownBodyWrapperProps {
|
|
|
56
56
|
*/
|
|
57
57
|
shouldCaptureEvents?: boolean;
|
|
58
58
|
}
|
|
59
|
-
declare const DropdownBodyWrapper:
|
|
59
|
+
declare const DropdownBodyWrapper: React.ForwardRefExoticComponent<DropdownBodyWrapperProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
60
|
export default DropdownBodyWrapper;
|
|
@@ -2,14 +2,14 @@ import { DropdownDirection } from '../../types/dropdown';
|
|
|
2
2
|
export declare const StyledDropdownBodyWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
3
3
|
export declare const StyledDropdownBodyWrapperContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme" | "$maxHeight" | "$width" | "$minWidth" | "$direction"> & {
|
|
4
4
|
$width: number;
|
|
5
|
-
$maxHeight
|
|
5
|
+
$maxHeight?: number;
|
|
6
6
|
$minWidth: number;
|
|
7
7
|
$direction: DropdownDirection;
|
|
8
8
|
} & {
|
|
9
9
|
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
10
10
|
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme" | "$maxHeight" | "$width" | "$minWidth" | "$direction"> & {
|
|
11
11
|
$width: number;
|
|
12
|
-
$maxHeight
|
|
12
|
+
$maxHeight?: number;
|
|
13
13
|
$minWidth: number;
|
|
14
14
|
$direction: DropdownDirection;
|
|
15
15
|
} & {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FILTER_CONTENT_ROW_GAP_PX = 10;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export type FilterContentProps = {
|
|
4
|
-
searchConfig?: SearchConfig;
|
|
5
|
-
filterButtonConfig?: FilterButtonConfig;
|
|
6
|
-
sortConfig?: SortConfig;
|
|
7
|
-
checkboxConfig?: CheckboxConfig;
|
|
8
|
-
comboboxConfig?: ComboboxConfig;
|
|
9
|
-
shouldAutoFocus: boolean;
|
|
10
|
-
};
|
|
2
|
+
import type { FilterContentProps } from './FilterContent.types';
|
|
11
3
|
declare const FilterContent: FC<FilterContentProps>;
|
|
12
4
|
export default FilterContent;
|
|
@@ -3,17 +3,6 @@ export declare const StyledFilterContent: import("styled-components/dist/types")
|
|
|
3
3
|
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme"> & {
|
|
4
4
|
theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
5
5
|
}, never>>> & string;
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
$textWidth: number;
|
|
10
|
-
} & {
|
|
11
|
-
theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
12
|
-
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme" | "$textWidth"> & {
|
|
13
|
-
$textWidth: number;
|
|
14
|
-
} & {
|
|
15
|
-
theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
16
|
-
}, never>>> & string;
|
|
17
|
-
export declare const StyledFilterComboboxInline: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
18
|
-
export declare const StyledFilterComboboxInlineLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
19
|
-
export declare const StyledFilterComboboxInlineComboboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
6
|
+
export declare const StyledFilterContentLabeledRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
7
|
+
export declare const StyledFilterContentLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
8
|
+
export declare const StyledFilterContentControlWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CheckboxConfig, ComboboxConfig, FilterButtonConfig, SearchConfig, SortConfig } from '../../../types/filter';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the `FilterContent` component.
|
|
4
|
+
*/
|
|
5
|
+
export type FilterContentProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Search configuration for the optional search input.
|
|
8
|
+
*/
|
|
9
|
+
searchConfig?: SearchConfig;
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for the optional filter button group.
|
|
12
|
+
*/
|
|
13
|
+
filterButtonConfig?: FilterButtonConfig;
|
|
14
|
+
/**
|
|
15
|
+
* Configuration for the optional sort combobox.
|
|
16
|
+
*/
|
|
17
|
+
sortConfig?: SortConfig;
|
|
18
|
+
/**
|
|
19
|
+
* Configuration for the optional checkbox.
|
|
20
|
+
*/
|
|
21
|
+
checkboxConfig?: CheckboxConfig;
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for the optional labeled combobox.
|
|
24
|
+
*/
|
|
25
|
+
comboboxConfig?: ComboboxConfig;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the search input should receive focus when the filter opens.
|
|
28
|
+
*/
|
|
29
|
+
shouldAutoFocus: boolean;
|
|
30
|
+
};
|
|
@@ -1,28 +1,79 @@
|
|
|
1
1
|
import { FilterButtonsProps } from '../components/filter-buttons/FilterButtons';
|
|
2
2
|
import { CheckboxProps } from '../components/checkbox/Checkbox';
|
|
3
3
|
import { ComboBoxProps } from '../components/combobox/ComboBox.types';
|
|
4
|
+
/**
|
|
5
|
+
* Search configuration for the `Filter` component.
|
|
6
|
+
*/
|
|
4
7
|
export interface SearchConfig {
|
|
8
|
+
/**
|
|
9
|
+
* Callback invoked whenever the search input changes.
|
|
10
|
+
*/
|
|
5
11
|
onSearchChange: (search: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Current search value.
|
|
14
|
+
*/
|
|
6
15
|
searchValue: string;
|
|
7
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Item configuration used by the sort dropdown.
|
|
19
|
+
*/
|
|
8
20
|
export interface SortItem {
|
|
21
|
+
/**
|
|
22
|
+
* Display text of the item.
|
|
23
|
+
*/
|
|
9
24
|
text: string;
|
|
25
|
+
/**
|
|
26
|
+
* Stable value or identifier of the item.
|
|
27
|
+
*/
|
|
10
28
|
id: string | number;
|
|
11
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Sort configuration for the `Filter` component.
|
|
32
|
+
*/
|
|
12
33
|
export interface SortConfig {
|
|
34
|
+
/**
|
|
35
|
+
* Callback invoked when a sort item is selected.
|
|
36
|
+
*/
|
|
13
37
|
onSortChange: (item: SortItem) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Currently selected sort item.
|
|
40
|
+
*/
|
|
14
41
|
selectedItem: SortItem;
|
|
42
|
+
/**
|
|
43
|
+
* Available sort items.
|
|
44
|
+
*/
|
|
15
45
|
items: SortItem[];
|
|
16
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Checkbox configuration for the `Filter` component.
|
|
49
|
+
*/
|
|
17
50
|
export type CheckboxConfig = CheckboxProps;
|
|
51
|
+
/**
|
|
52
|
+
* Filter button group configuration for the `Filter` component.
|
|
53
|
+
*/
|
|
18
54
|
export type FilterButtonConfig = FilterButtonsProps;
|
|
55
|
+
/**
|
|
56
|
+
* Combobox configuration used by `FilterContent`.
|
|
57
|
+
*/
|
|
19
58
|
export type ComboboxConfig = ComboBoxProps & {
|
|
20
59
|
label: string;
|
|
21
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Ref interface for the `Filter` component.
|
|
63
|
+
*/
|
|
22
64
|
export type FilterRef = {
|
|
65
|
+
/**
|
|
66
|
+
* Hides the filter popup.
|
|
67
|
+
*/
|
|
23
68
|
hide: VoidFunction;
|
|
69
|
+
/**
|
|
70
|
+
* Shows the filter popup.
|
|
71
|
+
*/
|
|
24
72
|
show: VoidFunction;
|
|
25
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* Different layout modes supported by the `Filter` component.
|
|
76
|
+
*/
|
|
26
77
|
export declare enum FilterType {
|
|
27
78
|
ONLY_SEARCH = 0,
|
|
28
79
|
ONLY_FILTER = 1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"typescript": "^5.9.3"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@chayns-components/textstring": "^5.2.
|
|
74
|
+
"@chayns-components/textstring": "^5.2.5",
|
|
75
75
|
"@chayns/colors": "^2.0.2",
|
|
76
76
|
"@chayns/uac-service": "~0.0.62",
|
|
77
77
|
"clsx": "^2.1.1",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "52588cd06d0acc37c4cce8db91aaba70e1af5f5e"
|
|
92
92
|
}
|