11import { ThemeDetail , ThemeType } from "api/commonSettingApi" ;
22import { RecordConstructorToComp } from "lowcoder-core" ;
33import { dropdownInputSimpleControl } from "comps/controls/dropdownInputSimpleControl" ;
4- import { MultiCompBuilder , valueComp } from "comps/generators" ;
4+ import { MultiCompBuilder , valueComp , withDefault } from "comps/generators" ;
55import { AddIcon , Dropdown } from "lowcoder-design" ;
66import { EllipsisSpan } from "pages/setting/theme/styledComponents" ;
77import { useEffect } from "react" ;
@@ -14,6 +14,10 @@ import { default as Divider } from "antd/es/divider";
1414import { THEME_SETTING } from "constants/routesURL" ;
1515import { CustomShortcutsComp } from "./customShortcutsComp" ;
1616import { DEFAULT_THEMEID } from "comps/utils/themeUtil" ;
17+ import { StringControl } from "comps/controls/codeControl" ;
18+ import { IconControl } from "comps/controls/iconControl" ;
19+ import { dropdownControl } from "comps/controls/dropdownControl" ;
20+ import { ApplicationCategoriesEnum } from "constants/applicationConstants" ;
1721
1822const TITLE = trans ( "appSetting.title" ) ;
1923const USER_DEFINE = "__USER_DEFINE" ;
@@ -92,9 +96,37 @@ const SettingsStyled = styled.div`
9296` ;
9397
9498const DivStyled = styled . div `
95- div {
96- width: 100%;
97- display: block;
99+ > div {
100+ flex-wrap: wrap;
101+ margin-bottom: 12px;
102+
103+ > div {
104+ width: 100%;
105+ display: block;
106+ }
107+
108+ > div:first-child {
109+ margin-bottom: 6px;
110+ }
111+
112+ .tooltipLabel {
113+ white-space: nowrap;
114+ }
115+
116+ }
117+ // custom styles for icon selector
118+ .app-icon {
119+ > div {
120+ margin-bottom: 0;
121+
122+ > div:first-child {
123+ margin-bottom: 6px;
124+ }
125+ > div:nth-child(2) {
126+ width: 88%;
127+ display: inline-block;
128+ }
129+ }
98130 }
99131` ;
100132
@@ -134,7 +166,22 @@ const DividerStyled = styled(Divider)`
134166 border-color: #e1e3eb;
135167` ;
136168
169+ type AppCategoriesEnumKey = keyof typeof ApplicationCategoriesEnum
170+ const AppCategories = Object . keys ( ApplicationCategoriesEnum ) . map (
171+ ( cat ) => {
172+ const value = ApplicationCategoriesEnum [ cat as AppCategoriesEnumKey ] ;
173+ return {
174+ label : value ,
175+ value,
176+ }
177+ }
178+ )
179+
137180const childrenMap = {
181+ title : withDefault ( StringControl , '' ) ,
182+ description : withDefault ( StringControl , '' ) ,
183+ icon : IconControl ,
184+ category : dropdownControl ( AppCategories , ApplicationCategoriesEnum . BUSINESS ) ,
138185 maxWidth : dropdownInputSimpleControl ( OPTIONS , USER_DEFINE , "1920" ) ,
139186 themeId : valueComp < string > ( DEFAULT_THEMEID ) ,
140187 customShortcuts : CustomShortcutsComp ,
@@ -146,7 +193,16 @@ type ChildrenInstance = RecordConstructorToComp<typeof childrenMap> & {
146193} ;
147194
148195function AppSettingsModal ( props : ChildrenInstance ) {
149- const { themeList, defaultTheme, themeId, maxWidth } = props ;
196+ const {
197+ themeList,
198+ defaultTheme,
199+ themeId,
200+ maxWidth,
201+ title,
202+ description,
203+ icon,
204+ category,
205+ } = props ;
150206 const THEME_OPTIONS = themeList ?. map ( ( theme ) => ( {
151207 label : theme . name ,
152208 value : theme . id + "" ,
@@ -182,16 +238,30 @@ function AppSettingsModal(props: ChildrenInstance) {
182238 < SettingsStyled >
183239 < Title > { TITLE } </ Title >
184240 < DivStyled >
241+ { title . propertyView ( {
242+ label : trans ( "appSetting.appTitle" ) ,
243+ placeholder : trans ( "appSetting.appTitle" )
244+ } ) }
245+ { description . propertyView ( {
246+ label : trans ( "appSetting.appDescription" ) ,
247+ placeholder : trans ( "appSetting.appDescription" )
248+ } ) }
249+ { category . propertyView ( {
250+ label : trans ( "appSetting.appCategory" ) ,
251+ } ) }
252+ < div className = "app-icon" >
253+ { icon . propertyView ( {
254+ label : trans ( "icon" ) ,
255+ tooltip : trans ( "aggregation.iconTooltip" ) ,
256+ } ) }
257+ </ div >
185258 { maxWidth . propertyView ( {
186259 dropdownLabel : trans ( "appSetting.canvasMaxWidth" ) ,
187260 inputLabel : trans ( "appSetting.userDefinedMaxWidth" ) ,
188261 inputPlaceholder : trans ( "appSetting.inputUserDefinedPxValue" ) ,
189262 placement : "bottom" ,
190263 min : 350 ,
191264 lastNode : < span > { trans ( "appSetting.maxWidthTip" ) } </ span > ,
192- labelStyle : { marginBottom : "8px" } ,
193- dropdownStyle : { marginBottom : "12px" } ,
194- inputStyle : { marginBottom : "12px" }
195265 } ) }
196266 < Dropdown
197267 defaultValue = {
@@ -205,8 +275,6 @@ function AppSettingsModal(props: ChildrenInstance) {
205275 options = { THEME_OPTIONS }
206276 label = { trans ( "appSetting.themeSetting" ) }
207277 placement = "bottom"
208- labelStyle = { { marginBottom : "8px" } }
209- dropdownStyle = { { marginBottom : "12px" } }
210278 itemNode = { ( value ) => < DropdownItem value = { value } /> }
211279 preNode = { ( ) => (
212280 < >
0 commit comments