How to use the heyui/src/utils/utils.isObject function in heyui

To help you get started, we’ve selected a few heyui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heyui / heyui / src / components / select / select.vue View on Github external
parse() {
      if (this.multiple) {
        let values = this.value || [];
        if (!utils.isArray(values)) {
          console.warn(`[HeyUI WARNING] Select Component: value '${values}' can't be a value of a multiple select`);
          values = [];
        }
        this.codes = values.map((item) => {
          return this.type == 'key' ? this.getValue(item) : item[this.keyName];
        }).filter(item => item !== null);
      } else {
        if (this.type == 'key') {
          this.codes = this.getValue(this.value);
        } else {
          if (utils.isObject(this.value)) {
            this.codes = this.value[this.keyName];
          } else {
            this.codes = null;
          }
        }
      }
      this.setObjects();
    },
    getValue(value) {
github heyui / heyui / src / plugins / notice / index.js View on Github external
function notice(param, timeout) {
  if (utils.isString(param)) {
    return Notice({ content: param, timeout });
  } else if (utils.isObject(param)) {
    if (this) {
      if (this.$router) {
        param.$router = this.$router;
      }
      if (this.$i18n) {
        param.$i18n = this.$i18n;
      }
      if (this.$store) {
        param.$store = this.$store;
      }
    }
    return Notice(param);
  }
  console.error('Notice params are incorrect:', param);
}
github heyui / heyui / src / plugins / notice / index.js View on Github external
function noticeWithType(type, param, timeout) {
  if (utils.isString(param)) {
    return Notice({ content: param, timeout, type });
  } else if (utils.isObject(param)) {
    if (type) param.type = type;
    return Notice(param);
  }
  console.error('Notice params are incorrect:', param);
}
github heyui / heyui / src / components / date-picker / datebase.vue View on Github external
const genData = param => {
  let { date, type, show, vm, isNowDays, view } = param;
  let disabled = false;
  if (utils.isObject(vm.option)) {
    if (vm.option.start) disabled = date.distance(vm.option.start, type) < 0;
    if (vm.option.end && !disabled) disabled = date.distance(vm.option.end, type) > 0;
    if (vm.option.disabled && !disabled) disabled = vm.option.disabled.call(null, date);
  }
  let dis = date.distance(vm.today, type);
  let isToday = dis == 0;
  if (view == 'quarter') {
    isToday = dis >= -2 && dis <= 0;
  }
  return {
    date,
    show,
    string: date.format(vm.format),
    disabled,
    isToday,
    isNowDays
github heyui / heyui / src / components / date-range-picker / daterangepicker.vue View on Github external
parseSingle(value, range) {
      if (utils.isObject(value) && value[this.paramName[range]]) {
        try {
          let nowValue = manba(value[this.paramName[range]], this.nowFormat);
          this.nowDate[range] = nowValue.format(this.nowFormat);
          return;
        } catch (evt) {
        }
      }
      this.nowDate[range] = '';
    },
    parse(value) {
github heyui / heyui / src / components / date-full-range-picker / datefullrangepicker.vue View on Github external
parseSingle(value, range) {
      if (utils.isObject(value) && value[this.paramName[range]]) {
        try {
          let nowValue = manba(value[this.paramName[range]]);
          if (range == 'end') {
            nowValue = nowValue.add(-1);
          }
          this.nowDate[range] = nowValue.format(this.nowFormat);
          return;
        } catch (evt) {}
      }
      this.nowDate[range] = '';
    },
    parse(value) {
github heyui / heyui / src / components / table / tableth.vue View on Github external
tooltipParam() {
      if (this.tooltip === true) {
        return {
          enable: true,
          content: this.content,
          placement: this.placement
        };
      } else if (utils.isObject(this.tooltip)) {
        return {
          enable: true,
          content: this.tooltip.content,
          placement: this.tooltip.placement
        };
      }
      return {
        enable: false
      };
    },
    cls() {
github heyui / heyui / src / utils / config.js View on Github external
let result = value.map((ele) => {
      if (utils.isObject(ele)) {
        return ele[titleField];
      }
      const d = dict[ele];
      if (utils.isObject(d)) {
        return d[titleField];
      }
      return d;
    });
    return result.filter(ele => (ele && ele !== '')).join(connector || ', ');
github heyui / heyui / src / components / date-range-picker / daterangepicker.vue View on Github external
show() {
      if (!utils.isObject(this.value)) {
        return '';
      }
      return `${this.value.start || this.t('h.datepicker.start')} - ${this.value.end || this.t('h.datepicker.end')}`;
    },
    shortcuts() {