-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #371 from shesha-io/fix/form-designer-styling-issues
Fix/form designer styling issues
- Loading branch information
Showing
12 changed files
with
549 additions
and
418 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.sha-list-component-body { | ||
.sha-list-component-divider { | ||
margin: 8px 0 0 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
shesha-reactjs/src/components/formDesigner/components/columns/exposedVariables.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
export const EXPOSED_VARIABLES = [ | ||
{ | ||
id: 'd430d31c-9360-4b57-96cc-3c322de31e58', | ||
name: 'value', | ||
description: 'Item value (if this is rendered in a SubForm)', | ||
type: 'any', | ||
}, | ||
{ | ||
id: 'd430d31c-9360-4b57-96cc-3c322de31e57', | ||
name: 'formMode', | ||
description: 'Selected form values', | ||
type: "'edit' | 'readonly' | 'designer'", | ||
}, | ||
{ | ||
id: 'd430d31c-9360-4b57-96cc-3c322de31e59', | ||
name: 'data', | ||
description: 'Selected form values', | ||
type: 'object', | ||
}, | ||
{ | ||
id: '5a367dfe-70e4-4521-96ba-bdee1336592a', | ||
name: 'globalState', | ||
description: 'The global state of the application', | ||
type: 'object', | ||
}, | ||
]; |
22 changes: 12 additions & 10 deletions
22
shesha-reactjs/src/components/formDesigner/components/columns/interfaces.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
import { IConfigurableFormComponent } from '../../../../providers/form/models'; | ||
|
||
export interface IColumnProps { | ||
id: string; | ||
flex: number; | ||
offset: number; | ||
push: number; | ||
pull: number; | ||
components: IConfigurableFormComponent[]; | ||
id: string; | ||
flex: number; | ||
offset: number; | ||
push: number; | ||
pull: number; | ||
components: IConfigurableFormComponent[]; | ||
} | ||
|
||
export interface IColumnsComponentProps extends IConfigurableFormComponent { | ||
columns: IColumnProps[]; | ||
gutterX?: number; | ||
gutterY?: number; | ||
} | ||
columns: IColumnProps[]; | ||
gutterX?: number; | ||
gutterY?: number; | ||
style?: string; | ||
customVisibility?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
shesha-reactjs/src/components/statusTag/addImportantFlag.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { IAnyObject } from 'interfaces'; | ||
import { CSSProperties } from 'react'; | ||
|
||
export const addImportant = (styleObj: IAnyObject): CSSProperties => { | ||
const newObj = {}; | ||
for (const prop in styleObj) { | ||
if (prop.startsWith('margin') || prop.startsWith('padding')) { | ||
let value = styleObj[prop]; | ||
if (typeof value === 'number') { | ||
value = `${value}px !important`; | ||
} else { | ||
value = `${value} !important`; | ||
} | ||
newObj[prop] = value; | ||
} else { | ||
newObj[prop] = styleObj[prop]; | ||
} | ||
} | ||
return newObj; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters