useMissingValues.js 706 B

123456789101112131415161718192021222324
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _vue = require("vue");
  7. var _treeUtil = require("../utils/treeUtil");
  8. var _default = (options, fieldNames, rawValues) => {
  9. return (0, _vue.computed)(() => {
  10. const missingValues = [];
  11. const existsValues = [];
  12. rawValues.value.forEach(valueCell => {
  13. const pathOptions = (0, _treeUtil.toPathOptions)(valueCell, options.value, fieldNames.value);
  14. if (pathOptions.every(opt => opt.option)) {
  15. existsValues.push(valueCell);
  16. } else {
  17. missingValues.push(valueCell);
  18. }
  19. });
  20. return [existsValues, missingValues];
  21. });
  22. };
  23. exports.default = _default;