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/pb-ui.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('eventemitter3'), require('@emotion/css'), require('react-dom')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', 'eventemitter3', '@emotion/css', 'react-dom'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.EventEmitter, global.css, global.ReactDOM));
5
- })(this, (function (exports, lodash, uuid$1, pako, React, qs, EventEmitter, css, ReactDOM) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('eventemitter3'), require('@emotion/css'), require('@ant-design/pro-components'), require('react-dom')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', 'eventemitter3', '@emotion/css', '@ant-design/pro-components', 'react-dom'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.EventEmitter, global.css, global.proComponents, global.ReactDOM));
5
+ })(this, (function (exports, lodash, uuid$1, pako, React, qs, EventEmitter, css, proComponents, ReactDOM) { 'use strict';
6
6
 
7
7
  function _interopNamespaceDefault(e) {
8
8
  var n = Object.create(null);
@@ -965,7 +965,7 @@
965
965
  * @Author: binruan@chatlabs.com
966
966
  * @Date: 2023-07-28 18:29:57
967
967
  * @LastEditors: binruan@chatlabs.com
968
- * @LastEditTime: 2024-05-17 10:11:41
968
+ * @LastEditTime: 2024-05-27 11:48:04
969
969
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\AppointForm\settingRender.tsx
970
970
  *
971
971
  */
@@ -1070,11 +1070,6 @@
1070
1070
  type: 'TextAlign',
1071
1071
  name: ['props', 'submitButtonStyle']
1072
1072
  },
1073
- {
1074
- label: '提交文本颜色',
1075
- type: 'Color',
1076
- name: ['props', 'submitColor']
1077
- },
1078
1073
  {
1079
1074
  label: '提交按钮颜色',
1080
1075
  type: 'Color',
@@ -1221,7 +1216,7 @@
1221
1216
  key: '4'
1222
1217
  }
1223
1218
  ], []);
1224
- React.useMemo(() => {
1219
+ const columnsData = React.useMemo(() => {
1225
1220
  if (layoutType === undefined) {
1226
1221
  const list = lodash.cloneDeep(columns) || defaultColumns;
1227
1222
  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 } })));
@@ -1264,7 +1259,8 @@
1264
1259
  return (React.createElement("div", { className: 'pb-appoint-form' },
1265
1260
  React.createElement("div", { className: `pb-appoint-form-title ${css.css(Object.assign({}, textStyle))}` }, title),
1266
1261
  React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
1267
- React.createElement("div", { className: 'pb-appoint-form-container' })),
1262
+ React.createElement("div", { className: 'pb-appoint-form-container' },
1263
+ React.createElement(proComponents.BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
1268
1264
  React.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
1269
1265
  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))));
1270
1266
  };
@@ -1346,7 +1342,7 @@
1346
1342
  label: '居中垂直偏移',
1347
1343
  type: 'Number',
1348
1344
  name: ['props', 'swiper', 'translateY'],
1349
- min: -100,
1345
+ min: -1000,
1350
1346
  addonAfter: '%',
1351
1347
  initialValue: 0
1352
1348
  }
@@ -8439,21 +8435,26 @@
8439
8435
  * @Author: binruan@chatlabs.com
8440
8436
  * @Date: 2024-03-20 10:27:31
8441
8437
  * @LastEditors: binruan@chatlabs.com
8442
- * @LastEditTime: 2024-05-20 15:53:04
8438
+ * @LastEditTime: 2024-05-27 09:47:19
8443
8439
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
8444
8440
  *
8445
8441
  */
8446
8442
  const FormatImage = React.forwardRef((props, ref) => {
8447
8443
  const { src, onLoad, style, className, loading } = props;
8448
8444
  const [imgSrc, setImgSrc] = React.useState();
8445
+ const { swiperRef } = useSxpDataSource();
8449
8446
  React.useImperativeHandle(ref, () => ({
8450
8447
  setSrc: (v) => {
8451
8448
  setImgSrc(v);
8452
8449
  }
8453
8450
  }));
8454
8451
  React.useEffect(() => {
8455
- setImgSrc(src);
8456
- }, [src]);
8452
+ var _a, _b;
8453
+ // 首屏不加载第二屏之后的图片
8454
+ 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;
8455
+ if (index === 0 || index > 0)
8456
+ setImgSrc(src);
8457
+ }, [src, swiperRef]);
8457
8458
  React.useRef(null);
8458
8459
  // useEffect(() => {
8459
8460
  // let observer: any = null;
@@ -8579,7 +8580,7 @@
8579
8580
  width: '100%',
8580
8581
  objectFit: 'cover',
8581
8582
  display: 'block',
8582
- transform: `translateY(${swiper === null || swiper === void 0 ? void 0 : swiper.translateY})%`
8583
+ objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? -(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
8583
8584
  }, src: src }))));
8584
8585
  }))),
8585
8586
  !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
@@ -8833,7 +8834,7 @@
8833
8834
  * @Author: binruan@chatlabs.com
8834
8835
  * @Date: 2024-03-26 16:50:25
8835
8836
  * @LastEditors: binruan@chatlabs.com
8836
- * @LastEditTime: 2024-04-12 17:37:19
8837
+ * @LastEditTime: 2024-05-27 17:31:27
8837
8838
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\settingRender.tsx
8838
8839
  *
8839
8840
  */
@@ -8868,7 +8869,7 @@
8868
8869
  label: '居中垂直偏移',
8869
8870
  type: 'Number',
8870
8871
  name: ['props', 'swiper', 'translateY'],
8871
- min: -100,
8872
+ min: -1000,
8872
8873
  addonAfter: '%',
8873
8874
  initialValue: 0
8874
8875
  }
@@ -9109,7 +9110,7 @@ Made in Italy` })));
9109
9110
  width: '100%',
9110
9111
  objectFit: 'cover',
9111
9112
  display: 'block',
9112
- transform: `translateY(${swiper === null || swiper === void 0 ? void 0 : swiper.translateY})%`
9113
+ objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? -(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
9113
9114
  }, src: src }))));
9114
9115
  }))),
9115
9116
  !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
@@ -9317,7 +9318,7 @@ Made in Italy` })));
9317
9318
  label: '居中垂直偏移',
9318
9319
  type: 'Number',
9319
9320
  name: ['props', 'translateY'],
9320
- min: -100,
9321
+ min: -1000,
9321
9322
  addonAfter: '%',
9322
9323
  initialValue: 0
9323
9324
  }
@@ -9536,7 +9537,7 @@ Made in Italy` })));
9536
9537
  objectFit: 'cover',
9537
9538
  height: '100%',
9538
9539
  display: 'block',
9539
- transform: `translateY(${translateY}%)`
9540
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
9540
9541
  }), src: src })),
9541
9542
  React.createElement("div", { className: css.css({
9542
9543
  color: '#fff',
@@ -9785,7 +9786,7 @@ Made in Italy` })));
9785
9786
  objectFit: 'cover',
9786
9787
  height: '100%',
9787
9788
  display: 'block',
9788
- transform: `translateY(${translateY}%)`
9789
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
9789
9790
  }), src: src })),
9790
9791
  React.createElement("div", { className: css.css({
9791
9792
  color: '#fff',
@@ -9883,7 +9884,7 @@ Made in Italy` })));
9883
9884
  objectFit: 'cover',
9884
9885
  height: '100%',
9885
9886
  display: 'block',
9886
- transform: `translateY(${translateY}%)`
9887
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
9887
9888
  }), src: src })),
9888
9889
  React.createElement("div", { className: css.css({
9889
9890
  color: '#fff',
@@ -10027,7 +10028,7 @@ Made in Italy` })));
10027
10028
  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) }),
10028
10029
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
10029
10030
  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: {
10030
- transform: `translateY(${translateY}%)`
10031
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
10031
10032
  } })),
10032
10033
  React.createElement("div", { className: css.css({
10033
10034
  color: '#000',
@@ -10142,7 +10143,7 @@ Made in Italy` })));
10142
10143
  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) }),
10143
10144
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
10144
10145
  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: {
10145
- transform: `translateY(${translateY}%)`
10146
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
10146
10147
  } })),
10147
10148
  React.createElement("div", { className: css.css({
10148
10149
  color: '#fff',
@@ -10256,7 +10257,7 @@ Made in Italy` })));
10256
10257
  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) }),
10257
10258
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
10258
10259
  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: {
10259
- transform: `translateY(${translateY}%)`
10260
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
10260
10261
  } })),
10261
10262
  React.createElement("div", { className: css.css({
10262
10263
  color: '#fff',
@@ -13792,7 +13793,7 @@ Made in Italy` })));
13792
13793
  * @Author: binruan@chatlabs.com
13793
13794
  * @Date: 2023-10-31 10:56:01
13794
13795
  * @LastEditors: binruan@chatlabs.com
13795
- * @LastEditTime: 2024-05-14 10:12:52
13796
+ * @LastEditTime: 2024-05-27 18:19:31
13796
13797
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
13797
13798
  *
13798
13799
  */
@@ -13838,14 +13839,14 @@ Made in Italy` })));
13838
13839
  const renderPopupDetail = React.useMemo(() => {
13839
13840
  var _a, _b, _c;
13840
13841
  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) => {
13841
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
13842
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
13842
13843
  if ((value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id)) {
13843
13844
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
13844
13845
  const Component = withBindDataSource(t);
13845
13846
  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';
13846
13847
  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';
13847
13848
  const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
13848
- 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 })));
13849
+ 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 })));
13849
13850
  }
13850
13851
  else {
13851
13852
  return React.createElement(React.Fragment, null);