tntd 3.1.8 → 3.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-select/index.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC5C,OAAO,cAAc,MAAM,wCAAwC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,iBAAiB,CAAA;AACnC,OAAO,cAAc,CAAA;AAErB,4CAA4C;AAC5C,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAC9B,iBAAiB;AACjB,MAAM,eAAe,GAAG;IACtB,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,EAAE;CACZ,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,IAAI;CACT,CAAA;AAED,MAAM,eAAe,GAAG,GAAG,CAAA;AAE3B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;AAE5B,MAAM,WAAY,SAAQ,aAAa;IACrC,YAAY,KAAK;QACf,KAAK,CAAC,KAAK,CAAC,CAAA;QAkDd;;;;mBAAe,CAAC,QAAQ,EAAE,EAAE;gBAC1B,IAAI,CAAC,QAAQ;oBAAE,OAAO,EAAE,CAAA;gBACxB,IAAI,GAAG,GAAG,EAAE,CAAA;gBACZ,IAAI,QAAQ,IAAI,QAAQ,CAAC,KAAK,EAAE;oBAC9B,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AAI,CAAA;qBACvD;oBACD,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;wBAC7B,OAAO,CACL,6BAAK,SAAS,EAAC,6BAA6B,IACzC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,oBAAC,KAAK,IAAC,KAAK,EAAE,KAAK,CAAC,sBAAsB,GAAI,CACjF,CACP,CAAA;qBACF;oBAED,OAAO,CACL,oBAAC,YAAY,oBACP;wBACF,UAAU;wBACV,QAAQ;wBACR,SAAS,EAAE,IAAI,CAAC,SAAS;wBACzB,IAAI;wBACJ,UAAU,EAAE,IAAI,CAAC,WAAW;qBAC7B,IACD,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;4BACX,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;wBACjB,CAAC,IACD,CACD,CAAA;gBACL,CAAC,KAEA,IAAI,CAAC,OAAO,CACJ,CACV,CAAA;QACL,CAAC,CACc,CAChB,CAAA;IACH,CAAC;CACJ;AAED,SAAS,UAAU,CAAC,KAAK;IACnB,OAAO,CAAC,oBAAC,cAAc,QACpB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE;QACnB,OAAO,oBAAC,WAAW,oBAAK,KAAK,IAAE,WAAW,EAAE,WAAW,IAAI,CAAA;IAC7D,CAAC,CACc,CAAC,CAAA;AACpB,CAAC;AAED,UAAU,CAAC,MAAM,GAAG,MAAM,CAAA;AAE1B,eAAe,UAAU,CAAA","sourcesContent":["import React, { PureComponent } from 'react'\nimport LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver'\nimport { ConfigConsumer } from '../config-provider'\nimport Select from '../select'\nimport Empty from '../empty'\nimport Spin from '../spin'\nimport { capitalizeFirstLetter } from '../utils'\nimport DropDownWrap from './DropDownWrap'\nimport en_US from '../locale/en_US'\nimport './index.less'\n\n// 页面实际渲染的下拉菜单数量,实际为 2 * ITEM_ELEMENT_NUMBER\nconst ITEM_ELEMENT_NUMBER = 30\n// Select size 配置\nconst ITEM_HEIGHT_CFG = {\n small: 24,\n large: 40,\n default: 32,\n}\n\nconst ARROW_CODE = {\n 40: 'down',\n 38: 'up',\n}\n\nconst DROPDOWN_HEIGHT = 224\n\nconst Option = Select.Option\n\nclass SuperSelect extends PureComponent {\n constructor(props) {\n super(props)\n\n const { mode, defaultValue, value, optionHeight, children: arr } = props\n this.isMultiple = ['tags', 'multiple'].includes(mode)\n const children = this.turnChildren(arr)\n\n // 设置默认 value\n let defaultV = this.isMultiple ? [] : ''\n defaultV = value || defaultValue || defaultV\n\n this.state = {\n children: children || [],\n filterChildren: null, // 筛选后的 options,优先显示,所以清除筛选后手动设为 null\n value: defaultV,\n maxWidth: null,\n selectWidth: null,\n }\n // 下拉菜单项行高\n this.ITEM_HEIGHT = optionHeight || ITEM_HEIGHT_CFG[props.size || 'default']\n // 可视区 dom 高度\n this.visibleDomHeight = this.ITEM_HEIGHT * ITEM_ELEMENT_NUMBER\n // 滚动时重新渲染的 scrollTop 判断值,大于 reactDelta 则刷新下拉列表\n this.reactDelta = this.visibleDomHeight / 3\n // 是否拖动滚动条快速滚动状态\n this.isStopReact = false\n // 上一次滚动的 scrollTop 值\n this.prevScrollTop = 0\n // 上一次按下方向键时 scrollTop 值\n this.prevTop = 0\n\n this.scrollTop = 0\n\n // className\n this.dropdownClassName = `dc${+new Date()}`\n\n this.id = `sid${+new Date()}`\n }\n\n componentDidMount() {\n // defaultOpens=true 时添加滚动事件\n setTimeout(() => {\n this.addEvent()\n }, 500)\n const { children: arr } = this.props\n const children = this.turnChildren(arr)\n // if (children && children.length > 0) {\n this.formulaWidth()\n // }\n }\n\n turnChildren = (children) => {\n if (!children) return []\n let arr = []\n if (children && children.props) {\n arr.push(children)\n } else {\n children.forEach((item) => {\n if (item) {\n if (item instanceof Array) {\n arr = arr.concat(item)\n } else {\n arr.push(item)\n }\n }\n })\n }\n return arr\n }\n\n formulaWidth = () => {\n // 获取dom设置宽度\n const { children: arr2, dropdownMatchSelectWidth = true, maxWidth } = this.props\n const selectDom = document.getElementById(this.id)\n let selectWidth\n if (selectDom) {\n selectWidth = selectDom.clientWidth || selectDom.offsetWidth\n }\n let arr = []\n let formulaMaxWidth = 10\n if (!dropdownMatchSelectWidth) {\n formulaMaxWidth = maxWidth || 10\n }\n if (!dropdownMatchSelectWidth && !maxWidth) {\n const children = this.turnChildren(arr2)\n for (let i = 0; i < children.length; i++) {\n const val = children[i].props.children\n const textWidth = this.getTextPixelWith(val)\n arr.push(textWidth.toFixed(2))\n }\n if (arr.length > 0) {\n formulaMaxWidth = Math.max(...arr)\n }\n }\n\n this.setState({\n selectWidth,\n maxWidth: formulaMaxWidth,\n })\n }\n\n // 获取单行文本的像素宽度\n getTextPixelWith = (text, fontStyle = '14px') => {\n let canvas = document.createElement('canvas') // 创建 canvas 画布\n let context = canvas.getContext('2d') // 获取 canvas 绘图上下文环境\n context.font = fontStyle // 设置字体样式,使用前设置好对应的 font 样式才能准确获取文字的像素长度\n let dimension = context.measureText(text) // 测量文字\n return dimension.width\n }\n\n componentDidUpdate(prevProps) {\n const { mode, defaultValue, value, children } = this.props\n let arr = this.turnChildren(children)\n if (prevProps.children !== children) {\n this.isMultiple = ['tags', 'multiple'].includes(mode)\n\n this.setState(\n {\n children: arr || [],\n filterChildren: null,\n },\n () => {\n if (arr && arr.length > 0) {\n // 设置下拉列表显示数据\n if (!value) {\n this.scrollTop = 0\n this.scrollEle && this.scrollEle.scrollTo(0, 0)\n this.setSuperDropDownMenu(true)\n }\n this.formulaWidth()\n if (!this.inputEle) {\n this.removeEvent()\n this.addEvent()\n }\n }\n }\n )\n }\n if (prevProps.value !== value) {\n // 更新时设置默认 value\n let defaultV = this.isMultiple ? [] : ''\n defaultV = value || defaultValue || defaultV\n this.setState({ value: defaultV })\n }\n }\n\n componentWillUnmount() {\n this.removeEvent()\n }\n\n getItemStyle = (i) => ({\n position: 'absolute',\n top: this.ITEM_HEIGHT * i,\n width: '100%',\n height: this.ITEM_HEIGHT,\n })\n\n preventEvent = (e) => {\n e.preventDefault()\n }\n\n addEvent = () => {\n this.scrollEle = document.querySelector(`.${this.dropdownClassName}`)\n // 下拉菜单未展开时元素不存在\n if (!this.scrollEle) return\n\n this.scrollEle.addEventListener('mousedown', this.preventEvent, false)\n this.scrollEle.addEventListener('scroll', this.onScroll, false)\n this.inputEle = document.querySelector(`#${this.id}`)\n\n if (!this.inputEle) return\n this.inputEle.addEventListener('keydown', this.onKeyDown, false)\n }\n\n // 模拟 antd select 按下 上下箭头 键时滚动列表\n onKeyDown = (e) => {\n const { keyCode } = e || {}\n\n setTimeout(() => {\n const activeItem = document.querySelector(\n `.${this.dropdownClassName} .ant-select-dropdown-menu-item-active`\n )\n if (!activeItem) return\n\n const { offsetTop } = activeItem\n const isUp = ARROW_CODE[keyCode] === 'up'\n const isDown = ARROW_CODE[keyCode] === 'down'\n\n // 在所有列表第一行按上键\n if (offsetTop - this.prevTop > DROPDOWN_HEIGHT && isUp && this.scrollEle) {\n this.scrollEle.scrollTo(0, this.allHeight - DROPDOWN_HEIGHT)\n this.prevTop = this.allHeight\n\n return\n }\n\n // 在所有列表中最后一行按下键\n if (this.prevTop > offsetTop + DROPDOWN_HEIGHT && isDown && this.scrollEle) {\n this.scrollEle.scrollTo(0, 0)\n this.prevTop = 0\n\n return\n }\n\n this.prevTop = offsetTop\n // 向下滚动到下拉框最后一行时,向下滚动一行的高度\n if (\n offsetTop > this.scrollEle.scrollTop + DROPDOWN_HEIGHT - this.ITEM_HEIGHT + 10 &&\n isDown\n ) {\n this.scrollEle.scrollTo(0, this.scrollTop + this.ITEM_HEIGHT)\n return\n }\n // 向上滚动到下拉框第一一行时,向上滚动一行的高度\n if (offsetTop < this.scrollEle.scrollTop && isUp) {\n this.scrollEle.scrollTo(0, this.scrollTop - this.ITEM_HEIGHT)\n }\n }, 100)\n }\n\n onScroll = () => this.throttleByHeight(this.onScrollReal)\n\n onScrollReal = () => {\n this.allList = this.getUseChildrenList()\n const { startIndex, endIndex } = this.getStartAndEndIndex()\n\n this.prevScrollTop = this.scrollTop\n // 重新渲染列表组件 Wrap\n const allHeight = this.allList.length * this.ITEM_HEIGHT || 100\n this.wrap.reactList(allHeight, startIndex, endIndex)\n }\n\n throttleByHeight = () => {\n this.scrollTop = this.scrollEle.scrollTop\n // 滚动的高度\n let delta = this.prevScrollTop - this.scrollTop\n delta = delta < 0 ? 0 - delta : delta\n\n delta > this.reactDelta && this.onScrollReal()\n }\n\n // 列表可展示所有 children\n getUseChildrenList = () => this.state.filterChildren || this.state.children\n\n getStartAndEndIndex = () => {\n // 滚动后显示在列表可视区中的第一个 item 的 index\n const showIndex = Number((this.scrollTop / this.ITEM_HEIGHT).toFixed(0))\n\n const startIndex = showIndex - ITEM_ELEMENT_NUMBER < 0 ? 0 : showIndex - ITEM_ELEMENT_NUMBER / 2\n const endIndex = showIndex + ITEM_ELEMENT_NUMBER\n return { startIndex, endIndex }\n }\n\n // 须使用 setTimeout 确保在 dom 加载完成之后添加事件\n setSuperDropDownMenu = (visible) => {\n if (!visible) return\n\n this.allList = this.getUseChildrenList()\n\n if (!this.eventTimer || !this.scrollEle) {\n this.eventTimer = setTimeout(() => this.addEvent(), 0)\n } else {\n const allHeight = this.allList.length * this.ITEM_HEIGHT || 100\n // 下拉列表单独重新渲染\n const { startIndex, endIndex } = this.getStartAndEndIndex()\n setTimeout(() => {\n this.wrap && this.wrap.reactList(allHeight, startIndex, endIndex)\n }, 0)\n }\n }\n\n onDropdownVisibleChange = (visible) => {\n const { onDropdownVisibleChange } = this.props\n onDropdownVisibleChange && onDropdownVisibleChange(visible)\n\n const { value, children } = this.state\n // 关闭下拉框前清空筛选条件,防止下次打开任然显示筛选后的 options\n if (!visible) {\n // 定时器确保关闭后再设置 filterChildren,防止列表刷新闪烁\n setTimeout(() => {\n this.setState({ filterChildren: null })\n this.setDefaultScrollTop(value)\n }, 100)\n // this.removeEvent();\n } else {\n // this.addEvent();\n if (value) {\n // 如果已有 value, 设置默认滚动位置\n this.setDefaultScrollTop()\n // 设置下拉列表显示数据\n this.setSuperDropDownMenu(visible)\n } else if (!value && value !== 0 && children && children.length > 0) {\n // 无数据时,下拉回归至第一个\n const val = children[0].props.value\n this.setDefaultScrollTop(val)\n }\n }\n }\n\n onDeselect = (value) => {\n const { onDeselect } = this.props\n onDeselect && onDeselect(value)\n }\n\n // 在搜索重新计算下拉滚动条高度\n onChange = (value, opt) => {\n const { showSearch, onChange, autoClearSearchValue, maxCount, mode } = this.props\n if (showSearch || this.isMultiple) {\n // 搜索模式下选择后是否需要重置搜索状态\n if (autoClearSearchValue !== false) {\n this.setState({ filterChildren: null }, () => {\n // 搜索成功后重新设置列表的总高度\n this.setSuperDropDownMenu(true)\n })\n }\n }\n\n if (mode === 'multiple') {\n if (value.length <= maxCount) {\n this.setState({ value })\n }\n } else {\n this.setState({ value })\n }\n onChange && onChange(value, opt)\n\n if (mode !== 'multiple') {\n this.select && this.select.blur()\n }\n }\n\n onSearch = (v) => {\n const { showSearch, onSearch, filterOption, children: arr } = this.props\n let children = this.turnChildren(arr)\n if (showSearch && filterOption !== false) {\n // 须根据 filterOption(如有该自定义函数)手动 filter 搜索匹配的列表\n let filterChildren = null\n if (typeof filterOption === 'function') {\n filterChildren = children.filter((item) => filterOption(v, item))\n } else if (filterOption === undefined) {\n filterChildren = children.filter((item) => this.filterOption(v, item))\n }\n\n // 搜索框有值,去除disabled=true的children\n let newFilterChild = []\n filterChildren &&\n filterChildren.forEach((item, index) => {\n if (!item.props.disabled) {\n newFilterChild.push(item)\n }\n })\n filterChildren = newFilterChild\n\n // 设置下拉列表显示数据\n this.setState({ filterChildren: v === '' ? null : filterChildren }, () => {\n setTimeout(() => {\n // 搜索后需要重置滚动位置到0,防止上次 scrollTop 位置无数据\n if (filterChildren && this.scrollEle) {\n this.scrollTop = 0\n this.scrollEle.scrollTo(0, 0)\n }\n // 搜索成功后需要重新设置列表的总高度\n this.setSuperDropDownMenu(true)\n }, 0)\n })\n }\n onSearch && onSearch(v)\n }\n\n filterOption = (v, option) => {\n // 自定义过滤对应的 option 属性配置\n const filterProps = this.props.optionFilterProp || 'value'\n return `${option.props[filterProps]}`.indexOf(v) >= 0\n }\n\n setDefaultScrollTop = (data) => {\n const { value } = this.state\n const { children: arr } = this.props\n const children = this.turnChildren(arr)\n\n let val = data || data === 0 ? data : value\n\n for (let i = 0; i < children.length; i++) {\n const item = children[i]\n const itemValue = item.props.value\n if (itemValue === val || (Array.isArray(val) && val.includes(itemValue))) {\n const targetScrollTop = i * this.ITEM_HEIGHT\n\n setTimeout(() => {\n if (!this.scrollEle) {\n this.addEvent()\n }\n this.scrollEle && this.scrollEle.scrollTo(0, targetScrollTop)\n }, 100)\n return\n }\n }\n }\n\n removeEvent = () => {\n if (!this.scrollEle) return\n this.scrollEle.removeEventListener('mousedown', this.preventEvent, false)\n this.scrollEle.removeEventListener('scroll', this.onScroll, false)\n if (!this.inputEle) return\n this.inputEle.removeEventListener('keydown', this.onKeyDown, false)\n }\n\n render() {\n const { maxWidth, selectWidth } = this.state\n let { dropdownStyle, optionLabelProp, dropdownClassName, placeholder, capitalize, renderEmpty, ...props } =\n this.props\n\n this.allList = this.getUseChildrenList()\n\n this.allHeight = this.allList.length * this.ITEM_HEIGHT || 100\n const { startIndex, endIndex } = this.getStartAndEndIndex()\n\n let dynamicWidth = maxWidth\n if (this.allList.length === 0 || maxWidth < selectWidth) {\n dynamicWidth = selectWidth\n }\n\n dropdownStyle = {\n maxHeight: `${DROPDOWN_HEIGHT}px`,\n ...dropdownStyle,\n overflow: 'auto',\n position: 'relative',\n maxWidth: dynamicWidth,\n }\n\n const { value } = this.state\n // 判断处于 antd Form 中时不自动设置 value\n const _props = { ...props }\n // 先删除 value,再手动赋值,防止空 value 影响 placeholder\n delete _props.value\n\n // value 为空字符会隐藏 placeholder,改为 undefined\n if (typeof value === 'string' && !value) {\n _props.value = undefined\n } else {\n _props.value = value\n }\n\n optionLabelProp = optionLabelProp || 'children'\n return (\n <LocaleReceiver componentName=\"TntdSelect\" defaultLocale={en_US.TntdSelect}>\n {(locale, localeCode) => {\n return (\n <Select\n {..._props}\n id={this.id}\n placeholder={capitalizeFirstLetter(placeholder || locale.select, capitalize, localeCode)}\n onSearch={this.onSearch}\n onChange={this.onChange}\n dropdownClassName={`${this.dropdownClassName} ${dropdownClassName || ''}`}\n optionLabelProp={optionLabelProp}\n dropdownStyle={dropdownStyle}\n onDropdownVisibleChange={this.onDropdownVisibleChange}\n onDeselect={this.onDeselect}\n ref={(ele) => (this.select = ele)}\n dropdownRender={(menu, props) => {\n if (_props.loading) {\n return <Spin size=\"small\" style={{ marginLeft: 8 }} />\n }\n if (this.allList.length === 0) {\n return (\n <div className=\"tntd-select-empty-container\">\n {renderEmpty ? renderEmpty('Select') : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />}\n </div>\n )\n }\n\n return (\n <DropDownWrap\n {...{\n startIndex,\n endIndex,\n allHeight: this.allHeight,\n menu,\n itemHeight: this.ITEM_HEIGHT,\n }}\n ref={(ele) => {\n this.wrap = ele\n }}\n />\n )\n }}\n >\n {this.allList}\n </Select>\n )\n }}\n </LocaleReceiver> \n )\n }\n}\n\nfunction TntdSelect(props) {\n return (<ConfigConsumer>\n {({ renderEmpty }) => {\n return <SuperSelect {...props} renderEmpty={renderEmpty} />\n }}\n </ConfigConsumer>)\n }\n\n TntdSelect.Option = Option\n\n export default TntdSelect\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-select/index.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC5C,OAAO,cAAc,MAAM,wCAAwC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,OAAO,EAAE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AW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,oBAAC,KAAK,IAAC,KAAK,EAAE,KAAK,CAAC,sBAAsB,GAAI,CACjF,CACP,CAAA;qBACF;oBAED,OAAO,CACL,oBAAC,YAAY,oBACP;wBACF,UAAU;wBACV,QAAQ;wBACR,SAAS,EAAE,IAAI,CAAC,SAAS;wBACzB,IAAI;wBACJ,UAAU,EAAE,IAAI,CAAC,WAAW;qBAC7B,IACD,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;4BACX,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;wBACjB,CAAC,IACD,CACD,CAAA;gBACL,CAAC,KAEA,IAAI,CAAC,OAAO,CACJ,CACV,CAAA;QACL,CAAC,CACc,CAChB,CAAA;IACH,CAAC;CACJ;AAED,SAAS,UAAU,CAAC,KAAK;IACnB,OAAO,CAAC,oBAAC,cAAc,QACpB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE;QACnB,OAAO,oBAAC,WAAW,oBAAK,KAAK,IAAE,WAAW,EAAE,WAAW,IAAI,CAAA;IAC7D,CAAC,CACc,CAAC,CAAA;AACpB,CAAC;AAED,UAAU,CAAC,MAAM,GAAG,MAAM,CAAA;AAE1B,eAAe,UAAU,CAAA","sourcesContent":["import React, { PureComponent } from 'react'\nimport LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver'\nimport { ConfigConsumer } from '../config-provider'\nimport Select from '../select'\nimport Empty from '../empty'\nimport Spin from '../spin'\nimport { capitalizeFirstLetter } from '../utils'\nimport DropDownWrap from './DropDownWrap'\nimport en_US from '../locale/en_US'\nimport './index.less'\n\n// 页面实际渲染的下拉菜单数量,实际为 2 * ITEM_ELEMENT_NUMBER\nconst ITEM_ELEMENT_NUMBER = 30\n// Select size 配置\nconst ITEM_HEIGHT_CFG = {\n small: 24,\n large: 40,\n default: 32,\n}\n\nconst ARROW_CODE = {\n 40: 'down',\n 38: 'up',\n}\n\nconst DROPDOWN_HEIGHT = 224\n\nconst Option = Select.Option\n\nclass SuperSelect extends PureComponent {\n constructor(props) {\n super(props)\n\n const { mode, defaultValue, value, optionHeight, children: arr } = props\n this.isMultiple = ['tags', 'multiple'].includes(mode)\n const children = this.turnChildren(arr)\n\n // 设置默认 value\n let defaultV = this.isMultiple ? [] : ''\n defaultV = value || defaultValue || defaultV\n\n this.state = {\n children: children || [],\n filterChildren: null, // 筛选后的 options,优先显示,所以清除筛选后手动设为 null\n value: defaultV,\n maxWidth: null,\n selectWidth: null,\n }\n // 下拉菜单项行高\n this.ITEM_HEIGHT = optionHeight || ITEM_HEIGHT_CFG[props.size || 'default']\n // 可视区 dom 高度\n this.visibleDomHeight = this.ITEM_HEIGHT * ITEM_ELEMENT_NUMBER\n // 滚动时重新渲染的 scrollTop 判断值,大于 reactDelta 则刷新下拉列表\n this.reactDelta = this.visibleDomHeight / 3\n // 是否拖动滚动条快速滚动状态\n this.isStopReact = false\n // 上一次滚动的 scrollTop 值\n this.prevScrollTop = 0\n // 上一次按下方向键时 scrollTop 值\n this.prevTop = 0\n\n this.scrollTop = 0\n\n // className\n this.dropdownClassName = `dc${+new Date()}`\n\n this.id = `sid${+new Date()}`\n }\n\n componentDidMount() {\n // defaultOpens=true 时添加滚动事件\n setTimeout(() => {\n this.addEvent()\n }, 500)\n const { children: arr } = this.props\n const children = this.turnChildren(arr)\n // if (children && children.length > 0) {\n this.formulaWidth()\n // }\n }\n\n turnChildren = (children) => {\n if (!children) return []\n let arr = []\n if (children && children.props) {\n arr.push(children)\n } else {\n children.forEach((item) => {\n if (item) {\n if (item instanceof Array) {\n arr = arr.concat(item)\n } else {\n arr.push(item)\n }\n }\n })\n }\n return arr\n }\n\n formulaWidth = () => {\n // 获取dom设置宽度\n const { children: arr2, dropdownMatchSelectWidth = true, maxWidth } = this.props\n const selectDom = document.getElementById(this.id)\n let selectWidth\n if (selectDom) {\n selectWidth = selectDom.clientWidth || selectDom.offsetWidth\n }\n let arr = []\n let formulaMaxWidth = 10\n if (!dropdownMatchSelectWidth) {\n formulaMaxWidth = maxWidth || 10\n }\n if (!dropdownMatchSelectWidth && !maxWidth) {\n const children = this.turnChildren(arr2)\n for (let i = 0; i < children.length; i++) {\n const val = children[i].props.children\n const textWidth = this.getTextPixelWith(val)\n arr.push(textWidth.toFixed(2))\n }\n if (arr.length > 0) {\n formulaMaxWidth = Math.max(...arr)\n }\n }\n\n this.setState({\n selectWidth,\n maxWidth: formulaMaxWidth,\n })\n }\n\n getDropMaxHeight = () => {\n const list = this.getUseChildrenList()\n const contentHeight = list.length * this.ITEM_HEIGHT\n // 当列表项很少时,使用实际内容高度;否则使用预设的最大高度\n return Math.min(contentHeight || DROPDOWN_HEIGHT, DROPDOWN_HEIGHT)\n }\n getTextPixelWith = (text, fontStyle = '14px') => {\n let canvas = document.createElement('canvas') // 创建 canvas 画布\n let context = canvas.getContext('2d') // 获取 canvas 绘图上下文环境\n context.font = fontStyle // 设置字体样式,使用前设置好对应的 font 样式才能准确获取文字的像素长度\n let dimension = context.measureText(text) // 测量文字\n return dimension.width\n }\n\n componentDidUpdate(prevProps) {\n const { mode, defaultValue, value, children } = this.props\n let arr = this.turnChildren(children)\n if (prevProps.children !== children) {\n this.isMultiple = ['tags', 'multiple'].includes(mode)\n\n this.setState(\n {\n children: arr || [],\n filterChildren: null,\n },\n () => {\n if (arr && arr.length > 0) {\n // 设置下拉列表显示数据\n if (!value) {\n this.scrollTop = 0\n this.scrollEle && this.scrollEle.scrollTo(0, 0)\n this.setSuperDropDownMenu(true)\n }\n this.formulaWidth()\n if (!this.inputEle) {\n this.removeEvent()\n this.addEvent()\n }\n }\n }\n )\n }\n if (prevProps.value !== value) {\n // 更新时设置默认 value\n let defaultV = this.isMultiple ? [] : ''\n defaultV = value || defaultValue || defaultV\n this.setState({ value: defaultV })\n }\n }\n\n componentWillUnmount() {\n this.removeEvent()\n }\n\n getItemStyle = (i) => ({\n position: 'absolute',\n top: this.ITEM_HEIGHT * i,\n width: '100%',\n height: this.ITEM_HEIGHT,\n })\n\n preventEvent = (e) => {\n e.preventDefault()\n }\n\n addEvent = () => {\n this.scrollEle = document.querySelector(`.${this.dropdownClassName}`)\n // 下拉菜单未展开时元素不存在\n if (!this.scrollEle) return\n\n this.scrollEle.addEventListener('mousedown', this.preventEvent, false)\n this.scrollEle.addEventListener('scroll', this.onScroll, false)\n this.inputEle = document.querySelector(`#${this.id}`)\n\n if (!this.inputEle) return\n this.inputEle.addEventListener('keydown', this.onKeyDown, false)\n }\n\n // 模拟 antd select 按下 上下箭头 键时滚动列表\n onKeyDown = (e) => {\n const { keyCode } = e || {}\n\n setTimeout(() => {\n const activeItem = document.querySelector(\n `.${this.dropdownClassName} .ant-select-dropdown-menu-item-active`\n )\n if (!activeItem) return\n\n const { offsetTop } = activeItem\n const isUp = ARROW_CODE[keyCode] === 'up'\n const isDown = ARROW_CODE[keyCode] === 'down'\n\n // 在所有列表第一行按上键\n if (offsetTop - this.prevTop > DROPDOWN_HEIGHT && isUp && this.scrollEle) {\n this.scrollEle.scrollTo(0, this.allHeight - DROPDOWN_HEIGHT)\n this.prevTop = this.allHeight\n\n return\n }\n\n // 在所有列表中最后一行按下键\n if (this.prevTop > offsetTop + DROPDOWN_HEIGHT && isDown && this.scrollEle) {\n this.scrollEle.scrollTo(0, 0)\n this.prevTop = 0\n\n return\n }\n\n this.prevTop = offsetTop\n // 向下滚动到下拉框最后一行时,向下滚动一行的高度\n if (\n offsetTop > this.scrollEle.scrollTop + DROPDOWN_HEIGHT - this.ITEM_HEIGHT + 10 &&\n isDown\n ) {\n this.scrollEle.scrollTo(0, this.scrollTop + this.ITEM_HEIGHT)\n return\n }\n // 向上滚动到下拉框第一一行时,向上滚动一行的高度\n if (offsetTop < this.scrollEle.scrollTop && isUp) {\n this.scrollEle.scrollTo(0, this.scrollTop - this.ITEM_HEIGHT)\n }\n }, 100)\n }\n\n onScroll = () => this.throttleByHeight(this.onScrollReal)\n\n onScrollReal = () => {\n this.allList = this.getUseChildrenList()\n const { startIndex, endIndex } = this.getStartAndEndIndex()\n\n this.prevScrollTop = this.scrollTop\n // 重新渲染列表组件 Wrap\n const allHeight = this.allList.length * this.ITEM_HEIGHT || 100\n this.wrap.reactList(allHeight, startIndex, endIndex)\n }\n\n throttleByHeight = () => {\n this.scrollTop = this.scrollEle.scrollTop\n // 滚动的高度\n let delta = this.prevScrollTop - this.scrollTop\n delta = delta < 0 ? 0 - delta : delta\n\n delta > this.reactDelta && this.onScrollReal()\n }\n\n // 列表可展示所有 children\n getUseChildrenList = () => this.state.filterChildren || this.state.children\n\n getStartAndEndIndex = () => {\n // 滚动后显示在列表可视区中的第一个 item 的 index\n const showIndex = Number((this.scrollTop / this.ITEM_HEIGHT).toFixed(0))\n\n const startIndex = showIndex - ITEM_ELEMENT_NUMBER < 0 ? 0 : showIndex - ITEM_ELEMENT_NUMBER / 2\n const endIndex = showIndex + ITEM_ELEMENT_NUMBER\n return { startIndex, endIndex }\n }\n\n // 须使用 setTimeout 确保在 dom 加载完成之后添加事件\n setSuperDropDownMenu = (visible) => {\n if (!visible) return\n\n this.allList = this.getUseChildrenList()\n\n if (!this.eventTimer || !this.scrollEle) {\n this.eventTimer = setTimeout(() => this.addEvent(), 0)\n } else {\n const allHeight = this.allList.length * this.ITEM_HEIGHT || 100\n // 下拉列表单独重新渲染\n const { startIndex, endIndex } = this.getStartAndEndIndex()\n setTimeout(() => {\n this.wrap && this.wrap.reactList(allHeight, startIndex, endIndex)\n }, 0)\n }\n }\n\n onDropdownVisibleChange = (visible) => {\n const { onDropdownVisibleChange } = this.props\n onDropdownVisibleChange && onDropdownVisibleChange(visible)\n\n const { value, children } = this.state\n // 关闭下拉框前清空筛选条件,防止下次打开任然显示筛选后的 options\n if (!visible) {\n // 定时器确保关闭后再设置 filterChildren,防止列表刷新闪烁\n setTimeout(() => {\n this.setState({ filterChildren: null })\n this.setDefaultScrollTop(value)\n }, 100)\n // this.removeEvent();\n } else {\n // this.addEvent();\n if (value) {\n // 如果已有 value, 设置默认滚动位置\n this.setDefaultScrollTop()\n // 设置下拉列表显示数据\n this.setSuperDropDownMenu(visible)\n } else if (!value && value !== 0 && children && children.length > 0) {\n // 无数据时,下拉回归至第一个\n const val = children[0].props.value\n this.setDefaultScrollTop(val)\n }\n }\n }\n\n onDeselect = (value) => {\n const { onDeselect } = this.props\n onDeselect && onDeselect(value)\n }\n\n // 在搜索重新计算下拉滚动条高度\n onChange = (value, opt) => {\n const { showSearch, onChange, autoClearSearchValue, maxCount, mode } = this.props\n if (showSearch || this.isMultiple) {\n // 搜索模式下选择后是否需要重置搜索状态\n if (autoClearSearchValue !== false) {\n this.setState({ filterChildren: null }, () => {\n // 搜索成功后重新设置列表的总高度\n this.setSuperDropDownMenu(true)\n })\n }\n }\n\n if (mode === 'multiple') {\n if (value.length <= maxCount) {\n this.setState({ value })\n }\n } else {\n this.setState({ value })\n }\n onChange && onChange(value, opt)\n\n if (mode !== 'multiple') {\n this.select && this.select.blur()\n }\n }\n\n onSearch = (v) => {\n const { showSearch, onSearch, filterOption, children: arr } = this.props\n let children = this.turnChildren(arr)\n if (showSearch && filterOption !== false) {\n // 须根据 filterOption(如有该自定义函数)手动 filter 搜索匹配的列表\n let filterChildren = null\n if (typeof filterOption === 'function') {\n filterChildren = children.filter((item) => filterOption(v, item))\n } else if (filterOption === undefined) {\n filterChildren = children.filter((item) => this.filterOption(v, item))\n }\n\n // 搜索框有值,去除disabled=true的children\n let newFilterChild = []\n filterChildren &&\n filterChildren.forEach((item, index) => {\n if (!item.props.disabled) {\n newFilterChild.push(item)\n }\n })\n filterChildren = newFilterChild\n\n // 设置下拉列表显示数据\n this.setState({ filterChildren: v === '' ? null : filterChildren }, () => {\n setTimeout(() => {\n // 搜索后需要重置滚动位置到0,防止上次 scrollTop 位置无数据\n if (filterChildren && this.scrollEle) {\n this.scrollTop = 0\n this.scrollEle.scrollTo(0, 0)\n }\n // 搜索成功后需要重新设置列表的总高度\n this.setSuperDropDownMenu(true)\n }, 0)\n })\n }\n onSearch && onSearch(v)\n }\n\n filterOption = (v, option) => {\n // 自定义过滤对应的 option 属性配置\n const filterProps = this.props.optionFilterProp || 'value'\n return `${option.props[filterProps]}`.indexOf(v) >= 0\n }\n\n setDefaultScrollTop = (data) => {\n const { value } = this.state\n const { children: arr } = this.props\n const children = this.turnChildren(arr)\n\n let val = data || data === 0 ? data : value\n\n for (let i = 0; i < children.length; i++) {\n const item = children[i]\n const itemValue = item.props.value\n if (itemValue === val || (Array.isArray(val) && val.includes(itemValue))) {\n const targetScrollTop = i * this.ITEM_HEIGHT\n\n setTimeout(() => {\n if (!this.scrollEle) {\n this.addEvent()\n }\n this.scrollEle && this.scrollEle.scrollTo(0, targetScrollTop)\n }, 100)\n return\n }\n }\n }\n\n removeEvent = () => {\n if (!this.scrollEle) return\n this.scrollEle.removeEventListener('mousedown', this.preventEvent, false)\n this.scrollEle.removeEventListener('scroll', this.onScroll, false)\n if (!this.inputEle) return\n this.inputEle.removeEventListener('keydown', this.onKeyDown, false)\n }\n\n render() {\n const { maxWidth, selectWidth } = this.state\n let { dropdownStyle, optionLabelProp, dropdownClassName, placeholder, capitalize, renderEmpty, ...props } =\n this.props\n\n this.allList = this.getUseChildrenList()\n\n this.allHeight = this.allList.length * this.ITEM_HEIGHT || 100\n const { startIndex, endIndex } = this.getStartAndEndIndex()\n\n let dynamicWidth = maxWidth\n if (this.allList.length === 0 || maxWidth < selectWidth) {\n dynamicWidth = selectWidth\n }\n\n const dropMaxHeight = this.getDropMaxHeight()\n\n dropdownStyle = {\n maxHeight: `${dropMaxHeight}px`,\n ...dropdownStyle,\n overflow: 'auto',\n position: 'relative',\n maxWidth: dynamicWidth,\n }\n\n const { value } = this.state\n // 判断处于 antd Form 中时不自动设置 value\n const _props = { ...props }\n // 先删除 value,再手动赋值,防止空 value 影响 placeholder\n delete _props.value\n\n // value 为空字符会隐藏 placeholder,改为 undefined\n if (typeof value === 'string' && !value) {\n _props.value = undefined\n } else {\n _props.value = value\n }\n\n optionLabelProp = optionLabelProp || 'children'\n return (\n <LocaleReceiver componentName=\"TntdSelect\" defaultLocale={en_US.TntdSelect}>\n {(locale, localeCode) => {\n return (\n <Select\n {..._props}\n id={this.id}\n placeholder={capitalizeFirstLetter(placeholder || locale.select, capitalize, localeCode)}\n onSearch={this.onSearch}\n onChange={this.onChange}\n dropdownClassName={`${this.dropdownClassName} ${dropdownClassName || ''}`}\n optionLabelProp={optionLabelProp}\n dropdownStyle={dropdownStyle}\n onDropdownVisibleChange={this.onDropdownVisibleChange}\n onDeselect={this.onDeselect}\n ref={(ele) => (this.select = ele)}\n dropdownRender={(menu, props) => {\n if (_props.loading) {\n return <Spin size=\"small\" style={{ marginLeft: 8 }} />\n }\n if (this.allList.length === 0) {\n return (\n <div className=\"tntd-select-empty-container\">\n {renderEmpty ? renderEmpty('Select') : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />}\n </div>\n )\n }\n\n return (\n <DropDownWrap\n {...{\n startIndex,\n endIndex,\n allHeight: this.allHeight,\n menu,\n itemHeight: this.ITEM_HEIGHT,\n }}\n ref={(ele) => {\n this.wrap = ele\n }}\n />\n )\n }}\n >\n {this.allList}\n </Select>\n )\n }}\n </LocaleReceiver> \n )\n }\n}\n\nfunction TntdSelect(props) {\n return (<ConfigConsumer>\n {({ renderEmpty }) => {\n return <SuperSelect {...props} renderEmpty={renderEmpty} />\n }}\n </ConfigConsumer>)\n }\n\n TntdSelect.Option = Option\n\n export default TntdSelect\n"]}
@@ -2,12 +2,12 @@ import React from 'react';
2
2
  import type { ButtonProps as AntdButtonProps, ButtonGroupProps as AntdButtonGroupProps, ButtonType } from 'antd/lib/button';
3
3
  import { default as AntdButton } from 'antd/lib/button';
4
4
  export * from 'antd/lib/button';
5
- export declare type TntButtonType = ButtonType | 'tertiary' | 'ai';
5
+ export declare type TntButtonType = ButtonType | 'tertiary' | 'ai' | 'ai-default';
6
6
  export interface ButtonProps extends Omit<AntdButtonProps, 'size' | 'type'> {
7
7
  upperCaseIgnore?: [];
8
8
  unUpperConverted?: boolean;
9
9
  size?: 'large' | 'default' | 'small' | 'mini';
10
- type?: 'default' | 'primary' | 'tertiary' | 'ai' | 'ghost' | 'dashed' | 'danger' | 'link';
10
+ type?: 'default' | 'primary' | 'tertiary' | 'ai' | 'ai-default' | 'ghost' | 'dashed' | 'danger' | 'link';
11
11
  }
12
12
  export interface ButtonGroupProps extends Omit<AntdButtonGroupProps, 'size'> {
13
13
  size?: 'large' | 'default' | 'small' | 'mini';
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,gBAAgB,IAAI,oBAAoB,EACxC,UAAU,EACX,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAItD,cAAc,gBAAgB,CAAA;AAE9B,oBAAY,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,IAAI,CAAA;AAC1D,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC;IACzE,eAAe,CAAC,EAAE,EAAE,CAAA;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;IAC7C,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAA;CAC1F;AACD,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAC1E,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;CAC9C;AAED,UAAU,eACR,SAAQ,KAAK,CAAC,yBAAyB,CAAC,WAAW,GAAG,KAA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MAAM,iBAuCC,CAAA"}
@@ -124,9 +124,9 @@ var Button = exports.Button = (0, _react.forwardRef)(function (_a, ref) {
124
124
  componentName: "Button"
125
125
  }, function (locale, localeCode) {
126
126
  return _react["default"].createElement(_button["default"], Object.assign({}, rest, {
127
- type: type === 'tertiary' || type === 'ai' ? undefined : type,
127
+ type: type === 'tertiary' || type === 'ai' || type === 'ai-default' ? undefined : type,
128
128
  size: size === 'mini' ? undefined : size,
129
- className: (0, _classnames["default"])(className, tntPrefixCls, _defineProperty(_defineProperty(_defineProperty({}, "".concat(tntPrefixCls, "-mini"), size === 'mini'), "".concat(tntPrefixCls, "-tertiary"), type === 'tertiary'), "".concat(tntPrefixCls, "-ai"), type === 'ai')),
129
+ className: (0, _classnames["default"])(className, tntPrefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(tntPrefixCls, "-mini"), size === 'mini'), "".concat(tntPrefixCls, "-tertiary"), type === 'tertiary'), "".concat(tntPrefixCls, "-ai"), type === 'ai'), "".concat(tntPrefixCls, "-ai-default"), type === 'ai-default')),
130
130
  children: getNewChildren(children, unUpperConverted, upperCaseIgnore, localeCode),
131
131
  ref: ref
132
132
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,+CAAyC;AAMzC,4FAAmE;AACnE,wDAAmD;AACnD,4DAAsD;AACtD,wCAA4C;AAC5C,4DAAmC;AAEnC,iDAA8B;AAkB9B,MAAM,YAAY,GAAG,SAAS,CAAA;AAE9B,MAAM,cAAc,GAAG,CACrB,QAAa,EACb,gBAAqC,EACrC,eAA+B,EAC/B,UAA8B,EAC9B,EAAE;IACF,IAAI,WAAW,GAAG,QAAQ,CAAA;IAC1B,IAAI,CAAC,gBAAgB,EAAE;QACrB,WAAW,GAAG,IAAA,mBAAY,EAAC,WAAW,E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,OAAW,EAAN,IAAI,cAA1B,qBAA4B,CAAF;IACzE,OAAO,CACL,8BAAC,gCAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,OAAO,CACL,8BAAC,gBAAU,CAAC,KAAK,oBACX,IAAI,IACR,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EACxC,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE;gBAC/B,CAAC,GAAG,YAAY,aAAa,CAAC,EAAE,IAAI,KAAK,MAAM;aAChD,CAAC,IACF,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AAED,cAAM,CAAC,KAAK,GAAG,WAAW,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2023-10-26 09:46:28\n * @LastEditors: 郑泳健\n * @LastEditTime: 2026-01-14 14:51:59\n * @FilePath: /tntd/packages/tntd/src/button/button.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport React, { forwardRef } from 'react'\nimport type {\n ButtonProps as AntdButtonProps,\n ButtonGroupProps as AntdButtonGroupProps,\n ButtonType,\n} from 'antd/lib/button'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport { ConfigConsumer } from '../config-provider'\nimport { default as AntdButton } from 'antd/lib/button'\nimport { doUpperTitle } from '../utils/lang'\nimport classNames from 'classnames'\n\nexport * from 'antd/lib/button'\n\nexport type TntButtonType = ButtonType | 'tertiary' | 'ai'\nexport interface ButtonProps extends Omit<AntdButtonProps, 'size' | 'type'> {\n upperCaseIgnore?: []\n unUpperConverted?: boolean\n size?: 'large' | 'default' | 'small' | 'mini'\n type?: 'default' | 'primary' | 'tertiary' | 'ai' | 'ghost' | 'dashed' | 'danger' | 'link'\n}\nexport interface ButtonGroupProps extends Omit<AntdButtonGroupProps, 'size'> {\n size?: 'large' | 'default' | 'small' | 'mini'\n}\n\ninterface ButtonComponent\n extends React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<AntdButton>> {\n Group: React.FC<ButtonGroupProps>\n}\n\nconst tntPrefixCls = 'tnt-btn'\n\nconst getNewChildren = (\n children: any,\n unUpperConverted: boolean | undefined,\n upperCaseIgnore: [] | undefined,\n localeCode: string | undefined\n) => {\n let newChildren = children\n if (!unUpperConverted) {\n newChildren = doUpperTitle(newChildren, upperCaseIgnore, localeCode)\n }\n return newChildren\n}\n\nexport const Button = forwardRef<AntdButton, ButtonProps>(\n ({ className, size, type, children, unUpperConverted, upperCaseIgnore, ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return (\n <LocaleReceiver componentName=\"Button\">\n {(locale, localeCode) => {\n return (\n <AntdButton\n {...rest}\n type={type === 'tertiary' || type === 'ai' ? undefined : type}\n size={size === 'mini' ? undefined : size}\n className={classNames(className, tntPrefixCls, {\n [`${tntPrefixCls}-mini`]: size === 'mini',\n [`${tntPrefixCls}-tertiary`]: type === 'tertiary',\n [`${tntPrefixCls}-ai`]: type === 'ai',\n })}\n children={getNewChildren(\n children,\n unUpperConverted,\n upperCaseIgnore,\n localeCode\n )}\n ref={ref}\n />\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n }\n) as ButtonComponent\n\nconst ButtonGroup: React.FC<ButtonGroupProps> = ({ className, size, ...rest }) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return (\n <AntdButton.Group\n {...rest}\n size={size === 'mini' ? undefined : size}\n className={classNames(className, {\n [`${tntPrefixCls}-group-mini`]: size === 'mini',\n })}\n />\n )\n }}\n </ConfigConsumer>\n )\n}\n\nButton.Group = ButtonGroup\n"]}
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;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I,KAAK,MAAM;oBACzC,CAAC,GAAG,YAAY,WAAW,CAAC,EAAE,IAAI,KAAK,UAAU;oBACjD,CAAC,GAAG,YAAY,KAAK,CAAC,EAAE,IAAI,KAAK,IAAI;oBACrC,CAAC,GAAG,YAAY,aAAa,CAAC,EAAE,IAAI,KAAK,YAAY;iBACtD,CAAC,EACF,QAAQ,EAAE,cAAc,CACtB,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,UAAU,CACX,EACD,GAAG,EAAE,GAAG,IACR,CACH,CAAA;QACH,CAAC,CACc,CAClB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CACiB,CAAA;AAEpB,MAAM,WAAW,GAA+B,CAAC,EAA4B,EAAE,EAAE;QAAhC,EAAE,SAAS,EAAE,IAAI,OAAW,EAAN,IAAI,cAA1B,qBAA4B,CAAF;IACzE,OAAO,CACL,8BAAC,gCAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,OAAO,CACL,8BAAC,gBAAU,CAAC,KAAK,oBACX,IAAI,IACR,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EACxC,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE;gBAC/B,CAAC,GAAG,YAAY,aAAa,CAAC,EAAE,IAAI,KAAK,MAAM;aAChD,CAAC,IACF,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AAED,cAAM,CAAC,KAAK,GAAG,WAAW,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2023-10-26 09:46:28\n * @LastEditors: 郑泳健\n * @LastEditTime: 2026-01-14 14:51:59\n * @FilePath: /tntd/packages/tntd/src/button/button.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport React, { forwardRef } from 'react'\nimport type {\n ButtonProps as AntdButtonProps,\n ButtonGroupProps as AntdButtonGroupProps,\n ButtonType,\n} from 'antd/lib/button'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport { ConfigConsumer } from '../config-provider'\nimport { default as AntdButton } from 'antd/lib/button'\nimport { doUpperTitle } from '../utils/lang'\nimport classNames from 'classnames'\n\nexport * from 'antd/lib/button'\n\nexport type TntButtonType = ButtonType | 'tertiary' | 'ai' | 'ai-default'\nexport interface ButtonProps extends Omit<AntdButtonProps, 'size' | 'type'> {\n upperCaseIgnore?: []\n unUpperConverted?: boolean\n size?: 'large' | 'default' | 'small' | 'mini'\n type?:\n | 'default'\n | 'primary'\n | 'tertiary'\n | 'ai'\n | 'ai-default'\n | 'ghost'\n | 'dashed'\n | 'danger'\n | 'link'\n}\nexport interface ButtonGroupProps extends Omit<AntdButtonGroupProps, 'size'> {\n size?: 'large' | 'default' | 'small' | 'mini'\n}\n\ninterface ButtonComponent\n extends React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<AntdButton>> {\n Group: React.FC<ButtonGroupProps>\n}\n\nconst tntPrefixCls = 'tnt-btn'\n\nconst getNewChildren = (\n children: any,\n unUpperConverted: boolean | undefined,\n upperCaseIgnore: [] | undefined,\n localeCode: string | undefined\n) => {\n let newChildren = children\n if (!unUpperConverted) {\n newChildren = doUpperTitle(newChildren, upperCaseIgnore, localeCode)\n }\n return newChildren\n}\n\nexport const Button = forwardRef<AntdButton, ButtonProps>(\n ({ className, size, type, children, unUpperConverted, upperCaseIgnore, ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return (\n <LocaleReceiver componentName=\"Button\">\n {(locale, localeCode) => {\n return (\n <AntdButton\n {...rest}\n type={\n type === 'tertiary' || type === 'ai' || type === 'ai-default'\n ? undefined\n : type\n }\n size={size === 'mini' ? undefined : size}\n className={classNames(className, tntPrefixCls, {\n [`${tntPrefixCls}-mini`]: size === 'mini',\n [`${tntPrefixCls}-tertiary`]: type === 'tertiary',\n [`${tntPrefixCls}-ai`]: type === 'ai',\n [`${tntPrefixCls}-ai-default`]: type === 'ai-default',\n })}\n children={getNewChildren(\n children,\n unUpperConverted,\n upperCaseIgnore,\n localeCode\n )}\n ref={ref}\n />\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n }\n) as ButtonComponent\n\nconst ButtonGroup: React.FC<ButtonGroupProps> = ({ className, size, ...rest }) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return (\n <AntdButton.Group\n {...rest}\n size={size === 'mini' ? undefined : size}\n className={classNames(className, {\n [`${tntPrefixCls}-group-mini`]: size === 'mini',\n })}\n />\n )\n }}\n </ConfigConsumer>\n )\n}\n\nButton.Group = ButtonGroup\n"]}
@@ -3,55 +3,122 @@
3
3
 
4
4
  @btn-prefix-cls: ~'@{ant-prefix}-btn';
5
5
 
6
+ @btn-ai-hover-bg: linear-gradient(128deg, #2e69ff 6.08%, #bf5fff 96.35%);
7
+ @btn-ai-center-bg: linear-gradient(128deg, #2e69ff 6.08%, #bf5fff 96.35%);
8
+ @btn-ai-step-bg1: linear-gradient(128deg, #bf5fff 15.08%, #2e69ff 105.35%);
9
+ @btn-ai-step-bg2: linear-gradient(128deg, #bf5fff 24.08%, #2e69ff 114.35%);
10
+ @btn-ai-step-bg3: linear-gradient(128deg, #bf5fff 33.08%, #2e69ff 123.35%);
11
+ @btn-ai-step-bg4: linear-gradient(128deg, #bf5fff 42.08%, #2e69ff 132.35%);
12
+ @btn-ai-step-bg5: linear-gradient(128deg, #2e69ff -39.19%, #bf5fff 51.08%, #2e69ff 141.35%);
13
+ @btn-ai-step-bg6: linear-gradient(128deg, #2e69ff -30.19%, #bf5fff 60.08%, #2e69ff 150.35%);
14
+ @btn-ai-step-bg7: linear-gradient(128deg, #2e69ff -21.19%, #bf5fff 69.08%, #2e69ff 159.35%);
15
+ @btn-ai-step-bg8: linear-gradient(128deg, #2e69ff -12.19%, #bf5fff 78.08%, #2e69ff 168.35%);
16
+ @btn-ai-step-bg9: linear-gradient(128deg, #2e69ff -3.19%, #bf5fff 87.08%, #2e69ff 177.35%);
17
+
6
18
  .tnt-btn {
7
19
  &.tnt-btn-mini {
8
20
  .button-size(@btn-height-mini; @btn-padding-mini; @btn-font-size-mini; @btn-border-radius-sm);
21
+
9
22
  &.@{btn-prefix-cls}-icon-only {
10
23
  .square(@btn-height-mini);
11
24
  padding-right: 0;
12
25
  padding-left: 0;
13
26
  }
27
+
14
28
  &.@{btn-prefix-cls}-circle {
15
29
  min-width: @btn-height-mini;
16
30
  border-radius: 50%;
17
31
  }
32
+
18
33
  &.@{btn-prefix-cls}-round {
19
34
  .button-size(@btn-circle-size-mini; 0 @btn-circle-size-mini / 2; @btn-font-size-mini; @btn-circle-size-mini);
35
+
20
36
  &.@{btn-prefix-cls}-icon-only {
21
37
  width: auto;
22
38
  }
23
39
  }
24
40
  }
41
+
25
42
  &-group-mini {
26
- & > .@{btn-prefix-cls},
27
- & > span > .@{btn-prefix-cls} {
43
+
44
+ &>.@{btn-prefix-cls},
45
+ &>span>.@{btn-prefix-cls} {
28
46
  .button-size(@btn-height-mini; @btn-padding-mini; @btn-font-size-mini; 0);
29
47
  line-height: calc(@btn-height-mini - 2px);
30
48
  }
31
- & > .@{btn-prefix-cls}.@{btn-prefix-cls}-icon-only {
49
+
50
+ &>.@{btn-prefix-cls}.@{btn-prefix-cls}-icon-only {
32
51
  .square(@btn-height-mini);
33
52
  padding-right: 0;
34
53
  padding-left: 0;
35
54
  }
36
55
  }
56
+
37
57
  &-tertiary {
38
58
  .button-variant-tertiary(@btn-default-color, @primary-color, @btn-tertiary-bg);
39
59
  }
60
+
40
61
  &-ai {
41
- .button-variant-ai(@btn-primary-color, @primary-color, @btn-ai-bg);
62
+ .button-variant-ai(@btn-primary-color, @primary-color, @btn-ai-bg, @btn-ai-hover-bg);
42
63
  }
64
+
65
+ &-ai-default {
66
+ >span {
67
+ background: linear-gradient(128deg, #BF5FFF 6.08%, #2E69FF 96.35%);
68
+ background-clip: text;
69
+ -webkit-background-clip: text;
70
+ -webkit-text-fill-color: transparent;
71
+ }
72
+
73
+ &:hover,
74
+ &:focus {
75
+ border-color: @btn-default-border;
76
+ background: linear-gradient(142deg, #F8EEFF 6.08%, #E0E9FE 96.35%);
77
+ }
78
+
79
+ &:active,
80
+ &.active {
81
+ border-color: transparent;
82
+ background: linear-gradient(142deg, #F8EEFF 6.08%, #E0E9FE 96.35%) padding-box,
83
+ linear-gradient(142deg, #BF5FFF 6.08%, #2E69FF 96.35%) border-box;
84
+ background-origin: border-box;
85
+ background-clip: padding-box, border-box;
86
+ }
87
+
88
+ .button-disabled();
89
+
90
+ // AI 按钮禁用状态的额外样式
91
+ &[disabled],
92
+ &.@{btn-prefix-cls}-disabled {
93
+ span {
94
+ color: @disabled-color;
95
+ background: transparent;
96
+ -webkit-text-fill-color: unset;
97
+ }
98
+
99
+ &:hover,
100
+ &:focus,
101
+ &:active {
102
+ background: @btn-disable-bg !important;
103
+ }
104
+ }
105
+ }
106
+
43
107
  &.@{btn-prefix-cls}-primary {
44
108
  .button-disabled(@btn-primary-color, @blue-3, @blue-3);
45
109
  }
110
+
46
111
  &.@{btn-prefix-cls}-danger {
47
112
  .button-disabled(@btn-primary-color, @red-3, @red-3);
48
113
  }
114
+
49
115
  &.@{btn-prefix-cls}-link {
50
116
  .button-disabled(@blue-3, transparent, transparent);
51
117
  padding: 0;
52
118
  }
53
- > .@{iconfont-css-prefix} + span,
54
- > span + .@{iconfont-css-prefix} {
119
+
120
+ >.@{iconfont-css-prefix}+span,
121
+ >span+.@{iconfont-css-prefix} {
55
122
  margin-left: 4px;
56
123
  }
57
124
  }
@@ -64,16 +131,12 @@
64
131
 
65
132
  &:hover,
66
133
  &:focus {
67
- .button-color(
68
- @hover-color; ~`colorPalette('@{background}', 5) `; ~`colorPalette('@{background}', 5) `
69
- );
134
+ .button-color(@hover-color; ~`colorPalette('@{background}', 5) `; ~`colorPalette('@{background}', 5) `);
70
135
  }
71
136
 
72
137
  &:active,
73
138
  &.active {
74
- .button-color(
75
- @hover-color; ~`colorPalette('@{background}', 6) `; ~`colorPalette('@{background}', 6) `
76
- );
139
+ .button-color(@hover-color; ~`colorPalette('@{background}', 6) `; ~`colorPalette('@{background}', 6) `);
77
140
  }
78
141
 
79
142
  .button-disabled(@btn-disable-color; @btn-disable-bg; transparent);
@@ -88,134 +151,164 @@
88
151
  background: linear-gradient(0deg, @overlay-color 0%, @overlay-color 100%), @base-gradient;
89
152
  }
90
153
 
91
- .generate-hover-in-animation(@name; @background) {
154
+ .generate-hover-in-animation(@name; @background; @background-hover) {
92
155
  @keyframes @name {
93
156
  0% {
94
157
  background: @background;
95
158
  }
159
+
96
160
  10% {
97
- .ai-gradient-overlay(rgba(255, 255, 255, 0.02), @background);
161
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.02), @btn-ai-step-bg1);
98
162
  }
163
+
99
164
  20% {
100
- .ai-gradient-overlay(rgba(255, 255, 255, 0.04), @background);
165
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.04), @btn-ai-step-bg2);
101
166
  }
167
+
102
168
  30% {
103
- .ai-gradient-overlay(rgba(255, 255, 255, 0.06), @background);
169
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.06), @btn-ai-step-bg3);
104
170
  }
171
+
105
172
  40% {
106
- .ai-gradient-overlay(rgba(255, 255, 255, 0.08), @background);
173
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.08), @btn-ai-step-bg4);
107
174
  }
175
+
108
176
  50% {
109
- .ai-gradient-overlay(rgba(255, 255, 255, 0.1), @background);
177
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.1), @btn-ai-step-bg5);
110
178
  }
179
+
111
180
  60% {
112
- .ai-gradient-overlay(rgba(255, 255, 255, 0.12), @background);
181
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.12), @btn-ai-step-bg6);
113
182
  }
183
+
114
184
  70% {
115
- .ai-gradient-overlay(rgba(255, 255, 255, 0.14), @background);
185
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.14), @btn-ai-step-bg7);
116
186
  }
187
+
117
188
  80% {
118
- .ai-gradient-overlay(rgba(255, 255, 255, 0.16), @background);
189
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.16), @btn-ai-step-bg8);
119
190
  }
191
+
120
192
  90% {
121
- .ai-gradient-overlay(rgba(255, 255, 255, 0.18), @background);
193
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.18), @btn-ai-step-bg9);
122
194
  }
195
+
123
196
  100% {
124
- .ai-gradient-overlay(rgba(255, 255, 255, @ai-overlay-opacity), @background);
197
+ .ai-gradient-overlay(rgba(255, 255, 255, @ai-overlay-opacity), @background-hover);
125
198
  }
126
199
  }
127
200
  }
128
201
 
129
- .generate-hover-out-animation(@name; @background) {
202
+ .generate-hover-out-animation(@name; @background; @background-hover) {
130
203
  @keyframes @name {
131
204
  0% {
132
205
  .ai-gradient-overlay(rgba(255, 255, 255, @ai-overlay-opacity), @background);
133
206
  }
207
+
134
208
  10% {
135
- .ai-gradient-overlay(rgba(255, 255, 255, 0.18), @background);
209
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.18), @btn-ai-step-bg9);
136
210
  }
211
+
137
212
  20% {
138
- .ai-gradient-overlay(rgba(255, 255, 255, 0.16), @background);
213
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.16), @btn-ai-step-bg8);
139
214
  }
215
+
140
216
  30% {
141
- .ai-gradient-overlay(rgba(255, 255, 255, 0.14), @background);
217
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.14), @btn-ai-step-bg7);
142
218
  }
219
+
143
220
  40% {
144
- .ai-gradient-overlay(rgba(255, 255, 255, 0.12), @background);
221
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.12), @btn-ai-step-bg6);
145
222
  }
223
+
146
224
  50% {
147
- .ai-gradient-overlay(rgba(255, 255, 255, 0.1), @background);
225
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.1), @btn-ai-step-bg5);
148
226
  }
227
+
149
228
  60% {
150
- .ai-gradient-overlay(rgba(255, 255, 255, 0.08), @background);
229
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.08), @btn-ai-step-bg4);
151
230
  }
231
+
152
232
  70% {
153
- .ai-gradient-overlay(rgba(255, 255, 255, 0.06), @background);
233
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.06), @btn-ai-step-bg3);
154
234
  }
235
+
155
236
  80% {
156
- .ai-gradient-overlay(rgba(255, 255, 255, 0.04), @background);
237
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.04), @btn-ai-step-bg2);
157
238
  }
239
+
158
240
  90% {
159
- .ai-gradient-overlay(rgba(255, 255, 255, 0.02), @background);
241
+ .ai-gradient-overlay(rgba(255, 255, 255, 0.02), @btn-ai-step-bg1);
160
242
  }
243
+
161
244
  100% {
162
- background: @background;
245
+ background: @background-hover;
163
246
  }
164
247
  }
165
248
  }
166
249
 
167
- .generate-active-animation(@name; @background) {
250
+ .generate-active-animation(@name; @background; @background-hover) {
168
251
  @keyframes @name {
169
252
  0% {
170
253
  background: @background;
171
254
  }
255
+
172
256
  10% {
173
- .ai-gradient-overlay(rgba(0, 0, 0, 0.02), @background);
257
+ .ai-gradient-overlay(rgba(0, 0, 0, 0.02), @btn-ai-step-bg1);
174
258
  }
259
+
175
260
  20% {
176
- .ai-gradient-overlay(rgba(0, 0, 0, 0.04), @background);
261
+ .ai-gradient-overlay(rgba(0, 0, 0, 0.04), @btn-ai-step-bg2);
177
262
  }
263
+
178
264
  30% {
179
- .ai-gradient-overlay(rgba(0, 0, 0, 0.06), @background);
265
+ .ai-gradient-overlay(rgba(0, 0, 0, 0.06), @btn-ai-step-bg3);
180
266
  }
267
+
181
268
  40% {
182
- .ai-gradient-overlay(rgba(0, 0, 0, 0.08), @background);
269
+ .ai-gradient-overlay(rgba(0, 0, 0, 0.08), @btn-ai-step-bg4);
183
270
  }
271
+
184
272
  50% {
185
- .ai-gradient-overlay(rgba(0, 0, 0, 0.1), @background);
273
+ .ai-gradient-overlay(rgba(0, 0, 0, 0.1), @btn-ai-step-bg5);
186
274
  }
275
+
187
276
  60% {
188
- .ai-gradient-overlay(rgba(0, 0, 0, 0.12), @background);
277
+ .ai-gradient-overlay(rgba(0, 0, 0, 0.12), @btn-ai-step-bg6);
189
278
  }
279
+
190
280
  70% {
191
- .ai-gradient-overlay(rgba(0, 0, 0, 0.14), @background);
281
+ .ai-gradient-overlay(rgba(0, 0, 0, 0.14), @btn-ai-step-bg7);
192
282
  }
283
+
193
284
  80% {
194
- .ai-gradient-overlay(rgba(0, 0, 0, 0.16), @background);
285
+ .ai-gradient-overlay(rgba(0, 0, 0, 0.16), @btn-ai-step-bg8);
195
286
  }
287
+
196
288
  90% {
197
- .ai-gradient-overlay(rgba(0, 0, 0, 0.18), @background);
289
+ .ai-gradient-overlay(rgba(0, 0, 0, 0.18), @btn-ai-step-bg9);
198
290
  }
291
+
199
292
  100% {
200
- .ai-gradient-overlay(rgba(0, 0, 0, @ai-overlay-opacity), @background);
293
+ .ai-gradient-overlay(rgba(0, 0, 0, @ai-overlay-opacity), @background-hover);
201
294
  }
202
295
  }
203
296
  }
204
297
 
205
- .button-variant-ai(@color; @hover-color; @background) {
298
+ .button-variant-ai(@color; @hover-color; @background; @background-hover) {
206
299
  color: @color;
207
300
  background: @background;
208
301
  border: none;
209
302
  text-shadow: @btn-text-shadow;
210
303
  box-shadow: @btn-primary-shadow;
211
304
 
212
- animation: ai-hover-out @ai-animation-duration @ai-animation-easing;
213
- animation-fill-mode: both;
305
+ // animation: ai-hover-out @ai-animation-duration @ai-animation-easing;
306
+ // animation-fill-mode: both;
214
307
 
215
308
  &:hover,
216
309
  &:focus {
217
310
  color: @color;
218
- .ai-gradient-overlay(rgba(255, 255, 255, @ai-overlay-opacity), @background);
311
+ .ai-gradient-overlay(rgba(255, 255, 255, @ai-overlay-opacity), @background-hover);
219
312
  animation: ai-hover-in @ai-animation-duration @ai-animation-easing;
220
313
  animation-fill-mode: both;
221
314
  }
@@ -223,7 +316,7 @@
223
316
  &:active,
224
317
  &.active {
225
318
  color: @color;
226
- .ai-gradient-overlay(rgba(0, 0, 0, @ai-overlay-opacity), @background);
319
+ .ai-gradient-overlay(rgba(0, 0, 0, @ai-overlay-opacity), @background-hover);
227
320
  animation: ai-active-in @ai-animation-duration @ai-animation-easing;
228
321
  animation-fill-mode: both;
229
322
  }
@@ -246,7 +339,7 @@
246
339
  }
247
340
 
248
341
  // linear-gradient不支持 transition 动画,使用 animation模拟 transition 动画,目前10帧差不多可以很丝滑
249
- .generate-hover-in-animation(ai-hover-in; @background);
250
- .generate-hover-out-animation(ai-hover-out; @background);
251
- .generate-active-animation(ai-active-in; @background);
252
- }
342
+ .generate-hover-in-animation(ai-hover-in; @background; @background-hover);
343
+ .generate-hover-out-animation(ai-hover-out; @background-hover; @background);
344
+ .generate-active-animation(ai-active-in; @background-hover; @background; );
345
+ }
@@ -14,7 +14,8 @@
14
14
  border-radius: var(---, 8px);
15
15
  background: var(---, #F8F9FB);
16
16
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
17
- font-family: initial;
17
+ // font-family: initial;
18
+ font-family: inherit;
18
19
  font-weight: 400;
19
20
 
20
21
  .tntd-segmented-group {