vxe-pc-ui 0.2.0 → 0.3.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.
- package/es/tabs/src/tabs.js +24 -5
- package/es/ui/src/core.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +33 -7
- package/lib/index.umd.min.js +1 -1
- package/lib/tabs/src/tabs.js +31 -5
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/ui/src/core.js +1 -1
- package/lib/ui/src/core.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/tabs/src/tabs.ts +24 -5
- package/types/components/tab-pane.d.ts +1 -1
- package/types/components/tabs.d.ts +2 -2
package/es/tabs/src/tabs.js
CHANGED
|
@@ -10,9 +10,14 @@ export default defineComponent({
|
|
|
10
10
|
destroyOnClose: Boolean,
|
|
11
11
|
type: String
|
|
12
12
|
},
|
|
13
|
-
emits: [
|
|
13
|
+
emits: [
|
|
14
|
+
'update:modelValue',
|
|
15
|
+
'click',
|
|
16
|
+
'change',
|
|
17
|
+
'load'
|
|
18
|
+
],
|
|
14
19
|
setup(props, context) {
|
|
15
|
-
const { slots } = context;
|
|
20
|
+
const { slots, emit } = context;
|
|
16
21
|
const xID = XEUtils.uniqueId();
|
|
17
22
|
const refElem = ref();
|
|
18
23
|
const refHeaderElem = ref();
|
|
@@ -73,12 +78,23 @@ export default defineComponent({
|
|
|
73
78
|
});
|
|
74
79
|
};
|
|
75
80
|
const clickEvent = (evnt, item) => {
|
|
76
|
-
const { initNames } = reactData;
|
|
81
|
+
const { initNames, activeName } = reactData;
|
|
77
82
|
const { name } = item;
|
|
83
|
+
let isInit = false;
|
|
84
|
+
const value = name;
|
|
78
85
|
if (!initNames.includes(name)) {
|
|
86
|
+
isInit = true;
|
|
79
87
|
initNames.push(name);
|
|
80
88
|
}
|
|
81
89
|
reactData.activeName = name;
|
|
90
|
+
emit('update:modelValue', value);
|
|
91
|
+
if (name !== activeName) {
|
|
92
|
+
emit('change', { value, name, $event: evnt });
|
|
93
|
+
}
|
|
94
|
+
emit('click', { name, $event: evnt });
|
|
95
|
+
if (isInit) {
|
|
96
|
+
emit('load', { name, $event: evnt });
|
|
97
|
+
}
|
|
82
98
|
updateLineStyle();
|
|
83
99
|
};
|
|
84
100
|
const renderTabHeader = (list) => {
|
|
@@ -94,6 +110,7 @@ export default defineComponent({
|
|
|
94
110
|
const { title, name, slots } = item;
|
|
95
111
|
const tabSlot = slots ? slots.tab : null;
|
|
96
112
|
return h('div', {
|
|
113
|
+
key: name,
|
|
97
114
|
class: ['vxe-tab-header--item', {
|
|
98
115
|
'is--active': activeName === name
|
|
99
116
|
}],
|
|
@@ -125,6 +142,7 @@ export default defineComponent({
|
|
|
125
142
|
default() {
|
|
126
143
|
return name && initNames.includes(name)
|
|
127
144
|
? h('div', {
|
|
145
|
+
key: name,
|
|
128
146
|
class: ['vxe-tab-pane--item', {
|
|
129
147
|
'is--visible': activeName === name
|
|
130
148
|
}]
|
|
@@ -137,7 +155,7 @@ export default defineComponent({
|
|
|
137
155
|
const { destroyOnClose } = props;
|
|
138
156
|
const activeOptionTab = computeActiveOptionTab.value;
|
|
139
157
|
if (destroyOnClose) {
|
|
140
|
-
return activeOptionTab ? renderOptionPane(activeOptionTab) : createCommentVNode();
|
|
158
|
+
return activeOptionTab ? [renderOptionPane(activeOptionTab)] : createCommentVNode();
|
|
141
159
|
}
|
|
142
160
|
return options.map(renderOptionPane);
|
|
143
161
|
};
|
|
@@ -147,6 +165,7 @@ export default defineComponent({
|
|
|
147
165
|
const defaultSlot = slots ? slots.default : null;
|
|
148
166
|
return name && initNames.includes(name)
|
|
149
167
|
? h('div', {
|
|
168
|
+
key: name,
|
|
150
169
|
class: ['vxe-tab-pane--item', {
|
|
151
170
|
'is--visible': activeName === name
|
|
152
171
|
}]
|
|
@@ -157,7 +176,7 @@ export default defineComponent({
|
|
|
157
176
|
const { destroyOnClose } = props;
|
|
158
177
|
const activeDefaultTab = computeActiveDefaultTab.value;
|
|
159
178
|
if (destroyOnClose) {
|
|
160
|
-
return activeDefaultTab ? renderDefaultPane(activeDefaultTab) : createCommentVNode();
|
|
179
|
+
return activeDefaultTab ? [renderDefaultPane(activeDefaultTab)] : createCommentVNode();
|
|
161
180
|
}
|
|
162
181
|
return staticTabs.map(renderDefaultPane);
|
|
163
182
|
};
|
package/es/ui/src/core.js
CHANGED
|
@@ -32,7 +32,7 @@ export function setIcon(options) {
|
|
|
32
32
|
export function getIcon(key) {
|
|
33
33
|
return arguments.length ? XEUtils.get(iconConfigStore, key) : iconConfigStore;
|
|
34
34
|
}
|
|
35
|
-
export const version = "0.
|
|
35
|
+
export const version = "0.3.0";
|
|
36
36
|
const VxeCore = {
|
|
37
37
|
version,
|
|
38
38
|
setConfig,
|
package/es/ui/src/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getI18n } from './i18n';
|
|
2
2
|
export function getLog(message, params) {
|
|
3
|
-
return `[vxe-table v${"0.
|
|
3
|
+
return `[vxe-table v${"0.3.0"}] ${getI18n(message, params)}`;
|
|
4
4
|
}
|
|
5
5
|
function outLog(type) {
|
|
6
6
|
return function (message, params) {
|
package/lib/index.umd.js
CHANGED
|
@@ -2163,7 +2163,7 @@ var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(9274);
|
|
|
2163
2163
|
;// CONCATENATED MODULE: ./packages/ui/src/log.ts
|
|
2164
2164
|
|
|
2165
2165
|
function getLog(message, params) {
|
|
2166
|
-
return `[vxe-table v${"0.
|
|
2166
|
+
return `[vxe-table v${"0.3.0"}] ${getI18n(message, params)}`;
|
|
2167
2167
|
}
|
|
2168
2168
|
function outLog(type) {
|
|
2169
2169
|
return function (message, params) {
|
|
@@ -2378,7 +2378,7 @@ function setIcon(options) {
|
|
|
2378
2378
|
function getIcon(key) {
|
|
2379
2379
|
return arguments.length ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(iconStore, key) : iconStore;
|
|
2380
2380
|
}
|
|
2381
|
-
const version = "0.
|
|
2381
|
+
const version = "0.3.0";
|
|
2382
2382
|
const VxeCore = {
|
|
2383
2383
|
version,
|
|
2384
2384
|
setConfig,
|
|
@@ -13682,10 +13682,11 @@ const TabPane = VxeTabPane;
|
|
|
13682
13682
|
destroyOnClose: Boolean,
|
|
13683
13683
|
type: String
|
|
13684
13684
|
},
|
|
13685
|
-
emits: [],
|
|
13685
|
+
emits: ['update:modelValue', 'click', 'change', 'load'],
|
|
13686
13686
|
setup(props, context) {
|
|
13687
13687
|
const {
|
|
13688
|
-
slots
|
|
13688
|
+
slots,
|
|
13689
|
+
emit
|
|
13689
13690
|
} = context;
|
|
13690
13691
|
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
13691
13692
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -13761,15 +13762,37 @@ const TabPane = VxeTabPane;
|
|
|
13761
13762
|
};
|
|
13762
13763
|
const clickEvent = (evnt, item) => {
|
|
13763
13764
|
const {
|
|
13764
|
-
initNames
|
|
13765
|
+
initNames,
|
|
13766
|
+
activeName
|
|
13765
13767
|
} = reactData;
|
|
13766
13768
|
const {
|
|
13767
13769
|
name
|
|
13768
13770
|
} = item;
|
|
13771
|
+
let isInit = false;
|
|
13772
|
+
const value = name;
|
|
13769
13773
|
if (!initNames.includes(name)) {
|
|
13774
|
+
isInit = true;
|
|
13770
13775
|
initNames.push(name);
|
|
13771
13776
|
}
|
|
13772
13777
|
reactData.activeName = name;
|
|
13778
|
+
emit('update:modelValue', value);
|
|
13779
|
+
if (name !== activeName) {
|
|
13780
|
+
emit('change', {
|
|
13781
|
+
value,
|
|
13782
|
+
name,
|
|
13783
|
+
$event: evnt
|
|
13784
|
+
});
|
|
13785
|
+
}
|
|
13786
|
+
emit('click', {
|
|
13787
|
+
name,
|
|
13788
|
+
$event: evnt
|
|
13789
|
+
});
|
|
13790
|
+
if (isInit) {
|
|
13791
|
+
emit('load', {
|
|
13792
|
+
name,
|
|
13793
|
+
$event: evnt
|
|
13794
|
+
});
|
|
13795
|
+
}
|
|
13773
13796
|
updateLineStyle();
|
|
13774
13797
|
};
|
|
13775
13798
|
const renderTabHeader = list => {
|
|
@@ -13794,6 +13817,7 @@ const TabPane = VxeTabPane;
|
|
|
13794
13817
|
} = item;
|
|
13795
13818
|
const tabSlot = slots ? slots.tab : null;
|
|
13796
13819
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
13820
|
+
key: name,
|
|
13797
13821
|
class: ['vxe-tab-header--item', {
|
|
13798
13822
|
'is--active': activeName === name
|
|
13799
13823
|
}],
|
|
@@ -13827,6 +13851,7 @@ const TabPane = VxeTabPane;
|
|
|
13827
13851
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(tab_pane, item, {
|
|
13828
13852
|
default() {
|
|
13829
13853
|
return name && initNames.includes(name) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
13854
|
+
key: name,
|
|
13830
13855
|
class: ['vxe-tab-pane--item', {
|
|
13831
13856
|
'is--visible': activeName === name
|
|
13832
13857
|
}]
|
|
@@ -13840,7 +13865,7 @@ const TabPane = VxeTabPane;
|
|
|
13840
13865
|
} = props;
|
|
13841
13866
|
const activeOptionTab = computeActiveOptionTab.value;
|
|
13842
13867
|
if (destroyOnClose) {
|
|
13843
|
-
return activeOptionTab ? renderOptionPane(activeOptionTab) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
13868
|
+
return activeOptionTab ? [renderOptionPane(activeOptionTab)] : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
13844
13869
|
}
|
|
13845
13870
|
return options.map(renderOptionPane);
|
|
13846
13871
|
};
|
|
@@ -13855,6 +13880,7 @@ const TabPane = VxeTabPane;
|
|
|
13855
13880
|
} = item;
|
|
13856
13881
|
const defaultSlot = slots ? slots.default : null;
|
|
13857
13882
|
return name && initNames.includes(name) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
13883
|
+
key: name,
|
|
13858
13884
|
class: ['vxe-tab-pane--item', {
|
|
13859
13885
|
'is--visible': activeName === name
|
|
13860
13886
|
}]
|
|
@@ -13866,7 +13892,7 @@ const TabPane = VxeTabPane;
|
|
|
13866
13892
|
} = props;
|
|
13867
13893
|
const activeDefaultTab = computeActiveDefaultTab.value;
|
|
13868
13894
|
if (destroyOnClose) {
|
|
13869
|
-
return activeDefaultTab ? renderDefaultPane(activeDefaultTab) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
13895
|
+
return activeDefaultTab ? [renderDefaultPane(activeDefaultTab)] : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
13870
13896
|
}
|
|
13871
13897
|
return staticTabs.map(renderDefaultPane);
|
|
13872
13898
|
};
|