vxe-table 3.6.0-beta.1 → 3.6.0-beta.10

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 (126) hide show
  1. package/helper/vetur/attributes.json +17 -5
  2. package/helper/vetur/tags.json +10 -2
  3. package/lib/button/style/style.css +14 -5
  4. package/lib/button/style/style.min.css +1 -1
  5. package/lib/checkbox/src/checkbox.js +22 -9
  6. package/lib/checkbox/src/checkbox.min.js +1 -1
  7. package/lib/checkbox/src/group.js +13 -0
  8. package/lib/checkbox/src/group.min.js +1 -1
  9. package/lib/checkbox/style/style.css +37 -60
  10. package/lib/checkbox/style/style.min.css +1 -1
  11. package/lib/export/src/export-panel.js +10 -16
  12. package/lib/export/src/export-panel.min.js +1 -1
  13. package/lib/export/style/style.css +23 -92
  14. package/lib/export/style/style.min.css +1 -1
  15. package/lib/filter/src/panel.js +11 -15
  16. package/lib/filter/src/panel.min.js +1 -1
  17. package/lib/filter/style/style.css +24 -90
  18. package/lib/filter/style/style.min.css +1 -1
  19. package/lib/form/src/form.js +1 -1
  20. package/lib/form/src/form.min.js +1 -1
  21. package/lib/grid/style/style.css +1 -1
  22. package/lib/grid/style/style.min.css +1 -1
  23. package/lib/icon/index.js +10 -4
  24. package/lib/icon/index.min.js +1 -1
  25. package/lib/icon/src/icon.js +29 -0
  26. package/lib/icon/src/icon.min.js +1 -0
  27. package/lib/icon/style/style.css +103 -27
  28. package/lib/icon/style/style.min.css +1 -1
  29. package/lib/index.css +1 -1
  30. package/lib/index.umd.js +209 -113
  31. package/lib/index.umd.min.js +1 -1
  32. package/lib/input/style/style.css +6 -6
  33. package/lib/input/style/style.min.css +1 -1
  34. package/lib/list/src/list.js +1 -1
  35. package/lib/list/src/list.min.js +1 -1
  36. package/lib/loading/src/loading.js +19 -9
  37. package/lib/loading/src/loading.min.js +1 -1
  38. package/lib/locale/lang/en-US.js +1 -1
  39. package/lib/locale/lang/en-US.min.js +1 -1
  40. package/lib/locale/lang/en-US.umd.js +1 -1
  41. package/lib/locale/lang/ja-JP.js +1 -1
  42. package/lib/locale/lang/ja-JP.min.js +1 -1
  43. package/lib/locale/lang/ja-JP.umd.js +1 -1
  44. package/lib/locale/lang/zh-CN.js +1 -1
  45. package/lib/locale/lang/zh-CN.min.js +1 -1
  46. package/lib/locale/lang/zh-CN.umd.js +1 -1
  47. package/lib/locale/lang/zh-HK.min.js +1 -1
  48. package/lib/locale/lang/zh-HK.umd.js +1 -1
  49. package/lib/locale/lang/zh-MO.min.js +1 -1
  50. package/lib/locale/lang/zh-MO.umd.js +1 -1
  51. package/lib/locale/lang/zh-TC.js +1 -1
  52. package/lib/locale/lang/zh-TC.min.js +1 -1
  53. package/lib/locale/lang/zh-TC.umd.js +1 -1
  54. package/lib/locale/lang/zh-TW.min.js +1 -1
  55. package/lib/locale/lang/zh-TW.umd.js +1 -1
  56. package/lib/modal/src/modal.js +13 -6
  57. package/lib/modal/src/modal.min.js +1 -1
  58. package/lib/modal/style/style.css +22 -13
  59. package/lib/modal/style/style.min.css +1 -1
  60. package/lib/pager/style/style.css +1 -1
  61. package/lib/pager/style/style.min.css +1 -1
  62. package/lib/radio/src/radio.js +7 -5
  63. package/lib/radio/src/radio.min.js +1 -1
  64. package/lib/radio/style/style.css +32 -57
  65. package/lib/radio/style/style.min.css +1 -1
  66. package/lib/select/src/select.js +32 -3
  67. package/lib/select/src/select.min.js +1 -1
  68. package/lib/style.css +1 -1
  69. package/lib/style.min.css +1 -1
  70. package/lib/table/src/body.js +15 -7
  71. package/lib/table/src/body.min.js +1 -1
  72. package/lib/table/src/cell.js +4 -18
  73. package/lib/table/src/cell.min.js +1 -1
  74. package/lib/table/src/table.js +10 -2
  75. package/lib/table/src/table.min.js +1 -1
  76. package/lib/table/style/style.css +66 -143
  77. package/lib/table/style/style.min.css +1 -1
  78. package/lib/toolbar/src/toolbar.js +10 -14
  79. package/lib/toolbar/src/toolbar.min.js +1 -1
  80. package/lib/toolbar/style/style.css +24 -86
  81. package/lib/toolbar/style/style.min.css +1 -1
  82. package/lib/tools/log.js +1 -1
  83. package/lib/tools/log.min.js +1 -1
  84. package/lib/v-x-e-table/index.js +1 -1
  85. package/lib/v-x-e-table/index.min.js +1 -1
  86. package/lib/v-x-e-table/src/conf.js +5 -0
  87. package/lib/v-x-e-table/src/conf.min.js +1 -1
  88. package/lib/v-x-e-table/style/style.css +105 -29
  89. package/lib/v-x-e-table/style/style.min.css +1 -1
  90. package/package.json +4 -4
  91. package/packages/checkbox/src/checkbox.js +19 -5
  92. package/packages/checkbox/src/group.js +9 -0
  93. package/packages/export/src/export-panel.js +9 -19
  94. package/packages/filter/src/panel.js +9 -17
  95. package/packages/form/src/form.js +1 -1
  96. package/packages/icon/index.js +7 -4
  97. package/packages/icon/src/icon.js +20 -0
  98. package/packages/list/src/list.js +1 -1
  99. package/packages/loading/src/loading.js +18 -9
  100. package/packages/locale/lang/en-US.js +1 -1
  101. package/packages/locale/lang/ja-JP.js +1 -1
  102. package/packages/locale/lang/zh-CN.js +1 -1
  103. package/packages/locale/lang/zh-TC.js +1 -1
  104. package/packages/modal/src/modal.js +30 -22
  105. package/packages/radio/src/radio.js +7 -3
  106. package/packages/select/src/select.js +25 -3
  107. package/packages/table/src/body.js +14 -7
  108. package/packages/table/src/cell.js +4 -25
  109. package/packages/table/src/table.js +10 -2
  110. package/packages/toolbar/src/toolbar.js +10 -18
  111. package/packages/v-x-e-table/src/conf.js +5 -0
  112. package/styles/base/checked.scss +44 -148
  113. package/styles/button.scss +4 -2
  114. package/styles/checkbox.scss +6 -65
  115. package/styles/export.scss +2 -38
  116. package/styles/filter.scss +3 -36
  117. package/styles/icon.scss +136 -37
  118. package/styles/input.scss +1 -1
  119. package/styles/loading.scss +2 -2
  120. package/styles/modal.scss +19 -16
  121. package/styles/old-icon.scss +713 -0
  122. package/styles/radio.scss +9 -77
  123. package/styles/table.scss +13 -23
  124. package/styles/toolbar.scss +2 -26
  125. package/styles/variable.scss +11 -10
  126. package/types/table.d.ts +57 -18
@@ -125,21 +125,35 @@ function getSelectLabel (_vm, value) {
125
125
  return XEUtils.toValueString(item ? item[_vm.labelField] : value)
126
126
  }
127
127
 
128
+ function checkOptionDisabled (_vm, isSelected, option, group) {
129
+ if (option.disabled) {
130
+ return true
131
+ }
132
+ if (group && group.disabled) {
133
+ return true
134
+ }
135
+ if (_vm.isMaximize && !isSelected) {
136
+ return true
137
+ }
138
+ return false
139
+ }
140
+
128
141
  export function renderOption (h, _vm, list, group) {
129
142
  const { isGroup, labelField, valueField, optionKey, value, multiple, currentValue, optionOpts } = _vm
130
143
  const { useKey } = optionOpts
131
144
  return list.map((option, cIndex) => {
132
145
  const { slots } = option
133
- const isVisible = !isGroup || isOptionVisible(option)
134
- const isDisabled = (group && group.disabled) || option.disabled
135
146
  const optionValue = option[valueField]
147
+ const isSelected = multiple ? (value && value.indexOf(optionValue) > -1) : value === optionValue
148
+ const isVisible = !isGroup || isOptionVisible(option)
149
+ const isDisabled = checkOptionDisabled(_vm, isSelected, option, group)
136
150
  const optid = getOptid(_vm, option)
137
151
  const defaultSlot = slots ? slots.default : null
138
152
  return isVisible ? h('div', {
139
153
  key: useKey || optionKey ? optid : cIndex,
140
154
  class: ['vxe-select-option', option.className, {
141
155
  'is--disabled': isDisabled,
142
- 'is--selected': multiple ? (value && value.indexOf(optionValue) > -1) : value === optionValue,
156
+ 'is--selected': isSelected,
143
157
  'is--hover': currentValue === optionValue
144
158
  }],
145
159
  attrs: {
@@ -240,6 +254,7 @@ export default {
240
254
  optionGroupProps: Object,
241
255
  optionConfig: Object,
242
256
  className: [String, Function],
257
+ max: [String, Number],
243
258
  size: { type: String, default: () => GlobalConfig.select.size || GlobalConfig.size },
244
259
  filterable: Boolean,
245
260
  filterMethod: Function,
@@ -336,6 +351,13 @@ export default {
336
351
  return getRemoteSelectLabel(this, value)
337
352
  }
338
353
  return getSelectLabel(this, value)
354
+ },
355
+ isMaximize () {
356
+ const { value, multiple, max } = this
357
+ if (multiple && max) {
358
+ return (value ? value.length : 0) >= XEUtils.toNumber(max)
359
+ }
360
+ return false
339
361
  }
340
362
  },
341
363
  watch: {
@@ -298,6 +298,7 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
298
298
  showOverflow: allColumnOverflow,
299
299
  treeConfig,
300
300
  treeOpts,
301
+ expandOpts,
301
302
  editOpts,
302
303
  treeExpandeds,
303
304
  scrollYLoad,
@@ -379,11 +380,13 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
379
380
  )
380
381
  // 如果行被展开了
381
382
  if (isExpandRow) {
382
- let cellStyle
383
+ const { height: expandHeight } = expandOpts
384
+ const cellStyle = {}
385
+ if (expandHeight) {
386
+ cellStyle.height = `${expandHeight}px`
387
+ }
383
388
  if (treeConfig) {
384
- cellStyle = {
385
- paddingLeft: `${(rowLevel * treeOpts.indent) + 30}px`
386
- }
389
+ cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`
387
390
  }
388
391
  const { showOverflow } = expandColumn
389
392
  const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow
@@ -396,16 +399,20 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
396
399
  on: trOn
397
400
  }, [
398
401
  h('td', {
399
- class: ['vxe-body--expanded-column', {
402
+ class: {
403
+ 'vxe-body--expanded-column': 1,
400
404
  'fixed--hidden': fixedType && !hasFixedColumn,
401
405
  'col--ellipsis': hasEllipsis
402
- }],
406
+ },
403
407
  attrs: {
404
408
  colspan: tableColumn.length
405
409
  }
406
410
  }, [
407
411
  h('div', {
408
- class: 'vxe-body--expanded-cell',
412
+ class: {
413
+ 'vxe-body--expanded-cell': 1,
414
+ 'is--ellipsis': expandHeight
415
+ },
409
416
  style: cellStyle
410
417
  }, [
411
418
  expandColumn.renderData(h, expandParams)
@@ -321,10 +321,7 @@ export const Cell = {
321
321
  if (isVisible) {
322
322
  radioVNs.push(
323
323
  h('span', {
324
- class: 'vxe-radio--icon vxe-radio--checked-icon'
325
- }),
326
- h('span', {
327
- class: 'vxe-radio--icon vxe-radio--unchecked-icon'
324
+ class: ['vxe-radio--icon', isChecked ? GlobalConfig.icon.TABLE_RADIO_CHECKED : GlobalConfig.icon.TABLE_RADIO_UNCHECKED]
328
325
  })
329
326
  )
330
327
  }
@@ -394,13 +391,7 @@ export const Cell = {
394
391
  on
395
392
  }, [
396
393
  h('span', {
397
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
398
- }),
399
- h('span', {
400
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
401
- }),
402
- h('span', {
403
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
394
+ class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
404
395
  })
405
396
  ].concat(titleSlot || headerTitle ? [
406
397
  h('span', {
@@ -445,13 +436,7 @@ export const Cell = {
445
436
  if (isVisible) {
446
437
  checkVNs.push(
447
438
  h('span', {
448
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
449
- }),
450
- h('span', {
451
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
452
- }),
453
- h('span', {
454
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
439
+ class: ['vxe-checkbox--icon', indeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
455
440
  })
456
441
  )
457
442
  }
@@ -512,13 +497,7 @@ export const Cell = {
512
497
  if (isVisible) {
513
498
  checkVNs.push(
514
499
  h('span', {
515
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
516
- }),
517
- h('span', {
518
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
519
- }),
520
- h('span', {
521
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
500
+ class: ['vxe-checkbox--icon', indeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
522
501
  })
523
502
  )
524
503
  }
@@ -234,6 +234,8 @@ export default {
234
234
  validConfig: Object,
235
235
  // 校验规则配置项
236
236
  editRules: Object,
237
+ // 加载中配置项
238
+ loadingConfig: Object,
237
239
  // 空内容渲染配置项
238
240
  emptyRender: [Boolean, Object],
239
241
  // 自定义列配置项
@@ -569,6 +571,9 @@ export default {
569
571
  emptyOpts () {
570
572
  return Object.assign({}, GlobalConfig.table.emptyRender, this.emptyRender)
571
573
  },
574
+ loadingOpts () {
575
+ return Object.assign({}, GlobalConfig.table.loadingConfig, this.loadingConfig)
576
+ },
572
577
  cellOffsetWidth () {
573
578
  return this.border ? Math.max(2, Math.ceil(this.scrollbarWidth / this.tableColumn.length)) : 1
574
579
  },
@@ -965,7 +970,8 @@ export default {
965
970
  footerTableData,
966
971
  hasTip,
967
972
  columnOpts,
968
- rowOpts
973
+ rowOpts,
974
+ loadingOpts
969
975
  } = this
970
976
  const { leftList, rightList } = columnStore
971
977
  return h('div', {
@@ -1090,7 +1096,9 @@ export default {
1090
1096
  h(VxeLoading, {
1091
1097
  class: 'vxe-table--loading',
1092
1098
  props: {
1093
- loading
1099
+ value: loading,
1100
+ icon: loadingOpts.icon,
1101
+ text: loadingOpts.text
1094
1102
  }
1095
1103
  }),
1096
1104
  /**
@@ -150,12 +150,14 @@ function renderCustoms (h, _vm) {
150
150
  const isColGroup = column.children && column.children.length
151
151
  const isDisabled = checkMethod ? !checkMethod({ column }) : false
152
152
  if (isColGroup || colKey) {
153
+ const isChecked = column.visible
154
+ const isIndeterminate = column.halfVisible
153
155
  cols.push(
154
156
  h('li', {
155
157
  class: ['vxe-custom--option', `level--${column.level}`, {
156
158
  'is--group': isColGroup,
157
- 'is--checked': column.visible,
158
- 'is--indeterminate': column.halfVisible,
159
+ 'is--checked': isChecked,
160
+ 'is--indeterminate': isIndeterminate,
159
161
  'is--disabled': isDisabled
160
162
  }],
161
163
  attrs: {
@@ -170,13 +172,7 @@ function renderCustoms (h, _vm) {
170
172
  }
171
173
  }, [
172
174
  h('span', {
173
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
174
- }),
175
- h('span', {
176
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
177
- }),
178
- h('span', {
179
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
175
+ class: ['vxe-checkbox--icon', isIndeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
180
176
  }),
181
177
  h('span', {
182
178
  class: 'vxe-checkbox--label'
@@ -185,6 +181,8 @@ function renderCustoms (h, _vm) {
185
181
  )
186
182
  }
187
183
  })
184
+ const isAllChecked = customStore.isAll
185
+ const isAllIndeterminate = customStore.isIndeterminate
188
186
  return h('div', {
189
187
  class: ['vxe-custom--wrapper', {
190
188
  'is--active': customStore.visible
@@ -209,8 +207,8 @@ function renderCustoms (h, _vm) {
209
207
  }, [
210
208
  h('li', {
211
209
  class: ['vxe-custom--option', {
212
- 'is--checked': customStore.isAll,
213
- 'is--indeterminate': customStore.isIndeterminate
210
+ 'is--checked': isAllChecked,
211
+ 'is--indeterminate': isAllIndeterminate
214
212
  }],
215
213
  attrs: {
216
214
  title: GlobalConfig.i18n('vxe.table.allTitle')
@@ -220,13 +218,7 @@ function renderCustoms (h, _vm) {
220
218
  }
221
219
  }, [
222
220
  h('span', {
223
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
224
- }),
225
- h('span', {
226
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
227
- }),
228
- h('span', {
229
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
221
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
230
222
  }),
231
223
  h('span', {
232
224
  class: 'vxe-checkbox--label'
@@ -140,6 +140,11 @@ export default {
140
140
  TABLE_EXPAND_LOADED: iconPrefix + 'spinner roll',
141
141
  TABLE_EXPAND_OPEN: iconPrefix + 'arrow-right rotate90',
142
142
  TABLE_EXPAND_CLOSE: iconPrefix + 'arrow-right',
143
+ TABLE_CHECKBOX_CHECKED: iconPrefix + 'checkbox-checked',
144
+ TABLE_CHECKBOX_UNCHECKED: iconPrefix + 'checkbox-unchecked',
145
+ TABLE_CHECKBOX_INDETERMINATE: iconPrefix + 'checkbox-indeterminate',
146
+ TABLE_RADIO_CHECKED: iconPrefix + 'radio-checked',
147
+ TABLE_RADIO_UNCHECKED: iconPrefix + 'radio-unchecked',
143
148
 
144
149
  // button
145
150
  BUTTON_DROPDOWN: iconPrefix + 'arrow-down',
@@ -1,179 +1,75 @@
1
- // 单选框和复选框
2
- %RadioAndCheckboxSpan {
3
- position: relative;
4
- user-select: none;
5
- cursor: pointer;
6
- }
7
- %RadioAndCheckboxIcon {
8
- display: none;
9
- position: absolute;
10
- height: 1em;
11
- width: 1em;
12
- }
13
-
14
- %XERadio {
15
- @extend %RadioAndCheckboxSpan;
16
- .vxe-radio--icon {
17
- @extend %RadioAndCheckboxIcon;
18
- font-size: $vxe-radio-font-size-default;
19
- &:before {
20
- content: "";
21
- position: absolute;
22
- height: 1em;
23
- width: 1em;
24
- top: 0;
25
- left: 0;
26
- border: $vxe-radio-border-width solid $vxe-input-border-color;
27
- background-color: $vxe-radio-icon-background-color;
28
- border-radius: 50%;
29
- }
30
- }
31
- .vxe-radio--unchecked-icon {
32
- display: inline-block;
1
+ %XECheckboxIcon {
2
+ .vxe-checkbox--icon {
3
+ font-size: 1.34em;
33
4
  }
34
- .vxe-radio--checked-icon {
35
- &:after {
36
- content: "";
37
- position: absolute;
38
- height: 0.25em;
39
- width: 0.25em;
40
- top: 0.4em;
41
- left: 0.4em;
42
- border-radius: 50%;
43
- background-color: $vxe-radio-checked-icon-background-color;
44
- }
5
+ .vxe-checkbox--icon {
6
+ color: $vxe-input-border-color;
7
+ vertical-align: middle;
8
+ font-weight: 700;
9
+ user-select: none;
45
10
  }
46
- &.is--checked {
11
+ &.is--checked,
12
+ &.is--indeterminate {
47
13
  color: $vxe-primary-color;
48
- .vxe-radio--unchecked-icon {
49
- display: none;
50
- }
51
- .vxe-radio--checked-icon {
52
- display: inline-block;
53
- &:before {
54
- border-color: $vxe-primary-color;
55
- background-color: $vxe-primary-color;
56
- }
14
+ .vxe-checkbox--icon {
15
+ color: $vxe-primary-color;
57
16
  }
58
17
  }
59
18
  &:not(.is--disabled) {
19
+ cursor: pointer;
60
20
  &:hover {
61
- .vxe-radio--icon {
62
- &:before {
63
- border-color: $vxe-primary-color;
64
- }
21
+ .vxe-checkbox--icon {
22
+ color: $vxe-primary-color;
65
23
  }
66
24
  }
67
25
  }
68
26
  &.is--disabled {
69
- cursor: not-allowed;
70
27
  color: $vxe-disabled-color;
71
- .vxe-radio--icon {
72
- &:before {
73
- border-color: $vxe-input-disabled-color;
74
- background-color: $vxe-input-disabled-background-color;
75
- }
76
- &:after {
77
- background-color: $vxe-primary-disabled-color;
78
- }
28
+ cursor: not-allowed;
29
+ .vxe-checkbox--icon {
30
+ color: $vxe-input-disabled-color;
79
31
  }
80
32
  }
33
+ .vxe-checkbox--label {
34
+ padding-left: 0.5em;
35
+ vertical-align: middle;
36
+ }
81
37
  }
82
38
 
83
- %XECheckbox {
84
- @extend %RadioAndCheckboxSpan;
85
- .vxe-checkbox--icon {
86
- @extend %RadioAndCheckboxIcon;
87
- font-size: $vxe-checkbox-font-size-default;
88
- &:before {
89
- content: "";
90
- position: absolute;
91
- height: 1em;
92
- width: 1em;
93
- top: 0;
94
- left: 0;
95
- background-color: $vxe-checkbox-icon-background-color;
96
- border-radius: $vxe-checkbox-border-radius;
97
- border: $vxe-checkbox-border-width solid $vxe-input-border-color;
98
- }
99
- }
100
- .vxe-checkbox--unchecked-icon {
101
- display: inline-block;
102
- }
103
- .vxe-checkbox--checked-icon {
104
- &:after {
105
- content: "";
106
- position: absolute;
107
- height: $vxe-checkbox-checked-height;
108
- width: $vxe-checkbox-checked-width;
109
- top: 50%;
110
- left: 50%;
111
- border: $vxe-checkbox-border-width solid $vxe-checkbox-checked-icon-border-color;
112
- border-left: 0;
113
- border-top: 0;
114
- transform: translate(-50%, -50%) rotate(45deg);
115
- }
116
- }
117
- .vxe-checkbox--indeterminate-icon {
118
- &:after {
119
- content: "";
120
- position: absolute;
121
- top: 50%;
122
- left: 50%;
123
- height: $vxe-checkbox-indeterminate-height;
124
- width: $vxe-checkbox-indeterminate-width;
125
- background-color: $vxe-checkbox-indeterminate-icon-background-color;
126
- transform: translate(-50%, -50%);
127
- }
39
+ %XERadioIcon {
40
+ cursor: pointer;
41
+ .vxe-radio--icon {
42
+ font-size: 1.4em;
128
43
  }
129
- &.is--checked,
130
- &.is--indeterminate {
131
- color: $vxe-primary-color;
132
- .vxe-checkbox--unchecked-icon {
133
- display: none;
134
- }
135
- .vxe-checkbox--icon {
136
- &:before {
137
- border-color: $vxe-primary-color;
138
- background-color: $vxe-primary-color;
139
- }
140
- }
44
+ .vxe-radio--icon {
45
+ color: $vxe-input-border-color;
46
+ vertical-align: middle;
47
+ font-weight: 700;
48
+ user-select: none;
141
49
  }
142
50
  &.is--checked {
143
- .vxe-checkbox--checked-icon {
144
- display: inline-block;
145
- }
146
- }
147
- &.is--indeterminate {
148
- .vxe-checkbox--indeterminate-icon {
149
- display: inline-block;
51
+ color: $vxe-primary-color;
52
+ .vxe-radio--icon {
53
+ color: $vxe-primary-color;
150
54
  }
151
55
  }
152
56
  &:not(.is--disabled) {
57
+ cursor: pointer;
153
58
  &:hover {
154
- .vxe-checkbox--icon {
155
- &:before {
156
- border-color: $vxe-primary-color;
157
- }
59
+ .vxe-radio--icon {
60
+ color: $vxe-primary-color;
158
61
  }
159
62
  }
160
63
  }
161
64
  &.is--disabled {
162
- cursor: not-allowed;
163
65
  color: $vxe-disabled-color;
164
- .vxe-checkbox--icon {
165
- &:before {
166
- border-color: $vxe-input-disabled-color;
167
- background-color: $vxe-input-disabled-background-color;
168
- }
169
- &:after {
170
- border-color: $vxe-primary-disabled-color;
171
- }
172
- }
173
- .vxe-checkbox--indeterminate-icon {
174
- &:after {
175
- background-color: $vxe-primary-disabled-color;
176
- }
66
+ cursor: not-allowed;
67
+ .vxe-radio--icon {
68
+ color: $vxe-input-disabled-color;
177
69
  }
178
70
  }
71
+ .vxe-radio--label {
72
+ padding-left: 0.5em;
73
+ vertical-align: middle;
74
+ }
179
75
  }
@@ -86,7 +86,7 @@ $btnThemeList: (
86
86
  background-color: transparent;
87
87
  &:not(.is--disabled) {
88
88
  &:focus {
89
- box-shadow: 0 0 0.25em 0 $vxe-primary-color;
89
+ color: darken($vxe-font-color, 20%);
90
90
  }
91
91
  &:hover {
92
92
  color: lighten($vxe-primary-color, 10%);
@@ -98,6 +98,9 @@ $btnThemeList: (
98
98
  &.theme--#{map-get($item, name)} {
99
99
  color: $textColor;
100
100
  &:not(.is--disabled) {
101
+ &:focus {
102
+ color: darken($textColor, 10%);
103
+ }
101
104
  &:hover {
102
105
  color: lighten($textColor, 10%);
103
106
  }
@@ -133,7 +136,6 @@ $btnThemeList: (
133
136
  }
134
137
  &:focus {
135
138
  border-color: $vxe-primary-color;
136
- box-shadow: 0 0 0.25em 0 $vxe-primary-color;
137
139
  }
138
140
  &:active {
139
141
  color: darken($vxe-primary-color, 3%);
@@ -1,6 +1,7 @@
1
1
  /**Variable**/
2
2
  @import './helpers/mixin.scss';
3
3
  @import './base/common.scss';
4
+ @import './base/checked.scss';
4
5
 
5
6
  /*checkbox-group*/
6
7
  .vxe-checkbox-group {
@@ -11,13 +12,11 @@
11
12
 
12
13
  /*checkbox*/
13
14
  .vxe-checkbox {
15
+ @extend %XECheckboxIcon;
14
16
  display: inline-block;
15
17
  vertical-align: middle;
16
18
  white-space: nowrap;
17
- user-select: none;
18
19
  line-height: 1;
19
- cursor: pointer;
20
- color: $vxe-font-color;
21
20
  &+.vxe-checkbox {
22
21
  margin-left: 10px;
23
22
  }
@@ -29,53 +28,12 @@
29
28
  border: 0;
30
29
  appearance: none;
31
30
  }
32
- &+.vxe-checkbox--icon {
33
- position: relative;
34
- display: inline-block;
35
- width: 1em;
36
- height: 1em;
37
- background-color: $vxe-checkbox-icon-background-color;
38
- vertical-align: middle;
39
- border-radius: $vxe-checkbox-border-radius;
40
- border: $vxe-checkbox-border-width solid $vxe-input-border-color;
41
- &:before {
42
- content: "";
43
- position: absolute;
44
- }
45
- }
46
- &:checked+.vxe-checkbox--icon {
47
- background-color: $vxe-primary-color;
48
- border-color: $vxe-primary-color;
49
- &:before {
50
- height: $vxe-checkbox-checked-height;
51
- width: $vxe-checkbox-checked-width;
52
- left: 50%;
53
- top: 50%;
54
- border: $vxe-checkbox-border-width solid $vxe-checkbox-checked-icon-border-color;
55
- border-left: 0;
56
- border-top: 0;
57
- transform: translate(-50%, -50%) rotate(45deg);
58
- }
59
- &+.vxe-checkbox--label {
60
- color: $vxe-primary-color;
61
- }
62
- }
63
31
  }
64
32
  &.is--indeterminate {
65
33
  > input {
66
34
  &:not(:checked) {
67
35
  &+.vxe-checkbox--icon {
68
- background-color: $vxe-primary-color;
69
- border-color: $vxe-primary-color;
70
- &:before {
71
- border: 0;
72
- left: 50%;
73
- top: 50%;
74
- height: $vxe-checkbox-indeterminate-height;
75
- width: $vxe-checkbox-indeterminate-width;
76
- background-color: $vxe-checkbox-indeterminate-icon-background-color;
77
- transform: translate(-50%, -50%);
78
- }
36
+ color: $vxe-primary-color;
79
37
  }
80
38
  }
81
39
  }
@@ -84,7 +42,7 @@
84
42
  & > input {
85
43
  &:focus {
86
44
  &+.vxe-checkbox--icon {
87
- border-color: $vxe-primary-color;
45
+ color: $vxe-primary-color;
88
46
  box-shadow: 0 0 0.2em 0 $vxe-primary-color;
89
47
  }
90
48
  }
@@ -101,18 +59,13 @@
101
59
  cursor: not-allowed;
102
60
  > input {
103
61
  &+.vxe-checkbox--icon {
104
- border-color: $vxe-input-disabled-color;
105
- background-color: $vxe-input-disabled-background-color;
106
- &:before {
107
- border-color: $vxe-primary-disabled-color;
108
- }
62
+ color: $vxe-input-disabled-color;
109
63
  &+.vxe-checkbox--label {
110
64
  color: $vxe-disabled-color;
111
65
  }
112
66
  }
113
67
  &:checked+.vxe-checkbox--icon {
114
- border-color: $vxe-input-disabled-color;
115
- background-color: $vxe-input-disabled-background-color;
68
+ color: $vxe-input-disabled-color;
116
69
  }
117
70
  }
118
71
  }
@@ -127,25 +80,13 @@
127
80
 
128
81
  .vxe-checkbox {
129
82
  font-size: $vxe-font-size;
130
- .vxe-checkbox--icon {
131
- font-size: $vxe-checkbox-font-size-default;
132
- }
133
83
  &.size--medium {
134
84
  font-size: $vxe-font-size-medium;
135
- .vxe-checkbox--icon {
136
- font-size: $vxe-checkbox-font-size-medium;
137
- }
138
85
  }
139
86
  &.size--small {
140
87
  font-size: $vxe-font-size-small;
141
- .vxe-checkbox--icon {
142
- font-size: $vxe-checkbox-font-size-small;
143
- }
144
88
  }
145
89
  &.size--mini {
146
90
  font-size: $vxe-font-size-mini;
147
- .vxe-checkbox--icon {
148
- font-size: $vxe-checkbox-font-size-mini;
149
- }
150
91
  }
151
92
  }