Icard/angular-clarity-master(work.../node_modules/ngx-chips/esm2020/defaults.mjs

68 lines
8.5 KiB
JavaScript
Raw Permalink Normal View History

2024-07-16 14:55:36 +00:00
import { SECONDARY_PLACEHOLDER, PLACEHOLDER } from './core/constants/index';
export const defaults = {
tagInput: {
separatorKeys: [],
separatorKeyCodes: [],
maxItems: Infinity,
placeholder: PLACEHOLDER,
secondaryPlaceholder: SECONDARY_PLACEHOLDER,
validators: [],
asyncValidators: [],
onlyFromAutocomplete: false,
errorMessages: {},
theme: '',
onTextChangeDebounce: 250,
inputId: null,
inputClass: '',
clearOnBlur: false,
hideForm: false,
addOnBlur: false,
addOnPaste: false,
pasteSplitPattern: ',',
blinkIfDupe: true,
removable: true,
editable: false,
allowDupes: false,
modelAsStrings: false,
trimTags: true,
ripple: true,
tabIndex: '',
disable: false,
dragZone: '',
onRemoving: undefined,
onAdding: undefined,
displayBy: 'display',
identifyBy: 'value',
animationDuration: {
enter: '250ms',
leave: '150ms'
}
},
dropdown: {
displayBy: 'display',
identifyBy: 'value',
appendToBody: true,
offset: '50 0',
focusFirstElement: false,
showDropdownIfEmpty: false,
minimumTextLength: 1,
limitItemsTo: Infinity,
keepOpen: true,
dynamicUpdate: true,
zIndex: 1000,
matchingFn
}
};
/**
* @name matchingFn
* @param this
* @param value
* @param target
*/
function matchingFn(value, target) {
const targetValue = target[this.displayBy].toString();
return targetValue && targetValue
.toLowerCase()
.indexOf(value.toLowerCase()) >= 0;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVmYXVsdHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9tb2R1bGVzL2RlZmF1bHRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxXQUFXLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQTBENUUsTUFBTSxDQUFDLE1BQU0sUUFBUSx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