bkui-vue 0.0.2-beta.133 → 0.0.2-beta.135

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.
@@ -70,7 +70,7 @@
70
70
  .bk-popper[data-popper-placement^='right'] > .bk-popper-arrow {
71
71
  left: -4px;
72
72
  }
73
- .bk-cascader-popover.bk-pop2-content {
73
+ .bk-cascader-popover.bk-pop2-content.bk-popover {
74
74
  padding: 0;
75
75
  }
76
76
  .bk-cascader-popover-wrapper {
@@ -218,6 +218,7 @@ declare const _default: import("vue").DefineComponent<{
218
218
  displayText: import("vue").ComputedRef<any>;
219
219
  resolveClassName: (cls: string) => string;
220
220
  isShowPanel: import("vue").Ref<boolean>;
221
+ searchBlueHandler: () => void;
221
222
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "focus" | "toggle" | "clear" | "update:modelValue")[], "change" | "focus" | "toggle" | "clear" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
222
223
  modelValue: import("vue-types").VueTypeDef<(string | number | string[])[]>;
223
224
  list: import("vue-types").VueTypeValidableDef<unknown[]> & {
@@ -1,7 +1,7 @@
1
1
  @import '../styles/themes/themes.less';
2
2
  @import '../styles/mixins/mixins.less';
3
3
 
4
- .@{bk-prefix}-cascader-popover.@{bk-prefix}-pop2-content {
4
+ .@{bk-prefix}-cascader-popover.@{bk-prefix}-pop2-content.bk-popover {
5
5
  padding: 0;
6
6
  }
7
7
  .@{bk-prefix}-cascader-popover-wrapper {
@@ -196,7 +196,7 @@
196
196
  .bk-popper[data-popper-placement^='right'] > .bk-popper-arrow {
197
197
  left: -4px;
198
198
  }
199
- .bk-cascader-popover.bk-pop2-content {
199
+ .bk-cascader-popover.bk-pop2-content.bk-popover {
200
200
  padding: 0;
201
201
  }
202
202
  .bk-cascader-popover-wrapper {
@@ -318,6 +318,7 @@ declare const BkCascader: {
318
318
  displayText: import("vue").ComputedRef<any>;
319
319
  resolveClassName: (cls: string) => string;
320
320
  isShowPanel: import("vue").Ref<boolean>;
321
+ searchBlueHandler: () => void;
321
322
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "focus" | "toggle" | "clear" | "update:modelValue")[], string, {
322
323
  extCls: string;
323
324
  disabled: boolean;
@@ -589,6 +590,7 @@ declare const BkCascader: {
589
590
  displayText: import("vue").ComputedRef<any>;
590
591
  resolveClassName: (cls: string) => string;
591
592
  isShowPanel: import("vue").Ref<boolean>;
593
+ searchBlueHandler: () => void;
592
594
  }> & {} & import("vue").ComponentCustomProperties & {};
593
595
  __isFragment?: never;
594
596
  __isTeleport?: never;
@@ -818,6 +820,7 @@ declare const BkCascader: {
818
820
  displayText: import("vue").ComputedRef<any>;
819
821
  resolveClassName: (cls: string) => string;
820
822
  isShowPanel: import("vue").Ref<boolean>;
823
+ searchBlueHandler: () => void;
821
824
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "focus" | "toggle" | "clear" | "update:modelValue")[], "change" | "focus" | "toggle" | "clear" | "update:modelValue", {
822
825
  extCls: string;
823
826
  disabled: boolean;
@@ -1673,6 +1673,15 @@ var Store = /*#__PURE__*/function () {
1673
1673
  var updateSearchKey = function updateSearchKey() {
1674
1674
  searchKey.value = selectedText.value;
1675
1675
  };
1676
+ var searchBlueHandler = function searchBlueHandler() {
1677
+ // 单选搜索框与选择框互斥,因此一旦失去焦点,认为是没有选择,还原选择框的内容
1678
+ if (!props.multiple) {
1679
+ searchKey.value = selectedText.value;
1680
+ return;
1681
+ }
1682
+ // 多选下,失去焦点则需要删除搜索框
1683
+ searchKey.value = '';
1684
+ };
1676
1685
  // 更新选中
1677
1686
  var updateValue = function updateValue(val) {
1678
1687
  // 更新多选情况下的选中标签
@@ -1737,6 +1746,8 @@ var Store = /*#__PURE__*/function () {
1737
1746
  oldValue !== undefined && emit('change', value); // oldValue = undefined代表初始化,init不派发change事件
1738
1747
  // 如果有过滤搜索,选择后,自动focus到input
1739
1748
  inputRef === null || inputRef === void 0 || (_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 ? void 0 : _inputRef$value.focus();
1749
+ // 选择后过滤条件清除,面板初始化渲染
1750
+ isFiltering.value = false;
1740
1751
  };
1741
1752
  // list的监听函数
1742
1753
  var listChangeHandler = function listChangeHandler() {
@@ -1855,7 +1866,8 @@ var Store = /*#__PURE__*/function () {
1855
1866
  isEdit: isEdit,
1856
1867
  displayText: displayText,
1857
1868
  resolveClassName: resolveClassName,
1858
- isShowPanel: isShowPanel
1869
+ isShowPanel: isShowPanel,
1870
+ searchBlueHandler: searchBlueHandler
1859
1871
  };
1860
1872
  },
1861
1873
  render: function render() {
@@ -1952,6 +1964,7 @@ var Store = /*#__PURE__*/function () {
1952
1964
  }],
1953
1965
  "type": "text",
1954
1966
  "onInput": _this.searchInputHandler,
1967
+ "onBlur": _this.searchBlueHandler,
1955
1968
  "placeholder": _this.calcuPlaceholder,
1956
1969
  "value": _this.searchKey,
1957
1970
  "disabled": _this.disabled,
@@ -2547,6 +2547,17 @@ var timeProps = {
2547
2547
  confirm: {
2548
2548
  type: Boolean,
2549
2549
  "default": false
2550
+ },
2551
+ selectionMode: {
2552
+ type: String,
2553
+ "default": 'date',
2554
+ validator: function validator(v) {
2555
+ if (['year', 'month', 'date', 'time'].indexOf(v) < 0) {
2556
+ console.error("selectionMode property is not valid: '".concat(v, "'"));
2557
+ return false;
2558
+ }
2559
+ return true;
2560
+ }
2550
2561
  }
2551
2562
  };
2552
2563
  // function injectStrict<T>(key: InjectionKey<T>, fallback?: T) {
@@ -2642,7 +2653,8 @@ var timeProps = {
2642
2653
  return newDate["set".concat((0,external_shared_namespaceObject.capitalize)(type))](date[type]);
2643
2654
  });
2644
2655
  if (isEmit) {
2645
- emit('pick', newDate, true, 'time');
2656
+ // pick 参数:dates, visible, type, isUseShortCut
2657
+ emit('pick', newDate, true, props.selectionMode);
2646
2658
  }
2647
2659
  }
2648
2660
  function handlePickClick() {
@@ -2861,7 +2873,10 @@ var datePanelProps = {
2861
2873
  state.pickerTable = getTableType(state.currentView);
2862
2874
  }
2863
2875
  };
2864
- var handlePick = function handlePick(value, type) {
2876
+ var handlePick = function handlePick(value) {
2877
+ var _visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2878
+ var type = arguments.length > 2 ? arguments[2] : undefined;
2879
+ var _shortcut = arguments.length > 3 ? arguments[3] : undefined;
2865
2880
  var val = value;
2866
2881
  if (props.selectionMode === 'year') {
2867
2882
  val = new Date(value.getFullYear(), 0, 1);
@@ -2871,6 +2886,7 @@ var datePanelProps = {
2871
2886
  val = new Date(value);
2872
2887
  }
2873
2888
  state.dates = [val];
2889
+ // pick 参数:dates, visible, type, isUseShortCut
2874
2890
  emit('pick', val, false, type || props.selectionMode);
2875
2891
  };
2876
2892
  var handlePickSuccess = function handlePickSuccess() {
@@ -2884,7 +2900,7 @@ var datePanelProps = {
2884
2900
  var handleShortcutClick = function handleShortcutClick(shortcut) {
2885
2901
  if (shortcut.value) {
2886
2902
  // pick 参数:dates, visible, type, isUseShortCut
2887
- emit('pick', shortcut.value(), false, undefined, shortcut);
2903
+ emit('pick', shortcut.value(), false, props.selectionMode, shortcut);
2888
2904
  }
2889
2905
  if (shortcut.onClick) {
2890
2906
  shortcut.onClick(_this);
@@ -3099,6 +3115,7 @@ var datePanelProps = {
3099
3115
  "ref": "timePickerRef",
3100
3116
  "value": this.dates,
3101
3117
  "format": this.format,
3118
+ "selectionMode": this.selectionMode,
3102
3119
  "disabledDate": this.disabledDate,
3103
3120
  "onPick": this.handlePick,
3104
3121
  "onPick-click": this.handlePickClick,
@@ -3175,6 +3192,17 @@ var timeRangeProps = {
3175
3192
  allowCrossDay: {
3176
3193
  type: Boolean,
3177
3194
  "default": false
3195
+ },
3196
+ selectionMode: {
3197
+ type: String,
3198
+ "default": 'date',
3199
+ validator: function validator(v) {
3200
+ if (['year', 'month', 'date', 'time'].indexOf(v) < 0) {
3201
+ console.error("selectionMode property is not valid: '".concat(v, "'"));
3202
+ return false;
3203
+ }
3204
+ return true;
3205
+ }
3178
3206
  }
3179
3207
  };
3180
3208
  /* harmony default export */ const time_range = ((0,external_vue_namespaceObject.defineComponent)({
@@ -3285,7 +3313,8 @@ var timeRangeProps = {
3285
3313
  }
3286
3314
  }
3287
3315
  if (isEmit) {
3288
- emit('pick', [dateStart, dateEnd], true, 'time');
3316
+ // pick 参数:dates, visible, type, isUseShortCut
3317
+ emit('pick', [dateStart, dateEnd], true, props.selectionMode);
3289
3318
  }
3290
3319
  }
3291
3320
  function handleStartChange(date) {
@@ -3650,6 +3679,7 @@ var dateRangePanelProps = {
3650
3679
  * handleConfirm
3651
3680
  */
3652
3681
  var handleConfirm = function handleConfirm(visible, type) {
3682
+ // pick 参数:dates, visible, type, isUseShortCut
3653
3683
  emit('pick', state.dates, visible, type || props.type);
3654
3684
  };
3655
3685
  /**
@@ -3680,7 +3710,7 @@ var dateRangePanelProps = {
3680
3710
  selecting: false
3681
3711
  };
3682
3712
  }
3683
- handleConfirm(false, type || 'date');
3713
+ handleConfirm(false, type || props.selectionMode);
3684
3714
  } else {
3685
3715
  state.upToNowEnable = new Date(val).getTime() < new Date().getTime();
3686
3716
  state.rangeState = {
@@ -3726,6 +3756,7 @@ var dateRangePanelProps = {
3726
3756
  state.rangeState.to = to;
3727
3757
  state.dates = [form, to];
3728
3758
  state.selectedIndex = index;
3759
+ // pick 参数:dates, visible, type, isUseShortCut
3729
3760
  emit('pick', value, false, 'shortcut', shortcut);
3730
3761
  if (props.shortcutClose) {
3731
3762
  emit('pick-success');
@@ -4079,6 +4110,7 @@ var dateRangePanelProps = {
4079
4110
  }
4080
4111
  }() : '']), [[external_vue_namespaceObject.vShow, !this.isTime]]), this.isTime ? (0,external_vue_namespaceObject.createVNode)(time_range, {
4081
4112
  "ref": "timePickerRef",
4113
+ "selectionMode": this.selectionMode,
4082
4114
  "value": this.dates,
4083
4115
  "format": this.format,
4084
4116
  "disabledDate": this.disabledDate,
@@ -4162,7 +4194,7 @@ function date_picker_objectSpread(target) { for (var i = 1; i < arguments.length
4162
4194
  if (props.shortcutSelectedIndex !== -1) {
4163
4195
  shortcut = props.shortcuts[props.shortcutSelectedIndex] || null;
4164
4196
  if (shortcut) {
4165
- initialValue = shortcut.value();
4197
+ initialValue = [shortcut.value()];
4166
4198
  }
4167
4199
  }
4168
4200
  var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
@@ -108,7 +108,7 @@ declare const _default: import("vue").DefineComponent<{
108
108
  readonly default: () => {};
109
109
  };
110
110
  }, {
111
- panelPickerHandlers: import("vue").ComputedRef<(value: any, type: any) => void>;
111
+ panelPickerHandlers: import("vue").ComputedRef<(value: any, _visible: boolean, type: any, _shortcut: any) => void>;
112
112
  datePanelLabel: import("vue").ComputedRef<{
113
113
  separator: any;
114
114
  labels: any[];
@@ -126,7 +126,7 @@ declare const _default: import("vue").DefineComponent<{
126
126
  handleToggleTime: () => void;
127
127
  handlePickSuccess: () => void;
128
128
  handlePickClear: () => void;
129
- handlePick: (value: any, type: any) => void;
129
+ handlePick: (value: any, _visible: boolean, type: any, _shortcut: any) => void;
130
130
  handlePickClick: () => void;
131
131
  timePickerRef: any;
132
132
  resolveClassName: (cls: string) => string;
@@ -1,4 +1,5 @@
1
1
  import type { ExtractPropTypes, PropType } from 'vue';
2
+ import { SelectionModeType } from '../interface';
2
3
  declare const timeRangeProps: {
3
4
  steps: {
4
5
  type: PropType<number[]>;
@@ -16,6 +17,11 @@ declare const timeRangeProps: {
16
17
  type: BooleanConstructor;
17
18
  default: boolean;
18
19
  };
20
+ selectionMode: {
21
+ type: PropType<SelectionModeType>;
22
+ default: string;
23
+ validator(v: any): boolean;
24
+ };
19
25
  };
20
26
  export type TimeRangePanelProps = Readonly<ExtractPropTypes<typeof timeRangeProps>>;
21
27
  declare const _default: import("vue").DefineComponent<{
@@ -35,6 +41,11 @@ declare const _default: import("vue").DefineComponent<{
35
41
  type: BooleanConstructor;
36
42
  default: boolean;
37
43
  };
44
+ selectionMode: {
45
+ type: PropType<SelectionModeType>;
46
+ default: string;
47
+ validator(v: any): boolean;
48
+ };
38
49
  disabledHours: {
39
50
  readonly type: ArrayConstructor;
40
51
  readonly default: () => any[];
@@ -322,6 +333,11 @@ declare const _default: import("vue").DefineComponent<{
322
333
  type: BooleanConstructor;
323
334
  default: boolean;
324
335
  };
336
+ selectionMode: {
337
+ type: PropType<SelectionModeType>;
338
+ default: string;
339
+ validator(v: any): boolean;
340
+ };
325
341
  disabledHours: {
326
342
  readonly type: ArrayConstructor;
327
343
  readonly default: () => any[];
@@ -492,5 +508,6 @@ declare const _default: import("vue").DefineComponent<{
492
508
  disabledSeconds: unknown[];
493
509
  hideDisabledOptions: boolean;
494
510
  enterMode: boolean;
511
+ selectionMode: SelectionModeType;
495
512
  }, {}>;
496
513
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import type { ExtractPropTypes, PropType } from 'vue';
2
- import { IDisabledHMS } from '../interface';
2
+ import { IDisabledHMS, SelectionModeType } from '../interface';
3
3
  declare const timeProps: {
4
4
  disabledDate: {
5
5
  type: FunctionConstructor;
@@ -21,6 +21,11 @@ declare const timeProps: {
21
21
  type: BooleanConstructor;
22
22
  default: boolean;
23
23
  };
24
+ selectionMode: {
25
+ type: PropType<SelectionModeType>;
26
+ default: string;
27
+ validator(v: any): boolean;
28
+ };
24
29
  };
25
30
  export type TimePanelProps = Readonly<ExtractPropTypes<typeof timeProps>>;
26
31
  declare const _default: import("vue").DefineComponent<{
@@ -44,6 +49,11 @@ declare const _default: import("vue").DefineComponent<{
44
49
  type: BooleanConstructor;
45
50
  default: boolean;
46
51
  };
52
+ selectionMode: {
53
+ type: PropType<SelectionModeType>;
54
+ default: string;
55
+ validator(v: any): boolean;
56
+ };
47
57
  disabledHours: {
48
58
  readonly type: ArrayConstructor;
49
59
  readonly default: () => any[];
@@ -273,6 +283,11 @@ declare const _default: import("vue").DefineComponent<{
273
283
  type: BooleanConstructor;
274
284
  default: boolean;
275
285
  };
286
+ selectionMode: {
287
+ type: PropType<SelectionModeType>;
288
+ default: string;
289
+ validator(v: any): boolean;
290
+ };
276
291
  disabledHours: {
277
292
  readonly type: ArrayConstructor;
278
293
  readonly default: () => any[];
@@ -448,5 +463,6 @@ declare const _default: import("vue").DefineComponent<{
448
463
  disabledSeconds: unknown[];
449
464
  hideDisabledOptions: boolean;
450
465
  enterMode: boolean;
466
+ selectionMode: SelectionModeType;
451
467
  }, {}>;
452
468
  export default _default;
@@ -475,7 +475,7 @@ function _defineProperty(obj, key, value) {
475
475
  ;// CONCATENATED MODULE: external "vue"
476
476
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
477
477
  var external_vue_y = x => () => x
478
- const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
478
+ const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
479
479
  ;// CONCATENATED MODULE: ../../node_modules/resize-detector/esm/index.js
480
480
  var raf = null;
481
481
  function requestAnimationFrame (callback) {
@@ -1696,7 +1696,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
1696
1696
  if (!usingItem.value && !keyword.value) {
1697
1697
  emit('delete');
1698
1698
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
1699
- (0,external_vue_namespaceObject.nextTick)(setMenuList);
1699
+ setTimeout(setMenuList, 16);
1700
1700
  return;
1701
1701
  }
1702
1702
  if ((_usingItem$value10 = usingItem.value) !== null && _usingItem$value10 !== void 0 && _usingItem$value10.values.length) {
@@ -190,6 +190,7 @@
190
190
  }
191
191
  .bk-picker-panel-content .bk-picker-panel-content .bk-time-picker-cells {
192
192
  min-width: 216px;
193
+ position: relative;
193
194
  }
194
195
  .bk-picker-panel-content .bk-picker-panel-content .bk-time-picker-cells-with-seconds {
195
196
  min-width: 216px;
@@ -223,6 +223,7 @@
223
223
 
224
224
  .@{bk-prefix}-picker-panel-content .@{bk-prefix}-picker-panel-content .@{bk-prefix}-time-picker-cells {
225
225
  min-width: 216px;
226
+ position: relative;
226
227
  }
227
228
 
228
229
  .@{bk-prefix}-picker-panel-content .@{bk-prefix}-picker-panel-content .@{bk-prefix}-time-picker-cells-with-seconds {
@@ -316,6 +316,7 @@
316
316
  }
317
317
  .bk-picker-panel-content .bk-picker-panel-content .bk-time-picker-cells {
318
318
  min-width: 216px;
319
+ position: relative;
319
320
  }
320
321
  .bk-picker-panel-content .bk-picker-panel-content .bk-time-picker-cells-with-seconds {
321
322
  min-width: 216px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "0.0.2-beta.133",
3
+ "version": "0.0.2-beta.135",
4
4
  "workspaces": {
5
5
  "packages": [
6
6
  "packages/!(**.bak)*",