@quansitech/antd-admin 1.1.46 → 1.1.47

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,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;
@@ -289,4 +289,11 @@ export function getValueByPath(obj, path) {
289
289
  _iterator.f();
290
290
  }
291
291
  return current;
292
+ }
293
+ export function renderTextarea(text) {
294
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
295
+ style: {
296
+ whiteSpace: 'pre-wrap'
297
+ }
298
+ }, text));
292
299
  }
@@ -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";
@@ -142,6 +142,12 @@ export var schemaHandler = {
142
142
  }
143
143
  return _objectSpread({}, schema);
144
144
  },
145
+ textarea: function textarea(schema) {
146
+ schema.renderText = function (text) {
147
+ return renderTextarea(text);
148
+ };
149
+ return _objectSpread({}, schema);
150
+ },
145
151
  // 上传
146
152
  image: function image(schema) {
147
153
  var _schema$formItemProps2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quansitech/antd-admin",
3
- "version": "1.1.46",
3
+ "version": "1.1.47",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"