@dolphinweex/weex-vue-render 0.2.32 → 0.2.34

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.
@@ -4977,6 +4977,56 @@ var style = {
4977
4977
  }
4978
4978
  return t;
4979
4979
  },
4980
+ weexH: function(h, tag, data, ...children) {
4981
+ // 处理主题 h 方法
4982
+ if (!this.$weexThemeClass) {
4983
+ return h(tag, data, ...children);
4984
+ }
4985
+ if (data && data.staticClass && !data.themeProcessed) {
4986
+ const staticClasses = data.staticClass.split(' ').filter(cls => cls);
4987
+ let allThemeClasses = [];
4988
+ // 为每个静态类名应用主题处理
4989
+ staticClasses.forEach(className => {
4990
+ const themeClasses = this.$weexThemeClass(className);
4991
+ allThemeClasses.push(...themeClasses);
4992
+ });
4993
+ if (allThemeClasses.length > 0) {
4994
+ data.staticClass = data.staticClass + ' ' + allThemeClasses.join(' ');
4995
+ }
4996
+ data.themeProcessed = true;
4997
+ }
4998
+ const processedChildren = this.processChildrenTheme(children);
4999
+ return h(tag, data, ...processedChildren);
5000
+ },
5001
+ processChildrenTheme: function(children) {
5002
+ if (!children || !Array.isArray(children)) {
5003
+ return children;
5004
+ }
5005
+ return children.map(child => {
5006
+ if (Array.isArray(child)) {
5007
+ return this.processChildrenTheme(child);
5008
+ }
5009
+ // 如果是VNode对象
5010
+ if (child && typeof child === 'object' && child.data) {
5011
+ if (child.data.staticClass && !child.data.themeProcessed) {
5012
+ const staticClasses = child.data.staticClass.split(' ').filter(cls => cls);
5013
+ let allThemeClasses = [];
5014
+ staticClasses.forEach(className => {
5015
+ const themeClasses = this.$weexThemeClass(className);
5016
+ allThemeClasses.push(...themeClasses);
5017
+ });
5018
+ if (allThemeClasses.length > 0) {
5019
+ child.data.staticClass = child.data.staticClass + ' ' + allThemeClasses.join(' ');
5020
+ }
5021
+ child.data.themeProcessed = true;
5022
+ }
5023
+ if (child.children && Array.isArray(child.children)) {
5024
+ child.children = this.processChildrenTheme(child.children);
5025
+ }
5026
+ }
5027
+ return child;
5028
+ });
5029
+ },
4980
5030
  _px2rem: function _px2rem (value, rootValue, propKey) {
4981
5031
  var this$1 = this;
4982
5032
  if (typeof value === 'string') {
@@ -8570,7 +8620,7 @@ function _render (context, h) {
8570
8620
  staticStyle: getIndicatorItemStyle(mergedStyle, isActive)
8571
8621
  }));
8572
8622
  }
8573
- return h('nav', {
8623
+ return context.weexH(h,'nav', {
8574
8624
  attrs: { 'weex-type': 'indicator' },
8575
8625
  staticClass: 'weex-indicator weex-ct'
8576
8626
  }, [
@@ -8579,8 +8629,8 @@ function _render (context, h) {
8579
8629
  // so a smaller wrapper is needed to prevent the overlap.
8580
8630
  // This wrapper will cover only the whole size of all the
8581
8631
  // indicator pointers' item-sizes.
8582
- h('div', {
8583
- staticClass: 'weex-indicator-inner'
8632
+ context.weexH(h,'div', {
8633
+ staticClass: 'weex-indicator-inner '
8584
8634
  }, children)
8585
8635
  ])
8586
8636
  }
@@ -8621,7 +8671,7 @@ var indicator$1 = {
8621
8671
  }
8622
8672
  };
8623
8673
 
8624
- __$styleInject("/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n \n.weex-slider-wrapper {\n overflow: hidden;\n}\n\n.weex-slider-inner {\n width: 100%;\n height: 100%;\n overflow: visible;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n}\n\n.weex-slider-cell {\n width: 100%;\n height: 100%;\n float:left;\n top: 0px;\n left: 0px;\n background: transparent !important;\n overflow: hidden;\n -webkit-box-align: center;\n -webkit-align-items: flex-start;\n align-items: flex-start;\n -webkit-box-pack: center;\n}\n\n.neighbor-cell {\n overflow: visible !important;\n}\n\nnav.weex-indicator {\n position: absolute;\n z-index: 10;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n margin: 0;\n padding: 0;\n -webkit-box-align: center;\n -webkit-align-items: center;\n align-items: center;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n -webkit-transform: translate(-10rem, 0px);\n transform: translate(-10rem, 0px)\n}\n\ndiv.weex-indicator-inner {\n -webkit-transform: translate(10rem, 0px);\n transform: translate(10rem, 0px);\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n display: flex; \n}\n\n.weex-indicator-item {\n display: inline-block;\n position: relative;\n border-radius: 50%;\n width: 0.266667rem;\n height: 0.266667rem;\n background-color: #BBBBBB;\n}\n.weex-indicator-item + .weex-indicator-item {\n margin-left: 0.133333rem;\n}\n\n.weex-indicator-item-active {\n background-color: blue;\n}",undefined);
8674
+ __$styleInject("/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n \n.weex-slider-wrapper {\n overflow: hidden;\n}\n\n.weex-slider-inner {\n width: 100%;\n height: 100%;\n overflow: visible;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n}\n\n.weex-slider-cell {\n width: 100%;\n height: 100%;\n float:left;\n top: 0px;\n left: 0px;\n background: transparent !important;\n overflow: hidden;\n -webkit-box-align: center;\n -webkit-align-items: flex-start;\n align-items: flex-start;\n -webkit-box-pack: center;\n}\n\n.neighbor-cell {\n overflow: visible !important;\n}\n\nnav.weex-indicator {\n position: absolute;\n ;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n margin: 0;\n padding: 0;\n -webkit-box-align: center;\n -webkit-align-items: center;\n align-items: center;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n -webkit-transform: translate(-10rem, 0px);\n transform: translate(-10rem, 0px)\n}\n\ndiv.weex-indicator-inner {\n -webkit-transform: translate(10rem, 0px);\n transform: translate(10rem, 0px);\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n display: flex; \n}\n\n.weex-indicator-item {\n display: inline-block;\n position: relative;\n border-radius: 50%;\n width: 0.266667rem;\n height: 0.266667rem;\n background-color: #BBBBBB;\n}\n.weex-indicator-item + .weex-indicator-item {\n margin-left: 0.133333rem;\n}\n\n.weex-indicator-item-active {\n background-color: blue;\n}",undefined);
8625
8675
 
8626
8676
  /*
8627
8677
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -10433,6 +10483,13 @@ var dom = {
10433
10483
  var styleText = "@" + key + "{" + stylesText + "}";
10434
10484
  styleText = styleText.replace('local://', 'arkweb://');
10435
10485
  appendCss(styleText, 'dom-added-rules');
10486
+
10487
+ // 记录添加过的字体资源
10488
+ weex.requireModule("weexModule").callNative('fontsHandle', {
10489
+ method: 'addRule',
10490
+ key,
10491
+ styles,
10492
+ }, undefined, undefined, undefined);
10436
10493
  }
10437
10494
  };
10438
10495
  var dom$1 = {
@@ -10440,6 +10497,20 @@ var dom$1 = {
10440
10497
  var extendKeys = weex.utils.extendKeys;
10441
10498
  extendKeys(utils$3, weex.utils, ['camelToKebab', 'appendCss', 'isArray', 'getParentScrollerElement']);
10442
10499
  weex.registerModule('dom', dom);
10500
+
10501
+ // 在二级页面自动加载之前添加过的主题
10502
+ if (!global.addRuleFirst) {
10503
+ global.addRuleFirst = true
10504
+ weex.requireModule("weexModule").callNative('fontsHandle', {
10505
+ method: 'getRules'
10506
+ }, undefined, function(rules){
10507
+ if (rules && Array.isArray(rules)) {
10508
+ rules.forEach(rule=>{
10509
+ dom.addRule(rule.key, rule.styles);
10510
+ })
10511
+ }
10512
+ }, undefined);
10513
+ }
10443
10514
  }
10444
10515
  };
10445
10516
 
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  "type": "git",
50
50
  "url": "git+ssh://git@github.com/weexteam/weex-vue-render.git"
51
51
  },
52
- "version": "0.2.32"
52
+ "version": "0.2.34"
53
53
  }