@jswork/antd-components 1.0.105 → 1.0.106

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.
@@ -8,13 +8,13 @@ const CLASS_NAME = 'ac-slider-range';
8
8
  type StdEventTarget = { target: { value: any } };
9
9
  type StdCallback = (inEvent: StdEventTarget) => void;
10
10
 
11
- type Props = {
11
+ export type AcSliderRangeProps = {
12
12
  className?: string;
13
13
  range?: true;
14
14
  onChange?: StdCallback;
15
15
  } & Omit<SliderRangeProps, 'range'>;
16
16
 
17
- export class AcSliderRange extends React.Component<Props> {
17
+ export class AcSliderRange extends React.Component<AcSliderRangeProps> {
18
18
  static displayName = CLASS_NAME;
19
19
  static formSchema = CLASS_NAME;
20
20
  static defaultProps = {
@@ -38,3 +38,9 @@ export class AcSliderRange extends React.Component<Props> {
38
38
  );
39
39
  }
40
40
  }
41
+
42
+ export const AcSliderRangeFc = (props: AcSliderRangeProps) => {
43
+ return <AcSliderRange {...props} />;
44
+ };
45
+
46
+
@@ -7,12 +7,12 @@ const CLASS_NAME = 'ac-slider';
7
7
  type StdEventTarget = { target: { value: any } };
8
8
  type StdCallback = (inEvent: StdEventTarget) => void;
9
9
 
10
- type Props = {
10
+ export type AcSliderProps = {
11
11
  className?: string;
12
12
  onChange?: StdCallback;
13
13
  } & SliderSingleProps;
14
14
 
15
- export class AcSlider extends React.Component<Props> {
15
+ export class AcSlider extends React.Component<AcSliderProps> {
16
16
  static displayName = CLASS_NAME;
17
17
  static formSchema = CLASS_NAME;
18
18
  static defaultProps = {
@@ -35,3 +35,9 @@ export class AcSlider extends React.Component<Props> {
35
35
  );
36
36
  }
37
37
  }
38
+
39
+ export const AcSliderFc = (props: AcSliderProps) => {
40
+ return <AcSlider {...props} />;
41
+ };
42
+
43
+
@@ -7,13 +7,13 @@ const CLASS_NAME = 'ac-switch';
7
7
  type StdEventTarget = { target: { value: any } };
8
8
  type StdCallback = (inEvent: StdEventTarget) => void;
9
9
 
10
- type Props = {
10
+ type AcSwitchProps = {
11
11
  className?: string;
12
12
  value?: boolean;
13
13
  onChange?: StdCallback;
14
14
  } & SwitchProps;
15
15
 
16
- export class AcSwitch extends React.Component<Props> {
16
+ export class AcSwitch extends React.Component<AcSwitchProps> {
17
17
  static displayName = CLASS_NAME;
18
18
  static formSchema = CLASS_NAME;
19
19
  static defaultProps = {
@@ -24,7 +24,7 @@ export class AcSwitch extends React.Component<Props> {
24
24
  value: Boolean(this.props.value)
25
25
  };
26
26
 
27
- shouldComponentUpdate(nextProps: Readonly<Props>): boolean {
27
+ shouldComponentUpdate(nextProps: Readonly<AcSwitchProps>): boolean {
28
28
  const { value } = nextProps;
29
29
  if (value !== this.props.value) this.setState({ value });
30
30
  return true;
@@ -50,3 +50,8 @@ export class AcSwitch extends React.Component<Props> {
50
50
  );
51
51
  }
52
52
  }
53
+
54
+ export const AcSwitchFc = (props: AcSwitchProps) => {
55
+ return <AcSwitch {...props} />;
56
+ };
57
+
@@ -9,17 +9,17 @@ const TextArea = Input.TextArea;
9
9
  type StdEventTarget = { target: { value: any } };
10
10
  type StdCallback = (inEvent: StdEventTarget) => void;
11
11
 
12
- type Props = {
12
+ export type AcTextareaProps = {
13
13
  className?: string;
14
14
  value?: boolean;
15
15
  onChange?: StdCallback;
16
16
  } & TextAreaProps;
17
17
 
18
- export class AcTextarea extends React.Component<Props> {
18
+ export class AcTextarea extends React.Component<AcTextareaProps> {
19
19
  static displayName = CLASS_NAME;
20
20
  static formSchema = CLASS_NAME;
21
21
  static defaultProps = {
22
- onChange: noop
22
+ onChange: noop,
23
23
  };
24
24
 
25
25
  render() {
@@ -27,3 +27,8 @@ export class AcTextarea extends React.Component<Props> {
27
27
  return <TextArea className={cx(CLASS_NAME, className)} {...props} />;
28
28
  }
29
29
  }
30
+
31
+ export const AcTextareaFc = (props: AcTextareaProps) => {
32
+ return <AcTextarea {...props} />;
33
+ };
34
+
@@ -9,19 +9,19 @@ const STD_FORMAT = 'HH:mm:ss';
9
9
  type StdEventTarget = { target: { value: any } };
10
10
  type StdCallback = (inEvent: StdEventTarget) => void;
11
11
 
12
- type Props = {
12
+ export type AcTimePickerProps = {
13
13
  className?: string;
14
14
  value?: string | dayjs.Dayjs;
15
15
  defaultValue?: string | dayjs.Dayjs;
16
16
  onChange?: StdCallback;
17
- } & Omit<TimePickerProps, 'value' | 'defaultValue'>;
17
+ } & Omit<TimePickerProps, 'value' | 'defaultValue' | 'onChange' | 'ref'>;
18
18
 
19
- export class AcTimePicker extends React.Component<Props> {
19
+ export class AcTimePicker extends React.Component<AcTimePickerProps> {
20
20
  static displayName = CLASS_NAME;
21
21
  static formSchema = CLASS_NAME;
22
22
  static defaultProps = {
23
23
  onChange: noop,
24
- format: STD_FORMAT
24
+ format: STD_FORMAT,
25
25
  };
26
26
 
27
27
  handleChange = (inEvent) => {
@@ -64,3 +64,8 @@ export class AcTimePicker extends React.Component<Props> {
64
64
  );
65
65
  }
66
66
  }
67
+
68
+ export const AcTimePickerFc = (props: AcTimePickerProps) => {
69
+ return <AcTimePicker {...props} />;
70
+ };
71
+
@@ -9,7 +9,7 @@ type StdEventTarget = { target: { value: any } };
9
9
  type StdCallback = (inEvent: StdEventTarget) => void;
10
10
  type TemplateCallback = (item: { item: any }, options?: any) => React.ReactNode;
11
11
 
12
- type Props = {
12
+ type AcTransferProps = {
13
13
  className?: string;
14
14
  items?: any[];
15
15
  template: TemplateCallback;
@@ -17,7 +17,7 @@ type Props = {
17
17
  onChange?: StdCallback;
18
18
  } & TransferProps<any>;
19
19
 
20
- export class AcTransfer extends React.Component<Props> {
20
+ export class AcTransfer extends React.Component<AcTransferProps> {
21
21
  static displayName = CLASS_NAME;
22
22
  static formSchema = CLASS_NAME;
23
23
  static defaultProps = {
@@ -35,7 +35,7 @@ export class AcTransfer extends React.Component<Props> {
35
35
  value: this.props.value
36
36
  };
37
37
 
38
- shouldComponentUpdate(nextProps: Readonly<Props>): boolean {
38
+ shouldComponentUpdate(nextProps: Readonly<AcTransferProps>): boolean {
39
39
  const { value } = nextProps;
40
40
  const isNewValue = this.props.value !== value;
41
41
  if (isNewValue && value !== this.state.value) {
@@ -68,3 +68,8 @@ export class AcTransfer extends React.Component<Props> {
68
68
  );
69
69
  }
70
70
  }
71
+
72
+ export const AcTransferFc = (props: AcTransferProps) => {
73
+ return <AcTransfer {...props} />;
74
+ };
75
+
@@ -11,7 +11,7 @@ type StdCallback = (inEvent: StdEventTarget) => void;
11
11
 
12
12
  // @see: https://github.com/afeiship/react-ant-tree-select
13
13
 
14
- type Props = {
14
+ type AcTreeSelectProps = {
15
15
  className?: string;
16
16
  items?: any[];
17
17
  template?: any;
@@ -19,7 +19,7 @@ type Props = {
19
19
  onChange?: StdCallback;
20
20
  } & TreeSelectProps;
21
21
 
22
- export class AcTreeSelect extends React.Component<Props> {
22
+ export class AcTreeSelect extends React.Component<AcTreeSelectProps> {
23
23
  static displayName = CLASS_NAME;
24
24
  static formSchema = CLASS_NAME;
25
25
  static defaultProps = {
@@ -62,3 +62,9 @@ export class AcTreeSelect extends React.Component<Props> {
62
62
  );
63
63
  }
64
64
  }
65
+
66
+ export const AcTreeSelectFc = (props: AcTreeSelectProps) => {
67
+ return <AcTreeSelect {...props} />;
68
+ };
69
+
70
+
@@ -11,7 +11,7 @@ type StdEventTarget = { target: { value: any } };
11
11
  type StdCallback = (inEvent: StdEventTarget) => void;
12
12
  type CustomRequest = (inEvent: any) => Promise<any>;
13
13
 
14
- type Props = {
14
+ type AcUploadDraggerProps = {
15
15
  className?: string;
16
16
  value?: any[];
17
17
  defaultValue?: any[];
@@ -19,7 +19,7 @@ type Props = {
19
19
  onRequest?: CustomRequest;
20
20
  } & DraggerProps;
21
21
 
22
- export class AcUploadDragger extends React.Component<Props> {
22
+ export class AcUploadDragger extends React.Component<AcUploadDraggerProps> {
23
23
  static displayName = CLASS_NAME;
24
24
  static formSchema = CLASS_NAME;
25
25
  static defaultProps = {
@@ -58,3 +58,8 @@ export class AcUploadDragger extends React.Component<Props> {
58
58
  );
59
59
  }
60
60
  }
61
+
62
+ export const AcUploadDraggerFc = (props: AcUploadDraggerProps) => {
63
+ return <AcUploadDragger {...props} />;
64
+ };
65
+
@@ -54,3 +54,8 @@ export class AcUploadPictureCard extends AcAbstractUpload {
54
54
  );
55
55
  }
56
56
  }
57
+
58
+ export const AcUploadPictureCardFc = (props) => {
59
+ return <AcUploadPictureCard {...props} />;
60
+ };
61
+
@@ -20,7 +20,7 @@ export class AcUploadPicture extends AcAbstractUpload {
20
20
  return inFileList.map((item) => {
21
21
  return item.uid || item.pid || nx.gpid(item.url);
22
22
  });
23
- }
23
+ },
24
24
  };
25
25
 
26
26
  render() {
@@ -45,3 +45,8 @@ export class AcUploadPicture extends AcAbstractUpload {
45
45
  );
46
46
  }
47
47
  }
48
+
49
+ export const AcUploadPictureFc = (props) => {
50
+ return <AcUploadPicture {...props} />;
51
+ };
52
+
@@ -11,7 +11,7 @@ type StdEventTarget = { target: { value: any } };
11
11
  type StdCallback = (inEvent: StdEventTarget) => void;
12
12
  type CustomRequest = (inEvent: any) => Promise<any>;
13
13
 
14
- type Props = {
14
+ type AcUploadProps = {
15
15
  className?: string;
16
16
  value?: number;
17
17
  onChange?: StdCallback;
@@ -19,7 +19,7 @@ type Props = {
19
19
  btnProps?: ButtonProps;
20
20
  } & UploadProps;
21
21
 
22
- export class AcUpload extends React.Component<Props> {
22
+ export class AcUpload extends React.Component<AcUploadProps> {
23
23
  static displayName = CLASS_NAME;
24
24
  static formSchema = CLASS_NAME;
25
25
  static defaultProps = {
@@ -53,3 +53,8 @@ export class AcUpload extends React.Component<Props> {
53
53
  );
54
54
  }
55
55
  }
56
+
57
+ export const AcUploadFc = (props: AcUploadProps) => {
58
+ return <AcUpload {...props} />;
59
+ };
60
+
package/src/main.ts CHANGED
@@ -4,38 +4,38 @@ import { raw, checkboxRaw, radioRaw, selectRaw } from './tpls/raw';
4
4
  import { transferLabel } from './tpls/transfer';
5
5
  import { AcBreadcrumb } from './lib/breadcrumb';
6
6
  import { AcCheckableDropdown } from './lib/checkable-dropdown';
7
- import { AcCheckableTag } from './lib/checkable-tag';
8
- import { AcCheckableTagList } from './lib/checkable-tag-list';
9
- import { AcCheckbox } from './lib/checkbox';
10
- import { AcCheckboxGroup } from './lib/checkbox-group';
11
- import { AcCodeFlask } from './lib/codeflask';
7
+ import { AcCheckableTag, AcCheckableTagFc } from './lib/checkable-tag';
8
+ import { AcCheckableTagList, AcCheckableTagListFc } from './lib/checkable-tag-list';
9
+ import { AcCheckbox, AcCheckboxFc } from './lib/checkbox';
10
+ import { AcCheckboxGroup, AcCheckboxGroupFc } from './lib/checkbox-group';
11
+ import { AcCodeFlask, AcCodeFlaskFc } from './lib/codeflask';
12
12
  import { AcConfirmButton } from './lib/confirm-button';
13
- import { AcDatePicker } from './lib/date-picker';
14
- import { AcEditableTagGroup } from './lib/editable-tag-group';
15
- import { AcInput } from './lib/input';
16
- import { AcInputHidden } from './lib/input-hidden';
17
- import { AcInputNumber } from './lib/input-number';
18
- import { AcInputTags } from './lib/input-tags';
19
- import { AcInputToken } from './lib/input-token';
20
- import { AcPreSelect } from './lib/pre-select';
21
- import { AcRadioGroup } from './lib/radio-group';
22
- import { AcRangePicker } from './lib/range-picker';
23
- import { AcRate } from './lib/rate';
24
- import { AcSearch } from './lib/search';
25
- import { AcSelect } from './lib/select';
26
- import { AcSlider } from './lib/slider';
27
- import { AcSliderRange } from './lib/slider-range';
28
- import { AcSwitch } from './lib/switch';
13
+ import { AcDatePicker, AcDatePickerFc } from './lib/date-picker';
14
+ import { AcEditableTagGroup, AcEditableTagGroupFc } from './lib/editable-tag-group';
15
+ import { AcInput, AcInputFc } from './lib/input';
16
+ import { AcInputHidden, AcInputHiddenFc } from './lib/input-hidden';
17
+ import { AcInputNumber, AcInputNumberFc } from './lib/input-number';
18
+ import { AcInputTags, AcInputTagsFc } from './lib/input-tags';
19
+ import { AcInputToken, AcInputTokenFc } from './lib/input-token';
20
+ import { AcPreSelect, AcPreSelectFc } from './lib/pre-select';
21
+ import { AcRadioGroup, AcRadioGroupFc } from './lib/radio-group';
22
+ import { AcRangePicker, AcRangePickerFc } from './lib/range-picker';
23
+ import { AcRate, AcRateFc } from './lib/rate';
24
+ import { AcSearch, AcSearchFc } from './lib/search';
25
+ import { AcSelect, AcSelectFc } from './lib/select';
26
+ import { AcSlider, AcSliderFc } from './lib/slider';
27
+ import { AcSliderRange, AcSliderRangeFc } from './lib/slider-range';
28
+ import { AcSwitch, AcSwitchFc } from './lib/switch';
29
29
  import { AcTable } from './lib/table';
30
- import { AcTextarea } from './lib/textarea';
31
- import { AcTimePicker } from './lib/time-picker';
32
- import { AcTransfer } from './lib/transfer';
30
+ import { AcTextarea, AcTextareaFc } from './lib/textarea';
31
+ import { AcTimePicker, AcTimePickerFc } from './lib/time-picker';
32
+ import { AcTransfer, AcTransferFc } from './lib/transfer';
33
33
  import { AcTree } from './lib/tree';
34
- import { AcTreeSelect } from './lib/tree-select';
35
- import { AcUploadDragger } from './lib/upload-dragger';
36
- import { AcUploadPicture } from './lib/upload-picture';
37
- import { AcUploadPictureCard } from './lib/upload-picture-card';
38
- import { AcUpload } from './lib/upload';
34
+ import { AcTreeSelect, AcTreeSelectFc } from './lib/tree-select';
35
+ import { AcUploadDragger, AcUploadDraggerFc } from './lib/upload-dragger';
36
+ import { AcUploadPicture, AcUploadPictureFc } from './lib/upload-picture';
37
+ import { AcUploadPictureCard, AcUploadPictureCardFc } from './lib/upload-picture-card';
38
+ import { AcUpload, AcUploadFc } from './lib/upload';
39
39
 
40
40
  import './lib/alert';
41
41
 
@@ -98,6 +98,37 @@ export {
98
98
  AcUploadPictureCard,
99
99
  AcUpload,
100
100
 
101
+ // --- fc ---
102
+ AcCheckableTagFc,
103
+ AcCheckableTagListFc,
104
+ AcCheckboxFc,
105
+ AcCheckboxGroupFc,
106
+ AcCodeFlaskFc,
107
+ AcDatePickerFc,
108
+ AcEditableTagGroupFc,
109
+ AcInputFc,
110
+ AcInputHiddenFc,
111
+ AcInputNumberFc,
112
+ AcInputTagsFc,
113
+ AcInputTokenFc,
114
+ AcPreSelectFc,
115
+ AcRadioGroupFc,
116
+ AcRangePickerFc,
117
+ AcRateFc,
118
+ AcSearchFc,
119
+ AcSelectFc,
120
+ AcSliderFc,
121
+ AcSliderRangeFc,
122
+ AcSwitchFc,
123
+ AcTextareaFc,
124
+ AcTimePickerFc,
125
+ AcTransferFc,
126
+ AcTreeSelectFc,
127
+ AcUploadDraggerFc,
128
+ AcUploadPictureFc,
129
+ AcUploadPictureCardFc,
130
+ AcUploadFc,
131
+
101
132
  // ---- commands ----
102
133
  useTableCommand,
103
134
  };