@mertcankocak/core-project 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/FormikDropdown/FormikDropdown.d.ts +49 -0
- package/dist/components/FormikDropdown/FormikDropdown.d.ts.map +1 -0
- package/dist/components/FormikDropdown/index.d.ts +4 -0
- package/dist/components/FormikDropdown/index.d.ts.map +1 -0
- package/dist/components/FormikDropdown/types.d.ts +9 -0
- package/dist/components/FormikDropdown/types.d.ts.map +1 -0
- package/dist/components/FormikTextField/FormikTextField.d.ts +55 -0
- package/dist/components/FormikTextField/FormikTextField.d.ts.map +1 -0
- package/dist/components/FormikTextField/constants.d.ts +14 -0
- package/dist/components/FormikTextField/constants.d.ts.map +1 -0
- package/dist/components/FormikTextField/helpers.d.ts +9 -0
- package/dist/components/FormikTextField/helpers.d.ts.map +1 -0
- package/dist/components/FormikTextField/index.d.ts +7 -0
- package/dist/components/FormikTextField/index.d.ts.map +1 -0
- package/dist/components/FormikTextField/masks.d.ts +28 -0
- package/dist/components/FormikTextField/masks.d.ts.map +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/core-project.es.js +1416 -345
- package/dist/core-project.umd.js +30 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/stringUtils.d.ts +5 -0
- package/dist/utils/stringUtils.d.ts.map +1 -0
- package/package.json +18 -5
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SelectProps as MuiSelectProps, SxProps, Theme } from '@mui/material';
|
|
3
|
+
import { FormikDropdownOption } from './types';
|
|
4
|
+
|
|
5
|
+
export interface FormikDropdownProps extends Omit<MuiSelectProps, "name" | "value" | "onChange" | "onBlur" | "sx"> {
|
|
6
|
+
name: string;
|
|
7
|
+
options: FormikDropdownOption[];
|
|
8
|
+
label?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
helperText?: string;
|
|
15
|
+
autoFocus?: boolean;
|
|
16
|
+
errorMessageFormatter?: (error: string) => string;
|
|
17
|
+
"aria-label"?: string;
|
|
18
|
+
"aria-describedby"?: string;
|
|
19
|
+
/**
|
|
20
|
+
* MUI sx prop - Select için özelleştirme
|
|
21
|
+
*/
|
|
22
|
+
sx?: SxProps<Theme>;
|
|
23
|
+
/**
|
|
24
|
+
* FormControl için sx
|
|
25
|
+
*/
|
|
26
|
+
formControlSx?: SxProps<Theme>;
|
|
27
|
+
/**
|
|
28
|
+
* Multiple select desteği
|
|
29
|
+
*/
|
|
30
|
+
multiple?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Arama özelliği (Autocomplete kullanır)
|
|
33
|
+
*/
|
|
34
|
+
searchable?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Arama için placeholder
|
|
37
|
+
*/
|
|
38
|
+
searchPlaceholder?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Custom onChange handler
|
|
41
|
+
*/
|
|
42
|
+
onChange?: (value: string | number | (string | number)[]) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Custom render option function
|
|
45
|
+
*/
|
|
46
|
+
renderOption?: (option: FormikDropdownOption, index: number) => React.ReactNode;
|
|
47
|
+
}
|
|
48
|
+
export declare const FormikDropdown: React.ForwardRefExoticComponent<Omit<FormikDropdownProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
49
|
+
//# sourceMappingURL=FormikDropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormikDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/FormikDropdown/FormikDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO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oB,EAC5B,KAAK,EAAE,MAAM,KACV,KAAK,CAAC,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,cAAc,yGA6M1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormikDropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/FormikDropdown/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TextFieldProps as MuiTextFieldProps, SxProps, Theme } from '@mui/material';
|
|
3
|
+
import { MaskType } from './masks';
|
|
4
|
+
|
|
5
|
+
export interface FormikTextFieldProps extends Omit<MuiTextFieldProps, "name" | "value" | "onChange" | "onBlur" | "sx"> {
|
|
6
|
+
name: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
fieldToSearch?: string;
|
|
12
|
+
onSuggestionSearch?: (fieldName: string, searchTerm: string) => Promise<string[]>;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
step?: string | number;
|
|
15
|
+
min?: string | number;
|
|
16
|
+
max?: string | number;
|
|
17
|
+
startAdornment?: React.ReactNode;
|
|
18
|
+
endAdornment?: React.ReactNode;
|
|
19
|
+
disableUppercase?: boolean;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
fullWidth?: boolean;
|
|
22
|
+
debounceDelay?: number;
|
|
23
|
+
minSearchLength?: number;
|
|
24
|
+
helperText?: string;
|
|
25
|
+
autoFocus?: boolean;
|
|
26
|
+
multiline?: boolean;
|
|
27
|
+
rows?: number;
|
|
28
|
+
maxLength?: number;
|
|
29
|
+
errorMessageFormatter?: (error: string) => string;
|
|
30
|
+
"aria-label"?: string;
|
|
31
|
+
"aria-describedby"?: string;
|
|
32
|
+
/**
|
|
33
|
+
* MUI sx prop - TextField için özelleştirme
|
|
34
|
+
* @example sx={{ backgroundColor: 'red', '& .MuiInputBase-root': { borderRadius: 2 } }}
|
|
35
|
+
*/
|
|
36
|
+
sx?: SxProps<Theme>;
|
|
37
|
+
/**
|
|
38
|
+
* InputProps içindeki sx - Input root elementi için özelleştirme
|
|
39
|
+
*/
|
|
40
|
+
inputSx?: SxProps<Theme>;
|
|
41
|
+
/**
|
|
42
|
+
* InputProps içindeki input sx - Input elementi için özelleştirme
|
|
43
|
+
*/
|
|
44
|
+
inputElementSx?: SxProps<Theme>;
|
|
45
|
+
/**
|
|
46
|
+
* Input masking - telefon, tarih, tcKimlikNo, iban veya custom function
|
|
47
|
+
*/
|
|
48
|
+
mask?: MaskType;
|
|
49
|
+
/**
|
|
50
|
+
* Password show/hide icon gösterimi (type="password" için)
|
|
51
|
+
*/
|
|
52
|
+
showPasswordToggle?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export declare const FormikTextField: React.ForwardRefExoticComponent<Omit<FormikTextFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
//# sourceMappingURL=FormikTextField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormikTextField.d.ts","sourceRoot":"","sources":["../../../src/components/FormikTextField/FormikTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,EAML,cAAc,IAAI,iBA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AM,KAAK,MAAM,CAAC;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACzB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAChC;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,eAAe,0GA+R3B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormikTextField constants
|
|
3
|
+
*/
|
|
4
|
+
export declare const DEFAULT_DEBOUNCE_DELAY = 300;
|
|
5
|
+
export declare const DEFAULT_MIN_SEARCH_LENGTH = 1;
|
|
6
|
+
/**
|
|
7
|
+
* Input types that should not be converted to uppercase
|
|
8
|
+
*/
|
|
9
|
+
export declare const NON_UPPERCASE_TYPES: readonly ["password", "email", "number", "tel", "url"];
|
|
10
|
+
/**
|
|
11
|
+
* Allowed keyboard keys for number input
|
|
12
|
+
*/
|
|
13
|
+
export declare const ALLOWED_NUMBER_KEYS: readonly ["Backspace", "Delete", "ArrowLeft", "ArrowRight", "Tab", "Enter", "Escape"];
|
|
14
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/FormikTextField/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,mBAAmB,wDAMtB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,mBAAmB,uFAQtB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Değeri büyük harfe çevirir (gerekirse)
|
|
3
|
+
*/
|
|
4
|
+
export declare function transformValue(value: string, type: string, disableUppercase: boolean): string;
|
|
5
|
+
/**
|
|
6
|
+
* Number input için geçerli tuş kontrolü
|
|
7
|
+
*/
|
|
8
|
+
export declare function isValidNumberKey(key: string): boolean;
|
|
9
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/components/FormikTextField/helpers.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,OAAO,GACxB,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { FormikTextField } from './FormikTextField';
|
|
2
|
+
export type { FormikTextFieldProps } from './FormikTextField';
|
|
3
|
+
export { transformValue, isValidNumberKey } from './helpers';
|
|
4
|
+
export { DEFAULT_DEBOUNCE_DELAY, DEFAULT_MIN_SEARCH_LENGTH, NON_UPPERCASE_TYPES, ALLOWED_NUMBER_KEYS, } from './constants';
|
|
5
|
+
export { applyMask, maskPhone, maskDate, maskTCKimlikNo, maskIBAN, } from './masks';
|
|
6
|
+
export type { MaskType } from './masks';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormikTextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,cAAc,EACd,QAAQ,GACT,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input masking utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Telefon numarası maskeleme (TR format: 05XX XXX XX XX)
|
|
6
|
+
*/
|
|
7
|
+
export declare function maskPhone(value: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Tarih maskeleme (DD/MM/YYYY)
|
|
10
|
+
*/
|
|
11
|
+
export declare function maskDate(value: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* TC Kimlik No maskeleme (XXX XXX XXX)
|
|
14
|
+
*/
|
|
15
|
+
export declare function maskTCKimlikNo(value: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* IBAN maskeleme (TRXX XXXX XXXX XXXX XXXX XXXX XX)
|
|
18
|
+
*/
|
|
19
|
+
export declare function maskIBAN(value: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Maskeleme tipi
|
|
22
|
+
*/
|
|
23
|
+
export type MaskType = "phone" | "date" | "tcKimlikNo" | "iban" | ((value: string) => string);
|
|
24
|
+
/**
|
|
25
|
+
* Maskeleme fonksiyonu
|
|
26
|
+
*/
|
|
27
|
+
export declare function applyMask(value: string, maskType?: MaskType): string;
|
|
28
|
+
//# sourceMappingURL=masks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"masks.d.ts","sourceRoot":"","sources":["../../../src/components/FormikTextField/masks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAiB/C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAY9C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAYpD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAmC9C;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,MAAM,GACN,YAAY,GACZ,MAAM,GACN,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;AAEhC;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,CAmBpE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { FormikTextField } from './FormikTextField';
|
|
2
|
+
export type { FormikTextFieldProps } from './FormikTextField';
|
|
3
|
+
export { FormikDropdown } from './FormikDropdown';
|
|
4
|
+
export type { FormikDropdownProps, FormikDropdownOption, } from './FormikDropdown';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EACV,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC"}
|