@aplus-frontend/ui 0.4.5 → 0.4.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.
@@ -56,6 +56,7 @@ declare const __VLS_component: DefineComponent<ApFieldDateProps, {}, {}, {}, {},
56
56
  showToday: boolean;
57
57
  showTime: boolean | SharedTimeProps<dayjs.Dayjs>;
58
58
  emptyText: string;
59
+ formatBegins: boolean;
59
60
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
60
61
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
61
62
  export default _default;
@@ -83,23 +83,24 @@ const le = /* @__PURE__ */ b({
83
83
  onChange: {},
84
84
  onOk: {},
85
85
  format: { default: "Y-D" },
86
+ formatBegins: { type: Boolean, default: !0 },
86
87
  timezone: {}
87
88
  },
88
89
  emits: ["update:value"],
89
90
  setup(h, { emit: B }) {
90
- const e = h, k = B, { value: p, updateValue: c } = Z(
91
+ const e = h, g = B, { value: m, updateValue: c } = Z(
91
92
  e,
92
- k
93
- ), P = Y("Date", e), n = i(
93
+ g
94
+ ), k = Y("Date", e), n = i(
94
95
  () => I.indexOf(e.format) > -1
95
96
  ), d = i(
96
97
  () => n.value ? H[e.format] : e.format
97
- ), m = i(() => {
98
- if (y(t(p)))
98
+ ), p = i(() => {
99
+ if (y(t(m)))
99
100
  return;
100
- let o = r(t(p));
101
- return e.timezone && (o = r(W(t(p), e.timezone))), o;
102
- }), g = i(() => t(n) ? e.picker ?? U[e.format] : e.picker), C = i(() => {
101
+ let o = r(t(m));
102
+ return e.timezone && (o = r(W(t(m), e.timezone))), o;
103
+ }), P = i(() => t(n) ? e.picker ?? U[e.format] : e.picker), C = i(() => {
103
104
  const o = t(n) ? K[e.format] : {};
104
105
  return {
105
106
  ...$(e, [
@@ -111,7 +112,7 @@ const le = /* @__PURE__ */ b({
111
112
  "onUpdate:value",
112
113
  "mode"
113
114
  ]),
114
- placeholder: t(P),
115
+ placeholder: t(k),
115
116
  ...o
116
117
  };
117
118
  }), f = L(e.timezone);
@@ -122,14 +123,19 @@ const le = /* @__PURE__ */ b({
122
123
  }
123
124
  const l = r(o);
124
125
  c(
125
- f(l, t(n) ? t(d) : void 0)
126
+ f(
127
+ l,
128
+ t(n) ? t(d) : void 0,
129
+ e.formatBegins
130
+ )
126
131
  );
127
132
  }
128
133
  function T(o, l) {
129
134
  var s;
130
135
  const u = r(o), a = o ? f(
131
136
  u,
132
- t(n) ? t(d) : void 0
137
+ t(n) ? t(d) : void 0,
138
+ e.formatBegins
133
139
  ) : null;
134
140
  (s = e.onChange) == null || s.call(e, a, l);
135
141
  }
@@ -137,16 +143,17 @@ const le = /* @__PURE__ */ b({
137
143
  var a;
138
144
  const l = r(o), u = o ? f(
139
145
  l,
140
- t(n) ? t(d) : void 0
146
+ t(n) ? t(d) : void 0,
147
+ e.formatBegins
141
148
  ) : null;
142
149
  (a = e.onOk) == null || a.call(e, u);
143
150
  }
144
151
  return (o, l) => o.mode === "read" ? (v(), _(w, { key: 0 }, [
145
- M(R(m.value ? t(r)(m.value).format(d.value) : o.emptyText), 1)
152
+ M(R(p.value ? t(r)(p.value).format(d.value) : o.emptyText), 1)
146
153
  ], 64)) : (v(), F(t(j), A({ key: 1 }, C.value, {
147
- value: m.value,
154
+ value: p.value,
148
155
  format: d.value,
149
- picker: g.value,
156
+ picker: P.value,
150
157
  "onUpdate:value": O,
151
158
  onChange: T,
152
159
  onOk: S
@@ -41,6 +41,11 @@ export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' |
41
41
  onChange?: (ts: number | null, dayStr: string) => void;
42
42
  onOk?: (ts: number | null) => void;
43
43
  format?: LiteralUnion<ApFormatPresetType, string>;
44
+ /**
45
+ * 格式化时间时是否以`format`的开始
46
+ * @default true
47
+ */
48
+ formatBegins?: boolean;
44
49
  /**
45
50
  * 指定时区,指定后value会变为特定时区下的timestamp
46
51
  */
@@ -1,23 +1,23 @@
1
- import { defineComponent as G, ref as x, unref as e, useSlots as H, createVNode as l, cloneVNode as L, openBlock as y, createElementBlock as M, Fragment as q, createBlock as J, resolveDynamicComponent as K, createCommentVNode as P, withCtx as s, createElementVNode as i, normalizeClass as r, toDisplayString as m, createTextVNode as v, isRef as Q } from "vue";
2
- import { Button as B, Modal as W, RadioGroup as X, RadioButton as _, Divider as h } from "@aplus-frontend/antdv";
3
- import { getSingleVNode as Y } from "../../../../utils/slot.mjs";
4
- import { useInjectApTable as Z } from "../../../context.mjs";
1
+ import { defineComponent as G, ref as y, unref as e, computed as H, useSlots as L, createVNode as l, cloneVNode as M, openBlock as x, createElementBlock as P, Fragment as q, createBlock as J, resolveDynamicComponent as Q, createCommentVNode as W, withCtx as i, createElementVNode as s, normalizeClass as r, toDisplayString as c, createTextVNode as C, isRef as X } from "vue";
2
+ import { Button as B, Modal as Y, RadioGroup as Z, RadioButton as _, Divider as h } from "@aplus-frontend/antdv";
3
+ import { getSingleVNode as ee } from "../../../../utils/slot.mjs";
4
+ import { useInjectApTable as te } from "../../../context.mjs";
5
5
  import "../tree-select/index.vue.mjs";
6
- import { useTableColumnState as ee } from "../../../hooks/use-table-column-state.mjs";
6
+ import { useTableColumnState as le } from "../../../hooks/use-table-column-state.mjs";
7
7
  import "../../../../config-provider/index.mjs";
8
8
  import "../sorter/index.vue.mjs";
9
- import te, { customCloneColumnStates as N } from "../utils.mjs";
10
- import { SettingOutlined as le } from "@ant-design/icons-vue";
11
- import { useLocale as oe } from "../../../../config-provider/hooks/use-locale.mjs";
9
+ import oe, { customCloneColumnStates as N } from "../utils.mjs";
10
+ import { SettingOutlined as ne } from "@ant-design/icons-vue";
11
+ import { useLocale as ae } from "../../../../config-provider/hooks/use-locale.mjs";
12
12
  import { useNamespace as T } from "../../../../config-provider/hooks/use-namespace.mjs";
13
- import ne from "../tree-select/index.vue2.mjs";
14
- import ae from "../sorter/index.vue2.mjs";
15
- const ie = {
13
+ import se from "../tree-select/index.vue2.mjs";
14
+ import ie from "../sorter/index.vue2.mjs";
15
+ const re = {
16
16
  style: {
17
17
  lineHeight: "22px",
18
18
  color: "#8896B0"
19
19
  }
20
- }, xe = /* @__PURE__ */ G({
20
+ }, Be = /* @__PURE__ */ G({
21
21
  __name: "index",
22
22
  props: {
23
23
  config: {
@@ -25,46 +25,46 @@ const ie = {
25
25
  }
26
26
  },
27
27
  setup(A) {
28
- const C = A, {
28
+ const m = A, {
29
29
  columnsBackup: V,
30
30
  size: z,
31
- updateSize: c,
32
- updateColumns: d
33
- } = Z(), f = x(e(z)), {
31
+ updateSize: d,
32
+ updateColumns: f
33
+ } = te(), g = y(e(z)), R = H(() => m.config.persistenceKey), {
34
34
  columnState: n,
35
- setColumnState: R,
36
- isAllSelected: w,
37
- toggleSelectAll: D,
38
- columnStateBackup: O,
39
- setColumnStateBackup: U,
40
- cacheColumnStateIfNeeded: E
41
- } = ee(C.config, []), {
35
+ setColumnState: w,
36
+ isAllSelected: D,
37
+ toggleSelectAll: O,
38
+ columnStateBackup: U,
39
+ setColumnStateBackup: E,
40
+ cacheColumnStateIfNeeded: I
41
+ } = le(m.config, R, []), {
42
42
  t: a
43
- } = oe(), {
44
- b: g,
43
+ } = ae(), {
44
+ b: v,
45
45
  be: S
46
46
  } = T("ap-column-setting"), {
47
- b: I
48
- } = T("ap-table"), u = x(!1), $ = H(), b = Y($.trigger) || l(B, {
49
- icon: l(le, null, null),
50
- class: I("setting-trigger-button")
51
- }, null), k = b ? L(b, {
47
+ b: K
48
+ } = T("ap-table"), u = y(!1), $ = L(), b = ee($.trigger) || l(B, {
49
+ icon: l(ne, null, null),
50
+ class: K("setting-trigger-button")
51
+ }, null), k = b ? M(b, {
52
52
  onClick: () => {
53
53
  u.value = !0;
54
54
  }
55
55
  }) : null;
56
56
  function j() {
57
- R(N(e(O)));
57
+ w(N(e(U)));
58
58
  }
59
59
  function F() {
60
60
  var t, o;
61
- d == null || d(te(e(V), e(n))), c == null || c(e(f)), u.value = !1;
61
+ f == null || f(oe(e(V), e(n))), d == null || d(e(g)), u.value = !1;
62
62
  const p = N(n.value);
63
- U(p), E(p), (o = (t = C.config) == null ? void 0 : t.onChange) == null || o.call(t, p);
63
+ E(p), I(p), (o = (t = m.config) == null ? void 0 : t.onChange) == null || o.call(t, p);
64
64
  }
65
- return (p, t) => (y(), M(q, null, [e(k) ? (y(), J(K(e(k)), {
65
+ return (p, t) => (x(), P(q, null, [e(k) ? (x(), J(Q(e(k)), {
66
66
  key: 0
67
- })) : P("", !0), l(e(W), {
67
+ })) : W("", !0), l(e(Y), {
68
68
  open: u.value,
69
69
  "onUpdate:open": t[2] || (t[2] = (o) => u.value = o),
70
70
  title: e(a)("ap.apTable.setting.title"),
@@ -76,32 +76,32 @@ const ie = {
76
76
  },
77
77
  onOk: F
78
78
  }, {
79
- default: s(() => [i("div", {
80
- class: r(e(g)("wrapper"))
81
- }, [i("div", {
82
- class: r(e(g)("left"))
83
- }, [i("div", {
79
+ default: i(() => [s("div", {
80
+ class: r(e(v)("wrapper"))
81
+ }, [s("div", {
82
+ class: r(e(v)("left"))
83
+ }, [s("div", {
84
84
  class: r(e(S)("left", "header"))
85
- }, [i("div", null, [i("span", ie, m(e(a)("ap.apTable.setting.selectAllTip")), 1), l(e(B), {
85
+ }, [s("div", null, [s("span", re, c(e(a)("ap.apTable.setting.selectAllTip")), 1), l(e(B), {
86
86
  type: "link",
87
87
  size: "small",
88
- onClick: e(D)
88
+ onClick: e(O)
89
89
  }, {
90
- default: s(() => [v(m(e(w) ? e(a)("ap.apTable.setting.unSelectAll") : e(a)("ap.apTable.setting.selectAll")), 1)]),
90
+ default: i(() => [C(c(e(D) ? e(a)("ap.apTable.setting.unSelectAll") : e(a)("ap.apTable.setting.selectAll")), 1)]),
91
91
  _: 1
92
- }, 8, ["onClick"])]), l(e(X), {
93
- value: f.value,
94
- "onUpdate:value": t[0] || (t[0] = (o) => f.value = o)
92
+ }, 8, ["onClick"])]), l(e(Z), {
93
+ value: g.value,
94
+ "onUpdate:value": t[0] || (t[0] = (o) => g.value = o)
95
95
  }, {
96
- default: s(() => [l(e(_), {
96
+ default: i(() => [l(e(_), {
97
97
  value: "small"
98
98
  }, {
99
- default: s(() => [v(m(e(a)("ap.apTable.setting.sizeSmall")), 1)]),
99
+ default: i(() => [C(c(e(a)("ap.apTable.setting.sizeSmall")), 1)]),
100
100
  _: 1
101
101
  }), l(e(_), {
102
102
  value: "middle"
103
103
  }, {
104
- default: s(() => [v(m(e(a)("ap.apTable.setting.sizeNormal")), 1)]),
104
+ default: i(() => [C(c(e(a)("ap.apTable.setting.sizeNormal")), 1)]),
105
105
  _: 1
106
106
  })]),
107
107
  _: 1
@@ -110,7 +110,7 @@ const ie = {
110
110
  style: {
111
111
  margin: "0px"
112
112
  }
113
- }), l(ne, {
113
+ }), l(se, {
114
114
  class: r(e(S)("left", "content")),
115
115
  value: e(n)
116
116
  }, null, 8, ["class", "value"])], 2), l(e(h), {
@@ -119,11 +119,11 @@ const ie = {
119
119
  height: "100%",
120
120
  margin: "0px"
121
121
  }
122
- }), i("div", {
123
- class: r(e(g)("right"))
124
- }, [l(ae, {
122
+ }), s("div", {
123
+ class: r(e(v)("right"))
124
+ }, [l(ie, {
125
125
  value: e(n),
126
- "onUpdate:value": t[1] || (t[1] = (o) => Q(n) ? n.value = o : null),
126
+ "onUpdate:value": t[1] || (t[1] = (o) => X(n) ? n.value = o : null),
127
127
  onReset: j
128
128
  }, null, 8, ["value"])], 2)], 2)]),
129
129
  _: 1
@@ -131,5 +131,5 @@ const ie = {
131
131
  }
132
132
  });
133
133
  export {
134
- xe as default
134
+ Be as default
135
135
  };
@@ -1838,6 +1838,7 @@ export declare const apTableRenderItemMap: {
1838
1838
  showToday: boolean;
1839
1839
  showTime: boolean | SharedTimeProps<Dayjs>;
1840
1840
  emptyText: string;
1841
+ formatBegins: boolean;
1841
1842
  }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
1842
1843
  P: {};
1843
1844
  B: {};
@@ -1874,6 +1875,7 @@ export declare const apTableRenderItemMap: {
1874
1875
  showToday: boolean;
1875
1876
  showTime: boolean | SharedTimeProps<Dayjs>;
1876
1877
  emptyText: string;
1878
+ formatBegins: boolean;
1877
1879
  }>;
1878
1880
  __isFragment?: never;
1879
1881
  __isTeleport?: never;
@@ -1909,6 +1911,7 @@ export declare const apTableRenderItemMap: {
1909
1911
  showToday: boolean;
1910
1912
  showTime: boolean | SharedTimeProps<Dayjs>;
1911
1913
  emptyText: string;
1914
+ formatBegins: boolean;
1912
1915
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
1913
1916
  $slots: Readonly<{
1914
1917
  dateRender: any;
@@ -1,6 +1,6 @@
1
- import { ApColumnState, ApTableSettingType } from '../interface';
2
1
  import { Ref, ComputedRef, ShallowRef } from 'vue';
3
- export declare const useTableColumnState: (columnSetting: ApTableSettingType, initialColumnState: ApColumnState[]) => {
2
+ import { ApColumnState, ApTableSettingType } from '../interface';
3
+ export declare const useTableColumnState: (columnSetting: ApTableSettingType, persistenceKey: Ref<string | undefined>, initialColumnState: ApColumnState[]) => {
4
4
  columnState: Ref<{
5
5
  key: string | number;
6
6
  show?: boolean | undefined;
@@ -1,127 +1,127 @@
1
- import { ref as j, shallowRef as z, unref as d, computed as D, watchEffect as G } from "vue";
2
- import { isDef as W } from "../../utils/index.mjs";
3
- import X, { customCloneColumnStates as A, getColumnStateString as q } from "../components/setting/utils.mjs";
4
- import { useInjectApTable as H } from "../context.mjs";
5
- import { isObject as B, mergeWith as E, isBoolean as L, omit as P, isNumber as N } from "lodash-unified";
6
- function a(t, n) {
7
- t.forEach((o) => {
1
+ import { ref as D, shallowRef as G, unref as f, computed as W, watchEffect as X } from "vue";
2
+ import { isDef as q } from "../../utils/index.mjs";
3
+ import H, { customCloneColumnStates as B, getColumnStateString as L } from "../components/setting/utils.mjs";
4
+ import { useInjectApTable as P } from "../context.mjs";
5
+ import { isObject as N, mergeWith as F, isBoolean as Q, omit as U, isNumber as b } from "lodash-unified";
6
+ function u(r, o) {
7
+ r.forEach((n) => {
8
8
  var i;
9
- n(o), (i = o.children) != null && i.length && a(o.children, n);
9
+ o(n), (i = n.children) != null && i.length && u(n.children, o);
10
10
  });
11
11
  }
12
- function Q(t, n) {
13
- if (!n)
12
+ function V(r, o) {
13
+ if (!o)
14
14
  return {};
15
- const o = t.getItem(n);
16
- return o ? JSON.parse(o) : {};
15
+ const n = r.getItem(o);
16
+ return n ? JSON.parse(n) : {};
17
17
  }
18
- function F(t, n) {
19
- if (B(t) && B(n))
20
- return E({}, t, n, F);
18
+ function I(r, o) {
19
+ if (N(r) && N(o))
20
+ return F({}, r, o, I);
21
21
  }
22
- const b = Number.MAX_SAFE_INTEGER;
23
- function U(t, n, o, i) {
24
- return i ? i.fixed : n ? n.fixed : o && "fixed" in o ? o.fixed : L(t.fixed) ? t.fixed ? "left" : void 0 : t.fixed;
22
+ const E = Number.MAX_SAFE_INTEGER;
23
+ function Y(r, o, n, i) {
24
+ return i ? i.fixed : o ? o.fixed : n && "fixed" in n ? n.fixed : Q(r.fixed) ? r.fixed ? "left" : void 0 : r.fixed;
25
25
  }
26
- const te = (t, n) => {
27
- const o = j(n), i = z(
28
- A(n)
29
- ), { columnsBackup: p, updateColumns: l } = H(), I = t.persistenceType || "localStorage", x = window[I];
30
- function T() {
31
- const e = Q(
32
- x,
33
- t.persistenceKey
34
- ), r = E(
26
+ const re = (r, o, n) => {
27
+ const i = D(n), c = G(
28
+ B(n)
29
+ ), { columnsBackup: x, updateColumns: a } = P(), T = r.persistenceType || "localStorage", S = window[T];
30
+ function O() {
31
+ const e = V(
32
+ S,
33
+ f(o)
34
+ ), t = F(
35
35
  {},
36
- t.defaultValue || {},
36
+ r.defaultValue || {},
37
37
  e,
38
- F
39
- ), s = d(p);
40
- function c(R, u, _) {
41
- return R.map((f) => {
42
- var k, v;
43
- const w = (u == null ? void 0 : u[f.key]) || {}, h = {
44
- key: f.key,
45
- label: f.title,
38
+ I
39
+ ), s = f(x);
40
+ function l(j, h, z) {
41
+ return j.map((d) => {
42
+ var y, A;
43
+ const v = (h == null ? void 0 : h[d.key]) || {}, g = {
44
+ key: d.key,
45
+ label: d.title,
46
46
  show: !0,
47
- fixed: U(
48
- f,
49
- e[f.key],
50
- (k = t.defaultValue) == null ? void 0 : k[f.key],
51
- _
47
+ fixed: Y(
48
+ d,
49
+ e[d.key],
50
+ (y = r.defaultValue) == null ? void 0 : y[d.key],
51
+ z
52
52
  ),
53
53
  disabled: !1,
54
- ...P(w, ["children", "fixed"])
54
+ ...U(v, ["children", "fixed"])
55
55
  };
56
- return h.children = (v = f.children) != null && v.length ? c(
57
- f.children,
58
- w.children,
59
- h
60
- ) : void 0, h;
61
- }).sort(O);
56
+ return g.children = (A = d.children) != null && A.length ? l(
57
+ d.children,
58
+ v.children,
59
+ g
60
+ ) : void 0, g;
61
+ }).sort(J);
62
62
  }
63
- return c(s || [], r);
63
+ return l(s || [], t);
64
64
  }
65
- function O(e, r) {
66
- const s = N(e.order) ? e.order : b;
67
- let c = N(r.order) ? r.order : b;
68
- return e.fixed === "right" && r.fixed !== "right" && (c = s - 1), r.fixed === "left" && e.fixed !== "left" && (c = s - 1), s - c;
65
+ function J(e, t) {
66
+ const s = b(e.order) ? e.order : E;
67
+ let l = b(t.order) ? t.order : E;
68
+ return e.fixed === "right" && t.fixed !== "right" && (l = s - 1), t.fixed === "left" && e.fixed !== "left" && (l = s - 1), s - l;
69
69
  }
70
- const g = D(() => d(o).every((e) => e.show));
70
+ const m = W(() => f(i).every((e) => e.show));
71
71
  function C() {
72
- const e = d(o);
73
- a(e, (r) => {
74
- !r.disabled && (r.show = !0);
72
+ const e = f(i);
73
+ u(e, (t) => {
74
+ !t.disabled && (t.show = !0);
75
75
  });
76
76
  }
77
- function y() {
78
- const e = d(o);
79
- a(e, (r) => {
80
- !r.disabled && (r.show = !1);
77
+ function p() {
78
+ const e = f(i);
79
+ u(e, (t) => {
80
+ !t.disabled && (t.show = !1);
81
81
  });
82
82
  }
83
- function K() {
84
- d(g) ? y() : C();
83
+ function M() {
84
+ f(m) ? p() : C();
85
85
  }
86
- function J(e, r) {
87
- a(d(o), (s) => {
88
- s.key === e && (s.show = W(r) ? r : !s.show);
86
+ function R(e, t) {
87
+ u(f(i), (s) => {
88
+ s.key === e && (s.show = q(t) ? t : !s.show);
89
89
  });
90
90
  }
91
- function S(e) {
92
- o.value = e;
93
- }
94
- function M(e) {
91
+ function w(e) {
95
92
  i.value = e;
96
93
  }
97
- function m(e) {
98
- if (t.persistenceKey) {
99
- const r = q(e);
100
- x.setItem(t.persistenceKey, JSON.stringify(r));
94
+ function _(e) {
95
+ c.value = e;
96
+ }
97
+ function k(e) {
98
+ if (f(o)) {
99
+ const t = L(e);
100
+ S.setItem(f(o), JSON.stringify(t));
101
101
  }
102
102
  }
103
- return G(() => {
104
- var r;
105
- const e = T();
106
- S(e), (r = t.onChange) == null || r.call(t, e), l == null || l(
107
- X(
108
- d(p),
109
- d(e)
103
+ return X(() => {
104
+ var t;
105
+ const e = O();
106
+ w(e), (t = r.onChange) == null || t.call(r, e), a == null || a(
107
+ H(
108
+ f(x),
109
+ f(e)
110
110
  )
111
- ), i.value = A(e), m(e);
111
+ ), c.value = B(e), k(e);
112
112
  }), {
113
- columnState: o,
113
+ columnState: i,
114
114
  selectAll: C,
115
- unSelectAll: y,
116
- toggleSelect: J,
117
- setColumnState: S,
118
- isAllSelected: g,
119
- toggleSelectAll: K,
120
- columnStateBackup: i,
121
- setColumnStateBackup: M,
122
- cacheColumnStateIfNeeded: m
115
+ unSelectAll: p,
116
+ toggleSelect: R,
117
+ setColumnState: w,
118
+ isAllSelected: m,
119
+ toggleSelectAll: M,
120
+ columnStateBackup: c,
121
+ setColumnStateBackup: _,
122
+ cacheColumnStateIfNeeded: k
123
123
  };
124
124
  };
125
125
  export {
126
- te as useTableColumnState
126
+ re as useTableColumnState
127
127
  };
@@ -10,5 +10,6 @@ declare const _default: DefineComponent<ApFormItemBatchInputProps, {}, {}, {}, {
10
10
  hasFeedback: boolean;
11
11
  autoLink: boolean;
12
12
  validateFirst: boolean;
13
+ defaultSelectedAllKey: boolean;
13
14
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
14
15
  export default _default;
@@ -1,11 +1,12 @@
1
- import { defineComponent as b, computed as r, openBlock as B, createBlock as g, mergeProps as u, unref as m, withCtx as _, createVNode as V } from "vue";
1
+ import { defineComponent as g, computed as i, openBlock as _, createBlock as x, mergeProps as u, unref as m, withCtx as p, createVNode as s } from "vue";
2
2
  import "./index.vue2.mjs";
3
3
  import "../../ap-form/item/index.vue2.mjs";
4
- import { isValid as s } from "@aplus-frontend/utils";
5
- import { omit as p } from "lodash-unified";
6
- import x from "../../ap-form/item/index.vue.mjs";
7
- import k from "./index.vue.mjs";
8
- const A = /* @__PURE__ */ b({
4
+ import { isValid as c } from "@aplus-frontend/utils";
5
+ import { isEmpty as C, merge as k, omit as y } from "lodash-unified";
6
+ import { ApForm as F } from "../../ap-form/index.mjs";
7
+ import S from "../../ap-form/item/index.vue.mjs";
8
+ import V from "./index.vue.mjs";
9
+ const R = /* @__PURE__ */ g({
9
10
  __name: "form-item",
10
11
  props: {
11
12
  htmlFor: {},
@@ -50,56 +51,52 @@ const A = /* @__PURE__ */ b({
50
51
  field: { default: () => ({}) },
51
52
  disabled: { type: Boolean, default: void 0 },
52
53
  placeholer: {},
53
- trim: { type: Boolean, default: !0 }
54
+ trim: { type: Boolean, default: !0 },
55
+ defaultSelectedAllKey: { type: Boolean, default: !0 }
54
56
  },
55
57
  setup(v) {
56
- const l = v, c = r(() => (l == null ? void 0 : l.transform) || {
58
+ const l = v, h = i(() => (l == null ? void 0 : l.transform) || {
57
59
  flat: !1,
58
60
  transformer: (e) => {
59
- var a, o, i, n, d, f;
61
+ var o, a, r, d, n, f;
60
62
  if (e)
61
- return !(e != null && e.value) || ((a = e == null ? void 0 : e.value) == null ? void 0 : a.length) < 1 ? void 0 : (o = l == null ? void 0 : l.field) != null && o.options ? {
63
+ return !(e != null && e.value) || ((o = e == null ? void 0 : e.value) == null ? void 0 : o.length) < 1 ? void 0 : (a = l == null ? void 0 : l.field) != null && a.options ? {
62
64
  ...e,
63
- value: (n = (i = e == null ? void 0 : e.value) == null ? void 0 : i.filter((t) => s(t == null ? void 0 : t.trim()))) == null ? void 0 : n.map((t) => l.trim ? t == null ? void 0 : t.trim() : t)
64
- } : (f = (d = e == null ? void 0 : e.value) == null ? void 0 : d.filter((t) => s(t == null ? void 0 : t.trim()))) == null ? void 0 : f.map((t) => l.trim ? t == null ? void 0 : t.trim() : t);
65
+ value: (d = (r = e == null ? void 0 : e.value) == null ? void 0 : r.filter((t) => c(t == null ? void 0 : t.trim()))) == null ? void 0 : d.map((t) => l.trim ? t == null ? void 0 : t.trim() : t)
66
+ } : (f = (n = e == null ? void 0 : e.value) == null ? void 0 : n.filter((t) => c(t == null ? void 0 : t.trim()))) == null ? void 0 : f.map((t) => l.trim ? t == null ? void 0 : t.trim() : t);
65
67
  }
66
- }), y = r(() => {
68
+ }), b = (e, o) => {
69
+ var a, r, d;
70
+ return !(l != null && l.initialValue) && l.defaultSelectedAllKey && C(o.value) && ((d = o["onUpdate:value"]) == null || d.call(o, {
71
+ key: (r = (a = l == null ? void 0 : l.field) == null ? void 0 : a.options) == null ? void 0 : r.map((n) => n.value)
72
+ })), k(y(e, ["style"]), o);
73
+ }, B = i(() => {
67
74
  var e;
68
75
  return ((e = l.field) == null ? void 0 : e.style) || "width:auto";
69
- }), h = r(() => {
70
- var e, a;
71
- return (l == null ? void 0 : l.initialValue) || {
72
- key: (a = (e = l == null ? void 0 : l.field) == null ? void 0 : e.options) == null ? void 0 : a.map((o) => o.value)
73
- };
74
76
  });
75
- return (e, a) => {
76
- var o, i;
77
- return B(), g(x, u(
78
- m(p)(l, [
79
- "field",
80
- "initialValue",
81
- "transform",
82
- "placeholder",
83
- "disabled"
84
- ]),
85
- {
86
- "initial-value": h.value,
87
- transform: c.value,
88
- bordered: (i = (o = e.field) == null ? void 0 : o.options) != null && i.length ? !1 : e.bordered
89
- }
90
- ), {
91
- default: _(() => [
92
- V(k, u(m(p)(l.field, ["style"]), {
93
- style: y.value,
94
- disabled: e.disabled,
95
- placeholer: e.placeholer
96
- }), null, 16, ["style", "disabled", "placeholer"])
77
+ return (e, o) => {
78
+ var a, r;
79
+ return _(), x(S, u(m(y)(l, ["field", "transform", "placeholder", "disabled"]), {
80
+ transform: h.value,
81
+ bordered: (r = (a = e.field) == null ? void 0 : a.options) != null && r.length ? !1 : e.bordered
82
+ }), {
83
+ default: p(() => [
84
+ s(m(F).ControlRender, null, {
85
+ default: p(({ ...d }) => [
86
+ s(V, u(b(l.field, d), {
87
+ style: B.value,
88
+ disabled: e.disabled,
89
+ placeholer: e.placeholer
90
+ }), null, 16, ["style", "disabled", "placeholer"])
91
+ ]),
92
+ _: 1
93
+ })
97
94
  ]),
98
95
  _: 1
99
- }, 16, ["initial-value", "transform", "bordered"]);
96
+ }, 16, ["transform", "bordered"]);
100
97
  };
101
98
  }
102
99
  });
103
100
  export {
104
- A as default
101
+ R as default
105
102
  };
@@ -39,4 +39,9 @@ export type ApFormItemBatchInputProps = ApFormItemProps & {
39
39
  disabled?: boolean;
40
40
  placeholer?: string;
41
41
  trim?: boolean;
42
+ /**
43
+ * 是否默认选择所有的key
44
+ * @default true
45
+ */
46
+ defaultSelectedAllKey?: boolean;
42
47
  };
@@ -56,6 +56,7 @@ declare const __VLS_component: DefineComponent<ApFieldDateProps, {}, {}, {}, {},
56
56
  showToday: boolean;
57
57
  showTime: boolean | SharedTimeProps<dayjs.Dayjs>;
58
58
  emptyText: string;
59
+ formatBegins: boolean;
59
60
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
60
61
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
61
62
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("dayjs"),S=require("@aplus-frontend/antdv"),s=require("./constant.js");require("../../hooks/index.js");const m=require("lodash-unified"),T=require("./helper.js"),_=require("@aplus-frontend/utils"),M=require("../hooks/use-default-placeholder.js"),w=require("../../hooks/useControllableValue.js"),R=e.defineComponent({name:"ApFieldDate",__name:"index",props:{mode:{default:"edit"},class:{},style:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},placeholder:{},allowClear:{type:Boolean,default:!0},autofocus:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},id:{},presets:{},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},panelRender:{},inputRender:{},onOpenChange:{},onPanelChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},onContextmenu:{},onKeydown:{},role:{},name:{},autocomplete:{},direction:{},showToday:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},picker:{},prefixCls:{},defaultPickerValue:{},disabledDate:{},dateRender:{},monthCellRender:{},renderExtraFooter:{},onSelect:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},disabledTime:{},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"--"},value:{},defaultValue:{},onChange:{},onOk:{},format:{default:"Y-D"},timezone:{}},emits:["update:value"],setup(y,{emit:h}){const o=y,B=h,{value:c,updateValue:v}=w.useControllableValue(o,B),P=M.useDefaultPlaceholder("Date",o),a=e.computed(()=>s.ApFieldDatePresetFormats.indexOf(o.format)>-1),u=e.computed(()=>a.value?s.PRESET_FORMAT_MAP[o.format]:o.format),p=e.computed(()=>{if(m.isNil(e.unref(c)))return;let t=r(e.unref(c));return o.timezone&&(t=r(_.getTimeFormatToZone(e.unref(c),o.timezone))),t}),g=e.computed(()=>e.unref(a)?o.picker??s.PRESET_FORMAT_PICK_MAP[o.format]:o.picker),k=e.computed(()=>{const t=e.unref(a)?s.PRESET_FORMAT_TIME_MAP[o.format]:{};return{...m.omit(o,["value","defaultValue","onChange","onOk","format","onUpdate:value","mode"]),placeholder:e.unref(P),...t}}),f=T.formatDayWithTimezone(o.timezone);function C(t){if(m.isNil(t)){v(null);return}const l=r(t);v(f(l,e.unref(a)?e.unref(u):void 0))}function b(t,l){var i;const d=r(t),n=t?f(d,e.unref(a)?e.unref(u):void 0):null;(i=o.onChange)==null||i.call(o,n,l)}function O(t){var n;const l=r(t),d=t?f(l,e.unref(a)?e.unref(u):void 0):null;(n=o.onOk)==null||n.call(o,d)}return(t,l)=>t.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(p.value?e.unref(r)(p.value).format(u.value):t.emptyText),1)],64)):(e.openBlock(),e.createBlock(e.unref(S.DatePicker),e.mergeProps({key:1},k.value,{value:p.value,format:u.value,picker:g.value,"onUpdate:value":C,onChange:b,onOk:O}),e.createSlots({_:2},[e.renderList(t.$slots,(d,n)=>({name:n,fn:e.withCtx(i=>[e.renderSlot(t.$slots,n,e.normalizeProps(e.guardReactiveProps(i||{})))])}))]),1040,["value","format","picker"]))}});exports.default=R;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("dayjs"),S=require("@aplus-frontend/antdv"),s=require("./constant.js");require("../../hooks/index.js");const m=require("lodash-unified"),T=require("./helper.js"),_=require("@aplus-frontend/utils"),M=require("../hooks/use-default-placeholder.js"),w=require("../../hooks/useControllableValue.js"),R=e.defineComponent({name:"ApFieldDate",__name:"index",props:{mode:{default:"edit"},class:{},style:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},placeholder:{},allowClear:{type:Boolean,default:!0},autofocus:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},id:{},presets:{},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},panelRender:{},inputRender:{},onOpenChange:{},onPanelChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},onContextmenu:{},onKeydown:{},role:{},name:{},autocomplete:{},direction:{},showToday:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},picker:{},prefixCls:{},defaultPickerValue:{},disabledDate:{},dateRender:{},monthCellRender:{},renderExtraFooter:{},onSelect:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},disabledTime:{},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"--"},value:{},defaultValue:{},onChange:{},onOk:{},format:{default:"Y-D"},formatBegins:{type:Boolean,default:!0},timezone:{}},emits:["update:value"],setup(y,{emit:h}){const o=y,B=h,{value:c,updateValue:v}=w.useControllableValue(o,B),g=M.useDefaultPlaceholder("Date",o),a=e.computed(()=>s.ApFieldDatePresetFormats.indexOf(o.format)>-1),u=e.computed(()=>a.value?s.PRESET_FORMAT_MAP[o.format]:o.format),f=e.computed(()=>{if(m.isNil(e.unref(c)))return;let t=r(e.unref(c));return o.timezone&&(t=r(_.getTimeFormatToZone(e.unref(c),o.timezone))),t}),P=e.computed(()=>e.unref(a)?o.picker??s.PRESET_FORMAT_PICK_MAP[o.format]:o.picker),k=e.computed(()=>{const t=e.unref(a)?s.PRESET_FORMAT_TIME_MAP[o.format]:{};return{...m.omit(o,["value","defaultValue","onChange","onOk","format","onUpdate:value","mode"]),placeholder:e.unref(g),...t}}),p=T.formatDayWithTimezone(o.timezone);function C(t){if(m.isNil(t)){v(null);return}const l=r(t);v(p(l,e.unref(a)?e.unref(u):void 0,o.formatBegins))}function b(t,l){var i;const d=r(t),n=t?p(d,e.unref(a)?e.unref(u):void 0,o.formatBegins):null;(i=o.onChange)==null||i.call(o,n,l)}function O(t){var n;const l=r(t),d=t?p(l,e.unref(a)?e.unref(u):void 0,o.formatBegins):null;(n=o.onOk)==null||n.call(o,d)}return(t,l)=>t.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(f.value?e.unref(r)(f.value).format(u.value):t.emptyText),1)],64)):(e.openBlock(),e.createBlock(e.unref(S.DatePicker),e.mergeProps({key:1},k.value,{value:f.value,format:u.value,picker:P.value,"onUpdate:value":C,onChange:b,onOk:O}),e.createSlots({_:2},[e.renderList(t.$slots,(d,n)=>({name:n,fn:e.withCtx(i=>[e.renderSlot(t.$slots,n,e.normalizeProps(e.guardReactiveProps(i||{})))])}))]),1040,["value","format","picker"]))}});exports.default=R;
@@ -41,6 +41,11 @@ export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' |
41
41
  onChange?: (ts: number | null, dayStr: string) => void;
42
42
  onOk?: (ts: number | null) => void;
43
43
  format?: LiteralUnion<ApFormatPresetType, string>;
44
+ /**
45
+ * 格式化时间时是否以`format`的开始
46
+ * @default true
47
+ */
48
+ formatBegins?: boolean;
44
49
  /**
45
50
  * 指定时区,指定后value会变为特定时区下的timestamp
46
51
  */
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("@aplus-frontend/antdv"),w=require("../../../../utils/slot.js"),D=require("../../../context.js");require("../tree-select/index.vue.js");const E=require("../../../hooks/use-table-column-state.js");require("../../../../config-provider/index.js");require("../sorter/index.vue.js");const p=require("../utils.js"),A=require("@ant-design/icons-vue"),R=require("../../../../config-provider/hooks/use-locale.js"),N=require("../../../../config-provider/hooks/use-namespace.js"),O=require("../tree-select/index.vue2.js"),I=require("../sorter/index.vue2.js"),M={style:{lineHeight:"22px",color:"#8896B0"}},U=e.defineComponent({__name:"index",props:{config:{default:()=>({})}},setup(C){const f=C,{columnsBackup:S,size:V,updateSize:s,updateColumns:i}=D.useInjectApTable(),c=e.ref(e.unref(V)),{columnState:a,setColumnState:_,isAllSelected:x,toggleSelectAll:b,columnStateBackup:y,setColumnStateBackup:k,cacheColumnStateIfNeeded:h}=E.useTableColumnState(f.config,[]),{t:o}=R.useLocale(),{b:d,be:m}=N.useNamespace("ap-column-setting"),{b:q}=N.useNamespace("ap-table"),u=e.ref(!1),T=e.useSlots(),g=w.getSingleVNode(T.trigger)||e.createVNode(l.Button,{icon:e.createVNode(A.SettingOutlined,null,null),class:q("setting-trigger-button")},null),v=g?e.cloneVNode(g,{onClick:()=>{u.value=!0}}):null;function B(){_(p.customCloneColumnStates(e.unref(y)))}function z(){var t,n;i==null||i(p.default(e.unref(S),e.unref(a))),s==null||s(e.unref(c)),u.value=!1;const r=p.customCloneColumnStates(a.value);k(r),h(r),(n=(t=f.config)==null?void 0:t.onChange)==null||n.call(t,r)}return(r,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(v)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v)),{key:0})):e.createCommentVNode("",!0),e.createVNode(e.unref(l.Modal),{open:u.value,"onUpdate:open":t[2]||(t[2]=n=>u.value=n),title:e.unref(o)("ap.apTable.setting.title"),width:900,centered:!0,"body-style":{padding:"0px !important",height:"450px"},onOk:z},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(d)("wrapper"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(d)("left"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(m)("left","header"))},[e.createElementVNode("div",null,[e.createElementVNode("span",M,e.toDisplayString(e.unref(o)("ap.apTable.setting.selectAllTip")),1),e.createVNode(e.unref(l.Button),{type:"link",size:"small",onClick:e.unref(b)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(x)?e.unref(o)("ap.apTable.setting.unSelectAll"):e.unref(o)("ap.apTable.setting.selectAll")),1)]),_:1},8,["onClick"])]),e.createVNode(e.unref(l.RadioGroup),{value:c.value,"onUpdate:value":t[0]||(t[0]=n=>c.value=n)},{default:e.withCtx(()=>[e.createVNode(e.unref(l.RadioButton),{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("ap.apTable.setting.sizeSmall")),1)]),_:1}),e.createVNode(e.unref(l.RadioButton),{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("ap.apTable.setting.sizeNormal")),1)]),_:1})]),_:1},8,["value"])],2),e.createVNode(e.unref(l.Divider),{dashed:"",style:{margin:"0px"}}),e.createVNode(O.default,{class:e.normalizeClass(e.unref(m)("left","content")),value:e.unref(a)},null,8,["class","value"])],2),e.createVNode(e.unref(l.Divider),{type:"vertical",style:{height:"100%",margin:"0px"}}),e.createElementVNode("div",{class:e.normalizeClass(e.unref(d)("right"))},[e.createVNode(I.default,{value:e.unref(a),"onUpdate:value":t[1]||(t[1]=n=>e.isRef(a)?a.value=n:null),onReset:B},null,8,["value"])],2)],2)]),_:1},8,["open","title"])],64))}});exports.default=U;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("@aplus-frontend/antdv"),D=require("../../../../utils/slot.js"),E=require("../../../context.js");require("../tree-select/index.vue.js");const A=require("../../../hooks/use-table-column-state.js");require("../../../../config-provider/index.js");require("../sorter/index.vue.js");const f=require("../utils.js"),R=require("@ant-design/icons-vue"),O=require("../../../../config-provider/hooks/use-locale.js"),N=require("../../../../config-provider/hooks/use-namespace.js"),I=require("../tree-select/index.vue2.js"),M=require("../sorter/index.vue2.js"),U={style:{lineHeight:"22px",color:"#8896B0"}},j=e.defineComponent({__name:"index",props:{config:{default:()=>({})}},setup(C){const s=C,{columnsBackup:S,size:V,updateSize:i,updateColumns:c}=E.useInjectApTable(),d=e.ref(e.unref(V)),_=e.computed(()=>s.config.persistenceKey),{columnState:a,setColumnState:x,isAllSelected:b,toggleSelectAll:y,columnStateBackup:k,setColumnStateBackup:h,cacheColumnStateIfNeeded:q}=A.useTableColumnState(s.config,_,[]),{t:o}=O.useLocale(),{b:p,be:m}=N.useNamespace("ap-column-setting"),{b:T}=N.useNamespace("ap-table"),r=e.ref(!1),B=e.useSlots(),g=D.getSingleVNode(B.trigger)||e.createVNode(l.Button,{icon:e.createVNode(R.SettingOutlined,null,null),class:T("setting-trigger-button")},null),v=g?e.cloneVNode(g,{onClick:()=>{r.value=!0}}):null;function z(){x(f.customCloneColumnStates(e.unref(k)))}function w(){var t,n;c==null||c(f.default(e.unref(S),e.unref(a))),i==null||i(e.unref(d)),r.value=!1;const u=f.customCloneColumnStates(a.value);h(u),q(u),(n=(t=s.config)==null?void 0:t.onChange)==null||n.call(t,u)}return(u,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(v)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v)),{key:0})):e.createCommentVNode("",!0),e.createVNode(e.unref(l.Modal),{open:r.value,"onUpdate:open":t[2]||(t[2]=n=>r.value=n),title:e.unref(o)("ap.apTable.setting.title"),width:900,centered:!0,"body-style":{padding:"0px !important",height:"450px"},onOk:w},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(p)("wrapper"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(p)("left"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(m)("left","header"))},[e.createElementVNode("div",null,[e.createElementVNode("span",U,e.toDisplayString(e.unref(o)("ap.apTable.setting.selectAllTip")),1),e.createVNode(e.unref(l.Button),{type:"link",size:"small",onClick:e.unref(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)?e.unref(o)("ap.apTable.setting.unSelectAll"):e.unref(o)("ap.apTable.setting.selectAll")),1)]),_:1},8,["onClick"])]),e.createVNode(e.unref(l.RadioGroup),{value:d.value,"onUpdate:value":t[0]||(t[0]=n=>d.value=n)},{default:e.withCtx(()=>[e.createVNode(e.unref(l.RadioButton),{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("ap.apTable.setting.sizeSmall")),1)]),_:1}),e.createVNode(e.unref(l.RadioButton),{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("ap.apTable.setting.sizeNormal")),1)]),_:1})]),_:1},8,["value"])],2),e.createVNode(e.unref(l.Divider),{dashed:"",style:{margin:"0px"}}),e.createVNode(I.default,{class:e.normalizeClass(e.unref(m)("left","content")),value:e.unref(a)},null,8,["class","value"])],2),e.createVNode(e.unref(l.Divider),{type:"vertical",style:{height:"100%",margin:"0px"}}),e.createElementVNode("div",{class:e.normalizeClass(e.unref(p)("right"))},[e.createVNode(M.default,{value:e.unref(a),"onUpdate:value":t[1]||(t[1]=n=>e.isRef(a)?a.value=n:null),onReset:z},null,8,["value"])],2)],2)]),_:1},8,["open","title"])],64))}});exports.default=j;
@@ -1838,6 +1838,7 @@ export declare const apTableRenderItemMap: {
1838
1838
  showToday: boolean;
1839
1839
  showTime: boolean | SharedTimeProps<Dayjs>;
1840
1840
  emptyText: string;
1841
+ formatBegins: boolean;
1841
1842
  }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
1842
1843
  P: {};
1843
1844
  B: {};
@@ -1874,6 +1875,7 @@ export declare const apTableRenderItemMap: {
1874
1875
  showToday: boolean;
1875
1876
  showTime: boolean | SharedTimeProps<Dayjs>;
1876
1877
  emptyText: string;
1878
+ formatBegins: boolean;
1877
1879
  }>;
1878
1880
  __isFragment?: never;
1879
1881
  __isTeleport?: never;
@@ -1909,6 +1911,7 @@ export declare const apTableRenderItemMap: {
1909
1911
  showToday: boolean;
1910
1912
  showTime: boolean | SharedTimeProps<Dayjs>;
1911
1913
  emptyText: string;
1914
+ formatBegins: boolean;
1912
1915
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
1913
1916
  $slots: Readonly<{
1914
1917
  dateRender: any;
@@ -1,6 +1,6 @@
1
- import { ApColumnState, ApTableSettingType } from '../interface';
2
1
  import { Ref, ComputedRef, ShallowRef } from 'vue';
3
- export declare const useTableColumnState: (columnSetting: ApTableSettingType, initialColumnState: ApColumnState[]) => {
2
+ import { ApColumnState, ApTableSettingType } from '../interface';
3
+ export declare const useTableColumnState: (columnSetting: ApTableSettingType, persistenceKey: Ref<string | undefined>, initialColumnState: ApColumnState[]) => {
4
4
  columnState: Ref<{
5
5
  key: string | number;
6
6
  show?: boolean | undefined;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),M=require("../../utils/index.js"),l=require("../components/setting/utils.js"),J=require("../context.js"),c=require("lodash-unified");function a(t,s){t.forEach(n=>{var o;s(n),(o=n.children)!=null&&o.length&&a(n.children,s)})}function R(t,s){if(!s)return{};const n=t.getItem(s);return n?JSON.parse(n):{}}function m(t,s){if(c.isObject(t)&&c.isObject(s))return c.mergeWith({},t,s,m)}const T=Number.MAX_SAFE_INTEGER;function W(t,s,n,o){return o?o.fixed:s?s.fixed:n&&"fixed"in n?n.fixed:c.isBoolean(t.fixed)?t.fixed?"left":void 0:t.fixed}const _=(t,s)=>{const n=i.ref(s),o=i.shallowRef(l.customCloneColumnStates(s)),{columnsBackup:S,updateColumns:h}=J.useInjectApTable(),O=t.persistenceType||"localStorage",C=window[O];function q(){const e=R(C,t.persistenceKey),r=c.mergeWith({},t.defaultValue||{},e,m),f=i.unref(S);function d(j,g,K){return j.map(u=>{var A,N;const k=(g==null?void 0:g[u.key])||{},x={key:u.key,label:u.title,show:!0,fixed:W(u,e[u.key],(A=t.defaultValue)==null?void 0:A[u.key],K),disabled:!1,...c.omit(k,["children","fixed"])};return x.children=(N=u.children)!=null&&N.length?d(u.children,k.children,x):void 0,x}).sort(B)}return d(f||[],r)}function B(e,r){const f=c.isNumber(e.order)?e.order:T;let d=c.isNumber(r.order)?r.order:T;return e.fixed==="right"&&r.fixed!=="right"&&(d=f-1),r.fixed==="left"&&e.fixed!=="left"&&(d=f-1),f-d}const y=i.computed(()=>i.unref(n).every(e=>e.show));function p(){const e=i.unref(n);a(e,r=>{!r.disabled&&(r.show=!0)})}function w(){const e=i.unref(n);a(e,r=>{!r.disabled&&(r.show=!1)})}function E(){i.unref(y)?w():p()}function F(e,r){a(i.unref(n),f=>{f.key===e&&(f.show=M.isDef(r)?r:!f.show)})}function b(e){n.value=e}function I(e){o.value=e}function v(e){if(t.persistenceKey){const r=l.getColumnStateString(e);C.setItem(t.persistenceKey,JSON.stringify(r))}}return i.watchEffect(()=>{var r;const e=q();b(e),(r=t.onChange)==null||r.call(t,e),h==null||h(l.default(i.unref(S),i.unref(e))),o.value=l.customCloneColumnStates(e),v(e)}),{columnState:n,selectAll:p,unSelectAll:w,toggleSelect:F,setColumnState:b,isAllSelected:y,toggleSelectAll:E,columnStateBackup:o,setColumnStateBackup:I,cacheColumnStateIfNeeded:v}};exports.useTableColumnState=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),R=require("../../utils/index.js"),l=require("../components/setting/utils.js"),W=require("../context.js"),d=require("lodash-unified");function a(r,n){r.forEach(i=>{var u;n(i),(u=i.children)!=null&&u.length&&a(i.children,n)})}function _(r,n){if(!n)return{};const i=r.getItem(n);return i?JSON.parse(i):{}}function O(r,n){if(d.isObject(r)&&d.isObject(n))return d.mergeWith({},r,n,O)}const T=Number.MAX_SAFE_INTEGER;function z(r,n,i,u){return u?u.fixed:n?n.fixed:i&&"fixed"in i?i.fixed:d.isBoolean(r.fixed)?r.fixed?"left":void 0:r.fixed}const D=(r,n,i)=>{const u=o.ref(i),h=o.shallowRef(l.customCloneColumnStates(i)),{columnsBackup:C,updateColumns:g}=W.useInjectApTable(),q=r.persistenceType||"localStorage",w=window[q];function B(){const e=_(w,o.unref(n)),t=d.mergeWith({},r.defaultValue||{},e,O),f=o.unref(C);function c(M,S,J){return M.map(s=>{var p,N;const A=(S==null?void 0:S[s.key])||{},x={key:s.key,label:s.title,show:!0,fixed:z(s,e[s.key],(p=r.defaultValue)==null?void 0:p[s.key],J),disabled:!1,...d.omit(A,["children","fixed"])};return x.children=(N=s.children)!=null&&N.length?c(s.children,A.children,x):void 0,x}).sort(E)}return c(f||[],t)}function E(e,t){const f=d.isNumber(e.order)?e.order:T;let c=d.isNumber(t.order)?t.order:T;return e.fixed==="right"&&t.fixed!=="right"&&(c=f-1),t.fixed==="left"&&e.fixed!=="left"&&(c=f-1),f-c}const b=o.computed(()=>o.unref(u).every(e=>e.show));function v(){const e=o.unref(u);a(e,t=>{!t.disabled&&(t.show=!0)})}function m(){const e=o.unref(u);a(e,t=>{!t.disabled&&(t.show=!1)})}function F(){o.unref(b)?m():v()}function I(e,t){a(o.unref(u),f=>{f.key===e&&(f.show=R.isDef(t)?t:!f.show)})}function y(e){u.value=e}function j(e){h.value=e}function k(e){if(o.unref(n)){const t=l.getColumnStateString(e);w.setItem(o.unref(n),JSON.stringify(t))}}return o.watchEffect(()=>{var t;const e=B();y(e),(t=r.onChange)==null||t.call(r,e),g==null||g(l.default(o.unref(C),o.unref(e))),h.value=l.customCloneColumnStates(e),k(e)}),{columnState:u,selectAll:v,unSelectAll:m,toggleSelect:I,setColumnState:y,isAllSelected:b,toggleSelectAll:F,columnStateBackup:h,setColumnStateBackup:j,cacheColumnStateIfNeeded:k}};exports.useTableColumnState=D;
@@ -10,5 +10,6 @@ declare const _default: DefineComponent<ApFormItemBatchInputProps, {}, {}, {}, {
10
10
  hasFeedback: boolean;
11
11
  autoLink: boolean;
12
12
  validateFirst: boolean;
13
+ defaultSelectedAllKey: boolean;
13
14
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
14
15
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue");require("./index.vue2.js");require("../../ap-form/item/index.vue2.js");const s=require("@aplus-frontend/utils"),f=require("lodash-unified"),y=require("../../ap-form/item/index.vue.js"),_=require("./index.vue.js"),b=a.defineComponent({__name:"form-item",props:{htmlFor:{},prefixCls:{},label:{},help:{},extra:{},labelCol:{},wrapperCol:{},hasFeedback:{type:Boolean,default:!1},colon:{type:Boolean,default:void 0},labelAlign:{},prop:{},name:{},rules:{},autoLink:{type:Boolean,default:!0},required:{type:Boolean,default:void 0},validateFirst:{type:Boolean,default:void 0},validateStatus:{},validateTrigger:{},messageVariables:{},hidden:{type:Boolean},noStyle:{type:Boolean},tooltip:{},span:{},order:{},offset:{},push:{},pull:{},xs:{},sm:{},md:{},lg:{},xl:{},xxl:{},flex:{},bordered:{type:Boolean,default:!1},valuePropName:{},initialValue:{},_signal:{},transform:{},field:{default:()=>({})},disabled:{type:Boolean,default:void 0},placeholer:{},trim:{type:Boolean,default:!0}},setup(m){const l=m,p=a.computed(()=>(l==null?void 0:l.transform)||{flat:!1,transformer:e=>{var u,o,r,i,n,d;if(e)return!(e!=null&&e.value)||((u=e==null?void 0:e.value)==null?void 0:u.length)<1?void 0:(o=l==null?void 0:l.field)!=null&&o.options?{...e,value:(i=(r=e==null?void 0:e.value)==null?void 0:r.filter(t=>s.isValid(t==null?void 0:t.trim())))==null?void 0:i.map(t=>l.trim?t==null?void 0:t.trim():t)}:(d=(n=e==null?void 0:e.value)==null?void 0:n.filter(t=>s.isValid(t==null?void 0:t.trim())))==null?void 0:d.map(t=>l.trim?t==null?void 0:t.trim():t)}}),c=a.computed(()=>{var e;return((e=l.field)==null?void 0:e.style)||"width:auto"}),v=a.computed(()=>{var e,u;return(l==null?void 0:l.initialValue)||{key:(u=(e=l==null?void 0:l.field)==null?void 0:e.options)==null?void 0:u.map(o=>o.value)}});return(e,u)=>{var o,r;return a.openBlock(),a.createBlock(y.default,a.mergeProps(a.unref(f.omit)(l,["field","initialValue","transform","placeholder","disabled"]),{"initial-value":v.value,transform:p.value,bordered:(r=(o=e.field)==null?void 0:o.options)!=null&&r.length?!1:e.bordered}),{default:a.withCtx(()=>[a.createVNode(_.default,a.mergeProps(a.unref(f.omit)(l.field,["style"]),{style:c.value,disabled:e.disabled,placeholer:e.placeholer}),null,16,["style","disabled","placeholer"])]),_:1},16,["initial-value","transform","bordered"])}}});exports.default=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue");require("./index.vue2.js");require("../../ap-form/item/index.vue2.js");const f=require("@aplus-frontend/utils"),i=require("lodash-unified"),y=require("../../ap-form/index.js"),_=require("../../ap-form/item/index.vue.js"),h=require("./index.vue.js"),b=o.defineComponent({__name:"form-item",props:{htmlFor:{},prefixCls:{},label:{},help:{},extra:{},labelCol:{},wrapperCol:{},hasFeedback:{type:Boolean,default:!1},colon:{type:Boolean,default:void 0},labelAlign:{},prop:{},name:{},rules:{},autoLink:{type:Boolean,default:!0},required:{type:Boolean,default:void 0},validateFirst:{type:Boolean,default:void 0},validateStatus:{},validateTrigger:{},messageVariables:{},hidden:{type:Boolean},noStyle:{type:Boolean},tooltip:{},span:{},order:{},offset:{},push:{},pull:{},xs:{},sm:{},md:{},lg:{},xl:{},xxl:{},flex:{},bordered:{type:Boolean,default:!1},valuePropName:{},initialValue:{},_signal:{},transform:{},field:{default:()=>({})},disabled:{type:Boolean,default:void 0},placeholer:{},trim:{type:Boolean,default:!0},defaultSelectedAllKey:{type:Boolean,default:!0}},setup(p){const l=p,m=o.computed(()=>(l==null?void 0:l.transform)||{flat:!1,transformer:e=>{var a,r,u,d,n,s;if(e)return!(e!=null&&e.value)||((a=e==null?void 0:e.value)==null?void 0:a.length)<1?void 0:(r=l==null?void 0:l.field)!=null&&r.options?{...e,value:(d=(u=e==null?void 0:e.value)==null?void 0:u.filter(t=>f.isValid(t==null?void 0:t.trim())))==null?void 0:d.map(t=>l.trim?t==null?void 0:t.trim():t)}:(s=(n=e==null?void 0:e.value)==null?void 0:n.filter(t=>f.isValid(t==null?void 0:t.trim())))==null?void 0:s.map(t=>l.trim?t==null?void 0:t.trim():t)}}),c=(e,a)=>{var r,u,d;return!(l!=null&&l.initialValue)&&l.defaultSelectedAllKey&&i.isEmpty(a.value)&&((d=a["onUpdate:value"])==null||d.call(a,{key:(u=(r=l==null?void 0:l.field)==null?void 0:r.options)==null?void 0:u.map(n=>n.value)})),i.merge(i.omit(e,["style"]),a)},v=o.computed(()=>{var e;return((e=l.field)==null?void 0:e.style)||"width:auto"});return(e,a)=>{var r,u;return o.openBlock(),o.createBlock(_.default,o.mergeProps(o.unref(i.omit)(l,["field","transform","placeholder","disabled"]),{transform:m.value,bordered:(u=(r=e.field)==null?void 0:r.options)!=null&&u.length?!1:e.bordered}),{default:o.withCtx(()=>[o.createVNode(o.unref(y.ApForm).ControlRender,null,{default:o.withCtx(({...d})=>[o.createVNode(h.default,o.mergeProps(c(l.field,d),{style:v.value,disabled:e.disabled,placeholer:e.placeholer}),null,16,["style","disabled","placeholer"])]),_:1})]),_:1},16,["transform","bordered"])}}});exports.default=b;
@@ -39,4 +39,9 @@ export type ApFormItemBatchInputProps = ApFormItemProps & {
39
39
  disabled?: boolean;
40
40
  placeholer?: string;
41
41
  trim?: boolean;
42
+ /**
43
+ * 是否默认选择所有的key
44
+ * @default true
45
+ */
46
+ defaultSelectedAllKey?: boolean;
42
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -470,16 +470,16 @@
470
470
  .aplus-ap-table-table tr > th.ant-table-cell::before {
471
471
  background-color: #D8DDE5 !important;
472
472
  }
473
- .aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
473
+ .aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
474
474
  padding: 12px 16px;
475
475
  }
476
- .aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell {
476
+ .aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
477
477
  padding: 12px 16px;
478
478
  }
479
- .aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell {
479
+ .aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
480
480
  padding: 9px 16px;
481
481
  }
482
- .aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell {
482
+ .aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
483
483
  padding: 9px 16px;
484
484
  }
485
485
  .aplus-ap-table .ant-table-placeholder .ant-table-expanded-row-fixed::after {
@@ -70,16 +70,16 @@
70
70
  background-color: var(--ap-table-header-bg, #F2F6F9);
71
71
  }
72
72
  }
73
- .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
73
+ .ant-table.ant-table-middle .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
74
74
  padding: 12px 16px;
75
75
  }
76
- .ant-table.ant-table-middle .ant-table-thead .ant-table-cell {
76
+ .ant-table.ant-table-middle .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
77
77
  padding: 12px 16px;
78
78
  }
79
- .ant-table.ant-table-small .ant-table-row .ant-table-cell {
79
+ .ant-table.ant-table-small .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
80
80
  padding: 9px 16px;
81
81
  }
82
- .ant-table.ant-table-small .ant-table-thead .ant-table-cell {
82
+ .ant-table.ant-table-small .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
83
83
  padding: 9px 16px;
84
84
  }
85
85
  .ant-table-placeholder .ant-table-expanded-row-fixed {
@@ -470,16 +470,16 @@
470
470
  .aplus-ap-table-table tr > th.ant-table-cell::before {
471
471
  background-color: #D8DDE5 !important;
472
472
  }
473
- .aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
473
+ .aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
474
474
  padding: 12px 16px;
475
475
  }
476
- .aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell {
476
+ .aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
477
477
  padding: 12px 16px;
478
478
  }
479
- .aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell {
479
+ .aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
480
480
  padding: 9px 16px;
481
481
  }
482
- .aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell {
482
+ .aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
483
483
  padding: 9px 16px;
484
484
  }
485
485
  .aplus-ap-table .ant-table-placeholder .ant-table-expanded-row-fixed::after {
package/theme/index.css CHANGED
@@ -1049,16 +1049,16 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
1049
1049
  .aplus-ap-table-table tr > th.ant-table-cell::before {
1050
1050
  background-color: #D8DDE5 !important;
1051
1051
  }
1052
- .aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
1052
+ .aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
1053
1053
  padding: 12px 16px;
1054
1054
  }
1055
- .aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell {
1055
+ .aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
1056
1056
  padding: 12px 16px;
1057
1057
  }
1058
- .aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell {
1058
+ .aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
1059
1059
  padding: 9px 16px;
1060
1060
  }
1061
- .aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell {
1061
+ .aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
1062
1062
  padding: 9px 16px;
1063
1063
  }
1064
1064
  .aplus-ap-table .ant-table-placeholder .ant-table-expanded-row-fixed::after {