@progress/kendo-vue-upload
Version:
9 lines (8 loc) • 1.07 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
;const u=require("../interfaces/UploadFileStatus.js"),d=o=>(o||[]).map(t=>({...t})),c=(o,t)=>{t.push(o)},p=(o,t)=>{o.forEach(s=>c(s,t))},l=o=>{const t={};return o.forEach(s=>{t[s.uid]?t[s.uid].push(s):t[s.uid]=[s]}),t},i=o=>{const t={};return r(o,(s,a)=>{let n=!0;s.forEach(e=>{(e.status!==u.UploadFileStatus.Selected||e.validationErrors&&e.validationErrors.length>0)&&(n=!1)}),n&&(t[a]=s)}),t},h=(o,t)=>{r(o,s=>{s.forEach(a=>{a.status=t})})},E=o=>{const t=[];return r(o,s=>{t.push.apply(t,s)}),t},r=(o,t)=>{Object.keys(o).forEach(s=>{t(o[s],s)})},F={copyState:d,addMany:p,add:c,groupFilesByUid:l,filesForUpload:i,setFilesStatus:h,flatFileGroup:E,groupForEach:r};module.exports=F;