Skip to content

Commit c79fead

Browse files
fixed imported dependencies path
1 parent 2c1a1da commit c79fead

File tree

12 files changed

+68
-24
lines changed

12 files changed

+68
-24
lines changed

client/packages/lowcoder/src/comps/comps/buttonComp/buttonComp.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import {
2525
import { RefControl } from "comps/controls/refControl";
2626

2727
import React, { useContext } from "react";
28-
import { AnimationStyle, styleControl } from "@lowcoder-ee/index.sdk";
28+
import { AnimationStyle } from "@lowcoder-ee/comps/controls/styleControlConstants";
29+
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
2930

3031
const FormLabel = styled(CommonBlueLabel)`
3132
font-size: 13px;
@@ -130,7 +131,7 @@ const ButtonTmpComp = (function () {
130131
prefixIcon: IconControl,
131132
suffixIcon: IconControl,
132133
style: ButtonStyleControl,
133-
animationStyle:styleControl(AnimationStyle),
134+
animationStyle: styleControl(AnimationStyle),
134135
viewRef: RefControl<HTMLElement>,
135136
};
136137
return new UICompBuilder(childrenMap, (props) => (

client/packages/lowcoder/src/comps/comps/buttonComp/dropdownComp.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import {
2121
ButtonStyleControl,
2222
getButtonStyle,
2323
} from "./buttonCompConstants";
24-
import { styleControl } from "@lowcoder-ee/index.sdk";
25-
24+
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
2625

2726
const StyledDropdownButton = styled(DropdownButton)`
2827
width: 100%;

client/packages/lowcoder/src/comps/comps/containerComp/containerComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import { BoolCodeControl } from "comps/controls/codeControl";
1616
import { DisabledContext } from "comps/generators/uiCompBuilder";
1717
import React, { useContext } from "react";
1818
import { EditorContext } from "comps/editorState";
19-
import { AnimationStyle, styleControl } from "@lowcoder-ee/index.sdk";
19+
import { AnimationStyle } from "@lowcoder-ee/comps/controls/styleControlConstants";
20+
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
2021

2122
export const ContainerBaseComp = (function () {
2223
const childrenMap = {

client/packages/lowcoder/src/comps/comps/containerComp/pageLayoutComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import {
1818
ContainerCompBuilder,
1919
} from "../pageLayoutComp/pageLayoutCompBuilder";
2020
import { PageLayout } from "../pageLayoutComp/pageLayout";
21-
import { AnimationStyle, styleControl } from "@lowcoder-ee/index.sdk";
21+
import { AnimationStyle } from "@lowcoder-ee/comps/controls/styleControlConstants";
22+
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
2223

2324
export const ContainerBaseComp = (function () {
2425
const childrenMap = {

client/packages/lowcoder/src/comps/comps/customComp/customComp.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import { EventData, EventTypeEnum } from "./types";
1212
import { hiddenPropertyView } from "comps/utils/propertyUtils";
1313
import { trans } from "i18n";
1414
import { EditorContext } from "comps/editorState";
15-
import { AnimationStyle, AnimationStyleType, CustomStyle, CustomStyleType, styleControl } from "@lowcoder-ee/index.sdk";
15+
import { AnimationStyle, AnimationStyleType, CustomStyle, CustomStyleType } from "@lowcoder-ee/comps/controls/styleControlConstants";
16+
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
1617

1718
// TODO: eventually to embedd in container so we have styling?
1819
// TODO: support different starter templates for different frameworks (react, ANT, Flutter, Angular, etc)
@@ -218,7 +219,7 @@ function InnerCustomComponent(props: IProps) {
218219
const childrenMap = {
219220
model: jsonObjectStateControl(defaultModel),
220221
code: withDefault(StringControl, defaultCode),
221-
style:styleControl(CustomStyle),
222+
style: styleControl(CustomStyle),
222223
animationStyle:styleControl(AnimationStyle),
223224
};
224225

client/packages/lowcoder/src/comps/comps/formComp/formComp.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ import { DisabledContext } from "comps/generators/uiCompBuilder";
5858
import { default as LoadingOutlined } from "@ant-design/icons/LoadingOutlined";
5959
import { messageInstance } from "lowcoder-design/src/components/GlobalInstances";
6060
import { styled } from "styled-components";
61-
import { AnimationStyle, styleControl } from "@lowcoder-ee/index.sdk";
61+
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
62+
import { AnimationStyle } from "@lowcoder-ee/comps/controls/styleControlConstants";
6263

6364
const FormWrapper = styled.div`
6465
height: 100%;
@@ -79,7 +80,7 @@ const childrenMap = {
7980
disableSubmit: BoolCodeControl,
8081
loading: BoolCodeControl,
8182
onEvent: eventHandlerControl(eventOptions),
82-
animationStyle:styleControl(AnimationStyle)
83+
animationStyle: styleControl(AnimationStyle)
8384
};
8485

8586
type FormProps = TriContainerViewProps &

client/packages/lowcoder/src/comps/comps/jsonComp/jsonExplorerComp.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import { hiddenPropertyView } from "comps/utils/propertyUtils";
1111
import { trans } from "i18n";
1212
import { EditorContext } from "comps/editorState";
1313
import { useContext } from "react";
14-
import { AnimationStyle, AnimationStyleType, styleControl } from "@lowcoder-ee/index.sdk";
14+
import { AnimationStyle, AnimationStyleType } from "@lowcoder-ee/comps/controls/styleControlConstants";
15+
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
1516

1617
/**
1718
* JsonExplorer Comp
@@ -54,7 +55,7 @@ let JsonExplorerTmpComp = (function () {
5455
indent: withDefault(NumberControl, 4),
5556
expandToggle: BoolControl.DEFAULT_TRUE,
5657
theme: dropdownControl(themeOptions, 'shapeshifter:inverted'),
57-
animationStyle:styleControl(AnimationStyle),
58+
animationStyle: styleControl(AnimationStyle),
5859
};
5960
return new UICompBuilder(childrenMap, (props) => (
6061
<JsonExplorerContainer

client/packages/lowcoder/src/comps/comps/listViewComp/listView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import {
1818
import { ContextContainerComp } from "./contextContainerComp";
1919
import { ListViewImplComp } from "./listViewComp";
2020
import { getCurrentItemParams, getData } from "./listViewUtils";
21-
import { AnimationStyleType } from "@lowcoder-ee/index.sdk";
2221
import { CompTypeContext } from "@lowcoder-ee/comps/utils/compTypeContext";
2322
import { ThemeContext } from "@lowcoder-ee/comps/utils/themeContext";
2423
import { setInitialCompStyles } from "@lowcoder-ee/comps/utils/themeUtil";
2524
import { childrenToProps } from "@lowcoder-ee/comps/generators/multi";
25+
import { AnimationStyleType } from "@lowcoder-ee/comps/controls/styleControlConstants";
2626

2727
const ListViewWrapper = styled.div<{ $style: any; $paddingWidth: string,$animationStyle:AnimationStyleType }>`
2828
height: 100%;

client/packages/lowcoder/src/comps/comps/meetingComp/controlButton.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import { useEffect, useRef, useState } from "react";
3939
import ReactResizeDetector from "react-resize-detector";
4040

4141
import { useContext } from "react";
42-
import { BoolControl } from "@lowcoder-ee/index.sdk";
4342

4443
const Container = styled.div<{ $style: any }>`
4544
height: 100%;

client/packages/lowcoder/src/comps/comps/progressCircleComp.tsx

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ import { NameConfig, NameConfigHidden, withExposingConfigs } from "../generators
99
import { hiddenPropertyView } from "comps/utils/propertyUtils";
1010
import { trans } from "i18n";
1111

12-
import { useContext } from "react";
12+
import { useContext, useEffect } from "react";
1313
import { EditorContext } from "comps/editorState";
14+
import { ThemeContext } from "../utils/themeContext";
15+
import { CompTypeContext } from "../utils/compTypeContext";
16+
import { setInitialCompStyles } from "../utils/themeUtil";
1417

1518
// TODO: after Update of ANTd, introduce Size attribute to ProgressCircle
1619

@@ -69,10 +72,27 @@ let ProgressCircleTmpComp = (function () {
6972
const childrenMap = {
7073
value: numberExposingStateControl("value", 60),
7174
// borderRadius property hidden as it's not valid for progress circle
72-
style: styleControl(CircleProgressStyle),
73-
animationStyle: styleControl(AnimationStyle),
75+
style: styleControl(CircleProgressStyle, 'style'),
76+
animationStyle: styleControl(AnimationStyle, 'animationStyle'),
7477
};
75-
return new UICompBuilder(childrenMap, (props) => {
78+
return new UICompBuilder(childrenMap, (props, dispatch) => {
79+
const theme = useContext(ThemeContext);
80+
const compType = useContext(CompTypeContext);
81+
const compTheme = theme?.theme?.components?.[compType];
82+
83+
const styleProps: Record<string, any> = {};
84+
['style', 'animationStyle'].forEach((key: string) => {
85+
styleProps[key] = (props as any)[key];
86+
});
87+
88+
useEffect(() => {
89+
setInitialCompStyles({
90+
dispatch,
91+
compTheme,
92+
styleProps,
93+
});
94+
}, []);
95+
7696
return (
7797
<StyledProgressCircle
7898
$style={props.style}

client/packages/lowcoder/src/comps/comps/progressComp.tsx

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ import styled, { css } from "styled-components";
1010
import { hiddenPropertyView } from "comps/utils/propertyUtils";
1111
import { trans } from "i18n";
1212

13-
import { useContext } from "react";
13+
import { useContext, useEffect } from "react";
1414
import { EditorContext } from "comps/editorState";
15+
import { ThemeContext } from "../utils/themeContext";
16+
import { CompTypeContext } from "../utils/compTypeContext";
17+
import { setInitialCompStyles } from "../utils/themeUtil";
1518

1619
const getStyle = (style: ProgressStyleType) => {
1720
return css`
@@ -53,10 +56,27 @@ const ProgressBasicComp = (function () {
5356
const childrenMap = {
5457
value: numberExposingStateControl('value', 60),
5558
showInfo: BoolControl,
56-
style: styleControl(ProgressStyle),
57-
animationStyle: styleControl(AnimationStyle),
59+
style: styleControl(ProgressStyle, 'style'),
60+
animationStyle: styleControl(AnimationStyle, 'animationStyle'),
5861
};
59-
return new UICompBuilder(childrenMap, (props) => {
62+
return new UICompBuilder(childrenMap, (props, dispatch) => {
63+
const theme = useContext(ThemeContext);
64+
const compType = useContext(CompTypeContext);
65+
const compTheme = theme?.theme?.components?.[compType];
66+
67+
const styleProps: Record<string, any> = {};
68+
['style', 'animationStyle'].forEach((key: string) => {
69+
styleProps[key] = (props as any)[key];
70+
});
71+
72+
useEffect(() => {
73+
setInitialCompStyles({
74+
dispatch,
75+
compTheme,
76+
styleProps,
77+
});
78+
}, []);
79+
6080
return (
6181
<ProgressStyled
6282
percent={Math.round(props.value.value)}

client/packages/lowcoder/src/comps/comps/selectInputComp/radioCompConstants.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { RefControl } from "comps/controls/refControl";
2222

2323
import { useContext } from "react";
2424
import { EditorContext } from "comps/editorState";
25-
import { withDefault } from "@lowcoder-ee/index.sdk";
25+
import { withDefault } from "@lowcoder-ee/comps/generators";
2626

2727
export const RadioLayoutOptions = [
2828
{ label: trans("radio.horizontal"), value: "horizontal" },
@@ -41,7 +41,7 @@ export const RadioChildrenMap = {
4141
labelStyle:styleControl(LabelStyle),
4242
layout: dropdownControl(RadioLayoutOptions, "horizontal"),
4343
viewRef: RefControl<HTMLDivElement>,
44-
inputFieldStyle:withDefault(styleControl(RadioStyle),{borderWidth: '1px'}),
44+
inputFieldStyle: withDefault(styleControl(RadioStyle),{borderWidth: '1px'}),
4545
animationStyle: styleControl(AnimationStyle),
4646
...SelectInputValidationChildren,
4747
...formDataChildren,

0 commit comments

Comments
 (0)