From 2b80870461df40abd281cef1fa87809480e8fd2b Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 23 Feb 2023 21:42:41 +0800 Subject: [PATCH] doc: update doc --- components/checkbox/style/index.less | 6 - .../checkbox/style/{index.tsx => index.ts} | 0 components/checkbox/style/mixin.less | 241 --------- components/checkbox/style/rtl.less | 28 -- components/input/style/IE11.less | 20 - components/input/style/affix.less | 74 --- components/input/style/allow-clear.less | 44 -- components/input/style/index.less | 86 ---- components/input/style/mixin.less | 470 ------------------ components/input/style/rtl.less | 206 -------- components/input/style/search-input.less | 70 --- components/input/style/status.less | 42 -- .../style/{dropdown.tsx => dropdown.ts} | 0 components/select/style/index.less | 330 ------------ .../select/style/{index.tsx => index.ts} | 0 components/select/style/multiple.less | 222 --------- .../style/{multiple.tsx => multiple.ts} | 0 components/select/style/rtl.less | 168 ------- components/select/style/single.less | 179 ------- .../select/style/{single.tsx => single.ts} | 0 components/select/style/status.less | 48 -- components/tree/style/directory.less | 72 --- components/tree/style/index.less | 16 - components/tree/style/{index.tsx => index.ts} | 0 components/tree/style/mixin.less | 322 ------------ components/tree/style/rtl.less | 72 --- package.json | 1 + site/scripts/genrateRoutes.js | 6 +- site/src/components/DemoBox.vue | 4 +- site/src/layouts/UserLayout.less | 2 - site/src/layouts/header/Github.vue | 3 +- site/src/layouts/header/Logo.vue | 1 - site/src/layouts/header/Navigation.vue | 1 - site/src/layouts/header/SearchBox.less | 2 - site/src/layouts/header/index.less | 1 - site/src/locale/en-US.js | 6 - site/src/locale/zh-CN.js | 6 - site/src/main.js | 3 - site/src/store/index.js | 60 --- site/src/store/user.js | 41 -- site/src/theme/static/colors.less | 242 --------- site/src/theme/static/contributors.less | 11 - site/src/theme/static/dark.less | 369 -------------- site/src/theme/static/design-doc.less | 18 - site/src/theme/static/footer.less | 2 - site/src/theme/static/header.less | 2 - site/src/theme/static/icon-pic-searcher.less | 51 -- site/src/theme/static/index.less | 30 +- site/src/theme/static/motion.less | 39 -- .../theme/static/new-version-info-modal.less | 24 - site/src/theme/static/reset.less | 46 -- site/src/theme/static/responsive.less | 2 - site/src/theme/static/rtl.less | 12 - site/src/theme/static/theme.less | 2 - site/src/views/ComponentOverview.less | 2 - site/src/views/jobs.vue | 173 ------- .../src/views/user/login/components/Login.vue | 96 ---- .../views/user/login/components/LoginItem.jsx | 44 -- .../user/login/components/LoginSubmit.vue | 21 - .../views/user/login/components/LoginTab.vue | 37 -- .../user/login/components/WrapFormItem.vue | 93 ---- site/src/views/user/login/components/index.js | 13 - .../views/user/login/components/index.less | 53 -- site/src/views/user/login/components/map.jsx | 83 ---- site/src/views/user/login/index.vue | 97 ---- site/src/views/user/login/locales/en-US.js | 77 --- site/src/views/user/login/locales/zh-CN.js | 74 --- site/src/views/user/login/model.js | 44 -- site/src/views/user/login/service.js | 12 - site/src/views/user/login/style.less | 36 -- site/src/views/user/login/utils/utils.js | 10 - site/src/views/user/register-result/index.vue | 59 --- .../user/register-result/locales/en-US.js | 23 - .../user/register-result/locales/zh-CN.js | 22 - .../src/views/user/register-result/style.less | 21 - site/src/views/user/register/index.vue | 248 --------- site/src/views/user/register/locales/en-US.js | 78 --- site/src/views/user/register/locales/zh-CN.js | 74 --- site/src/views/user/register/model.js | 24 - site/src/views/user/register/service.js | 8 - site/src/views/user/register/style.less | 52 -- site/src/views/vip.vue | 6 - site/themeConfig.ts | 55 -- site/vite.config.ts | 6 - 84 files changed, 8 insertions(+), 5336 deletions(-) delete mode 100644 components/checkbox/style/index.less rename components/checkbox/style/{index.tsx => index.ts} (100%) delete mode 100644 components/checkbox/style/mixin.less delete mode 100644 components/checkbox/style/rtl.less delete mode 100644 components/input/style/IE11.less delete mode 100644 components/input/style/affix.less delete mode 100644 components/input/style/allow-clear.less delete mode 100644 components/input/style/index.less delete mode 100644 components/input/style/mixin.less delete mode 100644 components/input/style/rtl.less delete mode 100644 components/input/style/search-input.less delete mode 100644 components/input/style/status.less rename components/select/style/{dropdown.tsx => dropdown.ts} (100%) delete mode 100644 components/select/style/index.less rename components/select/style/{index.tsx => index.ts} (100%) delete mode 100644 components/select/style/multiple.less rename components/select/style/{multiple.tsx => multiple.ts} (100%) delete mode 100644 components/select/style/rtl.less delete mode 100644 components/select/style/single.less rename components/select/style/{single.tsx => single.ts} (100%) delete mode 100644 components/select/style/status.less delete mode 100644 components/tree/style/directory.less delete mode 100644 components/tree/style/index.less rename components/tree/style/{index.tsx => index.ts} (100%) delete mode 100644 components/tree/style/mixin.less delete mode 100644 components/tree/style/rtl.less delete mode 100644 site/src/store/index.js delete mode 100644 site/src/store/user.js delete mode 100644 site/src/theme/static/colors.less delete mode 100644 site/src/theme/static/contributors.less delete mode 100644 site/src/theme/static/dark.less delete mode 100644 site/src/theme/static/design-doc.less delete mode 100644 site/src/theme/static/icon-pic-searcher.less delete mode 100644 site/src/theme/static/motion.less delete mode 100644 site/src/theme/static/new-version-info-modal.less delete mode 100644 site/src/theme/static/reset.less delete mode 100644 site/src/theme/static/rtl.less delete mode 100644 site/src/views/jobs.vue delete mode 100644 site/src/views/user/login/components/Login.vue delete mode 100644 site/src/views/user/login/components/LoginItem.jsx delete mode 100644 site/src/views/user/login/components/LoginSubmit.vue delete mode 100644 site/src/views/user/login/components/LoginTab.vue delete mode 100644 site/src/views/user/login/components/WrapFormItem.vue delete mode 100644 site/src/views/user/login/components/index.js delete mode 100644 site/src/views/user/login/components/index.less delete mode 100644 site/src/views/user/login/components/map.jsx delete mode 100644 site/src/views/user/login/index.vue delete mode 100644 site/src/views/user/login/locales/en-US.js delete mode 100644 site/src/views/user/login/locales/zh-CN.js delete mode 100644 site/src/views/user/login/model.js delete mode 100644 site/src/views/user/login/service.js delete mode 100644 site/src/views/user/login/style.less delete mode 100644 site/src/views/user/login/utils/utils.js delete mode 100644 site/src/views/user/register-result/index.vue delete mode 100644 site/src/views/user/register-result/locales/en-US.js delete mode 100644 site/src/views/user/register-result/locales/zh-CN.js delete mode 100644 site/src/views/user/register-result/style.less delete mode 100644 site/src/views/user/register/index.vue delete mode 100644 site/src/views/user/register/locales/en-US.js delete mode 100644 site/src/views/user/register/locales/zh-CN.js delete mode 100644 site/src/views/user/register/model.js delete mode 100644 site/src/views/user/register/service.js delete mode 100644 site/src/views/user/register/style.less delete mode 100644 site/src/views/vip.vue delete mode 100644 site/themeConfig.ts diff --git a/components/checkbox/style/index.less b/components/checkbox/style/index.less deleted file mode 100644 index cdb84297c..000000000 --- a/components/checkbox/style/index.less +++ /dev/null @@ -1,6 +0,0 @@ -@import '../../style/themes/index'; -@import './mixin'; - -.antCheckboxFn(); - -@import './rtl'; diff --git a/components/checkbox/style/index.tsx b/components/checkbox/style/index.ts similarity index 100% rename from components/checkbox/style/index.tsx rename to components/checkbox/style/index.ts diff --git a/components/checkbox/style/mixin.less b/components/checkbox/style/mixin.less deleted file mode 100644 index ae4a39d94..000000000 --- a/components/checkbox/style/mixin.less +++ /dev/null @@ -1,241 +0,0 @@ -@import '../../style/mixins/index'; - -.antCheckboxFn(@checkbox-prefix-cls: ~'@{ant-prefix}-checkbox') { - @checkbox-inner-prefix-cls: ~'@{checkbox-prefix-cls}-inner'; - // 一般状态 - .@{checkbox-prefix-cls} { - .reset-component(); - - position: relative; - top: 0.2em; - line-height: 1; - white-space: nowrap; - outline: none; - cursor: pointer; - - .@{checkbox-prefix-cls}-wrapper:hover &-inner, - &:hover &-inner, - &-input:focus + &-inner { - border-color: @checkbox-color; - } - - &-checked::after { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - border: 1px solid @checkbox-color; - border-radius: @border-radius-base; - visibility: hidden; - animation: antCheckboxEffect 0.36s ease-in-out; - animation-fill-mode: backwards; - content: ''; - } - - &:hover::after, - .@{checkbox-prefix-cls}-wrapper:hover &::after { - visibility: visible; - } - - &-inner { - position: relative; - top: 0; - left: 0; - display: block; - width: @checkbox-size; - height: @checkbox-size; - direction: ltr; - background-color: @checkbox-check-bg; - border: @checkbox-border-width @border-style-base @border-color-base; - border-radius: @checkbox-border-radius; - // Fix IE checked style - // https://github.com/ant-design/ant-design/issues/12597 - border-collapse: separate; - transition: all 0.3s; - - &::after { - @check-width: (@checkbox-size / 14) * 5px; - @check-height: (@checkbox-size / 14) * 8px; - - position: absolute; - top: 50%; - // https://github.com/ant-design/ant-design/pull/19452 - // https://github.com/ant-design/ant-design/pull/31726 - left: 21.5%; - display: table; - width: @check-width; - height: @check-height; - border: 2px solid @checkbox-check-color; - border-top: 0; - border-left: 0; - transform: rotate(45deg) scale(0) translate(-50%, -50%); - opacity: 0; - transition: all 0.1s @ease-in-back, opacity 0.1s; - content: ' '; - } - } - - &-input { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1; - width: 100%; - height: 100%; - cursor: pointer; - opacity: 0; - } - } - - // 选中状态 - .@{checkbox-prefix-cls}-checked .@{checkbox-inner-prefix-cls}::after { - position: absolute; - display: table; - border: 2px solid @checkbox-check-color; - border-top: 0; - border-left: 0; - transform: rotate(45deg) scale(1) translate(-50%, -50%); - opacity: 1; - transition: all 0.2s @ease-out-back 0.1s; - content: ' '; - } - - .@{checkbox-prefix-cls}-checked { - .@{checkbox-inner-prefix-cls} { - background-color: @checkbox-color; - border-color: @checkbox-color; - } - } - - .@{checkbox-prefix-cls}-disabled { - cursor: not-allowed; - - &.@{checkbox-prefix-cls}-checked { - .@{checkbox-inner-prefix-cls}::after { - border-color: @disabled-color; - animation-name: none; - } - } - - .@{checkbox-prefix-cls}-input { - cursor: not-allowed; - pointer-events: none; - } - - .@{checkbox-inner-prefix-cls} { - background-color: @input-disabled-bg; - border-color: @border-color-base !important; - - &::after { - border-color: @input-disabled-bg; - border-collapse: separate; - animation-name: none; - } - } - - & + span { - color: @disabled-color; - cursor: not-allowed; - } - - // Not show highlight border of checkbox when disabled - &:hover::after, - .@{checkbox-prefix-cls}-wrapper:hover &::after { - visibility: hidden; - } - } - - .@{checkbox-prefix-cls}-wrapper { - .reset-component(); - display: inline-flex; - align-items: baseline; - line-height: unset; - cursor: pointer; - - &::after { - display: inline-block; - width: 0; - overflow: hidden; - content: '\a0'; - } - - &.@{checkbox-prefix-cls}-wrapper-disabled { - cursor: not-allowed; - } - - & + & { - margin-left: 8px; - } - - &&-in-form-item { - input[type='checkbox'] { - width: 14px; - height: 14px; - } - } - } - - .@{checkbox-prefix-cls} + span { - padding-right: 8px; - padding-left: 8px; - } - - .@{checkbox-prefix-cls}-group { - .reset-component(); - display: inline-block; - - &-item { - margin-right: @checkbox-group-item-margin-right; - - &:last-child { - margin-right: 0; - } - } - - &-item + &-item { - margin-left: 0; - } - } - - // 半选状态 - .@{checkbox-prefix-cls}-indeterminate { - .@{checkbox-inner-prefix-cls} { - background-color: @checkbox-check-bg; - border-color: @border-color-base; - } - .@{checkbox-inner-prefix-cls}::after { - @indeterminate-width: @checkbox-size - 8px; - @indeterminate-height: @checkbox-size - 8px; - - top: 50%; - left: 50%; - width: @indeterminate-width; - height: @indeterminate-height; - background-color: @checkbox-color; - border: 0; - transform: translate(-50%, -50%) scale(1); - opacity: 1; - content: ' '; - } - - &.@{checkbox-prefix-cls}-disabled .@{checkbox-inner-prefix-cls}::after { - background-color: @disabled-color; - border-color: @disabled-color; - } - } -} - -@keyframes antCheckboxEffect { - 0% { - transform: scale(1); - opacity: 0.5; - } - - 100% { - transform: scale(1.6); - opacity: 0; - } -} diff --git a/components/checkbox/style/rtl.less b/components/checkbox/style/rtl.less deleted file mode 100644 index fa15b4df1..000000000 --- a/components/checkbox/style/rtl.less +++ /dev/null @@ -1,28 +0,0 @@ -@import '../../style/mixins/index'; - -.antCheckboxFn(@checkbox-prefix-cls: ~'@{ant-prefix}-checkbox') { - .@{checkbox-prefix-cls}-rtl { - direction: rtl; - } - - .@{checkbox-prefix-cls}-group { - &-item { - .@{checkbox-prefix-cls}-group-rtl & { - margin-right: 0; - margin-left: @checkbox-group-item-margin-right; - } - - &:last-child { - .@{checkbox-prefix-cls}-group-rtl & { - margin-left: 0 !important; - } - } - } - - &-item + &-item { - .@{checkbox-prefix-cls}-group-rtl & { - margin-left: @checkbox-group-item-margin-right; - } - } - } -} diff --git a/components/input/style/IE11.less b/components/input/style/IE11.less deleted file mode 100644 index 984413e6d..000000000 --- a/components/input/style/IE11.less +++ /dev/null @@ -1,20 +0,0 @@ -// Fix Input component height issue in IE11 -@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { - .@{ant-prefix}-input { - height: @input-height-base; - - &-lg { - height: @input-height-lg; - } - - &-sm { - height: @input-height-sm; - } - - &-affix-wrapper { - > input.@{ant-prefix}-input { - height: auto; - } - } - } -} diff --git a/components/input/style/affix.less b/components/input/style/affix.less deleted file mode 100644 index 5f9240444..000000000 --- a/components/input/style/affix.less +++ /dev/null @@ -1,74 +0,0 @@ -@import './mixin'; -@import (reference) '../../style/themes/index'; -@input-prefix-cls: ~'@{ant-prefix}-input'; - -@input-affix-margin: 4px; - -.@{ant-prefix}-input { - &-affix-wrapper { - .input(); - display: inline-flex; - - &:not(&-disabled):hover { - .hover(); - z-index: 1; - .@{ant-prefix}-input-search-with-button & { - z-index: 0; - } - } - - &-focused, - &:focus { - z-index: 1; - } - - &-disabled { - .@{ant-prefix}-input[disabled] { - background: transparent; - } - } - - > input.@{ant-prefix}-input { - padding: 0; - border: none; - outline: none; - - &:focus { - box-shadow: none !important; - } - } - - &::before { - width: 0; - visibility: hidden; - content: '\a0'; - } - } - - &-prefix, - &-suffix { - display: flex; - flex: none; - align-items: center; - - > *:not(:last-child) { - margin-right: 8px; - } - } - - &-show-count-suffix { - color: @text-color-secondary; - } - - &-show-count-has-suffix { - margin-right: 2px; - } - - &-prefix { - margin-right: @input-affix-margin; - } - - &-suffix { - margin-left: @input-affix-margin; - } -} diff --git a/components/input/style/allow-clear.less b/components/input/style/allow-clear.less deleted file mode 100644 index 946541ef4..000000000 --- a/components/input/style/allow-clear.less +++ /dev/null @@ -1,44 +0,0 @@ -@import (reference) '../../style/themes/index'; -@input-prefix-cls: ~'@{ant-prefix}-input'; - -// ========================= Input ========================= -.@{iconfont-css-prefix}.@{ant-prefix}-input-clear-icon, -.@{ant-prefix}-input-clear-icon { - margin: 0; - color: @disabled-color; - font-size: @font-size-sm; - vertical-align: -1px; - // https://github.com/ant-design/ant-design/pull/18151 - // https://codesandbox.io/s/wizardly-sun-u10br - cursor: pointer; - transition: color 0.3s; - - &:hover { - color: @text-color-secondary; - } - - &:active { - color: @text-color; - } - - &-hidden { - visibility: hidden; - } - - &-has-suffix { - margin: 0 @input-affix-margin; - } -} - -// ======================= TextArea ======================== -.@{ant-prefix}-input-affix-wrapper-textarea-with-clear-btn { - padding: 0 !important; - border: 0 !important; - - .@{ant-prefix}-input-clear-icon { - position: absolute; - top: 8px; - right: 8px; - z-index: 1; - } -} diff --git a/components/input/style/index.less b/components/input/style/index.less deleted file mode 100644 index 36e1c9266..000000000 --- a/components/input/style/index.less +++ /dev/null @@ -1,86 +0,0 @@ -@import '../../style/themes/index'; -@import '../../style/mixins/index'; -@import './mixin'; -@import './affix'; -@import './allow-clear'; -@import './status'; - -@input-prefix-cls: ~'@{ant-prefix}-input'; - -// Input styles -.@{input-prefix-cls} { - .reset-component(); - .input(); - - //== Style for input-group: input with label, with button or dropdown... - &-group { - .reset-component(); - .input-group(~'@{input-prefix-cls}'); - - &-wrapper { - display: inline-block; - width: 100%; - text-align: start; - vertical-align: top; // https://github.com/ant-design/ant-design/issues/6403 - } - } - - &-password-icon.@{iconfont-css-prefix} { - color: @text-color-secondary; - cursor: pointer; - transition: all 0.3s; - - &:hover { - color: @input-icon-hover-color; - } - } - - &[type='color'] { - height: @input-height-base; - - &.@{input-prefix-cls}-lg { - height: @input-height-lg; - } - &.@{input-prefix-cls}-sm { - height: @input-height-sm; - padding-top: 3px; - padding-bottom: 3px; - } - } - - &-textarea-show-count { - // https://github.com/ant-design/ant-design/issues/33049 - > .@{input-prefix-cls} { - height: 100%; - } - - &::after { - float: right; - color: @text-color-secondary; - white-space: nowrap; - content: attr(data-count); - pointer-events: none; - } - - &.@{input-prefix-cls}-textarea-in-form-item { - &::after { - margin-bottom: -22px; - } - } - } - - &-textarea-suffix { - position: absolute; - top: 0; - right: @input-padding-horizontal-base; - bottom: 0; - z-index: 1; - display: inline-flex; - align-items: center; - margin: auto; - } -} - -@import './search-input'; -@import './rtl'; -@import './IE11'; diff --git a/components/input/style/mixin.less b/components/input/style/mixin.less deleted file mode 100644 index fd5f99483..000000000 --- a/components/input/style/mixin.less +++ /dev/null @@ -1,470 +0,0 @@ -@import '../../style/themes/index'; -@import '../../style/mixins/index'; - -@input-affix-with-clear-btn-width: 38px; - -// size mixins for input -.input-lg() { - padding: @input-padding-vertical-lg @input-padding-horizontal-lg; - font-size: @font-size-lg; -} - -.input-sm() { - padding: @input-padding-vertical-sm @input-padding-horizontal-sm; -} - -// input status -// == when focus or active -.active(@borderColor: @primary-color; @hoverBorderColor: @primary-color-hover; @outlineColor: @primary-color-outline) { - & when (@theme = dark) { - border-color: @borderColor; - } - & when (not (@theme = dark) and not (@theme = variable)) { - border-color: @hoverBorderColor; - } - & when not (@theme = variable) { - box-shadow: @input-outline-offset @outline-blur-size @outline-width - fade(@borderColor, @outline-fade); - } - & when (@theme = variable) { - border-color: @hoverBorderColor; - box-shadow: @input-outline-offset @outline-blur-size @outline-width @outlineColor; - } - border-right-width: @border-width-base; - outline: 0; -} - -// == when hover -.hover(@color: @input-hover-border-color) { - border-color: @color; - border-right-width: @border-width-base; -} - -.disabled() { - color: @input-disabled-color; - background-color: @input-disabled-bg; - border-color: @input-border-color; - box-shadow: none; - cursor: not-allowed; - opacity: 1; - - &:hover { - .hover(@input-border-color); - } -} - -// Basic style for input -.input() { - position: relative; - display: inline-block; - width: 100%; - min-width: 0; - padding: @input-padding-vertical-base @input-padding-horizontal-base; - color: @input-color; - font-size: @font-size-base; - line-height: @line-height-base; - background-color: @input-bg; - background-image: none; - border: @border-width-base @border-style-base @input-border-color; - border-radius: @control-border-radius; - transition: all 0.3s; - .placeholder(); // Reset placeholder - - &:hover { - .hover(); - } - - &:focus, - &-focused { - .active(); - } - - &-disabled { - .disabled(); - } - - &[disabled] { - .disabled(); - } - - &-borderless { - &, - &:hover, - &:focus, - &-focused, - &-disabled, - &[disabled] { - background-color: transparent; - border: none; - box-shadow: none; - } - } - - // Reset height for `textarea`s - textarea& { - max-width: 100%; // prevent textearea resize from coming out of its container - height: auto; - min-height: @input-height-base; - line-height: @line-height-base; - vertical-align: bottom; - transition: all 0.3s, height 0s; - } - - // Size - &-lg { - .input-lg(); - } - - &-sm { - .input-sm(); - } -} - -// label input -.input-group(@inputClass) { - position: relative; - display: table; - width: 100%; - border-collapse: separate; - border-spacing: 0; - - // Undo padding and float of grid classes - &[class*='col-'] { - float: none; - padding-right: 0; - padding-left: 0; - } - - > [class*='col-'] { - padding-right: 8px; - - &:last-child { - padding-right: 0; - } - } - - &-addon, - &-wrap, - > .@{inputClass} { - display: table-cell; - - &:not(:first-child):not(:last-child) { - border-radius: 0; - } - } - - &-addon, - &-wrap { - width: 1px; // To make addon/wrap as small as possible - white-space: nowrap; - vertical-align: middle; - } - - &-wrap > * { - display: block !important; - } - - .@{inputClass} { - float: left; - width: 100%; - margin-bottom: 0; - text-align: inherit; - - &:focus { - z-index: 1; // Fix https://gw.alipayobjects.com/zos/rmsportal/DHNpoqfMXSfrSnlZvhsJ.png - border-right-width: 1px; - } - - &:hover { - z-index: 1; - border-right-width: 1px; - .@{ant-prefix}-input-search-with-button & { - z-index: 0; - } - } - } - - &-addon { - position: relative; - padding: 0 @input-padding-horizontal-base; - color: @input-color; - font-weight: normal; - font-size: @font-size-base; - text-align: center; - background-color: @input-addon-bg; - border: @border-width-base @border-style-base @input-border-color; - border-radius: @control-border-radius; - transition: all 0.3s; - - // Reset Select's style in addon - .@{ant-prefix}-select { - margin: -(@input-padding-vertical-base + 1px) (-@input-padding-horizontal-base); - - &.@{ant-prefix}-select-single:not(.@{ant-prefix}-select-customize-input) - .@{ant-prefix}-select-selector { - background-color: inherit; - border: @border-width-base @border-style-base transparent; - box-shadow: none; - } - - &-open, - &-focused { - .@{ant-prefix}-select-selector { - color: @primary-color; - } - } - } - - // https://github.com/ant-design/ant-design/issues/31333 - .@{ant-prefix}-cascader-picker { - margin: -9px (-@control-padding-horizontal); - background-color: transparent; - .@{ant-prefix}-cascader-input { - text-align: left; - border: 0; - box-shadow: none; - } - } - } - - // Reset rounded corners - > .@{inputClass}:first-child, - &-addon:first-child { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - - // Reset Select's style in addon - .@{ant-prefix}-select .@{ant-prefix}-select-selector { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - } - } - - > .@{inputClass}-affix-wrapper { - &:not(:first-child) .@{inputClass} { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - } - - &:not(:last-child) .@{inputClass} { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - } - } - - &-addon:first-child { - border-right: 0; - } - - &-addon:last-child { - border-left: 0; - } - - > .@{inputClass}:last-child, - &-addon:last-child { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - - // Reset Select's style in addon - .@{ant-prefix}-select .@{ant-prefix}-select-selector { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - } - } - - // Sizing options - &-lg .@{inputClass}, - &-lg > &-addon { - .input-lg(); - } - - &-sm .@{inputClass}, - &-sm > &-addon { - .input-sm(); - } - - // Fix https://github.com/ant-design/ant-design/issues/5754 - &-lg .@{ant-prefix}-select-single .@{ant-prefix}-select-selector { - height: @input-height-lg; - } - - &-sm .@{ant-prefix}-select-single .@{ant-prefix}-select-selector { - height: @input-height-sm; - } - - .@{inputClass}-affix-wrapper { - &:not(:last-child) { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - .@{ant-prefix}-input-search & { - border-top-left-radius: @control-border-radius; - border-bottom-left-radius: @control-border-radius; - } - } - - &:not(:first-child), - .@{ant-prefix}-input-search &:not(:first-child) { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - } - } - - &&-compact { - display: block; - .clearfix(); - - &-addon, - &-wrap, - > .@{inputClass} { - &:not(:first-child):not(:last-child) { - border-right-width: @border-width-base; - - &:hover { - z-index: 1; - } - - &:focus { - z-index: 1; - } - } - } - - & > * { - display: inline-block; - float: none; - vertical-align: top; // https://github.com/ant-design/ant-design-pro/issues/139 - border-radius: 0; - } - - & > .@{inputClass}-affix-wrapper { - display: inline-flex; - } - - & > .@{ant-prefix}-picker-range { - display: inline-flex; - } - - & > *:not(:last-child) { - margin-right: -@border-width-base; - border-right-width: @border-width-base; - } - - // Undo float for .ant-input-group .ant-input - .@{inputClass} { - float: none; - } - - // reset border for Select, DatePicker, AutoComplete, Cascader, Mention, TimePicker, Input - & > .@{ant-prefix}-select > .@{ant-prefix}-select-selector, - & > .@{ant-prefix}-select-auto-complete .@{ant-prefix}-input, - & > .@{ant-prefix}-cascader-picker .@{ant-prefix}-input, - & > .@{ant-prefix}-input-group-wrapper .@{ant-prefix}-input { - border-right-width: @border-width-base; - border-radius: 0; - - &:hover { - z-index: 1; - } - - &:focus { - z-index: 1; - } - } - - & > .@{ant-prefix}-select-focused { - z-index: 1; - } - - // update z-index for arrow icon - & > .@{ant-prefix}-select > .@{ant-prefix}-select-arrow { - z-index: 1; // https://github.com/ant-design/ant-design/issues/20371 - } - - & > *:first-child, - & > .@{ant-prefix}-select:first-child > .@{ant-prefix}-select-selector, - & > .@{ant-prefix}-select-auto-complete:first-child .@{ant-prefix}-input, - & > .@{ant-prefix}-cascader-picker:first-child .@{ant-prefix}-input { - border-top-left-radius: @control-border-radius; - border-bottom-left-radius: @control-border-radius; - } - - & > *:last-child, - & > .@{ant-prefix}-select:last-child > .@{ant-prefix}-select-selector, - & > .@{ant-prefix}-cascader-picker:last-child .@{ant-prefix}-input, - & > .@{ant-prefix}-cascader-picker-focused:last-child .@{ant-prefix}-input { - border-right-width: @border-width-base; - border-top-right-radius: @control-border-radius; - border-bottom-right-radius: @control-border-radius; - } - - // https://github.com/ant-design/ant-design/issues/12493 - & > .@{ant-prefix}-select-auto-complete .@{ant-prefix}-input { - vertical-align: top; - } - - .@{ant-prefix}-input-group-wrapper + .@{ant-prefix}-input-group-wrapper { - margin-left: -1px; - .@{ant-prefix}-input-affix-wrapper { - border-radius: 0; - } - } - - .@{ant-prefix}-input-group-wrapper:not(:last-child) { - &.@{ant-prefix}-input-search > .@{ant-prefix}-input-group { - & > .@{ant-prefix}-input-group-addon > .@{ant-prefix}-input-search-button { - border-radius: 0; - } - - & > .@{ant-prefix}-input { - border-radius: @control-border-radius 0 0 @control-border-radius; - } - } - } - } -} - -.status-color( - @prefix-cls: @input-prefix-cls; - @text-color: @input-color; - @border-color: @input-border-color; - @background-color: @input-bg; - @hoverBorderColor: @primary-color-hover; - @outlineColor: @primary-color-outline; -) { - &:not(.@{prefix-cls}-disabled):not(.@{prefix-cls}-borderless).@{prefix-cls} { - &, - &:hover { - background: @background-color; - border-color: @border-color; - } - - &:focus, - &-focused { - .active(@text-color, @hoverBorderColor, @outlineColor); - } - } -} - -.status-color-common( - @prefix-cls: @input-prefix-cls; - @text-color: @input-color; - @border-color: @input-border-color; - @background-color: @input-bg; - @hoverBorderColor: @primary-color-hover; - @outlineColor: @primary-color-outline; -) { - .@{prefix-cls}-prefix { - color: @text-color; - } -} - -.group-status-color( - @prefix-cls: @input-prefix-cls; - @text-color: @input-color; - @border-color: @input-border-color; -) { - .@{prefix-cls}-group-addon { - color: @text-color; - border-color: @border-color; - } -} diff --git a/components/input/style/rtl.less b/components/input/style/rtl.less deleted file mode 100644 index 64799d9bb..000000000 --- a/components/input/style/rtl.less +++ /dev/null @@ -1,206 +0,0 @@ -@import '../../style/themes/index'; -@import '../../style/mixins/index'; - -//== Style for input-group: input with label, with button or dropdown... -.@{ant-prefix}-input-group { - &-wrapper { - &-rtl { - direction: rtl; - } - } - - &-rtl { - direction: rtl; - } -} - -// affix -@input-affix-margin: 4px; - -.@{ant-prefix}-input { - &-affix-wrapper&-affix-wrapper-rtl { - > input.@{ant-prefix}-input { - border: none; - outline: none; - } - } - - &-affix-wrapper-rtl { - .@{ant-prefix}-input-prefix { - margin: 0 0 0 @input-affix-margin; - } - - .@{ant-prefix}-input-suffix { - margin: 0 @input-affix-margin 0 0; - } - } - - &-textarea { - &-rtl { - direction: rtl; - } - - &-rtl&-show-count::after { - text-align: left; - } - } -} - -// allow-clear -.@{ant-prefix}-input-clear-icon { - &-has-suffix { - .@{ant-prefix}-input-affix-wrapper-rtl & { - margin-right: 0; - margin-left: @input-affix-margin; - } - } - - .@{ant-prefix}-input-affix-wrapper-rtl & { - right: auto; - left: 8px; - } -} - -// mixin -@input-rtl-cls: ~'@{ant-prefix}-input-rtl'; - -.active() { - .@{input-rtl-cls} & { - border-right-width: 0; - border-left-width: @border-width-base !important; - } -} - -.hover() { - .@{input-rtl-cls} & { - border-right-width: 0; - border-left-width: @border-width-base !important; - } -} - -.input() { - &-rtl { - direction: rtl; - } -} - -// label input -.input-group(@inputClass) { - > .@{inputClass}-rtl:first-child, - &-rtl &-addon:first-child { - border-radius: 0 @border-radius-base @border-radius-base 0; - } - - &-addon:first-child { - .@{inputClass}-group-rtl & { - border-right: @border-width-base @border-style-base @input-border-color; - border-left: 0; - } - } - - &-addon:last-child { - .@{inputClass}-group-rtl & { - border-right: 0; - border-left: @border-width-base @border-style-base @input-border-color; - } - } - - > .@{inputClass}:last-child, - &-addon:last-child { - .@{inputClass}-group-rtl& { - border-radius: @border-radius-base 0 0 @border-radius-base; - } - } - - .@{inputClass}-affix-wrapper { - &:not(:first-child) { - .@{inputClass}-group-rtl& { - border-radius: @border-radius-base 0 0 @border-radius-base; - } - } - - &:not(:last-child) { - .@{inputClass}-group-rtl& { - border-radius: 0 @border-radius-base @border-radius-base 0; - } - } - } - - &&-compact { - & > *:not(:last-child) { - .@{inputClass}-group-rtl& { - margin-right: 0; - margin-left: -@border-width-base; - border-left-width: @border-width-base; - } - } - - & > *:first-child, - & > .@{ant-prefix}-select:first-child > .@{ant-prefix}-select-selector, - & > .@{ant-prefix}-select-auto-complete:first-child .@{ant-prefix}-input, - & > .@{ant-prefix}-cascader-picker:first-child .@{ant-prefix}-input { - .@{inputClass}-group-rtl& { - border-radius: 0 @border-radius-base @border-radius-base 0; - } - } - - & > *:last-child, - & > .@{ant-prefix}-select:last-child > .@{ant-prefix}-select-selector, - & > .@{ant-prefix}-select-auto-complete:last-child .@{ant-prefix}-input, - & > .@{ant-prefix}-cascader-picker:last-child .@{ant-prefix}-input, - & > .@{ant-prefix}-cascader-picker-focused:last-child .@{ant-prefix}-input { - .@{inputClass}-group-rtl& { - border-left-width: @border-width-base; - border-radius: @border-radius-base 0 0 @border-radius-base; - } - } - - .@{ant-prefix}-input-group-wrapper-rtl + .@{ant-prefix}-input-group-wrapper-rtl { - margin-right: -1px; - margin-left: 0; - } - - .@{ant-prefix}-input-group-wrapper-rtl:not(:last-child) { - &.@{ant-prefix}-input-search > .@{ant-prefix}-input-group { - & > .@{ant-prefix}-input { - border-radius: 0 @border-radius-base @border-radius-base 0; - } - } - } - } -} - -// search-input -@search-prefix: ~'@{ant-prefix}-input-search'; -@search-rtl-cls: ~'@{search-prefix}-rtl'; - -.@{search-prefix}-rtl { - direction: rtl; - - .@{ant-prefix}-input { - &:hover, - &:focus { - + .@{ant-prefix}-input-group-addon .@{search-prefix}-button:not(.@{ant-prefix}-btn-primary) { - border-right-color: @input-hover-border-color; - border-left-color: @border-color-base; - } - } - } - - > .@{ant-prefix}-input-group { - > .@{ant-prefix}-input-affix-wrapper { - &:hover, - &-focused { - border-right-color: @input-hover-border-color; - } - } - - > .@{ant-prefix}-input-group-addon { - right: -1px; - left: auto; - .@{search-prefix}-button { - border-radius: @border-radius-base 0 0 @border-radius-base; - } - } - } -} diff --git a/components/input/style/search-input.less b/components/input/style/search-input.less deleted file mode 100644 index 7a92cfb2d..000000000 --- a/components/input/style/search-input.less +++ /dev/null @@ -1,70 +0,0 @@ -@import '../../style/themes/index'; -@import '../../style/mixins/index'; -@import './mixin'; - -@search-prefix: ~'@{ant-prefix}-input-search'; - -.@{search-prefix} { - .@{ant-prefix}-input { - &:hover, - &:focus { - border-color: @input-hover-border-color; - - + .@{ant-prefix}-input-group-addon .@{search-prefix}-button:not(.@{ant-prefix}-btn-primary) { - border-left-color: @input-hover-border-color; - } - } - } - - .@{ant-prefix}-input-affix-wrapper { - border-radius: 0; - } - - // fix slight height diff in Firefox: - // https://ant.design/components/auto-complete-cn/#components-auto-complete-demo-certain-category - .@{ant-prefix}-input-lg { - line-height: @line-height-base - 0.0002; - } - - > .@{ant-prefix}-input-group { - > .@{ant-prefix}-input-group-addon:last-child { - left: -1px; - padding: 0; - border: 0; - - .@{search-prefix}-button { - padding-top: 0; - padding-bottom: 0; - border-radius: 0 @border-radius-base @border-radius-base 0; - } - - .@{search-prefix}-button:not(.@{ant-prefix}-btn-primary) { - color: @text-color-secondary; - - &.@{ant-prefix}-btn-loading::before { - top: 0; - right: 0; - bottom: 0; - left: 0; - } - } - } - } - - &-button { - height: @input-height-base; - - &:hover, - &:focus { - z-index: 1; - } - } - - &-large &-button { - height: @input-height-lg; - } - - &-small &-button { - height: @input-height-sm; - } -} diff --git a/components/input/style/status.less b/components/input/style/status.less deleted file mode 100644 index e6562e602..000000000 --- a/components/input/style/status.less +++ /dev/null @@ -1,42 +0,0 @@ -@import './mixin'; - -@input-prefix-cls: ~'@{ant-prefix}-input'; - -@input-wrapper-cls: @input-prefix-cls, ~'@{input-prefix-cls}-affix-wrapper'; - -each(@input-wrapper-cls, { - .@{value} { - &-status-error { - .status-color(@value, @error-color, @error-color, @input-bg, @error-color-hover, @error-color-outline); - .status-color-common(@input-prefix-cls, @error-color, @error-color, @input-bg, @error-color-hover, @error-color-outline); - } - - &-status-warning { - .status-color(@value, @warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline); - .status-color-common(@input-prefix-cls, @warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline); - } - } -}); - -.@{input-prefix-cls}-textarea { - &-status-error, - &-status-warning, - &-status-success, - &-status-validating { - &.@{input-prefix-cls}-textarea-has-feedback { - .@{input-prefix-cls} { - padding-right: 24px; - } - } - } -} - -.@{input-prefix-cls}-group-wrapper { - &-status-error { - .group-status-color(@input-prefix-cls, @error-color, @error-color); - } - - &-status-warning { - .group-status-color(@input-prefix-cls, @warning-color, @warning-color); - } -} diff --git a/components/select/style/dropdown.tsx b/components/select/style/dropdown.ts similarity index 100% rename from components/select/style/dropdown.tsx rename to components/select/style/dropdown.ts diff --git a/components/select/style/index.less b/components/select/style/index.less deleted file mode 100644 index 474101f26..000000000 --- a/components/select/style/index.less +++ /dev/null @@ -1,330 +0,0 @@ -@import '../../style/themes/index'; -@import '../../style/mixins/index'; -@import '../../input/style/mixin'; -@import './single'; -@import './multiple'; -@import './status'; - -@select-prefix-cls: ~'@{ant-prefix}-select'; -@select-height-without-border: @input-height-base - 2 * @border-width-base; -@select-dropdown-edge-child-vertical-padding: @dropdown-edge-child-vertical-padding; - -.select-selector() { - position: relative; - background-color: @select-background; - border: @border-width-base @border-style-base @select-border-color; - border-radius: @control-border-radius; - transition: all 0.3s @ease-in-out; - - input { - cursor: pointer; - } - - .@{select-prefix-cls}-show-search& { - cursor: text; - - input { - cursor: auto; - } - } - - .@{select-prefix-cls}-focused:not(.@{select-prefix-cls}-disabled)& { - .active(); - } - - .@{select-prefix-cls}-disabled& { - color: @disabled-color; - background: @input-disabled-bg; - cursor: not-allowed; - - .@{select-prefix-cls}-multiple& { - background: @select-multiple-disabled-background; - } - - input { - cursor: not-allowed; - } - } -} - -/* Reset search input style */ -.select-search-input-without-border() { - .@{select-prefix-cls}-selection-search-input { - margin: 0; - padding: 0; - background: transparent; - border: none; - outline: none; - appearance: none; - - &::-webkit-search-cancel-button { - display: none; - /* stylelint-disable-next-line property-no-vendor-prefix */ - -webkit-appearance: none; - } - } -} - -.@{select-prefix-cls} { - .reset-component(); - position: relative; - display: inline-block; - cursor: pointer; - - &:not(&-customize-input) &-selector { - .select-selector(); - .select-search-input-without-border(); - } - - &:not(&-disabled):hover &-selector { - .hover(); - } - - // ======================== Selection ======================== - &-selection-item { - flex: 1; - overflow: hidden; - font-weight: normal; - white-space: nowrap; - text-overflow: ellipsis; - - // IE11 css hack. `*::-ms-backdrop,` is a must have - @media all and (-ms-high-contrast: none) { - *::-ms-backdrop, - & { - flex: auto; - } - } - } - - // ======================= Placeholder ======================= - &-selection-placeholder { - flex: 1; - overflow: hidden; - color: @input-placeholder-color; - white-space: nowrap; - text-overflow: ellipsis; - pointer-events: none; - - // IE11 css hack. `*::-ms-backdrop,` is a must have - @media all and (-ms-high-contrast: none) { - *::-ms-backdrop, - & { - flex: auto; - } - } - } - - // ========================== Arrow ========================== - &-arrow { - .iconfont-mixin(); - position: absolute; - top: 50%; - right: @control-padding-horizontal - 1px; - display: flex; - align-items: center; - height: @font-size-sm; - margin-top: (-@font-size-sm / 2); - color: @disabled-color; - font-size: @font-size-sm; - line-height: 1; - text-align: center; - pointer-events: none; - - .@{iconfont-css-prefix} { - vertical-align: top; - transition: transform 0.3s; - - > svg { - vertical-align: top; - } - - &:not(.@{select-prefix-cls}-suffix) { - pointer-events: auto; - } - } - - .@{select-prefix-cls}-disabled & { - cursor: not-allowed; - } - - > *:not(:last-child) { - margin-inline-end: @padding-xs; - } - } - - // ========================== Clear ========================== - &-clear { - position: absolute; - top: 50%; - right: @control-padding-horizontal - 1px; - z-index: 1; - display: inline-block; - width: @font-size-sm; - height: @font-size-sm; - margin-top: (-@font-size-sm / 2); - color: @disabled-color; - font-size: @font-size-sm; - font-style: normal; - line-height: 1; - text-align: center; - text-transform: none; - background: @select-clear-background; - cursor: pointer; - opacity: 0; - transition: color 0.3s ease, opacity 0.15s ease; - text-rendering: auto; - - &::before { - display: block; - } - - &:hover { - color: @text-color-secondary; - } - - .@{select-prefix-cls}:hover & { - opacity: 1; - } - } - - // ========================== Popup ========================== - &-dropdown { - .reset-component(); - position: absolute; - top: -9999px; - left: -9999px; - z-index: @zindex-dropdown; - box-sizing: border-box; - padding: @select-dropdown-edge-child-vertical-padding 0; - overflow: hidden; - font-size: @font-size-base; - // Fix select render lag of long text in chrome - // https://github.com/ant-design/ant-design/issues/11456 - // https://github.com/ant-design/ant-design/issues/11843 - font-variant: initial; - background-color: @select-dropdown-bg; - border-radius: @border-radius-base; - outline: none; - box-shadow: @box-shadow-base; - - &.@{ant-prefix}-slide-up-enter.@{ant-prefix}-slide-up-enter-active&-placement-bottomLeft, - &.@{ant-prefix}-slide-up-appear.@{ant-prefix}-slide-up-appear-active&-placement-bottomLeft { - animation-name: antSlideUpIn; - } - - &.@{ant-prefix}-slide-up-enter.@{ant-prefix}-slide-up-enter-active&-placement-topLeft, - &.@{ant-prefix}-slide-up-appear.@{ant-prefix}-slide-up-appear-active&-placement-topLeft { - animation-name: antSlideDownIn; - } - - &.@{ant-prefix}-slide-up-leave.@{ant-prefix}-slide-up-leave-active&-placement-bottomLeft { - animation-name: antSlideUpOut; - } - - &.@{ant-prefix}-slide-up-leave.@{ant-prefix}-slide-up-leave-active&-placement-topLeft { - animation-name: antSlideDownOut; - } - - &-hidden { - display: none; - } - - &-empty { - color: @disabled-color; - } - } - - // ========================= Options ========================= - .item() { - position: relative; - display: block; - min-height: @select-dropdown-height; - padding: @select-dropdown-vertical-padding @control-padding-horizontal; - color: @text-color; - font-weight: normal; - font-size: @select-dropdown-font-size; - line-height: @select-dropdown-line-height; - } - - &-item-empty { - .item(); - color: @disabled-color; - } - - &-item { - .item(); - - cursor: pointer; - transition: background 0.3s ease; - - // =========== Group ============ - &-group { - color: @text-color-secondary; - font-size: @font-size-sm; - cursor: default; - } - - // =========== Option =========== - &-option { - display: flex; - - &-content { - flex: auto; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - - &-state { - flex: none; - } - - &-active:not(&-disabled) { - background-color: @select-item-active-bg; - } - - &-selected:not(&-disabled) { - color: @select-item-selected-color; - font-weight: @select-item-selected-font-weight; - background-color: @select-item-selected-bg; - - .@{select-prefix-cls}-item-option-state { - color: @primary-color; - } - } - - &-disabled { - &.@{select-prefix-cls}-item-option-selected { - background-color: @select-multiple-disabled-background; - } - color: @disabled-color; - cursor: not-allowed; - } - - &-grouped { - padding-left: @control-padding-horizontal * 2; - } - } - } - - // ============================================================ - // == Size == - // ============================================================ - &-lg { - font-size: @font-size-lg; - } - - // no border style - &-borderless &-selector { - background-color: transparent !important; - border-color: transparent !important; - box-shadow: none !important; - } - - &&-in-form-item { - width: 100%; - } -} - -@import './rtl'; diff --git a/components/select/style/index.tsx b/components/select/style/index.ts similarity index 100% rename from components/select/style/index.tsx rename to components/select/style/index.ts diff --git a/components/select/style/multiple.less b/components/select/style/multiple.less deleted file mode 100644 index e9f2fc2fe..000000000 --- a/components/select/style/multiple.less +++ /dev/null @@ -1,222 +0,0 @@ -@import (reference) '../../style/themes/index'; -@select-prefix-cls: ~'@{ant-prefix}-select'; - -@select-overflow-prefix-cls: ~'@{select-prefix-cls}-selection-overflow'; -@select-multiple-item-border-width: 1px; - -@select-multiple-padding: max( - @input-padding-vertical-base - @select-multiple-item-border-width - - @select-multiple-item-spacing-half, - 0 -); - -/** - * Do not merge `height` & `line-height` under style with `selection` & `search`, - * since chrome may update to redesign with its align logic. - */ - -// =========================== Overflow =========================== -.@{select-overflow-prefix-cls} { - position: relative; - display: flex; - flex: auto; - flex-wrap: wrap; - max-width: 100%; - - &-item { - flex: none; - align-self: center; - max-width: 100%; - } -} - -.@{select-prefix-cls} { - &-multiple { - // ========================= Selector ========================= - .@{select-prefix-cls}-selector { - display: flex; - flex-wrap: wrap; - align-items: center; - // Multiple is little different that horizontal is follow the vertical - padding: @select-multiple-padding @input-padding-vertical-base; - - .@{select-prefix-cls}-show-search& { - cursor: text; - } - - .@{select-prefix-cls}-disabled& { - background: @select-multiple-disabled-background; - cursor: not-allowed; - } - - &::after { - display: inline-block; - width: 0; - margin: @select-multiple-item-spacing-half 0; - line-height: @select-multiple-item-height; - content: '\a0'; - } - } - - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selector, - &.@{select-prefix-cls}-allow-clear .@{select-prefix-cls}-selector { - padding-right: @font-size-sm + @control-padding-horizontal; - } - - // ======================== Selections ======================== - .@{select-prefix-cls}-selection-item { - position: relative; - display: flex; - flex: none; - box-sizing: border-box; - max-width: 100%; - - height: @select-multiple-item-height; - margin-top: @select-multiple-item-spacing-half; - margin-bottom: @select-multiple-item-spacing-half; - line-height: @select-multiple-item-height - @select-multiple-item-border-width * 2; - background: @select-selection-item-bg; - border: 1px solid @select-selection-item-border-color; - border-radius: @border-radius-base; - cursor: default; - transition: font-size 0.3s, line-height 0.3s, height 0.3s; - user-select: none; - margin-inline-end: @input-padding-vertical-base; - padding-inline-start: @padding-xs; - padding-inline-end: (@padding-xs / 2); - - .@{select-prefix-cls}-disabled& { - color: @select-multiple-item-disabled-color; - border-color: @select-multiple-item-disabled-border-color; - cursor: not-allowed; - } - - // It's ok not to do this, but 24px makes bottom narrow in view should adjust - &-content { - display: inline-block; - margin-right: (@padding-xs / 2); - overflow: hidden; - white-space: pre; // fix whitespace wrapping. custom tags display all whitespace within. - text-overflow: ellipsis; - } - - &-remove { - .iconfont-mixin(); - display: inline-block; - color: @text-color-secondary; - font-weight: bold; - font-size: 10px; - line-height: inherit; - cursor: pointer; - - > .@{iconfont-css-prefix} { - vertical-align: middle; - } - - &:hover { - color: @icon-color-hover; - } - } - } - - // ========================== Input ========================== - .@{select-overflow-prefix-cls}-item + .@{select-overflow-prefix-cls}-item { - .@{select-prefix-cls}-selection-search { - margin-inline-start: 0; - } - } - - .@{select-prefix-cls}-selection-search { - position: relative; - max-width: 100%; - margin-inline-start: @input-padding-horizontal-base - @input-padding-vertical-base; - - &-input, - &-mirror { - height: @select-multiple-item-height; - font-family: @font-family; - line-height: @select-multiple-item-height; - transition: all 0.3s; - } - - &-input { - width: 100%; - min-width: 4.1px; // fix search cursor missing - } - - &-mirror { - position: absolute; - top: 0; - left: 0; - z-index: 999; - white-space: pre; // fix whitespace wrapping caused width calculation bug - visibility: hidden; - } - } - - // ======================= Placeholder ======================= - .@{select-prefix-cls}-selection-placeholder { - position: absolute; - top: 50%; - right: @input-padding-horizontal; - left: @input-padding-horizontal; - transform: translateY(-50%); - transition: all 0.3s; - } - - // ============================================================ - // == Size == - // ============================================================ - .select-size(@suffix, @input-height) { - @merged-cls: ~'@{select-prefix-cls}-@{suffix}'; - &.@{merged-cls} { - @select-selection-height: @input-height - @input-padding-vertical-base * 2; - @select-height-without-border: @input-height - @border-width-base * 2; - - .@{select-prefix-cls}-selector::after { - line-height: @select-selection-height; - } - - .@{select-prefix-cls}-selection-item { - height: @select-selection-height; - line-height: @select-selection-height - @border-width-base * 2; - } - - .@{select-prefix-cls}-selection-search { - height: @select-selection-height; - line-height: @select-selection-height; - - &-input, - &-mirror { - height: @select-selection-height; - line-height: @select-selection-height - @border-width-base * 2; - } - } - } - } - - .select-size('lg', @input-height-lg); - .select-size('sm', @input-height-sm); - - // Size small need additional set padding - &.@{select-prefix-cls}-sm { - .@{select-prefix-cls}-selection-placeholder { - left: @input-padding-horizontal-sm; - } - // https://github.com/ant-design/ant-design/issues/29559 - .@{select-prefix-cls}-selection-search { - margin-inline-start: 3px; - } - } - &.@{select-prefix-cls}-lg { - .@{select-prefix-cls}-selection-item { - height: @select-multiple-item-height-lg; - line-height: @select-multiple-item-height-lg; - } - } - } - - &-disabled .@{select-prefix-cls}-selection-item-remove { - display: none; - } -} diff --git a/components/select/style/multiple.tsx b/components/select/style/multiple.ts similarity index 100% rename from components/select/style/multiple.tsx rename to components/select/style/multiple.ts diff --git a/components/select/style/rtl.less b/components/select/style/rtl.less deleted file mode 100644 index 3497c899b..000000000 --- a/components/select/style/rtl.less +++ /dev/null @@ -1,168 +0,0 @@ -@import '../../style/themes/index'; -@import '../../style/mixins/index'; -@import '../../input/style/mixin'; - -@select-prefix-cls: ~'@{ant-prefix}-select'; - -.@{select-prefix-cls} { - &-rtl { - direction: rtl; - } - - // ========================== Arrow ========================== - &-arrow { - .@{select-prefix-cls}-rtl & { - right: initial; - left: @control-padding-horizontal - 1px; - } - } - - // ========================== Clear ========================== - &-clear { - .@{select-prefix-cls}-rtl & { - right: initial; - left: @control-padding-horizontal - 1px; - } - } - - // ========================== Popup ========================== - &-dropdown { - &-rtl { - direction: rtl; - } - } - - // ========================= Options ========================= - &-item { - &-option { - &-grouped { - .@{select-prefix-cls}-dropdown-rtl & { - padding-right: @control-padding-horizontal * 2; - padding-left: @control-padding-horizontal; - } - } - } - } -} - -// multiple -@select-multiple-item-border-width: 1px; -@select-multiple-item-spacing-half: ceil((@input-padding-vertical-base / 2)); -@select-multiple-padding: max( - @input-padding-vertical-base - @select-multiple-item-border-width - - @select-multiple-item-spacing-half, - 0 -); - -.@{select-prefix-cls}-multiple { - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selector, - &.@{select-prefix-cls}-allow-clear .@{select-prefix-cls}-selector { - .@{select-prefix-cls}-rtl& { - padding-right: @input-padding-vertical-base; - padding-left: @font-size-sm + @control-padding-horizontal; - } - } - - // ======================== Selections ======================== - .@{select-prefix-cls}-selection-item { - .@{select-prefix-cls}-rtl& { - text-align: right; - } - // It's ok not to do this, but 24px makes bottom narrow in view should adjust - &-content { - .@{select-prefix-cls}-rtl& { - margin-right: 0; - margin-left: (@padding-xs / 2); - text-align: right; - } - } - } - - // ========================== Input ========================== - .@{select-prefix-cls}-selection-search { - &-mirror { - .@{select-prefix-cls}-rtl& { - right: 0; - left: auto; - } - } - } - - // ======================= Placeholder ======================= - .@{select-prefix-cls}-selection-placeholder { - .@{select-prefix-cls}-rtl& { - right: @input-padding-horizontal; - left: auto; - } - } - - // ============================================================ - // == Size == - // ============================================================ - - // Size small need additional set padding - &.@{select-prefix-cls}-sm { - .@{select-prefix-cls}-selection-placeholder { - .@{select-prefix-cls}-rtl& { - right: @input-padding-horizontal-sm; - } - } - } -} - -// single -@selection-item-padding: ceil(@font-size-base * 1.25); - -.@{select-prefix-cls}-single { - // ========================= Selector ========================= - .@{select-prefix-cls}-selector { - .@{select-prefix-cls}-selection-item, - .@{select-prefix-cls}-selection-placeholder { - .@{select-prefix-cls}-rtl& { - right: 0; - left: 9px; - text-align: right; - } - } - } - - // With arrow should provides `padding-right` to show the arrow - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-search { - .@{select-prefix-cls}-rtl& { - right: @input-padding-horizontal-base; - left: @input-padding-horizontal-base + @font-size-base; - } - } - - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-item, - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-placeholder { - .@{select-prefix-cls}-rtl& { - padding-right: 0; - padding-left: @selection-item-padding; - } - } - - // ============================================================ - // == Size == - // ============================================================ - - // Size small need additional set padding - &.@{select-prefix-cls}-sm { - &:not(.@{select-prefix-cls}-customize-input) { - // With arrow should provides `padding-right` to show the arrow - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-search { - .@{select-prefix-cls}-rtl& { - right: @input-padding-horizontal-sm - 1px; - } - } - - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-item, - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-placeholder { - .@{select-prefix-cls}-rtl& { - padding-right: 0; - padding-left: @font-size-base * 1.5; - } - } - } - } -} diff --git a/components/select/style/single.less b/components/select/style/single.less deleted file mode 100644 index 500dd7298..000000000 --- a/components/select/style/single.less +++ /dev/null @@ -1,179 +0,0 @@ -@import (reference) '../../style/themes/index'; -@select-prefix-cls: ~'@{ant-prefix}-select'; - -@selection-item-padding: ceil(@font-size-base * 1.25); - -.@{select-prefix-cls}-single { - // ========================= Selector ========================= - .@{select-prefix-cls}-selector { - display: flex; - - .@{select-prefix-cls}-selection-search { - position: absolute; - top: 0; - right: @input-padding-horizontal-base; - bottom: 0; - left: @input-padding-horizontal-base; - - &-input { - width: 100%; - } - } - - .@{select-prefix-cls}-selection-item, - .@{select-prefix-cls}-selection-placeholder { - padding: 0; - line-height: @select-height-without-border; - transition: all 0.3s; - - // Firefox inline-block position calculation is not same as Chrome & Safari. Patch this: - @supports (-moz-appearance: meterbar) { - & { - line-height: @select-height-without-border; - } - } - } - - .@{select-prefix-cls}-selection-item { - position: relative; - user-select: none; - } - - .@{select-prefix-cls}-selection-placeholder { - transition: none; - pointer-events: none; - } - - // For common baseline align - &::after, - /* For '' value baseline align */ - .@{select-prefix-cls}-selection-item::after, - /* For undefined value baseline align */ - .@{select-prefix-cls}-selection-placeholder::after { - display: inline-block; - width: 0; - visibility: hidden; - content: '\a0'; - } - } - - // With arrow should provides `padding-right` to show the arrow - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-search { - right: @input-padding-horizontal-base + @font-size-base; - } - - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-item, - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-placeholder { - padding-right: @selection-item-padding; - } - - // Opacity selection if open - &.@{select-prefix-cls}-open .@{select-prefix-cls}-selection-item { - color: @input-placeholder-color; - } - - // ========================== Input ========================== - // We only change the style of non-customize input which is only support by `combobox` mode. - - // Not customize - &:not(.@{select-prefix-cls}-customize-input) { - .@{select-prefix-cls}-selector { - width: 100%; - height: @input-height-base; - padding: 0 @input-padding-horizontal-base; - - .@{select-prefix-cls}-selection-search-input { - height: @select-height-without-border; - } - - &::after { - line-height: @select-height-without-border; - } - } - } - - &.@{select-prefix-cls}-customize-input { - .@{select-prefix-cls}-selector { - &::after { - display: none; - } - - .@{select-prefix-cls}-selection-search { - position: static; - width: 100%; - } - - .@{select-prefix-cls}-selection-placeholder { - position: absolute; - right: 0; - left: 0; - padding: 0 @input-padding-horizontal-base; - - &::after { - display: none; - } - } - } - } - - // ============================================================ - // == Size == - // ============================================================ - .select-size(@suffix, @input-height) { - @merged-cls: ~'@{select-prefix-cls}-@{suffix}'; - - &.@{merged-cls}:not(.@{select-prefix-cls}-customize-input) { - .@{select-prefix-cls}-selector { - height: @input-height; - - &::after, - .@{select-prefix-cls}-selection-item, - .@{select-prefix-cls}-selection-placeholder { - line-height: @input-height - 2 * @border-width-base; - } - } - - // Not customize - &:not(.@{select-prefix-cls}-customize-input) { - .@{select-prefix-cls}-selection-search-input { - height: @input-height - 2 * @border-width-base; - } - } - } - } - - .select-size('lg', @select-single-item-height-lg); - .select-size('sm', @input-height-sm); - - // Size small need additional set padding - &.@{select-prefix-cls}-sm { - &:not(.@{select-prefix-cls}-customize-input) { - .@{select-prefix-cls}-selection-search { - right: @input-padding-horizontal-sm; - left: @input-padding-horizontal-sm; - } - - .@{select-prefix-cls}-selector { - padding: 0 @input-padding-horizontal-sm; - } - - // With arrow should provides `padding-right` to show the arrow - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-search { - right: @input-padding-horizontal-sm + @font-size-base * 1.5; - } - - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-item, - &.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-placeholder { - padding-right: @font-size-base * 1.5; - } - } - } - - &.@{select-prefix-cls}-lg { - &:not(.@{select-prefix-cls}-customize-input) { - .@{select-prefix-cls}-selector { - padding: 0 @input-padding-horizontal-lg; - } - } - } -} diff --git a/components/select/style/single.tsx b/components/select/style/single.ts similarity index 100% rename from components/select/style/single.tsx rename to components/select/style/single.ts diff --git a/components/select/style/status.less b/components/select/style/status.less deleted file mode 100644 index a746a04f6..000000000 --- a/components/select/style/status.less +++ /dev/null @@ -1,48 +0,0 @@ -@import '../../input/style/mixin'; - -@select-prefix-cls: ~'@{ant-prefix}-select'; - -.select-status-color( - @text-color; - @border-color; - @background-color; - @hoverBorderColor; - @outlineColor; -) { - &.@{select-prefix-cls}:not(.@{select-prefix-cls}-disabled):not(.@{select-prefix-cls}-customize-input) { - .@{select-prefix-cls}-selector { - background-color: @background-color; - border-color: @border-color !important; - } - &.@{select-prefix-cls}-open .@{select-prefix-cls}-selector, - &.@{select-prefix-cls}-focused .@{select-prefix-cls}-selector { - .active(@border-color, @hoverBorderColor, @outlineColor); - } - } -} - -.@{select-prefix-cls} { - &-status-error { - .select-status-color(@error-color, @error-color, @select-background, @error-color-hover, @error-color-outline); - } - - &-status-warning { - .select-status-color(@warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline); - } - - &-status-error, - &-status-warning, - &-status-success, - &-status-validating { - &.@{select-prefix-cls}-has-feedback { - //.@{prefix-cls}-arrow, - .@{select-prefix-cls}-clear { - right: 32px; - } - - .@{select-prefix-cls}-selection-selected-value { - padding-right: 42px; - } - } - } -} diff --git a/components/tree/style/directory.less b/components/tree/style/directory.less deleted file mode 100644 index 51baf617c..000000000 --- a/components/tree/style/directory.less +++ /dev/null @@ -1,72 +0,0 @@ -@import '../../style/themes/index'; - -@tree-prefix-cls: ~'@{ant-prefix}-tree'; - -.@{tree-prefix-cls}.@{tree-prefix-cls}-directory { - // ================== TreeNode ================== - .@{tree-prefix-cls}-treenode { - position: relative; - - // Hover color - &::before { - position: absolute; - top: 0; - right: 0; - bottom: 4px; - left: 0; - transition: background-color 0.3s; - content: ''; - pointer-events: none; - } - - &:hover { - &::before { - background: @item-hover-bg; - } - } - - // Elements - > * { - z-index: 1; - } - - // >>> Switcher - .@{tree-prefix-cls}-switcher { - transition: color 0.3s; - } - - // >>> Title - .@{tree-prefix-cls}-node-content-wrapper { - border-radius: 0; - user-select: none; - - &:hover { - background: transparent; - } - - &.@{tree-prefix-cls}-node-selected { - color: @tree-directory-selected-color; - background: transparent; - } - } - - // ============= Selected ============= - &-selected { - &:hover::before, - &::before { - background: @tree-directory-selected-bg; - } - - // >>> Switcher - .@{tree-prefix-cls}-switcher { - color: @tree-directory-selected-color; - } - - // >>> Title - .@{tree-prefix-cls}-node-content-wrapper { - color: @tree-directory-selected-color; - background: transparent; - } - } - } -} diff --git a/components/tree/style/index.less b/components/tree/style/index.less deleted file mode 100644 index a2c0067f2..000000000 --- a/components/tree/style/index.less +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../style/themes/index'; -@import '../../style/mixins/index'; -@import '../../checkbox/style/mixin'; -@import './mixin'; -@import './directory'; - -@tree-prefix-cls: ~'@{ant-prefix}-tree'; -@tree-node-prefix-cls: ~'@{tree-prefix-cls}-treenode'; - -.antCheckboxFn(@checkbox-prefix-cls: ~'@{ant-prefix}-tree-checkbox'); - -.@{tree-prefix-cls} { - .antTreeFn(@tree-prefix-cls); -} - -@import './rtl'; diff --git a/components/tree/style/index.tsx b/components/tree/style/index.ts similarity index 100% rename from components/tree/style/index.tsx rename to components/tree/style/index.ts diff --git a/components/tree/style/mixin.less b/components/tree/style/mixin.less deleted file mode 100644 index 3a502753c..000000000 --- a/components/tree/style/mixin.less +++ /dev/null @@ -1,322 +0,0 @@ -@import '../../style/mixins/index'; - -@tree-prefix-cls: ~'@{ant-prefix}-tree'; -@select-tree-prefix-cls: ~'@{ant-prefix}-select-tree'; -@tree-motion: ~'@{ant-prefix}-motion-collapse'; -@tree-node-padding: (@padding-xs / 2); -@tree-node-hightlight-color: inherit; - -.antTreeSwitcherIcon(@type: 'tree-default-open-icon') { - .@{tree-prefix-cls}-switcher-icon, - .@{select-tree-prefix-cls}-switcher-icon { - display: inline-block; - font-size: 10px; - vertical-align: baseline; - - svg { - transition: transform 0.3s; - } - } -} - -.drop-indicator() { - .@{tree-prefix-cls}-drop-indicator { - position: absolute; - // it should displayed over the following node - z-index: 1; - height: 2px; - background-color: @primary-color; - border-radius: 1px; - pointer-events: none; - - &::after { - position: absolute; - top: -3px; - left: -6px; - width: 8px; - height: 8px; - background-color: transparent; - border: 2px solid @primary-color; - border-radius: 50%; - content: ''; - } - } -} - -.antTreeFn(@custom-tree-prefix-cls) { - @custom-tree-node-prefix-cls: ~'@{custom-tree-prefix-cls}-treenode'; - .reset-component(); - background: @tree-bg; - border-radius: @border-radius-base; - transition: background-color 0.3s; - - &-focused:not(:hover):not(&-active-focused) { - background: @primary-1; - } - - // =================== Virtual List =================== - &-list-holder-inner { - align-items: flex-start; - } - - &.@{custom-tree-prefix-cls}-block-node { - .@{custom-tree-prefix-cls}-list-holder-inner { - align-items: stretch; - - // >>> Title - .@{custom-tree-prefix-cls}-node-content-wrapper { - flex: auto; - } - - // >>> Drag - .@{custom-tree-node-prefix-cls}.dragging { - position: relative; - - &::after { - position: absolute; - top: 0; - right: 0; - bottom: @tree-node-padding; - left: 0; - border: 1px solid @primary-color; - opacity: 0; - animation: ant-tree-node-fx-do-not-use 0.3s; - animation-play-state: running; - animation-fill-mode: forwards; - content: ''; - pointer-events: none; - } - } - } - } - - // ===================== TreeNode ===================== - .@{custom-tree-node-prefix-cls} { - display: flex; - align-items: flex-start; - padding: 0 0 @tree-node-padding 0; - outline: none; - // Disabled - &-disabled { - // >>> Title - .@{custom-tree-prefix-cls}-node-content-wrapper { - color: @disabled-color; - cursor: not-allowed; - - &:hover { - background: transparent; - } - } - } - - &-active .@{custom-tree-prefix-cls}-node-content-wrapper { - background: @tree-node-hover-bg; - } - - &:not(&-disabled).filter-node .@{custom-tree-prefix-cls}-title { - color: @tree-node-hightlight-color; - font-weight: 500; - } - } - - // >>> Indent - &-indent { - align-self: stretch; - white-space: nowrap; - user-select: none; - - &-unit { - display: inline-block; - width: @tree-title-height; - } - } - - // >>> Drag Handler - &-draggable-icon { - width: @tree-title-height; - line-height: @tree-title-height; - text-align: center; - opacity: 0.2; - transition: opacity @animation-duration-slow; - - .@{custom-tree-node-prefix-cls}:hover & { - opacity: 0.45; - } - } - - // >>> Switcher - &-switcher { - .antTreeSwitcherIcon(); - position: relative; - flex: none; - align-self: stretch; - width: @tree-title-height; - margin: 0; - line-height: @tree-title-height; - text-align: center; - cursor: pointer; - user-select: none; - - &-noop { - cursor: default; - } - - &_close { - .@{custom-tree-prefix-cls}-switcher-icon { - svg { - transform: rotate(-90deg); - } - } - } - - &-loading-icon { - color: @primary-color; - } - - &-leaf-line { - position: relative; - z-index: 1; - display: inline-block; - width: 100%; - height: 100%; - // https://github.com/ant-design/ant-design/issues/31884 - &::before { - position: absolute; - top: 0; - right: 12px; - bottom: -@tree-node-padding; - margin-left: -1px; - border-right: 1px solid @normal-color; - content: ' '; - } - - &::after { - position: absolute; - width: @tree-title-height - 14px; - height: @tree-title-height - 10px; - border-bottom: 1px solid @normal-color; - content: ' '; - } - } - } - - // >>> Checkbox - &-checkbox { - top: initial; - margin: ((@tree-title-height - @checkbox-size) / 2) 8px 0 0; - } - - // >>> Title - & &-node-content-wrapper { - position: relative; - z-index: auto; - min-height: @tree-title-height; - margin: 0; - padding: 0 4px; - color: inherit; - line-height: @tree-title-height; - background: transparent; - border-radius: @border-radius-base; - cursor: pointer; - transition: all 0.3s, border 0s, line-height 0s, box-shadow 0s; - - &:hover { - background-color: @tree-node-hover-bg; - } - - &.@{custom-tree-prefix-cls}-node-selected { - background-color: @tree-node-selected-bg; - } - - // Icon - .@{custom-tree-prefix-cls}-iconEle { - display: inline-block; - width: @tree-title-height; - height: @tree-title-height; - line-height: @tree-title-height; - text-align: center; - vertical-align: top; - - &:empty { - display: none; - } - } - } - - // https://github.com/ant-design/ant-design/issues/28217 - &-unselectable &-node-content-wrapper:hover { - background-color: transparent; - } - - // ==================== Draggable ===================== - &-node-content-wrapper { - line-height: @tree-title-height; - user-select: none; - - .drop-indicator(); - } - - .@{custom-tree-node-prefix-cls}.drop-container { - > [draggable] { - box-shadow: 0 0 0 2px @primary-color; - } - } - - // ==================== Show Line ===================== - &-show-line { - // ================ Indent lines ================ - .@{custom-tree-prefix-cls}-indent { - &-unit { - position: relative; - height: 100%; - - &::before { - position: absolute; - top: 0; - right: (@tree-title-height / 2); - bottom: -@tree-node-padding; - border-right: 1px solid @border-color-base; - content: ''; - } - - &-end { - &::before { - display: none; - } - } - } - } - - // ============== Cover Background ============== - .@{custom-tree-prefix-cls}-switcher { - background: @component-background; - - &-line-icon { - // https://github.com/ant-design/ant-design/issues/32813 - vertical-align: -0.15em; - } - } - } - - .@{custom-tree-node-prefix-cls}-leaf-last { - .@{custom-tree-prefix-cls}-switcher { - &-leaf-line { - &::before { - top: auto !important; - bottom: auto !important; - height: @tree-title-height - 10px !important; - } - } - } - } -} - -@keyframes ant-tree-node-fx-do-not-use { - 0% { - opacity: 0; - } - - 100% { - opacity: 1; - } -} diff --git a/components/tree/style/rtl.less b/components/tree/style/rtl.less deleted file mode 100644 index 7604ef60e..000000000 --- a/components/tree/style/rtl.less +++ /dev/null @@ -1,72 +0,0 @@ -@import '../../style/themes/index'; -@import '../../style/mixins/index'; -@import '../../checkbox/style/mixin'; - -@tree-prefix-cls: ~'@{ant-prefix}-tree'; -@select-tree-prefix-cls: ~'@{ant-prefix}-select-tree'; -@tree-node-prefix-cls: ~'@{tree-prefix-cls}-treenode'; - -.@{tree-prefix-cls} { - &-rtl { - direction: rtl; - .@{tree-prefix-cls}-node-content-wrapper[draggable='true'] { - .@{tree-prefix-cls}-drop-indicator { - &::after { - right: -6px; - left: unset; - } - } - } - } - - // ===================== TreeNode ===================== - .@{tree-node-prefix-cls} { - &-rtl { - direction: rtl; - } - } - - // >>> Switcher - &-switcher { - &_close { - .@{tree-prefix-cls}-switcher-icon { - svg { - .@{tree-prefix-cls}-rtl & { - transform: rotate(90deg); - } - } - } - } - } - // ==================== Show Line ===================== - &-show-line { - // ================ Indent lines ================ - .@{tree-prefix-cls}-indent { - &-unit { - &::before { - .@{tree-prefix-cls}-rtl& { - right: auto; - left: -(@tree-title-height / 2) - 1px; - border-right: none; - border-left: 1px solid @border-color-base; - } - } - } - } - } - // >>> Checkbox - &-checkbox { - .@{tree-prefix-cls}-rtl & { - margin: ((@tree-title-height - @checkbox-size) / 2) 0 0 8px; - } - } -} - -.@{select-tree-prefix-cls} { - // >>> Checkbox - &-checkbox { - .@{tree-prefix-cls}-select-dropdown-rtl & { - margin: ((@tree-title-height - @checkbox-size) / 2) 0 0 8px; - } - } -} diff --git a/package.json b/package.json index 9da99cd75..4595209a5 100644 --- a/package.json +++ b/package.json @@ -249,6 +249,7 @@ "ts-jest": "^28.0.5", "ts-loader": "^9.1.0", "ts-node": "^10.8.2", + "typedoc": "^0.23.25", "typescript": "~4.9.3", "umi-request": "^1.3.5", "unified": "9.2.2", diff --git a/site/scripts/genrateRoutes.js b/site/scripts/genrateRoutes.js index 6458a72a9..2eb1d06d8 100644 --- a/site/scripts/genrateRoutes.js +++ b/site/scripts/genrateRoutes.js @@ -13,10 +13,8 @@ const { ESLint } = require('eslint'); const content = fs.readFileSync(path).toString(); const componentName = path.split('/')[1]; - if (componentName !== 'color-picker') { - const { data } = matter(content); - components[componentName] = { ...components[componentName], ...data }; - } + const { data } = matter(content); + components[componentName] = { ...components[componentName], ...data }; }); const TEMPLATE = ` export default [ diff --git a/site/src/components/DemoBox.vue b/site/src/components/DemoBox.vue index dfb8b0133..a600377da 100644 --- a/site/src/components/DemoBox.vue +++ b/site/src/components/DemoBox.vue @@ -37,8 +37,8 @@ diff --git a/site/src/views/user/login/components/Login.vue b/site/src/views/user/login/components/Login.vue deleted file mode 100644 index 92abd98af..000000000 --- a/site/src/views/user/login/components/Login.vue +++ /dev/null @@ -1,96 +0,0 @@ - - diff --git a/site/src/views/user/login/components/LoginItem.jsx b/site/src/views/user/login/components/LoginItem.jsx deleted file mode 100644 index eb6aff464..000000000 --- a/site/src/views/user/login/components/LoginItem.jsx +++ /dev/null @@ -1,44 +0,0 @@ -import ItemMap from './map'; -// eslint-disable-next-line import/no-unresolved -import WrapFormItem from './WrapFormItem'; - -const LoginItem = {}; -Object.keys(ItemMap).forEach(key => { - const item = ItemMap[key]; - LoginItem[key] = { - props: { - defaultValue: String, - name: String, - placeholder: String, - rules: { - type: Array, - default: () => item.rules, - }, - getCaptchaButtonText: String, - getCaptchaSecondText: String, - getCaptcha: Function, - countDown: Number, - customprops: { - type: Object, - default: () => item.props, - }, - type: { - type: String, - default: key, - }, - }, - inject: { - loginContext: { default: () => ({ form: {}, updateActive: () => {} }) }, - }, - render() { - const { - loginContext: { form, updateActive }, - $props, - $listeners, - } = this; - return ; - }, - }; -}); - -export default LoginItem; diff --git a/site/src/views/user/login/components/LoginSubmit.vue b/site/src/views/user/login/components/LoginSubmit.vue deleted file mode 100644 index 1fbb4eec2..000000000 --- a/site/src/views/user/login/components/LoginSubmit.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - diff --git a/site/src/views/user/login/components/LoginTab.vue b/site/src/views/user/login/components/LoginTab.vue deleted file mode 100644 index e18609d04..000000000 --- a/site/src/views/user/login/components/LoginTab.vue +++ /dev/null @@ -1,37 +0,0 @@ - - diff --git a/site/src/views/user/login/components/WrapFormItem.vue b/site/src/views/user/login/components/WrapFormItem.vue deleted file mode 100644 index e2375d1a2..000000000 --- a/site/src/views/user/login/components/WrapFormItem.vue +++ /dev/null @@ -1,93 +0,0 @@ - - diff --git a/site/src/views/user/login/components/index.js b/site/src/views/user/login/components/index.js deleted file mode 100644 index bdd027184..000000000 --- a/site/src/views/user/login/components/index.js +++ /dev/null @@ -1,13 +0,0 @@ -/* eslint-disable import/no-unresolved */ -import Login from './Login'; -import LoginSubmit from './LoginSubmit'; -import LoginTab from './LoginTab'; -import LoginItem from './LoginItem'; - -Login.Tab = LoginTab; -Login.Submit = LoginSubmit; -Object.keys(LoginItem).forEach(item => { - Login[item] = LoginItem[item]; -}); - -export default Login; diff --git a/site/src/views/user/login/components/index.less b/site/src/views/user/login/components/index.less deleted file mode 100644 index 8cc64558a..000000000 --- a/site/src/views/user/login/components/index.less +++ /dev/null @@ -1,53 +0,0 @@ -@import '~ant-design-vue/es/style/themes/default.less'; - -.login { - :global { - .ant-tabs .ant-tabs-bar { - margin-bottom: 24px; - text-align: center; - border-bottom: 0; - } - - .ant-form-item { - margin: 0 2px 24px; - } - } - - .getCaptcha { - display: block; - width: 100%; - } - - .icon { - margin-left: 16px; - color: rgba(0, 0, 0, 0.2); - font-size: 24px; - vertical-align: middle; - cursor: pointer; - transition: color 0.3s; - - &:hover { - color: @primary-color; - } - } - - .other { - margin-top: 24px; - line-height: 22px; - text-align: left; - - .register { - float: right; - } - } - - .prefixIcon { - color: @disabled-color; - font-size: @font-size-base; - } - - .submit { - width: 100%; - margin-top: 24px; - } -} diff --git a/site/src/views/user/login/components/map.jsx b/site/src/views/user/login/components/map.jsx deleted file mode 100644 index 86a2eb46e..000000000 --- a/site/src/views/user/login/components/map.jsx +++ /dev/null @@ -1,83 +0,0 @@ -import styles from './index.less'; -import { UserOutlined, MailOutlined, LockOutlined, MobileOutlined } from '@ant-design/icons-vue'; - -export default { - UserName: { - props: { - size: 'large', - id: 'userName', - // eslint-disable-next-line no-unused-vars - prefix: h => , - placeholder: 'please enter userName', - }, - rules: [ - { - required: true, - message: 'Please enter userName!', - }, - ], - }, - Email: { - props: { - size: 'large', - id: 'email', - // eslint-disable-next-line no-unused-vars - prefix: h => , - placeholder: 'please enter email', - }, - rules: [ - { - required: true, - message: 'Please enter email!', - }, - ], - }, - Password: { - props: { - size: 'large', - // eslint-disable-next-line no-unused-vars - prefix: h => , - type: 'password', - id: 'password', - placeholder: 'Please enter password!', - }, - rules: [ - { - required: true, - message: 'Please enter password!', - }, - ], - }, - Mobile: { - props: { - size: 'large', - // eslint-disable-next-line no-unused-vars - prefix: h => , - placeholder: 'mobile number', - }, - rules: [ - { - required: true, - message: 'Please enter mobile number!', - }, - { - pattern: /^1\d{10}$/, - message: 'Wrong mobile number format!', - }, - ], - }, - Captcha: { - props: { - size: 'large', - // eslint-disable-next-line no-unused-vars - prefix: h => , - placeholder: 'captcha', - }, - rules: [ - { - required: true, - message: 'Please enter Captcha!', - }, - ], - }, -}; diff --git a/site/src/views/user/login/index.vue b/site/src/views/user/login/index.vue deleted file mode 100644 index e0f4d2c4d..000000000 --- a/site/src/views/user/login/index.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - - diff --git a/site/src/views/user/login/locales/en-US.js b/site/src/views/user/login/locales/en-US.js deleted file mode 100644 index 0e63b03a9..000000000 --- a/site/src/views/user/login/locales/en-US.js +++ /dev/null @@ -1,77 +0,0 @@ -export default { - 'userandlogin.login.userName': 'userName', - 'userandlogin.login.password': 'password', - 'userandlogin.login.message-invalid-credentials': 'Invalid username or password', - 'userandlogin.login.message-invalid-verification-code': 'Invalid verification code', - 'userandlogin.login.tab-login-credentials': 'Credentials', - 'userandlogin.login.tab-login-mobile': 'Mobile number', - 'userandlogin.login.remember-me': 'Remember me', - 'userandlogin.login.forgot-password': 'Forgot your password?', - 'userandlogin.login.sign-in-with': 'Sign in with', - 'userandlogin.login.signup': 'Sign up', - 'userandlogin.login.login': 'Login', - 'userandlogin.register.register': 'Register', - 'userandlogin.register.get-verification-code': 'Get code', - 'userandlogin.register.sign-in': 'Already have an account?', - 'userandlogin.register-result.msg': 'Account:registered at {email}', - 'userandlogin.register-result.activation-email': - 'The activation email has been sent to your email address and is valid for 24 hours. Please log in to the email in time and click on the link in the email to activate the account.', - 'userandlogin.register-result.back-home': 'Back to home', - 'userandlogin.register-result.view-mailbox': 'View mailbox', - 'userandlogin.email.required': 'Please enter your email!', - 'userandlogin.email.wrong-format': 'The email address is in the wrong format!', - 'userandlogin.userName.required': 'Please enter your userName!', - 'userandlogin.password.required': 'Please enter your password!', - 'userandlogin.password.twice': 'The passwords entered twice do not match!', - 'userandlogin.strength.msg': - "Please enter at least 6 characters and don't use passwords that are easy to guess.", - 'userandlogin.strength.strong': 'Strength: strong', - 'userandlogin.strength.medium': 'Strength: medium', - 'userandlogin.strength.short': 'Strength: too short', - 'userandlogin.confirm-password.required': 'Please confirm your password!', - 'userandlogin.phone-number.required': 'Please enter your phone number!', - 'userandlogin.phone-number.wrong-format': 'Malformed phone number!', - 'userandlogin.verification-code.required': 'Please enter the verification code!', - 'userandlogin.title.required': 'Please enter a title', - 'userandlogin.date.required': 'Please select the start and end date', - 'userandlogin.goal.required': 'Please enter a description of the goal', - 'userandlogin.standard.required': 'Please enter a metric', - 'userandlogin.form.get-captcha': 'Get Captcha', - 'userandlogin.captcha.second': 'sec', - 'userandlogin.form.optional': ' (optional) ', - 'userandlogin.form.submit': 'Submit', - 'userandlogin.form.save': 'Save', - 'userandlogin.email.placeholder': 'Email', - 'userandlogin.password.placeholder': 'Password', - 'userandlogin.confirm-password.placeholder': 'Confirm password', - 'userandlogin.phone-number.placeholder': 'Phone number', - 'userandlogin.verification-code.placeholder': 'Verification code', - 'userandlogin.title.label': 'Title', - 'userandlogin.title.placeholder': 'Give the target a name', - 'userandlogin.date.label': 'Start and end date', - 'userandlogin.placeholder.start': 'Start date', - 'userandlogin.placeholder.end': 'End date', - 'userandlogin.goal.label': 'Goal description', - 'userandlogin.goal.placeholder': 'Please enter your work goals', - 'userandlogin.standard.label': 'Metrics', - 'userandlogin.standard.placeholder': 'Please enter a metric', - 'userandlogin.client.label': 'Client', - 'userandlogin.label.tooltip': 'Target service object', - 'userandlogin.client.placeholder': - 'Please describe your customer service, internal customers directly @ Name / job number', - 'userandlogin.invites.label': 'Inviting critics', - 'userandlogin.invites.placeholder': - 'Please direct @ Name / job number, you can invite up to 5 people', - 'userandlogin.weight.label': 'Weight', - 'userandlogin.weight.placeholder': 'Please enter weight', - 'userandlogin.public.label': 'Target disclosure', - 'userandlogin.label.help': 'Customers and invitees are shared by default', - 'userandlogin.radio.public': 'Public', - 'userandlogin.radio.partially-public': 'Partially public', - 'userandlogin.radio.private': 'Private', - 'userandlogin.publicUsers.placeholder': 'Open to', - 'userandlogin.option.A': 'Colleague A', - 'userandlogin.option.B': 'Colleague B', - 'userandlogin.option.C': 'Colleague C', - 'userandlogin.navBar.lang': 'Languages', -}; diff --git a/site/src/views/user/login/locales/zh-CN.js b/site/src/views/user/login/locales/zh-CN.js deleted file mode 100644 index ca2b6676c..000000000 --- a/site/src/views/user/login/locales/zh-CN.js +++ /dev/null @@ -1,74 +0,0 @@ -export default { - 'userandlogin.login.userName': '用户名', - 'userandlogin.login.password': '密码', - 'userandlogin.login.message-invalid-credentials': '账户或密码错误', - 'userandlogin.login.message-invalid-verification-code': '验证码错误', - 'userandlogin.login.tab-login-credentials': '账户密码登录', - 'userandlogin.login.tab-login-mobile': '手机号登录', - 'userandlogin.login.remember-me': '自动登录', - 'userandlogin.login.forgot-password': '忘记密码', - 'userandlogin.login.sign-in-with': '其他登录方式', - 'userandlogin.login.signup': '注册账户', - 'userandlogin.login.login': '登录', - 'userandlogin.register.register': '注册', - 'userandlogin.register.get-verification-code': '获取验证码', - 'userandlogin.register.sign-in': '使用已有账户登录', - 'userandlogin.register-result.msg': '你的账户:{email} 注册成功', - 'userandlogin.register-result.activation-email': - '激活邮件已发送到你的邮箱中,邮件有效期为24小时。请及时登录邮箱,点击邮件中的链接激活帐户。', - 'userandlogin.register-result.back-home': '返回首页', - 'userandlogin.register-result.view-mailbox': '查看邮箱', - 'userandlogin.email.required': '请输入邮箱地址!', - 'userandlogin.email.wrong-format': '邮箱地址格式错误!', - 'userandlogin.userName.required': '请输入用户名!', - 'userandlogin.password.required': '请输入密码!', - 'userandlogin.password.twice': '两次输入的密码不匹配!', - 'userandlogin.strength.msg': '请至少输入 6 个字符。请不要使用容易被猜到的密码。', - 'userandlogin.strength.strong': '强度:强', - 'userandlogin.strength.medium': '强度:中', - 'userandlogin.strength.short': '强度:太短', - 'userandlogin.confirm-password.required': '请确认密码!', - 'userandlogin.phone-number.required': '请输入手机号!', - 'userandlogin.phone-number.wrong-format': '手机号格式错误!', - 'userandlogin.verification-code.required': '请输入验证码!', - 'userandlogin.title.required': '请输入标题', - 'userandlogin.date.required': '请选择起止日期', - 'userandlogin.goal.required': '请输入目标描述', - 'userandlogin.standard.required': '请输入衡量标准', - 'userandlogin.form.get-captcha': '获取验证码', - 'userandlogin.captcha.second': '秒', - 'userandlogin.form.optional': '(选填)', - 'userandlogin.form.submit': '提交', - 'userandlogin.form.save': '保存', - 'userandlogin.email.placeholder': '邮箱', - 'userandlogin.password.placeholder': '至少6位密码,区分大小写', - 'userandlogin.confirm-password.placeholder': '确认密码', - 'userandlogin.phone-number.placeholder': '手机号', - 'userandlogin.verification-code.placeholder': '验证码', - 'userandlogin.title.label': '标题', - 'userandlogin.title.placeholder': '给目标起个名字', - 'userandlogin.date.label': '起止日期', - 'userandlogin.placeholder.start': '开始日期', - 'userandlogin.placeholder.end': '结束日期', - 'userandlogin.goal.label': '目标描述', - 'userandlogin.goal.placeholder': '请输入你的阶段性工作目标', - 'userandlogin.standard.label': '衡量标准', - 'userandlogin.standard.placeholder': '请输入衡量标准', - 'userandlogin.client.label': '客户', - 'userandlogin.label.tooltip': '目标的服务对象', - 'userandlogin.client.placeholder': '请描述你服务的客户,内部客户直接 @姓名/工号', - 'userandlogin.invites.label': '邀评人', - 'userandlogin.invites.placeholder': '请直接 @姓名/工号,最多可邀请 5 人', - 'userandlogin.weight.label': '权重', - 'userandlogin.weight.placeholder': '请输入', - 'userandlogin.public.label': '目标公开', - 'userandlogin.label.help': '客户、邀评人默认被分享', - 'userandlogin.radio.public': '公开', - 'userandlogin.radio.partially-public': '部分公开', - 'userandlogin.radio.private': '不公开', - 'userandlogin.publicUsers.placeholder': '公开给', - 'userandlogin.option.A': '同事甲', - 'userandlogin.option.B': '同事乙', - 'userandlogin.option.C': '同事丙', - 'userandlogin.navBar.lang': '语言', -}; diff --git a/site/src/views/user/login/model.js b/site/src/views/user/login/model.js deleted file mode 100644 index 220f13f36..000000000 --- a/site/src/views/user/login/model.js +++ /dev/null @@ -1,44 +0,0 @@ -import qs from 'qs'; -import router from '../../../router'; -import { fakeAccountLogin } from './service'; - -export default { - namespaced: true, - state: { - status: undefined, - }, - actions: { - async login({ commit }, payload) { - const response = await fakeAccountLogin(payload); - commit({ - type: 'changeLoginStatus', - payload: response, - }); - // Login successfully - if (response.status === 'ok') { - const urlParams = new URL(window.location.href); - let redirect = qs.parse(location.search).redirect; - if (redirect) { - const redirectUrlParams = new URL(redirect); - if (redirectUrlParams.origin === urlParams.origin) { - redirect = redirect.substr(urlParams.origin.length); - if (redirect.match(/^\/.*#/)) { - redirect = redirect.substr(redirect.indexOf('#') + 1); - } - } else { - redirect = null; - } - } - router.replace({ path: redirect || '/' }); - } - }, - }, - mutations: { - changeLoginStatus(state, { payload }) { - Object.assign(state, { - status: payload.status, - type: payload.type, - }); - }, - }, -}; diff --git a/site/src/views/user/login/service.js b/site/src/views/user/login/service.js deleted file mode 100644 index 9c5e1f2a0..000000000 --- a/site/src/views/user/login/service.js +++ /dev/null @@ -1,12 +0,0 @@ -import request from '../../../utils/request'; - -export async function fakeAccountLogin(params) { - return request('/api/login/account', { - method: 'POST', - data: params, - }); -} - -export async function getFakeCaptcha(mobile) { - return request(`/api/login/captcha?mobile=${mobile}`); -} diff --git a/site/src/views/user/login/style.less b/site/src/views/user/login/style.less deleted file mode 100644 index a16a20428..000000000 --- a/site/src/views/user/login/style.less +++ /dev/null @@ -1,36 +0,0 @@ -@import '~ant-design-vue/es/style/themes/default.less'; - -.main { - width: 368px; - margin: 0 auto; - @media screen and (max-width: @screen-sm) { - width: 95%; - } - - .icon { - margin-left: 16px; - color: rgba(0, 0, 0, 0.2); - font-size: 24px; - vertical-align: middle; - cursor: pointer; - transition: color 0.3s; - - &:hover { - color: @primary-color; - } - } - - .other { - margin-top: 24px; - line-height: 22px; - text-align: left; - - .register { - float: right; - } - } -} -.main /deep/ .antd-pro-login-submit { - width: 100%; - margin-top: 24px; -} diff --git a/site/src/views/user/login/utils/utils.js b/site/src/views/user/login/utils/utils.js deleted file mode 100644 index 54f470f48..000000000 --- a/site/src/views/user/login/utils/utils.js +++ /dev/null @@ -1,10 +0,0 @@ -import { parse } from 'qs'; - -export function getPageQuery() { - return parse(window.location.href.split('?')[1]); -} - -export function setAuthority(authority) { - const proAuthority = typeof authority === 'string' ? [authority] : authority; - return localStorage.setItem('antd-pro-authority', JSON.stringify(proAuthority)); -} diff --git a/site/src/views/user/register-result/index.vue b/site/src/views/user/register-result/index.vue deleted file mode 100644 index 6bfbb9c53..000000000 --- a/site/src/views/user/register-result/index.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - - - diff --git a/site/src/views/user/register-result/locales/en-US.js b/site/src/views/user/register-result/locales/en-US.js deleted file mode 100644 index ed75e97ba..000000000 --- a/site/src/views/user/register-result/locales/en-US.js +++ /dev/null @@ -1,23 +0,0 @@ -export default { - 'userandregister-result.login.userName': 'userName', - 'userandregister-result.login.password': 'password', - 'userandregister-result.login.message-invalid-credentials': - 'Invalid username or password(admin/ant.design)', - 'userandregister-result.login.message-invalid-verification-code': 'Invalid verification code', - 'userandregister-result.login.tab-login-credentials': 'Credentials', - 'userandregister-result.login.tab-login-mobile': 'Mobile number', - 'userandregister-result.login.remember-me': 'Remember me', - 'userandregister-result.login.forgot-password': 'Forgot your password?', - 'userandregister-result.login.sign-in-with': 'Sign in with', - 'userandregister-result.login.signup': 'Sign up', - 'userandregister-result.login.login': 'Login', - 'userandregister-result.register.register': 'Register', - 'userandregister-result.register.get-verification-code': 'Get code', - 'userandregister-result.register.sign-in': 'Already have an account?', - 'userandregister-result.register-result.msg': 'Account:registered at {email}', - 'userandregister-result.register-result.activation-email': - 'The activation email has been sent to your email address and is valid for 24 hours. Please log in to the email in time and click on the link in the email to activate the account.', - 'userandregister-result.register-result.back-home': 'Back to home', - 'userandregister-result.register-result.view-mailbox': 'View mailbox', - 'userandregister-result.navBar.lang': 'Languages', -}; diff --git a/site/src/views/user/register-result/locales/zh-CN.js b/site/src/views/user/register-result/locales/zh-CN.js deleted file mode 100644 index eb7736301..000000000 --- a/site/src/views/user/register-result/locales/zh-CN.js +++ /dev/null @@ -1,22 +0,0 @@ -export default { - 'userandregister-result.login.userName': '用户名', - 'userandregister-result.login.password': '密码', - 'userandregister-result.login.message-invalid-credentials': '账户或密码错误(admin/ant.design)', - 'userandregister-result.login.message-invalid-verification-code': '验证码错误', - 'userandregister-result.login.tab-login-credentials': '账户密码登录', - 'userandregister-result.login.tab-login-mobile': '手机号登录', - 'userandregister-result.login.remember-me': '自动登录', - 'userandregister-result.login.forgot-password': '忘记密码', - 'userandregister-result.login.sign-in-with': '其他登录方式', - 'userandregister-result.login.signup': '注册账户', - 'userandregister-result.login.login': '登录', - 'userandregister-result.register.register': '注册', - 'userandregister-result.register.get-verification-code': '获取验证码', - 'userandregister-result.register.sign-in': '使用已有账户登录', - 'userandregister-result.register-result.msg': '你的账户:{email} 注册成功', - 'userandregister-result.register-result.activation-email': - '激活邮件已发送到你的邮箱中,邮件有效期为24小时。请及时登录邮箱,点击邮件中的链接激活帐户。', - 'userandregister-result.register-result.back-home': '返回首页', - 'userandregister-result.register-result.view-mailbox': '查看邮箱', - 'userandregister-result.navBar.lang': '语言', -}; diff --git a/site/src/views/user/register-result/style.less b/site/src/views/user/register-result/style.less deleted file mode 100644 index 09d3dca95..000000000 --- a/site/src/views/user/register-result/style.less +++ /dev/null @@ -1,21 +0,0 @@ -.registerResult { - width: 800px; - min-height: 400px; - margin: auto; - padding: 80px; - background: none; - /deep/ .anticon { - font-size: 64px; - } - .title { - margin-top: 32px; - font-size: 20px; - line-height: 28px; - } - .actions { - margin-top: 40px; - a + a { - margin-left: 8px; - } - } -} diff --git a/site/src/views/user/register/index.vue b/site/src/views/user/register/index.vue deleted file mode 100644 index 8a175214d..000000000 --- a/site/src/views/user/register/index.vue +++ /dev/null @@ -1,248 +0,0 @@ - - - diff --git a/site/src/views/user/register/locales/en-US.js b/site/src/views/user/register/locales/en-US.js deleted file mode 100644 index c01fa4381..000000000 --- a/site/src/views/user/register/locales/en-US.js +++ /dev/null @@ -1,78 +0,0 @@ -export default { - 'userandregister.login.userName': 'userName', - 'userandregister.login.password': 'password', - 'userandregister.login.message-invalid-credentials': - 'Invalid username or password(admin/ant.design)', - 'userandregister.login.message-invalid-verification-code': 'Invalid verification code', - 'userandregister.login.tab-login-credentials': 'Credentials', - 'userandregister.login.tab-login-mobile': 'Mobile number', - 'userandregister.login.remember-me': 'Remember me', - 'userandregister.login.forgot-password': 'Forgot your password?', - 'userandregister.login.sign-in-with': 'Sign in with', - 'userandregister.login.signup': 'Sign up', - 'userandregister.login.login': 'Login', - 'userandregister.register.register': 'Register', - 'userandregister.register.get-verification-code': 'Get code', - 'userandregister.register.sign-in': 'Already have an account?', - 'userandregister.register-result.msg': 'Account:registered at {email}', - 'userandregister.register-result.activation-email': - 'The activation email has been sent to your email address and is valid for 24 hours. Please log in to the email in time and click on the link in the email to activate the account.', - 'userandregister.register-result.back-home': 'Back to home', - 'userandregister.register-result.view-mailbox': 'View mailbox', - 'userandregister.email.required': 'Please enter your email!', - 'userandregister.email.wrong-format': 'The email address is in the wrong format!', - 'userandregister.userName.required': 'Please enter your userName!', - 'userandregister.password.required': 'Please enter your password!', - 'userandregister.password.twice': 'The passwords entered twice do not match!', - 'userandregister.strength.msg': - "Please enter at least 6 characters and don't use passwords that are easy to guess.", - 'userandregister.strength.strong': 'Strength: strong', - 'userandregister.strength.medium': 'Strength: medium', - 'userandregister.strength.short': 'Strength: too short', - 'userandregister.confirm-password.required': 'Please confirm your password!', - 'userandregister.phone-number.required': 'Please enter your phone number!', - 'userandregister.phone-number.wrong-format': 'Malformed phone number!', - 'userandregister.verification-code.required': 'Please enter the verification code!', - 'userandregister.title.required': 'Please enter a title', - 'userandregister.date.required': 'Please select the start and end date', - 'userandregister.goal.required': 'Please enter a description of the goal', - 'userandregister.standard.required': 'Please enter a metric', - 'userandregister.form.get-captcha': 'Get Captcha', - 'userandregister.captcha.second': 'sec', - 'userandregister.form.optional': ' (optional) ', - 'userandregister.form.submit': 'Submit', - 'userandregister.form.save': 'Save', - 'userandregister.email.placeholder': 'Email', - 'userandregister.password.placeholder': 'Password', - 'userandregister.confirm-password.placeholder': 'Confirm password', - 'userandregister.phone-number.placeholder': 'Phone number', - 'userandregister.verification-code.placeholder': 'Verification code', - 'userandregister.title.label': 'Title', - 'userandregister.title.placeholder': 'Give the target a name', - 'userandregister.date.label': 'Start and end date', - 'userandregister.placeholder.start': 'Start date', - 'userandregister.placeholder.end': 'End date', - 'userandregister.goal.label': 'Goal description', - 'userandregister.goal.placeholder': 'Please enter your work goals', - 'userandregister.standard.label': 'Metrics', - 'userandregister.standard.placeholder': 'Please enter a metric', - 'userandregister.client.label': 'Client', - 'userandregister.label.tooltip': 'Target service object', - 'userandregister.client.placeholder': - 'Please describe your customer service, internal customers directly @ Name / job number', - 'userandregister.invites.label': 'Inviting critics', - 'userandregister.invites.placeholder': - 'Please direct @ Name / job number, you can invite up to 5 people', - 'userandregister.weight.label': 'Weight', - 'userandregister.weight.placeholder': 'Please enter weight', - 'userandregister.public.label': 'Target disclosure', - 'userandregister.label.help': 'Customers and invitees are shared by default', - 'userandregister.radio.public': 'Public', - 'userandregister.radio.partially-public': 'Partially public', - 'userandregister.radio.private': 'Private', - 'userandregister.publicUsers.placeholder': 'Open to', - 'userandregister.option.A': 'Colleague A', - 'userandregister.option.B': 'Colleague B', - 'userandregister.option.C': 'Colleague C', - 'userandregister.navBar.lang': 'Languages', -}; diff --git a/site/src/views/user/register/locales/zh-CN.js b/site/src/views/user/register/locales/zh-CN.js deleted file mode 100644 index 0e0e4b0c9..000000000 --- a/site/src/views/user/register/locales/zh-CN.js +++ /dev/null @@ -1,74 +0,0 @@ -export default { - 'userandregister.login.userName': '用户名', - 'userandregister.login.password': '密码', - 'userandregister.login.message-invalid-credentials': '账户或密码错误(admin/ant.design)', - 'userandregister.login.message-invalid-verification-code': '验证码错误', - 'userandregister.login.tab-login-credentials': '账户密码登录', - 'userandregister.login.tab-login-mobile': '手机号登录', - 'userandregister.login.remember-me': '自动登录', - 'userandregister.login.forgot-password': '忘记密码', - 'userandregister.login.sign-in-with': '其他登录方式', - 'userandregister.login.signup': '注册账户', - 'userandregister.login.login': '登录', - 'userandregister.register.register': '注册', - 'userandregister.register.get-verification-code': '获取验证码', - 'userandregister.register.sign-in': '使用已有账户登录', - 'userandregister.register-result.msg': '你的账户:{email} 注册成功', - 'userandregister.register-result.activation-email': - '激活邮件已发送到你的邮箱中,邮件有效期为24小时。请及时登录邮箱,点击邮件中的链接激活帐户。', - 'userandregister.register-result.back-home': '返回首页', - 'userandregister.register-result.view-mailbox': '查看邮箱', - 'userandregister.email.required': '请输入邮箱地址!', - 'userandregister.email.wrong-format': '邮箱地址格式错误!', - 'userandregister.userName.required': '请输入用户名!', - 'userandregister.password.required': '请输入密码!', - 'userandregister.password.twice': '两次输入的密码不匹配!', - 'userandregister.strength.msg': '请至少输入 6 个字符。请不要使用容易被猜到的密码。', - 'userandregister.strength.strong': '强度:强', - 'userandregister.strength.medium': '强度:中', - 'userandregister.strength.short': '强度:太短', - 'userandregister.confirm-password.required': '请确认密码!', - 'userandregister.phone-number.required': '请输入手机号!', - 'userandregister.phone-number.wrong-format': '手机号格式错误!', - 'userandregister.verification-code.required': '请输入验证码!', - 'userandregister.title.required': '请输入标题', - 'userandregister.date.required': '请选择起止日期', - 'userandregister.goal.required': '请输入目标描述', - 'userandregister.standard.required': '请输入衡量标准', - 'userandregister.form.get-captcha': '获取验证码', - 'userandregister.captcha.second': '秒', - 'userandregister.form.optional': '(选填)', - 'userandregister.form.submit': '提交', - 'userandregister.form.save': '保存', - 'userandregister.email.placeholder': '邮箱', - 'userandregister.password.placeholder': '至少6位密码,区分大小写', - 'userandregister.confirm-password.placeholder': '确认密码', - 'userandregister.phone-number.placeholder': '手机号', - 'userandregister.verification-code.placeholder': '验证码', - 'userandregister.title.label': '标题', - 'userandregister.title.placeholder': '给目标起个名字', - 'userandregister.date.label': '起止日期', - 'userandregister.placeholder.start': '开始日期', - 'userandregister.placeholder.end': '结束日期', - 'userandregister.goal.label': '目标描述', - 'userandregister.goal.placeholder': '请输入你的阶段性工作目标', - 'userandregister.standard.label': '衡量标准', - 'userandregister.standard.placeholder': '请输入衡量标准', - 'userandregister.client.label': '客户', - 'userandregister.label.tooltip': '目标的服务对象', - 'userandregister.client.placeholder': '请描述你服务的客户,内部客户直接 @姓名/工号', - 'userandregister.invites.label': '邀评人', - 'userandregister.invites.placeholder': '请直接 @姓名/工号,最多可邀请 5 人', - 'userandregister.weight.label': '权重', - 'userandregister.weight.placeholder': '请输入', - 'userandregister.public.label': '目标公开', - 'userandregister.label.help': '客户、邀评人默认被分享', - 'userandregister.radio.public': '公开', - 'userandregister.radio.partially-public': '部分公开', - 'userandregister.radio.private': '不公开', - 'userandregister.publicUsers.placeholder': '公开给', - 'userandregister.option.A': '同事甲', - 'userandregister.option.B': '同事乙', - 'userandregister.option.C': '同事丙', - 'userandregister.navBar.lang': '语言', -}; diff --git a/site/src/views/user/register/model.js b/site/src/views/user/register/model.js deleted file mode 100644 index b77d2b81b..000000000 --- a/site/src/views/user/register/model.js +++ /dev/null @@ -1,24 +0,0 @@ -import { fakeRegister } from './service'; - -const Model = { - namespaced: true, - state: { - status: undefined, - }, - actions: { - async submit({ commit }, { payload }) { - const response = await fakeRegister(payload); - commit({ - type: 'registerHandle', - payload: response, - }); - }, - }, - mutations: { - registerHandle(state, { payload }) { - state.status = payload.status; - }, - }, -}; - -export default Model; diff --git a/site/src/views/user/register/service.js b/site/src/views/user/register/service.js deleted file mode 100644 index 4a599e328..000000000 --- a/site/src/views/user/register/service.js +++ /dev/null @@ -1,8 +0,0 @@ -import request from '../../../utils/request'; - -export async function fakeRegister(params) { - return request('/api/register', { - method: 'POST', - data: params, - }); -} diff --git a/site/src/views/user/register/style.less b/site/src/views/user/register/style.less deleted file mode 100644 index ee1fd6d0f..000000000 --- a/site/src/views/user/register/style.less +++ /dev/null @@ -1,52 +0,0 @@ -@import '~ant-design-vue/es/style/themes/default.less'; - -.main { - width: 368px; - margin: 0 auto; - /deep/ .ant-form-item { - margin-bottom: 24px; - } - - /deep/ .ant-select-selection-selected-value { - padding-right: 0; - } - h3 { - margin-bottom: 20px; - font-size: 16px; - } - - .getCaptcha { - display: block; - width: 100%; - } - - .submit { - width: 50%; - } - - .login { - float: right; - line-height: @btn-height-lg; - } -} -.success, -.warning, -.error { - transition: color 0.3s; -} - -.success { - color: @success-color; -} - -.warning { - color: @warning-color; -} - -.error { - color: @error-color; -} - -.progress-pass > .progress /deep/ .ant-progress-bg { - background-color: @warning-color; -} diff --git a/site/src/views/vip.vue b/site/src/views/vip.vue deleted file mode 100644 index 659dd0e1e..000000000 --- a/site/src/views/vip.vue +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/site/themeConfig.ts b/site/themeConfig.ts deleted file mode 100644 index 5cac51484..000000000 --- a/site/themeConfig.ts +++ /dev/null @@ -1,55 +0,0 @@ -import less from 'less'; -import defaultVars from '../scripts/default-vars'; -import dark from '../scripts/dark-vars'; -const themeConfig = [ - { - theme: 'dark', - htmlThemeAttr: 'dark', - modifyVars: { - hack: `true;@import "${require.resolve('../components/style/color/colorPalette.less')}";`, - ...defaultVars, - ...dark, - 'text-color': 'fade(@white, 65%)', - 'gray-8': '@text-color', - 'background-color-base': '#555', - 'skeleton-color': 'rgba(0,0,0,0.8)', - 'root-entry-name': 'dark', - }, - }, -]; -const additionalData = async (content: string, filename: string): Promise => { - const themePromises = themeConfig.map(async t => { - const { htmlThemeAttr, modifyVars = {} } = t; - const options = { - javascriptEnabled: true, - modifyVars, - relativeUrls: true, - filename, - }; - try { - const { css } = await less.render(content, options); - let res = ''; - if (htmlThemeAttr && css) { - res = ` - [data-doc-theme=${htmlThemeAttr}] { - ${css} - } - `; - } - return Promise.resolve(res); - } catch (error) { - // eslint-disable-next-line no-console - console.log(error); - return Promise.reject(content); - } - }); - let res = content; - for (const themePromise of themePromises) { - const theme = await themePromise; - res += theme; - } - return res; -}; - -export default themeConfig; -export { themeConfig, additionalData }; diff --git a/site/vite.config.ts b/site/vite.config.ts index cbd784e88..ea38691da 100644 --- a/site/vite.config.ts +++ b/site/vite.config.ts @@ -3,7 +3,6 @@ import vue from '@vitejs/plugin-vue'; import md from '../plugin/md'; import docs from '../plugin/docs'; import vueJsx from '@vitejs/plugin-vue-jsx'; -import { additionalData } from './themeConfig'; /** * @type {import('vite').UserConfig} */ @@ -45,13 +44,8 @@ export default { css: { preprocessorOptions: { less: { - modifyVars: { - hack: `true;@import "${require.resolve('../components/style/color/colorPalette.less')}";`, - 'root-entry-name': 'variable', - }, javascriptEnabled: true, // includePaths: ["node_modules/"], - additionalData, }, }, },