How to use the heyui/src/utils/utils.extend 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 / plugins / pop / index.js View on Github external
constructor(reference, options) {
    options = utils.extend({}, DEFAULT_OPTIONS, options);
    this.reference = reference;

    this.options = options;

    const triggerEvents = typeof options.trigger === 'string' ? options.trigger.split(' ').filter((trigger) => {
      return ['click', 'hover', 'focus', 'manual', 'contextMenu'].indexOf(trigger) !== -1;
    }) : [];

    this.isOpen = false;

    this.arrowSelector = options.arrowSelector;
    this.innerSelector = options.innerSelector;
    this.triggerEvents = [];
    if (options.content.nodeType === 1) {
      options.content.style.display = 'none';
    }
github heyui / heyui / src / components / menu / menu.vue View on Github external
data() {
    let param = {};
    param = utils.extend({}, config.getOption('menu'), this.option);
    return {
      param,
      status: {
        selected: null,
        opened: []
      }
    };
  },
  computed: {
github heyui / heyui / src / components / date-picker / datebase.vue View on Github external
type() {
      this.options = utils.extend({}, options.datetimeOptions, this.option);
      this.view = startView[this.type];
    }
  },
github heyui / heyui / src / components / tree-picker / treepicker.vue View on Github external
param() {
      if (this.config) {
        return utils.extend({},
          config.getOption('tree.default'),
          config.getOption(`tree.configs.${this.config}`),
          this.option
        );
      } else {
        return utils.extend({}, config.getOption('tree.default'), this.option);
      }
    },
    showCls() {
github heyui / heyui / src / components / form / form.vue View on Github external
validField(prop) {
      if (!prop || !this.validator || !this.model) {
        return {
          valid: true
        };
      }
      let returnResult = this.validator.validField(prop, this.model, {
        next: (result) => {
          utils.extend(true, this.messages, result);
        }
      });
      utils.extend(true, this.messages, returnResult);
      return utils.extend({}, this.messages[prop]);
    },
    validFieldJs(prop, next) {
github heyui / heyui / src / plugins / modal / index.js View on Github external
function Modal(originalParam) {
  let cls = prefixCls;
  let param = utils.extend({ hasMask: true, closeOnMask: true, buttons: ['cancel'] }, Default, originalParam, true);

  if (originalParam.hasDivider || Default.hasDivider) {
    param.className += ` h-modal-has-divider`;
  }

  if (param.fullScreen) {
    param.className += ` h-modal-full-screen`;
  }

  if (param.middle) {
    param.className += ` h-modal-container-center`;
  }

  if (param.transparent) {
    param.className += ` h-modal-transparent`;
  }
github heyui / heyui / src / components / category / category.vue View on Github external
param() {
      if (this.config) {
        return utils.extend({}, config.getOption('category.default'), config.getOption(
          `category.configs.${this.config}`), this.option);
      } else {
        return utils.extend({}, config.getOption('category.default'), this.option);
      }
    },
    categoryCls() {
github heyui / heyui / src / components / form / form.vue View on Github external
renderMessage(returnResult) {
      let isSuccess = true;
      for (let r in returnResult) {
        if (!returnResult[r].valid) {
          isSuccess = false;
          break;
        }
      }
      utils.extend(true, this.messages, returnResult);
      let result = {
        result: isSuccess,
        messages: utils.toArray(this.messages, 'prop').filter(item => !item.valid)
      };
      return result;
    },
    tipError(result) {
github heyui / heyui / src / components / category / category.vue View on Github external
param() {
      if (this.config) {
        return utils.extend({}, config.getOption('category.default'), config.getOption(
          `category.configs.${this.config}`), this.option);
      } else {
        return utils.extend({}, config.getOption('category.default'), this.option);
      }
    },
    categoryCls() {
github heyui / heyui / src / components / cascader / cascader.vue View on Github external
param() {
      if (this.config) {
        return utils.extend({}, config.getOption('cascader.default'), config.getOption(
          `cascader.configs.${this.config}`), this.option);
      } else {
        return utils.extend({}, config.getOption('cascader.default'), this.option);
      }
    },
    cascaderCls() {