spotlibs-components 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{components/atoms → atoms}/icons/index.mjs +2 -2
- package/dist/{components/index.d.mts → index.d.mts} +1 -1
- package/dist/{components/index.mjs → index.mjs} +490 -678
- package/dist/index.mjs.map +1 -0
- package/dist/{components/mui → mui}/index.mjs +1 -1
- package/dist/{types-BkrxwBFm.d.mts → types-D1akE7ak.d.mts} +87 -149
- package/dist/types.d.mts +4 -0
- package/dist/utils/index.d.mts +104 -184
- package/package.json +3 -2
- package/src/utils/admin-kuota-nasional/constant.d.ts +23 -0
- package/src/utils/asset.d.ts +1 -0
- package/src/utils/booleanUtils.d.ts +2 -0
- package/src/utils/briguna-digital/constant.d.ts +2 -0
- package/src/utils/compress.d.ts +2 -0
- package/src/utils/compressImage.d.ts +6 -0
- package/src/utils/constants.d.ts +5 -0
- package/src/utils/cookies.d.ts +19 -0
- package/src/utils/crypto.d.ts +5 -0
- package/src/utils/decodeString.d.ts +1 -0
- package/src/utils/disableFormElements.d.ts +5 -0
- package/src/utils/excelUtils.d.ts +25 -0
- package/src/utils/exception.d.ts +19 -0
- package/src/utils/formatString.d.ts +25 -0
- package/src/utils/formatters/account.d.ts +2 -0
- package/src/utils/formatters/currency.d.ts +20 -0
- package/src/utils/formatters/date.d.ts +12 -0
- package/src/utils/formatters/index.d.ts +47 -0
- package/src/utils/formatters/string.d.ts +6 -0
- package/src/utils/generateImportExcel.d.ts +35 -0
- package/src/utils/generateTimestamp.d.ts +1 -0
- package/src/utils/handleApiError.d.ts +1 -0
- package/src/utils/index.d.ts +104 -0
- package/src/utils/json.d.ts +4 -0
- package/src/utils/localStorage.d.ts +1 -0
- package/src/utils/logger.d.ts +4 -0
- package/src/utils/schema/globalSchema.d.ts +8 -0
- package/src/utils/signature.d.ts +10 -0
- package/src/utils/specifics/korporasi/prakarsaKorporasiUtils.d.ts +5 -0
- package/src/utils/specifics/mikro/validationMaintenanceAgunanUtils.d.ts +2 -0
- package/src/utils/status.d.ts +37 -0
- package/src/utils/stringUtils.d.ts +22 -0
- package/src/utils/tipeBank.d.ts +3 -0
- package/dist/components/index.mjs.map +0 -1
- package/dist/components/types.d.mts +0 -4
- /package/dist/{components/atoms → atoms}/icons/index.d.mts +0 -0
- /package/dist/{components/atoms → atoms}/icons/index.mjs.map +0 -0
- /package/dist/{components/mui → mui}/index.d.mts +0 -0
- /package/dist/{components/mui → mui}/index.mjs.map +0 -0
- /package/dist/{components/types.mjs → types.mjs} +0 -0
- /package/dist/{components/types.mjs.map → types.mjs.map} +0 -0
|
@@ -243,7 +243,7 @@ declare const SpacingToken: {
|
|
|
243
243
|
spacing10: string;
|
|
244
244
|
};
|
|
245
245
|
|
|
246
|
-
declare const CONTENT_SPACING_TOKENS: {
|
|
246
|
+
declare const CONTENT_SPACING_TOKENS: {
|
|
247
247
|
spacing_1: {
|
|
248
248
|
mobile: string;
|
|
249
249
|
tablet: string;
|
|
@@ -258,41 +258,41 @@ declare const CONTENT_SPACING_TOKENS: {
|
|
|
258
258
|
mobile: string;
|
|
259
259
|
tablet: string;
|
|
260
260
|
web: string;
|
|
261
|
-
};
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
interface ResponsiveSpacingValue {
|
|
265
|
-
mobile?: string;
|
|
266
|
-
tablet?: string;
|
|
267
|
-
web?: string;
|
|
268
|
-
[key: string]: string | undefined;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
type SpacingSizeValue = keyof typeof SpacingToken | string | number;
|
|
272
|
-
|
|
273
|
-
type ContentSpacingSizeValue =
|
|
274
|
-
| keyof typeof CONTENT_SPACING_TOKENS
|
|
275
|
-
| ResponsiveSpacingValue;
|
|
276
|
-
|
|
277
|
-
interface SpacingProps {
|
|
278
|
-
size?: SpacingSizeValue;
|
|
279
|
-
axis?: "vertical" | "horizontal";
|
|
280
|
-
as?: React.ElementType;
|
|
281
|
-
className?: string;
|
|
282
|
-
style?: React.CSSProperties;
|
|
283
|
-
children?: React.ReactNode;
|
|
284
|
-
[key: string]: unknown;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
interface ContentSpacingProps {
|
|
288
|
-
size?: ContentSpacingSizeValue;
|
|
289
|
-
breakpoint?: "mobile" | "tablet" | "web";
|
|
290
|
-
as?: React.ElementType;
|
|
291
|
-
className?: string;
|
|
292
|
-
style?: React.CSSProperties;
|
|
293
|
-
children?: React.ReactNode;
|
|
294
|
-
[key: string]: unknown;
|
|
295
|
-
}
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
interface ResponsiveSpacingValue {
|
|
265
|
+
mobile?: string;
|
|
266
|
+
tablet?: string;
|
|
267
|
+
web?: string;
|
|
268
|
+
[key: string]: string | undefined;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
type SpacingSizeValue = keyof typeof SpacingToken | string | number;
|
|
272
|
+
|
|
273
|
+
type ContentSpacingSizeValue =
|
|
274
|
+
| keyof typeof CONTENT_SPACING_TOKENS
|
|
275
|
+
| ResponsiveSpacingValue;
|
|
276
|
+
|
|
277
|
+
interface SpacingProps {
|
|
278
|
+
size?: SpacingSizeValue;
|
|
279
|
+
axis?: "vertical" | "horizontal";
|
|
280
|
+
as?: React.ElementType;
|
|
281
|
+
className?: string;
|
|
282
|
+
style?: React.CSSProperties;
|
|
283
|
+
children?: React.ReactNode;
|
|
284
|
+
[key: string]: unknown;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
interface ContentSpacingProps {
|
|
288
|
+
size?: ContentSpacingSizeValue;
|
|
289
|
+
breakpoint?: "mobile" | "tablet" | "web";
|
|
290
|
+
as?: React.ElementType;
|
|
291
|
+
className?: string;
|
|
292
|
+
style?: React.CSSProperties;
|
|
293
|
+
children?: React.ReactNode;
|
|
294
|
+
[key: string]: unknown;
|
|
295
|
+
}
|
|
296
296
|
|
|
297
297
|
declare const Spacing: React.FC<SpacingProps>;
|
|
298
298
|
|
|
@@ -380,52 +380,6 @@ interface BaseButtonProps {
|
|
|
380
380
|
|
|
381
381
|
declare function BaseButton(props: BaseButtonProps): React.ReactElement;
|
|
382
382
|
|
|
383
|
-
interface BaseSkeletonProps {
|
|
384
|
-
/**
|
|
385
|
-
* Skeleton shape variant.
|
|
386
|
-
* - `text` — single line of text placeholder
|
|
387
|
-
* - `rectangular` — rectangle block placeholder
|
|
388
|
-
* - `rounded` — rectangle with border-radius
|
|
389
|
-
* - `circular` — circle placeholder (avatar, icon)
|
|
390
|
-
*/
|
|
391
|
-
variant?: "text" | "rectangular" | "rounded" | "circular";
|
|
392
|
-
/**
|
|
393
|
-
* Animation type.
|
|
394
|
-
* - `pulse` — fading animation (default)
|
|
395
|
-
* - `wave` — wave sweep animation
|
|
396
|
-
* - `none` — no animation (static)
|
|
397
|
-
*/
|
|
398
|
-
animation?: "pulse" | "wave" | "none";
|
|
399
|
-
/** Width of the skeleton. Accepts number (px) or string (e.g. "100%", "200px") */
|
|
400
|
-
width?: number | string;
|
|
401
|
-
/** Height of the skeleton. Accepts number (px) or string (e.g. "40px", "1.2em") */
|
|
402
|
-
height?: number | string;
|
|
403
|
-
/** Number of skeleton lines to render. If > 1, renders stacked skeletons. */
|
|
404
|
-
count?: number;
|
|
405
|
-
/** Gap between stacked skeletons when count > 1. Default is SpacingToken.spacing2 */
|
|
406
|
-
gap?: string | number;
|
|
407
|
-
/** MUI sx overrides */
|
|
408
|
-
sx?: SxProps;
|
|
409
|
-
[key: string]: any;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
declare function BaseSkeleton(props: BaseSkeletonProps): React.ReactElement;
|
|
413
|
-
|
|
414
|
-
interface BaseSwitchProps {
|
|
415
|
-
/** Current switch state */
|
|
416
|
-
status?: boolean;
|
|
417
|
-
/** Label text or element */
|
|
418
|
-
label?: React.ReactNode;
|
|
419
|
-
/** Label position relative to the switch */
|
|
420
|
-
labelPlacement?: "start" | "end" | "top" | "bottom";
|
|
421
|
-
/** Disabled state */
|
|
422
|
-
isDisabled?: boolean;
|
|
423
|
-
/** Change handler */
|
|
424
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
declare function BaseSwitch(props: BaseSwitchProps): React.ReactElement;
|
|
428
|
-
|
|
429
383
|
interface BaseCardProps {
|
|
430
384
|
/** Card variant type */
|
|
431
385
|
variant?: "default" | "with-header" | "with-header-footer";
|
|
@@ -455,10 +409,6 @@ interface BaseCardProps {
|
|
|
455
409
|
showEndIcon?: boolean;
|
|
456
410
|
/** Footer content (only for with-header-footer variant) */
|
|
457
411
|
footer?: React.ReactNode;
|
|
458
|
-
/** Enable watermark overlay on content area */
|
|
459
|
-
isWatermark?: boolean;
|
|
460
|
-
/** Watermark text (e.g. "000000 / Nama Lengkap") */
|
|
461
|
-
watermarkText?: string;
|
|
462
412
|
/** MUI sx overrides */
|
|
463
413
|
sx?: SxProps;
|
|
464
414
|
[key: string]: any;
|
|
@@ -466,32 +416,20 @@ interface BaseCardProps {
|
|
|
466
416
|
|
|
467
417
|
declare function BaseCard(props: BaseCardProps): React.ReactElement;
|
|
468
418
|
|
|
469
|
-
interface
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
message?: string;
|
|
481
|
-
/** Color variant */
|
|
482
|
-
variant?: "success" | "error" | "info" | "warning" | "default";
|
|
483
|
-
/** Auto hide duration in milliseconds */
|
|
484
|
-
duration?: number;
|
|
485
|
-
/** Anchor origin position */
|
|
486
|
-
position?: BaseSnackbarPosition;
|
|
487
|
-
/** Icon element or component. If not provided, no icon is shown. */
|
|
488
|
-
icon?: React.ReactNode | React.ComponentType<any>;
|
|
489
|
-
/** MUI sx overrides */
|
|
490
|
-
sx?: SxProps;
|
|
491
|
-
[key: string]: any;
|
|
419
|
+
interface BaseSwitchProps {
|
|
420
|
+
/** Current switch state */
|
|
421
|
+
status?: boolean;
|
|
422
|
+
/** Label text or element */
|
|
423
|
+
label?: React.ReactNode;
|
|
424
|
+
/** Label position relative to the switch */
|
|
425
|
+
labelPlacement?: "start" | "end" | "top" | "bottom";
|
|
426
|
+
/** Disabled state */
|
|
427
|
+
isDisabled?: boolean;
|
|
428
|
+
/** Change handler */
|
|
429
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
492
430
|
}
|
|
493
431
|
|
|
494
|
-
declare function
|
|
432
|
+
declare function BaseSwitch(props: BaseSwitchProps): React.ReactElement;
|
|
495
433
|
|
|
496
434
|
interface BaseCheckboxOption {
|
|
497
435
|
/** Label yang ditampilkan */
|
|
@@ -543,25 +481,25 @@ declare function BaseCheckbox(
|
|
|
543
481
|
props: BaseCheckboxProps,
|
|
544
482
|
): React.ReactElement | null;
|
|
545
483
|
|
|
546
|
-
type BaseDatatableAlign =
|
|
547
|
-
| "left"
|
|
548
|
-
| "center"
|
|
549
|
-
| "right"
|
|
550
|
-
| "justify"
|
|
551
|
-
| "inherit"
|
|
552
|
-
| (string & {});
|
|
553
|
-
|
|
554
|
-
interface BaseDatatableColumn<T = Record<string, any>> {
|
|
555
|
-
id?: string;
|
|
556
|
-
key?: string;
|
|
557
|
-
field?: string;
|
|
558
|
-
sortField?: string;
|
|
559
|
-
label?: ReactNode;
|
|
560
|
-
header?: ReactNode;
|
|
561
|
-
accessorKey?: string;
|
|
562
|
-
accessorFn?: (row: T) => any;
|
|
563
|
-
align?: BaseDatatableAlign;
|
|
564
|
-
headerAlign?: BaseDatatableAlign;
|
|
484
|
+
type BaseDatatableAlign =
|
|
485
|
+
| "left"
|
|
486
|
+
| "center"
|
|
487
|
+
| "right"
|
|
488
|
+
| "justify"
|
|
489
|
+
| "inherit"
|
|
490
|
+
| (string & {});
|
|
491
|
+
|
|
492
|
+
interface BaseDatatableColumn<T = Record<string, any>> {
|
|
493
|
+
id?: string;
|
|
494
|
+
key?: string;
|
|
495
|
+
field?: string;
|
|
496
|
+
sortField?: string;
|
|
497
|
+
label?: ReactNode;
|
|
498
|
+
header?: ReactNode;
|
|
499
|
+
accessorKey?: string;
|
|
500
|
+
accessorFn?: (row: T) => any;
|
|
501
|
+
align?: BaseDatatableAlign;
|
|
502
|
+
headerAlign?: BaseDatatableAlign;
|
|
565
503
|
width?: number;
|
|
566
504
|
minWidth?: number;
|
|
567
505
|
sticky?: "left" | "right";
|
|
@@ -580,11 +518,11 @@ interface BaseDatatableColumn<T = Record<string, any>> {
|
|
|
580
518
|
}) => ReactNode;
|
|
581
519
|
}
|
|
582
520
|
|
|
583
|
-
interface BaseDatatableHeaderCell {
|
|
584
|
-
id?: string;
|
|
585
|
-
key?: string;
|
|
586
|
-
label: ReactNode;
|
|
587
|
-
align?: BaseDatatableAlign;
|
|
521
|
+
interface BaseDatatableHeaderCell {
|
|
522
|
+
id?: string;
|
|
523
|
+
key?: string;
|
|
524
|
+
label: ReactNode;
|
|
525
|
+
align?: BaseDatatableAlign;
|
|
588
526
|
colSpan?: number;
|
|
589
527
|
rowSpan?: number;
|
|
590
528
|
colspan?: number;
|
|
@@ -615,12 +553,12 @@ interface BaseDatatableSortState {
|
|
|
615
553
|
direction: "asc" | "desc";
|
|
616
554
|
}
|
|
617
555
|
|
|
618
|
-
interface BaseDatatableSortPayload {
|
|
619
|
-
orderBy: string;
|
|
620
|
-
order: "asc" | "desc";
|
|
621
|
-
page: number;
|
|
622
|
-
rowsPerPage: number;
|
|
623
|
-
}
|
|
556
|
+
interface BaseDatatableSortPayload {
|
|
557
|
+
orderBy: string;
|
|
558
|
+
order: "asc" | "desc";
|
|
559
|
+
page: number;
|
|
560
|
+
rowsPerPage: number;
|
|
561
|
+
}
|
|
624
562
|
|
|
625
563
|
interface BaseDatatableLayout {
|
|
626
564
|
stickyHeader?: boolean;
|
|
@@ -686,14 +624,14 @@ interface BaseDatatableProps<T = Record<string, any>> {
|
|
|
686
624
|
layout?: BaseDatatableLayout;
|
|
687
625
|
selection?: BaseDatatableSelection<T>;
|
|
688
626
|
pagination?: BaseDatatablePagination;
|
|
689
|
-
renderRow?: (context: BaseDatatableRenderRowContext<T>) => ReactNode;
|
|
690
|
-
onRowClick?: (row: T, rowIndex: number) => void;
|
|
691
|
-
getRowId?: (row: T, rowIndex: number) => string | number;
|
|
692
|
-
emptyState?: ReactNode;
|
|
693
|
-
loading?: boolean;
|
|
694
|
-
loadingText?: ReactNode;
|
|
695
|
-
rowHover?: boolean;
|
|
696
|
-
activeRowId?: string | number | null;
|
|
627
|
+
renderRow?: (context: BaseDatatableRenderRowContext<T>) => ReactNode;
|
|
628
|
+
onRowClick?: (row: T, rowIndex: number) => void;
|
|
629
|
+
getRowId?: (row: T, rowIndex: number) => string | number;
|
|
630
|
+
emptyState?: ReactNode;
|
|
631
|
+
loading?: boolean;
|
|
632
|
+
loadingText?: ReactNode;
|
|
633
|
+
rowHover?: boolean;
|
|
634
|
+
activeRowId?: string | number | null;
|
|
697
635
|
containerSx?: SxProps;
|
|
698
636
|
tableSx?: SxProps;
|
|
699
637
|
}
|
|
@@ -1143,4 +1081,4 @@ declare function BaseModalOTP(
|
|
|
1143
1081
|
props: BaseModalOTPProps,
|
|
1144
1082
|
): React.ReactElement | null;
|
|
1145
1083
|
|
|
1146
|
-
export { type
|
|
1084
|
+
export { type BaseStepperProps as $, type BaseDatatableAlign as A, BaseAlert as B, CONTENT_SPACING_TOKENS as C, DerivedColor as D, type BaseDatatableColumn as E, type BaseDatatableFeatures as F, type BaseDatatableHeaderCell as G, type BaseDatatableLayout as H, type BaseDatatablePagination as I, type BaseDatatableProps as J, type BaseDatatableSelection as K, type BaseDatatableSortPayload as L, type BaseDatatableSortState as M, type BaseDatePickerProps as N, type BaseDropdownProps as O, PrimitiveColor as P, type BaseDropzoneProps as Q, Radius as R, Shadow as S, TextFieldUpload as T, type BaseModalOTPProps as U, VariantStyles as V, type BaseModalProps as W, type BaseModalStepperProps as X, type BaseModalStepperStep as Y, type BaseRadioButtonProps as Z, type BaseStepperDashboardStep as _, BaseButton as a, type BaseStepperSimpleStep as a0, type BaseSwitchProps as a1, type BaseTextAreaProps as a2, type BaseTextFieldProps as a3, type ContentSpacingProps as a4, type DerivedColorType as a5, type PrimitiveColorType as a6, type RadiusLevel as a7, type RadiusMap as a8, type RadiusTokenProps as a9, type ShadowElevation as aa, type ShadowLevel as ab, type ShadowMap as ac, type ShadowTokenProps as ad, type SpacingProps as ae, type TextFieldUploadProps as af, type TypographyColor as ag, type TypographyProps as ah, type TypographyVariant as ai, BaseCard as b, BaseCheckbox as c, BaseDatatable as d, BaseDatePicker as e, BaseDropdown as f, BaseDropzone as g, BaseModal as h, BaseModalOTP as i, BaseModalStepper as j, BaseRadioButton as k, BaseStepper as l, BaseSwitch as m, BaseTextArea as n, BaseTextField as o, BaseTypography as p, ContentSpacing as q, RadiusToken as r, ShadowToken as s, Spacing as t, SpacingToken as u, type BaseAlertProps as v, type BaseButtonProps as w, type BaseCardProps as x, type BaseCheckboxOption as y, type BaseCheckboxProps as z };
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { v as BaseAlertProps, w as BaseButtonProps, x as BaseCardProps, y as BaseCheckboxOption, z as BaseCheckboxProps, A as BaseDatatableAlign, E as BaseDatatableColumn, F as BaseDatatableFeatures, G as BaseDatatableHeaderCell, H as BaseDatatableLayout, I as BaseDatatablePagination, J as BaseDatatableProps, K as BaseDatatableSelection, L as BaseDatatableSortPayload, M as BaseDatatableSortState, N as BaseDatePickerProps, O as BaseDropdownProps, Q as BaseDropzoneProps, U as BaseModalOTPProps, W as BaseModalProps, X as BaseModalStepperProps, Y as BaseModalStepperStep, Z as BaseRadioButtonProps, _ as BaseStepperDashboardStep, $ as BaseStepperProps, a0 as BaseStepperSimpleStep, a1 as BaseSwitchProps, a2 as BaseTextAreaProps, a3 as BaseTextFieldProps, a4 as ContentSpacingProps, a5 as DerivedColorType, a6 as PrimitiveColorType, a7 as RadiusLevel, a8 as RadiusMap, a9 as RadiusTokenProps, aa as ShadowElevation, ab as ShadowLevel, ac as ShadowMap, ad as ShadowTokenProps, ae as SpacingProps, af as TextFieldUploadProps, ag as TypographyColor, ah as TypographyProps, ai as TypographyVariant } from './types-D1akE7ak.mjs';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '@mui/material/styles';
|
|
4
|
+
import 'react-hook-form';
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,186 +1,106 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
declare function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
declare function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
declare function
|
|
60
|
-
declare function
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
declare
|
|
64
|
-
declare
|
|
65
|
-
declare
|
|
66
|
-
declare
|
|
67
|
-
declare
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
declare
|
|
91
|
-
declare
|
|
92
|
-
declare
|
|
93
|
-
declare
|
|
94
|
-
declare
|
|
95
|
-
|
|
96
|
-
declare
|
|
97
|
-
declare
|
|
98
|
-
declare
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
declare const NOT_AUTHORIZE_RESPONSE_CODE: string[];
|
|
105
|
-
declare const PUBLIC_PATHS: string[];
|
|
106
|
-
declare const COOKIE_MAX_SIZE: 2000;
|
|
107
|
-
declare const CLIENT_PUBLIC_API_ROUTES: string[];
|
|
108
|
-
declare const CLIENT_ALLOWED_ORIGINS: (string | RegExp)[];
|
|
109
|
-
|
|
110
|
-
declare function disableFormElements(selector: any): void;
|
|
111
|
-
declare function disableFormBuilder(fields: any, roleAccess: any): any;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Cek apakah responseCode termasuk exception.
|
|
115
|
-
* @param {string} responseCode - Response code dari API
|
|
116
|
-
* @returns {boolean} True jika code ada di daftar exception
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* isExceptionCode("00") // false (success)
|
|
120
|
-
* isExceptionCode("X0") // true (header exception)
|
|
121
|
-
* isExceptionCode("02") // true (not found)
|
|
122
|
-
*/
|
|
123
|
-
declare function isExceptionCode(responseCode: string): boolean;
|
|
124
|
-
/**
|
|
125
|
-
* Get human-readable message dari exception code.
|
|
126
|
-
* @param {string} responseCode - Response code dari API
|
|
127
|
-
* @returns {string} Exception message
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* getExceptionMessage("X1") // "Access denied"
|
|
131
|
-
* getExceptionMessage("99") // "Internal system error"
|
|
132
|
-
* getExceptionMessage("unknown") // "An unexpected error occurred"
|
|
133
|
-
*/
|
|
1
|
+
// Formatters - Currency
|
|
2
|
+
declare function formatCurrency(
|
|
3
|
+
value: number | string | null | undefined,
|
|
4
|
+
options?: {
|
|
5
|
+
locale?: string;
|
|
6
|
+
currency?: string;
|
|
7
|
+
minFractionDigits?: number;
|
|
8
|
+
maxFractionDigits?: number;
|
|
9
|
+
}
|
|
10
|
+
): string;
|
|
11
|
+
declare function formatRupiah(value: number | string | null | undefined): string;
|
|
12
|
+
declare function formatNominal(
|
|
13
|
+
value: number | string | null | undefined,
|
|
14
|
+
options?: {
|
|
15
|
+
locale?: string;
|
|
16
|
+
minFractionDigits?: number;
|
|
17
|
+
maxFractionDigits?: number;
|
|
18
|
+
decimalSeparator?: string;
|
|
19
|
+
}
|
|
20
|
+
): string;
|
|
21
|
+
declare function formatDigit(value: number | string): string;
|
|
22
|
+
|
|
23
|
+
// Formatters - Account
|
|
24
|
+
declare function formatAccountNumber(value: string | null | undefined): string;
|
|
25
|
+
declare function formatNPWP(value: string | null | undefined): string;
|
|
26
|
+
|
|
27
|
+
// Formatters - Date
|
|
28
|
+
declare function toYearFirstDash(value: Date | string): string;
|
|
29
|
+
declare function toDateFirstSlash(value: Date | string): string;
|
|
30
|
+
declare function formatDateToDDSlashMMSlashYYYY(date: Date): string;
|
|
31
|
+
declare function formatDateToDDMMYYYY(date: Date): string;
|
|
32
|
+
declare function yearFirstDashToDateFirstDash(value: string): string;
|
|
33
|
+
declare function yearFirstDashToDateFirstSlash(value: string): string;
|
|
34
|
+
declare function dateFirstSlashToYearFirstDash(value: string): string;
|
|
35
|
+
declare function sevenDigitToDateFirstSlash(value: string): string;
|
|
36
|
+
declare function sevenDigitToYearFirstDash(value: string): string;
|
|
37
|
+
declare function sevenDigitToDateFirstDash(value: string): string;
|
|
38
|
+
declare function toDateTimeHourMinute(value: string): string;
|
|
39
|
+
declare function ddmmyyToSlashDate(value: string): string;
|
|
40
|
+
|
|
41
|
+
// Formatters - String
|
|
42
|
+
declare function formatResponseDesc(desc: string): string;
|
|
43
|
+
declare function titleCase(str: string): string;
|
|
44
|
+
declare function snakeToCamelWithSpace(snakeStr: string): string;
|
|
45
|
+
declare function stringToBoolean(str: string): boolean | undefined;
|
|
46
|
+
declare function matchWiths(targetStr: string, values?: string[]): boolean;
|
|
47
|
+
declare function maskString(value: string, type?: string): string;
|
|
48
|
+
|
|
49
|
+
// JSON
|
|
50
|
+
declare function parseJSON(value: string): unknown;
|
|
51
|
+
declare function jsonToStringLimiter(value?: unknown): string | null;
|
|
52
|
+
declare function errorState(name: string, errors: unknown): unknown;
|
|
53
|
+
declare function ascendingStringify(obj: unknown): string;
|
|
54
|
+
|
|
55
|
+
// Asset
|
|
56
|
+
declare function callAsset(uri?: string): string;
|
|
57
|
+
|
|
58
|
+
// Boolean Utils
|
|
59
|
+
declare function checkRoleUser(roles: string[], listRole: string[]): boolean;
|
|
60
|
+
declare function toggleUsingDummyWbenchEndpoint(status: boolean): boolean;
|
|
61
|
+
|
|
62
|
+
// Constants
|
|
63
|
+
declare const NOT_AUTHORIZE_RESPONSE_CODE: string[];
|
|
64
|
+
declare const PUBLIC_PATHS: string[];
|
|
65
|
+
declare const COOKIE_MAX_SIZE: number;
|
|
66
|
+
declare const CLIENT_PUBLIC_API_ROUTES: string[];
|
|
67
|
+
declare const CLIENT_ALLOWED_ORIGINS: Array<string | RegExp>;
|
|
68
|
+
|
|
69
|
+
// Disable Form
|
|
70
|
+
declare function disableFormElements(selector: string): void;
|
|
71
|
+
declare function disableFormBuilder(
|
|
72
|
+
fields: Array<Record<string, unknown> | null>,
|
|
73
|
+
roleAccess: boolean
|
|
74
|
+
): Array<Record<string, unknown> | null>;
|
|
75
|
+
|
|
76
|
+
// Generate Timestamp
|
|
77
|
+
declare function generateVcifId(): string;
|
|
78
|
+
|
|
79
|
+
// LocalStorage
|
|
80
|
+
declare function getLocalStorageItem(key: string): unknown;
|
|
81
|
+
|
|
82
|
+
// Tipe Bank
|
|
83
|
+
declare function getTipeBankKorporasi(
|
|
84
|
+
data: Array<{ status_perusahaan: string; tipe_bank: string }>
|
|
85
|
+
): string;
|
|
86
|
+
|
|
87
|
+
// Exception
|
|
88
|
+
declare const HEADER_EXCEPTION: string;
|
|
89
|
+
declare const ACCESS_EXCEPTION: string;
|
|
90
|
+
declare const PARAMETER_EXCEPTION: string;
|
|
91
|
+
declare const NOTFOUND_EXCEPTION: string;
|
|
92
|
+
declare const INVALIDRULE_EXCEPTION: string;
|
|
93
|
+
declare const THIRDPARTY_EXCEPTION: string;
|
|
94
|
+
declare const WAITING_EXCEPTION: string;
|
|
95
|
+
declare const UNSUPPORTED_EXCEPTION: string;
|
|
96
|
+
declare const RUNTIME_EXCEPTION: string;
|
|
97
|
+
declare const EXCEPTION_MESSAGES: Record<string, string>;
|
|
98
|
+
declare class ApiException extends Error {
|
|
99
|
+
responseCode: string;
|
|
100
|
+
responseDesc: string;
|
|
101
|
+
constructor(responseCode: string, responseDesc?: string);
|
|
102
|
+
}
|
|
103
|
+
declare function isExceptionCode(responseCode: string): boolean;
|
|
134
104
|
declare function getExceptionMessage(responseCode: string): string;
|
|
135
|
-
/**
|
|
136
|
-
* Exception Utilities
|
|
137
|
-
*
|
|
138
|
-
* Standardized exception codes dan ApiException class untuk handling error dari backend API.
|
|
139
|
-
*/
|
|
140
|
-
declare const HEADER_EXCEPTION: "X0";
|
|
141
|
-
declare const ACCESS_EXCEPTION: "X1";
|
|
142
|
-
declare const PARAMETER_EXCEPTION: "01";
|
|
143
|
-
declare const NOTFOUND_EXCEPTION: "02";
|
|
144
|
-
declare const INVALIDRULE_EXCEPTION: "03";
|
|
145
|
-
declare const THIRDPARTY_EXCEPTION: "04";
|
|
146
|
-
declare const WAITING_EXCEPTION: "05";
|
|
147
|
-
declare const UNSUPPORTED_EXCEPTION: "06";
|
|
148
|
-
declare const RUNTIME_EXCEPTION: "99";
|
|
149
|
-
declare const EXCEPTION_MESSAGES: {
|
|
150
|
-
X0: string;
|
|
151
|
-
X1: string;
|
|
152
|
-
"01": string;
|
|
153
|
-
"02": string;
|
|
154
|
-
"03": string;
|
|
155
|
-
"04": string;
|
|
156
|
-
"05": string;
|
|
157
|
-
"06": string;
|
|
158
|
-
"99": string;
|
|
159
|
-
};
|
|
160
|
-
/**
|
|
161
|
-
* Custom exception class untuk API errors.
|
|
162
|
-
* Menyimpan responseCode dan responseDesc dari backend.
|
|
163
|
-
*
|
|
164
|
-
* @example
|
|
165
|
-
* throw new ApiException("02", "Prakarsa tidak ditemukan");
|
|
166
|
-
*
|
|
167
|
-
* @example
|
|
168
|
-
* // Tanpa custom message — pakai default dari EXCEPTION_MESSAGES
|
|
169
|
-
* throw new ApiException("X1");
|
|
170
|
-
* // Error: [X1] Access denied
|
|
171
|
-
*/
|
|
172
|
-
declare class ApiException extends Error {
|
|
173
|
-
constructor(responseCode: any, responseDesc: any);
|
|
174
|
-
responseCode: any;
|
|
175
|
-
responseDesc: any;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
declare function dashedAccount(value: any): any;
|
|
179
|
-
declare function dashedNPWP(value: any): any;
|
|
180
|
-
declare function formatCurrency(value: any, country?: string, curr?: string, minFrac?: number, maxFrac?: number): string;
|
|
181
|
-
declare function formatResponseDesc(desc: any): any;
|
|
182
|
-
declare function formatNominal(value: any, locale?: string, minFrac?: number, maxFrac?: number, commaSeparator?: string): any;
|
|
183
|
-
declare function titleCase(str: any): any;
|
|
184
|
-
declare function stringToBoolean(str: any): boolean;
|
|
185
105
|
|
|
186
|
-
export { ACCESS_EXCEPTION, ApiException, CLIENT_ALLOWED_ORIGINS, CLIENT_PUBLIC_API_ROUTES, COOKIE_MAX_SIZE, EXCEPTION_MESSAGES, HEADER_EXCEPTION, INVALIDRULE_EXCEPTION, NOTFOUND_EXCEPTION, NOT_AUTHORIZE_RESPONSE_CODE, PARAMETER_EXCEPTION, PUBLIC_PATHS, RUNTIME_EXCEPTION, THIRDPARTY_EXCEPTION, UNSUPPORTED_EXCEPTION, WAITING_EXCEPTION, ascendingStringify, callAsset, checkRoleUser,
|
|
106
|
+
export { ACCESS_EXCEPTION, ApiException, CLIENT_ALLOWED_ORIGINS, CLIENT_PUBLIC_API_ROUTES, COOKIE_MAX_SIZE, EXCEPTION_MESSAGES, HEADER_EXCEPTION, INVALIDRULE_EXCEPTION, NOTFOUND_EXCEPTION, NOT_AUTHORIZE_RESPONSE_CODE, PARAMETER_EXCEPTION, PUBLIC_PATHS, RUNTIME_EXCEPTION, THIRDPARTY_EXCEPTION, UNSUPPORTED_EXCEPTION, WAITING_EXCEPTION, ascendingStringify, callAsset, checkRoleUser, dateFirstSlashToYearFirstDash, ddmmyyToSlashDate, disableFormBuilder, disableFormElements, errorState, formatAccountNumber, formatCurrency, formatDateToDDMMYYYY, formatDateToDDSlashMMSlashYYYY, formatDigit, formatNPWP, formatNominal, formatResponseDesc, formatRupiah, generateVcifId, getExceptionMessage, getLocalStorageItem, getTipeBankKorporasi, isExceptionCode, jsonToStringLimiter, maskString, matchWiths, parseJSON, sevenDigitToDateFirstDash, sevenDigitToDateFirstSlash, sevenDigitToYearFirstDash, snakeToCamelWithSpace, stringToBoolean, titleCase, toDateFirstSlash, toDateTimeHourMinute, toYearFirstDash, toggleUsingDummyWbenchEndpoint, yearFirstDashToDateFirstDash, yearFirstDashToDateFirstSlash };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spotlibs-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -29,10 +29,12 @@
|
|
|
29
29
|
"default": "./dist/mui/index.mjs"
|
|
30
30
|
},
|
|
31
31
|
"./utils": {
|
|
32
|
+
"types": "./dist/utils/index.d.mts",
|
|
32
33
|
"import": "./dist/utils/index.mjs",
|
|
33
34
|
"default": "./dist/utils/index.mjs"
|
|
34
35
|
},
|
|
35
36
|
"./utils/*": {
|
|
37
|
+
"types": "./src/utils/*.d.ts",
|
|
36
38
|
"import": "./src/utils/*.js",
|
|
37
39
|
"default": "./src/utils/*.js"
|
|
38
40
|
}
|
|
@@ -40,7 +42,6 @@
|
|
|
40
42
|
"dependencies": {
|
|
41
43
|
"@emotion/react": "^11.14.0",
|
|
42
44
|
"@emotion/styled": "^11.14.1",
|
|
43
|
-
"@hirohe/react-watermark": "^0.5.0",
|
|
44
45
|
"@hookform/error-message": "^2.0.1",
|
|
45
46
|
"@hookform/resolvers": "^3.1.1",
|
|
46
47
|
"@mui/icons-material": "^5.16.14",
|