@pisell/materials 1.0.503 → 1.0.505

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.
Files changed (102) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +7 -7
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +26 -26
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +26 -26
  11. package/es/components/dataSourceComponents/dataSourceForm/utils.js +4 -2
  12. package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +2 -1
  13. package/es/components/dataSourceComponents/dataSourceTable/filter/utils.js +1 -0
  14. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
  15. package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.js +1 -1
  16. package/es/components/dataSourceComponents/fields/index.d.ts +2 -2
  17. package/es/components/dataSourceComponents/hooks/useActions.js +10 -1
  18. package/es/components/pisellAvatar/index.d.ts +19 -0
  19. package/es/components/pisellAvatar/index.js +89 -0
  20. package/es/components/pisellAvatar/index.less +25 -0
  21. package/es/components/pisellCustomCheckboxGroup/index.d.ts +15 -0
  22. package/es/components/pisellCustomCheckboxGroup/index.js +125 -0
  23. package/es/components/pisellCustomCheckboxGroup/index.less +0 -0
  24. package/es/components/pisellDropdown/index.d.ts +20 -0
  25. package/es/components/pisellDropdown/index.js +51 -0
  26. package/es/components/pisellDropdown/index.less +44 -0
  27. package/es/components/pisellImageCarousels/index.d.ts +20 -0
  28. package/es/components/pisellImageCarousels/index.js +106 -0
  29. package/es/components/pisellImageCarousels/index.less +92 -0
  30. package/es/components/pisellProgressBar/index.d.ts +14 -0
  31. package/es/components/pisellProgressBar/index.js +44 -0
  32. package/es/components/pisellProgressBar/index.less +48 -0
  33. package/es/components/pisellSectionHeaders/index.d.ts +21 -0
  34. package/es/components/pisellSectionHeaders/index.js +39 -0
  35. package/es/components/pisellSectionHeaders/index.less +48 -0
  36. package/es/components/pisellViewGrid/index.d.ts +16 -0
  37. package/es/components/pisellViewGrid/index.js +88 -0
  38. package/es/components/pisellViewGrid/index.less +30 -0
  39. package/es/components/table/Table/index.js +17 -6
  40. package/es/components/table/Table/utils.d.ts +1 -1
  41. package/es/components/table/index.js +5 -1
  42. package/es/components/table/model.d.ts +1 -0
  43. package/es/components/table/model.js +7 -1
  44. package/es/hooks/useTranslationOriginal.js +2 -1
  45. package/es/index.d.ts +9 -2
  46. package/es/index.js +10 -3
  47. package/lib/components/dataSourceComponents/dataSourceForm/utils.js +2 -2
  48. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +2 -1
  49. package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.js +1 -0
  50. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
  51. package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.js +1 -1
  52. package/lib/components/dataSourceComponents/fields/index.d.ts +2 -2
  53. package/lib/components/dataSourceComponents/hooks/useActions.js +5 -1
  54. package/lib/components/pisellAvatar/index.d.ts +19 -0
  55. package/lib/components/pisellAvatar/index.js +108 -0
  56. package/lib/components/pisellAvatar/index.less +25 -0
  57. package/lib/components/pisellCustomCheckboxGroup/index.d.ts +15 -0
  58. package/lib/components/pisellCustomCheckboxGroup/index.js +94 -0
  59. package/lib/components/pisellCustomCheckboxGroup/index.less +0 -0
  60. package/lib/components/pisellDropdown/index.d.ts +20 -0
  61. package/lib/components/pisellDropdown/index.js +72 -0
  62. package/lib/components/pisellDropdown/index.less +44 -0
  63. package/lib/components/pisellImageCarousels/index.d.ts +20 -0
  64. package/lib/components/pisellImageCarousels/index.js +107 -0
  65. package/lib/components/pisellImageCarousels/index.less +92 -0
  66. package/lib/components/pisellProgressBar/index.d.ts +14 -0
  67. package/lib/components/pisellProgressBar/index.js +62 -0
  68. package/lib/components/pisellProgressBar/index.less +48 -0
  69. package/lib/components/pisellSectionHeaders/index.d.ts +21 -0
  70. package/lib/components/pisellSectionHeaders/index.js +58 -0
  71. package/lib/components/pisellSectionHeaders/index.less +48 -0
  72. package/lib/components/pisellViewGrid/index.d.ts +16 -0
  73. package/lib/components/pisellViewGrid/index.js +109 -0
  74. package/lib/components/pisellViewGrid/index.less +30 -0
  75. package/lib/components/table/Table/index.js +17 -6
  76. package/lib/components/table/Table/utils.d.ts +1 -1
  77. package/lib/components/table/index.js +5 -1
  78. package/lib/components/table/model.d.ts +1 -0
  79. package/lib/components/table/model.js +5 -1
  80. package/lib/hooks/useTranslationOriginal.js +2 -1
  81. package/lib/index.d.ts +9 -2
  82. package/lib/index.js +23 -2
  83. package/lowcode/data-source-form/utils.ts +2 -2
  84. package/lowcode/pisell-avatar/__screenshots__/avatar-1.jpg +0 -0
  85. package/lowcode/pisell-avatar/meta.ts +111 -0
  86. package/lowcode/pisell-avatar/snippets.ts +14 -0
  87. package/lowcode/pisell-custom-checkbox-group/__screenshots__/card-1.png +0 -0
  88. package/lowcode/pisell-custom-checkbox-group/meta.ts +202 -0
  89. package/lowcode/pisell-custom-checkbox-group/snippets.ts +56 -0
  90. package/lowcode/pisell-dropdown/__screenshots__/dropdown-1.png +0 -0
  91. package/lowcode/pisell-dropdown/meta.ts +180 -0
  92. package/lowcode/pisell-dropdown/snippets.ts +69 -0
  93. package/lowcode/pisell-image-carousels/meta.ts +143 -0
  94. package/lowcode/pisell-image-carousels/snippets.ts +26 -0
  95. package/lowcode/pisell-progress-bar/meta.ts +115 -0
  96. package/lowcode/pisell-progress-bar/snippets.ts +15 -0
  97. package/lowcode/pisell-section-headers/meta.ts +91 -0
  98. package/lowcode/pisell-section-headers/snippets.ts +22 -0
  99. package/lowcode/pisell-view-grid/__screenshots__/card-1.png +0 -0
  100. package/lowcode/pisell-view-grid/meta.ts +167 -0
  101. package/lowcode/pisell-view-grid/snippets.ts +54 -0
  102. package/package.json +4 -3
@@ -294,12 +294,14 @@ export var withOptions = function withOptions(WrappedComponent) {
294
294
  if (optionSourceType !== 'api') {
295
295
  return propsOptions;
296
296
  }
297
- return ((_list$data = list.data) === null || _list$data === void 0 ? void 0 : (_list$data$data = _list$data.data) === null || _list$data$data === void 0 ? void 0 : _list$data$data.map(function (item) {
297
+ return (((_list$data = list.data) === null || _list$data === void 0 ? void 0 : (_list$data$data = _list$data.data) === null || _list$data$data === void 0 ? void 0 : _list$data$data.map(function (item) {
298
298
  return {
299
299
  label: translationOriginal(item[labelField]),
300
300
  value: item[valueField]
301
301
  };
302
- })) || [];
302
+ })) || []).sort(function (a, b) {
303
+ return a.label.localeCompare(b.label);
304
+ });
303
305
  }, [propsOptions, optionSourceType, list === null || list === void 0 ? void 0 : (_list$data2 = list.data) === null || _list$data2 === void 0 ? void 0 : _list$data2.data]);
304
306
  return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
305
307
  options: options
@@ -145,7 +145,8 @@ var Filter = function Filter(props) {
145
145
  style: {
146
146
  width: 200,
147
147
  margin: 0
148
- }
148
+ },
149
+ allowClear: true
149
150
  }) : null;
150
151
  }, [search]);
151
152
  return /*#__PURE__*/React.createElement(Form, {
@@ -48,6 +48,7 @@ var getCptProps = function getCptProps(field, cptType, item) {
48
48
  props.allowClear = true;
49
49
  if (cptType === 'FormItemSelect') {
50
50
  props.mode = 'multiple';
51
+ props.showSearch = true;
51
52
  }
52
53
  if (['Select', 'Radio.Group', 'Checkbox.Group'].includes(field === null || field === void 0 ? void 0 : (_field$uiSchema2 = field.uiSchema) === null || _field$uiSchema2 === void 0 ? void 0 : _field$uiSchema2['x-component']) && ((field === null || field === void 0 ? void 0 : (_field$uiSchema3 = field.uiSchema) === null || _field$uiSchema3 === void 0 ? void 0 : (_field$uiSchema3$enum = _field$uiSchema3.enum) === null || _field$uiSchema3$enum === void 0 ? void 0 : _field$uiSchema3$enum.length) || 0) > 0) {
53
54
  var _field$uiSchema4, _field$uiSchema5;
@@ -59,7 +59,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
59
59
  useCustomAction: boolean;
60
60
  actionType: string;
61
61
  openMode: "modal" | "drawer";
62
- openContentSize: "small" | "middle" | "large";
62
+ openContentSize: "small" | "large" | "middle";
63
63
  openTitle: string;
64
64
  key: string;
65
65
  } | undefined;
@@ -52,7 +52,7 @@ var Translation = function Translation(_ref) {
52
52
  var _ref3 = _slicedToArray(_ref2, 2),
53
53
  key = _ref3[0],
54
54
  val = _ref3[1];
55
- return val;
55
+ return key !== 'original' && val;
56
56
  });
57
57
  }, [value]);
58
58
  var handleInputChange = useCallback(function (lang) {
@@ -40,7 +40,7 @@ declare const formFieldMap: {
40
40
  'FormItemCheckbox.Group': import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
41
41
  FormItemDateRangePicker: import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
42
42
  FormItemUpload: import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
43
- FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithFormItemProps>;
43
+ FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
44
44
  };
45
45
  declare const getFieldComponent: (fieldComponent: string) => import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<any> | (import("react").FC<{}> & {
46
46
  Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
@@ -64,5 +64,5 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
64
64
  valueField: string;
65
65
  } & {
66
66
  dataSource?: any;
67
- }) => import("react").JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithFormItemProps>;
67
+ }) => import("react").JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
68
68
  export { getFieldComponent, formFieldMap };
@@ -2,6 +2,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2
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
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
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 { useMemo } from 'react';
5
6
  import { useMemoizedFn } from 'ahooks';
6
7
  import PisellToast from "../../pisellToast";
7
8
  import useFormat from "../dataSourceTable/hooks/useFormat";
@@ -41,8 +42,16 @@ var useActions = function useActions() {
41
42
  formatListResult = _useFormat.formatListResult,
42
43
  formatListParams = _useFormat.formatListParams,
43
44
  formatCreateUpdateParams = _useFormat.formatCreateUpdateParams;
45
+
46
+ // 真实currentRecord
47
+ var currentRecord = useMemo(function () {
48
+ return parseVariable === null || parseVariable === void 0 ? void 0 : parseVariable(currentValue, {});
49
+ }, [currentValue, parseVariable]);
44
50
  var getParsedActions = useMemoizedFn(function () {
45
- return parseActions(originalActions, {});
51
+ // 目前接口使用变量还无法在界面配置 所以这里默认追加currentRecord
52
+ return parseActions(originalActions, {
53
+ currentRecord: currentRecord
54
+ });
46
55
  });
47
56
 
48
57
  // 生成自定义 API 请求函数
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import type { AvatarProps } from 'antd';
3
+ import './index.less';
4
+ export declare type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
5
+ export interface PisellAvatarProps extends Omit<AvatarProps, 'size' | 'shape'> {
6
+ shape?: 'circle' | 'square';
7
+ size?: AvatarSize;
8
+ src?: string;
9
+ alt?: string;
10
+ icon?: React.ReactNode;
11
+ children?: React.ReactNode;
12
+ className?: string;
13
+ style?: React.CSSProperties;
14
+ useTextAvatar?: boolean;
15
+ borderRadius?: number;
16
+ onError?: () => boolean;
17
+ }
18
+ declare const PisellAvatar: React.FC<PisellAvatarProps>;
19
+ export default PisellAvatar;
@@ -0,0 +1,89 @@
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
+ var _excluded = ["shape", "size", "src", "alt", "icon", "children", "className", "style", "useTextAvatar", "borderRadius", "onError"];
3
+ 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); }
4
+ 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; }
5
+ 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; }
6
+ 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; }
7
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
+ 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); }
9
+ 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; }
10
+ 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; }
11
+ import React, { useMemo } from 'react';
12
+ import { Avatar } from 'antd';
13
+ import classNames from 'classnames';
14
+ import Iconfont from "../iconfont";
15
+ import "./index.less";
16
+ // 尺寸映射表(单位:像素)
17
+ var sizeMap = {
18
+ xs: 24,
19
+ sm: 32,
20
+ md: 40,
21
+ lg: 48,
22
+ xl: 56,
23
+ xxl: 64
24
+ };
25
+
26
+ // 字体大小映射表(单位:像素)
27
+ var fontSizeMap = {
28
+ xs: 12,
29
+ sm: 14,
30
+ md: 16,
31
+ lg: 18,
32
+ xl: 20,
33
+ xxl: 24
34
+ };
35
+ var PisellAvatar = function PisellAvatar(_ref) {
36
+ var _ref$shape = _ref.shape,
37
+ shape = _ref$shape === void 0 ? 'circle' : _ref$shape,
38
+ _ref$size = _ref.size,
39
+ size = _ref$size === void 0 ? 'xs' : _ref$size,
40
+ src = _ref.src,
41
+ alt = _ref.alt,
42
+ icon = _ref.icon,
43
+ children = _ref.children,
44
+ className = _ref.className,
45
+ style = _ref.style,
46
+ useTextAvatar = _ref.useTextAvatar,
47
+ _ref$borderRadius = _ref.borderRadius,
48
+ borderRadius = _ref$borderRadius === void 0 ? 4 : _ref$borderRadius,
49
+ onError = _ref.onError,
50
+ restProps = _objectWithoutProperties(_ref, _excluded);
51
+ var classes = classNames('pisell-avatar', "pisell-avatar-".concat(size), "pisell-avatar-".concat(shape), {
52
+ 'pisell-avatar-with-text': !src && !icon && children
53
+ }, className);
54
+ var mergedStyle = _objectSpread(_objectSpread({}, style), {}, {
55
+ width: sizeMap[size],
56
+ height: sizeMap[size],
57
+ fontSize: children || icon ? fontSizeMap[size] : undefined,
58
+ lineHeight: "".concat(sizeMap[size], "px"),
59
+ borderRadius: shape === 'square' ? "".concat(borderRadius, "px") : '50%'
60
+ });
61
+
62
+ /**
63
+ * @title: 渲染头像内容
64
+ * @description:
65
+ * @param {*} useMemo
66
+ * @return {*}
67
+ * @Author: WangHan
68
+ * @Date: 2025-01-07 11:58
69
+ */
70
+ var renderChildren = useMemo(function () {
71
+ // 使用文本头像并且有文本内容
72
+ if (useTextAvatar && children) {
73
+ return children;
74
+ }
75
+ return /*#__PURE__*/React.createElement(Iconfont, {
76
+ type: "pisell2-user-01"
77
+ });
78
+ }, [useTextAvatar, children]);
79
+ return /*#__PURE__*/React.createElement(Avatar, _extends({}, restProps, {
80
+ className: classes,
81
+ shape: shape,
82
+ style: mergedStyle,
83
+ src: src,
84
+ alt: alt,
85
+ icon: icon,
86
+ onError: onError
87
+ }), renderChildren);
88
+ };
89
+ export default PisellAvatar;
@@ -0,0 +1,25 @@
1
+ @prefix: pisell-avatar;
2
+
3
+ .@{prefix} {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ justify-content: center;
7
+ background: var(--Gray-100, #f2f4f7); // 默认背景色
8
+ border: none; // 移除默认边框
9
+
10
+ img {
11
+ object-fit: cover;
12
+ }
13
+
14
+ .anticon {
15
+ font-size: inherit !important;
16
+ }
17
+
18
+ // 文本头像样式
19
+ &.pisell-avatar-with-text {
20
+ background: var(--Gray-100, #f2f4f7); // 文本头像的背景色
21
+ color: var(--Gray-600, #475467); // 文本颜色
22
+ font-weight: 600;
23
+ // border: 0.75px solid var(--Gray-900, #101828);
24
+ }
25
+ }
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface PisellCustomCheckboxGroupProps {
4
+ dataSource?: any[];
5
+ disabled?: boolean;
6
+ allowAdd?: boolean;
7
+ isMultiple?: boolean;
8
+ id?: string | string[];
9
+ onChange?: (value: string | string[]) => void;
10
+ onAdd?: () => void;
11
+ [key: string]: any;
12
+ className?: string;
13
+ }
14
+ declare const PisellCustomCheckboxGroup: React.FC<PisellCustomCheckboxGroupProps>;
15
+ export default PisellCustomCheckboxGroup;
@@ -0,0 +1,125 @@
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
+ var _excluded = ["dataSource", "allowAdd", "onAdd", "disabled", "isMultiple", "value", "onChange", "className"];
3
+ 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); }
4
+ 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; }
5
+ 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; }
6
+ 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; }
7
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
+ 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); }
9
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
10
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
12
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
13
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
+ 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."); }
15
+ 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); }
16
+ 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; }
17
+ 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; } }
18
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
+ 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; }
20
+ 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; }
21
+ import React, { useMemo, useState } from 'react';
22
+ import classNames from 'classnames';
23
+ import PisellViewGrid from "../pisellViewGrid";
24
+ import "./index.less";
25
+ var PisellCustomCheckboxGroup = function PisellCustomCheckboxGroup(_ref) {
26
+ var _ref$dataSource = _ref.dataSource,
27
+ dataSource = _ref$dataSource === void 0 ? [] : _ref$dataSource,
28
+ _ref$allowAdd = _ref.allowAdd,
29
+ allowAdd = _ref$allowAdd === void 0 ? false : _ref$allowAdd,
30
+ onAdd = _ref.onAdd,
31
+ _ref$disabled = _ref.disabled,
32
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
33
+ _ref$isMultiple = _ref.isMultiple,
34
+ isMultiple = _ref$isMultiple === void 0 ? false : _ref$isMultiple,
35
+ value = _ref.value,
36
+ onChange = _ref.onChange,
37
+ className = _ref.className,
38
+ rest = _objectWithoutProperties(_ref, _excluded);
39
+ var _useState = useState(Array.isArray(value) ? value : value ? [value] : []),
40
+ _useState2 = _slicedToArray(_useState, 2),
41
+ selectedValues = _useState2[0],
42
+ setSelectedValues = _useState2[1];
43
+
44
+ /**
45
+ * @title: 构建最终数据,如果允许添加,则增加一项
46
+ * @description:
47
+ * @param {*} useMemo
48
+ * @return {*}
49
+ * @Author: WangHan
50
+ * @Date: 2025-01-08 18:21
51
+ */
52
+ var finalDataSource = useMemo(function () {
53
+ return allowAdd ? [{
54
+ id: 0,
55
+ text: '3',
56
+ isAddCard: true
57
+ }].concat(_toConsumableArray(dataSource)) : dataSource;
58
+ }, [allowAdd, dataSource]);
59
+
60
+ /**
61
+ * @title: 触发卡片的点击事件
62
+ * @description:
63
+ * @param {any} item
64
+ * @return {*}
65
+ * @Author: WangHan
66
+ * @Date: 2025-01-08 18:22
67
+ */
68
+ var handleItemClick = function handleItemClick(item) {
69
+ if (disabled) return;
70
+ var value = item === null || item === void 0 ? void 0 : item.id;
71
+ var newValues;
72
+
73
+ // 单选
74
+ if (!isMultiple) {
75
+ newValues = [value];
76
+ } else {
77
+ // 多选
78
+ if (selectedValues.includes(value)) {
79
+ newValues = selectedValues.filter(function (v) {
80
+ return v !== id;
81
+ });
82
+ } else {
83
+ newValues = [].concat(_toConsumableArray(selectedValues), [value]);
84
+ }
85
+ }
86
+ setSelectedValues(newValues);
87
+ onChange === null || onChange === void 0 ? void 0 : onChange(!isMultiple ? newValues[0] : newValues);
88
+ };
89
+
90
+ /**
91
+ * @title: 渲染卡片
92
+ * @description:
93
+ * @param {any} item
94
+ * @param {number} index
95
+ * @return {*}
96
+ * @Author: WangHan
97
+ * @Date: 2025-01-08 18:11
98
+ */
99
+ var renderGridItem = function renderGridItem(item, index) {
100
+ var _rest$renderItem;
101
+ var obj = _objectSpread({}, item);
102
+
103
+ // 给item增加 是否禁用/是否选中 的属性
104
+ if (selectedValues) {
105
+ var selected = selectedValues.includes(item === null || item === void 0 ? void 0 : item.id);
106
+ obj = _objectSpread(_objectSpread({}, item), {}, {
107
+ disabled: disabled,
108
+ selected: selected
109
+ });
110
+ }
111
+ return /*#__PURE__*/React.createElement("div", {
112
+ onClick: function onClick() {
113
+ return item !== null && item !== void 0 && item.isAddCard ? onAdd : handleItemClick(item);
114
+ }
115
+ }, rest === null || rest === void 0 ? void 0 : (_rest$renderItem = rest.renderItem) === null || _rest$renderItem === void 0 ? void 0 : _rest$renderItem.call(rest, obj, index));
116
+ };
117
+ return /*#__PURE__*/React.createElement(PisellViewGrid, _extends({}, rest, {
118
+ dataSource: finalDataSource,
119
+ renderItem: function renderItem(item, index) {
120
+ return renderGridItem(item, index);
121
+ },
122
+ className: classNames('pisell-custom-checkbox-group', className)
123
+ }));
124
+ };
125
+ export default PisellCustomCheckboxGroup;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface MenuItemType {
4
+ key: string;
5
+ label: string;
6
+ icon?: React.ReactNode;
7
+ shortcut?: string;
8
+ divider?: boolean;
9
+ }
10
+ export interface PisellDropdownProps {
11
+ trigger?: React.ReactNode;
12
+ items?: MenuItemType[];
13
+ showShortcut?: boolean;
14
+ triggerType?: ('click' | 'hover')[];
15
+ className?: string;
16
+ style?: React.CSSProperties;
17
+ onSelect?: (key: string) => void;
18
+ }
19
+ declare const PisellDropdown: React.FC<PisellDropdownProps>;
20
+ export default PisellDropdown;
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import { Menu } from 'antd';
3
+ import Dropdown from "../dropdown";
4
+ import classNames from 'classnames';
5
+ import "./index.less";
6
+ var PisellDropdown = function PisellDropdown(_ref) {
7
+ var trigger = _ref.trigger,
8
+ _ref$items = _ref.items,
9
+ items = _ref$items === void 0 ? [] : _ref$items,
10
+ _ref$showShortcut = _ref.showShortcut,
11
+ showShortcut = _ref$showShortcut === void 0 ? true : _ref$showShortcut,
12
+ _ref$triggerType = _ref.triggerType,
13
+ triggerType = _ref$triggerType === void 0 ? ['click'] : _ref$triggerType,
14
+ className = _ref.className,
15
+ style = _ref.style,
16
+ onSelect = _ref.onSelect;
17
+ var renderMenuItem = function renderMenuItem(item) {
18
+ var menuItem = /*#__PURE__*/React.createElement("div", {
19
+ className: "pisell-dropdown-item"
20
+ }, /*#__PURE__*/React.createElement("div", {
21
+ className: "pisell-dropdown-item-content"
22
+ }, item.icon && /*#__PURE__*/React.createElement("span", {
23
+ className: "pisell-dropdown-item-icon"
24
+ }, item.icon), /*#__PURE__*/React.createElement("span", {
25
+ className: "pisell-dropdown-item-label"
26
+ }, item.label)), showShortcut && item.shortcut && /*#__PURE__*/React.createElement("span", {
27
+ className: "pisell-dropdown-item-shortcut"
28
+ }, item.shortcut));
29
+ return item.divider ? /*#__PURE__*/React.createElement(React.Fragment, {
30
+ key: item.key
31
+ }, /*#__PURE__*/React.createElement(Menu.Item, {
32
+ key: item.key
33
+ }, menuItem), /*#__PURE__*/React.createElement(Menu.Divider, null)) : /*#__PURE__*/React.createElement(Menu.Item, {
34
+ key: item.key
35
+ }, menuItem);
36
+ };
37
+ var menu = /*#__PURE__*/React.createElement(Menu, {
38
+ onClick: function onClick(_ref2) {
39
+ var key = _ref2.key;
40
+ return onSelect === null || onSelect === void 0 ? void 0 : onSelect(key);
41
+ },
42
+ className: "pisell-dropdown-menu"
43
+ }, items.map(renderMenuItem));
44
+ return /*#__PURE__*/React.createElement(Dropdown, {
45
+ overlay: menu,
46
+ trigger: triggerType,
47
+ className: classNames('pisell-dropdown', className),
48
+ style: style
49
+ }, trigger || /*#__PURE__*/React.createElement("span", null, "Account"));
50
+ };
51
+ export default PisellDropdown;
@@ -0,0 +1,44 @@
1
+ .pisell-dropdown {
2
+ &-menu {
3
+ min-width: 200px;
4
+ }
5
+
6
+ &-item {
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: space-between;
10
+ padding: 8px 12px;
11
+
12
+ &-content {
13
+ display: flex;
14
+ align-items: center;
15
+ gap: 8px;
16
+ }
17
+
18
+ &-icon {
19
+ display: flex;
20
+ align-items: center;
21
+ font-size: 16px;
22
+ color: #666;
23
+ }
24
+
25
+ &-label {
26
+ color: #333;
27
+ }
28
+
29
+ &-shortcut {
30
+ color: #999;
31
+ font-size: 12px;
32
+ }
33
+ }
34
+ }
35
+
36
+ .ant-dropdown-menu-item {
37
+ padding: 0 !important;
38
+
39
+ &:hover {
40
+ .pisell-dropdown-item {
41
+ background-color: #f5f5f5;
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import 'swiper/swiper-bundle.css';
3
+ import './index.less';
4
+ export interface PisellImageCarouselsProps {
5
+ dataSource?: Array<{
6
+ url: string;
7
+ alt?: string;
8
+ }>;
9
+ width?: number;
10
+ height?: number;
11
+ showArrows?: boolean;
12
+ showDots?: boolean;
13
+ autoplay?: boolean;
14
+ interval?: number;
15
+ borderRadius?: number;
16
+ className?: string;
17
+ style?: React.CSSProperties;
18
+ }
19
+ declare const PisellImageCarousels: React.FC<PisellImageCarouselsProps>;
20
+ export default PisellImageCarousels;