@himanshu-sorathiya/react-kit 1.0.22 → 1.0.24

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/dist/events.js CHANGED
@@ -1,2 +1,3 @@
1
- import { n as e, r as t, t as n } from "./events2.js";
2
- export { e as useClickOutside, t as useEventListener, n as useKey };
1
+ import { t as e } from "./useEventListener.js";
2
+ import { n as t, t as n } from "./events2.js";
3
+ export { t as useClickOutside, e as useEventListener, n as useKey };
package/dist/events2.js CHANGED
@@ -1,65 +1,36 @@
1
- import { useEffect as e, useLayoutEffect as t, useRef as n } from "react";
2
- //#region src/events/useEventListener/useEventListener.ts
3
- var r = typeof window < "u" ? t : e;
4
- function i(t, i, a = {}) {
5
- let { target: o, capture: s = !1, passive: c = !1, once: l = !1 } = a, u = o === void 0 ? typeof window > "u" ? null : window : o, d = n(i);
6
- r(() => {
7
- d.current = i;
8
- }, [i]), e(() => {
9
- let e = u && "current" in u ? u.current : u;
10
- if (!e?.addEventListener) return;
11
- let n = Array.isArray(t) ? t : [t], r = (e) => d.current(e);
12
- return n.forEach((t) => {
13
- e.addEventListener(t, r, {
14
- capture: s,
15
- passive: c,
16
- once: l
17
- });
18
- }), () => {
19
- n.forEach((t) => {
20
- e.removeEventListener(t, r, { capture: s });
21
- });
22
- };
23
- }, [
24
- Array.isArray(t) ? t.join(",") : t,
25
- u,
26
- s,
27
- c,
28
- l
29
- ]);
30
- }
31
- //#endregion
1
+ import { t as e } from "./useEventListener.js";
2
+ import { useEffect as t, useLayoutEffect as n, useRef as r } from "react";
32
3
  //#region src/events/useClickOutside/useClickOutside.ts
33
- var a = typeof window < "u" ? t : e;
34
- function o(e, t, r = {}) {
35
- let { enabled: o = !0, eventType: s = ["mousedown", "touchstart"] } = r, c = n(t);
36
- a(() => {
37
- c.current = t;
38
- }, [t]), i(s, (t) => {
39
- o && (Array.isArray(e) ? e : [e]).every((e) => {
40
- let n = e && "current" in e ? e.current : e;
41
- return n && !n.contains(t.target);
42
- }) && c.current(t);
4
+ var i = typeof window < "u" ? n : t;
5
+ function a(t, n, a = {}) {
6
+ let { enabled: o = !0, eventType: s = ["mousedown", "touchstart"] } = a, c = r(n);
7
+ i(() => {
8
+ c.current = n;
9
+ }, [n]), e(s, (e) => {
10
+ o && (Array.isArray(t) ? t : [t]).every((t) => {
11
+ let n = t && "current" in t ? t.current : t;
12
+ return n && !n.contains(e.target);
13
+ }) && c.current(e);
43
14
  }, { target: typeof document > "u" ? null : document });
44
15
  }
45
16
  //#endregion
46
17
  //#region src/events/useKey/constants.ts
47
- var s = [
18
+ var o = [
48
19
  "keydown",
49
20
  "keyup",
50
21
  "keypress"
51
- ], c = typeof window < "u" ? t : e;
52
- function l(t, r, { enabled: i = !0, preventDefault: a = !0, stopPropagation: o = !0, eventType: l = "keydown", preventRepeat: u = !1, ignoreWhenFocusedInInputs: d = !0, ctrlKey: f = !1, shiftKey: p = !1, altKey: m = !1, metaKey: h = !1, target: g } = {}) {
53
- let _ = g === void 0 ? typeof window > "u" ? null : window : g, v = n(r), y = n(i), b = n(!1);
54
- c(() => {
55
- v.current = r;
56
- }, [r]), e(() => {
22
+ ], s = typeof window < "u" ? n : t;
23
+ function c(e, n, { enabled: i = !0, preventDefault: a = !0, stopPropagation: c = !0, eventType: l = "keydown", preventRepeat: u = !1, ignoreWhenFocusedInInputs: d = !0, ctrlKey: f = !1, shiftKey: p = !1, altKey: m = !1, metaKey: h = !1, target: g } = {}) {
24
+ let _ = g === void 0 ? typeof window > "u" ? null : window : g, v = r(n), y = r(i), b = r(!1);
25
+ s(() => {
26
+ v.current = n;
27
+ }, [n]), t(() => {
57
28
  y.current = i;
58
- }, [i]), e(() => {
59
- let e = _ && "current" in _ ? _.current : _;
60
- if (!e) return;
61
- let n = String(t || "").toLowerCase(), r = s.includes(l) ? l : "keydown", i = u && r !== "keyup";
62
- function c() {
29
+ }, [i]), t(() => {
30
+ let t = _ && "current" in _ ? _.current : _;
31
+ if (!t) return;
32
+ let n = String(e || "").toLowerCase(), r = o.includes(l) ? l : "keydown", i = u && r !== "keyup";
33
+ function s() {
63
34
  b.current = !1;
64
35
  }
65
36
  function g(e) {
@@ -72,16 +43,16 @@ function l(t, r, { enabled: i = !0, preventDefault: a = !0, stopPropagation: o =
72
43
  let t = e.target;
73
44
  if (!(d && t instanceof HTMLElement && (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement || t.isContentEditable)) && e.ctrlKey === f && e.shiftKey === p && e.altKey === m && e.metaKey === h && n === e.key.toLowerCase()) {
74
45
  if (i && b.current) return;
75
- b.current = !0, v.current(e), a && e.preventDefault(), o && e.stopPropagation();
46
+ b.current = !0, v.current(e), a && e.preventDefault(), c && e.stopPropagation();
76
47
  }
77
48
  }
78
- return e.addEventListener(r, x), i && (e.addEventListener("keyup", g), window.addEventListener("blur", c)), () => {
79
- e.removeEventListener(r, x), i && (e.removeEventListener("keyup", g), window.removeEventListener("blur", c));
49
+ return t.addEventListener(r, x), i && (t.addEventListener("keyup", g), window.addEventListener("blur", s)), () => {
50
+ t.removeEventListener(r, x), i && (t.removeEventListener("keyup", g), window.removeEventListener("blur", s));
80
51
  };
81
52
  }, [
82
- t,
53
+ e,
83
54
  a,
84
- o,
55
+ c,
85
56
  l,
86
57
  u,
87
58
  d,
@@ -93,4 +64,4 @@ function l(t, r, { enabled: i = !0, preventDefault: a = !0, stopPropagation: o =
93
64
  ]);
94
65
  }
95
66
  //#endregion
96
- export { o as n, i as r, l as t };
67
+ export { a as n, c as t };
package/dist/index.d.ts CHANGED
@@ -1,186 +1,8 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
3
  import React$1 from 'react';
4
- import { CSSProperties, RefObject } from 'react';
4
+ import { CSSProperties, Key, RefObject } from 'react';
5
5
 
6
- export type DateInput = Date | number | string;
7
- export type WeekStartsOn = 0 | 1 | 2 | 3 | 4 | 5 | 6;
8
- export type DateInterval = {
9
- start: Date;
10
- end: Date;
11
- };
12
- export type DateRange = {
13
- start: Date;
14
- end: Date;
15
- };
16
- export type Duration = {
17
- years?: number;
18
- months?: number;
19
- weeks?: number;
20
- days?: number;
21
- hours?: number;
22
- minutes?: number;
23
- seconds?: number;
24
- };
25
- export declare function toDate(input: DateInput): Date;
26
- export declare function isDate(value: unknown): value is Date;
27
- export declare function isValid(date: Date): boolean;
28
- export declare function createDate(year: number, month: number, day?: number): Date;
29
- export declare function getYear(date: DateInput): number;
30
- export declare function getMonth(date: DateInput): number;
31
- export declare function getDate(date: DateInput): number;
32
- export declare function getHours(date: DateInput): number;
33
- export declare function getMinutes(date: DateInput): number;
34
- export declare function getSeconds(date: DateInput): number;
35
- export declare function getMilliseconds(date: DateInput): number;
36
- export declare function getTimestamp(date: DateInput): number;
37
- export declare function getDayOfWeek(date: DateInput): number;
38
- export declare function getDaysInMonth(date: DateInput): number;
39
- export declare function getQuarter(date: DateInput): number;
40
- export declare function getDayOfYear(date: DateInput): number;
41
- declare const TOKEN_FORMATTERS: {
42
- yyyy: (d: Date) => string;
43
- yy: (d: Date) => string;
44
- MMMM: (d: Date, loc: string) => string;
45
- MMM: (d: Date, loc: string) => string;
46
- MM: (d: Date) => string;
47
- M: (d: Date) => string;
48
- dd: (d: Date) => string;
49
- d: (d: Date) => string;
50
- EEEE: (d: Date, loc: string) => string;
51
- EEE: (d: Date, loc: string) => string;
52
- E: (d: Date, loc: string) => string;
53
- HH: (d: Date) => string;
54
- H: (d: Date) => string;
55
- hh: (d: Date) => string;
56
- h: (d: Date) => string;
57
- mm: (d: Date) => string;
58
- ss: (d: Date) => string;
59
- SSS: (d: Date) => string;
60
- a: (d: Date, loc: string) => string;
61
- Q: (d: Date) => string;
62
- w: (d: Date) => string;
63
- D: (d: Date) => string;
64
- xxx: (d: Date) => string;
65
- xx: (d: Date) => string;
66
- x: (d: Date) => string;
67
- };
68
- export type FormatToken = keyof typeof TOKEN_FORMATTERS;
69
- export declare function format(date: DateInput, formatString: string, options?: {
70
- locale?: string;
71
- }): string;
72
- export declare function formatDate(date: DateInput, locale?: string, options?: Intl.DateTimeFormatOptions): string;
73
- export declare function formatRelativeTime(date: DateInput, baseDate?: DateInput, locale?: string): string;
74
- export declare function formatISO(date: DateInput, options?: {
75
- format?: "extended" | "basic";
76
- representation?: "complete" | "date" | "time";
77
- }): string;
78
- export declare function formatRFC3339(date: DateInput, options?: {
79
- fractionDigits?: 0 | 1 | 2 | 3;
80
- }): string;
81
- export declare function formatISO9075(date: DateInput, options?: {
82
- representation?: "complete" | "date" | "time";
83
- }): string;
84
- export declare function formatRFC2822(date: DateInput): string;
85
- export declare function formatDuration(duration: Duration, options?: {
86
- format?: ReadonlyArray<keyof Duration>;
87
- zero?: boolean;
88
- delimiter?: string;
89
- locale?: string;
90
- }): string;
91
- export declare function toISOString(date: DateInput): string;
92
- export declare function parseISO(isoString: string): Date;
93
- export declare function addMilliseconds(date: DateInput, amount: number): Date;
94
- export declare function addSeconds(date: DateInput, amount: number): Date;
95
- export declare function addMinutes(date: DateInput, amount: number): Date;
96
- export declare function addHours(date: DateInput, amount: number): Date;
97
- export declare function addDays(date: DateInput, amount: number): Date;
98
- export declare function addWeeks(date: DateInput, amount: number): Date;
99
- export declare function addMonths(date: DateInput, amount: number): Date;
100
- export declare function addYears(date: DateInput, amount: number): Date;
101
- export declare function subMilliseconds(date: DateInput, amount: number): Date;
102
- export declare function subSeconds(date: DateInput, amount: number): Date;
103
- export declare function subMinutes(date: DateInput, amount: number): Date;
104
- export declare function subHours(date: DateInput, amount: number): Date;
105
- export declare function subDays(date: DateInput, amount: number): Date;
106
- export declare function subWeeks(date: DateInput, amount: number): Date;
107
- export declare function subMonths(date: DateInput, amount: number): Date;
108
- export declare function subYears(date: DateInput, amount: number): Date;
109
- export declare function setYear(date: DateInput, year: number): Date;
110
- export declare function setMonth(date: DateInput, month: number): Date;
111
- export declare function setDate(date: DateInput, day: number): Date;
112
- export declare function setHours(date: DateInput, hours: number): Date;
113
- export declare function setMinutes(date: DateInput, minutes: number): Date;
114
- export declare function setSeconds(date: DateInput, seconds: number): Date;
115
- export declare function setMilliseconds(date: DateInput, ms: number): Date;
116
- export declare function startOfDay(date: DateInput): Date;
117
- export declare function endOfDay(date: DateInput): Date;
118
- export declare function startOfHour(date: DateInput): Date;
119
- export declare function endOfHour(date: DateInput): Date;
120
- export declare function startOfMinute(date: DateInput): Date;
121
- export declare function endOfMinute(date: DateInput): Date;
122
- export declare function startOfWeek(date: DateInput, weekStartsOn?: WeekStartsOn): Date;
123
- export declare function endOfWeek(date: DateInput, weekStartsOn?: WeekStartsOn): Date;
124
- export declare function startOfMonth(date: DateInput): Date;
125
- export declare function endOfMonth(date: DateInput): Date;
126
- export declare function startOfQuarter(date: DateInput): Date;
127
- export declare function endOfQuarter(date: DateInput): Date;
128
- export declare function startOfYear(date: DateInput): Date;
129
- export declare function endOfYear(date: DateInput): Date;
130
- export declare function differenceInMilliseconds(dateLeft: DateInput, dateRight: DateInput): number;
131
- export declare function differenceInSeconds(dateLeft: DateInput, dateRight: DateInput): number;
132
- export declare function differenceInMinutes(dateLeft: DateInput, dateRight: DateInput): number;
133
- export declare function differenceInHours(dateLeft: DateInput, dateRight: DateInput): number;
134
- export declare function differenceInDays(dateLeft: DateInput, dateRight: DateInput): number;
135
- export declare function differenceInWeeks(dateLeft: DateInput, dateRight: DateInput): number;
136
- export declare function differenceInMonths(dateLeft: DateInput, dateRight: DateInput): number;
137
- export declare function differenceInYears(dateLeft: DateInput, dateRight: DateInput): number;
138
- export declare function addBusinessDays(date: DateInput, amount: number): Date;
139
- export declare function differenceInBusinessDays(dateLeft: DateInput, dateRight: DateInput): number;
140
- export declare function clampDate(date: DateInput, min: DateInput, max: DateInput): Date;
141
- export declare function min(dates: Date[]): Date | null;
142
- export declare function max(dates: Date[]): Date | null;
143
- export declare function closestTo(date: DateInput, datesArray: Date[]): Date | null;
144
- export declare function eachDayOfInterval(interval: DateInterval): Date[];
145
- export declare function eachMonthOfInterval(interval: DateInterval): Date[];
146
- export declare function eachYearOfInterval(interval: DateInterval): Date[];
147
- export declare function fromUnixTime(seconds: number): Date;
148
- export declare function toUnixTime(date: DateInput): number;
149
- export declare function roundToNearestMinutes(date: DateInput, step: number): Date;
150
- export declare function getISOWeek(date: DateInput): number;
151
- export declare function setISOWeek(date: DateInput, week: number): Date;
152
- export declare function intervalToDuration(interval: DateInterval): Duration;
153
- export declare function durationToMilliseconds(duration: Duration): number;
154
- export declare function isSameDay(dateA: DateInput, dateB: DateInput): boolean;
155
- export declare function isSameMonth(dateA: DateInput, dateB: DateInput): boolean;
156
- export declare function isSameYear(dateA: DateInput, dateB: DateInput): boolean;
157
- export declare function isSameQuarter(dateA: DateInput, dateB: DateInput): boolean;
158
- export declare function isSameWeek(dateA: DateInput, dateB: DateInput, weekStartsOn?: WeekStartsOn): boolean;
159
- export declare function isSameHour(dateA: DateInput, dateB: DateInput): boolean;
160
- export declare function isSameMinute(dateA: DateInput, dateB: DateInput): boolean;
161
- export declare function isSameSecond(dateA: DateInput, dateB: DateInput): boolean;
162
- export declare function isSameTime(dateA: DateInput, dateB: DateInput): boolean;
163
- export declare function isBefore(date: DateInput, compareDate: DateInput): boolean;
164
- export declare function isAfter(date: DateInput, compareDate: DateInput): boolean;
165
- export declare function isEqual(dateA: DateInput, dateB: DateInput): boolean;
166
- export declare function isWithinRange(date: DateInput, start: DateInput, end: DateInput): boolean;
167
- export declare function isOverlapping(rangeA: DateRange, rangeB: DateRange): boolean;
168
- export declare function isToday(date: DateInput): boolean;
169
- export declare function isYesterday(date: DateInput): boolean;
170
- export declare function isTomorrow(date: DateInput): boolean;
171
- export declare function isPast(date: DateInput): boolean;
172
- export declare function isFuture(date: DateInput): boolean;
173
- export declare function isThisWeek(date: DateInput, weekStartsOn?: WeekStartsOn): boolean;
174
- export declare function isThisMonth(date: DateInput): boolean;
175
- export declare function isThisYear(date: DateInput): boolean;
176
- export declare function isFirstDayOfMonth(date: DateInput): boolean;
177
- export declare function isLastDayOfMonth(date: DateInput): boolean;
178
- export declare function isWeekend(date: DateInput): boolean;
179
- export declare function isWeekday(date: DateInput): boolean;
180
- export declare function isAM(date: DateInput): boolean;
181
- export declare function isPM(date: DateInput): boolean;
182
- export declare function isLeapYear(yearOrDate: number | Date): boolean;
183
- export declare function isInLeapYear(date: DateInput): boolean;
184
6
  export type ClickOutsideEvent = MouseEvent | TouchEvent | PointerEvent | Event;
185
7
  export type ClickOutsideTarget = HTMLElement | null;
186
8
  export type ClickOutsideTargetRef = React$1.RefObject<ClickOutsideTarget> | ClickOutsideTarget;
@@ -316,6 +138,96 @@ export type UseThrottledStateReturn<T> = [
316
138
  export declare function useThrottledState<T>(initialValue: T | (() => T), delay: number, options?: ThrottleOptions): UseThrottledStateReturn<T>;
317
139
  export type UseThrottledValueReturn<T> = T;
318
140
  export declare function useThrottledValue<T>(value: T, delay: number, options?: ThrottleOptions): UseThrottledValueReturn<T>;
141
+ export type ScrollAlign = "start" | "center" | "end" | "auto";
142
+ export type Axis = "vertical" | "horizontal";
143
+ export interface ScrollToOffsetOptions {
144
+ smooth?: boolean;
145
+ }
146
+ export interface ScrollToCellOptions {
147
+ rowAlign?: ScrollAlign;
148
+ colAlign?: ScrollAlign;
149
+ smooth?: boolean;
150
+ }
151
+ export interface ScrollToRowOptions {
152
+ align?: ScrollAlign;
153
+ smooth?: boolean;
154
+ }
155
+ export interface ScrollToColumnOptions {
156
+ align?: ScrollAlign;
157
+ smooth?: boolean;
158
+ }
159
+ export interface VirtualCell {
160
+ key: React$1.Key;
161
+ rowIndex: number;
162
+ colIndex: number;
163
+ height: number;
164
+ width: number;
165
+ top: number;
166
+ left: number;
167
+ }
168
+ export interface UseVirtualGridOptions {
169
+ rowCount: number;
170
+ colCount: number;
171
+ estimateRowHeight: number | ((rowIndex: number) => number);
172
+ estimateColumnWidth: number | ((colIndex: number) => number);
173
+ getScrollElement: () => HTMLElement | Window | Document | null;
174
+ overscanRows?: number;
175
+ overscanCols?: number;
176
+ scrollingDelay?: number;
177
+ initialViewportHeight?: number;
178
+ initialViewportWidth?: number;
179
+ initialScrollTop?: number;
180
+ initialScrollLeft?: number;
181
+ initialScrollRow?: number;
182
+ initialScrollCol?: number;
183
+ itemKey?: (rowIndex: number, colIndex: number) => React$1.Key;
184
+ }
185
+ export interface UseVirtualGridReturn {
186
+ virtualCells: VirtualCell[];
187
+ totalHeight: number;
188
+ totalWidth: number;
189
+ isScrolling: boolean;
190
+ scrollToCell: (rowIndex: number, colIndex: number, options?: ScrollToCellOptions) => void;
191
+ scrollToOffset: (offsets: {
192
+ top: number;
193
+ left: number;
194
+ }, options?: ScrollToOffsetOptions) => void;
195
+ scrollToRow: (rowIndex: number, options?: ScrollToRowOptions) => void;
196
+ scrollToColumn: (colIndex: number, options?: ScrollToColumnOptions) => void;
197
+ }
198
+ export declare function useVirtualGrid(options: UseVirtualGridOptions): UseVirtualGridReturn;
199
+ export interface ScrollToIndexOptions {
200
+ align?: ScrollAlign;
201
+ smooth?: boolean;
202
+ }
203
+ export interface VirtualItem {
204
+ key: React$1.Key;
205
+ index: number;
206
+ size: number;
207
+ start: number;
208
+ }
209
+ export interface UseVirtualListOptions<T = unknown> {
210
+ count: number;
211
+ estimateSize: number | ((index: number) => number);
212
+ getScrollElement: () => HTMLElement | Window | Document | null;
213
+ overscan?: number;
214
+ horizontal?: boolean;
215
+ reverse?: boolean;
216
+ scrollingDelay?: number;
217
+ initialViewportSize?: number;
218
+ initialOffset?: number;
219
+ initialScrollIndex?: number;
220
+ data?: T[];
221
+ itemKey?: string | string[] | ((index: number, item?: T) => React$1.Key);
222
+ }
223
+ export interface UseVirtualListReturn {
224
+ virtualItems: VirtualItem[];
225
+ totalSize: number;
226
+ isScrolling: boolean;
227
+ scrollToIndex: (index: number, options?: ScrollToIndexOptions) => void;
228
+ scrollToOffset: (offset: number, options?: ScrollToOffsetOptions) => void;
229
+ }
230
+ export declare function useVirtualList<T = unknown>(options: UseVirtualListOptions<T>): UseVirtualListReturn;
319
231
  export type FilterType = "text" | "number" | "boolean" | "date" | "select" | "multiselect" | "custom";
320
232
  export type TextOperator = "contains" | "equals" | "startsWith" | "endsWith" | "notContains";
321
233
  export type NumberOperator = "equals" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual" | "between";
@@ -495,17 +407,16 @@ export interface UsePaginationReturn<T> {
495
407
  resetPagination: () => void;
496
408
  }
497
409
  export declare function usePagination<T>(data: T[] | undefined, initialPageSize: number, initialPageIndex?: number): UsePaginationReturn<T>;
498
- type SelectionId$1 = string | number;
499
410
  export interface UseSingleSelectionReturn {
500
- selectedId: SelectionId$1 | undefined;
411
+ selectedId: SelectionId | undefined;
501
412
  hasSelection: boolean;
502
- select: (id: SelectionId$1) => void;
413
+ select: (id: SelectionId) => void;
503
414
  deselect: () => void;
504
- toggle: (id: SelectionId$1) => void;
505
- isSelected: (id: SelectionId$1) => boolean;
415
+ toggle: (id: SelectionId) => void;
416
+ isSelected: (id: SelectionId) => boolean;
506
417
  resetSelection: () => void;
507
418
  }
508
- export declare function useSingleSelection(initialSelectedId?: SelectionId$1): UseSingleSelectionReturn;
419
+ export declare function useSingleSelection(initialSelectedId?: SelectionId): UseSingleSelectionReturn;
509
420
  export type SortType = "numeric" | "alphabetical" | "alphanumeric" | "boolean" | "date" | "basic" | "custom";
510
421
  export interface BaseSortOptions {
511
422
  desc?: boolean;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { addBusinessDays as e, addDays as t, addHours as n, addMilliseconds as r, addMinutes as i, addMonths as a, addSeconds as o, addWeeks as s, addYears as c, clampDate as l, closestTo as u, createDate as d, differenceInBusinessDays as f, differenceInDays as p, differenceInHours as m, differenceInMilliseconds as h, differenceInMinutes as g, differenceInMonths as _, differenceInSeconds as v, differenceInWeeks as y, differenceInYears as b, durationToMilliseconds as x, eachDayOfInterval as S, eachMonthOfInterval as C, eachYearOfInterval as w, endOfDay as T, endOfHour as E, endOfMinute as D, endOfMonth as O, endOfQuarter as k, endOfWeek as A, endOfYear as j, format as M, formatDate as N, formatDuration as P, formatISO as F, formatISO9075 as I, formatRFC2822 as L, formatRFC3339 as R, formatRelativeTime as z, fromUnixTime as B, getDate as V, getDayOfWeek as H, getDayOfYear as U, getDaysInMonth as W, getHours as G, getISOWeek as K, getMilliseconds as q, getMinutes as J, getMonth as Y, getQuarter as X, getSeconds as Z, getTimestamp as Q, getYear as $, intervalToDuration as ee, isAM as te, isAfter as ne, isBefore as re, isDate as ie, isEqual as ae, isFirstDayOfMonth as oe, isFuture as se, isInLeapYear as ce, isLastDayOfMonth as le, isLeapYear as ue, isOverlapping as de, isPM as fe, isPast as pe, isSameDay as me, isSameHour as he, isSameMinute as ge, isSameMonth as _e, isSameQuarter as ve, isSameSecond as ye, isSameTime as be, isSameWeek as xe, isSameYear as Se, isThisMonth as Ce, isThisWeek as we, isThisYear as Te, isToday as Ee, isTomorrow as De, isValid as Oe, isWeekday as ke, isWeekend as Ae, isWithinRange as je, isYesterday as Me, max as Ne, min as Pe, parseISO as Fe, roundToNearestMinutes as Ie, setDate as Le, setHours as Re, setISOWeek as ze, setMilliseconds as Be, setMinutes as Ve, setMonth as He, setSeconds as Ue, setYear as We, startOfDay as Ge, startOfHour as Ke, startOfMinute as qe, startOfMonth as Je, startOfQuarter as Ye, startOfWeek as Xe, startOfYear as Ze, subDays as Qe, subHours as $e, subMilliseconds as et, subMinutes as tt, subMonths as nt, subSeconds as rt, subWeeks as it, subYears as at, toDate as ot, toISOString as st, toUnixTime as ct } from "./datetime.js";
2
- import { n as lt, r as ut, t as dt } from "./events2.js";
3
- import { a as ft, c as pt, i as mt, l as ht, n as gt, o as _t, r as vt, s as yt, t as bt, u as xt } from "./performance2.js";
4
- import { a as St, c as Ct, i as wt, n as Tt, o as Et, r as Dt, s as Ot, t as kt } from "./state2.js";
5
- import { a as At, c as jt, i as Mt, n as Nt, o as Pt, r as Ft, s as It, t as Lt } from "./ui2.js";
6
- export { jt as FuzzyHighlighter, Mt as ModalLayout, e as addBusinessDays, t as addDays, n as addHours, r as addMilliseconds, i as addMinutes, a as addMonths, o as addSeconds, s as addWeeks, c as addYears, l as clampDate, u as closestTo, d as createDate, f as differenceInBusinessDays, p as differenceInDays, m as differenceInHours, h as differenceInMilliseconds, g as differenceInMinutes, _ as differenceInMonths, v as differenceInSeconds, y as differenceInWeeks, b as differenceInYears, x as durationToMilliseconds, S as eachDayOfInterval, C as eachMonthOfInterval, w as eachYearOfInterval, T as endOfDay, E as endOfHour, D as endOfMinute, O as endOfMonth, k as endOfQuarter, A as endOfWeek, j as endOfYear, M as format, N as formatDate, P as formatDuration, F as formatISO, I as formatISO9075, L as formatRFC2822, R as formatRFC3339, z as formatRelativeTime, B as fromUnixTime, V as getDate, H as getDayOfWeek, U as getDayOfYear, W as getDaysInMonth, G as getHours, K as getISOWeek, q as getMilliseconds, J as getMinutes, Y as getMonth, X as getQuarter, Z as getSeconds, Q as getTimestamp, $ as getYear, ee as intervalToDuration, te as isAM, ne as isAfter, re as isBefore, ie as isDate, ae as isEqual, oe as isFirstDayOfMonth, se as isFuture, ce as isInLeapYear, le as isLastDayOfMonth, ue as isLeapYear, de as isOverlapping, fe as isPM, pe as isPast, me as isSameDay, he as isSameHour, ge as isSameMinute, _e as isSameMonth, ve as isSameQuarter, ye as isSameSecond, be as isSameTime, xe as isSameWeek, Se as isSameYear, Ce as isThisMonth, we as isThisWeek, Te as isThisYear, Ee as isToday, De as isTomorrow, Oe as isValid, ke as isWeekday, Ae as isWeekend, je as isWithinRange, Me as isYesterday, Ne as max, Pe as min, Fe as parseISO, Ie as roundToNearestMinutes, Le as setDate, Re as setHours, ze as setISOWeek, Be as setMilliseconds, Ve as setMinutes, He as setMonth, Ue as setSeconds, We as setYear, Ge as startOfDay, Ke as startOfHour, qe as startOfMinute, Je as startOfMonth, Ye as startOfQuarter, Xe as startOfWeek, Ze as startOfYear, Qe as subDays, $e as subHours, et as subMilliseconds, tt as subMinutes, nt as subMonths, rt as subSeconds, it as subWeeks, at as subYears, ot as toDate, st as toISOString, ct as toUnixTime, lt as useClickOutside, xt as useDebounce, ht as useDebouncedCallback, pt as useDebouncedState, yt as useDebouncedValue, ut as useEventListener, Ft as useExpansion, Ct as useFilter, Ot as useFuzzySearch, Et as useGrouping, dt as useKey, At as useModal, Pt as useModalActions, It as useModalState, St as useMultipleSelection, wt as useOrder, Dt as usePagination, Nt as usePin, _t as useRateLimit, ft as useRateLimitedCallback, Tt as useSingleSelection, kt as useSort, mt as useThrottle, vt as useThrottledCallback, gt as useThrottledState, bt as useThrottledValue, Lt as useVisibility };
1
+ import { t as e } from "./useEventListener.js";
2
+ import { n as t, t as n } from "./events2.js";
3
+ import { a as r, c as i, d as a, f as o, i as s, l as c, n as l, o as u, r as d, s as f, t as p, u as m } from "./performance2.js";
4
+ import { a as h, c as g, i as _, n as v, o as y, r as b, s as x, t as S } from "./state2.js";
5
+ import { a as C, c as w, i as T, n as E, o as D, r as O, s as k, t as A } from "./ui2.js";
6
+ export { w as FuzzyHighlighter, T as ModalLayout, t as useClickOutside, o as useDebounce, a as useDebouncedCallback, m as useDebouncedState, c as useDebouncedValue, e as useEventListener, O as useExpansion, g as useFilter, x as useFuzzySearch, y as useGrouping, n as useKey, C as useModal, D as useModalActions, k as useModalState, h as useMultipleSelection, _ as useOrder, b as usePagination, E as usePin, i as useRateLimit, f as useRateLimitedCallback, v as useSingleSelection, S as useSort, u as useThrottle, r as useThrottledCallback, s as useThrottledState, d as useThrottledValue, l as useVirtualGrid, p as useVirtualList, A as useVisibility };
@@ -1,5 +1,7 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
+ import { Key } from 'react';
4
+
3
5
  export interface DebounceOptions {
4
6
  maxWait?: number;
5
7
  leading?: boolean;
@@ -79,5 +81,95 @@ export type UseThrottledStateReturn<T> = [
79
81
  export declare function useThrottledState<T>(initialValue: T | (() => T), delay: number, options?: ThrottleOptions): UseThrottledStateReturn<T>;
80
82
  export type UseThrottledValueReturn<T> = T;
81
83
  export declare function useThrottledValue<T>(value: T, delay: number, options?: ThrottleOptions): UseThrottledValueReturn<T>;
84
+ export type ScrollAlign = "start" | "center" | "end" | "auto";
85
+ export type Axis = "vertical" | "horizontal";
86
+ export interface ScrollToOffsetOptions {
87
+ smooth?: boolean;
88
+ }
89
+ export interface ScrollToCellOptions {
90
+ rowAlign?: ScrollAlign;
91
+ colAlign?: ScrollAlign;
92
+ smooth?: boolean;
93
+ }
94
+ export interface ScrollToRowOptions {
95
+ align?: ScrollAlign;
96
+ smooth?: boolean;
97
+ }
98
+ export interface ScrollToColumnOptions {
99
+ align?: ScrollAlign;
100
+ smooth?: boolean;
101
+ }
102
+ export interface VirtualCell {
103
+ key: Key;
104
+ rowIndex: number;
105
+ colIndex: number;
106
+ height: number;
107
+ width: number;
108
+ top: number;
109
+ left: number;
110
+ }
111
+ export interface UseVirtualGridOptions {
112
+ rowCount: number;
113
+ colCount: number;
114
+ estimateRowHeight: number | ((rowIndex: number) => number);
115
+ estimateColumnWidth: number | ((colIndex: number) => number);
116
+ getScrollElement: () => HTMLElement | Window | Document | null;
117
+ overscanRows?: number;
118
+ overscanCols?: number;
119
+ scrollingDelay?: number;
120
+ initialViewportHeight?: number;
121
+ initialViewportWidth?: number;
122
+ initialScrollTop?: number;
123
+ initialScrollLeft?: number;
124
+ initialScrollRow?: number;
125
+ initialScrollCol?: number;
126
+ itemKey?: (rowIndex: number, colIndex: number) => Key;
127
+ }
128
+ export interface UseVirtualGridReturn {
129
+ virtualCells: VirtualCell[];
130
+ totalHeight: number;
131
+ totalWidth: number;
132
+ isScrolling: boolean;
133
+ scrollToCell: (rowIndex: number, colIndex: number, options?: ScrollToCellOptions) => void;
134
+ scrollToOffset: (offsets: {
135
+ top: number;
136
+ left: number;
137
+ }, options?: ScrollToOffsetOptions) => void;
138
+ scrollToRow: (rowIndex: number, options?: ScrollToRowOptions) => void;
139
+ scrollToColumn: (colIndex: number, options?: ScrollToColumnOptions) => void;
140
+ }
141
+ export declare function useVirtualGrid(options: UseVirtualGridOptions): UseVirtualGridReturn;
142
+ export interface ScrollToIndexOptions {
143
+ align?: ScrollAlign;
144
+ smooth?: boolean;
145
+ }
146
+ export interface VirtualItem {
147
+ key: Key;
148
+ index: number;
149
+ size: number;
150
+ start: number;
151
+ }
152
+ export interface UseVirtualListOptions<T = unknown> {
153
+ count: number;
154
+ estimateSize: number | ((index: number) => number);
155
+ getScrollElement: () => HTMLElement | Window | Document | null;
156
+ overscan?: number;
157
+ horizontal?: boolean;
158
+ reverse?: boolean;
159
+ scrollingDelay?: number;
160
+ initialViewportSize?: number;
161
+ initialOffset?: number;
162
+ initialScrollIndex?: number;
163
+ data?: T[];
164
+ itemKey?: string | string[] | ((index: number, item?: T) => Key);
165
+ }
166
+ export interface UseVirtualListReturn {
167
+ virtualItems: VirtualItem[];
168
+ totalSize: number;
169
+ isScrolling: boolean;
170
+ scrollToIndex: (index: number, options?: ScrollToIndexOptions) => void;
171
+ scrollToOffset: (offset: number, options?: ScrollToOffsetOptions) => void;
172
+ }
173
+ export declare function useVirtualList<T = unknown>(options: UseVirtualListOptions<T>): UseVirtualListReturn;
82
174
 
83
175
  export {};
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./performance2.js";
2
- export { l as useDebounce, r as useDebouncedCallback, t as useDebouncedState, s as useDebouncedValue, a as useRateLimit, e as useRateLimitedCallback, n as useThrottle, o as useThrottledCallback, i as useThrottledState, c as useThrottledValue };
1
+ import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./performance2.js";
2
+ export { r as useDebounce, n as useDebouncedCallback, d as useDebouncedState, a as useDebouncedValue, t as useRateLimit, l as useRateLimitedCallback, s as useThrottle, e as useThrottledCallback, i as useThrottledState, c as useThrottledValue, o as useVirtualGrid, u as useVirtualList };