diff --git a/scss/_variables.scss b/scss/_variables.scss index 958f9712..f8d564ee 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -146,6 +146,9 @@ $gap-base: px2rem(15px) !default; $gap-md: px2rem(20px) !default; $gap-lg: px2rem(30px) !default; +$icon-color: $gray600 !default; +$icon-onHover-color: $gray900 !default; + // Components $scrollbar-width: px2rem(17px) !default; @@ -446,7 +449,7 @@ $Table-thead-fontSize: $fontSizeBase !default; $Table-thead-color: $text--loud-color !default; $Table-thead-borderColor: $Table-borderColor !default; $Table-thead-borderWidth: $Table-borderWidth !default; -$Table-thead-iconColor: $text--muted-color !default; +$Table-thead-iconColor: $icon-color !default; $TableCell-height: px2rem(40px) !default; $TableCell-paddingX: $gap-sm !default; $TableCell--edge-paddingX: $gap-md !default; @@ -554,19 +557,19 @@ $ListItem-onModified-borderColor: darken($ListItem-onModified-bg, 10%) !default; $ListItem-onDragging-opacity: 0.1 !default; // QuickEdit -$QuickEdit-iconColor: $text--muted-color !default; -$QuickEdit-onHover-iconColor: $text-color !default; +$QuickEdit-iconColor: $icon-color !default; +$QuickEdit-onHover-iconColor: $icon-onHover-color !default; $QuickEdit-onFocus-borderColor: $info !default; $QuickEdit-onFocus-borderWidth: $borderWidth !default; // Copyable -$Copyable-iconColor: $text--muted-color !default; -$Copyable-onHover-iconColor: $text-color !default; +$Copyable-iconColor: $icon-color !default; +$Copyable-onHover-iconColor: $icon-onHover-color !default; // PopOverAble -$PopOverAble-iconColor: $text--muted-color !default; -$PopOverAble-onHover-iconColor: $text-color !default; +$PopOverAble-iconColor: $icon-color !default; +$PopOverAble-onHover-iconColor: $icon-onHover-color !default; // PopOver $PopOver-bg: white !default; @@ -574,8 +577,8 @@ $PopOver-bg: white !default; // Remark $Remark-width: 1rem !default; $Remark-icon-fontSize: $fontSizeBase !default; -$Remark-iconColor: $text--muted-color !default; -$Remark-onHover-iconColor: $text-color !default; +$Remark-iconColor: $icon-color !default; +$Remark-onHover-iconColor: $icon-onHover-color !default; $Remark-bg: transparent !default; $Remark-onHover-bg: transparent !default; $Remark-borderWidth: 0 !default; @@ -618,7 +621,7 @@ $Form-input-onActive-color: $info !default; $Form-input-borderRadius: $borderRadius !default; $Form-input-borderColor: $borderColor !default; $Form-input-borderWidth: px2rem(1px) !default; -$Form-input-iconColor: #999 !default; +$Form-input-iconColor: $icon-color !default; $Form-input-onFocused-borderColor: $info !default; $Form-input-onFocused-bg: $Form-input-bg !default; $Form-input-onError-borderColor: $danger !default; @@ -674,18 +677,18 @@ $Form-select-onFocused-color: $Form-select-color !default; $Form-select-onFocused-borderColor: $Form-input-onFocused-borderColor !default; $Form-select-onError-borderColor: $Form-input-onError-borderColor !default; $Form-selectOption-height: $Form-input-height !default; -$Form-selectValue-color: #007eff !default; +$Form-selectValue-color: $info !default; $Form-selectValue-bg: saturate(lighten($Form-selectValue-color, 40%), 2.5%) !default; $Form-selectValue-borderColor: saturate(lighten($Form-selectValue-color, 30%), 2.5%) !default; $Form-selectValue-fontSize: $fontSizeSm !default; $Form-select-caret-vender: 'FontAwesome' !default; $Form-select-caret-icon: '\f0d7' !default; $Form-select-caret-fontSize: $fontSizeBase !default; -$Form-select-caret-iconColor: $Form-input-iconColor !default; -$Form-select-caret-onHover-iconColor: $Form-input-iconColor !default; +$Form-select-caret-iconColor: $icon-color !default; +$Form-select-caret-onHover-iconColor: $icon-onHover-color !default; $Form-select-outer-borderWidth: px2rem(1px) !default; $Form-select-outer-boxShadow: none !default; -$Form-select-outer-top: 100% !default; +$Form-select-input-fontSize: $fontSizeSm !default; $Form-select-menu-height: $Form-input-height !default; $Form-select-menu-bg: $white !default; $Form-select-menu-color: $Form-select-color !default; @@ -696,6 +699,8 @@ $Form-select-menu-onActive-bg: transparent !default; $Form-select-menu-onDisabled-color: $text--muted-color !default; $Form-select-menu-onDisabled-bg: transparent !default; $Form-select-checkall-bottomBorder: #eceff8 !default; +$Form-select-popoverGap: 0 !default; +$Form-select-search-height: $Form-select-menu-height !default; // InputGroup $InputGroup-height: $Form-input-height !default; @@ -713,8 +718,8 @@ $InputGroup-select-bg: $white !default; $InputGroup-select-onFocused-bg: $white !default; $InputGroup-select-color: $Form-select-color !default; $InputGroup-select-onFocused-color: $Form-select-onFocused-color !default; -$InputGroup-select-arrowColor: $Form-select-caret-iconColor !default; -$InputGroup-select-onFocused-arrowColor: $Form-select-caret-iconColor !default; +$InputGroup-select-arrowColor: $icon-color !default; +$InputGroup-select-onFocused-arrowColor: $icon-onHover-color !default; $InputGroup-button-borderWidth: $borderWidth !default; $InputGroup-button-borderColor: $Form-input-borderColor !default; $InputGroup-button-borderRadius: $borderRadius !default; @@ -892,6 +897,8 @@ $Checkbox-color: $Form-input-borderColor !default; $Checkbox-onHover-color: $info !default; $Checkbox--sm-size: px2rem(16px) !default; +$Checkbox--sm-inner-size: $Checkbox--sm-size/2 !default; +$Checkbox--sm--full-inner-size: px2rem(10px) !default; $Checkbox-gb: #fff !default; $Checkbox-borderRadius: $borderRadius !default; @@ -949,8 +956,8 @@ $DatePicker-fontSize: $Form-input-fontSize !default; $DatePicker-paddingX: px2rem(12px) !default; $DatePicker-paddingY: ($DatePicker-height - $DatePicker-lineHeight * $DatePicker-fontSize)/2 - $DatePicker-borderWidth !default; $DatePicker-placeholderColor: $Form-input-placeholderColor !default; -$DatePicker-iconColor: $gray600 !default; -$DatePicker-onHover-iconColor: darken($DatePicker-iconColor, 10%) !default; +$DatePicker-iconColor: $icon-color !default; +$DatePicker-onHover-iconColor: $icon-onHover-color !default; $DatePicker-onFocused-borderColor: $Form-input-onFocused-borderColor !default; $DatePicker-toggler-vendor: 'FontAwesome' !default; $DatePicker-toggler-fontSize: $Form-fontSize !default; @@ -1041,7 +1048,7 @@ $ListControl-item-onDisabled-bg: $ListControl-item-bg !default; // Combo $Combo-toolbarBtn-lineHeight: 1 !default; $Combo-toolbarBtn-height: px2rem(20px) !default; -$Combo-toolbarBtn-color: $Form-input-iconColor !default; +$Combo-toolbarBtn-color: $icon-color !default; $Combo-toolbarBtn-paddingX: px2rem(5px) !default; $Combo-toolbarBtn-paddingY: px2rem(2px) !default; @@ -1261,7 +1268,7 @@ $TransferSelect-heading-borderBottom: $borderWidth solid $borderColor !default; // Tree $TreeSelect-popover-bg: #fff !default; $Tree-indent: px2rem(20px) !default; -$Tree-itemArrowWidth: px2rem(10px) !default; +$Tree-itemArrowWidth: px2rem(16px) !default; $Tree-arrowVendor: 'FontAwesome' !default; $Tree-unfoldedArrowContent: '\f107' !default; $Tree-foldedArrowContent: '\f105' !default; @@ -1271,7 +1278,10 @@ $Tree-leafIconVendor: 'FontAwesome' !default; $Tree-leafIconContent: '\f15b' !default; $Tree-folderIconVendor: 'FontAwesome' !default; $Tree-folderIconContent: '\f07b' !default; -$Tree-itemText--onChecked-color: $Form-selectValue-color !default; +$Tree-itemLabel--onChecked-color: $Form-selectValue-color !default; +$Tree-itemHeight: px2rem(30px) !default; +$Tree-item-onHover-bg: rgba(0, 126, 255, 0.08) !default; +$Tree-inputHeight: $Form-input-height * 0.85 !default; // IconPicker $IconPicker-tabs-bg: #f0f3f4 !default; @@ -1339,8 +1349,8 @@ $Carousel-imageTitle-bottom: px2rem(45px) !default; $Carousel-imageDescription-bottom: px2rem(25px) !default; // Picker -$Picker-iconColor: $gray600 !default; -$Picker-onHover-iconColor: darken($Picker-iconColor, 10%) !default; +$Picker-iconColor: $icon-color !default; +$Picker-onHover-iconColor: $icon-onHover-color !default; $Picker-btn-vendor: 'FontAwesome' !default; $Picker-btn-fontSize: $Form-fontSize !default; $Picker-btn-icon: '\f2d2' !default; \ No newline at end of file diff --git a/scss/components/form/_checks.scss b/scss/components/form/_checks.scss index 30b780ae..e3a33308 100644 --- a/scss/components/form/_checks.scss +++ b/scss/components/form/_checks.scss @@ -8,12 +8,12 @@ position: absolute; } - &:hover input:not(:disabled) + i { + &:hover input:not(:disabled)+i { border-color: $Checkbox-onHover-color; // box-shadow: 0 0 px2rem(1px) $Checkbox-onHover-color inset; } - > i { + >i { cursor: pointer; line-height: 1; background: $Checkbox-gb; @@ -21,7 +21,7 @@ vertical-align: middle; position: relative; - + span { + +span { margin-left: $Checkbox-gap; cursor: pointer; @@ -39,6 +39,8 @@ height: 0px; background-color: transparent; transition: all 0.2s; + transform-origin: 50% 50%; + transform: translate(-50%, -50%); } } @@ -48,19 +50,17 @@ input { margin-left: -$Checkbox-size; - &:checked + i { + &:checked+i { border-color: $Checkbox-onHover-color; &:before { - left: ($Checkbox-size - px2rem(2px) - $Checkbox-inner-size) / 2; - top: ($Checkbox-size - px2rem(2px) - $Checkbox-inner-size) / 2; width: $Checkbox-inner-size; height: $Checkbox-inner-size; background: $Checkbox-onHover-color; } } - &[disabled] + i { + &[disabled]+i { border-color: lighten($Checkbox-color, 5%); cursor: not-allowed; @@ -70,13 +70,13 @@ } } - &[disabled] + i + span { + &[disabled]+i+span { cursor: not-allowed; color: $text--muted-color; } } - > i { + >i { width: $Checkbox-size; height: $Checkbox-size; border: px2rem(1px) solid $Checkbox-color; @@ -87,25 +87,16 @@ } &--full.#{$ns}Checkbox--checkbox { - &:not(:disabled) + i:hover { + &:not(:disabled)+i:hover { border-color: $Checkbox-color; } input { - &:checked + i { + &:checked+i { border-color: $Checkbox-onHover-color; background: $Checkbox-onHover-color; &:before { - // todo 后面自动计算 - @if $ns== 'cxd-' { - top: px2rem(2px); - left: px2rem(1px); - } @else { - top: px2rem(5px); - left: ($Checkbox-size - $Checkbox--full-inner-size) /2; - } - width: $Checkbox--full-inner-size; height: $Checkbox--full-inner-size / 2; border-color: $white; @@ -120,13 +111,13 @@ // } // } - &:checked[disabled] + i { + &:checked[disabled]+i { border-color: lighten($Checkbox-color, 5%); background-color: lighten($Checkbox-color, 5%); } } - > i { + >i { position: relative; cursor: pointer; @@ -138,9 +129,9 @@ width: 0; height: 0; border-color: transparent; - transition: all 0.2s; + transition: width 0.2s, height 0.2s, transform 0.2s; border-width: 0 0 px2rem(2px) px2rem(2px); - transform: rotate(-40deg); + transform: translate(-50%, -60%) rotate(-40deg); border-style: solid; } } @@ -152,12 +143,10 @@ input { margin-left: -$Radio-size; - &:checked + i { + &:checked+i { border-color: $Radio-onHover-color; &:before { - left: ($Radio-size - px2rem(2px) - $Radio-inner-size) / 2; - top: ($Radio-size - px2rem(2px) - $Radio-inner-size) / 2; width: $Radio-inner-size; height: $Radio-inner-size; background-color: $Radio-onHover-color; @@ -165,7 +154,7 @@ } } - &[disabled] + i { + &[disabled]+i { border-color: lighten($Radio-color, 5%); cursor: not-allowed; @@ -174,13 +163,13 @@ } } - &[disabled] + i + span { + &[disabled]+i+span { cursor: not-allowed; color: $text--muted-color; } } - > i { + >i { cursor: pointer; width: $Radio-size; height: $Radio-size; @@ -192,30 +181,41 @@ } &--sm { - margin-right: px2rem(5px); + padding-left: $Checkbox--sm-size; input { - &:checked + i { + margin-left: -$Checkbox--sm-size; + + &:checked+i { &:before { - left: $Checkbox--sm-size / 4 - px2rem(1px); - top: $Checkbox--sm-size / 4 - px2rem(1px); - width: $Checkbox--sm-size / 2; - height: $Checkbox--sm-size / 2; + width: $Checkbox--sm-inner-size; + height: $Checkbox--sm-inner-size; } } } - > i { + >i { width: $Checkbox--sm-size; height: $Checkbox--sm-size; margin-left: -$Checkbox--sm-size; - + span { + +span { margin-left: $gap-xs; } } } + &--sm.#{$ns}Checkbox--full { + input { + &:checked+i { + &:before { + width: $Checkbox--sm--full-inner-size; + height: $Checkbox--sm--full-inner-size / 2; + } + } + } + } + &-desc { color: $text--muted-color; margin-left: $Checkbox-gap; @@ -244,13 +244,14 @@ .#{$ns}RadiosControl-group, .#{$ns}CheckboxesControl-group { + .#{$ns}RadiosControl-group, .#{$ns}CheckboxesControl-group { padding-left: px2rem(80px); @include clearfix(); - > .#{$ns}RadiosControl-groupLabel, - > .#{$ns}CheckboxesControl-groupLabel { + >.#{$ns}RadiosControl-groupLabel, + >.#{$ns}CheckboxesControl-groupLabel { float: left; width: px2rem(80px); margin-left: px2rem(-80px); @@ -261,4 +262,4 @@ .#{$ns}RadiosControl-groupLabel, .#{$ns}CheckboxesControl-groupLabel { display: block; -} +} \ No newline at end of file diff --git a/scss/components/form/_select.scss b/scss/components/form/_select.scss index ee113347..8b83a187 100644 --- a/scss/components/form/_select.scss +++ b/scss/components/form/_select.scss @@ -132,22 +132,10 @@ transform: rotate(180deg); } - // &-menuOuter { - // position: absolute; - // background: $Form-select-menu-bg; - // color: $Form-select-menu-color; - // border: $Form-select-outer-borderWidth solid $Form-input-onFocused-borderColor; - // left: px2rem(-1px); - // right: px2rem(-1px); - // min-width: 100%; - // top: $Form-select-outer-top; - // z-index: 10; - // box-shadow: $Form-select-outer-boxShadow; - // } - &-menu { max-height: px2rem(300px); - overflow: auto; + overflow-y: auto; + overflow-x: hidden; user-select: none; } @@ -156,19 +144,22 @@ outline: none; border: none; margin: 0 $Form-select-paddingX; - padding: ($Form-input-height - $Form-input-lineHeight * $Form-input-fontSize)/2 0; - line-height: $Form-input-lineHeight; + height: $Form-select-search-height; + font-size: $Form-select-input-fontSize; border-bottom: 1px solid $borderColor; display: flex; align-items: center; + // &.is-focused { + // border-color: $Form-input-onFocused-borderColor; + // } + >svg { fill: #999; width: px2rem(14px); min-width: px2rem(14px); height: px2rem(14px); margin-right: px2rem(5px); - top: 0; } >input { @@ -176,7 +167,8 @@ border: none; flex-grow: 1; background: transparent; - font-size: px2rem(12px); + position: relative; + top: 0.125em; } } @@ -222,8 +214,8 @@ &-noResult { color: $Form-select-placeholderColor; line-height: $Form-input-lineHeight; + font-size: $Form-select-input-fontSize; user-select: none; - margin: 5px 0 0; padding: ($Form-select-menu-height - $Form-input-lineHeight * $Form-input-fontSize)/2 $Form-select-paddingX; } @@ -236,6 +228,10 @@ cursor: pointer; padding: ($Form-select-menu-height - $Form-input-lineHeight * $Form-input-fontSize)/2 $Form-select-paddingX; + &:hover { + text-decoration: none; + } + >svg { width: px2rem(14px); height: px2rem(14px); @@ -278,7 +274,8 @@ } .#{$ns}Select-popover { - margin-top: px2rem(2px); + margin-top: $Form-select-popoverGap - $Form-select-outer-borderWidth; + background: $Form-select-menu-bg; color: $Form-select-menu-color; border: $Form-select-outer-borderWidth solid $Form-input-onFocused-borderColor; @@ -289,7 +286,7 @@ z-index: 2; &.#{$ns}PopOver--leftTopLeftBottom { - margin-top: px2rem(-2px); + margin-top: -($Form-select-popoverGap - $Form-select-outer-borderWidth); } } diff --git a/scss/components/form/_tree.scss b/scss/components/form/_tree.scss index 0a03d2c0..c3274746 100644 --- a/scss/components/form/_tree.scss +++ b/scss/components/form/_tree.scss @@ -1,34 +1,3 @@ -@mixin tree-input { - > svg { - display: inline-block; - cursor: pointer; - position: relative; - top: 2px; - width: px2rem(16px); - height: px2rem(16px); - margin-left: px2rem(5px); - } - - > input { - margin-left: px2rem(15px); - padding: px2rem(5px); - width: px2rem(150px); - height: px2rem(25px); - color: $Form-input-color; - - &::placeholder { - color: $Form-input-placeholderColor; - user-select: none; - } - - &:focus { - outline: none; - border: $borderWidth solid $info; - } - } -} - -// todo .#{$ns}TreeControl { border: 1px solid $Form-input-borderColor; padding: 6px 12px; @@ -46,6 +15,7 @@ } .#{$ns}Tree { + &-list, &-sublist { list-style: none; @@ -53,39 +23,26 @@ margin: 0; } - &-sublist { - padding-left: $Tree-indent; - - &.is-folded { - display: none; - } - - > li { - @include tree-input; - } + &-sublist.is-folded { + display: none; } &-item { - line-height: px2rem(30px); + line-height: $Tree-itemHeight; position: relative; - .#{$ns}Tree-item-icons { - visibility: hidden; - transition: visibility .1s ease; - } - - > a { + >div { color: inherit; &:hover { text-decoration: none; - > span.#{$ns}Tree-item-icons { + >.#{$ns}Tree-item-icons { visibility: visible; } } - > span > svg { + >span>svg { display: inline-block; cursor: pointer; position: relative; @@ -95,49 +52,105 @@ margin-left: px2rem(5px); } } + } - &--isLeaf > a { - padding-left: $Tree-itemArrowWidth + $gap-xs; - } - - &--isEdit { - display: inline-block; - @include tree-input; + &-itemLabel { + &:hover { + background: $Tree-item-onHover-bg; } } - &-rootItem { - > a > i { - margin-left: 0 !important; + &-item-icons { + visibility: hidden; + transition: visibility .1s ease; + display: inline-block; + vertical-align: top; + height: $Tree-itemHeight; + line-height: $Tree-itemHeight; + + >a { + display: inline-block; + vertical-align: middle; + margin-left: $gap-xs; + cursor: pointer; + + >svg { + $svgSize: px2rem(16px); + width: $svgSize; + height: $svgSize; + top: 0.125 * $svgSize; + } + } + } + + &-itemInput { + padding-left: $Tree-itemArrowWidth; + + >a { + display: inline-block; + cursor: pointer; + margin-left: $gap-sm; + color: $icon-color; + + &:hover { + color: $icon-onHover-color; + text-decoration: none; + } } - .#{$ns}Tree-addTop { - height: px2rem(25px); - line-height: px2rem(25px); - cursor: pointer; - padding-left: $Tree-indent; - > p { - > svg { - position: relative; - top: 2px; - width: px2rem(16px); - height: px2rem(16px); - } - > span { - padding-left: px2rem(5px); - } + >input { + outline: none; + background-color: $Form-input-bg; + border: $Form-input-borderWidth solid $Form-input-borderColor; + border-radius: $Form-input-borderRadius; + line-height: $Form-input-lineHeight; + padding: ($Tree-inputHeight - $Form-input-lineHeight * $Form-input-fontSize - px2rem(2px))/2 $Form-input-paddingX; + font-size: $Form-input-fontSize; + + &::placeholder { + color: $Form-input-placeholderColor; + user-select: none; } - &-input { - @include tree-input + &:focus { + border-color: $Form-input-onFocused-borderColor; + box-shadow: $Form-input-boxShadow; + + @if $Form-input-onFocused-bg !=$Form-input-bg { + background-color: $Form-input-onFocused-bg; + } } } } + &-addTopBtn { + cursor: pointer; + height: $Tree-itemHeight; + line-height: $Tree-itemHeight; + display: block; + + &:hover { + text-decoration: none; + } + + &.is-disabled { + pointer-events: none; + color: $text--muted-color; + } + + >svg { + $svgSize: px2rem(14px); + width: $svgSize; + height: $svgSize; + top: $svgSize * 0.125; + margin-right: $Tree-itemArrowWidth - px2rem(14px); // icon 的宽度是14px + } + } + &-itemArrow { cursor: pointer; width: $Tree-itemArrowWidth; - margin-right: $gap-xs; + text-align: center; display: inline-block; &:before { @@ -151,9 +164,14 @@ } } + &-itemArrowPlaceholder { + display: inline-block; + width: $Tree-itemArrowWidth; + } + &-itemIcon { display: inline-block; - margin-right: $gap-xs; + margin-right: px2rem(3px); } &-rootIcon { @@ -180,13 +198,13 @@ } } - &-itemText { + &-itemLabel { user-select: none; cursor: pointer; &.is-checked, &.is-children-checked { - color: $Tree-itemText--onChecked-color; + color: $Tree-itemLabel--onChecked-color; } &.is-disabled { @@ -197,4 +215,46 @@ &-placeholder { color: $text--muted-color; } -} + + + + &-item &-item>&-itemLabel { + padding-left: $Tree-indent; + } + + &-item &-item &-item>&-itemLabel { + padding-left: $Tree-indent * 2; + } + + &-item &-item &-item &-item>&-itemLabel { + padding-left: $Tree-indent * 3; + } + + &-item &-item &-item &-item &-item>&-itemLabel { + padding-left: $Tree-indent * 4; + } + + &-item &-item &-item &-item &-item &-item>&-itemLabel { + padding-left: $Tree-indent * 5; + } + + &-item &-item &-item &-item &-item &-item &-item>&-itemLabel { + padding-left: $Tree-indent * 6; + } + + &-item &-item &-item &-item &-item &-item &-item &-item>&-itemLabel { + padding-left: $Tree-indent * 7; + } + + &-item &-item &-item &-item &-item &-item &-item &-item &-item>&-itemLabel { + padding-left: $Tree-indent * 8; + } + + &-item &-item &-item &-item &-item &-item &-item &-item &-item &-item>&-itemLabel { + padding-left: $Tree-indent * 9; + } + + &-item &-item &-item &-item &-item &-item &-item &-item &-item &-item &-item>&-itemLabel { + padding-left: $Tree-indent * 10; + } +} \ No newline at end of file diff --git a/scss/themes/cxd.scss b/scss/themes/cxd.scss index 2862ef40..2a19e9af 100644 --- a/scss/themes/cxd.scss +++ b/scss/themes/cxd.scss @@ -26,6 +26,9 @@ $borderColor: #e8ebee; $link-onHover-decoration: none; +$icon-color: #999; +$icon-onHover-color: $primary; + $Layout-header-boxShadow: none; $Layout-header-bg: #F5F5F5; $Layout-aside-width: px2rem(180px); @@ -103,6 +106,9 @@ $Form-select-menu-color: #333; $Form-select-menu-onHover-color: #000; $Form-select-menu-onHover-bg: #eaf6fe; $Form-select-menu-height: px2rem(24px); +$Form-select-popoverGap: px2rem(3px); +$Form-select-search-height: px2rem(30px); +$Form-selectValue-color: $primary !default; $InputGroup-select-borderWidth: px2rem(1px); $InputGroup-select-bg: #f6f7fb; diff --git a/src/components/Checkbox.tsx b/src/components/Checkbox.tsx index e39f33e6..e9d62061 100644 --- a/src/components/Checkbox.tsx +++ b/src/components/Checkbox.tsx @@ -20,7 +20,7 @@ interface CheckboxProps { id?: string; key?: string | number; style?: React.CSSProperties; - type?: string; + type: 'checkbox' | 'radio'; size?: 'sm' | 'lg' | 'small' | 'large'; label?: string; labelClassName?: string; @@ -80,19 +80,12 @@ export class Checkbox extends React.Component { labelClassName } = this.props; - className = - (className ? className : '') + - (size && sizeMap[size] ? ` ${sizeMap[size]}` : ''); - return (