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.
Files changed (246) hide show
  1. package/BackToTop/index.css +34 -0
  2. package/BackToTop/index.d.ts +11 -0
  3. package/BackToTop/index.js +458 -0
  4. package/CascadingSelect/index.css +159 -0
  5. package/CascadingSelect/index.d.ts +56 -0
  6. package/CascadingSelect/index.js +958 -0
  7. package/CascadingSelectE2E/index.css +159 -0
  8. package/CascadingSelectE2E/index.d.ts +60 -0
  9. package/CascadingSelectE2E/index.js +1126 -0
  10. package/Checkbox/index.d.ts +30 -0
  11. package/Checkbox/index.js +226 -0
  12. package/ColorPicker/index.css +38 -0
  13. package/ColorPicker/index.d.ts +27 -0
  14. package/ColorPicker/index.js +246 -0
  15. package/DigitalClock/index.d.ts +7 -0
  16. package/DigitalClock/index.js +208 -0
  17. package/DropdownMenu/index.css +127 -0
  18. package/DropdownMenu/index.d.ts +37 -0
  19. package/DropdownMenu/index.js +237 -0
  20. package/DynamicFields/index.d.ts +26 -0
  21. package/DynamicFields/index.js +412 -0
  22. package/File/index.d.ts +36 -0
  23. package/File/index.js +473 -0
  24. package/Input/index.d.ts +42 -0
  25. package/Input/index.js +286 -0
  26. package/LiveSearch/index.d.ts +37 -0
  27. package/LiveSearch/index.js +1195 -0
  28. package/ModalDialog/index.d.ts +60 -0
  29. package/ModalDialog/index.js +725 -0
  30. package/ModeSwitch/index.d.ts +17 -0
  31. package/ModeSwitch/index.js +202 -0
  32. package/MultiFuncSelect/index.css +178 -0
  33. package/MultiFuncSelect/index.d.ts +67 -0
  34. package/MultiFuncSelect/index.js +1826 -0
  35. package/MultilevelDropdownMenu/index.css +35 -0
  36. package/MultilevelDropdownMenu/index.d.ts +25 -0
  37. package/MultilevelDropdownMenu/index.js +464 -0
  38. package/Pagination/index.d.ts +49 -0
  39. package/Pagination/index.js +341 -0
  40. package/README.md +108 -0
  41. package/Radio/index.d.ts +31 -0
  42. package/Radio/index.js +246 -0
  43. package/RangeSlider/index.css +149 -0
  44. package/RangeSlider/index.d.ts +21 -0
  45. package/RangeSlider/index.js +730 -0
  46. package/ScrollReveal/index.css +23 -0
  47. package/ScrollReveal/index.d.ts +21 -0
  48. package/ScrollReveal/index.js +216 -0
  49. package/Scrollbar/index.css +168 -0
  50. package/Scrollbar/index.d.ts +15 -0
  51. package/Scrollbar/index.js +605 -0
  52. package/SearchBar/index.d.ts +32 -0
  53. package/SearchBar/index.js +246 -0
  54. package/Select/index.d.ts +34 -0
  55. package/Select/index.js +331 -0
  56. package/ShowMoreLess/index.css +23 -0
  57. package/ShowMoreLess/index.d.ts +30 -0
  58. package/ShowMoreLess/index.js +202 -0
  59. package/Switch/index.d.ts +29 -0
  60. package/Switch/index.js +211 -0
  61. package/Table/index.css +533 -0
  62. package/Table/index.d.ts +25 -0
  63. package/Table/index.js +2113 -0
  64. package/Tabs/index.d.ts +3 -0
  65. package/Tabs/index.js +323 -0
  66. package/TagInput/index.css +90 -0
  67. package/TagInput/index.d.ts +28 -0
  68. package/TagInput/index.js +370 -0
  69. package/Textarea/index.d.ts +30 -0
  70. package/Textarea/index.js +242 -0
  71. package/Toast/index.css +95 -0
  72. package/Toast/index.d.ts +35 -0
  73. package/Toast/index.js +340 -0
  74. package/Tooltip/index.css +240 -0
  75. package/Tooltip/index.d.ts +19 -0
  76. package/Tooltip/index.js +200 -0
  77. package/Tree/index.css +225 -0
  78. package/Tree/index.d.ts +37 -0
  79. package/Tree/index.js +1406 -0
  80. package/all.d.ts +33 -0
  81. package/all.js +35 -0
  82. package/lib/cjs/BackToTop/index.d.ts +11 -0
  83. package/lib/cjs/BackToTop/index.js +458 -0
  84. package/lib/cjs/CascadingSelect/index.d.ts +56 -0
  85. package/lib/cjs/CascadingSelect/index.js +958 -0
  86. package/lib/cjs/CascadingSelectE2E/index.d.ts +60 -0
  87. package/lib/cjs/CascadingSelectE2E/index.js +1126 -0
  88. package/lib/cjs/Checkbox/index.d.ts +30 -0
  89. package/lib/cjs/Checkbox/index.js +226 -0
  90. package/lib/cjs/ColorPicker/index.d.ts +27 -0
  91. package/lib/cjs/ColorPicker/index.js +246 -0
  92. package/lib/cjs/DigitalClock/index.d.ts +7 -0
  93. package/lib/cjs/DigitalClock/index.js +208 -0
  94. package/lib/cjs/DropdownMenu/index.d.ts +37 -0
  95. package/lib/cjs/DropdownMenu/index.js +237 -0
  96. package/lib/cjs/DynamicFields/index.d.ts +26 -0
  97. package/lib/cjs/DynamicFields/index.js +412 -0
  98. package/lib/cjs/File/index.d.ts +36 -0
  99. package/lib/cjs/File/index.js +473 -0
  100. package/lib/cjs/Input/index.d.ts +42 -0
  101. package/lib/cjs/Input/index.js +286 -0
  102. package/lib/cjs/LiveSearch/index.d.ts +37 -0
  103. package/lib/cjs/LiveSearch/index.js +1195 -0
  104. package/lib/cjs/ModalDialog/index.d.ts +60 -0
  105. package/lib/cjs/ModalDialog/index.js +725 -0
  106. package/lib/cjs/ModeSwitch/index.d.ts +17 -0
  107. package/lib/cjs/ModeSwitch/index.js +202 -0
  108. package/lib/cjs/MultiFuncSelect/index.d.ts +67 -0
  109. package/lib/cjs/MultiFuncSelect/index.js +1826 -0
  110. package/lib/cjs/MultilevelDropdownMenu/index.d.ts +25 -0
  111. package/lib/cjs/MultilevelDropdownMenu/index.js +464 -0
  112. package/lib/cjs/Pagination/index.d.ts +49 -0
  113. package/lib/cjs/Pagination/index.js +341 -0
  114. package/lib/cjs/Radio/index.d.ts +31 -0
  115. package/lib/cjs/Radio/index.js +246 -0
  116. package/lib/cjs/RangeSlider/index.d.ts +21 -0
  117. package/lib/cjs/RangeSlider/index.js +730 -0
  118. package/lib/cjs/ScrollReveal/index.d.ts +21 -0
  119. package/lib/cjs/ScrollReveal/index.js +216 -0
  120. package/lib/cjs/Scrollbar/index.d.ts +15 -0
  121. package/lib/cjs/Scrollbar/index.js +605 -0
  122. package/lib/cjs/SearchBar/index.d.ts +32 -0
  123. package/lib/cjs/SearchBar/index.js +246 -0
  124. package/lib/cjs/Select/index.d.ts +34 -0
  125. package/lib/cjs/Select/index.js +331 -0
  126. package/lib/cjs/ShowMoreLess/index.d.ts +30 -0
  127. package/lib/cjs/ShowMoreLess/index.js +202 -0
  128. package/lib/cjs/Switch/index.d.ts +29 -0
  129. package/lib/cjs/Switch/index.js +211 -0
  130. package/lib/cjs/Table/index.d.ts +25 -0
  131. package/lib/cjs/Table/index.js +2113 -0
  132. package/lib/cjs/Tabs/index.d.ts +3 -0
  133. package/lib/cjs/Tabs/index.js +323 -0
  134. package/lib/cjs/TagInput/index.d.ts +28 -0
  135. package/lib/cjs/TagInput/index.js +370 -0
  136. package/lib/cjs/Textarea/index.d.ts +30 -0
  137. package/lib/cjs/Textarea/index.js +242 -0
  138. package/lib/cjs/Toast/index.d.ts +35 -0
  139. package/lib/cjs/Toast/index.js +340 -0
  140. package/lib/cjs/Tooltip/index.d.ts +19 -0
  141. package/lib/cjs/Tooltip/index.js +200 -0
  142. package/lib/cjs/Tree/index.d.ts +37 -0
  143. package/lib/cjs/Tree/index.js +1406 -0
  144. package/lib/cjs/index.d.ts +33 -0
  145. package/lib/cjs/index.js +35 -0
  146. package/lib/css/BackToTop/index.css +34 -0
  147. package/lib/css/CascadingSelect/index.css +159 -0
  148. package/lib/css/CascadingSelectE2E/index.css +159 -0
  149. package/lib/css/ColorPicker/index.css +38 -0
  150. package/lib/css/DropdownMenu/index.css +127 -0
  151. package/lib/css/MultiFuncSelect/index.css +178 -0
  152. package/lib/css/MultilevelDropdownMenu/index.css +35 -0
  153. package/lib/css/RangeSlider/index.css +149 -0
  154. package/lib/css/ScrollReveal/index.css +23 -0
  155. package/lib/css/Scrollbar/index.css +168 -0
  156. package/lib/css/ShowMoreLess/index.css +23 -0
  157. package/lib/css/Table/index.css +533 -0
  158. package/lib/css/TagInput/index.css +90 -0
  159. package/lib/css/Toast/index.css +95 -0
  160. package/lib/css/Tooltip/index.css +240 -0
  161. package/lib/css/Tree/index.css +225 -0
  162. package/lib/esm/BackToTop/index.scss +47 -0
  163. package/lib/esm/BackToTop/index.tsx +182 -0
  164. package/lib/esm/BackToTop/utils/easing.js +200 -0
  165. package/lib/esm/BackToTop/utils/performance.js +52 -0
  166. package/lib/esm/CascadingSelect/Group.tsx +39 -0
  167. package/lib/esm/CascadingSelect/index.scss +214 -0
  168. package/lib/esm/CascadingSelect/index.tsx +922 -0
  169. package/lib/esm/CascadingSelect/utils/performance.js +52 -0
  170. package/lib/esm/CascadingSelectE2E/Group.tsx +39 -0
  171. package/lib/esm/CascadingSelectE2E/index.scss +214 -0
  172. package/lib/esm/CascadingSelectE2E/index.tsx +1091 -0
  173. package/lib/esm/CascadingSelectE2E/utils/performance.js +52 -0
  174. package/lib/esm/Checkbox/index.tsx +160 -0
  175. package/lib/esm/ColorPicker/index.scss +48 -0
  176. package/lib/esm/ColorPicker/index.tsx +187 -0
  177. package/lib/esm/DigitalClock/index.tsx +72 -0
  178. package/lib/esm/DigitalClock/utils/useInterval.js +43 -0
  179. package/lib/esm/DropdownMenu/Option.tsx +27 -0
  180. package/lib/esm/DropdownMenu/index.scss +180 -0
  181. package/lib/esm/DropdownMenu/index.tsx +148 -0
  182. package/lib/esm/DynamicFields/index.tsx +386 -0
  183. package/lib/esm/File/index.tsx +302 -0
  184. package/lib/esm/Input/index.tsx +233 -0
  185. package/lib/esm/LiveSearch/index.tsx +582 -0
  186. package/lib/esm/LiveSearch/utils/performance.js +52 -0
  187. package/lib/esm/LiveSearch/utils/useThrottle.js +36 -0
  188. package/lib/esm/ModalDialog/index.tsx +479 -0
  189. package/lib/esm/ModalDialog/plugins/BSL/bodyScrollLock.es6.js +262 -0
  190. package/lib/esm/ModalDialog/plugins/BSL/index.ts +2 -0
  191. package/lib/esm/ModeSwitch/index.tsx +82 -0
  192. package/lib/esm/MultiFuncSelect/index.scss +269 -0
  193. package/lib/esm/MultiFuncSelect/index.tsx +1597 -0
  194. package/lib/esm/MultiFuncSelect/utils/performance.js +52 -0
  195. package/lib/esm/MultiFuncSelect/utils/tree.js +103 -0
  196. package/lib/esm/MultiFuncSelect/utils/useThrottle.js +36 -0
  197. package/lib/esm/MultilevelDropdownMenu/MenuList.tsx +230 -0
  198. package/lib/esm/MultilevelDropdownMenu/index.scss +75 -0
  199. package/lib/esm/MultilevelDropdownMenu/index.tsx +71 -0
  200. package/lib/esm/MultilevelDropdownMenu/utils/dom.js +81 -0
  201. package/lib/esm/Pagination/index.tsx +230 -0
  202. package/lib/esm/Pagination/pagination-navigators.tsx +60 -0
  203. package/lib/esm/Radio/index.tsx +201 -0
  204. package/lib/esm/RangeSlider/index.scss +184 -0
  205. package/lib/esm/RangeSlider/index.tsx +223 -0
  206. package/lib/esm/ScrollReveal/index.scss +27 -0
  207. package/lib/esm/ScrollReveal/index.tsx +146 -0
  208. package/lib/esm/Scrollbar/index.scss +217 -0
  209. package/lib/esm/Scrollbar/index.tsx +497 -0
  210. package/lib/esm/Scrollbar/utils/performance.js +52 -0
  211. package/lib/esm/SearchBar/index.tsx +181 -0
  212. package/lib/esm/Select/index.tsx +276 -0
  213. package/lib/esm/ShowMoreLess/index.scss +27 -0
  214. package/lib/esm/ShowMoreLess/index.tsx +144 -0
  215. package/lib/esm/Switch/index.tsx +143 -0
  216. package/lib/esm/Table/TableColgroup.tsx +29 -0
  217. package/lib/esm/Table/TableField.tsx +40 -0
  218. package/lib/esm/Table/TableFieldRow.tsx +212 -0
  219. package/lib/esm/Table/TableHeaders.tsx +146 -0
  220. package/lib/esm/Table/TableRow.tsx +127 -0
  221. package/lib/esm/Table/TableSummaries.tsx +36 -0
  222. package/lib/esm/Table/index.scss +364 -0
  223. package/lib/esm/Table/index.tsx +576 -0
  224. package/lib/esm/Table/table-utils.ts +65 -0
  225. package/lib/esm/Table/utils/dom.js +81 -0
  226. package/lib/esm/Table/utils/performance.js +52 -0
  227. package/lib/esm/Tabs/TabList.tsx +42 -0
  228. package/lib/esm/Tabs/TabPanel.tsx +34 -0
  229. package/lib/esm/Tabs/Tabs.tsx +232 -0
  230. package/lib/esm/Tabs/index.tsx +3 -0
  231. package/lib/esm/TagInput/index.scss +125 -0
  232. package/lib/esm/TagInput/index.tsx +314 -0
  233. package/lib/esm/Textarea/index.tsx +178 -0
  234. package/lib/esm/Toast/Item.tsx +75 -0
  235. package/lib/esm/Toast/index.scss +120 -0
  236. package/lib/esm/Toast/index.tsx +249 -0
  237. package/lib/esm/Tooltip/index.scss +327 -0
  238. package/lib/esm/Tooltip/index.tsx +142 -0
  239. package/lib/esm/Tree/TreeList.tsx +503 -0
  240. package/lib/esm/Tree/index.scss +375 -0
  241. package/lib/esm/Tree/index.tsx +301 -0
  242. package/lib/esm/Tree/init-height.tsx +27 -0
  243. package/lib/esm/Tree/utils/convert-tree.js +29 -0
  244. package/lib/esm/Tree/utils/dom.js +81 -0
  245. package/lib/esm/index.js +31 -0
  246. package/package.json +40 -0
@@ -0,0 +1,35 @@
1
+ /* ======================================================
2
+ <!-- Multi-level Dropdown Menu -->
3
+ /* ====================================================== */
4
+ .navbar-nav a {
5
+ position: relative;
6
+ }
7
+ .navbar-nav .arrow {
8
+ transition: 0.1s ease-in-out;
9
+ display: inline-block;
10
+ text-align: center;
11
+ position: absolute;
12
+ right: 0.5em;
13
+ top: 1.5em;
14
+ transform: translateY(-50%) rotate(0deg);
15
+ }
16
+ .navbar-nav li {
17
+ position: relative;
18
+ }
19
+ .navbar-nav li i {
20
+ font-style: normal;
21
+ }
22
+ .navbar-nav li > a.active > .arrow {
23
+ transform: translateY(-50%) rotate(90deg);
24
+ }
25
+ .navbar-nav > li ul {
26
+ transition: max-height 0.25s ease;
27
+ overflow: hidden;
28
+ position: relative;
29
+ }
30
+ .navbar-nav > li:not(.active) ul {
31
+ max-height: 0;
32
+ }
33
+ .navbar-nav > li ul ul {
34
+ margin-top: auto;
35
+ }
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ declare module 'react' {
3
+ interface ReactI18NextChildren<T> {
4
+ children?: any;
5
+ }
6
+ }
7
+ declare type MultilevelDropdownMenuProps = {
8
+ /** Mutually exclusive alternate expansion between the first levels */
9
+ alternateCollapse?: boolean;
10
+ /** set an arrow */
11
+ arrow?: React.ReactNode;
12
+ /** The class name of the navbar. */
13
+ navbarClassName?: string;
14
+ /** The class name of the child on <ul>. */
15
+ childClassName?: string;
16
+ /** Specify data of Cascading DropDown List as a JSON string format. */
17
+ data?: any[any];
18
+ /** Pass the current routing path into. It is used to determine whether to activate */
19
+ routerPath?: string;
20
+ /** -- */
21
+ id?: string;
22
+ onSelect?: (e: any, val: any) => void;
23
+ };
24
+ declare const _default: React.MemoExoticComponent<(props: MultilevelDropdownMenuProps) => JSX.Element>;
25
+ export default _default;
@@ -0,0 +1,464 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("react"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["react"], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["RPB"] = factory(require("react"));
8
+ else
9
+ root["RPB"] = factory(root["React"]);
10
+ })(this, (__WEBPACK_EXTERNAL_MODULE__787__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ var __webpack_modules__ = ({
13
+
14
+ /***/ 426:
15
+ /***/ ((module) => {
16
+
17
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
18
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
19
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
20
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
21
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
22
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
23
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
24
+ /**
25
+ * Dom Utilities
26
+ * @param {HTMLElement} el - Element
27
+ * @param {?String} filter - A filter string
28
+ * @returns HtmlElementCollection
29
+ */
30
+ function matches(el, filter) {
31
+ if (el && el.nodeType === 1) {
32
+ if (filter) {
33
+ return el.matches(filter);
34
+ }
35
+ return true;
36
+ }
37
+ return false;
38
+ }
39
+
40
+ // the next siblings
41
+ function getNextSiblings(el) {
42
+ var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false || '';
43
+ var sibs = [];
44
+ while (el = el.nextSibling) {
45
+ if (matches(el, filter)) {
46
+ sibs.push(el);
47
+ }
48
+ }
49
+ return sibs;
50
+ }
51
+
52
+ // previous siblings
53
+ function getPreviousSiblings(el) {
54
+ var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false || '';
55
+ var sibs = [];
56
+ while (el = el.previousSibling) {
57
+ if (matches(el, filter)) {
58
+ sibs.push(el);
59
+ }
60
+ }
61
+ return sibs;
62
+ }
63
+
64
+ // parent and get all the siblings
65
+ function getAllSiblings(el) {
66
+ var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false || '';
67
+ var sibs = [];
68
+ el = el.parentNode.firstChild;
69
+ while (el = el.nextSibling) {
70
+ if (matches(el, filter)) {
71
+ sibs.push(el);
72
+ }
73
+ }
74
+ return sibs;
75
+ }
76
+
77
+ // all parent nodes
78
+ function getParents(el) {
79
+ var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false || '';
80
+ var parents = [];
81
+ while (el = el.parentNode) {
82
+ if (matches(el, filter)) {
83
+ parents.push(el);
84
+ }
85
+ }
86
+ return parents;
87
+ }
88
+
89
+ // all child nodes
90
+ function getChildren(el) {
91
+ var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false || '';
92
+ var all = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
93
+ all.push.apply(all, _toConsumableArray(el.childNodes));
94
+ var _iterator = _createForOfIteratorHelper(el.childNodes),
95
+ _step;
96
+ try {
97
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
98
+ var child = _step.value;
99
+ getChildren(child, filter, all);
100
+ }
101
+ } catch (err) {
102
+ _iterator.e(err);
103
+ } finally {
104
+ _iterator.f();
105
+ }
106
+ var res = all.filter(function (item) {
107
+ return matches(item, filter);
108
+ });
109
+ return res;
110
+ }
111
+ module.exports = {
112
+ getNextSiblings: getNextSiblings,
113
+ getPreviousSiblings: getPreviousSiblings,
114
+ getAllSiblings: getAllSiblings,
115
+ getParents: getParents,
116
+ getChildren: getChildren
117
+ };
118
+
119
+ /***/ }),
120
+
121
+ /***/ 787:
122
+ /***/ ((module) => {
123
+
124
+ "use strict";
125
+ module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
126
+
127
+ /***/ })
128
+
129
+ /******/ });
130
+ /************************************************************************/
131
+ /******/ // The module cache
132
+ /******/ var __webpack_module_cache__ = {};
133
+ /******/
134
+ /******/ // The require function
135
+ /******/ function __webpack_require__(moduleId) {
136
+ /******/ // Check if module is in cache
137
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
138
+ /******/ if (cachedModule !== undefined) {
139
+ /******/ return cachedModule.exports;
140
+ /******/ }
141
+ /******/ // Create a new module (and put it into the cache)
142
+ /******/ var module = __webpack_module_cache__[moduleId] = {
143
+ /******/ // no module.id needed
144
+ /******/ // no module.loaded needed
145
+ /******/ exports: {}
146
+ /******/ };
147
+ /******/
148
+ /******/ // Execute the module function
149
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
150
+ /******/
151
+ /******/ // Return the exports of the module
152
+ /******/ return module.exports;
153
+ /******/ }
154
+ /******/
155
+ /************************************************************************/
156
+ /******/ /* webpack/runtime/compat get default export */
157
+ /******/ (() => {
158
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
159
+ /******/ __webpack_require__.n = (module) => {
160
+ /******/ var getter = module && module.__esModule ?
161
+ /******/ () => (module['default']) :
162
+ /******/ () => (module);
163
+ /******/ __webpack_require__.d(getter, { a: getter });
164
+ /******/ return getter;
165
+ /******/ };
166
+ /******/ })();
167
+ /******/
168
+ /******/ /* webpack/runtime/define property getters */
169
+ /******/ (() => {
170
+ /******/ // define getter functions for harmony exports
171
+ /******/ __webpack_require__.d = (exports, definition) => {
172
+ /******/ for(var key in definition) {
173
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
174
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
175
+ /******/ }
176
+ /******/ }
177
+ /******/ };
178
+ /******/ })();
179
+ /******/
180
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
181
+ /******/ (() => {
182
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
183
+ /******/ })();
184
+ /******/
185
+ /******/ /* webpack/runtime/make namespace object */
186
+ /******/ (() => {
187
+ /******/ // define __esModule on exports
188
+ /******/ __webpack_require__.r = (exports) => {
189
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
190
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
191
+ /******/ }
192
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
193
+ /******/ };
194
+ /******/ })();
195
+ /******/
196
+ /************************************************************************/
197
+ var __webpack_exports__ = {};
198
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
199
+ (() => {
200
+ "use strict";
201
+ // ESM COMPAT FLAG
202
+ __webpack_require__.r(__webpack_exports__);
203
+
204
+ // EXPORTS
205
+ __webpack_require__.d(__webpack_exports__, {
206
+ "default": () => (/* binding */ src)
207
+ });
208
+
209
+ // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
210
+ var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(787);
211
+ var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
212
+ // EXTERNAL MODULE: ./src/utils/dom.js
213
+ var dom = __webpack_require__(426);
214
+ ;// CONCATENATED MODULE: ./src/MenuList.tsx
215
+
216
+
217
+
218
+ /* Recursively nested components to traverse nodes
219
+ -------------------------------------------------*/
220
+
221
+ function MenuList(props) {
222
+ var alternateCollapse = props.alternateCollapse,
223
+ first = props.first,
224
+ arrow = props.arrow,
225
+ childClassName = props.childClassName,
226
+ data = props.data,
227
+ routerPath = props.routerPath,
228
+ onSelect = props.onSelect;
229
+ var rootRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
230
+ var currentPath = routerPath ? routerPath : '';
231
+ var activeClass = function activeClass(el, mode) {
232
+ var classname = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'active';
233
+ if (mode === 'add') {
234
+ el.classList.add(classname);
235
+ } else {
236
+ el.classList.remove(classname);
237
+ }
238
+ };
239
+ var closeChild = function closeChild(hyperlink, ul) {
240
+ if (ul.length === 0) return;
241
+ activeClass(hyperlink, 'remove');
242
+ hyperlink.setAttribute('aria-expanded', 'false');
243
+ activeClass(hyperlink.parentNode, 'remove');
244
+
245
+ //to close
246
+ [].slice.call(ul).forEach(function (element) {
247
+ element.style.maxHeight = 0;
248
+ });
249
+ };
250
+ var openChild = function openChild(hyperlink, ul) {
251
+ if (ul.length === 0) return;
252
+ activeClass(hyperlink, 'add');
253
+ hyperlink.setAttribute('aria-expanded', 'true');
254
+ activeClass(hyperlink.parentNode, 'add');
255
+
256
+ // init <ul> height
257
+ [].slice.call(ul).forEach(function (el) {
258
+ if (typeof el.querySelectorAll('li')[0] !== 'undefined') {
259
+ var calcH = el.querySelectorAll('li').length * el.querySelectorAll('li')[0].scrollHeight;
260
+ el.style.maxHeight = "".concat(calcH, "px");
261
+ }
262
+ });
263
+ };
264
+ function handleClick(e) {
265
+ e.preventDefault();
266
+ var hyperlink = e.currentTarget;
267
+ var url = hyperlink.getAttribute('href');
268
+ var subElement = (0,dom.getNextSiblings)(hyperlink, 'ul');
269
+
270
+ // route switching
271
+ //=====================
272
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(e, {
273
+ isRouter: hyperlink.dataset.router,
274
+ slug: hyperlink.dataset.slug,
275
+ link: hyperlink.dataset.link
276
+ });
277
+
278
+ // hide child if expandedLink doesn't exist, on the contrary
279
+ //=====================
280
+ if (hyperlink.getAttribute('aria-expanded') === 'false' || hyperlink.getAttribute('aria-expanded') === null) {
281
+ //Hide all other siblings of the selected <ul>
282
+ if (alternateCollapse) {
283
+ [].slice.call(rootRef.current.children).forEach(function (li) {
284
+ activeClass(li, 'remove');
285
+ var _li = li.firstChild;
286
+ activeClass(_li, 'remove');
287
+ _li.setAttribute('aria-expanded', false);
288
+ [].slice.call((0,dom.getNextSiblings)(_li, 'ul')).forEach(function (element) {
289
+ element.style.maxHeight = 0;
290
+ });
291
+ });
292
+ }
293
+
294
+ //open current
295
+ openChild(hyperlink, subElement);
296
+ } else {
297
+ //close current
298
+ closeChild(hyperlink, subElement);
299
+ }
300
+
301
+ // active current item
302
+ //=====================
303
+ if (currentPath === url || currentPath.indexOf(url.replace(/\/[\d]+\.html|\.html/ig, '')) >= 0 && url !== '/') {
304
+ activeClass(e.target, 'add');
305
+ activeClass(e.target.parentElement, 'add');
306
+ }
307
+ }
308
+ function arrowGenerator() {
309
+ return arrow ? arrow : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
310
+ viewBox: "0 0 22 22",
311
+ width: "8px"
312
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
313
+ d: "m345.44 248.29l-194.29 194.28c-12.359 12.365-32.397 12.365-44.75 0-12.354-12.354-12.354-32.391 0-44.744l171.91-171.91-171.91-171.9c-12.354-12.359-12.354-32.394 0-44.748 12.354-12.359 32.391-12.359 44.75 0l194.29 194.28c6.177 6.18 9.262 14.271 9.262 22.366 0 8.099-3.091 16.196-9.267 22.373",
314
+ transform: "matrix(.03541-.00013.00013.03541 2.98 3.02)",
315
+ fill: "#a5a5a5"
316
+ }));
317
+ }
318
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
319
+ // Activate current item
320
+ //=====================
321
+ var allItems = rootRef.current ? [].slice.call(document.querySelectorAll(".".concat(childClassName, " a"))).map(function (item) {
322
+ var _item$parentNode$clas;
323
+ return {
324
+ href: item.getAttribute('href'),
325
+ el: item,
326
+ actived: (_item$parentNode$clas = item.parentNode.classList) !== null && _item$parentNode$clas !== void 0 && _item$parentNode$clas.contains('active') ? true : false,
327
+ expandedLink: document.body.contains(item.parentNode.parentNode.previousSibling) ? item.parentNode.parentNode.previousSibling : false
328
+ };
329
+ }) : [];
330
+ allItems.forEach(function (hyperlink) {
331
+ // Expand the currently active item by default
332
+ if (hyperlink.actived) {
333
+ hyperlink.el.setAttribute('aria-expanded', 'true');
334
+ if (hyperlink.expandedLink) {
335
+ var expandedLink = hyperlink.expandedLink; // <a>
336
+ activeClass(expandedLink.parentNode, 'add');
337
+ expandedLink.setAttribute('aria-expanded', true);
338
+ }
339
+
340
+ // init <ul> height
341
+ var ul = (0,dom.getNextSiblings)(hyperlink.el, 'ul');
342
+ [].slice.call(ul).forEach(function (el) {
343
+ if (typeof el.querySelectorAll('li')[0] !== 'undefined') {
344
+ var calcH = el.querySelectorAll('li').length * el.querySelectorAll('li')[0].scrollHeight;
345
+ el.style.maxHeight = "".concat(calcH, "px");
346
+ }
347
+ });
348
+ }
349
+ });
350
+ }, [data]);
351
+ if (data) {
352
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", {
353
+ className: childClassName,
354
+ ref: rootRef,
355
+ style: !first ? {
356
+ maxHeight: '0px'
357
+ } : {}
358
+ }, data.map(function (item, i) {
359
+ var _matchPath = currentPath === item.link || currentPath.indexOf(item.link.replace(/\/[\d]+\.html|\.html/ig, '')) >= 0 && item.link !== '/';
360
+ if (item.heading) return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
361
+ className: "nav-item",
362
+ key: i
363
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
364
+ tabIndex: -1,
365
+ className: "nav-link disabled",
366
+ href: "#",
367
+ "aria-disabled": "true",
368
+ "data-router": "false",
369
+ "data-link": item.link,
370
+ "data-slug": item.slug
371
+ }, item.icon ? item.icon.indexOf('</svg>') < 0 ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("i", {
372
+ className: item.icon
373
+ }), " ") : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("var", {
374
+ dangerouslySetInnerHTML: {
375
+ __html: "".concat(item.icon)
376
+ }
377
+ }) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("i", {
378
+ dangerouslySetInnerHTML: {
379
+ __html: "".concat(item.title)
380
+ }
381
+ })));
382
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
383
+ key: i,
384
+ className: item.active ? "nav-item active" : _matchPath ? "nav-item active" : 'nav-item'
385
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
386
+ tabIndex: -1,
387
+ title: item.title,
388
+ className: item.active ? "nav-link active" : _matchPath ? "nav-link active" : 'nav-link',
389
+ href: item.link === '#' ? "".concat(item.link, "-").concat(i) : item.link,
390
+ onClick: handleClick,
391
+ "data-router": item.link.indexOf('#') >= 0 || item.link.indexOf('http') >= 0 ? 'false' : 'true',
392
+ "data-link": item.link,
393
+ "data-slug": item.slug
394
+ }, item.icon ? item.icon.indexOf('</svg>') < 0 ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("i", {
395
+ className: item.icon
396
+ }), " ") : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("var", {
397
+ dangerouslySetInnerHTML: {
398
+ __html: "".concat(item.icon)
399
+ }
400
+ }) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("i", {
401
+ dangerouslySetInnerHTML: {
402
+ __html: "".concat(item.title)
403
+ }
404
+ }), item.children ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
405
+ className: "arrow"
406
+ }, arrowGenerator()) : ''), item.children && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(MenuList, {
407
+ data: item.children,
408
+ first: false,
409
+ arrow: arrow,
410
+ onSelect: onSelect,
411
+ routerPath: routerPath
412
+ }));
413
+ })));
414
+ } else {
415
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null);
416
+ }
417
+ }
418
+ ;// CONCATENATED MODULE: ./src/index.tsx
419
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
420
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
421
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
422
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
423
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
424
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
425
+
426
+
427
+ var MultilevelDropdownMenu = function MultilevelDropdownMenu(props) {
428
+ var alternateCollapse = props.alternateCollapse,
429
+ arrow = props.arrow,
430
+ navbarClassName = props.navbarClassName,
431
+ childClassName = props.childClassName,
432
+ routerPath = props.routerPath,
433
+ data = props.data,
434
+ id = props.id,
435
+ onSelect = props.onSelect;
436
+ var uniqueID = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useId)();
437
+ var idRes = id || uniqueID;
438
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
439
+ _useState2 = _slicedToArray(_useState, 2),
440
+ val = _useState2[0],
441
+ setVal = _useState2[1];
442
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
443
+ setVal(data);
444
+ }, [data]);
445
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("nav", {
446
+ id: idRes,
447
+ className: navbarClassName ? navbarClassName : "navbar"
448
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(MenuList, {
449
+ alternateCollapse: alternateCollapse,
450
+ first: true,
451
+ arrow: arrow,
452
+ data: val,
453
+ childClassName: childClassName || 'navbar-nav',
454
+ onSelect: onSelect,
455
+ routerPath: routerPath
456
+ })));
457
+ };
458
+ /* harmony default export */ const src = (/*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.memo)(MultilevelDropdownMenu));
459
+ })();
460
+
461
+ /******/ return __webpack_exports__;
462
+ /******/ })()
463
+ ;
464
+ });
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ declare type PaginationProps = {
3
+ /** The class name of the navigation wrapper */
4
+ wrapperClassName?: string;
5
+ /** The class name of the navigation */
6
+ navClassName?: string;
7
+ /** An API URL Path. Use `{page}` characters to place a placeholder. such as `/mypage/{page}` */
8
+ apiUrl: string;
9
+ /** The range of pages displayed */
10
+ pageRangeDisplayed: number;
11
+ /** The currently selected page number. */
12
+ activePage: number;
13
+ /** The total number of pages. */
14
+ totalPages: number;
15
+ /** Label for the previous button. */
16
+ previousLabel?: React.ReactNode;
17
+ /** Label for the next button. */
18
+ nextLabel?: React.ReactNode;
19
+ /** Label for the first button. */
20
+ firstLabel?: React.ReactNode;
21
+ /** Label for the last button. */
22
+ lastLabel?: React.ReactNode;
23
+ /** Label for ellipsis */
24
+ breakLabel?: React.ReactNode;
25
+ /** Set the alignment of the control */
26
+ align?: string | null;
27
+ /** Only display the previous and next buttons. */
28
+ onlyPrevNext?: boolean;
29
+ /** The classname for the active page */
30
+ activeClass?: string;
31
+ /** The classname on tag li of the previous button */
32
+ previousClass?: string;
33
+ /** The classname on tag li of the next button */
34
+ nextClass?: string;
35
+ /** The classname on tag li of the first button */
36
+ firstClass?: string;
37
+ /** The classname on tag li of the last button */
38
+ lastClass?: string;
39
+ /** The classname for disabled buttons */
40
+ disabledClass?: string;
41
+ /** The activation button is symmetrical on the left and right sides. */
42
+ symmetry?: boolean;
43
+ /** -- */
44
+ style?: React.CSSProperties;
45
+ /** The method to call when a page is clicked. Exposes the current page number as an argument. */
46
+ onChange?: (param: any) => void;
47
+ };
48
+ declare const Pagination: (props: PaginationProps) => JSX.Element;
49
+ export default Pagination;