funda-ui 1.0.272
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/BackToTop/index.css +34 -0
- package/BackToTop/index.d.ts +11 -0
- package/BackToTop/index.js +458 -0
- package/CascadingSelect/index.css +159 -0
- package/CascadingSelect/index.d.ts +56 -0
- package/CascadingSelect/index.js +958 -0
- package/CascadingSelectE2E/index.css +159 -0
- package/CascadingSelectE2E/index.d.ts +60 -0
- package/CascadingSelectE2E/index.js +1126 -0
- package/Checkbox/index.d.ts +30 -0
- package/Checkbox/index.js +226 -0
- package/ColorPicker/index.css +38 -0
- package/ColorPicker/index.d.ts +27 -0
- package/ColorPicker/index.js +246 -0
- package/DigitalClock/index.d.ts +7 -0
- package/DigitalClock/index.js +208 -0
- package/DropdownMenu/index.css +127 -0
- package/DropdownMenu/index.d.ts +37 -0
- package/DropdownMenu/index.js +237 -0
- package/DynamicFields/index.d.ts +26 -0
- package/DynamicFields/index.js +412 -0
- package/File/index.d.ts +36 -0
- package/File/index.js +473 -0
- package/Input/index.d.ts +42 -0
- package/Input/index.js +286 -0
- package/LiveSearch/index.d.ts +37 -0
- package/LiveSearch/index.js +1195 -0
- package/ModalDialog/index.d.ts +60 -0
- package/ModalDialog/index.js +725 -0
- package/ModeSwitch/index.d.ts +17 -0
- package/ModeSwitch/index.js +202 -0
- package/MultiFuncSelect/index.css +178 -0
- package/MultiFuncSelect/index.d.ts +67 -0
- package/MultiFuncSelect/index.js +1826 -0
- package/MultilevelDropdownMenu/index.css +35 -0
- package/MultilevelDropdownMenu/index.d.ts +25 -0
- package/MultilevelDropdownMenu/index.js +464 -0
- package/Pagination/index.d.ts +49 -0
- package/Pagination/index.js +341 -0
- package/README.md +108 -0
- package/Radio/index.d.ts +31 -0
- package/Radio/index.js +246 -0
- package/RangeSlider/index.css +149 -0
- package/RangeSlider/index.d.ts +21 -0
- package/RangeSlider/index.js +730 -0
- package/ScrollReveal/index.css +23 -0
- package/ScrollReveal/index.d.ts +21 -0
- package/ScrollReveal/index.js +216 -0
- package/Scrollbar/index.css +168 -0
- package/Scrollbar/index.d.ts +15 -0
- package/Scrollbar/index.js +605 -0
- package/SearchBar/index.d.ts +32 -0
- package/SearchBar/index.js +246 -0
- package/Select/index.d.ts +34 -0
- package/Select/index.js +331 -0
- package/ShowMoreLess/index.css +23 -0
- package/ShowMoreLess/index.d.ts +30 -0
- package/ShowMoreLess/index.js +202 -0
- package/Switch/index.d.ts +29 -0
- package/Switch/index.js +211 -0
- package/Table/index.css +533 -0
- package/Table/index.d.ts +25 -0
- package/Table/index.js +2113 -0
- package/Tabs/index.d.ts +3 -0
- package/Tabs/index.js +323 -0
- package/TagInput/index.css +90 -0
- package/TagInput/index.d.ts +28 -0
- package/TagInput/index.js +370 -0
- package/Textarea/index.d.ts +30 -0
- package/Textarea/index.js +242 -0
- package/Toast/index.css +95 -0
- package/Toast/index.d.ts +35 -0
- package/Toast/index.js +340 -0
- package/Tooltip/index.css +240 -0
- package/Tooltip/index.d.ts +19 -0
- package/Tooltip/index.js +200 -0
- package/Tree/index.css +225 -0
- package/Tree/index.d.ts +37 -0
- package/Tree/index.js +1406 -0
- package/all.d.ts +33 -0
- package/all.js +35 -0
- package/lib/cjs/BackToTop/index.d.ts +11 -0
- package/lib/cjs/BackToTop/index.js +458 -0
- package/lib/cjs/CascadingSelect/index.d.ts +56 -0
- package/lib/cjs/CascadingSelect/index.js +958 -0
- package/lib/cjs/CascadingSelectE2E/index.d.ts +60 -0
- package/lib/cjs/CascadingSelectE2E/index.js +1126 -0
- package/lib/cjs/Checkbox/index.d.ts +30 -0
- package/lib/cjs/Checkbox/index.js +226 -0
- package/lib/cjs/ColorPicker/index.d.ts +27 -0
- package/lib/cjs/ColorPicker/index.js +246 -0
- package/lib/cjs/DigitalClock/index.d.ts +7 -0
- package/lib/cjs/DigitalClock/index.js +208 -0
- package/lib/cjs/DropdownMenu/index.d.ts +37 -0
- package/lib/cjs/DropdownMenu/index.js +237 -0
- package/lib/cjs/DynamicFields/index.d.ts +26 -0
- package/lib/cjs/DynamicFields/index.js +412 -0
- package/lib/cjs/File/index.d.ts +36 -0
- package/lib/cjs/File/index.js +473 -0
- package/lib/cjs/Input/index.d.ts +42 -0
- package/lib/cjs/Input/index.js +286 -0
- package/lib/cjs/LiveSearch/index.d.ts +37 -0
- package/lib/cjs/LiveSearch/index.js +1195 -0
- package/lib/cjs/ModalDialog/index.d.ts +60 -0
- package/lib/cjs/ModalDialog/index.js +725 -0
- package/lib/cjs/ModeSwitch/index.d.ts +17 -0
- package/lib/cjs/ModeSwitch/index.js +202 -0
- package/lib/cjs/MultiFuncSelect/index.d.ts +67 -0
- package/lib/cjs/MultiFuncSelect/index.js +1826 -0
- package/lib/cjs/MultilevelDropdownMenu/index.d.ts +25 -0
- package/lib/cjs/MultilevelDropdownMenu/index.js +464 -0
- package/lib/cjs/Pagination/index.d.ts +49 -0
- package/lib/cjs/Pagination/index.js +341 -0
- package/lib/cjs/Radio/index.d.ts +31 -0
- package/lib/cjs/Radio/index.js +246 -0
- package/lib/cjs/RangeSlider/index.d.ts +21 -0
- package/lib/cjs/RangeSlider/index.js +730 -0
- package/lib/cjs/ScrollReveal/index.d.ts +21 -0
- package/lib/cjs/ScrollReveal/index.js +216 -0
- package/lib/cjs/Scrollbar/index.d.ts +15 -0
- package/lib/cjs/Scrollbar/index.js +605 -0
- package/lib/cjs/SearchBar/index.d.ts +32 -0
- package/lib/cjs/SearchBar/index.js +246 -0
- package/lib/cjs/Select/index.d.ts +34 -0
- package/lib/cjs/Select/index.js +331 -0
- package/lib/cjs/ShowMoreLess/index.d.ts +30 -0
- package/lib/cjs/ShowMoreLess/index.js +202 -0
- package/lib/cjs/Switch/index.d.ts +29 -0
- package/lib/cjs/Switch/index.js +211 -0
- package/lib/cjs/Table/index.d.ts +25 -0
- package/lib/cjs/Table/index.js +2113 -0
- package/lib/cjs/Tabs/index.d.ts +3 -0
- package/lib/cjs/Tabs/index.js +323 -0
- package/lib/cjs/TagInput/index.d.ts +28 -0
- package/lib/cjs/TagInput/index.js +370 -0
- package/lib/cjs/Textarea/index.d.ts +30 -0
- package/lib/cjs/Textarea/index.js +242 -0
- package/lib/cjs/Toast/index.d.ts +35 -0
- package/lib/cjs/Toast/index.js +340 -0
- package/lib/cjs/Tooltip/index.d.ts +19 -0
- package/lib/cjs/Tooltip/index.js +200 -0
- package/lib/cjs/Tree/index.d.ts +37 -0
- package/lib/cjs/Tree/index.js +1406 -0
- package/lib/cjs/index.d.ts +33 -0
- package/lib/cjs/index.js +35 -0
- package/lib/css/BackToTop/index.css +34 -0
- package/lib/css/CascadingSelect/index.css +159 -0
- package/lib/css/CascadingSelectE2E/index.css +159 -0
- package/lib/css/ColorPicker/index.css +38 -0
- package/lib/css/DropdownMenu/index.css +127 -0
- package/lib/css/MultiFuncSelect/index.css +178 -0
- package/lib/css/MultilevelDropdownMenu/index.css +35 -0
- package/lib/css/RangeSlider/index.css +149 -0
- package/lib/css/ScrollReveal/index.css +23 -0
- package/lib/css/Scrollbar/index.css +168 -0
- package/lib/css/ShowMoreLess/index.css +23 -0
- package/lib/css/Table/index.css +533 -0
- package/lib/css/TagInput/index.css +90 -0
- package/lib/css/Toast/index.css +95 -0
- package/lib/css/Tooltip/index.css +240 -0
- package/lib/css/Tree/index.css +225 -0
- package/lib/esm/BackToTop/index.scss +47 -0
- package/lib/esm/BackToTop/index.tsx +182 -0
- package/lib/esm/BackToTop/utils/easing.js +200 -0
- package/lib/esm/BackToTop/utils/performance.js +52 -0
- package/lib/esm/CascadingSelect/Group.tsx +39 -0
- package/lib/esm/CascadingSelect/index.scss +214 -0
- package/lib/esm/CascadingSelect/index.tsx +922 -0
- package/lib/esm/CascadingSelect/utils/performance.js +52 -0
- package/lib/esm/CascadingSelectE2E/Group.tsx +39 -0
- package/lib/esm/CascadingSelectE2E/index.scss +214 -0
- package/lib/esm/CascadingSelectE2E/index.tsx +1091 -0
- package/lib/esm/CascadingSelectE2E/utils/performance.js +52 -0
- package/lib/esm/Checkbox/index.tsx +160 -0
- package/lib/esm/ColorPicker/index.scss +48 -0
- package/lib/esm/ColorPicker/index.tsx +187 -0
- package/lib/esm/DigitalClock/index.tsx +72 -0
- package/lib/esm/DigitalClock/utils/useInterval.js +43 -0
- package/lib/esm/DropdownMenu/Option.tsx +27 -0
- package/lib/esm/DropdownMenu/index.scss +180 -0
- package/lib/esm/DropdownMenu/index.tsx +148 -0
- package/lib/esm/DynamicFields/index.tsx +386 -0
- package/lib/esm/File/index.tsx +302 -0
- package/lib/esm/Input/index.tsx +233 -0
- package/lib/esm/LiveSearch/index.tsx +582 -0
- package/lib/esm/LiveSearch/utils/performance.js +52 -0
- package/lib/esm/LiveSearch/utils/useThrottle.js +36 -0
- package/lib/esm/ModalDialog/index.tsx +479 -0
- package/lib/esm/ModalDialog/plugins/BSL/bodyScrollLock.es6.js +262 -0
- package/lib/esm/ModalDialog/plugins/BSL/index.ts +2 -0
- package/lib/esm/ModeSwitch/index.tsx +82 -0
- package/lib/esm/MultiFuncSelect/index.scss +269 -0
- package/lib/esm/MultiFuncSelect/index.tsx +1597 -0
- package/lib/esm/MultiFuncSelect/utils/performance.js +52 -0
- package/lib/esm/MultiFuncSelect/utils/tree.js +103 -0
- package/lib/esm/MultiFuncSelect/utils/useThrottle.js +36 -0
- package/lib/esm/MultilevelDropdownMenu/MenuList.tsx +230 -0
- package/lib/esm/MultilevelDropdownMenu/index.scss +75 -0
- package/lib/esm/MultilevelDropdownMenu/index.tsx +71 -0
- package/lib/esm/MultilevelDropdownMenu/utils/dom.js +81 -0
- package/lib/esm/Pagination/index.tsx +230 -0
- package/lib/esm/Pagination/pagination-navigators.tsx +60 -0
- package/lib/esm/Radio/index.tsx +201 -0
- package/lib/esm/RangeSlider/index.scss +184 -0
- package/lib/esm/RangeSlider/index.tsx +223 -0
- package/lib/esm/ScrollReveal/index.scss +27 -0
- package/lib/esm/ScrollReveal/index.tsx +146 -0
- package/lib/esm/Scrollbar/index.scss +217 -0
- package/lib/esm/Scrollbar/index.tsx +497 -0
- package/lib/esm/Scrollbar/utils/performance.js +52 -0
- package/lib/esm/SearchBar/index.tsx +181 -0
- package/lib/esm/Select/index.tsx +276 -0
- package/lib/esm/ShowMoreLess/index.scss +27 -0
- package/lib/esm/ShowMoreLess/index.tsx +144 -0
- package/lib/esm/Switch/index.tsx +143 -0
- package/lib/esm/Table/TableColgroup.tsx +29 -0
- package/lib/esm/Table/TableField.tsx +40 -0
- package/lib/esm/Table/TableFieldRow.tsx +212 -0
- package/lib/esm/Table/TableHeaders.tsx +146 -0
- package/lib/esm/Table/TableRow.tsx +127 -0
- package/lib/esm/Table/TableSummaries.tsx +36 -0
- package/lib/esm/Table/index.scss +364 -0
- package/lib/esm/Table/index.tsx +576 -0
- package/lib/esm/Table/table-utils.ts +65 -0
- package/lib/esm/Table/utils/dom.js +81 -0
- package/lib/esm/Table/utils/performance.js +52 -0
- package/lib/esm/Tabs/TabList.tsx +42 -0
- package/lib/esm/Tabs/TabPanel.tsx +34 -0
- package/lib/esm/Tabs/Tabs.tsx +232 -0
- package/lib/esm/Tabs/index.tsx +3 -0
- package/lib/esm/TagInput/index.scss +125 -0
- package/lib/esm/TagInput/index.tsx +314 -0
- package/lib/esm/Textarea/index.tsx +178 -0
- package/lib/esm/Toast/Item.tsx +75 -0
- package/lib/esm/Toast/index.scss +120 -0
- package/lib/esm/Toast/index.tsx +249 -0
- package/lib/esm/Tooltip/index.scss +327 -0
- package/lib/esm/Tooltip/index.tsx +142 -0
- package/lib/esm/Tree/TreeList.tsx +503 -0
- package/lib/esm/Tree/index.scss +375 -0
- package/lib/esm/Tree/index.tsx +301 -0
- package/lib/esm/Tree/init-height.tsx +27 -0
- package/lib/esm/Tree/utils/convert-tree.js +29 -0
- package/lib/esm/Tree/utils/dom.js +81 -0
- package/lib/esm/index.js +31 -0
- package/package.json +40 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert Tree
|
|
3
|
+
* @param {Array} arr - Input array to convert
|
|
4
|
+
* @param {?String | ?Number} parentId - Parent id
|
|
5
|
+
* @param {?String} keyId - Key value of id.
|
|
6
|
+
* @param {?String} keyParentId - Key value of parent id.
|
|
7
|
+
* @returns Array
|
|
8
|
+
*/
|
|
9
|
+
function convertTree(arr, parentId = '', keyId = 'id', keyParentId = 'parent_id') {
|
|
10
|
+
|
|
11
|
+
if( !parentId ) {
|
|
12
|
+
|
|
13
|
+
// If there is no parent id (when recursing for the first time), all parents will be queried
|
|
14
|
+
return arr.filter(item => !item[keyParentId]).map(item => {
|
|
15
|
+
// Query all child nodes by parent node ID
|
|
16
|
+
item.children = convertTree(arr, item[keyId], keyId, keyParentId);
|
|
17
|
+
return item;
|
|
18
|
+
})
|
|
19
|
+
} else {
|
|
20
|
+
return arr.filter(item => item[keyParentId] === parentId).map(item => {
|
|
21
|
+
// Query all child nodes by parent node ID
|
|
22
|
+
item.children = convertTree(arr, item[keyId], keyId, keyParentId);
|
|
23
|
+
return item;
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module.exports = convertTree;
|
|
29
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dom Utilities
|
|
3
|
+
* @param {HTMLElement} el - Element
|
|
4
|
+
* @param {?String} filter - A filter string
|
|
5
|
+
* @returns HtmlElementCollection
|
|
6
|
+
*/
|
|
7
|
+
function matches(el, filter) {
|
|
8
|
+
if (el && el.nodeType === 1) {
|
|
9
|
+
if (filter) {
|
|
10
|
+
return el.matches(filter);
|
|
11
|
+
}
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// the next siblings
|
|
18
|
+
function getNextSiblings(el, filter = false || '') {
|
|
19
|
+
const sibs = [];
|
|
20
|
+
while (el = el.nextSibling) {
|
|
21
|
+
if (matches(el, filter)) {
|
|
22
|
+
sibs.push(el);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return sibs;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// previous siblings
|
|
29
|
+
function getPreviousSiblings(el, filter = false || '') {
|
|
30
|
+
const sibs = [];
|
|
31
|
+
while (el = el.previousSibling) {
|
|
32
|
+
if (matches(el, filter)) {
|
|
33
|
+
sibs.push(el);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return sibs;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// parent and get all the siblings
|
|
40
|
+
function getAllSiblings(el, filter = false || '') {
|
|
41
|
+
const sibs = [];
|
|
42
|
+
el = el.parentNode.firstChild;
|
|
43
|
+
while (el = el.nextSibling) {
|
|
44
|
+
if (matches(el, filter)) {
|
|
45
|
+
sibs.push(el);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return sibs;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// all parent nodes
|
|
52
|
+
function getParents(el, filter = false || '') {
|
|
53
|
+
const parents = [];
|
|
54
|
+
while (el = el.parentNode) {
|
|
55
|
+
if (matches(el, filter)) {
|
|
56
|
+
parents.push(el);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return parents;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// all child nodes
|
|
63
|
+
function getChildren(el, filter = false || '', all = []) {
|
|
64
|
+
all.push(...el.childNodes);
|
|
65
|
+
for (const child of el.childNodes) {
|
|
66
|
+
getChildren(child, filter, all);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const res = all.filter( item => matches(item, filter) );
|
|
70
|
+
return res;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
module.exports = {
|
|
75
|
+
getNextSiblings,
|
|
76
|
+
getPreviousSiblings,
|
|
77
|
+
getAllSiblings,
|
|
78
|
+
getParents,
|
|
79
|
+
getChildren
|
|
80
|
+
}
|
|
81
|
+
|
package/lib/esm/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { default as BackToTop } from './BackToTop';
|
|
2
|
+
export { default as CascadingSelect } from './CascadingSelect';
|
|
3
|
+
export { default as CascadingSelectE2E } from './CascadingSelectE2E';
|
|
4
|
+
export { default as Checkbox } from './Checkbox';
|
|
5
|
+
export { default as ColorPicker } from './ColorPicker';
|
|
6
|
+
export { default as DigitalClock } from './DigitalClock';
|
|
7
|
+
export { default as DropdownMenu } from './DropdownMenu';
|
|
8
|
+
export { default as DynamicFields } from './DynamicFields';
|
|
9
|
+
export { default as File } from './File';
|
|
10
|
+
export { default as Input } from './Input';
|
|
11
|
+
export { default as LiveSearch } from './LiveSearch';
|
|
12
|
+
export { default as ModalDialog } from './ModalDialog';
|
|
13
|
+
export { default as ModeSwitch } from './ModeSwitch';
|
|
14
|
+
export { default as MultiFuncSelect } from './MultiFuncSelect';
|
|
15
|
+
export { default as MultilevelDropdownMenu } from './MultilevelDropdownMenu';
|
|
16
|
+
export { default as Pagination } from './Pagination';
|
|
17
|
+
export { default as Radio } from './Radio';
|
|
18
|
+
export { default as RangeSlider } from './RangeSlider';
|
|
19
|
+
export { default as ScrollReveal } from './ScrollReveal';
|
|
20
|
+
export { default as Scrollbar } from './Scrollbar';
|
|
21
|
+
export { default as SearchBar } from './SearchBar';
|
|
22
|
+
export { default as Select } from './Select';
|
|
23
|
+
export { default as ShowMoreLess } from './ShowMoreLess';
|
|
24
|
+
export { default as Switch } from './Switch';
|
|
25
|
+
export { default as Table } from './Table';
|
|
26
|
+
export { default as Tabs } from './Tabs';
|
|
27
|
+
export { default as TagInput } from './TagInput';
|
|
28
|
+
export { default as Textarea } from './Textarea';
|
|
29
|
+
export { default as Toast } from './Toast';
|
|
30
|
+
export { default as Tooltip } from './Tooltip';
|
|
31
|
+
export { default as Tree } from './Tree';
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "UIUX Lab",
|
|
3
|
+
"email": "uiuxlab@gmail.com",
|
|
4
|
+
"name": "funda-ui",
|
|
5
|
+
"version": "1.0.272",
|
|
6
|
+
"description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/xizon/funda-ui.git"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"bootstrap",
|
|
16
|
+
"react-bootstrap",
|
|
17
|
+
"react-components",
|
|
18
|
+
"components",
|
|
19
|
+
"components-react",
|
|
20
|
+
"react-bootstrap-components",
|
|
21
|
+
"react"
|
|
22
|
+
],
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/xizon/funda-ui/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/xizon/funda-ui#readme",
|
|
27
|
+
"main": "all.js",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"react": "^18.2.0",
|
|
31
|
+
"react-dom": "^18.2.0"
|
|
32
|
+
},
|
|
33
|
+
"types": "all.d.ts",
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"directory": "lib"
|
|
36
|
+
},
|
|
37
|
+
"directories": {
|
|
38
|
+
"lib": "lib"
|
|
39
|
+
}
|
|
40
|
+
}
|