funda-ui 4.7.115 → 4.7.133

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.d.ts +1 -0
  2. package/CascadingSelect/index.js +7 -3
  3. package/CascadingSelectE2E/index.d.ts +1 -0
  4. package/CascadingSelectE2E/index.js +7 -3
  5. package/Date/index.js +25 -2
  6. package/EventCalendar/index.js +25 -2
  7. package/EventCalendarTimeline/index.js +25 -2
  8. package/README.md +9 -11
  9. package/Refresher/index.d.ts +22 -0
  10. package/Refresher/index.js +564 -0
  11. package/SplitterPanel/index.css +63 -0
  12. package/SplitterPanel/index.d.ts +20 -0
  13. package/SplitterPanel/index.js +800 -0
  14. package/Utils/date.d.ts +15 -5
  15. package/Utils/date.js +22 -2
  16. package/Utils/time.d.ts +34 -0
  17. package/Utils/time.js +162 -0
  18. package/Utils/useIsMobile.js +66 -2
  19. package/all.d.ts +2 -0
  20. package/all.js +2 -0
  21. package/lib/cjs/CascadingSelect/index.d.ts +1 -0
  22. package/lib/cjs/CascadingSelect/index.js +7 -3
  23. package/lib/cjs/CascadingSelectE2E/index.d.ts +1 -0
  24. package/lib/cjs/CascadingSelectE2E/index.js +7 -3
  25. package/lib/cjs/Date/index.js +25 -2
  26. package/lib/cjs/EventCalendar/index.js +25 -2
  27. package/lib/cjs/EventCalendarTimeline/index.js +25 -2
  28. package/lib/cjs/Refresher/index.d.ts +22 -0
  29. package/lib/cjs/Refresher/index.js +564 -0
  30. package/lib/cjs/SplitterPanel/index.d.ts +20 -0
  31. package/lib/cjs/SplitterPanel/index.js +800 -0
  32. package/lib/cjs/Utils/date.d.ts +15 -5
  33. package/lib/cjs/Utils/date.js +22 -2
  34. package/lib/cjs/Utils/time.d.ts +34 -0
  35. package/lib/cjs/Utils/time.js +162 -0
  36. package/lib/cjs/Utils/useIsMobile.js +66 -2
  37. package/lib/cjs/index.d.ts +2 -0
  38. package/lib/cjs/index.js +2 -0
  39. package/lib/css/SplitterPanel/index.css +63 -0
  40. package/lib/esm/CascadingSelect/Group.tsx +4 -2
  41. package/lib/esm/CascadingSelect/index.tsx +3 -0
  42. package/lib/esm/CascadingSelectE2E/Group.tsx +4 -2
  43. package/lib/esm/CascadingSelectE2E/index.tsx +3 -0
  44. package/lib/esm/Refresher/index.tsx +121 -0
  45. package/lib/esm/SplitterPanel/index.scss +82 -0
  46. package/lib/esm/SplitterPanel/index.tsx +174 -0
  47. package/lib/esm/Utils/hooks/useIsMobile.tsx +90 -4
  48. package/lib/esm/Utils/libs/date.ts +28 -8
  49. package/lib/esm/Utils/libs/time.ts +125 -0
  50. package/lib/esm/index.js +2 -0
  51. package/package.json +1 -1
@@ -2152,6 +2152,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2152
2152
  return (/* binding */_getDateDetails
2153
2153
  );
2154
2154
  },
2155
+ /* harmony export */"getDaysInLastMonths": function getDaysInLastMonths() {
2156
+ return (/* binding */_getDaysInLastMonths
2157
+ );
2158
+ },
2155
2159
  /* harmony export */"getFirstAndLastMonthDay": function getFirstAndLastMonthDay() {
2156
2160
  return (/* binding */_getFirstAndLastMonthDay
2157
2161
  );
@@ -2452,6 +2456,25 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2452
2456
  return specifiedDay;
2453
2457
  }
2454
2458
 
2459
+ /**
2460
+ * Calculates the total number of days from today going back a specified number of months.
2461
+ *
2462
+ * @param {number} monthsAgo - The number of months to go back (e.g., 3 means the past 3 months).
2463
+ * @returns {number} The total number of days between the calculated past date and today.
2464
+ *
2465
+ * @example
2466
+ * getDaysInLastMonths(3); // Returns number of days in the past 3 months
2467
+ */
2468
+ function _getDaysInLastMonths() {
2469
+ var monthsAgo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;
2470
+ var today = new Date();
2471
+ var pastDate = new Date();
2472
+ pastDate.setMonth(today.getMonth() - monthsAgo);
2473
+ var diffInMs = today.getTime() - pastDate.getTime();
2474
+ var diffInDays = Math.round(diffInMs / (1000 * 60 * 60 * 24));
2475
+ return diffInDays;
2476
+ }
2477
+
2455
2478
  /**
2456
2479
  * Get next month date
2457
2480
  * @param {Date | String} v
@@ -2532,7 +2555,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2532
2555
  /**
2533
2556
  * Get current month
2534
2557
  * @param {Boolean} padZeroEnabled
2535
- * @returns {Number}
2558
+ * @returns {Number|String}
2536
2559
  */
2537
2560
  function _getCurrentMonth() {
2538
2561
  var padZeroEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
@@ -2543,7 +2566,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2543
2566
  /**
2544
2567
  * Get current day
2545
2568
  * @param {Boolean} padZeroEnabled
2546
- * @returns {Number}
2569
+ * @returns {Number|String}
2547
2570
  */
2548
2571
  function _getCurrentDay() {
2549
2572
  var padZeroEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
@@ -2347,6 +2347,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2347
2347
  return (/* binding */_getDateDetails
2348
2348
  );
2349
2349
  },
2350
+ /* harmony export */"getDaysInLastMonths": function getDaysInLastMonths() {
2351
+ return (/* binding */_getDaysInLastMonths
2352
+ );
2353
+ },
2350
2354
  /* harmony export */"getFirstAndLastMonthDay": function getFirstAndLastMonthDay() {
2351
2355
  return (/* binding */_getFirstAndLastMonthDay
2352
2356
  );
@@ -2647,6 +2651,25 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2647
2651
  return specifiedDay;
2648
2652
  }
2649
2653
 
2654
+ /**
2655
+ * Calculates the total number of days from today going back a specified number of months.
2656
+ *
2657
+ * @param {number} monthsAgo - The number of months to go back (e.g., 3 means the past 3 months).
2658
+ * @returns {number} The total number of days between the calculated past date and today.
2659
+ *
2660
+ * @example
2661
+ * getDaysInLastMonths(3); // Returns number of days in the past 3 months
2662
+ */
2663
+ function _getDaysInLastMonths() {
2664
+ var monthsAgo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;
2665
+ var today = new Date();
2666
+ var pastDate = new Date();
2667
+ pastDate.setMonth(today.getMonth() - monthsAgo);
2668
+ var diffInMs = today.getTime() - pastDate.getTime();
2669
+ var diffInDays = Math.round(diffInMs / (1000 * 60 * 60 * 24));
2670
+ return diffInDays;
2671
+ }
2672
+
2650
2673
  /**
2651
2674
  * Get next month date
2652
2675
  * @param {Date | String} v
@@ -2727,7 +2750,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2727
2750
  /**
2728
2751
  * Get current month
2729
2752
  * @param {Boolean} padZeroEnabled
2730
- * @returns {Number}
2753
+ * @returns {Number|String}
2731
2754
  */
2732
2755
  function _getCurrentMonth() {
2733
2756
  var padZeroEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
@@ -2738,7 +2761,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2738
2761
  /**
2739
2762
  * Get current day
2740
2763
  * @param {Boolean} padZeroEnabled
2741
- * @returns {Number}
2764
+ * @returns {Number|String}
2742
2765
  */
2743
2766
  function _getCurrentDay() {
2744
2767
  var padZeroEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ interface RefresherProps {
3
+ /** Pulling text */
4
+ pullingText?: React.ReactNode;
5
+ /** Text when reaching the threshold */
6
+ readyToRefreshText?: React.ReactNode;
7
+ /** Refreshing text */
8
+ refreshingText?: React.ReactNode;
9
+ /** The pull distance (px) that triggers the refresh */
10
+ threshold?: number;
11
+ /** The height of the trigger area */
12
+ triggerHeight?: number;
13
+ /** The styles of the trigger area */
14
+ triggerAreaStyle?: React.CSSProperties;
15
+ /** Pull-down is only allowed when the scroll bar of this element is at the top. You can only fire certain actions when the scrollbar is at the top by listening to the scroll event of a given DOM element and determining if its scrollTop is 0. */
16
+ scrollableElementClassName?: string;
17
+ /** Refresh action is async */
18
+ onRefresh: () => Promise<void>;
19
+ children: React.ReactNode;
20
+ }
21
+ declare const Refresher: (prpps: RefresherProps) => JSX.Element;
22
+ export default Refresher;