@jiovan-labs/ant-buddy-pro 2.0.2 → 2.0.4
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/cjs/field/NotifyBadge/index.d.ts +13 -4
- package/dist/cjs/field/NotifyBadge/index.js +39 -42
- package/dist/cjs/field/NotifyBadge/styles.js +29 -17
- package/dist/cjs/form/AddonInput/index.js +44 -17
- package/dist/cjs/form/AvatarUpload/index.d.ts +3 -3
- package/dist/cjs/form/LocaleInput/index.js +15 -11
- package/dist/cjs/form/LocaleInput/styles.js +19 -10
- package/dist/cjs/form/TagInput/index.d.ts +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/layout/EvenDescriptions/index.d.ts +10 -0
- package/dist/cjs/layout/EvenDescriptions/index.js +63 -0
- package/dist/cjs/layout/EvenDescriptions/styles.d.ts +2 -0
- package/dist/cjs/layout/EvenDescriptions/styles.js +51 -0
- package/dist/esm/field/NotifyBadge/index.d.ts +13 -4
- package/dist/esm/field/NotifyBadge/index.js +64 -85
- package/dist/esm/field/NotifyBadge/styles.js +24 -18
- package/dist/esm/form/AddonInput/index.js +60 -26
- package/dist/esm/form/AvatarUpload/index.d.ts +3 -3
- package/dist/esm/form/LocaleInput/index.js +24 -13
- package/dist/esm/form/LocaleInput/styles.js +16 -8
- package/dist/esm/form/TagInput/index.d.ts +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/layout/EvenDescriptions/index.d.ts +10 -0
- package/dist/esm/layout/EvenDescriptions/index.js +43 -0
- package/dist/esm/layout/EvenDescriptions/styles.d.ts +2 -0
- package/dist/esm/layout/EvenDescriptions/styles.js +23 -0
- package/package.json +9 -9
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/layout/EvenDescriptions/styles.ts
|
|
20
|
+
var styles_exports = {};
|
|
21
|
+
__export(styles_exports, {
|
|
22
|
+
useFieldStyle: () => useFieldStyle
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(styles_exports);
|
|
25
|
+
var import_pro_components = require("@ant-design/pro-components");
|
|
26
|
+
var import_PackageConst = require("../../constant/PackageConst");
|
|
27
|
+
var buildFieldStyle = (token) => {
|
|
28
|
+
return {
|
|
29
|
+
// `&&&` 提升特异性,确保稳定覆盖 antd v6 在 bordered 模式下写入的 `> table { tableLayout: auto }`
|
|
30
|
+
[`${token.componentCls}-fixed`]: {
|
|
31
|
+
[`&&& ${token.antCls}-descriptions-view > table`]: {
|
|
32
|
+
tableLayout: "fixed",
|
|
33
|
+
width: "100%"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
function useFieldStyle(prefixCls) {
|
|
39
|
+
return (0, import_pro_components.useStyle)(`${import_PackageConst.PackageConst.PACKAGE_NAME}:EvenDescriptions`, (token) => {
|
|
40
|
+
const mesh = {
|
|
41
|
+
...token,
|
|
42
|
+
prefixCls,
|
|
43
|
+
componentCls: `.${prefixCls}`
|
|
44
|
+
};
|
|
45
|
+
return [buildFieldStyle(mesh)];
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
useFieldStyle
|
|
51
|
+
});
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type BadgeProps, type DropdownProps, type
|
|
3
|
-
import { ListItemMetaProps } from 'antd/es/list/Item';
|
|
2
|
+
import { type BadgeProps, type DropdownProps, type ListyProps, type TabsProps } from 'antd';
|
|
4
3
|
import { type TabPlacement } from 'antd/es/tabs';
|
|
5
4
|
import { type Tab as RcTab } from '@rc-component/tabs/es/interface';
|
|
6
5
|
import { type WithFalse, type ReadonlyTabsType } from "../../type/declaration";
|
|
7
6
|
export type NotifyPresetStyle = WithFalse<'notice' | 'task'>;
|
|
8
7
|
export type NotifyTabPosition = Exclude<TabPlacement, 'bottom'>;
|
|
9
|
-
export type NotifyDataItem =
|
|
8
|
+
export type NotifyDataItem = {
|
|
10
9
|
id?: string;
|
|
10
|
+
avatar?: React.ReactNode;
|
|
11
|
+
title?: React.ReactNode;
|
|
12
|
+
description?: React.ReactNode;
|
|
11
13
|
extra?: React.ReactNode;
|
|
12
14
|
read?: boolean;
|
|
13
15
|
timestamp?: string;
|
|
14
16
|
};
|
|
17
|
+
export type NotifyListProps = Omit<ListyProps<any>, 'itemRender' | 'rowKey'> & {
|
|
18
|
+
dataSource?: any[];
|
|
19
|
+
renderItem?: (item: any, index: number) => React.ReactNode;
|
|
20
|
+
rowKey?: ListyProps<any>['rowKey'];
|
|
21
|
+
footer?: React.ReactNode;
|
|
22
|
+
};
|
|
15
23
|
export type HyperlinkProps = {
|
|
16
24
|
clazz?: string;
|
|
17
25
|
style?: React.CSSProperties;
|
|
@@ -20,8 +28,9 @@ export type HyperlinkProps = {
|
|
|
20
28
|
rel?: string;
|
|
21
29
|
};
|
|
22
30
|
export type MixinTabProps = Omit<RcTab, 'children'> & {
|
|
31
|
+
bordered?: boolean;
|
|
23
32
|
labelBadgeProps?: Omit<BadgeProps, 'children'>;
|
|
24
|
-
listProps?:
|
|
33
|
+
listProps?: NotifyListProps;
|
|
25
34
|
listPlaceholder?: React.ReactNode;
|
|
26
35
|
showClear?: boolean | (() => boolean);
|
|
27
36
|
showMore?: boolean | (() => boolean);
|
|
@@ -5,10 +5,9 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import { Avatar, Badge, Dropdown, Empty,
|
|
8
|
+
import { Avatar, Badge, Dropdown, Empty, Listy, Tabs } from 'antd';
|
|
9
9
|
import { BellOutlined } from '@ant-design/icons';
|
|
10
10
|
import { useIntl } from '@ant-design/pro-components';
|
|
11
|
-
import { If } from '@jiovan-labs/react-condition';
|
|
12
11
|
import { ArrayUtils, BooleanUtils, ObjectUtils } from '@jiovan-labs/ts-lang-utils';
|
|
13
12
|
import { omit } from '@rc-component/util';
|
|
14
13
|
import classnames from 'classnames';
|
|
@@ -67,62 +66,39 @@ export var NotifyBadge = function NotifyBadge(props) {
|
|
|
67
66
|
}));
|
|
68
67
|
};
|
|
69
68
|
var renderPresetList = function renderPresetList(item, index, tab) {
|
|
70
|
-
var avatar = !item.avatar ? undefined : /*#__PURE__*/_jsx(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
className: "".concat(clazzPrefix, "-list-item-avatar"),
|
|
77
|
-
src: item.avatar
|
|
78
|
-
})
|
|
79
|
-
}), /*#__PURE__*/_jsx(If.Else, {
|
|
80
|
-
children: /*#__PURE__*/_jsx("span", {
|
|
81
|
-
className: "".concat(clazzPrefix, "-list-item-icon"),
|
|
82
|
-
children: item.avatar
|
|
83
|
-
})
|
|
84
|
-
})]
|
|
85
|
-
})
|
|
69
|
+
var avatar = !item.avatar ? undefined : typeof item.avatar === 'string' ? /*#__PURE__*/_jsx(Avatar, {
|
|
70
|
+
className: "".concat(clazzPrefix, "-list-item-avatar"),
|
|
71
|
+
src: item.avatar
|
|
72
|
+
}) : /*#__PURE__*/_jsx("span", {
|
|
73
|
+
className: "".concat(clazzPrefix, "-list-item-icon"),
|
|
74
|
+
children: item.avatar
|
|
86
75
|
});
|
|
87
|
-
return /*#__PURE__*/
|
|
76
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
88
77
|
className: classnames("".concat(clazzPrefix, "-list-item"), "".concat(clazzPrefix, "-list-item-").concat(item.read ? 'read' : 'unread')),
|
|
89
78
|
onClick: function onClick(event) {
|
|
90
79
|
var _tab$onClick;
|
|
91
80
|
return (_tab$onClick = tab.onClick) === null || _tab$onClick === void 0 ? void 0 : _tab$onClick.call(tab, event, item.key || item.id || index);
|
|
92
81
|
},
|
|
93
|
-
children: /*#__PURE__*/_jsx(
|
|
82
|
+
children: [!!avatar && /*#__PURE__*/_jsx("div", {
|
|
83
|
+
className: "".concat(clazzPrefix, "-list-item-avatar-wrapper"),
|
|
84
|
+
children: avatar
|
|
85
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
94
86
|
className: "".concat(clazzPrefix, "-list-item-meta"),
|
|
95
|
-
|
|
96
|
-
title: /*#__PURE__*/_jsxs("div", {
|
|
87
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
97
88
|
className: "".concat(clazzPrefix, "-list-item-title"),
|
|
98
|
-
children: [item.title, /*#__PURE__*/_jsx(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
102
|
-
className: "".concat(clazzPrefix, "-list-item-extra"),
|
|
103
|
-
children: item.extra
|
|
104
|
-
})
|
|
105
|
-
})]
|
|
106
|
-
}),
|
|
107
|
-
description: /*#__PURE__*/_jsxs(_Fragment, {
|
|
108
|
-
children: [/*#__PURE__*/_jsx(If, {
|
|
109
|
-
condition: item.description,
|
|
110
|
-
validation: false,
|
|
111
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
112
|
-
className: "".concat(clazzPrefix, "-list-item-description"),
|
|
113
|
-
children: item.description
|
|
114
|
-
})
|
|
115
|
-
}), /*#__PURE__*/_jsx(If, {
|
|
116
|
-
condition: item.timestamp,
|
|
117
|
-
validation: false,
|
|
118
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
119
|
-
className: "".concat(clazzPrefix, "-list-item-timestamp"),
|
|
120
|
-
children: item.timestamp
|
|
121
|
-
})
|
|
89
|
+
children: [item.title, !!item.extra && /*#__PURE__*/_jsx("div", {
|
|
90
|
+
className: "".concat(clazzPrefix, "-list-item-extra"),
|
|
91
|
+
children: item.extra
|
|
122
92
|
})]
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
|
|
93
|
+
}), !!item.description && /*#__PURE__*/_jsx("div", {
|
|
94
|
+
className: "".concat(clazzPrefix, "-list-item-description"),
|
|
95
|
+
children: item.description
|
|
96
|
+
}), !!item.timestamp && /*#__PURE__*/_jsx("div", {
|
|
97
|
+
className: "".concat(clazzPrefix, "-list-item-timestamp"),
|
|
98
|
+
children: item.timestamp
|
|
99
|
+
})]
|
|
100
|
+
})]
|
|
101
|
+
});
|
|
126
102
|
};
|
|
127
103
|
var renderListFooter = function renderListFooter(tab) {
|
|
128
104
|
var _tab$listProps3, _props$localeProps, _props$localeProps2;
|
|
@@ -134,29 +110,21 @@ export var NotifyBadge = function NotifyBadge(props) {
|
|
|
134
110
|
}
|
|
135
111
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
136
112
|
children: [(_tab$listProps3 = tab.listProps) === null || _tab$listProps3 === void 0 ? void 0 : _tab$listProps3.footer, /*#__PURE__*/_jsxs("div", {
|
|
137
|
-
className: "".concat(clazzPrefix, "-builtin-footer"),
|
|
138
|
-
children: [/*#__PURE__*/_jsx(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
153
|
-
className: "".concat(clazzPrefix, "-action-button"),
|
|
154
|
-
onClick: function onClick(event) {
|
|
155
|
-
var _tab$onMore, _tab$key2;
|
|
156
|
-
return (_tab$onMore = tab.onMore) === null || _tab$onMore === void 0 ? void 0 : _tab$onMore.call(tab, event, (_tab$key2 = tab.key) !== null && _tab$key2 !== void 0 ? _tab$key2 : tab.presetStyle);
|
|
157
|
-
},
|
|
158
|
-
children: ObjectUtils.firstNotNil(props === null || props === void 0 || (_props$localeProps2 = props.localeProps) === null || _props$localeProps2 === void 0 ? void 0 : _props$localeProps2.more, intlLocales.get([locale, 'more']), intlLocales.get(['en_US', 'more']))
|
|
159
|
-
})
|
|
113
|
+
className: classnames("".concat(clazzPrefix, "-builtin-footer"), tab.bordered ? undefined : "".concat(clazzPrefix, "-builtin-footer-bordered")),
|
|
114
|
+
children: [showClear && /*#__PURE__*/_jsx("div", {
|
|
115
|
+
className: "".concat(clazzPrefix, "-action-button"),
|
|
116
|
+
onClick: function onClick(event) {
|
|
117
|
+
var _tab$onClear, _tab$key;
|
|
118
|
+
return (_tab$onClear = tab.onClear) === null || _tab$onClear === void 0 ? void 0 : _tab$onClear.call(tab, event, (_tab$key = tab.key) !== null && _tab$key !== void 0 ? _tab$key : tab.presetStyle);
|
|
119
|
+
},
|
|
120
|
+
children: ObjectUtils.firstNotNil(props === null || props === void 0 || (_props$localeProps = props.localeProps) === null || _props$localeProps === void 0 ? void 0 : _props$localeProps.clear, intlLocales.get([locale, 'clear']), intlLocales.get(['en_US', 'clear']))
|
|
121
|
+
}), showMore && /*#__PURE__*/_jsx("div", {
|
|
122
|
+
className: "".concat(clazzPrefix, "-action-button"),
|
|
123
|
+
onClick: function onClick(event) {
|
|
124
|
+
var _tab$onMore, _tab$key2;
|
|
125
|
+
return (_tab$onMore = tab.onMore) === null || _tab$onMore === void 0 ? void 0 : _tab$onMore.call(tab, event, (_tab$key2 = tab.key) !== null && _tab$key2 !== void 0 ? _tab$key2 : tab.presetStyle);
|
|
126
|
+
},
|
|
127
|
+
children: ObjectUtils.firstNotNil(props === null || props === void 0 || (_props$localeProps2 = props.localeProps) === null || _props$localeProps2 === void 0 ? void 0 : _props$localeProps2.more, intlLocales.get([locale, 'more']), intlLocales.get(['en_US', 'more']))
|
|
160
128
|
})]
|
|
161
129
|
})]
|
|
162
130
|
});
|
|
@@ -167,23 +135,34 @@ export var NotifyBadge = function NotifyBadge(props) {
|
|
|
167
135
|
return undefined;
|
|
168
136
|
}
|
|
169
137
|
return props.tabsProps.items.map(function (tab) {
|
|
170
|
-
var _tab$listProps4, _tab$listPlaceholder, _tab$
|
|
171
|
-
var
|
|
138
|
+
var _tab$listProps$items, _tab$listProps4, _tab$listProps5, _tab$listPlaceholder, _tab$listProps6, _tab$listProps$rowKey, _tab$listProps7, _tab$key3;
|
|
139
|
+
var listItems = (_tab$listProps$items = (_tab$listProps4 = tab.listProps) === null || _tab$listProps4 === void 0 ? void 0 : _tab$listProps4.items) !== null && _tab$listProps$items !== void 0 ? _tab$listProps$items : (_tab$listProps5 = tab.listProps) === null || _tab$listProps5 === void 0 ? void 0 : _tab$listProps5.dataSource;
|
|
140
|
+
var empty = !listItems || Array.isArray(listItems) && !listItems.length;
|
|
172
141
|
var placeholder = (_tab$listPlaceholder = tab.listPlaceholder) !== null && _tab$listPlaceholder !== void 0 ? _tab$listPlaceholder : /*#__PURE__*/_jsx(Empty, {
|
|
173
142
|
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
174
143
|
});
|
|
175
|
-
var content = empty ? placeholder : /*#__PURE__*/
|
|
176
|
-
className:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
return
|
|
144
|
+
var content = empty ? placeholder : /*#__PURE__*/_jsxs("div", {
|
|
145
|
+
className: "".concat(clazzPrefix, "-tab-list-wrapper"),
|
|
146
|
+
children: [/*#__PURE__*/_jsx(Listy, _objectSpread(_objectSpread({
|
|
147
|
+
className: classnames("".concat(clazzPrefix, "-tab-list"), tab.bordered ? "".concat(clazzPrefix, "-tab-list-bordered") : undefined, (_tab$listProps6 = tab.listProps) === null || _tab$listProps6 === void 0 ? void 0 : _tab$listProps6.className),
|
|
148
|
+
items: listItems,
|
|
149
|
+
rowKey: (_tab$listProps$rowKey = (_tab$listProps7 = tab.listProps) === null || _tab$listProps7 === void 0 ? void 0 : _tab$listProps7.rowKey) !== null && _tab$listProps$rowKey !== void 0 ? _tab$listProps$rowKey : function (item) {
|
|
150
|
+
var _item$key;
|
|
151
|
+
return (_item$key = item === null || item === void 0 ? void 0 : item.key) !== null && _item$key !== void 0 ? _item$key : item === null || item === void 0 ? void 0 : item.id;
|
|
152
|
+
},
|
|
153
|
+
classNames: {
|
|
154
|
+
item: "".concat(clazzPrefix, "-listy-item")
|
|
183
155
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
156
|
+
}, !(tab !== null && tab !== void 0 && tab.listProps) ? {} : omit(tab.listProps, ['className', 'footer', 'renderItem', 'dataSource', 'items', 'rowKey', 'classNames'])), {}, {
|
|
157
|
+
itemRender: function itemRender(item, index) {
|
|
158
|
+
var _tab$listProps8;
|
|
159
|
+
if ((_tab$listProps8 = tab.listProps) !== null && _tab$listProps8 !== void 0 && _tab$listProps8.renderItem) {
|
|
160
|
+
return tab.listProps.renderItem(item, index);
|
|
161
|
+
}
|
|
162
|
+
return tab.presetStyle === 'notice' || tab.presetStyle === 'task' ? renderPresetList(item, index, tab) : undefined;
|
|
163
|
+
}
|
|
164
|
+
})), renderListFooter(tab)]
|
|
165
|
+
});
|
|
187
166
|
return _objectSpread(_objectSpread({
|
|
188
167
|
key: (_tab$key3 = tab.key) !== null && _tab$key3 !== void 0 ? _tab$key3 : tab.presetStyle,
|
|
189
168
|
label: renderTabLabel(tab)
|
|
@@ -16,28 +16,36 @@ var buildFieldStyle = function buildFieldStyle(token) {
|
|
|
16
16
|
}, "&:hover", {
|
|
17
17
|
backgroundColor: 'unset !important',
|
|
18
18
|
cursor: 'unset !important'
|
|
19
|
-
})), "".concat(token.componentCls, "-tabs"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(token.antCls, "-tabs-content-top ").concat(token.antCls, "-tabs-tab"), {
|
|
19
|
+
})), "".concat(token.componentCls, "-tabs"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(token.antCls, "-tabs-content-top ").concat(token.antCls, "-tabs-tab"), {
|
|
20
20
|
paddingTop: 2
|
|
21
21
|
}), "".concat(token.antCls, "-tabs-content-left ").concat(token.antCls, "-tabs-tabpane"), {
|
|
22
22
|
paddingLeft: token.paddingXS
|
|
23
23
|
}), "".concat(token.antCls, "-tabs-content-right ").concat(token.antCls, "-tabs-tabpane"), {
|
|
24
24
|
paddingRight: token.paddingXS
|
|
25
|
-
}), "".concat(token.componentCls, "-tab-list"), _defineProperty(
|
|
25
|
+
}), "".concat(token.componentCls, "-tab-list-wrapper"), _defineProperty({
|
|
26
26
|
maxHeight: 400,
|
|
27
27
|
overflow: 'auto'
|
|
28
28
|
}, "&::-webkit-scrollbar", {
|
|
29
29
|
display: 'none'
|
|
30
|
-
}), "".concat(token.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
})), "".concat(token.componentCls, "-tab-list"), _defineProperty(_defineProperty({}, "&".concat(token.componentCls, "-tab-list-bordered"), {
|
|
31
|
+
border: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorSplit),
|
|
32
|
+
borderRadius: token.borderRadius
|
|
33
|
+
}), "".concat(token.antCls, "-listy-item:last-child"), {
|
|
34
|
+
borderBottom: 'none'
|
|
35
|
+
})), "".concat(token.componentCls, "-listy-item"), _defineProperty({
|
|
34
36
|
cursor: 'pointer',
|
|
35
|
-
paddingRight: token.paddingXS,
|
|
36
|
-
paddingLeft: token.paddingXS,
|
|
37
|
-
overflow: 'hidden',
|
|
38
37
|
transition: 'all 0.3s'
|
|
38
|
+
}, "&:hover", {
|
|
39
|
+
backgroundColor: token.controlItemBgActive
|
|
40
|
+
})), "".concat(token.componentCls, "-list-item"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
41
|
+
display: 'flex',
|
|
42
|
+
alignItems: 'flex-start',
|
|
43
|
+
gap: token.paddingXS,
|
|
44
|
+
overflow: 'hidden'
|
|
39
45
|
}, "&&-read", {
|
|
40
46
|
opacity: 0.4
|
|
47
|
+
}), "&-avatar-wrapper", {
|
|
48
|
+
flex: 'none'
|
|
41
49
|
}), "&-avatar", {
|
|
42
50
|
backgroundColor: token.colorBgContainer,
|
|
43
51
|
marginTop: token.marginXXS
|
|
@@ -52,27 +60,25 @@ var buildFieldStyle = function buildFieldStyle(token) {
|
|
|
52
60
|
fontSize: token.fontSize - 1
|
|
53
61
|
}), "&-timestamp", {
|
|
54
62
|
marginTop: token.marginXXS,
|
|
55
|
-
fontSize: token.fontSizeSM
|
|
63
|
+
fontSize: token.fontSizeSM,
|
|
64
|
+
color: token.colorTextTertiary
|
|
56
65
|
}), "&-extra", {
|
|
57
66
|
float: 'right',
|
|
58
67
|
marginTop: -1.5,
|
|
59
68
|
marginRight: 0,
|
|
60
69
|
color: token.colorTextSecondary,
|
|
61
70
|
fontWeight: 'normal'
|
|
62
|
-
}), "
|
|
63
|
-
backgroundColor: token.controlItemBgActive
|
|
64
|
-
}), "&:last-child", {
|
|
65
|
-
borderBottom: 'none !important'
|
|
66
|
-
})), "".concat(token.componentCls, "-builtin-footer"), _defineProperty({
|
|
71
|
+
})), "".concat(token.componentCls, "-builtin-footer"), _defineProperty(_defineProperty({
|
|
67
72
|
height: 38,
|
|
68
73
|
color: token.colorPrimaryText,
|
|
69
74
|
display: 'flex',
|
|
70
75
|
alignItems: 'start',
|
|
71
76
|
textAlign: 'center',
|
|
72
|
-
borderTop: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorSplit),
|
|
73
|
-
borderRadius: "0 0 ".concat(token.borderRadius, "px ").concat(token.borderRadius, "px"),
|
|
74
77
|
transition: 'all 0.3s'
|
|
75
|
-
}, "".concat(token.componentCls, "-
|
|
78
|
+
}, "&".concat(token.componentCls, "-builtin-footer-bordered"), {
|
|
79
|
+
borderTop: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorSplit),
|
|
80
|
+
borderRadius: "0 0 ".concat(token.borderRadius, "px ").concat(token.borderRadius, "px")
|
|
81
|
+
}), "".concat(token.componentCls, "-action-button"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
76
82
|
display: 'flex',
|
|
77
83
|
flex: 1,
|
|
78
84
|
cursor: 'pointer',
|
|
@@ -6,10 +6,14 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
8
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
9
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
10
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
14
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
17
|
import React from 'react';
|
|
14
18
|
import { Form, Input, Space } from 'antd';
|
|
15
19
|
import { ProForm, FormListContext } from '@ant-design/pro-components';
|
|
@@ -37,6 +41,12 @@ export var AddonInput = function AddonInput(props) {
|
|
|
37
41
|
_ref$proField = _ref.proField,
|
|
38
42
|
proField = _ref$proField === void 0 ? true : _ref$proField;
|
|
39
43
|
var fieldStyle = useFieldStyle(clazzPrefix);
|
|
44
|
+
var compositionRef = React.useRef(false);
|
|
45
|
+
var _React$useState = React.useState(undefined),
|
|
46
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
47
|
+
composingValue = _React$useState2[0],
|
|
48
|
+
setComposingValue = _React$useState2[1];
|
|
49
|
+
var webkitBrowser = navigator.userAgent.indexOf('WebKit') !== -1;
|
|
40
50
|
var addonBeforeDom = typeof (props === null || props === void 0 ? void 0 : props.addonBefore) === 'function' ? props.addonBefore() : props === null || props === void 0 ? void 0 : props.addonBefore;
|
|
41
51
|
var addonAfterDom = typeof (props === null || props === void 0 ? void 0 : props.addonAfter) === 'function' ? props.addonAfter() : props === null || props === void 0 ? void 0 : props.addonAfter;
|
|
42
52
|
var addonBeforeStyle = {
|
|
@@ -59,9 +69,41 @@ export var AddonInput = function AddonInput(props) {
|
|
|
59
69
|
var widthBlockClazz = !widthBlock ? undefined : "".concat(clazzPrefix, "-width-block");
|
|
60
70
|
var entryReadModeClazz = !entryReadMode ? undefined : "".concat(clazzPrefix, "-read-mode");
|
|
61
71
|
var entryImmutableClazz = !entryImmutable ? undefined : "".concat(clazzPrefix, "-immutable");
|
|
62
|
-
var omitFieldProps = !(props !== null && props !== void 0 && props.fieldProps) ? {} : omit(props === null || props === void 0 ? void 0 : props.fieldProps, ['className', 'name', 'id', 'placeholder', 'allowClear', 'readOnly', 'disabled', 'value', 'onChange']);
|
|
72
|
+
var omitFieldProps = !(props !== null && props !== void 0 && props.fieldProps) ? {} : omit(props === null || props === void 0 ? void 0 : props.fieldProps, ['className', 'name', 'id', 'placeholder', 'allowClear', 'readOnly', 'disabled', 'value', 'onChange', 'onCompositionStart', 'onCompositionEnd']);
|
|
73
|
+
var setFieldValue = function setFieldValue(value) {
|
|
74
|
+
if (simpleName) {
|
|
75
|
+
form === null || form === void 0 || form.setFieldValue(simpleName, value);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
var handleChange = function handleChange(event) {
|
|
79
|
+
var _props$fieldProps6, _props$fieldProps6$on;
|
|
80
|
+
if (compositionRef.current) {
|
|
81
|
+
setComposingValue(event.target.value);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (!simpleName) {
|
|
85
|
+
setComposingValue(event.target.value);
|
|
86
|
+
}
|
|
87
|
+
setFieldValue(event.target.value);
|
|
88
|
+
props === null || props === void 0 || (_props$fieldProps6 = props.fieldProps) === null || _props$fieldProps6 === void 0 || (_props$fieldProps6$on = _props$fieldProps6.onChange) === null || _props$fieldProps6$on === void 0 || _props$fieldProps6$on.call(_props$fieldProps6, event);
|
|
89
|
+
};
|
|
90
|
+
var handleCompositionStart = function handleCompositionStart(event) {
|
|
91
|
+
var _props$fieldProps7, _props$fieldProps7$on;
|
|
92
|
+
compositionRef.current = true;
|
|
93
|
+
props === null || props === void 0 || (_props$fieldProps7 = props.fieldProps) === null || _props$fieldProps7 === void 0 || (_props$fieldProps7$on = _props$fieldProps7.onCompositionStart) === null || _props$fieldProps7$on === void 0 || _props$fieldProps7$on.call(_props$fieldProps7, event);
|
|
94
|
+
};
|
|
95
|
+
var handleCompositionEnd = function handleCompositionEnd(event) {
|
|
96
|
+
var _props$fieldProps8, _props$fieldProps8$on;
|
|
97
|
+
compositionRef.current = false;
|
|
98
|
+
props === null || props === void 0 || (_props$fieldProps8 = props.fieldProps) === null || _props$fieldProps8 === void 0 || (_props$fieldProps8$on = _props$fieldProps8.onCompositionEnd) === null || _props$fieldProps8$on === void 0 || _props$fieldProps8$on.call(_props$fieldProps8, event);
|
|
99
|
+
var finalValue = event.currentTarget.value;
|
|
100
|
+
setComposingValue(simpleName ? undefined : finalValue);
|
|
101
|
+
if (webkitBrowser) {
|
|
102
|
+
setFieldValue(finalValue);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
63
105
|
if (proField) {
|
|
64
|
-
var _props$
|
|
106
|
+
var _props$fieldProps9, _StringUtils$join, _props$fieldProps10, _props$proFieldProps3, _props$fieldProps11;
|
|
65
107
|
var restProps = !props ? {} : omit(props, ['className', 'name', 'allowClear', 'fieldProps', 'proFieldProps', 'clazzPrefix', 'addonBefore', 'addonAfter', 'cursorBefore', 'cursorAfter', 'paddingBefore', 'paddingAfter', 'widthBlock', 'proField']);
|
|
66
108
|
return /*#__PURE__*/_jsx("div", {
|
|
67
109
|
className: classnames(clazzPrefix, fieldStyle.hashId, proFieldClazz, widthBlockClazz, entryReadModeClazz, entryImmutableClazz),
|
|
@@ -78,23 +120,19 @@ export var AddonInput = function AddonInput(props) {
|
|
|
78
120
|
style: addonBeforeStyle,
|
|
79
121
|
children: addonBeforeDom
|
|
80
122
|
}), /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
81
|
-
className: classnames("".concat(clazzPrefix, "-input"), props === null || props === void 0 || (_props$
|
|
82
|
-
placeholder: (_StringUtils$join = StringUtils.join(props === null || props === void 0 ? void 0 : props.placeholder)) !== null && _StringUtils$join !== void 0 ? _StringUtils$join : props === null || props === void 0 || (_props$
|
|
123
|
+
className: classnames("".concat(clazzPrefix, "-input"), props === null || props === void 0 || (_props$fieldProps9 = props.fieldProps) === null || _props$fieldProps9 === void 0 ? void 0 : _props$fieldProps9.className),
|
|
124
|
+
placeholder: (_StringUtils$join = StringUtils.join(props === null || props === void 0 ? void 0 : props.placeholder)) !== null && _StringUtils$join !== void 0 ? _StringUtils$join : props === null || props === void 0 || (_props$fieldProps10 = props.fieldProps) === null || _props$fieldProps10 === void 0 ? void 0 : _props$fieldProps10.placeholder,
|
|
83
125
|
name: simpleName,
|
|
84
|
-
value: entryReadMode ? fieldValue || (props === null || props === void 0 || (_props$proFieldProps3 = props.proFieldProps) === null || _props$proFieldProps3 === void 0 ? void 0 : _props$proFieldProps3.emptyText) || '-' : fieldValue,
|
|
85
|
-
allowClear: !entryImmutable && (props === null || props === void 0 ? void 0 : props.allowClear) !== false && (props === null || props === void 0 || (_props$
|
|
126
|
+
value: composingValue !== null && composingValue !== void 0 ? composingValue : entryReadMode ? fieldValue || (props === null || props === void 0 || (_props$proFieldProps3 = props.proFieldProps) === null || _props$proFieldProps3 === void 0 ? void 0 : _props$proFieldProps3.emptyText) || '-' : fieldValue,
|
|
127
|
+
allowClear: !entryImmutable && (props === null || props === void 0 ? void 0 : props.allowClear) !== false && (props === null || props === void 0 || (_props$fieldProps11 = props.fieldProps) === null || _props$fieldProps11 === void 0 ? void 0 : _props$fieldProps11.allowClear) !== false,
|
|
86
128
|
readOnly: entryReadMode || entryReadonly,
|
|
87
129
|
disabled: entryDisabled,
|
|
88
130
|
style: !inputWidth ? undefined : {
|
|
89
131
|
width: inputWidth
|
|
90
132
|
},
|
|
91
|
-
onChange:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
form === null || form === void 0 || form.setFieldValue(simpleName, event.target.value);
|
|
95
|
-
}
|
|
96
|
-
props === null || props === void 0 || (_props$fieldProps9 = props.fieldProps) === null || _props$fieldProps9 === void 0 || (_props$fieldProps9$on = _props$fieldProps9.onChange) === null || _props$fieldProps9$on === void 0 || _props$fieldProps9$on.call(_props$fieldProps9, event);
|
|
97
|
-
}
|
|
133
|
+
onChange: handleChange,
|
|
134
|
+
onCompositionStart: handleCompositionStart,
|
|
135
|
+
onCompositionEnd: handleCompositionEnd
|
|
98
136
|
}, omitFieldProps)), !!addonAfterDom && /*#__PURE__*/_jsx(Space.Addon, {
|
|
99
137
|
className: "".concat(clazzPrefix, "-compact-after"),
|
|
100
138
|
style: addonAfterStyle,
|
|
@@ -104,9 +142,9 @@ export var AddonInput = function AddonInput(props) {
|
|
|
104
142
|
}))
|
|
105
143
|
});
|
|
106
144
|
} else {
|
|
107
|
-
var _props$className, _props$
|
|
145
|
+
var _props$className, _props$fieldProps12, _props$fieldProps13, _StringUtils$join2, _props$fieldProps14, _props$proFieldProps4;
|
|
108
146
|
return /*#__PURE__*/_jsx("div", {
|
|
109
|
-
className: classnames(clazzPrefix, fieldStyle.hashId, proFieldClazz, widthBlockClazz, entryReadModeClazz, entryImmutableClazz, (_props$className = props === null || props === void 0 ? void 0 : props.className) !== null && _props$className !== void 0 ? _props$className : props === null || props === void 0 || (_props$
|
|
147
|
+
className: classnames(clazzPrefix, fieldStyle.hashId, proFieldClazz, widthBlockClazz, entryReadModeClazz, entryImmutableClazz, (_props$className = props === null || props === void 0 ? void 0 : props.className) !== null && _props$className !== void 0 ? _props$className : props === null || props === void 0 || (_props$fieldProps12 = props.fieldProps) === null || _props$fieldProps12 === void 0 ? void 0 : _props$fieldProps12.className),
|
|
110
148
|
children: /*#__PURE__*/_jsxs(Space.Compact, {
|
|
111
149
|
className: "".concat(clazzPrefix, "-space"),
|
|
112
150
|
style: {
|
|
@@ -117,22 +155,18 @@ export var AddonInput = function AddonInput(props) {
|
|
|
117
155
|
style: addonBeforeStyle,
|
|
118
156
|
children: addonBeforeDom
|
|
119
157
|
}), /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
120
|
-
className: classnames("".concat(clazzPrefix, "-input"), props === null || props === void 0 || (_props$
|
|
158
|
+
className: classnames("".concat(clazzPrefix, "-input"), props === null || props === void 0 || (_props$fieldProps13 = props.fieldProps) === null || _props$fieldProps13 === void 0 ? void 0 : _props$fieldProps13.className),
|
|
121
159
|
name: simpleName,
|
|
122
|
-
placeholder: (_StringUtils$join2 = StringUtils.join(props === null || props === void 0 ? void 0 : props.placeholder)) !== null && _StringUtils$join2 !== void 0 ? _StringUtils$join2 : props === null || props === void 0 || (_props$
|
|
123
|
-
value: entryReadMode ? fieldValue || (props === null || props === void 0 || (_props$proFieldProps4 = props.proFieldProps) === null || _props$proFieldProps4 === void 0 ? void 0 : _props$proFieldProps4.emptyText) || '-' : fieldValue,
|
|
160
|
+
placeholder: (_StringUtils$join2 = StringUtils.join(props === null || props === void 0 ? void 0 : props.placeholder)) !== null && _StringUtils$join2 !== void 0 ? _StringUtils$join2 : props === null || props === void 0 || (_props$fieldProps14 = props.fieldProps) === null || _props$fieldProps14 === void 0 ? void 0 : _props$fieldProps14.placeholder,
|
|
161
|
+
value: composingValue !== null && composingValue !== void 0 ? composingValue : entryReadMode ? fieldValue || (props === null || props === void 0 || (_props$proFieldProps4 = props.proFieldProps) === null || _props$proFieldProps4 === void 0 ? void 0 : _props$proFieldProps4.emptyText) || '-' : fieldValue,
|
|
124
162
|
readOnly: entryReadMode || entryReadonly,
|
|
125
163
|
disabled: entryDisabled,
|
|
126
164
|
style: !inputWidth ? undefined : {
|
|
127
165
|
width: inputWidth
|
|
128
166
|
},
|
|
129
|
-
onChange:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
form === null || form === void 0 || form.setFieldValue(props.name, event.target.value);
|
|
133
|
-
}
|
|
134
|
-
props === null || props === void 0 || (_props$fieldProps13 = props.fieldProps) === null || _props$fieldProps13 === void 0 || (_props$fieldProps13$o = _props$fieldProps13.onChange) === null || _props$fieldProps13$o === void 0 || _props$fieldProps13$o.call(_props$fieldProps13, event);
|
|
135
|
-
}
|
|
167
|
+
onChange: handleChange,
|
|
168
|
+
onCompositionStart: handleCompositionStart,
|
|
169
|
+
onCompositionEnd: handleCompositionEnd
|
|
136
170
|
}, omitFieldProps)), !!addonAfterDom && /*#__PURE__*/_jsx(Space.Addon, {
|
|
137
171
|
className: "".concat(clazzPrefix, "-compact-after"),
|
|
138
172
|
style: addonAfterStyle,
|
|
@@ -45,7 +45,7 @@ export type AvatarUploadProps = Omit<ProFormFieldItemProps, 'children' | 'fieldR
|
|
|
45
45
|
locale?: string;
|
|
46
46
|
localeProps?: IntlLocaleProps;
|
|
47
47
|
};
|
|
48
|
-
export declare const AvatarUpload: React.ForwardRefExoticComponent<Omit<ProFormFieldItemProps, "children" | "
|
|
48
|
+
export declare const AvatarUpload: React.ForwardRefExoticComponent<Omit<ProFormFieldItemProps, "children" | "placeholder" | "fieldProps" | "disabled" | "readonly" | "fieldRef"> & {
|
|
49
49
|
clazzPrefix?: string | undefined;
|
|
50
50
|
containerClazz?: string | undefined;
|
|
51
51
|
containerStyle?: React.CSSProperties | undefined;
|
|
@@ -53,8 +53,8 @@ export declare const AvatarUpload: React.ForwardRefExoticComponent<Omit<ProFormF
|
|
|
53
53
|
imageSrc?: string | undefined;
|
|
54
54
|
fallbackSrc?: string | undefined;
|
|
55
55
|
shape?: CircleSquareShape | undefined;
|
|
56
|
-
avatarProps?: Omit<AvatarProps, "children" | "
|
|
57
|
-
imageProps?: Omit<ImageProps, "title" | "
|
|
56
|
+
avatarProps?: Omit<AvatarProps, "children" | "src" | "srcSet" | "shape"> | undefined;
|
|
57
|
+
imageProps?: Omit<ImageProps, "title" | "src" | "fallback" | "preview" | "height" | "srcSet" | "width"> | undefined;
|
|
58
58
|
uploadEnabled?: boolean | undefined;
|
|
59
59
|
uploadProps?: FileUploadProps | undefined;
|
|
60
60
|
cropEnabled?: boolean | undefined;
|
|
@@ -16,7 +16,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
16
16
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
import React from 'react';
|
|
19
|
-
import { ConfigProvider, Form,
|
|
19
|
+
import { ConfigProvider, Form, Listy, Popconfirm, Space, Tooltip } from 'antd';
|
|
20
20
|
import { TranslationOutlined, SelectOutlined } from '@ant-design/icons';
|
|
21
21
|
import { useIntl } from '@ant-design/pro-components';
|
|
22
22
|
import { EditOrReadOnlyContext } from '@ant-design/pro-components/es/form/BaseForm/EditOrReadOnlyContext.js';
|
|
@@ -121,8 +121,15 @@ export var LocaleInput = function LocaleInput(props) {
|
|
|
121
121
|
useEventListener('resize', handleWindowResize);
|
|
122
122
|
var addonEntryDom = typeof addon === 'function' ? addon() : addon;
|
|
123
123
|
var buildEntryAddonDom = function buildEntryAddonDom(before) {
|
|
124
|
-
|
|
124
|
+
if (!(before && addonPos === 'before' || !before && addonPos === 'after')) {
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
return multilingual ? addonEntryDom : /*#__PURE__*/_jsx("span", {
|
|
128
|
+
className: "".concat(clazzPrefix, "-entry-addon-disabled"),
|
|
129
|
+
children: addonEntryDom
|
|
130
|
+
});
|
|
125
131
|
};
|
|
132
|
+
var entryAddonCursor = multilingual ? 'pointer' : 'not-allowed';
|
|
126
133
|
var renderEntryReadonly = function renderEntryReadonly(dom) {
|
|
127
134
|
var _props$proFieldProps;
|
|
128
135
|
return /*#__PURE__*/_jsxs("div", {
|
|
@@ -157,8 +164,8 @@ export var LocaleInput = function LocaleInput(props) {
|
|
|
157
164
|
children: /*#__PURE__*/_jsx(AddonInput, _objectSpread({
|
|
158
165
|
addonBefore: buildEntryAddonDom(true),
|
|
159
166
|
addonAfter: buildEntryAddonDom(false),
|
|
160
|
-
cursorBefore: addonPos === 'before' ?
|
|
161
|
-
cursorAfter: addonPos === 'after' ?
|
|
167
|
+
cursorBefore: addonPos === 'before' ? entryAddonCursor : undefined,
|
|
168
|
+
cursorAfter: addonPos === 'after' ? entryAddonCursor : undefined,
|
|
162
169
|
fieldProps: _objectSpread(_objectSpread({
|
|
163
170
|
className: classnames("".concat(clazzPrefix, "-entry-").concat(fieldId), (_props$className = props === null || props === void 0 ? void 0 : props.className) !== null && _props$className !== void 0 ? _props$className : props === null || props === void 0 || (_props$fieldProps = props.fieldProps) === null || _props$fieldProps === void 0 ? void 0 : _props$fieldProps.className),
|
|
164
171
|
allowClear: (props === null || props === void 0 ? void 0 : props.allowClear) || (props === null || props === void 0 || (_props$fieldProps2 = props.fieldProps) === null || _props$fieldProps2 === void 0 ? void 0 : _props$fieldProps2.allowClear)
|
|
@@ -184,8 +191,8 @@ export var LocaleInput = function LocaleInput(props) {
|
|
|
184
191
|
placeholder: (_StringUtils$join = StringUtils.join(props === null || props === void 0 ? void 0 : props.placeholder)) !== null && _StringUtils$join !== void 0 ? _StringUtils$join : props === null || props === void 0 || (_props$fieldProps4 = props.fieldProps) === null || _props$fieldProps4 === void 0 ? void 0 : _props$fieldProps4.placeholder,
|
|
185
192
|
addonBefore: buildEntryAddonDom(true),
|
|
186
193
|
addonAfter: buildEntryAddonDom(false),
|
|
187
|
-
cursorBefore: addonPos === 'before' ?
|
|
188
|
-
cursorAfter: addonPos === 'after' ?
|
|
194
|
+
cursorBefore: addonPos === 'before' ? entryAddonCursor : undefined,
|
|
195
|
+
cursorAfter: addonPos === 'after' ? entryAddonCursor : undefined,
|
|
189
196
|
proField: proField,
|
|
190
197
|
onChange: function onChange(event) {
|
|
191
198
|
var _props$fieldProps5, _props$fieldProps5$on;
|
|
@@ -435,13 +442,17 @@ export var LocaleInput = function LocaleInput(props) {
|
|
|
435
442
|
props === null || props === void 0 || (_props$triggerProps = props.triggerProps) === null || _props$triggerProps === void 0 || (_props$triggerProps$o = _props$triggerProps.onOpenChange) === null || _props$triggerProps$o === void 0 || _props$triggerProps$o.call(_props$triggerProps, false);
|
|
436
443
|
}, 200);
|
|
437
444
|
},
|
|
438
|
-
children: /*#__PURE__*/_jsx(
|
|
439
|
-
className: "".concat(clazzPrefix, "-popup-list"),
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
+
children: /*#__PURE__*/_jsx(Listy, {
|
|
446
|
+
className: classnames("".concat(clazzPrefix, "-popup-list"), "".concat(clazzPrefix, "-popup-list-bordered")),
|
|
447
|
+
items: tagInputs,
|
|
448
|
+
rowKey: function rowKey(_item, index) {
|
|
449
|
+
return index;
|
|
450
|
+
},
|
|
451
|
+
classNames: {
|
|
452
|
+
item: "".concat(clazzPrefix, "-popup-listy-item")
|
|
453
|
+
},
|
|
454
|
+
itemRender: function itemRender(item) {
|
|
455
|
+
return /*#__PURE__*/_jsx("div", {
|
|
445
456
|
className: "".concat(clazzPrefix, "-popup-list-item"),
|
|
446
457
|
children: item
|
|
447
458
|
});
|