funda-ui 4.4.15 → 4.5.12

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 (77) hide show
  1. package/Date/index.js +1078 -77
  2. package/EventCalendar/index.css +114 -114
  3. package/EventCalendar/index.d.ts +1 -0
  4. package/EventCalendar/index.js +124 -86
  5. package/EventCalendarTimeline/index.css +274 -270
  6. package/EventCalendarTimeline/index.d.ts +3 -0
  7. package/EventCalendarTimeline/index.js +673 -225
  8. package/Input/index.d.ts +7 -0
  9. package/Input/index.js +699 -57
  10. package/MasonryLayout/index.js +11 -1
  11. package/MultipleCheckboxes/index.js +11 -11
  12. package/MultipleSelect/index.d.ts +1 -0
  13. package/MultipleSelect/index.js +18 -16
  14. package/NativeSelect/index.js +11 -11
  15. package/Radio/index.js +11 -11
  16. package/RangeSlider/index.js +1078 -77
  17. package/Select/index.js +45 -13
  18. package/Table/index.css +1 -0
  19. package/Table/index.js +36 -7
  20. package/TagInput/index.d.ts +1 -0
  21. package/TagInput/index.js +20 -2
  22. package/Textarea/index.d.ts +7 -0
  23. package/Textarea/index.js +707 -10
  24. package/Tree/index.js +13 -11
  25. package/Utils/inputsCalculation.d.ts +18 -1
  26. package/Utils/inputsCalculation.js +26 -0
  27. package/Utils/object.js +11 -11
  28. package/Utils/os.d.ts +2 -0
  29. package/Utils/os.js +104 -0
  30. package/lib/cjs/Date/index.js +1078 -77
  31. package/lib/cjs/EventCalendar/index.d.ts +1 -0
  32. package/lib/cjs/EventCalendar/index.js +124 -86
  33. package/lib/cjs/EventCalendarTimeline/index.d.ts +3 -0
  34. package/lib/cjs/EventCalendarTimeline/index.js +673 -225
  35. package/lib/cjs/Input/index.d.ts +7 -0
  36. package/lib/cjs/Input/index.js +699 -57
  37. package/lib/cjs/MasonryLayout/index.js +11 -1
  38. package/lib/cjs/MultipleCheckboxes/index.js +11 -11
  39. package/lib/cjs/MultipleSelect/index.d.ts +1 -0
  40. package/lib/cjs/MultipleSelect/index.js +18 -16
  41. package/lib/cjs/NativeSelect/index.js +11 -11
  42. package/lib/cjs/Radio/index.js +11 -11
  43. package/lib/cjs/RangeSlider/index.js +1078 -77
  44. package/lib/cjs/Select/index.js +45 -13
  45. package/lib/cjs/Table/index.js +36 -7
  46. package/lib/cjs/TagInput/index.d.ts +1 -0
  47. package/lib/cjs/TagInput/index.js +20 -2
  48. package/lib/cjs/Textarea/index.d.ts +7 -0
  49. package/lib/cjs/Textarea/index.js +707 -10
  50. package/lib/cjs/Tree/index.js +13 -11
  51. package/lib/cjs/Utils/inputsCalculation.d.ts +18 -1
  52. package/lib/cjs/Utils/inputsCalculation.js +26 -0
  53. package/lib/cjs/Utils/object.js +11 -11
  54. package/lib/cjs/Utils/os.d.ts +2 -0
  55. package/lib/cjs/Utils/os.js +104 -0
  56. package/lib/css/EventCalendar/index.css +114 -114
  57. package/lib/css/EventCalendarTimeline/index.css +274 -270
  58. package/lib/css/Table/index.css +1 -0
  59. package/lib/esm/EventCalendar/index.scss +81 -81
  60. package/lib/esm/EventCalendar/index.tsx +144 -104
  61. package/lib/esm/EventCalendarTimeline/index.scss +226 -221
  62. package/lib/esm/EventCalendarTimeline/index.tsx +791 -517
  63. package/lib/esm/Input/index.tsx +299 -77
  64. package/lib/esm/MasonryLayout/index.tsx +9 -2
  65. package/lib/esm/ModalDialog/index.tsx +0 -1
  66. package/lib/esm/MultipleSelect/index.tsx +6 -4
  67. package/lib/esm/Table/Table.tsx +0 -1
  68. package/lib/esm/Table/index.scss +2 -0
  69. package/lib/esm/Table/utils/hooks/useTableDraggable.tsx +47 -6
  70. package/lib/esm/TagInput/index.tsx +23 -1
  71. package/lib/esm/Textarea/index.tsx +332 -39
  72. package/lib/esm/Tree/TreeList.tsx +4 -1
  73. package/lib/esm/Tree/index.tsx +1 -0
  74. package/lib/esm/Utils/libs/inputsCalculation.ts +60 -31
  75. package/lib/esm/Utils/libs/object.ts +67 -67
  76. package/lib/esm/Utils/libs/os.ts +63 -0
  77. package/package.json +1 -1
package/Tree/index.js CHANGED
@@ -676,10 +676,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
676
676
  return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
677
677
  }, _typeof(obj);
678
678
  }
679
- /**
680
- * Remove Duplicate objects from JSON Array
681
- * @param {Array} obj
682
- * @param {String} fieldName
679
+ /**
680
+ * Remove Duplicate objects from JSON Array
681
+ * @param {Array} obj
682
+ * @param {String} fieldName
683
683
  */
684
684
  function _removeArrDuplicateItems(obj, fieldName) {
685
685
  if (!Array.isArray(obj)) return [];
@@ -692,9 +692,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
692
692
  }
693
693
  ;
694
694
 
695
- /**
696
- * Deep clone
697
- * @param {*} obj
695
+ /**
696
+ * Deep clone
697
+ * @param {*} obj
698
698
  */
699
699
  function _deepClone(obj) {
700
700
  if (Array.isArray(obj)) {
@@ -714,10 +714,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
714
714
  }
715
715
  }
716
716
 
717
- /**
718
- * Flat Data
719
- * @param {*} data
720
- * @returns
717
+ /**
718
+ * Flat Data
719
+ * @param {*} data
720
+ * @returns
721
721
  */
722
722
  function _flatData(data) {
723
723
  var result = [];
@@ -1275,6 +1275,7 @@ function TreeList(props) {
1275
1275
  function handleCollapse(e) {
1276
1276
  if (disableCollapse) return;
1277
1277
  e.preventDefault();
1278
+ e.stopPropagation();
1278
1279
  var hyperlink = e.currentTarget;
1279
1280
  var url = hyperlink.getAttribute('href');
1280
1281
  var subElement = (0,dom.getNextSiblings)(hyperlink, 'ul');
@@ -1325,6 +1326,7 @@ function TreeList(props) {
1325
1326
  }
1326
1327
  function handleSelect(e) {
1327
1328
  e.preventDefault();
1329
+ e.stopPropagation();
1328
1330
  var hyperlink = e.currentTarget;
1329
1331
  if (hyperlink.classList.contains('selected')) {
1330
1332
  activeClass(hyperlink, 'remove', 'selected');
@@ -1,3 +1,20 @@
1
+ /**
2
+ * Gets the relative upside of the text
3
+ * @param {Element} el - A DOM node containing one selector to match against.
4
+ * @returns {Number} - Returns a pure number.
5
+ */
6
+ declare function getTextTop(el: HTMLElement): number;
7
+ /**
8
+ * Get the actual value with user specific methed
9
+ * it can be 'width', 'height', 'outerWidth', 'outerHeight'
10
+ * @private
11
+ * @param {Element} el - A DOM node containing one selector to match against.
12
+ * @param {String} prop - A string naming the property of style.
13
+ * @param {?Json} config - Whether or not margin is included. The key `includeMargin`
14
+ takes effect when set to true
15
+ * @return {Number} - Returns a pure number.
16
+ */
17
+ declare function actualPropertyValue(el: any, prop: string, config?: any): any;
1
18
  /**
2
19
  * Get cursor or text position in pixels for input element
3
20
  *
@@ -7,4 +24,4 @@
7
24
  * @returns {Number}
8
25
  */
9
26
  declare function getTextWidth(input: HTMLInputElement, fauxContainer: HTMLSpanElement, rawTextContainer: HTMLElement): any;
10
- export { getTextWidth };
27
+ export { getTextTop, actualPropertyValue, getTextWidth };
@@ -46,8 +46,25 @@ return /******/ (() => { // webpackBootstrap
46
46
  var __webpack_exports__ = {};
47
47
  __webpack_require__.r(__webpack_exports__);
48
48
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
49
+ /* harmony export */ "actualPropertyValue": () => (/* binding */ actualPropertyValue),
50
+ /* harmony export */ "getTextTop": () => (/* binding */ getTextTop),
49
51
  /* harmony export */ "getTextWidth": () => (/* binding */ getTextWidth)
50
52
  /* harmony export */ });
53
+ /**
54
+ * Gets the relative upside of the text
55
+ * @param {Element} el - A DOM node containing one selector to match against.
56
+ * @returns {Number} - Returns a pure number.
57
+ */
58
+ function getTextTop(el) {
59
+ var styles = window.getComputedStyle(el);
60
+ var fontSize = parseFloat(styles.fontSize);
61
+ var lineHeight = parseFloat(styles.lineHeight) || fontSize;
62
+ var paddingTop = parseFloat(styles.paddingTop);
63
+ var borderWidth = parseFloat(styles.borderWidth);
64
+ var textTop = paddingTop + (lineHeight - fontSize) / 2 - borderWidth * 2;
65
+ return textTop;
66
+ }
67
+
51
68
  /**
52
69
  * Get the actual value with user specific methed
53
70
  * it can be 'width', 'height', 'outerWidth', 'outerHeight'
@@ -73,6 +90,15 @@ function actualPropertyValue(el, prop) {
73
90
  marginWidth = parseFloat(style.marginLeft) + parseFloat(style.marginRight);
74
91
  marginHeight = parseFloat(style.marginTop) + parseFloat(style.marginBottom);
75
92
  }
93
+ if (prop === 'fontSize') {
94
+ actualVal = parseFloat(style.fontSize);
95
+ }
96
+ if (prop === 'fontFamily') {
97
+ actualVal = style.fontFamily;
98
+ }
99
+ if (prop === 'letterSpacing') {
100
+ actualVal = style.letterSpacing;
101
+ }
76
102
  if (prop === 'width') {
77
103
  maxVal = parseFloat(style.maxWidth);
78
104
 
package/Utils/object.js CHANGED
@@ -51,10 +51,10 @@ __webpack_require__.r(__webpack_exports__);
51
51
  /* harmony export */ "removeArrDuplicateItems": () => (/* binding */ removeArrDuplicateItems)
52
52
  /* harmony export */ });
53
53
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
54
- /**
55
- * Remove Duplicate objects from JSON Array
56
- * @param {Array} obj
57
- * @param {String} fieldName
54
+ /**
55
+ * Remove Duplicate objects from JSON Array
56
+ * @param {Array} obj
57
+ * @param {String} fieldName
58
58
  */
59
59
  function removeArrDuplicateItems(obj, fieldName) {
60
60
  if (!Array.isArray(obj)) return [];
@@ -67,9 +67,9 @@ function removeArrDuplicateItems(obj, fieldName) {
67
67
  }
68
68
  ;
69
69
 
70
- /**
71
- * Deep clone
72
- * @param {*} obj
70
+ /**
71
+ * Deep clone
72
+ * @param {*} obj
73
73
  */
74
74
  function deepClone(obj) {
75
75
  if (Array.isArray(obj)) {
@@ -89,10 +89,10 @@ function deepClone(obj) {
89
89
  }
90
90
  }
91
91
 
92
- /**
93
- * Flat Data
94
- * @param {*} data
95
- * @returns
92
+ /**
93
+ * Flat Data
94
+ * @param {*} data
95
+ * @returns
96
96
  */
97
97
  function flatData(data) {
98
98
  var result = [];
package/Utils/os.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare function getOs(): any;
2
+ export default getOs;
package/Utils/os.js ADDED
@@ -0,0 +1,104 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["RPB"] = factory();
8
+ else
9
+ root["RPB"] = factory();
10
+ })(this, () => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ // The require scope
14
+ /******/ var __webpack_require__ = {};
15
+ /******/
16
+ /************************************************************************/
17
+ /******/ /* webpack/runtime/define property getters */
18
+ /******/ (() => {
19
+ /******/ // define getter functions for harmony exports
20
+ /******/ __webpack_require__.d = (exports, definition) => {
21
+ /******/ for(var key in definition) {
22
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
23
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
24
+ /******/ }
25
+ /******/ }
26
+ /******/ };
27
+ /******/ })();
28
+ /******/
29
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
30
+ /******/ (() => {
31
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
32
+ /******/ })();
33
+ /******/
34
+ /******/ /* webpack/runtime/make namespace object */
35
+ /******/ (() => {
36
+ /******/ // define __esModule on exports
37
+ /******/ __webpack_require__.r = (exports) => {
38
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
39
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40
+ /******/ }
41
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
42
+ /******/ };
43
+ /******/ })();
44
+ /******/
45
+ /************************************************************************/
46
+ var __webpack_exports__ = {};
47
+ __webpack_require__.r(__webpack_exports__);
48
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
49
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
50
+ /* harmony export */ });
51
+ /*
52
+ * Determine whether it is a special platform
53
+ *
54
+ * @private
55
+ */
56
+ function getOs() {
57
+ if (typeof window === 'undefined') return {};
58
+ var os;
59
+ if (typeof window !== "undefined") {
60
+ var _getOs = function _getOs() {
61
+ var _navigator = window.navigator;
62
+ var platform = function platform() {
63
+ // 2022 way of detecting. Note : this userAgentData feature is available only in secure contexts (HTTPS)
64
+ if (typeof _navigator.userAgentData !== 'undefined' && _navigator.userAgentData != null) {
65
+ return _navigator.userAgentData.platform;
66
+ }
67
+ // Deprecated but still works for most of the browser
68
+ if (typeof _navigator.platform !== 'undefined') {
69
+ if (typeof _navigator.userAgent !== 'undefined' && /android/.test(_navigator.userAgent.toLowerCase())) {
70
+ // android device’s _navigator.platform is often set as 'linux', so const’s use userAgent for them
71
+ return 'android';
72
+ }
73
+ return _navigator.platform;
74
+ }
75
+ return 'unknown';
76
+ };
77
+ var _platform = platform().toLowerCase();
78
+ var isOSX = /mac/.test(_platform); // Mac desktop
79
+ var isIOS = ['iphone', 'ipad', 'ipod'].indexOf(_platform) === -1 ? false : true; // Mac iOs
80
+ var isApple = isOSX || isIOS; // Apple device (desktop or iOS)
81
+ var isWindows = /win/.test(_platform); // Windows
82
+ var isAndroid = /android/.test(_platform); // Android
83
+ var isLinux = /linux/.test(_platform); // Linux
84
+
85
+ return {
86
+ isOSX: isOSX,
87
+ isIOS: isIOS,
88
+ isApple: isApple,
89
+ isWindows: isWindows,
90
+ isAndroid: isAndroid,
91
+ isLinux: isLinux
92
+ };
93
+ };
94
+ os = _getOs();
95
+ } else {
96
+ os = {};
97
+ }
98
+ return os;
99
+ }
100
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getOs);
101
+ /******/ return __webpack_exports__;
102
+ /******/ })()
103
+ ;
104
+ });