@fewangsit/wangsvue-fats 1.0.1-alpha.62 → 1.0.1-alpha.64

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.
@@ -1,11 +1,11 @@
1
- var b = Object.defineProperty;
2
- var f = (d, i, e) => i in d ? b(d, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[i] = e;
3
- var a = (d, i, e) => f(d, typeof i != "symbol" ? i + "" : i, e);
4
- import { p, H as g, c as h, h as l, a as v } from "./p-DTTCzifR.es.js";
1
+ var f = Object.defineProperty;
2
+ var b = (c, i, e) => i in c ? f(c, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[i] = e;
3
+ var a = (c, i, e) => b(c, typeof i != "symbol" ? i + "" : i, e);
4
+ import { p, H as v, c as h, h as l, a as g } from "./p-DTTCzifR.es.js";
5
5
  import { B as x } from "./p-C5lMEBcj.es.js";
6
6
  import { r as u } from "./p-Duri5p90.es.js";
7
- import { d as I } from "./p-CKYwZoTo.es.js";
8
- const m = /* @__PURE__ */ p(class extends g {
7
+ import { d as I } from "./p-C0QfdhKo.es.js";
8
+ const A = /* @__PURE__ */ p(class extends v {
9
9
  constructor() {
10
10
  super();
11
11
  a(this, "base");
@@ -36,6 +36,9 @@ const m = /* @__PURE__ */ p(class extends g {
36
36
  componentDidRender() {
37
37
  this.updateInkBar();
38
38
  }
39
+ function(e) {
40
+ this.currentActiveIndex = e;
41
+ }
39
42
  onUpdateActiveIndex(e) {
40
43
  this.updateActiveIndex.emit(e);
41
44
  }
@@ -66,8 +69,8 @@ const m = /* @__PURE__ */ p(class extends g {
66
69
  for (let s = 0; s < e.length; s++) {
67
70
  const r = e[s];
68
71
  if (r.dataset.pHighlight === "true") {
69
- const c = r.getBoundingClientRect(), o = this.navRef.getBoundingClientRect();
70
- this.inkbarRef.style.width = `${c.width}px`, this.inkbarRef.style.left = `${c.left - o.left}px`, t = !0;
72
+ const d = r.getBoundingClientRect(), o = this.navRef.getBoundingClientRect();
73
+ this.inkbarRef.style.width = `${d.width}px`, this.inkbarRef.style.left = `${d.left - o.left}px`, t = !0;
71
74
  break;
72
75
  }
73
76
  }
@@ -75,8 +78,8 @@ const m = /* @__PURE__ */ p(class extends g {
75
78
  }
76
79
  setActiveIndex() {
77
80
  const e = window.location.pathname, t = (s) => {
78
- var c;
79
- let r = (c = this.model) == null ? void 0 : c.findIndex((o) => o.route && s === o.route);
81
+ var d;
82
+ let r = (d = this.model) == null ? void 0 : d.findIndex((o) => o.route && s === o.route);
80
83
  if (r === -1 && s.includes("/")) {
81
84
  const o = s.substring(0, s.lastIndexOf("/"));
82
85
  r = t(o);
@@ -86,23 +89,24 @@ const m = /* @__PURE__ */ p(class extends g {
86
89
  this.currentActiveIndex = n === -1 ? this.currentActiveIndex : n;
87
90
  }
88
91
  getPtmo(e, t) {
89
- const { activeIndex: n, model: s, type: r, useTrailingLine: c } = this, o = {
92
+ const { activeIndex: n, model: s, type: r, useTrailingLine: d } = this, o = {
90
93
  item: e,
91
94
  index: t,
92
95
  active: t != null && this.currentActiveIndex === t,
93
96
  disabled: e != null && this.disabled(e)
94
97
  };
95
98
  return {
96
- props: { activeIndex: n, model: s, type: r, useTrailingLine: c },
99
+ props: { activeIndex: n, model: s, type: r, useTrailingLine: d },
97
100
  state: { currentActiveIndex: this.currentActiveIndex },
98
101
  context: e ? o : void 0
99
102
  };
100
103
  }
101
104
  render() {
102
- return l(v, { key: "4a399a4b6412de58edb4f06df1ff9246654981a7", ...this.ptm("root") }, l("ul", { key: "37930281d1b0ec7d17a1eb9089edd5fbe89109f7", ...this.ptm("menu", this.getPtmo()), role: "menubar", ref: (e) => this.navRef = e }, this.model.map((e, t) => this.visible(e) ? l("li", { key: this.label(e) + "_" + t, class: this.cx("menuitem", this.getPtmo(e, t)), role: "presentation", "data-ui-highlight": (this.currentActiveIndex === t).toString(), "data-ui-disabled": this.disabled(e).toString(), onClick: (n) => this.onItemClick(n, e, t) }, l("a", { role: "menuitem", href: e.url ?? e.route ? u.normalizePath(e.url ?? e.route) : void 0, target: e.target, "aria-label": this.label(e), "aria-disabled": this.disabled(e) ? "true" : "false", tabIndex: -1, onClick: (n) => e.route && n.preventDefault(), ...this.ptm("action", this.getPtmo(e, t)) }, e.icon && l("wangs-icon", { icon: e.icon }), l("span", { class: this.cx("label") }, this.label(e)))) : null), l("li", { key: "2031b2abfd6285d4b513ad8bed9f522bd7413ecf", ref: (e) => this.inkbarRef = e, class: this.cx("inkbar", this.getPtmo()), role: "none" })));
105
+ return l(g, { key: "7fb3735dced0621a032964f1ae3f73b6ec67c5b2", ...this.ptm("root") }, l("ul", { key: "27c66d9d0501efeaa42edbe9316e9e7aa6af35ff", ...this.ptm("menu", this.getPtmo()), role: "menubar", ref: (e) => this.navRef = e }, this.model.map((e, t) => this.visible(e) ? l("li", { key: this.label(e) + "_" + t, class: this.cx("menuitem", this.getPtmo(e, t)), role: "presentation", "data-ui-highlight": (this.currentActiveIndex === t).toString(), "data-ui-disabled": this.disabled(e).toString(), onClick: (n) => this.onItemClick(n, e, t) }, l("a", { role: "menuitem", href: e.url ?? e.route ? u.normalizePath(e.url ?? e.route) : void 0, target: e.target, "aria-label": this.label(e), "aria-disabled": this.disabled(e) ? "true" : "false", tabIndex: -1, onClick: (n) => e.route && n.preventDefault(), ...this.ptm("action", this.getPtmo(e, t)) }, e.icon && l("wangs-icon", { icon: e.icon }), l("span", { class: this.cx("label") }, this.label(e)))) : null), l("li", { key: "b839c46122db33c4375b28788bdf23eeb5b40305", ref: (e) => this.inkbarRef = e, class: this.cx("inkbar", this.getPtmo()), role: "none" })));
103
106
  }
104
107
  static get watchers() {
105
108
  return {
109
+ activeIndex: ["function"],
106
110
  currentActiveIndex: ["onUpdateActiveIndex"]
107
111
  };
108
112
  }
@@ -114,6 +118,7 @@ const m = /* @__PURE__ */ p(class extends g {
114
118
  useTrailingLine: [4, "use-trailing-line"],
115
119
  currentActiveIndex: [32]
116
120
  }, [[8, "wangs-ui-core:navigation-event", "onRoutePathChanged"]], {
121
+ activeIndex: ["function"],
117
122
  currentActiveIndex: ["onUpdateActiveIndex"]
118
123
  }]);
119
124
  function E() {
@@ -122,7 +127,7 @@ function E() {
122
127
  ["wangs-tab-menu", "wangs-icon"].forEach((i) => {
123
128
  switch (i) {
124
129
  case "wangs-tab-menu":
125
- customElements.get(i) || customElements.define(i, m);
130
+ customElements.get(i) || customElements.define(i, A);
126
131
  break;
127
132
  case "wangs-icon":
128
133
  customElements.get(i) || I();
@@ -1,7 +1,7 @@
1
- var f = Object.defineProperty;
2
- var b = (o, i, e) => i in o ? f(o, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[i] = e;
1
+ var g = Object.defineProperty;
2
+ var b = (o, i, e) => i in o ? g(o, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[i] = e;
3
3
  var s = (o, i, e) => b(o, typeof i != "symbol" ? i + "" : i, e);
4
- import { p as y, H as k, c as l, h as r, a as x } from "./p-DTTCzifR.es.js";
4
+ import { p as y, H as k, c as a, h as r, a as x } from "./p-DTTCzifR.es.js";
5
5
  import { B as T } from "./p-C5lMEBcj.es.js";
6
6
  function u(o) {
7
7
  setTimeout(o, 0);
@@ -30,8 +30,8 @@ const w = /* @__PURE__ */ y(class extends k {
30
30
  s(this, "blur");
31
31
  s(this, "completed");
32
32
  s(this, "onInput", (e, t) => {
33
- const n = e.target, a = this.tokens;
34
- a[t] = n.value, this.tokens = [...a], this.updateModel(e), e.inputType === "deleteContentBackward" ? this.moveToPrev(n) : (e.inputType === "insertText" || e.inputType === "deleteContentForward") && this.moveToNext(n);
33
+ const n = e.target, l = this.tokens;
34
+ l[t] = n.value, this.tokens = [...l], this.updateModel(e), e.inputType === "deleteContentBackward" ? this.moveToPrev(n) : (e.inputType === "insertText" || e.inputType === "deleteContentForward") && this.moveToNext(n);
35
35
  });
36
36
  s(this, "onFocus", (e) => {
37
37
  e.target.select(), this.focus.emit(e), this.focused = !0;
@@ -42,10 +42,10 @@ const w = /* @__PURE__ */ y(class extends k {
42
42
  });
43
43
  });
44
44
  s(this, "onPaste", (e) => {
45
- var a;
45
+ var l;
46
46
  if (this.readonly || this.disabled)
47
47
  return;
48
- const t = ((a = e.clipboardData) == null ? void 0 : a.getData("text")) ?? "";
48
+ const t = ((l = e.clipboardData) == null ? void 0 : l.getData("text")) ?? "";
49
49
  if (!t)
50
50
  return;
51
51
  const n = t.substring(0, this.length);
@@ -68,7 +68,7 @@ const w = /* @__PURE__ */ y(class extends k {
68
68
  break;
69
69
  }
70
70
  });
71
- this.__registerHost(), this.updateModelValue = l(this, "update:modelValue"), this.change = l(this, "change"), this.focus = l(this, "focus"), this.blur = l(this, "blur"), this.completed = l(this, "completed"), this.base = new T({ tag: "WANGS-INPUT-OTP", pt: this.pt });
71
+ this.__registerHost(), this.updateModelValue = a(this, "update:modelValue"), this.change = a(this, "change"), this.focus = a(this, "focus"), this.blur = a(this, "blur"), this.completed = a(this, "completed"), this.base = new T({ tag: "WANGS-INPUT-OTP", pt: this.pt });
72
72
  }
73
73
  get cx() {
74
74
  return this.base.cx;
@@ -110,16 +110,16 @@ const w = /* @__PURE__ */ y(class extends k {
110
110
  return !!this.tokens[e];
111
111
  }
112
112
  getPtmo(e) {
113
- const { invalid: t, mask: n, disabled: a, integerOnly: h, modelValue: d, readonly: p, length: c, variant: m, tokens: g } = this;
113
+ const { invalid: t, mask: n, disabled: l, integerOnly: h, modelValue: d, readonly: p, length: c, variant: m, tokens: f } = this;
114
114
  return {
115
- props: { invalid: t, mask: n, disabled: a, integerOnly: h, modelValue: d, readonly: p, length: c, variant: m },
116
- state: { tokens: g },
115
+ props: { invalid: t, mask: n, disabled: l, integerOnly: h, modelValue: d, readonly: p, length: c, variant: m },
116
+ state: { tokens: f },
117
117
  parent: this.el.parentElement,
118
118
  context: e != null ? { filled: this.isInputFilledIn(e), disabled: this.disabled } : void 0
119
119
  };
120
120
  }
121
121
  render() {
122
- return r(x, { key: "844b6b24ab1e9755147b855a1bfe18e13998eb26", class: this.cx("root", this.getPtmo()) }, Array.from({ length: this.length }).map((e, t) => r("input", { type: this.mask ? "password" : "text", class: this.cx("input", this.getPtmo(t)), value: this.tokens[t] || "", inputmode: this.integerOnly ? "numeric" : "text", disabled: this.disabled, readonly: this.readonly, onInput: (n) => this.onInput(n, t), onFocus: this.onFocus, onBlur: this.onBlur, onPaste: this.onPaste, onKeyDown: this.onKeyDown, maxLength: 1 })));
122
+ return r(x, { key: "465f7467e4adc55b59b7bc134347277b4fe3753c", class: this.cx("root", this.getPtmo()) }, Array.from({ length: this.length }).map((e, t) => r("input", { type: this.mask ? "password" : "text", class: this.cx("input", this.getPtmo(t)), value: this.tokens[t] || "", inputmode: this.integerOnly ? "numeric" : "text", disabled: this.disabled, readonly: this.readonly, onInput: (n) => this.onInput(n, t), onFocus: this.onFocus, onBlur: this.onBlur, onPaste: this.onPaste, onKeyDown: this.onKeyDown, maxLength: 1 })));
123
123
  }
124
124
  static get watchers() {
125
125
  return {
@@ -2,7 +2,7 @@ var c = Object.defineProperty;
2
2
  var f = (t, e, n) => e in t ? c(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var o = (t, e, n) => f(t, typeof e != "symbol" ? e + "" : e, n);
4
4
  import { p as a, H as r, h as s, a as u } from "./p-DTTCzifR.es.js";
5
- const l = /* @__PURE__ */ a(class extends r {
5
+ const d = /* @__PURE__ */ a(class extends r {
6
6
  constructor() {
7
7
  super();
8
8
  /**
@@ -12,23 +12,23 @@ const l = /* @__PURE__ */ a(class extends r {
12
12
  this.__registerHost();
13
13
  }
14
14
  render() {
15
- return s(u, { key: "b38f4386d6fb33972469caffc9b7f95b7fb0e7c9" }, s("slot", { key: "e1f130e8171a7ac985fc07612e3e8a693d6058ea", name: "icon" }), s("slot", { key: "f7395cc5ea9dc2d6125bf3e30a97e0303dab43e0" }, this.label));
15
+ return s(u, { key: "6d8cd1675cb92185f11a363897c0157ffe14f773" }, s("slot", { key: "0d9bdc2f9307d8545762019da83ec51f8e5f401e", name: "icon" }), s("slot", { key: "a71a60c1d70f5e6c83bbc1a3f2c9aeb2b55313a0" }, this.label));
16
16
  }
17
17
  }, [4, "wangs-button", {
18
18
  label: [1]
19
19
  }]);
20
- function m() {
20
+ function l() {
21
21
  if (typeof customElements > "u")
22
22
  return;
23
23
  ["wangs-button"].forEach((e) => {
24
24
  switch (e) {
25
25
  case "wangs-button":
26
- customElements.get(e) || customElements.define(e, l);
26
+ customElements.get(e) || customElements.define(e, d);
27
27
  break;
28
28
  }
29
29
  });
30
30
  }
31
- const p = m;
31
+ const p = l;
32
32
  export {
33
33
  p as d
34
34
  };
@@ -1,4 +1,4 @@
1
- import { d as e } from "./p-CKYwZoTo.es.js";
1
+ import { d as e } from "./p-C0QfdhKo.es.js";
2
2
  const m = e;
3
3
  export {
4
4
  m as d
@@ -1,4 +1,4 @@
1
- import { d as e } from "./p-CsoK-EWG.es.js";
1
+ import { d as e } from "./p-b33NVvKu.es.js";
2
2
  const m = e;
3
3
  export {
4
4
  m as d
@@ -1,4 +1,4 @@
1
- import { d as e } from "./p-DPHEi31J.es.js";
1
+ import { d as e } from "./p-CRgC2JIi.es.js";
2
2
  const m = e;
3
3
  export {
4
4
  m as d