@kilnonedre/foundation 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -397,7 +397,7 @@ interface ConfigProp$3 {
|
|
|
397
397
|
declare const FormTimePicker: (props: ConfigProp$3) => react_jsx_runtime.JSX.Element;
|
|
398
398
|
|
|
399
399
|
interface ConfigProps {
|
|
400
|
-
value?: Array<
|
|
400
|
+
value?: Array<UUID>;
|
|
401
401
|
onChange?: (_ids: string[]) => void;
|
|
402
402
|
className?: string;
|
|
403
403
|
disabled?: boolean;
|
|
@@ -405,7 +405,7 @@ interface ConfigProps {
|
|
|
405
405
|
readonly?: boolean;
|
|
406
406
|
maxSizeKb?: number;
|
|
407
407
|
upload: (_formData: FormData) => Promise<ConfigApiRespT<CommonObject>>;
|
|
408
|
-
read: (_id:
|
|
408
|
+
read: (_id: UUID) => Promise<ConfigApiRespT<CommonObject>>;
|
|
409
409
|
onError?: (_message: string) => void;
|
|
410
410
|
}
|
|
411
411
|
|
|
@@ -496,10 +496,10 @@ declare const isValidURL: (string: string) => boolean;
|
|
|
496
496
|
*/
|
|
497
497
|
declare const emptyToUndefined: (value: unknown) => string | undefined;
|
|
498
498
|
declare const enumValues: <T extends Record<string, string>>(obj: T) => [T[keyof T], ...T[keyof T][]];
|
|
499
|
-
declare const zTextOptional: (label: string, min?: number, max?: number) => z.
|
|
499
|
+
declare const zTextOptional: (label: string, min?: number, max?: number) => z.ZodString;
|
|
500
500
|
declare const zTextRequired: (label: string, min?: number, max?: number) => z.ZodString;
|
|
501
501
|
declare const zIdCard: (label?: string) => z.ZodString;
|
|
502
|
-
declare const zIdCardOptional: (label?: string) => z.
|
|
502
|
+
declare const zIdCardOptional: (label?: string) => z.ZodOptional<z.ZodString>;
|
|
503
503
|
declare const zEmail: (max?: number) => z.ZodString;
|
|
504
504
|
declare const zPhone: (max?: number) => z.ZodString;
|
|
505
505
|
declare const zId: (label?: string) => z.ZodString;
|
|
@@ -520,8 +520,8 @@ declare const zDateOptional: (label: string) => z.ZodOptional<z.ZodDate>;
|
|
|
520
520
|
declare const zNumber: (label: string, min?: number, max?: number) => z.ZodNumber;
|
|
521
521
|
declare const zNumberOptional: (label: string, min?: number, max?: number) => z.ZodOptional<z.ZodNumber>;
|
|
522
522
|
declare const zCoerceNumber: (label: string, min?: number, max?: number) => z.ZodCoercedNumber<unknown>;
|
|
523
|
-
declare const zCoerceNumberOptional: (label: string, min?: number, max?: number) => z.
|
|
523
|
+
declare const zCoerceNumberOptional: (label: string, min?: number, max?: number) => z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
524
524
|
declare const zDecimal: (label: string, min?: number, max?: number) => z.ZodString;
|
|
525
|
-
declare const zDecimalOptional: (label: string, min?: number, max?: number) => z.
|
|
525
|
+
declare const zDecimalOptional: (label: string, min?: number, max?: number) => z.ZodOptional<z.ZodString>;
|
|
526
526
|
|
|
527
527
|
export { Badge, Button, CheckboxSingleList, type CommonObject, type CommonOption, type ConfigCascaderOption, type ConfigDropdownCascaderMultiProp, type ConfigDropdownCascaderSingleProp, type ConfigRenderBase, type ConfigRenderPasswordInput, DataTable, Dialog, DisplayTable, DropdownCascaderMulti, DropdownCascaderSingle, EnumApprovalStatus, EnumApprovalStatusLabel, EnumApprovalView, EnumApprovalViewLabel, EnumEntityStatus, EnumEntityStatusLabel, EnumFormMode, EnumFormModeLabel, EnumGenderType, EnumGenderTypeLabel, EnumMapProvider, EnumMapProviderLabel, EnumOrderStatus, EnumOrderStatusLabel, EnumPublishMethod, EnumPublishMethodLabel, EnumSemanticColor, EnumSemanticColorLabel, EnumStorageMethod, EnumStorageMethodLabel, EnumVariant, EnumVariantLabel, FieldController, FieldGroup, FieldPlain, FieldText, FormSelect, FormTimePicker, KeywordSearchBar, MediaUploader, Provider, type SemanticColorToken, TableEmpty, TableFormDialog, TableHeaderText, TableImage, TablePagination, TableText, Text, Title, type UUID, boolToText, buildColumn, cn, emptyToUndefined, enumApprovalStatusOptions, enumApprovalViewOptions, enumEntityStatusOptions, enumFormModeOptions, enumGenderTypeOptions, enumMapProviderOptions, enumOrderStatusOptions, enumPublishMethodOptions, enumSemanticColorOptions, enumStorageMethodOptions, enumToOptions, enumValues, enumVariantOptions, formatDateTime, formatDecimal, genUuid, getOptionMap, getSemanticColor, getSuccessMessage, isEmpty, isFormData, isValidEmail, isValidURL, renderBody, renderCascaderNodes, renderConfirmFooter, renderFooter, renderInput, renderPasswordInput, renderTextarea, zBool, zCoerceNumber, zCoerceNumberOptional, zDate, zDateOptional, zDecimal, zDecimalOptional, zEmail, zEnumNullable, zEnumNullableOptional, zEnumNullableRequired, zEnumOptional, zEnumRequired, zId, zIdCard, zIdCardOptional, zIds, zImageId, zImageIdRequired, zImageIds, zImageIdsOptional, zNumber, zNumberOptional, zPhone, zTextOptional, zTextRequired, zTexts };
|
package/dist/index.js
CHANGED
|
@@ -519,20 +519,16 @@ var emptyToUndefined = (value) => {
|
|
|
519
519
|
return v || void 0;
|
|
520
520
|
};
|
|
521
521
|
var enumValues = (obj) => Object.values(obj);
|
|
522
|
-
var zTextOptional = (label, min = 1, max = 32) => z.
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
);
|
|
522
|
+
var zTextOptional = (label, min = 1, max = 32) => z.string().trim().max(max, `${label}\u6700\u591A ${max} \u4E2A\u5B57\u7B26`).refine((v) => v === "" || v.length >= min, {
|
|
523
|
+
message: `${label}\u81F3\u5C11 ${min} \u4E2A\u5B57\u7B26`
|
|
524
|
+
});
|
|
526
525
|
var zTextRequired = (label, min = 1, max = 32) => z.string({
|
|
527
526
|
message: `\u8BF7\u8F93\u5165${label}`
|
|
528
527
|
}).trim().min(min, `${label}\u81F3\u5C11 ${min} \u4E2A\u5B57\u7B26`).max(max, `${label}\u6700\u591A ${max} \u4E2A\u5B57\u7B26`);
|
|
529
528
|
var zIdCard = (label = "\u8EAB\u4EFD\u8BC1\u53F7") => z.string({
|
|
530
529
|
message: `\u8BF7\u8F93\u5165${label}`
|
|
531
530
|
}).trim().regex(/^\d{15}$|^\d{17}(\d|X|x)$/, `${label}\u683C\u5F0F\u4E0D\u6B63\u786E`);
|
|
532
|
-
var zIdCardOptional = (label = "\u8EAB\u4EFD\u8BC1\u53F7") => z.
|
|
533
|
-
emptyToUndefined,
|
|
534
|
-
z.string().trim().regex(/^\d{15}$|^\d{17}(\d|X|x)$/, `${label}\u683C\u5F0F\u4E0D\u6B63\u786E`).optional()
|
|
535
|
-
);
|
|
531
|
+
var zIdCardOptional = (label = "\u8EAB\u4EFD\u8BC1\u53F7") => z.string().trim().regex(/^\d{15}$|^\d{17}(\d|X|x)$/, `${label}\u683C\u5F0F\u4E0D\u6B63\u786E`).optional();
|
|
536
532
|
var zEmail = (max = 32) => z.string({
|
|
537
533
|
message: "\u8BF7\u8F93\u5165\u90AE\u7BB1"
|
|
538
534
|
}).trim().email("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u90AE\u7BB1").max(max, `\u90AE\u7BB1\u6700\u591A ${max} \u4E2A\u5B57\u7B26`);
|
|
@@ -610,7 +606,7 @@ var zCoerceNumber = (label, min, max) => {
|
|
|
610
606
|
}
|
|
611
607
|
return schema;
|
|
612
608
|
};
|
|
613
|
-
var zCoerceNumberOptional = (label, min, max) =>
|
|
609
|
+
var zCoerceNumberOptional = (label, min, max) => zCoerceNumber(label, min, max).optional();
|
|
614
610
|
var zDecimal = (label, min, max) => {
|
|
615
611
|
let schema = z.string({
|
|
616
612
|
message: `\u8BF7\u8F93\u5165${label}`
|
|
@@ -627,7 +623,7 @@ var zDecimal = (label, min, max) => {
|
|
|
627
623
|
}
|
|
628
624
|
return schema;
|
|
629
625
|
};
|
|
630
|
-
var zDecimalOptional = (label, min, max) =>
|
|
626
|
+
var zDecimalOptional = (label, min, max) => zDecimal(label, min, max).optional();
|
|
631
627
|
|
|
632
628
|
// src/type/enum/approval-status.ts
|
|
633
629
|
var EnumApprovalStatus = {
|