@mi-avalon/libs 0.0.9 → 0.0.10

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IMFormCascaderItem, IMFormChkBoxGroupItem, IMFormDatePickerItem, IMFormInputItem, IMFormInputNumItem, IMFormItem, IMFormMentionsItem, IMFormRadioGroupItem, IMFormRangePickerItem, IMFormSelectItem, IMFormSliderItem, IMFormTextItem, IMFormTreeSelectItem, IMFormUploadItem } from './type';
2
+ import { IMFormCascaderItem, IMFormCheckBoxGroupItem, IMFormDatePickerItem, IMFormInputItem, IMFormInputNumItem, IMFormItem, IMFormMentionsItem, IMFormRadioGroupItem, IMFormRangePickerItem, IMFormSelectItem, IMFormTextItem, IMFormTreeSelectItem, IMFormUploadItem } from './type';
3
3
  export declare class MFormItemConst {
4
4
  static readonly labelCol: {
5
5
  span: number;
@@ -9,7 +9,7 @@ export declare class MFormItemConst {
9
9
  };
10
10
  static readonly defaultRowGutter = 24;
11
11
  static getDefaultArrayPlaceholder(item: IMFormItem): [string, string];
12
- static getDefaultPlaceholder(item: IMFormItem): string | undefined;
12
+ static getDefaultPlaceholder(item: IMFormItem): string;
13
13
  static input: (item: IMFormInputItem) => React.JSX.Element;
14
14
  static password: (item: IMFormInputItem) => React.JSX.Element;
15
15
  static text: (item: IMFormTextItem) => React.JSX.Element;
@@ -18,10 +18,9 @@ export declare class MFormItemConst {
18
18
  static rangePicker: (item: IMFormRangePickerItem) => React.JSX.Element;
19
19
  static select: (item: IMFormSelectItem) => React.JSX.Element;
20
20
  static radio: (item: IMFormRadioGroupItem) => React.JSX.Element;
21
- static checkbox: (item: IMFormChkBoxGroupItem) => React.JSX.Element;
21
+ static checkbox: (item: IMFormCheckBoxGroupItem) => React.JSX.Element;
22
22
  static upload: (item: IMFormUploadItem) => React.JSX.Element;
23
23
  static mentions: (item: IMFormMentionsItem) => React.JSX.Element;
24
24
  static cascader: (item: IMFormCascaderItem) => React.JSX.Element;
25
25
  static treeSelect: (item: IMFormTreeSelectItem) => React.JSX.Element;
26
- static slider: (item: IMFormSliderItem) => React.JSX.Element;
27
26
  }
@@ -1,11 +1,9 @@
1
- import { CascaderAutoProps, FormInstance, FormItemProps, FormProps, InputNumberProps, InputProps, MentionsProps, RadioGroupProps, RowProps, SelectProps, SliderSingleProps, TreeSelectProps, UploadProps } from 'antd';
2
- import { CheckboxGroupProps } from 'antd/es/checkbox';
3
- import { RangePickerProps } from 'antd/es/date-picker';
4
- import { Rule } from 'antd/es/form';
5
- import { TextAreaProps } from 'antd/es/input';
6
- import { SliderRangeProps } from 'antd/es/slider';
7
- import { DatePickerProps } from 'antd/lib';
1
+ import { CascaderAutoProps, Checkbox, DatePicker, FormInstance, FormItemProps, FormProps, FormRule, Input, InputNumberProps, InputProps, MentionsProps, RadioGroupProps, RowProps, SelectProps, TreeSelectProps, UploadProps } from 'antd';
8
2
  import { ReactElement } from 'react';
3
+ declare type CheckboxGroupProps = React.ComponentProps<typeof Checkbox.Group>;
4
+ declare type RangePickerProps = React.ComponentProps<typeof DatePicker.RangePicker>;
5
+ declare type DatePickerProps = React.ComponentProps<typeof DatePicker>;
6
+ declare type TextAreaProps = React.ComponentProps<typeof Input.TextArea>;
9
7
  export declare enum MFormItemTypeEnum {
10
8
  Input = "input",
11
9
  InputNumber = "inputNumber",
@@ -19,8 +17,7 @@ export declare enum MFormItemTypeEnum {
19
17
  Upload = "upload",
20
18
  Mentions = "mentions",
21
19
  Cascader = "cascader",
22
- TreeSelect = "treeSelect",
23
- Slider = "slider"
20
+ TreeSelect = "treeSelect"
24
21
  }
25
22
  export declare type MFormItemLayout = {
26
23
  span?: number;
@@ -85,7 +82,7 @@ export interface IMFormBaseItem {
85
82
  /**
86
83
  * rule-max, 正则,验证消息
87
84
  */
88
- rules?: Rule[];
85
+ rules?: FormRule[];
89
86
  /**
90
87
  * 自定义form
91
88
  */
@@ -138,7 +135,7 @@ export interface IMFormRadioGroupItem extends IMFormBaseItem {
138
135
  type: MFormItemTypeEnum.Radio;
139
136
  props?: RadioGroupProps;
140
137
  }
141
- export interface IMFormChkBoxGroupItem extends IMFormBaseItem {
138
+ export interface IMFormCheckBoxGroupItem extends IMFormBaseItem {
142
139
  type: MFormItemTypeEnum.Checkbox;
143
140
  props?: CheckboxGroupProps;
144
141
  }
@@ -177,8 +174,5 @@ export interface IMFormTreeSelectItem extends IMFormBaseItem {
177
174
  placeholder?: string;
178
175
  props?: TreeSelectProps;
179
176
  }
180
- export interface IMFormSliderItem extends IMFormBaseItem {
181
- type: MFormItemTypeEnum.Slider;
182
- props?: SliderSingleProps | SliderRangeProps;
183
- }
184
- export declare type IMFormItem = IMFormInputItem | IMFormInputNumItem | IMFormSelectItem | IMFormChkBoxGroupItem | IMFormRadioGroupItem | IMFormTextItem | IMFormDatePickerItem | IMFormRangePickerItem | IMFormUploadItem | IMFormMentionsItem | IMFormCascaderItem | IMFormTreeSelectItem | IMFormSliderItem;
177
+ export declare type IMFormItem = IMFormInputItem | IMFormInputNumItem | IMFormSelectItem | IMFormCheckBoxGroupItem | IMFormRadioGroupItem | IMFormTextItem | IMFormDatePickerItem | IMFormRangePickerItem | IMFormUploadItem | IMFormMentionsItem | IMFormCascaderItem | IMFormTreeSelectItem;
178
+ export {};
@@ -942,8 +942,9 @@ styleInject(css_248z$1);
942
942
  MFormItemTypeEnum["Mentions"] = "mentions";
943
943
  MFormItemTypeEnum["Cascader"] = "cascader";
944
944
  MFormItemTypeEnum["TreeSelect"] = "treeSelect";
945
- MFormItemTypeEnum["Slider"] = "slider";
945
+ // Slider = 'slider',
946
946
  })(exports.MFormItemTypeEnum || (exports.MFormItemTypeEnum = {}));
947
+ // | IMFormSliderItem;
947
948
 
948
949
  var RangePicker = antd.DatePicker.RangePicker;
949
950
  var MFormItemConst = /*#__PURE__*/function () {
@@ -1070,9 +1071,6 @@ MFormItemConst.treeSelect = function (item) {
1070
1071
  placeholder: item.placeholder || MFormItemConst.getDefaultPlaceholder(item)
1071
1072
  }));
1072
1073
  };
1073
- MFormItemConst.slider = function (item) {
1074
- return React__default.createElement(antd.Slider, Object.assign({}, item.props));
1075
- };
1076
1074
 
1077
1075
  var classname$2 = function classname(n) {
1078
1076
  if (n === void 0) {