@pisell/materials 1.0.597 → 1.0.599
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 +33 -33
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +30 -30
- package/es/components/appVersionControl/index.d.ts +5 -0
- package/es/components/appVersionControl/index.js +221 -0
- package/es/components/appVersionControl/index.less +34 -0
- package/es/components/appVersionControl/types.d.ts +20 -0
- package/es/components/appVersionControl/types.js +1 -0
- package/es/components/customSelect/index.d.ts +17 -0
- package/es/components/customSelect/index.js +26 -0
- package/es/components/customSelect/index.less +7 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +4 -12
- package/es/components/dataSourceComponents/dataSourceMenu/index.d.ts +2 -0
- package/es/components/dataSourceComponents/dataSourceMenu/index.js +19 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/WithMode.js +4 -4
- package/es/components/image/avatar.png +0 -0
- package/es/components/image/image.png +0 -0
- package/es/components/image/index.d.ts +10 -0
- package/es/components/image/index.js +25 -0
- package/es/components/image/product.png +0 -0
- package/es/components/pisellDraggable/PisellDraggable.d.ts +18 -0
- package/es/components/pisellDraggable/PisellDraggable.js +190 -0
- package/es/components/pisellDraggable/PisellDraggable.less +154 -0
- package/es/components/pisellDraggable/SortableItem.d.ts +41 -0
- package/es/components/pisellDraggable/SortableItem.js +115 -0
- package/es/components/pisellDraggable/index.d.ts +3 -0
- package/es/components/pisellDraggable/index.js +2 -0
- package/es/components/pisellDraggable/types.d.ts +101 -0
- package/es/components/pisellDraggable/types.js +1 -0
- package/es/components/pisellLayout/content.d.ts +8 -0
- package/es/components/pisellLayout/content.js +29 -0
- package/es/components/pisellLayout/footer.d.ts +7 -0
- package/es/components/pisellLayout/footer.js +12 -0
- package/es/components/pisellLayout/header.d.ts +7 -0
- package/es/components/pisellLayout/header.js +12 -0
- package/es/components/pisellLayout/index.d.ts +14 -0
- package/es/components/pisellLayout/index.js +15 -0
- package/es/components/pisellLayout/sider.d.ts +7 -0
- package/es/components/pisellLayout/sider.js +12 -0
- package/es/components/pisellMenu/PisellMenu.d.ts +5 -0
- package/es/components/pisellMenu/PisellMenu.js +55 -0
- package/es/components/pisellMenu/PisellMenu.less +53 -0
- package/es/components/pisellMenu/index.d.ts +3 -0
- package/es/components/pisellMenu/index.js +2 -0
- package/es/components/pisellMenu/types.d.ts +30 -0
- package/es/components/pisellMenu/types.js +1 -0
- package/es/components/versionModal/index.d.ts +1 -0
- package/es/components/versionModal/index.js +5 -2
- package/es/index.d.ts +109 -134
- package/es/index.js +109 -164
- package/es/locales/en-US.d.ts +9 -1
- package/es/locales/en-US.js +15 -2
- package/es/locales/zh-CN.d.ts +9 -1
- package/es/locales/zh-CN.js +14 -2
- package/es/locales/zh-TW.d.ts +9 -0
- package/es/locales/zh-TW.js +16 -2
- package/es/typings.d.ts +4 -0
- package/lib/components/appVersionControl/index.d.ts +5 -0
- package/lib/components/appVersionControl/index.js +208 -0
- package/lib/components/appVersionControl/index.less +34 -0
- package/lib/components/appVersionControl/types.d.ts +20 -0
- package/lib/components/appVersionControl/types.js +17 -0
- package/lib/components/customSelect/index.d.ts +17 -0
- package/lib/components/customSelect/index.js +58 -0
- package/lib/components/customSelect/index.less +7 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +1 -14
- package/lib/components/dataSourceComponents/dataSourceMenu/index.d.ts +2 -0
- package/lib/components/dataSourceComponents/dataSourceMenu/index.js +45 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/WithMode.js +4 -4
- package/lib/components/image/avatar.png +0 -0
- package/lib/components/image/image.png +0 -0
- package/lib/components/image/index.d.ts +10 -0
- package/lib/components/image/index.js +59 -0
- package/lib/components/image/product.png +0 -0
- package/lib/components/pisellDraggable/PisellDraggable.d.ts +18 -0
- package/lib/components/pisellDraggable/PisellDraggable.js +175 -0
- package/lib/components/pisellDraggable/PisellDraggable.less +154 -0
- package/lib/components/pisellDraggable/SortableItem.d.ts +41 -0
- package/lib/components/pisellDraggable/SortableItem.js +127 -0
- package/lib/components/pisellDraggable/index.d.ts +3 -0
- package/lib/components/pisellDraggable/index.js +36 -0
- package/lib/components/pisellDraggable/types.d.ts +101 -0
- package/lib/components/pisellDraggable/types.js +17 -0
- package/lib/components/pisellLayout/content.d.ts +8 -0
- package/lib/components/pisellLayout/content.js +50 -0
- package/lib/components/pisellLayout/footer.d.ts +7 -0
- package/lib/components/pisellLayout/footer.js +42 -0
- package/lib/components/pisellLayout/header.d.ts +7 -0
- package/lib/components/pisellLayout/header.js +42 -0
- package/lib/components/pisellLayout/index.d.ts +14 -0
- package/lib/components/pisellLayout/index.js +45 -0
- package/lib/components/pisellLayout/sider.d.ts +7 -0
- package/lib/components/pisellLayout/sider.js +42 -0
- package/lib/components/pisellMenu/PisellMenu.d.ts +5 -0
- package/lib/components/pisellMenu/PisellMenu.js +91 -0
- package/lib/components/pisellMenu/PisellMenu.less +53 -0
- package/lib/components/pisellMenu/index.d.ts +3 -0
- package/lib/components/pisellMenu/index.js +36 -0
- package/lib/components/pisellMenu/types.d.ts +30 -0
- package/lib/components/pisellMenu/types.js +17 -0
- package/lib/components/versionModal/index.d.ts +1 -0
- package/lib/components/versionModal/index.js +4 -2
- package/lib/index.d.ts +109 -134
- package/lib/index.js +164 -172
- package/lib/locales/en-US.d.ts +9 -1
- package/lib/locales/en-US.js +13 -2
- package/lib/locales/zh-CN.d.ts +9 -1
- package/lib/locales/zh-CN.js +12 -2
- package/lib/locales/zh-TW.d.ts +9 -0
- package/lib/locales/zh-TW.js +14 -2
- package/lib/typings.d.ts +4 -0
- package/lowcode/_utils/defaultSchema.ts +1 -1
- package/lowcode/app-version-control/meta.ts +76 -0
- package/lowcode/custom-select/meta.ts +206 -0
- package/lowcode/custom-select/snippets.ts +33 -0
- package/lowcode/data-source-menu/meta.ts +115 -0
- package/lowcode/form-item-icon-select/snippets.ts +1 -0
- package/lowcode/form-item-input.mobile/__screenshots__/mobile.png +0 -0
- package/lowcode/form-item-input.mobile/meta.ts +15 -1
- package/lowcode/form-item-input.mobile/snippets.ts +7 -1
- package/lowcode/form-item-input.phone/meta.ts +15 -1
- package/lowcode/form-item-input.phone/snippets.ts +6 -0
- package/lowcode/form-item-input.subdomain/__screenshots__/subdomain.png +0 -0
- package/lowcode/form-item-input.subdomain/meta.ts +17 -1
- package/lowcode/form-item-input.subdomain/snippets.ts +1 -1
- package/lowcode/icon-select/meta.ts +1 -1
- package/lowcode/image/meta.ts +19 -0
- package/lowcode/image/snippets.ts +1 -0
- package/lowcode/pisell-content/meta.ts +86 -0
- package/lowcode/pisell-draggable/meta.ts +190 -0
- package/lowcode/pisell-footer/meta.ts +81 -0
- package/lowcode/pisell-header/meta.ts +83 -0
- package/lowcode/pisell-layout/meta.ts +174 -0
- package/lowcode/pisell-menu/meta.ts +112 -0
- package/lowcode/pisell-sider/meta.ts +142 -0
- package/lowcode/pisell-text/meta.ts +9 -8080
- package/package.json +3 -3
- package/lowcode/form-item-input.mobile/__screenshots__/phone.png +0 -0
|
@@ -0,0 +1,221 @@
|
|
|
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 _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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
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; }
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import classNames from 'classnames';
|
|
12
|
+
import React, { useMemo, useState } from 'react';
|
|
13
|
+
import Button from "../button";
|
|
14
|
+
import CustomSelect from "../customSelect";
|
|
15
|
+
import PisellCard from "../pisellCard";
|
|
16
|
+
import PisellModal from "../pisellModal";
|
|
17
|
+
import PisellAvatar from "../pisellAvatar";
|
|
18
|
+
import Icon from "../icon";
|
|
19
|
+
import PisellRow from "../pisellRow";
|
|
20
|
+
import PisellTags from "../pisellTags";
|
|
21
|
+
import PublishVersionModal from "../versionModal";
|
|
22
|
+
import { getText } from "../../locales";
|
|
23
|
+
import "./index.less";
|
|
24
|
+
var getStatusColor = function getStatusColor(status) {
|
|
25
|
+
if (status === 'live') return 'success';
|
|
26
|
+
if (status === 'draft') return 'warning';
|
|
27
|
+
if (status === 'deprecated') return 'error';
|
|
28
|
+
return 'gray';
|
|
29
|
+
};
|
|
30
|
+
var getStatusText = function getStatusText(status) {
|
|
31
|
+
if (status === 'live') return getText('pisell-lowcode-app-version-control-live');
|
|
32
|
+
if (status === 'draft') return getText('pisell-lowcode-app-version-control-draft');
|
|
33
|
+
if (status === 'deprecated') return getText('pisell-lowcode-app-version-control-deprecated');
|
|
34
|
+
};
|
|
35
|
+
var AppVersionControl = function AppVersionControl(props) {
|
|
36
|
+
var value = props.value,
|
|
37
|
+
_props$versions = props.versions,
|
|
38
|
+
versions = _props$versions === void 0 ? [] : _props$versions,
|
|
39
|
+
onVersionChange = props.onVersionChange,
|
|
40
|
+
onCreateVersion = props.onCreateVersion,
|
|
41
|
+
onPromoteToLive = props.onPromoteToLive,
|
|
42
|
+
className = props.className,
|
|
43
|
+
style = props.style,
|
|
44
|
+
_props$allowPublish = props.allowPublish,
|
|
45
|
+
allowPublish = _props$allowPublish === void 0 ? true : _props$allowPublish,
|
|
46
|
+
_props$allowCreate = props.allowCreate,
|
|
47
|
+
allowCreate = _props$allowCreate === void 0 ? true : _props$allowCreate;
|
|
48
|
+
var _useState = useState(false),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
promoteLoading = _useState2[0],
|
|
51
|
+
setPromoteLoading = _useState2[1];
|
|
52
|
+
var _useState3 = useState(false),
|
|
53
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
54
|
+
promoteToLiveModal = _useState4[0],
|
|
55
|
+
setPromoteToLiveModal = _useState4[1];
|
|
56
|
+
var _useState5 = useState(false),
|
|
57
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
58
|
+
publishVersionModal = _useState6[0],
|
|
59
|
+
setPublishVersionModal = _useState6[1];
|
|
60
|
+
var _useState7 = useState(false),
|
|
61
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
62
|
+
publishLoading = _useState8[0],
|
|
63
|
+
setPublishLoading = _useState8[1];
|
|
64
|
+
|
|
65
|
+
// 从versions中获取当前版本信息
|
|
66
|
+
var currentVersion = useMemo(function () {
|
|
67
|
+
return versions.find(function (v) {
|
|
68
|
+
return v.value === value;
|
|
69
|
+
});
|
|
70
|
+
}, [value, versions]);
|
|
71
|
+
|
|
72
|
+
// 从versions中获取live版本信息
|
|
73
|
+
var liveVersion = useMemo(function () {
|
|
74
|
+
var _versions$find;
|
|
75
|
+
return (_versions$find = versions.find(function (v) {
|
|
76
|
+
return v.status === 'live';
|
|
77
|
+
})) === null || _versions$find === void 0 ? void 0 : _versions$find.version;
|
|
78
|
+
}, [versions]);
|
|
79
|
+
var handlePromoteToLive = /*#__PURE__*/function () {
|
|
80
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
81
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
82
|
+
while (1) switch (_context.prev = _context.next) {
|
|
83
|
+
case 0:
|
|
84
|
+
setPromoteLoading(true);
|
|
85
|
+
_context.prev = 1;
|
|
86
|
+
_context.next = 4;
|
|
87
|
+
return onPromoteToLive === null || onPromoteToLive === void 0 ? void 0 : onPromoteToLive(value, currentVersion);
|
|
88
|
+
case 4:
|
|
89
|
+
setPromoteToLiveModal(false);
|
|
90
|
+
_context.next = 10;
|
|
91
|
+
break;
|
|
92
|
+
case 7:
|
|
93
|
+
_context.prev = 7;
|
|
94
|
+
_context.t0 = _context["catch"](1);
|
|
95
|
+
console.error('Failed to promote version:', _context.t0);
|
|
96
|
+
case 10:
|
|
97
|
+
_context.prev = 10;
|
|
98
|
+
setPromoteLoading(false);
|
|
99
|
+
return _context.finish(10);
|
|
100
|
+
case 13:
|
|
101
|
+
case "end":
|
|
102
|
+
return _context.stop();
|
|
103
|
+
}
|
|
104
|
+
}, _callee, null, [[1, 7, 10, 13]]);
|
|
105
|
+
}));
|
|
106
|
+
return function handlePromoteToLive() {
|
|
107
|
+
return _ref.apply(this, arguments);
|
|
108
|
+
};
|
|
109
|
+
}();
|
|
110
|
+
var handlePublishVersion = /*#__PURE__*/function () {
|
|
111
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {
|
|
112
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
113
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
114
|
+
case 0:
|
|
115
|
+
setPublishLoading(true);
|
|
116
|
+
_context2.prev = 1;
|
|
117
|
+
_context2.next = 4;
|
|
118
|
+
return onCreateVersion === null || onCreateVersion === void 0 ? void 0 : onCreateVersion(data.version);
|
|
119
|
+
case 4:
|
|
120
|
+
setPublishVersionModal(false);
|
|
121
|
+
_context2.next = 10;
|
|
122
|
+
break;
|
|
123
|
+
case 7:
|
|
124
|
+
_context2.prev = 7;
|
|
125
|
+
_context2.t0 = _context2["catch"](1);
|
|
126
|
+
console.error('Failed to create version:', _context2.t0);
|
|
127
|
+
case 10:
|
|
128
|
+
_context2.prev = 10;
|
|
129
|
+
setPublishLoading(false);
|
|
130
|
+
return _context2.finish(10);
|
|
131
|
+
case 13:
|
|
132
|
+
case "end":
|
|
133
|
+
return _context2.stop();
|
|
134
|
+
}
|
|
135
|
+
}, _callee2, null, [[1, 7, 10, 13]]);
|
|
136
|
+
}));
|
|
137
|
+
return function handlePublishVersion(_x2) {
|
|
138
|
+
return _ref2.apply(this, arguments);
|
|
139
|
+
};
|
|
140
|
+
}();
|
|
141
|
+
var handleVersionChange = function handleVersionChange(value) {
|
|
142
|
+
var version = versions.find(function (v) {
|
|
143
|
+
return v.value === value;
|
|
144
|
+
});
|
|
145
|
+
onVersionChange === null || onVersionChange === void 0 ? void 0 : onVersionChange(value, version);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// if (!currentVersion) return null;
|
|
149
|
+
|
|
150
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PisellCard, {
|
|
151
|
+
className: classNames('pisell-lowcode-app-version-control', className),
|
|
152
|
+
style: style
|
|
153
|
+
}, /*#__PURE__*/React.createElement(PisellAvatar, {
|
|
154
|
+
size: "xl",
|
|
155
|
+
shape: "square",
|
|
156
|
+
borderRadius: 10,
|
|
157
|
+
useTextAvatar: true,
|
|
158
|
+
className: "pisell-lowcode-app-version-control-avatar",
|
|
159
|
+
src: currentVersion === null || currentVersion === void 0 ? void 0 : currentVersion.avatar
|
|
160
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
161
|
+
type: "pisell2-container",
|
|
162
|
+
className: "pisell-lowcode-app-version-control-avatar-icon"
|
|
163
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
164
|
+
className: "pisell-lowcode-app-version-control-title"
|
|
165
|
+
}, currentVersion === null || currentVersion === void 0 ? void 0 : currentVersion.label), /*#__PURE__*/React.createElement(CustomSelect, {
|
|
166
|
+
options: versions,
|
|
167
|
+
value: value,
|
|
168
|
+
size: "large",
|
|
169
|
+
onChange: handleVersionChange,
|
|
170
|
+
style: {
|
|
171
|
+
width: '100%'
|
|
172
|
+
},
|
|
173
|
+
renderItem: function renderItem(option) {
|
|
174
|
+
return /*#__PURE__*/React.createElement(PisellRow, {
|
|
175
|
+
leftContent: option.label,
|
|
176
|
+
rightContent: /*#__PURE__*/React.createElement(PisellTags, {
|
|
177
|
+
type: 'pill_color',
|
|
178
|
+
color: getStatusColor(option.status),
|
|
179
|
+
className: "pisell-lowcode-app-version-control-tag"
|
|
180
|
+
}, getStatusText(option.status))
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}), allowCreate && /*#__PURE__*/React.createElement(Button, {
|
|
184
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
185
|
+
type: "pisell2-plus"
|
|
186
|
+
}),
|
|
187
|
+
block: true,
|
|
188
|
+
size: "large",
|
|
189
|
+
onClick: function onClick() {
|
|
190
|
+
return setPublishVersionModal(true);
|
|
191
|
+
}
|
|
192
|
+
}, getText('pisell-lowcode-app-version-control-new-version')), allowPublish && /*#__PURE__*/React.createElement(Button, {
|
|
193
|
+
type: "primary",
|
|
194
|
+
block: true,
|
|
195
|
+
size: "large",
|
|
196
|
+
onClick: function onClick() {
|
|
197
|
+
return setPromoteToLiveModal(true);
|
|
198
|
+
}
|
|
199
|
+
}, getText('pisell-lowcode-app-version-control-promote-to-live'))), /*#__PURE__*/React.createElement(PisellModal.Information, {
|
|
200
|
+
open: promoteToLiveModal,
|
|
201
|
+
title: getText('pisell-lowcode-app-version-control-promote-version')(currentVersion === null || currentVersion === void 0 ? void 0 : currentVersion.version),
|
|
202
|
+
describe: getText('pisell-lowcode-app-version-control-promote-version-describe'),
|
|
203
|
+
okText: getText('pisell-lowcode-app-version-control-promote-version-ok'),
|
|
204
|
+
cancelText: getText('pisell-lowcode-app-version-control-promote-version-cancel'),
|
|
205
|
+
onOk: handlePromoteToLive,
|
|
206
|
+
confirmLoading: promoteLoading,
|
|
207
|
+
onCancel: function onCancel() {
|
|
208
|
+
return setPromoteToLiveModal(false);
|
|
209
|
+
}
|
|
210
|
+
}), /*#__PURE__*/React.createElement(PublishVersionModal, {
|
|
211
|
+
currentVersion: liveVersion || '',
|
|
212
|
+
visible: publishVersionModal,
|
|
213
|
+
onCancel: function onCancel() {
|
|
214
|
+
return setPublishVersionModal(false);
|
|
215
|
+
},
|
|
216
|
+
onConfirm: handlePublishVersion,
|
|
217
|
+
isShowNote: false,
|
|
218
|
+
confirmLoading: publishLoading
|
|
219
|
+
}));
|
|
220
|
+
};
|
|
221
|
+
export default AppVersionControl;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.pisell-lowcode-app-version-control {
|
|
2
|
+
background-color: #fff;
|
|
3
|
+
.pisell-lowcode-card-body {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
gap: 12px;
|
|
9
|
+
padding: 12px !important;
|
|
10
|
+
.pisell-lowcode-app-version-control-avatar {
|
|
11
|
+
display: flex;
|
|
12
|
+
.pisell-lowcode-avatar-string {
|
|
13
|
+
display: flex;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pisell-lowcode-app-version-control-avatar-icon {
|
|
18
|
+
font-size: 32px !important;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
.pisell-lowcode-app-version-control-title {
|
|
22
|
+
color: var(--Gray-900, #101828);
|
|
23
|
+
text-align: center;
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
line-height: 24px; /* 150% */
|
|
27
|
+
}
|
|
28
|
+
&:hover {
|
|
29
|
+
background: #fff !important;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
.pisell-lowcode-app-version-control-tag {
|
|
33
|
+
line-height: 20px;
|
|
34
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface Version {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
status: 'live' | 'draft' | 'deprecated';
|
|
7
|
+
version: string;
|
|
8
|
+
avatar?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AppVersionControlProps {
|
|
11
|
+
value: string;
|
|
12
|
+
versions: Version[];
|
|
13
|
+
onVersionChange: (value: string, version: Version) => void;
|
|
14
|
+
onCreateVersion: (version: string) => Promise<boolean | undefined>;
|
|
15
|
+
onPromoteToLive: (value: string, version: Version) => Promise<boolean | undefined>;
|
|
16
|
+
allowPublish?: boolean;
|
|
17
|
+
allowCreate?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
style?: React.CSSProperties;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectProps } from 'antd';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export interface BaseOption {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string | number;
|
|
7
|
+
}
|
|
8
|
+
export interface CustomSelectProps<T extends BaseOption> extends Omit<SelectProps<T['value']>, 'options' | 'value' | 'onChange'> {
|
|
9
|
+
options: T[];
|
|
10
|
+
value: T['value'];
|
|
11
|
+
onChange: (value: T['value']) => void;
|
|
12
|
+
renderItem?: (option: T) => React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
}
|
|
16
|
+
declare const CustomSelect: <T extends BaseOption>(props: CustomSelectProps<T>) => React.JSX.Element;
|
|
17
|
+
export default CustomSelect;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import Select from "../select";
|
|
5
|
+
import "./index.less";
|
|
6
|
+
var CustomSelect = function CustomSelect(props) {
|
|
7
|
+
var propsOptions = props.options,
|
|
8
|
+
value = props.value,
|
|
9
|
+
onChange = props.onChange,
|
|
10
|
+
renderItem = props.renderItem;
|
|
11
|
+
var options = useMemo(function () {
|
|
12
|
+
return propsOptions.map(function (option) {
|
|
13
|
+
return {
|
|
14
|
+
label: renderItem ? renderItem(option) : option.label,
|
|
15
|
+
value: option.value
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
}, [propsOptions, renderItem]);
|
|
19
|
+
return /*#__PURE__*/React.createElement(Select, _extends({}, props, {
|
|
20
|
+
className: classNames('pisell-lowcode-custom-select', props.className),
|
|
21
|
+
options: options,
|
|
22
|
+
value: value,
|
|
23
|
+
onChange: onChange
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
export default CustomSelect;
|
|
@@ -157,9 +157,6 @@ export var withFormItem = function withFormItem(WrappedComponent, overlayProps)
|
|
|
157
157
|
}));
|
|
158
158
|
}
|
|
159
159
|
if (typeobj && typeobj.enabled) {
|
|
160
|
-
console.log('Type validation object:', typeobj);
|
|
161
|
-
console.log('Validation enabled:', typeobj.enabled);
|
|
162
|
-
console.log('Validation type:', typeobj.type);
|
|
163
160
|
switch (typeobj.type) {
|
|
164
161
|
case 'email':
|
|
165
162
|
rules.push(_objectSpread(_objectSpread({}, typeobj), {}, {
|
|
@@ -182,7 +179,6 @@ export var withFormItem = function withFormItem(WrappedComponent, overlayProps)
|
|
|
182
179
|
try {
|
|
183
180
|
// 清理输入值,移除空格、括号等字符
|
|
184
181
|
var _cleanedNumber = value.replace(/\s|\(|\)/g, '');
|
|
185
|
-
|
|
186
182
|
// 使用 parsePhoneNumberFromString 验证 E.164 格式
|
|
187
183
|
var parsedNumber = parsePhoneNumberFromString(_cleanedNumber);
|
|
188
184
|
if (!(parsedNumber !== null && parsedNumber !== void 0 && parsedNumber.isValid())) {
|
|
@@ -213,9 +209,11 @@ export var withFormItem = function withFormItem(WrappedComponent, overlayProps)
|
|
|
213
209
|
|
|
214
210
|
// 根据号码前缀判断国家
|
|
215
211
|
if (_cleanedNumber2.startsWith('+61')) {
|
|
216
|
-
//
|
|
212
|
+
// 澳大利亚手机号规则:
|
|
213
|
+
// 1. 以04开头必须是10位数字
|
|
214
|
+
// 2. 以4开头必须是9位数字
|
|
217
215
|
var numberWithoutPrefix = _cleanedNumber2.slice(3);
|
|
218
|
-
if (!/^(04\d{8}
|
|
216
|
+
if (!/^(?:04\d{8}|4\d{8})$/.test(numberWithoutPrefix)) {
|
|
219
217
|
return Promise.reject(new Error(typeobj.message || getText('pisell-data-source-form-mobile-message')));
|
|
220
218
|
}
|
|
221
219
|
} else if (_cleanedNumber2.startsWith('+86')) {
|
|
@@ -244,12 +242,6 @@ export var withFormItem = function withFormItem(WrappedComponent, overlayProps)
|
|
|
244
242
|
if (!subdomain) {
|
|
245
243
|
return Promise.resolve();
|
|
246
244
|
}
|
|
247
|
-
if (subdomain.length < 2) {
|
|
248
|
-
return Promise.reject(new Error(getText('subdomain-error-too-short')));
|
|
249
|
-
}
|
|
250
|
-
if (subdomain.length > 60) {
|
|
251
|
-
return Promise.reject(new Error(getText('subdomain-error-too-long')));
|
|
252
|
-
}
|
|
253
245
|
if (!/^[a-z0-9-]+$/.test(subdomain)) {
|
|
254
246
|
return Promise.reject(new Error(getText('subdomain-error-pattern')));
|
|
255
247
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import BaseMenu from "../../pisellMenu";
|
|
4
|
+
import useVariables from "../hooks/useVariables";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @title: 数据源表单组件
|
|
8
|
+
* @description: 基于数据源动态生成表单,支持编辑、查看、禁用三种模式
|
|
9
|
+
*/
|
|
10
|
+
var DataSourceMenu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
11
|
+
var dataSource = props.dataSource;
|
|
12
|
+
var _useVariables = useVariables(),
|
|
13
|
+
parseVariable = _useVariables.parseVariable;
|
|
14
|
+
return /*#__PURE__*/React.createElement(BaseMenu, _extends({}, props, {
|
|
15
|
+
dataSource: parseVariable === null || parseVariable === void 0 ? void 0 : parseVariable(dataSource),
|
|
16
|
+
ref: ref
|
|
17
|
+
}));
|
|
18
|
+
});
|
|
19
|
+
export default DataSourceMenu;
|
|
@@ -66,7 +66,7 @@ var Subdomain = function Subdomain(props) {
|
|
|
66
66
|
_useState2 = _slicedToArray(_useState, 2),
|
|
67
67
|
subdomain = _useState2[0],
|
|
68
68
|
setSubdomain = _useState2[1];
|
|
69
|
-
var _useState3 = useState(''),
|
|
69
|
+
var _useState3 = useState('.root-domain.example'),
|
|
70
70
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
71
71
|
suffix = _useState4[0],
|
|
72
72
|
setSuffix = _useState4[1];
|
|
@@ -114,13 +114,13 @@ var Subdomain = function Subdomain(props) {
|
|
|
114
114
|
var _newSuffix = '';
|
|
115
115
|
switch (rootDomain) {
|
|
116
116
|
case 'xzero':
|
|
117
|
-
_newSuffix = coreData ? ".".concat(coreData.tenant_domain) : '';
|
|
117
|
+
_newSuffix = coreData ? ".".concat(coreData.tenant_domain) : '.root-domain.example';
|
|
118
118
|
break;
|
|
119
119
|
case 'saas':
|
|
120
|
-
_newSuffix = tenantData ? ".".concat(tenantData['saas.domain']) : '';
|
|
120
|
+
_newSuffix = tenantData ? ".".concat(tenantData['saas.domain']) : '.root-domain.example';
|
|
121
121
|
break;
|
|
122
122
|
default:
|
|
123
|
-
_newSuffix = customDomain ? customDomain.startsWith('.') ? customDomain : ".".concat(customDomain) : '';
|
|
123
|
+
_newSuffix = customDomain ? customDomain.startsWith('.') ? customDomain : ".".concat(customDomain) : '.root-domain.example';
|
|
124
124
|
}
|
|
125
125
|
setSuffix(_newSuffix);
|
|
126
126
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ImageProps as AntdImageProps } from 'antd';
|
|
3
|
+
export interface ImageProps extends Omit<AntdImageProps, 'placeholder'> {
|
|
4
|
+
/**
|
|
5
|
+
* 占位图类型
|
|
6
|
+
*/
|
|
7
|
+
fallbackType?: 'image' | 'avatar' | 'product';
|
|
8
|
+
}
|
|
9
|
+
declare const Image: React.FC<ImageProps>;
|
|
10
|
+
export default Image;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var _excluded = ["fallbackType", "fallback"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Image as AntdImage } from 'antd';
|
|
7
|
+
import image from "./image.png";
|
|
8
|
+
import avatar from "./avatar.png";
|
|
9
|
+
import product from "./product.png";
|
|
10
|
+
var defaultFallbackMap = {
|
|
11
|
+
image: image,
|
|
12
|
+
avatar: avatar,
|
|
13
|
+
product: product
|
|
14
|
+
};
|
|
15
|
+
var Image = function Image(_ref) {
|
|
16
|
+
var _ref$fallbackType = _ref.fallbackType,
|
|
17
|
+
fallbackType = _ref$fallbackType === void 0 ? 'image' : _ref$fallbackType,
|
|
18
|
+
fallback = _ref.fallback,
|
|
19
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
var finalFallback = fallback || defaultFallbackMap[fallbackType];
|
|
21
|
+
return /*#__PURE__*/React.createElement(AntdImage, _extends({}, restProps, {
|
|
22
|
+
fallback: finalFallback
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
export default Image;
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './PisellDraggable.less';
|
|
3
|
+
import { PisellDraggableProps } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* PisellDraggable 组件
|
|
6
|
+
* 一个功能强大的拖拽排序组件,支持嵌套结构、多种布局方式和自定义样式
|
|
7
|
+
*
|
|
8
|
+
* 特点:
|
|
9
|
+
* 1. 支持垂直、水平和网格布局
|
|
10
|
+
* 2. 支持无限层级嵌套
|
|
11
|
+
* 3. 支持自定义拖拽手柄和样式
|
|
12
|
+
* 4. 支持动画效果和自定义动画
|
|
13
|
+
* 5. 支持最大嵌套深度限制
|
|
14
|
+
*/
|
|
15
|
+
declare const PisellDraggable: React.FC<PisellDraggableProps & {
|
|
16
|
+
currentLevel?: number;
|
|
17
|
+
}>;
|
|
18
|
+
export default PisellDraggable;
|