funda-ui 4.7.111 → 4.7.125
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 -10
- package/SplitterPanel/index.css +63 -0
- package/SplitterPanel/index.d.ts +20 -0
- package/SplitterPanel/index.js +736 -0
- package/Stepper/index.js +3 -2
- 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/useHistoryTracker.d.ts +26 -0
- package/Utils/useHistoryTracker.js +475 -0
- package/all.d.ts +1 -0
- package/all.js +1 -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/SplitterPanel/index.d.ts +20 -0
- package/lib/cjs/SplitterPanel/index.js +736 -0
- package/lib/cjs/Stepper/index.js +3 -2
- 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/useHistoryTracker.d.ts +26 -0
- package/lib/cjs/Utils/useHistoryTracker.js +475 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -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/SplitterPanel/index.scss +82 -0
- package/lib/esm/SplitterPanel/index.tsx +174 -0
- package/lib/esm/Stepper/index.tsx +4 -2
- package/lib/esm/Utils/hooks/useHistoryTracker.tsx +403 -0
- package/lib/esm/Utils/libs/date.ts +28 -8
- package/lib/esm/Utils/libs/time.ts +125 -0
- package/lib/esm/index.js +1 -0
- package/package.json +1 -1
- package/Utils/useGlobalUrlListener.d.ts +0 -2
- package/Utils/useGlobalUrlListener.js +0 -157
- package/lib/cjs/Utils/useGlobalUrlListener.d.ts +0 -2
- package/lib/cjs/Utils/useGlobalUrlListener.js +0 -157
- package/lib/esm/Utils/hooks/useGlobalUrlListener.tsx +0 -46
package/Stepper/index.js
CHANGED
|
@@ -516,6 +516,7 @@ var Stepper = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fun
|
|
|
516
516
|
'--stepper-progress-height': "".concat(progress, "%")
|
|
517
517
|
};
|
|
518
518
|
} else {
|
|
519
|
+
var defaultProgress = activeIndex / (panels.length - 1) * 100;
|
|
519
520
|
var firstItem = stepItems[0];
|
|
520
521
|
var lastItem = stepItems[stepItems.length - 1];
|
|
521
522
|
if (!firstItem || !lastItem) return {};
|
|
@@ -525,9 +526,9 @@ var Stepper = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fun
|
|
|
525
526
|
var currentItem = stepItems[activeIndex];
|
|
526
527
|
if (!currentItem) return {};
|
|
527
528
|
var currentCenter = currentItem.offsetLeft + currentItem.clientWidth / 2;
|
|
528
|
-
var _progress = (currentCenter - firstCenter) / totalWidth * 100;
|
|
529
|
+
var _progress = defaultProgress !== 0 && activeIndex > 0 ? defaultProgress : (currentCenter - firstCenter) / totalWidth * 100;
|
|
529
530
|
return {
|
|
530
|
-
'--stepper-progress-width': "".concat(_progress, "%")
|
|
531
|
+
'--stepper-progress-width': "".concat(isNaN(_progress) ? 0 : _progress, "%")
|
|
531
532
|
};
|
|
532
533
|
}
|
|
533
534
|
};
|
package/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/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;
|
package/Utils/time.d.ts
ADDED
|
@@ -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 };
|
package/Utils/time.js
ADDED
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare type UseHistoryTrackerChangeFnType = (args: {
|
|
2
|
+
isReady: boolean;
|
|
3
|
+
history: string[];
|
|
4
|
+
forwardHistory: string[];
|
|
5
|
+
currentUrl: string;
|
|
6
|
+
firstUrl: string;
|
|
7
|
+
canGoBack: boolean;
|
|
8
|
+
canGoForward: boolean;
|
|
9
|
+
}) => void;
|
|
10
|
+
export declare type UseHistoryTrackerProps = {
|
|
11
|
+
onChange?: UseHistoryTrackerChangeFnType | null;
|
|
12
|
+
};
|
|
13
|
+
declare const useHistoryTracker: (props: UseHistoryTrackerProps) => {
|
|
14
|
+
isReady: boolean;
|
|
15
|
+
history: string[];
|
|
16
|
+
forwardHistory: string[];
|
|
17
|
+
currentUrl: string;
|
|
18
|
+
firstUrl: string;
|
|
19
|
+
clearHistory: () => void;
|
|
20
|
+
goToHistory: (index: number) => void;
|
|
21
|
+
goBack: () => Promise<unknown>;
|
|
22
|
+
goForward: () => Promise<unknown>;
|
|
23
|
+
canGoBack: () => boolean;
|
|
24
|
+
canGoForward: () => boolean;
|
|
25
|
+
};
|
|
26
|
+
export default useHistoryTracker;
|