Skip to content

Commit

Permalink
feat: ✨ 更新部分组件库组件命名
Browse files Browse the repository at this point in the history
  • Loading branch information
G committed Jan 4, 2024
1 parent 25996fb commit 4da56f4
Show file tree
Hide file tree
Showing 25 changed files with 96 additions and 101 deletions.
2 changes: 1 addition & 1 deletion packages/gbeata/docs/components/CharaSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function CharaSelect(props: CharaSelectProps) {
<div className="chara-select">
{content}
{readonly ? (
<div className="mw-form-text">-</div>
<div className="g-form-text">-</div>
) : (
<GDialog
title="角色选择"
Expand Down
6 changes: 3 additions & 3 deletions packages/gbeata/docs/components/DateShortcut.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ registerField('date-range', {
text = text.join('\n');
}
return readonly ? (
<span className="mw-form-text">{text || '-'}</span>
<span className="g-form-text">{text || '-'}</span>
) : (
<DatePicker.RangePicker
presets={presets}
Expand All @@ -109,7 +109,7 @@ const renderExtraFooter = ({ setFieldsValue, field }: AnyKeyProps) => {
* 填充日期
* @param value 日期
*/
const setValue = (value: dayjs.dayjs) => {
const setValue = (value: any) => {
setFieldsValue({
[field.key]: value,
});
Expand Down Expand Up @@ -157,7 +157,7 @@ registerField('date', {
text = '';
}
return readonly ? (
<span className="mw-form-text">{text || '-'}</span>
<span className="g-form-text">{text || '-'}</span>
) : (
<DatePicker
renderExtraFooter={() => renderExtraFooter({ setFieldsValue, field })}
Expand Down
2 changes: 1 addition & 1 deletion packages/gbeata/docs/components/ExtraConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ order: 3
全屏遮罩默认层级是固定 999,如果发生覆盖现象,可以考虑调整此参数。

```css
.mw-search-table.full {
.g-search-table.full {
z-index: 999;
}
```
Expand Down
4 changes: 2 additions & 2 deletions packages/gbeata/docs/components/GCtrl.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ GSearchTable 下 GCtrl 的样式会更加紧凑。
```tsx
import React from 'react';
import { GSearchTable, GAction, GCtrl, GSearchTableField } from 'gbeata';
import { GTableCtrlField } from 'gbeata/lib/GTable/mw-table';
import { GTableCtrlField } from 'gbeata/lib/GTable/g-table';

/**
* 测试接口,实际过程中推荐使用 axios 接口
Expand Down Expand Up @@ -147,7 +147,7 @@ export default function Demo() {
- Type: boolean
- Default: false

可以让 GCtrl 下所有的按钮变成[次级按钮](./mw-button#次级字体)
可以让 GCtrl 下所有的按钮变成[次级按钮](./g-button#次级字体)

### more

Expand Down
4 changes: 2 additions & 2 deletions packages/gbeata/docs/components/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ registerField('date-range', {
text = text.join('\n');
}
return readonly ? (
<span className="mw-form-text">{text || '-'}</span>
<span className="g-form-text">{text || '-'}</span>
) : (
<DatePicker.RangePicker
presets={presets}
Expand Down Expand Up @@ -95,7 +95,7 @@ registerField('date', {
text = '';
}
return readonly ? (
<span className="mw-form-text">{text || '-'}</span>
<span className="g-form-text">{text || '-'}</span>
) : (
<DatePicker
renderExtraFooter={() => renderExtraFooter({ setFieldsValue, field })}
Expand Down
2 changes: 1 addition & 1 deletion packages/gbeata/docs/components/registerField.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ registerField(FormType, {
render: ({ field, readonly, getFieldValue }: AnyKeyProps) => {
// 可以在 readonly 模式下,渲染成不同的样子
return readonly ? (
<span className="mw-form-text">{getFieldValue(field.key) || '-'}</span>
<span className="g-form-text">{getFieldValue(field.key) || '-'}</span>
) : (
<Component
placeholder={`请输入${field.title || ''}`}
Expand Down
2 changes: 1 addition & 1 deletion packages/gbeata/docs/guide/Form.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,4 +467,4 @@ export default function Demo() {
}
```

更详细的弹窗表单使用,请看[这里](../../components/form/mw-dialog-form)
更详细的弹窗表单使用,请看[这里](../../components/form/g-dialog-form)
2 changes: 1 addition & 1 deletion packages/gbeata/docs/guide/Table.md
Original file line number Diff line number Diff line change
Expand Up @@ -737,4 +737,4 @@ export const deleteApi = (params: AnyKeyProps): Promise<any> => {
};
```

更详细的指令按钮介绍,请看[这里](../../components/button/mw-action)
更详细的指令按钮介绍,请看[这里](../../components/button/g-action)
6 changes: 3 additions & 3 deletions packages/gbeata/src/GCard/index.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.mw-card {
.g-card {
&.collapsed {
.mw-card-collapsible-icon {
.g-card-collapsible-icon {
transform: rotate(-90deg);
}

Expand All @@ -14,7 +14,7 @@
}
}

.mw-card-collapsible-icon {
.g-card-collapsible-icon {
font-size: 16px;
cursor: pointer;
transition: transform 200ms;
Expand Down
4 changes: 2 additions & 2 deletions packages/gbeata/src/GCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ export default function GCard(props: GCardProps) {

const icon = collapsible ? (
<DownOutlined
className={`mw-card-collapsible-icon ${collapsePosition}`}
className={`g-card-collapsible-icon ${collapsePosition}`}
onClick={toggleCollapsed}
/>
) : null;

return (
<Card
{...params}
className={`mw-card ${collapsed ? 'collapsed' : ''}`}
className={`g-card ${collapsed ? 'collapsed' : ''}`}
title={
title ? (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.mw-ctrl {
.g-ctrl {
.ant-btn-link {
line-height: 1;
height: unset;
Expand Down
6 changes: 3 additions & 3 deletions packages/gbeata/src/GCtrl/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CTRL_DEFAULT_MAX, CTRL_DEFAULT_MORE_TEXT } from '../constant';
import locale from '../locale';
import { AnyKeyProps } from '../types/AnyKeyProps';
import { GCtrlProps } from './g-ctrl';
import './mw-ctrl.less';
import './g-ctrl.less';

/**
* 返回一个控制项
Expand Down Expand Up @@ -99,7 +99,7 @@ const getCtrlList = (

ctrlList.push(
<Dropdown key={max} overlay={menu} placement="bottomRight">
<GButton type="link" className={classNames('mw-button', sub && 'sub')}>
<GButton type="link" className={classNames('g-button', sub && 'sub')}>
{more}
</GButton>
</Dropdown>,
Expand All @@ -124,7 +124,7 @@ export default function GCtrl(props: GCtrlProps) {
return (
<Space
size={size}
className={classNames('mw-ctrl', className)}
className={classNames('g-ctrl', className)}
style={style}
split={split ?? <Divider type="vertical" />}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/gbeata/src/GDialogForm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ export default function AyDialogFormDemo() {
| updateApi | 进出详情模式。 | Promise | - | - |
| beforeSubmit | 表单的提交前校验,return false 则不会提交。 | (params?: AnyKeyProps, mode?: string) => boolean \| obejct | - | - |
| dialogOnly | 是否只使用申明了 dialog 的 Field。 | boolean | false | - |
| dialogExtend | [GDialog](../mw-dialog#参数) 的扩展值。 | object | - | - |
| dialogExtend | [GDialog](../g-dialog#参数) 的扩展值。 | object | - | - |
| formExtend | [GForm](../form#props-参数) 的扩展值。 | object | - | - |
| autoClose | 成功后是否自动关闭弹窗。 | boolean | true | - |
| drawer | 是否用 Drawer 替换 Modal。 | boolean | false | - |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
display: flex;
}

.mw-card {
.g-card {
margin-bottom: 12px;
}
}
Expand Down Expand Up @@ -141,21 +141,21 @@
display: flex;
padding: 4px 0;

.mw-button {
.g-button {
color: unset;
flex: 1;
padding: 0;

&:hover {
background-color: rgba(0, 0, 0, 0.1);
background-color: rgba(0, 0, 0, 10%);
}
}
}

.form-tip {
height: 32px;
padding-left: @space;
color: rgba(0, 0, 0, 0.45);
color: rgba(0, 0, 0, 45%);
display: flex;
align-items: center;
}
Expand Down Expand Up @@ -208,6 +208,6 @@
}

.form-tip {
color: rgba(255, 255, 255, 0.65);
color: rgba(255, 255, 255, 65%);
}
}
6 changes: 3 additions & 3 deletions packages/gbeata/src/GForm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ const fields: Array<GFormField> = [

## 卡片表单

`FormType``card` 时,子元素会被 [GCard](./mw-card) 包裹起来。
`FormType``card` 时,子元素会被 [GCard](./g-card) 包裹起来。

```tsx
import React, { useState } from 'react';
Expand Down Expand Up @@ -1462,6 +1462,6 @@ const fields: Array<Field> = [
[cardform]: ./form/card-form
[groupform]: ./form/group-form
[listform]: ./form/g-form-list
[cardgroup]: ./form/mw-card-group#在表单中使用
[taggroup]: ./form/mw-tag-group#在表单中使用
[cardgroup]: ./form/g-card-group#在表单中使用
[taggroup]: ./form/g-tag-group#在表单中使用
[日期格式化]: ./form/date-format
2 changes: 1 addition & 1 deletion packages/gbeata/src/GSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ const GSearch = forwardRef(function GSearch(props: GSearchProps, ref) {
inline ? styles.inline : '',
)}
>
<div className="mw-search-content" ref={wrapRef}>
<div className="g-search-content" ref={wrapRef}>
<GForm
layout={{ labelCol: { flex: '100px' } }}
ref={formRef}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import '../less/variable.less';

.mw-search-list {
.g-search-list {
.ant-pagination {
margin-right: @space !important;
}
Expand All @@ -27,7 +27,7 @@
}
}

.mw-search-list-more {
.g-search-list-more {
padding-right: 0;

.ant-row {
Expand Down Expand Up @@ -55,47 +55,47 @@
}
}

.mw-search-list-more-submit {
.g-search-list-more-submit {
display: none !important;
}

.mw-search-list-extra-fields-edit-line {
.g-search-list-extra-fields-edit-line {
margin: @gap 0;
display: flex;
justify-content: space-between;
align-items: center;
}

.mw-search-list-extra-fields-edit-line-right {
.g-search-list-extra-fields-edit-line-right {
display: flex;
align-items: center;
}

.mw-search-list-alert {
.g-search-list-alert {
margin: 0 @space2 @space2 !important;

.ant-alert-icon {
transform: translateY(1px);
}
}

.mw-search-poper {
.g-search-poper {
width: 300px;
max-height: 180px;
overflow: auto;
}

.mw-search-list-extra-btns {
.g-search-list-extra-btns {
margin-left: @space;
}

.mw-search-list-footer-actions {
.g-search-list-footer-actions {
right: 0;
bottom: 0;
width: 100%;
padding: @space @space2;
box-shadow: 0 -6px 16px -8px rgba(0, 0, 0, 0.08), 0 -9px 28px 0 rgba(0, 0, 0, 0.05),
0 -12px 48px 16px rgba(0, 0, 0, 0.03);
box-shadow: 0 -6px 16px -8px rgba(0, 0, 0, 0.08),
0 -9px 28px 0 rgba(0, 0, 0, 0.05), 0 -12px 48px 16px rgba(0, 0, 0, 0.03);
background-color: #fff;
z-index: 101;
position: fixed;
Expand Down
14 changes: 7 additions & 7 deletions packages/gbeata/src/GSearchList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ import Selection from './Selection';
import SelectionAll from './SelectionAll';
import { GSearchListProps } from './g-search-list';

import './mw-search-list.less';
import './g-search-list.less';

export { Selection, SelectionAll };

/**
* 转化并过滤成 mw-search 能用的 fields
* 转化并过滤成 g-search 能用的 fields
* @param fields 查询表格的 fields
*/
const getSearchFields = (fields: Array<GSearchTableField>) => {
Expand Down Expand Up @@ -345,14 +345,14 @@ function GSearchList(props: GSearchListProps, ref: Ref<any>) {
if (moreSearchFields && moreSearchFields.length) {
children.push(
<GForm
className="mw-search-list-more"
key="mw-search-list-more"
className="g-search-list-more"
key="g-search-list-more"
ref={moreSearchRef}
fields={moreSearchFields}
onConfirm={onConfirm}
>
<GButton
className="mw-search-list-more-submit"
className="g-search-list-more-submit"
htmlType="submit"
></GButton>
</GForm>,
Expand All @@ -372,7 +372,7 @@ function GSearchList(props: GSearchListProps, ref: Ref<any>) {
}, [moreSearchRef, moreSearchFields, onConfirm, rightActions, extraBtns]);

return (
<div className={`mw-search-list ${isEnter ? 'full' : ''}`}>
<div className={`g-search-list ${isEnter ? 'full' : ''}`}>
<GSearchTableContext.Provider
value={{
formRef,
Expand Down Expand Up @@ -411,7 +411,7 @@ function GSearchList(props: GSearchListProps, ref: Ref<any>) {
{tableChildren}
</GList>
{selection.length && footerActions.length ? (
<div className="mw-search-list-footer-actions">
<div className="g-search-list-footer-actions">
{message}
<Space>{footerActions}</Space>
</div>
Expand Down
Loading

0 comments on commit 4da56f4

Please sign in to comment.