UNPKG

@alifd/next

Version:

A configurable component library for web built on React.

416 lines (411 loc) 20.1 kB
.next-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; top: 0; margin: -1px; } .next-select { box-sizing: border-box; display: inline-block; position: relative; font-size: 0; vertical-align: middle; /* Select trigger */ /* 在搜索框未激活时,将 input 的 color 置为透明 */ /* ISSUE: 在 IE11 中,<input readonly/> 仍然会显示光标, 要隐藏掉 */ /* &.next-no-search { .next-select-trigger-search input { color: $color-transparent; } } */ /* 弹层 */ /* 全选按钮 */ /* -------------- IE polyfill -------------- */ /* 根据最新的数据,在中国,PC 端的 IE9 份额为 2%, */ /* 所以不应该因为 IE9 而不使用 flex,而是应该做降级 polyfill */ /* @see http://gs.statcounter.com/ */ /* IE10、IE11 虽然支持 flex,但还是会有各种各样奇奇怪怪的问题 */ } .next-select *, .next-select *:before, .next-select *:after { box-sizing: border-box; } .next-select-trigger { min-width: 100px; outline: 0; transition: all 100ms linear; transition: all var(--motion-duration-immediately, 100ms) var(--motion-linear, linear); } .next-select-trigger .next-input-label { flex: 0 0 auto; width: auto; } .next-select-trigger .next-select-values { display: block; width: 100%; flex: 1 1 0; overflow: hidden; } .next-select-trigger .next-select-values > em { font-style: inherit; } .next-select-trigger .next-select-values input { padding-left: 0; padding-right: 0; } .next-select-trigger .next-input-control { flex: 0 0 auto; width: auto; } .next-select-trigger .next-input-control > * { display: inline-block; width: auto; } .next-select-trigger .next-input-control > .next-select-arrow { padding-right: 0; } .next-select-trigger .next-input.next-disabled em { color: #CCCCCC; color: var(--input-disabled-color, #CCCCCC); } .next-select-trigger .next-input.next-disabled .next-select-arrow { cursor: not-allowed; } .next-select-trigger .next-select-clear { display: none; } .next-select-trigger.next-has-clear:hover .next-select-clear { display: inline-block; } .next-select-trigger.next-has-clear:hover .next-select-arrow { display: none; } .next-select .next-select-inner { display: inline-flex; align-items: center; width: 100%; min-width: 100px; outline: 0; color: #333333; color: var(--select-color, #333333); } .next-select .next-select-inner .next-tag { line-height: 1; margin-right: 4px; margin-right: var(--select-tag-spacing-lr, 4px); margin-bottom: 3px; margin-bottom: var(--select-tag-spacing-tb, 3px); padding-left: 0px; padding-left: var(--select-tag-padding-lr, 0px); padding-right: 0px; padding-right: var(--select-tag-padding-lr, 0px); } .next-select .next-select-inner .next-input-inner { width: auto; } .next-select-trigger-search { position: relative; display: inline-block; vertical-align: top; overflow: hidden; width: 100%; max-width: 100%; } .next-select-trigger-search > input, .next-select-trigger-search > span { display: block; font-size: inherit; font-family: inherit; letter-spacing: inherit; white-space: nowrap; overflow: hidden; } .next-select-trigger-search input { position: absolute; background-color: transparent; width: 100%; height: 100% !important; z-index: 1; left: 0; border: 0; outline: 0; margin: 0; padding: 0; cursor: inherit; } .next-select-trigger-search > span { position: relative; visibility: hidden; white-space: pre; max-width: 100%; /* 在 table 布局中,100% 并没有什么x用 */ z-index: -1; } .next-select-single { /* 搜索框激活时,展开后不显示值,只显示搜索框 */ /* 搜索框未激活,或者menu未展开,如果有值,则不显示搜索(placeholder) */ } .next-select-single.next-no-search { cursor: pointer; } .next-select-single.next-has-search.next-active .next-select-values > em { display: none; } .next-select-single.next-no-search .next-select-values > em + .next-select-trigger-search, .next-select-single.next-inactive .next-select-values > em + .next-select-trigger-search { width: 1px; opacity: 0; /* stylelint-disable */ filter: alpha(opacity=0); /* for IE 9 */ /* stylelint-enable */ } .next-select-single .next-select-values { display: inline-flex; align-items: center; } .next-select-single .next-select-values > em { vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .next-select-multiple .next-select-compact { position: relative; white-space: nowrap; } .next-select-multiple .next-select-compact .next-select-trigger-search { width: auto; } .next-select-multiple .next-select-compact .next-select-tag-compact { position: absolute; top: 0; right: 0; z-index: 1; padding: 0 4px 0 16px; color: #333333; color: var(--input-text-color, #333333); background: linear-gradient(90deg, transparent, #FFFFFF 10px); background: linear-gradient(90deg, transparent, var(--input-bg-color, #FFFFFF) 10px); } .next-select-multiple .next-disabled .next-select-tag-compact { background: linear-gradient(90deg, transparent, #F7F8FA 10px); background: linear-gradient(90deg, transparent, var(--input-disabled-bg-color, #F7F8FA) 10px); } .next-select-multiple, .next-select-tag { /* 如果有值,则搜索框变为1px */ } .next-select-multiple .next-select-values, .next-select-tag .next-select-values { /* Tag 有 3px 的 margin-bottom,所以包裹 Tag 的容器要作一下处理 */ margin-bottom: -3px; margin-bottom: calc(0px - var(--select-tag-spacing-tb, 3px)); height: auto !important; } .next-select-multiple .next-select-trigger-search, .next-select-tag .next-select-trigger-search { margin-bottom: 3px; margin-bottom: var(--select-tag-spacing-tb, 3px); } .next-select-multiple .next-tag + .next-select-trigger-search, .next-select-tag .next-tag + .next-select-trigger-search { width: auto; min-width: 1px; /* 保留一个光标的宽度 */ } .next-select-multiple .next-input, .next-select-tag .next-input { height: auto; align-items: start; } .next-select-multiple.next-small .next-select-values, .next-select-tag.next-small .next-select-values { min-height: 18px; min-height: calc(var(--form-element-small-height, 20px) - 2px); padding-top: 2px; padding-top: calc(var(--form-element-small-height, 20px)/2 - var(--select-s-lineheight, 14px)/2 - 1px); padding-bottom: 2px; padding-bottom: calc(var(--form-element-small-height, 20px)/2 - var(--select-s-lineheight, 14px)/2 - 1px); line-height: 14px; line-height: var(--select-s-lineheight, 14px); } .next-select-multiple.next-small .next-select-values-compact, .next-select-tag.next-small .next-select-values-compact { height: 20px !important; height: var(--form-element-small-height, 20px) !important; } .next-select-multiple.next-small .next-tag, .next-select-tag.next-small .next-tag { border: 0; padding-top: 0px; padding-top: calc(var(--select-s-lineheight, 14px)/2 - var(--s-4, 16px)/2 + 1px); padding-bottom: 0px; padding-bottom: calc(var(--select-s-lineheight, 14px)/2 - var(--s-4, 16px)/2 + 1px); height: 14px; height: var(--select-s-lineheight, 14px); } .next-select-multiple.next-small .next-tag .next-tag-body, .next-select-multiple.next-small .next-tag .next-tag-close-btn, .next-select-tag.next-small .next-tag .next-tag-body, .next-select-tag.next-small .next-tag .next-tag-close-btn { line-height: 14px; line-height: calc(var(--select-s-lineheight, 14px) - var(--select-s-lineheight, 14px)/2*2 + var(--s-4, 16px)/2*2 - 2px); } .next-select-multiple.next-small .next-tag-body, .next-select-tag.next-small .next-tag-body { line-height: 14px; line-height: var(--select-s-lineheight, 14px); } .next-select-multiple.next-small .next-input-label, .next-select-multiple.next-small .next-input-inner, .next-select-multiple.next-small .next-input-control, .next-select-multiple.next-small .next-select-tag-compact, .next-select-tag.next-small .next-input-label, .next-select-tag.next-small .next-input-inner, .next-select-tag.next-small .next-input-control, .next-select-tag.next-small .next-select-tag-compact { line-height: 18px; line-height: calc(var(--form-element-small-height, 20px) - 2px); } .next-select-multiple.next-medium .next-select-values, .next-select-tag.next-medium .next-select-values { min-height: 26px; min-height: calc(var(--form-element-medium-height, 28px) - 2px); padding-top: 3px; padding-top: calc(var(--form-element-medium-height, 28px)/2 - var(--select-m-lineheight, 20px)/2 - 1px); padding-bottom: 3px; padding-bottom: calc(var(--form-element-medium-height, 28px)/2 - var(--select-m-lineheight, 20px)/2 - 1px); line-height: 20px; line-height: var(--select-m-lineheight, 20px); } .next-select-multiple.next-medium .next-select-values-compact, .next-select-tag.next-medium .next-select-values-compact { height: 28px !important; height: var(--form-element-medium-height, 28px) !important; } .next-select-multiple.next-medium .next-tag, .next-select-tag.next-medium .next-tag { padding-top: 1px; padding-top: calc(var(--select-m-lineheight, 20px)/2 - var(--s-4, 16px)/2 - 1px); padding-bottom: 1px; padding-bottom: calc(var(--select-m-lineheight, 20px)/2 - var(--s-4, 16px)/2 - 1px); height: 20px; height: var(--select-m-lineheight, 20px); } .next-select-multiple.next-medium .next-tag .next-tag-body, .next-select-multiple.next-medium .next-tag .next-tag-close-btn, .next-select-tag.next-medium .next-tag .next-tag-body, .next-select-tag.next-medium .next-tag .next-tag-close-btn { line-height: 18px; line-height: calc(var(--select-m-lineheight, 20px) - var(--select-m-lineheight, 20px)/2*2 + var(--s-4, 16px)/2*2 + 2px); } .next-select-multiple.next-medium .next-input-label, .next-select-multiple.next-medium .next-input-inner, .next-select-multiple.next-medium .next-input-control, .next-select-multiple.next-medium .next-select-tag-compact, .next-select-tag.next-medium .next-input-label, .next-select-tag.next-medium .next-input-inner, .next-select-tag.next-medium .next-input-control, .next-select-tag.next-medium .next-select-tag-compact { line-height: 26px; line-height: calc(var(--form-element-medium-height, 28px) - 2px); } .next-select-multiple.next-large .next-select-values, .next-select-tag.next-large .next-select-values { min-height: 38px; min-height: calc(var(--form-element-large-height, 40px) - 2px); padding-top: 7px; padding-top: calc(var(--form-element-large-height, 40px)/2 - var(--select-l-lineheight, 24px)/2 - 1px); padding-bottom: 7px; padding-bottom: calc(var(--form-element-large-height, 40px)/2 - var(--select-l-lineheight, 24px)/2 - 1px); line-height: 24px; line-height: var(--select-l-lineheight, 24px); } .next-select-multiple.next-large .next-select-values-compact, .next-select-tag.next-large .next-select-values-compact { height: 40px !important; height: var(--form-element-large-height, 40px) !important; } .next-select-multiple.next-large .next-tag, .next-select-tag.next-large .next-tag { padding-top: 3px; padding-top: calc(var(--select-l-lineheight, 24px)/2 - var(--s-4, 16px)/2 - 1px); padding-bottom: 3px; padding-bottom: calc(var(--select-l-lineheight, 24px)/2 - var(--s-4, 16px)/2 - 1px); height: 24px; height: var(--select-l-lineheight, 24px); } .next-select-multiple.next-large .next-tag .next-tag-body, .next-select-multiple.next-large .next-tag .next-tag-close-btn, .next-select-tag.next-large .next-tag .next-tag-body, .next-select-tag.next-large .next-tag .next-tag-close-btn { line-height: 18px; line-height: calc(var(--select-l-lineheight, 24px) - var(--select-l-lineheight, 24px)/2*2 + var(--s-4, 16px)/2*2 + 2px); } .next-select-multiple.next-large .next-input-label, .next-select-multiple.next-large .next-input-inner, .next-select-multiple.next-large .next-input-control, .next-select-multiple.next-large .next-select-tag-compact, .next-select-tag.next-large .next-input-label, .next-select-tag.next-large .next-input-inner, .next-select-tag.next-large .next-input-control, .next-select-tag.next-large .next-select-tag-compact { line-height: 38px; line-height: calc(var(--form-element-large-height, 40px) - 2px); } .next-select-auto-complete { width: 160px; } .next-select-auto-complete .next-input { width: 100%; /* table-cell 下 margin 无效 */ } .next-select-auto-complete .next-input .next-input-hint-wrap { padding-right: 1px; } .next-select-auto-complete .next-input .next-select-arrow { padding-left: 0; } .next-select.next-active .next-select-arrow .next-icon-arrow-down { transform: rotate(180deg); } .next-select .next-select-unfold-icon::before { content: ""; content: var(--select-unfold-icon-content, ""); } .next-select-symbol-fold::before { content: ""; content: var(--select-fold-icon-content, ""); } .next-select-arrow { cursor: pointer; width: auto !important; text-align: center; transition: all 100ms linear; transition: all var(--motion-duration-immediately, 100ms) var(--motion-linear, linear); /* transform-origin: center 41.8%; // icon 图像中心 */ } .next-select-popup-wrap { animation-duration: 300ms; animation-duration: var(--motion-duration-standard, 300ms); animation-timing-function: ease; animation-timing-function: var(--motion-ease, ease); padding: 0px 0; padding: var(--popup-spacing-tb, 0px) 0; } .next-select-spacing-tb { padding: 0px 0; padding: var(--popup-spacing-tb, 0px) 0; } .next-select-menu-wrapper { max-height: 260px; overflow: auto; border: 1px solid #DCDEE3; border: var(--popup-local-border-width, 1px) var(--popup-local-border-style, solid) var(--popup-local-border-color, #DCDEE3); border-radius: 3px; border-radius: var(--popup-local-corner, 3px); box-shadow: none; box-shadow: var(--popup-local-shadow, none); } .next-select-menu-wrapper .next-select-menu { max-height: none; border: none; } .next-select-menu { max-height: 260px; overflow: auto; /* autoComplete 没有选项时 menu 不显示 */ } .next-select-menu .next-select-menu-empty-content { padding-left: 8px; padding-left: var(--s-2, 8px); padding-right: 8px; padding-right: var(--s-2, 8px); color: #999999; color: var(--select-hint-color, #999999); } .next-select-menu.next-select-auto-complete-menu.next-select-menu-empty { display: none; } .next-select-menu .next-menu-item-text .next-icon { vertical-align: middle; } .next-select-all { display: block; cursor: pointer; padding: 0 8px; padding: 0 var(--s-2, 8px); margin: 0 12px 8px; margin: 0 var(--s-3, 12px) var(--s-2, 8px); border-bottom: 1px solid #DCDEE3; border-bottom: 1px solid var(--color-line1-2, #DCDEE3); } .next-select-all:hover { color: #3E71F7; color: var(--color-link-3, #3E71F7); } .next-select-all .next-menu-icon-selected.next-icon { display: inline-block !important; top: initial; color: #5584FF; color: var(--select-menu-icon-color, #5584FF); } .next-select-highlight { color: #5584FF; color: var(--select-highlight-color, #5584FF); font-size: 12px; font-size: var(--select-highlight-font, 12px); } .next-select-in-ie.next-select-trigger .next-select-values { /* 在 table 布局中,overflow: hidden 会导致负的 margin 失效 */ overflow: visible; } .next-select-in-ie.next-select-trigger .next-input-control, .next-select-in-ie.next-select-trigger .next-input-label { width: 1px; } .next-select-in-ie.next-select-trigger .next-input-control > * { display: table-cell; width: 1%; } .next-select-in-ie.next-select-trigger .next-select-arrow { display: table-cell; } .next-select-in-ie.next-select-trigger .next-select-clear { display: none; } .next-select-in-ie.next-select-trigger.next-select-multiple .next-select-inner, .next-select-in-ie.next-select-trigger.next-select-tag .next-select-inner { vertical-align: top; } .next-select-in-ie.next-select-trigger .next-select-inner { display: inline-table; } .next-select-in-ie.next-select-trigger.next-select-single .next-select-values { display: inline-table; } .next-select-in-ie.next-select-trigger.next-select-single .next-input.next-small .next-select-values { line-height: 20px; line-height: var(--form-element-small-height, 20px); } .next-select-in-ie.next-select-trigger.next-select-single .next-input.next-medium .next-select-values { line-height: 28px; line-height: var(--form-element-medium-height, 28px); } .next-select-in-ie.next-select-trigger.next-select-single .next-input.next-large .next-select-values { line-height: 40px; line-height: var(--form-element-large-height, 40px); } .next-select-in-ie.next-select-trigger .next-select-trigger-search > span { max-width: 100px; } .next-select-in-ie.next-select-trigger.next-select-single { /* 搜索框未激活,或者menu未展开,如果有值,则不显示搜索(placeholder) */ } .next-select-in-ie.next-select-trigger.next-select-single.next-select-in-ie-fixwidth .next-select-values { position: relative; } .next-select-in-ie.next-select-trigger.next-select-single.next-select-in-ie-fixwidth .next-select-values > em { position: absolute; display: inline-block; height: 100%; line-height: 1; vertical-align: middle; overflow: hidden; left: 4px; right: 0; top: 30%; } .next-select-in-ie.next-select-trigger.next-select-single.next-no-search .next-select-values > em + .next-select-trigger-search, .next-select-in-ie.next-select-trigger.next-select-single.next-inactive .next-select-values > em + .next-select-trigger-search { /* stylelint-disable */ filter: alpha(opacity=0); /* for IE 9 */ /* stylelint-enable */ font-size: 0; } .next-select-in-ie.next-select-trigger.next-no-search .next-select-trigger-search input { color: inherit; } @media screen and (-webkit-min-device-pixel-ratio: 0) { .next-select-multiple .next-select-compact .next-select-tag-compact { background: linear-gradient(90deg, rgba(255, 255, 255, 0), #FFFFFF 10px); background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--input-bg-color, #FFFFFF) 10px); } .next-select-multiple .next-disabled .next-select-tag-compact { background: linear-gradient(90deg, rgba(255, 255, 255, 0), #F7F8FA 10px); background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--input-disabled-bg-color, #F7F8FA) 10px); } } .next-select.next-select-multiple[dir='rtl'] .next-select-compact .next-select-tag-compact { left: 0; right: auto; padding: 0 16px 0 4px; background: linear-gradient(270deg, rgba(255, 255, 255, 0), #FFFFFF 10px); background: linear-gradient(270deg, rgba(255, 255, 255, 0), var(--input-bg-color, #FFFFFF) 10px); }