-
Notifications
You must be signed in to change notification settings - Fork 277
Dev -> Main - v2.3.1 Fix #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
bc9d45c
Merge branch 'dev' of https://github.com/lowcoder-org/lowcoder into dev
freddysundowner c60dcce
Merge branch 'dev' of https://github.com/lowcoder-org/lowcoder into dev
freddysundowner ebfbdfd
added licence key data field
freddysundowner e7014bb
Merge branch 'dev' of https://github.com/lowcoder-org/lowcoder into c...
freddysundowner df156a5
fixed access of licence in the full calendar
freddysundowner 0e95abd
fixed bug on licence key input filled
freddysundowner a1918e5
"add premium and free calendar options drop down"
freddysundowner 4b86584
removed hand coded licence key
freddysundowner 50f87fc
Mention component height issue fix, checkbox component hover backgrou...
imtananikhwa 658e299
Add logs for debugging
aq-ikhwa-tech 4890116
fix for comps hide on adding to modal/drawer
raheeliftikhar5 6b8a497
Fixes and introduction of text-decoration and text transform property...
imtananikhwa f501802
CSS styles and propeties added to tabbed container while ensuring the...
imtananikhwa 2c80045
CSS properties and their control added for segment control
imtananikhwa 8e9ab45
Toasts Notification & Loading Mesages
sudoischenny 36ccf9a
Merge branch 'lowcoder-org:main' into main
sudoischenny 683179c
Update Toasts Image
sudoischenny 3708c30
Added toast.destroy()
sudoischenny 791cff1
Toast Dismiss
sudoischenny 9857111
Add migration to fix existing application public view bug
aq-ikhwa-tech e5bbd35
Remove unnecessary logs
aq-ikhwa-tech a85f478
fixed styledcomponent warning in drawerComp
raheeliftikhar5 08b675a
added app meta fields
raheeliftikhar5 27d870d
Merge pull request #1 from lowcoder-org/dev
sudoischenny 220c0cc
Merge branch 'lowcoder-org:main' into main
sudoischenny f30fdf2
TS issue fixed
imtananikhwa 6e81667
Tab container type removal, due to compiler error
imtananikhwa a6be0ab
Merge pull request #718 from lowcoder-org/add-logs-to-debug-api-stats...
FalkWolsky 2f7487b
Merge branch 'dev' into imtanan-task1
FalkWolsky b395356
Merge pull request #719 from imtananikhwa/imtanan-task1
FalkWolsky 56d2086
Merge branch 'dev' into main
FalkWolsky eb3854b
Merge pull request #721 from sudoischenny/main
FalkWolsky 8d6bf63
Merge branch 'dev' into fix_modal_comps_invisible
FalkWolsky 5e5f73c
Merge pull request #724 from raheeliftikhar5/fix_modal_comps_invisible
FalkWolsky fa20094
Merge branch 'dev' into app_meta_field
FalkWolsky e379627
Merge pull request #725 from raheeliftikhar5/app_meta_field
FalkWolsky b6e1e2c
Added Comments to Marketplace Use
877f9f5
Add Support as App Category
4f58b96
Adding Admin Area Icons
1c44f3a
Changing Readme for latest ENV Variables
c96bb7e
Rounding Up Marketplace and Multi-Icon Component
cc5333c
Added comments based on common discussion
120fbc9
fix: sorted out application view rights for all cases
ludomikula de03572
fix: update location of marketplace app settings
ludomikula d5c9c32
fix: for now, allow to view non-published apps for logged in users
ludomikula 35472c0
Adding mn height for App Cards in Marketplace
73ea344
Merge branch 'dev' into calendar-licenc-key
FalkWolsky 3452d4b
Merge pull request #736 from lowcoder-org/calendar-licenc-key
FalkWolsky f31c4f9
Increase Lowcoder Comps Version
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Rounding Up Marketplace and Multi-Icon Component
- Loading branch information
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
88 changes: 88 additions & 0 deletions
client/packages/lowcoder/src/comps/comps/multiIconDisplay.tsx
This file contains hidden or 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,88 @@ | ||
|
||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { findIconDefinition, library } from '@fortawesome/fontawesome-svg-core'; | ||
import { fas } from '@fortawesome/free-solid-svg-icons'; | ||
import { far } from '@fortawesome/free-regular-svg-icons'; | ||
import * as AntdIcons from '@ant-design/icons'; | ||
|
||
library.add(far,fas); | ||
|
||
function parseIconIdentifier(identifier: string) { | ||
if (identifier.startsWith('/icon:antd/')) { | ||
let name = identifier.split('/')[2]; | ||
return { type: 'antd', name }; | ||
} | ||
else if (identifier.startsWith('/icon:solid/') || identifier.startsWith('/icon:regular/')) { | ||
const [style, name] = identifier.substring(6).split('/'); | ||
return { type: 'fontAwesome', style, name }; | ||
} | ||
else if (identifier.startsWith('data:image')) { | ||
return { type: 'base64', data: identifier, name: "" }; | ||
} | ||
else if (identifier.startsWith('http')) { | ||
return { type: 'url', url: identifier, name: "" }; | ||
} | ||
else { | ||
return { type: 'unknown', name: "" }; | ||
} | ||
} | ||
|
||
interface IconProps { | ||
identifier: string; | ||
width?: string; | ||
height?: string; | ||
style?: React.CSSProperties; | ||
} | ||
|
||
const convertToCamelCase = (name: string) => { | ||
return name.replace(/(-\w)/g, (match) => match[1].toUpperCase()); | ||
} | ||
|
||
const appendStyleSuffix = (name: string) => { | ||
if (name.endsWith('outlined')) { | ||
return name.replace('outlined', 'Outlined'); | ||
} else if (name.endsWith('filled')) { | ||
return name.replace('filled', 'Filled'); | ||
} else if (name.endsWith('twotone')) { | ||
return name.replace('twotone', 'TwoTone'); | ||
} | ||
return name; | ||
} | ||
|
||
// Multi icon Display Component | ||
|
||
const baseMultiIconDisplay: React.FC<IconProps> = ({ identifier, width = '24px', height = '24px', style }) => { | ||
|
||
const iconData = parseIconIdentifier(identifier); | ||
|
||
if (iconData.type === 'fontAwesome') { | ||
const prefix = iconData.style === 'solid' ? 'fas' : 'far'; // 'fas' for solid, 'far' for regular | ||
// Find the icon definition using prefix and iconName | ||
const iconLookup = findIconDefinition({ prefix: prefix as any, iconName: iconData.name as any }); | ||
|
||
if (!iconLookup) { | ||
console.error(`Icon ${iconData.name} with prefix ${prefix} not found`); | ||
return null; | ||
} | ||
return <FontAwesomeIcon icon={iconLookup} style={{ width, height, ...style }} />; | ||
} | ||
else if (iconData.type === 'antd') { | ||
let iconName = convertToCamelCase(iconData.name); | ||
iconName = appendStyleSuffix(iconName); | ||
iconName = iconName.charAt(0).toUpperCase() + iconName.slice(1); | ||
const AntdIcon = (AntdIcons as any)[iconName]; | ||
if (!AntdIcon) { | ||
console.error(`ANTd Icon ${iconData.name} not found`); | ||
return null; | ||
} | ||
return <AntdIcon style={{ fontSize: width, ...style }} />; | ||
} | ||
else if (iconData.type === 'url' || iconData.type === 'base64') { | ||
return <img src={iconData.type === 'url' ? iconData.url : iconData.data} alt="icon" style={{ width, height, ...style }} />; | ||
} | ||
else { | ||
return null; // Unknown type | ||
} | ||
}; | ||
|
||
export const MultiIconDisplay = baseMultiIconDisplay; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.