{"version":3,"file":"ajf-core-node-icon.mjs","sources":["../../../projects/core/node-icon/src/node-icon.ts","../../../projects/core/node-icon/src/public_api.ts","../../../projects/core/node-icon/src/ajf-core-node-icon.ts"],"sourcesContent":["/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) 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 GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfField, AjfFieldType, AjfNode, AjfNodeType} from '@ajf/core/forms';\nimport {Directive, Input} from '@angular/core';\n\n@Directive()\nexport abstract class AjfNodeIcon {\n  private _fontSet: string = '';\n  get fontSet(): string {\n    return this._fontSet;\n  }\n\n  private _fontIcon: string = '';\n  get fontIcon(): string {\n    return this._fontIcon;\n  }\n\n  private _node: AjfNode | undefined;\n  get node(): AjfNode | undefined {\n    return this._node;\n  }\n  @Input()\n  set node(node: AjfNode | undefined) {\n    this._node = node;\n    this._fontSet = 'ajf-icon';\n    this._fontIcon = this._getFontIcon(node);\n  }\n\n  private _getFontIcon(node: AjfNode | undefined): string {\n    if (node == null) {\n      return '';\n    }\n    switch (node.nodeType) {\n      case AjfNodeType.AjfField:\n        const fieldType = AjfFieldType[(<AjfField>node).fieldType];\n        return fieldType != null ? `field-${fieldType.toLowerCase()}` : '';\n      default:\n        const nodeType = AjfNodeType[node.nodeType];\n        return nodeType != null ? `node-${nodeType.toLowerCase().replace('ajf', '')}` : '';\n    }\n  }\n}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) 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 GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport * from './node-icon';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;;AAoBG;MAMmB,WAAW,CAAA;AADjC,IAAA,WAAA,GAAA;QAEU,IAAQ,CAAA,QAAA,GAAW,EAAE;QAKrB,IAAS,CAAA,SAAA,GAAW,EAAE;AA6B/B;AAjCC,IAAA,IAAI,OAAO,GAAA;QACT,OAAO,IAAI,CAAC,QAAQ;;AAItB,IAAA,IAAI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,SAAS;;AAIvB,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,KAAK;;IAEnB,IACI,IAAI,CAAC,IAAyB,EAAA;AAChC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI;AACjB,QAAA,IAAI,CAAC,QAAQ,GAAG,UAAU;QAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;;AAGlC,IAAA,YAAY,CAAC,IAAyB,EAAA;AAC5C,QAAA,IAAI,IAAI,IAAI,IAAI,EAAE;AAChB,YAAA,OAAO,EAAE;;AAEX,QAAA,QAAQ,IAAI,CAAC,QAAQ;YACnB,KAAK,WAAW,CAAC,QAAQ;gBACvB,MAAM,SAAS,GAAG,YAAY,CAAY,IAAK,CAAC,SAAS,CAAC;A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