uikit 3.25.28-dev.fcd5185 → 3.25.29-dev.e02d266

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/ci-release.js +1 -4
  3. package/dist/css/uikit-core-rtl.css +1 -1
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +1 -1
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +1 -1
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +1 -1
  10. package/dist/css/uikit.min.css +1 -1
  11. package/dist/js/components/countdown.js +1 -1
  12. package/dist/js/components/countdown.min.js +1 -1
  13. package/dist/js/components/filter.js +1 -1
  14. package/dist/js/components/filter.min.js +1 -1
  15. package/dist/js/components/lightbox-panel.js +3 -3
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +3 -3
  18. package/dist/js/components/lightbox.min.js +1 -1
  19. package/dist/js/components/notification.js +1 -1
  20. package/dist/js/components/notification.min.js +1 -1
  21. package/dist/js/components/parallax.js +1 -1
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +1 -1
  24. package/dist/js/components/slider-parallax.min.js +1 -1
  25. package/dist/js/components/slider.js +1 -1
  26. package/dist/js/components/slider.min.js +1 -1
  27. package/dist/js/components/slideshow-parallax.js +1 -1
  28. package/dist/js/components/slideshow-parallax.min.js +1 -1
  29. package/dist/js/components/slideshow.js +1 -1
  30. package/dist/js/components/slideshow.min.js +1 -1
  31. package/dist/js/components/sortable.js +1 -1
  32. package/dist/js/components/sortable.min.js +1 -1
  33. package/dist/js/components/tooltip.js +1 -1
  34. package/dist/js/components/tooltip.min.js +1 -1
  35. package/dist/js/components/upload.js +35 -48
  36. package/dist/js/components/upload.min.js +1 -1
  37. package/dist/js/uikit-core.js +10 -11
  38. package/dist/js/uikit-core.min.js +1 -1
  39. package/dist/js/uikit-icons.js +1 -1
  40. package/dist/js/uikit-icons.min.js +1 -1
  41. package/dist/js/uikit.js +44 -58
  42. package/dist/js/uikit.min.js +1 -1
  43. package/package.json +1 -1
  44. package/src/js/api/component.js +1 -1
  45. package/src/js/api/log.js +1 -1
  46. package/src/js/components/upload.js +38 -49
  47. package/src/js/core/form-custom.js +3 -8
  48. package/src/js/core/svg.js +1 -1
  49. package/src/js/mixin/modal.js +1 -1
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.25.28-dev.fcd5185 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
1
+ /*! UIkit 3.25.29-dev.e02d266 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
@@ -103,37 +103,37 @@
103
103
  },
104
104
  methods: {
105
105
  async upload(files) {
106
- files = uikitUtil.toArray(files);
107
- if (!files.length) {
108
- return;
109
- }
110
- if (!this.multiple) {
111
- files = files.slice(0, 1);
112
- }
113
- uikitUtil.trigger(this.$el, "upload", [files]);
114
- for (const file of files) {
115
- if (this.maxSize && this.maxSize * 1e3 < file.size) {
116
- this.fail(this.t("invalidSize", this.maxSize));
106
+ try {
107
+ files = uikitUtil.toArray(files);
108
+ if (!files.length) {
117
109
  return;
118
110
  }
119
- if (this.allow && !match(this.allow, file.name)) {
120
- this.fail(this.t("invalidName", this.allow));
121
- return;
111
+ if (!this.multiple) {
112
+ files = files.slice(0, 1);
122
113
  }
123
- if (this.mime && !match(this.mime, file.type)) {
124
- this.fail(this.t("invalidMime", this.mime));
125
- return;
126
- }
127
- }
128
- this.beforeAll(this, files);
129
- const chunks = chunk(files, this.concurrent);
130
- const upload = async (files2) => {
131
- const data = new FormData();
132
- files2.forEach((file) => data.append(this.name, file));
133
- for (const key in this.params) {
134
- data.append(key, this.params[key]);
114
+ uikitUtil.trigger(this.$el, "upload", [files]);
115
+ for (const file of files) {
116
+ if (this.maxSize && this.maxSize * 1e3 < file.size) {
117
+ this.fail(this.t("invalidSize", this.maxSize));
118
+ return;
119
+ }
120
+ if (this.allow && !match(this.allow, file.name)) {
121
+ this.fail(this.t("invalidName", this.allow));
122
+ return;
123
+ }
124
+ if (this.mime && !match(this.mime, file.type)) {
125
+ this.fail(this.t("invalidMime", this.mime));
126
+ return;
127
+ }
135
128
  }
136
- try {
129
+ await this.beforeAll(this, files);
130
+ const size = this.concurrent;
131
+ for (let i = 0; i < files.length; i += size) {
132
+ const data = new FormData();
133
+ files.slice(i, i + size).forEach((file) => data.append(this.name, file));
134
+ for (const key in this.params) {
135
+ data.append(key, this.params[key]);
136
+ }
137
137
  const xhr = await ajax(this.url, {
138
138
  data,
139
139
  method: this.method,
@@ -148,38 +148,25 @@
148
148
  }
149
149
  });
150
150
  this.complete(xhr);
151
- if (chunks.length) {
152
- await upload(chunks.shift());
153
- } else {
151
+ if (i + size >= files.length) {
154
152
  this.completeAll(xhr);
155
153
  }
156
- } catch (e) {
157
- if (e.name !== "AbortError") {
158
- this.error(e);
159
- }
160
154
  }
161
- };
162
- await upload(chunks.shift());
155
+ } catch (e) {
156
+ if ((e == null ? void 0 : e.name) !== "AbortError") {
157
+ this.error(e);
158
+ }
159
+ }
163
160
  }
164
161
  }
165
162
  };
166
163
  function match(pattern, path) {
167
164
  const expression = pattern.replace(
168
165
  /\*\*|[.*+?^${}()|[\]\\]/g,
169
- (s) => {
170
- var _a;
171
- return (_a = { "**": ".*", "*": "[^/]+", "?": "[^/]", "|": "|" }[s]) != null ? _a : `\\${s}`;
172
- }
166
+ (s) => ({ "**": ".*", "*": "[^/]+", "?": "[^/]", "|": "|" })[s] || `\\${s}`
173
167
  );
174
168
  return new RegExp(`^(?:${expression})$`, "i").test(path);
175
169
  }
176
- function chunk(files, size) {
177
- const chunks = [];
178
- for (let i = 0; i < files.length; i += size) {
179
- chunks.push(files.slice(i, i + size));
180
- }
181
- return chunks;
182
- }
183
170
  function stop(e) {
184
171
  e.preventDefault();
185
172
  e.stopPropagation();
@@ -1 +1 @@
1
- /*! UIkit 3.25.28-dev.fcd5185 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */(function(r,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitupload",["uikit-util"],i):(r=typeof globalThis<"u"?globalThis:r||self,r.UIkitUpload=i(r.UIkit.util))})(this,(function(r){"use strict";var i={props:{i18n:Object},data:{i18n:null},methods:{t(e,...t){var s,n,o;let a=0;return((o=((s=this.i18n)==null?void 0:s[e])||((n=this.$options.i18n)==null?void 0:n[e]))==null?void 0:o.replace(/%s/g,()=>t[a++]||""))||""}}},p={mixins:[i],i18n:{invalidMime:"Invalid File Type: %s",invalidName:"Invalid File Name: %s",invalidSize:"Invalid File Size: %s Kilobytes Max"},props:{allow:String,clsDragover:String,concurrent:Number,maxSize:Number,method:String,mime:String,multiple:Boolean,name:String,params:Object,type:String,url:String},data:{allow:!1,clsDragover:"uk-dragover",concurrent:1,maxSize:0,method:"POST",mime:!1,multiple:!1,name:"files[]",params:{},type:"",url:"",abort:r.noop,beforeAll:r.noop,beforeSend:r.noop,complete:r.noop,completeAll:r.noop,error:r.noop,fail:r.noop,load:r.noop,loadEnd:r.noop,loadStart:r.noop,progress:r.noop},events:{change(e){r.matches(e.target,'input[type="file"]')&&(e.preventDefault(),e.target.files&&this.upload(e.target.files),e.target.value="")},drop(e){l(e);const t=e.dataTransfer;t!=null&&t.files&&(r.removeClass(this.$el,this.clsDragover),this.upload(t.files))},dragenter(e){l(e)},dragover(e){l(e),r.addClass(this.$el,this.clsDragover)},dragleave(e){l(e),r.removeClass(this.$el,this.clsDragover)}},methods:{async upload(e){if(e=r.toArray(e),!e.length)return;this.multiple||(e=e.slice(0,1)),r.trigger(this.$el,"upload",[e]);for(const n of e){if(this.maxSize&&this.maxSize*1e3<n.size){this.fail(this.t("invalidSize",this.maxSize));return}if(this.allow&&!d(this.allow,n.name)){this.fail(this.t("invalidName",this.allow));return}if(this.mime&&!d(this.mime,n.type)){this.fail(this.t("invalidMime",this.mime));return}}this.beforeAll(this,e);const t=u(e,this.concurrent),s=async n=>{const o=new FormData;n.forEach(a=>o.append(this.name,a));for(const a in this.params)o.append(a,this.params[a]);try{const a=await g(this.url,{data:o,method:this.method,responseType:this.type,beforeSend:m=>{const{xhr:f}=m;r.on(f.upload,"progress",this.progress);for(const c of["loadStart","load","loadEnd","abort"])r.on(f,c.toLowerCase(),this[c]);return this.beforeSend(m)}});this.complete(a),t.length?await s(t.shift()):this.completeAll(a)}catch(a){a.name!=="AbortError"&&this.error(a)}};await s(t.shift())}}};function d(e,t){const s=e.replace(/\*\*|[.*+?^${}()|[\]\\]/g,n=>{var o;return(o={"**":".*","*":"[^/]+","?":"[^/]","|":"|"}[n])!=null?o:`\\${n}`});return new RegExp(`^(?:${s})$`,"i").test(t)}function u(e,t){const s=[];for(let n=0;n<e.length;n+=t)s.push(e.slice(n,n+t));return s}function l(e){e.preventDefault(),e.stopPropagation()}async function g(e,t){const s={url:e,data:null,method:"GET",headers:{},xhr:new XMLHttpRequest,beforeSend:r.noop,responseType:"",...t};if(await s.beforeSend(s)===!1)throw h(s.xhr);return v(s.url,s)}function v(e,t){return new Promise((s,n)=>{const{xhr:o}=t;for(const a in t)if(a in o)try{o[a]=t[a]}catch{}o.open(t.method.toUpperCase(),e);for(const a in t.headers)o.setRequestHeader(a,t.headers[a]);r.on(o,"load",()=>{o.status===0||o.status>=200&&o.status<300||o.status===304?s(o):n(r.assign(Error(o.statusText),{xhr:o,status:o.status}))}),r.on(o,"error",()=>n(r.assign(Error("Network Error"),{xhr:o}))),r.on(o,"timeout",()=>n(r.assign(Error("Network Timeout"),{xhr:o}))),r.on(o,"abort",()=>n(h(o))),o.send(t.data)})}function h(e){return r.assign(Error("Network Abort"),{xhr:e,name:"AbortError"})}var w="upload";return typeof window<"u"&&window.UIkit&&window.UIkit.component(w,p),p}));
1
+ /*! UIkit 3.25.29-dev.e02d266 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */(function(o,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitupload",["uikit-util"],i):(o=typeof globalThis<"u"?globalThis:o||self,o.UIkitUpload=i(o.UIkit.util))})(this,(function(o){"use strict";var i={props:{i18n:Object},data:{i18n:null},methods:{t(e,...t){var n,s,r;let a=0;return((r=((n=this.i18n)==null?void 0:n[e])||((s=this.$options.i18n)==null?void 0:s[e]))==null?void 0:r.replace(/%s/g,()=>t[a++]||""))||""}}},d={mixins:[i],i18n:{invalidMime:"Invalid File Type: %s",invalidName:"Invalid File Name: %s",invalidSize:"Invalid File Size: %s Kilobytes Max"},props:{allow:String,clsDragover:String,concurrent:Number,maxSize:Number,method:String,mime:String,multiple:Boolean,name:String,params:Object,type:String,url:String},data:{allow:!1,clsDragover:"uk-dragover",concurrent:1,maxSize:0,method:"POST",mime:!1,multiple:!1,name:"files[]",params:{},type:"",url:"",abort:o.noop,beforeAll:o.noop,beforeSend:o.noop,complete:o.noop,completeAll:o.noop,error:o.noop,fail:o.noop,load:o.noop,loadEnd:o.noop,loadStart:o.noop,progress:o.noop},events:{change(e){o.matches(e.target,'input[type="file"]')&&(e.preventDefault(),e.target.files&&this.upload(e.target.files),e.target.value="")},drop(e){l(e);const t=e.dataTransfer;t!=null&&t.files&&(o.removeClass(this.$el,this.clsDragover),this.upload(t.files))},dragenter(e){l(e)},dragover(e){l(e),o.addClass(this.$el,this.clsDragover)},dragleave(e){l(e),o.removeClass(this.$el,this.clsDragover)}},methods:{async upload(e){try{if(e=o.toArray(e),!e.length)return;this.multiple||(e=e.slice(0,1)),o.trigger(this.$el,"upload",[e]);for(const n of e){if(this.maxSize&&this.maxSize*1e3<n.size){this.fail(this.t("invalidSize",this.maxSize));return}if(this.allow&&!p(this.allow,n.name)){this.fail(this.t("invalidName",this.allow));return}if(this.mime&&!p(this.mime,n.type)){this.fail(this.t("invalidMime",this.mime));return}}await this.beforeAll(this,e);const t=this.concurrent;for(let n=0;n<e.length;n+=t){const s=new FormData;e.slice(n,n+t).forEach(a=>s.append(this.name,a));for(const a in this.params)s.append(a,this.params[a]);const r=await c(this.url,{data:s,method:this.method,responseType:this.type,beforeSend:a=>{const{xhr:m}=a;o.on(m.upload,"progress",this.progress);for(const f of["loadStart","load","loadEnd","abort"])o.on(m,f.toLowerCase(),this[f]);return this.beforeSend(a)}});this.complete(r),n+t>=e.length&&this.completeAll(r)}}catch(t){(t==null?void 0:t.name)!=="AbortError"&&this.error(t)}}}};function p(e,t){const n=e.replace(/\*\*|[.*+?^${}()|[\]\\]/g,s=>({"**":".*","*":"[^/]+","?":"[^/]","|":"|"})[s]||`\\${s}`);return new RegExp(`^(?:${n})$`,"i").test(t)}function l(e){e.preventDefault(),e.stopPropagation()}async function c(e,t){const n={url:e,data:null,method:"GET",headers:{},xhr:new XMLHttpRequest,beforeSend:o.noop,responseType:"",...t};if(await n.beforeSend(n)===!1)throw h(n.xhr);return u(n.url,n)}function u(e,t){return new Promise((n,s)=>{const{xhr:r}=t;for(const a in t)if(a in r)try{r[a]=t[a]}catch{}r.open(t.method.toUpperCase(),e);for(const a in t.headers)r.setRequestHeader(a,t.headers[a]);o.on(r,"load",()=>{r.status===0||r.status>=200&&r.status<300||r.status===304?n(r):s(o.assign(Error(r.statusText),{xhr:r,status:r.status}))}),o.on(r,"error",()=>s(o.assign(Error("Network Error"),{xhr:r}))),o.on(r,"timeout",()=>s(o.assign(Error("Network Timeout"),{xhr:r}))),o.on(r,"abort",()=>s(h(r))),r.send(t.data)})}function h(e){return o.assign(Error("Network Abort"),{xhr:e,name:"AbortError"})}var g="upload";return typeof window<"u"&&window.UIkit&&window.UIkit.component(g,d),d}));
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.25.28-dev.fcd5185 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
1
+ /*! UIkit 3.25.29-dev.e02d266 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1690,7 +1690,7 @@
1690
1690
  wrapInner: wrapInner
1691
1691
  });
1692
1692
 
1693
- var VERSION = '3.25.28-dev.fcd5185';
1693
+ var VERSION = '3.25.29-dev.e02d266';
1694
1694
 
1695
1695
  function initUpdates(instance) {
1696
1696
  instance._data = {};
@@ -2177,7 +2177,7 @@
2177
2177
  const elementComponents = /* @__PURE__ */ new WeakMap();
2178
2178
  const components$1 = {};
2179
2179
  function component(name, options) {
2180
- var _a, _b;
2180
+ var _a;
2181
2181
  const id = PREFIX + hyphenate(name);
2182
2182
  if (!options) {
2183
2183
  if (!components$1[id].options) {
@@ -2187,10 +2187,10 @@
2187
2187
  }
2188
2188
  name = camelize(name);
2189
2189
  App[name] = (element, data) => createComponent(name, element, data);
2190
- const opt = (_a = options.options) != null ? _a : { ...options };
2190
+ const opt = options.options || { ...options };
2191
2191
  opt.id = id;
2192
2192
  opt.name = name;
2193
- (_b = opt.install) == null ? void 0 : _b.call(opt, App, opt, name);
2193
+ (_a = opt.install) == null ? void 0 : _a.call(opt, App, opt, name);
2194
2194
  if (App._initialized && !opt.functional) {
2195
2195
  requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));
2196
2196
  }
@@ -3941,15 +3941,14 @@
3941
3941
  }
3942
3942
  },
3943
3943
  update() {
3944
- var _a;
3944
+ var _a, _b, _c, _d, _e, _f;
3945
3945
  const { target, input } = this;
3946
3946
  if (!target) {
3947
3947
  return;
3948
3948
  }
3949
- let option;
3950
3949
  const prop = isInput(target) ? "value" : "textContent";
3951
3950
  const prev = target[prop];
3952
- const value = ((_a = input.files) == null ? void 0 : _a[0]) ? input.files[0].name : matches(input, "select") && (option = $$("option", input).find((el) => el.selected)) ? option.textContent : input.value;
3951
+ const value = (_f = (_e = (_b = (_a = input.files) == null ? void 0 : _a[0]) == null ? void 0 : _b.name) != null ? _e : (_d = (_c = input.selectedOptions) == null ? void 0 : _c[0]) == null ? void 0 : _d.label) != null ? _f : input.value;
3953
3952
  if (prev !== value) {
3954
3953
  target[prop] = value;
3955
3954
  }
@@ -5205,13 +5204,13 @@
5205
5204
  let rejectAnimation;
5206
5205
  return new Promise(
5207
5206
  (resolve, reject) => once(el, "show hide", () => {
5208
- var _a, _b, _c;
5207
+ var _a, _b;
5209
5208
  (_a = pendingReject.get(el)) == null ? void 0 : _a();
5210
5209
  rejectAnimation = reject;
5211
5210
  pendingReject.set(el, reject);
5212
5211
  _toggle(el, show);
5213
5212
  Promise.all(
5214
- ((_c = (_b = transitionElement == null ? void 0 : transitionElement.getAnimations) == null ? void 0 : _b.call(transitionElement)) != null ? _c : []).map(({ finished }) => finished)
5213
+ (((_b = transitionElement == null ? void 0 : transitionElement.getAnimations) == null ? void 0 : _b.call(transitionElement)) || []).map(({ finished }) => finished)
5215
5214
  ).then(resolve, reject);
5216
5215
  })
5217
5216
  ).then(() => {
@@ -6384,7 +6383,7 @@
6384
6383
  const loadSVG = memoize(async (src) => {
6385
6384
  if (src) {
6386
6385
  const response = await fetch(src);
6387
- if (response.headers.get("Content-Type") === "image/svg+xml") {
6386
+ if (/^image\/svg\+xml\s*(;|$)/i.test(response.headers.get("Content-Type"))) {
6388
6387
  return response.text();
6389
6388
  }
6390
6389
  }