Co-authored-by: Alireza <ar.sedghi@gmail.com> Co-authored-by: Dan Rukas <dan.rukas@gmail.com> Co-authored-by: Tang Cheng <45505657+tctco@users.noreply.github.com>
This commit is contained in:
44 files changed
+516
-258
No files matched your search
@@ -14,6 +14,8 @@ const serviceImplementation = {
|
||||
console.warn('isEmpty() NOT IMPLEMENTED');
|
||||
return true;
|
||||
},
|
||||
_updatePosition: (id: string, position: { x: number; y: number }) =>
|
||||
console.warn('updatePosition() NOT IMPLEMENTED'),
|
||||
_customComponent: null,
|
||||
};
|
||||
|
||||
@@ -63,6 +65,16 @@ class UIDialogService {
|
||||
return serviceImplementation._isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the position of a specific dialog by id
|
||||
*
|
||||
* @param {string} id - The dialog id to update
|
||||
* @param {{ x: number; y: number }} position - The new position
|
||||
*/
|
||||
updatePosition(id: string, position: { x: number; y: number }): void {
|
||||
return serviceImplementation._updatePosition(id, position);
|
||||
}
|
||||
|
||||
/**
|
||||
* This provides flexibility in customizing the Modal's default component
|
||||
*
|
||||
@@ -75,7 +87,14 @@ class UIDialogService {
|
||||
/**
|
||||
* Set the service implementation
|
||||
*/
|
||||
setServiceImplementation({ show, hide, hideAll, isEmpty, customComponent }: any): void {
|
||||
setServiceImplementation({
|
||||
show,
|
||||
hide,
|
||||
hideAll,
|
||||
isEmpty,
|
||||
updatePosition,
|
||||
customComponent,
|
||||
}: any): void {
|
||||
if (show) {
|
||||
serviceImplementation._show = show;
|
||||
}
|
||||
@@ -88,6 +107,9 @@ class UIDialogService {
|
||||
if (isEmpty) {
|
||||
serviceImplementation._isEmpty = isEmpty;
|
||||
}
|
||||
if (updatePosition) {
|
||||
serviceImplementation._updatePosition = updatePosition;
|
||||
}
|
||||
if (customComponent) {
|
||||
serviceImplementation._customComponent = customComponent;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user