rsuite 5.38.0 → 5.40.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/CHANGELOG.md +20 -0
- package/Nav/styles/index.less +10 -11
- package/SelectPicker/styles/index.less +8 -4
- package/cjs/CheckTreePicker/CheckTreePicker.js +1 -1
- package/cjs/CheckTreePicker/utils.d.ts +1 -1
- package/cjs/CheckTreePicker/utils.js +2 -2
- package/cjs/SelectPicker/Listbox.d.ts +34 -0
- package/cjs/SelectPicker/Listbox.js +263 -0
- package/cjs/SelectPicker/ListboxOption.d.ts +11 -0
- package/cjs/SelectPicker/ListboxOption.js +50 -0
- package/cjs/SelectPicker/ListboxOptionGroup.d.ts +9 -0
- package/cjs/SelectPicker/ListboxOptionGroup.js +69 -0
- package/cjs/SelectPicker/SelectPicker.js +33 -36
- package/cjs/Windowing/List.d.ts +2 -2
- package/cjs/locales/index.d.ts +1 -0
- package/cjs/locales/index.js +6 -2
- package/cjs/locales/ne_NP.d.ts +117 -0
- package/cjs/locales/ne_NP.js +89 -0
- package/cjs/utils/getDataGroupBy.d.ts +23 -0
- package/cjs/utils/getDataGroupBy.js +33 -0
- package/cjs/utils/treeUtils.d.ts +1 -1
- package/cjs/utils/treeUtils.js +8 -8
- package/dist/rsuite-no-reset-rtl.css +22 -11
- package/dist/rsuite-no-reset-rtl.min.css +1 -1
- package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
- package/dist/rsuite-no-reset.css +22 -11
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +22 -11
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +22 -11
- package/dist/rsuite.js +53 -20
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.css.map +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/CheckTreePicker/CheckTreePicker.js +1 -1
- package/esm/CheckTreePicker/utils.d.ts +1 -1
- package/esm/CheckTreePicker/utils.js +2 -2
- package/esm/SelectPicker/Listbox.d.ts +34 -0
- package/esm/SelectPicker/Listbox.js +240 -0
- package/esm/SelectPicker/ListboxOption.d.ts +11 -0
- package/esm/SelectPicker/ListboxOption.js +37 -0
- package/esm/SelectPicker/ListboxOptionGroup.d.ts +9 -0
- package/esm/SelectPicker/ListboxOptionGroup.js +53 -0
- package/esm/SelectPicker/SelectPicker.js +33 -36
- package/esm/Windowing/List.d.ts +2 -2
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +2 -1
- package/esm/locales/ne_NP.d.ts +117 -0
- package/esm/locales/ne_NP.js +79 -0
- package/esm/utils/getDataGroupBy.d.ts +23 -0
- package/esm/utils/getDataGroupBy.js +32 -0
- package/esm/utils/treeUtils.d.ts +1 -1
- package/esm/utils/treeUtils.js +8 -8
- package/locales/ne_NP/package.json +7 -0
- package/package.json +2 -2
- package/styles/mixins/listbox.less +2 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import enGB from 'date-fns/locale/en-GB';
|
|
3
|
+
var Calendar = {
|
|
4
|
+
sunday: 'आ',
|
|
5
|
+
monday: 'सो',
|
|
6
|
+
tuesday: 'म',
|
|
7
|
+
wednesday: 'बु',
|
|
8
|
+
thursday: 'बि',
|
|
9
|
+
friday: 'शु',
|
|
10
|
+
saturday: 'श',
|
|
11
|
+
ok: 'हुन्छ',
|
|
12
|
+
today: 'आज',
|
|
13
|
+
yesterday: 'हिजो',
|
|
14
|
+
hours: 'घण्टा',
|
|
15
|
+
minutes: 'मिनेट',
|
|
16
|
+
seconds: 'सेकेन्ड',
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Format of the string is based on Unicode Technical Standard #35:
|
|
20
|
+
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
21
|
+
**/
|
|
22
|
+
formattedMonthPattern: 'MMM yyyy',
|
|
23
|
+
formattedDayPattern: 'dd MMM yyyy',
|
|
24
|
+
dateLocale: enGB
|
|
25
|
+
};
|
|
26
|
+
export default {
|
|
27
|
+
common: {
|
|
28
|
+
loading: 'लोड हुँदैछ...',
|
|
29
|
+
emptyMessage: 'कुनै डाटा छैन'
|
|
30
|
+
},
|
|
31
|
+
Plaintext: {
|
|
32
|
+
unfilled: 'भरिएको छैन',
|
|
33
|
+
notSelected: 'चयन गरिएको छैन',
|
|
34
|
+
notUploaded: 'अपलोड गरिएको छैन'
|
|
35
|
+
},
|
|
36
|
+
Pagination: {
|
|
37
|
+
more: 'थप',
|
|
38
|
+
prev: 'अघिल्लो',
|
|
39
|
+
next: 'अर्को',
|
|
40
|
+
first: 'पहिलो',
|
|
41
|
+
last: 'अन्तिम',
|
|
42
|
+
limit: '{0} / पृष्ठ',
|
|
43
|
+
total: 'कुल पङ्क्तिहरू: {0}',
|
|
44
|
+
skip: '{0} पृष्ठमा जानुहोस्'
|
|
45
|
+
},
|
|
46
|
+
Calendar: Calendar,
|
|
47
|
+
DatePicker: _extends({}, Calendar),
|
|
48
|
+
DateRangePicker: _extends({}, Calendar, {
|
|
49
|
+
last7Days: 'पछिल्लो ७ दिन'
|
|
50
|
+
}),
|
|
51
|
+
Picker: {
|
|
52
|
+
noResultsText: 'कुनै परिणाम फेला परेन',
|
|
53
|
+
placeholder: 'चयन गर्नुहोस्',
|
|
54
|
+
searchPlaceholder: 'खोजी गर्नुहोस्',
|
|
55
|
+
checkAll: 'सबै'
|
|
56
|
+
},
|
|
57
|
+
InputPicker: {
|
|
58
|
+
newItem: 'नयाँ थप्नुहोस्',
|
|
59
|
+
createOption: 'विकल्प सिर्जना गर्नुहोस् "{0}"'
|
|
60
|
+
},
|
|
61
|
+
Uploader: {
|
|
62
|
+
inited: 'प्रारम्भिक',
|
|
63
|
+
progress: 'अपलोड गर्दै',
|
|
64
|
+
error: 'त्रुटि भयो',
|
|
65
|
+
complete: 'समाप्त',
|
|
66
|
+
emptyFile: 'खाली',
|
|
67
|
+
upload: 'अपलोड गर्नुहोस्'
|
|
68
|
+
},
|
|
69
|
+
CloseButton: {
|
|
70
|
+
closeLabel: 'बन्द गर्नुहोस्'
|
|
71
|
+
},
|
|
72
|
+
Breadcrumb: {
|
|
73
|
+
expandText: 'स्थान देखाउनुहोस्'
|
|
74
|
+
},
|
|
75
|
+
Toggle: {
|
|
76
|
+
on: 'खोल्नुहोस्',
|
|
77
|
+
off: 'बन्द गर्नुहोस्'
|
|
78
|
+
}
|
|
79
|
+
};
|
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
export declare const KEY_GROUP: string | symbol;
|
|
2
2
|
export declare const KEY_GROUP_TITLE = "groupTitle";
|
|
3
|
+
/**
|
|
4
|
+
* Chunk data into groups
|
|
5
|
+
* @returns [group, child, child, group, child, child]
|
|
6
|
+
*/
|
|
3
7
|
export declare function getDataGroupBy<T>(data: readonly T[], key: string, sort?: (isGroup: boolean) => <T>(a: T, b: T) => number): (T | {
|
|
4
8
|
groupTitle: string;
|
|
5
9
|
children: T[];
|
|
6
10
|
})[];
|
|
11
|
+
/**
|
|
12
|
+
* Chunk options into groups
|
|
13
|
+
* @returns [
|
|
14
|
+
* group {
|
|
15
|
+
* key
|
|
16
|
+
* options
|
|
17
|
+
* }
|
|
18
|
+
* group {
|
|
19
|
+
* key
|
|
20
|
+
* options
|
|
21
|
+
* }
|
|
22
|
+
* ]
|
|
23
|
+
*/
|
|
24
|
+
export declare type Group<T> = {
|
|
25
|
+
key: string;
|
|
26
|
+
options: T[];
|
|
27
|
+
};
|
|
28
|
+
export declare type CompareFn<T> = (a: T, b: T) => number;
|
|
29
|
+
export declare function groupOptions<T>(options: readonly T[], groupKey: string, compareOptions?: CompareFn<T>, compareGroups?: CompareFn<Group<T>>): Group<T>[];
|
|
@@ -3,6 +3,11 @@ import { WalkTreeStrategy, flattenTree } from '../utils/treeUtils';
|
|
|
3
3
|
var hasSymbol = typeof Symbol === 'function';
|
|
4
4
|
export var KEY_GROUP = hasSymbol ? Symbol('_$grouped') : '_$grouped';
|
|
5
5
|
export var KEY_GROUP_TITLE = 'groupTitle';
|
|
6
|
+
/**
|
|
7
|
+
* Chunk data into groups
|
|
8
|
+
* @returns [group, child, child, group, child, child]
|
|
9
|
+
*/
|
|
10
|
+
|
|
6
11
|
export function getDataGroupBy(data, key, sort) {
|
|
7
12
|
var groupMap = _groupBy(data, key);
|
|
8
13
|
|
|
@@ -27,4 +32,31 @@ export function getDataGroupBy(data, key, sort) {
|
|
|
27
32
|
return flattenTree(groups, function (group) {
|
|
28
33
|
return group.children;
|
|
29
34
|
}, WalkTreeStrategy.DFS);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Chunk options into groups
|
|
38
|
+
* @returns [
|
|
39
|
+
* group {
|
|
40
|
+
* key
|
|
41
|
+
* options
|
|
42
|
+
* }
|
|
43
|
+
* group {
|
|
44
|
+
* key
|
|
45
|
+
* options
|
|
46
|
+
* }
|
|
47
|
+
* ]
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
export function groupOptions(options, groupKey, compareOptions, compareGroups) {
|
|
51
|
+
var groupMap = _groupBy(options, groupKey);
|
|
52
|
+
|
|
53
|
+
var groups = Object.entries(groupMap).map(function (_ref3) {
|
|
54
|
+
var key = _ref3[0],
|
|
55
|
+
options = _ref3[1];
|
|
56
|
+
return {
|
|
57
|
+
key: key,
|
|
58
|
+
options: typeof compareOptions === 'function' ? options.sort(compareOptions) : options
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
return typeof compareGroups === 'function' ? groups.sort(compareGroups) : groups;
|
|
30
62
|
}
|
package/esm/utils/treeUtils.d.ts
CHANGED
|
@@ -240,7 +240,7 @@ export declare function useTreeSearch<T>(props: TreeSearchProps<T>): {
|
|
|
240
240
|
filteredData: T[];
|
|
241
241
|
setFilteredData: (data: T[], searchKeyword: string) => void;
|
|
242
242
|
setSearchKeyword: React.Dispatch<React.SetStateAction<string>>;
|
|
243
|
-
handleSearch: (searchKeyword: string, event
|
|
243
|
+
handleSearch: (searchKeyword: string, event?: React.ChangeEvent) => void;
|
|
244
244
|
};
|
|
245
245
|
export declare function useGetTreeNodeChildren<T extends Record<string, unknown>>(treeData: T[], valueKey: string, childrenKey: string): {
|
|
246
246
|
data: T[];
|
package/esm/utils/treeUtils.js
CHANGED
|
@@ -946,9 +946,7 @@ export function useTreeSearch(props) {
|
|
|
946
946
|
return data;
|
|
947
947
|
}, [childrenKey, labelKey, searchBy]); // Use search keywords to filter options.
|
|
948
948
|
|
|
949
|
-
var _useState5 = useState(
|
|
950
|
-
return searchKeyword !== null && searchKeyword !== void 0 ? searchKeyword : '';
|
|
951
|
-
}),
|
|
949
|
+
var _useState5 = useState(searchKeyword !== null && searchKeyword !== void 0 ? searchKeyword : ''),
|
|
952
950
|
searchKeywordState = _useState5[0],
|
|
953
951
|
setSearchKeyword = _useState5[1];
|
|
954
952
|
|
|
@@ -958,17 +956,19 @@ export function useTreeSearch(props) {
|
|
|
958
956
|
filteredData = _useState6[0],
|
|
959
957
|
setFilteredData = _useState6[1];
|
|
960
958
|
|
|
961
|
-
var handleSetFilteredData = useCallback(function (data, searchKeyword) {
|
|
962
|
-
setFilteredData(filterVisibleData(data, searchKeyword));
|
|
963
|
-
}, [filterVisibleData]);
|
|
964
|
-
|
|
965
959
|
var handleSearch = function handleSearch(searchKeyword, event) {
|
|
966
960
|
var filteredData = filterVisibleData(data, searchKeyword);
|
|
967
961
|
setFilteredData(filteredData);
|
|
968
962
|
setSearchKeyword(searchKeyword);
|
|
969
|
-
callback === null || callback === void 0 ? void 0 : callback(searchKeyword, filteredData, event);
|
|
963
|
+
event && (callback === null || callback === void 0 ? void 0 : callback(searchKeyword, filteredData, event));
|
|
970
964
|
};
|
|
971
965
|
|
|
966
|
+
useEffect(function () {
|
|
967
|
+
handleSearch(searchKeyword !== null && searchKeyword !== void 0 ? searchKeyword : ''); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
968
|
+
}, [searchKeyword]);
|
|
969
|
+
var handleSetFilteredData = useCallback(function (data, searchKeyword) {
|
|
970
|
+
setFilteredData(filterVisibleData(data, searchKeyword));
|
|
971
|
+
}, [filterVisibleData]);
|
|
972
972
|
return {
|
|
973
973
|
searchKeywordState: searchKeywordState,
|
|
974
974
|
filteredData: filteredData,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsuite",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.40.0",
|
|
4
4
|
"description": "A suite of react components",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"prop-types": "^15.8.1",
|
|
39
39
|
"react-use-set": "^1.0.0",
|
|
40
40
|
"react-window": "^1.8.8",
|
|
41
|
-
"rsuite-table": "^5.
|
|
41
|
+
"rsuite-table": "^5.12.0",
|
|
42
42
|
"schema-typed": "^2.1.3"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|