util.js 476 B

12345678910
  1. import { filterEmpty } from '../_util/props-util';
  2. const isValid = value => {
  3. return value !== undefined && value !== null && (Array.isArray(value) ? filterEmpty(value).length : true);
  4. };
  5. export function hasPrefixSuffix(propsAndSlots) {
  6. return isValid(propsAndSlots.prefix) || isValid(propsAndSlots.suffix) || isValid(propsAndSlots.allowClear);
  7. }
  8. export function hasAddon(propsAndSlots) {
  9. return isValid(propsAndSlots.addonBefore) || isValid(propsAndSlots.addonAfter);
  10. }