kui-vue 3.4.8 → 3.5.0

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 (366) hide show
  1. package/LICENSE +1 -1
  2. package/components/affix/affix.jsx +42 -42
  3. package/components/alert/alert.jsx +12 -7
  4. package/components/avatar/AvatarGroup.jsx +8 -5
  5. package/components/avatar/avatar.jsx +10 -7
  6. package/components/avatar/demo/base.md +1 -0
  7. package/components/avatar/demo/info.md +2 -5
  8. package/components/backtop/backtop.jsx +39 -32
  9. package/components/badge/badge.jsx +7 -7
  10. package/components/badge/demo/color.md +0 -1
  11. package/components/badge/styles/index.less +0 -4
  12. package/components/base/{collapse.js → collapse.jsx} +2 -7
  13. package/components/base/drop.jsx +181 -195
  14. package/components/base/input.jsx +27 -46
  15. package/components/base/pop.jsx +21 -17
  16. package/components/base/transition.js +1 -4
  17. package/components/breadcrumb/breadcrumb.jsx +6 -3
  18. package/components/breadcrumb/breadcrumbItem.jsx +4 -2
  19. package/components/breadcrumb/styles/index.less +1 -1
  20. package/components/button/button.jsx +95 -56
  21. package/components/button/buttonGroup.jsx +5 -3
  22. package/components/button/demo/base.md +3 -3
  23. package/components/button/demo/block.md +1 -1
  24. package/components/button/demo/color.md +30 -0
  25. package/components/button/demo/disabled.md +2 -2
  26. package/components/button/demo/index.vue +4 -4
  27. package/components/button/demo/light.md +8 -8
  28. package/components/button/demo/loading.md +10 -7
  29. package/components/button/demo/outline.md +22 -0
  30. package/components/button/demo/size.md +3 -4
  31. package/components/button/demo/with-icon.md +5 -5
  32. package/components/button/styles/index.less +269 -44
  33. package/components/card/card.jsx +4 -2
  34. package/components/carousel/carousel.jsx +143 -97
  35. package/components/carousel/carouselItem.jsx +13 -14
  36. package/components/carousel/styles/index.less +1 -1
  37. package/components/checkbox/checkbox.jsx +6 -4
  38. package/components/checkbox/demo/disabled.md +1 -3
  39. package/components/checkbox/group.jsx +6 -3
  40. package/components/collapse/collapse.jsx +14 -12
  41. package/components/collapse/demo/{accrodion.md → accordion.md} +2 -2
  42. package/components/collapse/demo/index.vue +2 -2
  43. package/components/collapse/panel.jsx +15 -16
  44. package/components/collapse/styles/index.less +3 -3
  45. package/components/colorPicker/alpha.jsx +107 -0
  46. package/components/colorPicker/colorpicker.jsx +177 -384
  47. package/components/colorPicker/demo/base.md +1 -3
  48. package/components/colorPicker/demo/customTriggle.md +34 -0
  49. package/components/colorPicker/demo/disabled.md +22 -0
  50. package/components/colorPicker/demo/disabledAlpha.md +20 -0
  51. package/components/colorPicker/demo/index.vue +11 -5
  52. package/components/colorPicker/demo/mode.md +16 -18
  53. package/components/colorPicker/demo/placement.md +25 -0
  54. package/components/colorPicker/demo/{colors.md → presets.md} +2 -2
  55. package/components/colorPicker/demo/size.md +14 -13
  56. package/components/colorPicker/hue.jsx +114 -0
  57. package/components/colorPicker/index.md +11 -11
  58. package/components/colorPicker/mode.jsx +176 -0
  59. package/components/colorPicker/paint.jsx +126 -0
  60. package/components/colorPicker/presets.jsx +69 -0
  61. package/components/colorPicker/styles/index.less +144 -46
  62. package/components/components.js +155 -0
  63. package/components/const/var.js +3 -0
  64. package/components/datePicker/datecalendar.jsx +34 -34
  65. package/components/datePicker/datepicker.jsx +24 -23
  66. package/components/datePicker/styles/calendar.less +3 -3
  67. package/components/descriptions/descriptions.jsx +12 -8
  68. package/components/descriptions/descriptionsItem.jsx +5 -2
  69. package/components/divider/divider.jsx +4 -2
  70. package/components/drawer/drawer.jsx +74 -69
  71. package/components/dropdown/dropdown.jsx +5 -2
  72. package/components/dropdown/styles/index.less +14 -3
  73. package/components/empty/empty.jsx +5 -5
  74. package/components/flex/demo/align.md +1 -1
  75. package/components/flex/demo/size.md +1 -1
  76. package/components/flex/flex.jsx +12 -4
  77. package/components/form/demo/length.md +1 -1
  78. package/components/form/demo/valid.md +1 -1
  79. package/components/form/form.jsx +9 -8
  80. package/components/form/formitem.jsx +14 -11
  81. package/components/grid/col.jsx +5 -2
  82. package/components/grid/row.jsx +11 -8
  83. package/components/icon/demo/base.md +8 -7
  84. package/components/icon/demo/index.vue +3 -1
  85. package/components/icon/demo/info.md +1 -38
  86. package/components/icon/demo/search.vue +16 -15
  87. package/components/icon/demo/use.md +30 -0
  88. package/components/icon/icon.jsx +5 -2
  89. package/components/image/group.jsx +4 -2
  90. package/components/image/image.jsx +16 -13
  91. package/components/image/index.js +6 -9
  92. package/components/image/{instance.js → instance.jsx} +6 -6
  93. package/components/image/preview.jsx +219 -195
  94. package/components/image/styles/index.less +1 -1
  95. package/components/index.js +36 -142
  96. package/components/input/input.jsx +6 -4
  97. package/components/input/inputGroup.jsx +16 -14
  98. package/components/input/textarea.jsx +16 -7
  99. package/components/inputNumber/demo/base.md +16 -8
  100. package/components/inputNumber/demo/format.md +7 -19
  101. package/components/inputNumber/demo/size.md +2 -6
  102. package/components/inputNumber/inputNumber.jsx +112 -104
  103. package/components/inputNumber/styles/index.less +47 -11
  104. package/components/layout/demo/base.md +11 -6
  105. package/components/layout/demo/layout1.md +82 -63
  106. package/components/layout/demo/layout2.md +93 -56
  107. package/components/layout/demo/layout3.md +95 -53
  108. package/components/layout/demo/layout4.md +97 -45
  109. package/components/layout/demo/layout5.md +81 -80
  110. package/components/layout/index.js +0 -4
  111. package/components/layout/layout.jsx +3 -2
  112. package/components/loading/demo/info.md +3 -3
  113. package/components/loading/{index.js → index.jsx} +29 -24
  114. package/components/locale/index.js +27 -69
  115. package/components/locale/lang/de.js +1 -1
  116. package/components/locale/lang/el.js +1 -1
  117. package/components/locale/lang/en.js +1 -1
  118. package/components/locale/lang/fr.js +2 -2
  119. package/components/locale/lang/it.js +1 -1
  120. package/components/locale/lang/ja.js +1 -1
  121. package/components/locale/lang/ko.js +1 -1
  122. package/components/locale/lang/ru.js +1 -1
  123. package/components/locale/lang/th.js +1 -1
  124. package/components/locale/lang/ua.js +1 -1
  125. package/components/locale/lang/vi.js +1 -1
  126. package/components/locale/lang/zh-CN.js +1 -1
  127. package/components/locale/lang/zh-TW.js +1 -1
  128. package/components/menu/demo/index.vue +2 -2
  129. package/components/menu/menu.jsx +6 -3
  130. package/components/menu/menudivider.jsx +5 -3
  131. package/components/menu/menugroup.jsx +4 -2
  132. package/components/menu/menuitem.jsx +6 -4
  133. package/components/menu/styles/index.less +88 -20
  134. package/components/menu/submenu.jsx +11 -28
  135. package/components/message/group.jsx +31 -28
  136. package/components/message/index.js +2 -2
  137. package/components/modal/demo/index.vue +2 -3
  138. package/components/modal/demo/info.md +5 -4
  139. package/components/modal/index.js +5 -7
  140. package/components/modal/modal.jsx +116 -121
  141. package/components/notice/index.js +2 -1
  142. package/components/page/page.jsx +15 -12
  143. package/components/page/styles/index.less +4 -4
  144. package/components/popconfirm/popconfirm.jsx +9 -8
  145. package/components/popconfirm/styles/index.less +15 -8
  146. package/components/poptip/poptip.jsx +7 -6
  147. package/components/poptip/styles/index.less +10 -4
  148. package/components/progress/progress.jsx +11 -8
  149. package/components/radio/button.jsx +4 -1
  150. package/components/radio/demo/button.md +1 -2
  151. package/components/radio/group.jsx +10 -19
  152. package/components/radio/radio.jsx +7 -9
  153. package/components/radio/styles/index.less +1 -1
  154. package/components/rate/rate.jsx +7 -10
  155. package/components/select/demo/base.md +5 -2
  156. package/components/select/demo/info.md +3 -1
  157. package/components/select/demo/multiple.md +1 -1
  158. package/components/select/demo/theme.md +0 -5
  159. package/components/select/index.md +4 -0
  160. package/components/select/option.jsx +8 -5
  161. package/components/select/select.jsx +247 -237
  162. package/components/select/styles/index.less +7 -13
  163. package/components/skeleton/demo/items.md +3 -3
  164. package/components/skeleton/skeleton.jsx +6 -2
  165. package/components/skeleton/skeletonAvatar.jsx +6 -2
  166. package/components/skeleton/skeletonButton.jsx +6 -2
  167. package/components/skeleton/skeletonImage.jsx +6 -2
  168. package/components/skeleton/skeletonText.jsx +6 -2
  169. package/components/slider/slider.jsx +15 -11
  170. package/components/slider/thumb.jsx +9 -8
  171. package/components/space/demo/align.md +5 -6
  172. package/components/space/demo/size.md +8 -8
  173. package/components/space/space.jsx +19 -17
  174. package/components/spin/demo/container.md +10 -10
  175. package/components/spin/spin.jsx +5 -2
  176. package/components/styles/color.less +57 -37
  177. package/components/styles/sys.less +31 -0
  178. package/components/styles/var.less +40 -11
  179. package/components/switch/styles/index.less +2 -2
  180. package/components/switch/switch.jsx +11 -8
  181. package/components/table/demo/edit.md +4 -4
  182. package/components/table/demo/expand.md +1 -2
  183. package/components/table/demo/filter.md +1 -1
  184. package/components/table/extend.jsx +172 -157
  185. package/components/table/styles/index.less +2 -1
  186. package/components/table/table.jsx +8 -6
  187. package/components/tabs/demo/base.md +6 -6
  188. package/components/tabs/demo/card.md +6 -6
  189. package/components/tabs/demo/centered.md +6 -6
  190. package/components/tabs/demo/closable.md +3 -3
  191. package/components/tabs/demo/disabled.md +6 -6
  192. package/components/tabs/demo/extra.md +6 -6
  193. package/components/tabs/demo/icon.md +4 -4
  194. package/components/tabs/demo/index.vue +3 -4
  195. package/components/tabs/demo/sample.md +6 -6
  196. package/components/tabs/index.js +2 -2
  197. package/components/tabs/index.md +1 -1
  198. package/components/tabs/styles/index.less +47 -9
  199. package/components/tabs/tabpanel.jsx +28 -0
  200. package/components/tabs/tabs.jsx +198 -151
  201. package/components/tag/demo/color.md +0 -1
  202. package/components/tag/styles/index.less +0 -6
  203. package/components/tag/tag.jsx +6 -3
  204. package/components/timeline/timeline.jsx +3 -1
  205. package/components/timeline/timelineitem.jsx +5 -2
  206. package/components/tooltip/demo/color.md +2 -3
  207. package/components/tooltip/styles/index.less +15 -26
  208. package/components/tooltip/tooltip.jsx +8 -6
  209. package/components/tree/demo/directory.md +3 -3
  210. package/components/tree/node.jsx +39 -50
  211. package/components/tree/styles/index.less +3 -3
  212. package/components/tree/tree.jsx +18 -28
  213. package/components/treeselect/styles/index.less +1 -1
  214. package/components/treeselect/treeselect.jsx +21 -22
  215. package/components/upload/demo/form.md +1 -1
  216. package/components/upload/upload.jsx +13 -27
  217. package/components/{_tool → utils}/animate.js +1 -1
  218. package/components/{_tool → utils}/clone.js +2 -2
  219. package/components/utils/color.js +5 -0
  220. package/components/{_tool/utils.js → utils/element.js} +8 -5
  221. package/components/utils/number.js +81 -0
  222. package/components/utils/theme.js +62 -0
  223. package/components/utils/vue.js +7 -0
  224. package/dist/k-ui.cjs.js +7 -0
  225. package/dist/k-ui.css +6 -7
  226. package/dist/k-ui.d.ts +162 -0
  227. package/dist/k-ui.esm.js +7 -0
  228. package/dist/k-ui.umd.js +7 -0
  229. package/dist/locale/de.js +5 -7
  230. package/dist/locale/el.js +5 -7
  231. package/dist/locale/en.js +5 -7
  232. package/dist/locale/fr.js +5 -7
  233. package/dist/locale/it.js +5 -7
  234. package/dist/locale/ja.js +5 -7
  235. package/dist/locale/ko.js +5 -7
  236. package/dist/locale/ru.js +5 -7
  237. package/dist/locale/th.js +5 -7
  238. package/dist/locale/ua.js +5 -7
  239. package/dist/locale/vi.js +5 -7
  240. package/dist/locale/zh-CN.js +7 -0
  241. package/dist/locale/zh-TW.js +7 -0
  242. package/package.json +53 -20
  243. package/readme.md +105 -0
  244. package/test/i18n@8.x.html +65 -0
  245. package/types/affix/Affix.d.ts +17 -0
  246. package/types/alert/Alert.d.ts +18 -0
  247. package/types/anchor/Anchor.d.ts +16 -0
  248. package/types/anchor/Link.d.ts +15 -0
  249. package/types/avatar/Avatar.d.ts +17 -0
  250. package/types/avatar/AvatarGroup.d.ts +15 -0
  251. package/types/backtop/BackTop.d.ts +16 -0
  252. package/types/badge/Badge.d.ts +20 -0
  253. package/types/base/BasePop.d.ts +24 -0
  254. package/types/base/Collapse.d.ts +15 -0
  255. package/types/base/Drop.d.ts +27 -0
  256. package/types/base/baseInput.d.ts +32 -0
  257. package/types/base/input.d.ts +32 -0
  258. package/types/base/pop.d.ts +36 -0
  259. package/types/breadcrumb/Breadcrumb.d.ts +11 -0
  260. package/types/breadcrumb/BreadcrumbItem.d.ts +17 -0
  261. package/types/button/Button.d.ts +27 -0
  262. package/types/button/ButtonGroup.d.ts +15 -0
  263. package/types/card/Card.d.ts +16 -0
  264. package/types/carousel/Carousel.d.ts +22 -0
  265. package/types/carousel/CarouselItem.d.ts +11 -0
  266. package/types/checkbox/Checkbox.d.ts +19 -0
  267. package/types/checkbox/CheckboxGroup.d.ts +20 -0
  268. package/types/collapse/Collapse.d.ts +15 -0
  269. package/types/collapse/Panel.d.ts +14 -0
  270. package/types/colorPicker/Alpha.d.ts +13 -0
  271. package/types/colorPicker/ColorPicker.d.ts +26 -0
  272. package/types/colorPicker/Hue.d.ts +13 -0
  273. package/types/colorPicker/Mode.d.ts +15 -0
  274. package/types/colorPicker/Paint.d.ts +14 -0
  275. package/types/colorPicker/Presets.d.ts +15 -0
  276. package/types/datePicker/DateCalendar.d.ts +27 -0
  277. package/types/datePicker/DatePicker.d.ts +36 -0
  278. package/types/descriptions/Descriptions.d.ts +21 -0
  279. package/types/descriptions/DescriptionsItem.d.ts +18 -0
  280. package/types/divider/Divider.d.ts +18 -0
  281. package/types/drawer/Drawer.d.ts +35 -0
  282. package/types/dropdown/Dropdown.d.ts +21 -0
  283. package/types/empty/Empty.d.ts +15 -0
  284. package/types/flex/Flex.d.ts +17 -0
  285. package/types/form/Form.d.ts +25 -0
  286. package/types/form/FormItem.d.ts +17 -0
  287. package/types/grid/Col.d.ts +15 -0
  288. package/types/grid/Row.d.ts +17 -0
  289. package/types/icon/Icon.d.ts +17 -0
  290. package/types/image/ImageGroup.d.ts +11 -0
  291. package/types/image/ImagePreview.d.ts +24 -0
  292. package/types/image/KImage.d.ts +21 -0
  293. package/types/image/imageProps.d.ts +19 -0
  294. package/types/image/instance.d.ts +19 -0
  295. package/types/index.d.ts +188 -0
  296. package/types/input/Input.d.ts +31 -0
  297. package/types/input/InputGroup.d.ts +17 -0
  298. package/types/input/TextArea.d.ts +16 -0
  299. package/types/inputNumber/InputNumber.d.ts +33 -0
  300. package/types/layout/layout.d.ts +13 -0
  301. package/types/layout/prop.d.ts +13 -0
  302. package/types/loading/Loading.d.ts +11 -0
  303. package/types/menu/Menu.d.ts +21 -0
  304. package/types/menu/MenuDivider.d.ts +11 -0
  305. package/types/menu/MenuGroup.d.ts +13 -0
  306. package/types/menu/MenuItem.d.ts +15 -0
  307. package/types/menu/SubMenu.d.ts +15 -0
  308. package/types/menu/show.d.ts +15 -0
  309. package/types/message/group.d.ts +13 -0
  310. package/types/message/inner.d.ts +24 -0
  311. package/types/modal/Modal.d.ts +31 -0
  312. package/types/page/Page.d.ts +26 -0
  313. package/types/popconfirm/Popconfirm.d.ts +21 -0
  314. package/types/poptip/Poptip.d.ts +22 -0
  315. package/types/progress/Progress.d.ts +33 -0
  316. package/types/radio/Radio.d.ts +19 -0
  317. package/types/radio/RadioButton.d.ts +18 -0
  318. package/types/radio/RadioGroup.d.ts +23 -0
  319. package/types/rate/Rate.d.ts +26 -0
  320. package/types/rate/Star.d.ts +22 -0
  321. package/types/select/Option.d.ts +15 -0
  322. package/types/select/Select.d.ts +38 -0
  323. package/types/skeleton/Skeleton.d.ts +21 -0
  324. package/types/skeleton/SkeletonAvatar.d.ts +19 -0
  325. package/types/skeleton/SkeletonButton.d.ts +20 -0
  326. package/types/skeleton/SkeletonImage.d.ts +18 -0
  327. package/types/skeleton/SkeletonText.d.ts +18 -0
  328. package/types/slider/Slider.d.ts +29 -0
  329. package/types/slider/thumb.d.ts +24 -0
  330. package/types/space/Space.d.ts +18 -0
  331. package/types/spin/Spin.d.ts +20 -0
  332. package/types/switch/KSwitch.d.ts +20 -0
  333. package/types/switch/Switch.d.ts +20 -0
  334. package/types/table/ExtendTable.d.ts +21 -0
  335. package/types/table/Table.d.ts +24 -0
  336. package/types/table/extend.d.ts +21 -0
  337. package/types/tabs/TabPanel.d.ts +17 -0
  338. package/types/tabs/Tabs.d.ts +18 -0
  339. package/types/tag/Tag.d.ts +18 -0
  340. package/types/timeline/TimeLine.d.ts +14 -0
  341. package/types/timeline/TimeLineItem.d.ts +16 -0
  342. package/types/tooltip/Tooltip.d.ts +23 -0
  343. package/types/tree/Tree.d.ts +28 -0
  344. package/types/tree/TreeNode.d.ts +17 -0
  345. package/types/treeselect/TreeSelect.d.ts +41 -0
  346. package/types/upload/Upload.d.ts +39 -0
  347. package/README.md +0 -106
  348. package/components/_tool/directives.js +0 -31
  349. package/components/_tool/number.js +0 -177
  350. package/components/bin/index.js +0 -3
  351. package/components/button/demo/normal.md +0 -41
  352. package/components/button/demo/solid.md +0 -16
  353. package/components/colorPicker/canvasHelper.js +0 -274
  354. package/components/colorPicker/demo/shape.md +0 -36
  355. package/components/tabs/tabpane.jsx +0 -25
  356. package/dist/k-ui.js +0 -9
  357. package/dist/locale/zhCN.js +0 -9
  358. package/dist/locale/zhTW.js +0 -9
  359. package/test/i18n@6.x.html +0 -52
  360. /package/components/{_tool → directives}/outsiteclick.js +0 -0
  361. /package/components/{_tool → directives}/resize.js +0 -0
  362. /package/components/{_tool → directives}/scroll.js +0 -0
  363. /package/components/{_tool → directives}/transfer.js +0 -0
  364. /package/components/menu/demo/{accrodion.md → accordion.md} +0 -0
  365. /package/components/modal/demo/{confrim.md → confirm.md} +0 -0
  366. /package/components/{_tool → utils}/docClick.js +0 -0
@@ -1,12 +1,13 @@
1
- import Icon from '../icon'
2
- import { Button } from '../button'
3
- import transfer from "../_tool/transfer";
4
- import { measureScrollBar, getOffset } from '../_tool/utils'
5
- import { t } from '../locale'
6
- // let cacheBodyOverflow = {};
7
- import { Close } from 'kui-icons'
1
+ import Icon from "../icon";
2
+ import { Button } from "../button";
3
+ import transfer from "../directives/transfer";
4
+ import { getOffset } from "../utils/element";
5
+ import { t } from "../locale";
6
+ import { Close } from "kui-icons";
8
7
 
9
- export default {
8
+ import { withInstall } from '../utils/vue'
9
+ const Modal = {
10
+ name: "Modal",
10
11
  directives: { transfer },
11
12
  props: {
12
13
  value: Boolean,
@@ -31,199 +32,193 @@ export default {
31
32
  rendered: false,
32
33
  show: this.value,
33
34
  showInner: this.value,
34
- left: '',
35
+ left: "",
35
36
  currentTop: this.top,
36
37
  isMouseDown: false,
37
38
  mousedownIn: false,
38
39
  startPos: { x: 0, y: 0 },
39
- showPoint: { x: 0, y: 0 }
40
- }
40
+ showPoint: { x: 0, y: 0 },
41
+ };
41
42
  },
42
43
  watch: {
43
44
  value(value) {
44
- this.updateProp(value)
45
- }
45
+ this.updateProp(value);
46
+ },
46
47
  },
47
48
  updated() {
48
49
  if (this.show) {
49
- this.setPos()
50
+ this.setPos();
50
51
  }
51
52
  },
52
53
  methods: {
53
54
  updateProp(visible) {
54
55
  if (visible) {
55
- this.rendered = true
56
- this.$nextTick(e => {
57
- this.show = visible
58
- this.showInner = visible
59
- })
56
+ this.rendered = true;
57
+ this.$nextTick(() => {
58
+ this.show = visible;
59
+ this.showInner = visible;
60
+ });
60
61
  } else {
61
- this.show = false
62
+ this.show = false;
62
63
  setTimeout(() => {
63
- this.showInner = false
64
+ this.showInner = false;
64
65
  }, 300);
65
66
  }
66
- // this.resetBodyStyle(visible)
67
67
  },
68
- // resetBodyStyle(opened) {
69
- // if (!this.$isServer) {
70
- // let target = document.body;
71
- // if (!this.show && !cacheBodyOverflow.hasOwnProperty('overflow')) {
72
- // cacheBodyOverflow = {
73
- // width: target.style.width,
74
- // overflow: target.style.overflow,
75
- // overflowX: target.style.overflowX,
76
- // overflowY: target.style.overflowY,
77
- // }
78
- // }
79
- // if (opened) {
80
- // let barWidth = measureScrollBar(true)
81
- // let hasBar = target.scrollHeight > window.innerHeight || target.offsetHeight > window.innerHeight
82
- // if (barWidth && hasBar) {
83
- // target.style.width = `calc(100% - ${barWidth}px)`
84
- // target.style.overflow = `hidden`
85
- // }
86
- // } else {
87
- // setTimeout(() => {
88
- // let task = (this.tasks && this.tasks.length == 0) || !this.tasks
89
- // task && Object.keys(cacheBodyOverflow).forEach(key => {
90
- // target.style[key] = cacheBodyOverflow[key] || ''
91
- // delete cacheBodyOverflow[key]
92
- // })
93
- // }, 300)
94
- // }
95
- // }
96
- // },
97
68
  setPos() {
98
69
  if (this.show && this.$refs.modal) {
99
- let { showPoint: { x, y } } = this
70
+ let {
71
+ showPoint: { x, y },
72
+ } = this;
100
73
  // let { x, y } = showPoint
101
- let { left, top } = getOffset(this.$refs.modal)
102
- this.$refs.modal.style['transform-origin'] = `${x - left}px ${y - top}px`
74
+ let { left, top } = getOffset(this.$refs.modal);
75
+ this.$refs.modal.style["transform-origin"] = `${x - left}px ${y - top}px`;
103
76
  }
104
77
  },
105
78
  ok() {
106
- this.$emit('ok')
79
+ this.$emit("ok");
107
80
  },
108
81
  cancel() {
109
- this.close()
110
- this.$emit('cancel')
82
+ this.close();
83
+ this.$emit("cancel");
111
84
  },
112
85
  close() {
113
- this.$emit('input', false)
114
- this.$emit('cancel')
115
- this.$emit('close')
86
+ this.$emit("input", false);
87
+ this.$emit("cancel");
88
+ this.$emit("close");
116
89
  },
117
90
  clickMaskToClose(e) {
118
- // console.log(this.mousedownIn)
119
91
  if (!this.loading && this.maskClosable && !this.$refs.modal.contains(e.target) && !this.mousedownIn) {
120
- this.close()
92
+ this.close();
121
93
  }
122
94
  },
123
95
  mousemove(e) {
124
96
  if (this.isMouseDown && this.draggable) {
125
- let { x, y } = this.startPos
126
- this.left += e.clientX - x
127
- this.currentTop = this.currentTop || 100
128
- this.currentTop += e.clientY - y
129
- this.startPos = { x: e.clientX, y: e.clientY }
130
- this.setPos()
131
- e.preventDefault()
97
+ let { x, y } = this.startPos;
98
+ this.left += e.clientX - x;
99
+ this.currentTop = this.currentTop || 100;
100
+ this.currentTop += e.clientY - y;
101
+ this.startPos = { x: e.clientX, y: e.clientY };
102
+ this.setPos();
103
+ e.preventDefault();
132
104
  }
133
105
  },
134
- mouseup(e) {
135
- this.isMouseDown = false
136
- document.removeEventListener('mousemove', this.mousemove)
137
- document.removeEventListener('mouseup', this.mouseup)
106
+ mouseup() {
107
+ this.isMouseDown = false;
108
+ document.removeEventListener("mousemove", this.mousemove);
109
+ document.removeEventListener("mouseup", this.mouseup);
138
110
  },
139
111
  mousedown(e) {
140
112
  if (!this.show) {
141
- this.showPoint = { x: e.clientX, y: e.clientY }
113
+ this.showPoint = { x: e.clientX, y: e.clientY };
142
114
  }
143
115
  if (e.button == 0 && this.draggable === true && this.$refs.hRef && this.$refs.hRef.contains(e.target)) {
144
- this.isMouseDown = true
145
- this.startPos = { x: e.clientX, y: e.clientY }
146
- this.mousemove(e)
147
- document.addEventListener('mousemove', this.mousemove)
148
- document.addEventListener('mouseup', this.mouseup)
116
+ this.isMouseDown = true;
117
+ this.startPos = { x: e.clientX, y: e.clientY };
118
+ this.mousemove(e);
119
+ document.addEventListener("mousemove", this.mousemove);
120
+ document.addEventListener("mouseup", this.mouseup);
149
121
  }
150
122
 
151
- this.mousedownIn = this.show && this.$refs.modal && this.$refs.modal.contains(e.target)
152
- }
123
+ this.mousedownIn = this.show && this.$refs.modal && this.$refs.modal.contains(e.target);
124
+ },
153
125
  },
154
126
  beforeDestroy() {
155
- !this.$isServer && document.removeEventListener('mousedown', this.mousedown);
127
+ typeof window !== "undefined" && document.removeEventListener("mousedown", this.mousedown);
156
128
  // this.resetBodyStyle(false)
157
129
  },
158
130
 
159
131
  mounted() {
160
- if (!this.$isServer) {
161
- document.addEventListener('mousedown', this.mousedown)
132
+ if (typeof window !== "undefined") {
133
+ document.addEventListener("mousedown", this.mousedown);
162
134
 
163
135
  if (this.draggable) {
164
- this.left = (document.body.offsetWidth - (this.width || 520)) / 2
136
+ this.left = (document.body.offsetWidth - (this.width || 520)) / 2;
165
137
  }
166
- // console.log(this.value)
167
138
  if (this.value) {
168
139
  this.$nextTick(() => {
169
- this.updateProp(true)
170
- })
140
+ this.updateProp(true);
141
+ });
171
142
  }
172
143
  }
173
144
  },
174
145
  render() {
175
- let { $slots, show, showInner, draggable, transfer } = this
146
+ let { $slots, show, showInner, draggable, transfer } = this;
176
147
 
177
148
  //mask
178
- let maskNode = null
149
+ let maskNode = null;
179
150
  if (this.mask) {
180
- maskNode = <transition name="k-modal-fade"><div class="k-modal-mask" v-show={show} /></transition>
151
+ maskNode = (
152
+ <transition name="k-modal-fade">
153
+ <div class="k-modal-mask" v-show={show} />
154
+ </transition>
155
+ );
181
156
  }
182
- let okText = this.okText || t('k.modal.ok')
183
- let cancelText = this.cancelText || t('k.modal.cancel')
157
+ let okText = this.okText || t("k.modal.ok");
158
+ let cancelText = this.cancelText || t("k.modal.cancel");
184
159
  //content
185
- let contentNode = $slots.content
160
+ let contentNode = $slots.content;
186
161
  if (!contentNode) {
187
- const contents = []
188
- this.showClose && contents.push(<span class="k-modal-close" onClick={this.close}><Icon type={Close} strokeWidth={50} /></span>)
189
- this.title !== null && contents.push(<div class="k-modal-header" ref="hRef"><div class="k-modal-header-inner">{this.title}</div></div>)
190
- contents.push(<div class="k-modal-body">{$slots.default}</div>)
162
+ const contents = [];
163
+ this.showClose &&
164
+ contents.push(
165
+ <span class="k-modal-close" onClick={this.close}>
166
+ <Icon type={Close} strokeWidth={50} />
167
+ </span>
168
+ );
169
+ this.title !== null &&
170
+ contents.push(
171
+ <div class="k-modal-header" ref="hRef">
172
+ <div class="k-modal-header-inner">{this.title}</div>
173
+ </div>
174
+ );
175
+ contents.push(<div class="k-modal-body">{$slots.default}</div>);
191
176
 
192
177
  //footer
193
178
  if (this.footer !== null) {
194
- let footer = $slots.footer
179
+ let footer = $slots.footer;
195
180
  if (!footer) {
196
- footer = [<Button onClick={this.cancel}>{cancelText}</Button>, <Button onClick={this.ok} type="primary" loading={this.loading}>{okText}</Button>]
181
+ footer = [
182
+ <Button onClick={this.cancel}>{cancelText}</Button>,
183
+ <Button onClick={this.ok} type="primary" loading={this.loading}>
184
+ {okText}
185
+ </Button>,
186
+ ];
197
187
  }
198
188
  const footerNode = footer ? <div class="k-modal-footer">{footer}</div> : null;
199
189
 
200
- contents.push(footerNode)
190
+ contents.push(footerNode);
201
191
  }
202
- contentNode = <div class="k-modal-content">{contents}</div>
192
+ contentNode = <div class="k-modal-content">{contents}</div>;
203
193
  }
204
194
 
205
195
  const style = {
206
196
  width: `${this.width}px`,
207
197
  top: `${this.currentTop}px`,
208
198
  left: `${this.left}px`,
209
- }
199
+ };
210
200
  const classes = [
211
- 'k-modal', {
212
- 'k-modal-draggable': draggable,
213
- 'k-modal-maximized': this.maximized,
214
- 'k-modal-centered': this.centered,
215
- 'k-modal-has-footer': this.footer !== null,
216
- }
217
- ]
218
- return this.rendered ? (<div class={classes} v-transfer={transfer}>
219
- {maskNode}
220
- <div class="k-modal-wrap" v-show={showInner} onClick={this.clickMaskToClose}>
221
- <transition name="k-modal-zoom">
222
- <div class="k-modal-inner" ref="modal" v-show={show} style={style}>
223
- {contentNode}
224
- </div>
225
- </transition>
201
+ "k-modal",
202
+ {
203
+ "k-modal-draggable": draggable,
204
+ "k-modal-maximized": this.maximized,
205
+ "k-modal-centered": this.centered,
206
+ "k-modal-has-footer": this.footer !== null,
207
+ },
208
+ ];
209
+ return this.rendered ? (
210
+ <div class={classes} v-transfer={transfer}>
211
+ {maskNode}
212
+ <div class="k-modal-wrap" v-show={showInner} onClick={this.clickMaskToClose}>
213
+ <transition name="k-modal-zoom">
214
+ <div class="k-modal-inner" ref="modal" v-show={show} style={style}>
215
+ {contentNode}
216
+ </div>
217
+ </transition>
218
+ </div>
226
219
  </div>
227
- </div>) : null
228
- }
229
- }
220
+ ) : null;
221
+ },
222
+ };
223
+
224
+ export default withInstall(Modal);
@@ -1,4 +1,5 @@
1
1
  import newInstance from '../message/instance'
2
+ import { withInstall } from '../utils/vue'
2
3
 
3
4
  let noticeInstance;
4
5
 
@@ -30,4 +31,4 @@ let Notice = {
30
31
  }
31
32
  });
32
33
 
33
- export default Notice;
34
+ export default withInstall(Notice);
@@ -1,10 +1,11 @@
1
- import { Select, Option } from '../select'
1
+ import { Select } from '../select'
2
2
  import { Input } from '../input'
3
3
  import Icon from '../icon'
4
4
  import { t } from '../locale';
5
5
  import { ChevronUp, ChevronDoubleBack, Ellipsis, ChevronDoubleForward } from 'kui-icons'
6
+ import { withInstall } from '../utils/vue'
6
7
 
7
- export default {
8
+ const Page = {
8
9
  name: "Page",
9
10
  props: {
10
11
  showSizer: Boolean,
@@ -43,7 +44,7 @@ export default {
43
44
  this.page = v
44
45
  this.resetPage()
45
46
  },
46
- total(v) {
47
+ total() {
47
48
  this.resetPage()
48
49
  }
49
50
  },
@@ -93,7 +94,7 @@ export default {
93
94
  let prop = {
94
95
  class: ['k-pager-item', { 'k-pager-item-active': page == p }],
95
96
  key: i,
96
- on: { click: e => this.toPage(p) }
97
+ on: { click: () => this.toPage(p) }
97
98
  }
98
99
  return <li {...prop}><span>{p}</span></li>
99
100
  })
@@ -157,14 +158,14 @@ export default {
157
158
  this.pageCount = Math.ceil(this.total / this.defaultPageSize) || 1;
158
159
  if (this.page > this.pageCount) {
159
160
  this.page = this.pageCount
160
- this.$emit('input', page)
161
- this.$emit('change', page)
161
+ this.$emit('input', this.page)
162
+ this.$emit('change', this.page)
162
163
  }
163
164
  this.$emit('page-size-change', { current: this.page, pageSize: value })
164
165
  },
165
166
  renderFirst() {
166
167
  if (this.pageCount > 0) {
167
- return <li class={["k-pager-item", { 'k-pager-item-active': this.page == 1 }]} onClick={e => this.toPage(1)} >
168
+ return <li class={["k-pager-item", { 'k-pager-item-active': this.page == 1 }]} onClick={() => this.toPage(1)} >
168
169
  <span>1</span>
169
170
  </li>
170
171
  }
@@ -173,7 +174,7 @@ export default {
173
174
  renderLast() {
174
175
  let { pageCount } = this
175
176
  if (pageCount > 1) {
176
- return <li class={['k-pager-item', { 'k-pager-item-active': this.page == pageCount }]} onClick={e => this.toPage(pageCount)} >
177
+ return <li class={['k-pager-item', { 'k-pager-item-active': this.page == pageCount }]} onClick={() => this.toPage(pageCount)} >
177
178
  <span>{pageCount}</span>
178
179
  </li>
179
180
  }
@@ -196,7 +197,7 @@ export default {
196
197
  }
197
198
  return (this.showSizer ? <div class="k-page-sizer"><Select {...prop} /></div > : null)
198
199
  },
199
- renderElvator() {
200
+ renderElevator() {
200
201
  let { size } = this
201
202
  let prop = {
202
203
  class: 'k-page-options-elevator',
@@ -232,7 +233,7 @@ export default {
232
233
  totalNode = (this.showTotal ? <div class="k-page-number"><span>{t('k.page.total')} {this.total} {t('k.page.items')}</span></div> : null),
233
234
  pagerNode = this.renderPage(),
234
235
  sizeNode = this.renderSize(),
235
- elvatorNode = this.renderElvator(),
236
+ elevatorNode = this.renderElevator(),
236
237
  firstNode = this.renderFirst(),
237
238
  lastNode = this.renderLast()
238
239
  return (
@@ -241,8 +242,10 @@ export default {
241
242
  <ul class="k-pager">
242
243
  {[preNode, firstNode, pagerNode, lastNode, nextNode,]}
243
244
  </ul>
244
- {[sizeNode, elvatorNode]}
245
+ {[sizeNode, elevatorNode]}
245
246
  </div>
246
247
  )
247
248
  }
248
- }
249
+ }
250
+
251
+ export default withInstall(Page)
@@ -48,12 +48,12 @@
48
48
  }
49
49
 
50
50
  &:active {
51
- // border-color: var(--kui-color-main-actived);
52
- background-color: var(--kui-color-actived);
53
- // color: var(--kui-color-main-actived);
51
+ // border-color: var(--kui-color-main-active);
52
+ background-color: var(--kui-color-active);
53
+ // color: var(--kui-color-main-active);
54
54
 
55
55
  .k-icon {
56
- color: var(--kui-color-main-actived);
56
+ color: var(--kui-color-main-active);
57
57
  }
58
58
  }
59
59
 
@@ -1,5 +1,7 @@
1
1
  import BasePop from '../base/pop'
2
- export default {
2
+ import { withInstall } from '../utils/vue'
3
+ import { placements } from '../const/var'
4
+ const Popconfirm = {
3
5
  name: 'Popconfirm',
4
6
  props: {
5
7
  dark: Boolean,
@@ -10,19 +12,17 @@ export default {
10
12
  cancelText: String,
11
13
  placement: {
12
14
  validator(value) {
13
- return (
14
- ["top", "top-left", "top-right", "bottom", "bottom-left", "bottom-right", "left", "left-bottom", "left-top", "right", "right-top", "right-bottom"].indexOf(value) >= 0
15
- );
15
+ return placements.includes(value);
16
16
  },
17
17
  default: "top"
18
18
  },
19
19
  },
20
20
  render() {
21
21
  let props = {
22
- props: { preCls: 'popconfirm', ...this.$props, confirm: true },
22
+ props: { preCls: 'popconfirm', ...this.$props, confirm: true, extendWidth: false },
23
23
  on: {
24
- 'ok': e => this.$emit('ok'),
25
- 'cancel': e => this.$emit('cancel')
24
+ 'ok': () => this.$emit('ok'),
25
+ 'cancel': () => this.$emit('cancel')
26
26
  }
27
27
  }
28
28
  return (
@@ -32,4 +32,5 @@ export default {
32
32
  </BasePop>
33
33
  )
34
34
  }
35
- };
35
+ };
36
+ export default withInstall(Popconfirm);
@@ -43,8 +43,8 @@
43
43
 
44
44
  &[k-placement^=bottom] {
45
45
  .k-popconfirm-arrow {
46
- top: -6px;
47
- height: 7px;
46
+ top: -7px;
47
+ height: 9px;
48
48
  transform: rotate(180deg);
49
49
  }
50
50
 
@@ -74,8 +74,8 @@
74
74
  &[k-placement^=left] {
75
75
  .k-popconfirm-arrow {
76
76
  right: -14px;
77
- width: 24px;
78
- height: 7px;
77
+ width: 23px;
78
+ height: 9px;
79
79
  transform: rotate(-90deg);
80
80
  }
81
81
 
@@ -106,8 +106,8 @@
106
106
  &[k-placement^=right] {
107
107
  .k-popconfirm-arrow {
108
108
  left: -14px;
109
- width: 24px;
110
- height: 7px;
109
+ width: 23px;
110
+ height: 9px;
111
111
  transform: rotate(90deg);
112
112
  }
113
113
 
@@ -145,6 +145,13 @@
145
145
  position: relative;
146
146
  // border: 1px solid var(--kui-color-border);
147
147
  // }
148
+ border: 1px solid var(--kui-color-border);
149
+
150
+ #ot {
151
+ stroke-width: 0.1em;
152
+ stroke: var(--kui-color-border);
153
+ }
154
+
148
155
  .k-popconfirm-body {
149
156
  padding: 18px 18px 10px 18px;
150
157
  box-sizing: border-box;
@@ -174,8 +181,8 @@
174
181
  display: flex;
175
182
  color: var(--kui-color-control-10);
176
183
  // color:inherit;
177
- width: 24px;
178
- height: 7px;
184
+ width: 23px;
185
+ height: 9px;
179
186
  }
180
187
 
181
188
  .k-popconfirm-footer {
@@ -1,5 +1,7 @@
1
1
  import BasePop from '../base/pop'
2
- export default {
2
+ import { withInstall } from '../utils/vue'
3
+ import { placements } from '../const/var'
4
+ const Poptip = {
3
5
  name: 'Poptip',
4
6
  props: {
5
7
  dark: Boolean,
@@ -9,9 +11,7 @@ export default {
9
11
  width: [Number, String],
10
12
  placement: {
11
13
  validator(value) {
12
- return (
13
- ["top", "top-left", "top-right", "bottom", "bottom-left", "bottom-right", "left", "left-bottom", "left-top", "right", "right-top", "right-bottom"].indexOf(value) >= 0
14
- );
14
+ return placements.includes(value);
15
15
  },
16
16
  default: "top"
17
17
  },
@@ -19,7 +19,7 @@ export default {
19
19
  },
20
20
  render() {
21
21
  let props = {
22
- props: { preCls: 'poptip', ...this.$props },
22
+ props: { preCls: 'poptip', ...this.$props, extendWidth: false },
23
23
  on: {
24
24
  input: (e) => this.$emit('input', e)
25
25
  }
@@ -31,4 +31,5 @@ export default {
31
31
  </BasePop>
32
32
  )
33
33
  }
34
- };
34
+ };
35
+ export default withInstall(Poptip);
@@ -84,8 +84,8 @@
84
84
  &[k-placement^=left] {
85
85
  .k-poptip-arrow {
86
86
  right: -14px;
87
- width: 24px;
88
- height: 7px;
87
+ width: 23px;
88
+ height: 9px;
89
89
  transform: rotate(-90deg);
90
90
 
91
91
  svg {
@@ -120,8 +120,8 @@
120
120
  &[k-placement^=right] {
121
121
  .k-poptip-arrow {
122
122
  left: -14px;
123
- width: 24px;
124
- height: 7px;
123
+ width: 23px;
124
+ height: 9px;
125
125
  transform: rotate(90deg);
126
126
 
127
127
  svg {
@@ -163,6 +163,12 @@
163
163
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
164
164
  border-radius: 8px; // var(--kui-border-radius);
165
165
  position: relative;
166
+ border: 1px solid var(--kui-color-border);
167
+
168
+ #ot {
169
+ stroke-width: 0.1em;
170
+ stroke: var(--kui-color-border);
171
+ }
166
172
 
167
173
  // }
168
174
  .k-poptip-body {
@@ -1,6 +1,7 @@
1
1
  import Icon from '../icon'
2
2
  import { CheckmarkCircle, CloseCircle, Close, Checkmark } from 'kui-icons'
3
- export default {
3
+ import { withInstall } from '../utils/vue'
4
+ const Progress = {
4
5
  name: 'Progress',
5
6
  props: {
6
7
  percent: { type: Number, default: 0 },
@@ -74,15 +75,15 @@ export default {
74
75
  renderCircle(percent, strokeColor, dashboard) {
75
76
  let { strokeWidth } = this
76
77
  let radius = 50 - strokeWidth / 2,
77
- benginX = 0,
78
- benginY = radius,
78
+ beginX = 0,
79
+ beginY = radius,
79
80
  endX = 0,
80
81
  endY = 2 * radius;
81
82
  let gapDegree = this.gapDegree;
82
83
  gapDegree = Math.max(0, gapDegree)
83
84
  gapDegree = Math.min(259, gapDegree)
84
85
  let d = `M 50,50
85
- m ${benginX}, ${benginY}
86
+ m ${beginX}, ${beginY}
86
87
  a ${radius},${radius} 0 1 1 ${endX}, ${-endY}
87
88
  a ${radius},${radius} 0 1 1 ${-endX},${endY}`,
88
89
  len = Math.PI * 2 * radius,
@@ -111,7 +112,7 @@ export default {
111
112
  <path d={d} fill="none" stroke-width={strokeWidth} style={style} class="k-progress-bg" />
112
113
  </svg>)
113
114
  },
114
- renderGress() {
115
+ renderBar() {
115
116
  let { currentPercent, type, color, strokeHeight } = this
116
117
  if (type == 'line') {
117
118
  let sty = {
@@ -143,15 +144,17 @@ export default {
143
144
  { 'k-progress-hide-info': !this.showInfo }
144
145
  ]
145
146
  let tipNode = this.renderTip()
146
- let gress = this.renderGress(), style;
147
+ let bar = this.renderBar(), style;
147
148
 
148
149
  if (type != 'line' && width > 10) {
149
150
  style = { width: width + 'px', height: width + 'px' }
150
151
  }
151
152
  return (
152
153
  <div class={classes} style={style}>
153
- {[gress, tipNode]}
154
+ {[bar, tipNode]}
154
155
  </div>
155
156
  )
156
157
  }
157
- }
158
+ }
159
+
160
+ export default withInstall(Progress)