@jswork/antd-components 1.0.209 → 1.0.211
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/dist/main.cjs.js +1 -1
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.d.mts +141 -127
- package/dist/main.d.ts +141 -127
- package/dist/main.esm.js +1 -1
- package/dist/main.esm.js.map +1 -1
- package/package.json +3 -2
- package/src/lib/input-copyable.tsx +43 -0
- package/src/lib/table.tsx +6 -2
- package/src/main.ts +108 -110
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jswork/antd-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.211",
|
|
4
4
|
"main": "dist/main.cjs.js",
|
|
5
5
|
"module": "dist/main.esm.js",
|
|
6
6
|
"types": "dist/main.d.ts",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@ant-design/icons": "*",
|
|
21
21
|
"@ebay/nice-form-react": "*",
|
|
22
|
-
"@jswork/react-ant-status-switch": "*",
|
|
23
22
|
"@jswork/next": "*",
|
|
23
|
+
"@jswork/react-ant-status-switch": "*",
|
|
24
24
|
"antd": "*",
|
|
25
25
|
"react-router-dom": "*"
|
|
26
26
|
},
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"@jswork/next-create-fetcher": "^1.0.6",
|
|
61
61
|
"@jswork/next-dom-event": "^1.0.8",
|
|
62
62
|
"@jswork/next-gpid": "^1.0.4",
|
|
63
|
+
"@jswork/next-tmpl": "^1.0.7",
|
|
63
64
|
"@jswork/next-tree-walk": "^1.0.7",
|
|
64
65
|
"@jswork/next-unique": "^1.0.2",
|
|
65
66
|
"@jswork/noop": "^1.0.0",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Typography } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AcInput, AcInputProps } from './input';
|
|
4
|
+
|
|
5
|
+
const CLASS_NAME = 'ac-input-copyable';
|
|
6
|
+
|
|
7
|
+
interface AcInputCopyableState {
|
|
8
|
+
value?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class AcInputCopyable extends React.Component<AcInputProps, AcInputCopyableState> {
|
|
12
|
+
static displayName = CLASS_NAME;
|
|
13
|
+
static formSchema = CLASS_NAME;
|
|
14
|
+
static defaultProps = {};
|
|
15
|
+
|
|
16
|
+
constructor(props) {
|
|
17
|
+
super(props);
|
|
18
|
+
this.state = {
|
|
19
|
+
value: props.value || '',
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get copyView() {
|
|
24
|
+
const { value } = this.state;
|
|
25
|
+
return <Typography.Text copyable={{ text: value }} />;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
handleInputChange = (e) => {
|
|
29
|
+
const { onChange } = this.props;
|
|
30
|
+
const { value } = e.target;
|
|
31
|
+
this.setState({ value });
|
|
32
|
+
onChange?.(e);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
render() {
|
|
36
|
+
const { onChange, ...rest } = this.props;
|
|
37
|
+
return <AcInput onChange={this.handleInputChange} {...rest} addonAfter={this.copyView} />;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const AcInputCopyableFc = (props: AcInputProps) => {
|
|
42
|
+
return <AcInputCopyable {...props} />;
|
|
43
|
+
};
|
package/src/lib/table.tsx
CHANGED
|
@@ -13,6 +13,7 @@ import { ReactHarmonyEvents } from '@jswork/harmony-events';
|
|
|
13
13
|
import nx from '@jswork/next';
|
|
14
14
|
import '@jswork/next-compact-object';
|
|
15
15
|
import '@jswork/next-create-fetcher';
|
|
16
|
+
import '@jswork/next-tmpl';
|
|
16
17
|
import UrlSyncFlat from '@jswork/url-sync-flat';
|
|
17
18
|
import { Table, TableProps } from 'antd';
|
|
18
19
|
import { ColumnsType } from 'antd/es/table';
|
|
@@ -370,7 +371,7 @@ export class AcTable extends React.Component<AcTableProps, AcTableState> {
|
|
|
370
371
|
public add = () => {
|
|
371
372
|
const { module, paramsAdd, pathAdd } = this.props;
|
|
372
373
|
const qs = this.toQueryString(paramsAdd);
|
|
373
|
-
if(pathAdd) return nx.$nav?.(pathAdd);
|
|
374
|
+
if (pathAdd) return nx.$nav?.(pathAdd);
|
|
374
375
|
nx.$nav?.(`/${module}/${this.routerKey}/add${qs}`);
|
|
375
376
|
};
|
|
376
377
|
|
|
@@ -380,7 +381,10 @@ export class AcTable extends React.Component<AcTableProps, AcTableState> {
|
|
|
380
381
|
public edit = (item: any) => {
|
|
381
382
|
const { module, rowKey, paramsEdit, pathEdit } = this.props;
|
|
382
383
|
const qs = this.toQueryString(paramsEdit);
|
|
383
|
-
if(pathEdit)
|
|
384
|
+
if (pathEdit) {
|
|
385
|
+
const _editPath = nx.tmpl(pathEdit, item);
|
|
386
|
+
return nx.$nav?.(nx.tmpl(_editPath, item));
|
|
387
|
+
}
|
|
384
388
|
nx.$nav?.(`/${module}/${this.routerKey}/${item[rowKey as string]}/edit${qs}`);
|
|
385
389
|
};
|
|
386
390
|
|
package/src/main.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { breadcrumbDefault } from './tpls/breadcrumb';
|
|
2
|
-
import { kv, checkboxKv, radioKv, treeKv, selectKv, treeSelectKv } from './tpls/kv';
|
|
3
|
-
import { raw, checkboxRaw, radioRaw, selectRaw } from './tpls/raw';
|
|
4
|
-
import { transferLabel } from './tpls/transfer';
|
|
5
1
|
import { AcBreadcrumb } from './lib/breadcrumb';
|
|
6
2
|
import { AcCheckableDropdown } from './lib/checkable-dropdown';
|
|
7
3
|
import { AcCheckableTag, AcCheckableTagFc } from './lib/checkable-tag';
|
|
@@ -13,6 +9,7 @@ import { AcConfirmButton } from './lib/confirm-button';
|
|
|
13
9
|
import { AcDatePicker, AcDatePickerFc } from './lib/date-picker';
|
|
14
10
|
import { AcEditableTagGroup, AcEditableTagGroupFc } from './lib/editable-tag-group';
|
|
15
11
|
import { AcInput, AcInputFc } from './lib/input';
|
|
12
|
+
import { AcInputCopyable, AcInputCopyableFc } from './lib/input-copyable';
|
|
16
13
|
import { AcInputHidden, AcInputHiddenFc } from './lib/input-hidden';
|
|
17
14
|
import { AcInputNumber, AcInputNumberFc } from './lib/input-number';
|
|
18
15
|
import { AcInputTags, AcInputTagsFc } from './lib/input-tags';
|
|
@@ -32,10 +29,14 @@ import { AcTimePicker, AcTimePickerFc } from './lib/time-picker';
|
|
|
32
29
|
import { AcTransfer, AcTransferFc } from './lib/transfer';
|
|
33
30
|
import { AcTree } from './lib/tree';
|
|
34
31
|
import { AcTreeSelect, AcTreeSelectFc } from './lib/tree-select';
|
|
32
|
+
import { AcUpload, AcUploadFc } from './lib/upload';
|
|
35
33
|
import { AcUploadDragger, AcUploadDraggerFc } from './lib/upload-dragger';
|
|
36
34
|
import { AcUploadPicture, AcUploadPictureFc } from './lib/upload-picture';
|
|
37
35
|
import { AcUploadPictureCard, AcUploadPictureCardFc } from './lib/upload-picture-card';
|
|
38
|
-
import {
|
|
36
|
+
import { breadcrumbDefault } from './tpls/breadcrumb';
|
|
37
|
+
import { checkboxKv, kv, radioKv, selectKv, treeKv, treeSelectKv } from './tpls/kv';
|
|
38
|
+
import { checkboxRaw, radioRaw, raw, selectRaw } from './tpls/raw';
|
|
39
|
+
import { transferLabel } from './tpls/transfer';
|
|
39
40
|
|
|
40
41
|
import type { AcBreadcrumbProps } from './lib/breadcrumb';
|
|
41
42
|
import type { AcCheckableDropdownProps } from './lib/checkable-dropdown';
|
|
@@ -59,169 +60,166 @@ import type { AcSelectProps } from './lib/select';
|
|
|
59
60
|
import type { AcSliderProps } from './lib/slider';
|
|
60
61
|
import type { AcSliderRangeProps } from './lib/slider-range';
|
|
61
62
|
import type { AcSwitchProps } from './lib/switch';
|
|
63
|
+
import type { AcTableProps } from './lib/table';
|
|
62
64
|
import type { AcTextareaProps } from './lib/textarea';
|
|
63
65
|
import type { AcTimePickerProps } from './lib/time-picker';
|
|
64
66
|
import type { AcTransferProps } from './lib/transfer';
|
|
65
67
|
import type { AcTreeProps } from './lib/tree';
|
|
66
68
|
import type { AcTreeSelectProps } from './lib/tree-select';
|
|
67
|
-
import type { AcUploadDraggerProps } from './lib/upload-dragger';
|
|
68
69
|
import type { AcUploadProps } from './lib/upload';
|
|
69
|
-
import type {
|
|
70
|
+
import type { AcUploadDraggerProps } from './lib/upload-dragger';
|
|
70
71
|
|
|
71
72
|
import '@jswork/next';
|
|
72
73
|
import './lib/alert';
|
|
73
74
|
|
|
74
75
|
// commands
|
|
75
|
-
import useTableCommand from './lib/use-table-command';
|
|
76
|
-
import { AcTableLinks } from './lib/table-links';
|
|
77
|
-
import type { AcTableLinksProps } from './lib/table-links';
|
|
78
|
-
import { AcCardExtras } from './lib/card-extras';
|
|
79
76
|
import type { AcCardExtrasProps } from './lib/card-extras';
|
|
80
|
-
import {
|
|
81
|
-
import { FormActions } from './lib/form-actions';
|
|
82
|
-
import type { FormActionsProps } from './lib/form-actions';
|
|
83
|
-
import { AcExtraSearch } from './lib/extra-search';
|
|
77
|
+
import { AcCardExtras } from './lib/card-extras';
|
|
84
78
|
import type { AcExtraSearchProps } from './lib/extra-search';
|
|
85
|
-
import {
|
|
79
|
+
import { AcExtraSearch } from './lib/extra-search';
|
|
80
|
+
import type { FormActionsProps } from './lib/form-actions';
|
|
81
|
+
import { FormActions } from './lib/form-actions';
|
|
82
|
+
import { initWidgets } from './lib/init-widgets';
|
|
83
|
+
import type { AcTableLinksProps } from './lib/table-links';
|
|
84
|
+
import { AcTableLinks } from './lib/table-links';
|
|
86
85
|
import type { AcTableStatusSwitcherProps } from './lib/table-status-switcher';
|
|
87
|
-
import {
|
|
86
|
+
import { AcTableStatusSwitcher } from './lib/table-status-switcher';
|
|
88
87
|
import type { AcTableToggleSwitcherProps } from './lib/table-toggle-switcher';
|
|
88
|
+
import { AcTableToggleSwitcher } from './lib/table-toggle-switcher';
|
|
89
|
+
import useTableCommand from './lib/use-table-command';
|
|
89
90
|
|
|
90
91
|
export * from './lib/button';
|
|
91
92
|
|
|
92
93
|
// export all templates
|
|
93
94
|
export {
|
|
94
|
-
// breadcrumb
|
|
95
|
-
breadcrumbDefault,
|
|
96
|
-
// kv
|
|
97
|
-
kv,
|
|
98
|
-
checkboxKv,
|
|
99
|
-
radioKv,
|
|
100
|
-
treeKv,
|
|
101
|
-
selectKv,
|
|
102
|
-
treeSelectKv,
|
|
103
|
-
// raw
|
|
104
|
-
raw,
|
|
105
|
-
checkboxRaw,
|
|
106
|
-
radioRaw,
|
|
107
|
-
selectRaw,
|
|
108
|
-
// transfer
|
|
109
|
-
transferLabel,
|
|
110
|
-
|
|
111
95
|
// --- components ---
|
|
112
96
|
AcBreadcrumb,
|
|
97
|
+
// ---- types ----
|
|
98
|
+
AcBreadcrumbProps,
|
|
99
|
+
AcCardExtras,
|
|
100
|
+
AcCardExtrasProps,
|
|
113
101
|
AcCheckableDropdown,
|
|
102
|
+
AcCheckableDropdownProps,
|
|
114
103
|
AcCheckableTag,
|
|
104
|
+
// --- fc components ---
|
|
105
|
+
AcCheckableTagFc,
|
|
115
106
|
AcCheckableTagList,
|
|
107
|
+
AcCheckableTagListFc,
|
|
108
|
+
AcCheckableTagListProps,
|
|
109
|
+
AcCheckableTagProps,
|
|
116
110
|
AcCheckbox,
|
|
111
|
+
AcCheckboxFc,
|
|
117
112
|
AcCheckboxGroup,
|
|
113
|
+
AcCheckboxGroupFc,
|
|
114
|
+
AcCheckboxGroupProps,
|
|
115
|
+
AcCheckboxProps,
|
|
118
116
|
AcCodeFlask,
|
|
117
|
+
AcCodeFlaskFc,
|
|
119
118
|
AcConfirmButton,
|
|
119
|
+
AcConfirmButtonProps,
|
|
120
120
|
AcDatePicker,
|
|
121
|
+
AcDatePickerFc,
|
|
122
|
+
AcDatePickerProps,
|
|
121
123
|
AcEditableTagGroup,
|
|
124
|
+
AcEditableTagGroupFc,
|
|
125
|
+
AcEditableTagGroupProps,
|
|
126
|
+
AcExtraSearch,
|
|
127
|
+
AcExtraSearchProps,
|
|
122
128
|
AcInput,
|
|
129
|
+
AcInputCopyable,
|
|
130
|
+
AcInputCopyableFc,
|
|
131
|
+
AcInputFc,
|
|
123
132
|
AcInputHidden,
|
|
133
|
+
AcInputHiddenFc,
|
|
124
134
|
AcInputNumber,
|
|
135
|
+
AcInputNumberFc,
|
|
136
|
+
AcInputNumberProps,
|
|
137
|
+
AcInputProps,
|
|
125
138
|
AcInputTags,
|
|
139
|
+
AcInputTagsFc,
|
|
140
|
+
AcInputTagsProps,
|
|
126
141
|
AcInputToken,
|
|
142
|
+
AcInputTokenFc,
|
|
143
|
+
AcInputTokenProps,
|
|
127
144
|
AcPreSelect,
|
|
145
|
+
AcPreSelectFc,
|
|
146
|
+
AcPreSelectProps,
|
|
128
147
|
AcRadioGroup,
|
|
148
|
+
AcRadioGroupFc,
|
|
149
|
+
AcRadioGroupProps,
|
|
129
150
|
AcRangePicker,
|
|
151
|
+
AcRangePickerFc,
|
|
152
|
+
AcRangePickerProps,
|
|
130
153
|
AcRate,
|
|
154
|
+
AcRateFc,
|
|
155
|
+
AcRateProps,
|
|
131
156
|
AcSearch,
|
|
157
|
+
AcSearchFc,
|
|
158
|
+
AcSearchProps,
|
|
132
159
|
AcSelect,
|
|
160
|
+
AcSelectFc,
|
|
161
|
+
AcSelectProps,
|
|
133
162
|
AcSlider,
|
|
163
|
+
AcSliderFc,
|
|
164
|
+
AcSliderProps,
|
|
134
165
|
AcSliderRange,
|
|
166
|
+
AcSliderRangeFc,
|
|
167
|
+
AcSliderRangeProps,
|
|
135
168
|
AcSwitch,
|
|
169
|
+
AcSwitchFc,
|
|
170
|
+
AcSwitchProps,
|
|
136
171
|
AcTable,
|
|
137
172
|
AcTableLinks,
|
|
138
|
-
|
|
173
|
+
AcTableLinksProps,
|
|
174
|
+
AcTableProps,
|
|
175
|
+
AcTableStatusSwitcher,
|
|
176
|
+
AcTableStatusSwitcherProps,
|
|
177
|
+
AcTableToggleSwitcher,
|
|
178
|
+
AcTableToggleSwitcherProps,
|
|
139
179
|
AcTextarea,
|
|
180
|
+
AcTextareaFc,
|
|
181
|
+
AcTextareaProps,
|
|
140
182
|
AcTimePicker,
|
|
183
|
+
AcTimePickerFc,
|
|
184
|
+
AcTimePickerProps,
|
|
141
185
|
AcTransfer,
|
|
186
|
+
AcTransferFc,
|
|
187
|
+
AcTransferProps,
|
|
142
188
|
AcTree,
|
|
189
|
+
AcTreeProps,
|
|
143
190
|
AcTreeSelect,
|
|
191
|
+
AcTreeSelectFc,
|
|
192
|
+
AcTreeSelectProps,
|
|
193
|
+
AcUpload,
|
|
144
194
|
AcUploadDragger,
|
|
195
|
+
AcUploadDraggerFc,
|
|
196
|
+
AcUploadDraggerProps,
|
|
197
|
+
AcUploadFc,
|
|
145
198
|
AcUploadPicture,
|
|
146
199
|
AcUploadPictureCard,
|
|
147
|
-
AcUpload,
|
|
148
|
-
|
|
149
|
-
// --- fc components ---
|
|
150
|
-
AcCheckableTagFc,
|
|
151
|
-
AcCheckableTagListFc,
|
|
152
|
-
AcCheckboxFc,
|
|
153
|
-
AcCheckboxGroupFc,
|
|
154
|
-
AcCodeFlaskFc,
|
|
155
|
-
AcDatePickerFc,
|
|
156
|
-
AcEditableTagGroupFc,
|
|
157
|
-
AcInputFc,
|
|
158
|
-
AcInputHiddenFc,
|
|
159
|
-
AcInputNumberFc,
|
|
160
|
-
AcInputTagsFc,
|
|
161
|
-
AcInputTokenFc,
|
|
162
|
-
AcPreSelectFc,
|
|
163
|
-
AcRadioGroupFc,
|
|
164
|
-
AcRangePickerFc,
|
|
165
|
-
AcRateFc,
|
|
166
|
-
AcSearchFc,
|
|
167
|
-
AcSelectFc,
|
|
168
|
-
AcSliderFc,
|
|
169
|
-
AcSliderRangeFc,
|
|
170
|
-
AcSwitchFc,
|
|
171
|
-
AcTextareaFc,
|
|
172
|
-
AcTimePickerFc,
|
|
173
|
-
AcTransferFc,
|
|
174
|
-
AcTreeSelectFc,
|
|
175
|
-
AcUploadDraggerFc,
|
|
176
|
-
AcUploadPictureFc,
|
|
177
200
|
AcUploadPictureCardFc,
|
|
178
|
-
|
|
179
|
-
FormActions,
|
|
180
|
-
AcExtraSearch,
|
|
181
|
-
AcTableStatusSwitcher,
|
|
182
|
-
AcTableToggleSwitcher,
|
|
183
|
-
|
|
184
|
-
// ---- commands ----
|
|
185
|
-
useTableCommand,
|
|
186
|
-
|
|
187
|
-
// ---- types ----
|
|
188
|
-
AcBreadcrumbProps,
|
|
189
|
-
AcCheckableDropdownProps,
|
|
190
|
-
AcCheckableTagProps,
|
|
191
|
-
AcCheckableTagListProps,
|
|
192
|
-
AcCheckboxProps,
|
|
193
|
-
AcCheckboxGroupProps,
|
|
194
|
-
AcConfirmButtonProps,
|
|
195
|
-
AcDatePickerProps,
|
|
196
|
-
AcEditableTagGroupProps,
|
|
197
|
-
AcInputProps,
|
|
198
|
-
AcInputNumberProps,
|
|
199
|
-
AcInputTagsProps,
|
|
200
|
-
AcInputTokenProps,
|
|
201
|
-
AcPreSelectProps,
|
|
202
|
-
AcRadioGroupProps,
|
|
203
|
-
AcRangePickerProps,
|
|
204
|
-
AcRateProps,
|
|
205
|
-
AcSearchProps,
|
|
206
|
-
AcSelectProps,
|
|
207
|
-
AcSliderProps,
|
|
208
|
-
AcSliderRangeProps,
|
|
209
|
-
AcSwitchProps,
|
|
210
|
-
AcTableProps,
|
|
211
|
-
AcTableLinksProps,
|
|
212
|
-
AcCardExtrasProps,
|
|
213
|
-
AcTextareaProps,
|
|
214
|
-
AcTimePickerProps,
|
|
215
|
-
AcTransferProps,
|
|
216
|
-
AcTreeProps,
|
|
217
|
-
AcTreeSelectProps,
|
|
218
|
-
AcUploadDraggerProps,
|
|
201
|
+
AcUploadPictureFc,
|
|
219
202
|
AcUploadProps,
|
|
203
|
+
// breadcrumb
|
|
204
|
+
breadcrumbDefault,
|
|
205
|
+
checkboxKv,
|
|
206
|
+
checkboxRaw,
|
|
207
|
+
FormActions,
|
|
220
208
|
FormActionsProps,
|
|
221
|
-
AcExtraSearchProps,
|
|
222
|
-
AcTableStatusSwitcherProps,
|
|
223
|
-
AcTableToggleSwitcherProps,
|
|
224
|
-
|
|
225
209
|
// ---- widgets ----
|
|
226
210
|
initWidgets,
|
|
211
|
+
// kv
|
|
212
|
+
kv,
|
|
213
|
+
radioKv,
|
|
214
|
+
radioRaw,
|
|
215
|
+
// raw
|
|
216
|
+
raw,
|
|
217
|
+
selectKv,
|
|
218
|
+
selectRaw,
|
|
219
|
+
// transfer
|
|
220
|
+
transferLabel,
|
|
221
|
+
treeKv,
|
|
222
|
+
treeSelectKv,
|
|
223
|
+
// ---- commands ----
|
|
224
|
+
useTableCommand,
|
|
227
225
|
};
|