bkui-vue 2.0.2-beta.87 → 2.0.2-beta.89

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.87";
6
+ export const version = "2.0.2-beta.89";
7
7
  window.__bkui_vue_version__ = version;
@@ -124,6 +124,7 @@ declare const BkInput: {
124
124
  onKeypress?: (_value: any, _evt: KeyboardEvent) => any;
125
125
  onKeyup?: (_value: any, _evt: KeyboardEvent) => any;
126
126
  onClear?: () => any;
127
+ onSearch?: (evt: Event) => any;
127
128
  onEnter?: (_value: any, _evt: KeyboardEvent) => any;
128
129
  "onUpdate:modelValue"?: (_value: any, _evt: KeyboardEvent) => any;
129
130
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -141,6 +142,7 @@ declare const BkInput: {
141
142
  compositionstart: (evt: CompositionEvent) => CompositionEvent;
142
143
  compositionupdate: (evt: CompositionEvent) => CompositionEvent;
143
144
  compositionend: (evt: CompositionEvent) => CompositionEvent;
145
+ search: (evt: Event) => Event;
144
146
  }, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
145
147
  type: import("vue-types").VueTypeValidableDef<string> & {
146
148
  default: string;
@@ -266,6 +268,7 @@ declare const BkInput: {
266
268
  onKeypress?: (_value: any, _evt: KeyboardEvent) => any;
267
269
  onKeyup?: (_value: any, _evt: KeyboardEvent) => any;
268
270
  onClear?: () => any;
271
+ onSearch?: (evt: Event) => any;
269
272
  onEnter?: (_value: any, _evt: KeyboardEvent) => any;
270
273
  "onUpdate:modelValue"?: (_value: any, _evt: KeyboardEvent) => any;
271
274
  }, {
@@ -429,6 +432,7 @@ declare const BkInput: {
429
432
  onKeypress?: (_value: any, _evt: KeyboardEvent) => any;
430
433
  onKeyup?: (_value: any, _evt: KeyboardEvent) => any;
431
434
  onClear?: () => any;
435
+ onSearch?: (evt: Event) => any;
432
436
  onEnter?: (_value: any, _evt: KeyboardEvent) => any;
433
437
  "onUpdate:modelValue"?: (_value: any, _evt: KeyboardEvent) => any;
434
438
  }, () => JSX.Element, {}, {}, {}, {
@@ -589,6 +593,7 @@ declare const BkInput: {
589
593
  onKeypress?: (_value: any, _evt: KeyboardEvent) => any;
590
594
  onKeyup?: (_value: any, _evt: KeyboardEvent) => any;
591
595
  onClear?: () => any;
596
+ onSearch?: (evt: Event) => any;
592
597
  onEnter?: (_value: any, _evt: KeyboardEvent) => any;
593
598
  "onUpdate:modelValue"?: (_value: any, _evt: KeyboardEvent) => any;
594
599
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -606,6 +611,7 @@ declare const BkInput: {
606
611
  compositionstart: (evt: CompositionEvent) => CompositionEvent;
607
612
  compositionupdate: (evt: CompositionEvent) => CompositionEvent;
608
613
  compositionend: (evt: CompositionEvent) => CompositionEvent;
614
+ search: (evt: Event) => Event;
609
615
  }, string, {
610
616
  type: string;
611
617
  prefix: string;
@@ -1658,6 +1658,7 @@ var EVENTS;
1658
1658
  EVENTS["KEYUP"] = "keyup";
1659
1659
  EVENTS["PASTE"] = "paste";
1660
1660
  EVENTS["UPDATE"] = "update:modelValue";
1661
+ EVENTS["SEARCH"] = "search";
1661
1662
  })(EVENTS || (EVENTS = {}));
1662
1663
  /* eslint-disable-next-line */
1663
1664
  function EventFunction(_value, _evt) {
@@ -1676,7 +1677,9 @@ var inputEmitEventsType = (_inputEmitEventsType = {}, _defineProperty(_definePro
1676
1677
  return evt;
1677
1678
  }), EVENTS.CHANGE, EventFunction), EVENTS.CLEAR, function () {
1678
1679
  return true;
1679
- }), EVENTS.INPUT, EventFunction), EVENTS.KEYPRESS, EventFunction), EVENTS.KEYDOWN, EventFunction), EVENTS.KEYUP, EventFunction), EVENTS.ENTER, EventFunction), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_inputEmitEventsType, EVENTS.PASTE, PastEventFunction), EVENTS.COMPOSITIONSTART, CompositionEventFunction), EVENTS.COMPOSITIONUPDATE, CompositionEventFunction), EVENTS.COMPOSITIONEND, CompositionEventFunction));
1680
+ }), EVENTS.INPUT, EventFunction), EVENTS.KEYPRESS, EventFunction), EVENTS.KEYDOWN, EventFunction), EVENTS.KEYUP, EventFunction), EVENTS.ENTER, EventFunction), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_inputEmitEventsType, EVENTS.PASTE, PastEventFunction), EVENTS.COMPOSITIONSTART, CompositionEventFunction), EVENTS.COMPOSITIONUPDATE, CompositionEventFunction), EVENTS.COMPOSITIONEND, CompositionEventFunction), EVENTS.SEARCH, function (evt) {
1681
+ return evt;
1682
+ }));
1680
1683
  /* harmony default export */ const input = ((0,external_vue_namespaceObject.defineComponent)({
1681
1684
  name: 'Input',
1682
1685
  directives: {
@@ -1714,7 +1717,9 @@ var inputEmitEventsType = (_inputEmitEventsType = {}, _defineProperty(_definePro
1714
1717
  var suffixCls = getCls('suffix-icon');
1715
1718
  var suffixIconMap = {
1716
1719
  search: function search() {
1717
- return (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Search, null, null);
1720
+ return (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Search, {
1721
+ "onClick": handleSearch
1722
+ }, null);
1718
1723
  },
1719
1724
  password: function password() {
1720
1725
  return (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Unvisible, {
@@ -1889,6 +1894,10 @@ var inputEmitEventsType = (_inputEmitEventsType = {}, _defineProperty(_definePro
1889
1894
  formItem === null || formItem === void 0 || (_formItem$validate2 = formItem.validate) === null || _formItem$validate2 === void 0 || _formItem$validate2.call(formItem, 'blur');
1890
1895
  }
1891
1896
  }
1897
+ // type = search suffix icon click event
1898
+ function handleSearch(e) {
1899
+ ctx.emit(EVENTS.SEARCH, e);
1900
+ }
1892
1901
  // 事件句柄生成器
1893
1902
  function eventHandler(eventName) {
1894
1903
  return function (e) {
@@ -131,7 +131,8 @@ export declare const enum EVENTS {
131
131
  KEYPRESS = "keypress",
132
132
  KEYUP = "keyup",
133
133
  PASTE = "paste",
134
- UPDATE = "update:modelValue"
134
+ UPDATE = "update:modelValue",
135
+ SEARCH = "search"
135
136
  }
136
137
  declare function EventFunction(_value: any, _evt: KeyboardEvent): any;
137
138
  declare function PastEventFunction(_value: any, _e: ClipboardEvent): boolean;
@@ -151,6 +152,7 @@ export declare const inputEmitEventsType: {
151
152
  compositionstart: typeof CompositionEventFunction;
152
153
  compositionupdate: typeof CompositionEventFunction;
153
154
  compositionend: typeof CompositionEventFunction;
155
+ search: (evt: Event) => Event;
154
156
  };
155
157
  export type InputType = ExtractPropTypes<typeof inputType>;
156
158
  declare const _default: import("vue").DefineComponent<{
@@ -280,6 +282,7 @@ declare const _default: import("vue").DefineComponent<{
280
282
  compositionstart: typeof CompositionEventFunction;
281
283
  compositionupdate: typeof CompositionEventFunction;
282
284
  compositionend: typeof CompositionEventFunction;
285
+ search: (evt: Event) => Event;
283
286
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
284
287
  type: import("vue-types").VueTypeValidableDef<string> & {
285
288
  default: string;
@@ -405,6 +408,7 @@ declare const _default: import("vue").DefineComponent<{
405
408
  onKeypress?: (_value: any, _evt: KeyboardEvent) => any;
406
409
  onKeyup?: (_value: any, _evt: KeyboardEvent) => any;
407
410
  onClear?: () => any;
411
+ onSearch?: (evt: Event) => any;
408
412
  onEnter?: (_value: any, _evt: KeyboardEvent) => any;
409
413
  "onUpdate:modelValue"?: (_value: any, _evt: KeyboardEvent) => any;
410
414
  }, {
@@ -418,8 +418,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
418
418
  ctx.emit('close');
419
419
  };
420
420
  var handleClickOutSide = function handleClickOutSide(e) {
421
- e.stopImmediatePropagation();
422
- e.stopPropagation();
421
+ var target = e.target;
422
+ // 判断点击的是否是当前 Dialog 的 mask(而不是子 Dialog 的 mask)
423
+ if (target !== maskRef.value) {
424
+ return; // 不是当前 Dialog 的 mask,不处理
425
+ }
423
426
  e.preventDefault();
424
427
  if (props.quickClose) {
425
428
  ctx.emit('quick-close');
@@ -34,9 +34,9 @@ declare const BkSearchSelect: {
34
34
  };
35
35
  }>> & {
36
36
  onCopy?: (...args: any[]) => any;
37
+ onSearch?: (...args: any[]) => any;
37
38
  "onUpdate:modelValue"?: (...args: any[]) => any;
38
39
  onSelectKey?: (...args: any[]) => any;
39
- onSearch?: (...args: any[]) => any;
40
40
  }, {
41
41
  inputRef: import("vue").Ref<import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
42
42
  data: {
@@ -436,9 +436,9 @@ declare const BkSearchSelect: {
436
436
  };
437
437
  }>> & {
438
438
  onCopy?: (...args: any[]) => any;
439
+ onSearch?: (...args: any[]) => any;
439
440
  "onUpdate:modelValue"?: (...args: any[]) => any;
440
441
  onSelectKey?: (...args: any[]) => any;
441
- onSearch?: (...args: any[]) => any;
442
442
  }, {
443
443
  data: Omit<import("./utils").ISearchItem, "value" | "isSelected">[];
444
444
  maxHeight: number;
@@ -500,9 +500,9 @@ declare const BkSearchSelect: {
500
500
  };
501
501
  }>> & {
502
502
  onCopy?: (...args: any[]) => any;
503
+ onSearch?: (...args: any[]) => any;
503
504
  "onUpdate:modelValue"?: (...args: any[]) => any;
504
505
  onSelectKey?: (...args: any[]) => any;
505
- onSearch?: (...args: any[]) => any;
506
506
  }, {
507
507
  inputRef: import("vue").Ref<import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
508
508
  data: {
@@ -914,9 +914,9 @@ declare const BkSearchSelect: {
914
914
  };
915
915
  }>> & {
916
916
  onCopy?: (...args: any[]) => any;
917
+ onSearch?: (...args: any[]) => any;
917
918
  "onUpdate:modelValue"?: (...args: any[]) => any;
918
919
  onSelectKey?: (...args: any[]) => any;
919
- onSearch?: (...args: any[]) => any;
920
920
  }, {
921
921
  inputRef: import("vue").Ref<import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
922
922
  data: {
@@ -467,9 +467,9 @@ declare const _default: import("vue").DefineComponent<{
467
467
  };
468
468
  }>> & {
469
469
  onCopy?: (...args: any[]) => any;
470
+ onSearch?: (...args: any[]) => any;
470
471
  "onUpdate:modelValue"?: (...args: any[]) => any;
471
472
  onSelectKey?: (...args: any[]) => any;
472
- onSearch?: (...args: any[]) => any;
473
473
  }, {
474
474
  data: Omit<ISearchItem, "value" | "isSelected">[];
475
475
  maxHeight: number;
@@ -4294,6 +4294,9 @@ function select_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { v
4294
4294
  var handleInputChange = function handleInputChange(value) {
4295
4295
  if (!filterable.value) return;
4296
4296
  customOptionName.value = value;
4297
+ if (!(value !== null && value !== void 0 && value.length)) {
4298
+ emitChange(multiple.value ? [] : '');
4299
+ }
4297
4300
  };
4298
4301
  // allow create(创建自定义选项)
4299
4302
  var handleCreateCustomOption = function handleCreateCustomOption(val, e) {
@@ -10,6 +10,31 @@ declare const BkSideslider: {
10
10
  default: string;
11
11
  validator: (value: string) => boolean;
12
12
  };
13
+ resizable: import("vue-types").VueTypeValidableDef<boolean> & {
14
+ default: boolean;
15
+ } & {
16
+ default: boolean;
17
+ };
18
+ minWidth: import("vue-types").VueTypeValidableDef<number> & {
19
+ default: number;
20
+ } & {
21
+ default: number;
22
+ };
23
+ maxWidth: import("vue-types").VueTypeValidableDef<number> & {
24
+ default: number;
25
+ } & {
26
+ default: number;
27
+ };
28
+ triggerWidth: import("vue-types").VueTypeValidableDef<number> & {
29
+ default: number;
30
+ } & {
31
+ default: number;
32
+ };
33
+ immediate: import("vue-types").VueTypeValidableDef<boolean> & {
34
+ default: boolean;
35
+ } & {
36
+ default: boolean;
37
+ };
13
38
  isShow: import("vue-types").VueTypeValidableDef<boolean> & {
14
39
  default: boolean;
15
40
  } & {
@@ -75,8 +100,11 @@ declare const BkSideslider: {
75
100
  onShown?: (...args: any[]) => any;
76
101
  onClosed?: (...args: any[]) => any;
77
102
  "onUpdate:isShow"?: (...args: any[]) => any;
103
+ "onBefore-resize"?: (...args: any[]) => any;
104
+ onResizing?: (...args: any[]) => any;
105
+ "onAfter-resize"?: (...args: any[]) => any;
78
106
  "onAnimation-end"?: (...args: any[]) => any;
79
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("hidden" | "shown" | "closed" | "update:isShow" | "animation-end")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
107
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("hidden" | "shown" | "closed" | "update:isShow" | "before-resize" | "resizing" | "after-resize" | "animation-end")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
80
108
  title: import("vue-types").VueTypeValidableDef<string> & {
81
109
  default: string;
82
110
  } & {
@@ -87,6 +115,31 @@ declare const BkSideslider: {
87
115
  default: string;
88
116
  validator: (value: string) => boolean;
89
117
  };
118
+ resizable: import("vue-types").VueTypeValidableDef<boolean> & {
119
+ default: boolean;
120
+ } & {
121
+ default: boolean;
122
+ };
123
+ minWidth: import("vue-types").VueTypeValidableDef<number> & {
124
+ default: number;
125
+ } & {
126
+ default: number;
127
+ };
128
+ maxWidth: import("vue-types").VueTypeValidableDef<number> & {
129
+ default: number;
130
+ } & {
131
+ default: number;
132
+ };
133
+ triggerWidth: import("vue-types").VueTypeValidableDef<number> & {
134
+ default: number;
135
+ } & {
136
+ default: number;
137
+ };
138
+ immediate: import("vue-types").VueTypeValidableDef<boolean> & {
139
+ default: boolean;
140
+ } & {
141
+ default: boolean;
142
+ };
90
143
  isShow: import("vue-types").VueTypeValidableDef<boolean> & {
91
144
  default: boolean;
92
145
  } & {
@@ -152,9 +205,13 @@ declare const BkSideslider: {
152
205
  onShown?: (...args: any[]) => any;
153
206
  onClosed?: (...args: any[]) => any;
154
207
  "onUpdate:isShow"?: (...args: any[]) => any;
208
+ "onBefore-resize"?: (...args: any[]) => any;
209
+ onResizing?: (...args: any[]) => any;
210
+ "onAfter-resize"?: (...args: any[]) => any;
155
211
  "onAnimation-end"?: (...args: any[]) => any;
156
212
  }, {
157
213
  title: string;
214
+ maxWidth: number;
158
215
  extCls: string;
159
216
  left: string;
160
217
  top: string;
@@ -163,6 +220,7 @@ declare const BkSideslider: {
163
220
  backgroundColor: string;
164
221
  transfer: string | boolean | HTMLElement;
165
222
  direction: string;
223
+ resizable: boolean;
166
224
  fullscreen: boolean;
167
225
  showMask: boolean;
168
226
  closeIcon: boolean;
@@ -170,6 +228,9 @@ declare const BkSideslider: {
170
228
  quickClose: boolean;
171
229
  animateType: string;
172
230
  beforeClose: () => boolean | Promise<boolean>;
231
+ minWidth: number;
232
+ triggerWidth: number;
233
+ immediate: boolean;
173
234
  }, true, {}, {}, {
174
235
  P: {};
175
236
  B: {};
@@ -188,6 +249,31 @@ declare const BkSideslider: {
188
249
  default: string;
189
250
  validator: (value: string) => boolean;
190
251
  };
252
+ resizable: import("vue-types").VueTypeValidableDef<boolean> & {
253
+ default: boolean;
254
+ } & {
255
+ default: boolean;
256
+ };
257
+ minWidth: import("vue-types").VueTypeValidableDef<number> & {
258
+ default: number;
259
+ } & {
260
+ default: number;
261
+ };
262
+ maxWidth: import("vue-types").VueTypeValidableDef<number> & {
263
+ default: number;
264
+ } & {
265
+ default: number;
266
+ };
267
+ triggerWidth: import("vue-types").VueTypeValidableDef<number> & {
268
+ default: number;
269
+ } & {
270
+ default: number;
271
+ };
272
+ immediate: import("vue-types").VueTypeValidableDef<boolean> & {
273
+ default: boolean;
274
+ } & {
275
+ default: boolean;
276
+ };
191
277
  isShow: import("vue-types").VueTypeValidableDef<boolean> & {
192
278
  default: boolean;
193
279
  } & {
@@ -253,9 +339,13 @@ declare const BkSideslider: {
253
339
  onShown?: (...args: any[]) => any;
254
340
  onClosed?: (...args: any[]) => any;
255
341
  "onUpdate:isShow"?: (...args: any[]) => any;
342
+ "onBefore-resize"?: (...args: any[]) => any;
343
+ onResizing?: (...args: any[]) => any;
344
+ "onAfter-resize"?: (...args: any[]) => any;
256
345
  "onAnimation-end"?: (...args: any[]) => any;
257
346
  }, () => JSX.Element, {}, {}, {}, {
258
347
  title: string;
348
+ maxWidth: number;
259
349
  extCls: string;
260
350
  left: string;
261
351
  top: string;
@@ -264,6 +354,7 @@ declare const BkSideslider: {
264
354
  backgroundColor: string;
265
355
  transfer: string | boolean | HTMLElement;
266
356
  direction: string;
357
+ resizable: boolean;
267
358
  fullscreen: boolean;
268
359
  showMask: boolean;
269
360
  closeIcon: boolean;
@@ -271,6 +362,9 @@ declare const BkSideslider: {
271
362
  quickClose: boolean;
272
363
  animateType: string;
273
364
  beforeClose: () => boolean | Promise<boolean>;
365
+ minWidth: number;
366
+ triggerWidth: number;
367
+ immediate: boolean;
274
368
  }>;
275
369
  __isFragment?: never;
276
370
  __isTeleport?: never;
@@ -286,6 +380,31 @@ declare const BkSideslider: {
286
380
  default: string;
287
381
  validator: (value: string) => boolean;
288
382
  };
383
+ resizable: import("vue-types").VueTypeValidableDef<boolean> & {
384
+ default: boolean;
385
+ } & {
386
+ default: boolean;
387
+ };
388
+ minWidth: import("vue-types").VueTypeValidableDef<number> & {
389
+ default: number;
390
+ } & {
391
+ default: number;
392
+ };
393
+ maxWidth: import("vue-types").VueTypeValidableDef<number> & {
394
+ default: number;
395
+ } & {
396
+ default: number;
397
+ };
398
+ triggerWidth: import("vue-types").VueTypeValidableDef<number> & {
399
+ default: number;
400
+ } & {
401
+ default: number;
402
+ };
403
+ immediate: import("vue-types").VueTypeValidableDef<boolean> & {
404
+ default: boolean;
405
+ } & {
406
+ default: boolean;
407
+ };
289
408
  isShow: import("vue-types").VueTypeValidableDef<boolean> & {
290
409
  default: boolean;
291
410
  } & {
@@ -351,9 +470,13 @@ declare const BkSideslider: {
351
470
  onShown?: (...args: any[]) => any;
352
471
  onClosed?: (...args: any[]) => any;
353
472
  "onUpdate:isShow"?: (...args: any[]) => any;
473
+ "onBefore-resize"?: (...args: any[]) => any;
474
+ onResizing?: (...args: any[]) => any;
475
+ "onAfter-resize"?: (...args: any[]) => any;
354
476
  "onAnimation-end"?: (...args: any[]) => any;
355
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("hidden" | "shown" | "closed" | "update:isShow" | "animation-end")[], "hidden" | "shown" | "closed" | "update:isShow" | "animation-end", {
477
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("hidden" | "shown" | "closed" | "update:isShow" | "before-resize" | "resizing" | "after-resize" | "animation-end")[], "hidden" | "shown" | "closed" | "update:isShow" | "before-resize" | "resizing" | "after-resize" | "animation-end", {
356
478
  title: string;
479
+ maxWidth: number;
357
480
  extCls: string;
358
481
  left: string;
359
482
  top: string;
@@ -362,6 +485,7 @@ declare const BkSideslider: {
362
485
  backgroundColor: string;
363
486
  transfer: string | boolean | HTMLElement;
364
487
  direction: string;
488
+ resizable: boolean;
365
489
  fullscreen: boolean;
366
490
  showMask: boolean;
367
491
  closeIcon: boolean;
@@ -369,5 +493,8 @@ declare const BkSideslider: {
369
493
  quickClose: boolean;
370
494
  animateType: string;
371
495
  beforeClose: () => boolean | Promise<boolean>;
496
+ minWidth: number;
497
+ triggerWidth: number;
498
+ immediate: boolean;
372
499
  }, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin<any[]>;
373
500
  export default BkSideslider;
@@ -506,7 +506,7 @@ function _defineProperty(obj, key, value) {
506
506
  ;// CONCATENATED MODULE: external "vue"
507
507
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
508
508
  var external_vue_y = x => () => x
509
- const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentInstance"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["useAttrs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.useAttrs, ["useSlots"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.useSlots });
509
+ const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentInstance"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["useAttrs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.useAttrs, ["useSlots"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.useSlots, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withModifiers"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withModifiers });
510
510
  // EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
511
511
  var regenerator = __webpack_require__(2841);
512
512
  var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
@@ -591,9 +591,14 @@ sliderProps.width["default"] = '400';
591
591
  }
592
592
  return true;
593
593
  }
594
- }
594
+ },
595
+ resizable: shared_namespaceObject.PropTypes.bool.def(false),
596
+ minWidth: shared_namespaceObject.PropTypes.number.def(400),
597
+ maxWidth: shared_namespaceObject.PropTypes.number.def(Infinity),
598
+ triggerWidth: shared_namespaceObject.PropTypes.number.def(5),
599
+ immediate: shared_namespaceObject.PropTypes.bool.def(false) // 是否实时拖拽(拖拽时立即改变宽度)
595
600
  }),
596
- emits: ['closed', 'update:isShow', 'shown', 'hidden', 'animation-end'],
601
+ emits: ['closed', 'update:isShow', 'shown', 'hidden', 'animation-end', 'before-resize', 'resizing', 'after-resize'],
597
602
  setup: function setup(props, _ref) {
598
603
  var emit = _ref.emit;
599
604
  var attrs = (0,external_vue_namespaceObject.useAttrs)();
@@ -601,6 +606,20 @@ sliderProps.width["default"] = '400';
601
606
  var instance = (0,external_vue_namespaceObject.getCurrentInstance)();
602
607
  var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
603
608
  resolveClassName = _usePrefix.resolveClassName;
609
+ // 拖拽相关状态
610
+ var currentWidth = (0,external_vue_namespaceObject.ref)(typeof props.width === 'number' ? props.width : parseInt(props.width) || 400);
611
+ // 代理线
612
+ var resizeProxyRef = (0,external_vue_namespaceObject.ref)(null);
613
+ // 遮罩
614
+ var resizeMaskRef = (0,external_vue_namespaceObject.ref)(null);
615
+ // modalWrapper
616
+ var modalWrapperRef = (0,external_vue_namespaceObject.ref)(null);
617
+ // content
618
+ var contentRef = (0,external_vue_namespaceObject.ref)(null);
619
+ // trigger
620
+ var triggerRef = (0,external_vue_namespaceObject.ref)(null);
621
+ // state
622
+ var state = (0,external_vue_namespaceObject.ref)({});
604
623
  var handleClose = /*#__PURE__*/function () {
605
624
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee() {
606
625
  var shouldClose;
@@ -634,10 +653,118 @@ sliderProps.width["default"] = '400';
634
653
  }();
635
654
  var handleShown = function handleShown() {
636
655
  emit('shown');
656
+ // 当侧边栏显示后,获取 modalWrapper 的引用
657
+ if (props.resizable && contentRef.value) {
658
+ (0,external_vue_namespaceObject.nextTick)(function () {
659
+ var _contentRef$value;
660
+ // 从当前实例的 content 元素向上查找 modal-wrapper,避免多个实例冲突
661
+ var element = (_contentRef$value = contentRef.value) === null || _contentRef$value === void 0 ? void 0 : _contentRef$value.parentElement;
662
+ while (element) {
663
+ if (element.classList.contains(resolveClassName('modal-wrapper'))) {
664
+ modalWrapperRef.value = element;
665
+ break;
666
+ }
667
+ element = element.parentElement;
668
+ }
669
+ });
670
+ }
637
671
  };
638
672
  var handleHidden = function handleHidden() {
639
673
  emit('hidden');
674
+ // 清理引用
675
+ if (props.resizable) {
676
+ modalWrapperRef.value = null;
677
+ }
640
678
  };
679
+ // 获取实际宽度值(限制在 min 和 max 之间)
680
+ var getRealValue = function getRealValue(current) {
681
+ var screenWidth = window.innerWidth;
682
+ var maxAllowed = Math.min(props.maxWidth, screenWidth - 100); // 至少留100px空间
683
+ return Math.min(maxAllowed, Math.max(props.minWidth, current));
684
+ };
685
+ // 更新 resizeProxy 的样式
686
+ var updateResizeProxyStyle = function updateResizeProxyStyle(width) {
687
+ if (!resizeProxyRef.value) return;
688
+ resizeProxyRef.value.style.visibility = 'visible';
689
+ if (props.direction === 'left') {
690
+ resizeProxyRef.value.style.inset = "0 auto 0 ".concat(width, "px");
691
+ } else {
692
+ resizeProxyRef.value.style.inset = "0 ".concat(width, "px 0 auto");
693
+ }
694
+ };
695
+ // 更新遮罩的样式
696
+ var updateResizeMaskStyle = function updateResizeMaskStyle(show) {
697
+ if (!resizeMaskRef.value) return;
698
+ resizeMaskRef.value.style.display = show ? 'block' : 'none';
699
+ resizeMaskRef.value.style.cursor = 'col-resize';
700
+ };
701
+ // mousedown 事件处理
702
+ var handleMousedown = function handleMousedown(event) {
703
+ var _modalWrapperRef$valu;
704
+ var mouseEvent = event;
705
+ if (!props.resizable) return;
706
+ emit('before-resize', mouseEvent);
707
+ var rect = (_modalWrapperRef$valu = modalWrapperRef.value) === null || _modalWrapperRef$valu === void 0 ? void 0 : _modalWrapperRef$valu.getBoundingClientRect();
708
+ if (!rect) return;
709
+ // 在 immediate 模式下,先同步 currentWidth 为实际宽度,避免闪动
710
+ if (props.immediate) {
711
+ currentWidth.value = rect.width;
712
+ }
713
+ state.value = Object.freeze({
714
+ mouse: {
715
+ clientX: mouseEvent.clientX
716
+ },
717
+ sidebar: {
718
+ width: rect.width
719
+ }
720
+ });
721
+ updateResizeMaskStyle(true);
722
+ // 非 immediate 模式下显示代理线
723
+ if (!props.immediate) {
724
+ updateResizeProxyStyle(rect.width);
725
+ }
726
+ var finalWidth = rect.width;
727
+ var handleMouseMove = function handleMouseMove(event) {
728
+ var delta;
729
+ if (props.direction === 'left') {
730
+ delta = event.clientX - state.value.mouse.clientX;
731
+ } else {
732
+ delta = state.value.mouse.clientX - event.clientX;
733
+ }
734
+ var newWidth = state.value.sidebar.width + delta;
735
+ finalWidth = getRealValue(newWidth);
736
+ // immediate 模式:直接更新宽度
737
+ if (props.immediate) {
738
+ currentWidth.value = finalWidth;
739
+ } else {
740
+ // 非 immediate 模式:更新代理线位置
741
+ updateResizeProxyStyle(finalWidth);
742
+ }
743
+ emit('resizing', finalWidth);
744
+ };
745
+ var handleMouseUp = function handleMouseUp() {
746
+ if (resizeProxyRef.value) {
747
+ resizeProxyRef.value.style.visibility = 'hidden';
748
+ }
749
+ updateResizeMaskStyle(false);
750
+ document.removeEventListener('mousemove', handleMouseMove);
751
+ document.removeEventListener('mouseup', handleMouseUp);
752
+ // 只在非 immediate 模式下才需要最后更新宽度
753
+ if (!props.immediate) {
754
+ currentWidth.value = finalWidth;
755
+ }
756
+ emit('after-resize', finalWidth);
757
+ };
758
+ document.addEventListener('mousemove', handleMouseMove);
759
+ document.addEventListener('mouseup', handleMouseUp);
760
+ };
761
+ // 监听 width prop 变化
762
+ (0,external_vue_namespaceObject.watch)(function () {
763
+ return props.width;
764
+ }, function (newWidth) {
765
+ var width = typeof newWidth === 'number' ? newWidth : parseInt(newWidth) || 400;
766
+ currentWidth.value = width;
767
+ });
641
768
  return function () {
642
769
  var modelSlot = {
643
770
  header: function header() {
@@ -656,8 +783,17 @@ sliderProps.width["default"] = '400';
656
783
  "default": function _default() {
657
784
  var _slots$default;
658
785
  return (0,external_vue_namespaceObject.createVNode)("div", {
786
+ "ref": contentRef,
659
787
  "class": "".concat(resolveClassName('sideslider-content'))
660
- }, [(_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)]);
788
+ }, [(_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots), props.resizable && (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)("i", {
789
+ "ref": triggerRef,
790
+ "style": "width: ".concat(props.triggerWidth, "px;"),
791
+ "class": "".concat(resolveClassName('sideslider-resize-trigger')),
792
+ "onMousedown": (0,external_vue_namespaceObject.withModifiers)(handleMousedown, ['left'])
793
+ }, null), (0,external_vue_namespaceObject.createVNode)("i", {
794
+ "ref": resizeProxyRef,
795
+ "class": ["".concat(resolveClassName('sideslider-resize-proxy')), props.direction]
796
+ }, null)])]);
661
797
  }
662
798
  };
663
799
  if (slots.footer) {
@@ -673,9 +809,9 @@ sliderProps.width["default"] = '400';
673
809
  if (instance.vnode.scopeId) {
674
810
  inheritAttrs[instance.vnode.scopeId] = '';
675
811
  }
676
- return (0,external_vue_namespaceObject.createVNode)(modal_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)(inheritAttrs, {
677
- "width": props.width,
678
- "class": _defineProperty(_defineProperty({}, resolveClassName('sideslider'), true), "is-position-".concat(props.direction), props.direction),
812
+ return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)(modal_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)(inheritAttrs, {
813
+ "width": currentWidth.value,
814
+ "class": _defineProperty(_defineProperty(_defineProperty({}, resolveClassName('sideslider'), true), "is-position-".concat(props.direction), props.direction), "".concat(resolveClassName('sideslider-resizable')), props.resizable),
679
815
  "extCls": props.extCls,
680
816
  "animateType": props.direction,
681
817
  "backgroundColor": props.backgroundColor,
@@ -694,7 +830,10 @@ sliderProps.width["default"] = '400';
694
830
  "default": function _default() {
695
831
  return [modelSlot];
696
832
  }
697
- });
833
+ }), props.resizable && (0,external_vue_namespaceObject.createVNode)("div", {
834
+ "ref": resizeMaskRef,
835
+ "class": "".concat(resolveClassName('sideslider-resize-mask'))
836
+ }, null)]);
698
837
  };
699
838
  }
700
839
  }));