bkui-vue 2.0.2-beta.46 → 2.0.2-beta.47

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/lib/index.js CHANGED
@@ -3,5 +3,5 @@ export * from './hooks';
3
3
  export { default } from './preset';
4
4
  export * from './config-provider';
5
5
  export * from './directives';
6
- export const version = "2.0.2-beta.46";
6
+ export const version = "2.0.2-beta.47";
7
7
  window.__bkui_vue_version__ = version;
@@ -45,6 +45,9 @@ declare const BkTab: {
45
45
  } & {
46
46
  default: string;
47
47
  };
48
+ beforeChange: {
49
+ type: FunctionConstructor;
50
+ };
48
51
  }>> & {
49
52
  onDrag?: (...args: any[]) => any;
50
53
  onChange?: (...args: any[]) => any;
@@ -107,6 +110,9 @@ declare const BkTab: {
107
110
  } & {
108
111
  default: string;
109
112
  };
113
+ beforeChange: {
114
+ type: FunctionConstructor;
115
+ };
110
116
  }>> & {
111
117
  onDrag?: (...args: any[]) => any;
112
118
  onChange?: (...args: any[]) => any;
@@ -180,6 +186,9 @@ declare const BkTab: {
180
186
  } & {
181
187
  default: string;
182
188
  };
189
+ beforeChange: {
190
+ type: FunctionConstructor;
191
+ };
183
192
  }>> & {
184
193
  onDrag?: (...args: any[]) => any;
185
194
  onChange?: (...args: any[]) => any;
@@ -259,6 +268,9 @@ declare const BkTab: {
259
268
  } & {
260
269
  default: string;
261
270
  };
271
+ beforeChange: {
272
+ type: FunctionConstructor;
273
+ };
262
274
  }>> & {
263
275
  onDrag?: (...args: any[]) => any;
264
276
  onChange?: (...args: any[]) => any;
package/lib/tab/index.js CHANGED
@@ -856,7 +856,10 @@ var tabProps = {
856
856
  extCls: shared_namespaceObject.PropTypes.string.def(''),
857
857
  validateActive: shared_namespaceObject.PropTypes.bool.def(true),
858
858
  activeBarSize: shared_namespaceObject.PropTypes.number.def(2),
859
- activeBarColor: shared_namespaceObject.PropTypes.string.def('#3a84ff')
859
+ activeBarColor: shared_namespaceObject.PropTypes.string.def('#3a84ff'),
860
+ beforeChange: {
861
+ type: Function
862
+ }
860
863
  };
861
864
  var tabNavProps = _objectSpread({
862
865
  active: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.number, shared_namespaceObject.PropTypes.string]).def(''),
@@ -1999,10 +2002,13 @@ function tab_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
1999
2002
  });
2000
2003
  },
2001
2004
  tabChange: function tabChange(name) {
2002
- // emit('xxx') 会调用onXxx函数, 所以不必在主动调用onXxx函数了
2003
- emit('change', name);
2004
- emit('tab-change', name);
2005
- emit('update:active', name);
2005
+ var _props$beforeChange, _props$beforeChange2;
2006
+ if ((_props$beforeChange = (_props$beforeChange2 = _props.beforeChange) === null || _props$beforeChange2 === void 0 ? void 0 : _props$beforeChange2.call(_props, name)) !== null && _props$beforeChange !== void 0 ? _props$beforeChange : true) {
2007
+ // emit('xxx') 会调用onXxx函数, 所以不必在主动调用onXxx函数了
2008
+ emit('change', name);
2009
+ emit('tab-change', name);
2010
+ emit('update:active', name);
2011
+ }
2006
2012
  },
2007
2013
  tabRemove: function tabRemove(index, panel) {
2008
2014
  // emit('xxx') 会调用onXxx函数, 所以不必在主动调用onXxx函数了
@@ -152,6 +152,9 @@ export declare const tabProps: {
152
152
  } & {
153
153
  default: string;
154
154
  };
155
+ beforeChange: {
156
+ type: FunctionConstructor;
157
+ };
155
158
  };
156
159
  export declare const tabNavProps: {
157
160
  tabAdd: {
package/lib/tab/tab.d.ts CHANGED
@@ -39,6 +39,9 @@ declare const _default: import("vue").DefineComponent<{
39
39
  } & {
40
40
  default: string;
41
41
  };
42
+ beforeChange: {
43
+ type: FunctionConstructor;
44
+ };
42
45
  }, {
43
46
  isMounted: import("vue").Ref<boolean>;
44
47
  panels: import("vue").Ref<any[]>;
@@ -89,6 +92,9 @@ declare const _default: import("vue").DefineComponent<{
89
92
  } & {
90
93
  default: string;
91
94
  };
95
+ beforeChange: {
96
+ type: FunctionConstructor;
97
+ };
92
98
  }>> & {
93
99
  onDrag?: (...args: any[]) => any;
94
100
  onChange?: (...args: any[]) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "2.0.2-beta.46",
3
+ "version": "2.0.2-beta.47",
4
4
  "workspaces": [
5
5
  "packages/**",
6
6
  "scripts/cli",