@libs-ui/services-dialog 0.2.305 → 0.2.306-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libs-ui-services-dialog.mjs","sources":["../../../../../libs-ui/services/dialog/src/dialog.service.ts","../../../../../libs-ui/services/dialog/src/libs-ui-services-dialog.ts"],"sourcesContent":["import { ComponentRef, Injectable, inject } from '@angular/core';\nimport { IModalFunctionsControl, LibsUiComponentsModalComponent, TYPE_MODAL_EVENT } from '@libs-ui/components-modal';\nimport { LibsUiDynamicComponentService } from '@libs-ui/services-dynamic-component';\nimport { uuid } from '@libs-ui/utils';\nimport { IDialog } from './interfaces/dialog.interface';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LibsUiDialogService {\n private dialogsRef: Map<string, { component: ComponentRef<LibsUiComponentsModalComponent> }> = new Map();\n private dynamicComponentService = inject(LibsUiDynamicComponentService);\n\n public addDialog(config: IDialog, isAddParentDocument?: boolean): string {\n const idDialog = uuid();\n const component = this.dynamicComponentService.resolveComponentFactory(LibsUiComponentsModalComponent);\n const instance = component.instance;\n let functionControl: IModalFunctionsControl;\n instance.outFunctionControl.subscribe((func: IModalFunctionsControl) => functionControl = func);\n\n instance.outEvent.subscribe((eventName: TYPE_MODAL_EVENT) => {\n functionControl.setStateDisable(true);\n\n switch (eventName) {\n case 'agree':\n config.configAgreeEvent?.callback(functionControl);\n if (!config.configAgreeEvent?.ignoreRemoveDialog) {\n this.removeDialog(idDialog);\n }\n\n return;\n\n case 'close':\n config.configCloseEvent?.callback(functionControl);\n if (!config.configCloseEvent?.ignoreRemoveDialog) {\n this.removeDialog(idDialog);\n }\n\n return;\n\n case 'cancel':\n config.configCancelEvent?.callback(functionControl);\n if (!config.configCancelEvent?.ignoreRemoveDialog) {\n this.removeDialog(idDialog);\n }\n break;\n\n case 'back':\n config.configBackEvent?.callback(functionControl);\n if (!config.configBackEvent?.ignoreRemoveDialog) {\n this.removeDialog(idDialog);\n }\n break;\n }\n });\n\n component.setInput('zIndex', config.zIndex);\n component.setInput('title', config.title);\n component.setInput('titleUseInnerText', config.titleUseInnerText ?? false);\n component.setInput('titleUseXssFilter', config.titleUseXssFilter ?? true);\n component.setInput('width', config.width || '500px');\n component.setInput('height', config.height || 'auto');\n component.setInput('maxWidth', config.maxWidth);\n component.setInput('maxHeight', config.maxHeight);\n component.setInput('headerConfig', config.headerConfig || { hidden: !config.title });\n component.setInput('bodyConfig', config.bodyConfig);\n component.setInput('footerConfig', config.footerConfig);\n component.setInput('classIncludeModalWrapper', config.classIncludeModalWrapper);\n component.setInput('disable', config.disable || false);\n component.setInput('mode', config.mode || 'center');\n component.setInput('ignoreCommunicateMicroEvent', config.ignoreCommunicateMicroEvent);\n if (config.buttonsFooter) {\n component.setInput('buttonsFooter', config.buttonsFooter)\n }\n this.dialogsRef.set(idDialog, { component });\n this.dynamicComponentService.addToBody(component, isAddParentDocument);\n\n return idDialog;\n }\n\n public switchDisableActionsOnDialog(id: string) {\n const data = this.dialogsRef.get(id);\n\n if (!data) {\n return;\n }\n data.component.setInput('disable', !data.component.instance.disable);\n }\n\n public removeDialog(id: string) {\n const data = this.dialogsRef.get(id);\n\n if (!data) {\n return;\n }\n this.dynamicComponentService.remove(data.component);\n this.dialogsRef.delete(id);\n }\n\n public clearDialogsRef() {\n const keys = this.dialogsRef.keys();\n\n for (const key of keys) {\n this.removeDialog(key);\n }\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MASa,mBAAmB,CAAA;AACtB,IAAA,UAAU,GAA6E,IAAI,GAAG,EAAE;AAChG,IAAA,uBAAuB,GAAG,MAAM,CAAC,6BAA6B,CAAC;IAEhE,SAAS,CAAC,MAAe,EAAE,mBAA6B,EAAA;AAC7D,QAAA,MAAM,QAAQ,GAAG,IAAI,EAAE;QACvB,MAAM,SAAS,GAAG,IAAI,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,8BAA8B,CAAC;AACtG,QAAA,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ;AACnC,QAAA,IAAI,eAAuC;AAC3C,QAAA,QAAQ,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,IAA4B,KAAK,eAAe,GAAG,IAAI,CAAC;QAE/F,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,SAA2B,KAAI;AAC1D,YAAA,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC;YAErC,QAAQ,SAAS;AACf,gBAAA,KAAK,OAAO;AACV,oBAAA,MAAM,CAAC,gBAAgB,EAAE,QAAQ,CAAC,eAAe,CAAC;AAClD,oBAAA,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,EAAE;AAChD,wBAAA,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC
|
|
1
|
+
{"version":3,"file":"libs-ui-services-dialog.mjs","sources":["../../../../../libs-ui/services/dialog/src/dialog.service.ts","../../../../../libs-ui/services/dialog/src/libs-ui-services-dialog.ts"],"sourcesContent":["import { ComponentRef, Injectable, inject } from '@angular/core';\nimport { IModalFunctionsControl, LibsUiComponentsModalComponent, TYPE_MODAL_EVENT } from '@libs-ui/components-modal';\nimport { LibsUiDynamicComponentService } from '@libs-ui/services-dynamic-component';\nimport { uuid } from '@libs-ui/utils';\nimport { IDialog } from './interfaces/dialog.interface';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LibsUiDialogService {\n private dialogsRef: Map<string, { component: ComponentRef<LibsUiComponentsModalComponent> }> = new Map();\n private dynamicComponentService = inject(LibsUiDynamicComponentService);\n\n public addDialog(config: IDialog, isAddParentDocument?: boolean): string {\n const idDialog = uuid();\n const component = this.dynamicComponentService.resolveComponentFactory(LibsUiComponentsModalComponent);\n const instance = component.instance;\n let functionControl: IModalFunctionsControl;\n instance.outFunctionControl.subscribe((func: IModalFunctionsControl) => functionControl = func);\n\n instance.outEvent.subscribe((eventName: TYPE_MODAL_EVENT) => {\n functionControl.setStateDisable(true);\n\n switch (eventName) {\n case 'agree':\n config.configAgreeEvent?.callback(functionControl);\n if (!config.configAgreeEvent?.ignoreRemoveDialog) {\n this.removeDialog(idDialog);\n }\n\n return;\n\n case 'close':\n config.configCloseEvent?.callback(functionControl);\n if (!config.configCloseEvent?.ignoreRemoveDialog) {\n this.removeDialog(idDialog);\n }\n\n return;\n\n case 'cancel':\n config.configCancelEvent?.callback(functionControl);\n if (!config.configCancelEvent?.ignoreRemoveDialog) {\n this.removeDialog(idDialog);\n }\n break;\n\n case 'back':\n config.configBackEvent?.callback(functionControl);\n if (!config.configBackEvent?.ignoreRemoveDialog) {\n this.removeDialog(idDialog);\n }\n break;\n }\n });\n\n component.setInput('zIndex', config.zIndex);\n component.setInput('title', config.title);\n component.setInput('titleUseInnerText', config.titleUseInnerText ?? false);\n component.setInput('titleUseXssFilter', config.titleUseXssFilter ?? true);\n component.setInput('width', config.width || '500px');\n component.setInput('height', config.height || 'auto');\n component.setInput('maxWidth', config.maxWidth);\n component.setInput('maxHeight', config.maxHeight);\n component.setInput('headerConfig', config.headerConfig || { hidden: !config.title });\n component.setInput('bodyConfig', config.bodyConfig);\n component.setInput('footerConfig', config.footerConfig);\n component.setInput('classIncludeModalWrapper', config.classIncludeModalWrapper);\n component.setInput('disable', config.disable || false);\n component.setInput('mode', config.mode || 'center');\n component.setInput('ignoreCommunicateMicroEvent', config.ignoreCommunicateMicroEvent);\n if (config.buttonsFooter) {\n component.setInput('buttonsFooter', config.buttonsFooter)\n }\n this.dialogsRef.set(idDialog, { component });\n this.dynamicComponentService.addToBody(component, isAddParentDocument);\n\n return idDialog;\n }\n\n public switchDisableActionsOnDialog(id: string) {\n const data = this.dialogsRef.get(id);\n\n if (!data) {\n return;\n }\n data.component.setInput('disable', !data.component.instance.disable);\n }\n\n public removeDialog(id: string) {\n const data = this.dialogsRef.get(id);\n\n if (!data) {\n return;\n }\n this.dynamicComponentService.remove(data.component);\n this.dialogsRef.delete(id);\n }\n\n public clearDialogsRef() {\n const keys = this.dialogsRef.keys();\n\n for (const key of keys) {\n this.removeDialog(key);\n }\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MASa,mBAAmB,CAAA;AACtB,IAAA,UAAU,GAA6E,IAAI,GAAG,EAAE;AAChG,IAAA,uBAAuB,GAAG,MAAM,CAAC,6BAA6B,CAAC;IAEhE,SAAS,CAAC,MAAe,EAAE,mBAA6B,EAAA;AAC7D,QAAA,MAAM,QAAQ,GAAG,IAAI,EAAE;QACvB,MAAM,SAAS,GAAG,IAAI,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,8BAA8B,CAAC;AACtG,QAAA,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ;AACnC,QAAA,IAAI,eAAuC;AAC3C,QAAA,QAAQ,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,IAA4B,KAAK,eAAe,GAAG,IAAI,CAAC;QAE/F,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,SAA2B,KAAI;AAC1D,YAAA,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC;YAErC,QAAQ,SAAS;AACf,gBAAA,KAAK,OAAO;AACV,oBAAA,MAAM,CAAC,gBAAgB,EAAE,QAAQ,CAAC,eAAe,CAAC;AAClD,oBAAA,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,EAAE;AAChD,wBAAA,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;oBAC7B;oBAEA;AAEF,gBAAA,KAAK,OAAO;AACV,oBAAA,MAAM,CAAC,gBAAgB,EAAE,QAAQ,CAAC,eAAe,CAAC;AAClD,oBAAA,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,EAAE;AAChD,wBAAA,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;oBAC7B;oBAEA;AAEF,gBAAA,KAAK,QAAQ;AACX,oBA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,eAAe,GAAA;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;AAEnC,QAAA,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;AACtB,YAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;QACxB;IACF;wGAhGW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA;;4FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACRD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libs-ui/services-dialog",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.306-4",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/core": ">=18.0.0",
|
|
6
|
-
"@libs-ui/components-modal": "0.2.
|
|
7
|
-
"@libs-ui/services-dynamic-component": "0.2.
|
|
8
|
-
"@libs-ui/utils": "0.2.
|
|
9
|
-
"@libs-ui/components-buttons-button": "0.2.
|
|
6
|
+
"@libs-ui/components-modal": "0.2.306-4",
|
|
7
|
+
"@libs-ui/services-dynamic-component": "0.2.306-4",
|
|
8
|
+
"@libs-ui/utils": "0.2.306-4",
|
|
9
|
+
"@libs-ui/components-buttons-button": "0.2.306-4"
|
|
10
10
|
},
|
|
11
11
|
"sideEffects": false,
|
|
12
12
|
"module": "fesm2022/libs-ui-services-dialog.mjs",
|