onekijs-ui 0.21.1 → 0.21.3
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/components/datetime/hooks/useDateRangeAdapter.d.ts +1 -0
- package/dist/components/datetime/hooks/useQuickRanges.d.ts +2 -2
- package/dist/components/datetime/hooks/useTimestampRangeAdapter.d.ts +1 -0
- package/dist/components/datetime/typings.d.ts +16 -5
- package/dist/components/datetime/util.d.ts +5 -5
- package/dist/components/icon/util.d.ts +3 -3
- package/dist/components/select/SelectService.d.ts +3 -3
- package/dist/index.js +182 -119
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +182 -119
- package/dist/index.module.js.map +1 -1
- package/dist/styles/border.d.ts +1 -1
- package/dist/styles/size.d.ts +6 -6
- package/dist/styles/typography.d.ts +2 -2
- package/package.json +3 -3
- package/src/components/accordion/components/AccordionPanelTitle.tsx +1 -1
- package/src/components/datetime/components/CalendarComponent.tsx +30 -8
- package/src/components/datetime/components/DateRangePickerComponent.tsx +7 -4
- package/src/components/datetime/components/DateTimeRangePickerComponent.tsx +7 -4
- package/src/components/datetime/components/PickerComponent.tsx +34 -30
- package/src/components/datetime/hooks/useDateRangeAdapter.ts +3 -1
- package/src/components/datetime/hooks/useQuickRanges.ts +35 -10
- package/src/components/datetime/hooks/useTimestampRangeAdapter.ts +3 -1
- package/src/components/datetime/style.ts +6 -0
- package/src/components/datetime/typings.ts +17 -5
- package/src/components/datetime/util.ts +25 -21
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AnonymousObject } from 'onekijs-framework';
|
|
2
|
-
import {
|
|
3
|
-
declare const useQuickRanges: (ranges:
|
|
2
|
+
import { DateStringRange, QuickRange } from '../typings';
|
|
3
|
+
declare const useQuickRanges: (ranges: QuickRange | QuickRange[]) => AnonymousObject<DateStringRange>;
|
|
4
4
|
export default useQuickRanges;
|
|
@@ -2,5 +2,6 @@ import { DateRangeAdapter } from '../typings';
|
|
|
2
2
|
declare const useTimestampRangeAdapter: (format?: 'seconds' | 'milliseconds') => DateRangeAdapter<{
|
|
3
3
|
from: number | null;
|
|
4
4
|
to: number | null;
|
|
5
|
+
label?: string | null | undefined;
|
|
5
6
|
}>;
|
|
6
7
|
export default useTimestampRangeAdapter;
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import { AnonymousObject } from 'onekijs-framework';
|
|
3
3
|
import { StylableProps } from '../../styles/typings';
|
|
4
4
|
import { DropdownWidthModifier } from '../dropdown/typings';
|
|
5
|
+
import { Placement } from '@popperjs/core';
|
|
5
6
|
export type BasePickerProps = StylableProps & {
|
|
6
7
|
animationMs?: number;
|
|
7
8
|
attachDropdownToBody?: boolean;
|
|
8
9
|
autoFocus?: boolean;
|
|
10
|
+
combo?: boolean;
|
|
9
11
|
disabled?: boolean;
|
|
10
12
|
dropdownWidthModifier?: DropdownWidthModifier;
|
|
11
13
|
nullable?: boolean;
|
|
@@ -13,11 +15,13 @@ export type BasePickerProps = StylableProps & {
|
|
|
13
15
|
onFocus?: () => void;
|
|
14
16
|
openOnFocus?: boolean;
|
|
15
17
|
placeholder?: string;
|
|
18
|
+
placement?: Placement;
|
|
16
19
|
};
|
|
17
20
|
export type CalendarComponentProps = StylableProps & {
|
|
18
21
|
from: DatePickerDate;
|
|
19
22
|
maxDate?: Date;
|
|
20
23
|
minDate?: Date;
|
|
24
|
+
nextSelectEdge: 'from' | 'to';
|
|
21
25
|
onChange: (formDate: string | undefined, toDate?: string) => void;
|
|
22
26
|
type: DatePickerType;
|
|
23
27
|
to: DatePickerDate;
|
|
@@ -65,20 +69,23 @@ export type DatePickerType = {
|
|
|
65
69
|
};
|
|
66
70
|
export type DateQuickRange = {
|
|
67
71
|
label: string;
|
|
68
|
-
from: Date;
|
|
69
|
-
to: Date;
|
|
72
|
+
from: Date | (() => Date);
|
|
73
|
+
to: Date | (() => Date);
|
|
70
74
|
};
|
|
71
75
|
export type DateRange = {
|
|
72
76
|
from: Date | null;
|
|
73
77
|
to: Date | null;
|
|
78
|
+
label?: string | null;
|
|
74
79
|
};
|
|
75
80
|
export type DateStringRange = {
|
|
76
81
|
from: string | null;
|
|
77
82
|
to: string | null;
|
|
83
|
+
label?: string | null;
|
|
78
84
|
};
|
|
79
85
|
export type TimestampRange = {
|
|
80
86
|
from: number | null;
|
|
81
87
|
to: number | null;
|
|
88
|
+
label?: string | null;
|
|
82
89
|
};
|
|
83
90
|
export type DateRangeAdapter<T extends any = any> = {
|
|
84
91
|
fromDateRange: (range: DateStringRange) => T;
|
|
@@ -86,9 +93,10 @@ export type DateRangeAdapter<T extends any = any> = {
|
|
|
86
93
|
};
|
|
87
94
|
export type DateRangePickerProps<T extends any = any> = BasePickerProps & {
|
|
88
95
|
adapter?: DateRangeAdapter<T>;
|
|
89
|
-
|
|
96
|
+
closeOnQuickSelect?: boolean;
|
|
90
97
|
onChange?: (value: T | null) => void;
|
|
91
98
|
quickRanges?: AnonymousObject<DateStringRange>;
|
|
99
|
+
value?: T | null;
|
|
92
100
|
};
|
|
93
101
|
export type DateTimePickerProps<T extends any = any> = DatePickerProps<T> & DisplayTime;
|
|
94
102
|
export type DateTimeRangePickerProps<T extends any = any> = DateRangePickerProps<T> & DisplayTime;
|
|
@@ -99,13 +107,16 @@ export type DisplayTime = {
|
|
|
99
107
|
displaySeconds?: boolean;
|
|
100
108
|
};
|
|
101
109
|
export type PickerComponentProps = BasePickerProps & DisplayTime & {
|
|
110
|
+
closeOnQuickSelect?: boolean;
|
|
102
111
|
type: DatePickerType;
|
|
103
112
|
quickRanges?: AnonymousObject<DateStringRange>;
|
|
104
113
|
value?: string | null;
|
|
105
|
-
onChange?: (value: string | null) => void;
|
|
114
|
+
onChange?: (value: string | null, label?: string | null) => void;
|
|
115
|
+
label?: string | null;
|
|
106
116
|
};
|
|
117
|
+
export type QuickRange = DefaultQuickRange | DateQuickRange;
|
|
107
118
|
export type QuickTimeRangeComponentProps = {
|
|
108
|
-
currentQuickRangeLabel?: string;
|
|
119
|
+
currentQuickRangeLabel?: string | null;
|
|
109
120
|
quickRanges: AnonymousObject<DateStringRange>;
|
|
110
121
|
onChange: (quickRangeLabel: string) => void;
|
|
111
122
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnonymousObject } from 'onekijs-framework';
|
|
2
|
-
import { DateStringRange } from './typings';
|
|
3
|
-
export declare const dateToString: (d: Date | string) => string;
|
|
4
|
-
export declare const toDateRange: (value: string | null) => DateStringRange | null;
|
|
5
|
-
export declare const qr: (quickRange:
|
|
6
|
-
export declare const defaultQuickRanges: () => AnonymousObject<
|
|
2
|
+
import { DateQuickRange, DateStringRange, DefaultQuickRange } from './typings';
|
|
3
|
+
export declare const dateToString: (d: Date | string | (() => Date)) => string;
|
|
4
|
+
export declare const toDateRange: (value: string | null, label?: string | null) => DateStringRange | null;
|
|
5
|
+
export declare const qr: (quickRange: DefaultQuickRange) => DateQuickRange;
|
|
6
|
+
export declare const defaultQuickRanges: () => AnonymousObject<DateQuickRange>;
|
|
7
7
|
export declare const findQuickRangeLabel: (quickRanges: AnonymousObject<DateStringRange> | undefined, dateRange: DateStringRange | string | null | undefined) => string | undefined;
|
|
@@ -80,11 +80,11 @@ export declare const getIconDivProps: (props: IconProps) => {
|
|
|
80
80
|
results?: number | undefined;
|
|
81
81
|
security?: string | undefined;
|
|
82
82
|
unselectable?: "on" | "off" | undefined;
|
|
83
|
-
inputMode?: "search" | "text" | "
|
|
83
|
+
inputMode?: "search" | "text" | "none" | "email" | "tel" | "url" | "numeric" | "decimal" | undefined;
|
|
84
84
|
is?: string | undefined;
|
|
85
85
|
'aria-activedescendant'?: string | undefined;
|
|
86
86
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
87
|
-
'aria-autocomplete'?: "
|
|
87
|
+
'aria-autocomplete'?: "none" | "inline" | "both" | "list" | undefined;
|
|
88
88
|
'aria-braillelabel'?: string | undefined;
|
|
89
89
|
'aria-brailleroledescription'?: string | undefined;
|
|
90
90
|
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
@@ -104,7 +104,7 @@ export declare const getIconDivProps: (props: IconProps) => {
|
|
|
104
104
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
105
105
|
'aria-flowto'?: string | undefined;
|
|
106
106
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
107
|
-
'aria-haspopup'?: boolean | "dialog" | "menu" | "
|
|
107
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "listbox" | "grid" | "true" | "false" | "tree" | undefined;
|
|
108
108
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
109
109
|
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
110
110
|
'aria-keyshortcuts'?: string | undefined;
|
|
@@ -5,16 +5,16 @@ declare class SelectService<T = any, I extends SelectItem<T> = SelectItem<T>, S
|
|
|
5
5
|
protected lastCheckQuery: Query | undefined;
|
|
6
6
|
get defaultValue(): T | T[] | null | undefined;
|
|
7
7
|
get defaultValueLoading(): boolean | undefined;
|
|
8
|
-
check(): Generator<void | import("redux-saga/effects").AllEffect<import("redux-saga/effects").CallEffect<Generator<I[] | Generator<void |
|
|
8
|
+
check(): Generator<void | import("redux-saga/effects").AllEffect<import("redux-saga/effects").CallEffect<Generator<I[] | Generator<void | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | import("redux-saga/effects").CancelEffect | CollectionFetcherResult<T> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>>> | import("redux-saga/effects").AllEffect<Generator<I[] | Generator<void | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | import("redux-saga/effects").CancelEffect | CollectionFetcherResult<T> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>> | import("redux-saga/effects").CallEffect<void>, void, (I | undefined)[]>;
|
|
9
9
|
get status(): CollectionStatus;
|
|
10
10
|
setData(data: T[], query?: Query): void;
|
|
11
|
-
setDefaultValue(value: T | T[] | null | undefined): Generator<void | Generator<void | import("redux-saga/effects").AllEffect<import("redux-saga/effects").CallEffect<Generator<I[] | Generator<void |
|
|
11
|
+
setDefaultValue(value: T | T[] | null | undefined): Generator<void | Generator<void | import("redux-saga/effects").AllEffect<import("redux-saga/effects").CallEffect<Generator<I[] | Generator<void | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | import("redux-saga/effects").CancelEffect | CollectionFetcherResult<T> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>>> | import("redux-saga/effects").AllEffect<Generator<I[] | Generator<void | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | import("redux-saga/effects").CancelEffect | CollectionFetcherResult<T> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>> | import("redux-saga/effects").CallEffect<void>, void, (I | undefined)[]>, void, unknown>;
|
|
12
12
|
setDefaultValueLoading(loading: boolean): void;
|
|
13
13
|
setItemWidth(_item: I, value: number): void;
|
|
14
14
|
setValue(value: null | T | T[]): void;
|
|
15
15
|
setUrl(url: string, query?: Query): void;
|
|
16
16
|
_buildItem(data: T | null | undefined, adaptee: unknown, context?: AnonymousObject): I;
|
|
17
|
-
_filterItem(item: I | undefined, query: Query, valid: boolean): Generator<I[] | Generator<void |
|
|
17
|
+
_filterItem(item: I | undefined, query: Query, valid: boolean): Generator<I[] | Generator<void | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | import("redux-saga/effects").CancelEffect | CollectionFetcherResult<T> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>;
|
|
18
18
|
_compareItem(a: I | undefined, b: I | undefined): boolean;
|
|
19
19
|
_doSearch(search: Primitive | undefined): boolean;
|
|
20
20
|
_setDefaultValue(value: T | T[] | null | undefined): void;
|