How to use the mout/array/find function in mout

To help you get started, we’ve selected a few mout 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 cam-inc / viron / src / components / viron-parameters / properties / index.js View on Github external
this.handleSelectChange = newOptions => {
    const item = find(newOptions, option => {
      return option.isSelected;
    });
    if (!this.opts.onchange) {
      return;
    }
    // this.opts.valを空にする。
    let ret = {};
    ret[anyOfKey] = item.value;
    // 値がundefinedのkeyを削除する。
    forOwn(ret, (val, key) => {
      if (isUndefined(val)) {
        delete ret[key];
      }
    });
    if (!size(ret)) {
      ret = undefined;
github cam-inc / viron / src / pages / viron-components / filter / index.js View on Github external
const target = find(this.columns, column => {
      return (column.key === key);
    });
    if (!!target) {
      target.isSelected = newIsSelected;
    }
    // 全て未選択の時はボタン非活性化。
    if (!find(this.columns, column => {
      return column.isSelected;
    })) {
      this.isApplyButtonDisabled = true;
    } else {
      this.isApplyButtonDisabled = false;
    }
    // 全て選択されている時は全選択ボタン活性化。
    if (find(this.columns, column => {
      return !column.isSelected;
    })) {
      this.isAllSelected = false;
    } else {
      this.isAllSelected = true;
    }
    this.update();
  };
github cam-inc / viron / src / pages / viron-components / filter / index.js View on Github external
this.handleItemChange = (newIsSelected, key) => {
    const target = find(this.columns, column => {
      return (column.key === key);
    });
    if (!!target) {
      target.isSelected = newIsSelected;
    }
    // 全て未選択の時はボタン非活性化。
    if (!find(this.columns, column => {
      return column.isSelected;
    })) {
      this.isApplyButtonDisabled = true;
    } else {
      this.isApplyButtonDisabled = false;
    }
    // 全て選択されている時は全選択ボタン活性化。
    if (find(this.columns, column => {
      return !column.isSelected;
github cam-inc / viron / src / store / mutations / viron.js View on Github external
all: (state, viron) => {
    // メニューのカテゴライズ。下位互換のため、dashboardとmanageは必須項目とする。
    if (!!viron) {
      viron.sections = viron.sections || [];
      if (!find(viron.sections, section => {
        return (section.id === 'manage');
      })) {
        viron.sections = combine([{ id: 'manage', label: i18n.t('word.manage') }], viron.sections);
      }
      if (!find(viron.sections, section => {
        return (section.id === 'dashboard');
      })) {
        viron.sections = combine([{ id: 'dashboard', label: i18n.t('word.dashboard') }], viron.sections);
      }
    }
    state.viron = viron;
    return ['viron'];
  }
});
github cam-inc / viron / src / store / mutations / viron.js View on Github external
all: (state, viron) => {
    // メニューのカテゴライズ。下位互換のため、dashboardとmanageは必須項目とする。
    if (!!viron) {
      viron.sections = viron.sections || [];
      if (!find(viron.sections, section => {
        return (section.id === 'manage');
      })) {
        viron.sections = combine([{ id: 'manage', label: i18n.t('word.manage') }], viron.sections);
      }
      if (!find(viron.sections, section => {
        return (section.id === 'dashboard');
      })) {
        viron.sections = combine([{ id: 'dashboard', label: i18n.t('word.dashboard') }], viron.sections);
      }
    }
    state.viron = viron;
    return ['viron'];
  }
});
github cam-inc / viron / src / store / getters / viron.js View on Github external
forEach(pages, page => {
      const targetSection = find(menu, section => {
        return (section.id === page.section);
      });
      const groupName = page.group;
      const isIndependent = !groupName;
      if (isIndependent) {
        targetSection.groups.push({
          pages: [{
            name: page.name,
            id: page.id
          }],
          isIndependent
        });
      } else {
        if (!find(targetSection.groups, group => {
          return (group.name === groupName);
        })) {
          targetSection.groups.push({
            name: groupName,
            pages: [],
            isIndependent
          });
        }
        const targetGroup = find(targetSection.groups, group => {
          return (group.name === groupName);
        });
        targetGroup.pages.push({
          name: page.name,
          id: page.id
        });
      }
github cam-inc / viron / src / components / organisms / viron-menu / group.js View on Github external
this.listen(states.PAGE, () => {
    const pageId = store.getter(getters.PAGE_ID);
    if (!!find(this.opts.group.list, item => {
      return (item.id === pageId);
    })) {
      this.isOpened = true;
    }
    map(this.opts.group.list, item => {
      if (item.id === pageId) {
        item.isSelected = true;
      } else {
        item.isSelected = false;
      }
      return item;
    });
    this.update();
  });
github cam-inc / viron / src / store / getters / viron.js View on Github external
forEach(pages, page => {
      const targetSection = find(menu, section => {
        return (section.id === page.section);
      });
      const groupName = page.group;
      const isIndependent = !groupName;
      if (isIndependent) {
        targetSection.groups.push({
          pages: [{
            name: page.name,
            id: page.id
          }],
          isIndependent
        });
      } else {
        if (!find(targetSection.groups, group => {
          return (group.name === groupName);
        })) {
github cam-inc / viron / src / components / organisms / viron-component / table.js View on Github external
this.handleActionButtonClick = (operationId, rowIdx) => {
    const operationObject = find(this.opts.rowactions, operationObject => {
      return (operationObject.operationId === operationId);
    });
    const method = store.getter(getters.OAS_PATH_ITEM_OBJECT_METHOD_NAME_BY_OPERATION_ID, operationObject.operationId);
    const rowData = this.opts.response[rowIdx];
    const initialParameters = createInitialQueries(operationObject, rowData);
    store.action(actions.DRAWERS_ADD, 'viron-component-operation', {
      title: operationObject.summary || operationObject.operationId,
      description: operationObject.description,
      method,
      primaryKey: this.opts.primarykey,
      operationObject,
      parameterObjects: operationObject.parameters,
      initialParameters,
      onComplete: () => {
        this.opts.updater();
      }
github cam-inc / viron / src / store / getters / viron.js View on Github external
name: page.name,
            id: page.id
          }],
          isIndependent
        });
      } else {
        if (!find(targetSection.groups, group => {
          return (group.name === groupName);
        })) {
          targetSection.groups.push({
            name: groupName,
            pages: [],
            isIndependent
          });
        }
        const targetGroup = find(targetSection.groups, group => {
          return (group.name === groupName);
        });
        targetGroup.pages.push({
          name: page.name,
          id: page.id
        });
      }
    });
    return menu;