@jswork/antd-components 1.0.219 → 1.0.221

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.
Files changed (46) hide show
  1. package/dist/main.cjs.js +1 -1
  2. package/dist/main.cjs.js.map +1 -1
  3. package/dist/main.d.mts +127 -132
  4. package/dist/main.d.ts +127 -132
  5. package/dist/main.esm.js +1 -1
  6. package/dist/main.esm.js.map +1 -1
  7. package/package.json +2 -2
  8. package/src/lib/_abstract-upload.tsx +6 -6
  9. package/src/lib/breadcrumb.tsx +0 -2
  10. package/src/lib/button.tsx +112 -66
  11. package/src/lib/card-extras.tsx +13 -8
  12. package/src/lib/checkable-dropdown.tsx +8 -10
  13. package/src/lib/checkable-tag-list.tsx +4 -7
  14. package/src/lib/checkable-tag.tsx +5 -8
  15. package/src/lib/checkbox-group.tsx +4 -8
  16. package/src/lib/checkbox.tsx +3 -8
  17. package/src/lib/codeflask.tsx +0 -2
  18. package/src/lib/color-picker.tsx +2 -5
  19. package/src/lib/editable-tag-group.tsx +5 -9
  20. package/src/lib/extra-search.tsx +1 -1
  21. package/src/lib/init-widgets.ts +2 -0
  22. package/src/lib/input-copyable.tsx +27 -5
  23. package/src/lib/input-number.tsx +3 -8
  24. package/src/lib/input-tags.tsx +2 -5
  25. package/src/lib/input-token.tsx +1 -3
  26. package/src/lib/input.tsx +2 -5
  27. package/src/lib/interactive-list.tsx +1 -7
  28. package/src/lib/markdown-editor.tsx +44 -0
  29. package/src/lib/pre-select.tsx +0 -3
  30. package/src/lib/radio-group.tsx +5 -8
  31. package/src/lib/range-picker.tsx +4 -12
  32. package/src/lib/rate.tsx +4 -14
  33. package/src/lib/search.tsx +1 -4
  34. package/src/lib/select.tsx +4 -8
  35. package/src/lib/slider-range.tsx +4 -9
  36. package/src/lib/slider.tsx +4 -15
  37. package/src/lib/switch.tsx +3 -7
  38. package/src/lib/textarea.tsx +3 -7
  39. package/src/lib/time-picker.tsx +2 -5
  40. package/src/lib/transfer.tsx +3 -6
  41. package/src/lib/tree-select.tsx +5 -17
  42. package/src/lib/upload-dragger.tsx +4 -7
  43. package/src/lib/upload-picture-card.tsx +0 -2
  44. package/src/lib/upload-picture.tsx +0 -2
  45. package/src/lib/upload.tsx +5 -8
  46. package/src/main.ts +5 -0
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
- import cx from 'classnames';
3
- import noop from '@jswork/noop';
4
- import { TreeSelect, TreeSelectProps } from 'antd';
5
1
  import '@jswork/next-tree-walk';
2
+ import { TreeSelect, TreeSelectProps } from 'antd';
3
+ import cx from 'classnames';
4
+ import React from 'react';
6
5
  import { treeSelectKv } from '../tpls/kv';
7
6
 
8
7
  const CLASS_NAME = 'ac-tree-select';
@@ -26,7 +25,6 @@ export class AcTreeSelect extends React.Component<AcTreeSelectProps> {
26
25
  items: [],
27
26
  template: treeSelectKv,
28
27
  itemsKey: 'children',
29
- onChange: noop,
30
28
  };
31
29
 
32
30
  get childView() {
@@ -36,19 +34,11 @@ export class AcTreeSelect extends React.Component<AcTreeSelectProps> {
36
34
 
37
35
  handleChange = (inValue) => {
38
36
  const { onChange } = this.props;
39
- onChange!({ target: { value: inValue } });
37
+ onChange?.({ target: { value: inValue } });
40
38
  };
41
39
 
42
40
  render() {
43
- const {
44
- className,
45
- items,
46
- itemsKey,
47
- template,
48
- treeData,
49
- onChange,
50
- ...props
51
- } = this.props;
41
+ const { className, items, itemsKey, template, treeData, onChange, ...props } = this.props;
52
42
 
53
43
  return (
54
44
  <TreeSelect
@@ -66,5 +56,3 @@ export class AcTreeSelect extends React.Component<AcTreeSelectProps> {
66
56
  export const AcTreeSelectFc = (props: AcTreeSelectProps) => {
67
57
  return <AcTreeSelect {...props} />;
68
58
  };
69
-
70
-
@@ -1,9 +1,8 @@
1
- import React from 'react';
2
- import noop from '@jswork/noop';
3
1
  import { InboxOutlined } from '@ant-design/icons';
4
2
  import { Upload } from 'antd';
5
- import cx from 'classnames';
6
3
  import { DraggerProps } from 'antd/es/upload';
4
+ import cx from 'classnames';
5
+ import React from 'react';
7
6
 
8
7
  const CLASS_NAME = 'ac-upload-dragger';
9
8
  const { Dragger } = Upload;
@@ -23,13 +22,12 @@ export class AcUploadDragger extends React.Component<AcUploadDraggerProps> {
23
22
  static displayName = CLASS_NAME;
24
23
  static formSchema = CLASS_NAME;
25
24
  static defaultProps = {
26
- onChange: noop,
27
- onRequest: (inEvent) => Promise.resolve(inEvent)
25
+ onRequest: (inEvent) => Promise.resolve(inEvent),
28
26
  };
29
27
 
30
28
  handleChange = (inEvent) => {
31
29
  const { onChange } = this.props;
32
- onChange!({ target: { value: inEvent } });
30
+ onChange?.({ target: { value: inEvent } });
33
31
  };
34
32
 
35
33
  handleCustomRequest = (inRequestOption) => {
@@ -62,4 +60,3 @@ export class AcUploadDragger extends React.Component<AcUploadDraggerProps> {
62
60
  export const AcUploadDraggerFc = (props: AcUploadDraggerProps) => {
63
61
  return <AcUploadDragger {...props} />;
64
62
  };
65
-
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import noop from '@jswork/noop';
3
2
  import { Space, Upload } from 'antd';
4
3
  import cx from 'classnames';
5
4
  import { UploadOutlined } from '@ant-design/icons';
@@ -18,7 +17,6 @@ export class AcUploadPictureCard extends AcAbstractUpload {
18
17
  static displayName = CLASS_NAME;
19
18
  static formSchema = CLASS_NAME;
20
19
  static defaultProps = {
21
- onChange: noop,
22
20
  value: [],
23
21
  transformURL: (pid) => (pid.includes('://') ? pid : `https://tva1.js.work/large/${pid}.jpg`),
24
22
  transformResponse: (inFileList: any) => {
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import noop from '@jswork/noop';
3
2
  import { UploadOutlined } from '@ant-design/icons';
4
3
  import { Upload, Button } from 'antd';
5
4
  import cx from 'classnames';
@@ -12,7 +11,6 @@ export class AcUploadPicture extends AcAbstractUpload {
12
11
  static displayName = CLASS_NAME;
13
12
  static formSchema = CLASS_NAME;
14
13
  static defaultProps = {
15
- onChange: noop,
16
14
  value: [],
17
15
  maxCount: 1,
18
16
  transformURL: (pid) => (pid.includes('://') ? pid : `https://tva1.js.work/large/${pid}.jpg`),
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
- import noop from '@jswork/noop';
3
- import { Upload, Button } from 'antd';
4
- import type { UploadProps, ButtonProps } from 'antd';
5
1
  import { UploadOutlined } from '@ant-design/icons';
2
+ import type { ButtonProps, UploadProps } from 'antd';
3
+ import { Button, Upload } from 'antd';
4
+ import React from 'react';
6
5
 
7
6
  import cx from 'classnames';
8
7
 
@@ -23,13 +22,12 @@ export class AcUpload extends React.Component<AcUploadProps> {
23
22
  static displayName = CLASS_NAME;
24
23
  static formSchema = CLASS_NAME;
25
24
  static defaultProps = {
26
- onChange: noop,
27
- onRequest: (inEvent) => Promise.resolve(inEvent)
25
+ onRequest: (inEvent) => Promise.resolve(inEvent),
28
26
  };
29
27
 
30
28
  handleChange = (inEvent) => {
31
29
  const { onChange } = this.props;
32
- onChange!({ target: { value: inEvent } });
30
+ onChange?.({ target: { value: inEvent } });
33
31
  };
34
32
 
35
33
  handleCustomRequest = (inRequestOption) => {
@@ -57,4 +55,3 @@ export class AcUpload extends React.Component<AcUploadProps> {
57
55
  export const AcUploadFc = (props: AcUploadProps) => {
58
56
  return <AcUpload {...props} />;
59
57
  };
60
-
package/src/main.ts CHANGED
@@ -15,6 +15,7 @@ import { AcInputHidden, AcInputHiddenFc } from './lib/input-hidden';
15
15
  import { AcInputNumber, AcInputNumberFc } from './lib/input-number';
16
16
  import { AcInputTags, AcInputTagsFc } from './lib/input-tags';
17
17
  import { AcInputToken, AcInputTokenFc } from './lib/input-token';
18
+ import { AcMarkdownEditor, AcMarkdownEditorFc } from './lib/markdown-editor';
18
19
  import { AcPreSelect, AcPreSelectFc } from './lib/pre-select';
19
20
  import { AcRadioGroup, AcRadioGroupFc } from './lib/radio-group';
20
21
  import { AcRangePicker, AcRangePickerFc } from './lib/range-picker';
@@ -53,6 +54,7 @@ import type { AcInputProps } from './lib/input';
53
54
  import type { AcInputNumberProps } from './lib/input-number';
54
55
  import type { AcInputTagsProps } from './lib/input-tags';
55
56
  import type { AcInputTokenProps } from './lib/input-token';
57
+ import type { AcMarkdownEditorProps } from './lib/markdown-editor';
56
58
  import type { AcPreSelectProps } from './lib/pre-select';
57
59
  import type { AcRadioGroupProps } from './lib/radio-group';
58
60
  import type { AcRangePickerProps } from './lib/range-picker';
@@ -146,6 +148,9 @@ export {
146
148
  AcInputToken,
147
149
  AcInputTokenFc,
148
150
  AcInputTokenProps,
151
+ AcMarkdownEditor,
152
+ AcMarkdownEditorFc,
153
+ AcMarkdownEditorProps,
149
154
  AcPreSelect,
150
155
  AcPreSelectFc,
151
156
  AcPreSelectProps,