1 line
122 KiB
Plaintext
1 line
122 KiB
Plaintext
|
{"version":3,"file":"ngx-chips.mjs","sources":["../../modules/core/pipes/highlight.pipe.ts","../../modules/core/constants/index.ts","../../modules/core/providers/drag-provider.ts","../../modules/defaults.ts","../../modules/core/providers/options-provider.ts","../../modules/core/accessor.ts","../../modules/core/helpers/listen.ts","../../modules/components/tag-input-form/tag-input-form.component.ts","../../modules/components/tag-input-form/tag-input-form.template.html","../../modules/components/tag/tag-ripple.component.ts","../../modules/components/icon/icon.ts","../../modules/components/icon/icon.html","../../modules/components/tag/tag.component.ts","../../modules/components/tag/tag.template.html","../../modules/components/tag-input/animations.ts","../../modules/components/dropdown/tag-input-dropdown.component.ts","../../modules/components/dropdown/tag-input-dropdown.template.html","../../modules/components/tag-input/tag-input.ts","../../modules/components/tag-input/tag-input.template.html","../../modules/tag-input.module.ts","../../modules/ngx-chips.ts"],"sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\n\nconst escape = s => s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n\n@Pipe({\n name: 'highlight'\n})\nexport class HighlightPipe implements PipeTransform {\n /**\n * @name transform\n * @param value {string}\n * @param arg {string}\n */\n public transform(value: string, arg: string): string {\n if (!arg.trim()) {\n return value;\n }\n\n try {\n const regex = new RegExp(`(${escape(arg)})`, 'i');\n return value.replace(regex, '<b>$1</b>');\n } catch (e) {\n return value;\n }\n }\n}\n","/*\n** constants and default values for <tag-input>\n */\n\nexport const PLACEHOLDER = '+ Tag';\nexport const SECONDARY_PLACEHOLDER = 'Enter a new tag';\nexport const KEYDOWN = 'keydown';\nexport const KEYUP = 'keyup';\nexport const FOCUS = 'focus';\nexport const MAX_ITEMS_WARNING = 'The number of items specified was greater than the property max-items.';\n\nexport const ACTIONS_KEYS = {\n DELETE: 'DELETE',\n SWITCH_PREV: 'SWITCH_PREV',\n SWITCH_NEXT: 'SWITCH_NEXT',\n TAB: 'TAB'\n};\n\nexport const KEY_PRESS_ACTIONS = {\n 8: ACTIONS_KEYS.DELETE,\n 46: ACTIONS_KEYS.DELETE,\n 37: ACTIONS_KEYS.SWITCH_PREV,\n 39: ACTIONS_KEYS.SWITCH_NEXT,\n 9: ACTIONS_KEYS.TAB\n};\n\nexport const DRAG_AND_DROP_KEY = 'Text';\nexport const NEXT = 'NEXT';\nexport const PREV = 'PREV';\n\n","import { TagInputComponent } from '../../components/tag-input/tag-input';\nimport { TagModel } from '../tag-model';\n\nimport { Injectable } from '@angular/core';\n\nexport declare interface DraggedTag {\n index: number;\n tag: TagModel;\n zone: string;\n}\n\nimport { DRAG_AND_DROP_KEY } from '../../core/constants';\n\nexport declare interface State {\n dragging: boolean;\n dropping: boolean;\n index: number | undefined;\n}\n\nexport declare type StateProperty = keyof State;\n\n@Injectable()\nexport class DragProvider {\n public sender: TagInputComponent;\n public receiver: TagInputComponent;\n\n public state: State = {\n dragging: false,\n dropping: false,\n index: undefined\n };\n\n /**\n * @name setDraggedItem\n * @param event\n * @param tag\n */\n public setDraggedItem(event: DragEvent, tag: DraggedTag): void {\n if (event && event.dataTransfer) {\n event.dataTransfer.setData(DRAG_AND_DROP_KEY, JSON.stringify(tag));\n }\n }\n\n /**\n * @name getDraggedItem\n * @param event\n */\n public getDraggedItem(event: DragEvent): DraggedTag | undefined {\n if (event && event.dataTransfer) {\n const data = event.dataTransfer.getData(DRAG_AND_DROP_KEY);\n try {\n return JSON.parse(data) as DraggedTag;\n } catch {\n return;\n }\n }\n }\n\n /**\n * @name setSender\n * @param sender\n */\n public setSender(s
|