@pisell/private-materials 3.0.13 → 3.0.14

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 (166) 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 +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/booking/components/addButton/index.d.ts +8 -8
  12. package/es/components/booking/components/addButton/index.js +1 -1
  13. package/es/components/booking/components/drawer/index.d.ts +1 -1
  14. package/es/components/booking/components/footer/FooterMenus/index.js +1 -1
  15. package/es/components/booking/components/footer/index.js +23 -21
  16. package/es/components/booking/components/footer/utils.js +4 -3
  17. package/es/components/booking/forms/forms.js +2 -1
  18. package/es/components/booking/info/client/index.js +0 -1
  19. package/es/components/booking/info/date/index.less +1 -1
  20. package/es/components/booking/info/index.js +10 -4
  21. package/es/components/booking/info/pet/index.js +5 -7
  22. package/es/components/booking/info/service/addService/index.js +27 -11
  23. package/es/components/booking/info/service/editService/index.js +8 -7
  24. package/es/components/booking/info/service/index.js +1 -1
  25. package/es/components/booking/info/service/index.less +3 -0
  26. package/es/components/booking/locales.d.ts +3 -0
  27. package/es/components/booking/locales.js +3 -0
  28. package/es/components/booking/model.d.ts +11 -0
  29. package/es/components/booking/utils.js +2 -1
  30. package/es/components/index.d.ts +2 -1
  31. package/es/components/index.js +2 -1
  32. package/es/components/productExtension/card/index.d.ts +10 -0
  33. package/es/components/productExtension/card/index.js +20 -0
  34. package/es/components/productExtension/card/index.less +34 -0
  35. package/es/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
  36. package/es/components/productExtension/fields/Actor/Container/index.js +34 -0
  37. package/es/components/productExtension/fields/Actor/Container/index.less +19 -0
  38. package/es/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
  39. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +94 -0
  40. package/es/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
  41. package/es/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
  42. package/es/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
  43. package/es/components/productExtension/fields/Actor/index.d.ts +5 -0
  44. package/es/components/productExtension/fields/Actor/index.js +23 -0
  45. package/es/components/productExtension/fields/Forms/index.d.ts +10 -0
  46. package/es/components/productExtension/fields/Forms/index.js +184 -0
  47. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
  48. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +30 -0
  49. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
  50. package/es/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
  51. package/es/components/productExtension/fields/SelectProducts/index.js +91 -0
  52. package/es/components/productExtension/fields/SelectProducts/index.less +30 -0
  53. package/es/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
  54. package/es/components/productExtension/fields/SelectProducts/mock.js +0 -0
  55. package/es/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
  56. package/es/components/productExtension/fields/SelectProducts/server.js +29 -0
  57. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
  58. package/es/components/productExtension/fields/SelectResourcesTable/index.js +198 -0
  59. package/es/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
  60. package/es/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
  61. package/es/components/productExtension/fields/SelectResourcesTable/mock.js +5072 -0
  62. package/es/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
  63. package/es/components/productExtension/fields/SelectResourcesTable/server.js +49 -0
  64. package/es/components/productExtension/fields/index.d.ts +1 -0
  65. package/es/components/productExtension/fields/index.js +33 -0
  66. package/es/components/productExtension/index.d.ts +7 -0
  67. package/es/components/productExtension/index.js +77 -0
  68. package/es/components/productExtension/index.less +0 -0
  69. package/es/components/productExtension/locales.d.ts +48 -0
  70. package/es/components/productExtension/locales.js +47 -0
  71. package/es/components/productExtension/server.d.ts +1 -0
  72. package/es/components/productExtension/server.js +29 -0
  73. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
  74. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +21 -5
  75. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
  76. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +20 -5
  77. package/es/components/selectModal/index.d.ts +24 -0
  78. package/es/components/selectModal/index.js +108 -0
  79. package/es/components/selectModal/index.less +0 -0
  80. package/es/components/tabProduct/card/index.d.ts +2 -2
  81. package/es/components/tabProduct/card/index.js +3 -4
  82. package/es/components/tabProduct/index.d.ts +4 -2
  83. package/es/components/tabProduct/index.js +10 -9
  84. package/es/index.d.ts +1 -0
  85. package/es/index.js +2 -1
  86. package/es/utils/index.d.ts +22 -0
  87. package/es/utils/index.js +56 -0
  88. package/lib/components/booking/components/addButton/index.d.ts +8 -8
  89. package/lib/components/booking/components/addButton/index.js +1 -1
  90. package/lib/components/booking/components/drawer/index.d.ts +1 -1
  91. package/lib/components/booking/components/footer/FooterMenus/index.js +1 -1
  92. package/lib/components/booking/components/footer/index.js +3 -1
  93. package/lib/components/booking/components/footer/utils.js +4 -2
  94. package/lib/components/booking/forms/forms.js +1 -1
  95. package/lib/components/booking/info/client/index.js +0 -1
  96. package/lib/components/booking/info/date/index.less +1 -1
  97. package/lib/components/booking/info/index.js +7 -1
  98. package/lib/components/booking/info/pet/index.js +5 -7
  99. package/lib/components/booking/info/service/addService/index.js +25 -10
  100. package/lib/components/booking/info/service/editService/index.js +7 -5
  101. package/lib/components/booking/info/service/index.js +1 -1
  102. package/lib/components/booking/info/service/index.less +3 -0
  103. package/lib/components/booking/locales.d.ts +3 -0
  104. package/lib/components/booking/locales.js +3 -0
  105. package/lib/components/booking/model.d.ts +11 -0
  106. package/lib/components/booking/utils.js +2 -1
  107. package/lib/components/index.d.ts +2 -1
  108. package/lib/components/index.js +3 -0
  109. package/lib/components/productExtension/card/index.d.ts +10 -0
  110. package/lib/components/productExtension/card/index.js +57 -0
  111. package/lib/components/productExtension/card/index.less +34 -0
  112. package/lib/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
  113. package/lib/components/productExtension/fields/Actor/Container/index.js +64 -0
  114. package/lib/components/productExtension/fields/Actor/Container/index.less +19 -0
  115. package/lib/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
  116. package/lib/components/productExtension/fields/Actor/CutOffTime/index.js +128 -0
  117. package/lib/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
  118. package/lib/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
  119. package/lib/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
  120. package/lib/components/productExtension/fields/Actor/index.d.ts +5 -0
  121. package/lib/components/productExtension/fields/Actor/index.js +56 -0
  122. package/lib/components/productExtension/fields/Forms/index.d.ts +10 -0
  123. package/lib/components/productExtension/fields/Forms/index.js +108 -0
  124. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
  125. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +65 -0
  126. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
  127. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
  128. package/lib/components/productExtension/fields/SelectProducts/index.js +111 -0
  129. package/lib/components/productExtension/fields/SelectProducts/index.less +30 -0
  130. package/lib/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
  131. package/lib/components/productExtension/fields/SelectProducts/mock.js +0 -0
  132. package/lib/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
  133. package/lib/components/productExtension/fields/SelectProducts/server.js +33 -0
  134. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
  135. package/lib/components/productExtension/fields/SelectResourcesTable/index.js +179 -0
  136. package/lib/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
  137. package/lib/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
  138. package/lib/components/productExtension/fields/SelectResourcesTable/mock.js +12723 -0
  139. package/lib/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
  140. package/lib/components/productExtension/fields/SelectResourcesTable/server.js +39 -0
  141. package/lib/components/productExtension/fields/index.d.ts +1 -0
  142. package/lib/components/productExtension/fields/index.js +69 -0
  143. package/lib/components/productExtension/index.d.ts +7 -0
  144. package/lib/components/productExtension/index.js +108 -0
  145. package/lib/components/productExtension/index.less +0 -0
  146. package/lib/components/productExtension/locales.d.ts +48 -0
  147. package/lib/components/productExtension/locales.js +71 -0
  148. package/lib/components/productExtension/server.d.ts +1 -0
  149. package/lib/components/productExtension/server.js +33 -0
  150. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
  151. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +11 -6
  152. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
  153. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +18 -4
  154. package/lib/components/selectModal/index.d.ts +24 -0
  155. package/lib/components/selectModal/index.js +133 -0
  156. package/lib/components/selectModal/index.less +0 -0
  157. package/lib/components/tabProduct/card/index.d.ts +2 -2
  158. package/lib/components/tabProduct/card/index.js +1 -2
  159. package/lib/components/tabProduct/index.d.ts +4 -2
  160. package/lib/components/tabProduct/index.js +7 -8
  161. package/lib/index.d.ts +1 -0
  162. package/lib/index.js +3 -0
  163. package/lib/utils/index.d.ts +22 -0
  164. package/lib/utils/index.js +59 -0
  165. package/lowcode/product-extension/meta.ts +120 -0
  166. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ export declare const getFormTypes: (params: any, config: any) => Promise<any>;
2
+ export declare const getAllResource: (params: any, config: any) => Promise<any>;
@@ -0,0 +1,49 @@
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
+ import { request } from "../../../../utils/index";
6
+ export var getFormTypes = /*#__PURE__*/function () {
7
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params, config) {
8
+ var _yield$request$getReq, data;
9
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10
+ while (1) switch (_context.prev = _context.next) {
11
+ case 0:
12
+ _context.next = 2;
13
+ return request.getRequest().get("/shop/form", params, config);
14
+ case 2:
15
+ _yield$request$getReq = _context.sent;
16
+ data = _yield$request$getReq.data;
17
+ return _context.abrupt("return", (data === null || data === void 0 ? void 0 : data.list) || []);
18
+ case 5:
19
+ case "end":
20
+ return _context.stop();
21
+ }
22
+ }, _callee);
23
+ }));
24
+ return function getFormTypes(_x, _x2) {
25
+ return _ref.apply(this, arguments);
26
+ };
27
+ }();
28
+ export var getAllResource = /*#__PURE__*/function () {
29
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params, config) {
30
+ var _yield$request$getReq2, data;
31
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
32
+ while (1) switch (_context2.prev = _context2.next) {
33
+ case 0:
34
+ _context2.next = 2;
35
+ return request.getRequest().get("/shop/schedule/relation/resource", params, config);
36
+ case 2:
37
+ _yield$request$getReq2 = _context2.sent;
38
+ data = _yield$request$getReq2.data;
39
+ return _context2.abrupt("return", (data === null || data === void 0 ? void 0 : data.list) || []);
40
+ case 5:
41
+ case "end":
42
+ return _context2.stop();
43
+ }
44
+ }, _callee2);
45
+ }));
46
+ return function getAllResource(_x3, _x4) {
47
+ return _ref2.apply(this, arguments);
48
+ };
49
+ }();
@@ -0,0 +1 @@
1
+ export declare const fields: any;
@@ -0,0 +1,33 @@
1
+ import SchedulesModule from "../../schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule";
2
+ import SelectResourcesTable from "./SelectResourcesTable";
3
+ import Actor from "./Actor";
4
+ import { InputNumber } from 'antd';
5
+ export var fields = {
6
+ 'schedule.ids': {
7
+ Component: SchedulesModule,
8
+ defaultProps: {
9
+ isTitle: false,
10
+ isSelf: true
11
+ }
12
+ },
13
+ 'event_item_resource': {
14
+ Component: SelectResourcesTable,
15
+ defaultProps: {}
16
+ },
17
+ 'event_item_capacity': {
18
+ Component: InputNumber,
19
+ defaultProps: {
20
+ min: 0,
21
+ max: 100000,
22
+ precision: 0,
23
+ style: {
24
+ width: '100%'
25
+ },
26
+ size: 'large'
27
+ }
28
+ },
29
+ 'event_item_actor': {
30
+ Component: Actor,
31
+ defaultProps: {}
32
+ }
33
+ };
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ interface ProductExtensionProps {
4
+ onDataChange: any;
5
+ }
6
+ declare const ProductExtension: ({ onDataChange }: ProductExtensionProps) => React.JSX.Element;
7
+ export default ProductExtension;
@@ -0,0 +1,77 @@
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 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ 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); }
7
+ import React, { useMemo, useEffect } from "react";
8
+ import { Form, Skeleton } from "antd";
9
+ import { request } from "../../utils/index";
10
+ import useEngineContext from "../../hooks/useEngineContext";
11
+ import { getProductExtensionFields } from "./server";
12
+ import { useRequest } from "ahooks";
13
+ import { fields } from "./fields";
14
+ import Card from "./card";
15
+ import "./index.less";
16
+ import { locales } from "@pisell/utils";
17
+ import localeTexts from "./locales";
18
+ locales.init(localeTexts, localStorage.getItem("umi_locale") || "en");
19
+ var ProductExtension = function ProductExtension(_ref) {
20
+ var _extension$filed;
21
+ var onDataChange = _ref.onDataChange;
22
+ var context = useEngineContext();
23
+ request.setRequest(context.appHelper.utils.request);
24
+ var _getProductExtensionFields = useRequest(getProductExtensionFields, {
25
+ manual: true,
26
+ onSuccess: function onSuccess(res) {
27
+ onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(res);
28
+ }
29
+ });
30
+ useEffect(function () {
31
+ _getProductExtensionFields.run({
32
+ code: "event_item"
33
+ });
34
+ }, []);
35
+ var extension = useMemo(function () {
36
+ return _getProductExtensionFields.data || {};
37
+ }, [_getProductExtensionFields.data]);
38
+ var renderItem = function renderItem(item, name) {
39
+ var _ref2 = fields[item.key] || {},
40
+ Component = _ref2.Component,
41
+ defaultProps = _ref2.defaultProps;
42
+ var _props = _objectSpread({}, defaultProps);
43
+ if (name) {
44
+ _props.name = name;
45
+ }
46
+ return Component ? /*#__PURE__*/React.createElement(Component, _props) : null;
47
+ };
48
+ return /*#__PURE__*/React.createElement(Skeleton, {
49
+ active: true,
50
+ round: true,
51
+ loading: _getProductExtensionFields.loading
52
+ }, (_extension$filed = extension.filed) === null || _extension$filed === void 0 ? void 0 : _extension$filed.map(function (item, index) {
53
+ var _item$, _item$2, _extension$extension;
54
+ var isHidden = ((_item$ = item[0]) === null || _item$ === void 0 ? void 0 : _item$.key) === "event_item_type";
55
+ return /*#__PURE__*/React.createElement(Card, {
56
+ hidden: isHidden,
57
+ key: index
58
+ // style={{ overflow: "inherit" }}
59
+ ,
60
+ header: item.length === 1 ? (_item$2 = item[0]) === null || _item$2 === void 0 ? void 0 : _item$2.name : extension === null || extension === void 0 ? void 0 : (_extension$extension = extension.extension) === null || _extension$extension === void 0 ? void 0 : _extension$extension.name
61
+ }, item.map(function (child, childIndex) {
62
+ var name = "".concat(child.id, "|").concat(child.key);
63
+ return /*#__PURE__*/React.createElement(Form.Item, {
64
+ hidden: isHidden,
65
+ label: item.length === 1 ? "" : child.name,
66
+ name: name,
67
+ rules: child.rules || child.key === "par_value" ? [{
68
+ required: true,
69
+ message: locales.getText("pisell2.text.product-extension.please-select")
70
+ }] : [],
71
+ key: childIndex,
72
+ noStyle: true
73
+ }, renderItem(child, name));
74
+ }));
75
+ }));
76
+ };
77
+ export default ProductExtension;
File without changes
@@ -0,0 +1,48 @@
1
+ declare const _default: {
2
+ en: {
3
+ 'pisell2.text.product-extension.please-select': string;
4
+ 'pisell2.text.product-extension.cut-off-time': string;
5
+ 'pisell2.text.product-extension.cut-off-time.desc': string;
6
+ 'pisell2.text.product-extension.future-day': string;
7
+ 'pisell2.text.product-extension.future-day.hint': string;
8
+ 'pisell2.text.product-extension.days': string;
9
+ 'pisell2.text.product-extension.hours': string;
10
+ 'pisell2.text.product-extension.minutes': string;
11
+ 'pisell2.text.product-extension.add-product': string;
12
+ 'pisell2.text.product-extension.add-other-product': string;
13
+ 'pisell2.text.product-extension.resource-type': string;
14
+ 'pisell2.text.product-extension.open': string;
15
+ 'pisell2.text.product-extension.options': string;
16
+ };
17
+ 'zh-CN': {
18
+ 'pisell2.text.product-extension.please-select': string;
19
+ 'pisell2.text.product-extension.cut-off-time': string;
20
+ 'pisell2.text.product-extension.cut-off-time.desc': string;
21
+ 'pisell2.text.product-extension.future-day': string;
22
+ 'pisell2.text.product-extension.future-day.hint': string;
23
+ 'pisell2.text.product-extension.days': string;
24
+ 'pisell2.text.product-extension.hours': string;
25
+ 'pisell2.text.product-extension.minutes': string;
26
+ 'pisell2.text.product-extension.add-product': string;
27
+ 'pisell2.text.product-extension.add-other-product': string;
28
+ 'pisell2.text.product-extension.resource-type': string;
29
+ 'pisell2.text.product-extension.open': string;
30
+ 'pisell2.text.product-extension.options': string;
31
+ };
32
+ 'zh-HK': {
33
+ 'pisell2.text.product-extension.please-select': string;
34
+ 'pisell2.text.product-extension.cut-off-time': string;
35
+ 'pisell2.text.product-extension.cut-off-time.desc': string;
36
+ 'pisell2.text.product-extension.future-day': string;
37
+ 'pisell2.text.product-extension.future-day.hint': string;
38
+ 'pisell2.text.product-extension.days': string;
39
+ 'pisell2.text.product-extension.hours': string;
40
+ 'pisell2.text.product-extension.minutes': string;
41
+ 'pisell2.text.product-extension.add-product': string;
42
+ 'pisell2.text.product-extension.add-other-product': string;
43
+ 'pisell2.text.product-extension.resource-type': string;
44
+ 'pisell2.text.product-extension.open': string;
45
+ 'pisell2.text.product-extension.options': string;
46
+ };
47
+ };
48
+ export default _default;
@@ -0,0 +1,47 @@
1
+ export default {
2
+ "en": {
3
+ 'pisell2.text.product-extension.please-select': "Please select",
4
+ 'pisell2.text.product-extension.cut-off-time': 'Cut-off time',
5
+ 'pisell2.text.product-extension.cut-off-time.desc': 'How long can I make an appointment before the event.Must be less than 168 hours',
6
+ 'pisell2.text.product-extension.future-day': 'Future Day',
7
+ 'pisell2.text.product-extension.future-day.hint': 'The maximum number of days in the future that customers can book',
8
+ 'pisell2.text.product-extension.days': 'Days',
9
+ 'pisell2.text.product-extension.hours': 'Hours',
10
+ 'pisell2.text.product-extension.minutes': 'Minutes',
11
+ 'pisell2.text.product-extension.add-product': 'Add Product',
12
+ 'pisell2.text.product-extension.add-other-product': 'Add Other Product',
13
+ 'pisell2.text.product-extension.resource-type': 'Resource Type',
14
+ 'pisell2.text.product-extension.open': 'Open',
15
+ 'pisell2.text.product-extension.options': 'Options'
16
+ },
17
+ 'zh-CN': {
18
+ 'pisell2.text.product-extension.please-select': "请选择",
19
+ 'pisell2.text.product-extension.cut-off-time': '截止时间',
20
+ 'pisell2.text.product-extension.cut-off-time.desc': '用于配置活动开始前多久停止预约(最大设置168小时)',
21
+ 'pisell2.text.product-extension.future-day': '预定天数',
22
+ 'pisell2.text.product-extension.future-day.hint': '客户未来最多可预订天数',
23
+ 'pisell2.text.product-extension.days': '天',
24
+ 'pisell2.text.product-extension.hours': '小时',
25
+ 'pisell2.text.product-extension.minutes': '分钟',
26
+ 'pisell2.text.product-extension.add-product': '添加商品',
27
+ 'pisell2.text.product-extension.add-other-product': '添加其他商品',
28
+ 'pisell2.text.product-extension.resource-type': '资源类型',
29
+ 'pisell2.text.product-extension.open': '启用',
30
+ 'pisell2.text.product-extension.options': '项目'
31
+ },
32
+ 'zh-HK': {
33
+ 'pisell2.text.product-extension.please-select': "請選擇",
34
+ 'pisell2.text.product-extension.cut-off-time': '截止时间',
35
+ 'pisell2.text.product-extension.cut-off-time.desc': '用於配置活動開始前多久停止預約(最大設置168小時)',
36
+ 'pisell2.text.product-extension.future-day': '預定天數',
37
+ 'pisell2.text.product-extension.future-day.hint': '客戶未來最多可預訂天數',
38
+ 'pisell2.text.product-extension.days': '天',
39
+ 'pisell2.text.product-extension.hours': '小時',
40
+ 'pisell2.text.product-extension.minutes': '分鐘',
41
+ 'pisell2.text.product-extension.add-product': '添加商品',
42
+ 'pisell2.text.product-extension.add-other-product': '添加其他商品',
43
+ 'pisell2.text.product-extension.resource-type': '資源類型',
44
+ 'pisell2.text.product-extension.open': '啟用',
45
+ 'pisell2.text.product-extension.options': '項目'
46
+ }
47
+ };
@@ -0,0 +1 @@
1
+ export declare const getProductExtensionFields: (params: any) => Promise<any>;
@@ -0,0 +1,29 @@
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
+ import { request } from "../../utils/index";
6
+ export var getProductExtensionFields = /*#__PURE__*/function () {
7
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
8
+ var _yield$request$getReq, data;
9
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10
+ while (1) switch (_context.prev = _context.next) {
11
+ case 0:
12
+ _context.next = 2;
13
+ return request.getRequest().get("/shop/product/extension/field/code", params, {
14
+ useCache: true
15
+ });
16
+ case 2:
17
+ _yield$request$getReq = _context.sent;
18
+ data = _yield$request$getReq.data;
19
+ return _context.abrupt("return", data || {});
20
+ case 5:
21
+ case "end":
22
+ return _context.stop();
23
+ }
24
+ }, _callee);
25
+ }));
26
+ return function getProductExtensionFields(_x) {
27
+ return _ref.apply(this, arguments);
28
+ };
29
+ }();
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import "./index.less";
3
- declare const AddSchedules: ({ value, onChange, drawerContainer }: any) => React.JSX.Element;
3
+ declare const AddSchedules: ({ value, onChange, drawerContainer, isSelf }: any) => React.JSX.Element;
4
4
  export default AddSchedules;
@@ -1,3 +1,9 @@
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 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ 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); }
1
7
  import { locales } from "@pisell/utils";
2
8
  import { useRequest } from "ahooks";
3
9
  import { Button } from "antd";
@@ -7,9 +13,11 @@ import { Context } from "../../../../../model";
7
13
  import { getSchedules } from "../../../../serve";
8
14
  import "./index.less";
9
15
  var AddSchedules = function AddSchedules(_ref) {
16
+ var _state$schedules;
10
17
  var value = _ref.value,
11
18
  onChange = _ref.onChange,
12
- drawerContainer = _ref.drawerContainer;
19
+ drawerContainer = _ref.drawerContainer,
20
+ isSelf = _ref.isSelf;
13
21
  var modalRef = useRef(null);
14
22
  var _useContext = useContext(Context),
15
23
  state = _useContext.state;
@@ -27,19 +35,25 @@ var AddSchedules = function AddSchedules(_ref) {
27
35
  onClick: function onClick() {
28
36
  var _modalRef$current;
29
37
  (_modalRef$current = modalRef.current) === null || _modalRef$current === void 0 ? void 0 : _modalRef$current.open();
38
+ if (isSelf) {
39
+ _getScheduleList.run({
40
+ num: 999,
41
+ skip: 1
42
+ });
43
+ }
30
44
  }
31
45
  }, locales.getText("pisell2.text.schedules.assign-schedule")), /*#__PURE__*/React.createElement(CustomSelect, {
32
46
  ref: modalRef,
33
47
  rowKey: "id",
34
- options: state.schedules.list || [],
48
+ options: isSelf ? _getScheduleList.data || [] : (state === null || state === void 0 ? void 0 : (_state$schedules = state.schedules) === null || _state$schedules === void 0 ? void 0 : _state$schedules.list) || [],
35
49
  loading: _getScheduleList.loading,
36
50
  value: value,
37
51
  onValueChange: onFinish,
38
52
  isPreview: false,
39
- drawerProps: {
53
+ drawerProps: _objectSpread({
40
54
  title: locales.getText("pisell2.text.schedules.assign-schedule"),
41
55
  destroyOnClose: true,
42
- width: 480,
56
+ width: 500,
43
57
  getContainer: drawerContainer || document.querySelector(".pisell-lowcode__schedules-component-products") || document.body,
44
58
  rootStyle: {
45
59
  position: "absolute"
@@ -48,7 +62,9 @@ var AddSchedules = function AddSchedules(_ref) {
48
62
  boxShadow: "none"
49
63
  },
50
64
  titleNoWrap: true
51
- },
65
+ }, isSelf ? {
66
+ zIndex: 1000
67
+ } : {}),
52
68
  mode: "multiple",
53
69
  optionRender: function optionRender(item) {
54
70
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
@@ -1,11 +1,14 @@
1
1
  import React from "react";
2
2
  import "./index.less";
3
3
  declare type Value = number[];
4
- declare const SchedulesModule: ({ value, onChange, drawerContainer, ruleFn, tabKey, }: {
4
+ declare const SchedulesModule: ({ value, onChange, drawerContainer, ruleFn, tabKey, previewItemChange, isSelf, isTitle, }: {
5
5
  value?: Value | undefined;
6
6
  onChange?: ((value: Value) => void) | undefined;
7
7
  drawerContainer?: HTMLElement | undefined;
8
8
  ruleFn?: (() => boolean) | undefined;
9
- tabKey: string;
9
+ tabKey?: string | undefined;
10
+ previewItemChange?: any;
11
+ isSelf?: boolean | undefined;
12
+ isTitle?: boolean | undefined;
10
13
  }) => React.JSX.Element;
11
14
  export default SchedulesModule;
@@ -7,6 +7,8 @@ import { useMemoizedFn, useRequest } from "ahooks";
7
7
  import { locales } from "@pisell/utils";
8
8
  import { calcCalendarDataBySchedules } from "../../../../schedules/utils";
9
9
  import { Context } from "../../../../model";
10
+ import useEngineContext from "../../../../../../hooks/useEngineContext";
11
+ import { request } from "../../../../utils";
10
12
  var SchedulesModule = function SchedulesModule(_ref) {
11
13
  var value = _ref.value,
12
14
  onChange = _ref.onChange,
@@ -15,7 +17,16 @@ var SchedulesModule = function SchedulesModule(_ref) {
15
17
  ruleFn = _ref$ruleFn === void 0 ? function () {
16
18
  return true;
17
19
  } : _ref$ruleFn,
18
- tabKey = _ref.tabKey;
20
+ tabKey = _ref.tabKey,
21
+ previewItemChange = _ref.previewItemChange,
22
+ _ref$isSelf = _ref.isSelf,
23
+ isSelf = _ref$isSelf === void 0 ? false : _ref$isSelf,
24
+ _ref$isTitle = _ref.isTitle,
25
+ isTitle = _ref$isTitle === void 0 ? true : _ref$isTitle;
26
+ var context = useEngineContext();
27
+ if (isSelf) {
28
+ request.setRequest(context.appHelper.utils.request);
29
+ }
19
30
  var _useContext = useContext(Context),
20
31
  state = _useContext.state,
21
32
  dispatch = _useContext.dispatch;
@@ -52,7 +63,7 @@ var SchedulesModule = function SchedulesModule(_ref) {
52
63
  }
53
64
  }, [value]);
54
65
  var setCalendarEditData = function setCalendarEditData(editData) {
55
- dispatch({
66
+ dispatch === null || dispatch === void 0 ? void 0 : dispatch({
56
67
  type: "setCalendar",
57
68
  payload: {
58
69
  isEdit: true,
@@ -66,7 +77,10 @@ var SchedulesModule = function SchedulesModule(_ref) {
66
77
  }
67
78
  }, [_getScheduleList.data, ruleFn === null || ruleFn === void 0 ? void 0 : ruleFn()]);
68
79
  var onClickItem = useMemoizedFn(function (item) {
69
- dispatch({
80
+ if (previewItemChange) {
81
+ return previewItemChange(item);
82
+ }
83
+ dispatch === null || dispatch === void 0 ? void 0 : dispatch({
70
84
  type: "setState",
71
85
  payload: {
72
86
  tabKey: "schedules",
@@ -91,9 +105,9 @@ var SchedulesModule = function SchedulesModule(_ref) {
91
105
  });
92
106
  return /*#__PURE__*/React.createElement("div", {
93
107
  className: "product-detail-card-module"
94
- }, /*#__PURE__*/React.createElement("div", {
108
+ }, isTitle ? /*#__PURE__*/React.createElement("div", {
95
109
  className: "product-detail-card-title"
96
- }, locales.getText("pisell2.text.schedules.schedules-title")), /*#__PURE__*/React.createElement(ScheduleList, {
110
+ }, locales.getText("pisell2.text.schedules.schedules-title")) : null, /*#__PURE__*/React.createElement(ScheduleList, {
97
111
  className: "product-detail-card-schedule-list",
98
112
  dataSource: _getScheduleList.data || [],
99
113
  loading: _getScheduleList.loading,
@@ -101,6 +115,7 @@ var SchedulesModule = function SchedulesModule(_ref) {
101
115
  onDelete: handleDeleteSchedule,
102
116
  onItemClick: onClickItem
103
117
  }), /*#__PURE__*/React.createElement(AddSchedules, {
118
+ isSelf: isSelf,
104
119
  value: _getScheduleList.data || [],
105
120
  onChange: _onAddChange,
106
121
  drawerContainer: drawerContainer
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import { AddButtonProps } from "../booking/components/addButton";
3
+ import { PisellDrawerProps } from "../booking/components/drawer";
4
+ import { TabProductProps } from "../tabProduct";
5
+ import "./index.less";
6
+ interface ValueType {
7
+ }
8
+ interface SelectModalProps {
9
+ value: ValueType[];
10
+ onChange: (value: ValueType[]) => void;
11
+ dataSource: ValueType[];
12
+ renderValueItem: (item: ValueType, onSelect: (value: ValueType[]) => void) => React.ReactNode;
13
+ renderOptionItem: (item: ValueType, onSelect: (value: ValueType[]) => void) => React.ReactNode;
14
+ disabled: boolean;
15
+ className: string;
16
+ style: React.CSSProperties;
17
+ maxLength?: number;
18
+ buttonProps: AddButtonProps;
19
+ drawerProps: PisellDrawerProps;
20
+ tabProductProps: TabProductProps;
21
+ loading: boolean;
22
+ }
23
+ declare const SelectModal: React.FC<Partial<SelectModalProps>>;
24
+ export default SelectModal;