@cloudbase/weda-ui-mp 3.7.1 → 3.7.3
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/components/form/select/dropdown-select/index.js +12 -7
- package/components/form/select/index.js +11 -0
- package/components/form/uploader/weui-uploader.wxml +1 -1
- package/components/form/uploader/weui-uploader.wxss +1 -1
- package/components/form-field-behavior/form-field-behavior.js +1 -1
- package/components/richText/index.json +4 -1
- package/components/richText/index.wxml +1 -1
- package/components/richText/mp-html/index.js +2 -0
- package/components/richText/mp-html/index.json +6 -0
- package/components/richText/mp-html/index.wxml +1 -0
- package/components/richText/mp-html/index.wxss +10 -0
- package/components/richText/mp-html/node/node.js +178 -0
- package/components/richText/mp-html/node/node.json +7 -0
- package/components/richText/mp-html/node/node.wxml +60 -0
- package/components/richText/mp-html/node/node.wxss +156 -0
- package/components/richText/mp-html/parser.js +2 -0
- package/components/wd-button/wd-button.wxss +4 -0
- package/components/wd-form/index.js +28 -5
- package/components/wd-form/index.wxml +15 -13
- package/components/wd-form/index.wxss +15 -0
- package/package.json +1 -1
|
@@ -227,9 +227,11 @@ Component({
|
|
|
227
227
|
option,
|
|
228
228
|
loadStatus,
|
|
229
229
|
searchOption,
|
|
230
|
-
searchStatus
|
|
230
|
+
searchStatus,
|
|
231
|
+
_needFetch
|
|
231
232
|
) {
|
|
232
233
|
if (this.data.searchValue === '') {
|
|
234
|
+
// 初始化会走到这
|
|
233
235
|
const { chooseIndexValue } = this.properties;
|
|
234
236
|
let index = -1;
|
|
235
237
|
if (chooseIndexValue !== '') {
|
|
@@ -250,12 +252,15 @@ Component({
|
|
|
250
252
|
clickIndex: index,
|
|
251
253
|
});
|
|
252
254
|
} else {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
if (_needFetch) {
|
|
256
|
+
// 只有needFetch 才设置searchOption
|
|
257
|
+
this.setData({
|
|
258
|
+
status: searchStatus,
|
|
259
|
+
showOption: searchOption,
|
|
260
|
+
isFinish: true,
|
|
261
|
+
index: -1,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
259
264
|
}
|
|
260
265
|
},
|
|
261
266
|
},
|
|
@@ -659,9 +659,20 @@ Component({
|
|
|
659
659
|
searchRecords.findIndex((r) => r._id === item._id) < 0
|
|
660
660
|
) || []
|
|
661
661
|
),
|
|
662
|
+
records: records.concat(
|
|
663
|
+
(results ?? []).filter(
|
|
664
|
+
(item) => records.findIndex((r) => r._id === item._id) < 0
|
|
665
|
+
) || []
|
|
666
|
+
),
|
|
662
667
|
searchStatus: status,
|
|
663
668
|
}
|
|
664
669
|
: {
|
|
670
|
+
searchRecords: searchRecords.concat(
|
|
671
|
+
(results ?? []).filter(
|
|
672
|
+
(item) =>
|
|
673
|
+
searchRecords.findIndex((r) => r._id === item._id) < 0
|
|
674
|
+
) || []
|
|
675
|
+
),
|
|
665
676
|
records: records.concat(
|
|
666
677
|
(results ?? []).filter(
|
|
667
678
|
(item) => records.findIndex((r) => r._id === item._id) < 0
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<view wx:if="{{currentFiles.length < maxCount && !readOnly}}" class="weui-uploader__input-box {{shapeClass}}" hover-class="weui-active">
|
|
41
41
|
<view wx:if="{{!disabled&&!isChooseAvatar}}" class="weui-uploader__input" bindtap="chooseImage"></view>
|
|
42
42
|
|
|
43
|
-
<button class="weui-uploader__input weui-uploader__input
|
|
43
|
+
<button class="weui-uploader__input weui-uploader__input-button" wx:if="{{!disabled&&isChooseAvatar}}" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar"></button>
|
|
44
44
|
|
|
45
45
|
<view wx:if="{{disabled}}" class="weui-uploader__uploader_disabled"></view>
|
|
46
46
|
</view>
|
|
@@ -417,7 +417,7 @@ export default Behavior({
|
|
|
417
417
|
this.data._status = status;
|
|
418
418
|
const { disabled: _disabled, readOnly: _readOnly } = this.data;
|
|
419
419
|
const statusParams = convertStatus(status, _disabled, _readOnly);
|
|
420
|
-
const form = this
|
|
420
|
+
const form = this?.$widget?.closest(
|
|
421
421
|
(w) => w.getConfig?.()?.componentType === 'form'
|
|
422
422
|
);
|
|
423
423
|
let disabled = statusParams.disabled;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
"use strict"; function e(t) { "@babel/helpers - typeof"; return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e; } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; })(t); } function t(e, t, o) { return (t = n(t)) in e ? Object.defineProperty(e, t, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = o, e; } function n(t) { var n = o(t, "string"); return "symbol" == e(n) ? n : n + ""; } function o(t, n) { if ("object" != e(t) || !t) return t; var o = t[Symbol.toPrimitive]; if (void 0 !== o) { var i = o.call(t, n || "default"); if ("object" != e(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === n ? String : Number)(t); } var i = require("./parser"), r = []; Component({ data: { nodes: [] }, properties: { containerStyle: String, content: { type: String, value: "", observer: function (e) { this.setContent(e); } }, copyLink: { type: Boolean, value: !0 }, domain: String, errorImg: String, lazyLoad: Boolean, loadingImg: String, pauseVideo: { type: Boolean, value: !0 }, previewImg: { type: null, value: !0 }, scrollTable: Boolean, selectable: null, setTitle: { type: Boolean, value: !0 }, showImgMenu: { type: Boolean, value: !0 }, tagStyle: Object, useAnchor: null }, created: function () { this.plugins = []; for (var e = r.length; e--;)this.plugins.push(new r[e](this)); }, detached: function () { this._hook("onDetached"); }, methods: { in: function (e, t, n) { e && t && n && (this._in = { page: e, selector: t, scrollTop: n }); }, navigateTo: function (e, n) { var o = this; return new Promise(function (i, r) { if (!o.data.useAnchor) return void r(Error("Anchor is disabled")); var a = wx.createSelectorQuery().in(o._in ? o._in.page : o).select((o._in ? o._in.selector : "._root") + (e ? "".concat(">>>", "#").concat(e) : "")).boundingClientRect(); o._in ? a.select(o._in.selector).scrollOffset().select(o._in.selector).boundingClientRect() : a.selectViewport().scrollOffset(), a.exec(function (e) { if (!e[0]) return void r(Error("Label not found")); var a = e[1].scrollTop + e[0].top - (e[2] ? e[2].top : 0) + (n || parseInt(o.data.useAnchor) || 0); o._in ? o._in.page.setData(t({}, o._in.scrollTop, a)) : wx.pageScrollTo({ scrollTop: a, duration: 300 }), i(); }); }); }, getText: function (e) { var t = ""; return function e(n) { for (var o = 0; o < n.length; o++) { var i = n[o]; if ("text" === i.type) t += i.text.replace(/&/g, "&"); else if ("br" === i.name) t += "\n"; else { var r = "p" === i.name || "div" === i.name || "tr" === i.name || "li" === i.name || "h" === i.name[0] && i.name[1] > "0" && i.name[1] < "7"; r && t && "\n" !== t[t.length - 1] && (t += "\n"), i.children && e(i.children), r && "\n" !== t[t.length - 1] ? t += "\n" : "td" !== i.name && "th" !== i.name || (t += "\t"); } } }(e || this.data.nodes), t; }, getRect: function () { var e = this; return new Promise(function (t, n) { wx.createSelectorQuery().in(e).select("._root").boundingClientRect().exec(function (e) { return e[0] ? t(e[0]) : n(Error("Root label not found")); }); }); }, pauseMedia: function () { for (var e = (this._videos || []).length; e--;)this._videos[e].pause(); }, setPlaybackRate: function (e) { this.playbackRate = e; for (var t = (this._videos || []).length; t--;)this._videos[t].playbackRate(e); }, setContent: function (e, t) { var n = this; this.imgList && t || (this.imgList = []), this._videos = []; var o = {}, r = new i(this).parse(e); if (t) for (var a = this.data.nodes.length, s = r.length; s--;)o["nodes[".concat(a + s, "]")] = r[s]; else o.nodes = r; if (this.setData(o, function () { n._hook("onLoad"), n.triggerEvent("load"); }), this.data.lazyLoad || this.imgList._unloadimgs < this.imgList.length / 2) { var l = 0, c = function e(t) { t && t.height || (t = {}), t.height === l ? n.triggerEvent("ready", t) : (l = t.height, setTimeout(function () { n.getRect().then(e).catch(e); }, 350)); }; this.getRect().then(c).catch(c); } else this.imgList._unloadimgs || this.getRect().then(function (e) { n.triggerEvent("ready", e); }).catch(function () { n.triggerEvent("ready", {}); }); }, _hook: function (e) { for (var t = r.length; t--;)this.plugins[t][e] && this.plugins[t][e](); }, _add: function (e) { e.detail.root = this; } } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<view class="_root {{selectable?'_select':''}}" style="{{containerStyle}}"><slot wx:if="{{!nodes[0]}}" /><node id="_root" childs="{{nodes}}" opts="{{[lazyLoad,loadingImg,errorImg,showImgMenu,selectable]}}" catchadd="_add" /></view>
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
'use strict';
|
|
3
|
+
function t(e) {
|
|
4
|
+
'@babel/helpers - typeof';
|
|
5
|
+
return (t =
|
|
6
|
+
'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
|
|
7
|
+
? function (t) {
|
|
8
|
+
return typeof t;
|
|
9
|
+
}
|
|
10
|
+
: function (t) {
|
|
11
|
+
return t &&
|
|
12
|
+
'function' == typeof Symbol &&
|
|
13
|
+
t.constructor === Symbol &&
|
|
14
|
+
t !== Symbol.prototype
|
|
15
|
+
? 'symbol'
|
|
16
|
+
: typeof t;
|
|
17
|
+
})(e);
|
|
18
|
+
}
|
|
19
|
+
function e(t, e) {
|
|
20
|
+
var r = Object.keys(t);
|
|
21
|
+
if (Object.getOwnPropertySymbols) {
|
|
22
|
+
var o = Object.getOwnPropertySymbols(t);
|
|
23
|
+
e &&
|
|
24
|
+
(o = o.filter(function (e) {
|
|
25
|
+
return Object.getOwnPropertyDescriptor(t, e).enumerable;
|
|
26
|
+
})),
|
|
27
|
+
r.push.apply(r, o);
|
|
28
|
+
}
|
|
29
|
+
return r;
|
|
30
|
+
}
|
|
31
|
+
function r(t) {
|
|
32
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
33
|
+
var i = null != arguments[r] ? arguments[r] : {};
|
|
34
|
+
r % 2
|
|
35
|
+
? e(Object(i), !0).forEach(function (e) {
|
|
36
|
+
o(t, e, i[e]);
|
|
37
|
+
})
|
|
38
|
+
: Object.getOwnPropertyDescriptors
|
|
39
|
+
? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i))
|
|
40
|
+
: e(Object(i)).forEach(function (e) {
|
|
41
|
+
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(i, e));
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
}
|
|
46
|
+
function o(t, e, r) {
|
|
47
|
+
return (
|
|
48
|
+
(e = i(e)) in t
|
|
49
|
+
? Object.defineProperty(t, e, {
|
|
50
|
+
value: r,
|
|
51
|
+
enumerable: !0,
|
|
52
|
+
configurable: !0,
|
|
53
|
+
writable: !0,
|
|
54
|
+
})
|
|
55
|
+
: (t[e] = r),
|
|
56
|
+
t
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
function i(e) {
|
|
60
|
+
var r = s(e, 'string');
|
|
61
|
+
return 'symbol' == t(r) ? r : r + '';
|
|
62
|
+
}
|
|
63
|
+
function s(e, r) {
|
|
64
|
+
if ('object' != t(e) || !e) return e;
|
|
65
|
+
var o = e[Symbol.toPrimitive];
|
|
66
|
+
if (void 0 !== o) {
|
|
67
|
+
var i = o.call(e, r || 'default');
|
|
68
|
+
if ('object' != t(i)) return i;
|
|
69
|
+
throw new TypeError('@@toPrimitive must return a primitive value.');
|
|
70
|
+
}
|
|
71
|
+
return ('string' === r ? String : Number)(e);
|
|
72
|
+
}
|
|
73
|
+
Component({
|
|
74
|
+
data: { ctrl: {}, isiOS: wx.getSystemInfoSync().system.includes('iOS') },
|
|
75
|
+
properties: { childs: Array, opts: Array },
|
|
76
|
+
options: { addGlobalClass: !0 },
|
|
77
|
+
attached: function () {
|
|
78
|
+
this.triggerEvent('add', this, { bubbles: !0, composed: !0 });
|
|
79
|
+
},
|
|
80
|
+
methods: {
|
|
81
|
+
noop: function () {},
|
|
82
|
+
getNode: function (t) {
|
|
83
|
+
try {
|
|
84
|
+
for (
|
|
85
|
+
var e = t.split('_'), r = this.data.childs[e[0]], o = 1;
|
|
86
|
+
o < e.length;
|
|
87
|
+
o++
|
|
88
|
+
)
|
|
89
|
+
r = r.children[e[o]];
|
|
90
|
+
return r;
|
|
91
|
+
} catch (t) {
|
|
92
|
+
return { text: '', attrs: {}, children: [] };
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
play: function (t) {
|
|
96
|
+
var e = t.target.dataset.i,
|
|
97
|
+
o = this.getNode(e);
|
|
98
|
+
if (
|
|
99
|
+
(this.root.triggerEvent('play', {
|
|
100
|
+
source: o.name,
|
|
101
|
+
attrs: r(r({}, o.attrs), {}, { src: o.src[this.data.ctrl[e] || 0] }),
|
|
102
|
+
}),
|
|
103
|
+
this.root.data.pauseVideo)
|
|
104
|
+
) {
|
|
105
|
+
for (var i = !1, s = t.target.id, n = this.root._videos.length; n--; )
|
|
106
|
+
this.root._videos[n].id === s
|
|
107
|
+
? (i = !0)
|
|
108
|
+
: this.root._videos[n].pause();
|
|
109
|
+
if (!i) {
|
|
110
|
+
var a = wx.createVideoContext(s, this);
|
|
111
|
+
(a.id = s),
|
|
112
|
+
this.root.playbackRate && a.playbackRate(this.root.playbackRate),
|
|
113
|
+
this.root._videos.push(a);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
imgTap: function (t) {
|
|
118
|
+
var e = this.getNode(t.target.dataset.i);
|
|
119
|
+
if (
|
|
120
|
+
!e.attrs.ignore &&
|
|
121
|
+
(this.root.triggerEvent('imgtap', e.attrs), this.root.data.previewImg)
|
|
122
|
+
) {
|
|
123
|
+
var r = this.root.imgList[e.i];
|
|
124
|
+
wx.previewImage({
|
|
125
|
+
showmenu: this.root.data.showImgMenu,
|
|
126
|
+
current: r,
|
|
127
|
+
urls: this.root.imgList,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
imgLoad: function (t) {
|
|
132
|
+
var e,
|
|
133
|
+
r = t.target.dataset.i,
|
|
134
|
+
i = this.getNode(r);
|
|
135
|
+
i.w
|
|
136
|
+
? ((this.data.opts[1] && !this.data.ctrl[r]) ||
|
|
137
|
+
-1 === this.data.ctrl[r]) &&
|
|
138
|
+
(e = 1)
|
|
139
|
+
: (e = t.detail.width),
|
|
140
|
+
e && this.setData(o({}, 'ctrl.' + r, e)),
|
|
141
|
+
this.checkReady();
|
|
142
|
+
},
|
|
143
|
+
checkReady: function () {
|
|
144
|
+
var t = this;
|
|
145
|
+
this.root.data.lazyLoad ||
|
|
146
|
+
((this.root.imgList._unloadimgs -= 1),
|
|
147
|
+
this.root.imgList._unloadimgs ||
|
|
148
|
+
setTimeout(function () {
|
|
149
|
+
t.root
|
|
150
|
+
.getRect()
|
|
151
|
+
.then(function (e) {
|
|
152
|
+
t.root.triggerEvent('ready', e);
|
|
153
|
+
})
|
|
154
|
+
.catch(function () {
|
|
155
|
+
t.root.triggerEvent('ready', {});
|
|
156
|
+
});
|
|
157
|
+
}, 350));
|
|
158
|
+
},
|
|
159
|
+
mediaError: function (t) {
|
|
160
|
+
var e = t.target.dataset.i,
|
|
161
|
+
r = this.getNode(e);
|
|
162
|
+
if ('video' === r.name || 'audio' === r.name) {
|
|
163
|
+
var i = (this.data.ctrl[e] || 0) + 1;
|
|
164
|
+
if ((i > r.src.length && (i = 0), i < r.src.length))
|
|
165
|
+
return this.setData(o({}, 'ctrl.' + e, i));
|
|
166
|
+
} else
|
|
167
|
+
'img' === r.name &&
|
|
168
|
+
(this.data.opts[2] && this.setData(o({}, 'ctrl.' + e, -1)),
|
|
169
|
+
this.checkReady());
|
|
170
|
+
this.root &&
|
|
171
|
+
this.root.triggerEvent('error', {
|
|
172
|
+
source: r.name,
|
|
173
|
+
attrs: r.attrs,
|
|
174
|
+
errMsg: t.detail.errMsg,
|
|
175
|
+
});
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<wxs module="isInline">var e={abbr:!0,b:!0,big:!0,code:!0,del:!0,em:!0,i:!0,ins:!0,label:!0,q:!0,small:!0,span:!0,strong:!0,sub:!0,sup:!0};module.exports=function(n,i){return e[n]||-1!==(i||"").indexOf("inline")};</wxs>
|
|
2
|
+
<template name="el">
|
|
3
|
+
<block wx:if="{{n.name==='img'}}">
|
|
4
|
+
<rich-text wx:if="{{n.t}}" style="display:{{n.t}}" nodes="<img class='_img' style='{{n.attrs.style}}' src='{{n.attrs.src}}'>" data-i="{{i}}" catchtap="imgTap" />
|
|
5
|
+
<block wx:else>
|
|
6
|
+
<image wx:if="{{(opts[1]&&!ctrl[i])||ctrl[i]<0}}" class="_img" style="{{n.attrs.style}}" src="{{ctrl[i]<0?opts[2]:opts[1]}}" mode="widthFix" />
|
|
7
|
+
<image
|
|
8
|
+
id="{{n.attrs.id}}"
|
|
9
|
+
class="_img {{n.attrs.class}}"
|
|
10
|
+
style="{{ctrl[i]===-1?'display:none;':''}}width:{{ctrl[i]||1}}px;height:1px;{{n.attrs.style}}"
|
|
11
|
+
src="{{n.attrs.src}}"
|
|
12
|
+
mode="{{!n.h?'widthFix':(!n.w?'heightFix':(n.m||'scaleToFill'))}}"
|
|
13
|
+
lazy-load="{{opts[0]}}"
|
|
14
|
+
webp="{{n.webp}}"
|
|
15
|
+
show-menu-by-longpress="{{opts[3]&&!n.attrs.ignore}}"
|
|
16
|
+
data-i="{{i}}"
|
|
17
|
+
bindload="imgLoad"
|
|
18
|
+
binderror="mediaError"
|
|
19
|
+
catchtap="imgTap"
|
|
20
|
+
bindlongpress="noop"
|
|
21
|
+
/>
|
|
22
|
+
</block>
|
|
23
|
+
</block>
|
|
24
|
+
<text wx:elif="{{n.text}}" user-select="{{opts[4]=='force'&&isiOS}}" decode>{{n.text}}</text>
|
|
25
|
+
<text wx:elif="{{n.name==='br'}}">\n</text>
|
|
26
|
+
<!-- <view wx:elif="{{n.name==='a'}}" id="{{n.attrs.id}}" class="{{n.attrs.href?'_a ':''}}{{n.attrs.class}}" hover-class="_hover" style="display:inline;{{n.attrs.style}}" data-i="{{i}}" catchtap="linkTap"> -->
|
|
27
|
+
<view wx:elif="{{n.name==='a'}}" id="{{n.attrs.id}}" class="{{n.attrs.href?'_a ':''}}{{n.attrs.class}}" hover-class="_hover" style="display:inline-block;{{n.attrs.style}}" data-i="{{i}}">
|
|
28
|
+
<!-- <node childs="{{n.children}}" opts="{{opts}}" style="display:inherit" /> -->
|
|
29
|
+
<wd-unified-link url="{{n.attrs.href}}" options="{{n.attrs.options}}">
|
|
30
|
+
<node childs="{{n.children}}" opts="{{opts}}" style="display: inherit" />
|
|
31
|
+
</wd-unified-link>
|
|
32
|
+
</view>
|
|
33
|
+
<video wx:elif="{{n.name==='video'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" autoplay="{{n.attrs.autoplay}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" muted="{{n.attrs.muted}}" object-fit="{{n.attrs['object-fit']}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" binderror="mediaError" />
|
|
34
|
+
<audio wx:elif="{{n.name==='audio'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" author="{{n.attrs.author}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" name="{{n.attrs.name}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" binderror="mediaError" />
|
|
35
|
+
<rich-text wx:else id="{{n.attrs.id}}" style="{{n.f}}" user-select="{{opts[4]}}" nodes="{{[n]}}" />
|
|
36
|
+
</template>
|
|
37
|
+
<block wx:for="{{childs}}" wx:for-item="n1" wx:for-index="i1" wx:key="i1">
|
|
38
|
+
<template wx:if="{{!n1.c&&(!n1.children||n1.name==='a'||!isInline(n1.name,n1.attrs.style))}}" is="el" data="{{n:n1,i:''+i1,opts:opts,ctrl:ctrl}}" />
|
|
39
|
+
<view wx:else id="{{n1.attrs.id}}" class="_{{n1.name}} {{n1.attrs.class}}" style="{{n1.attrs.style}}">
|
|
40
|
+
<block wx:for="{{n1.children}}" wx:for-item="n2" wx:for-index="i2" wx:key="i2">
|
|
41
|
+
<template wx:if="{{!n2.c&&(!n2.children||n2.name==='a'||!isInline(n2.name,n2.attrs.style))}}" is="el" data="{{n:n2,i:i1+'_'+i2,opts:opts,ctrl:ctrl}}" />
|
|
42
|
+
<view wx:else id="{{n2.attrs.id}}" class="_{{n2.name}} {{n2.attrs.class}}" style="{{n2.attrs.style}}">
|
|
43
|
+
<block wx:for="{{n2.children}}" wx:for-item="n3" wx:for-index="i3" wx:key="i3">
|
|
44
|
+
<template wx:if="{{!n3.c&&(!n3.children||n3.name==='a'||!isInline(n3.name,n3.attrs.style))}}" is="el" data="{{n:n3,i:i1+'_'+i2+'_'+i3,opts:opts,ctrl:ctrl}}" />
|
|
45
|
+
<view wx:else id="{{n3.attrs.id}}" class="_{{n3.name}} {{n3.attrs.class}}" style="{{n3.attrs.style}}">
|
|
46
|
+
<block wx:for="{{n3.children}}" wx:for-item="n4" wx:for-index="i4" wx:key="i4">
|
|
47
|
+
<template wx:if="{{!n4.c&&(!n4.children||n4.name==='a'||!isInline(n4.name,n4.attrs.style))}}" is="el" data="{{n:n4,i:i1+'_'+i2+'_'+i3+'_'+i4,opts:opts,ctrl:ctrl}}" />
|
|
48
|
+
<view wx:else id="{{n4.attrs.id}}" class="_{{n4.name}} {{n4.attrs.class}}" style="{{n4.attrs.style}}">
|
|
49
|
+
<block wx:for="{{n4.children}}" wx:for-item="n5" wx:for-index="i5" wx:key="i5">
|
|
50
|
+
<template wx:if="{{!n5.c&&(!n5.children||n5.name==='a'||!isInline(n5.name,n5.attrs.style))}}" is="el" data="{{n:n5,i:i1+'_'+i2+'_'+i3+'_'+i4+'_'+i5,opts:opts,ctrl:ctrl}}" />
|
|
51
|
+
<node wx:else id="{{n5.attrs.id}}" class="_{{n5.name}} {{n5.attrs.class}}" style="{{n5.attrs.style}}" childs="{{n5.children}}" opts="{{opts}}" />
|
|
52
|
+
</block>
|
|
53
|
+
</view>
|
|
54
|
+
</block>
|
|
55
|
+
</view>
|
|
56
|
+
</block>
|
|
57
|
+
</view>
|
|
58
|
+
</block>
|
|
59
|
+
</view>
|
|
60
|
+
</block>
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
._a {
|
|
2
|
+
padding: 1.5px 0 1.5px 0;
|
|
3
|
+
color: #0052d9;
|
|
4
|
+
word-break: break-all;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
._hover {
|
|
8
|
+
text-decoration: underline;
|
|
9
|
+
opacity: 0.7;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
._img {
|
|
13
|
+
max-width: 100%;
|
|
14
|
+
-webkit-touch-callout: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
._b,
|
|
18
|
+
._strong {
|
|
19
|
+
font-weight: 700;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
._code {
|
|
23
|
+
font-family: monospace;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
._del {
|
|
27
|
+
text-decoration: line-through;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
._em,
|
|
31
|
+
._i {
|
|
32
|
+
font-style: italic;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
._h1 {
|
|
36
|
+
font-size: 2em;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
._h2 {
|
|
40
|
+
font-size: 1.5em;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
._h3 {
|
|
44
|
+
font-size: 1.17em;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
._h5 {
|
|
48
|
+
font-size: 0.83em;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
._h6 {
|
|
52
|
+
font-size: 0.67em;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
._h1,
|
|
56
|
+
._h2,
|
|
57
|
+
._h3,
|
|
58
|
+
._h4,
|
|
59
|
+
._h5,
|
|
60
|
+
._h6 {
|
|
61
|
+
display: block;
|
|
62
|
+
font-weight: 700;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
._ins {
|
|
66
|
+
text-decoration: underline;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
._li {
|
|
70
|
+
display: list-item;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
._ol {
|
|
74
|
+
list-style-type: decimal;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
._ol,
|
|
78
|
+
._ul {
|
|
79
|
+
display: block;
|
|
80
|
+
padding-left: 40px;
|
|
81
|
+
margin: 1em 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
._q::before {
|
|
85
|
+
content: '"';
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
._q::after {
|
|
89
|
+
content: '"';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
._sub {
|
|
93
|
+
font-size: smaller;
|
|
94
|
+
vertical-align: sub;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
._sup {
|
|
98
|
+
font-size: smaller;
|
|
99
|
+
vertical-align: super;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
._tbody,
|
|
103
|
+
._tfoot,
|
|
104
|
+
._thead {
|
|
105
|
+
display: table-row-group;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
._tr {
|
|
109
|
+
display: table-row;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
._td,
|
|
113
|
+
._th {
|
|
114
|
+
display: table-cell;
|
|
115
|
+
vertical-align: middle;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
._th {
|
|
119
|
+
font-weight: 700;
|
|
120
|
+
text-align: center;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
._ul {
|
|
124
|
+
list-style-type: disc;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
._ul ._ul {
|
|
128
|
+
margin: 0;
|
|
129
|
+
list-style-type: circle;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
._ul ._ul ._ul {
|
|
133
|
+
list-style-type: square;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
._abbr,
|
|
137
|
+
._b,
|
|
138
|
+
._code,
|
|
139
|
+
._del,
|
|
140
|
+
._em,
|
|
141
|
+
._i,
|
|
142
|
+
._ins,
|
|
143
|
+
._label,
|
|
144
|
+
._q,
|
|
145
|
+
._span,
|
|
146
|
+
._strong,
|
|
147
|
+
._sub,
|
|
148
|
+
._sup {
|
|
149
|
+
display: inline;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
._blockquote,
|
|
153
|
+
._div,
|
|
154
|
+
._p {
|
|
155
|
+
display: block;
|
|
156
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
"use strict"; function t(t, e) { var s = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"]; if (!s) { if (Array.isArray(t) || (s = i(t)) || e && t && "number" == typeof t.length) { s && (t = s); var n = 0, a = function () { }; return { s: a, n: function () { return n >= t.length ? { done: !0 } : { done: !1, value: t[n++] } }, e: function (t) { throw t }, f: a } } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } var r, o = !0, l = !1; return { s: function () { s = s.call(t) }, n: function () { var t = s.next(); return o = t.done, t }, e: function (t) { l = !0, r = t }, f: function () { try { o || null == s.return || s.return() } finally { if (l) throw r } } } } function i(t, i) { if (t) { if ("string" == typeof t) return e(t, i); var s = {}.toString.call(t).slice(8, -1); return "Object" === s && t.constructor && (s = t.constructor.name), "Map" === s || "Set" === s ? Array.from(t) : "Arguments" === s || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ? e(t, i) : void 0 } } function e(t, i) { (null == i || i > t.length) && (i = t.length); for (var e = 0, s = Array(i); e < i; e++)s[e] = t[e]; return s } function s(t) { for (var i = Object.create(null), e = t.split(","), s = e.length; s--;)i[e[s]] = !0; return i } function n(t, i) { for (var e = t.indexOf("&"); -1 !== e;) { var s = t.indexOf(";", e + 3), n = void 0; if (-1 === s) break; "#" === t[e + 1] ? (n = parseInt(("x" === t[e + 2] ? "0" : "") + t.substring(e + 2, s)), isNaN(n) || (t = t.substr(0, e) + String.fromCharCode(n) + t.substr(s + 1))) : (n = t.substring(e + 1, s), (l.entities[n] || "amp" === n && i) && (t = t.substr(0, e) + (l.entities[n] || "&") + t.substr(s + 1))), e = t.indexOf("&", e + 1) } return t } function a(t) { for (var i = t.length - 1, e = i; e >= -1; e--)(-1 === e || t[e].c || !t[e].name || "div" !== t[e].name && "p" !== t[e].name && "h" !== t[e].name[0] || (t[e].attrs.style || "").includes("inline")) && (i - e >= 5 && t.splice(e + 1, i - e, { name: "div", attrs: {}, children: t.slice(e + 1, i + 1) }), i = e - 1) } function r(t) { this.options = t.data || {}, this.tagStyle = Object.assign({}, l.tagStyle, this.options.tagStyle), this.imgList = t.imgList || [], this.imgList._unloadimgs = 0, this.plugins = t.plugins || [], this.attrs = Object.create(null), this.stack = [], this.nodes = [], this.pre = (this.options.containerStyle || "").includes("white-space") && this.options.containerStyle.includes("pre") ? 2 : 0 } function o(t) { this.handler = t } var l = { trustTags: s("a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,ruby,rt,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video"), blockTags: s("address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section"), ignoreTags: s("area,base,canvas,embed,frame,head,iframe,input,link,map,meta,param,rp,script,source,style,textarea,title,track,wbr"), voidTags: s("area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr"), entities: { lt: "<", gt: ">", quot: '"', apos: "'", ensp: " ", emsp: " ", nbsp: " ", semi: ";", ndash: "–", mdash: "—", middot: "·", lsquo: "‘", rsquo: "’", ldquo: "“", rdquo: "”", bull: "•", hellip: "…", larr: "←", uarr: "↑", rarr: "→", darr: "↓" }, tagStyle: { address: "font-style:italic", big: "display:inline;font-size:1.2em", caption: "display:table-caption;text-align:center", center: "text-align:center", cite: "font-style:italic", dd: "margin-left:40px", mark: "background-color:yellow", pre: "font-family:monospace;white-space:pre", s: "text-decoration:line-through", small: "display:inline;font-size:0.8em", strike: "text-decoration:line-through", u: "text-decoration:underline" }, svgDict: { animatetransform: "animateTransform", lineargradient: "linearGradient", viewbox: "viewBox", attributename: "attributeName", repeatcount: "repeatCount", repeatdur: "repeatDur", foreignobject: "foreignObject" } }, h = {}, c = wx.getSystemInfoSync(), d = c.windowWidth, p = c.system, u = s(" ,\r,\n,\t,\f"), f = 0; r.prototype.parse = function (t) { for (var i = this.plugins.length; i--;)this.plugins[i].onUpdate && (t = this.plugins[i].onUpdate(t, l) || t); for (new o(this).parse(t); this.stack.length;)this.popNode(); return this.nodes.length > 50 && a(this.nodes), this.nodes }, r.prototype.expose = function () { for (var t = this.stack.length; t--;) { var i = this.stack[t]; if (i.c || "a" === i.name || "video" === i.name || "audio" === i.name) return; i.c = 1 } }, r.prototype.hook = function (t) { for (var i = this.plugins.length; i--;)if (this.plugins[i].onParse && !1 === this.plugins[i].onParse(t, this)) return !1; return !0 }, r.prototype.getUrl = function (t) { var i = this.options.domain; return "/" === t[0] ? "/" === t[1] ? t = (i ? i.split("://")[0] : "http") + ":" + t : i && (t = i + t) : !i || t.includes("data:") || t.includes("://") || (t = i + "/" + t), t }, r.prototype.parseStyle = function (t) { var i = t.attrs, e = (this.tagStyle[t.name] || "").split(";").concat((i.style || "").split(";")), s = {}, n = ""; i.id && !this.xml && (this.options.useAnchor ? this.expose() : "img" !== t.name && "a" !== t.name && "video" !== t.name && "audio" !== t.name && (i.id = void 0)), i.width && (s.width = parseFloat(i.width) + (i.width.includes("%") ? "%" : "px"), i.width = void 0), i.height && (s.height = parseFloat(i.height) + (i.height.includes("%") ? "%" : "px"), i.height = void 0); for (var a = 0, r = e.length; a < r; a++) { var o = e[a].split(":"); if (!(o.length < 2)) { var l = o.shift().trim().toLowerCase(), h = o.join(":").trim(); if ("-" === h[0] && h.lastIndexOf("-") > 0 || h.includes("safe")) n += ";".concat(l, ":").concat(h); else if (!s[l] || h.includes("import") || !s[l].includes("import")) { if (h.includes("url")) { var c = h.indexOf("(") + 1; if (c) { for (; '"' === h[c] || "'" === h[c] || u[h[c]];)c++; h = h.substr(0, c) + this.getUrl(h.substr(c)) } } else h.includes("rpx") && (h = h.replace(/[0-9.]+\s*rpx/g, function (t) { return parseFloat(t) * d / 750 + "px" })); s[l] = h } } } return t.attrs.style = n, s }, r.prototype.onTagName = function (t) { this.tagName = this.xml ? t : t.toLowerCase(), "svg" === this.tagName && (this.xml = (this.xml || 0) + 1, l.ignoreTags.style = void 0) }, r.prototype.onAttrName = function (t) { t = this.xml ? t : t.toLowerCase(), "data-" === t.substr(0, 5) ? "data-src" !== t || this.attrs.src ? "img" === this.tagName || "a" === this.tagName ? this.attrName = t : this.attrName = void 0 : this.attrName = "src" : (this.attrName = t, this.attrs[t] = "T") }, r.prototype.onAttrVal = function (t) { var i = this.attrName || ""; "style" === i || "href" === i ? this.attrs[i] = n(t, !0) : i.includes("src") ? this.attrs[i] = this.getUrl(n(t, !0)) : i && (this.attrs[i] = t) }, r.prototype.onOpenTag = function (t) { var i = Object.create(null); i.name = this.tagName, i.attrs = this.attrs, this.attrs = Object.create(null); var e = i.attrs, s = this.stack[this.stack.length - 1], n = s ? s.children : this.nodes, a = this.xml ? t : l.voidTags[i.name]; if (h[i.name] && (e.class = h[i.name] + (e.class ? " " + e.class : "")), "embed" === i.name) { var r = e.src || ""; r.includes(".mp4") || r.includes(".3gp") || r.includes(".m3u8") || (e.type || "").includes("video") ? i.name = "video" : (r.includes(".mp3") || r.includes(".wav") || r.includes(".aac") || r.includes(".m4a") || (e.type || "").includes("audio")) && (i.name = "audio"), e.autostart && (e.autoplay = "T"), e.controls = "T" } if ("video" !== i.name && "audio" !== i.name || ("video" !== i.name || e.id || (e.id = "v" + f++), e.controls || e.autoplay || (e.controls = "T"), i.src = [], e.src && (i.src.push(e.src), e.src = void 0), this.expose()), a) { if (!this.hook(i) || l.ignoreTags[i.name]) return void ("base" !== i.name || this.options.domain ? "source" === i.name && s && ("video" === s.name || "audio" === s.name) && e.src && s.src.push(e.src) : this.options.domain = e.href); var o = this.parseStyle(i); if ("img" === i.name) { if (e.src && (e.src.includes("webp") && (i.webp = "T"), e.src.includes("data:") && "all" !== this.options.previewImg && !e["original-src"] && (e.ignore = "T"), !e.ignore || i.webp || e.src.includes("cloud://"))) { for (var c = this.stack.length; c--;) { var p = this.stack[c]; "table" !== p.name || i.webp || e.src.includes("cloud://") || (!o.display || o.display.includes("inline") ? i.t = "inline-block" : i.t = o.display, o.display = void 0); var u = p.attrs.style || ""; if (!u.includes("flex:") || u.includes("flex:0") || u.includes("flex: 0") || o.width && !(parseInt(o.width) > 100)) if (u.includes("flex") && "100%" === o.width) for (var g = c + 1; g < this.stack.length; g++) { var m = this.stack[g].attrs.style || ""; if (!m.includes(";width") && !m.includes(" width") && 0 !== m.indexOf("width")) { o.width = ""; break } } else u.includes("inline-block") && (o.width && "%" === o.width[o.width.length - 1] ? (p.attrs.style += ";max-width:" + o.width, o.width = "") : p.attrs.style += ";max-width:100%"); else { o.width = "100% !important", o.height = ""; for (var v = c + 1; v < this.stack.length; v++)this.stack[v].attrs.style = (this.stack[v].attrs.style || "").replace("inline-", "") } "a" === p.name ? i.a = p.attrs : p.c = 1 } i.i = this.imgList.length; var y = e["original-src"] || e.src; if (this.imgList.includes(y)) { var b = y.indexOf("://"); if (-1 !== b) { b += 3; for (var x = y.substr(0, b); b < y.length && "/" !== y[b]; b++)x += Math.random() > .5 ? y[b].toUpperCase() : y[b]; x += y.substr(b), y = x } } this.imgList.push(y), i.t || (this.imgList._unloadimgs += 1) } "inline" === o.display && (o.display = ""), e.ignore && (o["max-width"] = o["max-width"] || "100%", e.style += ";-webkit-touch-callout:none"), parseInt(o.width) > d && (o.height = void 0), isNaN(parseInt(o.width)) || (i.w = "T"), !isNaN(parseInt(o.height)) && (!o.height.includes("%") || s && (s.attrs.style || "").includes("height")) && (i.h = "T"), i.w && i.h && o["object-fit"] && ("contain" === o["object-fit"] ? i.m = "aspectFit" : "cover" === o["object-fit"] && (i.m = "aspectFill")) } else if ("svg" === i.name) return n.push(i), this.stack.push(i), void this.popNode(); for (var w in o) o[w] && (e.style += ";".concat(w, ":").concat(o[w].replace(" !important", ""))); e.style = e.style.substr(1) || void 0 } else ("pre" === i.name || (e.style || "").includes("white-space") && e.style.includes("pre")) && 2 !== this.pre && (this.pre = i.pre = 1), i.children = [], this.stack.push(i); n.push(i) }, r.prototype.onCloseTag = function (t) { t = this.xml ? t : t.toLowerCase(); var i; for (i = this.stack.length; i-- && this.stack[i].name !== t;); if (-1 !== i) for (; this.stack.length > i;)this.popNode(); else if ("p" === t || "br" === t) { var e = this.stack.length ? this.stack[this.stack.length - 1].children : this.nodes; e.push({ name: t, attrs: { class: h[t], style: this.tagStyle[t] } }) } }, r.prototype.popNode = function () { var i = this.stack.pop(), e = i.attrs, s = i.children, n = this.stack[this.stack.length - 1], r = n ? n.children : this.nodes; if (!this.hook(i) || l.ignoreTags[i.name]) return "title" === i.name && s.length && "text" === s[0].type && this.options.setTitle && wx.setNavigationBarTitle({ title: s[0].text }), void r.pop(); if (i.pre && 2 !== this.pre) { this.pre = i.pre = void 0; for (var o = this.stack.length; o--;)this.stack[o].pre && (this.pre = 1) } if ("svg" === i.name) { if (this.xml > 1) return void this.xml--; var h = "", c = e.style; return e.style = "", e.xmlns = "http://www.w3.org/2000/svg", function i(e) { if ("text" === e.type) return void (h += e.text); var s = l.svgDict[e.name] || e.name; if ("foreignObject" === s) { var n, a = t(e.children || []); try { for (a.s(); !(n = a.n()).done;) { var r = n.value; if (r.attrs && !r.attrs.xmlns) { r.attrs.xmlns = "http://www.w3.org/1999/xhtml"; break } } } catch (t) { a.e(t) } finally { a.f() } } h += "<" + s; for (var o in e.attrs) { var c = e.attrs[o]; c && (h += " ".concat(l.svgDict[o] || o, '="').concat(c.replace(/"/g, ""), '"')) } if (e.children) { h += ">"; for (var d = 0; d < e.children.length; d++)i(e.children[d]); h += "</" + s + ">" } else h += "/>" }(i), i.name = "img", i.attrs = { src: "data:image/svg+xml;utf8," + h.replace(/#/g, "%23"), style: c, ignore: "T" }, i.children = void 0, this.xml = !1, void (l.ignoreTags.style = !0) } var p = {}; if (e.align && ("table" === i.name ? "center" === e.align ? p["margin-inline-start"] = p["margin-inline-end"] = "auto" : p.float = e.align : p["text-align"] = e.align, e.align = void 0), e.dir && (p.direction = e.dir, e.dir = void 0), "font" === i.name && (e.color && (p.color = e.color, e.color = void 0), e.face && (p["font-family"] = e.face, e.face = void 0), e.size)) { var u = parseInt(e.size); isNaN(u) || (u < 1 ? u = 1 : u > 7 && (u = 7), p["font-size"] = ["x-small", "small", "medium", "large", "x-large", "xx-large", "xxx-large"][u - 1]), e.size = void 0 } if ((e.class || "").includes("align-center") && (p["text-align"] = "center"), Object.assign(p, this.parseStyle(i)), "table" !== i.name && parseInt(p.width) > d && (p["max-width"] = "100%", p["box-sizing"] = "border-box"), l.blockTags[i.name]) i.name = "div"; else if (l.trustTags[i.name] || this.xml) if ("a" === i.name || "ad" === i.name) this.expose(); else if ("video" === i.name || "audio" === i.name) (p.height || "").includes("auto") && (p.height = void 0), i.children = void 0; else if ("ul" !== i.name && "ol" !== i.name || !i.c) if ("table" === i.name) { var f = parseFloat(e.cellpadding), g = parseFloat(e.cellspacing), m = parseFloat(e.border), v = p["border-color"], y = p["border-style"]; if (i.c && (isNaN(f) && (f = 2), isNaN(g) && (g = 2)), m && (e.style += ";border:".concat(m, "px ").concat(y || "solid", " ").concat(v || "gray")), i.flag && i.c) { i.flag = void 0, p.display = "grid", "collapse" === p["border-collapse"] && (p["border-collapse"] = void 0, g = 0), g ? (p["grid-gap"] = g + "px", p.padding = g + "px") : m && (e.style += ";border-left:0;border-top:0"); var b = [], x = [], w = [], k = {}; !function i(e) { for (var s = 0; s < e.length; s++)if ("tr" === e[s].name) x.push(e[s]); else if ("colgroup" === e[s].name) { var n, a = 1, r = t(e[s].children || []); try { for (r.s(); !(n = r.n()).done;) { var o = n.value; if ("col" === o.name) { var l = o.attrs.style || "", h = l.indexOf("width") ? l.indexOf(";width") : 0; if (-1 !== h) { var c = l.indexOf(";", h + 6); -1 === c && (c = l.length), b[a] = l.substring(h ? h + 7 : 6, c) } a += 1 } } } catch (t) { r.e(t) } finally { r.f() } } else i(e[s].children || []) }(s); for (var N = 1; N <= x.length; N++) { for (var T = 1, O = 0; O < x[N - 1].children.length; O++) { var j = x[N - 1].children[O]; if ("td" === j.name || "th" === j.name) { for (; k[N + "." + T];)T++; j.c = 1; var S = j.attrs.style || "", C = S.indexOf("width") ? S.indexOf(";width") : 0; if (-1 !== C) { var I = S.indexOf(";", C + 6); -1 === I && (I = S.length), j.attrs.colspan || (b[T] = S.substring(C ? C + 7 : 6, I)), S = S.substr(0, C) + S.substr(I) } if (S += ";display:flex;flex-direction:column", -1 !== (C = S.indexOf("vertical-align"))) { var A = S.substr(C + 15, 10); A.includes("middle") ? S += ";justify-content:center" : A.includes("bottom") && (S += ";justify-content:flex-end") } else S += ";justify-content:center"; if (-1 !== (C = S.indexOf("text-align"))) { var L = S.substr(C + 11, 10); L.includes("center") ? S += ";justify-content: center" : L.includes("right") && (S += ";justify-content: right") } if (S = (m ? ";border:".concat(m, "px ").concat(y || "solid", " ").concat(v || "gray") + (g ? "" : ";border-right:0;border-bottom:0") : "") + (f ? ";padding:".concat(f, "px") : "") + ";" + S, j.attrs.colspan && (S += ";grid-column-start:".concat(T, ";grid-column-end:").concat(T + parseInt(j.attrs.colspan)), j.attrs.rowspan || (S += ";grid-row-start:".concat(N, ";grid-row-end:").concat(N + 1)), T += parseInt(j.attrs.colspan) - 1), j.attrs.rowspan) { S += ";grid-row-start:".concat(N, ";grid-row-end:").concat(N + parseInt(j.attrs.rowspan)), j.attrs.colspan || (S += ";grid-column-start:".concat(T, ";grid-column-end:").concat(T + 1)); for (var z = 1; z < j.attrs.rowspan; z++)for (var F = 0; F < (j.attrs.colspan || 1); F++)k[N + z + "." + (T - F)] = 1 } S && (j.attrs.style = S), w.push(j), T++ } } if (1 === N) { for (var U = "", q = 1; q < T; q++)U += (b[q] ? b[q] : "auto") + " "; p["grid-template-columns"] = U } } i.children = w } else i.c && (p.display = "table"), isNaN(g) || (p["border-spacing"] = g + "px"), (m || f || i.c) && function t(e) { for (var s = 0; s < e.length; s++) { var n = e[s]; i.c && (n.c = 1), "th" === n.name || "td" === n.name ? (m && (n.attrs.style = "border:".concat(m, "px ").concat(y || "solid", " ").concat(v || "gray", ";").concat(n.attrs.style || "")), f && (n.attrs.style = "padding:".concat(f, "px;").concat(n.attrs.style || ""))) : n.children && t(n.children) } }(s); if (this.options.scrollTable && !(e.style || "").includes("inline")) { var V = Object.assign({}, i); i.name = "div", i.attrs = { style: "overflow-x:auto;padding:1px" }, i.children = [V], e = V.attrs } } else if (("tbody" === i.name || "tr" === i.name) && i.flag && i.c) i.flag = void 0, function t(i) { for (var e = 0; e < i.length; e++)if ("td" === i[e].name) for (var s = 0, n = ["color", "background", "background-color"]; s < n.length; s++) { var a = n[s]; p[a] && (i[e].attrs.style = a + ":" + p[a] + ";" + (i[e].attrs.style || "")) } else t(i[e].children || []) }(s); else if ("td" !== i.name && "th" !== i.name || !e.colspan && !e.rowspan) { if ("ruby" === i.name) { i.name = "span"; for (var D = 0; D < s.length - 1; D++)"text" === s[D].type && "rt" === s[D + 1].name && (s[D] = { name: "span", attrs: { style: "display:inline-block;text-align:center" }, children: [{ name: "div", attrs: { style: "font-size:50%;" + (s[D + 1].attrs.style || "") }, children: s[D + 1].children }, s[D]] }, s.splice(D + 1, 1)) } } else for (var B = this.stack.length; B--;)"table" !== this.stack[B].name && "tbody" !== this.stack[B].name && "tr" !== this.stack[B].name || (this.stack[B].flag = 1); else { var M = { a: "lower-alpha", A: "upper-alpha", i: "lower-roman", I: "upper-roman" }; M[e.type] && (e.style += ";list-style-type:" + M[e.type], e.type = void 0), i.c = 1; for (var P = s.length; P--;)"li" === s[P].name && (s[P].c = 1) } else i.name = "span"; if ((p.display || "").includes("flex") && !i.c) for (var Z = s.length; Z--;) { var _ = s[Z]; _.f && (_.attrs.style = (_.attrs.style || "") + _.f, _.f = void 0) } var E = n && ((n.attrs.style || "").includes("flex") || (n.attrs.style || "").includes("grid")) && !i.c && !(p.display || "").includes("inline"); E && (i.f = ";max-width:100%"), s.length >= 50 && i.c && !(p.display || "").includes("flex") && a(s); for (var G in p) if (p[G]) { var W = ";".concat(G, ":").concat(p[G].replace(" !important", "")); E && (G.includes("flex") && "flex-direction" !== G || "align-self" === G || G.includes("grid") || "-" === p[G][0] || G.includes("width") && W.includes("%")) ? (i.f += W, "width" === G && (e.style += ";width:100%")) : e.style += W } e.style = e.style.substr(1) || void 0 }, r.prototype.onText = function (t) { if (!this.pre) { for (var i, e = "", s = 0, a = t.length; s < a; s++)u[t[s]] ? (" " !== e[e.length - 1] && (e += " "), "\n" !== t[s] || i || (i = !0)) : e += t[s]; if (" " === e && i) return; t = e } var r = Object.create(null); if (r.type = "text", r.text = n(t), this.hook(r)) { "force" === this.options.selectable && p.includes("iOS") && !wx.canIUse("rich-text.user-select") && this.expose(); (this.stack.length ? this.stack[this.stack.length - 1].children : this.nodes).push(r) } }, o.prototype.parse = function (t) { this.content = t || "", this.i = 0, this.start = 0, this.state = this.text; for (var i = this.content.length; -1 !== this.i && this.i < i;)this.state() }, o.prototype.checkClose = function (t) { var i = "/" === this.content[this.i]; return !!(">" === this.content[this.i] || i && ">" === this.content[this.i + 1]) && (t && this.handler[t](this.content.substring(this.start, this.i)), this.i += i ? 2 : 1, this.start = this.i, this.handler.onOpenTag(i), "script" === this.handler.tagName ? (this.i = this.content.indexOf("</", this.i), -1 !== this.i && (this.i += 2, this.start = this.i), this.state = this.endTag) : this.state = this.text, !0) }, o.prototype.text = function () { if (this.i = this.content.indexOf("<", this.i), -1 === this.i) return void (this.start < this.content.length && this.handler.onText(this.content.substring(this.start, this.content.length))); var t = this.content[this.i + 1]; if (t >= "a" && t <= "z" || t >= "A" && t <= "Z") this.start !== this.i && this.handler.onText(this.content.substring(this.start, this.i)), this.start = ++this.i, this.state = this.tagName; else if ("/" === t || "!" === t || "?" === t) { this.start !== this.i && this.handler.onText(this.content.substring(this.start, this.i)); var i = this.content[this.i + 2]; if ("/" === t && (i >= "a" && i <= "z" || i >= "A" && i <= "Z")) return this.i += 2, this.start = this.i, void (this.state = this.endTag); var e = "--\x3e"; "!" === t && "-" === this.content[this.i + 2] && "-" === this.content[this.i + 3] || (e = ">"), this.i = this.content.indexOf(e, this.i), -1 !== this.i && (this.i += e.length, this.start = this.i) } else this.i++ }, o.prototype.tagName = function () { if (u[this.content[this.i]]) { for (this.handler.onTagName(this.content.substring(this.start, this.i)); u[this.content[++this.i]];); this.i < this.content.length && !this.checkClose() && (this.start = this.i, this.state = this.attrName) } else this.checkClose("onTagName") || this.i++ }, o.prototype.attrName = function () { var t = this.content[this.i]; if (u[t] || "=" === t) { this.handler.onAttrName(this.content.substring(this.start, this.i)); for (var i = "=" === t, e = this.content.length; ++this.i < e;)if (t = this.content[this.i], !u[t]) { if (this.checkClose()) return; if (i) return this.start = this.i, void (this.state = this.attrVal); if ("=" !== this.content[this.i]) return this.start = this.i, void (this.state = this.attrName); i = !0 } } else this.checkClose("onAttrName") || this.i++ }, o.prototype.attrVal = function () { var t = this.content[this.i], i = this.content.length; if ('"' === t || "'" === t) { if (this.start = ++this.i, this.i = this.content.indexOf(t, this.i), -1 === this.i) return; this.handler.onAttrVal(this.content.substring(this.start, this.i)) } else for (; this.i < i; this.i++) { if (u[this.content[this.i]]) { this.handler.onAttrVal(this.content.substring(this.start, this.i)); break } if (this.checkClose("onAttrVal")) return } for (; u[this.content[++this.i]];); this.i < i && !this.checkClose() && (this.start = this.i, this.state = this.attrName) }, o.prototype.endTag = function () { var t = this.content[this.i]; if (u[t] || ">" === t || "/" === t) { if (this.handler.onCloseTag(this.content.substring(this.start, this.i)), ">" !== t && (this.i = this.content.indexOf(">", this.i), -1 === this.i)) return; this.start = ++this.i, this.state = this.text } else this.i++ }, module.exports = r;
|
|
@@ -112,6 +112,18 @@ Component({
|
|
|
112
112
|
});
|
|
113
113
|
});
|
|
114
114
|
},
|
|
115
|
+
setReadOnly() {
|
|
116
|
+
Object.keys(this.data._formItemMap).forEach((name) => {
|
|
117
|
+
const items = this.data._formItemMap[name];
|
|
118
|
+
items.forEach((item) => {
|
|
119
|
+
if (!item.setReadOnly) {
|
|
120
|
+
console.error('表单组件缺少setReadOnly方法:', item);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
item.setReadOnly(true);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
},
|
|
115
127
|
async validate() {
|
|
116
128
|
const validatePromise = [];
|
|
117
129
|
const validateKey = [];
|
|
@@ -617,14 +629,25 @@ Component({
|
|
|
617
629
|
paramGetItem,
|
|
618
630
|
value
|
|
619
631
|
) {
|
|
632
|
+
if (formType === 'read') {
|
|
633
|
+
this.setReadOnly();
|
|
634
|
+
}
|
|
635
|
+
const isDataModel = ![
|
|
636
|
+
'connector',
|
|
637
|
+
'custom-connector',
|
|
638
|
+
'expression',
|
|
639
|
+
].includes(datasourceType);
|
|
640
|
+
if (
|
|
641
|
+
isDataModel &&
|
|
642
|
+
formTypeWithInitValue &&
|
|
643
|
+
_id &&
|
|
644
|
+
!equal(_id, this.data._preDataId)
|
|
645
|
+
) {
|
|
646
|
+
this.setData({ isLoadingData: true });
|
|
647
|
+
}
|
|
620
648
|
clearTimeout(this.data._delayRef.current.initTimer);
|
|
621
649
|
// eslint-disable-next-line rulesdir/no-timer
|
|
622
650
|
this.data._delayRef.current.initTimer = setTimeout(() => {
|
|
623
|
-
const isDataModel = ![
|
|
624
|
-
'connector',
|
|
625
|
-
'custom-connector',
|
|
626
|
-
'expression',
|
|
627
|
-
].includes(datasourceType);
|
|
628
651
|
if (!dataSourceName) {
|
|
629
652
|
this.setData({ loadingStatus: 'done' });
|
|
630
653
|
if (datasourceType !== 'expression') {
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
<
|
|
2
|
-
<block wx:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</block>
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
<view class="weui-form weda-ui wd-form wd-mp-form {{className}}" id="{{id}}" style="{{style}}">
|
|
2
|
+
<block wx:if="{{loadingStatus === 'loading'}}">
|
|
3
|
+
<view class="wedatea2td-action-state">
|
|
4
|
+
<view class="wedatea2td-mr-2n wedatea2td-icon wedatea2td-icon-loading" role="img" aria-label="loading"></view>
|
|
5
|
+
<view class="wedatea2td-action-state__text" title="数据加载中...">数据加载中...</view>
|
|
6
|
+
</view>
|
|
7
|
+
</block>
|
|
8
|
+
|
|
9
|
+
<block wx:if="{{errorObj.message}}">
|
|
10
|
+
<status-content errorObj="{{errorObj}}"></status-content>
|
|
11
|
+
</block>
|
|
12
|
+
<block wx:if="{{!errorObj.message}}">
|
|
13
|
+
<slot name="contentSlot" />
|
|
14
|
+
</block>
|
|
15
|
+
</view>
|
|
@@ -18,6 +18,21 @@
|
|
|
18
18
|
padding-bottom: 8px;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
.wd-mp-form {
|
|
22
|
+
position: relative;
|
|
23
|
+
}
|
|
24
|
+
.wd-mp-form .wedatea2td-action-state {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 0;
|
|
27
|
+
height: 100%;
|
|
28
|
+
width: 100%;
|
|
29
|
+
margin: 0 auto;
|
|
30
|
+
text-align: center;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
z-index: 9999;
|
|
34
|
+
background: #fff;
|
|
35
|
+
}
|
|
21
36
|
/*
|
|
22
37
|
表单模版内置样式 END }}}
|
|
23
38
|
*/
|