@kilnonedre/foundation 0.0.13 → 0.0.15
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 +35 -14
- package/dist/index.js +325 -279
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -136,16 +136,16 @@ type SemanticColorToken = {
|
|
|
136
136
|
};
|
|
137
137
|
declare const getSemanticColor: (semanticColor: EnumSemanticColor, variant: EnumVariant) => SemanticColorToken;
|
|
138
138
|
|
|
139
|
-
interface ConfigProp$
|
|
139
|
+
interface ConfigProp$i {
|
|
140
140
|
semanticColor?: EnumSemanticColor;
|
|
141
141
|
variant?: EnumVariant;
|
|
142
142
|
children?: ReactNode;
|
|
143
143
|
className?: string;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
declare const Badge: ({ semanticColor, variant, children, className, }: ConfigProp$
|
|
146
|
+
declare const Badge: ({ semanticColor, variant, children, className, }: ConfigProp$i) => react_jsx_runtime.JSX.Element;
|
|
147
147
|
|
|
148
|
-
interface ConfigProp$
|
|
148
|
+
interface ConfigProp$h {
|
|
149
149
|
semanticColor?: EnumSemanticColor;
|
|
150
150
|
variant?: EnumVariant;
|
|
151
151
|
children?: ReactNode;
|
|
@@ -157,15 +157,15 @@ interface ConfigProp$g {
|
|
|
157
157
|
type?: 'button' | 'submit' | 'reset';
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
declare const Button: ({ semanticColor, variant, children, className, onClick, disabled, type, size, loading, }: ConfigProp$
|
|
160
|
+
declare const Button: ({ semanticColor, variant, children, className, onClick, disabled, type, size, loading, }: ConfigProp$h) => react_jsx_runtime.JSX.Element;
|
|
161
161
|
|
|
162
|
-
interface ConfigProp$
|
|
162
|
+
interface ConfigProp$g {
|
|
163
163
|
options: Array<CommonOption>;
|
|
164
164
|
value?: string | null;
|
|
165
165
|
onChange: (_v: string) => void;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
declare const CheckboxSingleList: (props: ConfigProp$
|
|
168
|
+
declare const CheckboxSingleList: (props: ConfigProp$g) => react_jsx_runtime.JSX.Element;
|
|
169
169
|
|
|
170
170
|
interface ConfigListRespT<T> {
|
|
171
171
|
items: Array<T>;
|
|
@@ -193,7 +193,7 @@ type AdvancedFilterCtx = {
|
|
|
193
193
|
draftFilters: Record<string, unknown>;
|
|
194
194
|
setDraftFilters: (_updater: (_prev: Record<string, unknown>) => Record<string, unknown>) => void;
|
|
195
195
|
};
|
|
196
|
-
type ConfigProp$
|
|
196
|
+
type ConfigProp$f<T, P> = {
|
|
197
197
|
columns: Array<ColumnDef<T>>;
|
|
198
198
|
renderList: (_params: P) => Promise<ConfigApiRespT<ConfigListRespT<T>>>;
|
|
199
199
|
getRowId?: (_row: T) => string;
|
|
@@ -221,7 +221,7 @@ declare const KeywordSearchBar: (props: ConfigProps$1) => react_jsx_runtime.JSX.
|
|
|
221
221
|
|
|
222
222
|
declare const TableEmpty: () => react_jsx_runtime.JSX.Element;
|
|
223
223
|
|
|
224
|
-
interface ConfigProp$
|
|
224
|
+
interface ConfigProp$e {
|
|
225
225
|
id?: string;
|
|
226
226
|
mode: EnumFormMode;
|
|
227
227
|
children: ReactNode;
|
|
@@ -235,14 +235,20 @@ interface ConfigProp$d {
|
|
|
235
235
|
onOpenChange: (_nextOpen: boolean) => void;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
declare const TableFormDialog: (props: ConfigProp$
|
|
238
|
+
declare const TableFormDialog: (props: ConfigProp$e) => react_jsx_runtime.JSX.Element;
|
|
239
239
|
|
|
240
|
-
interface ConfigProp$
|
|
240
|
+
interface ConfigProp$d {
|
|
241
241
|
text: string;
|
|
242
242
|
className?: ClassValue;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
declare const TableHeaderText: (props: ConfigProp$
|
|
245
|
+
declare const TableHeaderText: (props: ConfigProp$d) => react_jsx_runtime.JSX.Element;
|
|
246
|
+
|
|
247
|
+
interface ConfigProp$c {
|
|
248
|
+
value: Array<CommonObject>;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
declare const TableImage: (props: ConfigProp$c) => react_jsx_runtime.JSX.Element;
|
|
246
252
|
|
|
247
253
|
interface ConfigProp$b {
|
|
248
254
|
totalPage: number;
|
|
@@ -262,7 +268,7 @@ interface ConfigProp$a {
|
|
|
262
268
|
|
|
263
269
|
declare const TableText: (props: ConfigProp$a) => react_jsx_runtime.JSX.Element;
|
|
264
270
|
|
|
265
|
-
declare const DataTable: <T, P>(props: ConfigProp$
|
|
271
|
+
declare const DataTable: <T, P>(props: ConfigProp$f<T, P>) => react_jsx_runtime.JSX.Element;
|
|
266
272
|
|
|
267
273
|
interface ConfigProp$9 {
|
|
268
274
|
children: ReactNode;
|
|
@@ -466,7 +472,22 @@ declare const isValidEmail: (string: string) => boolean;
|
|
|
466
472
|
|
|
467
473
|
declare const isValidURL: (string: string) => boolean;
|
|
468
474
|
|
|
469
|
-
|
|
475
|
+
/**
|
|
476
|
+
* 将空字符串转换为 undefined。
|
|
477
|
+
*
|
|
478
|
+
* 常用于 Zod 的 preprocess 场景,避免用户输入空字符串时被视为有效值。
|
|
479
|
+
*
|
|
480
|
+
* 示例:
|
|
481
|
+
* - '' => undefined
|
|
482
|
+
* - ' ' => undefined
|
|
483
|
+
* - 'hello' => 'hello'
|
|
484
|
+
* - null => undefined
|
|
485
|
+
* - 123 => undefined
|
|
486
|
+
*
|
|
487
|
+
* @param value 待处理的值
|
|
488
|
+
* @returns 去除首尾空格后的字符串,若为空则返回 undefined
|
|
489
|
+
*/
|
|
490
|
+
declare const emptyToUndefined: (value: unknown) => string | undefined;
|
|
470
491
|
declare const enumValues: <T extends Record<string, string>>(obj: T) => [T[keyof T], ...T[keyof T][]];
|
|
471
492
|
declare const zTextOptional: (label: string, min?: number, max?: number) => z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
472
493
|
declare const zTextRequired: (label: string, min?: number, max?: number) => z.ZodString;
|
|
@@ -496,4 +517,4 @@ declare const zCoerceNumberOptional: (label: string, min?: number, max?: number)
|
|
|
496
517
|
declare const zDecimal: (label: string, min?: number, max?: number) => z.ZodString;
|
|
497
518
|
declare const zDecimalOptional: (label: string, min?: number, max?: number) => z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
498
519
|
|
|
499
|
-
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, TablePagination, TableText, Text, 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 };
|
|
520
|
+
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, 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 };
|