@gnwebsoft/ui 3.0.8 → 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/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 +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +65 -4
- package/dist/types/index.cjs +31 -2
- package/dist/types/index.d.cts +588 -1
- package/dist/types/index.d.ts +588 -1
- package/dist/types/index.js +30 -1
- package/dist/utils/index.cjs +37 -3
- package/dist/utils/index.d.cts +329 -13
- package/dist/utils/index.d.ts +329 -13
- package/dist/utils/index.js +35 -1
- package/dist/wrappers/index.cjs +4 -4
- package/dist/wrappers/index.d.cts +11 -9
- package/dist/wrappers/index.d.ts +11 -9
- package/dist/wrappers/index.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-4H3AFH7A.js +0 -505
- package/dist/chunk-DE62KYFK.js +0 -122
- package/dist/chunk-DEPJRTVT.js +0 -1
- package/dist/chunk-FD57PCAC.cjs +0 -1
- package/dist/chunk-JCXHX2PZ.js +0 -2265
- package/dist/chunk-MW2UCDTI.cjs +0 -2265
- package/dist/chunk-R2YK4LTT.cjs +0 -122
- package/dist/chunk-ZC7FGYL2.cjs +0 -505
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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';
|
|
@@ -6,26 +6,28 @@ import { FieldValues, UseFormSetError, Control, DeepPartialSkipArrayKey, Path, P
|
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import '@mui/x-data-grid';
|
|
8
8
|
import '../AsyncSelectPayload-B9-6l33R.js';
|
|
9
|
+
import '../events-BcHVCLBz.js';
|
|
10
|
+
import 'react';
|
|
9
11
|
|
|
10
12
|
declare class api {
|
|
11
13
|
static filter<T, TFilter>(url: string, postModel: PostModel<TFilter>): Promise<ApiResponse<ListResponse<T>>>;
|
|
12
|
-
static post<T>(url: string, body?:
|
|
14
|
+
static post<T>(url: string, body?: JsonObject): Promise<ApiResponse<T>>;
|
|
13
15
|
static get<T>(url: string): Promise<ApiResponse<T>>;
|
|
14
16
|
static delete<T>(url: string): Promise<ApiResponse<T>>;
|
|
15
|
-
static put<T>(url: string, body?:
|
|
16
|
-
static fetch(url: string, options?:
|
|
17
|
-
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>>;
|
|
18
20
|
static upload<T>(url: string, formData: FormData): Promise<ApiResponse<T>>;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
declare class api2 {
|
|
22
24
|
static filter<T, TFilter>(url: string, postModel: PostModel<TFilter>): Promise<ApiResponse<ListResponse<T>>>;
|
|
23
|
-
static post<T>(url: string, body?:
|
|
25
|
+
static post<T>(url: string, body?: JsonObject): Promise<ApiResponse<T>>;
|
|
24
26
|
static get<T>(url: string): Promise<ApiResponse<T>>;
|
|
25
27
|
static delete<T>(url: string): Promise<ApiResponse<T>>;
|
|
26
|
-
static put<T>(url: string, body?:
|
|
27
|
-
static fetch(url: string, options?:
|
|
28
|
-
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>>;
|
|
29
31
|
static upload<T>(url: string, formData: FormData): Promise<ApiResponse<T>>;
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -90,9 +92,7 @@ declare class api2 {
|
|
|
90
92
|
*
|
|
91
93
|
* @public
|
|
92
94
|
*/
|
|
93
|
-
declare const flattenObjectKeys: (obj:
|
|
94
|
-
[x: string]: any;
|
|
95
|
-
};
|
|
95
|
+
declare const flattenObjectKeys: (obj: unknown, prefix?: string) => Record<string, unknown>;
|
|
96
96
|
|
|
97
97
|
declare function getTimezone<TDate extends PickerValidDate>(adapter: ReturnType<typeof useLocalizationContext>, value: TDate): string | null;
|
|
98
98
|
|
|
@@ -364,4 +364,320 @@ declare const typedWatch: {
|
|
|
364
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;
|
|
365
365
|
};
|
|
366
366
|
|
|
367
|
-
|
|
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=
|
|
@@ -4,9 +4,10 @@ import { FieldValues, FieldPath, Control, FieldError, PathValue, UseControllerPr
|
|
|
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';
|
|
10
11
|
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-B9-6l33R.cjs';
|
|
11
12
|
|
|
12
13
|
interface AsyncSelect2Payload {
|
|
@@ -97,12 +98,13 @@ interface CheckboxElementProps<TFieldValues extends FieldValues = FieldValues, T
|
|
|
97
98
|
*/
|
|
98
99
|
input?: (value: PathValue<TFieldValues, TName>) => boolean;
|
|
99
100
|
/**
|
|
100
|
-
* Transform the checkbox
|
|
101
|
+
* Transform the checkbox change event back to the desired field value.
|
|
101
102
|
* If not provided, the boolean checked state is used directly.
|
|
102
|
-
* @param
|
|
103
|
+
* @param event - The checkbox change event
|
|
104
|
+
* @param checked - The new checked state
|
|
103
105
|
* @returns The transformed value to store in the form
|
|
104
106
|
*/
|
|
105
|
-
output?: (checked: boolean) => PathValue<TFieldValues, TName>;
|
|
107
|
+
output?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => PathValue<TFieldValues, TName>;
|
|
106
108
|
};
|
|
107
109
|
/**
|
|
108
110
|
* Custom onChange handler that works alongside the form controller
|
|
@@ -321,7 +323,7 @@ interface CheckboxGroupProps<TFieldValues extends FieldValues = FieldValues, TNa
|
|
|
321
323
|
* @param selectedValues - Array of selected option values
|
|
322
324
|
* @returns The transformed value to store in the form
|
|
323
325
|
*/
|
|
324
|
-
output?: (
|
|
326
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
325
327
|
};
|
|
326
328
|
/**
|
|
327
329
|
* Custom onChange handler that works alongside the form controller
|
|
@@ -1120,7 +1122,7 @@ interface RadioButtonGroupProps<TFieldValues extends FieldValues = FieldValues,
|
|
|
1120
1122
|
disabled?: boolean;
|
|
1121
1123
|
transform?: {
|
|
1122
1124
|
input?: (value: PathValue<TFieldValues, TName>) => TOption[TValueKey];
|
|
1123
|
-
output?: (
|
|
1125
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
1124
1126
|
};
|
|
1125
1127
|
gridProps?: GridProps;
|
|
1126
1128
|
}
|
|
@@ -1366,7 +1368,7 @@ interface TextFieldElementProps<TFieldValues extends FieldValues = FieldValues,
|
|
|
1366
1368
|
/** Transform value before displaying in input */
|
|
1367
1369
|
input?: (value: PathValue<TFieldValues, TName>) => TValue;
|
|
1368
1370
|
/** Transform input event to form value */
|
|
1369
|
-
output?: (
|
|
1371
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
1370
1372
|
};
|
|
1371
1373
|
/**
|
|
1372
1374
|
* The input label text
|
|
@@ -1510,7 +1512,7 @@ interface EnhancedTextFieldElementProps<TFieldValues extends FieldValues = Field
|
|
|
1510
1512
|
/** Transform value before displaying in input */
|
|
1511
1513
|
input?: (value: PathValue<TFieldValues, TName>) => TValue;
|
|
1512
1514
|
/** Transform input event to form value */
|
|
1513
|
-
output?: (
|
|
1515
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
1514
1516
|
};
|
|
1515
1517
|
/**
|
|
1516
1518
|
* Built-in field type for automatic transformation
|
|
@@ -1672,7 +1674,7 @@ interface TimePickerElementProps<TFieldValues extends FieldValues = FieldValues,
|
|
|
1672
1674
|
slotProps?: Omit<TimePickerSlotProps<TEnableAccessibleFieldDOMStructure>, "textField">;
|
|
1673
1675
|
transform?: {
|
|
1674
1676
|
input?: (value: PathValue<TFieldValues, TName>) => TValue | null;
|
|
1675
|
-
output?: (
|
|
1677
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
1676
1678
|
};
|
|
1677
1679
|
gridProps?: GridProps;
|
|
1678
1680
|
timePickerProps?: Omit<TimePickerProps<TEnableAccessibleFieldDOMStructure>, "value" | "slotProps">;
|
package/dist/wrappers/index.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ import { FieldValues, FieldPath, Control, FieldError, PathValue, UseControllerPr
|
|
|
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.js';
|
|
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-CDTkKUlj.js';
|
|
10
11
|
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-B9-6l33R.js';
|
|
11
12
|
|
|
12
13
|
interface AsyncSelect2Payload {
|
|
@@ -97,12 +98,13 @@ interface CheckboxElementProps<TFieldValues extends FieldValues = FieldValues, T
|
|
|
97
98
|
*/
|
|
98
99
|
input?: (value: PathValue<TFieldValues, TName>) => boolean;
|
|
99
100
|
/**
|
|
100
|
-
* Transform the checkbox
|
|
101
|
+
* Transform the checkbox change event back to the desired field value.
|
|
101
102
|
* If not provided, the boolean checked state is used directly.
|
|
102
|
-
* @param
|
|
103
|
+
* @param event - The checkbox change event
|
|
104
|
+
* @param checked - The new checked state
|
|
103
105
|
* @returns The transformed value to store in the form
|
|
104
106
|
*/
|
|
105
|
-
output?: (checked: boolean) => PathValue<TFieldValues, TName>;
|
|
107
|
+
output?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => PathValue<TFieldValues, TName>;
|
|
106
108
|
};
|
|
107
109
|
/**
|
|
108
110
|
* Custom onChange handler that works alongside the form controller
|
|
@@ -321,7 +323,7 @@ interface CheckboxGroupProps<TFieldValues extends FieldValues = FieldValues, TNa
|
|
|
321
323
|
* @param selectedValues - Array of selected option values
|
|
322
324
|
* @returns The transformed value to store in the form
|
|
323
325
|
*/
|
|
324
|
-
output?: (
|
|
326
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
325
327
|
};
|
|
326
328
|
/**
|
|
327
329
|
* Custom onChange handler that works alongside the form controller
|
|
@@ -1120,7 +1122,7 @@ interface RadioButtonGroupProps<TFieldValues extends FieldValues = FieldValues,
|
|
|
1120
1122
|
disabled?: boolean;
|
|
1121
1123
|
transform?: {
|
|
1122
1124
|
input?: (value: PathValue<TFieldValues, TName>) => TOption[TValueKey];
|
|
1123
|
-
output?: (
|
|
1125
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
1124
1126
|
};
|
|
1125
1127
|
gridProps?: GridProps;
|
|
1126
1128
|
}
|
|
@@ -1366,7 +1368,7 @@ interface TextFieldElementProps<TFieldValues extends FieldValues = FieldValues,
|
|
|
1366
1368
|
/** Transform value before displaying in input */
|
|
1367
1369
|
input?: (value: PathValue<TFieldValues, TName>) => TValue;
|
|
1368
1370
|
/** Transform input event to form value */
|
|
1369
|
-
output?: (
|
|
1371
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
1370
1372
|
};
|
|
1371
1373
|
/**
|
|
1372
1374
|
* The input label text
|
|
@@ -1510,7 +1512,7 @@ interface EnhancedTextFieldElementProps<TFieldValues extends FieldValues = Field
|
|
|
1510
1512
|
/** Transform value before displaying in input */
|
|
1511
1513
|
input?: (value: PathValue<TFieldValues, TName>) => TValue;
|
|
1512
1514
|
/** Transform input event to form value */
|
|
1513
|
-
output?: (
|
|
1515
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
1514
1516
|
};
|
|
1515
1517
|
/**
|
|
1516
1518
|
* Built-in field type for automatic transformation
|
|
@@ -1672,7 +1674,7 @@ interface TimePickerElementProps<TFieldValues extends FieldValues = FieldValues,
|
|
|
1672
1674
|
slotProps?: Omit<TimePickerSlotProps<TEnableAccessibleFieldDOMStructure>, "textField">;
|
|
1673
1675
|
transform?: {
|
|
1674
1676
|
input?: (value: PathValue<TFieldValues, TName>) => TValue | null;
|
|
1675
|
-
output?: (
|
|
1677
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
1676
1678
|
};
|
|
1677
1679
|
gridProps?: GridProps;
|
|
1678
1680
|
timePickerProps?: Omit<TimePickerProps<TEnableAccessibleFieldDOMStructure>, "value" | "slotProps">;
|
package/dist/wrappers/index.js
CHANGED
|
@@ -24,8 +24,8 @@ import {
|
|
|
24
24
|
useDatePickerStyles,
|
|
25
25
|
useDatePickerValidation,
|
|
26
26
|
useDatePickerValue
|
|
27
|
-
} from "../chunk-
|
|
28
|
-
import "../chunk-
|
|
27
|
+
} from "../chunk-CHZU4PZB.js";
|
|
28
|
+
import "../chunk-3OPVOWQK.js";
|
|
29
29
|
export {
|
|
30
30
|
AsyncMultiSelect2,
|
|
31
31
|
CheckboxElement,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gnwebsoft/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A set of reusable wrappers for MUI v7",
|
|
6
6
|
"author": "GNWebsoft Private Limited",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"test": "jest",
|
|
31
31
|
"test:watch": "jest --watch",
|
|
32
32
|
"test:coverage": "jest --coverage",
|
|
33
|
-
"test:ci": "jest --ci --coverage --watchAll=false
|
|
33
|
+
"test:ci": "jest --ci --coverage --watchAll=false",
|
|
34
34
|
"test:a11y": "jest --testNamePattern=\"a11y\"",
|
|
35
35
|
"docs:api": "typedoc",
|
|
36
36
|
"docs:api:md": "typedoc --plugin typedoc-plugin-markdown --out docs/markdown",
|