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.
- package/CascadingSelect/index.d.ts +1 -0
- package/CascadingSelect/index.js +7 -3
- package/CascadingSelectE2E/index.d.ts +1 -0
- package/CascadingSelectE2E/index.js +7 -3
- package/Date/index.js +25 -2
- package/EventCalendar/index.js +25 -2
- package/EventCalendarTimeline/index.js +25 -2
- package/README.md +9 -11
- package/Refresher/index.d.ts +22 -0
- package/Refresher/index.js +564 -0
- package/SplitterPanel/index.css +63 -0
- package/SplitterPanel/index.d.ts +20 -0
- package/SplitterPanel/index.js +800 -0
- package/Utils/date.d.ts +15 -5
- package/Utils/date.js +22 -2
- package/Utils/time.d.ts +34 -0
- package/Utils/time.js +162 -0
- package/Utils/useIsMobile.js +66 -2
- package/all.d.ts +2 -0
- package/all.js +2 -0
- package/lib/cjs/CascadingSelect/index.d.ts +1 -0
- package/lib/cjs/CascadingSelect/index.js +7 -3
- package/lib/cjs/CascadingSelectE2E/index.d.ts +1 -0
- package/lib/cjs/CascadingSelectE2E/index.js +7 -3
- package/lib/cjs/Date/index.js +25 -2
- package/lib/cjs/EventCalendar/index.js +25 -2
- package/lib/cjs/EventCalendarTimeline/index.js +25 -2
- package/lib/cjs/Refresher/index.d.ts +22 -0
- package/lib/cjs/Refresher/index.js +564 -0
- package/lib/cjs/SplitterPanel/index.d.ts +20 -0
- package/lib/cjs/SplitterPanel/index.js +800 -0
- package/lib/cjs/Utils/date.d.ts +15 -5
- package/lib/cjs/Utils/date.js +22 -2
- package/lib/cjs/Utils/time.d.ts +34 -0
- package/lib/cjs/Utils/time.js +162 -0
- package/lib/cjs/Utils/useIsMobile.js +66 -2
- package/lib/cjs/index.d.ts +2 -0
- package/lib/cjs/index.js +2 -0
- package/lib/css/SplitterPanel/index.css +63 -0
- package/lib/esm/CascadingSelect/Group.tsx +4 -2
- package/lib/esm/CascadingSelect/index.tsx +3 -0
- package/lib/esm/CascadingSelectE2E/Group.tsx +4 -2
- package/lib/esm/CascadingSelectE2E/index.tsx +3 -0
- package/lib/esm/Refresher/index.tsx +121 -0
- package/lib/esm/SplitterPanel/index.scss +82 -0
- package/lib/esm/SplitterPanel/index.tsx +174 -0
- package/lib/esm/Utils/hooks/useIsMobile.tsx +90 -4
- package/lib/esm/Utils/libs/date.ts +28 -8
- package/lib/esm/Utils/libs/time.ts +125 -0
- package/lib/esm/index.js +2 -0
- package/package.json +1 -1
package/lib/cjs/Utils/date.d.ts
CHANGED
|
@@ -95,6 +95,16 @@ declare function getYesterdayDate(v: Date | string): string;
|
|
|
95
95
|
* @returns {String} yyyy-MM-dd
|
|
96
96
|
*/
|
|
97
97
|
declare function getSpecifiedDate(v: Date | string, days: number): string;
|
|
98
|
+
/**
|
|
99
|
+
* Calculates the total number of days from today going back a specified number of months.
|
|
100
|
+
*
|
|
101
|
+
* @param {number} monthsAgo - The number of months to go back (e.g., 3 means the past 3 months).
|
|
102
|
+
* @returns {number} The total number of days between the calculated past date and today.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* getDaysInLastMonths(3); // Returns number of days in the past 3 months
|
|
106
|
+
*/
|
|
107
|
+
declare function getDaysInLastMonths(monthsAgo?: number): number;
|
|
98
108
|
/**
|
|
99
109
|
* Get next month date
|
|
100
110
|
* @param {Date | String} v
|
|
@@ -134,15 +144,15 @@ declare function getCurrentYear(): number;
|
|
|
134
144
|
/**
|
|
135
145
|
* Get current month
|
|
136
146
|
* @param {Boolean} padZeroEnabled
|
|
137
|
-
* @returns {Number}
|
|
147
|
+
* @returns {Number|String}
|
|
138
148
|
*/
|
|
139
|
-
declare function getCurrentMonth(padZeroEnabled?: boolean): number;
|
|
149
|
+
declare function getCurrentMonth(padZeroEnabled?: boolean): string | number;
|
|
140
150
|
/**
|
|
141
151
|
* Get current day
|
|
142
152
|
* @param {Boolean} padZeroEnabled
|
|
143
|
-
* @returns {Number}
|
|
153
|
+
* @returns {Number|String}
|
|
144
154
|
*/
|
|
145
|
-
declare function getCurrentDay(padZeroEnabled?: boolean): number;
|
|
155
|
+
declare function getCurrentDay(padZeroEnabled?: boolean): string | number;
|
|
146
156
|
/**
|
|
147
157
|
* Get first and last month day
|
|
148
158
|
* @param {Number} v
|
|
@@ -214,4 +224,4 @@ declare function getWeekDatesFromSun(weekOffset: number): Date[];
|
|
|
214
224
|
* @returns {Array<Date>}
|
|
215
225
|
*/
|
|
216
226
|
declare function getWeekDatesFromMon(weekOffset: number): Date[];
|
|
217
|
-
export { isTimeString, getNow, padZero, dateFormat, getDateDetails, isValidDate, isValidHours, isValidMinutesAndSeconds, isValidYear, isValidMonth, isValidDay, getLastDayInMonth, getFirstAndLastMonthDay, getCalendarDate, getFullTime, getTodayDate, getCurrentMonth, getCurrentYear, getCurrentDay, getCurrentDate, getTomorrowDate, getYesterdayDate, getNextMonthDate, getPrevMonthDate, getNextYearDate, getPrevYearDate, getSpecifiedDate, setDateHours, setDateMinutes, setDateDays, timestampToDate, getMonthDates, getWeekDatesFromSun, getWeekDatesFromMon };
|
|
227
|
+
export { isTimeString, getNow, padZero, dateFormat, getDateDetails, isValidDate, isValidHours, isValidMinutesAndSeconds, isValidYear, isValidMonth, isValidDay, getLastDayInMonth, getFirstAndLastMonthDay, getCalendarDate, getFullTime, getTodayDate, getCurrentMonth, getCurrentYear, getCurrentDay, getCurrentDate, getTomorrowDate, getYesterdayDate, getNextMonthDate, getPrevMonthDate, getNextYearDate, getPrevYearDate, getSpecifiedDate, getDaysInLastMonths, setDateHours, setDateMinutes, setDateDays, timestampToDate, getMonthDates, getWeekDatesFromSun, getWeekDatesFromMon };
|
package/lib/cjs/Utils/date.js
CHANGED
|
@@ -53,6 +53,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53
53
|
/* harmony export */ "getCurrentMonth": () => (/* binding */ getCurrentMonth),
|
|
54
54
|
/* harmony export */ "getCurrentYear": () => (/* binding */ getCurrentYear),
|
|
55
55
|
/* harmony export */ "getDateDetails": () => (/* binding */ getDateDetails),
|
|
56
|
+
/* harmony export */ "getDaysInLastMonths": () => (/* binding */ getDaysInLastMonths),
|
|
56
57
|
/* harmony export */ "getFirstAndLastMonthDay": () => (/* binding */ getFirstAndLastMonthDay),
|
|
57
58
|
/* harmony export */ "getFullTime": () => (/* binding */ getFullTime),
|
|
58
59
|
/* harmony export */ "getLastDayInMonth": () => (/* binding */ getLastDayInMonth),
|
|
@@ -271,6 +272,25 @@ function getSpecifiedDate(v, days) {
|
|
|
271
272
|
return specifiedDay;
|
|
272
273
|
}
|
|
273
274
|
|
|
275
|
+
/**
|
|
276
|
+
* Calculates the total number of days from today going back a specified number of months.
|
|
277
|
+
*
|
|
278
|
+
* @param {number} monthsAgo - The number of months to go back (e.g., 3 means the past 3 months).
|
|
279
|
+
* @returns {number} The total number of days between the calculated past date and today.
|
|
280
|
+
*
|
|
281
|
+
* @example
|
|
282
|
+
* getDaysInLastMonths(3); // Returns number of days in the past 3 months
|
|
283
|
+
*/
|
|
284
|
+
function getDaysInLastMonths() {
|
|
285
|
+
var monthsAgo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;
|
|
286
|
+
var today = new Date();
|
|
287
|
+
var pastDate = new Date();
|
|
288
|
+
pastDate.setMonth(today.getMonth() - monthsAgo);
|
|
289
|
+
var diffInMs = today.getTime() - pastDate.getTime();
|
|
290
|
+
var diffInDays = Math.round(diffInMs / (1000 * 60 * 60 * 24));
|
|
291
|
+
return diffInDays;
|
|
292
|
+
}
|
|
293
|
+
|
|
274
294
|
/**
|
|
275
295
|
* Get next month date
|
|
276
296
|
* @param {Date | String} v
|
|
@@ -351,7 +371,7 @@ function getCurrentYear() {
|
|
|
351
371
|
/**
|
|
352
372
|
* Get current month
|
|
353
373
|
* @param {Boolean} padZeroEnabled
|
|
354
|
-
* @returns {Number}
|
|
374
|
+
* @returns {Number|String}
|
|
355
375
|
*/
|
|
356
376
|
function getCurrentMonth() {
|
|
357
377
|
var padZeroEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
@@ -362,7 +382,7 @@ function getCurrentMonth() {
|
|
|
362
382
|
/**
|
|
363
383
|
* Get current day
|
|
364
384
|
* @param {Boolean} padZeroEnabled
|
|
365
|
-
* @returns {Number}
|
|
385
|
+
* @returns {Number|String}
|
|
366
386
|
*/
|
|
367
387
|
function getCurrentDay() {
|
|
368
388
|
var padZeroEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get timeslots from starting and ending time
|
|
3
|
+
* @param {string} startTime - start time in format "HH:mm"
|
|
4
|
+
* @param {string} endTime - end time in format "HH:mm"
|
|
5
|
+
* @param {number} timeInterval - time interval in minutes
|
|
6
|
+
* @param {boolean} formatRange - if true returns ranges like "10:00 - 11:00", if false returns single times like "10:00"
|
|
7
|
+
* @returns {string[]} Array of time slots
|
|
8
|
+
* @example
|
|
9
|
+
|
|
10
|
+
console.log(getTimeslots("10:00", "14:00", 60, true)); //['10:00 - 11:00', '11:00 - 12:00', '12:00 - 13:00', '13:00 - 14:00']
|
|
11
|
+
console.log(getTimeslots("10:00", "14:00", 60)); // ['10:00', '11:00', '12:00', '13:00']
|
|
12
|
+
*/
|
|
13
|
+
declare function getTimeslots(startTime: string, endTime: string, timeInterval: number, formatRange?: boolean): string[];
|
|
14
|
+
/**
|
|
15
|
+
* Get minutes between two dates
|
|
16
|
+
* @param {Date} startDate - start date
|
|
17
|
+
* @param {Date} endDate - ebd date
|
|
18
|
+
* @returns Number
|
|
19
|
+
*/
|
|
20
|
+
declare function getMinutesBetweenDates(startDate: any, endDate: any): number;
|
|
21
|
+
/**
|
|
22
|
+
* Get minutes between two time
|
|
23
|
+
* @param {String} startTime - start time
|
|
24
|
+
* @param {String} endTime - ebd time
|
|
25
|
+
* @returns Number
|
|
26
|
+
*/
|
|
27
|
+
declare function getMinutesBetweenTime(startTime: any, endTime: any): string;
|
|
28
|
+
/**
|
|
29
|
+
* Convert HH:MM:SS into minute
|
|
30
|
+
* @param {String} timeStr - time string
|
|
31
|
+
* @returns Number
|
|
32
|
+
*/
|
|
33
|
+
declare function convertTimeToMin(timeStr: any): number;
|
|
34
|
+
export { getTimeslots, getMinutesBetweenDates, getMinutesBetweenTime, convertTimeToMin };
|
|
@@ -0,0 +1,162 @@
|
|
|
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 */ "convertTimeToMin": () => (/* binding */ convertTimeToMin),
|
|
50
|
+
/* harmony export */ "getMinutesBetweenDates": () => (/* binding */ getMinutesBetweenDates),
|
|
51
|
+
/* harmony export */ "getMinutesBetweenTime": () => (/* binding */ getMinutesBetweenTime),
|
|
52
|
+
/* harmony export */ "getTimeslots": () => (/* binding */ getTimeslots)
|
|
53
|
+
/* harmony export */ });
|
|
54
|
+
/**
|
|
55
|
+
* Get timeslots from starting and ending time
|
|
56
|
+
* @param {string} startTime - start time in format "HH:mm"
|
|
57
|
+
* @param {string} endTime - end time in format "HH:mm"
|
|
58
|
+
* @param {number} timeInterval - time interval in minutes
|
|
59
|
+
* @param {boolean} formatRange - if true returns ranges like "10:00 - 11:00", if false returns single times like "10:00"
|
|
60
|
+
* @returns {string[]} Array of time slots
|
|
61
|
+
* @example
|
|
62
|
+
|
|
63
|
+
console.log(getTimeslots("10:00", "14:00", 60, true)); //['10:00 - 11:00', '11:00 - 12:00', '12:00 - 13:00', '13:00 - 14:00']
|
|
64
|
+
console.log(getTimeslots("10:00", "14:00", 60)); // ['10:00', '11:00', '12:00', '13:00']
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
function getTimeslots(startTime, endTime, timeInterval) {
|
|
68
|
+
var formatRange = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
69
|
+
var parseTime = function parseTime(s) {
|
|
70
|
+
var c = s.split(':');
|
|
71
|
+
return parseInt(c[0]) * 60 + parseInt(c[1]);
|
|
72
|
+
};
|
|
73
|
+
var convertHours = function convertHours(mins) {
|
|
74
|
+
var hour = Math.floor(mins / 60);
|
|
75
|
+
mins = Math.trunc(mins % 60);
|
|
76
|
+
var converted = pad(hour, 2) + ':' + pad(mins, 2);
|
|
77
|
+
return converted;
|
|
78
|
+
};
|
|
79
|
+
var pad = function pad(str, max) {
|
|
80
|
+
str = str.toString();
|
|
81
|
+
return str.length < max ? pad("0" + str, max) : str;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// calculate time slot
|
|
85
|
+
var calculateTimeSlot = function calculateTimeSlot(_startTime, _endTime, _timeInterval) {
|
|
86
|
+
var timeSlots = [];
|
|
87
|
+
// Round start and end times to next 30 min interval
|
|
88
|
+
_startTime = Math.ceil(_startTime / 30) * 30;
|
|
89
|
+
_endTime = Math.ceil(_endTime / 30) * 30;
|
|
90
|
+
|
|
91
|
+
// Start and end of interval in the loop
|
|
92
|
+
var currentTime = _startTime;
|
|
93
|
+
while (currentTime < _endTime) {
|
|
94
|
+
if (formatRange) {
|
|
95
|
+
var t = convertHours(currentTime) + ' - ' + convertHours(currentTime + _timeInterval);
|
|
96
|
+
timeSlots.push(t);
|
|
97
|
+
} else {
|
|
98
|
+
timeSlots.push(convertHours(currentTime));
|
|
99
|
+
}
|
|
100
|
+
currentTime += _timeInterval;
|
|
101
|
+
}
|
|
102
|
+
return timeSlots;
|
|
103
|
+
};
|
|
104
|
+
var inputEndTime = parseTime(endTime);
|
|
105
|
+
var inputStartTime = parseTime(startTime);
|
|
106
|
+
var timeSegment = calculateTimeSlot(inputStartTime, inputEndTime, timeInterval);
|
|
107
|
+
return timeSegment;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Get minutes between two dates
|
|
112
|
+
* @param {Date} startDate - start date
|
|
113
|
+
* @param {Date} endDate - ebd date
|
|
114
|
+
* @returns Number
|
|
115
|
+
*/
|
|
116
|
+
function getMinutesBetweenDates(startDate, endDate) {
|
|
117
|
+
var diff = endDate.getTime() - startDate.getTime();
|
|
118
|
+
return diff / 60000;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Get minutes between two time
|
|
123
|
+
* @param {String} startTime - start time
|
|
124
|
+
* @param {String} endTime - ebd time
|
|
125
|
+
* @returns Number
|
|
126
|
+
*/
|
|
127
|
+
function getMinutesBetweenTime(startTime, endTime) {
|
|
128
|
+
var pad = function pad(num) {
|
|
129
|
+
return ("0" + num).slice(-2);
|
|
130
|
+
};
|
|
131
|
+
var s = startTime.split(":"),
|
|
132
|
+
sMin = +s[1] + s[0] * 60,
|
|
133
|
+
e = endTime.split(":"),
|
|
134
|
+
eMin = +e[1] + e[0] * 60,
|
|
135
|
+
diff = eMin - sMin;
|
|
136
|
+
if (diff < 0) {
|
|
137
|
+
sMin -= 12 * 60;
|
|
138
|
+
diff = eMin - sMin;
|
|
139
|
+
}
|
|
140
|
+
var h = Math.floor(diff / 60),
|
|
141
|
+
m = diff % 60;
|
|
142
|
+
return "" + pad(h) + ":" + pad(m);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Convert HH:MM:SS into minute
|
|
147
|
+
* @param {String} timeStr - time string
|
|
148
|
+
* @returns Number
|
|
149
|
+
*/
|
|
150
|
+
function convertTimeToMin(timeStr) {
|
|
151
|
+
var _time = timeStr.split(':').length === 3 ? "".concat(timeStr) : "".concat(timeStr, ":00");
|
|
152
|
+
var res = _time.split(':'); // split it at the colons
|
|
153
|
+
|
|
154
|
+
// Hours are worth 60 minutes.
|
|
155
|
+
var minutes = +res[0] * 60 + +res[1];
|
|
156
|
+
return minutes;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/******/ return __webpack_exports__;
|
|
160
|
+
/******/ })()
|
|
161
|
+
;
|
|
162
|
+
});
|
|
@@ -127,7 +127,7 @@ const App = () => {
|
|
|
127
127
|
*/
|
|
128
128
|
|
|
129
129
|
var useIsMobile = function useIsMobile() {
|
|
130
|
-
var breakpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
|
|
130
|
+
var breakpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 600;
|
|
131
131
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
|
132
132
|
_useState2 = _slicedToArray(_useState, 2),
|
|
133
133
|
isMobile = _useState2[0],
|
|
@@ -141,7 +141,71 @@ var useIsMobile = function useIsMobile() {
|
|
|
141
141
|
setIsMounted(true);
|
|
142
142
|
var handleResize = function handleResize() {
|
|
143
143
|
if (window) {
|
|
144
|
-
|
|
144
|
+
var detectDeviceType = function detectDeviceType() {
|
|
145
|
+
// 1. First check if window and navigator are available (SSR compatibility)
|
|
146
|
+
if (typeof window === 'undefined' || !navigator) {
|
|
147
|
+
return 'desktop'; // Default to desktop
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// 2. Get user agent string
|
|
151
|
+
var ua = navigator.userAgent.toLowerCase();
|
|
152
|
+
|
|
153
|
+
// 3. Get platform info
|
|
154
|
+
var platform = navigator.platform.toLowerCase();
|
|
155
|
+
|
|
156
|
+
// 4. Check screen characteristics using window.matchMedia
|
|
157
|
+
var isTouch = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
158
|
+
var isPortrait = window.matchMedia('(orientation: portrait)').matches;
|
|
159
|
+
var isLandscape = window.matchMedia('(orientation: landscape)').matches;
|
|
160
|
+
|
|
161
|
+
// 5. Get screen dimensions
|
|
162
|
+
var screenWidth = window.screen.width;
|
|
163
|
+
var screenHeight = window.screen.height;
|
|
164
|
+
var minScreenSize = Math.min(screenWidth, screenHeight);
|
|
165
|
+
var maxScreenSize = Math.max(screenWidth, screenHeight);
|
|
166
|
+
|
|
167
|
+
// Define device characteristics
|
|
168
|
+
var isTablet =
|
|
169
|
+
// Traditional UA detection
|
|
170
|
+
/ipad/.test(ua) || /android/.test(ua) && !/mobile/.test(ua) || /tablet/.test(ua) || /playbook/.test(ua) || /nexus (7|9|10)/.test(ua) || /sm-t/.test(ua) || /huawei(.*)mediapad/.test(ua) ||
|
|
171
|
+
// Special detection for iPad Pro and newer iPads
|
|
172
|
+
navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 ||
|
|
173
|
+
// Screen size characteristics (tablets typically fall within this range)
|
|
174
|
+
minScreenSize >= breakpoint && maxScreenSize <= 1366 && isTouch ||
|
|
175
|
+
// Specific device detection
|
|
176
|
+
/kindle|silk|kftt|kfot|kfjwa|kfjwi|kfsowi|kfthwa|kfthwi|kfapwa|kfapwi/i.test(ua);
|
|
177
|
+
var isMobile = !isTablet && (
|
|
178
|
+
// Prevent tablets from being detected as phones
|
|
179
|
+
// Traditional mobile device detection
|
|
180
|
+
/iphone|ipod|android.*mobile|windows phone|mobi/.test(ua) ||
|
|
181
|
+
// Screen size characteristics (phones typically smaller than 600px)
|
|
182
|
+
minScreenSize < breakpoint && isTouch ||
|
|
183
|
+
// Additional mobile device detection
|
|
184
|
+
/blackberry|\bbb\d+|meego|webos|palm|phone|pocket|mobile|mini|iemobile/i.test(ua));
|
|
185
|
+
|
|
186
|
+
// 6. Comprehensive decision logic
|
|
187
|
+
if (isMobile) {
|
|
188
|
+
// Additional check for small tablets
|
|
189
|
+
if (maxScreenSize >= 1024 && isTouch) {
|
|
190
|
+
return 'tablet';
|
|
191
|
+
}
|
|
192
|
+
return 'mobile';
|
|
193
|
+
}
|
|
194
|
+
if (isTablet) {
|
|
195
|
+
// Additional check for touch-enabled laptops
|
|
196
|
+
if (maxScreenSize > 1366 && /windows/.test(ua)) {
|
|
197
|
+
return 'desktop';
|
|
198
|
+
}
|
|
199
|
+
return 'tablet';
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// 7. Check for touch-enabled laptops
|
|
203
|
+
if (isTouch && /windows/.test(ua) && maxScreenSize > 1366) {
|
|
204
|
+
return 'desktop';
|
|
205
|
+
}
|
|
206
|
+
return 'desktop';
|
|
207
|
+
};
|
|
208
|
+
setIsMobile(detectDeviceType() === 'mobile');
|
|
145
209
|
}
|
|
146
210
|
};
|
|
147
211
|
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -29,12 +29,14 @@ export const NumberInput: any;
|
|
|
29
29
|
export const Pagination: any;
|
|
30
30
|
export const Radio: any;
|
|
31
31
|
export const RangeSlider: any;
|
|
32
|
+
export const Refresher: any;
|
|
32
33
|
export const RootPortal: any;
|
|
33
34
|
export const ScrollReveal: any;
|
|
34
35
|
export const Scrollbar: any;
|
|
35
36
|
export const SearchBar: any;
|
|
36
37
|
export const Select: any;
|
|
37
38
|
export const ShowMoreLess: any;
|
|
39
|
+
export const SplitterPanel: any;
|
|
38
40
|
export const Stepper: any;
|
|
39
41
|
export const Switch: any;
|
|
40
42
|
export const Table: any;
|
package/lib/cjs/index.js
CHANGED
|
@@ -31,12 +31,14 @@ exports.NumberInput = _interopRequireDefault(require("./NumberInput")).default;
|
|
|
31
31
|
exports.Pagination = _interopRequireDefault(require("./Pagination")).default;
|
|
32
32
|
exports.Radio = _interopRequireDefault(require("./Radio")).default;
|
|
33
33
|
exports.RangeSlider = _interopRequireDefault(require("./RangeSlider")).default;
|
|
34
|
+
exports.Refresher = _interopRequireDefault(require("./Refresher")).default;
|
|
34
35
|
exports.RootPortal = _interopRequireDefault(require("./RootPortal")).default;
|
|
35
36
|
exports.ScrollReveal = _interopRequireDefault(require("./ScrollReveal")).default;
|
|
36
37
|
exports.Scrollbar = _interopRequireDefault(require("./Scrollbar")).default;
|
|
37
38
|
exports.SearchBar = _interopRequireDefault(require("./SearchBar")).default;
|
|
38
39
|
exports.Select = _interopRequireDefault(require("./Select")).default;
|
|
39
40
|
exports.ShowMoreLess = _interopRequireDefault(require("./ShowMoreLess")).default;
|
|
41
|
+
exports.SplitterPanel = _interopRequireDefault(require("./SplitterPanel")).default;
|
|
40
42
|
exports.Stepper = _interopRequireDefault(require("./Stepper")).default;
|
|
41
43
|
exports.Switch = _interopRequireDefault(require("./Switch")).default;
|
|
42
44
|
exports.Table = _interopRequireDefault(require("./Table")).default;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/* ======================================================
|
|
2
|
+
<!-- Splitter Panel -->
|
|
3
|
+
/* ====================================================== */
|
|
4
|
+
.splitter-panel {
|
|
5
|
+
--splitter-panel-divider-color: rgba(0, 0, 0, 0.15);
|
|
6
|
+
--splitter-panel-divider-hover-color: rgba(210, 253, 253, .86);
|
|
7
|
+
display: flex;
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
.splitter-panel .splitter-panel-left {
|
|
11
|
+
width: var(--splitter-panel-left-w, 0);
|
|
12
|
+
}
|
|
13
|
+
.splitter-panel .splitter-panel-divider {
|
|
14
|
+
position: relative;
|
|
15
|
+
width: 1px;
|
|
16
|
+
cursor: col-resize;
|
|
17
|
+
padding: 0 2px;
|
|
18
|
+
transition: all 0.25s;
|
|
19
|
+
z-index: 1;
|
|
20
|
+
}
|
|
21
|
+
.splitter-panel .splitter-panel-divider::before {
|
|
22
|
+
content: "";
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
width: 1px;
|
|
27
|
+
height: 100%;
|
|
28
|
+
background: var(--splitter-panel-divider-color);
|
|
29
|
+
}
|
|
30
|
+
.splitter-panel .splitter-panel-divider::after {
|
|
31
|
+
content: "";
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 0;
|
|
34
|
+
left: -2px;
|
|
35
|
+
width: 5px;
|
|
36
|
+
height: 100%;
|
|
37
|
+
}
|
|
38
|
+
.splitter-panel .splitter-panel-divider:hover::after {
|
|
39
|
+
background: var(--splitter-panel-divider-hover-color);
|
|
40
|
+
}
|
|
41
|
+
.splitter-panel .splitter-panel-right {
|
|
42
|
+
flex: 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.splitter-panel-vertical {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
}
|
|
49
|
+
.splitter-panel-vertical .splitter-panel-top,
|
|
50
|
+
.splitter-panel-vertical .splitter-panel-bottom {
|
|
51
|
+
min-height: 50px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@media (max-width: 767px) {
|
|
55
|
+
.splitter-panel {
|
|
56
|
+
display: none !important;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
@media (min-width: 768px) {
|
|
60
|
+
.splitter-panel-vertical {
|
|
61
|
+
display: none !important;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { combinedCls } from 'funda-utils/dist/cjs/cls';
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
export type GroupFnType = (arg1: any, arg2: any, arg3: number) => void;
|
|
7
7
|
|
|
8
8
|
export type GroupProps = {
|
|
9
|
+
perColumnHeadersShow?: boolean;
|
|
9
10
|
level: number;
|
|
10
11
|
columnTitle: any[];
|
|
11
12
|
data?: any[any];
|
|
@@ -17,6 +18,7 @@ export type GroupProps = {
|
|
|
17
18
|
export default function Group(props: GroupProps) {
|
|
18
19
|
|
|
19
20
|
const {
|
|
21
|
+
perColumnHeadersShow,
|
|
20
22
|
level,
|
|
21
23
|
columnTitle,
|
|
22
24
|
data,
|
|
@@ -48,7 +50,7 @@ export default function Group(props: GroupProps) {
|
|
|
48
50
|
onClick={(e) => selectEv?.(e, item, index)}
|
|
49
51
|
></div>
|
|
50
52
|
} else {
|
|
51
|
-
return columnTitle[level] === '' ? null : <h3
|
|
53
|
+
return columnTitle[level] === '' || perColumnHeadersShow === false ? null : <h3
|
|
52
54
|
key={index}
|
|
53
55
|
className="cas-select__opt-header"
|
|
54
56
|
>
|
|
@@ -29,6 +29,7 @@ export type CascadingSelectProps = {
|
|
|
29
29
|
wrapperClassName?: string;
|
|
30
30
|
controlClassName?: string;
|
|
31
31
|
controlExClassName?: string;
|
|
32
|
+
perColumnHeadersShow?: boolean;
|
|
32
33
|
exceededSidePosOffset?: number;
|
|
33
34
|
value?: string;
|
|
34
35
|
label?: React.ReactNode | string;
|
|
@@ -88,6 +89,7 @@ const CascadingSelect = (props: CascadingSelectProps) => {
|
|
|
88
89
|
wrapperClassName,
|
|
89
90
|
controlClassName,
|
|
90
91
|
controlExClassName,
|
|
92
|
+
perColumnHeadersShow = true,
|
|
91
93
|
exceededSidePosOffset,
|
|
92
94
|
disabled,
|
|
93
95
|
required,
|
|
@@ -1116,6 +1118,7 @@ const CascadingSelect = (props: CascadingSelectProps) => {
|
|
|
1116
1118
|
return (
|
|
1117
1119
|
<li key={level} data-col={level} className="cas-select__items-col">
|
|
1118
1120
|
<Group
|
|
1121
|
+
perColumnHeadersShow={perColumnHeadersShow}
|
|
1119
1122
|
level={level}
|
|
1120
1123
|
columnTitle={columnTitleData}
|
|
1121
1124
|
data={item}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { combinedCls } from 'funda-utils/dist/cjs/cls';
|
|
4
4
|
|
|
5
5
|
export type GroupFnType = (arg1: any, arg2: any, arg3: number) => void;
|
|
6
6
|
|
|
7
7
|
export type GroupProps = {
|
|
8
|
+
perColumnHeadersShow?: boolean;
|
|
8
9
|
level: number;
|
|
9
10
|
columnTitle: any[];
|
|
10
11
|
data?: any[any];
|
|
@@ -16,6 +17,7 @@ export type GroupProps = {
|
|
|
16
17
|
export default function Group(props: GroupProps) {
|
|
17
18
|
|
|
18
19
|
const {
|
|
20
|
+
perColumnHeadersShow,
|
|
19
21
|
level,
|
|
20
22
|
columnTitle,
|
|
21
23
|
data,
|
|
@@ -48,7 +50,7 @@ export default function Group(props: GroupProps) {
|
|
|
48
50
|
onClick={(e) => selectEv?.(e, item, index)}
|
|
49
51
|
></div>
|
|
50
52
|
} else {
|
|
51
|
-
return columnTitle[level] === '' ? null : <h3
|
|
53
|
+
return columnTitle[level] === '' || perColumnHeadersShow === false ? null : <h3
|
|
52
54
|
key={index}
|
|
53
55
|
className="cas-select-e2e__opt-header"
|
|
54
56
|
>
|
|
@@ -45,6 +45,7 @@ export type CascadingSelectE2EProps = {
|
|
|
45
45
|
wrapperClassName?: string;
|
|
46
46
|
controlClassName?: string;
|
|
47
47
|
controlExClassName?: string;
|
|
48
|
+
perColumnHeadersShow?: boolean;
|
|
48
49
|
exceededSidePosOffset?: number;
|
|
49
50
|
value?: string;
|
|
50
51
|
label?: React.ReactNode | string;
|
|
@@ -106,6 +107,7 @@ const CascadingSelectE2E = (props: CascadingSelectE2EProps) => {
|
|
|
106
107
|
wrapperClassName,
|
|
107
108
|
controlClassName,
|
|
108
109
|
controlExClassName,
|
|
110
|
+
perColumnHeadersShow = true,
|
|
109
111
|
exceededSidePosOffset,
|
|
110
112
|
disabled,
|
|
111
113
|
required,
|
|
@@ -1373,6 +1375,7 @@ const CascadingSelectE2E = (props: CascadingSelectE2EProps) => {
|
|
|
1373
1375
|
return (
|
|
1374
1376
|
<li key={level} data-col={level} className="cas-select-e2e__items-col">
|
|
1375
1377
|
<Group
|
|
1378
|
+
perColumnHeadersShow={perColumnHeadersShow}
|
|
1376
1379
|
level={level}
|
|
1377
1380
|
columnTitle={columnTitleData}
|
|
1378
1381
|
data={item}
|