Skip to content

Commit f69f983

Browse files
committed
version 1.1.8
feat: bottom res support folders chore: Add loading for create org/group/login fix: scanner https err tip fix(table): fix table expansion problem
1 parent 2395c7e commit f69f983

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2452
-512
lines changed

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.7
1+
1.1.8

client/packages/openblocks-comps/src/comps/calendarComp/calendarConstants.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export const Wrapper = styled.div<{
261261
border-radius: 4px;
262262
box-shadow: 0 0px 10px 4px rgba(0, 0, 0, 0.25);
263263
overflow: hidden;
264-
left: ${(props) => `min(${props.left}px, calc(100% - 202px)) !important`};
264+
left: ${(props) => `min(${props.left}px, calc(100% - 210px)) !important`};
265265
.fc-popover-body {
266266
padding: 4px 0;
267267
min-width: 200px;
@@ -307,7 +307,8 @@ export const Wrapper = styled.div<{
307307
.fc-dayGridMonth-view .fc-more-link {
308308
margin: 0 2px 2px 2px !important;
309309
}
310-
.fc-timeGridWeek-view .fc-more-link {
310+
.fc-timeGridWeek-view .fc-more-link,
311+
.fc-timeGridDay-view .fc-more-link {
311312
margin: 2px !important;
312313
}
313314
.fc-daygrid-day-events {

client/packages/openblocks-design/src/components/Collapase.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ReactComponent as UnFold } from "icons/icon-unfold.svg";
33
import { ReactComponent as Folded } from "icons/icon-folded.svg";
44
import { ReactComponent as Omit } from "icons/icon-omit.svg";
55
import styled, { css } from "styled-components";
6-
import React, { ReactNode, useMemo } from "react";
6+
import React, { ReactNode } from "react";
77

88
const Panel = styled(AntdCollapse.Panel)`
99
.ant-collapse-header-text {
@@ -72,6 +72,7 @@ interface Iprops {
7272
isSelected?: boolean;
7373
simple?: boolean; // no nested
7474
isOpen?: boolean;
75+
className?: string;
7576
}
7677

7778
export const PadDiv = styled.div`
@@ -99,7 +100,7 @@ export const Collapse = (props: Iprops) => {
99100
// };
100101
return (
101102
// <Contain $color={props.isSelected || Color!==""}>
102-
<Container optColor={props.isSelected} simple={props.simple}>
103+
<Container optColor={props.isSelected} simple={props.simple} className={props.className}>
103104
<AntdCollapse
104105
ghost
105106
expandIcon={getExpandIcon}

client/packages/openblocks-design/src/components/Search.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const SearchDiv = styled.div<{ error?: boolean }>`
4343
}
4444
`;
4545
const SearchIcon = styled(Icon)`
46+
color: #9195a3;
4647
margin: 6px 0 6px 8px;
4748
`;
4849

client/packages/openblocks-design/src/components/Section.tsx

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,28 @@ import { controlItem, ControlNode } from "./control";
88
const SectionItem = styled.div<{ width?: number }>`
99
width: ${(props) => (props.width ? props.width : 312)}px;
1010
border-bottom: 1px solid #e1e3eb;
11+
1112
&:last-child {
1213
border-bottom: none;
1314
}
1415
`;
15-
const Sectionlabel = styled.span`
16+
const SectionLabel = styled.div`
1617
${labelCss};
18+
flex-grow: 1;
1719
font-size: 14px;
1820
color: #8b8fa3;
1921
line-height: 46px;
2022
font-weight: 600;
23+
2124
:hover {
2225
cursor: pointer;
2326
}
2427
`;
28+
2529
interface Irotate {
2630
deg: string;
2731
}
32+
2833
const PackupIcon = styled(Packup)<Irotate>`
2934
height: 20px;
3035
width: 20px;
@@ -33,20 +38,26 @@ const PackupIcon = styled(Packup)<Irotate>`
3338
margin-right: 16px;
3439
color: #8b8fa3;
3540
transform: ${(props) => props.deg};
41+
3642
:hover {
3743
cursor: pointer;
3844
}
3945
`;
4046

41-
const SectionlabelDiv = styled.div`
47+
const SectionLabelDiv = styled.div`
48+
display: flex;
49+
justify-content: space-between;
4250
height: 46px;
4351
margin-left: 16px;
52+
4453
:hover {
4554
cursor: pointer;
4655
}
47-
&:hover ${Sectionlabel} {
56+
57+
&:hover ${SectionLabel} {
4858
color: #222222;
4959
}
60+
5061
&:hover ${PackupIcon} path {
5162
fill: #222222;
5263
}
@@ -68,6 +79,7 @@ interface ISectionConfig<T> {
6879
noMargin?: boolean;
6980
style?: React.CSSProperties;
7081
children: T;
82+
additionalButton?: React.ReactNode;
7183
}
7284

7385
export interface PropertySectionState {
@@ -103,10 +115,13 @@ export const BaseSection = (props: ISectionConfig<ReactNode>) => {
103115
return (
104116
<SectionItem width={props.width} style={props.style}>
105117
{props.name && (
106-
<SectionlabelDiv onClick={handleToggle}>
107-
<Sectionlabel>{props.name}</Sectionlabel>
108-
<PackupIcon deg={open ? "rotate(0deg)" : "rotate(180deg)"} />
109-
</SectionlabelDiv>
118+
<SectionLabelDiv onClick={handleToggle} className={"section-header"}>
119+
<SectionLabel>{props.name}</SectionLabel>
120+
<div style={{ display: "flex" }}>
121+
{props.additionalButton}
122+
<PackupIcon deg={open ? "rotate(0deg)" : "rotate(180deg)"} />
123+
</div>
124+
</SectionLabelDiv>
110125
)}
111126
<ShowChildren show={open ? "flex" : "none"} noMargin={props.noMargin}>
112127
{props.children}

client/packages/openblocks-design/src/components/button.tsx

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const buttonStyleConfig = {
134134
};
135135
export type TacoButtonType = keyof typeof buttonStyleConfig;
136136

137-
const StyledAntdButton = styled(Button)<{ $buttonType: TacoButtonType }>`
137+
const StyledAntdButton = styled(Button)<{ $buttonType: TacoButtonType; $loading: boolean }>`
138138
${(props) => buttonStyleConfig[props.$buttonType]};
139139
display: flex;
140140
align-items: center;
@@ -148,19 +148,25 @@ const StyledAntdButton = styled(Button)<{ $buttonType: TacoButtonType }>`
148148
box-shadow: none;
149149
}
150150
151-
&.ant-btn-loading {
152-
span {
153-
display: none;
154-
}
151+
.ant-btn-loading-icon {
152+
display: none;
155153
}
156154
157155
& > svg {
156+
${(props) => props.$loading && "display: none;"}
158157
width: 12px;
159158
height: 12px;
160159
margin-right: 4px;
161160
}
162161
`;
163162

163+
const loadingStyle: CSSProperties = {
164+
position: "absolute",
165+
left: "50%",
166+
top: "50%",
167+
transform: "translate(-50%, -50%)",
168+
};
169+
164170
/**
165171
* antd button style adjustment when loading
166172
*/
@@ -172,15 +178,34 @@ const TacoButton = forwardRef(
172178
ref: React.Ref<HTMLElement>
173179
) => {
174180
const { buttonType, ...restProps } = props;
175-
const LoadingComp = !buttonType || buttonType === "link" ? LightLoading : Loading;
181+
let loadingBackground;
182+
let loadingColor;
183+
if (buttonType === "link") {
184+
loadingBackground = "#fafbff";
185+
loadingColor = "#3377FF";
186+
} else if (buttonType === "delete") {
187+
loadingBackground = "#fef4f4";
188+
loadingColor = "#f73131";
189+
}
176190
return (
177-
<StyledAntdButton {...restProps} $buttonType={props.buttonType ?? "normal"} ref={ref}>
191+
<StyledAntdButton
192+
{...restProps}
193+
$buttonType={props.buttonType ?? "normal"}
194+
$loading={!!props.loading}
195+
ref={ref}
196+
>
178197
{props.loading ? (
179-
buttonType === "delete" ? (
180-
<LoadingComp backgroundColor={"#fef4f4"} color={"#f73131"} />
181-
) : (
182-
<LoadingComp />
183-
)
198+
<>
199+
<span style={{ visibility: "hidden" }}>
200+
{props.icon}
201+
{props.children}
202+
</span>
203+
<Loading
204+
style={loadingStyle}
205+
backgroundColor={loadingBackground}
206+
color={loadingColor}
207+
/>
208+
</>
184209
) : (
185210
props.children
186211
)}

client/packages/openblocks-design/src/components/edit.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export interface EditTextProps {
8181
prefixIcon?: ReactNode;
8282
text: string;
8383
disabled?: boolean;
84+
forceClickIcon?: boolean;
8485
onFinish: (value: any) => void;
8586
onChange?: (value: any) => void;
8687
onEditStateChange?: (editing: boolean) => void;
@@ -107,6 +108,7 @@ export const EditText = (props: EditTextProps) => {
107108
$hasPrefix={!!props.prefixIcon}
108109
ref={inputRef}
109110
defaultValue={props.text}
111+
onClick={(e) => e.stopPropagation()}
110112
onChange={(e) => props.onChange?.((e.target as HTMLInputElement).value)}
111113
onBlur={(e) => {
112114
props.onFinish(e.target.value);
@@ -123,12 +125,15 @@ export const EditText = (props: EditTextProps) => {
123125
disabled={props.disabled}
124126
hasPrefix={!!props.prefixIcon}
125127
className="taco-edit-text-wrapper"
126-
onClick={() => !props.disabled && setEditing(true)}
128+
onClick={() => !props.disabled && !props.forceClickIcon && setEditing(true)}
127129
>
128130
<TextWrapper className={"taco-edit-text-body"} title={props.text}>
129131
{props.text}
130132
</TextWrapper>
131-
<EditIcon className={"taco-edit-text-icon"} />
133+
<EditIcon
134+
onClick={() => !props.disabled && setEditing(true)}
135+
className={"taco-edit-text-icon"}
136+
/>
132137
</EditTextWrapper>
133138
)}
134139
{props.prefixIcon && <Prefix>{props.prefixIcon}</Prefix>}
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 13 additions & 0 deletions
Loading
Lines changed: 6 additions & 0 deletions
Loading
Lines changed: 16 additions & 0 deletions
Loading
Lines changed: 14 additions & 0 deletions
Loading

client/packages/openblocks-design/src/icons/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ export { ReactComponent as SearchIcon } from "./icon-Search.svg";
144144
export { ReactComponent as SearchOutlinedIcon } from "./icon-SearchOutlined.svg";
145145
export { ReactComponent as FilterIcon } from "./icon-filter.svg";
146146
export { ReactComponent as DownloadIcon } from "./icon-download.svg";
147+
export { ReactComponent as DownloadBoldIcon } from "./icon-download-bold.svg";
148+
export { ReactComponent as DownloadedIcon } from "./icon-downloaded.svg";
147149
export { ReactComponent as SettingIcon } from "./icon-setting.svg";
148150
export { ReactComponent as RefreshIcon } from "./icon-refresh.svg";
149151
export { ReactComponent as DeleteIcon } from "./icon-recycle-bin.svg";
@@ -154,6 +156,7 @@ export { ReactComponent as CloseIcon } from "./icon-close.svg";
154156
export { ReactComponent as SuccessIcon } from "./icon-success.svg";
155157
export { ReactComponent as ErrorIcon } from "./icon-err-warning.svg";
156158
export { ReactComponent as DocIcon } from "./icon-tutorial.svg";
159+
export { ReactComponent as DocBoldIcon } from "./icon-tutorial-bold.svg";
157160
export { ReactComponent as QRCodeCompIcon } from "./icon-qrcode.svg";
158161
export { ReactComponent as NavDocIcon } from "./icon-nav-doc.svg";
159162
export { ReactComponent as LabIcon } from "./icon-laboratory.svg";
@@ -280,3 +283,4 @@ export { ReactComponent as UnLockIcon } from "icons/icon-unlock.svg";
280283
export { ReactComponent as CalendarDeleteIcon } from "icons/icon-calendar-delete.svg";
281284
export { ReactComponent as TableCheckedIcon } from "icons/icon-table-checked.svg";
282285
export { ReactComponent as TableUnCheckedIcon } from "icons/icon-table-boolean-false.svg";
286+
export { ReactComponent as FileFolderIcon } from "icons/icon-editor-folder.svg";
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import Api from "./api";
2+
import { AxiosPromise } from "axios";
3+
import { GenericApiResponse } from "api/apiResponses";
4+
import { FetchJSLibraryMetasPayload } from "redux/reduxActions/jsLibraryActions";
5+
6+
export interface JSLibraryMeta {
7+
name: string;
8+
latestVersion: string;
9+
homepage?: string;
10+
description?: string;
11+
}
12+
13+
export interface RecommendedJSLibraryMeta extends JSLibraryMeta {
14+
downloadUrl: string;
15+
}
16+
17+
export class JSLibraryApi extends Api {
18+
static url = "/misc/js-library";
19+
20+
static fetchMetas(
21+
request: FetchJSLibraryMetasPayload
22+
): AxiosPromise<GenericApiResponse<JSLibraryMeta[]>> {
23+
return Api.get(JSLibraryApi.url + `/metas`, { name: request.names.join(",") });
24+
}
25+
26+
static fetchRecommends(): AxiosPromise<GenericApiResponse<RecommendedJSLibraryMeta[]>> {
27+
return Api.get(JSLibraryApi.url + `/recommendations`);
28+
}
29+
}

0 commit comments

Comments
 (0)