@king-design/vue 3.1.4-beta.0 → 3.1.4-beta.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.
@@ -31,11 +31,10 @@ export default function ($props, $blocks, $__proto__) {
31
31
  name = _this$get.name,
32
32
  ghost = _this$get.ghost;
33
33
 
34
- var checked = this.isChecked();
35
- if (!this.config) debugger;
36
34
  var _this$config = this.config,
37
35
  cls = _this$config.cls,
38
36
  k = _this$config.k;
37
+ var checked = this.isChecked();
39
38
 
40
39
  var isIcon = function isIcon(child) {
41
40
  return child.tag === Icon || child.className && child.className.indexOf('icon') > -1;
@@ -264,13 +264,13 @@ export var makeButtonStyles = cache(function makeButtonStyles(k, iconSide) {
264
264
  }), ";.", k, "-icon-loading{margin-left:-1em;}}}"), ";"));
265
265
  });
266
266
  export var makeButtonGroupStyles = cache(function makeButtonGroupStyles(k) {
267
- return /*#__PURE__*/css("display:inline-flex;align-items:center;flex-wrap:wrap;vertical-align:middle;.", k, "-btn{margin:0;vertical-align:middle;&:hover,&:focus,&.", k, "-active{z-index:1;position:relative;}}&.", k, "-fluid{width:100%;}&:not(.", k, "-vertical){>.", k, "-btn{", _mapInstanceProperty(types).call(types, function (type) {
267
+ return /*#__PURE__*/css("display:inline-flex;align-items:center;flex-wrap:wrap;vertical-align:middle;.", k, "-btn{margin:0;vertical-align:middle;&:hover,&:focus,&.", k, "-active{z-index:1;position:relative;}}&.", k, "-fluid{width:100%;}&:not(.", k, "-vertical):not(.", k, "-seperate){>.", k, "-btn{", _mapInstanceProperty(types).call(types, function (type) {
268
268
  if (type === 'active') return;
269
269
  var borderColor = button.group[type].borderColor;
270
270
  return /*#__PURE__*/css("&.", k, "-", type, ":not(:first-child){border-left-color:", borderColor, ";}&.", k, "-", type, ":not(:last-child){border-right-color:", borderColor, ";}");
271
- }), ";&:not(:first-child){margin-left:-1px;&:not(:last-child){border-radius:0;}}&:not(:only-child):first-child{border-top-right-radius:0;border-bottom-right-radius:0;}&:not(:only-child):last-child{border-top-left-radius:0;border-bottom-left-radius:0;}}&.", k, "-fluid{display:flex;>.", k, "-btn{flex:1;}}}&.", k, "-vertical{flex-direction:column;>.", k, "-btn{", _mapInstanceProperty(types).call(types, function (type) {
271
+ }), ";&:not(:first-child){margin-left:-1px;&:not(:last-child){border-radius:0;}}&:not(:only-child):first-child{border-top-right-radius:0;border-bottom-right-radius:0;}&:not(:only-child):last-child{border-top-left-radius:0;border-bottom-left-radius:0;}}&.", k, "-fluid{display:flex;>.", k, "-btn{flex:1;}}}&.", k, "-vertical:not(.", k, "-seperate){flex-direction:column;>.", k, "-btn{", _mapInstanceProperty(types).call(types, function (type) {
272
272
  if (type === 'active') return;
273
273
  var borderColor = button.group[type].borderColor;
274
274
  return /*#__PURE__*/css("&.", k, "-", type, ":not(:first-child){border-top-color:", borderColor, ";}&.", k, "-", type, ":not(:last-child){border-bottom-color:", borderColor, ";}");
275
- }), ";&:not(.", k, "-btn-icon){width:100%;}&:not(:first-child){margin-top:-1px;&:not(:last-child){border-radius:0;}}&:not(:only-child):first-child{border-bottom-left-radius:0;border-bottom-right-radius:0;}&:not(:only-child):last-child{border-top-left-radius:0;border-top-right-radius:0;}}}&.", k, "-seperate{gap:8px;>.", k, "-btn{border-radius:", button.borderRadius, "!important;}}");
275
+ }), ";&:not(.", k, "-btn-icon){width:100%;}&:not(:first-child){margin-top:-1px;&:not(:last-child){border-radius:0;}}&:not(:only-child):first-child{border-bottom-left-radius:0;border-bottom-right-radius:0;}&:not(:only-child):last-child{border-top-left-radius:0;border-top-right-radius:0;}}}&.", k, "-seperate{gap:8px;}");
276
276
  });
@@ -1,8 +1,10 @@
1
1
  import { Component, VNode, TypeDefs } from 'intact-vue-next';
2
2
  export * from './column';
3
+ import { Sizes } from '../types';
3
4
  export interface CardProps {
4
5
  title?: string | VNode;
5
6
  type?: 'shadow' | 'border' | 'none';
7
+ size?: Sizes;
6
8
  }
7
9
  export interface CardEvents {
8
10
  }
@@ -6,12 +6,14 @@ export * from './column';
6
6
  import { useConfigContext } from '../config';
7
7
  var typeDefs = {
8
8
  title: [String, VNode],
9
- type: ['shadow', 'border', 'none']
9
+ type: ['shadow', 'border', 'none'],
10
+ size: String
10
11
  };
11
12
 
12
13
  var defaults = function defaults() {
13
14
  return {
14
- type: 'shadow'
15
+ type: 'shadow',
16
+ size: 'default'
15
17
  };
16
18
  };
17
19
 
@@ -16,7 +16,8 @@ export default function ($props, $blocks, $__proto__) {
16
16
  children = _this$get.children,
17
17
  className = _this$get.className,
18
18
  title = _this$get.title,
19
- type = _this$get.type;
19
+ type = _this$get.type,
20
+ size = _this$get.size;
20
21
 
21
22
  var k = this.config.k;
22
23
  var hasHeader = $blocks.header || $blocks.title || title || $blocks.extra;
@@ -33,7 +34,7 @@ export default function ($props, $blocks, $__proto__) {
33
34
  }
34
35
  }
35
36
 
36
- var classNameObj = (_classNameObj = {}, _classNameObj[k + "-card"] = true, _classNameObj[k + "-shadow"] = type === 'shadow', _classNameObj[k + "-border"] = type === 'border', _classNameObj[k + "-none"] = type === 'none', _classNameObj[k + "-no-header"] = !hasHeader, _classNameObj[k + "-card-grid"] = hasColumn, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
37
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-card"] = true, _classNameObj[k + "-shadow"] = type === 'shadow', _classNameObj[k + "-border"] = type === 'border', _classNameObj[k + "-none"] = type === 'none', _classNameObj[k + "-no-header"] = !hasHeader, _classNameObj[k + "-card-grid"] = hasColumn, _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
37
38
  return _$cv('div', _extends({
38
39
  'className': _$cn(classNameObj)
39
40
  }, getRestProps(this)), [hasHeader ? _$ce(2, 'div', (_$blocks['header'] = function ($super) {
@@ -1,3 +1,4 @@
1
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
1
2
  import { css } from '@emotion/css';
2
3
  import { theme, setDefault } from '../../styles/theme';
3
4
  import { deepDefaults } from '../../styles/utils';
@@ -5,7 +6,7 @@ import '../../styles/global';
5
6
  import { cache } from '../utils';
6
7
  var defaults = {
7
8
  border: '1px solid #e5e5e5',
8
- padding: '16px',
9
+ padding: '24px',
9
10
 
10
11
  get boxShadow() {
11
12
  return theme.boxShadow;
@@ -17,7 +18,19 @@ var defaults = {
17
18
 
18
19
  headerHeight: '48px',
19
20
  headerFontSize: '14px',
20
- bgColor: '#fff'
21
+ bgColor: '#fff',
22
+ large: {
23
+ padding: '32px',
24
+ headerHeight: '48px'
25
+ },
26
+ small: {
27
+ padding: '16px',
28
+ headerHeight: '48px'
29
+ },
30
+ mini: {
31
+ padding: '8px',
32
+ headerHeight: '32px'
33
+ }
21
34
  };
22
35
  var card;
23
36
  setDefault(function () {
@@ -26,6 +39,12 @@ setDefault(function () {
26
39
  }).card;
27
40
  makeStyles == null ? void 0 : makeStyles.clearCache();
28
41
  });
42
+ var sizes = ['large', 'small', 'mini'];
29
43
  export var makeStyles = cache(function makeStyles(k) {
30
- return /*#__PURE__*/css("border-radius:", card.borderRadius, ";background:", card.bgColor, ";.", k, "-card-header{height:", card.headerHeight, ";line-height:", card.headerHeight, ";padding:0 ", card.padding, ";}.", k, "-card-title{font-size:", card.headerFontSize, ";display:inline-block;}.", k, "-card-extra{float:right;height:100%;display:flex;align-items:center;}.", k, "-card-body{padding:0 ", card.padding, " ", card.padding, ";}&.", k, "-shadow{box-shadow:", card.boxShadow, ";}&.", k, "-none{box-shadow:none;}&.", k, "-border{border:", card.border, ";.", k, "-card-header{border-bottom:", card.border, ";}.", k, "-card-body{padding-top:", card.padding, ";}}&.", k, "-no-header{.", k, "-card-body{padding-top:", card.padding, ";}}&.", k, "-card-grid{.", k, "-card-body{display:flex;padding:0;}&.", k, "-border{.", k, "-card-column:not(:last-of-type){border-right:", card.border, ";}}}.", k, "-card-column{display:flex;align-items:center;padding:", card.padding, ";&.", k, "-fluid{flex:1;}&.", k, "-center{justify-content:center;}}");
44
+ return /*#__PURE__*/css("border-radius:", card.borderRadius, ";background:", card.bgColor, ";.", k, "-card-header{height:", card.headerHeight, ";padding:0 ", card.padding, ";display:flex;align-items:center;}.", k, "-card-title{font-size:", card.headerFontSize, ";flex:1;}.", k, "-card-extra{display:flex;align-items:center;}.", k, "-card-body{padding:0 ", card.padding, " ", card.padding, ";}&.", k, "-shadow{box-shadow:", card.boxShadow, ";}&.", k, "-none{box-shadow:none;}&.", k, "-border{border:", card.border, ";.", k, "-card-header{border-bottom:", card.border, ";}.", k, "-card-body{padding-top:", card.padding, ";}}&.", k, "-no-header{.", k, "-card-body{padding-top:", card.padding, ";}}&.", k, "-card-grid{.", k, "-card-body{display:flex;padding:0;}&.", k, "-border{.", k, "-card-column:not(:last-of-type){border-right:", card.border, ";}}}.", k, "-card-column{display:flex;align-items:center;padding:", card.padding, ";&.", k, "-fluid{flex:1;}&.", k, "-center{justify-content:center;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
45
+ var _card$size = card[size],
46
+ padding = _card$size.padding,
47
+ headerHeight = _card$size.headerHeight;
48
+ return /*#__PURE__*/css("&.", k, "-", size, "{.", k, "-card-header{padding:0 ", padding, ";height:", headerHeight, ";}.", k, "-card-body{padding:0 ", padding, " ", padding, ";}&.", k, "-border,&.", k, "-no-header{.", k, "-card-body{padding-top:", padding, ";}}.", k, "-card-column{padding:", padding, ";}}");
49
+ }), ";");
31
50
  });
@@ -1,7 +1,7 @@
1
1
  import { useInstance, onBeforeUnmount } from 'intact-vue-next';
2
2
  export function useAutoplay(next) {
3
3
  var instance = useInstance();
4
- var timer;
4
+ var timer = null;
5
5
  var ms;
6
6
  instance.on('$receive:autoplay', function (v) {
7
7
  if (v === true) {
@@ -24,7 +24,10 @@ export function useAutoplay(next) {
24
24
  }
25
25
 
26
26
  function stop() {
27
- window.clearTimeout(timer);
27
+ if (timer) {
28
+ window.clearTimeout(timer);
29
+ timer = null;
30
+ }
28
31
  }
29
32
 
30
33
  onBeforeUnmount(stop);
@@ -0,0 +1,45 @@
1
+ import { TypeDefs } from 'intact-vue-next';
2
+ import { BaseSelect, BaseSelectProps, BaseSelectEvents, BaseSelectBlocks } from '../select/base';
3
+ export interface CascaderProps<V = any, Multipe extends boolean = boolean, Data extends BaseCascaderData = CascaderData<V>> extends BaseSelectProps<V[], Multipe> {
4
+ data?: Data[];
5
+ trigger?: 'click' | 'hover';
6
+ changeOnSelect?: boolean;
7
+ format?: (labels: string[]) => string;
8
+ loadData?: (data: Data) => any;
9
+ filter?: (keywords: string, data: Data) => boolean;
10
+ fields?: CascaderFields<Data>;
11
+ }
12
+ export declare type CascaderFields<Data> = {
13
+ value?: keyof Data;
14
+ label?: keyof Data;
15
+ children?: keyof Data;
16
+ disabled?: keyof Data;
17
+ };
18
+ export interface BaseCascaderData {
19
+ loaded?: boolean;
20
+ [key: string]: any;
21
+ }
22
+ export interface CascaderData<V> extends BaseCascaderData {
23
+ value: V;
24
+ label: string;
25
+ children?: CascaderData<V>[];
26
+ disabled?: boolean;
27
+ }
28
+ export interface CascaderEvents extends BaseSelectEvents {
29
+ }
30
+ export interface CascaderBlocks<V> extends BaseSelectBlocks<V> {
31
+ }
32
+ export declare class Cascader<V = any, Multipe extends boolean = false, Data extends BaseCascaderData = CascaderData<V>> extends BaseSelect<CascaderProps<V, Multipe, Data>, CascaderEvents, CascaderBlocks<V>> {
33
+ static template: string | import('intact-vue-next').Template<any>;
34
+ static typeDefs: Required<TypeDefs<CascaderProps<any, boolean, CascaderData<any>>>>;
35
+ static defaults: () => Partial<CascaderProps<any, boolean, CascaderData<any>>>;
36
+ private fields;
37
+ private value;
38
+ private label;
39
+ private load;
40
+ private filterable;
41
+ private positionObj;
42
+ protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import('intact-vue-next').Children[];
43
+ protected getLabel(): import('intact-vue-next').Children;
44
+ protected hasValue(): any;
45
+ }
@@ -0,0 +1,63 @@
1
+ import { TypeDefs } from 'intact-vue-next';
2
+ import dayjs from './dayjs';
3
+ import { State } from '../../hooks/useState';
4
+ import { Shortcut } from './shortcuts';
5
+ import { BasePicker, BasePickerProps, BasePickerEvents, BasePickerBlocks, Value } from './basepicker';
6
+ export * as shortcuts from './shortcuts';
7
+ 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
+ type?: 'date' | 'datetime' | 'year' | 'month';
9
+ shortcuts?: Shortcut[];
10
+ }
11
+ export interface DatepickerEvents extends BasePickerEvents {
12
+ }
13
+ export interface DatepickerBlocks<V extends Value = Value, R extends boolean = boolean> extends BasePickerBlocks<V, R> {
14
+ }
15
+ export declare class Datepicker<V extends Value = Value, M extends boolean = false, R extends boolean = false> extends BasePicker<DatepickerProps<V, M, R>, DatepickerEvents, DatepickerBlocks<V, R>> {
16
+ static template: string | import('intact-vue-next').Template<any>;
17
+ static typeDefs: Required<TypeDefs<DatepickerProps<Value, boolean, boolean>>>;
18
+ static defaults: () => Partial<DatepickerProps<Value, boolean, boolean>>;
19
+ formats: {
20
+ getValueFormat: () => string;
21
+ getShowFormat: () => string;
22
+ createDateByValueFormat: (value: Value) => dayjs.Dayjs;
23
+ createDateByShowFormat: (value: string) => dayjs.Dayjs;
24
+ getShowString: (value: dayjs.Dayjs) => string;
25
+ getValueString: (value: dayjs.Dayjs) => string;
26
+ };
27
+ disabled: {
28
+ isDisabled: (value: dayjs.Dayjs, type?: dayjs.OpUnitType) => boolean;
29
+ isDisabledTime: (value: dayjs.Dayjs, flag: import("./usePanel").PanelFlags) => boolean;
30
+ isDisabledConfirm: () => boolean;
31
+ maxDate: State<dayjs.Dayjs | null>;
32
+ minDate: State<dayjs.Dayjs | null>;
33
+ };
34
+ panel: {
35
+ startPanel: State<import("./usePanel").PanelTypes>;
36
+ endPanel: State<import("./usePanel").PanelTypes>;
37
+ changePanel: (type: import("./usePanel").PanelTypes, flag?: import("./usePanel").PanelFlags) => void;
38
+ getPanel: (flag: import("./usePanel").PanelFlags) => State<import("./usePanel").PanelTypes>;
39
+ reset: () => void;
40
+ startRef: import('intact-vue-next').RefObject<import("./calendar").DatepickerCalendar>;
41
+ endRef: import('intact-vue-next').RefObject<import("./calendar").DatepickerCalendar>;
42
+ };
43
+ focusDate: {
44
+ focusDate: State<dayjs.Dayjs | null>;
45
+ reset: () => void;
46
+ };
47
+ value: {
48
+ format: () => string | string[];
49
+ onConfirm: () => void;
50
+ onChangeTime: (date: dayjs.Dayjs, flag: import("./usePanel").PanelFlags) => void;
51
+ getTimeValue: (flag: import("./usePanel").PanelFlags) => dayjs.Dayjs | null | undefined;
52
+ convertToDayjs: (v: Value | [Value, Value] | Value[] | [Value, Value][] | null | undefined) => import("./basepicker").DayjsValue;
53
+ getDayjsValue: () => import("./basepicker").DayjsValue;
54
+ value: State<import("./basepicker").StateValue>;
55
+ setValue: (v: import("./basepicker").StateValueItem, fromInput: boolean) => void;
56
+ onChangeDate: (v: dayjs.Dayjs, flag: import("./usePanel").PanelFlags) => void;
57
+ };
58
+ init(): void;
59
+ protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import('intact-vue-next').Children[];
60
+ protected getLabel(): string | string[];
61
+ protected clear(e: MouseEvent): void;
62
+ private setByShortcut;
63
+ }
@@ -10,7 +10,7 @@ export * from './shapes/rectangle';
10
10
  export * from './shapes/square';
11
11
  export * from './shapes/text';
12
12
  export * from './shapes/line';
13
- declare const DDiamond: import("vdt").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DTriangle: import("vdt").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DCylinder: import("vdt").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DCloud: import("vdt").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>;
13
+ declare const DDiamond: import("misstime").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DTriangle: import("misstime").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DCylinder: import("misstime").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DCloud: import("misstime").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>;
14
14
  export { DDiamond, DTriangle, DCylinder, DCloud };
15
15
  export * from './layouts/layout';
16
16
  export * from './layouts/circle';
@@ -3,7 +3,7 @@ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
3
3
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
4
4
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
5
5
  import { __decorate } from "tslib";
6
- import { Component, createVNode as h, provide, inject, findDomFromVNode, nextTick } from 'intact-vue-next';
6
+ import { Component, createVNode as h, directClone, provide, inject, findDomFromVNode, nextTick } from 'intact-vue-next';
7
7
  import { bind, getRestProps } from '../utils';
8
8
  import { noop } from 'intact-shared';
9
9
  import { cx } from '@emotion/css';
@@ -227,6 +227,12 @@ Dropdown.template = function () {
227
227
  var _children = children,
228
228
  trigger = _children[0],
229
229
  menu = _children[1];
230
+ /**
231
+ * In vue-legacy, if the menu is TooltipContent, the menu will be InUsed when update,
232
+ * so we clone it here, #954
233
+ */
234
+
235
+ menu = directClone(menu);
230
236
  var props = this.initEventCallbacks();
231
237
 
232
238
  var _this$get = this.get(),
@@ -39,7 +39,6 @@ export function usePosition() {
39
39
  var pos = instance.get('position');
40
40
 
41
41
  switch (pos) {
42
- case 'left':
43
42
  case 'left':
44
43
  pos = {
45
44
  my: 'right-10 center',
@@ -39,7 +39,7 @@ export var sizes = ['large', 'small', 'mini'];
39
39
  export var makeStyles = cache(function makeStyles(k, color) {
40
40
  // create the global icon styles
41
41
  makeIconStyles(k);
42
- return /*#__PURE__*/css("color:", icon.color, ";font-size:", icon.fontSize.default, ";line-height:1;", _mapInstanceProperty(sizes).call(sizes, function (size) {
42
+ return /*#__PURE__*/css("color:", icon.color, ";font-size:", icon.fontSize.default, ";line-height:1;font-weight:normal;", _mapInstanceProperty(sizes).call(sizes, function (size) {
43
43
  var fontSize = icon.fontSize[size];
44
44
  return /*#__PURE__*/css("&.", k, "-", size, "{font-size:", fontSize, ";}");
45
45
  }), " ", _mapInstanceProperty(colors).call(colors, function (color) {
@@ -135,7 +135,7 @@ setDefault(function () {
135
135
  export var makeStyles = cache(function makeStyles(k) {
136
136
  var _context;
137
137
 
138
- return /*#__PURE__*/css("display:inline-block;width:", input.width, ";color:", input.color, ";vertical-align:middle;.", k, "-input-wrapper{display:inline-flex;align-items:center;width:100%;position:relative;border:", input.border, ";background-color:", input.bgColor, ";transition:border ", input.transition, ",background ", input.transition, ",box-shadow ", input.transition, ";border-radius:", input.borderRadius, ";&:hover{border:", input.hoverBorder, ";z-index:1;}}&.", k, "-focus .", k, "-input-wrapper{border:", input.focusBorder, ";z-index:1;}.", k, "-input-inner{flex:1;outline:none;color:inherit;font-size:inherit;border:none;background:transparent;padding:0;width:0;&::placeholder{color:", input.placeholderColor, ";}}&.", k, "-fluid{width:100%;}.", k, "-input-prefix,.", k, "-input-suffix{display:flex;align-items:center;gap:", input.clearIconGap, ";color:", theme.color.lightBlack, ";position:relative;}.", k, "-input-prefix{margin-right:", input.clearIconGap, ";}.", k, "-input-suffix{margin-left:", input.clearIconGap, ";}.", k, "-input-clear{opacity:0;transition:opacity ", input.transition, ";pointer-events:none;color:", input.clearIconColor, ";}&:hover .", k, "-input-clear.", k, "-input-show{opacity:1;pointer-events:all;}.", k, "-input-show-password{color:", input.clearIconColor, ";}&.", k, "-stack-clear{.", k, "-input-clear{position:absolute;z-index:1;right:0;&.", k, "-input-show+*{transition:opacity ", input.transition, ";}}&:hover{.", k, "-input-clear.", k, "-input-show+*{opacity:0;}}}&.", k, "-group{display:inline-flex;.", k, "-input-wrapper{border-radius:0;flex:1;}.", k, "-input-wrapper:first-child{border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}.", k, "-input-wrapper:last-child{border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.", k, "-input-prepend,.", k, "-input-append{display:inline-flex;align-items:center;background-color:", input.groupBgColor, ";border:", input.border, ";white-space:nowrap;.", k, "-btn{margin:-1px;&.", k, "-none:hover{background:transparent;}}.", k, "-select{margin:-1px;text-align:left;}}.", k, "-input-prepend{&,.", k, "-btn,.", k, "-select{z-index:1;border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}}.", k, "-input-append{&,.", k, "-btn,.", k, "-select{z-index:1;border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.", k, "-input-padding{padding:0 ", input.groupPaddingGap, ";}.", k, "-input-prepend{border-right:none;}.", k, "-input-append{border-left:none;}&.", k, "-flat{color:", _flatInstanceProperty(input).color, ";.", k, "-input-wrapper{border:none;background:", _flatInstanceProperty(input).bgColor, ";}}&.", k, "-disabled{color:", input.disabledColor, ";cursor:not-allowed;.", k, "-input-wrapper{border-color:", input.disabledBorderColor, ";background:", input.disabledBgColor, ";}.", k, "-input-inner{cursor:not-allowed;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
138
+ return /*#__PURE__*/css("display:inline-block;width:", input.width, ";color:", input.color, ";vertical-align:middle;.", k, "-input-wrapper{display:inline-flex;align-items:center;width:100%;position:relative;border:", input.border, ";background-color:", input.bgColor, ";transition:border ", input.transition, ",background ", input.transition, ",box-shadow ", input.transition, ";border-radius:", input.borderRadius, ";&:hover{border:", input.hoverBorder, ";z-index:1;}}&.", k, "-focus .", k, "-input-wrapper{border:", input.focusBorder, ";z-index:1;}.", k, "-input-inner{flex:1;outline:none;color:inherit;font-size:inherit;border:none;background:transparent;padding:0;width:0;max-width:100%;&::placeholder{color:", input.placeholderColor, ";}}&.", k, "-fluid{width:100%;}.", k, "-input-prefix,.", k, "-input-suffix{display:flex;align-items:center;gap:", input.clearIconGap, ";color:", theme.color.lightBlack, ";position:relative;}.", k, "-input-prefix{margin-right:", input.clearIconGap, ";}.", k, "-input-suffix{margin-left:", input.clearIconGap, ";}.", k, "-input-clear{opacity:0;transition:opacity ", input.transition, ";pointer-events:none;color:", input.clearIconColor, ";}&:hover .", k, "-input-clear.", k, "-input-show{opacity:1;pointer-events:all;}.", k, "-input-show-password{color:", input.clearIconColor, ";}&.", k, "-stack-clear{.", k, "-input-clear{position:absolute;z-index:1;right:0;&.", k, "-input-show+*{transition:opacity ", input.transition, ";}}&:hover{.", k, "-input-clear.", k, "-input-show+*{opacity:0;}}}&.", k, "-group{display:inline-flex;.", k, "-input-wrapper{border-radius:0;flex:1;}.", k, "-input-wrapper:first-child{border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}.", k, "-input-wrapper:last-child{border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.", k, "-input-prepend,.", k, "-input-append{display:inline-flex;align-items:center;background-color:", input.groupBgColor, ";border:", input.border, ";white-space:nowrap;.", k, "-btn{margin:-1px;&.", k, "-none:hover{background:transparent;}}.", k, "-select{margin:-1px;text-align:left;}}.", k, "-input-prepend{&,.", k, "-btn,.", k, "-select{z-index:1;border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}}.", k, "-input-append{&,.", k, "-btn,.", k, "-select{z-index:1;border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.", k, "-input-padding{padding:0 ", input.groupPaddingGap, ";}.", k, "-input-prepend{border-right:none;}.", k, "-input-append{border-left:none;}&.", k, "-flat{color:", _flatInstanceProperty(input).color, ";.", k, "-input-wrapper{border:none;background:", _flatInstanceProperty(input).bgColor, ";}}&.", k, "-disabled{color:", input.disabledColor, ";cursor:not-allowed;.", k, "-input-wrapper{border-color:", input.disabledBorderColor, ";background:", input.disabledBgColor, ";}.", k, "-input-inner{cursor:not-allowed;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
139
139
  var styles = input[size];
140
140
  var sizeClassName = /*#__PURE__*/css("font-size:", styles.fontSize, ";.", k, "-input-wrapper{height:", styles.height, ";padding:0 ", styles.paddingGap, ";}");
141
141
  if (size === 'default') return sizeClassName;
@@ -0,0 +1,33 @@
1
+ import { Children, TypeDefs } from 'intact-vue-next';
2
+ import { Option } from './option';
3
+ import { BaseSelect, BaseSelectProps, BaseSelectEvents, BaseSelectBlocks } from './base';
4
+ export interface SelectProps<T = string, Multipe extends boolean = boolean> extends BaseSelectProps<T, Multipe> {
5
+ filter?: (keywords: string, props: any) => boolean;
6
+ searchable?: boolean;
7
+ creatable?: boolean;
8
+ labelMap?: Map<any, Children>;
9
+ card?: boolean;
10
+ autoDisableArrow?: boolean;
11
+ }
12
+ export interface SelectEvents extends BaseSelectEvents {
13
+ }
14
+ export interface SelectBlocks<T> extends BaseSelectBlocks<T> {
15
+ menu: null;
16
+ }
17
+ export declare class Select<T = string, Multipe extends boolean = false> extends BaseSelect<SelectProps<T, Multipe>, SelectEvents, SelectBlocks<T>> {
18
+ static template: string | import('intact-vue-next').Template<any>;
19
+ static typeDefs: Required<TypeDefs<SelectProps<string, boolean>>>;
20
+ static defaults: () => Partial<SelectProps<string, boolean>>;
21
+ filterable: {
22
+ getCreatedVNode: (children: (string | number | import('intact-vue-next').VNode<import('intact-vue-next').VNodeTag>)[]) => import('intact-vue-next').VNode<typeof Option> | undefined;
23
+ filter: (children: Children) => Children;
24
+ };
25
+ label: {
26
+ getLabel: () => Children;
27
+ activeIndices: import('intact-vue-next').NonNullableRefObject<number[]>;
28
+ };
29
+ init(): void;
30
+ protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | Children[];
31
+ protected getLabel(): Children;
32
+ private getAllShowedValues;
33
+ }
@@ -1,5 +1,5 @@
1
1
  export declare const context: {
2
- Provider: import("vdt").ComponentConstructor<import('intact-vue-next').Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
3
- Consumer: import("vdt").ComponentConstructor<import('intact-vue-next').Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
4
- useContext: () => import("vdt").RefObject<any>;
2
+ Provider: import("misstime").ComponentConstructor<import('intact-vue-next').Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
3
+ Consumer: import("misstime").ComponentConstructor<import('intact-vue-next').Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
4
+ useContext: () => import("misstime").RefObject<any>;
5
5
  };
@@ -78,7 +78,7 @@ function pushTextContext(rows, dom, content) {
78
78
  export function download(content, filename) {
79
79
  if (navigator.msSaveBlob) {
80
80
  // IE10+
81
- var blob = new Blob([content], {
81
+ var blob = new Blob(["\uFEFF" + content], {
82
82
  type: 'text/csv;charset=utf-8'
83
83
  });
84
84
  navigator.msSaveBlob(blob, filename);
@@ -86,7 +86,10 @@ export function download(content, filename) {
86
86
  var link = document.createElement('a');
87
87
 
88
88
  if ('download' in link) {
89
- var _blob = new Blob([content], {
89
+ /**
90
+ * should add \uFEFF, otherwise it will be error codes in MSExcel
91
+ */
92
+ var _blob = new Blob(["\uFEFF" + content], {
90
93
  type: 'text/csv;charset=utf-8'
91
94
  });
92
95
 
@@ -18,7 +18,7 @@ import { useExpandable } from './useExpandable';
18
18
  import { useSelected } from './useSelected';
19
19
  import { useTree } from './useTree';
20
20
  import { Tooltip } from '../tooltip/tooltip';
21
- import { useRestRowStatus } from './useRestRowStatus';
21
+ import { useResetRowStatus } from './useResetRowStatus';
22
22
  import { exportTable as _exportTable } from './exportTable';
23
23
  import { useResizable } from './useResizable';
24
24
  import { useDraggable } from './useDraggable';
@@ -117,7 +117,7 @@ export var Table = /*#__PURE__*/function (_Component) {
117
117
  _this.sortable = useSortable();
118
118
  _this.expandable = useExpandable();
119
119
  _this.selected = useSelected();
120
- _this.resetRowStatus = useRestRowStatus(_this.disableRow.getAllKeys);
120
+ _this.resetRowStatus = useResetRowStatus(_this.disableRow.getAllKeys);
121
121
  _this.draggable = useDraggable(_this.pagination.data);
122
122
  _this.stickyScrollbar = useStickyScrollbar(_this.stickyHeader.elementRef, _this.scroll, _this.width.tableRef, _this.fixedColumns.setScrollPosition);
123
123
  _this.config = useConfigContext();
@@ -89,7 +89,7 @@ export function useFixedColumns(getColumns, _ref, widthMap) {
89
89
  function updateScrollPositionOnResize() {
90
90
  var scrollDom = scrollRef.value;
91
91
 
92
- if (scrollDom.scrollWidth - scrollDom.offsetWidth <= 0) {
92
+ if (!hasFixed.value || scrollDom.scrollWidth - scrollDom.offsetWidth <= 0) {
93
93
  scrollPosition.set(null);
94
94
  } else {
95
95
  setScrollPosition(scrollRef.value.scrollLeft);
@@ -1,4 +1,4 @@
1
1
  import type { TableRowKey } from './table';
2
- export declare function useRestRowStatus(getAllKeys: () => TableRowKey[]): {
2
+ export declare function useResetRowStatus(getAllKeys: () => TableRowKey[]): {
3
3
  onRowBeforeUnmount: (key: TableRowKey) => void;
4
4
  };
@@ -2,7 +2,7 @@ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/i
2
2
  import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/slice";
3
3
  import { useInstance, onBeforeUnmount, onUpdated } from 'intact-vue-next';
4
4
  import { addOrRemove } from './useChecked';
5
- export function useRestRowStatus(getAllKeys) {
5
+ export function useResetRowStatus(getAllKeys) {
6
6
  var instance = useInstance();
7
7
  var allUnmountedRows = [];
8
8
  var willUnmounted = false;
@@ -1,4 +1,4 @@
1
- import { Component } from 'intact-vue-next';
1
+ import { Component, TypeDefs } from 'intact-vue-next';
2
2
  export interface TabProps {
3
3
  value?: any;
4
4
  disabled?: boolean;
@@ -10,6 +10,7 @@ export interface TabEvents {
10
10
  }
11
11
  export declare class Tab extends Component<TabProps, TabEvents> {
12
12
  static template: string | import('intact-vue-next').Template<any>;
13
+ static typeDefs: Required<TypeDefs<TabProps>>;
13
14
  private tabs;
14
15
  private config;
15
16
  private onClick;
@@ -49,6 +49,7 @@ export var Tab = /*#__PURE__*/function (_Component) {
49
49
  return Tab;
50
50
  }(Component);
51
51
  Tab.template = template;
52
+ Tab.typeDefs = typeDefs;
52
53
 
53
54
  __decorate([bind], Tab.prototype, "onClick", null);
54
55
 
@@ -0,0 +1,54 @@
1
+ import { TypeDefs } from 'intact-vue-next';
2
+ import { BasePicker } from '../datepicker/basepicker';
3
+ import dayjs from '../datepicker/dayjs';
4
+ import { State } from '../../hooks/useState';
5
+ import { PanelTypes } from '../datepicker/usePanel';
6
+ import { TimepickerProps, TimepickerEvents, TimepickerBlocks } from './constants';
7
+ export declare class PanelPicker<Multipe extends boolean = false, Range extends boolean = false> extends BasePicker<TimepickerProps<Multipe, Range>, TimepickerEvents, TimepickerBlocks> {
8
+ static template: string | import('intact-vue-next').Template<any>;
9
+ static typeDefs: Required<TypeDefs<TimepickerProps<boolean, boolean>>>;
10
+ formats: {
11
+ getValueFormat: () => string;
12
+ getShowFormat: () => string;
13
+ createDateByValueFormat: (value: import("../datepicker/basepicker").Value) => dayjs.Dayjs;
14
+ createDateByShowFormat: (value: import("../datepicker/basepicker").Value) => dayjs.Dayjs;
15
+ getShowString: (value: dayjs.Dayjs) => string;
16
+ getValueString: (value: dayjs.Dayjs) => string;
17
+ };
18
+ disabled: {
19
+ isDisabled: (value: dayjs.Dayjs, type?: dayjs.OpUnitType) => boolean;
20
+ isDisabledConfirm: () => boolean;
21
+ maxDate: State<dayjs.Dayjs | null>;
22
+ minDate: State<dayjs.Dayjs | null>;
23
+ isDisabledTime: (value: dayjs.Dayjs, flag: import("../datepicker/usePanel").PanelFlags) => boolean;
24
+ isDisabledTimeByStep: (value: string, flag: import("../datepicker/usePanel").PanelFlags) => boolean;
25
+ };
26
+ 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
+ startRef: import('intact-vue-next').RefObject<import("../datepicker/calendar").DatepickerCalendar>;
33
+ endRef: import('intact-vue-next').RefObject<import("../datepicker/calendar").DatepickerCalendar>;
34
+ };
35
+ value: {
36
+ 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;
40
+ value: State<import("../datepicker/basepicker").StateValue>;
41
+ setValue: (v: import("../datepicker/basepicker").StateValueItem, fromInput: boolean) => void;
42
+ getDayjsValue: () => import("../datepicker/basepicker").DayjsValue;
43
+ onChangeTime: (date: dayjs.Dayjs, flag: import("../datepicker/usePanel").PanelFlags) => void;
44
+ onChangeTimeByStep: (v: string, flag: import("../datepicker/usePanel").PanelFlags) => void;
45
+ };
46
+ step: {
47
+ options: State<{
48
+ value: string;
49
+ label: string;
50
+ }[] | null>;
51
+ };
52
+ protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import('intact-vue-next').Children[];
53
+ protected getLabel(): string | string[];
54
+ }
@@ -0,0 +1,28 @@
1
+ import { TypeDefs, Children, Key } from 'intact-vue-next';
2
+ import { BaseSelect, BaseSelectProps, BaseSelectEvents, BaseSelectBlocks } from '../select/base';
3
+ import { TreeProps } from '../tree';
4
+ import type { DataItem } from '../tree/useNodes';
5
+ export interface TreeSelectProps<K extends Key = Key, Multipe extends boolean = boolean, Checkbox extends boolean = boolean> extends BaseSelectProps<K, Multipe, Checkbox extends true ? K[] : K | null> {
6
+ data?: TreeProps<K>['data'];
7
+ uncorrelated?: boolean;
8
+ load?: TreeProps<K>['load'];
9
+ showLine?: boolean;
10
+ defaultExpandAll?: boolean;
11
+ checkbox?: Checkbox;
12
+ filter?: (keywords: string, data: DataItem<K>) => boolean;
13
+ }
14
+ export interface TreeSelectEvents extends BaseSelectEvents {
15
+ }
16
+ export interface TreeSelectBlocks<K> extends BaseSelectBlocks<K> {
17
+ }
18
+ export declare class TreeSelect<K extends Key = Key, Checkbox extends boolean = false, Multipe extends boolean = Checkbox extends true ? true : false> extends BaseSelect<TreeSelectProps<K, Multipe, Checkbox>, TreeSelectEvents, TreeSelectBlocks<K>> {
19
+ static template: string | import('intact-vue-next').Template<any>;
20
+ static typeDefs: Required<TypeDefs<TreeSelectProps<Key, boolean, boolean>>>;
21
+ static defaults: () => Partial<TreeSelectProps<Key, boolean, boolean>>;
22
+ private value;
23
+ init(): void;
24
+ expandAll(): void;
25
+ protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | Children[];
26
+ protected getLabel(): Children;
27
+ private filter;
28
+ }
@@ -35,7 +35,7 @@ export var Wave = /*#__PURE__*/function (_Component) {
35
35
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
36
36
  _this.instance = null;
37
37
  _this.className = void 0;
38
- _this.timer = 0;
38
+ _this.timer = null;
39
39
  _this.config = useConfigContext();
40
40
  return _this;
41
41
  }
@@ -95,7 +95,11 @@ export var Wave = /*#__PURE__*/function (_Component) {
95
95
  if (!node) return;
96
96
  node.classList.remove(this.className);
97
97
  node.removeEventListener('animationend', this.resetAnimation);
98
- clearTimeout(this.timer);
98
+
99
+ if (this.timer) {
100
+ clearTimeout(this.timer);
101
+ this.timer = null;
102
+ }
99
103
  };
100
104
 
101
105
  return Wave;
@@ -1,7 +1,7 @@
1
1
  import { onMounted, useInstance, onUnmounted } from 'intact-vue-next';
2
2
  export function useDelayClose(close, duration) {
3
3
  var instance = useInstance();
4
- var timer;
4
+ var timer = null;
5
5
 
6
6
  function delayClose() {
7
7
  if (duration) {
@@ -11,7 +11,7 @@ export function useDelayClose(close, duration) {
11
11
 
12
12
  function onMouseEnter(e) {
13
13
  instance.trigger('mouseenter', e);
14
- clearTimeout(timer);
14
+ clear();
15
15
  }
16
16
 
17
17
  function onMouseLeave(e) {
@@ -20,14 +20,19 @@ export function useDelayClose(close, duration) {
20
20
  // so we must detect the $unmounted status here
21
21
 
22
22
  if (instance.$unmounted) return;
23
- clearTimeout(timer);
23
+ clear();
24
24
  delayClose();
25
25
  }
26
26
 
27
+ function clear() {
28
+ if (timer) {
29
+ clearTimeout(timer);
30
+ timer = null;
31
+ }
32
+ }
33
+
27
34
  onMounted(delayClose);
28
- onUnmounted(function () {
29
- clearTimeout(timer);
30
- });
35
+ onUnmounted(clear);
31
36
  return {
32
37
  onMouseEnter: onMouseEnter,
33
38
  onMouseLeave: onMouseLeave