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.js CHANGED
@@ -5,6 +5,7 @@ import React, { useContext, useMemo, createContext, memo, useState, useRef, useE
5
5
  import qs from 'qs';
6
6
  import EventEmitter from 'eventemitter3';
7
7
  import { css } from '@emotion/css';
8
+ import { BetaSchemaForm } from '@ant-design/pro-components';
8
9
  import * as ReactDOM from 'react-dom';
9
10
 
10
11
  /******************************************************************************
@@ -949,7 +950,7 @@ var defaultSetting = {
949
950
  * @Author: binruan@chatlabs.com
950
951
  * @Date: 2023-07-28 18:29:57
951
952
  * @LastEditors: binruan@chatlabs.com
952
- * @LastEditTime: 2024-05-17 10:11:41
953
+ * @LastEditTime: 2024-05-27 11:48:04
953
954
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\AppointForm\settingRender.tsx
954
955
  *
955
956
  */
@@ -1054,11 +1055,6 @@ var settingRender$5 = [
1054
1055
  type: 'TextAlign',
1055
1056
  name: ['props', 'submitButtonStyle']
1056
1057
  },
1057
- {
1058
- label: '提交文本颜色',
1059
- type: 'Color',
1060
- name: ['props', 'submitColor']
1061
- },
1062
1058
  {
1063
1059
  label: '提交按钮颜色',
1064
1060
  type: 'Color',
@@ -1205,7 +1201,7 @@ const AppointForm$1 = (_a) => {
1205
1201
  key: '4'
1206
1202
  }
1207
1203
  ], []);
1208
- useMemo(() => {
1204
+ const columnsData = useMemo(() => {
1209
1205
  if (layoutType === undefined) {
1210
1206
  const list = cloneDeep(columns) || defaultColumns;
1211
1207
  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 } })));
@@ -1248,7 +1244,8 @@ const AppointForm$1 = (_a) => {
1248
1244
  return (React.createElement("div", { className: 'pb-appoint-form' },
1249
1245
  React.createElement("div", { className: `pb-appoint-form-title ${css(Object.assign({}, textStyle))}` }, title),
1250
1246
  React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
1251
- React.createElement("div", { className: 'pb-appoint-form-container' })),
1247
+ React.createElement("div", { className: 'pb-appoint-form-container' },
1248
+ React.createElement(BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
1252
1249
  React.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
1253
1250
  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))));
1254
1251
  };
@@ -1330,7 +1327,7 @@ var settingRender$4 = [
1330
1327
  label: '居中垂直偏移',
1331
1328
  type: 'Number',
1332
1329
  name: ['props', 'swiper', 'translateY'],
1333
- min: -100,
1330
+ min: -1000,
1334
1331
  addonAfter: '%',
1335
1332
  initialValue: 0
1336
1333
  }
@@ -8423,21 +8420,26 @@ var ExpandableText$1 = memo(ExpandableText);
8423
8420
  * @Author: binruan@chatlabs.com
8424
8421
  * @Date: 2024-03-20 10:27:31
8425
8422
  * @LastEditors: binruan@chatlabs.com
8426
- * @LastEditTime: 2024-05-20 15:53:04
8423
+ * @LastEditTime: 2024-05-27 09:47:19
8427
8424
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
8428
8425
  *
8429
8426
  */
8430
8427
  const FormatImage = forwardRef((props, ref) => {
8431
8428
  const { src, onLoad, style, className, loading } = props;
8432
8429
  const [imgSrc, setImgSrc] = useState();
8430
+ const { swiperRef } = useSxpDataSource();
8433
8431
  useImperativeHandle(ref, () => ({
8434
8432
  setSrc: (v) => {
8435
8433
  setImgSrc(v);
8436
8434
  }
8437
8435
  }));
8438
8436
  useEffect(() => {
8439
- setImgSrc(src);
8440
- }, [src]);
8437
+ var _a, _b;
8438
+ // 首屏不加载第二屏之后的图片
8439
+ 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;
8440
+ if (index === 0 || index > 0)
8441
+ setImgSrc(src);
8442
+ }, [src, swiperRef]);
8441
8443
  useRef(null);
8442
8444
  // useEffect(() => {
8443
8445
  // let observer: any = null;
@@ -8563,7 +8565,7 @@ const CommodityDetail$1 = (_a) => {
8563
8565
  width: '100%',
8564
8566
  objectFit: 'cover',
8565
8567
  display: 'block',
8566
- transform: `translateY(${swiper === null || swiper === void 0 ? void 0 : swiper.translateY})%`
8568
+ objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? -(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
8567
8569
  }, src: src }))));
8568
8570
  }))),
8569
8571
  !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
@@ -8817,7 +8819,7 @@ var _a$2, _b$2;
8817
8819
  * @Author: binruan@chatlabs.com
8818
8820
  * @Date: 2024-03-26 16:50:25
8819
8821
  * @LastEditors: binruan@chatlabs.com
8820
- * @LastEditTime: 2024-04-12 17:37:19
8822
+ * @LastEditTime: 2024-05-27 17:31:27
8821
8823
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\settingRender.tsx
8822
8824
  *
8823
8825
  */
@@ -8852,7 +8854,7 @@ var settingRender$2 = [
8852
8854
  label: '居中垂直偏移',
8853
8855
  type: 'Number',
8854
8856
  name: ['props', 'swiper', 'translateY'],
8855
- min: -100,
8857
+ min: -1000,
8856
8858
  addonAfter: '%',
8857
8859
  initialValue: 0
8858
8860
  }
@@ -9093,7 +9095,7 @@ Made in Italy` })));
9093
9095
  width: '100%',
9094
9096
  objectFit: 'cover',
9095
9097
  display: 'block',
9096
- transform: `translateY(${swiper === null || swiper === void 0 ? void 0 : swiper.translateY})%`
9098
+ objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? -(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
9097
9099
  }, src: src }))));
9098
9100
  }))),
9099
9101
  !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
@@ -9301,7 +9303,7 @@ var settingRender$1 = [
9301
9303
  label: '居中垂直偏移',
9302
9304
  type: 'Number',
9303
9305
  name: ['props', 'translateY'],
9304
- min: -100,
9306
+ min: -1000,
9305
9307
  addonAfter: '%',
9306
9308
  initialValue: 0
9307
9309
  }
@@ -9520,7 +9522,7 @@ const Commodity$1 = (_a) => {
9520
9522
  objectFit: 'cover',
9521
9523
  height: '100%',
9522
9524
  display: 'block',
9523
- transform: `translateY(${translateY}%)`
9525
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
9524
9526
  }), src: src })),
9525
9527
  React.createElement("div", { className: css({
9526
9528
  color: '#fff',
@@ -9769,7 +9771,7 @@ const CommodityDiro$1 = (_a) => {
9769
9771
  objectFit: 'cover',
9770
9772
  height: '100%',
9771
9773
  display: 'block',
9772
- transform: `translateY(${translateY}%)`
9774
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
9773
9775
  }), src: src })),
9774
9776
  React.createElement("div", { className: css({
9775
9777
  color: '#fff',
@@ -9867,7 +9869,7 @@ const CommodityDiroNew$1 = (_a) => {
9867
9869
  objectFit: 'cover',
9868
9870
  height: '100%',
9869
9871
  display: 'block',
9870
- transform: `translateY(${translateY}%)`
9872
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
9871
9873
  }), src: src })),
9872
9874
  React.createElement("div", { className: css({
9873
9875
  color: '#fff',
@@ -10011,7 +10013,7 @@ const MultiCommodityDiro$1 = (_a) => {
10011
10013
  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(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
10012
10014
  React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
10013
10015
  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: {
10014
- transform: `translateY(${translateY}%)`
10016
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
10015
10017
  } })),
10016
10018
  React.createElement("div", { className: css({
10017
10019
  color: '#000',
@@ -10126,7 +10128,7 @@ const MultiCommodity$1 = (_a) => {
10126
10128
  return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
10127
10129
  React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
10128
10130
  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: {
10129
- transform: `translateY(${translateY}%)`
10131
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
10130
10132
  } })),
10131
10133
  React.createElement("div", { className: css({
10132
10134
  color: '#fff',
@@ -10240,7 +10242,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
10240
10242
  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(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
10241
10243
  React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
10242
10244
  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: {
10243
- transform: `translateY(${translateY}%)`
10245
+ objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
10244
10246
  } })),
10245
10247
  React.createElement("div", { className: css({
10246
10248
  color: '#fff',
@@ -13776,7 +13778,7 @@ var index$1 = memo(DiyPortalPreview);
13776
13778
  * @Author: binruan@chatlabs.com
13777
13779
  * @Date: 2023-10-31 10:56:01
13778
13780
  * @LastEditors: binruan@chatlabs.com
13779
- * @LastEditTime: 2024-05-14 10:12:52
13781
+ * @LastEditTime: 2024-05-27 18:19:31
13780
13782
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
13781
13783
  *
13782
13784
  */
@@ -13822,14 +13824,14 @@ const Popup = () => {
13822
13824
  const renderPopupDetail = useMemo(() => {
13823
13825
  var _a, _b, _c;
13824
13826
  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) => {
13825
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
13827
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
13826
13828
  if ((value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id)) {
13827
13829
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
13828
13830
  const Component = withBindDataSource(t);
13829
13831
  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';
13830
13832
  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';
13831
13833
  const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
13832
- 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 })));
13834
+ 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 })));
13833
13835
  }
13834
13836
  else {
13835
13837
  return React.createElement(React.Fragment, null);