@pisell/materials 1.0.586 → 1.0.588
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +11 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/dataSourceComponents/fields/IconSelect/ReadPretty.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/IconSelect/ReadPretty.js +18 -0
- package/es/components/dataSourceComponents/fields/IconSelect/ReadPretty.less +6 -0
- package/es/components/dataSourceComponents/fields/IconSelect/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/IconSelect/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/IconSelect/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/IconSelect/index.js +4 -0
- package/es/components/dataSourceComponents/fields/IconSelect/type.d.ts +8 -0
- package/es/components/dataSourceComponents/fields/IconSelect/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +2 -1
- package/es/components/dataSourceComponents/fields/index.js +3 -1
- package/es/components/iconSelect/index.d.ts +10 -0
- package/es/components/iconSelect/index.js +215 -0
- package/es/components/iconSelect/index.less +54 -0
- package/es/components/iconSelect/utils.d.ts +14 -0
- package/es/components/iconSelect/utils.js +102 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/locales/en-US.d.ts +8 -1
- package/es/locales/en-US.js +25 -9
- package/es/locales/zh-CN.d.ts +7 -0
- package/es/locales/zh-CN.js +8 -1
- package/es/locales/zh-TW.d.ts +7 -0
- package/es/locales/zh-TW.js +8 -1
- package/lib/components/dataSourceComponents/fields/IconSelect/ReadPretty.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/ReadPretty.js +52 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/ReadPretty.less +6 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/type.d.ts +8 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +2 -1
- package/lib/components/dataSourceComponents/fields/index.js +3 -1
- package/lib/components/iconSelect/index.d.ts +10 -0
- package/lib/components/iconSelect/index.js +188 -0
- package/lib/components/iconSelect/index.less +54 -0
- package/lib/components/iconSelect/utils.d.ts +14 -0
- package/lib/components/iconSelect/utils.js +119 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lib/locales/en-US.d.ts +8 -1
- package/lib/locales/en-US.js +8 -2
- package/lib/locales/zh-CN.d.ts +7 -0
- package/lib/locales/zh-CN.js +8 -1
- package/lib/locales/zh-TW.d.ts +7 -0
- package/lib/locales/zh-TW.js +8 -1
- package/lowcode/_setters/antd-icon-setter/index.tsx +11 -4
- package/lowcode/data-source-form/constants.ts +2 -1
- package/lowcode/form-item-icon-select/meta.ts +65 -0
- package/lowcode/form-item-icon-select/snippets.ts +11 -0
- package/lowcode/icon-select/meta.ts +98 -0
- package/package.json +1 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/iconSelect/utils.tsx
|
|
30
|
+
var utils_exports = {};
|
|
31
|
+
__export(utils_exports, {
|
|
32
|
+
get: () => get,
|
|
33
|
+
getAntdIconList: () => getAntdIconList,
|
|
34
|
+
getIconList: () => getIconList
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(utils_exports);
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
function get(obj, path, defaultValue) {
|
|
39
|
+
if (!path)
|
|
40
|
+
return defaultValue;
|
|
41
|
+
const keys = path.split(".");
|
|
42
|
+
let result = obj;
|
|
43
|
+
for (const key of keys) {
|
|
44
|
+
if (result == null) {
|
|
45
|
+
return defaultValue;
|
|
46
|
+
}
|
|
47
|
+
result = result[key];
|
|
48
|
+
}
|
|
49
|
+
return result === void 0 ? defaultValue : result;
|
|
50
|
+
}
|
|
51
|
+
function getIconfontIconList() {
|
|
52
|
+
const symbols = Array.prototype.slice.call(
|
|
53
|
+
window.document.querySelectorAll(
|
|
54
|
+
'svg[style="position: absolute; width: 0px; height: 0px; overflow: hidden;"][aria-hidden="true"] > symbol'
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
return symbols.map((symbol) => {
|
|
58
|
+
const { id } = symbol;
|
|
59
|
+
return {
|
|
60
|
+
name: id,
|
|
61
|
+
group: "iconfont",
|
|
62
|
+
icon: (props) => /* @__PURE__ */ import_react.default.createElement("span", { role: "img", className: "anticon" }, /* @__PURE__ */ import_react.default.createElement(
|
|
63
|
+
"svg",
|
|
64
|
+
{
|
|
65
|
+
viewBox: "64 64 896 896",
|
|
66
|
+
width: "1em",
|
|
67
|
+
height: "1em",
|
|
68
|
+
fill: "currentColor",
|
|
69
|
+
dangerouslySetInnerHTML: { __html: symbol.innerHTML }
|
|
70
|
+
}
|
|
71
|
+
))
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function getAntdIconList() {
|
|
76
|
+
const antdIcons = window.icons;
|
|
77
|
+
return Object.keys(antdIcons).map((key) => {
|
|
78
|
+
var _a;
|
|
79
|
+
const item = antdIcons[key];
|
|
80
|
+
if (typeof item !== "object") {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const name = (item == null ? void 0 : item.displayName) ?? ((_a = item == null ? void 0 : item.render) == null ? void 0 : _a.displayName) ?? key;
|
|
84
|
+
let group = "outlined";
|
|
85
|
+
const lowercaseName = name.toLowerCase();
|
|
86
|
+
if (/outlined$/.test(lowercaseName)) {
|
|
87
|
+
group = "outlined";
|
|
88
|
+
} else if (/filled$/.test(lowercaseName)) {
|
|
89
|
+
group = "filled";
|
|
90
|
+
} else if (/twotone$/.test(lowercaseName)) {
|
|
91
|
+
group = "two-tone";
|
|
92
|
+
} else {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
name,
|
|
97
|
+
group,
|
|
98
|
+
icon: item
|
|
99
|
+
};
|
|
100
|
+
}).filter(Boolean);
|
|
101
|
+
}
|
|
102
|
+
function getIconList() {
|
|
103
|
+
const iconfontIconList = getIconfontIconList();
|
|
104
|
+
const antdIconList = getAntdIconList();
|
|
105
|
+
const allIcons = [...iconfontIconList, ...antdIconList];
|
|
106
|
+
const uniqueIconsMap = /* @__PURE__ */ new Map();
|
|
107
|
+
allIcons.forEach((icon) => {
|
|
108
|
+
if (!uniqueIconsMap.has(icon.name)) {
|
|
109
|
+
uniqueIconsMap.set(icon.name, icon);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return Array.from(uniqueIconsMap.values());
|
|
113
|
+
}
|
|
114
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
115
|
+
0 && (module.exports = {
|
|
116
|
+
get,
|
|
117
|
+
getAntdIconList,
|
|
118
|
+
getIconList
|
|
119
|
+
});
|
package/lib/index.d.ts
CHANGED
|
@@ -138,6 +138,7 @@ export { default as FormItemSelect } from './components/dataSourceComponents/fie
|
|
|
138
138
|
export { default as FormItemTimePicker } from './components/dataSourceComponents/fields/TimePicker';
|
|
139
139
|
export { default as FormItemUpload } from './components/dataSourceComponents/fields/Upload';
|
|
140
140
|
export { default as FormItemTranslation } from './components/dataSourceComponents/fields/Translation';
|
|
141
|
+
export { default as FormItemIconSelect } from './components/dataSourceComponents/fields/IconSelect';
|
|
141
142
|
export { default as DataSourceTable } from './components/dataSourceComponents/dataSourceTable';
|
|
142
143
|
export { default as DataSourceWrapper } from './components/dataSourceComponents/dataSourceWrapper';
|
|
143
144
|
export { default as DataSourceTypography } from './components/dataSourceComponents/dataSourceShow/dataSourceTypography';
|
|
@@ -155,3 +156,4 @@ export { default as PageHeader } from './components/page-header';
|
|
|
155
156
|
export { default as OrganizationTenantSwitcher } from './components/organizationTenantSwitcher';
|
|
156
157
|
export { default as loginAndRegister } from './components/login-and-register';
|
|
157
158
|
export { default as PublishVersionModal } from './components/versionModal';
|
|
159
|
+
export { default as IconSelect } from './components/iconSelect';
|
package/lib/index.js
CHANGED
|
@@ -75,6 +75,7 @@ __export(src_exports, {
|
|
|
75
75
|
FormItemCheckbox: () => import_Checkbox.default,
|
|
76
76
|
FormItemColorPicker: () => import_ColorPicker.default,
|
|
77
77
|
FormItemDatePicker: () => import_DatePicker.default,
|
|
78
|
+
FormItemIconSelect: () => import_IconSelect.default,
|
|
78
79
|
FormItemInput: () => import_Input.default,
|
|
79
80
|
FormItemInputNumber: () => import_InputNumber.default,
|
|
80
81
|
FormItemRadio: () => import_Radio.default,
|
|
@@ -84,6 +85,7 @@ __export(src_exports, {
|
|
|
84
85
|
FormItemUpload: () => import_Upload.default,
|
|
85
86
|
Grid: () => import_antd12.Grid,
|
|
86
87
|
Icon: () => import_icon.default,
|
|
88
|
+
IconSelect: () => import_iconSelect.default,
|
|
87
89
|
Iconfont: () => import_iconfont.default,
|
|
88
90
|
Image: () => import_antd13.Image,
|
|
89
91
|
Input: () => import_input.default,
|
|
@@ -329,6 +331,7 @@ var import_Select = __toESM(require("./components/dataSourceComponents/fields/Se
|
|
|
329
331
|
var import_TimePicker = __toESM(require("./components/dataSourceComponents/fields/TimePicker"));
|
|
330
332
|
var import_Upload = __toESM(require("./components/dataSourceComponents/fields/Upload"));
|
|
331
333
|
var import_Translation = __toESM(require("./components/dataSourceComponents/fields/Translation"));
|
|
334
|
+
var import_IconSelect = __toESM(require("./components/dataSourceComponents/fields/IconSelect"));
|
|
332
335
|
var import_dataSourceTable = __toESM(require("./components/dataSourceComponents/dataSourceTable"));
|
|
333
336
|
var import_dataSourceWrapper = __toESM(require("./components/dataSourceComponents/dataSourceWrapper"));
|
|
334
337
|
var import_dataSourceTypography = __toESM(require("./components/dataSourceComponents/dataSourceShow/dataSourceTypography"));
|
|
@@ -346,6 +349,7 @@ var import_page_header = __toESM(require("./components/page-header"));
|
|
|
346
349
|
var import_organizationTenantSwitcher = __toESM(require("./components/organizationTenantSwitcher"));
|
|
347
350
|
var import_login_and_register = __toESM(require("./components/login-and-register"));
|
|
348
351
|
var import_versionModal = __toESM(require("./components/versionModal"));
|
|
352
|
+
var import_iconSelect = __toESM(require("./components/iconSelect"));
|
|
349
353
|
// Annotate the CommonJS export names for ESM import in node:
|
|
350
354
|
0 && (module.exports = {
|
|
351
355
|
Affix,
|
|
@@ -394,6 +398,7 @@ var import_versionModal = __toESM(require("./components/versionModal"));
|
|
|
394
398
|
FormItemCheckbox,
|
|
395
399
|
FormItemColorPicker,
|
|
396
400
|
FormItemDatePicker,
|
|
401
|
+
FormItemIconSelect,
|
|
397
402
|
FormItemInput,
|
|
398
403
|
FormItemInputNumber,
|
|
399
404
|
FormItemRadio,
|
|
@@ -403,6 +408,7 @@ var import_versionModal = __toESM(require("./components/versionModal"));
|
|
|
403
408
|
FormItemUpload,
|
|
404
409
|
Grid,
|
|
405
410
|
Icon,
|
|
411
|
+
IconSelect,
|
|
406
412
|
Iconfont,
|
|
407
413
|
Image,
|
|
408
414
|
Input,
|
package/lib/locales/en-US.d.ts
CHANGED
|
@@ -168,11 +168,11 @@ declare const _default: {
|
|
|
168
168
|
'walletCard-discount': string;
|
|
169
169
|
'pisellQrcode-done': string;
|
|
170
170
|
'pisellQrcode-qrcode': string;
|
|
171
|
-
'pisell-design-mode-action-disabled': string;
|
|
172
171
|
'pisell-delete-confirm-title': string;
|
|
173
172
|
'pisell-delete-confirm-content': string;
|
|
174
173
|
'pisell-delete-confirm-ok': string;
|
|
175
174
|
'pisell-delete-confirm-cancel': string;
|
|
175
|
+
'pisell-design-mode-action-disabled': string;
|
|
176
176
|
'pisell-translation-original': string;
|
|
177
177
|
'pisell-version-modal-title': string;
|
|
178
178
|
'pisell-version-modal-current-version': string;
|
|
@@ -187,5 +187,12 @@ declare const _default: {
|
|
|
187
187
|
'pisell-version-modal-describe-update-notes': string;
|
|
188
188
|
'pisell-version-modal-version-error': string;
|
|
189
189
|
'pisell-version-modal-version-required': string;
|
|
190
|
+
'pisell-icon-select-placeholder': string;
|
|
191
|
+
'pisell-icon-select-outlined': string;
|
|
192
|
+
'pisell-icon-select-filled': string;
|
|
193
|
+
'pisell-icon-select-two-tone': string;
|
|
194
|
+
'pisell-icon-select-iconfont': string;
|
|
195
|
+
'pisell-icon-select-search': string;
|
|
196
|
+
'pisell-icon-select-select': string;
|
|
190
197
|
};
|
|
191
198
|
export default _default;
|
package/lib/locales/en-US.js
CHANGED
|
@@ -209,7 +209,6 @@ var en_US_default = {
|
|
|
209
209
|
//PisellQrcode组件
|
|
210
210
|
"pisellQrcode-done": "Done",
|
|
211
211
|
"pisellQrcode-qrcode": "QR code",
|
|
212
|
-
"pisell-design-mode-action-disabled": "This action cannot be performed in edit mode",
|
|
213
212
|
"pisell-delete-confirm-title": "Confirm Delete",
|
|
214
213
|
"pisell-delete-confirm-content": "Are you sure you want to delete this record? This action cannot be undone.",
|
|
215
214
|
"pisell-delete-confirm-ok": "Delete",
|
|
@@ -228,5 +227,12 @@ var en_US_default = {
|
|
|
228
227
|
"pisell-version-modal-confirm": "Confirm",
|
|
229
228
|
"pisell-version-modal-describe-update-notes": "Describe the main changes in this version...",
|
|
230
229
|
"pisell-version-modal-version-error": "Version number must be greater than the current version",
|
|
231
|
-
"pisell-version-modal-version-required": "Version number is required"
|
|
230
|
+
"pisell-version-modal-version-required": "Version number is required",
|
|
231
|
+
"pisell-icon-select-placeholder": "Select icon",
|
|
232
|
+
"pisell-icon-select-outlined": "Outlined",
|
|
233
|
+
"pisell-icon-select-filled": "Filled",
|
|
234
|
+
"pisell-icon-select-two-tone": "Two-tone",
|
|
235
|
+
"pisell-icon-select-iconfont": "Iconfont",
|
|
236
|
+
"pisell-icon-select-search": "Search icon",
|
|
237
|
+
"pisell-icon-select-select": "Select icon"
|
|
232
238
|
};
|
package/lib/locales/zh-CN.d.ts
CHANGED
|
@@ -187,5 +187,12 @@ declare const _default: {
|
|
|
187
187
|
'pisell-version-modal-describe-update-notes': string;
|
|
188
188
|
'pisell-version-modal-version-error': string;
|
|
189
189
|
'pisell-version-modal-version-required': string;
|
|
190
|
+
'pisell-icon-select-placeholder': string;
|
|
191
|
+
'pisell-icon-select-outlined': string;
|
|
192
|
+
'pisell-icon-select-filled': string;
|
|
193
|
+
'pisell-icon-select-two-tone': string;
|
|
194
|
+
'pisell-icon-select-iconfont': string;
|
|
195
|
+
'pisell-icon-select-search': string;
|
|
196
|
+
'pisell-icon-select-select': string;
|
|
190
197
|
};
|
|
191
198
|
export default _default;
|
package/lib/locales/zh-CN.js
CHANGED
|
@@ -226,5 +226,12 @@ var zh_CN_default = {
|
|
|
226
226
|
"pisell-version-modal-confirm": "确定",
|
|
227
227
|
"pisell-version-modal-describe-update-notes": "描述此版本的主要更改...",
|
|
228
228
|
"pisell-version-modal-version-error": "版本号必须大于当前版本",
|
|
229
|
-
"pisell-version-modal-version-required": "版本号为必填项"
|
|
229
|
+
"pisell-version-modal-version-required": "版本号为必填项",
|
|
230
|
+
"pisell-icon-select-placeholder": "请选择图标",
|
|
231
|
+
"pisell-icon-select-outlined": "线框风格",
|
|
232
|
+
"pisell-icon-select-filled": "实底风格",
|
|
233
|
+
"pisell-icon-select-two-tone": "双色风格",
|
|
234
|
+
"pisell-icon-select-iconfont": "Iconfont",
|
|
235
|
+
"pisell-icon-select-search": "搜索图标",
|
|
236
|
+
"pisell-icon-select-select": "选择图标"
|
|
230
237
|
};
|
package/lib/locales/zh-TW.d.ts
CHANGED
|
@@ -187,5 +187,12 @@ declare const _default: {
|
|
|
187
187
|
'pisell-version-modal-describe-update-notes': string;
|
|
188
188
|
'pisell-version-modal-version-error': string;
|
|
189
189
|
'pisell-version-modal-version-required': string;
|
|
190
|
+
'pisell-icon-select-placeholder': string;
|
|
191
|
+
'pisell-icon-select-outlined': string;
|
|
192
|
+
'pisell-icon-select-filled': string;
|
|
193
|
+
'pisell-icon-select-two-tone': string;
|
|
194
|
+
'pisell-icon-select-iconfont': string;
|
|
195
|
+
'pisell-icon-select-search': string;
|
|
196
|
+
'pisell-icon-select-select': string;
|
|
190
197
|
};
|
|
191
198
|
export default _default;
|
package/lib/locales/zh-TW.js
CHANGED
|
@@ -227,5 +227,12 @@ var zh_TW_default = {
|
|
|
227
227
|
"pisell-version-modal-confirm": "确定",
|
|
228
228
|
"pisell-version-modal-describe-update-notes": "描述此版本的主要更改...",
|
|
229
229
|
"pisell-version-modal-version-error": "版本號必須大於當前版本",
|
|
230
|
-
"pisell-version-modal-version-required": "版本號為必填項"
|
|
230
|
+
"pisell-version-modal-version-required": "版本號為必填項",
|
|
231
|
+
"pisell-icon-select-placeholder": "選擇圖標",
|
|
232
|
+
"pisell-icon-select-outlined": "線框風格",
|
|
233
|
+
"pisell-icon-select-filled": "實底風格",
|
|
234
|
+
"pisell-icon-select-two-tone": "雙色風格",
|
|
235
|
+
"pisell-icon-select-iconfont": "Iconfont",
|
|
236
|
+
"pisell-icon-select-search": "搜索圖標",
|
|
237
|
+
"pisell-icon-select-select": "選擇圖標"
|
|
231
238
|
};
|
|
@@ -22,8 +22,6 @@ function getIconfontIconList() {
|
|
|
22
22
|
any
|
|
23
23
|
>;
|
|
24
24
|
|
|
25
|
-
console.log(antdIcons,'antdIcons');
|
|
26
|
-
|
|
27
25
|
// iconfont的js会在页面中添加svg元素
|
|
28
26
|
const symbols = Array.prototype.slice.call(
|
|
29
27
|
iframe.contentDocument!.querySelectorAll(
|
|
@@ -102,7 +100,16 @@ function getIconList() {
|
|
|
102
100
|
const iconfontIconList = getIconfontIconList();
|
|
103
101
|
const antdIconList = getAntdIconList();
|
|
104
102
|
|
|
105
|
-
|
|
103
|
+
const allIcons = [...antdIconList, ...iconfontIconList];
|
|
104
|
+
|
|
105
|
+
const uniqueIconsMap = new Map();
|
|
106
|
+
allIcons.forEach(icon => {
|
|
107
|
+
if (!uniqueIconsMap.has(icon?.name)) {
|
|
108
|
+
uniqueIconsMap.set(icon?.name, icon);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
return Array.from(uniqueIconsMap.values());
|
|
106
113
|
}
|
|
107
114
|
|
|
108
115
|
const Icon = (props: any) => {
|
|
@@ -271,7 +278,7 @@ AntdIconSetter.defaultProps = {
|
|
|
271
278
|
value: undefined,
|
|
272
279
|
type: 'string',
|
|
273
280
|
defaultValue: '',
|
|
274
|
-
hasClear:
|
|
281
|
+
hasClear: true,
|
|
275
282
|
placeholder: '请点击选择 Icon',
|
|
276
283
|
onChange: () => undefined,
|
|
277
284
|
};
|
|
@@ -70,7 +70,8 @@ export const nocobaseCpt2PisellCptMap: Record<string, any> = {
|
|
|
70
70
|
'Radio.Group': 'FormItemRadio.Group',
|
|
71
71
|
'Checkbox.Group': 'FormItemCheckbox.Group',
|
|
72
72
|
Upload: 'FormItemUpload',
|
|
73
|
-
Translation: "FormItemTranslation"
|
|
73
|
+
Translation: "FormItemTranslation",
|
|
74
|
+
IconPicker: "FormItemIconSelect",
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import snippets from './snippets';
|
|
2
|
+
import { AntdIconSetter } from '../_setters';
|
|
3
|
+
import {
|
|
4
|
+
formItemGeneralDataGroup,
|
|
5
|
+
getFormItemGeneralInfoGroup,
|
|
6
|
+
generalItemMap,
|
|
7
|
+
getFormItemValidateGroup,
|
|
8
|
+
} from '../_utils/defaultSchema';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
snippets,
|
|
12
|
+
componentName: 'FormItemIconSelect',
|
|
13
|
+
title: '高级选择图标',
|
|
14
|
+
category: '表单',
|
|
15
|
+
group: '无代码组件',
|
|
16
|
+
docUrl: '',
|
|
17
|
+
screenshot: '',
|
|
18
|
+
devMode: 'proCode',
|
|
19
|
+
npm: {
|
|
20
|
+
package: '@pisell/materials',
|
|
21
|
+
version: '1.0.1',
|
|
22
|
+
exportName: 'FormItemIconSelect',
|
|
23
|
+
main: 'src/index.tsx',
|
|
24
|
+
destructuring: true,
|
|
25
|
+
subName: '',
|
|
26
|
+
},
|
|
27
|
+
generalProps: [
|
|
28
|
+
formItemGeneralDataGroup,
|
|
29
|
+
getFormItemGeneralInfoGroup([
|
|
30
|
+
generalItemMap['label'],
|
|
31
|
+
generalItemMap['tooltip'],
|
|
32
|
+
generalItemMap['extra'],
|
|
33
|
+
generalItemMap['hideLabel'],
|
|
34
|
+
generalItemMap['renderMode'],
|
|
35
|
+
{
|
|
36
|
+
title: {
|
|
37
|
+
label: {
|
|
38
|
+
type: 'i18n',
|
|
39
|
+
'en-US': 'defaultValue',
|
|
40
|
+
'zh-CN': '默认图标',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
name: 'defaultValue',
|
|
44
|
+
setter: AntdIconSetter,
|
|
45
|
+
supportVariable: true,
|
|
46
|
+
},
|
|
47
|
+
]),
|
|
48
|
+
getFormItemValidateGroup([
|
|
49
|
+
generalItemMap['requiredobj'],
|
|
50
|
+
]),
|
|
51
|
+
],
|
|
52
|
+
props: [],
|
|
53
|
+
configure: {
|
|
54
|
+
supports: {
|
|
55
|
+
style: true,
|
|
56
|
+
events: [
|
|
57
|
+
{
|
|
58
|
+
name: 'onChange',
|
|
59
|
+
template:
|
|
60
|
+
"onChange(event,${extParams}){\n// 输入框内容变化时的回调\nconsole.log('onChange',event);}",
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ComponentMetadata, Snippet } from '@alilc/lowcode-types';
|
|
2
|
+
import { AntdIconSetter } from '../_setters';
|
|
3
|
+
|
|
4
|
+
const IconSelectMeta: ComponentMetadata = {
|
|
5
|
+
componentName: 'IconSelect',
|
|
6
|
+
title: '选择图标',
|
|
7
|
+
docUrl: '',
|
|
8
|
+
screenshot: '',
|
|
9
|
+
devMode: 'proCode',
|
|
10
|
+
npm: {
|
|
11
|
+
package: '@pisell/materials',
|
|
12
|
+
version: '0.1.0',
|
|
13
|
+
exportName: 'IconSelect',
|
|
14
|
+
main: 'src/index.tsx',
|
|
15
|
+
destructuring: true,
|
|
16
|
+
subName: '',
|
|
17
|
+
},
|
|
18
|
+
configure: {
|
|
19
|
+
props: [
|
|
20
|
+
{
|
|
21
|
+
title: {
|
|
22
|
+
label: {
|
|
23
|
+
type: 'i18n',
|
|
24
|
+
'en-US': 'value',
|
|
25
|
+
'zh-CN': '当前图标',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
name: 'value',
|
|
29
|
+
setter: AntdIconSetter,
|
|
30
|
+
supportVariable: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: {
|
|
34
|
+
label: {
|
|
35
|
+
type: 'i18n',
|
|
36
|
+
'en-US': 'defaultValue',
|
|
37
|
+
'zh-CN': '默认图标',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
name: 'defaultValue',
|
|
41
|
+
setter: AntdIconSetter,
|
|
42
|
+
supportVariable: true,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
title: {
|
|
46
|
+
label: {
|
|
47
|
+
type: 'i18n',
|
|
48
|
+
'en-US': 'disabled',
|
|
49
|
+
'zh-CN': '是否禁用',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
name: 'disabled',
|
|
53
|
+
setter: 'BoolSetter',
|
|
54
|
+
defaultValue: false,
|
|
55
|
+
supportVariable: true,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
supports: {
|
|
59
|
+
style: true,
|
|
60
|
+
className: true,
|
|
61
|
+
events: [
|
|
62
|
+
{
|
|
63
|
+
name: 'onChange',
|
|
64
|
+
template:
|
|
65
|
+
"onChange(icon,${extParams}){\n// 选择icon变化时的回调\nconsole.log('onChange',icon);}",
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
component: {
|
|
70
|
+
isContainer: false,
|
|
71
|
+
nestingRule: {
|
|
72
|
+
childWhitelist: [],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
experimental: {
|
|
77
|
+
callbacks: {},
|
|
78
|
+
},
|
|
79
|
+
category: '表单',
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const snippets: Snippet[] = [
|
|
83
|
+
{
|
|
84
|
+
title: '选择图标',
|
|
85
|
+
screenshot: '',
|
|
86
|
+
schema: {
|
|
87
|
+
componentName: 'IconSelect',
|
|
88
|
+
props: {
|
|
89
|
+
placeholder: '选择图标',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
export default {
|
|
96
|
+
...IconSelectMeta,
|
|
97
|
+
snippets,
|
|
98
|
+
};
|