uikit 3.16.11 → 3.16.12-dev.eee62e629

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 (57) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/release.js +1 -1
  3. package/dist/css/uikit-core-rtl.css +1 -13
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +1 -13
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +1 -13
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +1 -13
  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 +1 -1
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +1 -1
  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 +1 -1
  36. package/dist/js/components/upload.min.js +1 -1
  37. package/dist/js/uikit-core.js +150 -134
  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 +150 -134
  42. package/dist/js/uikit.min.js +1 -1
  43. package/package.json +1 -1
  44. package/src/js/api/props.js +4 -12
  45. package/src/js/api/watch.js +3 -4
  46. package/src/js/core/icon.js +3 -5
  47. package/src/js/core/scroll.js +3 -1
  48. package/src/js/core/svg.js +58 -125
  49. package/src/js/mixin/svg.js +86 -0
  50. package/src/less/components/dropbar.less +1 -1
  51. package/src/less/components/dropdown.less +1 -1
  52. package/src/less/components/lightbox.less +0 -1
  53. package/src/less/components/navbar.less +1 -1
  54. package/src/scss/components/dropbar.scss +1 -1
  55. package/src/scss/components/dropdown.scss +1 -1
  56. package/src/scss/components/lightbox.scss +0 -1
  57. package/src/scss/components/navbar.scss +1 -1
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.16.11 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
1
+ /*! UIkit 3.16.12-dev.eee62e629 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1683,8 +1683,8 @@
1683
1683
  }
1684
1684
  function runWatches(instance, values) {
1685
1685
  for (const { name, handler, immediate = true } of instance._watches) {
1686
- if (instance._initial ? immediate : hasOwn(values, name) && !isEqual(values[name], instance[name])) {
1687
- handler.call(instance, instance[name], instance._initial ? void 0 : values[name]);
1686
+ if (instance._initial && immediate || hasOwn(values, name) && !isEqual(values[name], instance[name])) {
1687
+ handler.call(instance, instance[name], values[name]);
1688
1688
  }
1689
1689
  }
1690
1690
  instance._initial = false;
@@ -2047,11 +2047,11 @@
2047
2047
  }
2048
2048
  function initPropsObserver(instance) {
2049
2049
  const { $options, $props } = instance;
2050
- const { id, attrs, props, el } = $options;
2051
- if (!props || attrs === false) {
2050
+ const { id, props, el } = $options;
2051
+ if (!props) {
2052
2052
  return;
2053
2053
  }
2054
- const attributes = isArray(attrs) ? attrs : Object.keys(props);
2054
+ const attributes = Object.keys(props);
2055
2055
  const filter = attributes.map((key) => hyphenate(key)).concat(id);
2056
2056
  const observer = new MutationObserver((records) => {
2057
2057
  const data = getProps($options);
@@ -2158,7 +2158,7 @@
2158
2158
  };
2159
2159
  App.util = util;
2160
2160
  App.options = {};
2161
- App.version = "3.16.11";
2161
+ App.version = "3.16.12-dev.eee62e629";
2162
2162
 
2163
2163
  const PREFIX = "uk-";
2164
2164
  const DATA = "__uikit__";
@@ -4224,72 +4224,28 @@
4224
4224
  }
4225
4225
  };
4226
4226
 
4227
- function getMaxPathLength(el) {
4228
- return Math.ceil(
4229
- Math.max(
4230
- 0,
4231
- ...$$("[stroke]", el).map((stroke) => {
4232
- try {
4233
- return stroke.getTotalLength();
4234
- } catch (e) {
4235
- return 0;
4236
- }
4237
- })
4238
- )
4239
- );
4240
- }
4241
-
4242
- var SVG = {
4227
+ var Svg = {
4243
4228
  args: "src",
4244
4229
  props: {
4245
- id: Boolean,
4246
- icon: String,
4247
- src: String,
4248
- style: String,
4249
4230
  width: Number,
4250
4231
  height: Number,
4251
- ratio: Number,
4252
- class: String,
4253
- strokeAnimation: Boolean,
4254
- attributes: "list"
4232
+ ratio: Number
4255
4233
  },
4256
4234
  data: {
4257
- ratio: 1,
4258
- include: ["style", "class"],
4259
- class: "",
4260
- strokeAnimation: false
4261
- },
4262
- beforeConnect() {
4263
- this.class += " uk-svg";
4235
+ ratio: 1
4264
4236
  },
4265
4237
  connected() {
4266
- if (!this.icon && includes(this.src, "#")) {
4267
- [this.src, this.icon] = this.src.split("#");
4268
- }
4269
4238
  this.svg = this.getSvg().then((el) => {
4270
- if (this._connected) {
4271
- const svg = insertSVG(el, this.$el);
4272
- if (this.svgEl && svg !== this.svgEl) {
4273
- remove$1(this.svgEl);
4274
- }
4275
- this.applyAttributes(svg, el);
4276
- return this.svgEl = svg;
4239
+ if (!this._connected) {
4240
+ return;
4241
+ }
4242
+ const svg = insertSVG(el, this.$el);
4243
+ if (this.svgEl && svg !== this.svgEl) {
4244
+ remove$1(this.svgEl);
4277
4245
  }
4246
+ applyWidthAndHeight.call(this, svg, el);
4247
+ return this.svgEl = svg;
4278
4248
  }, noop);
4279
- if (this.strokeAnimation) {
4280
- this.svg.then((el) => {
4281
- if (this._connected && el) {
4282
- applyAnimation(el);
4283
- registerObserver(
4284
- this,
4285
- observeIntersection(el, (records, observer) => {
4286
- applyAnimation(el);
4287
- observer.disconnect();
4288
- })
4289
- );
4290
- }
4291
- });
4292
- }
4293
4249
  },
4294
4250
  disconnected() {
4295
4251
  this.svg.then((svg) => {
@@ -4306,76 +4262,9 @@
4306
4262
  },
4307
4263
  methods: {
4308
4264
  async getSvg() {
4309
- if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
4310
- return new Promise(
4311
- (resolve) => once(this.$el, "load", () => resolve(this.getSvg()))
4312
- );
4313
- }
4314
- return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
4315
- },
4316
- applyAttributes(el, ref) {
4317
- for (const prop in this.$options.props) {
4318
- if (includes(this.include, prop) && prop in this) {
4319
- attr(el, prop, this[prop]);
4320
- }
4321
- }
4322
- for (const attribute in this.attributes) {
4323
- const [prop, value] = this.attributes[attribute].split(":", 2);
4324
- attr(el, prop, value);
4325
- }
4326
- if (!this.id) {
4327
- removeAttr(el, "id");
4328
- }
4329
- const props = ["width", "height"];
4330
- let dimensions = props.map((prop) => this[prop]);
4331
- if (!dimensions.some((val) => val)) {
4332
- dimensions = props.map((prop) => attr(ref, prop));
4333
- }
4334
- const viewBox = attr(ref, "viewBox");
4335
- if (viewBox && !dimensions.some((val) => val)) {
4336
- dimensions = viewBox.split(" ").slice(2);
4337
- }
4338
- dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
4339
4265
  }
4340
4266
  }
4341
4267
  };
4342
- const loadSVG = memoize(async (src) => {
4343
- if (src) {
4344
- if (startsWith(src, "data:")) {
4345
- return decodeURIComponent(src.split(",")[1]);
4346
- } else {
4347
- return (await fetch(src)).text();
4348
- }
4349
- } else {
4350
- return Promise.reject();
4351
- }
4352
- });
4353
- function parseSVG(svg, icon) {
4354
- if (icon && includes(svg, "<symbol")) {
4355
- svg = parseSymbols(svg, icon) || svg;
4356
- }
4357
- svg = $(svg.substr(svg.indexOf("<svg")));
4358
- return (svg == null ? void 0 : svg.hasChildNodes()) && svg;
4359
- }
4360
- const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
4361
- const symbols = {};
4362
- function parseSymbols(svg, icon) {
4363
- if (!symbols[svg]) {
4364
- symbols[svg] = {};
4365
- symbolRe.lastIndex = 0;
4366
- let match;
4367
- while (match = symbolRe.exec(svg)) {
4368
- symbols[svg][match[3]] = `<svg xmlns="http://www.w3.org/2000/svg"${match[1]}svg>`;
4369
- }
4370
- }
4371
- return symbols[svg][icon];
4372
- }
4373
- function applyAnimation(el) {
4374
- const length = getMaxPathLength(el);
4375
- if (length) {
4376
- el.style.setProperty("--uk-animation-stroke", length);
4377
- }
4378
- }
4379
4268
  function insertSVG(el, root) {
4380
4269
  if (isVoidElement(root) || isTag(root, "canvas")) {
4381
4270
  root.hidden = true;
@@ -4388,6 +4277,18 @@
4388
4277
  function equals(el, other) {
4389
4278
  return isTag(el, "svg") && isTag(other, "svg") && el.innerHTML === other.innerHTML;
4390
4279
  }
4280
+ function applyWidthAndHeight(el, ref) {
4281
+ const props = ["width", "height"];
4282
+ let dimensions = props.map((prop) => this[prop]);
4283
+ if (!dimensions.some((val) => val)) {
4284
+ dimensions = props.map((prop) => attr(ref, prop));
4285
+ }
4286
+ const viewBox = attr(ref, "viewBox");
4287
+ if (viewBox && !dimensions.some((val) => val)) {
4288
+ dimensions = viewBox.split(" ").slice(2);
4289
+ }
4290
+ dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
4291
+ }
4391
4292
 
4392
4293
  var I18n = {
4393
4294
  props: {
@@ -4472,10 +4373,9 @@
4472
4373
  };
4473
4374
  const Icon = {
4474
4375
  install: install$1,
4475
- extends: SVG,
4376
+ mixins: [Svg],
4476
4377
  args: "icon",
4477
- props: ["icon"],
4478
- data: { include: [] },
4378
+ props: { icon: String },
4479
4379
  isIcon: true,
4480
4380
  beforeConnect() {
4481
4381
  addClass(this.$el, "uk-icon");
@@ -5406,7 +5306,9 @@
5406
5306
  for (const instance of instances) {
5407
5307
  if (within(e.target, instance.$el) && isSameSiteAnchor(instance.$el)) {
5408
5308
  e.preventDefault();
5409
- window.history.pushState({}, "", instance.$el.href);
5309
+ if (window.location.href !== instance.$el.href) {
5310
+ window.history.pushState({}, "", instance.$el.href);
5311
+ }
5410
5312
  instance.scrollTo(getTargetedElement(instance.$el));
5411
5313
  }
5412
5314
  }
@@ -5947,6 +5849,120 @@
5947
5849
  requestAnimationFrame(() => css(el, "transition", ""));
5948
5850
  }
5949
5851
 
5852
+ function getMaxPathLength(el) {
5853
+ return Math.ceil(
5854
+ Math.max(
5855
+ 0,
5856
+ ...$$("[stroke]", el).map((stroke) => {
5857
+ try {
5858
+ return stroke.getTotalLength();
5859
+ } catch (e) {
5860
+ return 0;
5861
+ }
5862
+ })
5863
+ )
5864
+ );
5865
+ }
5866
+
5867
+ var svg = {
5868
+ mixins: [Class, Svg],
5869
+ args: "src",
5870
+ props: {
5871
+ src: String,
5872
+ icon: String,
5873
+ attributes: "list",
5874
+ strokeAnimation: Boolean
5875
+ },
5876
+ data: {
5877
+ strokeAnimation: false
5878
+ },
5879
+ observe: [
5880
+ mutation({
5881
+ async handler() {
5882
+ const svg = await this.svg;
5883
+ if (svg) {
5884
+ applyAttributes.call(this, svg);
5885
+ }
5886
+ },
5887
+ options: {
5888
+ attributes: true,
5889
+ attributeFilter: ["id", "class", "style"]
5890
+ }
5891
+ })
5892
+ ],
5893
+ async connected() {
5894
+ if (includes(this.src, "#")) {
5895
+ [this.src, this.icon] = this.src.split("#");
5896
+ }
5897
+ const svg = await this.svg;
5898
+ if (svg) {
5899
+ applyAttributes.call(this, svg);
5900
+ if (this.strokeAnimation) {
5901
+ applyAnimation(svg);
5902
+ }
5903
+ }
5904
+ },
5905
+ methods: {
5906
+ async getSvg() {
5907
+ if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
5908
+ return new Promise(
5909
+ (resolve) => once(this.$el, "load", () => resolve(this.getSvg()))
5910
+ );
5911
+ }
5912
+ return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
5913
+ }
5914
+ }
5915
+ };
5916
+ function applyAttributes(el) {
5917
+ const { $el } = this;
5918
+ addClass(el, attr($el, "class"));
5919
+ for (let i = 0; i < $el.style.length; i++) {
5920
+ const prop = $el.style[i];
5921
+ css(el, prop, css($el, prop));
5922
+ }
5923
+ for (const attribute in this.attributes) {
5924
+ const [prop, value] = this.attributes[attribute].split(":", 2);
5925
+ attr(el, prop, value);
5926
+ }
5927
+ if (!this.$el.id) {
5928
+ removeAttr(el, "id");
5929
+ }
5930
+ }
5931
+ const loadSVG = memoize(async (src) => {
5932
+ if (src) {
5933
+ if (startsWith(src, "data:")) {
5934
+ return decodeURIComponent(src.split(",")[1]);
5935
+ } else {
5936
+ return (await fetch(src)).text();
5937
+ }
5938
+ } else {
5939
+ return Promise.reject();
5940
+ }
5941
+ });
5942
+ function parseSVG(svg, icon) {
5943
+ if (icon && includes(svg, "<symbol")) {
5944
+ svg = parseSymbols(svg)[icon] || svg;
5945
+ }
5946
+ svg = $(svg.substr(svg.indexOf("<svg")));
5947
+ return (svg == null ? void 0 : svg.hasChildNodes()) && svg;
5948
+ }
5949
+ const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
5950
+ const parseSymbols = memoize(function(svg) {
5951
+ const symbols = {};
5952
+ symbolRe.lastIndex = 0;
5953
+ let match;
5954
+ while (match = symbolRe.exec(svg)) {
5955
+ symbols[match[3]] = `<svg xmlns="http://www.w3.org/2000/svg"${match[1]}svg>`;
5956
+ }
5957
+ return symbols;
5958
+ });
5959
+ function applyAnimation(el) {
5960
+ const length = getMaxPathLength(el);
5961
+ if (length) {
5962
+ css(el, "--uk-animation-stroke", length);
5963
+ }
5964
+ }
5965
+
5950
5966
  const selDisabled = ".uk-disabled *, .uk-disabled, [disabled]";
5951
5967
  var Switcher = {
5952
5968
  mixins: [Togglable],
@@ -6335,7 +6351,7 @@
6335
6351
  SlidenavPrevious: Slidenav,
6336
6352
  Spinner: Spinner,
6337
6353
  Sticky: sticky,
6338
- Svg: SVG,
6354
+ Svg: svg,
6339
6355
  Switcher: Switcher,
6340
6356
  Tab: tab,
6341
6357
  Toggle: toggle,