@oinone/kunlun-vue-ui-antd 6.2.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 (260) hide show
  1. package/README.md +1 -0
  2. package/dist/oinone-kunlun-vue-ui-antd.css +1 -0
  3. package/dist/oinone-kunlun-vue-ui-antd.esm.js +16 -0
  4. package/dist/oinone-kunlun-vue-ui-antd.scss +1 -0
  5. package/dist/types/index.d.ts +3 -0
  6. package/dist/types/src/component/index.d.ts +31 -0
  7. package/dist/types/src/component/oio-block/index.d.ts +3 -0
  8. package/dist/types/src/component/oio-block/oio-block.vue.d.ts +39 -0
  9. package/dist/types/src/component/oio-block/oio-col.vue.d.ts +86 -0
  10. package/dist/types/src/component/oio-block/oio-row.vue.d.ts +34 -0
  11. package/dist/types/src/component/oio-breadcrumb/index.d.ts +2 -0
  12. package/dist/types/src/component/oio-breadcrumb/oio-breadcrumb-item.vue.d.ts +14 -0
  13. package/dist/types/src/component/oio-breadcrumb/oio-breadcrumb.vue.d.ts +14 -0
  14. package/dist/types/src/component/oio-button/index.d.ts +1 -0
  15. package/dist/types/src/component/oio-button/oio-button.vue.d.ts +136 -0
  16. package/dist/types/src/component/oio-cascader/index.d.ts +1 -0
  17. package/dist/types/src/component/oio-cascader/oio-cascader.vue.d.ts +236 -0
  18. package/dist/types/src/component/oio-checkbox/index.d.ts +1 -0
  19. package/dist/types/src/component/oio-checkbox/oio-checkbox.vue.d.ts +56 -0
  20. package/dist/types/src/component/oio-collapse/index.d.ts +2 -0
  21. package/dist/types/src/component/oio-collapse/oio-collapse-panel.vue.d.ts +86 -0
  22. package/dist/types/src/component/oio-collapse/oio-collapse.vue.d.ts +103 -0
  23. package/dist/types/src/component/oio-date-time-picker/index.d.ts +5 -0
  24. package/dist/types/src/component/oio-date-time-picker/oio-date-picker.vue.d.ts +182 -0
  25. package/dist/types/src/component/oio-date-time-picker/oio-date-time-picker.vue.d.ts +240 -0
  26. package/dist/types/src/component/oio-date-time-picker/oio-time-picker.vue.d.ts +176 -0
  27. package/dist/types/src/component/oio-date-time-picker/oio-year-picker.vue.d.ts +139 -0
  28. package/dist/types/src/component/oio-date-time-picker/use-date-time-picker-props.d.ts +15 -0
  29. package/dist/types/src/component/oio-date-time-range-picker/index.d.ts +5 -0
  30. package/dist/types/src/component/oio-date-time-range-picker/oio-date-range-picker.vue.d.ts +139 -0
  31. package/dist/types/src/component/oio-date-time-range-picker/oio-date-time-range-picker.vue.d.ts +195 -0
  32. package/dist/types/src/component/oio-date-time-range-picker/oio-time-range-picker.vue.d.ts +139 -0
  33. package/dist/types/src/component/oio-date-time-range-picker/oio-year-range-picker.vue.d.ts +124 -0
  34. package/dist/types/src/component/oio-date-time-range-picker/use-date-time-range-picker-props.d.ts +12 -0
  35. package/dist/types/src/component/oio-divider/index.d.ts +2 -0
  36. package/dist/types/src/component/oio-divider/oio-divider.vue.d.ts +38 -0
  37. package/dist/types/src/component/oio-drawer/index.d.ts +1 -0
  38. package/dist/types/src/component/oio-drawer/oio-drawer.vue.d.ts +227 -0
  39. package/dist/types/src/component/oio-dropdown/index.d.ts +1 -0
  40. package/dist/types/src/component/oio-dropdown/oio-dropdown.vue.d.ts +78 -0
  41. package/dist/types/src/component/oio-empty/index.d.ts +1 -0
  42. package/dist/types/src/component/oio-empty/oio-empty-data.vue.d.ts +42 -0
  43. package/dist/types/src/component/oio-form/index.d.ts +2 -0
  44. package/dist/types/src/component/oio-form/oio-form-item.vue.d.ts +126 -0
  45. package/dist/types/src/component/oio-form/oio-form.vue.d.ts +100 -0
  46. package/dist/types/src/component/oio-gallery/index.d.ts +1 -0
  47. package/dist/types/src/component/oio-gallery/oio-gallery.vue.d.ts +98 -0
  48. package/dist/types/src/component/oio-group/index.d.ts +2 -0
  49. package/dist/types/src/component/oio-group/oio-group-help.vue.d.ts +65 -0
  50. package/dist/types/src/component/oio-group/oio-group.vue.d.ts +113 -0
  51. package/dist/types/src/component/oio-inner-popup/index.d.ts +1 -0
  52. package/dist/types/src/component/oio-inner-popup/oio-inner-popup.vue.d.ts +195 -0
  53. package/dist/types/src/component/oio-input/index.d.ts +5 -0
  54. package/dist/types/src/component/oio-input/oio-input-group.vue.d.ts +16 -0
  55. package/dist/types/src/component/oio-input/oio-input-number.vue.d.ts +167 -0
  56. package/dist/types/src/component/oio-input/oio-input-password.vue.d.ts +111 -0
  57. package/dist/types/src/component/oio-input/oio-input-search.vue.d.ts +106 -0
  58. package/dist/types/src/component/oio-input/oio-input.vue.d.ts +107 -0
  59. package/dist/types/src/component/oio-modal/index.d.ts +1 -0
  60. package/dist/types/src/component/oio-modal/oio-modal.vue.d.ts +230 -0
  61. package/dist/types/src/component/oio-notification/index.d.ts +116 -0
  62. package/dist/types/src/component/oio-pagination/index.d.ts +1 -0
  63. package/dist/types/src/component/oio-pagination/oio-pagination.vue.d.ts +107 -0
  64. package/dist/types/src/component/oio-popconfirm/index.d.ts +1 -0
  65. package/dist/types/src/component/oio-popconfirm/oio-popconfirm.vue.d.ts +119 -0
  66. package/dist/types/src/component/oio-select/index.d.ts +1 -0
  67. package/dist/types/src/component/oio-select/oio-select.vue.d.ts +153 -0
  68. package/dist/types/src/component/oio-slider/index.d.ts +1 -0
  69. package/dist/types/src/component/oio-slider/oio-slider.vue.d.ts +155 -0
  70. package/dist/types/src/component/oio-spin/index.d.ts +1 -0
  71. package/dist/types/src/component/oio-spin/oio-spin.vue.d.ts +54 -0
  72. package/dist/types/src/component/oio-switch/index.d.ts +1 -0
  73. package/dist/types/src/component/oio-switch/oio-switch.vue.d.ts +92 -0
  74. package/dist/types/src/component/oio-tabs/index.d.ts +3 -0
  75. package/dist/types/src/component/oio-tabs/oio-tab.vue.d.ts +67 -0
  76. package/dist/types/src/component/oio-tabs/oio-tabs.vue.d.ts +93 -0
  77. package/dist/types/src/component/oio-tabs/use-tab-bar.d.ts +5 -0
  78. package/dist/types/src/component/oio-textarea/index.d.ts +1 -0
  79. package/dist/types/src/component/oio-textarea/oio-textarea.vue.d.ts +100 -0
  80. package/dist/types/src/component/oio-tooltip/index.d.ts +2 -0
  81. package/dist/types/src/component/oio-tooltip/oio-tooltip-help.vue.d.ts +12 -0
  82. package/dist/types/src/component/oio-tooltip/oio-tooltip.vue.d.ts +76 -0
  83. package/dist/types/src/component/oio-tree/index.d.ts +1 -0
  84. package/dist/types/src/component/oio-tree/oio-tree.vue.d.ts +171 -0
  85. package/dist/types/src/component/oio-tree-select/index.d.ts +1 -0
  86. package/dist/types/src/component/oio-tree-select/oio-tree-select.vue.d.ts +226 -0
  87. package/dist/types/src/component/oio-upload/index.d.ts +1 -0
  88. package/dist/types/src/component/oio-upload/oio-upload.vue.d.ts +187 -0
  89. package/dist/types/src/index.d.ts +2 -0
  90. package/dist/types/src/theme/index.d.ts +1 -0
  91. package/dist/types/src/vc-component/index.d.ts +1 -0
  92. package/dist/types/src/vc-component/use-max-tag-placeholder.d.ts +7 -0
  93. package/index.ts +3 -0
  94. package/package.json +36 -0
  95. package/rollup.config.js +15 -0
  96. package/src/component/index.ts +32 -0
  97. package/src/component/oio-block/index.ts +3 -0
  98. package/src/component/oio-block/oio-block.vue +77 -0
  99. package/src/component/oio-block/oio-col.vue +32 -0
  100. package/src/component/oio-block/oio-row.vue +42 -0
  101. package/src/component/oio-block/style/a-col.scss +18 -0
  102. package/src/component/oio-block/style/index.scss +42 -0
  103. package/src/component/oio-block/style/parameters.scss +13 -0
  104. package/src/component/oio-breadcrumb/index.ts +2 -0
  105. package/src/component/oio-breadcrumb/oio-breadcrumb-item.vue +30 -0
  106. package/src/component/oio-breadcrumb/oio-breadcrumb.vue +30 -0
  107. package/src/component/oio-button/index.ts +1 -0
  108. package/src/component/oio-button/oio-button.vue +154 -0
  109. package/src/component/oio-button/style/a-button.scss +210 -0
  110. package/src/component/oio-button/style/index.scss +21 -0
  111. package/src/component/oio-button/style/parameters.scss +5 -0
  112. package/src/component/oio-cascader/index.ts +1 -0
  113. package/src/component/oio-cascader/oio-cascader.vue +171 -0
  114. package/src/component/oio-cascader/style/index.scss +59 -0
  115. package/src/component/oio-cascader/style/parameters.scss +5 -0
  116. package/src/component/oio-checkbox/index.ts +1 -0
  117. package/src/component/oio-checkbox/oio-checkbox.vue +69 -0
  118. package/src/component/oio-checkbox/style/index.scss +8 -0
  119. package/src/component/oio-checkbox/style/parameters.scss +5 -0
  120. package/src/component/oio-collapse/index.ts +2 -0
  121. package/src/component/oio-collapse/oio-collapse-panel.vue +92 -0
  122. package/src/component/oio-collapse/oio-collapse.vue +138 -0
  123. package/src/component/oio-collapse/style/index.scss +59 -0
  124. package/src/component/oio-collapse/style/parameters.scss +5 -0
  125. package/src/component/oio-date-time-picker/index.ts +5 -0
  126. package/src/component/oio-date-time-picker/oio-date-picker.vue +34 -0
  127. package/src/component/oio-date-time-picker/oio-date-time-picker.vue +91 -0
  128. package/src/component/oio-date-time-picker/oio-time-picker.vue +34 -0
  129. package/src/component/oio-date-time-picker/oio-year-picker.vue +34 -0
  130. package/src/component/oio-date-time-picker/style/index.scss +348 -0
  131. package/src/component/oio-date-time-picker/style/mixin.scss +16 -0
  132. package/src/component/oio-date-time-picker/style/parameters.scss +5 -0
  133. package/src/component/oio-date-time-picker/use-date-time-picker-props.ts +151 -0
  134. package/src/component/oio-date-time-range-picker/index.ts +5 -0
  135. package/src/component/oio-date-time-range-picker/oio-date-range-picker.vue +29 -0
  136. package/src/component/oio-date-time-range-picker/oio-date-time-range-picker.vue +82 -0
  137. package/src/component/oio-date-time-range-picker/oio-time-range-picker.vue +29 -0
  138. package/src/component/oio-date-time-range-picker/oio-year-range-picker.vue +29 -0
  139. package/src/component/oio-date-time-range-picker/style/index.scss +227 -0
  140. package/src/component/oio-date-time-range-picker/style/parameters.scss +5 -0
  141. package/src/component/oio-date-time-range-picker/use-date-time-range-picker-props.ts +138 -0
  142. package/src/component/oio-divider/index.ts +3 -0
  143. package/src/component/oio-divider/oio-divider.vue +31 -0
  144. package/src/component/oio-divider/style/index.scss +7 -0
  145. package/src/component/oio-divider/style/parameters.scss +5 -0
  146. package/src/component/oio-drawer/index.ts +1 -0
  147. package/src/component/oio-drawer/oio-drawer.vue +120 -0
  148. package/src/component/oio-drawer/style/index.scss +93 -0
  149. package/src/component/oio-drawer/style/parameters.scss +5 -0
  150. package/src/component/oio-dropdown/index.ts +1 -0
  151. package/src/component/oio-dropdown/oio-dropdown.vue +81 -0
  152. package/src/component/oio-dropdown/style/index.scss +30 -0
  153. package/src/component/oio-dropdown/style/parameters.scss +5 -0
  154. package/src/component/oio-empty/index.ts +1 -0
  155. package/src/component/oio-empty/oio-empty-data.vue +47 -0
  156. package/src/component/oio-empty/style/index.scss +6 -0
  157. package/src/component/oio-form/index.ts +2 -0
  158. package/src/component/oio-form/oio-form-item.vue +81 -0
  159. package/src/component/oio-form/oio-form.vue +102 -0
  160. package/src/component/oio-form/style/animation.scss +17 -0
  161. package/src/component/oio-form/style/index.scss +135 -0
  162. package/src/component/oio-form/style/parameters.scss +9 -0
  163. package/src/component/oio-gallery/index.ts +1 -0
  164. package/src/component/oio-gallery/oio-gallery.vue +158 -0
  165. package/src/component/oio-group/index.ts +2 -0
  166. package/src/component/oio-group/oio-group-help.vue +28 -0
  167. package/src/component/oio-group/oio-group.vue +140 -0
  168. package/src/component/oio-group/style/index.scss +98 -0
  169. package/src/component/oio-group/style/parameters.scss +5 -0
  170. package/src/component/oio-inner-popup/index.ts +1 -0
  171. package/src/component/oio-inner-popup/oio-inner-popup.vue +230 -0
  172. package/src/component/oio-inner-popup/style/index.scss +147 -0
  173. package/src/component/oio-inner-popup/style/parameters.scss +5 -0
  174. package/src/component/oio-input/index.ts +5 -0
  175. package/src/component/oio-input/oio-input-group.vue +40 -0
  176. package/src/component/oio-input/oio-input-number.vue +374 -0
  177. package/src/component/oio-input/oio-input-password.vue +67 -0
  178. package/src/component/oio-input/oio-input-search.vue +107 -0
  179. package/src/component/oio-input/oio-input.vue +124 -0
  180. package/src/component/oio-input/style/a-input.scss +103 -0
  181. package/src/component/oio-input/style/index.scss +198 -0
  182. package/src/component/oio-input/style/mixin.scss +50 -0
  183. package/src/component/oio-input/style/oio-input-group.scss +31 -0
  184. package/src/component/oio-input/style/oio-input-number.scss +13 -0
  185. package/src/component/oio-input/style/oio-input-search.scss +94 -0
  186. package/src/component/oio-input/style/parameters.scss +21 -0
  187. package/src/component/oio-modal/index.ts +1 -0
  188. package/src/component/oio-modal/index.zh-CN.md +167 -0
  189. package/src/component/oio-modal/oio-modal.vue +184 -0
  190. package/src/component/oio-modal/style/index.scss +167 -0
  191. package/src/component/oio-modal/style/parameters.scss +5 -0
  192. package/src/component/oio-notification/index.ts +197 -0
  193. package/src/component/oio-notification/style/index.scss +67 -0
  194. package/src/component/oio-notification/style/parameters.scss +5 -0
  195. package/src/component/oio-pagination/index.ts +1 -0
  196. package/src/component/oio-pagination/oio-pagination.vue +105 -0
  197. package/src/component/oio-pagination/style/index.scss +181 -0
  198. package/src/component/oio-pagination/style/parameters.scss +5 -0
  199. package/src/component/oio-popconfirm/index.ts +1 -0
  200. package/src/component/oio-popconfirm/oio-popconfirm.vue +192 -0
  201. package/src/component/oio-popconfirm/style/index.scss +54 -0
  202. package/src/component/oio-popconfirm/style/parameters.scss +5 -0
  203. package/src/component/oio-popover/style/index.scss +16 -0
  204. package/src/component/oio-popover/style/parameters.scss +5 -0
  205. package/src/component/oio-radio/style/index.scss +24 -0
  206. package/src/component/oio-radio/style/parameters.scss +5 -0
  207. package/src/component/oio-select/index.ts +1 -0
  208. package/src/component/oio-select/oio-select.vue +104 -0
  209. package/src/component/oio-select/style/a-select.scss +102 -0
  210. package/src/component/oio-select/style/index.scss +129 -0
  211. package/src/component/oio-select/style/mixin.scss +18 -0
  212. package/src/component/oio-select/style/parameters.scss +5 -0
  213. package/src/component/oio-slider/index.ts +1 -0
  214. package/src/component/oio-slider/oio-slider.vue +81 -0
  215. package/src/component/oio-slider/style/index.scss +100 -0
  216. package/src/component/oio-slider/style/parameters.scss +5 -0
  217. package/src/component/oio-spin/index.ts +1 -0
  218. package/src/component/oio-spin/oio-spin.vue +87 -0
  219. package/src/component/oio-spin/style/index.scss +48 -0
  220. package/src/component/oio-spin/style/parameters.scss +5 -0
  221. package/src/component/oio-switch/index.ts +1 -0
  222. package/src/component/oio-switch/oio-switch.vue +42 -0
  223. package/src/component/oio-switch/style/index.scss +36 -0
  224. package/src/component/oio-switch/style/parameters.scss +5 -0
  225. package/src/component/oio-tabs/index.ts +3 -0
  226. package/src/component/oio-tabs/oio-tab.vue +99 -0
  227. package/src/component/oio-tabs/oio-tabs.vue +188 -0
  228. package/src/component/oio-tabs/style/index.scss +274 -0
  229. package/src/component/oio-tabs/style/parameters.scss +9 -0
  230. package/src/component/oio-tabs/use-tab-bar.ts +69 -0
  231. package/src/component/oio-textarea/index.ts +1 -0
  232. package/src/component/oio-textarea/oio-textarea.vue +76 -0
  233. package/src/component/oio-textarea/style/index.scss +108 -0
  234. package/src/component/oio-textarea/style/parameters.scss +5 -0
  235. package/src/component/oio-tooltip/index.ts +2 -0
  236. package/src/component/oio-tooltip/oio-tooltip-help.vue +40 -0
  237. package/src/component/oio-tooltip/oio-tooltip.vue +59 -0
  238. package/src/component/oio-tooltip/style/index.scss +8 -0
  239. package/src/component/oio-tooltip/style/parameters.scss +9 -0
  240. package/src/component/oio-tree/index.ts +1 -0
  241. package/src/component/oio-tree/oio-tree.vue +181 -0
  242. package/src/component/oio-tree/style/index.scss +51 -0
  243. package/src/component/oio-tree/style/parameters.scss +5 -0
  244. package/src/component/oio-tree-select/index.ts +1 -0
  245. package/src/component/oio-tree-select/oio-tree-select.vue +180 -0
  246. package/src/component/oio-tree-select/style/index.scss +92 -0
  247. package/src/component/oio-tree-select/style/parameters.scss +5 -0
  248. package/src/component/oio-upload/index.ts +1 -0
  249. package/src/component/oio-upload/oio-upload.vue +232 -0
  250. package/src/component/oio-upload/style/index.scss +66 -0
  251. package/src/component/oio-upload/style/parameters.scss +5 -0
  252. package/src/index.ts +3 -0
  253. package/src/shim-translate.d.ts +7 -0
  254. package/src/shim-vue.d.ts +6 -0
  255. package/src/style/global-parameters.scss +9 -0
  256. package/src/style/index.scss +31 -0
  257. package/src/style/mixin.scss +135 -0
  258. package/src/theme/index.ts +1 -0
  259. package/src/vc-component/index.ts +1 -0
  260. package/src/vc-component/use-max-tag-placeholder.ts +38 -0
@@ -0,0 +1,154 @@
1
+ <script lang="ts">
2
+ import {
3
+ ButtonBizStyle,
4
+ ButtonType,
5
+ IconPlacement,
6
+ OioButtonProps,
7
+ OioIcon,
8
+ PropRecordHelper
9
+ } from '@oinone/kunlun-vue-ui-common';
10
+ import { Button as AButton } from 'ant-design-vue';
11
+ import { isEmpty } from 'lodash-es';
12
+ import { computed, createVNode, defineComponent, nextTick, reactive, VNode } from 'vue';
13
+ import { DEFAULT_PREFIX } from '../../theme';
14
+
15
+ interface State {
16
+ loading: boolean;
17
+ }
18
+
19
+ function isChildrenEmpty(children: VNode[]): boolean {
20
+ if (children.length === 0) {
21
+ return true;
22
+ }
23
+ if (children.length === 1) {
24
+ const textVNode = children[0];
25
+ if (textVNode.type.toString() === 'Symbol(Text)') {
26
+ return isEmpty(textVNode.children);
27
+ }
28
+ }
29
+ return false;
30
+ }
31
+
32
+ export default defineComponent({
33
+ name: 'OioButton',
34
+ components: {
35
+ AButton,
36
+ OioIcon
37
+ },
38
+ inheritAttrs: false,
39
+ props: {
40
+ ...OioButtonProps
41
+ },
42
+ slots: ['default', 'icon', 'update:loading', 'update:selected'],
43
+ setup(props, context) {
44
+ const state = reactive<State>({
45
+ loading: false
46
+ });
47
+
48
+ const internalLoading = computed<boolean>({
49
+ get: () => {
50
+ const currentLoading = props.loading;
51
+ if (currentLoading == null) {
52
+ return state.loading;
53
+ }
54
+ return currentLoading;
55
+ },
56
+ set: (val: boolean) => {
57
+ state.loading = val;
58
+ context.emit('update:loading', val);
59
+ }
60
+ });
61
+
62
+ const onClick = (...args) => {
63
+ const fn = context.attrs.onClick as Function;
64
+ if (!fn) {
65
+ return;
66
+ }
67
+ if (props.async) {
68
+ internalLoading.value = true;
69
+ nextTick(() => fn?.(...args)).finally(() => {
70
+ internalLoading.value = false;
71
+ });
72
+ } else {
73
+ fn?.(...args);
74
+ }
75
+ if (props.selected != null) {
76
+ context.emit('update:selected', !props.selected);
77
+ }
78
+ };
79
+
80
+ const bizStyle = computed(() => {
81
+ if (props.disabled || props.bizStyle === ButtonBizStyle.default) {
82
+ return undefined;
83
+ }
84
+ return props.bizStyle;
85
+ });
86
+
87
+ return {
88
+ state,
89
+ internalLoading,
90
+ bizStyle,
91
+ onClick
92
+ };
93
+ },
94
+ render() {
95
+ const { type, htmlType, block, href, target, internalLoading, disabled, onClick, selected } = this;
96
+ const slots = PropRecordHelper.collectionSlots(this.$slots, [
97
+ {
98
+ origin: 'default',
99
+ isNotNull: true
100
+ },
101
+ 'icon'
102
+ ]);
103
+ if (!slots.icon && this.icon) {
104
+ slots.icon = () => [createVNode(OioIcon, { icon: this.icon })];
105
+ }
106
+ const buttonClassList = [`${DEFAULT_PREFIX}-button`, `${DEFAULT_PREFIX}-button-${this.type}`];
107
+ if (this.bizStyle) {
108
+ buttonClassList.push(`${DEFAULT_PREFIX}-button-biz-type-${this.bizStyle}`);
109
+ }
110
+ if (type === ButtonType.link && selected != null) {
111
+ if (selected) {
112
+ buttonClassList.push(`${DEFAULT_PREFIX}-button-selected`);
113
+ }
114
+ }
115
+ let children = slots.default?.() || [];
116
+ if (slots.icon) {
117
+ if (isChildrenEmpty(children)) {
118
+ buttonClassList.push(`${DEFAULT_PREFIX}-button-icon-only`);
119
+ } else {
120
+ buttonClassList.push(`${DEFAULT_PREFIX}-button-icon-${this.iconPlacement}`);
121
+ }
122
+ switch (this.iconPlacement) {
123
+ case IconPlacement.BEFORE:
124
+ children = [...slots.icon(), ...children];
125
+ break;
126
+ case IconPlacement.AFTER:
127
+ children = [...children, ...slots.icon()];
128
+ break;
129
+ default:
130
+ break;
131
+ }
132
+ }
133
+ if (href) {
134
+ buttonClassList.push(`${DEFAULT_PREFIX}-button-href-button`);
135
+ children.push(createVNode('a', { href, target }));
136
+ }
137
+ return createVNode(
138
+ AButton,
139
+ {
140
+ type,
141
+ block,
142
+ loading: internalLoading,
143
+ disabled,
144
+ htmlType,
145
+ ...PropRecordHelper.collectionBasicProps(this.$attrs, buttonClassList),
146
+ onClick
147
+ },
148
+ {
149
+ default: () => children
150
+ }
151
+ );
152
+ }
153
+ });
154
+ </script>
@@ -0,0 +1,210 @@
1
+ @import './parameters.scss';
2
+ @import '../../../style/mixin.scss';
3
+
4
+ @mixin event-style($prefix: $buttonParameterPrefix) {
5
+ &:active {
6
+ @include oio-active($prefix);
7
+ }
8
+
9
+ &:hover {
10
+ @include oio-hover($prefix);
11
+ }
12
+
13
+ &:focus {
14
+ @include oio-focus($prefix);
15
+ }
16
+
17
+ &:visited {
18
+ @include oio-visited($prefix);
19
+ }
20
+ }
21
+
22
+ @mixin biz-type-style($prefix: $buttonParameterPrefix) {
23
+ $dangerPrefix: $prefix + -danger;
24
+
25
+ &.#{$buttonClassPrefix}-biz-type-danger {
26
+ @include oio-appearance($dangerPrefix);
27
+ @include event-style($dangerPrefix);
28
+ }
29
+
30
+ $infoPrefix: $prefix + -info;
31
+
32
+ &.#{$buttonClassPrefix}-biz-type-info {
33
+ @include oio-appearance($infoPrefix);
34
+ @include event-style($infoPrefix);
35
+ }
36
+
37
+ $warningPrefix: $prefix + -warning;
38
+
39
+ &.#{$buttonClassPrefix}-biz-type-warning {
40
+ @include oio-appearance($warningPrefix);
41
+ @include event-style($warningPrefix);
42
+ }
43
+
44
+ $successPrefix: $prefix + -success;
45
+
46
+ &.#{$buttonClassPrefix}-biz-type-success {
47
+ @include oio-appearance($successPrefix);
48
+ @include event-style($successPrefix);
49
+ }
50
+ }
51
+
52
+ &.ant-btn {
53
+ height: var($parameterPrefix + -height);
54
+ padding: 0 var($parameterPrefix + -padding-md);
55
+ line-height: var($parameterPrefix + -line-height);
56
+
57
+ & > span {
58
+ font-size: var($parameterPrefix + -font-size);
59
+ line-height: var($parameterPrefix + -line-height);
60
+ font-weight: var($parameterPrefix + -font-weight);
61
+ vertical-align: top;
62
+ }
63
+
64
+ .#{$iconClassPrefix} {
65
+ font-size: var($parameterPrefix + -font-size);
66
+ }
67
+
68
+ &.#{$buttonClassPrefix}-icon-before {
69
+ .#{$iconClassPrefix} {
70
+ margin-right: 8px;
71
+ }
72
+ }
73
+
74
+ &.#{$buttonClassPrefix}-icon-after {
75
+ .#{$iconClassPrefix} {
76
+ margin-left: 8px;
77
+ }
78
+ }
79
+
80
+ &.ant-btn-two-chinese-chars > :not(.anticon) {
81
+ letter-spacing: 4px;
82
+ margin-right: -4px;
83
+ }
84
+
85
+ &[disabled] {
86
+ @include oio-disabled(true);
87
+
88
+ &:active {
89
+ @include oio-disabled(true);
90
+ }
91
+
92
+ &:hover {
93
+ @include oio-disabled(true);
94
+ }
95
+
96
+ &:focus {
97
+ @include oio-disabled(true);
98
+ }
99
+
100
+ .oio-icon {
101
+ color: var($parameterPrefix + -disabled-color);
102
+ }
103
+ }
104
+
105
+ &:empty {
106
+ visibility: unset;
107
+ vertical-align: top;
108
+ width: 66px;
109
+ }
110
+
111
+ &.#{$buttonClassPrefix}-href-button:not([disabled]) {
112
+ position: relative;
113
+ pointer-events: none;
114
+
115
+ & > a {
116
+ position: absolute;
117
+ top: 0;
118
+ left: 0;
119
+ width: 100%;
120
+ height: 100%;
121
+ pointer-events: all;
122
+ }
123
+ }
124
+ }
125
+
126
+ $defaultParameterPrefix: $buttonParameterPrefix;
127
+
128
+ &.ant-btn,
129
+ &.ant-btn-default {
130
+ @include oio-appearance($defaultParameterPrefix);
131
+ @include event-style($defaultParameterPrefix);
132
+ @include biz-type-style($defaultParameterPrefix + -default);
133
+ }
134
+
135
+ $dashedParameterPrefix: $buttonParameterPrefix + -dashed;
136
+
137
+ &.ant-btn-dashed {
138
+ @include oio-appearance($dashedParameterPrefix);
139
+ @include event-style($dashedParameterPrefix);
140
+ @include biz-type-style($dashedParameterPrefix);
141
+ }
142
+
143
+ $primaryParameterPrefix: $buttonParameterPrefix + -primary;
144
+
145
+ &.ant-btn-primary {
146
+ @include oio-appearance($primaryParameterPrefix);
147
+ @include event-style($primaryParameterPrefix);
148
+ @include biz-type-style($primaryParameterPrefix);
149
+
150
+ .oio-icon {
151
+ color: #ffffff;
152
+ }
153
+ }
154
+
155
+ $linkParameterPrefix: $buttonParameterPrefix + -link;
156
+
157
+ &.ant-btn-link {
158
+ @include oio-appearance($linkParameterPrefix);
159
+ @include event-style($linkParameterPrefix);
160
+ @include biz-type-style($linkParameterPrefix);
161
+
162
+ height: var($parameterPrefix + -line-height);
163
+ line-height: var($parameterPrefix + -line-height);
164
+ padding: 0;
165
+
166
+ &.#{$buttonClassPrefix}-icon-before {
167
+ .#{$iconClassPrefix} {
168
+ margin-right: 4px;
169
+ }
170
+ }
171
+
172
+ &.#{$buttonClassPrefix}-icon-after {
173
+ .#{$iconClassPrefix} {
174
+ margin-left: 4px;
175
+ }
176
+ }
177
+
178
+ &.#{$buttonClassPrefix}-icon-only {
179
+ background-color: transparent;
180
+
181
+ &:active,
182
+ &:hover,
183
+ &:focus,
184
+ &:visited {
185
+ background-color: transparent;
186
+ }
187
+ }
188
+
189
+ &[disabled] {
190
+ background-color: transparent;
191
+
192
+ &:active {
193
+ background-color: transparent;
194
+ }
195
+
196
+ &:hover {
197
+ background-color: transparent;
198
+ }
199
+
200
+ &:focus {
201
+ background-color: transparent;
202
+ }
203
+
204
+ &.#{$buttonClassPrefix}-icon-only {
205
+ .oio-icon {
206
+ color: var($parameterPrefix + -disabled-color);
207
+ }
208
+ }
209
+ }
210
+ }
@@ -0,0 +1,21 @@
1
+ @import './parameters.scss';
2
+
3
+ .#{$buttonClassPrefix} {
4
+ @import './a-button.scss';
5
+
6
+ &.#{$buttonClassPrefix}-link.#{$buttonClassPrefix}-selected {
7
+ background-color: rgba(var($parameterPrefix + -primary-color-rgb), 0.1);
8
+ border-radius: 4px;
9
+
10
+ &:active,
11
+ &:hover,
12
+ &:focus,
13
+ &:visited {
14
+ background-color: rgba(var($parameterPrefix + -primary-color-rgb), 0.1);
15
+ }
16
+
17
+ .oio-icon {
18
+ color: var($parameterPrefix + -primary-color-active);
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,5 @@
1
+ @import '../../../style/global-parameters.scss';
2
+
3
+ $buttonPrefix: $prefix + -button;
4
+ $buttonParameterPrefix: $parameterPrefix + -button;
5
+ $buttonClassPrefix: $buttonPrefix;
@@ -0,0 +1 @@
1
+ export { default as OioCascader } from './oio-cascader.vue';
@@ -0,0 +1,171 @@
1
+ <script lang="ts">
2
+ import { CastHelper, StringHelper } from '@oinone/kunlun-shared';
3
+ import {
4
+ CascaderDisplayRenderFunction,
5
+ CascaderItem,
6
+ CascaderProperties,
7
+ defaultCascaderProperties,
8
+ defaultLabelsSeparator,
9
+ fillCascaderItemsProperties,
10
+ OioCascaderProps,
11
+ PropRecordHelper,
12
+ SelectMode
13
+ } from '@oinone/kunlun-vue-ui-common';
14
+ import { Cascader as ACascader, Popover as APopover } from 'ant-design-vue';
15
+ import { computed, createVNode, defineComponent } from 'vue';
16
+ import { DEFAULT_PREFIX } from '../../theme';
17
+ import { useMaxTagPlaceholder } from '../../vc-component';
18
+ import { OioEmptyData } from '../oio-empty';
19
+
20
+ export default defineComponent({
21
+ name: 'OioCascader',
22
+ components: {
23
+ ACascader,
24
+ APopover
25
+ },
26
+ inheritAttrs: false,
27
+ props: {
28
+ ...OioCascaderProps
29
+ },
30
+ emits: ['update:value', 'change', 'search'],
31
+ setup(props, context) {
32
+ const internalProperties = computed<CascaderProperties>(() => {
33
+ return {
34
+ ...defaultCascaderProperties,
35
+ ...(props.properties || {})
36
+ };
37
+ });
38
+
39
+ const internalOptions = computed<CascaderItem[]>(() => {
40
+ const options = props.options || [];
41
+ if (props.mappingOptions) {
42
+ return fillCascaderItemsProperties(options, internalProperties.value, props.customFillProperties) || [];
43
+ }
44
+ return CastHelper.cast(options);
45
+ });
46
+
47
+ const multiple = computed(() => {
48
+ return props.mode === SelectMode.multiple;
49
+ });
50
+
51
+ const defaultDisplayRender: CascaderDisplayRenderFunction = ({ labels }) => {
52
+ if (multiple.value) {
53
+ return labels[labels.length - 1];
54
+ }
55
+ return labels.join(props.labelsSeparator || defaultLabelsSeparator);
56
+ };
57
+
58
+ const onUpdateValue = (values: string[] | string[][]) => {
59
+ context.emit('update:value', values);
60
+ };
61
+
62
+ const onChange = (values: string[] | string[][], selectedOptions: CascaderItem[] | CascaderItem[][]) => {
63
+ context.emit('change', values, selectedOptions);
64
+ };
65
+
66
+ const onSearch = (val) => {
67
+ context.emit('search', val);
68
+ };
69
+
70
+ return {
71
+ internalProperties,
72
+ internalOptions,
73
+ multiple,
74
+
75
+ defaultDisplayRender,
76
+ ...useMaxTagPlaceholder(),
77
+
78
+ onUpdateValue,
79
+ onChange,
80
+ onSearch
81
+ };
82
+ },
83
+ render() {
84
+ const {
85
+ value,
86
+ options,
87
+ filterOption,
88
+ mappingOptions,
89
+ autofocus,
90
+ placeholder,
91
+ allowClear,
92
+ readonly,
93
+ disabled,
94
+ searchValue,
95
+ enableSearch,
96
+ dropdownClassName,
97
+ getTriggerContainer,
98
+ changeOnSelect,
99
+ multipleCheckedStrategy,
100
+
101
+ loading,
102
+ loadData,
103
+
104
+ internalOptions,
105
+ multiple,
106
+
107
+ displayRender,
108
+ tagRender,
109
+ maxTagCount,
110
+ maxTagPlaceholder,
111
+ defaultDisplayRender,
112
+ defaultMaxTagPlaceholder,
113
+
114
+ onUpdateValue,
115
+ onChange,
116
+ onSearch
117
+ } = this;
118
+
119
+ const classNames = [`${DEFAULT_PREFIX}-select`, `${DEFAULT_PREFIX}-cascader`];
120
+ const dropdownClassNames = [`${DEFAULT_PREFIX}-select-dropdown`, `${DEFAULT_PREFIX}-cascader-dropdown`];
121
+ if (readonly) {
122
+ classNames.push(`${DEFAULT_PREFIX}-select-readonly`);
123
+ }
124
+ if (disabled) {
125
+ classNames.push(`${DEFAULT_PREFIX}-select-disabled`);
126
+ }
127
+ if (multiple) {
128
+ classNames.push(`${DEFAULT_PREFIX}-select-multiple`);
129
+ dropdownClassNames.push(`${DEFAULT_PREFIX}-select-dropdown-multiple`);
130
+ }
131
+
132
+ const children = {};
133
+
134
+ let showSearch: boolean | { filter: Function } | undefined = enableSearch;
135
+ if (showSearch && filterOption) {
136
+ showSearch = { filter: filterOption };
137
+ }
138
+
139
+ return createVNode(
140
+ ACascader,
141
+ {
142
+ autofocus,
143
+ placeholder,
144
+ allowClear,
145
+ disabled: readonly || disabled,
146
+ dropdownClassName: StringHelper.append(dropdownClassNames, dropdownClassName).join(' '),
147
+ getPopupContainer: getTriggerContainer,
148
+ changeOnSelect,
149
+ value,
150
+ searchValue,
151
+ showSearch,
152
+ options: mappingOptions ? internalOptions : options,
153
+ multiple,
154
+ showCheckedStrategy: multipleCheckedStrategy,
155
+ loading,
156
+ loadData,
157
+ displayRender: displayRender || defaultDisplayRender,
158
+ tagRender,
159
+ maxTagCount,
160
+ maxTagPlaceholder: maxTagPlaceholder || defaultMaxTagPlaceholder,
161
+ notFoundContent: createVNode(OioEmptyData, { loading }),
162
+ ...PropRecordHelper.collectionBasicProps(this.$attrs, classNames),
163
+ 'onUpdate:value': onUpdateValue,
164
+ onChange,
165
+ onSearch
166
+ },
167
+ children
168
+ );
169
+ }
170
+ });
171
+ </script>
@@ -0,0 +1,59 @@
1
+ @import './parameters.scss';
2
+
3
+ .#{$cascaderClassPrefix}-dropdown {
4
+ .ant-cascader-menus {
5
+ .ant-cascader-menu-item-expand-icon,
6
+ .ant-cascader-menu-item-loading-icon {
7
+ color: var(--oio-icon-color);
8
+ }
9
+
10
+ .ant-cascader-menu {
11
+ border-color: var(--oio-border-color);
12
+ }
13
+
14
+ .ant-cascader-menu-item {
15
+ font-size: var($parameterPrefix + -font-size);
16
+ color: var(--oio-text-color);
17
+
18
+ &:hover {
19
+ background-color: rgba(var($parameterPrefix + -primary-color-rgb), 0.1);
20
+ }
21
+
22
+ .ant-cascader-checkbox-checked .ant-cascader-checkbox-inner {
23
+ background-color: var($parameterPrefix + -primary-color);
24
+ border-color: var($parameterPrefix + -primary-color);
25
+ }
26
+
27
+ .ant-cascader-checkbox-indeterminate .ant-cascader-checkbox-inner:after {
28
+ background-color: var($parameterPrefix + -primary-color);
29
+ }
30
+
31
+ .ant-cascader-checkbox-input:focus + .ant-cascader-checkbox-inner,
32
+ .ant-cascader-checkbox-wrapper:hover .ant-cascader-checkbox-inner,
33
+ .ant-cascader-checkbox:hover .ant-cascader-checkbox-inner {
34
+ border-color: var($parameterPrefix + -primary-color);
35
+ }
36
+ }
37
+
38
+ .ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled),
39
+ .ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled):hover {
40
+ background-color: rgba(var($parameterPrefix + -primary-color-rgb), 0.1);
41
+
42
+ .ant-cascader-menu-item-content {
43
+ color: var($parameterPrefix + -primary-color);
44
+ }
45
+ }
46
+ }
47
+
48
+ &:not(.#{$classPrefix}-select-dropdown-multiple) {
49
+ .ant-cascader-menus {
50
+ .ant-cascader-menu-item-active:not(.ant-cascader-menu-item-expand) {
51
+ &:after {
52
+ content: '✓';
53
+ color: var($parameterPrefix + -primary-color);
54
+ font-weight: 500;
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,5 @@
1
+ @import '../../../style/global-parameters.scss';
2
+
3
+ $cascaderPrefix: $prefix + -cascader;
4
+ $cascaderParameterPrefix: $parameterPrefix + -cascader;
5
+ $cascaderClassPrefix: $cascaderPrefix;
@@ -0,0 +1 @@
1
+ export { default as OioCheckbox } from './oio-checkbox.vue';
@@ -0,0 +1,69 @@
1
+ <script lang="ts">
2
+ import { OioCheckboxProps, PropRecordHelper } from '@oinone/kunlun-vue-ui-common';
3
+ import { Checkbox as ACheckbox } from 'ant-design-vue';
4
+ import { computed, createVNode, defineComponent, ref } from 'vue';
5
+ import { DEFAULT_PREFIX } from '../../theme';
6
+
7
+ export default defineComponent({
8
+ name: 'OioCheckbox',
9
+ components: {
10
+ ACheckbox
11
+ },
12
+ inheritAttrs: false,
13
+ props: {
14
+ ...OioCheckboxProps
15
+ },
16
+ emits: ['update:checked', 'change'],
17
+ slots: ['default'],
18
+ setup(props, context) {
19
+ const internalChecked = ref(false);
20
+ const checked = computed<boolean>({
21
+ get() {
22
+ if (props.checked === undefined) {
23
+ return internalChecked.value;
24
+ }
25
+ if (props.checked === null) {
26
+ return false;
27
+ }
28
+ return props.checked;
29
+ },
30
+ set(value) {
31
+ if (props.readonly) {
32
+ return;
33
+ }
34
+ context.emit('update:checked', value);
35
+ context.emit('change', value);
36
+ internalChecked.value = value;
37
+ }
38
+ });
39
+
40
+ const onUpdateChecked = (val: boolean) => {
41
+ checked.value = val;
42
+ };
43
+
44
+ return {
45
+ checked,
46
+ onUpdateChecked
47
+ };
48
+ },
49
+ render() {
50
+ const { onUpdateChecked, onChange } = this;
51
+ const checkboxClassList = [`${DEFAULT_PREFIX}-checkbox`];
52
+ if (this.readonly) {
53
+ checkboxClassList.push(`${DEFAULT_PREFIX}-checkbox-readonly`);
54
+ }
55
+ return createVNode(
56
+ ACheckbox,
57
+ {
58
+ autofocus: this.autofocus,
59
+ indeterminate: this.indeterminate,
60
+ checked: this.checked,
61
+ disabled: this.disabled,
62
+ ...PropRecordHelper.collectionBasicProps(this.$attrs, checkboxClassList),
63
+ 'onUpdate:checked': onUpdateChecked
64
+ },
65
+ PropRecordHelper.collectionSlots(this.$slots, ['default'])
66
+ );
67
+ }
68
+ });
69
+ </script>
@@ -0,0 +1,8 @@
1
+ @import './parameters.scss';
2
+
3
+ .#{$checkboxClassPrefix} {
4
+ .ant-checkbox-inner {
5
+ background-color: var(--oio-background);
6
+ border: 1px solid var(--oio-border-color);
7
+ }
8
+ }