@moser-inc/moser-labs-react 7.3.0 → 7.4.0
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/index.d.ts +64 -322
- package/dist/index.js +60 -24
- package/package.json +4 -5
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ import { InputTextareaProps } from "primereact/inputtextarea";
|
|
|
22
22
|
import { MenuItem } from "primereact/menuitem";
|
|
23
23
|
import { IconType } from "primereact/utils";
|
|
24
24
|
import { FormEvent } from "primereact/ts-helpers";
|
|
25
|
+
import * as react_hook_form0 from "react-hook-form";
|
|
26
|
+
import { ControllerFieldState, FieldPath, FieldValues, UseControllerReturn } from "react-hook-form";
|
|
25
27
|
|
|
26
28
|
//#region src/constants/app.d.ts
|
|
27
29
|
declare const VERSION: string;
|
|
@@ -56,7 +58,7 @@ declare const LabsCalendarBase: {
|
|
|
56
58
|
declare const LabsCalendar: <TMode extends CalendarSelectionMode = "single", TValue = (TMode extends "multiple" ? Date[] : TMode extends "range" ? (Date | null)[] : Date)>(props: LabsCalendarProps<TMode, TValue> & react.RefAttributes<Calendar<TMode, TValue>>) => React.ReactElement | null;
|
|
57
59
|
//#endregion
|
|
58
60
|
//#region src/components/LabsFieldContainer.d.ts
|
|
59
|
-
interface
|
|
61
|
+
interface LabsFieldContainerProps {
|
|
60
62
|
id: string;
|
|
61
63
|
containerId?: string;
|
|
62
64
|
labelId?: string;
|
|
@@ -69,7 +71,7 @@ interface FieldContainerProps {
|
|
|
69
71
|
className?: string;
|
|
70
72
|
children?: ReactNode;
|
|
71
73
|
}
|
|
72
|
-
declare const
|
|
74
|
+
declare const LabsFieldContainer: ({
|
|
73
75
|
id,
|
|
74
76
|
containerId,
|
|
75
77
|
labelId,
|
|
@@ -81,10 +83,10 @@ declare const FieldContainer: ({
|
|
|
81
83
|
animation,
|
|
82
84
|
children,
|
|
83
85
|
...rest
|
|
84
|
-
}:
|
|
86
|
+
}: LabsFieldContainerProps) => react_jsx_runtime0.JSX.Element;
|
|
85
87
|
//#endregion
|
|
86
88
|
//#region src/components/LabsCheckbox.d.ts
|
|
87
|
-
type FieldProps$6 = Partial<CheckboxProps> &
|
|
89
|
+
type FieldProps$6 = Partial<CheckboxProps> & LabsFieldContainerProps;
|
|
88
90
|
type LabsCheckboxProps = FieldProps$6;
|
|
89
91
|
declare const LabsCheckbox: {
|
|
90
92
|
(props: LabsCheckboxProps): react_jsx_runtime0.JSX.Element;
|
|
@@ -92,13 +94,13 @@ declare const LabsCheckbox: {
|
|
|
92
94
|
};
|
|
93
95
|
//#endregion
|
|
94
96
|
//#region src/components/LabsFieldContainerInput.d.ts
|
|
95
|
-
interface
|
|
97
|
+
interface LabsFieldContainerInputProps extends LabsFieldContainerProps {
|
|
96
98
|
solo?: boolean;
|
|
97
99
|
floatLabel?: boolean;
|
|
98
100
|
prependIcon?: string;
|
|
99
101
|
appendIcon?: string;
|
|
100
102
|
}
|
|
101
|
-
declare const
|
|
103
|
+
declare const LabsFieldContainerInput: ({
|
|
102
104
|
id,
|
|
103
105
|
containerId,
|
|
104
106
|
labelId,
|
|
@@ -114,10 +116,10 @@ declare const FieldContainerInput: ({
|
|
|
114
116
|
className,
|
|
115
117
|
children,
|
|
116
118
|
...rest
|
|
117
|
-
}:
|
|
119
|
+
}: LabsFieldContainerInputProps) => react_jsx_runtime0.JSX.Element;
|
|
118
120
|
//#endregion
|
|
119
121
|
//#region src/components/LabsDate.d.ts
|
|
120
|
-
type FieldProps$5<TMode extends CalendarSelectionMode = 'single', TValue = (TMode extends 'multiple' ? Date[] : TMode extends 'range' ? (Date | null)[] : Date)> = LabsCalendarProps<TMode, TValue> &
|
|
122
|
+
type FieldProps$5<TMode extends CalendarSelectionMode = 'single', TValue = (TMode extends 'multiple' ? Date[] : TMode extends 'range' ? (Date | null)[] : Date)> = LabsCalendarProps<TMode, TValue> & LabsFieldContainerInputProps;
|
|
121
123
|
type LabsDateProps<TMode extends CalendarSelectionMode = 'single', TValue = (TMode extends 'multiple' ? Date[] : TMode extends 'range' ? (Date | null)[] : Date)> = FieldProps$5<TMode, TValue>;
|
|
122
124
|
declare const LabsDate: <TMode extends CalendarSelectionMode = "single", TValue = (TMode extends "multiple" ? Date[] : TMode extends "range" ? (Date | null)[] : Date)>(props: LabsDateProps<TMode, TValue>) => react_jsx_runtime0.JSX.Element;
|
|
123
125
|
//#endregion
|
|
@@ -134,16 +136,32 @@ declare const LabsEmpty: ({
|
|
|
134
136
|
...rest
|
|
135
137
|
}: LabsEmptyProps) => react_jsx_runtime0.JSX.Element;
|
|
136
138
|
//#endregion
|
|
139
|
+
//#region src/components/LabsFieldContainerChoice.d.ts
|
|
140
|
+
type LabsFieldContainerChoiceProps = LabsFieldContainerProps;
|
|
141
|
+
declare const LabsFieldContainerChoice: ({
|
|
142
|
+
id,
|
|
143
|
+
containerId,
|
|
144
|
+
labelId,
|
|
145
|
+
messageId,
|
|
146
|
+
hintId,
|
|
147
|
+
label,
|
|
148
|
+
message,
|
|
149
|
+
hint,
|
|
150
|
+
className,
|
|
151
|
+
children,
|
|
152
|
+
...rest
|
|
153
|
+
}: LabsFieldContainerChoiceProps) => react_jsx_runtime0.JSX.Element;
|
|
154
|
+
//#endregion
|
|
137
155
|
//#region src/components/LabsFieldContainerHint.d.ts
|
|
138
156
|
type BaseProps = Omit<ComponentProps<typeof motion.span>, 'children'>;
|
|
139
|
-
interface
|
|
157
|
+
interface LabsFieldContainerHintProps extends BaseProps {
|
|
140
158
|
id: string;
|
|
141
159
|
hintId?: string;
|
|
142
160
|
hint?: string;
|
|
143
161
|
solo?: boolean;
|
|
144
162
|
children?: ReactNode;
|
|
145
163
|
}
|
|
146
|
-
declare const
|
|
164
|
+
declare const LabsFieldContainerHint: ({
|
|
147
165
|
id,
|
|
148
166
|
hintId,
|
|
149
167
|
hint,
|
|
@@ -151,16 +169,16 @@ declare const FieldContainerHint: ({
|
|
|
151
169
|
children,
|
|
152
170
|
className,
|
|
153
171
|
...rest
|
|
154
|
-
}:
|
|
172
|
+
}: LabsFieldContainerHintProps) => react_jsx_runtime0.JSX.Element | null;
|
|
155
173
|
//#endregion
|
|
156
174
|
//#region src/components/LabsFieldContainerLabel.d.ts
|
|
157
|
-
interface
|
|
175
|
+
interface LabsFieldContainerLabelProps extends ComponentProps<typeof motion.label> {
|
|
158
176
|
id: string;
|
|
159
177
|
labelId?: string;
|
|
160
178
|
label?: string;
|
|
161
179
|
solo?: boolean;
|
|
162
180
|
}
|
|
163
|
-
declare const
|
|
181
|
+
declare const LabsFieldContainerLabel: ({
|
|
164
182
|
id,
|
|
165
183
|
labelId,
|
|
166
184
|
label,
|
|
@@ -168,16 +186,16 @@ declare const FieldContainerLabel: ({
|
|
|
168
186
|
children,
|
|
169
187
|
className,
|
|
170
188
|
...rest
|
|
171
|
-
}:
|
|
189
|
+
}: LabsFieldContainerLabelProps) => react_jsx_runtime0.JSX.Element | null;
|
|
172
190
|
//#endregion
|
|
173
191
|
//#region src/components/LabsFieldContainerMessage.d.ts
|
|
174
|
-
interface
|
|
192
|
+
interface LabsFieldContainerMessageProps extends ComponentProps<typeof motion.span> {
|
|
175
193
|
id: string;
|
|
176
194
|
messageId?: string;
|
|
177
195
|
message?: string;
|
|
178
196
|
solo?: boolean;
|
|
179
197
|
}
|
|
180
|
-
declare const
|
|
198
|
+
declare const LabsFieldContainerMessage: ({
|
|
181
199
|
id,
|
|
182
200
|
messageId,
|
|
183
201
|
message,
|
|
@@ -185,7 +203,7 @@ declare const FieldContainerMessage: ({
|
|
|
185
203
|
children,
|
|
186
204
|
className,
|
|
187
205
|
...rest
|
|
188
|
-
}:
|
|
206
|
+
}: LabsFieldContainerMessageProps) => react_jsx_runtime0.JSX.Element;
|
|
189
207
|
//#endregion
|
|
190
208
|
//#region src/components/LabsLoader.d.ts
|
|
191
209
|
interface LabsLoaderProps extends ProgressSpinnerProps {
|
|
@@ -334,7 +352,7 @@ interface LabsMultiSelectOption<T = unknown> {
|
|
|
334
352
|
disabled?: boolean;
|
|
335
353
|
items?: LabsMultiSelectOption<T>[];
|
|
336
354
|
}
|
|
337
|
-
type FieldProps$4 = Partial<MultiSelectProps> &
|
|
355
|
+
type FieldProps$4 = Partial<MultiSelectProps> & LabsFieldContainerInputProps;
|
|
338
356
|
type LabsMultiSelectChangeEvent<TValue> = Omit<MultiSelectChangeEvent, 'value' | 'selectedOption'> & {
|
|
339
357
|
value: TValue[];
|
|
340
358
|
selectedOption: LabsMultiSelectOption<TValue>;
|
|
@@ -356,7 +374,7 @@ interface LabsSelectOption<T = unknown> {
|
|
|
356
374
|
disabled?: boolean;
|
|
357
375
|
items?: LabsSelectOption<T>[];
|
|
358
376
|
}
|
|
359
|
-
type FieldProps$3 = Partial<DropdownProps> &
|
|
377
|
+
type FieldProps$3 = Partial<DropdownProps> & LabsFieldContainerInputProps;
|
|
360
378
|
interface LabsSelectProps<TValue extends string | number> extends FieldProps$3 {
|
|
361
379
|
value?: TValue;
|
|
362
380
|
options?: LabsSelectOption<TValue>[];
|
|
@@ -374,7 +392,7 @@ interface LabsSelectCascadeOption<T = unknown> {
|
|
|
374
392
|
disabled?: boolean;
|
|
375
393
|
items?: LabsSelectCascadeOption<T>[];
|
|
376
394
|
}
|
|
377
|
-
type FieldProps$2 = Partial<CascadeSelectProps> &
|
|
395
|
+
type FieldProps$2 = Partial<CascadeSelectProps> & LabsFieldContainerInputProps;
|
|
378
396
|
type LabsSelectCascadeChangeEvent<TValue> = Omit<CascadeSelectChangeEvent, 'value'> & {
|
|
379
397
|
value: TValue;
|
|
380
398
|
};
|
|
@@ -386,24 +404,24 @@ interface LabsSelectCascadeProps<TValue extends string | number> extends FieldPr
|
|
|
386
404
|
declare const LabsSelectCascade: <TValue extends string | number>(props: LabsSelectCascadeProps<TValue>) => react_jsx_runtime0.JSX.Element;
|
|
387
405
|
//#endregion
|
|
388
406
|
//#region src/components/LabsText.d.ts
|
|
389
|
-
type FieldProps$1 = Partial<InputTextProps> &
|
|
407
|
+
type FieldProps$1 = Partial<InputTextProps> & LabsFieldContainerInputProps;
|
|
390
408
|
type LabsTextProps = FieldProps$1;
|
|
391
409
|
type LabsTextElement = HTMLInputElement;
|
|
392
|
-
declare const LabsText: react.ForwardRefExoticComponent<Partial<InputTextProps> &
|
|
410
|
+
declare const LabsText: react.ForwardRefExoticComponent<Partial<InputTextProps> & LabsFieldContainerInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
393
411
|
//#endregion
|
|
394
412
|
//#region src/components/LabsTextCurrency.d.ts
|
|
395
413
|
type LabsTextCurrencyProps = LabsTextProps;
|
|
396
|
-
declare const LabsTextCurrency: react.ForwardRefExoticComponent<Partial<primereact_inputtext0.InputTextProps> &
|
|
414
|
+
declare const LabsTextCurrency: react.ForwardRefExoticComponent<Partial<primereact_inputtext0.InputTextProps> & LabsFieldContainerInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
397
415
|
//#endregion
|
|
398
416
|
//#region src/components/LabsTextSearch.d.ts
|
|
399
417
|
type LabsTextSearchProps = LabsTextProps;
|
|
400
|
-
declare const LabsTextSearch: react.ForwardRefExoticComponent<Partial<primereact_inputtext0.InputTextProps> &
|
|
418
|
+
declare const LabsTextSearch: react.ForwardRefExoticComponent<Partial<primereact_inputtext0.InputTextProps> & LabsFieldContainerInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
401
419
|
//#endregion
|
|
402
420
|
//#region src/components/LabsTextarea.d.ts
|
|
403
|
-
type FieldProps = Partial<InputTextareaProps> &
|
|
421
|
+
type FieldProps = Partial<InputTextareaProps> & LabsFieldContainerInputProps;
|
|
404
422
|
type LabsTextareaProps = FieldProps;
|
|
405
423
|
type LabsTextareaElement = HTMLTextAreaElement;
|
|
406
|
-
declare const LabsTextarea: react.ForwardRefExoticComponent<Partial<InputTextareaProps> &
|
|
424
|
+
declare const LabsTextarea: react.ForwardRefExoticComponent<Partial<InputTextareaProps> & LabsFieldContainerInputProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
407
425
|
//#endregion
|
|
408
426
|
//#region src/components/LabsToggle.d.ts
|
|
409
427
|
interface LabsToggleProps {
|
|
@@ -20469,284 +20487,8 @@ declare const LabsPrimeProvider: ({
|
|
|
20469
20487
|
children
|
|
20470
20488
|
}: LabsPrimeProviderProps) => react_jsx_runtime0.JSX.Element;
|
|
20471
20489
|
//#endregion
|
|
20472
|
-
//#region ../../node_modules/react-hook-form/dist/types/path/common.d.ts
|
|
20473
|
-
/**
|
|
20474
|
-
* Type to query whether an array type T is a tuple type.
|
|
20475
|
-
* @typeParam T - type which may be an array or tuple
|
|
20476
|
-
* @example
|
|
20477
|
-
* ```
|
|
20478
|
-
* IsTuple<[number]> = true
|
|
20479
|
-
* IsTuple<number[]> = false
|
|
20480
|
-
* ```
|
|
20481
|
-
*/
|
|
20482
|
-
type IsTuple<T extends ReadonlyArray<any>> = number extends T['length'] ? false : true;
|
|
20483
|
-
/**
|
|
20484
|
-
* Type which can be used to index an array or tuple type.
|
|
20485
|
-
*/
|
|
20486
|
-
type ArrayKey = number;
|
|
20487
|
-
/**
|
|
20488
|
-
* Type which given a tuple type returns its own keys, i.e. only its indices.
|
|
20489
|
-
* @typeParam T - tuple type
|
|
20490
|
-
* @example
|
|
20491
|
-
* ```
|
|
20492
|
-
* TupleKeys<[number, string]> = '0' | '1'
|
|
20493
|
-
* ```
|
|
20494
|
-
*/
|
|
20495
|
-
type TupleKeys<T extends ReadonlyArray<any>> = Exclude<keyof T, keyof any[]>;
|
|
20496
|
-
//#endregion
|
|
20497
|
-
//#region ../../node_modules/react-hook-form/dist/types/path/eager.d.ts
|
|
20498
|
-
/**
|
|
20499
|
-
* Helper function to break apart T1 and check if any are equal to T2
|
|
20500
|
-
*
|
|
20501
|
-
* See {@link IsEqual}
|
|
20502
|
-
*/
|
|
20503
|
-
type AnyIsEqual<T1, T2> = T1 extends T2 ? IsEqual<T1, T2> extends true ? true : never : never;
|
|
20504
|
-
/**
|
|
20505
|
-
* Helper type for recursively constructing paths through a type.
|
|
20506
|
-
* This actually constructs the strings and recurses into nested
|
|
20507
|
-
* object types.
|
|
20508
|
-
*
|
|
20509
|
-
* See {@link Path}
|
|
20510
|
-
*/
|
|
20511
|
-
type PathImpl<K extends string | number, V, TraversedTypes> = V extends Primitive | BrowserNativeObject ? `${K}` : true extends AnyIsEqual<TraversedTypes, V> ? `${K}` : `${K}` | `${K}.${PathInternal<V, TraversedTypes | V>}`;
|
|
20512
|
-
/**
|
|
20513
|
-
* Helper type for recursively constructing paths through a type.
|
|
20514
|
-
* This obscures the internal type param TraversedTypes from exported contract.
|
|
20515
|
-
*
|
|
20516
|
-
* See {@link Path}
|
|
20517
|
-
*/
|
|
20518
|
-
type PathInternal<T, TraversedTypes = T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? { [K in TupleKeys<T>]-?: PathImpl<K & string, T[K], TraversedTypes> }[TupleKeys<T>] : PathImpl<ArrayKey, V, TraversedTypes> : { [K in keyof T]-?: PathImpl<K & string, T[K], TraversedTypes> }[keyof T];
|
|
20519
|
-
/**
|
|
20520
|
-
* Type which eagerly collects all paths through a type
|
|
20521
|
-
* @typeParam T - type which should be introspected
|
|
20522
|
-
* @example
|
|
20523
|
-
* ```
|
|
20524
|
-
* Path<{foo: {bar: string}}> = 'foo' | 'foo.bar'
|
|
20525
|
-
* ```
|
|
20526
|
-
*/
|
|
20527
|
-
type Path<T> = T extends any ? PathInternal<T> : never;
|
|
20528
|
-
/**
|
|
20529
|
-
* See {@link Path}
|
|
20530
|
-
*/
|
|
20531
|
-
type FieldPath<TFieldValues extends FieldValues> = Path<TFieldValues>;
|
|
20532
|
-
/**
|
|
20533
|
-
* Helper type for recursively constructing paths through a type.
|
|
20534
|
-
* This actually constructs the strings and recurses into nested
|
|
20535
|
-
* object types.
|
|
20536
|
-
*
|
|
20537
|
-
* See {@link ArrayPath}
|
|
20538
|
-
*/
|
|
20539
|
-
type ArrayPathImpl<K extends string | number, V, TraversedTypes> = V extends Primitive | BrowserNativeObject ? IsAny<V> extends true ? string : never : V extends ReadonlyArray<infer U> ? U extends Primitive | BrowserNativeObject ? IsAny<V> extends true ? string : never : true extends AnyIsEqual<TraversedTypes, V> ? never : `${K}` | `${K}.${ArrayPathInternal<V, TraversedTypes | V>}` : true extends AnyIsEqual<TraversedTypes, V> ? never : `${K}.${ArrayPathInternal<V, TraversedTypes | V>}`;
|
|
20540
|
-
/**
|
|
20541
|
-
* Helper type for recursively constructing paths through a type.
|
|
20542
|
-
* This obscures the internal type param TraversedTypes from exported contract.
|
|
20543
|
-
*
|
|
20544
|
-
* See {@link ArrayPath}
|
|
20545
|
-
*/
|
|
20546
|
-
type ArrayPathInternal<T, TraversedTypes = T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? { [K in TupleKeys<T>]-?: ArrayPathImpl<K & string, T[K], TraversedTypes> }[TupleKeys<T>] : ArrayPathImpl<ArrayKey, V, TraversedTypes> : { [K in keyof T]-?: ArrayPathImpl<K & string, T[K], TraversedTypes> }[keyof T];
|
|
20547
|
-
/**
|
|
20548
|
-
* Type which eagerly collects all paths through a type which point to an array
|
|
20549
|
-
* type.
|
|
20550
|
-
* @typeParam T - type which should be introspected.
|
|
20551
|
-
* @example
|
|
20552
|
-
* ```
|
|
20553
|
-
* Path<{foo: {bar: string[], baz: number[]}}> = 'foo.bar' | 'foo.baz'
|
|
20554
|
-
* ```
|
|
20555
|
-
*/
|
|
20556
|
-
type ArrayPath<T> = T extends any ? ArrayPathInternal<T> : never;
|
|
20557
|
-
/**
|
|
20558
|
-
* Type to evaluate the type which the given path points to.
|
|
20559
|
-
* @typeParam T - deeply nested type which is indexed by the path
|
|
20560
|
-
* @typeParam P - path into the deeply nested type
|
|
20561
|
-
* @example
|
|
20562
|
-
* ```
|
|
20563
|
-
* PathValue<{foo: {bar: string}}, 'foo.bar'> = string
|
|
20564
|
-
* PathValue<[number, string], '1'> = string
|
|
20565
|
-
* ```
|
|
20566
|
-
*/
|
|
20567
|
-
type PathValue<T, P extends Path<T> | ArrayPath<T>> = PathValueImpl<T, P>;
|
|
20568
|
-
type PathValueImpl<T, P extends string> = T extends any ? P extends `${infer K}.${infer R}` ? K extends keyof T ? undefined extends T[K] ? PathValueImpl<T[K], R> | undefined : PathValueImpl<T[K], R> : K extends `${ArrayKey}` ? T extends ReadonlyArray<infer V> ? PathValueImpl<V, R> : never : never : P extends keyof T ? T[P] : P extends `${ArrayKey}` ? T extends ReadonlyArray<infer V> ? V : T extends undefined ? undefined : never : never : never;
|
|
20569
|
-
/**
|
|
20570
|
-
* See {@link PathValue}
|
|
20571
|
-
*/
|
|
20572
|
-
type FieldPathValue<TFieldValues extends FieldValues, TFieldPath extends FieldPath<TFieldValues>> = PathValue<TFieldValues, TFieldPath>;
|
|
20573
|
-
//#endregion
|
|
20574
|
-
//#region ../../node_modules/react-hook-form/dist/types/form.d.ts
|
|
20575
|
-
declare const $NestedValue: unique symbol;
|
|
20576
|
-
/**
|
|
20577
|
-
* @deprecated to be removed in the next major version
|
|
20578
|
-
*/
|
|
20579
|
-
type NestedValue<TValue extends object = object> = {
|
|
20580
|
-
[$NestedValue]: never;
|
|
20581
|
-
} & TValue;
|
|
20582
|
-
type FieldNamesMarkedBoolean<TFieldValues extends FieldValues> = DeepMap<DeepPartial<TFieldValues>, boolean>;
|
|
20583
|
-
type FormState<TFieldValues extends FieldValues> = {
|
|
20584
|
-
isDirty: boolean;
|
|
20585
|
-
isLoading: boolean;
|
|
20586
|
-
isSubmitted: boolean;
|
|
20587
|
-
isSubmitSuccessful: boolean;
|
|
20588
|
-
isSubmitting: boolean;
|
|
20589
|
-
isValidating: boolean;
|
|
20590
|
-
isValid: boolean;
|
|
20591
|
-
disabled: boolean;
|
|
20592
|
-
submitCount: number;
|
|
20593
|
-
defaultValues?: undefined | Readonly<DeepPartial<TFieldValues>>;
|
|
20594
|
-
dirtyFields: Partial<Readonly<FieldNamesMarkedBoolean<TFieldValues>>>;
|
|
20595
|
-
touchedFields: Partial<Readonly<FieldNamesMarkedBoolean<TFieldValues>>>;
|
|
20596
|
-
validatingFields: Partial<Readonly<FieldNamesMarkedBoolean<TFieldValues>>>;
|
|
20597
|
-
errors: FieldErrors<TFieldValues>;
|
|
20598
|
-
isReady: boolean;
|
|
20599
|
-
};
|
|
20600
|
-
type RefCallBack = (instance: any) => void;
|
|
20601
|
-
type UseFormStateReturn<TFieldValues extends FieldValues> = FormState<TFieldValues>;
|
|
20602
|
-
//#endregion
|
|
20603
|
-
//#region ../../node_modules/react-hook-form/dist/types/utils.d.ts
|
|
20604
|
-
type Noop = () => void;
|
|
20605
|
-
interface File extends Blob {
|
|
20606
|
-
readonly lastModified: number;
|
|
20607
|
-
readonly name: string;
|
|
20608
|
-
}
|
|
20609
|
-
interface FileList$1 {
|
|
20610
|
-
readonly length: number;
|
|
20611
|
-
item(index: number): File | null;
|
|
20612
|
-
[index: number]: File;
|
|
20613
|
-
}
|
|
20614
|
-
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
20615
|
-
type BrowserNativeObject = Date | FileList$1 | File;
|
|
20616
|
-
type NonUndefined<T> = T extends undefined ? never : T;
|
|
20617
|
-
type LiteralUnion<T extends U, U extends Primitive> = T | (U & {
|
|
20618
|
-
_?: never;
|
|
20619
|
-
});
|
|
20620
|
-
type ExtractObjects<T> = T extends infer U ? U extends object ? U : never : never;
|
|
20621
|
-
type IsPrimitiveLike<T> = T extends Primitive ? true : T extends Primitive & object ? true : false;
|
|
20622
|
-
type DeepPartial<T> = IsPrimitiveLike<T> extends true ? T : T extends BrowserNativeObject | NestedValue ? T : { [K in keyof T]?: ExtractObjects<T[K]> extends never ? T[K] : DeepPartial<T[K]> };
|
|
20623
|
-
/**
|
|
20624
|
-
* Checks whether the type is any
|
|
20625
|
-
* See {@link https://stackoverflow.com/a/49928360/3406963}
|
|
20626
|
-
* @typeParam T - type which may be any
|
|
20627
|
-
* ```
|
|
20628
|
-
* IsAny<any> = true
|
|
20629
|
-
* IsAny<string> = false
|
|
20630
|
-
* ```
|
|
20631
|
-
*/
|
|
20632
|
-
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
20633
|
-
/**
|
|
20634
|
-
* Checks whether T1 can be exactly (mutually) assigned to T2
|
|
20635
|
-
* @typeParam T1 - type to check
|
|
20636
|
-
* @typeParam T2 - type to check against
|
|
20637
|
-
* ```
|
|
20638
|
-
* IsEqual<string, string> = true
|
|
20639
|
-
* IsEqual<'foo', 'foo'> = true
|
|
20640
|
-
* IsEqual<string, number> = false
|
|
20641
|
-
* IsEqual<string, number> = false
|
|
20642
|
-
* IsEqual<string, 'foo'> = false
|
|
20643
|
-
* IsEqual<'foo', string> = false
|
|
20644
|
-
* IsEqual<'foo' | 'bar', 'foo'> = boolean // 'foo' is assignable, but 'bar' is not (true | false) -> boolean
|
|
20645
|
-
* ```
|
|
20646
|
-
*/
|
|
20647
|
-
type IsEqual<T1, T2> = T1 extends T2 ? (<G>() => G extends T1 ? 1 : 2) extends (<G>() => G extends T2 ? 1 : 2) ? true : false : false;
|
|
20648
|
-
type DeepMap<T, TValue> = IsAny<T> extends true ? any : T extends BrowserNativeObject | NestedValue ? TValue : T extends object ? { [K in keyof T]: DeepMap<NonUndefined<T[K]>, TValue> } : TValue;
|
|
20649
|
-
type IsFlatObject<T extends object> = Extract<Exclude<T[keyof T], NestedValue | Date | FileList$1>, any[] | object> extends never ? true : false;
|
|
20650
|
-
type Merge<A, B> = { [K in keyof A | keyof B]?: K extends keyof A & keyof B ? [A[K], B[K]] extends [object, object] ? Merge<A[K], B[K]> : B[K] : K extends keyof A ? A[K] : K extends keyof B ? B[K] : never };
|
|
20651
|
-
//#endregion
|
|
20652
|
-
//#region ../../node_modules/react-hook-form/dist/types/fields.d.ts
|
|
20653
|
-
type FieldName<TFieldValues extends FieldValues> = IsFlatObject<TFieldValues> extends true ? Extract<keyof TFieldValues, string> : string;
|
|
20654
|
-
type CustomElement<TFieldValues extends FieldValues> = Partial<HTMLElement> & {
|
|
20655
|
-
name: FieldName<TFieldValues>;
|
|
20656
|
-
type?: string;
|
|
20657
|
-
value?: any;
|
|
20658
|
-
disabled?: boolean;
|
|
20659
|
-
checked?: boolean;
|
|
20660
|
-
options?: HTMLOptionsCollection;
|
|
20661
|
-
files?: FileList | null;
|
|
20662
|
-
focus?: Noop;
|
|
20663
|
-
};
|
|
20664
|
-
type FieldValues = Record<string, any>;
|
|
20665
|
-
type FieldElement<TFieldValues extends FieldValues = FieldValues> = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | CustomElement<TFieldValues>;
|
|
20666
|
-
type Ref = FieldElement;
|
|
20667
|
-
//#endregion
|
|
20668
|
-
//#region ../../node_modules/react-hook-form/dist/types/errors.d.ts
|
|
20669
|
-
type Message = string;
|
|
20670
|
-
type MultipleFieldErrors = { [K in keyof RegisterOptions]?: ValidateResult } & {
|
|
20671
|
-
[key: string]: ValidateResult;
|
|
20672
|
-
};
|
|
20673
|
-
type FieldError = {
|
|
20674
|
-
type: LiteralUnion<keyof RegisterOptions, string>;
|
|
20675
|
-
root?: FieldError;
|
|
20676
|
-
ref?: Ref;
|
|
20677
|
-
types?: MultipleFieldErrors;
|
|
20678
|
-
message?: Message;
|
|
20679
|
-
};
|
|
20680
|
-
type DeepRequired<T> = T extends BrowserNativeObject | Blob ? T : { [K in keyof T]-?: NonNullable<DeepRequired<T[K]>> };
|
|
20681
|
-
type FieldErrorsImpl<T extends FieldValues = FieldValues> = { [K in keyof T]?: T[K] extends BrowserNativeObject | Blob ? FieldError : K extends 'root' | `root.${string}` ? GlobalError : T[K] extends object ? Merge<FieldError, FieldErrorsImpl<T[K]>> : FieldError };
|
|
20682
|
-
type GlobalError = Partial<{
|
|
20683
|
-
type: string | number;
|
|
20684
|
-
message: Message;
|
|
20685
|
-
}>;
|
|
20686
|
-
type FieldErrors<T extends FieldValues = FieldValues> = Partial<FieldValues extends IsAny<FieldValues> ? any : FieldErrorsImpl<DeepRequired<T>>> & {
|
|
20687
|
-
root?: Record<string, GlobalError> & GlobalError;
|
|
20688
|
-
};
|
|
20689
|
-
//#endregion
|
|
20690
|
-
//#region ../../node_modules/react-hook-form/dist/types/validator.d.ts
|
|
20691
|
-
type ValidationValue = boolean | number | string | RegExp;
|
|
20692
|
-
type ValidationRule<TValidationValue extends ValidationValue = ValidationValue> = TValidationValue | ValidationValueMessage<TValidationValue>;
|
|
20693
|
-
type ValidationValueMessage<TValidationValue extends ValidationValue = ValidationValue> = {
|
|
20694
|
-
value: TValidationValue;
|
|
20695
|
-
message: Message;
|
|
20696
|
-
};
|
|
20697
|
-
type ValidateResult = Message | Message[] | boolean | undefined;
|
|
20698
|
-
type Validate<TFieldValue, TFormValues> = (value: TFieldValue, formValues: TFormValues) => ValidateResult | Promise<ValidateResult>;
|
|
20699
|
-
type RegisterOptions<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Partial<{
|
|
20700
|
-
required: Message | ValidationRule<boolean>;
|
|
20701
|
-
min: ValidationRule<number | string>;
|
|
20702
|
-
max: ValidationRule<number | string>;
|
|
20703
|
-
maxLength: ValidationRule<number>;
|
|
20704
|
-
minLength: ValidationRule<number>;
|
|
20705
|
-
validate: Validate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues> | Record<string, Validate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues>>;
|
|
20706
|
-
value: FieldPathValue<TFieldValues, TFieldName>;
|
|
20707
|
-
setValueAs: (value: any) => any;
|
|
20708
|
-
shouldUnregister?: boolean;
|
|
20709
|
-
onChange?: (event: any) => void;
|
|
20710
|
-
onBlur?: (event: any) => void;
|
|
20711
|
-
disabled: boolean;
|
|
20712
|
-
deps: FieldPath<TFieldValues> | FieldPath<TFieldValues>[];
|
|
20713
|
-
}> & ({
|
|
20714
|
-
pattern?: ValidationRule<RegExp>;
|
|
20715
|
-
valueAsNumber?: false;
|
|
20716
|
-
valueAsDate?: false;
|
|
20717
|
-
} | {
|
|
20718
|
-
pattern?: undefined;
|
|
20719
|
-
valueAsNumber?: false;
|
|
20720
|
-
valueAsDate?: true;
|
|
20721
|
-
} | {
|
|
20722
|
-
pattern?: undefined;
|
|
20723
|
-
valueAsNumber?: true;
|
|
20724
|
-
valueAsDate?: false;
|
|
20725
|
-
});
|
|
20726
|
-
//#endregion
|
|
20727
|
-
//#region ../../node_modules/react-hook-form/dist/types/controller.d.ts
|
|
20728
|
-
type ControllerFieldState = {
|
|
20729
|
-
invalid: boolean;
|
|
20730
|
-
isTouched: boolean;
|
|
20731
|
-
isDirty: boolean;
|
|
20732
|
-
isValidating: boolean;
|
|
20733
|
-
error?: FieldError;
|
|
20734
|
-
};
|
|
20735
|
-
type ControllerRenderProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
|
20736
|
-
onChange: (...event: any[]) => void;
|
|
20737
|
-
onBlur: Noop;
|
|
20738
|
-
value: FieldPathValue<TFieldValues, TName>;
|
|
20739
|
-
disabled?: boolean;
|
|
20740
|
-
name: TName;
|
|
20741
|
-
ref: RefCallBack;
|
|
20742
|
-
};
|
|
20743
|
-
//#endregion
|
|
20744
20490
|
//#region src/types/ReactHookForm.type.d.ts
|
|
20745
|
-
type ControllerRenderParams<TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>> =
|
|
20746
|
-
field: ControllerRenderProps<TValues, TName>;
|
|
20747
|
-
fieldState: ControllerFieldState;
|
|
20748
|
-
formState: UseFormStateReturn<TValues>;
|
|
20749
|
-
};
|
|
20491
|
+
type ControllerRenderParams<TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>> = Pick<UseControllerReturn<TValues, TName>, 'field' | 'fieldState' | 'formState'>;
|
|
20750
20492
|
//#endregion
|
|
20751
20493
|
//#region src/utils/animations.d.ts
|
|
20752
20494
|
declare const DEFAULT_TRANSITION_MS = 100;
|
|
@@ -20902,11 +20644,11 @@ declare const toLabsCheckboxProps: <TValues extends FieldValues = FieldValues, T
|
|
|
20902
20644
|
},
|
|
20903
20645
|
fieldState
|
|
20904
20646
|
}: ControllerRenderParams<TValues, TName>) => {
|
|
20905
|
-
inputRef: RefCallBack;
|
|
20647
|
+
inputRef: react_hook_form0.RefCallBack;
|
|
20906
20648
|
checked: TValues[TName];
|
|
20907
20649
|
onChange: (event: primereact_checkbox0.CheckboxChangeEvent) => void;
|
|
20908
20650
|
message: string | undefined;
|
|
20909
|
-
onBlur: Noop;
|
|
20651
|
+
onBlur: react_hook_form0.Noop;
|
|
20910
20652
|
disabled?: boolean;
|
|
20911
20653
|
name: TName;
|
|
20912
20654
|
};
|
|
@@ -20918,11 +20660,11 @@ declare const toLabsDateProps: <TValues extends FieldValues = FieldValues, TName
|
|
|
20918
20660
|
},
|
|
20919
20661
|
fieldState
|
|
20920
20662
|
}: ControllerRenderParams<TValues, TName>) => {
|
|
20921
|
-
inputRef: RefCallBack;
|
|
20663
|
+
inputRef: react_hook_form0.RefCallBack;
|
|
20922
20664
|
value: TValues[TName];
|
|
20923
20665
|
onChange: (event: FormEvent<TValues[TName]>) => void;
|
|
20924
20666
|
message: string | undefined;
|
|
20925
|
-
onBlur: Noop;
|
|
20667
|
+
onBlur: react_hook_form0.Noop;
|
|
20926
20668
|
disabled?: boolean;
|
|
20927
20669
|
name: TName;
|
|
20928
20670
|
};
|
|
@@ -20934,11 +20676,11 @@ declare const toLabsMultiSelectProps: <TValues extends FieldValues = FieldValues
|
|
|
20934
20676
|
},
|
|
20935
20677
|
fieldState
|
|
20936
20678
|
}: ControllerRenderParams<TValues, TName>) => {
|
|
20937
|
-
inputRef: RefCallBack;
|
|
20679
|
+
inputRef: react_hook_form0.RefCallBack;
|
|
20938
20680
|
value: TValues[TName];
|
|
20939
20681
|
onChange: (event: LabsMultiSelectChangeEvent<TValues[TName][number]>) => void;
|
|
20940
20682
|
message: string | undefined;
|
|
20941
|
-
onBlur: Noop;
|
|
20683
|
+
onBlur: react_hook_form0.Noop;
|
|
20942
20684
|
disabled?: boolean;
|
|
20943
20685
|
name: TName;
|
|
20944
20686
|
};
|
|
@@ -20950,11 +20692,11 @@ declare const toLabsSelectProps: <TValues extends FieldValues = FieldValues, TNa
|
|
|
20950
20692
|
},
|
|
20951
20693
|
fieldState
|
|
20952
20694
|
}: ControllerRenderParams<TValues, TName>) => {
|
|
20953
|
-
inputRef: RefCallBack;
|
|
20695
|
+
inputRef: react_hook_form0.RefCallBack;
|
|
20954
20696
|
value: TValues[TName];
|
|
20955
20697
|
onChange: (event: FormEvent<TValues[TName], react.SyntheticEvent<Element, Event>>) => void;
|
|
20956
20698
|
message: string | undefined;
|
|
20957
|
-
onBlur: Noop;
|
|
20699
|
+
onBlur: react_hook_form0.Noop;
|
|
20958
20700
|
disabled?: boolean;
|
|
20959
20701
|
name: TName;
|
|
20960
20702
|
};
|
|
@@ -20966,13 +20708,13 @@ declare const toLabsSelectCascadeProps: <TValues extends FieldValues = FieldValu
|
|
|
20966
20708
|
},
|
|
20967
20709
|
fieldState
|
|
20968
20710
|
}: ControllerRenderParams<TValues, TName>) => {
|
|
20969
|
-
inputRef: RefCallBack;
|
|
20711
|
+
inputRef: react_hook_form0.RefCallBack;
|
|
20970
20712
|
value: TValues[TName];
|
|
20971
20713
|
onChange: (event: Omit<primereact_cascadeselect0.CascadeSelectChangeEvent, "value"> & {
|
|
20972
20714
|
value: TValues[TName];
|
|
20973
20715
|
}) => void;
|
|
20974
20716
|
message: string | undefined;
|
|
20975
|
-
onBlur: Noop;
|
|
20717
|
+
onBlur: react_hook_form0.Noop;
|
|
20976
20718
|
disabled?: boolean;
|
|
20977
20719
|
name: TName;
|
|
20978
20720
|
};
|
|
@@ -20984,11 +20726,11 @@ declare const toLabsTextProps: <TValues extends FieldValues = FieldValues, TName
|
|
|
20984
20726
|
},
|
|
20985
20727
|
fieldState
|
|
20986
20728
|
}: ControllerRenderParams<TValues, TName>) => {
|
|
20987
|
-
ref: RefCallBack;
|
|
20729
|
+
ref: react_hook_form0.RefCallBack;
|
|
20988
20730
|
value: TValues[TName];
|
|
20989
20731
|
message: string | undefined;
|
|
20990
20732
|
onChange: (...event: any[]) => void;
|
|
20991
|
-
onBlur: Noop;
|
|
20733
|
+
onBlur: react_hook_form0.Noop;
|
|
20992
20734
|
disabled?: boolean;
|
|
20993
20735
|
name: TName;
|
|
20994
20736
|
};
|
|
@@ -21000,11 +20742,11 @@ declare const toLabsTextCurrencyProps: <TValues extends FieldValues = FieldValue
|
|
|
21000
20742
|
},
|
|
21001
20743
|
fieldState
|
|
21002
20744
|
}: ControllerRenderParams<TValues, TName>) => {
|
|
21003
|
-
ref: RefCallBack;
|
|
20745
|
+
ref: react_hook_form0.RefCallBack;
|
|
21004
20746
|
value: TValues[TName];
|
|
21005
20747
|
message: string | undefined;
|
|
21006
20748
|
onChange: (...event: any[]) => void;
|
|
21007
|
-
onBlur: Noop;
|
|
20749
|
+
onBlur: react_hook_form0.Noop;
|
|
21008
20750
|
disabled?: boolean;
|
|
21009
20751
|
name: TName;
|
|
21010
20752
|
};
|
|
@@ -21016,11 +20758,11 @@ declare const toLabsTextSearchProps: <TValues extends FieldValues = FieldValues,
|
|
|
21016
20758
|
},
|
|
21017
20759
|
fieldState
|
|
21018
20760
|
}: ControllerRenderParams<TValues, TName>) => {
|
|
21019
|
-
ref: RefCallBack;
|
|
20761
|
+
ref: react_hook_form0.RefCallBack;
|
|
21020
20762
|
value: TValues[TName];
|
|
21021
20763
|
message: string | undefined;
|
|
21022
20764
|
onChange: (...event: any[]) => void;
|
|
21023
|
-
onBlur: Noop;
|
|
20765
|
+
onBlur: react_hook_form0.Noop;
|
|
21024
20766
|
disabled?: boolean;
|
|
21025
20767
|
name: TName;
|
|
21026
20768
|
};
|
|
@@ -21032,13 +20774,13 @@ declare const toLabsTextareaProps: <TValues extends FieldValues = FieldValues, T
|
|
|
21032
20774
|
},
|
|
21033
20775
|
fieldState
|
|
21034
20776
|
}: ControllerRenderParams<TValues, TName>) => {
|
|
21035
|
-
ref: RefCallBack;
|
|
20777
|
+
ref: react_hook_form0.RefCallBack;
|
|
21036
20778
|
value: TValues[TName];
|
|
21037
20779
|
message: string | undefined;
|
|
21038
20780
|
onChange: (...event: any[]) => void;
|
|
21039
|
-
onBlur: Noop;
|
|
20781
|
+
onBlur: react_hook_form0.Noop;
|
|
21040
20782
|
disabled?: boolean;
|
|
21041
20783
|
name: TName;
|
|
21042
20784
|
};
|
|
21043
20785
|
//#endregion
|
|
21044
|
-
export { ControllerRenderParams, DEFAULT_TRANSITION, DEFAULT_TRANSITION_MS, DEFAULT_TRANSITION_SECONDS, DirectoryValueBase,
|
|
20786
|
+
export { ControllerRenderParams, DEFAULT_TRANSITION, DEFAULT_TRANSITION_MS, DEFAULT_TRANSITION_SECONDS, DirectoryValueBase, KeycloakUser, LABS_MAIN_ID, LabsAnalyticsContext, LabsAnalyticsInstance, LabsAnalyticsProvider, LabsAnalyticsProviderProps, LabsAuthContext, LabsAuthContextValue, LabsAuthGate, LabsAuthGateProps, LabsAuthProvider, LabsAuthProviderProps, LabsButton, LabsButtonProps, LabsCalendar, LabsCalendarBase, LabsCalendarProps, LabsCheckbox, LabsCheckboxProps, LabsContext, LabsContextValue, LabsDate, LabsDateProps, LabsEmpty, LabsEmptyProps, LabsFieldContainer, LabsFieldContainerChoice, LabsFieldContainerChoiceProps, LabsFieldContainerHint, LabsFieldContainerHintProps, LabsFieldContainerInput, LabsFieldContainerInputProps, LabsFieldContainerLabel, LabsFieldContainerLabelProps, LabsFieldContainerMessage, LabsFieldContainerMessageProps, LabsFieldContainerProps, LabsHeadProvider, LabsHeadProviderProps, LabsLoader, LabsLoaderProps, LabsLogoutTimer, LabsLogoutTimerProps, LabsMain, LabsMainDesktopNav, LabsMainDesktopNavProps, LabsMainHeader, LabsMainHeaderActions, LabsMainHeaderProps, LabsMainMobileNav, LabsMainMobileNavProps, LabsMainProps, LabsMenuNav, LabsMenuNavProps, LabsMultiSelect, LabsMultiSelectChangeEvent, LabsMultiSelectOption, LabsMultiSelectProps, LabsPrimeProvider, LabsPrimeProviderProps, LabsProvider, LabsProviderProps, LabsSelect, LabsSelectCascade, LabsSelectCascadeOption, LabsSelectCascadeProps, LabsSelectOption, LabsSelectProps, LabsSpeedDialNav, LabsSpeedDialNavProps, LabsText, LabsTextCurrency, LabsTextCurrencyProps, LabsTextElement, LabsTextProps, LabsTextSearch, LabsTextSearchProps, LabsTextarea, LabsTextareaElement, LabsTextareaProps, LabsToggle, LabsToggleProps, LayoutBase, LayoutBaseProps, LayoutCentered, LayoutCenteredProps, LayoutMain, LayoutMainProps, Role, VERSION, auth, fadeAnimation, getParsedUserInfo, pluralize, refreshToken, scaleFadeAnimation, scaleFadeSubtleAnimation, slideYFadeAnimation, slideYFadeReverseAnimation, toCurrency, toFieldContainerProps, toLabsCheckboxProps, toLabsDateProps, toLabsMultiSelectProps, toLabsSelectCascadeProps, toLabsSelectProps, toLabsTextCurrencyProps, toLabsTextProps, toLabsTextSearchProps, toLabsTextareaProps, toPrecision, useAnalytics, useAuth, useBreakpoints, useLabs, withAuthHeader };
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ import { InputTextarea } from "primereact/inputtextarea";
|
|
|
29
29
|
import { Panel } from "primereact/panel";
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/constants/app.ts
|
|
32
|
-
const VERSION = "7.
|
|
32
|
+
const VERSION = "7.4.0";
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/lib/head/headContext.tsx
|
|
35
35
|
const head = createHead();
|
|
@@ -353,7 +353,7 @@ const toFieldSharedProps = (fieldProps) => {
|
|
|
353
353
|
};
|
|
354
354
|
//#endregion
|
|
355
355
|
//#region src/components/LabsFieldContainerHint.tsx
|
|
356
|
-
const
|
|
356
|
+
const LabsFieldContainerHint = ({ id, hintId = `${id}-hint`, hint, solo = false, children = hint, className, ...rest }) => {
|
|
357
357
|
if (!children) return null;
|
|
358
358
|
return /* @__PURE__ */ jsx(motion.span, {
|
|
359
359
|
id: hintId,
|
|
@@ -364,7 +364,7 @@ const FieldContainerHint = ({ id, hintId = `${id}-hint`, hint, solo = false, chi
|
|
|
364
364
|
};
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region src/components/LabsFieldContainerLabel.tsx
|
|
367
|
-
const
|
|
367
|
+
const LabsFieldContainerLabel = ({ id, labelId = `${id}-label`, label, solo = false, children = label, className, ...rest }) => {
|
|
368
368
|
if (!children) return null;
|
|
369
369
|
return /* @__PURE__ */ jsx(motion.label, {
|
|
370
370
|
id: labelId,
|
|
@@ -499,7 +499,7 @@ const scaleFadeSubtleAnimation = {
|
|
|
499
499
|
};
|
|
500
500
|
//#endregion
|
|
501
501
|
//#region src/components/LabsFieldContainerMessage.tsx
|
|
502
|
-
const
|
|
502
|
+
const LabsFieldContainerMessage = ({ id, messageId = `${id}-message`, message, solo = false, children = message, className, ...rest }) => {
|
|
503
503
|
return /* @__PURE__ */ jsx(AnimatePresence, {
|
|
504
504
|
mode: "wait",
|
|
505
505
|
children: children ? /* @__PURE__ */ jsx(motion.span, {
|
|
@@ -515,26 +515,26 @@ const FieldContainerMessage = ({ id, messageId = `${id}-message`, message, solo
|
|
|
515
515
|
};
|
|
516
516
|
//#endregion
|
|
517
517
|
//#region src/components/LabsFieldContainer.tsx
|
|
518
|
-
const
|
|
518
|
+
const LabsFieldContainer = ({ id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, children, ...rest }) => {
|
|
519
519
|
return /* @__PURE__ */ jsxs(motion.div, {
|
|
520
520
|
id: containerId,
|
|
521
521
|
...animation,
|
|
522
522
|
...rest,
|
|
523
523
|
children: [
|
|
524
|
-
/* @__PURE__ */ jsx(
|
|
524
|
+
/* @__PURE__ */ jsx(LabsFieldContainerLabel, {
|
|
525
525
|
id,
|
|
526
526
|
labelId,
|
|
527
527
|
label,
|
|
528
528
|
className: "text-xs block"
|
|
529
529
|
}),
|
|
530
530
|
children,
|
|
531
|
-
/* @__PURE__ */ jsx(
|
|
531
|
+
/* @__PURE__ */ jsx(LabsFieldContainerMessage, {
|
|
532
532
|
id,
|
|
533
533
|
messageId,
|
|
534
534
|
message,
|
|
535
535
|
className: "text-xs block"
|
|
536
536
|
}),
|
|
537
|
-
!message && /* @__PURE__ */ jsx(
|
|
537
|
+
!message && /* @__PURE__ */ jsx(LabsFieldContainerHint, {
|
|
538
538
|
id,
|
|
539
539
|
hintId,
|
|
540
540
|
hint,
|
|
@@ -547,7 +547,7 @@ const FieldContainer = ({ id, containerId = `${id}-container`, labelId = `${id}-
|
|
|
547
547
|
//#region src/components/LabsCheckbox.tsx
|
|
548
548
|
const LabsCheckbox = (props) => {
|
|
549
549
|
const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, className, checked = false, ...rest } = props;
|
|
550
|
-
return /* @__PURE__ */ jsxs(
|
|
550
|
+
return /* @__PURE__ */ jsxs(LabsFieldContainer, {
|
|
551
551
|
id,
|
|
552
552
|
containerId,
|
|
553
553
|
labelId,
|
|
@@ -564,7 +564,7 @@ const LabsCheckbox = (props) => {
|
|
|
564
564
|
inputId: id,
|
|
565
565
|
"aria-describedby": messageId,
|
|
566
566
|
className: "shrink"
|
|
567
|
-
}), /* @__PURE__ */ jsx(
|
|
567
|
+
}), /* @__PURE__ */ jsx(LabsFieldContainerLabel, {
|
|
568
568
|
id,
|
|
569
569
|
labelId,
|
|
570
570
|
label,
|
|
@@ -575,8 +575,8 @@ const LabsCheckbox = (props) => {
|
|
|
575
575
|
LabsCheckbox.displayName = "LabsCheckbox";
|
|
576
576
|
//#endregion
|
|
577
577
|
//#region src/components/LabsFieldContainerInput.tsx
|
|
578
|
-
const
|
|
579
|
-
return /* @__PURE__ */ jsxs(
|
|
578
|
+
const LabsFieldContainerInput = ({ id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, solo = false, floatLabel = false, prependIcon, appendIcon, className, children, ...rest }) => {
|
|
579
|
+
return /* @__PURE__ */ jsxs(LabsFieldContainer, {
|
|
580
580
|
id,
|
|
581
581
|
containerId,
|
|
582
582
|
labelId,
|
|
@@ -585,7 +585,7 @@ const FieldContainerInput = ({ id, containerId = `${id}-container`, labelId = `$
|
|
|
585
585
|
className: clsx(className, "flex flex-col gap-1"),
|
|
586
586
|
...rest,
|
|
587
587
|
children: [
|
|
588
|
-
!floatLabel && /* @__PURE__ */ jsx(
|
|
588
|
+
!floatLabel && /* @__PURE__ */ jsx(LabsFieldContainerLabel, {
|
|
589
589
|
id,
|
|
590
590
|
labelId,
|
|
591
591
|
label,
|
|
@@ -600,24 +600,24 @@ const FieldContainerInput = ({ id, containerId = `${id}-container`, labelId = `$
|
|
|
600
600
|
"p-icon-field-right": !!appendIcon
|
|
601
601
|
}),
|
|
602
602
|
children: [
|
|
603
|
+
children,
|
|
603
604
|
prependIcon && /* @__PURE__ */ jsx("i", { className: `${prependIcon} p-input-icon` }),
|
|
604
605
|
appendIcon && /* @__PURE__ */ jsx("i", { className: `${appendIcon} p-input-icon` }),
|
|
605
|
-
|
|
606
|
-
floatLabel && /* @__PURE__ */ jsx(FieldContainerLabel, {
|
|
606
|
+
floatLabel && /* @__PURE__ */ jsx(LabsFieldContainerLabel, {
|
|
607
607
|
id,
|
|
608
608
|
labelId,
|
|
609
609
|
label
|
|
610
610
|
})
|
|
611
611
|
]
|
|
612
612
|
}),
|
|
613
|
-
/* @__PURE__ */ jsx(
|
|
613
|
+
/* @__PURE__ */ jsx(LabsFieldContainerMessage, {
|
|
614
614
|
id,
|
|
615
615
|
messageId,
|
|
616
616
|
message,
|
|
617
617
|
solo,
|
|
618
618
|
className: "text-xs"
|
|
619
619
|
}),
|
|
620
|
-
!message && /* @__PURE__ */ jsx(
|
|
620
|
+
!message && /* @__PURE__ */ jsx(LabsFieldContainerHint, {
|
|
621
621
|
id,
|
|
622
622
|
hintId,
|
|
623
623
|
hint,
|
|
@@ -631,7 +631,7 @@ const FieldContainerInput = ({ id, containerId = `${id}-container`, labelId = `$
|
|
|
631
631
|
//#region src/components/LabsDate.tsx
|
|
632
632
|
const LabsDate = (props) => {
|
|
633
633
|
const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, solo, floatLabel, prependIcon, appendIcon, className, ...rest } = props;
|
|
634
|
-
return /* @__PURE__ */ jsx(
|
|
634
|
+
return /* @__PURE__ */ jsx(LabsFieldContainerInput, {
|
|
635
635
|
id,
|
|
636
636
|
containerId,
|
|
637
637
|
labelId,
|
|
@@ -671,6 +671,42 @@ const LabsEmpty = ({ text, className, icon, children, ...rest }) => {
|
|
|
671
671
|
});
|
|
672
672
|
};
|
|
673
673
|
//#endregion
|
|
674
|
+
//#region src/components/LabsFieldContainerChoice.tsx
|
|
675
|
+
const LabsFieldContainerChoice = ({ id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, className, children, ...rest }) => {
|
|
676
|
+
return /* @__PURE__ */ jsxs(LabsFieldContainer, {
|
|
677
|
+
id,
|
|
678
|
+
containerId,
|
|
679
|
+
labelId,
|
|
680
|
+
messageId,
|
|
681
|
+
hintId,
|
|
682
|
+
className: clsx(className, "flex flex-col gap-1"),
|
|
683
|
+
...rest,
|
|
684
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
685
|
+
className: "flex gap-8 items-center",
|
|
686
|
+
children: [children, /* @__PURE__ */ jsxs(LabsFieldContainerLabel, {
|
|
687
|
+
id,
|
|
688
|
+
labelId,
|
|
689
|
+
label,
|
|
690
|
+
className: "flex flex-col gap-1",
|
|
691
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
692
|
+
className: "font-semibold",
|
|
693
|
+
children: label
|
|
694
|
+
}), /* @__PURE__ */ jsx(LabsFieldContainerHint, {
|
|
695
|
+
id,
|
|
696
|
+
hintId,
|
|
697
|
+
hint,
|
|
698
|
+
className: "text-sm"
|
|
699
|
+
})]
|
|
700
|
+
})]
|
|
701
|
+
}), /* @__PURE__ */ jsx(LabsFieldContainerMessage, {
|
|
702
|
+
id,
|
|
703
|
+
messageId,
|
|
704
|
+
message,
|
|
705
|
+
className: "text-xs"
|
|
706
|
+
})]
|
|
707
|
+
});
|
|
708
|
+
};
|
|
709
|
+
//#endregion
|
|
674
710
|
//#region src/components/LabsLogoutTimer.tsx
|
|
675
711
|
const DELAY_LOGOUT_MILLISECONDS = 1440 * 60 * 1e3;
|
|
676
712
|
const LabsLogoutTimer = ({ children, options, onLogout }) => {
|
|
@@ -817,7 +853,7 @@ const LabsMainHeaderActions = () => {
|
|
|
817
853
|
//#region src/components/LabsMultiSelect.tsx
|
|
818
854
|
const LabsMultiSelect = (props) => {
|
|
819
855
|
const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, solo, floatLabel, prependIcon, appendIcon, className, ...rest } = props;
|
|
820
|
-
return /* @__PURE__ */ jsx(
|
|
856
|
+
return /* @__PURE__ */ jsx(LabsFieldContainerInput, {
|
|
821
857
|
id,
|
|
822
858
|
containerId,
|
|
823
859
|
labelId,
|
|
@@ -845,7 +881,7 @@ const LabsMultiSelect = (props) => {
|
|
|
845
881
|
//#region src/components/LabsSelect.tsx
|
|
846
882
|
const LabsSelect = (props) => {
|
|
847
883
|
const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, solo, floatLabel, prependIcon, appendIcon, className, ...rest } = props;
|
|
848
|
-
return /* @__PURE__ */ jsx(
|
|
884
|
+
return /* @__PURE__ */ jsx(LabsFieldContainerInput, {
|
|
849
885
|
id,
|
|
850
886
|
containerId,
|
|
851
887
|
labelId,
|
|
@@ -873,7 +909,7 @@ const LabsSelect = (props) => {
|
|
|
873
909
|
//#region src/components/LabsSelectCascade.tsx
|
|
874
910
|
const LabsSelectCascade = (props) => {
|
|
875
911
|
const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, solo, floatLabel, prependIcon, appendIcon, className, ...rest } = props;
|
|
876
|
-
return /* @__PURE__ */ jsx(
|
|
912
|
+
return /* @__PURE__ */ jsx(LabsFieldContainerInput, {
|
|
877
913
|
id,
|
|
878
914
|
containerId,
|
|
879
915
|
labelId,
|
|
@@ -901,7 +937,7 @@ const LabsSelectCascade = (props) => {
|
|
|
901
937
|
//#region src/components/LabsText.tsx
|
|
902
938
|
const LabsText = forwardRef((props, ref) => {
|
|
903
939
|
const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, solo, floatLabel, prependIcon, appendIcon, className, ...rest } = props;
|
|
904
|
-
return /* @__PURE__ */ jsx(
|
|
940
|
+
return /* @__PURE__ */ jsx(LabsFieldContainerInput, {
|
|
905
941
|
id,
|
|
906
942
|
containerId,
|
|
907
943
|
labelId,
|
|
@@ -954,7 +990,7 @@ LabsTextSearch.displayName = "LabsTextSearch";
|
|
|
954
990
|
//#region src/components/LabsTextarea.tsx
|
|
955
991
|
const LabsTextarea = forwardRef((props, ref) => {
|
|
956
992
|
const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, solo, floatLabel, prependIcon, appendIcon, className, ...rest } = props;
|
|
957
|
-
return /* @__PURE__ */ jsx(
|
|
993
|
+
return /* @__PURE__ */ jsx(LabsFieldContainerInput, {
|
|
958
994
|
id,
|
|
959
995
|
containerId,
|
|
960
996
|
labelId,
|
|
@@ -1172,4 +1208,4 @@ const toLabsTextareaProps = ({ field: { ref, value, ...field }, fieldState }) =>
|
|
|
1172
1208
|
value
|
|
1173
1209
|
});
|
|
1174
1210
|
//#endregion
|
|
1175
|
-
export { DEFAULT_TRANSITION, DEFAULT_TRANSITION_MS, DEFAULT_TRANSITION_SECONDS,
|
|
1211
|
+
export { DEFAULT_TRANSITION, DEFAULT_TRANSITION_MS, DEFAULT_TRANSITION_SECONDS, LABS_MAIN_ID, LabsAnalyticsContext, LabsAnalyticsProvider, LabsAuthContext, LabsAuthGate, LabsAuthProvider, LabsButton, LabsCalendar, LabsCalendarBase, LabsCheckbox, LabsContext, LabsDate, LabsEmpty, LabsFieldContainer, LabsFieldContainerChoice, LabsFieldContainerHint, LabsFieldContainerInput, LabsFieldContainerLabel, LabsFieldContainerMessage, LabsHeadProvider, LabsLoader, LabsLogoutTimer, LabsMain, LabsMainDesktopNav, LabsMainHeader, LabsMainHeaderActions, LabsMainMobileNav, LabsMenuNav, LabsMultiSelect, LabsPrimeProvider, LabsProvider, LabsSelect, LabsSelectCascade, LabsSpeedDialNav, LabsText, LabsTextCurrency, LabsTextSearch, LabsTextarea, LabsToggle, LayoutBase, LayoutCentered, LayoutMain, VERSION, auth, fadeAnimation, getParsedUserInfo, pluralize, refreshToken, scaleFadeAnimation, scaleFadeSubtleAnimation, slideYFadeAnimation, slideYFadeReverseAnimation, toCurrency, toFieldContainerProps, toLabsCheckboxProps, toLabsDateProps, toLabsMultiSelectProps, toLabsSelectCascadeProps, toLabsSelectProps, toLabsTextCurrencyProps, toLabsTextProps, toLabsTextSearchProps, toLabsTextareaProps, toPrecision, useAnalytics, useAuth, useBreakpoints, useLabs, withAuthHeader };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moser-inc/moser-labs-react",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"description": "React components for the Moser Labs suite of applications.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Moser Consulting",
|
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
"@vitejs/plugin-react": "^5.1.4",
|
|
59
59
|
"eslint": "^9.39.4",
|
|
60
60
|
"prettier": "^3.8.1",
|
|
61
|
-
"react-hook-form": "^7.71.2",
|
|
62
61
|
"react-router": "^7.13.1",
|
|
63
62
|
"react-router-dom": "^7.13.1",
|
|
64
63
|
"tsdown": "^0.21.2",
|
|
@@ -75,7 +74,8 @@
|
|
|
75
74
|
"motion": ">=12.35.0",
|
|
76
75
|
"primereact": ">=9.6.0 < 11.0.0",
|
|
77
76
|
"react": ">=18.2.0",
|
|
78
|
-
"react-dom": ">=18.2.0"
|
|
77
|
+
"react-dom": ">=18.2.0",
|
|
78
|
+
"react-hook-form": ">=7.78.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependenciesMeta": {
|
|
81
81
|
"motion": {
|
|
@@ -84,7 +84,6 @@
|
|
|
84
84
|
},
|
|
85
85
|
"inlinedDependencies": {
|
|
86
86
|
"@primeuix/styled": "0.7.4",
|
|
87
|
-
"@primeuix/themes": "2.0.3"
|
|
88
|
-
"react-hook-form": "7.71.2"
|
|
87
|
+
"@primeuix/themes": "2.0.3"
|
|
89
88
|
}
|
|
90
89
|
}
|