mautourco-components 0.2.49 → 0.2.50
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.
|
@@ -9,5 +9,6 @@ export interface QuoteHeaderProps {
|
|
|
9
9
|
onNewQuote: () => void;
|
|
10
10
|
onFilterChange?: (filter: FilterType, value: string) => void;
|
|
11
11
|
currentFilter?: Record<FilterType, string>;
|
|
12
|
+
filters?: Record<string, any>;
|
|
12
13
|
}
|
|
13
14
|
export declare function QuoteHeader(props: QuoteHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -45,14 +45,14 @@ var filterConfig = {
|
|
|
45
45
|
};
|
|
46
46
|
export function QuoteHeader(props) {
|
|
47
47
|
var _a;
|
|
48
|
-
var _b = props.current, current = _b === void 0 ? 'quotation' : _b, currentFilter = props.currentFilter, onNavigate = props.onNavigate, onNewQuote = props.onNewQuote, onFilterChange = props.onFilterChange;
|
|
49
|
-
var
|
|
48
|
+
var _b = props.current, current = _b === void 0 ? 'quotation' : _b, currentFilter = props.currentFilter, onNavigate = props.onNavigate, onNewQuote = props.onNewQuote, onFilterChange = props.onFilterChange, _c = props.filters, filters = _c === void 0 ? filterConfig : _c;
|
|
49
|
+
var _d = useState(currentFilter || {
|
|
50
50
|
date: '',
|
|
51
51
|
clientType: '',
|
|
52
52
|
fileStatus: '',
|
|
53
53
|
search: '',
|
|
54
|
-
}), currentValue =
|
|
55
|
-
var
|
|
54
|
+
}), currentValue = _d[0], setCurrentValue = _d[1];
|
|
55
|
+
var _e = useState((_a = currentFilter === null || currentFilter === void 0 ? void 0 : currentFilter.search) !== null && _a !== void 0 ? _a : ''), searchValue = _e[0], setSearchValue = _e[1];
|
|
56
56
|
// Create a ref to store the debounced function
|
|
57
57
|
var debouncedFilterChangeRef = useRef(debounce(function (value) {
|
|
58
58
|
onFilterChange === null || onFilterChange === void 0 ? void 0 : onFilterChange('search', value);
|
|
@@ -92,7 +92,7 @@ export function QuoteHeader(props) {
|
|
|
92
92
|
setSearchValue('');
|
|
93
93
|
}
|
|
94
94
|
}, [currentFilter]);
|
|
95
|
-
return (_jsxs("div", { className: "quote-header", children: [_jsx(Heading, { level: 4, as: "h1", className: "quote-header__title", color: "accent", children: "Quotation & Booking" }), _jsxs("div", { className: "flex gap-4", children: [_jsx(Button, { variant: current === 'quotation' ? 'primary' : 'outline-primary', className: "quote-header__button", onClick: function () { return onNavigate('quotation'); }, children: "Quotation" }), _jsx(Button, { variant: current === 'booking' ? 'primary' : 'outline-primary', className: "quote-header__button", onClick: function () { return onNavigate('booking'); }, children: "Booking" })] }), _jsxs("div", { className: "quote-header__search-container", children: [_jsx(Input, { placeholder: "Search", icon: "search", iconPosition: "leading", className: "quote-header__search", value: searchValue, onChange: handleInputChange }), _jsx(Button, { variant: "primary", leadingIcon: "plus-circle", iconSize: "md", size: "sm", onClick: onNewQuote, children: "New quote" })] }), _jsx("div", { className: "quote-header__filters", children: Object.entries(
|
|
95
|
+
return (_jsxs("div", { className: "quote-header", children: [_jsx(Heading, { level: 4, as: "h1", className: "quote-header__title", color: "accent", children: "Quotation & Booking" }), _jsxs("div", { className: "flex gap-4", children: [_jsx(Button, { variant: current === 'quotation' ? 'primary' : 'outline-primary', className: "quote-header__button", onClick: function () { return onNavigate('quotation'); }, children: "Quotation" }), _jsx(Button, { variant: current === 'booking' ? 'primary' : 'outline-primary', className: "quote-header__button", onClick: function () { return onNavigate('booking'); }, children: "Booking" })] }), _jsxs("div", { className: "quote-header__search-container", children: [_jsx(Input, { placeholder: "Search", icon: "search", iconPosition: "leading", className: "quote-header__search", value: searchValue, onChange: handleInputChange }), _jsx(Button, { variant: "primary", leadingIcon: "plus-circle", iconSize: "md", size: "sm", onClick: onNewQuote, children: "New quote" })] }), _jsx("div", { className: "quote-header__filters", children: Object.entries(filters).map(function (_a) {
|
|
96
96
|
var key = _a[0], value = _a[1];
|
|
97
97
|
return (_jsx(DropdownInput, { placeholder: value.placeholder, options: value.options, value: currentValue[key], onSelect: function (value) {
|
|
98
98
|
var _a;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mautourco-components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.50",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "Bibliothèque de composants
|
|
5
|
+
"description": "Bibliothèque de composants Mautourco pour le redesign",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"engines": {
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
],
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "https://github.com/
|
|
19
|
+
"url": "https://github.com/Mautourco-mauritius/design_system.git"
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
22
22
|
"react",
|
|
23
23
|
"components",
|
|
24
24
|
"design-system",
|
|
25
|
-
"
|
|
25
|
+
"mautourco"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@hookform/resolvers": "^5.2.2",
|
|
@@ -26,6 +26,8 @@ export interface QuoteHeaderProps {
|
|
|
26
26
|
onFilterChange?: (filter: FilterType, value: string) => void;
|
|
27
27
|
|
|
28
28
|
currentFilter?: Record<FilterType, string>;
|
|
29
|
+
|
|
30
|
+
filters?: Record<string, any>;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
const filterConfig = {
|
|
@@ -50,6 +52,7 @@ export function QuoteHeader(props: QuoteHeaderProps) {
|
|
|
50
52
|
onNavigate,
|
|
51
53
|
onNewQuote,
|
|
52
54
|
onFilterChange,
|
|
55
|
+
filters = filterConfig,
|
|
53
56
|
} = props;
|
|
54
57
|
const [currentValue, setCurrentValue] = useState<Record<FilterType, string>>(
|
|
55
58
|
currentFilter || {
|
|
@@ -144,7 +147,7 @@ export function QuoteHeader(props: QuoteHeaderProps) {
|
|
|
144
147
|
</Button>
|
|
145
148
|
</div>
|
|
146
149
|
<div className="quote-header__filters">
|
|
147
|
-
{Object.entries(
|
|
150
|
+
{Object.entries(filters).map(([key, value]) => (
|
|
148
151
|
<DropdownInput
|
|
149
152
|
key={key}
|
|
150
153
|
placeholder={value.placeholder}
|