@king-design/vue 3.6.0-beta.0 → 3.6.1

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.
Files changed (94) hide show
  1. package/__tests__/__snapshots__/Vue Next Demos.md +115 -51
  2. package/__tests__/components/editable.spec.ts +1 -1
  3. package/__tests__/components/misc.spec.ts +93 -0
  4. package/__tests__/components/table.spec.ts +1 -0
  5. package/components/cascader/index.spec.js +18 -19
  6. package/components/copy/index.spec.js +14 -31
  7. package/components/datepicker/basepicker.d.ts +6 -27
  8. package/components/datepicker/basepicker.js +23 -268
  9. package/components/datepicker/calendar.d.ts +4 -2
  10. package/components/datepicker/dayjs.d.ts +2 -13
  11. package/components/datepicker/helpers.d.ts +3 -2
  12. package/components/datepicker/helpers.js +2 -3
  13. package/components/datepicker/index.d.ts +21 -29
  14. package/components/datepicker/index.js +22 -32
  15. package/components/datepicker/index.spec.js +1277 -484
  16. package/components/datepicker/index.vdt.js +39 -38
  17. package/components/datepicker/shortcuts.d.ts +1 -1
  18. package/components/datepicker/styles.d.ts +7 -2
  19. package/components/datepicker/styles.js +10 -15
  20. package/components/datepicker/useConfirm.d.ts +6 -0
  21. package/components/datepicker/useConfirm.js +65 -0
  22. package/components/datepicker/useDisabled.d.ts +5 -3
  23. package/components/datepicker/useDisabled.js +22 -27
  24. package/components/datepicker/useFormats.d.ts +2 -2
  25. package/components/datepicker/useFormats.js +6 -2
  26. package/components/datepicker/useHighlight.d.ts +14 -0
  27. package/components/datepicker/useHighlight.js +60 -0
  28. package/components/datepicker/useKeyboards.js +2 -1
  29. package/components/datepicker/useMergeRange.d.ts +1 -1
  30. package/components/datepicker/useMergeRange.js +11 -16
  31. package/components/datepicker/useMonths.js +5 -3
  32. package/components/datepicker/usePanel.d.ts +1 -10
  33. package/components/datepicker/usePanel.js +19 -32
  34. package/components/datepicker/useShowDate.d.ts +1 -1
  35. package/components/datepicker/useShowDate.js +15 -40
  36. package/components/datepicker/useStatus.js +33 -16
  37. package/components/datepicker/useValue.d.ts +11 -6
  38. package/components/datepicker/useValue.js +49 -69
  39. package/components/datepicker/useValueBase.d.ts +28 -0
  40. package/components/datepicker/useValueBase.js +280 -0
  41. package/components/datepicker/useYears.js +6 -3
  42. package/components/dropdown/dropdown.d.ts +1 -0
  43. package/components/dropdown/dropdown.js +7 -4
  44. package/components/form/form.d.ts +1 -0
  45. package/components/form/form.js +7 -0
  46. package/components/form/index.spec.js +10 -8
  47. package/components/input/index.d.ts +2 -0
  48. package/components/input/index.js +6 -0
  49. package/components/input/index.spec.js +45 -0
  50. package/components/input/index.vdt.js +4 -3
  51. package/components/input/useAutoWidth.d.ts +2 -0
  52. package/components/input/useAutoWidth.js +19 -1
  53. package/components/menu/index.spec.js +28 -0
  54. package/components/menu/styles.js +2 -2
  55. package/components/scrollSelect/useMouseEvents.js +5 -4
  56. package/components/select/base.d.ts +1 -1
  57. package/components/select/base.js +3 -2
  58. package/components/select/base.vdt.js +4 -3
  59. package/components/select/index.spec.js +346 -218
  60. package/components/select/menu.js +1 -1
  61. package/components/select/option.js +2 -1
  62. package/components/select/select.js +2 -1
  63. package/components/select/styles.d.ts +79 -0
  64. package/components/select/styles.js +1 -0
  65. package/components/select/useCard.d.ts +4 -3
  66. package/components/select/useCard.js +15 -4
  67. package/components/select/useInput.d.ts +1 -1
  68. package/components/select/useInput.js +4 -4
  69. package/components/spinner/index.spec.js +82 -44
  70. package/components/spinner/useValue.js +2 -1
  71. package/components/table/index.spec.js +84 -6
  72. package/components/table/useStickyHeader.js +1 -1
  73. package/components/timepicker/index.spec.js +298 -128
  74. package/components/timepicker/panelPicker.d.ts +21 -16
  75. package/components/timepicker/panelPicker.js +7 -4
  76. package/components/timepicker/panelPicker.vdt.js +5 -9
  77. package/components/timepicker/selectPicker.d.ts +4 -3
  78. package/components/timepicker/styles.js +1 -1
  79. package/components/timepicker/useConfirm.d.ts +6 -0
  80. package/components/timepicker/useConfirm.js +19 -0
  81. package/components/timepicker/useDefaultValue.d.ts +4 -0
  82. package/components/timepicker/useDefaultValue.js +27 -0
  83. package/components/timepicker/useDisabled.d.ts +6 -3
  84. package/components/timepicker/useDisabled.js +13 -4
  85. package/components/timepicker/useFormats.d.ts +1 -1
  86. package/components/timepicker/useValue.d.ts +13 -8
  87. package/components/timepicker/useValue.js +14 -15
  88. package/components/tour/index.spec.js +1 -1
  89. package/index.d.ts +2 -2
  90. package/index.js +2 -2
  91. package/package.json +2 -2
  92. package/yarn-error.log +44 -43
  93. package/components/datepicker/usePosition.d.ts +0 -10
  94. package/components/datepicker/usePosition.js +0 -166
@@ -2,47 +2,49 @@ import { TypeDefs } from 'intact-vue-next';
2
2
  import { BasePicker } from '../datepicker/basepicker';
3
3
  import dayjs from '../datepicker/dayjs';
4
4
  import { State } from '../../hooks/useState';
5
- import { PanelTypes } from '../datepicker/usePanel';
6
5
  import { TimepickerProps, TimepickerEvents, TimepickerBlocks } from './constants';
6
+ import { StateValueItem } from '../datepicker/useValueBase';
7
7
  export declare class PanelPicker<Multipe extends boolean = false, Range extends boolean = false> extends BasePicker<TimepickerProps<Multipe, Range>, TimepickerEvents, TimepickerBlocks> {
8
8
  static template: string | import('intact-vue-next').Template<any>;
9
9
  static typeDefs: Required<TypeDefs<TimepickerProps<boolean, boolean>>>;
10
10
  formats: {
11
11
  getValueFormat: () => string;
12
12
  getShowFormat: () => string;
13
- createDateByValueFormat: (value: import("../datepicker/basepicker").Value) => dayjs.Dayjs;
14
- createDateByShowFormat: (value: import("../datepicker/basepicker").Value) => dayjs.Dayjs;
13
+ createDateByValueFormat: (value: import("../datepicker/useValueBase").Value) => dayjs.Dayjs;
14
+ createDateByShowFormat: (value: import("../datepicker/useValueBase").Value) => dayjs.Dayjs;
15
15
  getShowString: (value: dayjs.Dayjs) => string;
16
16
  getValueString: (value: dayjs.Dayjs) => string;
17
17
  };
18
+ defaultValue: {
19
+ get: () => StateValueItem;
20
+ };
18
21
  disabled: {
19
22
  isDisabled: (value: dayjs.Dayjs, type?: "h" | "s" | "y" | "date" | "month" | "week" | "millisecond" | "second" | "minute" | "hour" | "day" | "year" | "milliseconds" | "seconds" | "minutes" | "hours" | "days" | "months" | "years" | "dates" | "d" | "D" | "M" | "m" | "ms" | "weeks" | "w" | "quarter" | "quarters" | "Q") => boolean;
20
- isDisabledConfirm: () => boolean;
21
23
  maxDate: State<dayjs.Dayjs | null>;
22
24
  minDate: State<dayjs.Dayjs | null>;
23
- isDisabledTime: (value: dayjs.Dayjs, flag: import("../datepicker/usePanel").PanelFlags) => boolean;
25
+ isDisabledTime: (value: dayjs.Dayjs) => boolean;
24
26
  isDisabledTimeByStep: (value: string, flag: import("../datepicker/usePanel").PanelFlags) => boolean;
27
+ isDisabledConfirm: () => boolean;
28
+ isDisabledValue: (value: StateValueItem) => boolean;
25
29
  };
26
30
  panel: {
27
- startPanel: State<PanelTypes>;
28
- endPanel: State<PanelTypes>;
29
- changePanel: (type: PanelTypes, flag?: import("../datepicker/usePanel").PanelFlags) => void;
30
- getPanel: (flag: import("../datepicker/usePanel").PanelFlags) => State<PanelTypes>;
31
- reset: () => void;
32
31
  startRef: import('intact-vue-next').RefObject<import("../datepicker/calendar").DatepickerCalendar>;
33
32
  endRef: import('intact-vue-next').RefObject<import("../datepicker/calendar").DatepickerCalendar>;
34
33
  };
35
34
  value: {
36
35
  format: () => string | string[];
37
- onConfirm: () => void;
38
- getTimeValue: (flag: import("../datepicker/usePanel").PanelFlags) => dayjs.Dayjs | null | undefined;
39
- convertToDayjs: (v: import("../datepicker/basepicker").Value | [import("../datepicker/basepicker").Value, import("../datepicker/basepicker").Value] | import("../datepicker/basepicker").Value[] | [import("../datepicker/basepicker").Value, import("../datepicker/basepicker").Value][] | null | undefined) => import("../datepicker/basepicker").DayjsValue;
36
+ formatSingleValue: (value: StateValueItem) => string;
37
+ convertToDayjs: (v: import("../datepicker/useValueBase").Value | [import("../datepicker/useValueBase").Value, import("../datepicker/useValueBase").Value] | import("../datepicker/useValueBase").Value[] | [import("../datepicker/useValueBase").Value, import("../datepicker/useValueBase").Value][] | null | undefined) => import("../datepicker/useValueBase").DayjsValue;
38
+ unique: () => void;
40
39
  setMoment: () => void;
41
- value: State<import("../datepicker/basepicker").StateValue>;
42
- setValue: (v: import("../datepicker/basepicker").StateValueItem, fromInput: boolean) => void;
43
- getDayjsValue: () => import("../datepicker/basepicker").DayjsValue;
40
+ updateValue: () => void;
41
+ allValuesUpdatedInMultipleMode: () => boolean | undefined;
42
+ value: State<import("../datepicker/useValueBase").StateValue>;
43
+ setValue: (v: StateValueItem, fromInput: boolean) => void;
44
+ getDayjsValue: () => import("../datepicker/useValueBase").DayjsValue;
44
45
  onChangeTime: (date: dayjs.Dayjs, flag: import("../datepicker/usePanel").PanelFlags) => void;
45
46
  onChangeTimeByStep: (v: string, flag: import("../datepicker/usePanel").PanelFlags) => void;
47
+ getTimeValue: (flag: import("../datepicker/usePanel").PanelFlags) => dayjs.Dayjs | null | undefined;
46
48
  };
47
49
  step: {
48
50
  options: State<{
@@ -50,6 +52,9 @@ export declare class PanelPicker<Multipe extends boolean = false, Range extends
50
52
  label: string;
51
53
  }[] | null>;
52
54
  };
55
+ confirm: {
56
+ onConfirm: () => void;
57
+ };
53
58
  protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import('intact-vue-next').Children[];
54
59
  protected getLabel(): string | string[];
55
60
  }
@@ -8,9 +8,10 @@ import { useFormats } from './useFormats';
8
8
  import { useValue } from './useValue';
9
9
  import { useDisabled } from './useDisabled';
10
10
  import { usePanel } from '../datepicker/usePanel';
11
- import { PanelTypes } from '../datepicker/usePanel';
12
11
  import { useStep } from './useStep';
13
12
  import { typeDefs } from './constants';
13
+ import { useConfirm } from './useConfirm';
14
+ import { useDefaultValue } from './useDefaultValue';
14
15
  export var PanelPicker = /*#__PURE__*/function (_BasePicker) {
15
16
  _inheritsLoose(PanelPicker, _BasePicker);
16
17
  function PanelPicker() {
@@ -21,10 +22,12 @@ export var PanelPicker = /*#__PURE__*/function (_BasePicker) {
21
22
  }
22
23
  _this = _BasePicker.call.apply(_BasePicker, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
23
24
  _this.formats = useFormats();
24
- _this.disabled = useDisabled(_this.formats);
25
- _this.panel = usePanel(PanelTypes.Time);
26
- _this.value = useValue(_this.formats, _this.disabled, _this.panel);
25
+ _this.defaultValue = useDefaultValue();
26
+ _this.disabled = useDisabled(_this.formats, _this.defaultValue);
27
+ _this.panel = usePanel();
28
+ _this.value = useValue(_this.formats, _this.disabled, _this.panel, _this.defaultValue);
27
29
  _this.step = useStep(_this.disabled, _this.formats);
30
+ _this.confirm = useConfirm(_this.value, _this.formats.getValueString, _this.defaultValue);
28
31
  return _this;
29
32
  }
30
33
  var _proto = PanelPicker.prototype;
@@ -8,6 +8,7 @@ import { Button } from '../button';
8
8
  import { PanelFlags } from '../datepicker/usePanel';
9
9
  import { last } from '../datepicker/helpers';
10
10
  import { ScrollSelect } from '../scrollSelect';
11
+ import { makeStyles as makeStylesInheritDatepicker } from '../datepicker/styles';
11
12
  export default function ($props, $blocks, $__proto__) {
12
13
  var _classNameObj;
13
14
  $blocks || ($blocks = {});
@@ -21,13 +22,13 @@ export default function ($props, $blocks, $__proto__) {
21
22
  max = _this$get.max;
22
23
  var _this$value = this.value,
23
24
  value = _this$value.value.value,
24
- onConfirm = _this$value.onConfirm,
25
25
  onChangeTime = _this$value.onChangeTime,
26
26
  onChangeTimeByStep = _this$value.onChangeTimeByStep,
27
27
  getTimeValue = _this$value.getTimeValue,
28
28
  setMoment = _this$value.setMoment;
29
29
  var lastValue = last(value);
30
30
  var k = this.config.k;
31
+ var onConfirm = this.confirm.onConfirm;
31
32
  var classNameObj = (_classNameObj = {}, _classNameObj[k + "-time-content"] = true, _classNameObj[k + "-range"] = range, _classNameObj[className] = className, _classNameObj[makePanelStyles(k)] = true, _classNameObj);
32
33
  var options = this.step.options.value;
33
34
  var _this$disabled = this.disabled,
@@ -59,25 +60,20 @@ export default function ($props, $blocks, $__proto__) {
59
60
  }), 2, _$cn(k + "-datepicker-time"))], 0, _$cn(k + "-datepicker-calendar-wrapper"));
60
61
  };
61
62
  return _$su.call($this, {
62
- 'className': _$cn(k + "-timepicker")
63
+ 'className': _$cn(k + "-timepicker " + makeStylesInheritDatepicker(k))
63
64
  }, function ($blocks) {
64
65
  var _$blocks = {},
65
66
  __$blocks = _$ex({}, $blocks);
66
67
  return (_$blocks['base-menu'] = function ($super) {
67
68
  return _$cc(DropdownMenu, {
68
69
  'className': _$cn(classNameObj),
69
- 'children': _$ce(2, 'div', [_$ce(2, 'div', [generatePanel(PanelFlags.Start), _$ct('\n '), range ? generatePanel(PanelFlags.End) : null], 0, _$cn(k + "-datepicker-calendars")), _$ce(2, 'div', [!range && !multiple && !max && !min ? _$cc(Button, {
70
- 'type': 'link',
71
- 'size': 'small',
72
- 'ev-click': setMoment,
73
- 'children': _$('此刻')
74
- }) : undefined, _$cc(Button, {
70
+ 'children': _$ce(2, 'div', [_$ce(2, 'div', [generatePanel(PanelFlags.Start), _$ct('\n '), range ? generatePanel(PanelFlags.End) : null], 0, _$cn(k + "-datepicker-calendars")), _$ce(2, 'div', _$cc(Button, {
75
71
  'type': 'primary',
76
72
  'size': 'small',
77
73
  'disabled': isDisabledConfirm(),
78
74
  'ev-click': onConfirm,
79
75
  'children': _$('确定')
80
- })], 0, _$cn(k + "-datepicker-footer"))], 4, _$cn(k + "-datepicker-wrapper"))
76
+ }), 2, _$cn(k + "-datepicker-footer"))], 4, _$cn(k + "-datepicker-wrapper"))
81
77
  });
82
78
  }, __$blocks['base-menu'] = function ($super, data) {
83
79
  var block = $blocks['base-menu'];
@@ -6,15 +6,16 @@ export declare class SelectPicker extends Component<TimepickerProps, TimepickerE
6
6
  formats: {
7
7
  getValueFormat: () => string;
8
8
  getShowFormat: () => string;
9
- createDateByValueFormat: (value: import("../datepicker/basepicker").Value) => import("dayjs").Dayjs;
10
- createDateByShowFormat: (value: import("../datepicker/basepicker").Value) => import("dayjs").Dayjs;
9
+ createDateByValueFormat: (value: import("../datepicker/useValueBase").Value) => import("dayjs").Dayjs;
10
+ createDateByShowFormat: (value: import("../datepicker/useValueBase").Value) => import("dayjs").Dayjs;
11
11
  getShowString: (value: import("dayjs").Dayjs) => string;
12
12
  getValueString: (value: import("dayjs").Dayjs) => string;
13
13
  };
14
14
  disabled: {
15
15
  isDisabled: (value: import("dayjs").Dayjs, type?: "h" | "s" | "y" | "date" | "month" | "week" | "millisecond" | "second" | "minute" | "hour" | "day" | "year" | "milliseconds" | "seconds" | "minutes" | "hours" | "days" | "months" | "years" | "dates" | "d" | "D" | "M" | "m" | "ms" | "weeks" | "w" | "quarter" | "quarters" | "Q") => boolean;
16
- isDisabledTime: (value: import("dayjs").Dayjs, flag: import("../datepicker/usePanel").PanelFlags) => boolean;
16
+ isDisabledTime: (value: import("dayjs").Dayjs) => boolean;
17
17
  isDisabledConfirm: () => boolean;
18
+ isDisabledValue: (value: import("../datepicker/useValueBase").StateValueItem) => boolean;
18
19
  maxDate: import("../../hooks/useState").State<import("dayjs").Dayjs | null>;
19
20
  minDate: import("../../hooks/useState").State<import("dayjs").Dayjs | null>;
20
21
  };
@@ -26,5 +26,5 @@ setDefault(function () {
26
26
  makePanelStyles == null || makePanelStyles.clearCache();
27
27
  });
28
28
  export var makePanelStyles = cache(function makePanelStyles(k) {
29
- return cx(makePanelStylesBase(k), /*#__PURE__*/css("&.", k, "-time-content{.", k, "-datepicker-time{padding:", timepicker.padding, ";}.", k, "-scroll-select{height:", timepicker.scrollHeight, ";}}&.", k, "-range{.", k, "-datepicker-time{width:auto;}.", k, "-scroll-select{height:", timepicker.range.scrollHeight, ";}.", k, "-datepicker-calendar-wrapper{padding:", timepicker.range.padding, ";width:", timepicker.range.width, ";border:none;}.", k, "-timepicker-title{text-align:center;margin-bottom:", timepicker.range.titleGap, ";}}"));
29
+ return cx(makePanelStylesBase(k), /*#__PURE__*/css("&.", k, "-time-content{.", k, "-datepicker-time{padding:", timepicker.padding, ";}.", k, "-scroll-select{height:", timepicker.scrollHeight, ";}}&.", k, "-range{.", k, "-datepicker-time{width:auto;border:", timepicker.border, ";}.", k, "-scroll-select{height:", timepicker.range.scrollHeight, ";}.", k, "-datepicker-calendar-wrapper{padding:", timepicker.range.padding, ";width:", timepicker.range.width, ";border:none;}.", k, "-timepicker-title{text-align:center;margin-bottom:", timepicker.range.titleGap, ";}}"));
30
30
  });
@@ -0,0 +1,6 @@
1
+ import type { useFormats } from './useFormats';
2
+ import { useValue } from './useValue';
3
+ import type { useDefaultValue } from './useDefaultValue';
4
+ export declare function useConfirm(value: ReturnType<typeof useValue>, getValueString: ReturnType<typeof useFormats>['getValueString'], defaultValue: ReturnType<typeof useDefaultValue>): {
5
+ onConfirm: () => void;
6
+ };
@@ -0,0 +1,19 @@
1
+ import { useInstance } from 'intact-vue-next';
2
+ export function useConfirm(value, getValueString, defaultValue) {
3
+ var instance = useInstance();
4
+ function onConfirm() {
5
+ var _instance$get = instance.get(),
6
+ multiple = _instance$get.multiple;
7
+ // if we click confirm button directly, set the value to placeholder values
8
+ value.setValue(defaultValue.get(), false);
9
+ if (!multiple) {
10
+ instance.hide();
11
+ } else {
12
+ value.unique();
13
+ }
14
+ value.updateValue();
15
+ }
16
+ return {
17
+ onConfirm: onConfirm
18
+ };
19
+ }
@@ -0,0 +1,4 @@
1
+ import { StateValueItem } from '../datepicker/useValueBase';
2
+ export declare function useDefaultValue(): {
3
+ get: () => StateValueItem;
4
+ };
@@ -0,0 +1,27 @@
1
+ import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
2
+ import { useInstance } from 'intact-vue-next';
3
+ import { last } from '../datepicker/helpers';
4
+ import { NOW_START, NOW_END } from './constants';
5
+ import { isArray } from 'intact-shared';
6
+ export function useDefaultValue() {
7
+ var instance = useInstance();
8
+ function get() {
9
+ var _value = instance.value.value.value;
10
+ var lastValue = last(_value);
11
+ var _instance$get = instance.get(),
12
+ range = _instance$get.range;
13
+ if (range) {
14
+ // consider the second last value to maintain consistency
15
+ var penulimate = getPenulimate(_value);
16
+ return _Object$assign([NOW_START, NOW_END], penulimate, lastValue);
17
+ }
18
+ return lastValue || NOW_START;
19
+ }
20
+ return {
21
+ get: get
22
+ };
23
+ }
24
+ function getPenulimate(value) {
25
+ if (!isArray(value)) return;
26
+ return value[value.length - 2];
27
+ }
@@ -1,10 +1,13 @@
1
1
  import type { useFormats } from './useFormats';
2
2
  import { PanelFlags } from '../datepicker/usePanel';
3
- export declare function useDisabled(formats: ReturnType<typeof useFormats>): {
3
+ import { StateValueItem } from '../datepicker/useValueBase';
4
+ import type { useDefaultValue } from './useDefaultValue';
5
+ export declare function useDisabled(formats: ReturnType<typeof useFormats>, defaultValue: ReturnType<typeof useDefaultValue>): {
4
6
  isDisabled: (value: import("dayjs").Dayjs, type?: "h" | "s" | "y" | "date" | "month" | "week" | "millisecond" | "second" | "minute" | "hour" | "day" | "year" | "milliseconds" | "seconds" | "minutes" | "hours" | "days" | "months" | "years" | "dates" | "d" | "D" | "M" | "m" | "ms" | "weeks" | "w" | "quarter" | "quarters" | "Q") => boolean;
5
- isDisabledConfirm: () => boolean;
6
7
  maxDate: import("../../hooks/useState").State<import("dayjs").Dayjs | null>;
7
8
  minDate: import("../../hooks/useState").State<import("dayjs").Dayjs | null>;
8
- isDisabledTime: (value: import("dayjs").Dayjs, flag: PanelFlags) => boolean;
9
+ isDisabledTime: (value: import("dayjs").Dayjs) => boolean;
9
10
  isDisabledTimeByStep: (value: string, flag: PanelFlags) => boolean;
11
+ isDisabledConfirm: () => boolean;
12
+ isDisabledValue: (value: StateValueItem) => boolean;
10
13
  };
@@ -1,16 +1,25 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime-corejs3/helpers/objectWithoutPropertiesLoose";
3
- var _excluded = ["isDisabledTime"];
3
+ var _excluded = ["isDisabledTime", "isDisabledConfirm", "isDisabledValue"];
4
+ import { useInstance } from 'intact-vue-next';
4
5
  import { useDisabled as useDisabledBase } from '../datepicker/useDisabled';
5
- export function useDisabled(formats) {
6
+ export function useDisabled(formats, defaultValue) {
7
+ var instance = useInstance();
6
8
  var _useDisabledBase = useDisabledBase(formats),
7
9
  isDisabledTime = _useDisabledBase.isDisabledTime,
10
+ isDisabledConfirmBase = _useDisabledBase.isDisabledConfirm,
11
+ isDisabledValue = _useDisabledBase.isDisabledValue,
8
12
  rest = _objectWithoutPropertiesLoose(_useDisabledBase, _excluded);
9
13
  function isDisabledTimeByStep(value, flag) {
10
- return isDisabledTime(formats.createDateByValueFormat(value), flag);
14
+ return isDisabledTime(formats.createDateByValueFormat(value));
15
+ }
16
+ function isDisabledConfirm() {
17
+ return isDisabledValue(defaultValue.get());
11
18
  }
12
19
  return _extends({
13
20
  isDisabledTime: isDisabledTime,
14
- isDisabledTimeByStep: isDisabledTimeByStep
21
+ isDisabledTimeByStep: isDisabledTimeByStep,
22
+ isDisabledConfirm: isDisabledConfirm,
23
+ isDisabledValue: isDisabledValue
15
24
  }, rest);
16
25
  }
@@ -1,7 +1,7 @@
1
1
  import { Component } from 'intact-vue-next';
2
2
  import dayjs, { Dayjs } from '../datepicker/dayjs';
3
3
  import type { TimepickerProps } from './';
4
- import type { Value } from '../datepicker/basepicker';
4
+ import type { Value } from '../datepicker/useValueBase';
5
5
  export declare function useFormats<T extends Component<TimepickerProps>>(): {
6
6
  getValueFormat: () => string;
7
7
  getShowFormat: () => string;
@@ -1,17 +1,22 @@
1
1
  import type { useFormats } from './useFormats';
2
- import { StateValueItem } from '../datepicker/basepicker';
2
+ import { StateValueItem, DayjsValue } from '../datepicker/useValueBase';
3
3
  import type { useDisabled } from '../datepicker/useDisabled';
4
4
  import type { usePanel } from '../datepicker/usePanel';
5
5
  import { PanelFlags } from '../datepicker/usePanel';
6
- export declare function useValue(formats: ReturnType<typeof useFormats>, disabled: ReturnType<typeof useDisabled>, panel: ReturnType<typeof usePanel>): {
6
+ import type Dayjs from 'dayjs';
7
+ import type { useDefaultValue } from './useDefaultValue';
8
+ export declare function useValue(formats: ReturnType<typeof useFormats>, disabled: ReturnType<typeof useDisabled>, panel: ReturnType<typeof usePanel>, defaultValue: ReturnType<typeof useDefaultValue>): {
7
9
  format: () => string | string[];
8
- onConfirm: () => void;
9
- getTimeValue: (flag: PanelFlags) => import("dayjs").Dayjs | null | undefined;
10
- convertToDayjs: (v: import("../datepicker/basepicker").Value | [import("../datepicker/basepicker").Value, import("../datepicker/basepicker").Value] | import("../datepicker/basepicker").Value[] | [import("../datepicker/basepicker").Value, import("../datepicker/basepicker").Value][] | null | undefined) => import("../datepicker/basepicker").DayjsValue;
10
+ formatSingleValue: (value: StateValueItem) => string;
11
+ convertToDayjs: (v: import("../datepicker/useValueBase").Value | [import("../datepicker/useValueBase").Value, import("../datepicker/useValueBase").Value] | import("../datepicker/useValueBase").Value[] | [import("../datepicker/useValueBase").Value, import("../datepicker/useValueBase").Value][] | null | undefined) => DayjsValue;
12
+ unique: () => void;
11
13
  setMoment: () => void;
12
- value: import("../../hooks/useState").State<import("../datepicker/basepicker").StateValue>;
14
+ updateValue: () => void;
15
+ allValuesUpdatedInMultipleMode: () => boolean | undefined;
16
+ value: import("../../hooks/useState").State<import("../datepicker/useValueBase").StateValue>;
13
17
  setValue: (v: StateValueItem, fromInput: boolean) => void;
14
- getDayjsValue: () => import("../datepicker/basepicker").DayjsValue;
15
- onChangeTime: (date: import("dayjs").Dayjs, flag: PanelFlags) => void;
18
+ getDayjsValue: () => DayjsValue;
19
+ onChangeTime: (date: Dayjs.Dayjs, flag: PanelFlags) => void;
16
20
  onChangeTimeByStep: (v: string, flag: PanelFlags) => void;
21
+ getTimeValue: (flag: PanelFlags) => Dayjs.Dayjs | null | undefined;
17
22
  };
@@ -1,19 +1,17 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime-corejs3/helpers/objectWithoutPropertiesLoose";
3
- var _excluded = ["value", "getDayjsValue", "setValue", "onChangeTime"];
3
+ var _excluded = ["value", "getDayjsValue", "setValue", "onChangeTime", "getTimeValue"];
4
4
  import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/slice";
5
5
  import { useInstance } from 'intact-vue-next';
6
- import { last } from '../utils';
7
- import { useValue as useValueBase } from '../datepicker/basepicker';
8
- import { NOW_START, NOW_END } from './constants';
9
- export function useValue(formats, disabled, panel) {
6
+ import { useValueBase } from '../datepicker/useValueBase';
7
+ export function useValue(formats, disabled, panel, defaultValue) {
10
8
  var instance = useInstance();
11
9
  var _useValueBase = useValueBase(formats, disabled, panel, function (v) {
12
10
  return false;
13
11
  }, function (v) {
14
12
  // pop the last value when input
15
13
  // because it is a placeholder date
16
- value.value.pop();
14
+ // value.value.pop(); // no placeholder any more
17
15
  setValue(v, true);
18
16
  }, function () {
19
17
  return 'second';
@@ -24,24 +22,25 @@ export function useValue(formats, disabled, panel) {
24
22
  getDayjsValue = _useValueBase.getDayjsValue,
25
23
  setValue = _useValueBase.setValue,
26
24
  onChangeTime = _useValueBase.onChangeTime,
25
+ getTimeValueBase = _useValueBase.getTimeValue,
27
26
  rest = _objectWithoutPropertiesLoose(_useValueBase, _excluded);
28
- setValue(getPlaceholderDates(), false);
29
- instance.watch('value', function (value) {
30
- var dayjsValue = getDayjsValue();
31
- setValue(last(dayjsValue) || getPlaceholderDates(), false);
32
- });
33
- function getPlaceholderDates() {
34
- return instance.get('range') ? [NOW_START, NOW_END] : NOW_START;
35
- }
36
27
  function onChangeTimeByStep(v, flag) {
37
28
  var date = formats.createDateByValueFormat(v);
38
29
  onChangeTime(date, flag);
39
30
  }
31
+ function getTimeValue(flag) {
32
+ var value = defaultValue.get();
33
+ if (instance.get('range')) {
34
+ return value[flag];
35
+ }
36
+ return value;
37
+ }
40
38
  return _extends({
41
39
  value: value,
42
40
  setValue: setValue,
43
41
  getDayjsValue: getDayjsValue,
44
42
  onChangeTime: onChangeTime,
45
- onChangeTimeByStep: onChangeTimeByStep
43
+ onChangeTimeByStep: onChangeTimeByStep,
44
+ getTimeValue: getTimeValue
46
45
  }, rest);
47
46
  }
@@ -285,7 +285,7 @@ describe('Tour', function () {
285
285
  buttons = element.querySelectorAll('.k-btn');
286
286
  startBtn = _findInstanceProperty(_context14 = _Array$from(buttons)).call(_context14, function (btn) {
287
287
  var _btn$textContent7;
288
- return (_btn$textContent7 = btn.textContent) == null ? void 0 : _includesInstanceProperty(_btn$textContent7).call(_btn$textContent7, '启动引导');
288
+ return (_btn$textContent7 = btn.textContent) == null ? void 0 : _includesInstanceProperty(_btn$textContent7).call(_btn$textContent7, '开始自定义按钮引导');
289
289
  });
290
290
  startBtn.click();
291
291
  _context15.next = 6;
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.6.0-beta.0
2
+ * @king-design v3.6.1
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -66,7 +66,7 @@ export * from './components/upload';
66
66
  export * from './components/view';
67
67
  export * from './components/virtualList';
68
68
  export * from './components/wave';
69
- export declare const version = "3.6.0-beta.0";
69
+ export declare const version = "3.6.1";
70
70
 
71
71
 
72
72
  export {normalize} from 'intact-vue-next';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.6.0-beta.0
2
+ * @king-design v3.6.1
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -67,7 +67,7 @@ export * from './components/upload';
67
67
  export * from './components/view';
68
68
  export * from './components/virtualList';
69
69
  export * from './components/wave';
70
- export var version = '3.6.0-beta.0';
70
+ export var version = '3.6.1';
71
71
  /* generate end */
72
72
 
73
73
  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.6.0-beta.0",
3
+ "version": "3.6.1",
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.40",
40
+ "intact-vue-next": "3.0.44",
41
41
  "monaco-editor": "^0.26.1",
42
42
  "mxgraphx": "^4.0.7",
43
43
  "resize-observer-polyfill": "^1.5.1",
package/yarn-error.log CHANGED
@@ -1,8 +1,8 @@
1
1
  Arguments:
2
- /usr/local/bin/node /usr/local/Cellar/yarn/1.22.19/libexec/bin/yarn.js
2
+ /home/javey/.nvm/versions/node/v14.21.3/bin/node /usr/share/yarn/bin/yarn.js --registry=https://registry.npmjs.org
3
3
 
4
4
  PATH:
5
- /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/knightedge/bin
5
+ /tmp/yarn--1709196756448-0.38987287096922607:/home/javey/Workspaces/kpc/node_modules/.bin:/home/javey/.config/yarn/link/node_modules/.bin:/home/javey/.nvm/versions/node/v14.21.3/libexec/lib/node_modules/npm/bin/node-gyp-bin:/home/javey/.nvm/versions/node/v14.21.3/lib/node_modules/npm/bin/node-gyp-bin:/home/javey/.nvm/versions/node/v14.21.3/bin/node_modules/npm/bin/node-gyp-bin:/home/javey/.nvm/versions/node/v14.21.3/bin:/home/javey/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/javey/.yarn/bin:/home/javey/.local/bin:/home/javey/.yarn/bin:/home/javey/.local/bin
6
6
 
7
7
  Yarn version:
8
8
  1.22.19
@@ -11,18 +11,18 @@ Node version:
11
11
  14.21.3
12
12
 
13
13
  Platform:
14
- darwin x64
14
+ linux x64
15
15
 
16
16
  Trace:
17
- Error: https://registry.npmjs.org/intact-vue-next/-/intact-vue-next-3.0.34.tgz: ETIMEDOUT
18
- at Timeout._onTimeout (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:141550:19)
17
+ Error: https://registry.npmjs.org/intact-vue-next: ETIMEDOUT
18
+ at Timeout._onTimeout (/usr/share/yarn/lib/cli.js:141550:19)
19
19
  at listOnTimeout (internal/timers.js:557:17)
20
20
  at processTimers (internal/timers.js:500:7)
21
21
 
22
22
  npm manifest:
23
23
  {
24
24
  "name": "@king-design/vue",
25
- "version": "3.3.0",
25
+ "version": "3.2.0",
26
26
  "description": "King-Design UI components for Vue3.0.",
27
27
  "keywords": [
28
28
  "component",
@@ -59,7 +59,7 @@ npm manifest:
59
59
  "@emotion/css": "^11.5.0",
60
60
  "dayjs": "^1.10.7",
61
61
  "enquire.js": "^2.1.6",
62
- "intact-vue-next": "3.0.34",
62
+ "intact-vue-next": "3.0.31",
63
63
  "monaco-editor": "^0.26.1",
64
64
  "mxgraphx": "^4.0.7",
65
65
  "resize-observer-polyfill": "^1.5.1",
@@ -67,7 +67,8 @@ npm manifest:
67
67
  "tslib": "^2.3.1"
68
68
  },
69
69
  "sideEffects": [
70
- "./styles/**/*"
70
+ "**/*/styles/global.*",
71
+ "**/*/styles/fonts/*"
71
72
  ],
72
73
  "devDependencies": {
73
74
  "@vue/babel-plugin-jsx": "^1.1.5",
@@ -708,30 +709,30 @@ Lockfile:
708
709
  parent-module "^1.0.0"
709
710
  resolve-from "^4.0.0"
710
711
 
711
- intact-shared@^3.0.34:
712
- version "3.0.34"
713
- resolved "https://registry.npmjs.org/intact-shared/-/intact-shared-3.0.34.tgz#ddaf0e098540d8e98bf49c5f378a33681f1c55a9"
714
- integrity sha512-pT8cpl7XDF7lYM6xWEoLwtf12sEysPjSfdmUr5DXaWvRm8cByg4dTxC+/+KQ0m3Umv0WE2vilQMixIh9hqe0Fg==
712
+ intact-shared@^3.0.30:
713
+ version "3.0.30"
714
+ resolved "https://registry.npmjs.org/intact-shared/-/intact-shared-3.0.30.tgz#ba07cad0f88a3ad6dfae4a2e3dd7c8bac0b1713b"
715
+ integrity sha512-Umk8DDJSNvGKnccSH3VhkHiaLEVabgAupFmDACMbT2pW8phjVRqJxTzTOeyCX+1NEPkxouEAvtNKPWngVsLquw==
715
716
 
716
- intact-vue-next@3.0.34:
717
- version "3.0.34"
718
- resolved "https://registry.npmjs.org/intact-vue-next/-/intact-vue-next-3.0.34.tgz#e9c4268c9be81900f590ec536df561ec70aa3a85"
719
- integrity sha512-nv9UUXZ72jfXflVbopTWb+oxrGw9aoIdguaMwnn8EzIhiNaA34zpRqhy8GXOUJCG85P9BCkZZfU1zD0LqMtVIQ==
717
+ intact-vue-next@3.0.30:
718
+ version "3.0.30"
719
+ resolved "https://registry.npmjs.org/intact-vue-next/-/intact-vue-next-3.0.30.tgz#6e5301d52b19bed602b434424502a311712f464e"
720
+ integrity sha512-MqRhCxS0j7T8x+dRsnPaDGRE+i7A6XJ7gpxtMa33IYCNsOY/a/mGNRT3cvXvjY43+OunwV5IrT6x4w/fwAiaPQ==
720
721
  dependencies:
721
- intact "^3.0.34"
722
- intact-shared "^3.0.34"
722
+ intact "^3.0.30"
723
+ intact-shared "^3.0.30"
723
724
  tslib "^2.3.1"
724
725
 
725
- intact@^3.0.34:
726
- version "3.0.34"
727
- resolved "https://registry.npmjs.org/intact/-/intact-3.0.34.tgz#9407202bd159f29d80792c26218b97b682cfae78"
728
- integrity sha512-j13WHChj5aJmw4+FSgMoEF/s67mnsq/fSA0LhSpmGYY6CChsBH6aPyQJUvEdYtjytZBCABvuJYgbcbyNHynb+w==
726
+ intact@^3.0.30:
727
+ version "3.0.30"
728
+ resolved "https://registry.npmjs.org/intact/-/intact-3.0.30.tgz#b6eff7635dddb2d351710853891799f5b32e2666"
729
+ integrity sha512-1hdp7oiELdVdeCCh8+CFlkGx5NoNe5HNE3Gaz84tt0DE17BS87rH6h3ByPChqYvEgfuvN8l2/Iobl5PNJWOuGQ==
729
730
  dependencies:
730
- intact-shared "^3.0.34"
731
- misstime "^3.0.34"
731
+ intact-shared "^3.0.30"
732
+ misstime "^3.0.30"
732
733
  tslib "^2.2.0"
733
- vdt "^3.0.34"
734
- vdt-compiler "^3.0.34"
734
+ vdt "^3.0.30"
735
+ vdt-compiler "^3.0.30"
735
736
 
736
737
  is-arrayish@^0.2.1:
737
738
  version "0.2.1"
@@ -807,12 +808,12 @@ Lockfile:
807
808
  resolved "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
808
809
  integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
809
810
 
810
- misstime@^3.0.34:
811
- version "3.0.34"
812
- resolved "https://registry.npmjs.org/misstime/-/misstime-3.0.34.tgz#462f6509d06e1e80e7622b0ffa96df5438bbb87d"
813
- integrity sha512-xO5ZHcG0cYkcWr7ZPquGFQWnZaMC5y4r1lKlFqCedLHFAAiV8SNEnj4bpFge8yTJJNO8LEXKOFWuE8WWpfy22g==
811
+ misstime@^3.0.30:
812
+ version "3.0.30"
813
+ resolved "https://registry.npmjs.org/misstime/-/misstime-3.0.30.tgz#59a307e3b099cf988e03eef25d67921ec2131db5"
814
+ integrity sha512-UoDxIiRZl0i4IOPyJpDLc/rxxPEU9Co3H5rwrZeTxrQFQBTbaP/JxUYJ76hnYqeSDOC9doN7jeSrHH+3oTqfig==
814
815
  dependencies:
815
- intact-shared "^3.0.34"
816
+ intact-shared "^3.0.30"
816
817
 
817
818
  monaco-editor@^0.26.1:
818
819
  version "0.26.1"
@@ -953,22 +954,22 @@ Lockfile:
953
954
  resolved "https://registry.npmmirror.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410"
954
955
  integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==
955
956
 
956
- vdt-compiler@^3.0.34:
957
- version "3.0.34"
958
- resolved "https://registry.npmjs.org/vdt-compiler/-/vdt-compiler-3.0.34.tgz#7110da7dc1e86a5a54987e9e07922cc25f46e0fb"
959
- integrity sha512-UFILLLLSg9SxXkiyGLdGbExOttTf5Tawpu07YFOxjRQJA5mpUWhus2+2RUbkNiWzr+9OJB7hZCwEWBKF+pQd1Q==
957
+ vdt-compiler@^3.0.30:
958
+ version "3.0.30"
959
+ resolved "https://registry.npmjs.org/vdt-compiler/-/vdt-compiler-3.0.30.tgz#557368a09ac602e2c5ef90fd421bc6c86f92df19"
960
+ integrity sha512-W8kAoGqz56+rauoJfhRDOFO1tV6RNPsZIXeCATWIgmv8+DnciJXU8WgrbqDW9IQbYCXrOnMGZZXaZJATPkNXGg==
960
961
  dependencies:
961
- intact-shared "^3.0.34"
962
- misstime "^3.0.34"
962
+ intact-shared "^3.0.30"
963
+ misstime "^3.0.30"
963
964
  tslib "^2.2.0"
964
965
 
965
- vdt@^3.0.34:
966
- version "3.0.34"
967
- resolved "https://registry.npmjs.org/vdt/-/vdt-3.0.34.tgz#b01df681dbd986ef0515ead3f0a8c060b840a327"
968
- integrity sha512-mGGTKgCTXZYHIlUYb2UsZxfp/n4sRLUP5XU+tA9l3qUXjvKeHz9tSsPdS4JdugvhTapaf8USTeE59e7SeMbzlA==
966
+ vdt@^3.0.30:
967
+ version "3.0.30"
968
+ resolved "https://registry.npmjs.org/vdt/-/vdt-3.0.30.tgz#12dbf2644a96cf2d6428cb1f17e02aa4076f7a98"
969
+ integrity sha512-HkkgHTDWHBiffZtVRnQb3rKs0p1/VoPkeMQH+5nbqYesAFhFOiF1jpvrQn6cRWZvcRsQMcJWNZT46V8t6eL8KQ==
969
970
  dependencies:
970
- intact-shared "^3.0.34"
971
- misstime "^3.0.34"
971
+ intact-shared "^3.0.30"
972
+ misstime "^3.0.30"
972
973
  tslib "^2.2.0"
973
974
 
974
975
  vue-loader@^16.1.2: