@king-design/intact 3.0.0-beta.1 → 3.0.0-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.
Files changed (173) hide show
  1. package/components/button/demos/basic.md +1 -1
  2. package/components/button/demos/disabled.md +2 -1
  3. package/components/button/demos/group.md +2 -2
  4. package/components/button/demos/icon.md +7 -7
  5. package/components/button/demos/loading.md +4 -4
  6. package/components/button/demos/size.md +4 -4
  7. package/components/button/styles.ts +19 -13
  8. package/components/carousel/index.vdt +2 -2
  9. package/components/cascader/index.vdt +1 -1
  10. package/components/checkbox/demos/basic.md +1 -1
  11. package/components/checkbox/demos/group.md +1 -1
  12. package/components/checkbox/demos/indeterminate.md +1 -1
  13. package/components/checkbox/demos/value.md +1 -1
  14. package/components/collapse/item.vdt +1 -1
  15. package/components/copy/index.vdt +1 -1
  16. package/components/datepicker/calendar.vdt +6 -6
  17. package/components/datepicker/demos/datetime.md +5 -4
  18. package/components/datepicker/index.spec.ts +11 -1
  19. package/components/datepicker/styles.ts +6 -1
  20. package/components/datepicker/useValue.ts +35 -10
  21. package/components/dialog/styles.ts +1 -1
  22. package/components/dropdown/demos/basic.md +1 -1
  23. package/components/dropdown/demos/checkbox.md +1 -1
  24. package/components/dropdown/demos/disabled.md +2 -2
  25. package/components/dropdown/demos/nested.md +6 -6
  26. package/components/dropdown/demos/position.md +3 -3
  27. package/components/dropdown/demos/trigger.md +2 -2
  28. package/components/form/demos/basic.md +2 -2
  29. package/components/form/demos/custom.md +2 -4
  30. package/components/form/styles.ts +2 -2
  31. package/components/icon/demos/icons.md +130 -97
  32. package/components/icon/styles.ts +6 -2
  33. package/components/input/demos/blocks.md +7 -2
  34. package/components/input/demos/clearable.md +2 -2
  35. package/components/input/demos/showCount.md +18 -0
  36. package/components/input/demos/size.md +6 -4
  37. package/components/input/index.md +1 -0
  38. package/components/input/index.ts +5 -0
  39. package/components/input/index.vdt +22 -14
  40. package/components/input/search.vdt +2 -5
  41. package/components/input/styles.ts +81 -77
  42. package/components/input/useFocus.ts +17 -0
  43. package/components/menu/item.vdt +1 -1
  44. package/components/pagination/index.vdt +2 -2
  45. package/components/progress/index.vdt +1 -1
  46. package/components/radio/demos/basic.md +1 -1
  47. package/components/radio/demos/group.md +1 -1
  48. package/components/radio/demos/value.md +1 -1
  49. package/components/select/base.vdt +19 -17
  50. package/components/select/demos/customMenu.md +2 -2
  51. package/components/select/index.spec.ts +4 -1
  52. package/components/select/menu.vdt +2 -2
  53. package/components/select/option.vdt +1 -0
  54. package/components/select/styles.ts +5 -1
  55. package/components/spinner/index.vdt +4 -4
  56. package/components/spinner/styles.ts +9 -6
  57. package/components/steps/step.vdt +2 -2
  58. package/components/steps/styles.ts +5 -1
  59. package/components/table/cell.vdt +1 -1
  60. package/components/table/column.vdt +27 -16
  61. package/components/table/demos/group.md +4 -3
  62. package/components/table/demos/title.md +3 -5
  63. package/components/table/index.spec.ts +18 -1
  64. package/components/table/styles.ts +21 -28
  65. package/components/table/useGroup.ts +41 -23
  66. package/components/tabs/index.vdt +3 -2
  67. package/components/tag/index.md +31 -0
  68. package/components/tag/styles.ts +6 -6
  69. package/components/tag/tags.vdt +1 -0
  70. package/components/tag/useNowrap.ts +1 -1
  71. package/components/transfer/index.vdt +4 -3
  72. package/components/types.ts +1 -0
  73. package/components/upload/index.vdt +4 -4
  74. package/es/components/button/styles.d.ts +1 -1
  75. package/es/components/button/styles.js +3 -5
  76. package/es/components/carousel/index.vdt.js +2 -2
  77. package/es/components/cascader/index.vdt.js +1 -1
  78. package/es/components/collapse/item.vdt.js +1 -1
  79. package/es/components/copy/index.vdt.js +1 -1
  80. package/es/components/datepicker/calendar.vdt.js +6 -6
  81. package/es/components/datepicker/index.spec.js +170 -152
  82. package/es/components/datepicker/styles.js +1 -1
  83. package/es/components/datepicker/useValue.d.ts +3 -3
  84. package/es/components/datepicker/useValue.js +38 -9
  85. package/es/components/dialog/styles.js +1 -1
  86. package/es/components/form/styles.js +1 -1
  87. package/es/components/icon/styles.js +1 -1
  88. package/es/components/input/index.d.ts +3 -1
  89. package/es/components/input/index.js +4 -1
  90. package/es/components/input/index.vdt.js +21 -10
  91. package/es/components/input/search.vdt.js +2 -4
  92. package/es/components/input/styles.js +13 -6
  93. package/es/components/input/useFocus.d.ts +4 -0
  94. package/es/components/input/useFocus.js +21 -0
  95. package/es/components/menu/item.vdt.js +4 -1
  96. package/es/components/pagination/index.vdt.js +2 -2
  97. package/es/components/progress/index.vdt.js +1 -1
  98. package/es/components/select/base.vdt.js +36 -19
  99. package/es/components/select/index.spec.js +23 -11
  100. package/es/components/select/menu.vdt.js +5 -5
  101. package/es/components/select/option.vdt.js +2 -1
  102. package/es/components/select/styles.js +1 -1
  103. package/es/components/spinner/index.vdt.js +4 -4
  104. package/es/components/spinner/styles.js +2 -2
  105. package/es/components/steps/step.vdt.js +2 -2
  106. package/es/components/steps/styles.js +6 -2
  107. package/es/components/table/cell.vdt.js +1 -1
  108. package/es/components/table/column.vdt.js +40 -24
  109. package/es/components/table/index.spec.js +37 -6
  110. package/es/components/table/styles.js +15 -8
  111. package/es/components/table/useGroup.d.ts +9 -3
  112. package/es/components/table/useGroup.js +45 -37
  113. package/es/components/tabs/index.vdt.js +7 -2
  114. package/es/components/tag/styles.js +1 -1
  115. package/es/components/tag/tags.vdt.js +14 -2
  116. package/es/components/tag/useNowrap.js +1 -1
  117. package/es/components/transfer/index.vdt.js +14 -3
  118. package/es/components/types.d.ts +1 -0
  119. package/es/components/upload/index.vdt.js +4 -4
  120. package/es/index.d.ts +2 -2
  121. package/es/index.js +2 -2
  122. package/es/site/data/components/button/demos/disabled/react.js +5 -2
  123. package/es/site/data/components/button/demos/group/react.js +2 -2
  124. package/es/site/data/components/button/demos/icon/react.js +7 -7
  125. package/es/site/data/components/button/demos/loading/react.js +4 -4
  126. package/es/site/data/components/button/demos/size/react.js +4 -4
  127. package/es/site/data/components/datepicker/demos/datetime/index.d.ts +1 -0
  128. package/es/site/data/components/datepicker/demos/datetime/index.js +1 -0
  129. package/es/site/data/components/dropdown/demos/basic/react.js +1 -1
  130. package/es/site/data/components/dropdown/demos/checkbox/react.js +1 -1
  131. package/es/site/data/components/dropdown/demos/disabled/react.js +2 -2
  132. package/es/site/data/components/dropdown/demos/nested/react.js +9 -9
  133. package/es/site/data/components/dropdown/demos/position/react.js +3 -3
  134. package/es/site/data/components/dropdown/demos/trigger/react.js +2 -2
  135. package/es/site/data/components/form/demos/basic/react.js +1 -1
  136. package/es/site/data/components/icon/demos/icons/index.d.ts +8 -4
  137. package/es/site/data/components/icon/demos/icons/index.js +35 -1
  138. package/es/site/data/components/icon/demos/icons/react.d.ts +9 -4
  139. package/es/site/data/components/icon/demos/icons/react.js +51 -9
  140. package/es/site/data/components/input/demos/blocks/react.js +7 -7
  141. package/es/site/data/components/input/demos/clearable/react.js +2 -2
  142. package/es/site/data/components/input/demos/showCount/index.d.ts +5 -0
  143. package/es/site/data/components/input/demos/showCount/index.js +17 -0
  144. package/es/site/data/components/input/demos/showCount/react.d.ts +4 -0
  145. package/es/site/data/components/input/demos/showCount/react.js +33 -0
  146. package/es/site/data/components/input/demos/size/react.js +8 -8
  147. package/es/site/data/components/select/demos/customMenu/react.js +5 -5
  148. package/es/site/data/components/table/demos/title/react.js +4 -4
  149. package/es/site/src/pages/styles.js +1 -1
  150. package/es/site/src/router/index.js +1 -1
  151. package/es/styles/fonts/iconfont.eot +0 -0
  152. package/es/styles/fonts/iconfont.js +1 -1
  153. package/es/styles/fonts/iconfont.svg +35 -35
  154. package/es/styles/fonts/iconfont.ttf +0 -0
  155. package/es/styles/fonts/iconfont.woff +0 -0
  156. package/es/styles/global.js +1 -1
  157. package/index.ts +2 -2
  158. package/package.json +2 -2
  159. package/styles/fonts/demo.css +277 -108
  160. package/styles/fonts/demo_index.html +2169 -0
  161. package/styles/fonts/iconfont.css +52 -50
  162. package/styles/fonts/iconfont.eot +0 -0
  163. package/styles/fonts/iconfont.js +1 -0
  164. package/styles/fonts/iconfont.json +611 -0
  165. package/styles/fonts/iconfont.svg +35 -35
  166. package/styles/fonts/iconfont.ts +123 -124
  167. package/styles/fonts/iconfont.ttf +0 -0
  168. package/styles/fonts/iconfont.woff +0 -0
  169. package/styles/fonts/iconfont.woff2 +0 -0
  170. package/styles/global.ts +4 -4
  171. package/components/select/useNowrap.ts +0 -24
  172. package/es/components/select/useNowrap.d.ts +0 -3
  173. package/es/components/select/useNowrap.js +0 -19
@@ -3,7 +3,7 @@ title: 按钮类型
3
3
  order: 0
4
4
  ---
5
5
 
6
- 有如下几种类型:默认按钮,主按钮,次按钮,警告按钮,危险按钮,成功按钮,文字按钮,超链接按钮
6
+ 有如下几种类型:默认按钮,主按钮,次按钮,警告按钮,危险按钮,成功按钮,文字按钮,超链接按钮,扁平按钮
7
7
 
8
8
  ```vdt
9
9
  import {Button} from 'kpc';
@@ -11,7 +11,8 @@ import {Button} from 'kpc';
11
11
  <div>
12
12
  <Button disabled>disabled</Button>
13
13
  <Button disabled type="none">disabled text</Button>
14
- <Button disabled icon circle><i class="k-icon ion-ios-search"></i></Button>
14
+ <Button disabled icon circle><i class="k-icon k-icon-search"></i></Button>
15
15
  <Button disabled type="link">link</Button>
16
+ <Button disabled type="flat">flat</Button>
16
17
  </div>
17
18
  ```
@@ -27,10 +27,10 @@ import {Button, ButtonGroup} from 'kpc';
27
27
  </ButtonGroup>
28
28
  <ButtonGroup>
29
29
  <Button type="primary">
30
- <i class="k-icon ion-ios-arrow-left"></i>上一页
30
+ <i class="k-icon k-icon-left"></i>上一页
31
31
  </Button>
32
32
  <Button type="primary">
33
- 下一页<i class="k-icon ion-ios-arrow-right"></i>
33
+ 下一页<i class="k-icon k-icon-right"></i>
34
34
  </Button>
35
35
  </ButtonGroup>
36
36
  <br /><br />
@@ -11,13 +11,13 @@ order: 1
11
11
  import {Button, Icon} from 'kpc';
12
12
 
13
13
  <div>
14
- <Button icon><Icon class="ion-ios-search" /></Button>
15
- <Button icon circle><Icon class="ion-ios-search" /></Button>
16
- <Button icon circle type="none"><Icon class="ion-ios-search" /></Button>
17
- <Button icon circle type="flat"><Icon class="ion-ios-search" /></Button>
18
- <Button type="danger" size="large" icon circle><Icon class="ion-ios-search" size="large" /></Button>
19
- <Button type="primary"><Icon class="ion-ios-search" size="small" />搜索</Button>
20
- <Button circle type='primary'><Icon class="ion-ios-search" size="small" />搜索</Button>
14
+ <Button icon><Icon class="k-icon-search" /></Button>
15
+ <Button icon circle><Icon class="k-icon-search" /></Button>
16
+ <Button icon circle type="none"><Icon class="k-icon-search" /></Button>
17
+ <Button icon circle type="flat"><Icon class="k-icon-search" /></Button>
18
+ <Button type="danger" size="large" icon circle><Icon class="k-icon-search" size="large" /></Button>
19
+ <Button type="primary"><Icon class="k-icon-search" size="small" />搜索</Button>
20
+ <Button circle type='primary'><Icon class="k-icon-search" size="small" />搜索</Button>
21
21
  </div>
22
22
  ```
23
23
 
@@ -13,7 +13,7 @@ import {Button, Icon} from 'kpc';
13
13
 
14
14
  <div>
15
15
  <Button type="primary" loading>确认</Button>
16
- <Button icon circle loading><i class="k-icon ion-ios-search"></i></Button>
16
+ <Button icon circle loading><i class="k-icon k-icon-search"></i></Button>
17
17
  <br /> <br />
18
18
  <Button type="primary"
19
19
  loading={this.get('loading1')}
@@ -22,15 +22,15 @@ import {Button, Icon} from 'kpc';
22
22
  <Button type="primary"
23
23
  loading={this.get('loading2')}
24
24
  ev-click={this.onClick.bind(this, 'loading2')}
25
- ><Icon class="ion-ios-search" />点击加载</Button>
25
+ ><Icon class="k-icon-search" />点击加载</Button>
26
26
  <Button icon circle
27
27
  loading={this.get('loading3')}
28
28
  ev-click={this.onClick.bind(this, 'loading3')}
29
- ><Icon class="ion-ios-search" /></Button>
29
+ ><Icon class="k-icon-search" /></Button>
30
30
  <Button type="primary"
31
31
  loading={this.get('loading4')}
32
32
  ev-click={this.onClick.bind(this, 'loading4')}
33
- >图标在右侧<Icon class="ion-ios-search" /></Button>
33
+ >图标在右侧<Icon class="k-icon-search" /></Button>
34
34
  </div>
35
35
  ```
36
36
 
@@ -14,10 +14,10 @@ import {Button, Icon} from 'kpc';
14
14
  <Button size="small">small</Button>
15
15
  <Button size="mini">mini</Button>
16
16
  <br /><br />
17
- <Button icon circle size="large"><Icon class="ion-ios-search" size="large" /></Button>
18
- <Button icon circle><Icon class="ion-ios-search" /></Button>
19
- <Button icon circle size="small"><Icon class="ion-ios-search" size="small" /></Button>
20
- <Button icon circle size="mini"><Icon class="ion-ios-search" size="mini" /></Button>
17
+ <Button icon circle size="large"><Icon class="k-icon-search" size="large" /></Button>
18
+ <Button icon circle><Icon class="k-icon-search" /></Button>
19
+ <Button icon circle size="small"><Icon class="k-icon-search" size="small" /></Button>
20
+ <Button icon circle size="mini"><Icon class="k-icon-search" size="mini" /></Button>
21
21
  </div>
22
22
  ```
23
23
 
@@ -29,7 +29,7 @@ export const types = ['primary', 'warning', 'danger', 'active', 'success'] as co
29
29
  const sizes = ['large', 'small', 'mini'] as const;
30
30
 
31
31
  const btnStyles = {
32
- get color() { return theme.color.lightBlack },
32
+ get color() { return theme.color.text },
33
33
  bgColor: '#fff',
34
34
  lineHeight: '1.15',
35
35
  get padding() { return `0 ${theme.default.padding}` },
@@ -114,7 +114,8 @@ const defaults = deepDefaults(
114
114
  link: {
115
115
  get color() { return theme.color.link },
116
116
  get hoverColor() { return theme.color.linkHover },
117
- get hoverBgColor() { return theme.color.hoverBg },
117
+ hoverBgColor: 'transparent',
118
+ // get hoverBgColor() { return theme.color.hoverBg },
118
119
  },
119
120
 
120
121
  none: {
@@ -234,16 +235,6 @@ export function makeButtonStyles({iconSide}: {iconSide?: string}) {
234
235
  }
235
236
  }
236
237
 
237
- // disabled
238
- &.k-disabled {
239
- &, &:hover {
240
- color: ${button.disabled.color};
241
- background: ${button.disabled.bgColor};
242
- border-color: ${button.disabled.borderColor};
243
- cursor: not-allowed
244
- }
245
- }
246
-
247
238
  &.k-none,
248
239
  &.k-link,
249
240
  &.k-flat {
@@ -258,11 +249,26 @@ export function makeButtonStyles({iconSide}: {iconSide?: string}) {
258
249
  &.k-none:hover {
259
250
  background: ${button.none.hoverBgColor};
260
251
  }
261
-
262
252
  &.k-flat {
263
253
  background: ${button.none.hoverBgColor};
264
254
  }
265
255
 
256
+ // disabled
257
+ &.k-disabled {
258
+ &, &:hover {
259
+ color: ${button.disabled.color};
260
+ background: ${button.disabled.bgColor};
261
+ border-color: ${button.disabled.borderColor};
262
+ cursor: not-allowed
263
+ }
264
+ }
265
+ &.k-none.k-disabled,
266
+ &.k-link.k-disabled {
267
+ &, &:hover {
268
+ background: transparent;
269
+ }
270
+ }
271
+
266
272
  ${sizes.map(size => {
267
273
  const styles = button[size];
268
274
 
@@ -36,12 +36,12 @@ const {stop, play} = this.autoplay;
36
36
  <Button icon circle type="none" size="large" class="k-carousel-btn k-prev"
37
37
  ev-click={this.prev}
38
38
  >
39
- <Icon class="ion-ios-arrow-left" />
39
+ <Icon class="k-icon-left" />
40
40
  </Button>
41
41
  <Button icon circle type="none" size="large" class="k-carousel-btn k-next"
42
42
  ev-click={this.next}
43
43
  >
44
- <Icon class="ion-ios-arrow-right" />
44
+ <Icon class="k-icon-right" />
45
45
  </Button>
46
46
  <div class="k-carousel-indicator c-clearfix">
47
47
  <div v-for={getItems()}
@@ -40,7 +40,7 @@ const Options = (data, level, loaded, parentSelected) => {
40
40
  >
41
41
  {getField(item, 'label')}
42
42
  <Icon v-if={children}
43
- class="k-cascader-arrow ion-ios-arrow-right"
43
+ class="k-cascader-arrow k-icon-right"
44
44
  />
45
45
  </DropdownItem>
46
46
  );
@@ -20,7 +20,7 @@ import {Checkbox} from 'kpc';
20
20
 
21
21
  ```styl
22
22
  .k-checkbox
23
- margin-right 20px
23
+ margin-right 24px
24
24
  ```
25
25
 
26
26
  ```ts
@@ -20,7 +20,7 @@ import {Checkbox} from 'kpc';
20
20
 
21
21
  ```styl
22
22
  .k-checkbox
23
- margin-right 20px
23
+ margin-right 24px
24
24
  ```
25
25
 
26
26
  ```ts
@@ -25,7 +25,7 @@ import {Checkbox} from 'kpc';
25
25
 
26
26
  ```styl
27
27
  .k-checkbox
28
- margin-right 20px
28
+ margin-right 24px
29
29
  ```
30
30
 
31
31
  ```ts
@@ -26,7 +26,7 @@ import {Checkbox} from 'kpc';
26
26
 
27
27
  ```styl
28
28
  .k-checkbox
29
- margin-right 20px
29
+ margin-right 24px
30
30
  ```
31
31
 
32
32
  ```ts
@@ -21,7 +21,7 @@ const classNameObj = {
21
21
  <div class={classNameObj} {...getRestProps(this)}>
22
22
  <div class={kls('title')} ev-click={this.toggle}>
23
23
  <b:title>{title}</b:title>
24
- <Icon class={{[kls('arrow')]: true, 'ion-ios-arrow-right': true}} hoverable={!disabled}></Icon>
24
+ <Icon class={{[kls('arrow')]: true, 'k-icon-right': true}} hoverable={!disabled}></Icon>
25
25
  </div>
26
26
  <Transition
27
27
  show={isActive}
@@ -18,6 +18,6 @@ const classNameObj = {
18
18
  <Virtual ev-click={startCopy} class={classNameObj} {...getRestProps(this)}>
19
19
  <template v-if={children}>{children}</template>
20
20
  <Icon key="1" v-else-if={!success.value} class="k-icon-clone" hoverable title={_$('复制')} />
21
- <Icon key="2" v-else class="k-icon-truth" hoverable color="success" />
21
+ <Icon key="2" v-else class="k-icon-check" hoverable color="success" />
22
22
  </Virtual>
23
23
  </Transition>
@@ -52,15 +52,15 @@ const {
52
52
  tagName="div"
53
53
  ev-click={isYear ? prevTenYears : prevYear}
54
54
  >
55
- <Icon class="ion-ios-arrow-left" size="small" />
56
- <Icon class="ion-ios-arrow-left" size="small" />
55
+ <Icon class="k-icon-left" size="small" />
56
+ <Icon class="k-icon-left" size="small" />
57
57
  </Button>
58
58
  <Button icon type="none" size="small" class="k-prev"
59
59
  tagName="div"
60
60
  ev-click={prevMonth}
61
61
  v-if={!isYearOrMonth}
62
62
  >
63
- <Icon class="ion-ios-arrow-left" size="small" />
63
+ <Icon class="k-icon-left" size="small" />
64
64
  </Button>
65
65
  </div>
66
66
  <div class="k-month-values">
@@ -80,14 +80,14 @@ const {
80
80
  ev-click={nextMonth}
81
81
  v-if={!isYearOrMonth}
82
82
  >
83
- <Icon class="ion-ios-arrow-right" size="small" />
83
+ <Icon class="k-icon-right" size="small" />
84
84
  </Button>
85
85
  <Button icon type="none" size="small" class="k-next"
86
86
  tagName="div"
87
87
  ev-click={isYear ? nextTenYears : nextYear}
88
88
  >
89
- <Icon class="ion-ios-arrow-right" size="small" />
90
- <Icon class="ion-ios-arrow-right" size="small" />
89
+ <Icon class="k-icon-right" size="small" />
90
+ <Icon class="k-icon-right" size="small" />
91
91
  </Button>
92
92
  </div>
93
93
  </div>
@@ -18,6 +18,11 @@ import {Datepicker} from 'kpc';
18
18
  </div>
19
19
  ```
20
20
 
21
+ ```styl
22
+ .k-datepicker
23
+ margin-right 20px
24
+ ```
25
+
21
26
  ```ts
22
27
  interface Props {
23
28
  datetime1?: string | null
@@ -35,7 +40,3 @@ export default class extends Component<Props> {
35
40
  }
36
41
  ```
37
42
 
38
- ```styl
39
- .k-datepicker
40
- margin-right 20px
41
- ```
@@ -448,6 +448,16 @@ describe('Datepicker', () => {
448
448
  content.querySelector<HTMLElement>('.k-btn')!.click();
449
449
  await wait();
450
450
  expect(instance.get('datetimeRange')).have.lengthOf(1);
451
+
452
+ // select the first value in end panel
453
+ calendar2.querySelectorAll<HTMLElement>('.k-calendar-item')[17].click();
454
+ calendar2.querySelectorAll<HTMLElement>('.k-calendar-item')[17].click();
455
+ await wait();
456
+ content.querySelector<HTMLElement>('.k-btn')!.click();
457
+ await wait();
458
+ const values = instance.get('datetimeRange')!;
459
+ expect(values).have.lengthOf(2);
460
+ expect(values[1][1].includes('23:59:59')).to.be.true;
451
461
  });
452
462
  });
453
463
 
@@ -531,7 +541,7 @@ describe('Datepicker', () => {
531
541
  await wait();
532
542
  const value2 = instance.get('time')!;
533
543
  expect(value2).have.lengthOf(2);
534
- expect(value2.map(item => item.split(' ')[1])).eql(['01:00:00', '23:00:00']);
544
+ expect(value2.map(item => item.split(' ')[1])).eql(['01:00:00', '22:59:59']);
535
545
  });
536
546
 
537
547
  it('year', async () => {
@@ -117,6 +117,10 @@ export function makeCalendarStyles() {
117
117
  display: flex;
118
118
  padding: ${datepicker.month.padding};
119
119
  }
120
+ .k-prev .k-icon,
121
+ .k-next .k-icon {
122
+ margin: 0 -5px !important;
123
+ }
120
124
  .k-month-values {
121
125
  flex: 1;
122
126
  font-size: 14px;
@@ -149,10 +153,11 @@ export function makeCalendarStyles() {
149
153
  align-items: center;
150
154
  cursor: pointer;
151
155
  position: relative;
156
+ border-radius: ${datepicker.item.borderRadius};
152
157
  .k-value {
153
158
  border-radius: ${datepicker.item.borderRadius};
154
159
  }
155
- &.k-hover .k-value {
160
+ &.k-hover {
156
161
  background: ${datepicker.item.hoverBgColor};
157
162
  }
158
163
  &.k-exceed {
@@ -7,11 +7,12 @@ import {
7
7
  DayjsValueRange,
8
8
  DayjsValue,
9
9
  } from './basepicker';
10
- import {Dayjs} from 'dayjs';
10
+ import dayjs, {Dayjs} from 'dayjs';
11
11
  import {Datepicker} from './index';
12
12
  import type {useFormats} from './useFormats';
13
13
  import type {useDisabled} from './useDisabled';
14
14
  import {last} from '../utils';
15
+ import { endTime } from './helpers';
15
16
  import {PanelTypes, PanelFlags, usePanel} from './usePanel';
16
17
 
17
18
  export function useValue(
@@ -50,23 +51,25 @@ export function useValue(
50
51
 
51
52
  function onChangeDate(v: Dayjs, flag: PanelFlags) {
52
53
  const {multiple, type, range} = instance.get();
53
- let _value: StateValueItem = v;
54
-
55
- // the datetime must be greater than minDate, #406
56
- const minDate = disabled.minDate.value;
57
- if (minDate && _value.isBefore(minDate)) {
58
- _value = minDate;
59
- }
54
+ let _value: StateValueItem;
60
55
 
61
56
  if (range) {
62
57
  const oldValue = last(value.value as StateValueRange[]);
63
58
  if (!oldValue || oldValue.length === 2) {
64
- _value = [v];
59
+ /**
60
+ * if we select the first value or re-select the value
61
+ * no matter what the flag is, we should set flag to start panel
62
+ * #877
63
+ */
64
+ flag = PanelFlags.Start;
65
+ _value = [fixDatetimeWithMinDate(v)];
65
66
  } else {
66
- _value = [oldValue[0], v];
67
+ _value = [oldValue[0], fixDatetimeWithMaxDate(v)];
67
68
  (_value as DayjsValueRange).sort((a, b) => a.isAfter(b) ? 1 : -1);
68
69
  }
69
70
  instance.trigger('selecting', _value);
71
+ } else {
72
+ _value = fixDatetimeWithMinDate(v);
70
73
  }
71
74
 
72
75
  setValue(_value, false);
@@ -78,5 +81,27 @@ export function useValue(
78
81
  }
79
82
  }
80
83
 
84
+ function fixDatetimeWithMinDate(v: Dayjs) {
85
+ // the datetime must be greater than minDate, #406
86
+ const minDate = disabled.minDate.value;
87
+ if (minDate && v.isBefore(minDate)) {
88
+ return minDate;
89
+ }
90
+ return v;
91
+ }
92
+
93
+ function fixDatetimeWithMaxDate(v: Dayjs) {
94
+ // the tiem of end datetime should be set to 23:59:59, #878
95
+ const maxDate = disabled.maxDate.value;
96
+ const date = v.toDate();
97
+
98
+ endTime(date);
99
+ v = dayjs(date);
100
+ if (maxDate && v.isAfter(maxDate)) {
101
+ return maxDate;
102
+ }
103
+ return v;
104
+ }
105
+
81
106
  return {value, setValue, onChangeDate, ...rest};
82
107
  }
@@ -23,7 +23,7 @@ const defaults = {
23
23
  border: `1px solid #e2e5e8`,
24
24
  closeTop: '9px',
25
25
  closeRight: '-9px',
26
- closeIconFontSize: '16px',
26
+ closeIconFontSize: '22px',
27
27
  },
28
28
 
29
29
  // body
@@ -16,7 +16,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
16
16
  <div>
17
17
  <Dropdown>
18
18
  <Button type="primary">
19
- hover <Icon class="ion-ios-arrow-down" />
19
+ hover <Icon class="k-icon-down" />
20
20
  </Button>
21
21
  <DropdownMenu>
22
22
  <DropdownItem>item 1</DropdownItem>
@@ -10,7 +10,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Checkbox, Button, Icon} from 'kpc'
10
10
 
11
11
  <div>
12
12
  <Dropdown>
13
- <Button>More<Icon class="ion-ios-arrow-right" /></Button>
13
+ <Button>More<Icon class="k-icon-right" /></Button>
14
14
  <DropdownMenu class="checkbox-menu">
15
15
  <DropdownItem hideOnSelect={false}>
16
16
  <Checkbox v-model="checked"
@@ -13,7 +13,7 @@ import {Icon} from 'kpc';
13
13
  <div>
14
14
  <Dropdown disabled>
15
15
  <Button type="primary">
16
- disabled <Icon class="ion-ios-arrow-down" />
16
+ disabled <Icon class="k-icon-down" />
17
17
  </Button>
18
18
  <DropdownMenu>
19
19
  <DropdownItem>item 1</DropdownItem>
@@ -24,7 +24,7 @@ import {Icon} from 'kpc';
24
24
 
25
25
  <Dropdown>
26
26
  <Button type="primary">
27
- disabled item <Icon class="ion-ios-arrow-down" />
27
+ disabled item <Icon class="k-icon-down" />
28
28
  </Button>
29
29
  <DropdownMenu>
30
30
  <DropdownItem>item 1</DropdownItem>
@@ -12,7 +12,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
12
12
  <div>
13
13
  <Dropdown trigger="click">
14
14
  <Button type="primary">
15
- click <Icon class="ion-ios-arrow-down" />
15
+ click <Icon class="k-icon-down" />
16
16
  </Button>
17
17
  <DropdownMenu class="dropdown-demo">
18
18
  <DropdownItem>item 1</DropdownItem>
@@ -21,13 +21,13 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
21
21
  <Dropdown position={{my: 'left top', at: 'right top'}} class="dropdown-demo">
22
22
  <DropdownItem>
23
23
  <span>hover</span>
24
- <i class="ion-ios-arrow-right"></i>
24
+ <Icon class="k-icon-right" />
25
25
  </DropdownItem>
26
26
  <DropdownMenu class="dropdown-demo">
27
27
  <Dropdown position={{my: 'left top', at: 'right top'}}>
28
28
  <DropdownItem>
29
29
  <span>hover</span>
30
- <i class="ion-ios-arrow-right"></i>
30
+ <Icon class="k-icon-right" />
31
31
  </DropdownItem>
32
32
  <DropdownMenu class="dropdown-demo">
33
33
  <DropdownItem>item 1</DropdownItem>
@@ -40,13 +40,13 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
40
40
  <Dropdown trigger="click" position={{my: 'left top', at: 'right top'}}>
41
41
  <DropdownItem>
42
42
  <span>click</span>
43
- <i class="ion-ios-arrow-right"></i>
43
+ <Icon class="k-icon-right" />
44
44
  </DropdownItem>
45
45
  <DropdownMenu class="dropdown-demo">
46
46
  <Dropdown trigger="click" position={{my: 'left top', at: 'right top'}}>
47
47
  <DropdownItem>
48
48
  <span>click</span>
49
- <i class="ion-ios-arrow-right"></i>
49
+ <Icon class="k-icon-right" />
50
50
  </DropdownItem>
51
51
  <DropdownMenu class="dropdown-demo">
52
52
  <DropdownItem>item 1</DropdownItem>
@@ -64,7 +64,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
64
64
 
65
65
  ```styl
66
66
  /.dropdown-demo.k-dropdown-menu
67
- .ion-ios-arrow-right
67
+ .k-icon
68
68
  float right
69
69
  height 32px
70
70
  &:before
@@ -12,7 +12,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
12
12
  <div>
13
13
  <Dropdown position={{my: 'left top', at: 'left bottom+5'}}>
14
14
  <Button type="primary">
15
- left <Icon class="ion-ios-arrow-down" />
15
+ left <Icon class="k-icon-down" />
16
16
  </Button>
17
17
  <DropdownMenu>
18
18
  <DropdownItem>item 1</DropdownItem>
@@ -23,7 +23,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
23
23
 
24
24
  <Dropdown position={{my: 'right top', at: 'right bottom+5'}}>
25
25
  <Button type="primary">
26
- right <Icon class="ion-ios-arrow-down" />
26
+ right <Icon class="k-icon-down" />
27
27
  </Button>
28
28
  <DropdownMenu>
29
29
  <DropdownItem>item 1</DropdownItem>
@@ -34,7 +34,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
34
34
 
35
35
  <Dropdown position="top">
36
36
  <Button type="primary">
37
- top center <Icon class="ion-ios-arrow-down" />
37
+ top center <Icon class="k-icon-down" />
38
38
  </Button>
39
39
  <DropdownMenu>
40
40
  <DropdownItem>item 1</DropdownItem>
@@ -14,7 +14,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon, Input} from 'kpc';
14
14
  <div>
15
15
  <Dropdown>
16
16
  <Button type="primary">
17
- hover <Icon class="ion-ios-arrow-down" />
17
+ hover <Icon class="k-icon-down" />
18
18
  </Button>
19
19
  <DropdownMenu>
20
20
  <DropdownItem>item 1</DropdownItem>
@@ -25,7 +25,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon, Input} from 'kpc';
25
25
 
26
26
  <Dropdown trigger="click">
27
27
  <Button type="primary">
28
- click <Icon class="ion-ios-arrow-down" />
28
+ click <Icon class="k-icon-down" />
29
29
  </Button>
30
30
  <DropdownMenu>
31
31
  <DropdownItem>item 1</DropdownItem>
@@ -110,7 +110,7 @@ import {
110
110
  </FormItem>
111
111
  <FormItem>
112
112
  <Button type="primary" htmlType="submit" ev-click={this.handleSubmit}>提交</Button>
113
- <Button style="margin-left: 20px" ev-click={this.reset}>重置</Button>
113
+ <Button style="margin-left: 8px" ev-click={this.reset}>重置</Button>
114
114
  </FormItem>
115
115
  </Form>
116
116
  ```
@@ -121,7 +121,7 @@ import {
121
121
  width 300px
122
122
  .k-radio
123
123
  .k-checkbox
124
- margin-right 10px
124
+ margin-right 24px
125
125
 
126
126
  @media (max-width: 768px)
127
127
  .k-form-item
@@ -36,16 +36,14 @@ import {Form, FormItem, Input, Button} from 'kpc';
36
36
  <Button ev-click={this.remove.bind(self, $key)}>删除</Button>
37
37
  </b:append>
38
38
  </FormItem>
39
+ </FormItem>
40
+ <FormItem>
39
41
  <Button ev-click={this.add}>添加</Button>
40
42
  </FormItem>
41
43
  </Form>
42
44
  ```
43
45
 
44
46
  ```styl
45
- .k-form-item
46
- .k-form-item
47
- margin-bottom 20px
48
-
49
47
  @media (max-width: 768px)
50
48
  .k-form-item
51
49
  width 100%
@@ -86,7 +86,7 @@ export function makeItemStyles() {
86
86
  &.k-invalid {
87
87
  // input
88
88
  .k-input {
89
- .k-input-inner {
89
+ .k-input-wrapper {
90
90
  border: ${form.item.invalidBorder};
91
91
  position: relative;
92
92
  z-index: 1
@@ -98,7 +98,7 @@ export function makeItemStyles() {
98
98
  .k-radio-wrapper {
99
99
  border: ${form.item.invalidBorder} !important;
100
100
  }
101
- .k-select .k-input .k-input-inner {
101
+ .k-select .k-input .k-input-wrapper {
102
102
  border: none;
103
103
  }
104
104
  }