blob: ddab1c5e02d3cca52a854e4ec26e074233ed202b [file] [log] [blame]
{"remainingRequest":"/Users/jaslan/Development/nifi-fds/angular-url-loader.js!/Users/jaslan/Development/nifi-fds/node_modules/babel-loader/lib/index.js??ref--5-2!/Users/jaslan/Development/nifi-fds/platform/core/snackbars/services/snackbar.service.js","dependencies":[{"path":"/Users/jaslan/Development/nifi-fds/platform/core/snackbars/services/snackbar.service.js","mtime":1562689731046},{"path":"/Users/jaslan/Development/nifi-fds/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/jaslan/Development/nifi-fds/angular-url-loader.js","mtime":1562689731025},{"path":"/Users/jaslan/Development/nifi-fds/node_modules/babel-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MatSnackBarConfig, MatSnackBar } from '@angular/material';\nimport $ from 'jquery';\nimport { FdsCoasterComponent } from '../coaster/coaster.component';\nexport function ISnackBarConfig() {\n this.title = '';\n this.message = '';\n this.snackBarRef = undefined;\n this.viewContainerRef = undefined;\n}\nISnackBarConfig.prototype = {\n contstructor: ISnackBarConfig\n};\n$.extend(ISnackBarConfig, MatSnackBarConfig);\nexport function ICoasterConfig() {\n this.icon = '';\n this.color = '';\n}\nICoasterConfig.prototype = {\n contstructor: ICoasterConfig\n};\n$.extend(ICoasterConfig, ISnackBarConfig);\n/**\n * FdsSnackBarService constructor.\n *\n * @param MatSnackBar The angular material MatSnackBar.\n * @constructor\n */\n\nexport function FdsSnackBarService(MatSnackBar) {\n this.snackBarService = MatSnackBar;\n}\nFdsSnackBarService.prototype = {\n contstructor: FdsSnackBarService,\n\n /**\n * Wrapper function over the open() method in MatSnackBar.\n *\n * @param message The message to show in the snackbar.\n * @param action The label for the snackbar action.\n * @param config Additional configuration options for the snackbar.\n *\n * @returns {MatSnackBarRef} The reference to the snackbar.\n */\n open: function open(message, action, config) {\n return this.snackBarService.open(message, action, config);\n },\n\n /**\n * Wrapper function over the openFromComponent() method in MatSnackBar.\n * Opens a snackbar containing the given component.\n *\n * @param component The angular ComponentType<T>.\n * @param config The angular material MatSnackBarConfig.\n *\n * @returns {MatSnackBarRef} The reference to the snackbar.\n */\n openFromComponent: function openFromComponent(component, config) {\n return this.snackBarService.openFromComponent(component, config);\n },\n\n /**\n * Wrapper function over the dismiss() method in MatSnackBar.\n * Dismisses the currently-open snackbar.\n */\n dismiss: function dismiss() {\n this.snackBarService.dismiss();\n },\n\n /**\n * Opens a coaster snackbar with the provided config.\n *\n * @param config ICoasterConfig {\n * message?: string;\n * title?: string;\n * snackBarRef?: MatSnackBarRef;\n * viewContainerRef?: ViewContainerRef;\n * icon?: string;\n * color?: string;\n * }\n *\n * @returns {MatSnackBarRef} The reference to the snackbar.\n */\n openCoaster: function openCoaster(config) {\n var snackBarConfig = new ICoasterConfig();\n snackBarConfig.verticalPosition = config.verticalPosition;\n snackBarConfig.horizontalPosition = config.horizontalPosition;\n snackBarConfig.duration = config.duration;\n var snackBarRef = this.snackBarService.openFromComponent(FdsCoasterComponent, snackBarConfig);\n var coasterComponent = snackBarRef.instance;\n coasterComponent.snackBarRef = snackBarRef;\n\n if (config.title) {\n coasterComponent.title = config.title;\n }\n\n if (config.message) {\n coasterComponent.message = config.message;\n }\n\n if (config.icon) {\n coasterComponent.icon = config.icon;\n }\n\n if (config.color) {\n coasterComponent.color = config.color;\n }\n\n return snackBarRef;\n }\n};\nFdsSnackBarService.parameters = [MatSnackBar];"]}