UNPKG

@rero/ng-core

Version:

RERO angular core library.

1 lines 789 kB
{"version":3,"file":"rero-ng-core.mjs","sources":["../../../../projects/rero/ng-core/src/lib/core-config.service.ts","../../../../projects/rero/ng-core/src/lib/api/api.service.ts","../../../../projects/rero/ng-core/src/lib/component/abstract-can-deactivate.component.ts","../../../../projects/rero/ng-core/src/lib/pipe/nl2br.pipe.ts","../../../../projects/rero/ng-core/src/lib/dialog/dialog.component.ts","../../../../projects/rero/ng-core/src/lib/directives/ng-var.directive.ts","../../../../projects/rero/ng-core/src/lib/pipe/default.pipe.ts","../../../../projects/rero/ng-core/src/lib/error/error.component.ts","../../../../projects/rero/ng-core/src/lib/error/error.component.html","../../../../projects/rero/ng-core/src/lib/guard/component-can-deactivate.guard.ts","../../../../projects/rero/ng-core/src/lib/pipe/callback-array-filter.pipe.ts","../../../../projects/rero/ng-core/src/lib/pipe/filesize.pipe.ts","../../../../projects/rero/ng-core/src/lib/pipe/markdown.pipe.ts","../../../../projects/rero/ng-core/src/lib/pipe/sanitize.pipe.ts","../../../../projects/rero/ng-core/src/lib/utils/sort-by-keys.ts","../../../../projects/rero/ng-core/src/lib/pipe/sort-by-keys.pipe.ts","../../../../projects/rero/ng-core/src/lib/pipe/truncate-text.pipe.ts","../../../../projects/rero/ng-core/src/lib/pipe/ucfirst.pipe.ts","../../../../projects/rero/ng-core/src/lib/prime-ng-core-module.ts","../../../../projects/rero/ng-core/src/lib/search-input/search-input.component.ts","../../../../projects/rero/ng-core/src/lib/search-input/search-input.component.html","../../../../projects/rero/ng-core/src/lib/text-read-more/text-read-more.component.ts","../../../../projects/rero/ng-core/src/lib/text-read-more/text-read-more.component.html","../../../../projects/rero/ng-core/src/lib/translate/date-translate-pipe.ts","../../../../projects/rero/ng-core/src/lib/translate/translate-language.service.ts","../../../../projects/rero/ng-core/src/lib/translate/translate-language.pipe.ts","../../../../projects/rero/ng-core/src/lib/translate/translate-loader.ts","../../../../projects/rero/ng-core/src/lib/translate/translate-service.ts","../../../../projects/rero/ng-core/src/lib/core.module.ts","../../../../projects/rero/ng-core/src/lib/error/error.ts","../../../../projects/rero/ng-core/src/lib/utils/utils.ts","../../../../projects/rero/ng-core/src/lib/record/editor/utils.ts","../../../../projects/rero/ng-core/src/lib/record/record.handle-error.service.ts","../../../../projects/rero/ng-core/src/lib/record/record.service.ts","../../../../projects/rero/ng-core/src/lib/pipe/get-record.pipe.ts","../../../../projects/rero/ng-core/src/lib/primeng-config.ts","../../../../projects/rero/ng-core/src/lib/record/action-status.ts","../../../../projects/rero/ng-core/src/lib/record/detail/detail-button/detail-button.component.ts","../../../../projects/rero/ng-core/src/lib/record/detail/detail-button/detail-button.component.html","../../../../projects/rero/ng-core/src/lib/utils/config.ts","../../../../projects/rero/ng-core/src/lib/record/record-ui.service.ts","../../../../projects/rero/ng-core/src/lib/record/detail/detail.directive.ts","../../../../projects/rero/ng-core/src/lib/record/detail/view/json.component.ts","../../../../projects/rero/ng-core/src/lib/record/detail/detail.component.ts","../../../../projects/rero/ng-core/src/lib/record/detail/detail.component.html","../../../../projects/rero/ng-core/src/lib/route/route-collection.service.ts","../../../../projects/rero/ng-core/src/lib/service/logger.service.ts","../../../../projects/rero/ng-core/src/lib/record/editor/services/jsonschema.service.ts","../../../../projects/rero/ng-core/src/lib/record/editor/services/templates.service.ts","../../../../projects/rero/ng-core/src/lib/record/editor/widgets/load-template-form/load-template-form.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/widgets/load-template-form/load-template-form.component.html","../../../../projects/rero/ng-core/src/lib/record/editor/widgets/save-template-form/save-template-form.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/widgets/save-template-form/save-template-form.component.html","../../../../projects/rero/ng-core/src/lib/record/editor/widgets/add-field-editor/add-field-editor.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/widgets/add-field-editor/add-field-editor.component.html","../../../../projects/rero/ng-core/src/lib/record/editor/editor.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/editor.component.html","../../../../projects/rero/ng-core/src/lib/validator/validators.ts","../../../../projects/rero/ng-core/src/lib/record/editor/extensions.ts","../../../../projects/rero/ng-core/src/lib/record/editor/formly/primeng/date-picker/date-picker.ts","../../../../projects/rero/ng-core/src/lib/record/editor/formly/primeng/input/src/input.type.ts","../../../../projects/rero/ng-core/src/lib/record/editor/formly/primeng/input/src/input.module.ts","../../../../projects/rero/ng-core/src/lib/record/editor/formly/primeng/services/translate-label.service.ts","../../../../projects/rero/ng-core/src/lib/record/editor/formly/primeng/multi-checkbox/multi-checkbox.ts","../../../../projects/rero/ng-core/src/lib/record/editor/formly/primeng/multi-select/multi-select.ts","../../../../projects/rero/ng-core/src/lib/record/editor/formly/primeng/remote-autocomplete/remote-autocomplete.service.ts","../../../../projects/rero/ng-core/src/lib/record/editor/formly/primeng/remote-autocomplete/remote-autocomplete.ts","../../../../projects/rero/ng-core/src/lib/record/editor/formly/primeng/remote-autocomplete/remote-autocomplete.interface.ts","../../../../projects/rero/ng-core/src/lib/record/editor/formly/primeng/select/select.ts","../../../../projects/rero/ng-core/src/lib/record/editor/formly/primeng/tree-select/tree-select.ts","../../../../projects/rero/ng-core/src/lib/record/editor/widgets/dropdown-label-editor/dropdown-label-editor.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/widgets/dropdown-label-editor/dropdown-label-editor.component.html","../../../../projects/rero/ng-core/src/lib/record/editor/widgets/label/label.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/widgets/label/label.component.html","../../../../projects/rero/ng-core/src/lib/record/editor/type/array-type/array-type.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/type/array-type/array-type.component.html","../../../../projects/rero/ng-core/src/lib/record/editor/type/multischema/multischema.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/type/object-type/object-type.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/type/object-type/object-type.component.html","../../../../projects/rero/ng-core/src/lib/record/editor/type/password-generator-type.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/type/switch/switch.component.ts","../../../../projects/rero/ng-core/src/lib/record/export-button/export-button.component.ts","../../../../projects/rero/ng-core/src/lib/record/export-button/export-button.component.html","../../../../projects/rero/ng-core/src/lib/record/record.ts","../../../../projects/rero/ng-core/src/lib/validator/email.validator.ts","../../../../projects/rero/ng-core/src/lib/record/editor/type/markdown/markdown.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/type/radio-button.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/type/textarea/textarea.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/wrappers/card-wrapper/card-wrapper.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/wrappers/form-field-wrapper/form-field-wrapper.component.ts","../../../../projects/rero/ng-core/src/lib/record/editor/wrappers/hide-wrapper/hide-wrapper.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/record-search.service.ts","../../../../projects/rero/ng-core/src/lib/record/search/result/item/json.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/result/record-search-result.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/result/record-search-result.component.html","../../../../projects/rero/ng-core/src/lib/record/search/aggregation/service/bucket-name.service.ts","../../../../projects/rero/ng-core/src/lib/record/search/aggregation/pipe/bucket-name.pipe.ts","../../../../projects/rero/ng-core/src/lib/record/search/aggregation/buckets/buckets.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/aggregation/buckets/buckets.component.html","../../../../projects/rero/ng-core/src/lib/record/search/aggregation/slider/slider.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/aggregation/slider/slider.component.html","../../../../projects/rero/ng-core/src/lib/record/search/aggregation/date-range/date-range.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/aggregation/date-range/date-range.component.html","../../../../projects/rero/ng-core/src/lib/record/search/aggregation/aggregation.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/aggregation/aggregation.component.html","../../../../projects/rero/ng-core/src/lib/record/search/aggregation/list-filters/list-filters.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/aggregation/list-filters/list-filters.component.html","../../../../projects/rero/ng-core/src/lib/record/search/paginator/paginator.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/paginator/paginator.component.html","../../../../projects/rero/ng-core/src/lib/record/search/menu-sort/menu-sort.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/menu-sort/menu-sort.component.html","../../../../projects/rero/ng-core/src/lib/record/search/search-filters/search-filters.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/search-filters/search-filters.component.html","../../../../projects/rero/ng-core/src/lib/record/search/search-tabs/search-tabs.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/search-tabs/search-tabs.component.html","../../../../projects/rero/ng-core/src/lib/record/search/record-search.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/record-search.component.html","../../../../projects/rero/ng-core/src/lib/record/search/record-search-page.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/record-search-page.component.html","../../../../projects/rero/ng-core/src/lib/record/record-routing.module.ts","../../../../projects/rero/ng-core/src/lib/record/search-autocomplete/search-autocomplete.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/search-fields/search-fields.component.ts","../../../../projects/rero/ng-core/src/lib/record/search/search-fields/search-fields.component.html","../../../../projects/rero/ng-core/src/lib/record/record.module.ts","../../../../projects/rero/ng-core/src/lib/record/search/result/item/result-item.ts","../../../../projects/rero/ng-core/src/lib/service/crypto-js.service.ts","../../../../projects/rero/ng-core/src/lib/service/local-storage.service.ts","../../../../projects/rero/ng-core/src/lib/service/title-meta.service.ts","../../../../projects/rero/ng-core/src/lib/validator/time.validator.ts","../../../../projects/rero/ng-core/src/lib/validator/unique.validator.ts","../../../../projects/rero/ng-core/src/public-api.ts","../../../../projects/rero/ng-core/src/rero-ng-core.ts"],"sourcesContent":["/*\n * RERO angular core\n * Copyright (C) 2020 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Injectable } from '@angular/core';\n\n/**\n * Interface for configuration.\n */\nexport interface Config {\n production?: boolean;\n prefixWindow?: string;\n apiBaseUrl?: string;\n apiEndpointPrefix?: string;\n $refPrefix: string;\n schemaFormEndpoint: string;\n languages?: string[];\n defaultLanguage?: string;\n secretPassphrase: string;\n translationsURLs?: Array<any>;\n}\n\n/**\n * Service for managing configuration of the application.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class CoreConfigService implements Config {\n production = false;\n prefixWindow = undefined;\n apiBaseUrl = '';\n apiEndpointPrefix = '/api';\n schemaFormEndpoint = '/api/schemaform';\n $refPrefix = undefined;\n languages = ['en'];\n defaultLanguage = 'en';\n secretPassphrase = 'ShERWIN53SnAggIng48rELAtiVes';\n translationsURLs = [];\n}\n","/*\n * RERO angular core\n * Copyright (C) 2020-2025 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { inject, Injectable } from '@angular/core';\nimport { CoreConfigService } from '../core-config.service';\n\n/**\n * Service giving information about API.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiService {\n\n protected configService: CoreConfigService = inject(CoreConfigService);\n\n // API base URL. Ex: https://localhost:5000.\n baseUrl = '';\n\n // API prefix. Ex: /api\n endpointPrefix = '/';\n\n /**\n * Returns Invenio API Endpoint corresponding to type.\n *\n * @param type Type of the resource.\n * @param absolute If absolute or relative url must be returned.\n * @return Endpoint as string.\n */\n getEndpointByType(type: string, absolute: boolean = false): string {\n let endpoint = this.configService.apiEndpointPrefix + '/' + type;\n if (absolute === true) {\n endpoint = this.configService.apiBaseUrl + endpoint;\n }\n return endpoint;\n }\n\n /**\n * Returns Invenio-RERO-base API export endpoint corresponding to type.\n *\n * @param type Type of the resource.\n * @param absolute If absolute or relative url must be returned.\n * @return Endpoint as string.\n */\n getExportEndpointByType(type: string, absolute: boolean = false): string {\n let endpoint = this.configService.apiEndpointPrefix + '/export/' + type;\n if (absolute === true) {\n endpoint = this.configService.apiBaseUrl + endpoint;\n }\n return endpoint;\n }\n\n /**\n * Returns $ref endpoint to resource.\n *\n * @param type Type of resource.\n * @param id Id of the record.\n * @return Ref endpoint as string.\n */\n getRefEndpoint(type: string, id: string): string {\n let prefix = '';\n if (this.configService.$refPrefix) {\n prefix += this.configService.$refPrefix;\n }\n return `${prefix}${this.configService.apiEndpointPrefix}/${type}/${id}`;\n }\n\n /**\n * Returns invenio API FormOption Endpoint corresponding to type.\n *\n * @param type Type of the resource\n * @param absolute If absolute or relative url must be returned.\n * @return Schema form endpoint.\n */\n getSchemaFormEndpoint(type: string, absolute: boolean = false): string {\n let endpoint = this.configService.schemaFormEndpoint + '/' + type;\n if (absolute === true) {\n endpoint = this.configService.apiBaseUrl + endpoint;\n }\n return endpoint;\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2023 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {Component, HostListener} from \"@angular/core\";\n\n/**\n * Doc: https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event\n *\n * The beforeunload event is fired when the window, the document and its resources\n * are about to be unloaded. The document is still visible and the event is still\n * cancelable at this point.\n */\n@Component({\n template: '',\n standalone: false\n})\nexport abstract class AbstractCanDeactivateComponent {\n\n abstract canDeactivate: boolean;\n\n @HostListener('window:beforeunload', ['$event'])\n unloadNotification($event: any) {\n if (!this.canDeactivate) {\n $event.returnValue = true;\n }\n }\n\n /**\n * Can deactivate changed on editor\n * @param activate - boolean\n */\n canDeactivateChanged(activate: boolean): void {\n this.canDeactivate = activate;\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2020-2025 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { inject, Pipe, PipeTransform } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\n\n/**\n * Pipe for converting carriage returns to <br> html entities.\n */\n@Pipe({\n name: 'nl2br',\n standalone: false\n})\nexport class Nl2brPipe implements PipeTransform {\n\n protected sanitizer: DomSanitizer = inject(DomSanitizer);\n\n /**\n * Returns transformed value containing <br> entities.\n *\n * @param value Value to transform.\n * @return Transformed value.\n */\n transform(value?: string): any {\n if (!value) {\n return this.sanitizer.bypassSecurityTrustHtml('');\n }\n return this.sanitizer.bypassSecurityTrustHtml(\n value.replace(/\\r\\n?|\\n/g, '<br>\\n')\n );\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2020-2025 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Component, inject } from '@angular/core';\nimport { DynamicDialogConfig, DynamicDialogRef } from 'primeng/dynamicdialog';\n\n@Component({\n selector: 'ng-core-dialog',\n template: `\n <div class=\"core:flex core:flex-col core:gap-2\">\n <div class=\"core:flex\" [innerHtml]=\"config.data.body|nl2br\"></div>\n <div class=\"core:flex core:justify-end core:gap-1\">\n <p-button\n [label]=\"config.data.cancelTitleButton || 'Cancel'|translate\"\n severity=\"danger\"\n [outlined]=\"true\"\n (onClick)=\"cancel()\"\n />\n @if (config.data.confirmButton) {\n <p-button [label]=\"config.data.confirmTitleButton || 'OK'|translate\" (onClick)=\"confirm()\" />\n }\n </div>\n </div>\n `,\n standalone: false\n})\nexport class DialogComponent {\n\n config: DynamicDialogConfig = inject(DynamicDialogConfig);\n protected ref: DynamicDialogRef = inject(DynamicDialogRef);\n\n confirm(): void {\n this.ref.close(true);\n }\n\n cancel(): void {\n this.ref.close(false);\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2020-2024 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Directive, inject, Input, TemplateRef, ViewContainerRef } from '@angular/core';\n\n// eslint-disable-next-line @angular-eslint/directive-selector\n@Directive({\n selector: '[ngVar]',\n standalone: false\n})\nexport class NgVarDirective {\n\n protected vcRef: ViewContainerRef = inject(ViewContainerRef);\n protected templateRef: TemplateRef<any> = inject(TemplateRef);\n\n /** Context */\n public context: any = {};\n\n @Input()\n set ngVar(context: any) {\n this.context.$implicit = this.context.ngVar = context;\n this.updateView();\n }\n\n /** Update view */\n private updateView() {\n this.vcRef.clear();\n this.vcRef.createEmbeddedView(this.templateRef, this.context);\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2020 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Pipe for returning a default value if the given value is null or undefined.\n */\n@Pipe({\n name: 'default', pure: true,\n standalone: false\n})\nexport class DefaultPipe implements PipeTransform {\n /**\n * Returns a default value.\n *\n * @param value Value to check.\n * @param defaultValue Value to return if value is null.\n * @return Value or default value.\n */\n transform(value: any, defaultValue: any): any {\n return value || defaultValue;\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2020 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Component, Input } from '@angular/core';\nimport { Error } from './error';\n\n/**\n * Component for displaying errors.\n */\n@Component({\n selector: 'ng-core-error',\n templateUrl: './error.component.html',\n standalone: false\n})\nexport class ErrorComponent {\n // Error object containing title, status and optionally a message.\n @Input() error: Error;\n}\n","<!--\n RERO angular core\n Copyright (C) 2020 RERO\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Affero General Public License as published by\n the Free Software Foundation, version 3 of the License.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Affero General Public License for more details.\n\n You should have received a copy of the GNU Affero General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n<div class=\"core:text-center core:my-8\">\n <p class=\"core:text-4xl\">\n <i class=\"fa fa-flash core:mr-4\"></i>\n <span class=\"core:text-muted-color\">{{ error.status }}</span>\n {{ error.title }}\n </p>\n <h5 class=\"core:mt-8\">{{ error.message | default: ('You cannot access this page.' | translate) }}</h5>\n</div>\n","/*\n * RERO angular core\n * Copyright (C) 2023-2024 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { inject, Injectable } from '@angular/core';\n\nimport { TranslateService } from '@ngx-translate/core';\nimport { Observable } from 'rxjs';\nimport { AbstractCanDeactivateComponent } from '../component/abstract-can-deactivate.component';\nimport { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog';\nimport { DialogComponent } from '../dialog/dialog.component';\n\n/**\n * When this guard is configured, it intercepts the form output without\n * saving or undoing changes.\n *\n * Route definition configuration\n * { path: 'foo/bar', canDeactivate: [ ComponentCanDeactivateGuard ] },\n *\n * Custom editor component configuration\n * class FooComponent AbstractCanDeactivateComponent {\n * canDeactivate: boolean = false;\n * ...\n * }\n *\n * Template configuration (add output canDeactivateChange)\n * <ng-core-editor\n * (canDeactivateChange)=\"canDeactivateChanged($event)\"\n * ...\n * ></ng-core-editor>\n */\n\n@Injectable()\nexport class ComponentCanDeactivateGuard {\n\n protected translateService: TranslateService = inject(TranslateService);\n protected dialogService: DialogService = inject(DialogService);\n\n ref: DynamicDialogRef | undefined;\n\n /**\n * Displays a confirmation modal if the user leaves the form without\n * saving or canceling\n * @param component - AbstractCanDeactivateComponent\n * @returns Observable<boolean> or boolean\n */\n canDeactivate(component: AbstractCanDeactivateComponent): Observable<boolean> | boolean {\n if (!component.canDeactivate) {\n this.ref = this.dialogService.open(DialogComponent, {\n header: this.translateService.instant('Quit the page'),\n data: {\n body: this.translateService.instant(\n 'Do you want to quit the page? The changes made so far will be lost.'\n ),\n confirmButton: true,\n confirmTitleButton: this.translateService.instant('Quit'),\n cancelTitleButton: this.translateService.instant('Stay'),\n },\n dismissableMask: true,\n modal: true,\n style: { width: '25rem' }\n });\n\n return this.ref.onClose;\n }\n\n return true;\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2020 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Pipe for applying a callback function to filter array items.\n */\n@Pipe({\n name: 'callbackArrayFilter',\n standalone: false\n})\nexport class CallbackArrayFilterPipe implements PipeTransform {\n /**\n * Filter array items with the given callback function.\n *\n * @param items List of items.\n * @param callback Callback function to apply.\n * @return List of filtered values.\n */\n transform(items?: any[], callback?: (item: any) => boolean): any[] {\n if (!items && !callback) {\n return [];\n }\n if (items && !callback) {\n return items;\n }\n\n return items.filter(item => callback(item));\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2020 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Get human readable file size.\n */\n@Pipe({\n name: 'filesize',\n standalone: false\n})\nexport class FilesizePipe implements PipeTransform {\n /**\n * Transform size to a human readable size.\n *\n * @param size Size of file.\n * @param precision Number of decimals.\n * @return Human readable file size.\n */\n transform(size: number, precision = 2) {\n let i = -1;\n const byteUnits = ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n do {\n size /= 1024;\n i++;\n } while (size > 1024);\n\n return [Math.max(size, 0.1).toFixed(precision), byteUnits[i]].join(' ');\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2021-2024 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { inject, Pipe, PipeTransform } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { marked } from 'marked';\n\n/**\n * Pipe to transform markdown to html.\n */\n@Pipe({\n name: 'markdown',\n standalone: false\n})\nexport class MarkdownPipe implements PipeTransform {\n\n protected sanitizer: DomSanitizer = inject(DomSanitizer);\n\n /**\n * Transform markdown to HTML.\n *\n * @param value Markdown initial value.\n * @returns HTML corresponding to markdown.\n */\n transform(value: string): SafeHtml {\n const markValue: string = marked.parse(value, { gfm: true, breaks: false, async: false });\n return this.sanitizer.bypassSecurityTrustHtml(markValue);\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2025 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { Pipe, PipeTransform } from \"@angular/core\";\n\n@Pipe({\n name: 'sanitize',\n standalone: false\n})\nexport class SanitizePipe implements PipeTransform\n{\n transform(value: string, regex: string = '<[^>]*>', replace: string = '', flag: string = 'g'): string {\n const re = new RegExp(regex, flag);\n return value.replace(re, replace);\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2020 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n * Source code: https://dev.to/codephobia/using-typescricore:pt-to-sort-by-keys-35ob\n */\n\n/**\n * Error messages\n */\nconst ERROR_REQUIRES_AT_LEAST_ONE_KEY = 'provide at least one key to sort by';\nconst ERROR_KEY_LENGTH_INVALID = 'a key was provided as an empty string';\nconst ERROR_DESC_KEY_LENGTH_INVALID = 'a descending key was missing the key name';\nconst ERROR_OBJECT_DOESNT_CONTAIN_KEY = 'a key you are attempting to sort by is not on all objects';\n\n/**\n * Recursive function to sort values by their keys.\n */\nconst sortByKey = <T>(a: T, b: T, ...keys: string[]): number => {\n // Get first key in array.\n let key = keys.shift();\n\n // Make sure we have a valid key name.\n if (!key.length) {\n throw new Error(ERROR_KEY_LENGTH_INVALID);\n }\n\n // Default to ascending order.\n let desc = false;\n\n // Check for descending sort.\n if (key.charAt(0) === '-') {\n // Make sure key has a name as well as the minus sign.\n if (key.length < 2) {\n throw new Error(ERROR_DESC_KEY_LENGTH_INVALID);\n }\n\n // Remove minus from key name.\n key = key.substr(1);\n\n // Flag as descending order.\n desc = true;\n }\n\n // Make sure the objects both have the key. We make sure\n // to check this after we have removed the minus sign.\n if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {\n throw new Error(ERROR_OBJECT_DOESNT_CONTAIN_KEY);\n }\n\n // Determine checks based on asc / desc.\n const direction = (desc) ? -1 : 1;\n\n // Perform bubble sort based on the values.\n const authorizedSort = [-1, 1];\n if (authorizedSort.includes(a[key].localeCompare(b[key]))) {\n return a[key].localeCompare(b[key]) * direction;\n }\n\n // The values of the current key are equal, so if we still\n // have keys to check recursively, check the next key.\n if (keys.length) {\n return sortByKey(a, b, ...keys);\n }\n\n // All keys returned and no more sorting needed.\n return 0;\n};\n\n/**\n * Wrapper sort function for the recursive one.\n */\nexport const sortByKeys = <T>(data: T[], ...keys: string[]): T[] => {\n // Make sure we have at least one key to sort by.\n if (!keys.length) {\n throw new Error(ERROR_REQUIRES_AT_LEAST_ONE_KEY);\n }\n\n // Sort data.\n data.sort((a: T, b: T): number => {\n return sortByKey(a, b, ...keys);\n });\n\n // Return sorted data.\n return data;\n};\n","/*\n * RERO angular core\n * Copyright (C) 2020 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n * Source code: https://dev.to/codephobia/using-typescript-to-sort-by-keys-35ob\n */\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { sortByKeys } from '../utils/sort-by-keys';\n\n/**\n * Pipe for the sorting function.\n */\n@Pipe({\n name: 'sortByKeys',\n pure: true,\n standalone: false\n})\nexport class SortByKeysPipe implements PipeTransform {\n /**\n * Order elements by sort key(s)\n * @param value - array of values\n * @param keys - string, sort key\n */\n public transform(value: any, ...keys: string[]): any[] {\n return sortByKeys<any>(value, ...keys);\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2020 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Pipe for truncating text.\n */\n@Pipe({\n name: 'truncateText',\n standalone: false\n})\nexport class TruncateTextPipe implements PipeTransform {\n /**\n * Truncate text.\n *\n * @param value Text to truncate.\n * @param limit Limit after which the text is truncated.\n * @param trail Trailing chars\n * @param type Word or Char type\n * @return Truncated string\n */\n transform(value: string, limit: number = 40, trail: string = '…', type: 'word'|'char' = 'word'): string {\n let result = value || '';\n\n if (type === 'char' && value) {\n if (value.length < limit) {\n return value;\n } else {\n return value.substring(0, limit) + trail;\n }\n }\n\n if (type === 'word' && value) {\n const words = value.split(/\\s+/);\n if (words.length > Math.abs(limit)) {\n if (limit < 0) {\n limit *= -1;\n result =\n trail + words.slice(words.length - limit).join(' ');\n } else {\n result = words.slice(0, limit).join(' ') + trail;\n }\n }\n }\n\n return result;\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2020 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Uppercase the first letter of the string.\n */\n@Pipe({\n name: 'ucfirst',\n standalone: false\n})\nexport class UpperCaseFirstPipe implements PipeTransform {\n /**\n * Uppercase the first letter of the given value.\n *\n * @param value Value to transform.\n * @return Transformed value.\n */\n transform(value: string): string {\n if (value === null) {\n return value;\n }\n\n return value.charAt(0).toUpperCase() + value.slice(1);\n }\n}\n","/*\n * RERO angular core\n * Copyright (C) 2020-2024 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { NgModule } from '@angular/core';\nimport { ConfirmationService, MessageService } from 'primeng/api';\nimport { AutoCompleteModule } from 'primeng/autocomplete';\nimport { AutoFocusModule } from 'primeng/autofocus';\nimport { BadgeModule } from 'primeng/badge';\nimport { ButtonModule } from 'primeng/button';\nimport { CardModule } from 'primeng/card';\nimport { CheckboxModule } from 'primeng/checkbox';\nimport { ConfirmDialogModule } from 'primeng/confirmdialog';\nimport { DatePickerModule } from 'primeng/datepicker';\nimport { DividerModule } from 'primeng/divider';\nimport { DialogService, DynamicDialogModule } from 'primeng/dynamicdialog';\nimport { FieldsetModule } from 'primeng/fieldset';\nimport { InputGroupModule } from 'primeng/inputgroup';\nimport { InputGroupAddonModule } from 'primeng/inputgroupaddon';\nimport { InputNumberModule } from 'primeng/inputnumber';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { ListboxModule } from 'primeng/listbox';\nimport { MenuModule } from 'primeng/menu';\nimport { MessageModule } from 'primeng/message';\nimport { PaginatorModule } from 'primeng/paginator';\nimport { PanelModule } from 'primeng/panel';\nimport { RadioButtonModule } from 'primeng/radiobutton';\nimport { RippleModule } from 'primeng/ripple';\nimport { ScrollPanelModule } from 'primeng/scrollpanel';\nimport { SelectModule } from 'primeng/select';\nimport { SplitButtonModule } from 'primeng/splitbutton';\nimport { TabsModule } from 'primeng/tabs';\nimport { TextareaModule } from 'primeng/textarea';\nimport { TieredMenuModule } from 'primeng/tieredmenu';\nimport { ToastModule } from 'primeng/toast';\nimport { ToggleSwitchModule } from 'primeng/toggleswitch';\nimport { TooltipModule } from 'primeng/tooltip';\n\n@NgModule({\n providers: [\n ConfirmationService,\n DialogService,\n MessageService\n ],\n exports: [\n AutoCompleteModule,\n AutoFocusModule,\n BadgeModule,\n ButtonModule,\n CardModule,\n CheckboxModule,\n ConfirmDialogModule,\n DatePickerModule,\n DividerModule,\n DynamicDialogModule,\n FieldsetModule,\n InputGroupAddonModule,\n InputGroupModule,\n InputNumberModule,\n InputTextModule,\n ListboxModule,\n MenuModule,\n MessageModule,\n PaginatorModule,\n PanelModule,\n RadioButtonModule,\n RippleModule,\n ScrollPanelModule,\n SelectModule,\n SplitButtonModule,\n TabsModule,\n TextareaModule,\n TieredMenuModule,\n ToastModule,\n ToggleSwitchModule,\n TooltipModule,\n ],\n})\nexport class PrimeNgCoreModule {}\n","/*\n * RERO angular core\n * Copyright (C) 2020-2024 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Component, ElementRef, ViewChild, input, output } from '@angular/core';\n\n@Component({\n selector: 'ng-core-search-input',\n templateUrl: './search-input.component.html',\n standalone: false\n})\nexport class SearchInputComponent {\n /** Input Id */\n inputId = input<string>('search');\n\n /** Display label */\n displayLabel = input<boolean>(false);\n\n /** Placeholder */\n placeholder = input<string>('search');\n\n /** Value to search */\n searchText = input<string>('');\n\n /** Remove trailing and leading spaces if true */\n trimQueryString = input<boolean>(true);\n\n /** Disabled attribute of search input */\n disabled = input<boolean>(false);\n\n /** Make the focus on field */\n focus = input<boolean>(false);\n\n /** Search value event */\n search = output<string>();\n\n /** Search input reference */\n @ViewChild('searchInput') input: ElementRef;\n\n /**\n * Start the search by pressing enter\n * or clicking on the lens.\n */\n doSearch(): void {\n const { value } = this.input.nativeElement;\n this.search.emit(this.trimQueryString() ? value.trim() : value);\n }\n}\n","<!--\n RERO angular core\n Copyright (C) 2020-2024 RERO\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Affero General Public License as published by\n the Free Software Foundation, version 3 of the License.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Affero General Public License for more details.\n\n You should have received a copy of the GNU Affero General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n@if (displayLabel()) {\n <label [for]=\"inputId()\" class=\"core:font-bold\">{{ placeholder() }}</label>\n}\n<p-inputGroup>\n <input\n #searchInput\n [pAutoFocus]=\"focus()\"\n pInputText\n [disabled]=\"disabled()\"\n [id]=\"inputId()\"\n [placeholder]=\"!displayLabel() && placeholder() ? placeholder() : ''\"\n [value]=\"searchText()\"\n (keydown.enter)=\"doSearch()\"\n attr.aria-label=\"{{ placeholder() }}\"\n />\n <p-inputGroupAddon>\n <i class=\"fa fa-search\" (click)=\"doSearch()\"></i>\n </p-inputGroupAddon>\n</p-inputGroup>\n","/*\n * RERO angular core\n * Copyright (C) 2020 RERO\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Component, Input, OnInit } from '@angular/core';\n\n/**\n * Component for displaying a \"read more\" link after a text.\n */\n@Component({\n selector: 'ng-core-text-read-more',\n templateUrl: './text-read-more.component.html',\n standalone: false\n})\nexport class TextReadMoreComponent implements OnInit {\n /** Initial text */\n @Input() text: string;\n\n /** Number of parts to display (depending of the unit) */\n @Input() limit = 50;\n\n /** \"Show more\" label to display */\n @Input() showMoreLabel = 'Show more';\n\n /** \"Show less\" label to display */\n @Input() showLessLabel = 'Show less';\n\n /** Splitting unit [ word | character] */\n @Input() unit = 'word';\n\n /** trailing string */\n @Input() trailing = '…';\n\n /** The text that will be display */\n textToDisplay: string;\n\n /** boolean to know if initial text is expanded */\n isExpanded = false;\n\n /** boolean to know if limit is reached */\n isLimitReached = true;\n\n /** The truncated text */\n private sTruncateText: string;\n\n ngOnInit() {\n this.textToDisplay = this.sTruncateText = this._truncateText();\n if (this.text === this.textToDisplay) {\n this.isLimitReached = false;\n }\n }\n\n /**\n * Allow to toggle content of the field\n * @param event : Click event\