@cloudbase/weda-ui-mp 3.22.3 → 3.23.0
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.
|
@@ -1480,6 +1480,33 @@ textarea {
|
|
|
1480
1480
|
margin-left: 0.25rem;
|
|
1481
1481
|
}
|
|
1482
1482
|
|
|
1483
|
+
.wd-form-tag-input-wrap.wd-form-input-wrap.size-height-md {
|
|
1484
|
+
position: relative;
|
|
1485
|
+
height: auto;
|
|
1486
|
+
min-height: var(--wd-form-item-height-md);
|
|
1487
|
+
}
|
|
1488
|
+
.wd-form-tag-input-wrap.wd-form-input-wrap.size-height-md .wedatea2td-tag-group {
|
|
1489
|
+
font-size: inherit;
|
|
1490
|
+
width: calc(100% - 1rem);
|
|
1491
|
+
display: flex;
|
|
1492
|
+
align-items: center;
|
|
1493
|
+
flex-wrap: wrap;
|
|
1494
|
+
padding: 0.25rem 0;
|
|
1495
|
+
}
|
|
1496
|
+
.wd-form-tag-input-wrap.wd-form-input-wrap.size-height-md .wedatea2td-tag-group .wedatea2td-tag--edit {
|
|
1497
|
+
display: inline-flex;
|
|
1498
|
+
}
|
|
1499
|
+
.wd-form-tag-input-wrap.wd-form-input-wrap.size-height-md .wedatea2td-tag-group input {
|
|
1500
|
+
flex-grow: 1;
|
|
1501
|
+
width: min-content;
|
|
1502
|
+
margin-top: 0.25rem;
|
|
1503
|
+
margin-right: 0.25rem;
|
|
1504
|
+
}
|
|
1505
|
+
.wd-form-tag-input-wrap.wd-form-input-wrap.size-height-md .wd-form-input-wrap__after {
|
|
1506
|
+
position: absolute;
|
|
1507
|
+
right: 0.25rem;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1483
1510
|
.wd-form-input-wrap.size-font-sm {
|
|
1484
1511
|
font: var(--wd-typography-body-sm);
|
|
1485
1512
|
}
|
|
@@ -196,6 +196,33 @@
|
|
|
196
196
|
margin-left: 0.25rem;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
.wd-form-tag-input-wrap.wd-form-input-wrap.size-height-md {
|
|
200
|
+
position: relative;
|
|
201
|
+
height: auto;
|
|
202
|
+
min-height: var(--wd-form-item-height-md);
|
|
203
|
+
}
|
|
204
|
+
.wd-form-tag-input-wrap.wd-form-input-wrap.size-height-md .wedatea2td-tag-group {
|
|
205
|
+
font-size: inherit;
|
|
206
|
+
width: calc(100% - 1rem);
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
flex-wrap: wrap;
|
|
210
|
+
padding: 0.25rem 0;
|
|
211
|
+
}
|
|
212
|
+
.wd-form-tag-input-wrap.wd-form-input-wrap.size-height-md .wedatea2td-tag-group .wedatea2td-tag--edit {
|
|
213
|
+
display: inline-flex;
|
|
214
|
+
}
|
|
215
|
+
.wd-form-tag-input-wrap.wd-form-input-wrap.size-height-md .wedatea2td-tag-group input {
|
|
216
|
+
flex-grow: 1;
|
|
217
|
+
width: min-content;
|
|
218
|
+
margin-top: 0.25rem;
|
|
219
|
+
margin-right: 0.25rem;
|
|
220
|
+
}
|
|
221
|
+
.wd-form-tag-input-wrap.wd-form-input-wrap.size-height-md .wd-form-input-wrap__after {
|
|
222
|
+
position: absolute;
|
|
223
|
+
right: 0.25rem;
|
|
224
|
+
}
|
|
225
|
+
|
|
199
226
|
.wd-form-input-wrap.size-font-sm {
|
|
200
227
|
font: var(--wd-typography-body-sm);
|
|
201
228
|
}
|
|
@@ -69,22 +69,17 @@ Component({
|
|
|
69
69
|
},
|
|
70
70
|
observers: {
|
|
71
71
|
tabs: function (tabs) {
|
|
72
|
-
const tabsData = filterMenuData(
|
|
73
|
-
(tabs.isMultiTerminal ? tabs.mobileMenuData : tabs.menuData) || []
|
|
74
|
-
);
|
|
72
|
+
const tabsData = filterMenuData((tabs.isMultiTerminal ? tabs.mobileMenuData : tabs.menuData) || []);
|
|
75
73
|
this.findSelectItem(tabsData);
|
|
76
74
|
this.init(tabs);
|
|
77
75
|
},
|
|
78
76
|
},
|
|
79
77
|
methods: {
|
|
80
|
-
...handleEvents([{ title: '点击', name: 'tap' }]),
|
|
81
78
|
updateWidgetAPI() {
|
|
82
79
|
this.setReadonlyAttributes &&
|
|
83
80
|
this.setReadonlyAttributes({
|
|
84
81
|
tabs: this.data.tabsData,
|
|
85
|
-
selectedTab: this.data.tabsData?.find?.(
|
|
86
|
-
(item) => item.key === this.data.selectedKey
|
|
87
|
-
),
|
|
82
|
+
selectedTab: this.data.tabsData?.find?.((item) => item.key === this.data.selectedKey),
|
|
88
83
|
setSelectTab: this.setSelectTab.bind(this),
|
|
89
84
|
});
|
|
90
85
|
},
|
|
@@ -92,11 +87,7 @@ Component({
|
|
|
92
87
|
* 设置选中项
|
|
93
88
|
* @param {string} key
|
|
94
89
|
*/
|
|
95
|
-
setSelectTab(
|
|
96
|
-
{ key, isNavigate = true } = {},
|
|
97
|
-
tabsData = this.data.tabsData,
|
|
98
|
-
isInit = false
|
|
99
|
-
) {
|
|
90
|
+
setSelectTab({ key, isNavigate = true } = {}, tabsData = this.data.tabsData, isInit = false) {
|
|
100
91
|
const selectItem = this.findSelectItem(tabsData, key);
|
|
101
92
|
|
|
102
93
|
if (!selectItem) return;
|
|
@@ -119,14 +110,11 @@ Component({
|
|
|
119
110
|
const { $w } = app?.__internal__ || {};
|
|
120
111
|
|
|
121
112
|
const currentPath = `/${$w?.page?.uuid || $w?.page?.id}`;
|
|
122
|
-
const menuPath = `${
|
|
123
|
-
item.subPackageName ? `/${item.subPackageName}` : ''
|
|
124
|
-
}${item.path || ''}`;
|
|
113
|
+
const menuPath = `${item.subPackageName ? `/${item.subPackageName}` : ''}${item.path || ''}`;
|
|
125
114
|
if (
|
|
126
115
|
item?.type === 'route' &&
|
|
127
116
|
item?.path &&
|
|
128
|
-
(currentPath !== menuPath.split('?')[0] ||
|
|
129
|
-
!judgeMenuPathAndCurrentPath(menuPath))
|
|
117
|
+
(currentPath !== menuPath.split('?')[0] || !judgeMenuPathAndCurrentPath(menuPath))
|
|
130
118
|
) {
|
|
131
119
|
(app?.[this.properties.routeType] || app.navigateTo)?.({
|
|
132
120
|
pageId: item.path.replace('/', ''),
|
|
@@ -140,9 +128,7 @@ Component({
|
|
|
140
128
|
* @param {*} tabs
|
|
141
129
|
*/
|
|
142
130
|
init(tabs = this.properties.tabs) {
|
|
143
|
-
const tabsData = filterMenuData(
|
|
144
|
-
(tabs.isMultiTerminal ? tabs.mobileMenuData : tabs.menuData) || []
|
|
145
|
-
);
|
|
131
|
+
const tabsData = filterMenuData((tabs.isMultiTerminal ? tabs.mobileMenuData : tabs.menuData) || []);
|
|
146
132
|
const selectItem = this.findSelectItem(tabsData) || {};
|
|
147
133
|
this.setSelectTab({ key: selectItem.key }, tabsData, true);
|
|
148
134
|
this.setData({ tabsData });
|
|
@@ -154,13 +140,14 @@ Component({
|
|
|
154
140
|
*/
|
|
155
141
|
tabClick(itemInfo) {
|
|
156
142
|
const tab = itemInfo?.currentTarget?.dataset?.tab;
|
|
143
|
+
this.triggerEvent('tap', { tab });
|
|
157
144
|
|
|
158
145
|
const { key, disabled } = tab;
|
|
159
146
|
if (disabled || this.data.selectedKey === key) return;
|
|
160
147
|
|
|
161
148
|
this.setData({ selectedKey: key });
|
|
162
149
|
this.updateWidgetAPI();
|
|
163
|
-
this.triggerEvent('change', { item: tab });
|
|
150
|
+
this.triggerEvent('change', { tab, item: tab });
|
|
164
151
|
this.navigateTo(tab);
|
|
165
152
|
},
|
|
166
153
|
/**
|
|
@@ -177,15 +164,12 @@ Component({
|
|
|
177
164
|
const currentPath = `/${$w?.page?.uuid || $w?.page?.id}`;
|
|
178
165
|
|
|
179
166
|
for (let i = 0; i < len; i++) {
|
|
180
|
-
const menuPath = `${
|
|
181
|
-
tabs[i].subPackageName ? `/${tabs[i].subPackageName}` : ''
|
|
182
|
-
}${tabs[i].path}`;
|
|
167
|
+
const menuPath = `${tabs[i].subPackageName ? `/${tabs[i].subPackageName}` : ''}${tabs[i].path}`;
|
|
183
168
|
|
|
184
169
|
if (
|
|
185
170
|
tabs[i].isSelect ||
|
|
186
171
|
tabs[i].key === selectedKey ||
|
|
187
|
-
(currentPath === menuPath.split('?')[0] &&
|
|
188
|
-
judgeMenuPathAndCurrentPath(menuPath))
|
|
172
|
+
(currentPath === menuPath.split('?')[0] && judgeMenuPathAndCurrentPath(menuPath))
|
|
189
173
|
)
|
|
190
174
|
return tabs[i];
|
|
191
175
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<wxs module="tools"> function includes(tabItem) { return tabItem.iconUrl && tabItem.iconUrl.indexOf('http') !== -1 ? 'custom' : 'inner' } module.exports = { includes: includes } </wxs>
|
|
2
2
|
<view id="{{id}}" style="{{style}}" class="{{className}} {{classPrefix + '-tabbar'}} {{classPrefix + '-mp-tabbar'}}">
|
|
3
|
-
<view wx:for="{{tabsData}}" wx:key="tabIndex" wx:for-item="tabItem" class="{{classPrefix + '-tabbar__item'}} {{selectedKey === tabItem.key ? 'is-selected' : ''}}"
|
|
3
|
+
<view wx:for="{{tabsData}}" wx:key="tabIndex" wx:for-item="tabItem" class="{{classPrefix + '-tabbar__item'}} {{selectedKey === tabItem.key ? 'is-selected' : ''}}" catchtap="tabClick" data-tab="{{tabItem}}">
|
|
4
4
|
<view class="{{classPrefix + '-tabbar__item-icon'}}">
|
|
5
5
|
<wd-icon wx:if="{{tabItem.iconUrl}}" name="{{tabItem.iconUrl}}" src="{{tabItem.iconUrl}}" type="{{tools.includes(tabItem)}}" />
|
|
6
6
|
<wd-icon wx:elif="{{tabItem.selectedIconPath || tabItem.iconPath}}" name="{{selectedKey === tabItem.key? tabItem.selectedIconPath : tabItem.iconPath}}" src="{{selectedKey === tabItem.key? tabItem.selectedIconPath : tabItem.iconPath}}" type="custom" />
|