@jswork/antd-components 1.0.92 → 1.0.94

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/antd-components",
3
- "version": "1.0.92",
3
+ "version": "1.0.94",
4
4
  "main": "dist/main.cjs.js",
5
5
  "module": "dist/main.esm.js",
6
6
  "types": "dist/main.d.ts",
@@ -14,20 +14,22 @@
14
14
  "scripts": {
15
15
  "build": "tsup",
16
16
  "postbuild": "postsass -s src/style.scss -d dist/style.css -c",
17
- "release": "release-it --ci"
17
+ "release": "release-it"
18
18
  },
19
19
  "devDependencies": {
20
- "@jswork/harmony-events": "^1.2.2",
21
- "@jswork/next": "^1.2.6",
20
+ "@jswork/harmony-events": "^1.2.11",
21
+ "@jswork/next": "^1.2.11",
22
22
  "@swc/core": "^1.3.93",
23
23
  "@types/react": "^18.2.28",
24
24
  "@types/react-dom": "^18.2.13",
25
25
  "antd": "^5.20.0",
26
- "dayjs": "^1.11.12",
27
26
  "autoprefixer": "^10.4.16",
28
27
  "classnames": "^2.5.1",
29
28
  "cssnano": "^6.0.1",
29
+ "dayjs": "^1.11.12",
30
30
  "esbuild-plugin-copy": "^2.1.1",
31
+ "lodash": "^4.17.21",
32
+ "postcss": "^8.5.3",
31
33
  "react": "^18.2.0",
32
34
  "react-dom": "^18.2.0",
33
35
  "tsup": "^7.2.0",
@@ -45,7 +47,7 @@
45
47
  "@jswork/next-tree-walk": "^1.0.7",
46
48
  "@jswork/noop": "^1.0.0",
47
49
  "@jswork/react-codeflask": "^1.1.2",
48
- "@jswork/react-list": "^1.2.11",
50
+ "@jswork/react-list": "^1.4.3",
49
51
  "@jswork/weibo2res": "^1.0.4",
50
52
  "fast-deep-equal": "^3.1.3",
51
53
  "nanoid": "^4.0.2",
@@ -33,7 +33,7 @@ export class AcBreadcrumb extends React.Component<Props> {
33
33
  const { className, value, items, template, onChange, ...props } = this.props;
34
34
  return (
35
35
  <Breadcrumb className={cx(className, CLASS_NAME)} {...props}>
36
- <ReactList items={items} template={template} />
36
+ <ReactList items={items || []} template={template} />
37
37
  </Breadcrumb>
38
38
  );
39
39
  }
@@ -89,7 +89,7 @@ export class AcCheckableTagList extends React.Component<Props> {
89
89
  {label}
90
90
  </Button>
91
91
  <ReactList
92
- items={items}
92
+ items={items || []}
93
93
  template={({ item, index }) => {
94
94
  const _value = this.state.value as any[];
95
95
  const isChecked = _value?.includes(item.value);
@@ -65,7 +65,7 @@ export class AcCheckboxGroup extends React.Component<AcCheckboxGroupProps> {
65
65
  value={stateValue}
66
66
  onChange={this.handleChange}
67
67
  {...props}>
68
- <ReactList items={items} template={template} />
68
+ <ReactList items={items || []} template={template} />
69
69
  </Checkbox.Group>
70
70
  );
71
71
  }
@@ -60,7 +60,7 @@ export class AcRadioGroup extends React.Component<Props> {
60
60
 
61
61
  return (
62
62
  <Radio.Group className={cx(CLASS_NAME, className)} onChange={this.handleChange} {...props}>
63
- <ReactList items={items} template={this.templateCallback} />
63
+ <ReactList items={items || []} template={this.templateCallback} />
64
64
  </Radio.Group>
65
65
  );
66
66
  }
@@ -8,7 +8,7 @@ import { selectKv, kv as KvTmpl } from '../tpls/kv';
8
8
  const CLASS_NAME = 'ac-select';
9
9
  const DEFAULT_KV = {
10
10
  label: 'label',
11
- value: 'value'
11
+ value: 'value',
12
12
  };
13
13
 
14
14
  type StdEventTarget = { target: { value: any } };
@@ -33,11 +33,11 @@ export class AcSelect extends React.Component<Props> {
33
33
  kv: DEFAULT_KV,
34
34
  template: selectKv,
35
35
  onChange: noop,
36
- onSearch: noop
36
+ onSearch: noop,
37
37
  };
38
38
 
39
39
  state = {
40
- value: this.props.value
40
+ value: this.props.value,
41
41
  };
42
42
 
43
43
  shouldComponentUpdate(nextProps: Readonly<Props>): boolean {
@@ -64,21 +64,25 @@ export class AcSelect extends React.Component<Props> {
64
64
  if (kv === DEFAULT_KV) return template!(args);
65
65
  return KvTmpl(args, {
66
66
  component: Select.Option,
67
- ...kv
67
+ ...kv,
68
68
  });
69
69
  };
70
70
 
71
71
  render() {
72
72
  const { className, onChange, onSearch, value, template, ...props } = this.props;
73
73
  const { value: _value } = this.state;
74
+ const asProps = {
75
+ onChange: this.handleChange,
76
+ value: _value,
77
+ } as any;
78
+
74
79
  return (
75
80
  <ReactList
76
81
  allowEmpty
77
82
  as={Select}
78
- onChange={this.handleChange}
79
83
  className={cx(CLASS_NAME, className)}
80
- value={_value}
81
84
  template={this.template}
85
+ {...asProps}
82
86
  {...props}
83
87
  />
84
88
  );