Skip to content

Commit b95ef20

Browse files
authored
Merge branch 'dev' into pwa-icon-support
2 parents 56b2d1b + 1053d19 commit b95ef20

File tree

4 files changed

+48
-18
lines changed

4 files changed

+48
-18
lines changed

client/packages/lowcoder/src/comps/comps/mediaComp/colorPickerComp.tsx

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Section, sectionNames } from "lowcoder-design";
22
import { BoolControl } from "comps/controls/boolControl";
33
import { styleControl } from "comps/controls/styleControl";
4-
import { ColorPickerStyle, ColorPickerStyleType } from "comps/controls/styleControlConstants";
4+
import { AnimationStyle, ColorPickerStyle, ColorPickerStyleType, DisabledInputStyle, DisabledInputStyleType, InputFieldStyle, InputLikeStyle, InputLikeStyleType, LabelStyle } from "comps/controls/styleControlConstants";
55
import { NameConfig } from "comps/generators/withExposing";
66
import styled, { css } from "styled-components";
77
import { UICompBuilder, withDefault } from "../../generators";
@@ -16,18 +16,22 @@ import { changeEvent, eventHandlerControl } from "comps/controls/eventHandlerCon
1616
import { jsonObjectExposingStateControl, stringExposingStateControl } from "comps/controls/codeStateControl";
1717
import { dropdownControl } from "comps/controls/dropdownControl";
1818
import { ArrayOrJSONObjectControl } from "comps/controls/codeControl";
19-
import { JSONObject } from "@lowcoder-ee/util/jsonTypes";
2019

21-
export function getStyle(style: ColorPickerStyleType) {
20+
export function getStyle(style: InputLikeStyleType) {
2221
return css`
2322
border-radius: ${style.radius};
2423
&:not(.ant-input-disabled, .ant-input-affix-wrapper-disabled),
25-
input {
24+
.ant-color-picker-trigger {
25+
color: ${style.text};
26+
font-weight: ${style.textWeight};
27+
font-family: ${style.fontFamily};
28+
font-style:${style.fontStyle};
29+
text-transform:${style.textTransform};
30+
text-decoration:${style.textDecoration};
2631
background-color: ${style.background};
27-
color:${style.text};
28-
font-weight:${style.textWeight};
29-
font-family:${style.fontFamily};
3032
border-color: ${style.border};
33+
padding: ${style.padding};
34+
margin: ${style.margin};
3135
&:focus,
3236
&.ant-input-affix-wrapper-focused {
3337
border-color: ${style.accent};
@@ -38,15 +42,31 @@ export function getStyle(style: ColorPickerStyleType) {
3842
.ant-input-clear-icon svg:hover {
3943
opacity: 0.65;
4044
}
45+
.ant-color-picker-trigger-text {
46+
font-size: ${style.textSize};
47+
}
4148
}
4249
`;
4350
}
4451

45-
const ColorPickerWrapper = styled(ColorPicker) <{ $style: ColorPickerStyleType }>`
46-
width: 100%;
52+
const ColorPickerWrapper = styled(ColorPicker) <{
53+
$style: InputLikeStyleType;
54+
$disabledStyle?: DisabledInputStyleType;
55+
}>`
4756
display: flex;
4857
justify-content: flex-start;
58+
box-shadow: ${(props) =>
59+
`${props.$style?.boxShadow} ${props.$style?.boxShadowColor}`};
4960
${(props) => props.$style && getStyle(props.$style)}
61+
62+
/* Disabled state styling */
63+
&:disabled,
64+
&.ant-input-disabled {
65+
color: ${(props) => props.$disabledStyle?.disabledText};
66+
background: ${(props) => props.$disabledStyle?.disabledBackground};
67+
border-color: ${(props) => props.$disabledStyle?.disabledBorder};
68+
cursor: not-allowed;
69+
}
5070
`;
5171

5272
const colorPickerTriggerOption = [
@@ -61,20 +81,25 @@ export const colorPickerEvent = eventHandlerControl([
6181
const childrenMap = {
6282
...textInputChildren,
6383
value: stringExposingStateControl('value', '#3377ff'),
64-
style: styleControl(ColorPickerStyle , 'style'),
6584
color: jsonObjectExposingStateControl('color', {}),
6685
trigger: dropdownControl(colorPickerTriggerOption, 'click'),
6786
disabledAlpha: BoolControl,
6887
showPresets: BoolControl,
6988
onEvent: colorPickerEvent,
7089
presets: withDefault(ArrayOrJSONObjectControl, JSON.stringify(presets, null, 2)),
90+
style: styleControl(InputFieldStyle, 'style'),
91+
labelStyle:styleControl(LabelStyle, 'labelStyle'),
92+
inputFieldStyle: styleControl(InputLikeStyle, 'inputFieldStyle'),
93+
animationStyle: styleControl(AnimationStyle, 'animationStyle'),
94+
disabledStyle: styleControl(DisabledInputStyle, 'disabledStyle'),
7195
};
7296

7397
export const ColorPickerComp = new UICompBuilder(childrenMap, (props) => {
7498
return props.label({
7599
children: (
76100
<ColorPickerWrapper
77-
$style={props.style}
101+
$style={props.inputFieldStyle}
102+
$disabledStyle={props.disabledStyle}
78103
value={props?.value?.value}
79104
disabledAlpha={props.disabledAlpha}
80105
showText={value => value.toHexString().toUpperCase()}
@@ -94,6 +119,9 @@ export const ColorPickerComp = new UICompBuilder(childrenMap, (props) => {
94119
/>
95120
),
96121
style: props.style,
122+
labelStyle: props.labelStyle,
123+
inputFieldStyle:props.inputFieldStyle,
124+
animationStyle:props.animationStyle,
97125
});
98126
})
99127
.setPropertyViewFn((children) => {
@@ -121,6 +149,10 @@ export const ColorPickerComp = new UICompBuilder(childrenMap, (props) => {
121149
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
122150

123151
<Section name={sectionNames.style}>{children.style.getPropertyView()}</Section>
152+
<Section name={sectionNames.labelStyle}>{children.labelStyle.getPropertyView()}</Section>
153+
<Section name={sectionNames.inputFieldStyle}>{children.inputFieldStyle.getPropertyView()}</Section>
154+
<Section name={trans("prop.disabledStyle")}>{children.disabledStyle.getPropertyView()}</Section>
155+
<Section name={sectionNames.animationStyle} hasTooltip={true}>{children.animationStyle.getPropertyView()}</Section>
124156
</>
125157
);
126158
})

client/packages/lowcoder/src/comps/comps/tableComp/tableToolbarComp.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -793,18 +793,15 @@ export const TableToolbar = memo(function TableToolbar(props: {
793793

794794
const handleDownload = useCallback(() => {
795795
onDownload();
796-
onEvent("download");
797-
}, [onDownload, onEvent]);
796+
}, [onDownload]);
798797

799798
const handleSaveChanges = useCallback(() => {
800799
onSaveChanges();
801-
onEvent("saveChanges");
802-
}, [onSaveChanges, onEvent]);
800+
}, [onSaveChanges]);
803801

804802
const handleCancelChanges = useCallback(() => {
805803
onCancelChanges();
806-
onEvent("cancelChanges");
807-
}, [onCancelChanges, onEvent]);
804+
}, [onCancelChanges]);
808805

809806
const handleColumnFilterChange = useCallback((filters: TableFilterDataType[], stackType: TableFilter["stackType"]) => {
810807
if (

client/packages/lowcoder/src/comps/queries/queryComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ QueryCompTmp = class extends QueryCompTmp {
301301

302302
// If the dsl has not changed, but the dependent node value has changed, then trigger the query execution
303303
// FIXME, this should be changed to a reference judgement, but for unknown reasons if the reference is modified once, it will change twice.
304-
if (dependsChanged) {
304+
if (dependsChanged && !isJsQuery) {
305305
if (dslNotChanged) {
306306
this.execute(next);
307307
}

client/packages/lowcoder/src/constants/themeConstants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ export const defaultTheme: ThemeDetail = {
219219
dateRange: input,
220220
time: input,
221221
timeRange: input,
222+
colorPicker: input,
222223
rangeSlider: slider,
223224
segmentedControl,
224225
select: select,

0 commit comments

Comments
 (0)