@pisell/materials 1.0.498 → 1.0.499
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 +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +22 -22
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +21 -21
- package/es/components/dataSourceComponents/dataSourceForm/style.less +9 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +13 -10
- package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +14 -5
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +7 -3
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -2
- package/es/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +3 -2
- package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +6 -2
- package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +6 -2
- package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Input/ReadPretty.js +7 -2
- package/es/components/dataSourceComponents/fields/Input/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +7 -2
- package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.js +11 -5
- package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +11 -4
- package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +2 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +1 -1
- package/es/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.js +7 -2
- package/es/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.js +8 -3
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/InputNumber/ReadPretty.js +9 -4
- package/es/components/dataSourceComponents/fields/InputNumber/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Radio/ReadPretty.js +3 -2
- package/es/components/dataSourceComponents/fields/Select/ReadPretty.js +3 -2
- package/es/components/dataSourceComponents/fields/TimePicker/ReadPretty.js +6 -2
- package/es/components/dataSourceComponents/fields/TimePicker/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +291 -252
- package/es/components/dataSourceComponents/fields/Upload/constants.d.ts +9 -0
- package/es/components/dataSourceComponents/fields/Upload/constants.js +9 -0
- package/es/components/dataSourceComponents/fields/Upload/index.less +49 -0
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +12 -11
- package/es/components/dataSourceComponents/fields/Upload/types.d.ts +48 -0
- package/es/components/dataSourceComponents/fields/Upload/types.js +1 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +13 -13
- package/es/components/dataSourceComponents/fields/Upload/utils.js +237 -215
- package/es/components/dataSourceComponents/fields/index.d.ts +2 -1
- package/es/components/dataSourceComponents/fields/index.js +1 -0
- package/es/locales/en-US.d.ts +5 -0
- package/es/locales/en-US.js +5 -0
- package/es/locales/zh-CN.d.ts +5 -0
- package/es/locales/zh-CN.js +5 -0
- package/es/locales/zh-TW.d.ts +5 -0
- package/es/locales/zh-TW.js +5 -0
- package/lib/components/dataSourceComponents/dataSourceForm/style.less +9 -0
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +6 -3
- package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +9 -5
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +4 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +10 -1
- package/lib/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +2 -2
- package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +11 -2
- package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +11 -2
- package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Input/ReadPretty.js +11 -1
- package/lib/components/dataSourceComponents/fields/Input/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +11 -1
- package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.js +9 -4
- package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +11 -4
- package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +2 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +4 -4
- package/lib/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.js +11 -1
- package/lib/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.js +12 -1
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/InputNumber/ReadPretty.js +9 -4
- package/lib/components/dataSourceComponents/fields/InputNumber/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Radio/ReadPretty.js +2 -2
- package/lib/components/dataSourceComponents/fields/Select/ReadPretty.js +2 -2
- package/lib/components/dataSourceComponents/fields/TimePicker/ReadPretty.js +11 -2
- package/lib/components/dataSourceComponents/fields/TimePicker/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +319 -247
- package/lib/components/dataSourceComponents/fields/Upload/constants.d.ts +9 -0
- package/lib/components/dataSourceComponents/fields/Upload/constants.js +47 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.less +49 -0
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +12 -11
- package/lib/components/dataSourceComponents/fields/Upload/types.d.ts +48 -0
- package/lib/components/dataSourceComponents/fields/Upload/types.js +17 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +13 -13
- package/lib/components/dataSourceComponents/fields/Upload/utils.js +205 -254
- package/lib/components/dataSourceComponents/fields/index.d.ts +2 -1
- package/lib/components/dataSourceComponents/fields/index.js +1 -0
- package/lib/locales/en-US.d.ts +5 -0
- package/lib/locales/en-US.js +5 -0
- package/lib/locales/zh-CN.d.ts +5 -0
- package/lib/locales/zh-CN.js +5 -0
- package/lib/locales/zh-TW.d.ts +5 -0
- package/lib/locales/zh-TW.js +5 -0
- package/lowcode/data-source-form/utils.ts +5 -4
- package/lowcode/data-source-table/utils.tsx +2 -2
- package/lowcode/form-item-upload/meta.ts +11 -0
- package/lowcode/submit-button/meta.ts +10 -0
- package/package.json +1 -1
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
-
function
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
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; }
|
|
8
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
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); } }
|
|
4
|
+
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); }); }; }
|
|
5
|
+
import { isPlainObject, isString } from '@pisell/utils';
|
|
13
6
|
import { getText } from "../../../../locales";
|
|
7
|
+
import { SUPPORTED_LANGUAGES, MEDIA_TYPES, IMAGE_QUALITY, IMAGE_TYPE, DEFAULT_UID } from "./constants";
|
|
8
|
+
export var generateUid = function generateUid() {
|
|
9
|
+
return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
|
10
|
+
};
|
|
14
11
|
export var getSuffix = function getSuffix(name) {
|
|
15
12
|
return name.split('.').pop() || '';
|
|
16
13
|
};
|
|
@@ -20,218 +17,243 @@ export var getPointSuffix = function getPointSuffix(name) {
|
|
|
20
17
|
export var getFileType = function getFileType(name) {
|
|
21
18
|
return getPointSuffix(getSuffix(name));
|
|
22
19
|
};
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
children: [{
|
|
27
|
-
key: 'pdf',
|
|
28
|
-
title: 'PDF',
|
|
29
|
-
types: ['.pdf'],
|
|
30
|
-
color: 'red'
|
|
31
|
-
}, {
|
|
32
|
-
key: 'word',
|
|
33
|
-
title: 'Word文档',
|
|
34
|
-
types: ['.doc', '.docx'],
|
|
35
|
-
color: 'blueDark'
|
|
36
|
-
}, {
|
|
37
|
-
key: 'excel',
|
|
38
|
-
title: 'Excel工作簿',
|
|
39
|
-
types: ['.xls', '.xlsx'],
|
|
40
|
-
color: 'green600'
|
|
41
|
-
}, {
|
|
42
|
-
key: 'powerPoint',
|
|
43
|
-
title: 'PowerPoint演示文稿',
|
|
44
|
-
types: ['.ppt', '.pptx'],
|
|
45
|
-
color: 'orangeDark'
|
|
46
|
-
}, {
|
|
47
|
-
key: 'textFile',
|
|
48
|
-
title: '文本文件',
|
|
49
|
-
types: ['.txt'],
|
|
50
|
-
color: 'gray700'
|
|
51
|
-
}, {
|
|
52
|
-
key: 'richFile',
|
|
53
|
-
title: '富文本格式',
|
|
54
|
-
types: ['.rtf'],
|
|
55
|
-
color: 'gray500'
|
|
56
|
-
}, {
|
|
57
|
-
key: 'csv',
|
|
58
|
-
title: 'CSV',
|
|
59
|
-
types: ['.csv'],
|
|
60
|
-
color: 'green600'
|
|
61
|
-
}]
|
|
62
|
-
}, {
|
|
63
|
-
title: '图片',
|
|
64
|
-
key: 'images',
|
|
65
|
-
children: [{
|
|
66
|
-
key: 'jpg',
|
|
67
|
-
title: 'JPG',
|
|
68
|
-
types: ['.jpg', '.jpeg'],
|
|
69
|
-
color: 'img'
|
|
70
|
-
}, {
|
|
71
|
-
key: 'png',
|
|
72
|
-
title: 'PNG',
|
|
73
|
-
types: ['.png'],
|
|
74
|
-
color: 'img'
|
|
75
|
-
}, {
|
|
76
|
-
key: 'gif',
|
|
77
|
-
title: 'GIF',
|
|
78
|
-
types: ['.gif'],
|
|
79
|
-
color: 'img'
|
|
80
|
-
}, {
|
|
81
|
-
key: 'bmp',
|
|
82
|
-
title: 'BMP',
|
|
83
|
-
types: ['.bmp'],
|
|
84
|
-
color: 'img'
|
|
85
|
-
}, {
|
|
86
|
-
key: 'tiff',
|
|
87
|
-
title: 'TIFF',
|
|
88
|
-
types: ['tif', '.tiff'],
|
|
89
|
-
color: 'img'
|
|
90
|
-
}, {
|
|
91
|
-
key: 'svg',
|
|
92
|
-
title: 'SVG',
|
|
93
|
-
types: ['.svg'],
|
|
94
|
-
color: 'img'
|
|
95
|
-
}, {
|
|
96
|
-
key: 'webp',
|
|
97
|
-
title: 'WEBP',
|
|
98
|
-
types: ['.webp'],
|
|
99
|
-
color: 'img'
|
|
100
|
-
}]
|
|
101
|
-
}, {
|
|
102
|
-
title: '音频',
|
|
103
|
-
key: 'audio',
|
|
104
|
-
children: [{
|
|
105
|
-
key: 'mp3',
|
|
106
|
-
title: 'MP3',
|
|
107
|
-
types: ['.mp3'],
|
|
108
|
-
color: 'pink600'
|
|
109
|
-
}, {
|
|
110
|
-
key: 'wav',
|
|
111
|
-
title: 'WAV',
|
|
112
|
-
types: ['.wav'],
|
|
113
|
-
color: 'pink600'
|
|
114
|
-
}, {
|
|
115
|
-
key: 'flac',
|
|
116
|
-
title: 'FLAC',
|
|
117
|
-
color: 'pink600',
|
|
118
|
-
types: ['.flac']
|
|
119
|
-
}, {
|
|
120
|
-
key: 'aac',
|
|
121
|
-
title: 'AAC',
|
|
122
|
-
color: 'pink600',
|
|
123
|
-
types: ['.aac', '.m4a']
|
|
124
|
-
}, {
|
|
125
|
-
key: 'ogg',
|
|
126
|
-
title: 'OGG',
|
|
127
|
-
types: ['.ogg'],
|
|
128
|
-
color: 'pink600'
|
|
129
|
-
}]
|
|
130
|
-
}, {
|
|
131
|
-
title: '视频',
|
|
132
|
-
key: 'video',
|
|
133
|
-
children: [{
|
|
134
|
-
key: 'mp4',
|
|
135
|
-
title: 'MP4',
|
|
136
|
-
types: ['.mp4'],
|
|
137
|
-
color: 'blueDark'
|
|
138
|
-
}, {
|
|
139
|
-
key: 'avi',
|
|
140
|
-
title: 'AVI',
|
|
141
|
-
types: ['.avi'],
|
|
142
|
-
color: 'blueDark'
|
|
143
|
-
}, {
|
|
144
|
-
key: 'mkv',
|
|
145
|
-
title: 'MKV',
|
|
146
|
-
types: ['.mkv'],
|
|
147
|
-
color: 'blueDark'
|
|
148
|
-
}, {
|
|
149
|
-
key: 'mov',
|
|
150
|
-
title: 'MOV',
|
|
151
|
-
types: ['.mov'],
|
|
152
|
-
color: 'blueDark'
|
|
153
|
-
}, {
|
|
154
|
-
key: 'wmv',
|
|
155
|
-
title: 'WMV',
|
|
156
|
-
types: ['.wmv'],
|
|
157
|
-
color: 'blueDark'
|
|
158
|
-
}, {
|
|
159
|
-
key: 'flv',
|
|
160
|
-
title: 'FLV',
|
|
161
|
-
types: ['.flv'],
|
|
162
|
-
color: 'blueDark'
|
|
163
|
-
}]
|
|
164
|
-
}, {
|
|
165
|
-
title: '压缩文件',
|
|
166
|
-
key: 'compressedFiles',
|
|
167
|
-
children: [{
|
|
168
|
-
key: 'zip',
|
|
169
|
-
title: 'ZIP',
|
|
170
|
-
types: ['.zip'],
|
|
171
|
-
color: 'gray700'
|
|
172
|
-
}, {
|
|
173
|
-
key: 'rar',
|
|
174
|
-
title: 'RAR',
|
|
175
|
-
types: ['.rar'],
|
|
176
|
-
color: 'gray700'
|
|
177
|
-
}, {
|
|
178
|
-
key: '7z',
|
|
179
|
-
title: '7Z',
|
|
180
|
-
types: ['.7z'],
|
|
181
|
-
color: 'gray700'
|
|
182
|
-
}, {
|
|
183
|
-
key: 'tar',
|
|
184
|
-
title: 'TAR',
|
|
185
|
-
types: ['.tar'],
|
|
186
|
-
color: 'gray700'
|
|
187
|
-
}, {
|
|
188
|
-
key: 'gz',
|
|
189
|
-
title: 'GZ',
|
|
190
|
-
types: ['.gz'],
|
|
191
|
-
color: 'gray700'
|
|
192
|
-
}]
|
|
193
|
-
}];
|
|
194
|
-
|
|
195
|
-
// 所有的types
|
|
196
|
-
var allChildren = presetTypeData.map(function (item) {
|
|
197
|
-
return item.children;
|
|
198
|
-
}).flat(1);
|
|
199
|
-
var presetTypeMap = allChildren.reduce(function (pre, cur) {
|
|
200
|
-
return _objectSpread(_objectSpread({}, pre), {}, _defineProperty({}, cur.key, cur.types));
|
|
201
|
-
}, {});
|
|
202
|
-
|
|
203
|
-
// 通过 presetTypes 数组 获取 types
|
|
204
|
-
export var getPresetTypes = function getPresetTypes(presetTypes) {
|
|
205
|
-
if (!presetTypes) return [];
|
|
206
|
-
var types = [];
|
|
207
|
-
presetTypes.forEach(function (item) {
|
|
208
|
-
types.push.apply(types, _toConsumableArray(presetTypeMap[item] || []));
|
|
209
|
-
});
|
|
210
|
-
return types;
|
|
20
|
+
export var getFileName = function getFileName(url) {
|
|
21
|
+
var parts = url.split('/');
|
|
22
|
+
return parts[parts.length - 1] || '';
|
|
211
23
|
};
|
|
212
|
-
|
|
213
|
-
// 校验文件数量
|
|
214
24
|
export var checkFileCount = function checkFileCount(_ref) {
|
|
215
25
|
var multiple = _ref.multiple,
|
|
216
26
|
minCount = _ref.minCount,
|
|
217
27
|
maxCount = _ref.maxCount,
|
|
218
28
|
valueLength = _ref.valueLength;
|
|
219
|
-
if (multiple) {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
29
|
+
if (!multiple) return {
|
|
30
|
+
success: true
|
|
31
|
+
};
|
|
32
|
+
if (minCount === maxCount && valueLength !== minCount) {
|
|
33
|
+
return {
|
|
34
|
+
success: false,
|
|
35
|
+
message: getText('pisell-upload-count-error')(minCount)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (minCount !== maxCount && (valueLength < minCount || valueLength > maxCount)) {
|
|
39
|
+
return {
|
|
40
|
+
success: false,
|
|
41
|
+
message: getText('pisell-upload-count-error')("".concat(minCount, "-").concat(maxCount))
|
|
42
|
+
};
|
|
233
43
|
}
|
|
234
44
|
return {
|
|
235
45
|
success: true
|
|
236
46
|
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Media handling
|
|
50
|
+
var createVideoMetadata = /*#__PURE__*/function () {
|
|
51
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
|
|
52
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
53
|
+
while (1) switch (_context.prev = _context.next) {
|
|
54
|
+
case 0:
|
|
55
|
+
return _context.abrupt("return", new Promise(function (resolve) {
|
|
56
|
+
var video = document.createElement('video');
|
|
57
|
+
var canvas = document.createElement('canvas');
|
|
58
|
+
video.preload = 'metadata';
|
|
59
|
+
var hasMetadata = false;
|
|
60
|
+
var hasSeeked = false;
|
|
61
|
+
var tryResolve = function tryResolve() {
|
|
62
|
+
if (!hasMetadata || !hasSeeked) return;
|
|
63
|
+
canvas.width = video.videoWidth;
|
|
64
|
+
canvas.height = video.videoHeight;
|
|
65
|
+
var ctx = canvas.getContext('2d');
|
|
66
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
67
|
+
canvas.toBlob(function (blob) {
|
|
68
|
+
var metadata = {
|
|
69
|
+
width: video.videoWidth,
|
|
70
|
+
height: video.videoHeight,
|
|
71
|
+
duration: video.duration,
|
|
72
|
+
bitrate: file.size / video.duration
|
|
73
|
+
};
|
|
74
|
+
if (blob) {
|
|
75
|
+
metadata.cover = new File([blob], "".concat(file.name, "-cover.jpg"), {
|
|
76
|
+
type: IMAGE_TYPE
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
URL.revokeObjectURL(video.src);
|
|
80
|
+
resolve(metadata);
|
|
81
|
+
}, IMAGE_TYPE, IMAGE_QUALITY);
|
|
82
|
+
};
|
|
83
|
+
video.onloadedmetadata = function () {
|
|
84
|
+
hasMetadata = true;
|
|
85
|
+
tryResolve();
|
|
86
|
+
};
|
|
87
|
+
video.onseeked = function () {
|
|
88
|
+
hasSeeked = true;
|
|
89
|
+
tryResolve();
|
|
90
|
+
};
|
|
91
|
+
video.src = URL.createObjectURL(file);
|
|
92
|
+
}));
|
|
93
|
+
case 1:
|
|
94
|
+
case "end":
|
|
95
|
+
return _context.stop();
|
|
96
|
+
}
|
|
97
|
+
}, _callee);
|
|
98
|
+
}));
|
|
99
|
+
return function createVideoMetadata(_x) {
|
|
100
|
+
return _ref2.apply(this, arguments);
|
|
101
|
+
};
|
|
102
|
+
}();
|
|
103
|
+
var createAudioMetadata = /*#__PURE__*/function () {
|
|
104
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file) {
|
|
105
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
106
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
107
|
+
case 0:
|
|
108
|
+
return _context2.abrupt("return", new Promise(function (resolve) {
|
|
109
|
+
var audio = document.createElement('audio');
|
|
110
|
+
audio.preload = 'metadata';
|
|
111
|
+
audio.src = URL.createObjectURL(file);
|
|
112
|
+
audio.onloadedmetadata = function () {
|
|
113
|
+
URL.revokeObjectURL(audio.src);
|
|
114
|
+
resolve({
|
|
115
|
+
duration: audio.duration,
|
|
116
|
+
bitrate: file.size / audio.duration
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
}));
|
|
120
|
+
case 1:
|
|
121
|
+
case "end":
|
|
122
|
+
return _context2.stop();
|
|
123
|
+
}
|
|
124
|
+
}, _callee2);
|
|
125
|
+
}));
|
|
126
|
+
return function createAudioMetadata(_x2) {
|
|
127
|
+
return _ref3.apply(this, arguments);
|
|
128
|
+
};
|
|
129
|
+
}();
|
|
130
|
+
export var getMediaMetadata = /*#__PURE__*/function () {
|
|
131
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(file) {
|
|
132
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
133
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
134
|
+
case 0:
|
|
135
|
+
if (!file.type.startsWith(MEDIA_TYPES.VIDEO)) {
|
|
136
|
+
_context3.next = 2;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
return _context3.abrupt("return", createVideoMetadata(file));
|
|
140
|
+
case 2:
|
|
141
|
+
if (!file.type.startsWith(MEDIA_TYPES.AUDIO)) {
|
|
142
|
+
_context3.next = 4;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
return _context3.abrupt("return", createAudioMetadata(file));
|
|
146
|
+
case 4:
|
|
147
|
+
return _context3.abrupt("return", null);
|
|
148
|
+
case 5:
|
|
149
|
+
case "end":
|
|
150
|
+
return _context3.stop();
|
|
151
|
+
}
|
|
152
|
+
}, _callee3);
|
|
153
|
+
}));
|
|
154
|
+
return function getMediaMetadata(_x3) {
|
|
155
|
+
return _ref4.apply(this, arguments);
|
|
156
|
+
};
|
|
157
|
+
}();
|
|
158
|
+
export var genFileListByString = function genFileListByString(value) {
|
|
159
|
+
if (!value) return [];
|
|
160
|
+
return [{
|
|
161
|
+
uid: generateUid(),
|
|
162
|
+
name: getFileName(value),
|
|
163
|
+
status: 'done',
|
|
164
|
+
url: value
|
|
165
|
+
}];
|
|
166
|
+
};
|
|
167
|
+
export var createMultilingualData = function createMultilingualData(value) {
|
|
168
|
+
return SUPPORTED_LANGUAGES.reduce(function (acc, lang) {
|
|
169
|
+
acc[lang] = value;
|
|
170
|
+
return acc;
|
|
171
|
+
}, {});
|
|
172
|
+
};
|
|
173
|
+
export var createMultilingualFileList = function createMultilingualFileList(value) {
|
|
174
|
+
return SUPPORTED_LANGUAGES.reduce(function (acc, lang) {
|
|
175
|
+
acc[lang] = genFileListByString(value);
|
|
176
|
+
return acc;
|
|
177
|
+
}, {});
|
|
178
|
+
};
|
|
179
|
+
var handleMultilingualSingleFile = function handleMultilingualSingleFile(value) {
|
|
180
|
+
var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
181
|
+
return {
|
|
182
|
+
uid: "-".concat(index),
|
|
183
|
+
name: getFileName(value),
|
|
184
|
+
status: 'done',
|
|
185
|
+
url: value,
|
|
186
|
+
multilingualFileList: createMultilingualFileList(value),
|
|
187
|
+
multilingual: createMultilingualData(value)
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
var handleMultilingualObject = function handleMultilingualObject(value) {
|
|
191
|
+
var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
192
|
+
var defaultUrl = value.original || value.en || value['zh-CN'] || value['zh-HK'];
|
|
193
|
+
return {
|
|
194
|
+
uid: "-".concat(index),
|
|
195
|
+
name: getFileName(defaultUrl),
|
|
196
|
+
status: 'done',
|
|
197
|
+
url: defaultUrl,
|
|
198
|
+
multilingual: value,
|
|
199
|
+
multilingualFileList: SUPPORTED_LANGUAGES.reduce(function (acc, lang) {
|
|
200
|
+
acc[lang] = genFileListByString(value[lang]);
|
|
201
|
+
return acc;
|
|
202
|
+
}, {})
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
export var getDefaultFileList = function getDefaultFileList(value, options) {
|
|
206
|
+
if (!value) return [];
|
|
207
|
+
var enableMultilingual = options.enableMultilingual,
|
|
208
|
+
multiple = options.multiple;
|
|
209
|
+
if (enableMultilingual) {
|
|
210
|
+
if (isString(value)) {
|
|
211
|
+
return [handleMultilingualSingleFile(value)];
|
|
212
|
+
}
|
|
213
|
+
if (Array.isArray(value)) {
|
|
214
|
+
return value.map(function (item, index) {
|
|
215
|
+
if (isString(item)) {
|
|
216
|
+
return handleMultilingualSingleFile(item, index);
|
|
217
|
+
}
|
|
218
|
+
if (isPlainObject(item)) {
|
|
219
|
+
return handleMultilingualObject(item, index);
|
|
220
|
+
}
|
|
221
|
+
return [];
|
|
222
|
+
}).flat();
|
|
223
|
+
}
|
|
224
|
+
if (isPlainObject(value)) {
|
|
225
|
+
return [handleMultilingualObject(value)];
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (multiple && Array.isArray(value)) {
|
|
229
|
+
return value.map(function (url, index) {
|
|
230
|
+
return {
|
|
231
|
+
uid: "-".concat(index),
|
|
232
|
+
name: getFileName(url),
|
|
233
|
+
status: 'done',
|
|
234
|
+
url: url
|
|
235
|
+
};
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
if (isString(value)) {
|
|
239
|
+
return [{
|
|
240
|
+
uid: DEFAULT_UID,
|
|
241
|
+
name: getFileName(value),
|
|
242
|
+
status: 'done',
|
|
243
|
+
url: value
|
|
244
|
+
}];
|
|
245
|
+
}
|
|
246
|
+
return [];
|
|
247
|
+
};
|
|
248
|
+
export var getFileMetadataParams = function getFileMetadataParams(file) {
|
|
249
|
+
if (!file.metadata) return {};
|
|
250
|
+
var metadataParams = {};
|
|
251
|
+
var metadataKeys = ['width', 'height', 'duration', 'bitrate'];
|
|
252
|
+
metadataKeys.forEach(function (key) {
|
|
253
|
+
var _file$metadata;
|
|
254
|
+
if (((_file$metadata = file.metadata) === null || _file$metadata === void 0 ? void 0 : _file$metadata[key]) !== undefined) {
|
|
255
|
+
metadataParams["metadata[".concat(key, "]")] = file.metadata[key];
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
return metadataParams;
|
|
237
259
|
};
|
|
@@ -32,6 +32,7 @@ declare const formFieldMap: {
|
|
|
32
32
|
FormItemPercent: import("react").FC<any>;
|
|
33
33
|
FormItemTimePicker: import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
34
34
|
'FormItemInput.JSON': import("react").FC<any>;
|
|
35
|
+
'FormItemInput.Phone': import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
35
36
|
'FormItemInput.Email': import("react").FC<import("antd").InputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
36
37
|
'FormItemInput.URL': import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
37
38
|
'FormItemInput.Password': import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
@@ -44,7 +45,7 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
44
45
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
45
46
|
} & {
|
|
46
47
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
47
|
-
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
48
|
+
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
48
49
|
JSON: import("react").FC<any>;
|
|
49
50
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
50
51
|
TextArea: import("react").FC<import("antd/es/input").TextAreaProps & import("react").RefAttributes<import("antd/es/input/TextArea").TextAreaRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
@@ -21,6 +21,7 @@ var formFieldMap = {
|
|
|
21
21
|
FormItemPercent: InputNumber,
|
|
22
22
|
FormItemTimePicker: TimePicker,
|
|
23
23
|
'FormItemInput.JSON': Input.JSON,
|
|
24
|
+
'FormItemInput.Phone': Input.Phone,
|
|
24
25
|
'FormItemInput.Email': Input.Email,
|
|
25
26
|
'FormItemInput.URL': Input.URL,
|
|
26
27
|
'FormItemInput.Password': Input.Password,
|
package/es/locales/en-US.d.ts
CHANGED
|
@@ -152,6 +152,11 @@ declare const _default: {
|
|
|
152
152
|
'pisell-upload-setting-type-error': (type: string) => string;
|
|
153
153
|
'pisell-upload-count-error': (count: number) => string;
|
|
154
154
|
'pisell-upload-error': (name: string) => string;
|
|
155
|
+
'pisell-upload-multilingual-title': string;
|
|
156
|
+
'pisell-upload-multilingual-item-title-original': string;
|
|
157
|
+
'pisell-upload-multilingual-item-title-en': string;
|
|
158
|
+
'pisell-upload-multilingual-item-title-zh-CN': string;
|
|
159
|
+
'pisell-upload-multilingual-item-title-zh-HK': string;
|
|
155
160
|
'pisell-color-picker-default': string;
|
|
156
161
|
'pisell-action-get-data': string;
|
|
157
162
|
'pisell-action-delete-failed': string;
|
package/es/locales/en-US.js
CHANGED
|
@@ -200,6 +200,11 @@ export default {
|
|
|
200
200
|
'pisell-upload-error': function pisellUploadError(name) {
|
|
201
201
|
return "".concat(name, " upload failed");
|
|
202
202
|
},
|
|
203
|
+
'pisell-upload-multilingual-title': 'Multilingual',
|
|
204
|
+
'pisell-upload-multilingual-item-title-original': 'Original',
|
|
205
|
+
'pisell-upload-multilingual-item-title-en': 'English',
|
|
206
|
+
'pisell-upload-multilingual-item-title-zh-CN': '简体中文',
|
|
207
|
+
'pisell-upload-multilingual-item-title-zh-HK': '繁體中文',
|
|
203
208
|
// 颜色组件
|
|
204
209
|
'pisell-color-picker-default': 'Default',
|
|
205
210
|
// 获取数据
|
package/es/locales/zh-CN.d.ts
CHANGED
|
@@ -152,6 +152,11 @@ declare const _default: {
|
|
|
152
152
|
'pisell-upload-setting-type-error': (type: string) => string;
|
|
153
153
|
'pisell-upload-count-error': (count: number) => string;
|
|
154
154
|
'pisell-upload-error': (name: string) => string;
|
|
155
|
+
'pisell-upload-multilingual-title': string;
|
|
156
|
+
'pisell-upload-multilingual-item-title-original': string;
|
|
157
|
+
'pisell-upload-multilingual-item-title-en': string;
|
|
158
|
+
'pisell-upload-multilingual-item-title-zh-CN': string;
|
|
159
|
+
'pisell-upload-multilingual-item-title-zh-HK': string;
|
|
155
160
|
'pisell-color-picker-default': string;
|
|
156
161
|
'pisell-action-get-data': string;
|
|
157
162
|
'pisell-action-delete-failed': string;
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -199,6 +199,11 @@ export default {
|
|
|
199
199
|
'pisell-upload-error': function pisellUploadError(name) {
|
|
200
200
|
return "".concat(name, " \u4E0A\u4F20\u5931\u8D25");
|
|
201
201
|
},
|
|
202
|
+
'pisell-upload-multilingual-title': '多语言',
|
|
203
|
+
'pisell-upload-multilingual-item-title-original': '原始',
|
|
204
|
+
'pisell-upload-multilingual-item-title-en': 'English',
|
|
205
|
+
'pisell-upload-multilingual-item-title-zh-CN': '简体中文',
|
|
206
|
+
'pisell-upload-multilingual-item-title-zh-HK': '繁體中文',
|
|
202
207
|
// 颜色组件
|
|
203
208
|
'pisell-color-picker-default': '默认',
|
|
204
209
|
// 获取数据
|
package/es/locales/zh-TW.d.ts
CHANGED
|
@@ -152,6 +152,11 @@ declare const _default: {
|
|
|
152
152
|
'pisell-upload-setting-type-error': (type: string) => string;
|
|
153
153
|
'pisell-upload-count-error': (count: number) => string;
|
|
154
154
|
'pisell-upload-error': (name: string) => string;
|
|
155
|
+
'pisell-upload-multilingual-title': string;
|
|
156
|
+
'pisell-upload-multilingual-item-title-original': string;
|
|
157
|
+
'pisell-upload-multilingual-item-title-en': string;
|
|
158
|
+
'pisell-upload-multilingual-item-title-zh-CN': string;
|
|
159
|
+
'pisell-upload-multilingual-item-title-zh-HK': string;
|
|
155
160
|
'pisell-color-picker-default': string;
|
|
156
161
|
'pisell-action-get-data': string;
|
|
157
162
|
'pisell-action-delete-failed': string;
|
package/es/locales/zh-TW.js
CHANGED
|
@@ -200,6 +200,11 @@ export default {
|
|
|
200
200
|
'pisell-upload-error': function pisellUploadError(name) {
|
|
201
201
|
return "".concat(name, " \u4E0A\u50B3\u5931\u6557");
|
|
202
202
|
},
|
|
203
|
+
'pisell-upload-multilingual-title': '多語言',
|
|
204
|
+
'pisell-upload-multilingual-item-title-original': '原始',
|
|
205
|
+
'pisell-upload-multilingual-item-title-en': 'English',
|
|
206
|
+
'pisell-upload-multilingual-item-title-zh-CN': '简体中文',
|
|
207
|
+
'pisell-upload-multilingual-item-title-zh-HK': '繁體中文',
|
|
203
208
|
// 颜色选择组件
|
|
204
209
|
'pisell-color-picker-default': '默認',
|
|
205
210
|
// 获取数据
|
|
@@ -54,8 +54,6 @@ var SubmitButton = (props) => {
|
|
|
54
54
|
afterSubmitNotificationConfig,
|
|
55
55
|
childrenString
|
|
56
56
|
} = props;
|
|
57
|
-
console.log(props, "propsprops");
|
|
58
|
-
console.log(childrenString, "childrenchildren");
|
|
59
57
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
60
58
|
const [api, contextHolder] = import_antd.notification.useNotification();
|
|
61
59
|
const form = import_antd.Form.useFormInstance();
|
|
@@ -111,11 +109,16 @@ var SubmitButton = (props) => {
|
|
|
111
109
|
if (allValues.id) {
|
|
112
110
|
values.id = allValues.id;
|
|
113
111
|
}
|
|
112
|
+
if ((toastConfig == null ? void 0 : toastConfig.enable) && !(toastConfig == null ? void 0 : toastConfig.showAfterSubmit)) {
|
|
113
|
+
(0, import_pisellToast.default)({
|
|
114
|
+
content: toastConfig.title
|
|
115
|
+
});
|
|
116
|
+
}
|
|
114
117
|
await onSubmit(values);
|
|
115
118
|
if (refreshData) {
|
|
116
119
|
refreshTableData == null ? void 0 : refreshTableData();
|
|
117
120
|
}
|
|
118
|
-
if (toastConfig == null ? void 0 : toastConfig.enable) {
|
|
121
|
+
if ((toastConfig == null ? void 0 : toastConfig.enable) && (toastConfig == null ? void 0 : toastConfig.showAfterSubmit)) {
|
|
119
122
|
(0, import_pisellToast.default)({
|
|
120
123
|
content: toastConfig.title
|
|
121
124
|
});
|