@rhino-design/vue 0.2.7 → 0.2.8

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 (36) hide show
  1. package/README.md +95 -18
  2. package/README.zh-CN.md +115 -0
  3. package/dist/arco.less +95 -76
  4. package/dist/components/XButton.vue.js +2 -2
  5. package/dist/components/XConfigProvider.vue.js +1 -1
  6. package/dist/components/XMenuOverflowWrap.vue.js +66 -59
  7. package/dist/components/XScrollbar.vue.js +1 -1
  8. package/dist/components/XSubMenuPop.vue.js +1 -1
  9. package/dist/components/XTable.vue.d.ts +1 -0
  10. package/dist/components/XTable.vue.js +3 -3
  11. package/dist/components/XTable.vue2.js +774 -614
  12. package/dist/components/XToast.vue.d.ts +25 -0
  13. package/dist/components/XToast.vue.js +7 -0
  14. package/dist/components/XToast.vue2.js +27 -0
  15. package/dist/components/XTour.vue.d.ts +2 -0
  16. package/dist/components/XTour.vue.js +69 -61
  17. package/dist/components/XTree.vue.d.ts +2 -0
  18. package/dist/components/XTree.vue.js +1 -1
  19. package/dist/components/XTree.vue2.js +124 -121
  20. package/dist/components/XTreeNode.vue.d.ts +1 -0
  21. package/dist/components/XTreeNode.vue.js +2 -2
  22. package/dist/components/XTreeNode.vue2.js +21 -20
  23. package/dist/components/XTreeSelect.vue.js +4 -4
  24. package/dist/components/XTreeSelect.vue2.js +314 -291
  25. package/dist/components/XWatermark.vue.js +4 -4
  26. package/dist/components/index.d.ts +1 -0
  27. package/dist/components/index.js +55 -53
  28. package/dist/index.cjs +9 -9
  29. package/dist/index.css +95 -76
  30. package/dist/index.js +62 -60
  31. package/dist/index.less +95 -76
  32. package/dist/index.scss +14853 -0
  33. package/dist/style.css +95 -76
  34. package/dist/style.less +95 -76
  35. package/dist/style.scss +14853 -0
  36. package/package.json +8 -43
@@ -0,0 +1,25 @@
1
+ type ToastStatus = 'info' | 'success' | 'warning' | 'error';
2
+ type __VLS_Props = {
3
+ visible?: boolean;
4
+ status?: ToastStatus;
5
+ };
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: {
9
+ default?(_: {}): any;
10
+ };
11
+ refs: {};
12
+ rootEl: any;
13
+ };
14
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
16
+ visible: boolean;
17
+ status: ToastStatus;
18
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
20
+ export default _default;
21
+ type __VLS_WithTemplateSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./XToast.vue2.js";
2
+ /* empty css */
3
+ import t from "../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c06d7578"]]);
5
+ export {
6
+ p as default
7
+ };
@@ -0,0 +1,27 @@
1
+ import { defineComponent as i, computed as a, openBlock as s, createBlock as n, Transition as u, withCtx as c, createElementBlock as d, normalizeClass as m, renderSlot as f, createCommentVNode as v } from "vue";
2
+ const p = ["role", "aria-live"], B = /* @__PURE__ */ i({
3
+ __name: "XToast",
4
+ props: {
5
+ visible: { type: Boolean, default: !1 },
6
+ status: { default: "success" }
7
+ },
8
+ setup(e) {
9
+ const t = e, o = a(() => t.status === "error" ? "alert" : "status"), r = a(() => t.status === "error" ? "assertive" : "polite");
10
+ return (l, x) => (s(), n(u, { name: "x-toast-fade" }, {
11
+ default: c(() => [
12
+ e.visible ? (s(), d("div", {
13
+ key: 0,
14
+ class: m(["x-toast", `x-toast--${e.status}`]),
15
+ role: o.value,
16
+ "aria-live": r.value
17
+ }, [
18
+ f(l.$slots, "default", {}, void 0, !0)
19
+ ], 10, p)) : v("", !0)
20
+ ]),
21
+ _: 3
22
+ }));
23
+ }
24
+ });
25
+ export {
26
+ B as default
27
+ };
@@ -9,6 +9,7 @@ type __VLS_Props = {
9
9
  current?: number;
10
10
  steps?: XTourStep[];
11
11
  mask?: boolean;
12
+ arrow?: boolean;
12
13
  };
13
14
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
15
  change: (value: number) => any;
@@ -23,6 +24,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
23
24
  }>, {
24
25
  mask: boolean;
25
26
  open: boolean;
27
+ arrow: boolean;
26
28
  current: number;
27
29
  steps: XTourStep[];
28
30
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
@@ -1,120 +1,128 @@
1
- import { defineComponent as X, ref as B, computed as p, watch as $, nextTick as q, onMounted as D, onBeforeUnmount as I, openBlock as x, createBlock as U, Teleport as j, createElementBlock as C, createCommentVNode as M, createElementVNode as i, normalizeStyle as A, toDisplayString as s } from "vue";
2
- import { useXI18n as F } from "../composables/i18n.js";
3
- const G = {
1
+ import { defineComponent as q, ref as g, computed as d, watch as D, nextTick as I, onMounted as U, onBeforeUnmount as j, openBlock as y, createBlock as A, Teleport as F, createElementBlock as k, createCommentVNode as _, createElementVNode as r, normalizeStyle as G, normalizeClass as J, toDisplayString as a } from "vue";
2
+ import { useXI18n as K } from "../composables/i18n.js";
3
+ const O = {
4
4
  key: 0,
5
5
  class: "x-tour"
6
- }, J = {
6
+ }, Q = {
7
7
  key: 0,
8
8
  class: "x-tour__mask"
9
- }, K = { class: "x-tour__counter" }, O = { class: "x-tour__footer" }, Q = ["disabled"], tt = /* @__PURE__ */ X({
9
+ }, Y = { class: "x-tour__counter" }, Z = { class: "x-tour__footer" }, tt = ["disabled"], ot = /* @__PURE__ */ q({
10
10
  __name: "XTour",
11
11
  props: {
12
12
  open: { type: Boolean, default: !1 },
13
13
  current: { default: 0 },
14
14
  steps: { default: () => [] },
15
- mask: { type: Boolean, default: !0 }
15
+ mask: { type: Boolean, default: !0 },
16
+ arrow: { type: Boolean, default: !0 }
16
17
  },
17
18
  emits: ["update:open", "update:current", "change", "finish"],
18
- setup(o, { emit: W }) {
19
- const n = o, c = W, v = B(null), g = B({}), { t: d } = F(), E = p(() => d("tour.prevStep", void 0, "上一步")), S = p(() => d("tour.skip", void 0, "跳过")), H = p(() => d("tour.nextStep", void 0, "下一步")), L = p(() => d("tour.finish", void 0, "完成")), r = p(() => n.steps[n.current] ?? null);
20
- function b() {
21
- var _, T;
22
- if (!n.open || !r.value) return;
23
- const t = ((_ = v.value) == null ? void 0 : _.offsetWidth) ?? Math.min(360, window.innerWidth - 32), u = ((T = v.value) == null ? void 0 : T.offsetHeight) ?? 220, h = 16, N = (l) => Math.min(Math.max(h, l), window.innerWidth - t - h), P = (l) => Math.min(Math.max(h, l), window.innerHeight - u - h), a = (l, V) => {
24
- g.value = {
25
- left: `${N(l)}px`,
26
- top: `${P(V)}px`,
19
+ setup(o, { emit: S }) {
20
+ const n = o, s = S, b = g(null), T = g({}), c = g("bottom"), f = g(!1), { t: h } = K(), H = d(() => h("tour.prevStep", void 0, "上一步")), L = d(() => h("tour.skip", void 0, "跳过")), z = d(() => h("tour.nextStep", void 0, "下一步")), P = d(() => h("tour.finish", void 0, "完成")), u = d(() => n.steps[n.current] ?? null);
21
+ function B() {
22
+ var W, E;
23
+ if (!n.open || !u.value) return;
24
+ const t = ((W = b.value) == null ? void 0 : W.offsetWidth) ?? Math.min(360, window.innerWidth - 32), i = ((E = b.value) == null ? void 0 : E.offsetHeight) ?? 220, v = 16, N = (p) => Math.min(Math.max(v, p), window.innerWidth - t - v), V = (p) => Math.min(Math.max(v, p), window.innerHeight - i - v), l = (p, X) => {
25
+ T.value = {
26
+ left: `${N(p)}px`,
27
+ top: `${V(X)}px`,
27
28
  transform: "none"
28
29
  };
29
30
  };
30
- if (!r.value.target) {
31
- a((window.innerWidth - t) / 2, (window.innerHeight - u) / 2);
31
+ if (!u.value.target) {
32
+ f.value = !1, c.value = "center", l((window.innerWidth - t) / 2, (window.innerHeight - i) / 2);
32
33
  return;
33
34
  }
34
- const k = document.querySelector(r.value.target);
35
- if (!k) {
36
- a((window.innerWidth - t) / 2, (window.innerHeight - u) / 2);
35
+ const M = document.querySelector(u.value.target);
36
+ if (!M) {
37
+ f.value = !1, c.value = "center", l((window.innerWidth - t) / 2, (window.innerHeight - i) / 2);
37
38
  return;
38
39
  }
39
- const e = k.getBoundingClientRect(), w = r.value.placement ?? "bottom", m = 16;
40
+ f.value = !0;
41
+ const e = M.getBoundingClientRect(), w = u.value.placement ?? "bottom";
42
+ c.value = w;
43
+ const x = 16;
40
44
  if (w === "top") {
41
- a(e.left + e.width / 2 - t / 2, e.top - u - m);
45
+ l(e.left + e.width / 2 - t / 2, e.top - i - x);
42
46
  return;
43
47
  }
44
48
  if (w === "left") {
45
- a(e.left - t - m, e.top + e.height / 2 - u / 2);
49
+ l(e.left - t - x, e.top + e.height / 2 - i / 2);
46
50
  return;
47
51
  }
48
52
  if (w === "right") {
49
- a(e.right + m, e.top + e.height / 2 - u / 2);
53
+ l(e.right + x, e.top + e.height / 2 - i / 2);
50
54
  return;
51
55
  }
52
- a(e.left + e.width / 2 - t / 2, e.bottom + m);
56
+ l(e.left + e.width / 2 - t / 2, e.bottom + x);
53
57
  }
54
- function f() {
55
- b();
58
+ function m() {
59
+ B();
56
60
  }
57
- $(
61
+ D(
58
62
  () => [n.open, n.current, n.steps],
59
63
  async () => {
60
- await q(), b();
64
+ await I(), B();
61
65
  },
62
66
  { deep: !0, immediate: !0 }
63
- ), D(() => {
64
- window.addEventListener("resize", f), window.addEventListener("scroll", f, !0);
65
- }), I(() => {
66
- window.removeEventListener("resize", f), window.removeEventListener("scroll", f, !0);
67
+ ), U(() => {
68
+ window.addEventListener("resize", m), window.addEventListener("scroll", m, !0);
69
+ }), j(() => {
70
+ window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0);
67
71
  });
68
- function y() {
69
- c("update:open", !1);
72
+ function C() {
73
+ s("update:open", !1);
70
74
  }
71
- function z() {
75
+ function R() {
72
76
  const t = Math.max(0, n.current - 1);
73
- c("update:current", t), c("change", t);
77
+ s("update:current", t), s("change", t);
74
78
  }
75
- function R() {
79
+ function $() {
76
80
  if (n.current >= n.steps.length - 1) {
77
- c("finish"), y();
81
+ s("finish"), C();
78
82
  return;
79
83
  }
80
84
  const t = n.current + 1;
81
- c("update:current", t), c("change", t);
85
+ s("update:current", t), s("change", t);
82
86
  }
83
- return (t, u) => (x(), U(j, { to: "body" }, [
84
- o.open && r.value ? (x(), C("div", G, [
85
- o.mask ? (x(), C("div", J)) : M("", !0),
86
- i("div", {
87
+ return (t, i) => (y(), A(F, { to: "body" }, [
88
+ o.open && u.value ? (y(), k("div", O, [
89
+ o.mask ? (y(), k("div", Q)) : _("", !0),
90
+ r("div", {
87
91
  ref_key: "popupRef",
88
- ref: v,
92
+ ref: b,
89
93
  class: "x-tour__popup",
90
- style: A(g.value)
94
+ style: G(T.value)
91
95
  }, [
92
- i("div", K, s(o.current + 1) + " / " + s(o.steps.length), 1),
93
- i("strong", null, s(r.value.title), 1),
94
- i("p", null, s(r.value.description), 1),
95
- i("div", O, [
96
- i("button", {
96
+ o.arrow && f.value && c.value !== "center" ? (y(), k("span", {
97
+ key: 0,
98
+ class: J(["x-tour__arrow", `is-${c.value}`])
99
+ }, null, 2)) : _("", !0),
100
+ r("div", Y, a(o.current + 1) + " / " + a(o.steps.length), 1),
101
+ r("strong", null, a(u.value.title), 1),
102
+ r("p", null, a(u.value.description), 1),
103
+ r("div", Z, [
104
+ r("button", {
97
105
  type: "button",
98
106
  class: "x-button",
99
107
  disabled: o.current === 0,
100
- onClick: z
101
- }, s(E.value), 9, Q),
102
- i("button", {
108
+ onClick: R
109
+ }, a(H.value), 9, tt),
110
+ r("button", {
103
111
  type: "button",
104
112
  class: "x-button x-button--outline",
105
- onClick: y
106
- }, s(S.value), 1),
107
- i("button", {
113
+ onClick: C
114
+ }, a(L.value), 1),
115
+ r("button", {
108
116
  type: "button",
109
117
  class: "x-button x-button--primary",
110
- onClick: R
111
- }, s(o.current >= o.steps.length - 1 ? L.value : H.value), 1)
118
+ onClick: $
119
+ }, a(o.current >= o.steps.length - 1 ? P.value : z.value), 1)
112
120
  ])
113
121
  ], 4)
114
- ])) : M("", !0)
122
+ ])) : _("", !0)
115
123
  ]));
116
124
  }
117
125
  });
118
126
  export {
119
- tt as default
127
+ ot as default
120
128
  };
@@ -44,6 +44,7 @@ type __VLS_Props = {
44
44
  }) => boolean;
45
45
  filterTreeNode?: (node: TreeNodeData) => boolean;
46
46
  searchValue?: string;
47
+ actionOnNodeClick?: 'expand';
47
48
  fieldNames?: {
48
49
  key?: string;
49
50
  title?: string;
@@ -227,6 +228,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
227
228
  selectable: boolean;
228
229
  showLine: boolean;
229
230
  blockNode: boolean;
231
+ actionOnNodeClick: "expand";
230
232
  checkedStrategy: CheckedStrategy;
231
233
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
232
234
  treeViewportRef: HTMLDivElement;
@@ -1,7 +1,7 @@
1
1
  import o from "./XTree.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fe5c4085"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9572f80b"]]);
5
5
  export {
6
6
  m as default
7
7
  };