Skip to content

Commit

Permalink
Merge pull request #66 from hocgin/v4.0.39
Browse files Browse the repository at this point in the history
V4.0.39
  • Loading branch information
hocgin authored Dec 26, 2021
2 parents 865df83 + b8f4ed4 commit a064675
Show file tree
Hide file tree
Showing 30 changed files with 337 additions and 272 deletions.
9 changes: 9 additions & 0 deletions _docs/可选引入.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ console.log(e);

### 可选组件(动态加载组件)
https://umijs.org/zh-CN/docs/ssr#%E5%A6%82%E4%BD%95%E5%88%A4%E6%96%AD%E5%BD%93%E5%89%8D%E9%A1%B5%E9%9D%A2%E6%98%AF-ssr-%E8%BF%98%E6%98%AF-csr%EF%BC%9F
import { dynamic } from 'umi';

export default dynamic({
loader: async function() {
// 这里的注释 webpackChunkName 可以指导 webpack 将该组件 HugeA 以这个名字单独拆出去
const { default: HugeA } = await import(/* webpackChunkName: "external_A" */ './HugeA');
return HugeA;
},
});
16 changes: 15 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ npm install @hocgin/ui
yarn add @hocgin/ui
```

## 组件分类
### 普通组件

### 高阶组件
- Archive [存档组件] => 目前废弃状态,使用 Antd Pro 的 SchemaForm 进行扩展。
- Exhibit [展览组件] => 目前扩展状态,需符合 Antd Pro 的 ProField 方式进行扩展。
- Promise [契约组件] => 契约数据结构快捷使用的构件。
- Promise.Schema [配置化契约构件]
- Schema.ArchiveSchemaConfig [存档构件] 新增、修改
- Schema.DeleteSchemaConfig [删除构件] 删除
- Schema.ExhibitSchemaConfig [展览构件] 详情
- Schema.TableSchemaConfig [表单构件] 表单查询


## 查看文档

[组件文档](http://127.0.0.1:8000/components/comment)
[组件文档](/components)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hocgin/ui",
"version": "4.0.38",
"version": "4.0.39",
"sideEffects": [
".less",
".css"
Expand Down
2 changes: 1 addition & 1 deletion src/Archive/archive.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# @formatter:off
title: Archive - 存档
title: Archive - 存档(弃)
order: 1000
nav:
title: 高级组件
Expand Down
4 changes: 3 additions & 1 deletion src/Comment/components/Editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import { ClearOutlined, SmileOutlined, UserOutlined } from '@ant-design/icons';
import {
CommentType,
ReplyDataType,
ReplyParamsType, UseAction,
ReplyParamsType,
UseAction,
UserDataType,
} from '../type';
// @ts-ignore
import { Picker } from 'emoji-mart';
import 'emoji-mart/css/emoji-mart.css';
import { useMount, useRequest } from 'ahooks';

const { TextArea } = Input;
Expand Down
13 changes: 11 additions & 2 deletions src/Exhibit/components/Link/Link.less
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
.link {
display: inline-block;
padding: 0 4px;
padding: 2px;
border-radius: 2px;
background: #c1a3a31f;
border: 1px dashed #ebedf1;
margin: 1px;
box-sizing: border-box;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
width: 10em;

&:hover {
opacity: 0.8;
cursor: pointer;
font-weight: 350;
font-weight: 300;
}
}

.linkText {
padding-left: 2px;
}
2 changes: 1 addition & 1 deletion src/Exhibit/components/Link/Site.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Index extends React.Component<SiteProps> {
<Tooltip placement="top" color="#383838" title={fullUrl}>
<LinkOutlined />
</Tooltip>
&nbsp;{title || url}
<span className={styles.linkText}>{title || url}</span>
</a>
</div>
);
Expand Down
30 changes: 15 additions & 15 deletions src/Footer/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { Logo as GinLogo } from '@hocgin/ui';
const GitHubFilled = (props: any) => {
return (
<i className={classnames(props.className, styles.github)}>
<svg role='img' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'>
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<title>GitHub icon</title>
<path
fill='currentColor'
d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'
fill="currentColor"
d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
/>
</svg>
</i>
Expand All @@ -20,11 +20,11 @@ const GitHubFilled = (props: any) => {
const SinaWeiboFilled = (props: any) => {
return (
<i className={classnames(props.className, styles.weibo)}>
<svg role='img' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'>
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<title>Sina Weibo icon</title>
<path
fill='currentColor'
d='M10.098 20.323c-3.977.391-7.414-1.406-7.672-4.02-.259-2.609 2.759-5.047 6.74-5.441 3.979-.394 7.413 1.404 7.671 4.018.259 2.6-2.759 5.049-6.737 5.439l-.002.004zM9.05 17.219c-.384.616-1.208.884-1.829.602-.612-.279-.793-.991-.406-1.593.379-.595 1.176-.861 1.793-.601.622.263.82.972.442 1.592zm1.27-1.627c-.141.237-.449.353-.689.253-.236-.09-.313-.361-.177-.586.138-.227.436-.346.672-.24.239.09.315.36.18.601l.014-.028zm.176-2.719c-1.893-.493-4.033.45-4.857 2.118-.836 1.704-.026 3.591 1.886 4.21 1.983.64 4.318-.341 5.132-2.179.8-1.793-.201-3.642-2.161-4.149zm7.563-1.224c-.346-.105-.57-.18-.405-.615.375-.977.42-1.804 0-2.404-.781-1.112-2.915-1.053-5.364-.03 0 0-.766.331-.571-.271.376-1.217.315-2.224-.27-2.809-1.338-1.337-4.869.045-7.888 3.08C1.309 10.87 0 13.273 0 15.348c0 3.981 5.099 6.395 10.086 6.395 6.536 0 10.888-3.801 10.888-6.82 0-1.822-1.547-2.854-2.915-3.284v.01zm1.908-5.092c-.766-.856-1.908-1.187-2.96-.962-.436.09-.706.511-.616.932.09.42.511.691.932.602.511-.105 1.067.044 1.442.465.376.421.466.977.316 1.473-.136.406.089.856.51.992.405.119.857-.105.992-.512.33-1.021.12-2.178-.646-3.035l.03.045zm2.418-2.195c-1.576-1.757-3.905-2.419-6.054-1.968-.496.104-.812.587-.706 1.081.104.496.586.813 1.082.707 1.532-.331 3.185.15 4.296 1.383 1.112 1.246 1.429 2.943.947 4.416-.165.48.106 1.007.586 1.157.479.165.991-.104 1.157-.586.675-2.088.241-4.478-1.338-6.235l.03.045z'
fill="currentColor"
d="M10.098 20.323c-3.977.391-7.414-1.406-7.672-4.02-.259-2.609 2.759-5.047 6.74-5.441 3.979-.394 7.413 1.404 7.671 4.018.259 2.6-2.759 5.049-6.737 5.439l-.002.004zM9.05 17.219c-.384.616-1.208.884-1.829.602-.612-.279-.793-.991-.406-1.593.379-.595 1.176-.861 1.793-.601.622.263.82.972.442 1.592zm1.27-1.627c-.141.237-.449.353-.689.253-.236-.09-.313-.361-.177-.586.138-.227.436-.346.672-.24.239.09.315.36.18.601l.014-.028zm.176-2.719c-1.893-.493-4.033.45-4.857 2.118-.836 1.704-.026 3.591 1.886 4.21 1.983.64 4.318-.341 5.132-2.179.8-1.793-.201-3.642-2.161-4.149zm7.563-1.224c-.346-.105-.57-.18-.405-.615.375-.977.42-1.804 0-2.404-.781-1.112-2.915-1.053-5.364-.03 0 0-.766.331-.571-.271.376-1.217.315-2.224-.27-2.809-1.338-1.337-4.869.045-7.888 3.08C1.309 10.87 0 13.273 0 15.348c0 3.981 5.099 6.395 10.086 6.395 6.536 0 10.888-3.801 10.888-6.82 0-1.822-1.547-2.854-2.915-3.284v.01zm1.908-5.092c-.766-.856-1.908-1.187-2.96-.962-.436.09-.706.511-.616.932.09.42.511.691.932.602.511-.105 1.067.044 1.442.465.376.421.466.977.316 1.473-.136.406.089.856.51.992.405.119.857-.105.992-.512.33-1.021.12-2.178-.646-3.035l.03.045zm2.418-2.195c-1.576-1.757-3.905-2.419-6.054-1.968-.496.104-.812.587-.706 1.081.104.496.586.813 1.082.707 1.532-.331 3.185.15 4.296 1.383 1.112 1.246 1.429 2.943.947 4.416-.165.48.106 1.007.586 1.157.479.165.991-.104 1.157-.586.675-2.088.241-4.478-1.338-6.235l.03.045z"
/>
</svg>
</i>
Expand All @@ -36,18 +36,18 @@ const SocialLinks = (props: any) => {
<ul className={props.className}>
<li>
<a
href='https://github.com/hocgin'
target='_blank'
rel='noopener noreferrer'
href="https://github.com/hocgin"
target="_blank"
rel="noopener noreferrer"
>
<GitHubFilled />
</a>
</li>
<li>
<a
href='https://weibo.com/hocgin'
target='_blank'
rel='noopener noreferrer'
href="https://weibo.com/hocgin"
target="_blank"
rel="noopener noreferrer"
>
<SinaWeiboFilled />
</a>
Expand All @@ -70,11 +70,11 @@ class Index extends React.Component {
</div>
<div className={styles.copytitle}>
© 2013-2021 |{' '}
<a href='http://www.hocgin.top/' target='_blank'>
🧱 红土块
<a href="http://www.hocgin.top/" target="_blank">
🧱 红土立方
</a>{' '}
|{' '}
<a href='https://beian.miit.gov.cn/' target='_blank'>
<a href="https://beian.miit.gov.cn/" target="_blank">
闽ICP备20004537号
</a>
</div>
Expand Down
84 changes: 33 additions & 51 deletions src/Header/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,59 +1,41 @@
import React from 'react';
import React, { useState } from 'react';
import classnames from 'classnames';
import { MenuOutlined, CloseOutlined } from '@ant-design/icons';
import styles from './index.less';

interface LogoProps {
const Index: React.FC<{
menus?: any[];
className?: string | undefined;
}

interface LogoState {
isOpenMenu?: boolean;
}

class Index extends React.Component<LogoProps, LogoState> {
static defaultProps = {
menus: [],
};
state = {
isOpenMenu: false,
};

render() {
let { isOpenMenu } = this.state;
let { menus, className } = this.props;
return (
<header className={classnames(styles.topHeader, className)}>
<a href="http://www.hocgin.top/" className={styles.logo}>
HOCGIN
<span className={styles.suffix}>
<span className={styles.dot}>.</span>top
</span>
</a>
<div
className={classnames(styles.toggle, { [styles.active]: isOpenMenu })}
onClick={this.onClickToggle}
>
{isOpenMenu ? <CloseOutlined /> : <MenuOutlined />}
</div>
<ul
className={classnames(styles.navigation, {
[styles.active]: isOpenMenu,
})}
>
{(menus || []).map(({ href, title }, index) => (
<li key={index}>
<a href={href}>{title}</a>
</li>
))}
</ul>
</header>
);
}

onClickToggle = () =>
this.setState(({ isOpenMenu }) => ({ isOpenMenu: !isOpenMenu }));
}
}> = ({ className, menus = [] }, ref) => {
let [isOpenMenu, setIsOpenMenu] = useState(false);
return (
<header className={classnames(styles.topHeader, className)}>
<a href="http://www.hocgin.top/" className={styles.logo}>
<span>HOCGIN</span>
<span className={styles.suffix}>
<span className={styles.dot}>.</span>
<span>top</span>
</span>
</a>
<div
className={classnames(styles.toggle, { [styles.active]: isOpenMenu })}
onClick={() => setIsOpenMenu(!isOpenMenu)}
>
{isOpenMenu ? <CloseOutlined /> : <MenuOutlined />}
</div>
<ul
className={classnames(styles.navigation, {
[styles.active]: isOpenMenu,
})}
>
{(menus || []).map(({ href, title }, index) => (
<li key={index}>
<a href={href}>{title}</a>
</li>
))}
</ul>
</header>
);
};

export default Index;
41 changes: 16 additions & 25 deletions src/Markdown/components/Editor/index.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
import React, { Component } from 'react';
import React from 'react';
import styles from './index.less';

interface EditorProps {
value: string;
height?: number;
onChange?: (value?: string) => void;
}

class Index extends Component<EditorProps, {}> {
static defaultProps = {};

constructor(props: any, context: any) {
super(props, context);
const MDEditor: React.FC<any> = ({ ...rest }: any) => {
try {
let Uiw = require('@uiw/react-md-editor')?.default;
console.log(Uiw);
return <Uiw {...rest} />;
} catch (e) {
return <div>需要安装 @uiw/react-md-editor</div>;
}
};

render() {
let { children, value, height, onChange } = this.props;

let result = <span>需要安装 @uiw/react-md-editor</span>;
try {
let MDEditor = require('@uiw/react-md-editor');
result = <MDEditor value={value} height={height} onChange={onChange} />;
} catch (e) {
console.warn('需要安装 @uiw/react-md-editor', e);
}

return <>{result}</>;
}
}
const Index: React.FC<{
value: string;
height?: number;
onChange?: (value?: string) => void;
}> = ({ children, value, height, onChange }, ref) => {
return <><MDEditor value={value} height={height} onChange={onChange} /></>;
};

export default Index;
43 changes: 13 additions & 30 deletions src/Markdown/components/Preview/index.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,21 @@
import React, { Component } from 'react';
import styles from './index.less';

interface EditorProps {
children?: string;
}

interface EditorState {
}

class Index extends Component<EditorProps, EditorState> {
static defaultProps = {
children: '',
};

constructor(props: any, context: any) {
super(props, context);
const Markdown: React.FC<any> = ({ ...rest }: any) => {
try {
let Uiw = require('@uiw/react-md-editor')?.default;
console.log(Uiw);
return <Uiw.Markdown {...rest} />;
} catch (e) {
return <div>需要安装 @uiw/react-md-editor</div>;
}
};

render() {
let { children } = this.props;
let result = <span>需要安装 @uiw/react-md-editor</span>;
try {
let MDEditor = require('@uiw/react-md-editor');
result = <MDEditor.Markdown source={children} />;
} catch (e) {
console.warn('需要安装 @uiw/react-md-editor', e);
}

return (
<div className={styles.markdownPreview}>
{result}
</div>
);
}
}
const Index: React.FC<{
children?: string;
}> = ({ children }, ref) => {
return <><Markdown source={children} /></>;
};

export default Index;
1 change: 0 additions & 1 deletion src/Money/CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/Promise/components/Encoding/index.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.view {
display: flex;
display: flex!important;

.input {
flex: 1 1;
Expand Down
Loading

1 comment on commit a064675

@vercel
Copy link

@vercel vercel bot commented on a064675 Dec 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.