@gnwebsoft/ui 3.0.7 → 4.0.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/AsyncSelectPayload-B9-6l33R.d.cts +10 -0
- package/dist/AsyncSelectPayload-B9-6l33R.d.ts +10 -0
- package/dist/chunk-3OPVOWQK.js +140 -0
- package/dist/chunk-AEOF2TUF.cjs +2273 -0
- package/dist/chunk-ALHC7RLK.js +575 -0
- package/dist/chunk-BRRLB22L.js +72 -0
- package/dist/chunk-CHZU4PZB.js +2273 -0
- package/dist/chunk-EBRUE2WR.cjs +1 -1
- package/dist/chunk-HEHPKM4B.cjs +140 -0
- package/dist/chunk-K2EJ4YKO.cjs +72 -0
- package/dist/chunk-MVPLBJRK.cjs +1 -1
- package/dist/chunk-XY4U6A77.cjs +575 -0
- package/dist/components/index.cjs +1 -1
- package/dist/{enhanced-z-I7EHVS.d.cts → enhanced-CDTkKUlj.d.ts} +5 -5
- package/dist/{enhanced-z-I7EHVS.d.ts → enhanced-ZQoS03Cd.d.cts} +5 -5
- package/dist/events-BcHVCLBz.d.cts +77 -0
- package/dist/events-BcHVCLBz.d.ts +77 -0
- package/dist/hooks/index.cjs +3 -3
- package/dist/hooks/index.d.cts +3 -2
- package/dist/hooks/index.d.ts +3 -2
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +67 -6
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +65 -4
- package/dist/types/index.cjs +31 -2
- package/dist/types/index.d.cts +589 -10
- package/dist/types/index.d.ts +589 -10
- package/dist/types/index.js +30 -1
- package/dist/utils/index.cjs +37 -3
- package/dist/utils/index.d.cts +330 -13
- package/dist/utils/index.d.ts +330 -13
- package/dist/utils/index.js +35 -1
- package/dist/wrappers/index.cjs +4 -4
- package/dist/wrappers/index.d.cts +41 -19
- package/dist/wrappers/index.d.ts +41 -19
- package/dist/wrappers/index.js +2 -2
- package/package.json +15 -14
- package/dist/chunk-4H3AFH7A.js +0 -505
- package/dist/chunk-55VNGODF.cjs +0 -2265
- package/dist/chunk-BWC3LJIB.js +0 -2265
- package/dist/chunk-DE62KYFK.js +0 -122
- package/dist/chunk-DEPJRTVT.js +0 -1
- package/dist/chunk-FD57PCAC.cjs +0 -1
- package/dist/chunk-R2YK4LTT.cjs +0 -122
- package/dist/chunk-ZC7FGYL2.cjs +0 -505
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { PostModel, ApiResponse, ListResponse, ValidationErrors } from '../types/index.js';
|
|
1
|
+
import { PostModel, ApiResponse, ListResponse, JsonObject, RequestOptions, ValidationErrors } from '../types/index.js';
|
|
2
2
|
import { PickerValidDate } from '@mui/x-date-pickers';
|
|
3
3
|
import { useLocalizationContext } from '@mui/x-date-pickers/internals';
|
|
4
4
|
import * as react_hook_form from 'react-hook-form';
|
|
5
5
|
import { FieldValues, UseFormSetError, Control, DeepPartialSkipArrayKey, Path, PathValue } from 'react-hook-form';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import '@mui/x-data-grid';
|
|
8
|
+
import '../AsyncSelectPayload-B9-6l33R.js';
|
|
9
|
+
import '../events-BcHVCLBz.js';
|
|
10
|
+
import 'react';
|
|
8
11
|
|
|
9
12
|
declare class api {
|
|
10
13
|
static filter<T, TFilter>(url: string, postModel: PostModel<TFilter>): Promise<ApiResponse<ListResponse<T>>>;
|
|
11
|
-
static post<T>(url: string, body?:
|
|
14
|
+
static post<T>(url: string, body?: JsonObject): Promise<ApiResponse<T>>;
|
|
12
15
|
static get<T>(url: string): Promise<ApiResponse<T>>;
|
|
13
16
|
static delete<T>(url: string): Promise<ApiResponse<T>>;
|
|
14
|
-
static put<T>(url: string, body?:
|
|
15
|
-
static fetch(url: string, options?:
|
|
16
|
-
static tempFetch<T>(url: string, options?:
|
|
17
|
+
static put<T>(url: string, body?: JsonObject): Promise<ApiResponse<T>>;
|
|
18
|
+
static fetch(url: string, options?: RequestInit): Promise<Response>;
|
|
19
|
+
static tempFetch<T>(url: string, options?: RequestOptions): Promise<ApiResponse<T>>;
|
|
17
20
|
static upload<T>(url: string, formData: FormData): Promise<ApiResponse<T>>;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
declare class api2 {
|
|
21
24
|
static filter<T, TFilter>(url: string, postModel: PostModel<TFilter>): Promise<ApiResponse<ListResponse<T>>>;
|
|
22
|
-
static post<T>(url: string, body?:
|
|
25
|
+
static post<T>(url: string, body?: JsonObject): Promise<ApiResponse<T>>;
|
|
23
26
|
static get<T>(url: string): Promise<ApiResponse<T>>;
|
|
24
27
|
static delete<T>(url: string): Promise<ApiResponse<T>>;
|
|
25
|
-
static put<T>(url: string, body?:
|
|
26
|
-
static fetch(url: string, options?:
|
|
27
|
-
static tempFetch<T>(url: string, options?:
|
|
28
|
+
static put<T>(url: string, body?: JsonObject): Promise<ApiResponse<T>>;
|
|
29
|
+
static fetch(url: string, options?: RequestInit): Promise<Response>;
|
|
30
|
+
static tempFetch<T>(url: string, options?: RequestOptions): Promise<ApiResponse<T>>;
|
|
28
31
|
static upload<T>(url: string, formData: FormData): Promise<ApiResponse<T>>;
|
|
29
32
|
}
|
|
30
33
|
|
|
@@ -89,9 +92,7 @@ declare class api2 {
|
|
|
89
92
|
*
|
|
90
93
|
* @public
|
|
91
94
|
*/
|
|
92
|
-
declare const flattenObjectKeys: (obj:
|
|
93
|
-
[x: string]: any;
|
|
94
|
-
};
|
|
95
|
+
declare const flattenObjectKeys: (obj: unknown, prefix?: string) => Record<string, unknown>;
|
|
95
96
|
|
|
96
97
|
declare function getTimezone<TDate extends PickerValidDate>(adapter: ReturnType<typeof useLocalizationContext>, value: TDate): string | null;
|
|
97
98
|
|
|
@@ -363,4 +364,320 @@ declare const typedWatch: {
|
|
|
363
364
|
readonly selector: <TFieldValues extends react_hook_form.FieldValues, TName extends react_hook_form.Path<TFieldValues>, TOutput>(control: react_hook_form.Control<TFieldValues>, name: TName, selector: (value: react_hook_form.PathValue<TFieldValues, TName>) => TOutput, deps?: React.DependencyList) => TOutput;
|
|
364
365
|
};
|
|
365
366
|
|
|
366
|
-
|
|
367
|
+
/**
|
|
368
|
+
* Type guard utilities for runtime type checking
|
|
369
|
+
*
|
|
370
|
+
* @packageDocumentation
|
|
371
|
+
*/
|
|
372
|
+
/**
|
|
373
|
+
* Type guard to check if a value is a non-null object (excluding arrays)
|
|
374
|
+
*
|
|
375
|
+
* @param value - The value to check
|
|
376
|
+
* @returns True if the value is a plain object
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
* ```typescript
|
|
380
|
+
* if (isRecord(value)) {
|
|
381
|
+
* // value is Record<string, unknown>
|
|
382
|
+
* const keys = Object.keys(value);
|
|
383
|
+
* }
|
|
384
|
+
* ```
|
|
385
|
+
*
|
|
386
|
+
* @public
|
|
387
|
+
*/
|
|
388
|
+
declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
389
|
+
/**
|
|
390
|
+
* Type guard to check if an object has a specific property
|
|
391
|
+
*
|
|
392
|
+
* @param obj - The object to check
|
|
393
|
+
* @param key - The property key to look for
|
|
394
|
+
* @returns True if the object has the property
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* ```typescript
|
|
398
|
+
* if (hasProperty(obj, 'name')) {
|
|
399
|
+
* // obj is Record<'name', unknown>
|
|
400
|
+
* console.log(obj.name);
|
|
401
|
+
* }
|
|
402
|
+
* ```
|
|
403
|
+
*
|
|
404
|
+
* @public
|
|
405
|
+
*/
|
|
406
|
+
declare function hasProperty<K extends PropertyKey>(obj: unknown, key: K): obj is Record<K, unknown>;
|
|
407
|
+
/**
|
|
408
|
+
* Type guard to check if a value is a non-empty string
|
|
409
|
+
*
|
|
410
|
+
* @param value - The value to check
|
|
411
|
+
* @returns True if the value is a non-empty string
|
|
412
|
+
*
|
|
413
|
+
* @example
|
|
414
|
+
* ```typescript
|
|
415
|
+
* if (isNonEmptyString(value)) {
|
|
416
|
+
* // value is string with length > 0
|
|
417
|
+
* console.log(value.toUpperCase());
|
|
418
|
+
* }
|
|
419
|
+
* ```
|
|
420
|
+
*
|
|
421
|
+
* @public
|
|
422
|
+
*/
|
|
423
|
+
declare function isNonEmptyString(value: unknown): value is string;
|
|
424
|
+
/**
|
|
425
|
+
* Type guard to check if a value is a valid array
|
|
426
|
+
*
|
|
427
|
+
* @param value - The value to check
|
|
428
|
+
* @returns True if the value is an array
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* ```typescript
|
|
432
|
+
* if (isArray(value)) {
|
|
433
|
+
* // value is unknown[]
|
|
434
|
+
* value.forEach(item => console.log(item));
|
|
435
|
+
* }
|
|
436
|
+
* ```
|
|
437
|
+
*
|
|
438
|
+
* @public
|
|
439
|
+
*/
|
|
440
|
+
declare function isArray<T = unknown>(value: unknown): value is T[];
|
|
441
|
+
/**
|
|
442
|
+
* Type guard to check if a value is a non-empty array
|
|
443
|
+
*
|
|
444
|
+
* @param value - The value to check
|
|
445
|
+
* @returns True if the value is a non-empty array
|
|
446
|
+
*
|
|
447
|
+
* @example
|
|
448
|
+
* ```typescript
|
|
449
|
+
* if (isNonEmptyArray(items)) {
|
|
450
|
+
* // items is [T, ...T[]] - guaranteed to have at least one element
|
|
451
|
+
* const first = items[0]; // Safe access
|
|
452
|
+
* }
|
|
453
|
+
* ```
|
|
454
|
+
*
|
|
455
|
+
* @public
|
|
456
|
+
*/
|
|
457
|
+
declare function isNonEmptyArray<T>(value: unknown): value is [T, ...T[]];
|
|
458
|
+
/**
|
|
459
|
+
* Type guard to check if a value is a function
|
|
460
|
+
*
|
|
461
|
+
* @param value - The value to check
|
|
462
|
+
* @returns True if the value is a function
|
|
463
|
+
*
|
|
464
|
+
* @example
|
|
465
|
+
* ```typescript
|
|
466
|
+
* if (isFunction(callback)) {
|
|
467
|
+
* // callback is (...args: unknown[]) => unknown
|
|
468
|
+
* callback();
|
|
469
|
+
* }
|
|
470
|
+
* ```
|
|
471
|
+
*
|
|
472
|
+
* @public
|
|
473
|
+
*/
|
|
474
|
+
declare function isFunction(value: unknown): value is (...args: readonly unknown[]) => unknown;
|
|
475
|
+
/**
|
|
476
|
+
* Type guard to check if a value is a string
|
|
477
|
+
*
|
|
478
|
+
* @param value - The value to check
|
|
479
|
+
* @returns True if the value is a string (including empty string)
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* ```typescript
|
|
483
|
+
* if (isString(value)) {
|
|
484
|
+
* // value is string
|
|
485
|
+
* console.log(value.length);
|
|
486
|
+
* }
|
|
487
|
+
* ```
|
|
488
|
+
*
|
|
489
|
+
* @public
|
|
490
|
+
*/
|
|
491
|
+
declare function isString(value: unknown): value is string;
|
|
492
|
+
/**
|
|
493
|
+
* Type guard to check if a value is a number (excluding NaN)
|
|
494
|
+
*
|
|
495
|
+
* @param value - The value to check
|
|
496
|
+
* @returns True if the value is a valid number
|
|
497
|
+
*
|
|
498
|
+
* @example
|
|
499
|
+
* ```typescript
|
|
500
|
+
* if (isNumber(value)) {
|
|
501
|
+
* // value is number (not NaN)
|
|
502
|
+
* const doubled = value * 2;
|
|
503
|
+
* }
|
|
504
|
+
* ```
|
|
505
|
+
*
|
|
506
|
+
* @public
|
|
507
|
+
*/
|
|
508
|
+
declare function isNumber(value: unknown): value is number;
|
|
509
|
+
/**
|
|
510
|
+
* Type guard to check if a value is a boolean
|
|
511
|
+
*
|
|
512
|
+
* @param value - The value to check
|
|
513
|
+
* @returns True if the value is a boolean
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```typescript
|
|
517
|
+
* if (isBoolean(value)) {
|
|
518
|
+
* // value is boolean
|
|
519
|
+
* console.log(!value);
|
|
520
|
+
* }
|
|
521
|
+
* ```
|
|
522
|
+
*
|
|
523
|
+
* @public
|
|
524
|
+
*/
|
|
525
|
+
declare function isBoolean(value: unknown): value is boolean;
|
|
526
|
+
/**
|
|
527
|
+
* Type guard to check if a value is null
|
|
528
|
+
*
|
|
529
|
+
* @param value - The value to check
|
|
530
|
+
* @returns True if the value is null
|
|
531
|
+
*
|
|
532
|
+
* @example
|
|
533
|
+
* ```typescript
|
|
534
|
+
* if (isNull(value)) {
|
|
535
|
+
* // value is null
|
|
536
|
+
* return defaultValue;
|
|
537
|
+
* }
|
|
538
|
+
* ```
|
|
539
|
+
*
|
|
540
|
+
* @public
|
|
541
|
+
*/
|
|
542
|
+
declare function isNull(value: unknown): value is null;
|
|
543
|
+
/**
|
|
544
|
+
* Type guard to check if a value is undefined
|
|
545
|
+
*
|
|
546
|
+
* @param value - The value to check
|
|
547
|
+
* @returns True if the value is undefined
|
|
548
|
+
*
|
|
549
|
+
* @example
|
|
550
|
+
* ```typescript
|
|
551
|
+
* if (isUndefined(value)) {
|
|
552
|
+
* // value is undefined
|
|
553
|
+
* return defaultValue;
|
|
554
|
+
* }
|
|
555
|
+
* ```
|
|
556
|
+
*
|
|
557
|
+
* @public
|
|
558
|
+
*/
|
|
559
|
+
declare function isUndefined(value: unknown): value is undefined;
|
|
560
|
+
/**
|
|
561
|
+
* Type guard to check if a value is null or undefined
|
|
562
|
+
*
|
|
563
|
+
* @param value - The value to check
|
|
564
|
+
* @returns True if the value is nullish
|
|
565
|
+
*
|
|
566
|
+
* @example
|
|
567
|
+
* ```typescript
|
|
568
|
+
* if (isNullish(value)) {
|
|
569
|
+
* // value is null | undefined
|
|
570
|
+
* return defaultValue;
|
|
571
|
+
* }
|
|
572
|
+
*
|
|
573
|
+
* if (!isNullish(value)) {
|
|
574
|
+
* // value is NonNullable<typeof value>
|
|
575
|
+
* console.log(value);
|
|
576
|
+
* }
|
|
577
|
+
* ```
|
|
578
|
+
*
|
|
579
|
+
* @public
|
|
580
|
+
*/
|
|
581
|
+
declare function isNullish(value: unknown): value is null | undefined;
|
|
582
|
+
/**
|
|
583
|
+
* Type guard to check if a value is defined (not null or undefined)
|
|
584
|
+
*
|
|
585
|
+
* @param value - The value to check
|
|
586
|
+
* @returns True if the value is not null or undefined
|
|
587
|
+
*
|
|
588
|
+
* @example
|
|
589
|
+
* ```typescript
|
|
590
|
+
* const filtered = items.filter(isDefined);
|
|
591
|
+
* // filtered has type: NonNullable<T>[]
|
|
592
|
+
* ```
|
|
593
|
+
*
|
|
594
|
+
* @public
|
|
595
|
+
*/
|
|
596
|
+
declare function isDefined<T>(value: T): value is NonNullable<T>;
|
|
597
|
+
/**
|
|
598
|
+
* Type guard to check if a value is a Date object
|
|
599
|
+
*
|
|
600
|
+
* @param value - The value to check
|
|
601
|
+
* @returns True if the value is a Date
|
|
602
|
+
*
|
|
603
|
+
* @example
|
|
604
|
+
* ```typescript
|
|
605
|
+
* if (isDate(value)) {
|
|
606
|
+
* // value is Date
|
|
607
|
+
* console.log(value.toISOString());
|
|
608
|
+
* }
|
|
609
|
+
* ```
|
|
610
|
+
*
|
|
611
|
+
* @public
|
|
612
|
+
*/
|
|
613
|
+
declare function isDate(value: unknown): value is Date;
|
|
614
|
+
/**
|
|
615
|
+
* Type guard to check if a value is a Promise
|
|
616
|
+
*
|
|
617
|
+
* @param value - The value to check
|
|
618
|
+
* @returns True if the value is a Promise
|
|
619
|
+
*
|
|
620
|
+
* @example
|
|
621
|
+
* ```typescript
|
|
622
|
+
* if (isPromise(value)) {
|
|
623
|
+
* // value is Promise<unknown>
|
|
624
|
+
* const result = await value;
|
|
625
|
+
* }
|
|
626
|
+
* ```
|
|
627
|
+
*
|
|
628
|
+
* @public
|
|
629
|
+
*/
|
|
630
|
+
declare function isPromise(value: unknown): value is Promise<unknown>;
|
|
631
|
+
/**
|
|
632
|
+
* Type guard to check if an error is an Error instance
|
|
633
|
+
*
|
|
634
|
+
* @param error - The error to check
|
|
635
|
+
* @returns True if the error is an Error instance
|
|
636
|
+
*
|
|
637
|
+
* @example
|
|
638
|
+
* ```typescript
|
|
639
|
+
* try {
|
|
640
|
+
* // ...
|
|
641
|
+
* } catch (error) {
|
|
642
|
+
* if (isError(error)) {
|
|
643
|
+
* // error is Error
|
|
644
|
+
* console.error(error.message);
|
|
645
|
+
* }
|
|
646
|
+
* }
|
|
647
|
+
* ```
|
|
648
|
+
*
|
|
649
|
+
* @public
|
|
650
|
+
*/
|
|
651
|
+
declare function isError(error: unknown): error is Error;
|
|
652
|
+
/**
|
|
653
|
+
* Type guard to check if a value matches a specific type using a validator function
|
|
654
|
+
*
|
|
655
|
+
* @param value - The value to check
|
|
656
|
+
* @param validator - Function that returns true if value matches the type
|
|
657
|
+
* @returns True if the value matches the type
|
|
658
|
+
*
|
|
659
|
+
* @example
|
|
660
|
+
* ```typescript
|
|
661
|
+
* interface User {
|
|
662
|
+
* id: string;
|
|
663
|
+
* name: string;
|
|
664
|
+
* }
|
|
665
|
+
*
|
|
666
|
+
* const isUser = (value: unknown): value is User =>
|
|
667
|
+
* isRecord(value) &&
|
|
668
|
+
* hasProperty(value, 'id') &&
|
|
669
|
+
* hasProperty(value, 'name') &&
|
|
670
|
+
* isString(value.id) &&
|
|
671
|
+
* isString(value.name);
|
|
672
|
+
*
|
|
673
|
+
* if (isUser(data)) {
|
|
674
|
+
* // data is User
|
|
675
|
+
* console.log(data.name);
|
|
676
|
+
* }
|
|
677
|
+
* ```
|
|
678
|
+
*
|
|
679
|
+
* @public
|
|
680
|
+
*/
|
|
681
|
+
declare function matches<T>(value: unknown, validator: (value: unknown) => value is T): value is T;
|
|
682
|
+
|
|
683
|
+
export { type PathArray, api, api2, flattenObjectKeys, getTimezone, handleServerErrors, hasProperty, isArray, isBoolean, isDate, isDefined, isError, isFunction, isNonEmptyArray, isNonEmptyString, isNull, isNullish, isNumber, isPromise, isRecord, isString, isUndefined, matches, propertyExists, readValueAsDate, removeLeadingTrailingSlashes, schemaTools, typedWatch, useWatchBatch, useWatchBoolean, useWatchConditional, useWatchDebounced, useWatchDefault, useWatchField, useWatchFields, useWatchForm, useWatchSelector, useWatchTransform };
|
package/dist/utils/index.js
CHANGED
|
@@ -4,6 +4,23 @@ import {
|
|
|
4
4
|
flattenObjectKeys,
|
|
5
5
|
getTimezone,
|
|
6
6
|
handleServerErrors,
|
|
7
|
+
hasProperty,
|
|
8
|
+
isArray,
|
|
9
|
+
isBoolean,
|
|
10
|
+
isDate,
|
|
11
|
+
isDefined,
|
|
12
|
+
isError,
|
|
13
|
+
isFunction,
|
|
14
|
+
isNonEmptyArray,
|
|
15
|
+
isNonEmptyString,
|
|
16
|
+
isNull,
|
|
17
|
+
isNullish,
|
|
18
|
+
isNumber,
|
|
19
|
+
isPromise,
|
|
20
|
+
isRecord,
|
|
21
|
+
isString,
|
|
22
|
+
isUndefined,
|
|
23
|
+
matches,
|
|
7
24
|
propertyExists,
|
|
8
25
|
readValueAsDate,
|
|
9
26
|
removeLeadingTrailingSlashes,
|
|
@@ -19,13 +36,30 @@ import {
|
|
|
19
36
|
useWatchForm,
|
|
20
37
|
useWatchSelector,
|
|
21
38
|
useWatchTransform
|
|
22
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-ALHC7RLK.js";
|
|
23
40
|
export {
|
|
24
41
|
api,
|
|
25
42
|
api2,
|
|
26
43
|
flattenObjectKeys,
|
|
27
44
|
getTimezone,
|
|
28
45
|
handleServerErrors,
|
|
46
|
+
hasProperty,
|
|
47
|
+
isArray,
|
|
48
|
+
isBoolean,
|
|
49
|
+
isDate,
|
|
50
|
+
isDefined,
|
|
51
|
+
isError,
|
|
52
|
+
isFunction,
|
|
53
|
+
isNonEmptyArray,
|
|
54
|
+
isNonEmptyString,
|
|
55
|
+
isNull,
|
|
56
|
+
isNullish,
|
|
57
|
+
isNumber,
|
|
58
|
+
isPromise,
|
|
59
|
+
isRecord,
|
|
60
|
+
isString,
|
|
61
|
+
isUndefined,
|
|
62
|
+
matches,
|
|
29
63
|
propertyExists,
|
|
30
64
|
readValueAsDate,
|
|
31
65
|
removeLeadingTrailingSlashes,
|
package/dist/wrappers/index.cjs
CHANGED
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
28
|
-
require('../chunk-
|
|
27
|
+
var _chunkAEOF2TUFcjs = require('../chunk-AEOF2TUF.cjs');
|
|
28
|
+
require('../chunk-HEHPKM4B.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -52,5 +52,5 @@ require('../chunk-R2YK4LTT.cjs');
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
exports.AsyncMultiSelect2 =
|
|
56
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
55
|
+
exports.AsyncMultiSelect2 = _chunkAEOF2TUFcjs.AsyncMultiSelect2; exports.CheckboxElement = _chunkAEOF2TUFcjs.CheckboxElement; exports.CheckboxGroup = _chunkAEOF2TUFcjs.CheckboxGroup; exports.DatePickerElement = _chunkAEOF2TUFcjs.DatePickerElement; exports.DatePickerElementCore = _chunkAEOF2TUFcjs.DatePickerElementCore; exports.EnhancedTextFieldElement = _chunkAEOF2TUFcjs.EnhancedTextFieldElement; exports.Field = _chunkAEOF2TUFcjs.Field; exports.PasswordElement = _chunkAEOF2TUFcjs.PasswordElement_default; exports.RadioButtonGroup = _chunkAEOF2TUFcjs.RadioButtonGroup_default; exports.SelectCascadeElement = _chunkAEOF2TUFcjs.SelectCascadeElement_default; exports.SelectElement = _chunkAEOF2TUFcjs.SelectElement_default; exports.SelectMultiElement = _chunkAEOF2TUFcjs.SelectMultiElement_default; exports.TextFieldElement = _chunkAEOF2TUFcjs.TextFieldElement_default; exports.TimePickerElement = _chunkAEOF2TUFcjs.TimePickerElement_default; exports.createDateInputTransform = _chunkAEOF2TUFcjs.createDateInputTransform; exports.createDateOutputTransform = _chunkAEOF2TUFcjs.createDateOutputTransform; exports.createDefaultDatePickerConfig = _chunkAEOF2TUFcjs.createDefaultDatePickerConfig; exports.createStableKey = _chunkAEOF2TUFcjs.createStableKey; exports.extractErrorMessage = _chunkAEOF2TUFcjs.extractErrorMessage; exports.isParsableDateString = _chunkAEOF2TUFcjs.isParsableDateString; exports.isValidDate = _chunkAEOF2TUFcjs.isValidDate; exports.readDatePickerValueAsDate = _chunkAEOF2TUFcjs.readDatePickerValueAsDate; exports.useDatePickerStyles = _chunkAEOF2TUFcjs.useDatePickerStyles; exports.useDatePickerValidation = _chunkAEOF2TUFcjs.useDatePickerValidation; exports.useDatePickerValue = _chunkAEOF2TUFcjs.useDatePickerValue;
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvbGlicy9HTldlYlNvZnQuVUkvcGFja2FnZXMvdWkvZGlzdC93cmFwcGVycy9pbmRleC5janMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDRTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNGLHlEQUE4QjtBQUM5QixpQ0FBOEI7QUFDOUI7QUFDRTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNGLDRzREFBQyIsImZpbGUiOiIvYnVpbGRzL2xpYnMvR05XZWJTb2Z0LlVJL3BhY2thZ2VzL3VpL2Rpc3Qvd3JhcHBlcnMvaW5kZXguY2pzIn0=
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react_hook_form from 'react-hook-form';
|
|
3
|
-
import { FieldValues, FieldPath, Control, FieldError, PathValue, UseControllerProps, UseControllerReturn } from 'react-hook-form';
|
|
3
|
+
import { FieldValues, FieldPath, Control, FieldError, PathValue, UseControllerProps, UseControllerReturn, Path } from 'react-hook-form';
|
|
4
4
|
import { GridProps, TextFieldVariants, SxProps, AutocompleteRenderInputParams, CheckboxProps, FormControlLabelProps, Theme, TextFieldProps, IconButtonProps, FormLabelProps, RadioProps, ChipTypeMap, AutocompleteProps, TextField } from '@mui/material';
|
|
5
5
|
import * as React$1 from 'react';
|
|
6
6
|
import React__default, { ReactNode, ChangeEvent } from 'react';
|
|
7
|
+
import { E as EventOrValue } from '../events-BcHVCLBz.cjs';
|
|
7
8
|
import { PickerValidDate, DateValidationError, PickerChangeHandlerContext, DatePickerSlotProps, DatePickerProps, TimeValidationError, TimePickerSlotProps, TimePickerProps } from '@mui/x-date-pickers';
|
|
8
9
|
import { useLocalizationContext } from '@mui/x-date-pickers/internals';
|
|
9
|
-
import { F as FieldType } from '../enhanced-
|
|
10
|
+
import { F as FieldType } from '../enhanced-ZQoS03Cd.cjs';
|
|
11
|
+
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-B9-6l33R.cjs';
|
|
10
12
|
|
|
11
13
|
interface AsyncSelect2Payload {
|
|
12
14
|
query: string | null;
|
|
@@ -96,12 +98,13 @@ interface CheckboxElementProps<TFieldValues extends FieldValues = FieldValues, T
|
|
|
96
98
|
*/
|
|
97
99
|
input?: (value: PathValue<TFieldValues, TName>) => boolean;
|
|
98
100
|
/**
|
|
99
|
-
* Transform the checkbox
|
|
101
|
+
* Transform the checkbox change event back to the desired field value.
|
|
100
102
|
* If not provided, the boolean checked state is used directly.
|
|
101
|
-
* @param
|
|
103
|
+
* @param event - The checkbox change event
|
|
104
|
+
* @param checked - The new checked state
|
|
102
105
|
* @returns The transformed value to store in the form
|
|
103
106
|
*/
|
|
104
|
-
output?: (checked: boolean) => PathValue<TFieldValues, TName>;
|
|
107
|
+
output?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => PathValue<TFieldValues, TName>;
|
|
105
108
|
};
|
|
106
109
|
/**
|
|
107
110
|
* Custom onChange handler that works alongside the form controller
|
|
@@ -232,8 +235,8 @@ declare const CheckboxGroup: {
|
|
|
232
235
|
displayName: string;
|
|
233
236
|
};
|
|
234
237
|
|
|
235
|
-
type PrimitiveValue$
|
|
236
|
-
type OptionObject$
|
|
238
|
+
type PrimitiveValue$2 = string | number | boolean;
|
|
239
|
+
type OptionObject$2<TValueKey extends string = string, TLabelKey extends string = string, TDisabledKey extends string = string> = Record<TValueKey, PrimitiveValue$2> & Record<TLabelKey, string> & Partial<Record<TDisabledKey, boolean>> & Record<string, unknown>;
|
|
237
240
|
/**
|
|
238
241
|
* Props for the CheckboxGroup component.
|
|
239
242
|
*
|
|
@@ -246,7 +249,7 @@ type OptionObject$1<TValueKey extends string = string, TLabelKey extends string
|
|
|
246
249
|
*
|
|
247
250
|
* @public
|
|
248
251
|
*/
|
|
249
|
-
interface CheckboxGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TOption extends OptionObject$
|
|
252
|
+
interface CheckboxGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TOption extends OptionObject$2<TValueKey, TLabelKey, TDisabledKey> = OptionObject$2, TValueKey extends keyof TOption & string = "Value", TLabelKey extends keyof TOption & string = "Label", TDisabledKey extends keyof TOption & string = "disabled"> extends Omit<CheckboxProps, "name" | "checked" | "value" | "onChange"> {
|
|
250
253
|
/**
|
|
251
254
|
* The field name in the form
|
|
252
255
|
* @example "selectedItems" | "user.preferences"
|
|
@@ -320,7 +323,7 @@ interface CheckboxGroupProps<TFieldValues extends FieldValues = FieldValues, TNa
|
|
|
320
323
|
* @param selectedValues - Array of selected option values
|
|
321
324
|
* @returns The transformed value to store in the form
|
|
322
325
|
*/
|
|
323
|
-
output?: (
|
|
326
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
324
327
|
};
|
|
325
328
|
/**
|
|
326
329
|
* Custom onChange handler that works alongside the form controller
|
|
@@ -1095,9 +1098,9 @@ declare const PasswordElement: {
|
|
|
1095
1098
|
displayName: string;
|
|
1096
1099
|
};
|
|
1097
1100
|
|
|
1098
|
-
type PrimitiveValue = string | number | boolean;
|
|
1099
|
-
type OptionObject<TValueKey extends string = string, TLabelKey extends string = string, TDisabledKey extends string = string> = Record<TValueKey, PrimitiveValue> & Record<TLabelKey, string> & Partial<Record<TDisabledKey, boolean>> & Record<string, unknown>;
|
|
1100
|
-
interface RadioButtonGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TOption extends OptionObject<TValueKey, TLabelKey, TDisabledKey> = OptionObject, TValueKey extends keyof TOption & string = "id", TLabelKey extends keyof TOption & string = "label", TDisabledKey extends keyof TOption & string = "disabled"> {
|
|
1101
|
+
type PrimitiveValue$1 = string | number | boolean;
|
|
1102
|
+
type OptionObject$1<TValueKey extends string = string, TLabelKey extends string = string, TDisabledKey extends string = string> = Record<TValueKey, PrimitiveValue$1> & Record<TLabelKey, string> & Partial<Record<TDisabledKey, boolean>> & Record<string, unknown>;
|
|
1103
|
+
interface RadioButtonGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TOption extends OptionObject$1<TValueKey, TLabelKey, TDisabledKey> = OptionObject$1, TValueKey extends keyof TOption & string = "id", TLabelKey extends keyof TOption & string = "label", TDisabledKey extends keyof TOption & string = "disabled"> {
|
|
1101
1104
|
options: TOption[];
|
|
1102
1105
|
helperText?: ReactNode;
|
|
1103
1106
|
name: TName;
|
|
@@ -1119,12 +1122,12 @@ interface RadioButtonGroupProps<TFieldValues extends FieldValues = FieldValues,
|
|
|
1119
1122
|
disabled?: boolean;
|
|
1120
1123
|
transform?: {
|
|
1121
1124
|
input?: (value: PathValue<TFieldValues, TName>) => TOption[TValueKey];
|
|
1122
|
-
output?: (
|
|
1125
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
1123
1126
|
};
|
|
1124
1127
|
gridProps?: GridProps;
|
|
1125
1128
|
}
|
|
1126
1129
|
declare const RadioButtonGroup: {
|
|
1127
|
-
<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TOption extends OptionObject<TValueKey, TLabelKey, TDisabledKey> = OptionObject<string, string, string>, TValueKey extends keyof TOption & string = "id", TLabelKey extends keyof TOption & string = "label", TDisabledKey extends keyof TOption & string = "disabled">({ gridProps, ...props }: RadioButtonGroupProps<TFieldValues, TName, TOption, TValueKey, TLabelKey, TDisabledKey>): react_jsx_runtime.JSX.Element;
|
|
1130
|
+
<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TOption extends OptionObject$1<TValueKey, TLabelKey, TDisabledKey> = OptionObject$1<string, string, string>, TValueKey extends keyof TOption & string = "id", TLabelKey extends keyof TOption & string = "label", TDisabledKey extends keyof TOption & string = "disabled">({ gridProps, ...props }: RadioButtonGroupProps<TFieldValues, TName, TOption, TValueKey, TLabelKey, TDisabledKey>): react_jsx_runtime.JSX.Element;
|
|
1128
1131
|
displayName: string;
|
|
1129
1132
|
};
|
|
1130
1133
|
|
|
@@ -1365,7 +1368,7 @@ interface TextFieldElementProps<TFieldValues extends FieldValues = FieldValues,
|
|
|
1365
1368
|
/** Transform value before displaying in input */
|
|
1366
1369
|
input?: (value: PathValue<TFieldValues, TName>) => TValue;
|
|
1367
1370
|
/** Transform input event to form value */
|
|
1368
|
-
output?: (
|
|
1371
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
1369
1372
|
};
|
|
1370
1373
|
/**
|
|
1371
1374
|
* The input label text
|
|
@@ -1509,7 +1512,7 @@ interface EnhancedTextFieldElementProps<TFieldValues extends FieldValues = Field
|
|
|
1509
1512
|
/** Transform value before displaying in input */
|
|
1510
1513
|
input?: (value: PathValue<TFieldValues, TName>) => TValue;
|
|
1511
1514
|
/** Transform input event to form value */
|
|
1512
|
-
output?: (
|
|
1515
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
1513
1516
|
};
|
|
1514
1517
|
/**
|
|
1515
1518
|
* Built-in field type for automatic transformation
|
|
@@ -1671,7 +1674,7 @@ interface TimePickerElementProps<TFieldValues extends FieldValues = FieldValues,
|
|
|
1671
1674
|
slotProps?: Omit<TimePickerSlotProps<TEnableAccessibleFieldDOMStructure>, "textField">;
|
|
1672
1675
|
transform?: {
|
|
1673
1676
|
input?: (value: PathValue<TFieldValues, TName>) => TValue | null;
|
|
1674
|
-
output?: (
|
|
1677
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
1675
1678
|
};
|
|
1676
1679
|
gridProps?: GridProps;
|
|
1677
1680
|
timePickerProps?: Omit<TimePickerProps<TEnableAccessibleFieldDOMStructure>, "value" | "slotProps">;
|
|
@@ -1683,6 +1686,22 @@ declare const TimePickerElement: {
|
|
|
1683
1686
|
displayName: string;
|
|
1684
1687
|
};
|
|
1685
1688
|
|
|
1689
|
+
type PrimitiveValue = string | number | boolean;
|
|
1690
|
+
type OptionObject<TValueKey extends string = string, TLabelKey extends string = string> = Record<TValueKey, PrimitiveValue> & Record<TLabelKey, string> & Record<string, unknown>;
|
|
1691
|
+
type AsyncSelectElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = Path<TFieldValues>, TValueKey extends string = "Value", TLabelKey extends string = "Label", TOption extends OptionObject<TValueKey, TLabelKey> = OptionObject<TValueKey, TLabelKey>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent']> = Omit<AutocompleteProps<TOption, Multiple, DisableClearable, FreeSolo, ChipComponent>, 'name' | 'control' | 'ref' | 'multiple' | 'loading' | 'getOptionLabel' | 'getOptionKey' | 'isOptionEqualToValue' | 'options' | 'value' | 'filterSelectedOptions' | 'filterOptions' | 'onChange' | 'onInputChange' | 'renderInput'> & {
|
|
1692
|
+
name: TName;
|
|
1693
|
+
control?: Control<TFieldValues>;
|
|
1694
|
+
gridProps?: GridProps;
|
|
1695
|
+
placeholder?: string;
|
|
1696
|
+
label?: string;
|
|
1697
|
+
initialValue?: TOption[TValueKey] | null;
|
|
1698
|
+
queryFn: (data: AsyncSelectPayload) => Promise<TOption[] | undefined>;
|
|
1699
|
+
variant?: TextFieldVariants;
|
|
1700
|
+
sx?: SxProps;
|
|
1701
|
+
labelKey?: TLabelKey;
|
|
1702
|
+
valueKey?: TValueKey;
|
|
1703
|
+
};
|
|
1704
|
+
|
|
1686
1705
|
declare const Field: {
|
|
1687
1706
|
Text: {
|
|
1688
1707
|
<TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue = unknown>({ gridProps, ...props }: TextFieldElementProps<TFieldValues, TName, TValue>): React.ReactElement;
|
|
@@ -1717,7 +1736,10 @@ declare const Field: {
|
|
|
1717
1736
|
<TOption, TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>>({ gridProps, ...props }: SelectCascadeElementProps<TOption, TFieldValues, TName>): React.ReactElement;
|
|
1718
1737
|
displayName: string;
|
|
1719
1738
|
};
|
|
1720
|
-
AsyncSelect:
|
|
1739
|
+
AsyncSelect: {
|
|
1740
|
+
<TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValueKey extends string = "Value", TLabelKey extends string = "Label", TOption extends OptionObject<TValueKey, TLabelKey> = OptionObject<TValueKey, TLabelKey>>({ gridProps, ...props }: AsyncSelectElementProps<TFieldValues, TName, TValueKey, TLabelKey, TOption>): React.ReactElement;
|
|
1741
|
+
displayName: string;
|
|
1742
|
+
};
|
|
1721
1743
|
AsyncMultiSelect: {
|
|
1722
1744
|
<TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>>({ gridProps, ...props }: AsyncMultiSelect2Props<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
1723
1745
|
displayName: string;
|
|
@@ -1728,4 +1750,4 @@ declare const Field: {
|
|
|
1728
1750
|
};
|
|
1729
1751
|
};
|
|
1730
1752
|
|
|
1731
|
-
export { AsyncMultiSelect2, type AsyncMultiSelect2Props, type AsyncSelect2Payload, type BrandedDate, CheckboxElement, type CheckboxElementProps, CheckboxGroup, type CheckboxGroupProps, DatePickerElement, DatePickerElementCore, type DatePickerElementCoreProps, type DatePickerElementGridProps, type DatePickerElementProps, type DatePickerHookReturn, type DatePickerValidationConfig, type DateTransform, EnhancedTextFieldElement, type EnhancedTextFieldElementProps, Field, type Option2Item, type OptionObject$
|
|
1753
|
+
export { AsyncMultiSelect2, type AsyncMultiSelect2Props, type AsyncSelect2Payload, type BrandedDate, CheckboxElement, type CheckboxElementProps, CheckboxGroup, type CheckboxGroupProps, DatePickerElement, DatePickerElementCore, type DatePickerElementCoreProps, type DatePickerElementGridProps, type DatePickerElementProps, type DatePickerHookReturn, type DatePickerValidationConfig, type DateTransform, EnhancedTextFieldElement, type EnhancedTextFieldElementProps, Field, type Option2Item, type OptionObject$2 as OptionObject, PasswordElement, RadioButtonGroup, SelectCascadeElement, SelectElement, SelectMultiElement, TextFieldElement, TimePickerElement, type TypedDatePickerSlotProps, type UseDatePickerStylesOptions, type UseDatePickerStylesReturn, type UseDatePickerValidationOptions, type UseDatePickerValidationReturn, type UseDatePickerValueOptions, type UseDatePickerValueReturn, type ValidatedDate, createDateInputTransform, createDateOutputTransform, createDefaultDatePickerConfig, createStableKey, extractErrorMessage, isParsableDateString, isValidDate, readDatePickerValueAsDate, useDatePickerStyles, useDatePickerValidation, useDatePickerValue };
|