funda-ui 4.7.133 → 4.7.150

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 (51) hide show
  1. package/CascadingSelect/index.css +15 -4
  2. package/CascadingSelect/index.d.ts +2 -0
  3. package/CascadingSelect/index.js +294 -22
  4. package/CascadingSelectE2E/index.css +15 -4
  5. package/CascadingSelectE2E/index.d.ts +2 -0
  6. package/CascadingSelectE2E/index.js +300 -28
  7. package/Checkbox/index.js +4 -2
  8. package/LiveSearch/index.js +2 -1
  9. package/Refresher/index.js +3 -3
  10. package/Select/index.css +33 -0
  11. package/Select/index.d.ts +1 -0
  12. package/Select/index.js +350 -39
  13. package/SplitterPanel/index.js +3 -3
  14. package/Switch/index.js +4 -2
  15. package/Utils/format-string.d.ts +2 -1
  16. package/Utils/format-string.js +22 -12
  17. package/Utils/time.d.ts +3 -3
  18. package/Utils/useIsMobile.js +3 -3
  19. package/lib/cjs/CascadingSelect/index.d.ts +2 -0
  20. package/lib/cjs/CascadingSelect/index.js +294 -22
  21. package/lib/cjs/CascadingSelectE2E/index.d.ts +2 -0
  22. package/lib/cjs/CascadingSelectE2E/index.js +300 -28
  23. package/lib/cjs/Checkbox/index.js +4 -2
  24. package/lib/cjs/LiveSearch/index.js +2 -1
  25. package/lib/cjs/Refresher/index.js +3 -3
  26. package/lib/cjs/Select/index.d.ts +1 -0
  27. package/lib/cjs/Select/index.js +350 -39
  28. package/lib/cjs/SplitterPanel/index.js +3 -3
  29. package/lib/cjs/Switch/index.js +4 -2
  30. package/lib/cjs/Utils/format-string.d.ts +2 -1
  31. package/lib/cjs/Utils/format-string.js +22 -12
  32. package/lib/cjs/Utils/time.d.ts +3 -3
  33. package/lib/cjs/Utils/useIsMobile.js +3 -3
  34. package/lib/css/CascadingSelect/index.css +15 -4
  35. package/lib/css/CascadingSelectE2E/index.css +15 -4
  36. package/lib/css/Select/index.css +33 -0
  37. package/lib/esm/CascadingSelect/index.scss +22 -7
  38. package/lib/esm/CascadingSelect/index.tsx +49 -1
  39. package/lib/esm/CascadingSelectE2E/Group.tsx +1 -0
  40. package/lib/esm/CascadingSelectE2E/index.scss +23 -6
  41. package/lib/esm/CascadingSelectE2E/index.tsx +53 -1
  42. package/lib/esm/Checkbox/index.tsx +5 -3
  43. package/lib/esm/LiveSearch/index.tsx +2 -1
  44. package/lib/esm/Select/index.scss +43 -2
  45. package/lib/esm/Select/index.tsx +81 -24
  46. package/lib/esm/Select/utils/func.ts +0 -10
  47. package/lib/esm/Switch/index.tsx +4 -2
  48. package/lib/esm/Utils/hooks/useIsMobile.tsx +9 -12
  49. package/lib/esm/Utils/libs/format-string.ts +22 -12
  50. package/lib/esm/Utils/libs/time.ts +6 -6
  51. package/package.json +1 -1
@@ -8,7 +8,7 @@
8
8
  * @returns {string} The processed string
9
9
  */
10
10
  function rmSpec(input: string): string {
11
- return input.replace(/[^a-zA-Z0-9 \u4E00-\u9FFF]/g, "");
11
+ return input?.replace(/[^a-zA-Z0-9 \u4E00-\u9FFF]/g, "");
12
12
  }
13
13
 
14
14
  /**
@@ -17,7 +17,7 @@ function rmSpec(input: string): string {
17
17
  * @returns {string} The processed string
18
18
  */
19
19
  function onlyNumAndLetter(input: string): string {
20
- return input.replace(/[^a-zA-Z0-9 ]/g, "");
20
+ return input?.replace(/[^a-zA-Z0-9 ]/g, "");
21
21
  }
22
22
 
23
23
  /**
@@ -26,7 +26,7 @@ function onlyNumAndLetter(input: string): string {
26
26
  * @returns {string} The processed string
27
27
  */
28
28
  function rmAllSpace(input: string): string {
29
- return input.replace(/\s/g, "");
29
+ return input?.replace(/\s/g, "");
30
30
  }
31
31
 
32
32
  /**
@@ -35,7 +35,7 @@ function rmAllSpace(input: string): string {
35
35
  * @returns {string} The processed string
36
36
  */
37
37
  function trimAll(input: string): string {
38
- return input.replace(/(^\s+)|(\s+$)/g, "");
38
+ return input?.replace(/(^\s+)|(\s+$)/g, "");
39
39
  }
40
40
 
41
41
  /**
@@ -44,25 +44,35 @@ function trimAll(input: string): string {
44
44
  * @returns {string} The processed string
45
45
  */
46
46
  function multiSpacesToSingle(input: string): string {
47
- return input.replace(/\s+(\W)/g, ' ');
47
+ return input?.replace(/\s+(\W)/g, ' ');
48
48
  }
49
49
 
50
50
  /**
51
- * Convert HTML text to plain text
51
+ * Convert HTML text to plain text (Remove html tag content)
52
52
  * @param {string} input - The input string to process
53
53
  * @returns {string} The processed string
54
54
  */
55
+ /*
56
+ Examples:
57
+ console.log(htmlToPlain("<p>Hello <b>World</b></p>")); // Hello World
58
+ */
55
59
  function htmlToPlain(input: string): string {
56
- return input.replace(/(<([^>]+)>)/ig, '');
60
+ return input?.replace(/(<([^>]+)>)/ig, '');
57
61
  }
58
62
 
59
63
  /**
60
- * Strip HTML tags and their content
64
+ * Strip HTML tags and their content
65
+ * !!!Important: It will remove nested tags
61
66
  * @param {string} input - The input string to process
62
67
  * @returns {string} The processed string
63
68
  */
69
+ /*
70
+ Examples:
71
+ console.log(stripTagsAndContent("<p>Hello <b>World</b></p>")); // World
72
+ console.log(stripTagsAndContent("Hello <b>World</b>")); // Hello
73
+ */
64
74
  function stripTagsAndContent(input: string): string {
65
- return input.replace(/<\/?[^>]+(>|$)(.*?)<\/?[^>]+(>|$)/ig, '');
75
+ return input?.replace(/<\/?[^>]+(>|$)(.*?)<\/?[^>]+(>|$)/ig, '');
66
76
  }
67
77
 
68
78
  /**
@@ -71,7 +81,7 @@ function stripTagsAndContent(input: string): string {
71
81
  * @returns {string} The processed URL
72
82
  */
73
83
  function removeFirstLastSlash(input: string): string {
74
- return input.replace(/^\/|\/$/g, '');
84
+ return input?.replace(/^\/|\/$/g, '');
75
85
  }
76
86
 
77
87
  /**
@@ -80,7 +90,7 @@ function removeFirstLastSlash(input: string): string {
80
90
  * @returns {string} The processed URL
81
91
  */
82
92
  function removeTrailingSlash(input: string): string {
83
- return input.replace(/\/+$/, '');
93
+ return input?.replace(/\/+$/, '');
84
94
  }
85
95
 
86
96
  /**
@@ -89,7 +99,7 @@ function removeTrailingSlash(input: string): string {
89
99
  * @returns {string} The processed URL
90
100
  */
91
101
  function removeFirstSlash(input: string): string {
92
- return input.replace(/\//, '');
102
+ return input?.replace(/\//, '');
93
103
  }
94
104
 
95
105
  export {
@@ -69,7 +69,7 @@ function getTimeslots(
69
69
  * @param {Date} endDate - ebd date
70
70
  * @returns Number
71
71
  */
72
- function getMinutesBetweenDates(startDate, endDate) {
72
+ function getMinutesBetweenDates(startDate: Date, endDate: Date) {
73
73
  const diff = endDate.getTime() - startDate.getTime();
74
74
  return (diff / 60000);
75
75
  }
@@ -81,12 +81,12 @@ function getMinutesBetweenDates(startDate, endDate) {
81
81
  * @param {String} endTime - ebd time
82
82
  * @returns Number
83
83
  */
84
- function getMinutesBetweenTime(startTime, endTime) {
85
- const pad = (num) => {
84
+ function getMinutesBetweenTime(startTime: string, endTime: string) {
85
+ const pad = (num: string | number) => {
86
86
  return ("0" + num).slice(-2);
87
87
  };
88
- let s = startTime.split(":"), sMin = +s[1] + s[0] * 60,
89
- e = endTime.split(":"), eMin = +e[1] + e[0] * 60,
88
+ let s: any = startTime.split(":"), sMin = +s[1] + s[0] * 60,
89
+ e: any = endTime.split(":"), eMin = +e[1] + e[0] * 60,
90
90
  diff = eMin - sMin;
91
91
 
92
92
  if (diff < 0) { sMin -= 12 * 60; diff = eMin - sMin }
@@ -102,7 +102,7 @@ function getMinutesBetweenTime(startTime, endTime) {
102
102
  * @param {String} timeStr - time string
103
103
  * @returns Number
104
104
  */
105
- function convertTimeToMin(timeStr) {
105
+ function convertTimeToMin(timeStr: string) {
106
106
  const _time = timeStr.split(':').length === 3 ? `${timeStr}` : `${timeStr}:00`;
107
107
 
108
108
  const res = _time.split(':'); // split it at the colons
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "UIUX Lab",
3
3
  "email": "uiuxlab@gmail.com",
4
4
  "name": "funda-ui",
5
- "version": "4.7.133",
5
+ "version": "4.7.150",
6
6
  "description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
7
7
  "repository": {
8
8
  "type": "git",