@yuneta/gobj-js 7.16.4 → 7.16.6

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.
@@ -2275,22 +2275,28 @@ function Ul(e) {
2275
2275
  return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
2276
2276
  }
2277
2277
  function Fl(e, t) {
2278
- vr(t) ? (e || (e = document), e.querySelectorAll("[data-i18n]").forEach(function(e) {
2278
+ if (!vr(t)) return void xn("You must supply a translation function");
2279
+ e || (e = document);
2280
+ const n = (t) => {
2281
+ let n = [];
2282
+ return "function" == typeof e.matches && e.matches(t) && n.push(e), n.push(...e.querySelectorAll(t)), n;
2283
+ };
2284
+ n("[data-i18n]").forEach(function(e) {
2279
2285
  let n = e.getAttribute("data-i18n");
2280
2286
  for (let r of e.childNodes) if (r.nodeType === Node.TEXT_NODE) {
2281
2287
  n || (n = r.nodeValue), r.nodeValue = t(n);
2282
2288
  break;
2283
2289
  }
2284
- }), e.querySelectorAll("[data-i18n-title]").forEach(function(e) {
2290
+ }), n("[data-i18n-title]").forEach(function(e) {
2285
2291
  let n = e.getAttribute("data-i18n-title");
2286
2292
  n && e.setAttribute("title", t(n));
2287
- }), e.querySelectorAll("[data-i18n-aria-label]").forEach(function(e) {
2293
+ }), n("[data-i18n-aria-label]").forEach(function(e) {
2288
2294
  let n = e.getAttribute("data-i18n-aria-label");
2289
2295
  n && e.setAttribute("aria-label", t(n));
2290
- }), e.querySelectorAll("[data-i18n-placeholder]").forEach(function(e) {
2296
+ }), n("[data-i18n-placeholder]").forEach(function(e) {
2291
2297
  let n = e.getAttribute("data-i18n-placeholder");
2292
2298
  n && e.setAttribute("placeholder", t(n));
2293
- })) : xn("You must supply a translation function");
2299
+ });
2294
2300
  }
2295
2301
  function Gl(e = "Time Tracker", t = !1) {
2296
2302
  const n = e, r = performance.now();
@@ -2616,7 +2622,8 @@ function mo(e) {
2616
2622
  default_value: e.default,
2617
2623
  placeholder: e.placeholder,
2618
2624
  fillspace: e.fillspace || 4,
2619
- fkey: e.fkey || null
2625
+ fkey: e.fkey || null,
2626
+ is_file: !1
2620
2627
  };
2621
2628
  if (!e.flag) return t;
2622
2629
  for (let n = 0; n < e.flag.length; n++) {
@@ -2629,7 +2636,10 @@ function mo(e) {
2629
2636
  case "template":
2630
2637
  t.enum_list = e.template;
2631
2638
  break;
2632
- case "table": t.enum_list = e.table;
2639
+ case "table":
2640
+ t.enum_list = e.table;
2641
+ break;
2642
+ case "file": t.is_file = !0;
2633
2643
  }
2634
2644
  t.type = r;
2635
2645
  } else if (_l(bo, r)) switch (r) {
@@ -2643,7 +2653,7 @@ function mo(e) {
2643
2653
  case "hidden": t.is_hidden = !0;
2644
2654
  }
2645
2655
  }
2646
- return t;
2656
+ return t.is_file && (t.type = "file"), t;
2647
2657
  }
2648
2658
  function Eo(e, t) {
2649
2659
  let n = {