@king-design/vue 3.3.0 → 3.3.2

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.
@@ -9,7 +9,7 @@ var typeDefs = {
9
9
  };
10
10
  var defaults = function defaults() {
11
11
  return {
12
- separator: '>'
12
+ separator: ''
13
13
  };
14
14
  };
15
15
  export var Breadcrumb = /*#__PURE__*/function (_Component) {
@@ -1,9 +1,13 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/extends";
2
2
  import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
3
- import { createElementVNode as _$ce, noop as _$no, className as _$cn, createVNode as _$cv } from 'intact-vue-next';
3
+ import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc, noop as _$no, className as _$cn, createVNode as _$cv } from 'intact-vue-next';
4
4
  import { getRestProps, mapChildren } from '../utils';
5
5
  import { BreadcrumbItem } from './item';
6
6
  import { makeStyles } from './styles';
7
+ import { Icon } from '../icon';
8
+ var _$tmp0 = {
9
+ 'className': 'k-icon-right'
10
+ };
7
11
  export default function ($props, $blocks, $__proto__) {
8
12
  var _classNameObj;
9
13
  $blocks || ($blocks = {});
@@ -17,7 +21,7 @@ export default function ($props, $blocks, $__proto__) {
17
21
  className = _this$get.className;
18
22
  var k = this.config.k;
19
23
  var classNameObj = (_classNameObj = {}, _classNameObj[k + "-breadcrumb"] = true, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
20
- var separatorVNode = _$ce(2, 'span', (_$blocks['separator'] = function ($super) {
24
+ var separatorVNode = _$ce(2, 'span', !$blocks.separator && !separator ? _$cc(Icon, _$tmp0) : (_$blocks['separator'] = function ($super) {
21
25
  return separator;
22
26
  }, __$blocks['separator'] = function ($super, data) {
23
27
  var block = $blocks['separator'];
@@ -1,6 +1,7 @@
1
1
  import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
2
  import _extends from "@babel/runtime-corejs3/helpers/extends";
3
3
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
4
+ import _valuesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/values";
4
5
  import template from './index.vdt';
5
6
  import { BaseSelect } from '../select/base';
6
7
  import { _$ } from '../../i18n';
@@ -41,7 +42,7 @@ export var Cascader = /*#__PURE__*/function (_BaseSelect) {
41
42
  _this.value = useValue();
42
43
  _this.label = useLabel(_this.fields);
43
44
  _this.load = useLoad(_this.fields);
44
- _this.filterable = useFilterable(_this.input.keywords, _this.value.setValue, _this.fields);
45
+ _this.filterable = useFilterable(_this.input.keywords, _this.value.setValue, _this.fields, _valuesInstanceProperty(_this.value));
45
46
  _this.positionObj = {
46
47
  my: 'left top',
47
48
  at: 'right top',
@@ -433,4 +433,36 @@ describe('Cascader', function () {
433
433
  }
434
434
  }, _callee10);
435
435
  })));
436
+ it('should only show submenu while the root menu will show', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
437
+ var _mount10, instance, element, _element$querySelecto2, dom, input;
438
+ return _regeneratorRuntime.wrap(function _callee11$(_context14) {
439
+ while (1) switch (_context14.prev = _context14.next) {
440
+ case 0:
441
+ _mount10 = mount(FilterDemo), instance = _mount10[0], element = _mount10[1];
442
+ instance.set('values', [['beijing', 'haidian']]);
443
+ _context14.next = 4;
444
+ return wait();
445
+ case 4:
446
+ _element$querySelecto2 = element.querySelectorAll('.k-cascader'), dom = _element$querySelecto2[1];
447
+ dispatchEvent(dom, 'click');
448
+ _context14.next = 8;
449
+ return wait();
450
+ case 8:
451
+ input = dom.querySelector('.k-input-inner'); // should show layer when input empty string
452
+ input.value = 's';
453
+ dispatchEvent(input, 'input');
454
+ _context14.next = 13;
455
+ return wait();
456
+ case 13:
457
+ document.body.click();
458
+ _context14.next = 16;
459
+ return wait();
460
+ case 16:
461
+ expect(getElement('.k-cascader-menu')).to.not.exist;
462
+ case 17:
463
+ case "end":
464
+ return _context14.stop();
465
+ }
466
+ }, _callee11);
467
+ })));
436
468
  });
@@ -17,7 +17,8 @@ export default function ($props, $blocks, $__proto__) {
17
17
  trigger = _this$get.trigger,
18
18
  filterable = _this$get.filterable,
19
19
  fields = _this$get.fields,
20
- multiple = _this$get.multiple;
20
+ multiple = _this$get.multiple,
21
+ show = _this$get.show;
21
22
  var k = this.config.k;
22
23
  var baseMenuStyles = makeMenuStyles(k);
23
24
  var classNameObj = (_classNameObj = {}, _classNameObj[k + "-cascader-menu"] = true, _classNameObj[makeMenuStyles(k)] = true, _classNameObj);
@@ -41,7 +42,7 @@ export default function ($props, $blocks, $__proto__) {
41
42
  }
42
43
  return _mapInstanceProperty(data).call(data, function (item, index) {
43
44
  var value = getField(item, 'value');
44
- var showed = isShowed(value, level);
45
+ var showed = show && isShowed(value, level);
45
46
  var selected = parentSelected && isSelected(value, level);
46
47
  var children = getField(item, 'children');
47
48
  var Item = function Item() {
@@ -74,7 +75,8 @@ export default function ($props, $blocks, $__proto__) {
74
75
  var _this$filterable = this.filterable,
75
76
  filter = _filterInstanceProperty(_this$filterable),
76
77
  keywords = _this$filterable.keywords.value,
77
- selectByFilter = _this$filterable.selectByFilter;
78
+ selectByFilter = _this$filterable.selectByFilter,
79
+ isSelectedItem = _this$filterable.isSelectedItem;
78
80
  return _$su.call($this, {
79
81
  'className': _$cn(k + "-cascader")
80
82
  }, function ($blocks) {
@@ -93,9 +95,12 @@ export default function ($props, $blocks, $__proto__) {
93
95
  var items = filter();
94
96
  if (!items.length) return _$ce(2, 'div', _$('无匹配数据'), 0, _$cn(k + "-cascader-empty"));
95
97
  return _$ma(items, function ($value, $key) {
98
+ var _$cn4;
96
99
  return _$cc(DropdownItem, {
97
100
  'ev-select': selectByFilter.bind(null, $value),
98
101
  'disabled': $value.disabled,
102
+ 'hideOnSelect': !multiple,
103
+ 'className': _$cn((_$cn4 = {}, _$cn4[k + "-selected"] = isSelectedItem($value), _$cn4)),
99
104
  'children': function () {
100
105
  // highlight keywords
101
106
  var label = _mapInstanceProperty($value).call($value, function (item) {
@@ -43,5 +43,5 @@ export var makeMenuStyles = cache(function makeMenuStyles(k) {
43
43
  return /*#__PURE__*/css("min-width:", cascader.width, "!important;height:", cascader.height, ";overflow:auto;.", k, "-cascader-arrow{float:right;height:100%;margin-left:", cascader.arrowGap, ";line-height:inherit;}.", k, "-cascader-loading{display:block;text-align:center;margin-top:", cascader.loadingGap, ";}.", k, "-cascader-empty{padding:", cascader.empty.padding, ";color:", cascader.empty.color, ";text-align:center;}.", k, "-cascader-option{&.", k, "-selected{color:", cascader.selectedColor, ";}&.", k, "-active{background:", cascader.activeBgColor, ";}}");
44
44
  });
45
45
  export var makeFilterMenuStyles = cache(function makeFilterMenuStyles(k) {
46
- return /*#__PURE__*/css("min-width:", _filterInstanceProperty(cascader).minWidth, "!important;height:auto;max-height:", _filterInstanceProperty(cascader).maxHeight, ";em{font-style:normal;color:", _filterInstanceProperty(cascader).highlightColor, ";}");
46
+ return /*#__PURE__*/css("min-width:", _filterInstanceProperty(cascader).minWidth, "!important;height:auto;max-height:", _filterInstanceProperty(cascader).maxHeight, ";em{font-style:normal;color:", _filterInstanceProperty(cascader).highlightColor, ";}.", k, "-dropdown-item.", k, "-selected{color:", cascader.selectedColor, ";}");
47
47
  });
@@ -2,8 +2,9 @@ import type { CascaderData } from './';
2
2
  import { State } from '../../hooks/useState';
3
3
  import type { Value } from './useValue';
4
4
  import type { useFields } from './useFields';
5
- export declare function useFilterable(keywords: State<string>, setValue: (value: Value) => void, getField: ReturnType<typeof useFields>): {
5
+ export declare function useFilterable(keywords: State<string>, setValue: (value: Value) => void, getField: ReturnType<typeof useFields>, values: State<Value[]>): {
6
6
  filter: () => CascaderData<any>[][];
7
7
  selectByFilter: (data: CascaderData<any>[]) => void;
8
8
  keywords: State<string>;
9
+ isSelectedItem: (data: CascaderData<any>[]) => boolean;
9
10
  };
@@ -1,9 +1,11 @@
1
1
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
2
2
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
3
3
  import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/slice";
4
+ import _findInstanceProperty from "@babel/runtime-corejs3/core-js/instance/find";
4
5
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
5
6
  import { useInstance } from 'intact-vue-next';
6
- export function useFilterable(keywords, setValue, getField) {
7
+ import { isEqualArray } from '../utils';
8
+ export function useFilterable(keywords, setValue, getField, values) {
7
9
  var instance = useInstance();
8
10
  function filter() {
9
11
  var ret = [];
@@ -44,14 +46,23 @@ export function useFilterable(keywords, setValue, getField) {
44
46
  return ret;
45
47
  }
46
48
  function selectByFilter(data) {
47
- var value = _mapInstanceProperty(data).call(data, function (item) {
49
+ setValue(getValue(data));
50
+ }
51
+ function isSelectedItem(data) {
52
+ var _context2;
53
+ return !!_findInstanceProperty(_context2 = values.value).call(_context2, function (value) {
54
+ return isEqualArray(value, getValue(data));
55
+ });
56
+ }
57
+ function getValue(data) {
58
+ return _mapInstanceProperty(data).call(data, function (item) {
48
59
  return getField(item, 'value');
49
60
  });
50
- setValue(value);
51
61
  }
52
62
  return {
53
63
  filter: filter,
54
64
  selectByFilter: selectByFilter,
55
- keywords: keywords
65
+ keywords: keywords,
66
+ isSelectedItem: isSelectedItem
56
67
  };
57
68
  }
@@ -2,11 +2,13 @@ import { ProviderProps } from '../context';
2
2
  import { Component } from 'intact-vue-next';
3
3
  export interface ConfigProps {
4
4
  classNamePrefix?: string;
5
+ disableWave?: boolean;
5
6
  }
6
7
  declare const ConfigConsumer: import('intact-vue-next').ComponentConstructor<Component<import("../context").ConsumerProps<ConfigProps>, {}, {}, {}>>;
7
8
  declare function useConfigContext(): {
8
9
  cls: (name: string) => string;
9
10
  readonly k: string;
11
+ readonly disableWave: boolean;
10
12
  };
11
13
  /**
12
14
  * for vue/react type checking
@@ -12,6 +12,9 @@ function useConfigContext() {
12
12
  },
13
13
  get k() {
14
14
  return config.value.classNamePrefix || 'k';
15
+ },
16
+ get disableWave() {
17
+ return config.value.disableWave || false;
15
18
  }
16
19
  };
17
20
  }
@@ -4,6 +4,7 @@ import { State } from '../../hooks/useState';
4
4
  import { Shortcut } from './shortcuts';
5
5
  import { BasePicker, BasePickerProps, BasePickerEvents, BasePickerBlocks, Value } from './basepicker';
6
6
  export * as shortcuts from './shortcuts';
7
+ export { dayjs };
7
8
  export interface DatepickerProps<V extends Value = Value, M extends boolean = boolean, R extends boolean = boolean> extends BasePickerProps<V extends string ? V : V | string, M, R> {
8
9
  type?: 'date' | 'datetime' | 'year' | 'month';
9
10
  shortcuts?: Shortcut[];
@@ -5,6 +5,7 @@ import { __decorate } from "tslib";
5
5
  import { provide } from 'intact-vue-next';
6
6
  import template from './index.vdt';
7
7
  import { DATEPICKER } from './constants';
8
+ import dayjs from './dayjs';
8
9
  import { useValue } from './useValue';
9
10
  import { isNullOrUndefined } from 'intact-shared';
10
11
  import { _$ } from '../../i18n';
@@ -17,6 +18,7 @@ import { useKeyboards } from './useKeyboards';
17
18
  import { BasePicker } from './basepicker';
18
19
  import * as _shortcuts from './shortcuts';
19
20
  export { _shortcuts as shortcuts };
21
+ export { dayjs };
20
22
  var typeDefs = _extends({}, BasePicker.typeDefs, {
21
23
  type: ['date', 'datetime', 'year', 'month'],
22
24
  shortcuts: Array
@@ -52,6 +52,7 @@ export declare class BaseDialog<T extends BaseDialogProps = BaseDialogProps, E e
52
52
  protected config: {
53
53
  cls: (name: string) => string;
54
54
  readonly k: string;
55
+ readonly disableWave: boolean;
55
56
  };
56
57
  init(): void;
57
58
  show(props?: T): void;
@@ -75,7 +75,7 @@ function useKeyboardForDropdownMenu(dropdown) {
75
75
  return focusByIndex(0);
76
76
  };
77
77
  // In Cascader the menu may have been replaced by another menu, in this case,
78
- // if the dropdown has showed while we mounted the menu, add keydown listener
78
+ // if the dropdown has showed while we mounted the menu, add the keydown listener
79
79
  if (dropdown.get('value')) {
80
80
  onShow();
81
81
  }
@@ -15,7 +15,7 @@ export interface InputProps<V extends Value = Value> extends InputHTMLAttributes
15
15
  type?: HTMLInputTypes;
16
16
  value?: V;
17
17
  defaultValue?: string | number;
18
- placeholder?: string;
18
+ placeholder?: string | number;
19
19
  readonly?: boolean;
20
20
  clearable?: boolean;
21
21
  disabled?: boolean;
@@ -16,7 +16,7 @@ var typeDefs = {
16
16
  type: String,
17
17
  value: [String, Number],
18
18
  defaultValue: [String, Number],
19
- placeholder: String,
19
+ placeholder: [String, Number],
20
20
  readonly: Boolean,
21
21
  clearable: Boolean,
22
22
  disabled: Boolean,
@@ -20,7 +20,7 @@ var defaults = {
20
20
  },
21
21
  item: {
22
22
  height: '40px',
23
- padding: '0 17px',
23
+ padding: '0 12px',
24
24
  bodyPadding: '0 4px',
25
25
  color: '#aeaeb9',
26
26
  hoverColor: '#fff',
@@ -36,7 +36,7 @@ var defaults = {
36
36
  },
37
37
  title: {
38
38
  height: '40px',
39
- padding: '0 17px',
39
+ padding: '0 12px',
40
40
  color: '#fff'
41
41
  },
42
42
  icon: {
@@ -112,7 +112,7 @@ export { menu };
112
112
  export var makeMenuStyles = cache(function makeMenuStyles(k) {
113
113
  // we must increase the priority by adding &.${k}-menu
114
114
  // to override the css of dropdownMenu
115
- return /*#__PURE__*/css("&.", k, "-menu{width:", menu.width, ";transition:width ", menu.transition, ";background:", menu.bgColor, ";font-size:", menu.fontSize, ";position:relative;}.", k, "-icon{width:", menu.icon.width, ";margin-right:", menu.icon.gap, ";text-align:center;flex-shrink:0;}.", k, "-menu-header{height:", menu.header.height, ";padding:0 21px;color:", menu.header.color, ";font-size:", menu.header.fontSize, ";font-weight:bold;}.", k, "-menu-body{padding:", menu.item.bodyPadding, ";max-height:calc(100% - ", menu.header.height, ");overflow-y:auto;overflow-x:hidden;}.", k, "-menu-title{height:", menu.title.height, ";border-top:", menu.border, ";margin-top:4px;.", k, "-menu-name{transition:all ", menu.transition, ";height:", menu.title.height, ";color:", menu.title.color, ";font-weight:bold;}}.", k, "-menu-arrow-box{width:14px;height:60px;cursor:pointer;background:", menu.bgColor, ";border-radius:0 8px 8px 0;position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:calc(", menu.width, " - 2px);transition:left ", menu.transition, ";transform:translateY(-50%);border:", menu.border, ";border-left:none;.", k, "-icon{margin-right:0;}&:hover{.", k, "-menu-arrow:before{color:", menu.item.activeBgColor, ";}}}&.", k, "-light{border:1px solid ", theme.color.disabledBg, ";border-top:0;background:", menu.light.bgColor, ";.", k, "-menu-header{color:", menu.light.title.color, ";}.", k, "-menu-item{.", k, "-menu-item-title{color:", menu.light.item.color, ";&:hover{background:", menu.light.item.hoverBg, ";}}.", k, "-menu-item-arrow{color:", menu.light.item.color, ";}&.", k, "-highlighted{>.", k, "-menu-item-title{color:", menu.light.item.hoverColor, ";}}&.", k, "-disabled{>.", k, "-menu-item-title{color:", menu.light.item.disabledColor, "!important;}}}.", k, "-menu-title{border-top:", menu.light.border, ";.", k, "-menu-name{color:", menu.light.title.color, ";}}.", k, "-menu-arrow-box{background:", menu.light.bgColor, ";border:", menu.light.border, ";border-left:none;&:hover{.", k, "-menu-arrow:before{color:", menu.light.active.color, ";}}}.", k, "-menu:not(.", k, "-dropdown-menu){background:", menu.light.bgColor, ";}&.", k, "-horizontal{.", k, "-menu-header{border-right:", menu.light.border, ";}.", k, "-menu-body>.", k, "-menu-title{border-right:", menu.light.border, ";}}.", k, "-menu-item.", k, "-active{>.", k, "-menu-item-title{color:", menu.light.active.color, "!important;background:", menu.light.active.bgColor, ";}}.", k, "-sub-menu{.", k, "-menu-item-title,.", k, "-menu-item-arrow{color:", menu.light.item.subTitleColor, "!important;}}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
115
+ return /*#__PURE__*/css("&.", k, "-menu{width:", menu.width, ";transition:width ", menu.transition, ";background:", menu.bgColor, ";font-size:", menu.fontSize, ";position:relative;}.", k, "-icon{width:", menu.icon.width, ";margin-right:", menu.icon.gap, ";text-align:center;flex-shrink:0;}.", k, "-menu-header{height:", menu.header.height, ";padding:0 16px;color:", menu.header.color, ";font-size:", menu.header.fontSize, ";font-weight:bold;}.", k, "-menu-body{padding:", menu.item.bodyPadding, ";max-height:calc(100% - ", menu.header.height, ");overflow-y:auto;overflow-x:hidden;scrollbar-width:none;}.", k, "-menu-title{height:", menu.title.height, ";border-top:", menu.border, ";margin-top:4px;.", k, "-menu-name{transition:all ", menu.transition, ";height:", menu.title.height, ";color:", menu.title.color, ";font-weight:bold;}}.", k, "-menu-arrow-box{width:14px;height:60px;cursor:pointer;background:", menu.bgColor, ";border-radius:0 8px 8px 0;position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:calc(", menu.width, " - 2px);transition:left ", menu.transition, ";transform:translateY(-50%);border:", menu.border, ";border-left:none;.", k, "-icon{margin-right:0;}&:hover{.", k, "-menu-arrow:before{color:", menu.item.activeBgColor, ";}}}&.", k, "-light{border-right:1px solid ", theme.color.disabledBg, ";background:", menu.light.bgColor, ";.", k, "-menu-header{color:", menu.light.title.color, ";}.", k, "-menu-item{.", k, "-menu-item-title{color:", menu.light.item.color, ";&:hover{background:", menu.light.item.hoverBg, ";}}.", k, "-menu-item-arrow{color:", menu.light.item.color, ";}&.", k, "-highlighted{>.", k, "-menu-item-title{color:", menu.light.item.hoverColor, ";}}&.", k, "-disabled{>.", k, "-menu-item-title{color:", menu.light.item.disabledColor, "!important;}}}.", k, "-menu-title{border-top:", menu.light.border, ";.", k, "-menu-name{color:", menu.light.title.color, ";}}.", k, "-menu-arrow-box{background:", menu.light.bgColor, ";border:", menu.light.border, ";border-left:none;&:hover{.", k, "-menu-arrow:before{color:", menu.light.active.color, ";}}}.", k, "-menu:not(.", k, "-dropdown-menu){background:", menu.light.bgColor, ";}&.", k, "-horizontal{.", k, "-menu-header{border-right:", menu.light.border, ";}.", k, "-menu-body>.", k, "-menu-title{border-right:", menu.light.border, ";}}.", k, "-menu-item.", k, "-active{>.", k, "-menu-item-title{color:", menu.light.active.color, "!important;background:", menu.light.active.bgColor, ";}}.", k, "-sub-menu{.", k, "-menu-item-title,.", k, "-menu-item-arrow{color:", menu.light.item.subTitleColor, "!important;}}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
116
116
  var styles = menu[size];
117
117
  return /*#__PURE__*/css("&.", k, "-", size, "{width:", styles.width, ";font-size:", styles.fontSize, ";.", k, "-menu{font-size:", styles.fontSize, ";}.", k, "-menu-arrow-box{left:calc(", styles.width, " - 2px);}}");
118
118
  }), "&.", k, "-collapsed{width:calc(", menu.icon.width, " + (", getLeft(menu.item.padding), " + ", getLeft(menu.item.bodyPadding), ") * 2);.", k, "-icon{margin-right:0;}.", k, "-menu-item-arrow{display:none;}}&.", k, "-collapsed-arrow{width:0px;border-left:none;.", k, "-menu-body{overflow:hidden;padding:0;}.", k, "-menu-arrow-box{left:0;.", k, "-menu-arrow:before{transform:rotateY(180deg);}}}&.", k, "-dropdown-menu{width:fit-content;min-width:", menu.dropdown.minWidth, ";.", k, "-menu-item-arrow{transform:rotate(-90deg);}}&.", k, "-horizontal{width:auto;display:flex;.", k, "-menu-body{display:flex;align-items:center;.", k, "-menu-title{border-top:none;border-right:", menu.border, ";}}}");
@@ -54,6 +54,7 @@ export declare abstract class BaseSelect<T extends BaseSelectProps<any> = BaseSe
54
54
  protected config: {
55
55
  cls: (name: string) => string;
56
56
  readonly k: string;
57
+ readonly disableWave: boolean;
57
58
  };
58
59
  init(): void;
59
60
  protected abstract getPlaceholder(): Children;
@@ -36,7 +36,11 @@ export function useInput(resetKeywords) {
36
36
  filterable = _component$get.filterable;
37
37
  if (multiple && filterable) {
38
38
  focusInput();
39
- resetKeywords(keywords);
39
+ /**
40
+ * don't reset keywords on multiple mode for continue selection
41
+ * https://github.com/ksc-fe/kpc/issues/983
42
+ */
43
+ // resetKeywords(keywords);
40
44
  }
41
45
  });
42
46
  return {
@@ -29,7 +29,7 @@ var defaults = {
29
29
  get color() {
30
30
  return theme.color.lightBlack;
31
31
  },
32
- padding: "0 5px 0 12px",
32
+ padding: "0 8px 0 12px",
33
33
  fontSize: "12px",
34
34
  fontWeight: "bold",
35
35
  textAlign: 'left',
@@ -42,7 +42,7 @@ var defaults = {
42
42
  get hoverBgcolor() {
43
43
  return theme.color.bg;
44
44
  },
45
- padding: "11px 5px 11px 12px"
45
+ padding: "11px 8px 11px 12px"
46
46
  },
47
47
  // stripe
48
48
  stripeBgColor: '#f9f9fc',
@@ -90,7 +90,7 @@ setDefault(function () {
90
90
  makeGroupMenuStyles == null || makeGroupMenuStyles.clearCache();
91
91
  });
92
92
  export var makeStyles = cache(function makeStyles(k) {
93
- return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&:first-of-type:before{display:none;}}.", k, "-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.", k, "-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:break-word;}.", k, "-fixed-left,.", k, "-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.", k, "-fixed-left:after{right:-11px;}.", k, "-fixed-right:after{left:-11px;}&.", k, "-scroll-left .", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.", k, "-scroll-right .", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.", k, "-scroll-middle{.", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.", k, "-fixed-right+.", k, "-fixed-right:after{display:none;}.", k, "-table-affix-header{position:sticky;top:0;left:0;.", k, "-affix-wrapper{overflow:hidden;}&.", k, "-fixed{position:relative;}}&.", k, "-border,&.", k, "-grid{.", k, "-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.", k, "-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.", k, "-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.", k, "-table-group{margin-left:", table.group.gap, ";}.", k, "-table-check{.", k, "-checkbox,.", k, "-radio{position:relative;top:-1px;}}.", k, "-column-sortable{cursor:pointer;}.", k, "-column-sort{.", k, "-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin:0 0 1px ", _sortInstanceProperty(table).gap, ";}&.", k, "-desc .", k, "-icon.", k, "-desc,&.", k, "-asc .", k, "-icon.", k, "-asc{color:", _sortInstanceProperty(table).enabledColor, ";}}.", k, "-table-spin.", k, "-overlay{z-index:2;}.", k, "-table-empty{text-align:center;}tr.", k, "-expand{td{padding:0;background:#fdfcff;}}&.", k, "-with-expand{tr:not(.", k, "-expand){td{border-bottom:none;}}}.", k, "-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.", k, "-selected td{background:", table.selectedBgColor, ";}.", k, "-table-arrow{width:", table.arrow.width, "!important;margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.", k, "-spreaded{.", k, "-table-arrow{transform:rotate(90deg);}}.", k, "-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.", k, "-dragging{opacity:", table.draggingOpacity, ";}.", k, "-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.", k, "-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
93
+ return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&.", k, "-fixed-right:before{left:-2px;}&:first-of-type:before{display:none;}}.", k, "-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.", k, "-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:break-word;}.", k, "-fixed-left,.", k, "-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.", k, "-fixed-left:after{right:-11px;}.", k, "-fixed-right:after{left:-11px;}&.", k, "-scroll-left .", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.", k, "-scroll-right .", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.", k, "-scroll-middle{.", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.", k, "-fixed-right+.", k, "-fixed-right:after{display:none;}.", k, "-table-affix-header{position:sticky;top:0;left:0;.", k, "-affix-wrapper{overflow:hidden;}&.", k, "-fixed{position:relative;}}&.", k, "-border,&.", k, "-grid{.", k, "-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.", k, "-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.", k, "-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.", k, "-table-group{margin-left:", table.group.gap, ";}.", k, "-table-check{.", k, "-checkbox,.", k, "-radio{position:relative;top:-1px;}}.", k, "-column-sortable{cursor:pointer;}.", k, "-column-sort{.", k, "-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin:0 0 1px ", _sortInstanceProperty(table).gap, ";}&.", k, "-desc .", k, "-icon.", k, "-desc,&.", k, "-asc .", k, "-icon.", k, "-asc{color:", _sortInstanceProperty(table).enabledColor, ";}}.", k, "-table-spin.", k, "-overlay{z-index:2;}.", k, "-table-empty{text-align:center;}tr.", k, "-expand{td{padding:0;background:#fdfcff;}}&.", k, "-with-expand{tr:not(.", k, "-expand){td{border-bottom:none;}}}.", k, "-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.", k, "-selected td{background:", table.selectedBgColor, ";}.", k, "-table-arrow{width:", table.arrow.width, "!important;margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.", k, "-spreaded{.", k, "-table-arrow{transform:rotate(90deg);}}.", k, "-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.", k, "-dragging{opacity:", table.draggingOpacity, ";}.", k, "-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.", k, "-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
94
94
  return /*#__PURE__*/css(".", k, "-align-", type, "{text-align:", type, ";}");
95
95
  }), ">.", k, "-pagination{margin:16px 0;}&.", k, "-fix-header{min-height:0;.", k, "-table-wrapper{height:100%;}}");
96
96
  });
@@ -24,6 +24,7 @@ export declare class Tabs<T = any> extends Component<TabsProps<T>, TabsEvents<T>
24
24
  config: {
25
25
  cls: (name: string) => string;
26
26
  readonly k: string;
27
+ readonly disableWave: boolean;
27
28
  };
28
29
  init(): void;
29
30
  changeTab(tabProps: TabProps): Promise<void>;
@@ -71,7 +71,7 @@ export var makeStyles = cache(function makeStyles(k) {
71
71
  }
72
72
  return /*#__PURE__*/css("&.", k, "-", theme, "{background:", bgColor, ";color:", color, ";.", k, "-tooltip-arrow{", _mapInstanceProperty(_context = _Object$keys(directionMap)).call(_context, function (direction) {
73
73
  var borderDirection = directionMap[direction];
74
- return /*#__PURE__*/css("&.", k, "-", direction, "{border-", borderDirection, "-color:", borderColor, ";&:before{border-", borderDirection, "-color:", bgColor, ";}}");
74
+ return /*#__PURE__*/css("&.", k, "-", direction, "{&:before{border-", borderDirection, "-color:", bgColor, ";}}");
75
75
  }), ";}}");
76
76
  }), ".", k, "-tooltip-footer{padding-top:", tooltip.confirm.gaps, ";.", k, "-btn:not(:first-of-type){margin-left:", tooltip.confirm.gaps, ";}}&.", k, "-small{padding:", tooltip.smallPadding, ";}}");
77
77
  });
@@ -24,10 +24,11 @@ export default function ($props, $blocks, $__proto__) {
24
24
  files = _this$get.files,
25
25
  children = _this$get.children,
26
26
  type = _this$get.type,
27
- directory = _this$get.directory;
27
+ directory = _this$get.directory,
28
+ disabled = _this$get.disabled;
28
29
  var drag = this.drag;
29
30
  var k = this.config.k;
30
- var classNameObj = (_classNameObj = {}, _classNameObj[k + "-upload"] = true, _classNameObj[className] = className, _classNameObj[k + "-drag"] = type === 'drag', _classNameObj[k + "-dragover"] = drag.dragOver.value, _classNameObj[k + "-gallery"] = type === 'gallery', _classNameObj[makeStyles(k)] = true, _classNameObj);
31
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-upload"] = true, _classNameObj[className] = className, _classNameObj[k + "-drag"] = type === 'drag', _classNameObj[k + "-dragover"] = drag.dragOver.value, _classNameObj[k + "-gallery"] = type === 'gallery', _classNameObj[k + "-disabled"] = disabled, _classNameObj[makeStyles(k)] = true, _classNameObj);
31
32
  var events = {
32
33
  'ev-click': this.selectFile
33
34
  };
@@ -49,6 +50,7 @@ export default function ($props, $blocks, $__proto__) {
49
50
  };
50
51
  return block ? block.call($this, callBlock, data) : callBlock();
51
52
  }, __$blocks['children'](_$no)) : type !== 'gallery' ? type === 'select' ? _$cc(Button, {
53
+ 'disabled': disabled,
52
54
  'children': [_$cc(Icon, {
53
55
  'className': _$cn(k + "-icon-upload")
54
56
  }), _$('点击上传')]
@@ -113,7 +113,7 @@ setDefault(function () {
113
113
  makeUploadDialogStyles == null || makeUploadDialogStyles.clearCache();
114
114
  });
115
115
  export var makeStyles = cache(function makeStyles(k) {
116
- return /*#__PURE__*/css("font-size:", upload.fontSize, ";position:relative;.", k, "-icon-upload{position:relative;top:-1px;}.", k, "-upload-handle{display:inline-block;vertical-align:middle;color:", upload.color, ";}.", k, "-upload-tip{margin-top:", upload.tip.gap, ";color:", upload.color, ";}.", k, "-upload-files{margin-top:", upload.filesGap, ";}.", k, "-upload-file{margin:", upload.file.margin, ";padding-right:", upload.file.delete.width, ";position:relative;&:hover{.", k, "-upload-close{display:inline-flex;position:absolute;right:", upload.file.delete.right, ";top:", upload.file.delete.top, ";}.", k, "-upload-file-main{background:", upload.file.bgColor, ";}}}.", k, "-upload-file-main{padding:", upload.file.padding, ";border-radius:", upload.file.borderRadius, ";}.", k, "-upload-name{display:flex;align-items:center;height:", upload.file.height, ";}.", k, "-upload-file-icon{margin-right:", upload.file.fileIconGap, ";}.", k, "-upload-file-name{flex:1;}.", k, "-upload-status-icon{color:", upload.file.status.color, ";margin-right:", upload.file.status.offsetRight, ";}.", k, "-upload-close{display:none;}.", k, "-upload-file.", k, "-error{color:", upload.file.errorColor, ";.", k, "-upload-status-icon{color:", upload.file.status.errorColor, ";}}.", k, "-upload-progress{.", k, "-progress-text{width:auto!important;}}&.", k, "-drag{.", k, "-upload-handle{display:block;border:", upload.drag.border, ";border-radius:", upload.drag.borderRadius, ";cursor:pointer;text-align:center;transition:border-color ", upload.transition, ";background:", upload.drag.bgColor, ";&:hover{border-color:", upload.drag.hoverBorderColor, ";}}.", k, "-upload-area{padding:", upload.drag.padding, ";.", k, "-icon{display:inline-block;font-size:", upload.drag.icon.fontSize, ";margin-bottom:", upload.drag.icon.gap, ";}}&.", k, "-dragover{.", k, "-upload-handle{border-color:", upload.drag.overBorderColor, ";}}}.", k, "-upload-pictures{display:inline-block;vertical-align:middle;}.", k, "-upload-picture{padding:", upload.gallery.padding, ";position:relative;vertical-align:middle;&.", k, "-error{border-color:", upload.gallery.errorBorderColor, ";}.", k, "-upload-close{display:inline-flex;}&:hover{.", k, "-upload-icons{opacity:1;}}.", k, "-upload-img{display:inline-block;width:100%;height:100%;}.", k, "-upload-icons{opacity:0;transition:opacity ", upload.transition, ";}}.", k, "-upload-picture-card{display:inline-flex;width:", upload.gallery.width, ";height:", upload.gallery.height, ";border-radius:", upload.gallery.borderRadius, ";border:", upload.gallery.border, ";margin:", upload.gallery.margin, ";background:", upload.gallery.bgColor, ";align-items:center;justify-content:center;flex-direction:column;}.", k, "-upload-add{border:", upload.gallery.add.border, ";cursor:pointer;&:hover{border-color:", upload.gallery.add.hoverBorderColor, ";}}.", k, "-upload-overlap{position:absolute;width:100%;height:100%;left:0;top:0;background:", upload.overlap.bgColor, ";display:flex;align-items:center;justify-content:center;gap:", upload.overlap.iconGap, ";color:", upload.overlap.color, ";.", k, "-icon:not(:hover){color:inherit;}.", k, "-upload-progress{position:absolute;width:100%;top:50%;padding:", upload.gallery.padding, ";transform:translateY(-50%);}}");
116
+ return /*#__PURE__*/css("font-size:", upload.fontSize, ";position:relative;.", k, "-icon-upload{position:relative;top:-1px;}.", k, "-upload-handle{display:inline-block;vertical-align:middle;color:", upload.color, ";}.", k, "-upload-tip{margin-top:", upload.tip.gap, ";color:", upload.color, ";}.", k, "-upload-files{margin-top:", upload.filesGap, ";}.", k, "-upload-file{margin:", upload.file.margin, ";padding-right:", upload.file.delete.width, ";position:relative;&:hover{.", k, "-upload-close{display:inline-flex;position:absolute;right:", upload.file.delete.right, ";top:", upload.file.delete.top, ";}.", k, "-upload-file-main{background:", upload.file.bgColor, ";}}}.", k, "-upload-file-main{padding:", upload.file.padding, ";border-radius:", upload.file.borderRadius, ";}.", k, "-upload-name{display:flex;align-items:center;height:", upload.file.height, ";}.", k, "-upload-file-icon{margin-right:", upload.file.fileIconGap, ";}.", k, "-upload-file-name{flex:1;}.", k, "-upload-status-icon{color:", upload.file.status.color, ";margin-right:", upload.file.status.offsetRight, ";}.", k, "-upload-close{display:none;}.", k, "-upload-file.", k, "-error{color:", upload.file.errorColor, ";.", k, "-upload-status-icon{color:", upload.file.status.errorColor, ";}}.", k, "-upload-progress{.", k, "-progress-text{width:auto!important;}}&.", k, "-drag{.", k, "-upload-handle{display:block;border:", upload.drag.border, ";border-radius:", upload.drag.borderRadius, ";cursor:pointer;text-align:center;transition:border-color ", upload.transition, ";background:", upload.drag.bgColor, ";&:hover{border-color:", upload.drag.hoverBorderColor, ";}}.", k, "-upload-area{padding:", upload.drag.padding, ";.", k, "-icon{display:inline-block;font-size:", upload.drag.icon.fontSize, ";margin-bottom:", upload.drag.icon.gap, ";}}&.", k, "-dragover{.", k, "-upload-handle{border-color:", upload.drag.overBorderColor, ";}}}.", k, "-upload-pictures{display:inline-block;vertical-align:middle;}.", k, "-upload-picture{padding:", upload.gallery.padding, ";position:relative;vertical-align:middle;&.", k, "-error{border-color:", upload.gallery.errorBorderColor, ";}.", k, "-upload-close{display:inline-flex;}&:hover{.", k, "-upload-icons{opacity:1;}}.", k, "-upload-img{display:inline-block;width:100%;height:100%;}.", k, "-upload-icons{opacity:0;transition:opacity ", upload.transition, ";}}.", k, "-upload-picture-card{display:inline-flex;width:", upload.gallery.width, ";height:", upload.gallery.height, ";border-radius:", upload.gallery.borderRadius, ";border:", upload.gallery.border, ";margin:", upload.gallery.margin, ";background:", upload.gallery.bgColor, ";align-items:center;justify-content:center;flex-direction:column;}.", k, "-upload-add{border:", upload.gallery.add.border, ";cursor:pointer;&:hover{border-color:", upload.gallery.add.hoverBorderColor, ";}}.", k, "-upload-overlap{position:absolute;width:100%;height:100%;left:0;top:0;background:", upload.overlap.bgColor, ";display:flex;align-items:center;justify-content:center;gap:", upload.overlap.iconGap, ";color:", upload.overlap.color, ";.", k, "-icon:not(:hover){color:inherit;}.", k, "-upload-progress{position:absolute;width:100%;top:50%;padding:", upload.gallery.padding, ";transform:translateY(-50%);}}&.", k, "-disabled{.", k, "-upload-add,.", k, "-upload-handle{cursor:auto;a{color:", upload.color, ";}&:hover{border-color:", theme.color.border, ";}}}");
117
117
  });
118
118
  export var makeUploadDialogStyles = cache(function makeUploadDialogStyles(k) {
119
119
  return /*#__PURE__*/css(process.env.NODE_ENV === "production" ? {
@@ -62,6 +62,8 @@ export var Wave = /*#__PURE__*/function (_Component) {
62
62
  var _this$get2 = this.get(),
63
63
  disabled = _this$get2.disabled;
64
64
  var node = e.target;
65
+ // configProvider全局禁用动效
66
+ if (this.config.disableWave) return;
65
67
  // 点击输入框中的icon时,此时输入框不需要动效
66
68
  var isInput = instance.classList.contains('k-input-wrapper');
67
69
  if (disabled || isInput && node.classList.contains(this.config.cls('icon'))) return;
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.3.0
2
+ * @king-design v3.3.2
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -63,7 +63,7 @@ export * from './components/treeSelect';
63
63
  export * from './components/upload';
64
64
  export * from './components/view';
65
65
  export * from './components/wave';
66
- export declare const version = "3.3.0";
66
+ export declare const version = "3.3.2";
67
67
 
68
68
 
69
69
  export {normalize} from 'intact-vue-next';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.3.0
2
+ * @king-design v3.3.2
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -64,7 +64,7 @@ export * from './components/treeSelect';
64
64
  export * from './components/upload';
65
65
  export * from './components/view';
66
66
  export * from './components/wave';
67
- export var version = '3.3.0';
67
+ export var version = '3.3.2';
68
68
  /* generate end */
69
69
 
70
70
  export {normalize} from 'intact-vue-next';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@king-design/vue",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "description": "King-Design UI components for Vue3.0.",
5
5
  "keywords": [
6
6
  "component",
@@ -37,7 +37,7 @@
37
37
  "@emotion/css": "^11.5.0",
38
38
  "dayjs": "^1.10.7",
39
39
  "enquire.js": "^2.1.6",
40
- "intact-vue-next": "3.0.33",
40
+ "intact-vue-next": "3.0.34",
41
41
  "monaco-editor": "^0.26.1",
42
42
  "mxgraphx": "^4.0.7",
43
43
  "resize-observer-polyfill": "^1.5.1",