-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add "Empty Data" warning message when grid is empty (#155)
* feat(core): add "Empty Data" warning message when grid is empty - this is in fact a div element that is created and reposition inside the grid, the reason we do that is because we cannot put that text inside a cell because it has its cell boundary, so creating a div and position it over the grid is the best approach * fix(core): mem leaks w/orphan DOM elements when disposing * feat(formatters): add FakeHyperlink Formatter
- Loading branch information
1 parent
9633d4a
commit 13875b4
Showing
38 changed files
with
403 additions
and
81 deletions.
There are no files selected for viewing
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
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
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
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
15 changes: 15 additions & 0 deletions
15
packages/common/src/formatters/__tests__/fakeHyperlinkFormatter.spec.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,15 @@ | ||
import { fakeHyperlinkFormatter } from '../fakeHyperlinkFormatter'; | ||
|
||
describe('the Edit Icon Formatter', () => { | ||
it('should return a span with the "fake-hyperlink" class when a value is provided', () => { | ||
const value = 'Custom Value'; | ||
const result = fakeHyperlinkFormatter(0, 0, value); | ||
expect(result).toBe('<span class="fake-hyperlink">Custom Value</span>'); | ||
}); | ||
|
||
it('should return an empty string formatter when no value is provided', () => { | ||
const value = null; | ||
const result = fakeHyperlinkFormatter(0, 0, value); | ||
expect(result).toBe(''); | ||
}); | ||
}); |
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 @@ | ||
import { Formatter } from './../interfaces/index'; | ||
|
||
export const fakeHyperlinkFormatter: Formatter = (_row: number, _cell: number, value: string) => { | ||
return value ? `<span class="fake-hyperlink">${value}</span>` : ''; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export interface EmptyWarning { | ||
/** Empty data warning message, defaults to "No data to display." */ | ||
message: string; | ||
|
||
/** Empty data warning message translation key, defaults to "EMPTY_DATA_WARNING_MESSAGE" */ | ||
messageKey?: string; | ||
|
||
/** DOM Element class name, defaults to "empty-data-warning" */ | ||
class?: string; | ||
|
||
/** Top margin position, number in pixel, of where the warning message will be displayed, default calculation is (header title row + filter row + 5px) */ | ||
marginTop?: number; | ||
|
||
/** Left margin position, number in pixel, of where the warning message will be displayed, defaults to 10px */ | ||
marginLeft?: number; | ||
} |
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
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
Oops, something went wrong.