cnhis-design-vue 3.1.17-beta.5 → 3.1.17-beta.6
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isObject } from '@vueuse/core';
|
|
2
|
-
import { cloneDeep, pick } from 'lodash-es';
|
|
2
|
+
import { cloneDeep, omit, pick } from 'lodash-es';
|
|
3
3
|
import { useFormValidator, useFieldNormalize } from '../../../../packages/form-render';
|
|
4
4
|
import { arrayed, parseNumberFromMaybeString, formRenderLog } from '../utils/index.js';
|
|
5
5
|
import { fieldKeyEscape, createLinebarId } from '../utils/schema.js';
|
|
@@ -142,7 +142,7 @@ function useFieldListAdaptor(collector) {
|
|
|
142
142
|
const createCustomSchema = (item) => {
|
|
143
143
|
const schema = createStandardSchema(item);
|
|
144
144
|
Object.assign(schema["x-component-props"], {
|
|
145
|
-
fieldItem: item
|
|
145
|
+
fieldItem: omit(item, ["reactions"])
|
|
146
146
|
});
|
|
147
147
|
return schema;
|
|
148
148
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare enum LogsType {
|
|
2
|
+
DEFAULT = "default",
|
|
3
|
+
PRIMARY = "primary",
|
|
4
|
+
SUCCESS = "success",
|
|
5
|
+
WARNING = "warning",
|
|
6
|
+
DANGER = "danger"
|
|
7
|
+
}
|
|
8
|
+
declare class Log {
|
|
9
|
+
/**
|
|
10
|
+
* @description 打印一个 [ title | text ] 样式的信息
|
|
11
|
+
* @param {String} title title text
|
|
12
|
+
* @param {String} info info text
|
|
13
|
+
* @param {String} type style
|
|
14
|
+
* @param {any[]} appendInfo
|
|
15
|
+
*/
|
|
16
|
+
capsule(title: string, info: any, type?: LogsType, ...appendInfo: any[]): void;
|
|
17
|
+
/**
|
|
18
|
+
* @description 打印彩色文字
|
|
19
|
+
*/
|
|
20
|
+
colorful(textArr: {
|
|
21
|
+
text: any;
|
|
22
|
+
type: LogsType;
|
|
23
|
+
}[]): void;
|
|
24
|
+
text(text: any): void;
|
|
25
|
+
primary(text: any): void;
|
|
26
|
+
success(text: any): void;
|
|
27
|
+
warning(text: any): void;
|
|
28
|
+
danger(text: any): void;
|
|
29
|
+
}
|
|
30
|
+
declare const log: Log;
|
|
31
|
+
export default log;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var LogsType = /* @__PURE__ */ ((LogsType2) => {
|
|
2
|
+
LogsType2["DEFAULT"] = "default";
|
|
3
|
+
LogsType2["PRIMARY"] = "primary";
|
|
4
|
+
LogsType2["SUCCESS"] = "success";
|
|
5
|
+
LogsType2["WARNING"] = "warning";
|
|
6
|
+
LogsType2["DANGER"] = "danger";
|
|
7
|
+
return LogsType2;
|
|
8
|
+
})(LogsType || {});
|
|
9
|
+
function typeColor(type = "primary" /* PRIMARY */) {
|
|
10
|
+
const colorMap = {
|
|
11
|
+
["default" /* DEFAULT */]: "#f5f5f5",
|
|
12
|
+
["primary" /* PRIMARY */]: "#409EFF",
|
|
13
|
+
["success" /* SUCCESS */]: "#67C23A",
|
|
14
|
+
["warning" /* WARNING */]: "#E6A23C",
|
|
15
|
+
["danger" /* DANGER */]: "#F56C6C"
|
|
16
|
+
};
|
|
17
|
+
return colorMap[type];
|
|
18
|
+
}
|
|
19
|
+
class Log {
|
|
20
|
+
capsule(title, info, type = "primary" /* PRIMARY */, ...appendInfo) {
|
|
21
|
+
console.log(`%c ${title} %c ${info} %c`, "background:#35495E; padding: 1px; border-radius: 3px 0 0 3px; color: #fff;", `background:${typeColor(type)}; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;`, "background:transparent", ...appendInfo);
|
|
22
|
+
}
|
|
23
|
+
colorful(textArr) {
|
|
24
|
+
console.log(`%c${textArr.map((t) => t.text || "").join("%c")}`, ...textArr.map((t) => `color: ${typeColor(t.type)};`));
|
|
25
|
+
}
|
|
26
|
+
text(text) {
|
|
27
|
+
this.colorful([{ text, type: "default" /* DEFAULT */ }]);
|
|
28
|
+
}
|
|
29
|
+
primary(text) {
|
|
30
|
+
this.colorful([{ text, type: "primary" /* PRIMARY */ }]);
|
|
31
|
+
}
|
|
32
|
+
success(text) {
|
|
33
|
+
this.colorful([{ text, type: "success" /* SUCCESS */ }]);
|
|
34
|
+
}
|
|
35
|
+
warning(text) {
|
|
36
|
+
this.colorful([{ text, type: "warning" /* WARNING */ }]);
|
|
37
|
+
}
|
|
38
|
+
danger(text) {
|
|
39
|
+
this.colorful([{ text, type: "danger" /* DANGER */ }]);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const log = new Log();
|
|
43
|
+
|
|
44
|
+
export { LogsType, log as default };
|
package/global.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as NaiveUI from 'naive-ui';
|
|
2
|
-
|
|
3
|
-
declare module 'naive-ui' {
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
export const NTree: any;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export {};
|
|
1
|
+
import * as NaiveUI from 'naive-ui';
|
|
2
|
+
|
|
3
|
+
declare module 'naive-ui' {
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
export const NTree: any;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export {};
|