base6-ui 2.0.14 → 2.0.16

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,5 +1,7 @@
1
1
  import { CSSProperties } from 'vue';
2
+ import { SliderProps } from 'naive-ui';
2
3
  type PropsType = {
4
+ step?: SliderProps['step'];
3
5
  style?: CSSProperties;
4
6
  showInput?: boolean;
5
7
  size?: 'small' | 'medium';
@@ -8,7 +10,6 @@ type PropsType = {
8
10
  max?: number;
9
11
  range?: boolean;
10
12
  showExtremeValueText?: boolean;
11
- precision?: number;
12
13
  };
13
14
  declare const _default: import('vue').DefineComponent<PropsType, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
15
  "update:value": (...args: any[]) => void;
@@ -19,7 +20,7 @@ declare const _default: import('vue').DefineComponent<PropsType, {}, {}, {}, {},
19
20
  max: number;
20
21
  size: "small" | "medium";
21
22
  min: number;
22
- precision: number;
23
+ step: number | "mark";
23
24
  range: boolean;
24
25
  showInput: boolean;
25
26
  showExtremeValueText: boolean;
@@ -1,7 +1,7 @@
1
1
  import o from "./index.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-92fa543e"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6c4c66a4"]]);
5
5
  export {
6
- f as default
6
+ m as default
7
7
  };
@@ -1,16 +1,17 @@
1
- import { NSlider as h, NInputNumber as z } from "naive-ui";
2
- import { defineComponent as w, shallowRef as b, computed as B, watch as k, createElementBlock as u, openBlock as i, normalizeStyle as N, createElementVNode as o, createCommentVNode as r, createVNode as s, mergeProps as S, toDisplayString as v, createBlock as C, Fragment as p } from "vue";
3
- import E from "../../hooks/useNaiveConfigProvideContext.mjs";
4
- const I = { class: "slider-content" }, T = {
1
+ import { NSlider as z, NInputNumber as w } from "naive-ui";
2
+ import { defineComponent as b, shallowRef as B, computed as f, watch as S, createElementBlock as u, openBlock as i, normalizeStyle as k, createElementVNode as o, createCommentVNode as r, createVNode as d, mergeProps as N, toDisplayString as c, createBlock as C, Fragment as E } from "vue";
3
+ import I from "../../hooks/useNaiveConfigProvideContext.mjs";
4
+ const T = { class: "slider-content" }, U = {
5
5
  key: 0,
6
6
  class: "extreme-value-text"
7
- }, U = {
7
+ }, V = {
8
8
  key: 0,
9
9
  class: "slider-input"
10
- }, D = /* @__PURE__ */ w({
10
+ }, F = /* @__PURE__ */ b({
11
11
  name: "BodenSlider",
12
12
  __name: "index",
13
13
  props: {
14
+ step: { default: 1 },
14
15
  style: { default: () => ({}) },
15
16
  showInput: { type: Boolean, default: !1 },
16
17
  size: { default: "medium" },
@@ -18,83 +19,86 @@ const I = { class: "slider-content" }, T = {
18
19
  min: { default: 0 },
19
20
  max: { default: 100 },
20
21
  range: { type: Boolean, default: !1 },
21
- showExtremeValueText: { type: Boolean, default: !1 },
22
- precision: { default: 0 }
22
+ showExtremeValueText: { type: Boolean, default: !1 }
23
23
  },
24
24
  emits: ["update:value"],
25
- setup(e, { emit: x }) {
26
- const f = e, { mergedThemeOverridesRef: c } = E(), d = b({}), y = x, n = B({
25
+ setup(e, { emit: g }) {
26
+ const v = e, { mergedThemeOverridesRef: y } = I(), x = B({}), p = g, n = f({
27
27
  get() {
28
- return f.value;
28
+ return v.value;
29
29
  },
30
- set(l) {
31
- y("update:value", l);
30
+ set(t) {
31
+ p("update:value", t);
32
32
  }
33
+ }), s = f(() => {
34
+ const t = v.step;
35
+ return (String(t).split(".")[1] || "").length || 1;
33
36
  });
34
- return k(
35
- () => c?.value?.Slider,
36
- (l) => {
37
- l && (d.value = {
38
- "--n-slider-handler-border": l.handleBorderStyle,
39
- "--n-slider-input-width": l.inputWidth,
40
- "--n-slider-range-input-line-color": l.rangeInputLineColor,
41
- "--n-slider-extreme-value-text-color": l.extremeValueTextColor
37
+ return S(
38
+ () => y?.value?.Slider,
39
+ (t) => {
40
+ t && (x.value = {
41
+ "--n-slider-handler-border": t.handleBorderStyle,
42
+ "--n-slider-input-width": t.inputWidth,
43
+ "--n-slider-range-input-line-color": t.rangeInputLineColor,
44
+ "--n-slider-extreme-value-text-color": t.extremeValueTextColor
42
45
  });
43
46
  },
44
47
  {
45
48
  immediate: !0
46
49
  }
47
- ), (l, t) => {
48
- const g = h, m = z;
50
+ ), (t, l) => {
51
+ const h = z, m = w;
49
52
  return i(), u("div", {
50
53
  class: "boden-slider",
51
- style: N([d.value, e.style])
54
+ style: k([x.value, e.style])
52
55
  }, [
53
- o("div", I, [
54
- s(g, S(l.$attrs, {
56
+ o("div", T, [
57
+ d(h, N(t.$attrs, {
55
58
  value: n.value,
56
- "onUpdate:value": t[0] || (t[0] = (a) => n.value = a),
59
+ "onUpdate:value": l[0] || (l[0] = (a) => n.value = a),
57
60
  min: e.min,
58
61
  max: e.max,
59
- range: e.range
60
- }), null, 16, ["value", "min", "max", "range"]),
61
- e.showExtremeValueText ? (i(), u("div", T, [
62
- o("div", null, v(e.min), 1),
63
- o("div", null, v(e.max), 1)
62
+ range: e.range,
63
+ step: e.step
64
+ }), null, 16, ["value", "min", "max", "range", "step"]),
65
+ e.showExtremeValueText ? (i(), u("div", U, [
66
+ o("div", null, c(e.min), 1),
67
+ o("div", null, c(e.max), 1)
64
68
  ])) : r("", !0)
65
69
  ]),
66
- e.showInput ? (i(), u("div", U, [
70
+ e.showInput ? (i(), u("div", V, [
67
71
  !e.range && typeof n.value == "number" ? (i(), C(m, {
68
72
  key: 0,
69
73
  "show-button": !1,
70
74
  placeholder: "",
71
75
  size: e.size,
72
76
  value: n.value,
73
- "onUpdate:value": t[1] || (t[1] = (a) => n.value = a),
77
+ "onUpdate:value": l[1] || (l[1] = (a) => n.value = a),
74
78
  min: e.min,
75
79
  max: e.max,
76
- precision: e.precision
77
- }, null, 8, ["size", "value", "min", "max", "precision"])) : e.range && typeof n.value != "number" ? (i(), u(p, { key: 1 }, [
78
- s(m, {
80
+ precision: s.value
81
+ }, null, 8, ["size", "value", "min", "max", "precision"])) : e.range && typeof n.value != "number" ? (i(), u(E, { key: 1 }, [
82
+ d(m, {
79
83
  "show-button": !1,
80
84
  placeholder: "",
81
85
  size: e.size,
82
86
  value: n.value[0],
83
- "onUpdate:value": t[2] || (t[2] = (a) => n.value[0] = a),
87
+ "onUpdate:value": l[2] || (l[2] = (a) => n.value[0] = a),
84
88
  min: e.min,
85
89
  max: e.max,
86
- precision: e.precision
90
+ precision: s.value
87
91
  }, null, 8, ["size", "value", "min", "max", "precision"]),
88
- t[4] || (t[4] = o("div", { class: "line" }, null, -1)),
89
- s(m, {
92
+ l[4] || (l[4] = o("div", { class: "line" }, null, -1)),
93
+ d(m, {
90
94
  "show-button": !1,
91
95
  placeholder: "",
92
96
  size: e.size,
93
97
  value: n.value[1],
94
- "onUpdate:value": t[3] || (t[3] = (a) => n.value[1] = a),
98
+ "onUpdate:value": l[3] || (l[3] = (a) => n.value[1] = a),
95
99
  min: e.min,
96
100
  max: e.max,
97
- precision: e.precision
101
+ precision: s.value
98
102
  }, null, 8, ["size", "value", "min", "max", "precision"])
99
103
  ], 64)) : r("", !0)
100
104
  ])) : r("", !0)
@@ -103,5 +107,5 @@ const I = { class: "slider-content" }, T = {
103
107
  }
104
108
  });
105
109
  export {
106
- D as default
110
+ F as default
107
111
  };
@@ -3,9 +3,13 @@ import o from "../../token/dark.mjs";
3
3
  import { commonBase as e } from "../../common.mjs";
4
4
  const l = {
5
5
  borderRadius: e.borderRadiusMedium,
6
- color: r["color-gray-3"],
7
- textColor: o["color-text-6"],
8
- padding: e.paddingBase
6
+ padding: e.paddingBase,
7
+ peers: {
8
+ Popover: {
9
+ color: r["color-gray-3"],
10
+ textColor: o["color-text-5"]
11
+ }
12
+ }
9
13
  }, d = {
10
14
  peers: {
11
15
  Popover: {
@@ -3,9 +3,13 @@ import { commonBase as r } from "../../common.mjs";
3
3
  import e from "../../token/light.mjs";
4
4
  const l = {
5
5
  borderRadius: r.borderRadiusMedium,
6
- color: o["color-gray-10"],
7
- textColor: e["color-text-1"],
8
- padding: r.paddingBase
6
+ padding: r.paddingBase,
7
+ peers: {
8
+ Popover: {
9
+ color: o["color-gray-10"],
10
+ textColor: e["color-text-1"]
11
+ }
12
+ }
9
13
  }, c = {
10
14
  peers: {
11
15
  Popover: {