dolphin-weex-ui 0.3.5 → 0.3.8

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.
package/CHANGELOG.md CHANGED
@@ -1,14 +1,26 @@
1
1
  # 升级日志
2
2
 
3
+ ## 0.3.8
4
+ - [!] dof-actionsheet 新增props值,支持部分修改样式
5
+ - date: 2022/8/04
6
+ ## 0.3.7
7
+ - [!] dof-slider 修复在value值接近min值时,bar滑动距离不准确问题
8
+ - [!] dof-minibar 取消样式中的默认背景色,采用props中backgroundColor设置颜色
9
+ - date: 2022/7/20
10
+
11
+ ## 0.3.6
12
+ - [!] storage: setStorage return a promise instance
13
+ - date: 2022/6/27
14
+
3
15
  ## 0.3.5
4
16
  - [!] dof-cell fix keep middle content centered
5
- - [!] dof-bottom-bar fix paading-bottom
17
+ - [!] dof-bottom-bar fix padding-bottom
6
18
  - date: 2022/6/10
7
19
 
8
20
  ## 0.3.4
9
21
  - [!] dof-action-sheet fix action-bar duplicate padding-bottom
10
22
  - date: 2022/5/24
11
- ## 0.3.1
23
+ ## 0.3.3
12
24
  - [!] dof-bottom fix bottom-bar shadow incorrect
13
25
  - date: 2022/5/9
14
26
  ## 0.3.2
@@ -71,13 +83,13 @@
71
83
 
72
84
  ## 0.2.13
73
85
  - [!] dof-bottom-bar 修复_animation调用参数错误,导致监控上报
74
- - date: 2021/1/7
86
+ - date: 2021/12/7
75
87
  ## 0.2.12
76
88
  - [!] dof-tab-page 修复下划线不居中调整优化
77
- - date: 2021/1/7
89
+ - date: 2021/12/7
78
90
  ## 0.2.11
79
91
  - [!] dof-tab-page 修复下划线不居中
80
- - date: 2021/1/7
92
+ - date: 2021/12/7
81
93
 
82
94
  ## 0.2.10
83
95
  - [!] dof-actionsheet 添加title插槽
package/README.md CHANGED
@@ -4,12 +4,8 @@ A group of examples for using Weex and Vue.js.
4
4
 
5
5
  ## [在线文档](http://confluence.msmart.com/pages/viewpage.action?pageId=10003490)
6
6
 
7
- ##运行方法
7
+ ## 运行方法
8
8
 
9
9
  首先安装依赖: cnpm install 。然后
10
10
  + `npm run start`: 启动项目
11
11
  + `npm run dev`: 监听src目录下文件变化,并自动编译。
12
-
13
- ### 在线预览
14
-
15
- ### 本地调试
@@ -0,0 +1,12 @@
1
+
2
+ ## 在线预览
3
+ - 本地服务启动后,打开服务页面,如`http://xxx.xxx.xxx.xx:8999/`, 选择你需要访问的组件实例,如 `progress`, 则访问到 `http://xxx:8999/progress/?_wx_tpl=http%3A%2F%2Fxxxx%3A8999%2Fprogress%2Findex.native.js`
4
+ - 将上诉地址中的参数删除,如: `http://xxx:8999/progress/index.native.js`, 生成二维码
5
+ - 美居扫码访问,建议采用 `DolphinWeex 测试中转页` 扫码访问, 访问路径:美居 -> 设置 -> 关于美的美居 -> 测试使用 -> Dolphin weex 测试中转页
6
+ ## 本地调试
7
+ - 执行上述运行方法后,代码修改,会自动编译, 需要重新访问页面
8
+ - 在美居 `Dolphin weex 测试中转页` 中,代码修改后,需要返回到中转页,重新选择对应地址访问
9
+
10
+ tips:
11
+ 1. 需要访问某个组件例子,可以将 `/webpack.config.js` 中 `mkdir` 的值设置为对应的组件名,如`progress`
12
+ 2. 美居(ios) 可以通过: 打开性能监控组件 -> weex 专区 -> 日志 , 查看日志
@@ -6583,38 +6583,58 @@ var modal = weex.requireModule('modal');
6583
6583
  * @param value
6584
6584
  * @param duration Storage有效时间,单位:小时
6585
6585
  * @param set_time 是否设置时间
6586
- * @returns {boolean}
6586
+ * @returns promise
6587
6587
  */
6588
- var setStorage = function setStorage(key, value, callback) {
6589
- var set_time = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
6590
- var duration = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
6588
+ var setStorage = function setStorage(key, value) {
6589
+ var set_time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
6590
+ var duration = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
6591
6591
 
6592
- if (!key) return;
6593
- if (typeof value !== 'string') {
6594
- value = JSON.stringify(value);
6595
- }
6596
- try {
6597
- if (set_time) {
6598
- var date = new Date();
6599
- if (duration > 0) {
6600
- value += '&' + (date.getTime() + duration * 3600 * 1e3);
6601
- } else {
6602
- value += '&0';
6592
+ return new Promise(function (resolve, reject) {
6593
+ if (!key) {
6594
+ reject('key is empty !');
6595
+ return;
6596
+ }
6597
+ try {
6598
+ if (typeof value !== 'string') {
6599
+ value = JSON.stringify(value);
6603
6600
  }
6604
- value += '&' + date.getTime();
6601
+ if (set_time) {
6602
+ var date = new Date();
6603
+ if (duration > 0) {
6604
+ value += '&' + (date.getTime() + duration * 3600 * 1e3);
6605
+ } else {
6606
+ value += '&0';
6607
+ }
6608
+ value += '&' + date.getTime();
6609
+ }
6610
+ storage.setItem(key, value, function (event) {
6611
+ if (event.result === 'success') {
6612
+ // event.data 为undefined, 故返回完整的event
6613
+ resolve(event);
6614
+ } else {
6615
+ reject(event);
6616
+ }
6617
+ });
6618
+ } catch (error) {
6619
+ console.error(error);
6620
+ reject(error);
6605
6621
  }
6606
- storage.setItem(key, value, callback);
6607
- } catch (error) {
6608
- console.error(error);
6609
- reject(error);
6610
- }
6622
+ });
6611
6623
  };
6624
+ /**
6625
+ * 读取缓存
6626
+ * @param {string} key 缓存Key值
6627
+ * @param {boolean} parse 是否需要对缓存结果做解析
6628
+ * @returns promise
6629
+ */
6612
6630
  var getStorage = function getStorage(key) {
6613
6631
  var parse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6614
6632
 
6615
- if (!key) return false;
6616
- try {
6617
- return new Promise(function (resolve, reject) {
6633
+ return new Promise(function (resolve, reject) {
6634
+ if (!key) {
6635
+ reject('key is empty !');
6636
+ }
6637
+ try {
6618
6638
  storage.getItem(key, function (event) {
6619
6639
  if (event.result === 'success') {
6620
6640
  if (parse) {
@@ -6631,13 +6651,17 @@ var getStorage = function getStorage(key) {
6631
6651
  reject('key: "' + key + '" not found');
6632
6652
  }
6633
6653
  });
6634
- });
6635
- } catch (error) {
6636
- console.error(error);
6637
- reject(error);
6638
- }
6654
+ } catch (error) {
6655
+ reject(error);
6656
+ }
6657
+ });
6639
6658
  };
6640
6659
 
6660
+ /**
6661
+ * 删除指定缓存
6662
+ * @param {string} key 缓存key值
6663
+ * @returns promise
6664
+ */
6641
6665
  var removeStorage = function removeStorage(key) {
6642
6666
  return new Promise(function (resolve, reject) {
6643
6667
  try {
@@ -14222,7 +14246,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
14222
14246
  //
14223
14247
  //
14224
14248
  //
14225
- //
14226
14249
 
14227
14250
  var animation = weex.requireModule('animation');
14228
14251
  var platform = weex.config.env.platform;
@@ -14290,6 +14313,18 @@ module.exports = {
14290
14313
  default: function _default() {
14291
14314
  return [];
14292
14315
  }
14316
+ },
14317
+ titleStyle: {
14318
+ type: Object,
14319
+ default: function _default() {}
14320
+ },
14321
+ defaultBtnStyle: {
14322
+ type: Object,
14323
+ default: function _default() {}
14324
+ },
14325
+ itemStyle: {
14326
+ type: Object,
14327
+ default: function _default() {}
14293
14328
  }
14294
14329
  },
14295
14330
  data: function data() {
@@ -21884,7 +21919,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
21884
21919
  //
21885
21920
  //
21886
21921
  //
21887
- //
21888
21922
 
21889
21923
  var Navigator = weex.requireModule('navigator');
21890
21924
  var platform = weex.config.env.platform.toLowerCase();
@@ -29539,9 +29573,23 @@ exports.default = {
29539
29573
  return res;
29540
29574
  },
29541
29575
  barStyle: function barStyle() {
29542
- var width = (this.value - this.min) / this.scope * this.width;
29576
+ var percent = (this.value - this.min) / this.scope;
29577
+ // const width = ((this.value - this.min) / this.scope) * this.width
29578
+ // const widthCss = clamp(width+this.trackHeight, this.trackHeight, this.width)
29579
+
29580
+ // fix: 修复value带来的width小于this.trackHeight时,bar宽度不变
29581
+ var width = percent * this.width;
29582
+ var widthCss = this.trackHeight;
29583
+ if (percent < 0) {
29584
+ widthCss = this.trackHeight;
29585
+ } else if (percent > 1) {
29586
+ widthCss = this.width + this.trackHeight;
29587
+ } else {
29588
+ // 正常滑动
29589
+ widthCss = width + this.trackHeight;
29590
+ }
29543
29591
  var res = {
29544
- width: (0, _mathExtension.clamp)(width, this.trackHeight, this.width) + 'px',
29592
+ width: widthCss + 'px',
29545
29593
  borderRadius: this.trackHeight / 2 + 'px',
29546
29594
  height: this.trackHeight + 'px'
29547
29595
  };
@@ -29568,7 +29616,8 @@ exports.default = {
29568
29616
 
29569
29617
  (0, _dom.getBoundingClientRect)(this.$refs.track, function (res) {
29570
29618
  if (res.result) {
29571
- _this.width = res.size.width;
29619
+ // 实际可滑动长度(可变化范围)= bar宽度 - btn宽度
29620
+ _this.width = res.size.width - _this.trackHeight;
29572
29621
  }
29573
29622
  }, this.delay);
29574
29623
  },
@@ -35967,8 +36016,7 @@ module.exports = {
35967
36016
  "display": "inline-flex",
35968
36017
  "flexDirection": "row",
35969
36018
  "justifyContent": "space-between",
35970
- "alignItems": "stretch",
35971
- "backgroundColor": "#ffffff"
36019
+ "alignItems": "stretch"
35972
36020
  },
35973
36021
  "left": {
35974
36022
  "width": "160",
@@ -36455,7 +36503,8 @@ module.exports = {
36455
36503
  "position": "relative"
36456
36504
  },
36457
36505
  "dof-slider-bar": {
36458
- "position": "relative"
36506
+ "position": "relative",
36507
+ "overflow": "hidden"
36459
36508
  },
36460
36509
  "dof-slider-bar--brand": {
36461
36510
  "backgroundColor": "#267aff"
@@ -39776,13 +39825,15 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
39776
39825
  "click": function () {}
39777
39826
  }
39778
39827
  }, [_vm._t("title", [(_vm.title || _vm.$slots.title) ? _c('text', {
39779
- staticClass: ["title"]
39780
- }, [_vm._v("\n " + _vm._s(_vm.title) + "\n ")]) : _vm._e()]), _c('div', {
39828
+ staticClass: ["title"],
39829
+ style: _vm.titleStyle
39830
+ }, [_vm._v(_vm._s(_vm.title))]) : _vm._e()]), _c('div', {
39781
39831
  staticClass: ["midea-actionsheet-content"]
39782
39832
  }, _vm._l((_vm.items), function(item, index) {
39783
39833
  return _c('div', {
39784
39834
  key: index,
39785
39835
  class: [index == 0 && !_vm.title ? 'midea-actionsheet-list-first' : 'midea-actionsheet-list'],
39836
+ style: _vm.itemStyle,
39786
39837
  on: {
39787
39838
  "click": function($event) {
39788
39839
  _vm.actionsheetItemClick(item, index)
@@ -39798,6 +39849,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
39798
39849
  staticClass: ["midea-actionsheet-bottom"]
39799
39850
  }, [_c('text', {
39800
39851
  staticClass: ["midea-actionsheet-btn", "leftBtn"],
39852
+ style: _vm.defaultBtnStyle,
39801
39853
  on: {
39802
39854
  "click": function($event) {
39803
39855
  _vm.actionsheetBtnClick(_vm.button)
@@ -40967,7 +41019,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
40967
41019
  style: _vm.wrapStyle
40968
41020
  }, _vm._l((_vm.picList), function(src, i) {
40969
41021
  return _c('rain-item', {
40970
- key: "i",
41022
+ key: i,
40971
41023
  ref: ("rain-item-" + i),
40972
41024
  refInFor: true,
40973
41025
  attrs: {