pb-sxp-ui 1.0.72 → 1.0.73

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 (45) hide show
  1. package/dist/index.cjs +28 -26
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +28 -26
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +3 -3
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +3 -3
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +31 -30
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +3 -3
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/SxpPageRender/FormatImage.js +7 -2
  14. package/es/core/components/SxpPageRender/Popup/index.js +2 -2
  15. package/es/materials/sxp/popup/AppointForm/index.js +3 -1
  16. package/es/materials/sxp/popup/AppointForm/settingRender.js +0 -5
  17. package/es/materials/sxp/popup/CommodityDetail/index.js +1 -1
  18. package/es/materials/sxp/popup/CommodityDetail/settingRender.js +1 -1
  19. package/es/materials/sxp/popup/CommodityDetailDiro/index.js +2 -3
  20. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
  21. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +1 -1
  22. package/es/materials/sxp/template/Commodity/index.js +1 -1
  23. package/es/materials/sxp/template/CommodityDiro/index.js +1 -1
  24. package/es/materials/sxp/template/CommodityDiroNew/index.js +1 -1
  25. package/es/materials/sxp/template/MultiCommodity/index.js +1 -1
  26. package/es/materials/sxp/template/MultiCommodityDiro/index.js +1 -1
  27. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +1 -1
  28. package/es/materials/sxp/template/components/settingRender.js +1 -1
  29. package/lib/core/components/SxpPageRender/FormatImage.js +7 -2
  30. package/lib/core/components/SxpPageRender/Popup/index.js +2 -2
  31. package/lib/materials/sxp/popup/AppointForm/index.js +3 -1
  32. package/lib/materials/sxp/popup/AppointForm/settingRender.js +0 -5
  33. package/lib/materials/sxp/popup/CommodityDetail/index.js +1 -1
  34. package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +1 -1
  35. package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +2 -3
  36. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
  37. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +1 -1
  38. package/lib/materials/sxp/template/Commodity/index.js +1 -1
  39. package/lib/materials/sxp/template/CommodityDiro/index.js +1 -1
  40. package/lib/materials/sxp/template/CommodityDiroNew/index.js +1 -1
  41. package/lib/materials/sxp/template/MultiCommodity/index.js +1 -1
  42. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +1 -1
  43. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +1 -1
  44. package/lib/materials/sxp/template/components/settingRender.js +1 -1
  45. package/package.json +3 -1
package/dist/index.cjs CHANGED
@@ -9,6 +9,7 @@ var React = require('react');
9
9
  var qs = require('qs');
10
10
  var EventEmitter = require('eventemitter3');
11
11
  var css = require('@emotion/css');
12
+ var proComponents = require('@ant-design/pro-components');
12
13
  var ReactDOM = require('react-dom');
13
14
 
14
15
  function _interopNamespaceDefault(e) {
@@ -972,7 +973,7 @@ var defaultSetting = {
972
973
  * @Author: binruan@chatlabs.com
973
974
  * @Date: 2023-07-28 18:29:57
974
975
  * @LastEditors: binruan@chatlabs.com
975
- * @LastEditTime: 2024-05-17 10:11:41
976
+ * @LastEditTime: 2024-05-27 11:48:04
976
977
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\AppointForm\settingRender.tsx
977
978
  *
978
979
  */
@@ -1077,11 +1078,6 @@ var settingRender$5 = [
1077
1078
  type: 'TextAlign',
1078
1079
  name: ['props', 'submitButtonStyle']
1079
1080
  },
1080
- {
1081
- label: '提交文本颜色',
1082
- type: 'Color',
1083
- name: ['props', 'submitColor']
1084
- },
1085
1081
  {
1086
1082
  label: '提交按钮颜色',
1087
1083
  type: 'Color',
@@ -1228,7 +1224,7 @@ const AppointForm$1 = (_a) => {
1228
1224
  key: '4'
1229
1225
  }
1230
1226
  ], []);
1231
- React.useMemo(() => {
1227
+ const columnsData = React.useMemo(() => {
1232
1228
  if (layoutType === undefined) {
1233
1229
  const list = lodash.cloneDeep(columns) || defaultColumns;
1234
1230
  return list === null || list === void 0 ? void 0 : list.map((obj) => (Object.assign(Object.assign({}, obj), { title: undefined, fieldProps: { placeholder: obj === null || obj === void 0 ? void 0 : obj.title } })));
@@ -1271,7 +1267,8 @@ const AppointForm$1 = (_a) => {
1271
1267
  return (React.createElement("div", { className: 'pb-appoint-form' },
1272
1268
  React.createElement("div", { className: `pb-appoint-form-title ${css.css(Object.assign({}, textStyle))}` }, title),
1273
1269
  React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
1274
- React.createElement("div", { className: 'pb-appoint-form-container' })),
1270
+ React.createElement("div", { className: 'pb-appoint-form-container' },
1271
+ React.createElement(proComponents.BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
1275
1272
  React.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
1276
1273
  React.createElement("button", { onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? React.createElement(React.Fragment, null, "loading...") : submitText))));
1277
1274
  };
@@ -1353,7 +1350,7 @@ var settingRender$4 = [
1353
1350
  label: '居中垂直偏移',
1354
1351
  type: 'Number',
1355
1352
  name: ['props', 'swiper', 'translateY'],
1356
- min: -100,
1353
+ min: -1000,
1357
1354
  addonAfter: '%',
1358
1355
  initialValue: 0
1359
1356
  }
@@ -8446,21 +8443,26 @@ var ExpandableText$1 = React.memo(ExpandableText);
8446
8443
  * @Author: binruan@chatlabs.com
8447
8444
  * @Date: 2024-03-20 10:27:31
8448
8445
  * @LastEditors: binruan@chatlabs.com
8449
- * @LastEditTime: 2024-05-20 15:53:04
8446
+ * @LastEditTime: 2024-05-27 09:47:19
8450
8447
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
8451
8448
  *
8452
8449
  */
8453
8450
  const FormatImage = React.forwardRef((props, ref) => {
8454
8451
  const { src, onLoad, style, className, loading } = props;
8455
8452
  const [imgSrc, setImgSrc] = React.useState();
8453
+ const { swiperRef } = useSxpDataSource();
8456
8454
  React.useImperativeHandle(ref, () => ({
8457
8455
  setSrc: (v) => {
8458
8456
  setImgSrc(v);
8459
8457
  }
8460
8458
  }));
8461
8459
  React.useEffect(() => {
8462
- setImgSrc(src);
8463
- }, [src]);
8460
+ var _a, _b;
8461
+ // 首屏不加载第二屏之后的图片
8462
+ const index = (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.activeIndex;
8463
+ if (index === 0 || index > 0)
8464
+ setImgSrc(src);
8465
+ }, [src, swiperRef]);
8464
8466
  React.useRef(null);
8465
8467
  // useEffect(() => {
8466
8468
  // let observer: any = null;
@@ -8586,7 +8588,7 @@ const CommodityDetail$1 = (_a) => {
8586
8588
  width: '100%',
8587
8589
  objectFit: 'cover',
8588
8590
  display: 'block',
8589
- transform: `translateY(${swiper === null || swiper === void 0 ? void 0 : swiper.translateY})%`
8591
+ objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? -(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
8590
8592
  }, src: src }))));
8591
8593
  }))),
8592
8594
  !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
@@ -8840,7 +8842,7 @@ var _a$2, _b$2;
8840
8842
  * @Author: binruan@chatlabs.com
8841
8843
  * @Date: 2024-03-26 16:50:25
8842
8844
  * @LastEditors: binruan@chatlabs.com
8843
- * @LastEditTime: 2024-04-12 17:37:19
8845
+ * @LastEditTime: 2024-05-27 17:31:27
8844
8846
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\settingRender.tsx
8845
8847
  *
8846
8848
  */
@@ -8875,7 +8877,7 @@ var settingRender$2 = [
8875
8877
  label: '居中垂直偏移',
8876
8878
  type: 'Number',
8877
8879
  name: ['props', 'swiper', 'translateY'],
8878
- min: -100,
8880
+ min: -1000,
8879
8881
  addonAfter: '%',
8880
8882
  initialValue: 0
8881
8883
  }
@@ -9116,7 +9118,7 @@ Made in Italy` })));
9116
9118
  width: '100%',
9117
9119
  objectFit: 'cover',
9118
9120
  display: 'block',
9119
- transform: `translateY(${swiper === null || swiper === void 0 ? void 0 : swiper.translateY})%`
9121
+ objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? -(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
9120
9122
  }, src: src }))));
9121
9123
  }))),
9122
9124
  !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
@@ -9324,7 +9326,7 @@ var settingRender$1 = [
9324
9326
  label: '居中垂直偏移',
9325
9327
  type: 'Number',
9326
9328
  name: ['props', 'translateY'],
9327
- min: -100,
9329
+ min: -1000,
9328
9330
  addonAfter: '%',
9329
9331
  initialValue: 0
9330
9332
  }
@@ -9543,7 +9545,7 @@ const Commodity$1 = (_a) => {
9543
9545
  objectFit: 'cover',
9544
9546
  height: '100%',
9545
9547
  display: 'block',
9546
- transform: `translateY(${translateY}%)`
9548
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
9547
9549
  }), src: src })),
9548
9550
  React.createElement("div", { className: css.css({
9549
9551
  color: '#fff',
@@ -9792,7 +9794,7 @@ const CommodityDiro$1 = (_a) => {
9792
9794
  objectFit: 'cover',
9793
9795
  height: '100%',
9794
9796
  display: 'block',
9795
- transform: `translateY(${translateY}%)`
9797
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
9796
9798
  }), src: src })),
9797
9799
  React.createElement("div", { className: css.css({
9798
9800
  color: '#fff',
@@ -9890,7 +9892,7 @@ const CommodityDiroNew$1 = (_a) => {
9890
9892
  objectFit: 'cover',
9891
9893
  height: '100%',
9892
9894
  display: 'block',
9893
- transform: `translateY(${translateY}%)`
9895
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
9894
9896
  }), src: src })),
9895
9897
  React.createElement("div", { className: css.css({
9896
9898
  color: '#fff',
@@ -10034,7 +10036,7 @@ const MultiCommodityDiro$1 = (_a) => {
10034
10036
  return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
10035
10037
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
10036
10038
  React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, style: {
10037
- transform: `translateY(${translateY}%)`
10039
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
10038
10040
  } })),
10039
10041
  React.createElement("div", { className: css.css({
10040
10042
  color: '#000',
@@ -10149,7 +10151,7 @@ const MultiCommodity$1 = (_a) => {
10149
10151
  return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
10150
10152
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
10151
10153
  React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, style: {
10152
- transform: `translateY(${translateY}%)`
10154
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
10153
10155
  } })),
10154
10156
  React.createElement("div", { className: css.css({
10155
10157
  color: '#fff',
@@ -10263,7 +10265,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
10263
10265
  return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
10264
10266
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
10265
10267
  React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, style: {
10266
- transform: `translateY(${translateY}%)`
10268
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
10267
10269
  } })),
10268
10270
  React.createElement("div", { className: css.css({
10269
10271
  color: '#fff',
@@ -13799,7 +13801,7 @@ var index$1 = React.memo(DiyPortalPreview);
13799
13801
  * @Author: binruan@chatlabs.com
13800
13802
  * @Date: 2023-10-31 10:56:01
13801
13803
  * @LastEditors: binruan@chatlabs.com
13802
- * @LastEditTime: 2024-05-14 10:12:52
13804
+ * @LastEditTime: 2024-05-27 18:19:31
13803
13805
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
13804
13806
  *
13805
13807
  */
@@ -13845,14 +13847,14 @@ const Popup = () => {
13845
13847
  const renderPopupDetail = React.useMemo(() => {
13846
13848
  var _a, _b, _c;
13847
13849
  return (_c = (_b = (_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.popupList) === null || _c === void 0 ? void 0 : _c.map((value, index) => {
13848
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
13850
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
13849
13851
  if ((value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id)) {
13850
13852
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
13851
13853
  const Component = withBindDataSource(t);
13852
13854
  const isExternalLink = ((_d = (_c = (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
13853
13855
  const isPopup = ((_g = (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.event) === null || _f === void 0 ? void 0 : _f.onClick) === null || _g === void 0 ? void 0 : _g.linkType) === 'popup';
13854
13856
  const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
13855
- return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: '100%', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.textStyle), bindDatas: (_m = (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.bindDatas) !== null && _m !== void 0 ? _m : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_o = value === null || value === void 0 ? void 0 : value.item) === null || _o === void 0 ? void 0 : _o.props, { event: ((_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
13857
+ return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
13856
13858
  }
13857
13859
  else {
13858
13860
  return React.createElement(React.Fragment, null);