uikit 3.19.4 → 3.19.5-dev.21fa5c45d
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.
- package/CHANGELOG.md +10 -0
- package/dist/css/uikit-core-rtl.css +1 -1
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +1 -1
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +1 -1
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +1 -1
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +1 -1
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +7 -8
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +1 -1
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1 -1
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +1 -1
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +58 -44
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +58 -44
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +59 -45
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +58 -44
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +58 -44
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +3 -3
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +1 -1
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +103 -65
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +107 -70
- package/dist/js/uikit.min.js +1 -1
- package/eslint.config.js +8 -5
- package/package.json +3 -4
- package/src/js/api/observer.js +17 -5
- package/src/js/components/filter.js +4 -5
- package/src/js/core/drop.js +0 -6
- package/src/js/core/img.js +1 -1
- package/src/js/core/inverse.js +18 -5
- package/src/js/core/margin.js +1 -1
- package/src/js/core/switcher.js +6 -1
- package/src/js/core/toggle.js +1 -1
- package/src/js/util/selector.js +61 -37
- package/src/js/util/svg.js +1 -12
- package/tests/modal.html +2 -2
- package/build/package.json +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.19.
|
|
1
|
+
/*! UIkit 3.19.5-dev.21fa5c45d | https://www.getuikit.com | (c) 2014 - 2024 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,...r){var a,s,t;let n=0;return((t=((a=this.i18n)==null?void 0:a[e])||((s=this.$options.i18n)==null?void 0:s[e]))==null?void 0:t.replace(/%s/g,()=>r[n++]||""))||""}}},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 r=e.dataTransfer;r!=null&&r.files&&(o.removeClass(this.$el,this.clsDragover),this.upload(r.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){if(e=o.toArray(e),!e.length)return;o.trigger(this.$el,"upload",[e]);for(const s of e){if(this.maxSize&&this.maxSize*1e3<s.size){this.fail(this.t("invalidSize",this.maxSize));return}if(this.allow&&!h(this.allow,s.name)){this.fail(this.t("invalidName",this.allow));return}if(this.mime&&!h(this.mime,s.type)){this.fail(this.t("invalidMime",this.mime));return}}this.multiple||(e=e.slice(0,1)),this.beforeAll(this,e);const r=f(e,this.concurrent),a=async s=>{const t=new FormData;s.forEach(n=>t.append(this.name,n));for(const n in this.params)t.append(n,this.params[n]);try{const n=await u(this.url,{data:t,method:this.method,responseType:this.type,beforeSend:p=>{const{xhr:m}=p;o.on(m.upload,"progress",this.progress);for(const c of["loadStart","load","loadEnd","abort"])o.on(m,c.toLowerCase(),this[c]);return this.beforeSend(p)}});this.complete(n),r.length?await a(r.shift()):this.completeAll(n)}catch(n){this.error(n)}};await a(r.shift())}}};function h(e,r){return r.match(new RegExp(`^${e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")}$`,"i"))}function f(e,r){const a=[];for(let s=0;s<e.length;s+=r)a.push(e.slice(s,s+r));return a}function l(e){e.preventDefault(),e.stopPropagation()}function u(e,r){const a={data:null,method:"GET",headers:{},xhr:new XMLHttpRequest,beforeSend:o.noop,responseType:"",...r};return Promise.resolve().then(()=>a.beforeSend(a)).then(()=>g(e,a))}function g(e,r){return new Promise((a,s)=>{const{xhr:t}=r;for(const n in r)if(n in t)try{t[n]=r[n]}catch{}t.open(r.method.toUpperCase(),e);for(const n in r.headers)t.setRequestHeader(n,r.headers[n]);o.on(t,"load",()=>{t.status===0||t.status>=200&&t.status<300||t.status===304?a(t):s(o.assign(Error(t.statusText),{xhr:t,status:t.status}))}),o.on(t,"error",()=>s(o.assign(Error("Network Error"),{xhr:t}))),o.on(t,"timeout",()=>s(o.assign(Error("Network Timeout"),{xhr:t}))),t.send(r.data)})}return typeof window<"u"&&window.UIkit&&window.UIkit.component("upload",d),d});
|
package/dist/js/uikit-core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.19.
|
|
1
|
+
/*! UIkit 3.19.5-dev.21fa5c45d | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -367,55 +367,77 @@
|
|
|
367
367
|
function findAll(selector, context) {
|
|
368
368
|
return toNodes(_query(selector, toNode(context), "querySelectorAll"));
|
|
369
369
|
}
|
|
370
|
-
const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
|
|
371
|
-
const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
|
|
372
370
|
function getContext(selector, context = document) {
|
|
373
|
-
return isString(selector) &&
|
|
374
|
-
}
|
|
375
|
-
const
|
|
376
|
-
const
|
|
371
|
+
return isString(selector) && parseSelector(selector).isContextSelector || isDocument(context) ? context : context.ownerDocument;
|
|
372
|
+
}
|
|
373
|
+
const addStarRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
|
|
374
|
+
const splitSelectorRe = /.*?[^\\](?![^(]*\))(?:,|$)/g;
|
|
375
|
+
const trailingCommaRe = /\s*,$/;
|
|
376
|
+
const parseSelector = memoize((selector) => {
|
|
377
|
+
selector = selector.replace(addStarRe, "$1 *");
|
|
378
|
+
let isContextSelector = false;
|
|
379
|
+
const selectors = [];
|
|
380
|
+
for (let sel of selector.match(splitSelectorRe)) {
|
|
381
|
+
sel = sel.replace(trailingCommaRe, "").trim();
|
|
382
|
+
if (sel[0] === ">") {
|
|
383
|
+
sel = `:scope ${sel}`;
|
|
384
|
+
}
|
|
385
|
+
isContextSelector || (isContextSelector = ["!", "+", "~", "-"].includes(sel[0]));
|
|
386
|
+
selectors.push(sel);
|
|
387
|
+
}
|
|
388
|
+
return {
|
|
389
|
+
selector: selectors.join(","),
|
|
390
|
+
selectors,
|
|
391
|
+
isContextSelector
|
|
392
|
+
};
|
|
393
|
+
});
|
|
377
394
|
function _query(selector, context = document, queryFn) {
|
|
378
395
|
if (!selector || !isString(selector)) {
|
|
379
396
|
return selector;
|
|
380
397
|
}
|
|
381
|
-
|
|
382
|
-
if (isContextSelector
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
if (sel[0] === "-") {
|
|
396
|
-
const selectors = sel.substr(1).trim().split(" ");
|
|
397
|
-
const prev = (ctx || context).previousElementSibling;
|
|
398
|
-
ctx = matches(prev, sel.substr(1)) ? prev : null;
|
|
399
|
-
sel = selectors.slice(1).join(" ");
|
|
398
|
+
const parsed = parseSelector(selector);
|
|
399
|
+
if (!parsed.isContextSelector) {
|
|
400
|
+
return _doQuery(context, queryFn, parsed.selector);
|
|
401
|
+
}
|
|
402
|
+
selector = "";
|
|
403
|
+
const isSingle = parsed.selectors.length === 1;
|
|
404
|
+
for (let sel of parsed.selectors) {
|
|
405
|
+
let ctx = context;
|
|
406
|
+
if (sel[0] === "!") {
|
|
407
|
+
const selectors = sel.substr(1).trim().split(" ");
|
|
408
|
+
ctx = parent(context).closest(selectors[0]);
|
|
409
|
+
sel = selectors.slice(1).join(" ").trim();
|
|
410
|
+
if (!sel.length && isSingle) {
|
|
411
|
+
return ctx;
|
|
400
412
|
}
|
|
401
|
-
|
|
402
|
-
|
|
413
|
+
}
|
|
414
|
+
if (sel[0] === "-") {
|
|
415
|
+
const selectors = sel.substr(1).trim().split(" ");
|
|
416
|
+
const prev = (ctx || context).previousElementSibling;
|
|
417
|
+
ctx = matches(prev, sel.substr(1)) ? prev : null;
|
|
418
|
+
sel = selectors.slice(1).join(" ");
|
|
419
|
+
if (!sel.length && isSingle) {
|
|
420
|
+
return ctx;
|
|
403
421
|
}
|
|
422
|
+
} else if (sel[0] === "~" || sel[0] === "+" && isSingle) {
|
|
423
|
+
return _doQuery(parent(ctx), queryFn, `:scope :nth-child(${index(ctx) + 1}) ${sel}`);
|
|
404
424
|
}
|
|
405
|
-
if (
|
|
406
|
-
|
|
425
|
+
if (ctx) {
|
|
426
|
+
selector += `${selector ? "," : ""}${domPath(ctx)} ${sel}`;
|
|
407
427
|
}
|
|
408
428
|
}
|
|
429
|
+
if (!isDocument(context)) {
|
|
430
|
+
context = context.ownerDocument;
|
|
431
|
+
}
|
|
432
|
+
return _doQuery(context, queryFn, selector);
|
|
433
|
+
}
|
|
434
|
+
function _doQuery(context, queryFn, selector) {
|
|
409
435
|
try {
|
|
410
436
|
return context[queryFn](selector);
|
|
411
437
|
} catch (e) {
|
|
412
438
|
return null;
|
|
413
439
|
}
|
|
414
440
|
}
|
|
415
|
-
const selectorRe = /.*?[^\\](?![^(]*\))(?:,|$)/g;
|
|
416
|
-
const splitSelector = memoize(
|
|
417
|
-
(selector) => selector.match(selectorRe).map((selector2) => selector2.replace(/,$/, "").trim())
|
|
418
|
-
);
|
|
419
441
|
function domPath(element) {
|
|
420
442
|
const names = [];
|
|
421
443
|
while (element.parentNode) {
|
|
@@ -1875,18 +1897,30 @@
|
|
|
1875
1897
|
}
|
|
1876
1898
|
const targets = hasOwn(instance, key) ? instance[key] : target;
|
|
1877
1899
|
const observer = observe(targets, handler, options, args);
|
|
1878
|
-
if (isFunction(target) && isArray(instance[key])
|
|
1879
|
-
registerWatch(
|
|
1900
|
+
if (isFunction(target) && isArray(instance[key])) {
|
|
1901
|
+
registerWatch(
|
|
1902
|
+
instance,
|
|
1903
|
+
{ handler: updateTargets(observer, options), immediate: false },
|
|
1904
|
+
key
|
|
1905
|
+
);
|
|
1880
1906
|
}
|
|
1881
1907
|
registerObserver(instance, observer);
|
|
1882
1908
|
}
|
|
1883
|
-
function updateTargets(observer) {
|
|
1909
|
+
function updateTargets(observer, options) {
|
|
1884
1910
|
return (targets, prev) => {
|
|
1885
1911
|
for (const target of prev) {
|
|
1886
|
-
!includes(targets, target)
|
|
1912
|
+
if (!includes(targets, target)) {
|
|
1913
|
+
if (observer.unobserve) {
|
|
1914
|
+
observer.unobserve(target);
|
|
1915
|
+
} else {
|
|
1916
|
+
observer.disconnect();
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1887
1919
|
}
|
|
1888
1920
|
for (const target of targets) {
|
|
1889
|
-
!includes(prev, target)
|
|
1921
|
+
if (!includes(prev, target) || !observer.unobserve) {
|
|
1922
|
+
observer.observe(target, options);
|
|
1923
|
+
}
|
|
1890
1924
|
}
|
|
1891
1925
|
};
|
|
1892
1926
|
}
|
|
@@ -2153,7 +2187,7 @@
|
|
|
2153
2187
|
};
|
|
2154
2188
|
App.util = util;
|
|
2155
2189
|
App.options = {};
|
|
2156
|
-
App.version = "3.19.
|
|
2190
|
+
App.version = "3.19.5-dev.21fa5c45d";
|
|
2157
2191
|
|
|
2158
2192
|
const PREFIX = "uk-";
|
|
2159
2193
|
const DATA = "__uikit__";
|
|
@@ -3253,10 +3287,6 @@
|
|
|
3253
3287
|
}
|
|
3254
3288
|
css(this.$el, this._style);
|
|
3255
3289
|
},
|
|
3256
|
-
observe: lazyload({
|
|
3257
|
-
target: ({ toggle, $el }) => query(toggle, $el),
|
|
3258
|
-
targets: ({ $el }) => $el
|
|
3259
|
-
}),
|
|
3260
3290
|
events: [
|
|
3261
3291
|
{
|
|
3262
3292
|
name: "click",
|
|
@@ -3945,10 +3975,10 @@
|
|
|
3945
3975
|
observe: [
|
|
3946
3976
|
mutation({
|
|
3947
3977
|
options: {
|
|
3948
|
-
childList: true,
|
|
3949
3978
|
attributes: true,
|
|
3950
3979
|
attributeFilter: ["style"]
|
|
3951
|
-
}
|
|
3980
|
+
},
|
|
3981
|
+
target: ({ $el }) => [$el, ...children($el)]
|
|
3952
3982
|
}),
|
|
3953
3983
|
resize({
|
|
3954
3984
|
target: ({ $el }) => [$el, ...children($el)]
|
|
@@ -4667,13 +4697,13 @@
|
|
|
4667
4697
|
delete this.img;
|
|
4668
4698
|
},
|
|
4669
4699
|
observe: intersection({
|
|
4670
|
-
target: ({ $el, $props }) => [$el, ...queryAll($props.target, $el)],
|
|
4671
4700
|
handler(entries, observer) {
|
|
4672
4701
|
this.load();
|
|
4673
4702
|
observer.disconnect();
|
|
4674
4703
|
},
|
|
4675
4704
|
options: ({ margin }) => ({ rootMargin: margin }),
|
|
4676
|
-
filter: ({ loading }) => loading === "lazy"
|
|
4705
|
+
filter: ({ loading }) => loading === "lazy",
|
|
4706
|
+
target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el
|
|
4677
4707
|
}),
|
|
4678
4708
|
methods: {
|
|
4679
4709
|
load() {
|
|
@@ -4763,9 +4793,15 @@
|
|
|
4763
4793
|
selActive: false
|
|
4764
4794
|
},
|
|
4765
4795
|
computed: {
|
|
4766
|
-
target: ({ target }, $el) => target ? $$(target, $el) :
|
|
4796
|
+
target: ({ target }, $el) => target ? $$(target, $el) : $el
|
|
4767
4797
|
},
|
|
4768
4798
|
observe: [
|
|
4799
|
+
intersection({
|
|
4800
|
+
handler([{ isIntersecting }]) {
|
|
4801
|
+
this.isIntersecting = isIntersecting;
|
|
4802
|
+
},
|
|
4803
|
+
args: { intersecting: false }
|
|
4804
|
+
}),
|
|
4769
4805
|
mutation({
|
|
4770
4806
|
target: ({ target }) => target,
|
|
4771
4807
|
options: { attributes: true, attributeFilter: ["class"], attributeOldValue: true }
|
|
@@ -4773,7 +4809,10 @@
|
|
|
4773
4809
|
{
|
|
4774
4810
|
target: ({ target }) => target,
|
|
4775
4811
|
observe: (target, handler) => {
|
|
4776
|
-
const observer = observeResize(
|
|
4812
|
+
const observer = observeResize(
|
|
4813
|
+
[...toNodes(target), document.documentElement],
|
|
4814
|
+
handler
|
|
4815
|
+
);
|
|
4777
4816
|
const listener = [
|
|
4778
4817
|
on(document, "scroll itemshown itemhidden", handler, {
|
|
4779
4818
|
passive: true,
|
|
@@ -4802,7 +4841,10 @@
|
|
|
4802
4841
|
],
|
|
4803
4842
|
update: {
|
|
4804
4843
|
read() {
|
|
4805
|
-
|
|
4844
|
+
if (!this.isIntersecting) {
|
|
4845
|
+
return false;
|
|
4846
|
+
}
|
|
4847
|
+
for (const target of toNodes(this.target)) {
|
|
4806
4848
|
replaceClass(
|
|
4807
4849
|
target,
|
|
4808
4850
|
"uk-light,uk-dark",
|
|
@@ -6084,18 +6126,10 @@
|
|
|
6084
6126
|
}
|
|
6085
6127
|
|
|
6086
6128
|
function getMaxPathLength(el) {
|
|
6087
|
-
return Math.ceil(
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
try {
|
|
6092
|
-
return stroke.getTotalLength();
|
|
6093
|
-
} catch (e) {
|
|
6094
|
-
return 0;
|
|
6095
|
-
}
|
|
6096
|
-
})
|
|
6097
|
-
)
|
|
6098
|
-
);
|
|
6129
|
+
return Math.ceil(Math.max(0, ...$$("[stroke]", el).map((stroke) => {
|
|
6130
|
+
var _a;
|
|
6131
|
+
return (_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke);
|
|
6132
|
+
})));
|
|
6099
6133
|
}
|
|
6100
6134
|
|
|
6101
6135
|
var svg = {
|
|
@@ -6320,7 +6354,11 @@
|
|
|
6320
6354
|
],
|
|
6321
6355
|
update() {
|
|
6322
6356
|
var _a;
|
|
6323
|
-
|
|
6357
|
+
for (const el of this.connects) {
|
|
6358
|
+
if (isTag(el, "ul")) {
|
|
6359
|
+
attr(el, "role", "presentation");
|
|
6360
|
+
}
|
|
6361
|
+
}
|
|
6324
6362
|
attr(children(this.$el), "role", "presentation");
|
|
6325
6363
|
for (const index in this.toggles) {
|
|
6326
6364
|
const toggle = this.toggles[index];
|
|
@@ -6419,7 +6457,7 @@
|
|
|
6419
6457
|
}
|
|
6420
6458
|
}
|
|
6421
6459
|
},
|
|
6422
|
-
observe: lazyload({
|
|
6460
|
+
observe: lazyload({ targets: ({ target }) => target }),
|
|
6423
6461
|
events: [
|
|
6424
6462
|
{
|
|
6425
6463
|
name: pointerDown,
|