tplus-components-touch 3.26.25 → 3.26.30

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.
@@ -8,6 +8,15 @@
8
8
  height: 376px !important;
9
9
  padding: 0;
10
10
  }
11
+ .showUseCard {
12
+ font-family: 'PingFangSC-Regular';
13
+ font-size: 14px;
14
+ color: #666666;
15
+ letter-spacing: 0;
16
+ line-height: 30px;
17
+ font-weight: 400;
18
+ float: left;
19
+ }
11
20
  }
12
21
  }
13
22
  .asyncModal{
@@ -131,7 +131,8 @@ var TouchScroll = (_temp = _class = function (_Component) {
131
131
  { className: 'swiper-slide' },
132
132
  children
133
133
  )
134
- )
134
+ ),
135
+ _react2.default.createElement('div', { className: 'swiper-scrollbar' })
135
136
  );
136
137
  }
137
138
  }]);
@@ -168,7 +169,10 @@ var TouchScroll = (_temp = _class = function (_Component) {
168
169
  if (height < 10 || width < 10) return;
169
170
  (parentElement.style || {}).overflow = 'hidden';
170
171
 
171
- var onScrollProgress = scrollProgress ? { watchSlidesProgress: true, on: { progress: scrollProgress } } : {};
172
+ var onScrollProgress = scrollProgress ? { mousewheel: true, scrollbar: {
173
+ el: '.swiper-scrollbar',
174
+ hide: true
175
+ }, watchSlidesProgress: true, on: { progress: scrollProgress } } : {};
172
176
  _this3.touchScroll = new _swiper2.default(_this3.container, (0, _extends3.default)({
173
177
  height: height,
174
178
  width: width,
@@ -1 +1 @@
1
- {"version":3,"sources":["tplus-components-touch/components/touchScroll/index.js"],"names":["envIsElectron","env","platform","TouchScroll","props","isElectron","width","height","createScroll","touchScroll","update","destroy","undefined","children","className","container","ref","Component","propTypes","PropTypes","bool","string","number","direction","scrollProgress","func","parentElement","clientHeight","clientWidth","parseInt","style","overflow","onScrollProgress","watchSlidesProgress","on","progress","Swiper","slidesPerView","freeMode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAAA;;;;;;;;;;;;AAUA;;;;AACA;;;;AACA;;;;AACA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;AAGjBiB,iBAAWA,aAAa,UAHP;AAIjBc,qBAAe,MAJE;AAKjBC,gBAAU;AALO,OAMdN,gBANc,EAAnB;AAQD,G;;kBAtEkB7B,W","file":"index.js","sourcesContent":["/**\n * Created by hzy on 2019/7/30.\n *\n * @className className\n * @isElectron 设置为isElectron环境\n * @height 滚动区高度\n * @width 滚动区宽度\n * @direction horizontal or undefined\n * @scrollProgress 滚动进度\n */\nimport React, { Component } from 'react';\nimport PropTypes, {oneOfType} from 'prop-types';\nimport Swiper from 'swiper/dist/js/swiper.js';\nimport {env} from 'mutants-microfx';\nimport 'swiper/dist/css/swiper.min.css';\n\nconst envIsElectron = env.platform === 'electron';\n\nexport default class TouchScroll extends Component {\n static propTypes = {\n isElectron: PropTypes.bool,\n height: oneOfType([\n PropTypes.string,\n PropTypes.number\n ]),\n width: oneOfType([\n PropTypes.string,\n PropTypes.number\n ]),\n direction: PropTypes.string,\n scrollProgress: PropTypes.func,\n };\n constructor(props){\n super(props);\n const {isElectron, width, height} = this.props;\n this.isElectron = isElectron || envIsElectron;\n }\n\n componentDidMount() {\n if (!this.isElectron) return;\n\n this.createScroll();\n }\n\n componentDidUpdate() {\n if (!this.isElectron) return;\n\n if (this.touchScroll) {\n this.touchScroll.update();\n } else {\n this.createScroll();\n }\n }\n\n componentWillUnmount() {\n if (!this.isElectron) return;\n\n this.touchScroll && this.touchScroll.destroy(false);\n this.touchScroll = undefined;\n }\n\n createScroll = () => {\n let {height, width, direction, scrollProgress} = this.props;\n const parentElement = this.container.parentElement || {};\n const clientHeight = parentElement.clientHeight;\n const clientWidth = parentElement.clientWidth;\n\n if (typeof height !== 'undefined' || typeof width !== 'undefined') {\n height = typeof height === 'string' ? parseInt(height) : height;\n width = typeof width === 'string' ? parseInt(width) : width;\n } else if (!direction && clientHeight) {\n height = clientHeight;\n } else if (direction && clientWidth) {\n width = clientWidth;\n }\n\n if (height < 10 || width < 10) return;\n (parentElement.style || {}).overflow = 'hidden';\n\n const onScrollProgress = scrollProgress ? {watchSlidesProgress : true, on: {progress: scrollProgress}} : {};\n this.touchScroll = new Swiper(this.container, {\n height,\n width,\n direction: direction || 'vertical',\n slidesPerView: 'auto',\n freeMode: true,\n ...onScrollProgress\n });\n }\n\n render() {\n const {children, className = ''} = this.props;\n if (!this.isElectron) return children;\n\n return (<div className={className} ref={ref => this.container = ref}>\n <div className=\"swiper-wrapper\">\n <div className=\"swiper-slide\">{children}</div>\n </div>\n </div>);\n }\n}\n"]}
1
+ {"version":3,"sources":["tplus-components-touch/components/touchScroll/index.js"],"names":["envIsElectron","env","platform","TouchScroll","props","isElectron","width","height","createScroll","touchScroll","update","destroy","undefined","children","className","container","ref","Component","propTypes","PropTypes","bool","string","number","direction","scrollProgress","func","parentElement","clientHeight","clientWidth","parseInt","style","overflow","onScrollProgress","mousewheel","scrollbar","el","hide","watchSlidesProgress","on","progress","Swiper","slidesPerView","freeMode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAAA;;;;;;;;;;;;AAUA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AAEA,IAAMA,gBAAgBC,oBAAIC,QAAJ,KAAiB,UAAvC;;IAEqBC,W;;;AAcnB,uBAAYC,KAAZ,EAAkB;AAAA;;AAAA,gJACVA,KADU;;AAAA;;AAAA,sBAEoB,MAAKA,KAFzB;AAAA,QAETC,UAFS,eAETA,UAFS;AAAA,QAEGC,KAFH,eAEGA,KAFH;AAAA,QAEUC,MAFV,eAEUA,MAFV;;AAGhB,UAAKF,UAAL,GAAkBA,cAAcL,aAAhC;AAHgB;AAIjB;;;;wCAEmB;AAClB,UAAI,CAAC,KAAKK,UAAV,EAAsB;;AAEtB,WAAKG,YAAL;AACD;;;yCAEoB;AACnB,UAAI,CAAC,KAAKH,UAAV,EAAsB;;AAEtB,UAAI,KAAKI,WAAT,EAAsB;AACpB,aAAKA,WAAL,CAAiBC,MAAjB;AACD,OAFD,MAEO;AACL,aAAKF,YAAL;AACD;AACF;;;2CAEsB;A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AAiB,WAAtD,EAAmE;AACjEC,eAAS,OAAOA,MAAP,KAAkB,QAAlB,GAA6BsB,SAAStB,MAAT,CAA7B,GAAgDA,MAAzD;AACAD,cAAQ,OAAOA,KAAP,KAAiB,QAAjB,GAA4BuB,SAASvB,KAAT,CAA5B,GAA8CA,KAAtD;AACD,KAHD,MAGO,IAAI,CAACiB,SAAD,IAAcI,YAAlB,EAAgC;AACrCpB,eAASoB,YAAT;AACD,KAFM,MAEA,IAAIJ,aAAaK,WAAjB,EAA8B;AACnCtB,cAAQsB,WAAR;AACD;;AAED,QAAIrB,SAAS,EAAT,IAAeD,QAAQ,EAA3B,EAA+B;AAC/B,KAACoB,cAAcI,KAAd,IAAuB,EAAxB,EAA4BC,QAA5B,GAAuC,QAAvC;;AAEA,QAAMC,mBAAmBR,iBAAiB,EAACS,YAAY,IAAb,EAAmBC,WAAW;AACtEC,YAAI,mBADkE;AAEtEC,cAAM;AAFgE,OAA9B,EAGvCC,qBAAsB,IAHiB,EAGXC,IAAI,EAACC,UAAUf,cAAX,EAHO,EAAjB,GAGwC,EAHjE;AAIA,WAAKf,WAAL,GAAmB,IAAI+B,gBAAJ,CAAW,OAAKzB,SAAhB;AACjBR,oBADiB;AAEjBD,kBAFiB;AAGjBiB,iBAAWA,aAAa,UAHP;AAIjBkB,qBAAe,MAJE;AAKjBC,gBAAU;AALO,OAMdV,gBANc,EAAnB;AAQD,G;;kBAzEkB7B,W","file":"index.js","sourcesContent":["/**\n * Created by hzy on 2019/7/30.\n *\n * @className className\n * @isElectron 设置为isElectron环境\n * @height 滚动区高度\n * @width 滚动区宽度\n * @direction horizontal or undefined\n * @scrollProgress 滚动进度\n */\nimport React, { Component } from 'react';\nimport PropTypes, {oneOfType} from 'prop-types';\nimport Swiper from 'swiper/dist/js/swiper.js';\nimport {env} from 'mutants-microfx';\nimport 'swiper/dist/css/swiper.min.css';\n\nconst envIsElectron = env.platform === 'electron';\n\nexport default class TouchScroll extends Component {\n static propTypes = {\n isElectron: PropTypes.bool,\n height: oneOfType([\n PropTypes.string,\n PropTypes.number\n ]),\n width: oneOfType([\n PropTypes.string,\n PropTypes.number\n ]),\n direction: PropTypes.string,\n scrollProgress: PropTypes.func,\n };\n constructor(props){\n super(props);\n const {isElectron, width, height} = this.props;\n this.isElectron = isElectron || envIsElectron;\n }\n\n componentDidMount() {\n if (!this.isElectron) return;\n\n this.createScroll();\n }\n\n componentDidUpdate() {\n if (!this.isElectron) return;\n\n if (this.touchScroll) {\n this.touchScroll.update();\n } else {\n this.createScroll();\n }\n }\n\n componentWillUnmount() {\n if (!this.isElectron) return;\n\n this.touchScroll && this.touchScroll.destroy(false);\n this.touchScroll = undefined;\n }\n\n createScroll = () => {\n let {height, width, direction, scrollProgress} = this.props;\n const parentElement = this.container.parentElement || {};\n const clientHeight = parentElement.clientHeight;\n const clientWidth = parentElement.clientWidth;\n\n if (typeof height !== 'undefined' || typeof width !== 'undefined') {\n height = typeof height === 'string' ? parseInt(height) : height;\n width = typeof width === 'string' ? parseInt(width) : width;\n } else if (!direction && clientHeight) {\n height = clientHeight;\n } else if (direction && clientWidth) {\n width = clientWidth;\n }\n\n if (height < 10 || width < 10) return;\n (parentElement.style || {}).overflow = 'hidden';\n\n const onScrollProgress = scrollProgress ? {mousewheel: true, scrollbar: {\n el: '.swiper-scrollbar',\n hide: true,\n }, watchSlidesProgress : true, on: {progress: scrollProgress}} : {};\n this.touchScroll = new Swiper(this.container, {\n height,\n width,\n direction: direction || 'vertical',\n slidesPerView: 'auto',\n freeMode: true,\n ...onScrollProgress\n });\n }\n\n render() {\n const {children, className = ''} = this.props;\n if (!this.isElectron) return children;\n\n return (<div className={className} ref={ref => this.container = ref}>\n <div className=\"swiper-wrapper\">\n <div className=\"swiper-slide\">{children}</div>\n </div>\n <div className=\"swiper-scrollbar\" />\n </div>);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tplus-components-touch",
3
- "version": "3.26.25",
3
+ "version": "3.26.30",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {