@flatbiz/antd 4.2.93 → 4.2.95
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/esm/button-operate/index.js +1 -1
- package/esm/button-operate/index.js.map +1 -1
- package/esm/button-wrapper/index.js +1 -1
- package/esm/button-wrapper/index.js.map +1 -1
- package/esm/color-picker-wrapper/index.js +2 -1
- package/esm/color-picker-wrapper/index.js.map +1 -1
- package/esm/config-provider-wrapper/index.js +1 -1
- package/esm/config-provider-wrapper/index.js.map +1 -1
- package/esm/date-range-picker-wrapper-form-item/index.js +2 -1
- package/esm/date-range-picker-wrapper-form-item/index.js.map +1 -1
- package/esm/dialog-alert/index.js +1 -1
- package/esm/dialog-alert/index.js.map +1 -1
- package/esm/dialog-confirm/index.js +1 -1
- package/esm/dialog-confirm/index.js.map +1 -1
- package/esm/dialog-drawer/index.js +1 -1
- package/esm/dialog-drawer/index.js.map +1 -1
- package/esm/dialog-drawer-content/index.js +1 -1
- package/esm/dialog-drawer-content/index.js.map +1 -1
- package/esm/dialog-modal/index.js +1 -1
- package/esm/dialog-modal/index.js.map +1 -1
- package/esm/drag-collapse-form-list/index.js +1 -1
- package/esm/drag-collapse-form-list/index.js.map +1 -1
- package/esm/drag-form-list/index.js +6 -1
- package/esm/drag-form-list/index.js.map +1 -1
- package/esm/drag-table/index.js +2 -1
- package/esm/drag-table/index.js.map +1 -1
- package/esm/dropdown-menu-wrapper/index.js +1 -1
- package/esm/dropdown-menu-wrapper/index.js.map +1 -1
- package/esm/easy-table/index.js +1 -1
- package/esm/easy-table/index.js.map +1 -1
- package/esm/editable-table/index.js +1 -1
- package/esm/editable-table/index.js.map +1 -1
- package/esm/error-boundary-wrapper/index.js +2 -1
- package/esm/error-boundary-wrapper/index.js.map +1 -1
- package/esm/fba-app/index.js +5 -2
- package/esm/fba-app/index.js.map +1 -1
- package/esm/form-item-hidden/index.js.map +1 -1
- package/esm/form-item-text/index.css +1 -1
- package/esm/form-item-text/index.js +5 -1
- package/esm/form-item-text/index.js.map +1 -1
- package/esm/form-list-wrapper/index.js +6 -1
- package/esm/form-list-wrapper/index.js.map +1 -1
- package/esm/index-34027e61.js +3 -0
- package/esm/index-34027e61.js.map +1 -0
- package/esm/index.js +6 -4
- package/esm/search-menu/index.css +1 -0
- package/esm/search-menu/index.js +1 -1
- package/esm/search-menu/index.js.map +1 -1
- package/esm/table-cell-render/index.js +1 -1
- package/esm/table-cell-render/index.js.map +1 -1
- package/esm/text-css-ellipsis/index.js +2 -1
- package/esm/text-css-ellipsis/index.js.map +1 -1
- package/esm/text-overflow-render/index.js +1 -1
- package/esm/text-overflow-render/index.js.map +1 -1
- package/esm/text-symbol-wrapper/index.css +1 -0
- package/esm/text-symbol-wrapper/index.js +5 -0
- package/esm/text-symbol-wrapper/index.js.map +1 -0
- package/esm/tree-wrapper/index.js +1 -1
- package/esm/tree-wrapper/index.js.map +1 -1
- package/index.d.ts +136 -32
- package/package.json +1 -1
- package/esm/index-ac189a77.js +0 -3
- package/esm/index-ac189a77.js.map +0 -1
package/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
/// <reference types="scheduler" />
|
|
4
4
|
|
|
5
5
|
import { API, ModelType } from '@dimjs/model';
|
|
6
|
-
import { PlainObject } from '@dimjs/utils';
|
|
7
6
|
import { DateFormatType, TAny, TNoopDefine, TPlainObject } from '@flatbiz/utils';
|
|
8
7
|
import { IAllProps } from '@tinymce/tinymce-react';
|
|
9
8
|
import { AlertProps, ButtonProps, CardProps, CascaderProps, CheckboxProps, CollapseProps, ColorPickerProps, DrawerProps, DropdownProps, FormInstance, FormItemProps, FormListFieldData, FormListOperation, InputNumberProps, InputProps, ModalProps, PaginationProps, PopconfirmProps, PopoverProps, RadioGroupProps, RowProps, SelectProps, SpaceProps, SwitchProps, TableProps, TabsProps, TagProps, TimePickerProps, TimeRangePickerProps, TooltipProps, TreeProps, TreeSelectProps, UploadProps } from 'antd';
|
|
@@ -547,7 +546,31 @@ export type DateRangePickerWrapperProps = Omit<RangePickerDateProps<TAny>, "valu
|
|
|
547
546
|
* ```
|
|
548
547
|
*/
|
|
549
548
|
export declare const DateRangePickerWrapper: (props: DateRangePickerWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
550
|
-
export
|
|
549
|
+
export interface FormItemWrapperProps extends FormItemProps {
|
|
550
|
+
wrapper?: (children: ReactNode) => ReactElement;
|
|
551
|
+
/** 设置wrapper后,before、after失效 */
|
|
552
|
+
before?: ReactNode;
|
|
553
|
+
/** 设置wrapper后,before、after失效 */
|
|
554
|
+
after?: ReactNode;
|
|
555
|
+
/** value 序列化处理 */
|
|
556
|
+
inputNormalize?: (value?: TAny) => TAny;
|
|
557
|
+
/**
|
|
558
|
+
* onChange 参数序列化处理
|
|
559
|
+
* 如果设置 normalize 属性,outputNormalize将失效
|
|
560
|
+
*/
|
|
561
|
+
outputNormalize?: (value?: TAny) => TAny;
|
|
562
|
+
/** 是否清楚 Form.Item */
|
|
563
|
+
isClear?: boolean;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* 对 Form.Item 包装处理
|
|
567
|
+
* ```
|
|
568
|
+
* 1. 为 children 增加 before、after
|
|
569
|
+
* 2. 对输入、输出数据进行序列化处理
|
|
570
|
+
* ```
|
|
571
|
+
*/
|
|
572
|
+
export declare const FormItemWrapper: (props: FormItemWrapperProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
573
|
+
export type DateRangePickerWrapperFormItemProps = Omit<FormItemWrapperProps, "name"> & {
|
|
551
574
|
/**
|
|
552
575
|
* 开始的时间name
|
|
553
576
|
*/
|
|
@@ -790,6 +813,7 @@ export type DragCollapseFormListProps = {
|
|
|
790
813
|
content: (data: DragCollapseFormListContentProps) => ReactElement;
|
|
791
814
|
/** 设置面板禁止拖拽 */
|
|
792
815
|
getItemDragDisabled?: (uid: string | number, index: number) => boolean;
|
|
816
|
+
rules?: FormListProps["rules"];
|
|
793
817
|
};
|
|
794
818
|
/**
|
|
795
819
|
* 可拖拽 折叠面板+FormList
|
|
@@ -829,6 +853,7 @@ export type DragFormListContentProps = {
|
|
|
829
853
|
export type DragFormListProps = {
|
|
830
854
|
className?: string;
|
|
831
855
|
style?: CSSProperties;
|
|
856
|
+
itemStyle?: CSSProperties;
|
|
832
857
|
/** formList item 数据中的唯一值,默认值:uid */
|
|
833
858
|
uidFieldName?: string;
|
|
834
859
|
/** formList name */
|
|
@@ -863,6 +888,7 @@ export type DragFormListProps = {
|
|
|
863
888
|
formListChildrenWrapper?: (props: {
|
|
864
889
|
children: ReactElement;
|
|
865
890
|
}) => ReactElement;
|
|
891
|
+
rules?: FormListProps["rules"];
|
|
866
892
|
};
|
|
867
893
|
/**
|
|
868
894
|
* 可拖拽FormList
|
|
@@ -1721,10 +1747,11 @@ export type EditableTableRefApi = {
|
|
|
1721
1747
|
* demo:https://fex.qa.tcshuke.com/docs/admin/main/table/row-editable1
|
|
1722
1748
|
* @param props
|
|
1723
1749
|
* ```
|
|
1724
|
-
* 1.
|
|
1725
|
-
* 2.
|
|
1726
|
-
* 3.
|
|
1727
|
-
* 4.
|
|
1750
|
+
* 1. 通过 tableProps 设置Table属性,table size默认:small
|
|
1751
|
+
* 2. Table children column 不可编辑
|
|
1752
|
+
* 3. 当存在折叠children数据时,组件会在children中内置_isChildrenItem字段
|
|
1753
|
+
* 4. 可通过tableChildrenColumnRender自定义渲染 table children column 显示
|
|
1754
|
+
* 5. 设置 rowSelection 后,rowSelection.onChange 通过 ref 的 getTableItemDataByFormListItemKey获取数据
|
|
1728
1755
|
* ```
|
|
1729
1756
|
*/
|
|
1730
1757
|
export declare const EditableTable: import("react").ForwardRefExoticComponent<EditableTableProps & import("react").RefAttributes<EditableTableRefApi>>;
|
|
@@ -2076,33 +2103,74 @@ export declare const FormItemGroup: {
|
|
|
2076
2103
|
Card: import("react").FC<FormItemCardProps>;
|
|
2077
2104
|
};
|
|
2078
2105
|
export type FormItemHiddenProps = {
|
|
2079
|
-
name:
|
|
2106
|
+
name: FormItemProps["name"];
|
|
2080
2107
|
};
|
|
2081
2108
|
export declare const FormItemHidden: (props: FormItemHiddenProps) => import("react/jsx-runtime").JSX.Element;
|
|
2082
|
-
export
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
after?: ReactNode;
|
|
2088
|
-
/** value 序列化处理 */
|
|
2089
|
-
inputNormalize?: (value?: TAny) => TAny;
|
|
2109
|
+
export type FormItemTextServiceConfig = {
|
|
2110
|
+
onRequest: (params?: TAny) => Promise<TAny>;
|
|
2111
|
+
params?: TPlainObject;
|
|
2112
|
+
/** 标记serviceConfig.params中无效参数,被设置的params key 不传入服务接口入参 */
|
|
2113
|
+
invalidParamKey?: string[];
|
|
2090
2114
|
/**
|
|
2091
|
-
*
|
|
2092
|
-
* 如果设置 normalize 属性,outputNormalize将失效
|
|
2115
|
+
* 如果没有配置 render,返回结果会直接进行dom渲染,如果非string类型会进行JSON.stringify处理
|
|
2093
2116
|
*/
|
|
2094
|
-
|
|
2095
|
-
/**
|
|
2096
|
-
|
|
2097
|
-
}
|
|
2117
|
+
onResponseAdapter?: (respData?: TAny, value?: TAny) => TAny;
|
|
2118
|
+
/** 必须参数key列表,与params配合使用 */
|
|
2119
|
+
requiredParamsKeys?: string[];
|
|
2120
|
+
};
|
|
2121
|
+
export type FormItemTextProps = FormItemWrapperProps & {
|
|
2122
|
+
/** 是否换行,默认不换行,超出省略(鼠标悬浮可显示) */
|
|
2123
|
+
wrap?: boolean;
|
|
2124
|
+
/** 自定义数据显示 */
|
|
2125
|
+
render?: (value?: TAny) => ReactNode;
|
|
2126
|
+
/** 占位值,当 value 为 ''、undefined、null时显示 */
|
|
2127
|
+
placeholderValue?: string;
|
|
2128
|
+
serviceConfig?: FormItemTextServiceConfig;
|
|
2129
|
+
};
|
|
2098
2130
|
/**
|
|
2099
|
-
*
|
|
2131
|
+
* FormItem 文本显示,默认不换行,超出省略(鼠标悬浮可显示)
|
|
2100
2132
|
* ```
|
|
2101
|
-
*
|
|
2102
|
-
*
|
|
2103
|
-
*
|
|
2104
|
-
|
|
2105
|
-
|
|
2133
|
+
* 可通过配置 serviceConfig 通过接口获取数据,一般用于 Select 数据显示
|
|
2134
|
+
*
|
|
2135
|
+
* 例如:
|
|
2136
|
+
* 1. 基本数据渲染
|
|
2137
|
+
* <FormItemText name="xxx" label="xxx" />
|
|
2138
|
+
* 2. 对象数据渲染
|
|
2139
|
+
* <FormItemText
|
|
2140
|
+
* name="xxx"
|
|
2141
|
+
* label="xxx"
|
|
2142
|
+
* render={(value) => {
|
|
2143
|
+
* const target = [].find(
|
|
2144
|
+
* (item) => item.value === value,
|
|
2145
|
+
* );
|
|
2146
|
+
* return target ? (
|
|
2147
|
+
* <Tag color={target['color']}>{target.label}</Tag>
|
|
2148
|
+
* ) : null;
|
|
2149
|
+
* }}
|
|
2150
|
+
* />
|
|
2151
|
+
* 3. 接口数据渲染
|
|
2152
|
+
* <FormItemText
|
|
2153
|
+
* name="xxx"
|
|
2154
|
+
* label="xxx"
|
|
2155
|
+
* serviceConfig={{
|
|
2156
|
+
* onRequest: () => {
|
|
2157
|
+
* return serviceHandle.request('/random/api9468', {}, 'post');
|
|
2158
|
+
* },
|
|
2159
|
+
* onResponseAdapter: (dataList: TPlainObject[], value) => {
|
|
2160
|
+
* return dataList?.find((item) => item.value === value);
|
|
2161
|
+
* },
|
|
2162
|
+
* }}
|
|
2163
|
+
* render={(dataItem) => {
|
|
2164
|
+
* return dataItem ? (
|
|
2165
|
+
* <Tag style={{ margin: 0 }} color={dataItem['color']}>
|
|
2166
|
+
* {dataItem.label}
|
|
2167
|
+
* </Tag>
|
|
2168
|
+
* ) : null;
|
|
2169
|
+
* }}
|
|
2170
|
+
* />
|
|
2171
|
+
* ```
|
|
2172
|
+
*/
|
|
2173
|
+
export declare const FormItemText: (props: FormItemTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
2106
2174
|
export type FormListWrapperContentProps = {
|
|
2107
2175
|
/** Form.List item fieldData */
|
|
2108
2176
|
formListFieldData: FormListFieldData;
|
|
@@ -2631,7 +2699,7 @@ export interface ISearchMenuProps {
|
|
|
2631
2699
|
* 目前只支持单选
|
|
2632
2700
|
*/
|
|
2633
2701
|
value?: string;
|
|
2634
|
-
onChange?: (key: string,
|
|
2702
|
+
onChange?: (key: string, targetItem?: TPlainObject) => void;
|
|
2635
2703
|
/** 树型源数据 */
|
|
2636
2704
|
dataSource: TPlainObject[];
|
|
2637
2705
|
/** 惰性搜索 */
|
|
@@ -2645,20 +2713,35 @@ export interface ISearchMenuProps {
|
|
|
2645
2713
|
children?: string;
|
|
2646
2714
|
};
|
|
2647
2715
|
/** 自定义渲染条目 */
|
|
2648
|
-
renderItem?:
|
|
2716
|
+
renderItem?: (nodeData: TPlainObject) => ReactElement;
|
|
2649
2717
|
/** 搜索框参数 */
|
|
2650
2718
|
inputProps?: InputSearchWrapperProps;
|
|
2719
|
+
/** 搜索位置额外元素 */
|
|
2720
|
+
searchExtraElement?: ReactElement;
|
|
2651
2721
|
placeholder?: string;
|
|
2652
2722
|
className?: string;
|
|
2653
|
-
wrapStyle?:
|
|
2654
|
-
style?:
|
|
2723
|
+
wrapStyle?: CSSProperties;
|
|
2724
|
+
style?: CSSProperties;
|
|
2725
|
+
searchStyle?: CSSProperties;
|
|
2726
|
+
}
|
|
2727
|
+
export interface IListViewItem {
|
|
2728
|
+
label: ReactNode;
|
|
2729
|
+
key: string;
|
|
2730
|
+
}
|
|
2731
|
+
export interface IListViewProps {
|
|
2732
|
+
dataList: IListViewItem[];
|
|
2733
|
+
value?: string;
|
|
2734
|
+
onChange?: (key: string, item: IListViewItem) => void;
|
|
2735
|
+
style?: CSSProperties;
|
|
2736
|
+
/** 自定义空数据提示 */
|
|
2737
|
+
emptyView?: ReactElement;
|
|
2655
2738
|
}
|
|
2656
2739
|
/**
|
|
2657
2740
|
* 列表搜索
|
|
2658
2741
|
* @param props
|
|
2659
2742
|
* @returns
|
|
2660
2743
|
*/
|
|
2661
|
-
export declare function SearchMenu(props: ISearchMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
2744
|
+
export declare function SearchMenu(props: ISearchMenuProps & Pick<IListViewProps, "emptyView">): import("react/jsx-runtime").JSX.Element;
|
|
2662
2745
|
export type SelectorWrapperSearchServiceConfig = {
|
|
2663
2746
|
params?: TPlainObject;
|
|
2664
2747
|
onRequest: (params?: TAny) => TAny;
|
|
@@ -3238,6 +3321,27 @@ export type TextOverflowRenderProps = {
|
|
|
3238
3321
|
* @returns
|
|
3239
3322
|
*/
|
|
3240
3323
|
export declare const TextOverflowRender: (props: TextOverflowRenderProps) => import("react/jsx-runtime").JSX.Element;
|
|
3324
|
+
export type TextSymbolWrapperProps = {
|
|
3325
|
+
symbolType?: "required";
|
|
3326
|
+
/** 自定义标记符号,优先级大于 symbolType */
|
|
3327
|
+
symbol?: string;
|
|
3328
|
+
/** 标记位置,默认:brefore */
|
|
3329
|
+
position?: "before" | "after";
|
|
3330
|
+
text?: string | ReactElement;
|
|
3331
|
+
symbolStyle?: CSSProperties;
|
|
3332
|
+
onSymbolClick?: (event: any) => void;
|
|
3333
|
+
className?: string;
|
|
3334
|
+
style?: CSSProperties;
|
|
3335
|
+
/** 只隐藏符号,不隐藏文案 */
|
|
3336
|
+
hiddenSymbol?: boolean;
|
|
3337
|
+
};
|
|
3338
|
+
/**
|
|
3339
|
+
* 为文字添加符号,例如:必填符号
|
|
3340
|
+
* ```
|
|
3341
|
+
* 例如: <TextSymbolWrapper text={'用户名'} symbolType="required" />
|
|
3342
|
+
* ```
|
|
3343
|
+
*/
|
|
3344
|
+
export declare const TextSymbolWrapper: (props: TextSymbolWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
3241
3345
|
export type TimePickerWrapperProps = Omit<TimePickerProps, "value" | "onChange" | "format"> & {
|
|
3242
3346
|
value?: string;
|
|
3243
3347
|
onChange?: (value?: string) => void;
|
package/package.json
CHANGED
package/esm/index-ac189a77.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
2
|
-
import{extend as e}from"@dimjs/utils/cjs/extend";var r={TreeWrapper:{requestError:"数据加载异常..."},FbaDialogModal:{cancelText:"cancel"}};var a={TreeWrapper:{requestError:"数据加载异常..."},FbaDialogModal:{cancelText:"取消"}};var o=function o(l,n){var s=a;if(l==="en"){s=r}window["__fba_locale_message"]=e(true,{},s,n)};var l=function e(){var r=window["__fba_locale_message"];return r||{}};export{l as g,o as s};
|
|
3
|
-
//# sourceMappingURL=index-ac189a77.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-ac189a77.js","sources":["@flatbiz/antd/src/_utils/i18n/en.ts","@flatbiz/antd/src/_utils/i18n/zh-cn.ts","@flatbiz/antd/src/_utils/i18n/index.ts"],"sourcesContent":["import { TFbaLocale } from '../../types';\n\nexport const en: TFbaLocale = {\n TreeWrapper: {\n /** 数据加载异常,默认文案 */\n requestError: '数据加载异常...',\n },\n FbaDialogModal: {\n cancelText: 'cancel',\n },\n};\n","import { TFbaLocale } from '../../types';\n\nexport const zhCn: TFbaLocale = {\n TreeWrapper: {\n /** 数据加载异常,默认文案 */\n requestError: '数据加载异常...',\n },\n FbaDialogModal: {\n cancelText: '取消',\n },\n};\n","import { extend } from '@dimjs/utils';\nimport { TFbaLocale, TLocale } from '../../types';\nimport { en } from './en';\nimport { zhCn } from './zh-cn';\n\n/**\n * 设置 @flatbiz/antd中的国际化语言\n * @param locale\n * @param customLocaleMessage\n */\nexport const setFbaLocaleMessage = (locale: TLocale, customLocaleMessage?: Partial<TFbaLocale>) => {\n let localeMessage = zhCn;\n if (locale === 'en') {\n localeMessage = en;\n }\n window['__fba_locale_message'] = extend(true, {}, localeMessage, customLocaleMessage);\n};\n\n/**\n * 读取 @flatbiz/antd中的国际化语言\n * @param key\n * @returns\n */\nexport const getFbaLocaleMessage = () => {\n const localeMessage = window['__fba_locale_message'] as TFbaLocale;\n return localeMessage || {};\n};\n"],"names":["en","TreeWrapper","requestError","FbaDialogModal","cancelText","zhCn","setFbaLocaleMessage","locale","customLocaleMessage","localeMessage","window","_extend","getFbaLocaleMessage"],"mappings":";iDAEO,IAAMA,EAAiB,CAC5BC,YAAa,CAEXC,aAAc,aAEhBC,eAAgB,CACdC,WAAY,WCNT,IAAMC,EAAmB,CAC9BJ,YAAa,CAEXC,aAAc,aAEhBC,eAAgB,CACdC,WAAY,OCET,IAAME,EAAsB,SAAtBA,EAAuBC,EAAiBC,GACnD,IAAIC,EAAgBJ,EACpB,GAAIE,IAAW,KAAM,CACnBE,EAAgBT,CAClB,CACAU,OAAO,wBAA0BC,EAAO,KAAM,GAAIF,EAAeD,EACnE,MAOaI,EAAsB,SAAtBA,IACX,IAAMH,EAAgBC,OAAO,wBAC7B,OAAOD,GAAiB,CAAA,CAC1B"}
|