@quansitech/antd-admin 1.1.46 → 1.1.48
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/lib/helpers.d.ts +2 -0
- package/dist/lib/helpers.js +10 -0
- package/dist/lib/schemaHandler.js +7 -2
- package/package.json +1 -1
package/dist/lib/helpers.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VisitOptions } from "@inertiajs/core/types/types";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { ModalFuncProps } from "antd";
|
|
3
4
|
import { Condition, ModalOptions } from "../types";
|
|
4
5
|
export declare function replaceUrl(url: string, params: any): string;
|
|
@@ -17,3 +18,4 @@ export declare function filterObjectKeys(obj: Record<string, any>, keysToFilter:
|
|
|
17
18
|
export declare function diffTree(tree1: any[], tree2: any[], childKey: string): any[];
|
|
18
19
|
export declare function findValuePath(obj: any, target: any, path?: string[]): string[] | null;
|
|
19
20
|
export declare function getValueByPath(obj: any, path: string[]): any;
|
|
21
|
+
export declare function renderTextarea(text: string): React.JSX.Element;
|
package/dist/lib/helpers.js
CHANGED
|
@@ -289,4 +289,14 @@ export function getValueByPath(obj, path) {
|
|
|
289
289
|
_iterator.f();
|
|
290
290
|
}
|
|
291
291
|
return current;
|
|
292
|
+
}
|
|
293
|
+
export function renderTextarea(text) {
|
|
294
|
+
if (typeof text !== 'string') {
|
|
295
|
+
text = '-';
|
|
296
|
+
}
|
|
297
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
298
|
+
style: {
|
|
299
|
+
whiteSpace: 'pre-wrap'
|
|
300
|
+
}
|
|
301
|
+
}, text));
|
|
292
302
|
}
|
|
@@ -8,7 +8,7 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
8
8
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
9
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
10
|
import http from "./http";
|
|
11
|
-
import { deepSet, handleCondition } from "./helpers";
|
|
11
|
+
import { deepSet, handleCondition, renderTextarea } from "./helpers";
|
|
12
12
|
import container from "./container";
|
|
13
13
|
import { itemRender } from "./FormList";
|
|
14
14
|
import { lowerFirst } from "es-toolkit";
|
|
@@ -65,7 +65,6 @@ var handleUploadRules = function handleUploadRules(rules) {
|
|
|
65
65
|
rules.push({
|
|
66
66
|
validator: uploadValidator
|
|
67
67
|
});
|
|
68
|
-
console.log(rules);
|
|
69
68
|
return rules;
|
|
70
69
|
};
|
|
71
70
|
export var commonHandler = function commonHandler(schema) {
|
|
@@ -142,6 +141,12 @@ export var schemaHandler = {
|
|
|
142
141
|
}
|
|
143
142
|
return _objectSpread({}, schema);
|
|
144
143
|
},
|
|
144
|
+
textarea: function textarea(schema) {
|
|
145
|
+
schema.render = function (dom, entity, index, action, schema) {
|
|
146
|
+
return renderTextarea((entity === null || entity === void 0 ? void 0 : entity[schema.dataIndex]) || entity.value);
|
|
147
|
+
};
|
|
148
|
+
return _objectSpread({}, schema);
|
|
149
|
+
},
|
|
145
150
|
// 上传
|
|
146
151
|
image: function image(schema) {
|
|
147
152
|
var _schema$formItemProps2;
|