@aplus-frontend/ui 0.0.40 → 0.1.0

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 (57) hide show
  1. package/es/src/ap-action/item/index.vue2.mjs +19 -20
  2. package/es/src/ap-action/item-modal/index.vue.mjs +7 -6
  3. package/es/src/ap-action/style/item.css +10 -25
  4. package/es/src/ap-field/checkbox/index.vue.mjs +32 -27
  5. package/es/src/ap-field/checkbox/style.css +7 -0
  6. package/es/src/ap-field/interface.d.ts +2 -0
  7. package/es/src/ap-field/radio/index.vue.d.ts +3 -0
  8. package/es/src/ap-field/radio/index.vue.mjs +44 -29
  9. package/es/src/ap-field/radio/style.css +4 -0
  10. package/es/src/ap-table/ap-table.vue.mjs +125 -126
  11. package/es/src/ap-table/constants.d.ts +15 -0
  12. package/es/src/ap-table/style/ap-table.css +1 -21
  13. package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +10 -9
  14. package/es/src/check-card/index.vue2.mjs +44 -48
  15. package/es/src/check-card/style/index.css +10 -42
  16. package/es/src/design-token/index.mjs +4 -2
  17. package/es/src/editable-table/form-item.vue.mjs +57 -58
  18. package/es/src/editable-table/index.vue.mjs +54 -55
  19. package/es/src/editable-table/style/index.css +1 -21
  20. package/es/src/locale/lang/en.mjs +1 -1
  21. package/es/src/locale/lang/zh-cn.mjs +22 -22
  22. package/es/src/theme/ap-action/item.css +10 -25
  23. package/es/src/theme/ap-field/checkbox.css +7 -0
  24. package/es/src/theme/ap-field/radio.css +4 -0
  25. package/es/src/theme/ap-table/ap-table.css +1 -21
  26. package/es/src/theme/check-card/index.css +10 -42
  27. package/es/src/theme/css-var/index.mjs +83 -19
  28. package/es/src/theme/editable-table/index.css +1 -21
  29. package/lib/src/ap-action/item/index.vue2.js +1 -1
  30. package/lib/src/ap-action/item-modal/index.vue.js +1 -1
  31. package/lib/src/ap-action/style/item.css +10 -25
  32. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  33. package/lib/src/ap-field/checkbox/style.css +7 -0
  34. package/lib/src/ap-field/interface.d.ts +2 -0
  35. package/lib/src/ap-field/radio/index.vue.d.ts +3 -0
  36. package/lib/src/ap-field/radio/index.vue.js +1 -1
  37. package/lib/src/ap-field/radio/style.css +4 -0
  38. package/lib/src/ap-table/ap-table.vue.js +1 -1
  39. package/lib/src/ap-table/constants.d.ts +15 -0
  40. package/lib/src/ap-table/style/ap-table.css +1 -21
  41. package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
  42. package/lib/src/check-card/index.vue2.js +1 -1
  43. package/lib/src/check-card/style/index.css +10 -42
  44. package/lib/src/design-token/index.js +1 -1
  45. package/lib/src/editable-table/form-item.vue.js +1 -1
  46. package/lib/src/editable-table/index.vue.js +1 -1
  47. package/lib/src/editable-table/style/index.css +1 -21
  48. package/lib/src/locale/lang/en.js +1 -1
  49. package/lib/src/locale/lang/zh-cn.js +1 -1
  50. package/lib/src/theme/ap-action/item.css +10 -25
  51. package/lib/src/theme/ap-field/checkbox.css +7 -0
  52. package/lib/src/theme/ap-field/radio.css +4 -0
  53. package/lib/src/theme/ap-table/ap-table.css +1 -21
  54. package/lib/src/theme/check-card/index.css +10 -42
  55. package/lib/src/theme/css-var/index.js +1 -1
  56. package/lib/src/theme/editable-table/index.css +1 -21
  57. package/package.json +2 -2
@@ -1,10 +1,9 @@
1
- import { defineComponent as y, ref as v, unref as l, computed as d, renderSlot as u, openBlock as t, createElementBlock as c, normalizeClass as B, createBlock as m, createCommentVNode as f, isVNode as A, resolveDynamicComponent as h, toDisplayString as I } from "vue";
1
+ import { defineComponent as y, ref as C, unref as s, computed as d, renderSlot as c, openBlock as l, createElementBlock as u, normalizeClass as b, createBlock as f, createCommentVNode as m, isVNode as v, resolveDynamicComponent as B, toDisplayString as A } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import L from "ant-design-vue/es/button/LoadingIcon";
3
+ import h from "ant-design-vue/es/button/LoadingIcon";
4
4
  import "../style/item.css";
5
- import { useNamespace as N } from "../../config-provider/hooks/use-namespace.mjs";
6
- import { useGlobalConfig as x } from "../../config-provider/hooks/use-global-config.mjs";
7
- const D = { key: 1 }, G = /* @__PURE__ */ y({
5
+ import { useNamespace as I } from "../../config-provider/hooks/use-namespace.mjs";
6
+ const L = { key: 1 }, $ = /* @__PURE__ */ y({
8
7
  name: "ApActionItem",
9
8
  __name: "index",
10
9
  props: {
@@ -17,40 +16,40 @@ const D = { key: 1 }, G = /* @__PURE__ */ y({
17
16
  loading: { type: Boolean, default: !1 }
18
17
  },
19
18
  setup(p) {
20
- const o = p, { b: g, m: s, bm: b } = N("action-item"), k = x("uiMode", "aplus"), a = v(!1);
19
+ const o = p, { b: g, m: t } = I("action-item"), a = C(!1);
21
20
  function r(e) {
22
21
  var i;
23
- l(n) || o.disabled || ((i = o.onClick) == null || i.call(o, e), o.onAction && (a.value = !0, o.onAction(e).finally(() => a.value = !1)));
22
+ s(n) || o.disabled || ((i = o.onClick) == null || i.call(o, e), o.onAction && (a.value = !0, o.onAction(e).finally(() => a.value = !1)));
24
23
  }
25
- const n = d(() => o.loading || l(a)), C = d(() => [
24
+ const n = d(() => o.loading || s(a)), k = d(() => [
26
25
  g(),
27
- b(l(k), o.color),
28
- o.disabled ? s("disabled") : null,
29
- n.value ? s("loading") : null
26
+ t(o.color),
27
+ o.disabled ? t("disabled") : null,
28
+ n.value ? t("loading") : null
30
29
  ].filter(Boolean));
31
- return (e, i) => u(e.$slots, "trigger", {
30
+ return (e, i) => c(e.$slots, "trigger", {
32
31
  loading: n.value,
33
32
  disabled: e.disabled,
34
33
  onClick: r
35
34
  }, () => [
36
- e.visible ? (t(), c("span", {
35
+ e.visible ? (l(), u("span", {
37
36
  key: 0,
38
37
  onClick: r,
39
- class: B(C.value)
38
+ class: b(k.value)
40
39
  }, [
41
- n.value ? (t(), m(l(L), {
40
+ n.value ? (l(), f(s(h), {
42
41
  key: 0,
43
42
  prefixCls: "btn",
44
43
  existIcon: !1,
45
44
  loading: ""
46
- })) : f("", !0),
47
- u(e.$slots, "default", {}, () => [
48
- A(e.text) ? (t(), m(h(e.text), { key: 0 })) : (t(), c("span", D, I(e.text || ""), 1))
45
+ })) : m("", !0),
46
+ c(e.$slots, "default", {}, () => [
47
+ v(e.text) ? (l(), f(B(e.text), { key: 0 })) : (l(), u("span", L, A(e.text || ""), 1))
49
48
  ])
50
- ], 2)) : f("", !0)
49
+ ], 2)) : m("", !0)
51
50
  ]);
52
51
  }
53
52
  });
54
53
  export {
55
- G as default
54
+ $ as default
56
55
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as c, useSlots as m, openBlock as d, createBlock as p, mergeProps as f, unref as u, createSlots as _, renderList as A, withCtx as P, renderSlot as y, normalizeProps as k, guardReactiveProps as B } from "vue";
2
- import { Modal as x } from "ant-design-vue";
1
+ import { defineComponent as c, useSlots as m, openBlock as d, createBlock as p, mergeProps as f, unref as u, createSlots as _, renderList as A, withCtx as P, renderSlot as y, normalizeProps as k, guardReactiveProps as x } from "vue";
2
+ import { Modal as B } from "ant-design-vue";
3
3
  import "../item/index.vue.mjs";
4
4
  import { omit as g } from "lodash-unified";
5
5
  import h from "../item/index.vue2.mjs";
6
- const M = /* @__PURE__ */ c({
6
+ const z = /* @__PURE__ */ c({
7
7
  name: "ApActionItemModal",
8
8
  __name: "index",
9
9
  props: {
@@ -19,8 +19,9 @@ const M = /* @__PURE__ */ c({
19
19
  setup(a) {
20
20
  const l = m(), o = a;
21
21
  async function i(t) {
22
- x.confirm({
22
+ B.confirm({
23
23
  ...o.modalProps,
24
+ zIndex: 1060,
24
25
  onOk: async () => {
25
26
  var n, r, e;
26
27
  (r = (n = o.modalProps).onOk) == null || r.call(n), await ((e = o.onAction) == null ? void 0 : e.call(o, t));
@@ -31,12 +32,12 @@ const M = /* @__PURE__ */ c({
31
32
  A(l, (r, e) => ({
32
33
  name: e,
33
34
  fn: P((s) => [
34
- y(t.$slots, e, k(B(s || {})))
35
+ y(t.$slots, e, k(x(s || {})))
35
36
  ])
36
37
  }))
37
38
  ]), 1040));
38
39
  }
39
40
  });
40
41
  export {
41
- M as default
42
+ z as default
42
43
  };
@@ -4,35 +4,20 @@
4
4
  line-height: 22px;
5
5
  cursor: pointer;
6
6
  }
7
- .aplus-action-item-aplus--primary {
8
- color: #0070ff;
7
+ .aplus-action-item--primary {
8
+ color: var(--ap-action-color-primary-base);
9
9
  }
10
- .aplus-action-item-aplus--primary:not(.aplus-action-item--disabled):hover {
11
- color: #66a9ff;
10
+ .aplus-action-item--primary:not(.aplus-action-item--disabled):hover {
11
+ color: var(--ap-action-color-primary-hover);
12
12
  }
13
- .aplus-action-item-admin--primary {
14
- color: #1890FF;
13
+ .aplus-action-item--success {
14
+ color: var(--ap-action-color-success);
15
15
  }
16
- .aplus-action-item-admin--primary:not(.aplus-action-item--disabled):hover {
17
- color: #5EB1FF;
16
+ .aplus-action-item--error {
17
+ color: var(--ap-action-color-error);
18
18
  }
19
- .aplus-action-item-aplus--success {
20
- color: #2ed1a3;
21
- }
22
- .aplus-action-item-aplus--error {
23
- color: #FF4D4F;
24
- }
25
- .aplus-action-item-aplus--warn {
26
- color: #FFA940;
27
- }
28
- .aplus-action-item-admin--success {
29
- color: #52C41A;
30
- }
31
- .aplus-action-item-admin--error {
32
- color: #FF4D4F;
33
- }
34
- .aplus-action-item-admin--warn {
35
- color: #FAAD14;
19
+ .aplus-action-item--warn {
20
+ color: var(--ap-action-color-warn);
36
21
  }
37
22
  .aplus-action-item--loading {
38
23
  opacity: 0.35;
@@ -1,10 +1,13 @@
1
- import { defineComponent as g, ref as m, onMounted as h, openBlock as o, createElementBlock as a, Fragment as l, unref as e, createTextVNode as d, toDisplayString as f, createBlock as c, mergeProps as C } from "vue";
2
- import { isFunction as V, isNil as b, omit as _ } from "lodash-unified";
3
- import { Spin as q, CheckboxGroup as B } from "ant-design-vue";
1
+ import { defineComponent as h, ref as m, onMounted as b, openBlock as o, createElementBlock as l, Fragment as n, unref as e, createTextVNode as c, toDisplayString as d, createBlock as f, mergeProps as C } from "vue";
2
+ import { isFunction as V, isNil as B, omit as q } from "lodash-unified";
3
+ import { Spin as T, CheckboxGroup as U } from "ant-design-vue";
4
4
  import "../../hooks/index.mjs";
5
- import { getOptionValue as T, getOptionLabel as U } from "./helper.mjs";
6
- import { useControllableValue as F } from "../../hooks/useControllableValue.mjs";
7
- const E = /* @__PURE__ */ g({
5
+ import { getOptionValue as _, getOptionLabel as F } from "./helper.mjs";
6
+ import "../../config-provider/index.mjs";
7
+ import "./style.css";
8
+ import { useNamespace as N } from "../../config-provider/hooks/use-namespace.mjs";
9
+ import { useControllableValue as O } from "../../hooks/useControllableValue.mjs";
10
+ const w = /* @__PURE__ */ h({
8
11
  name: "ApFieldCheckbox",
9
12
  inheritAttrs: !1,
10
13
  __name: "index",
@@ -22,44 +25,46 @@ const E = /* @__PURE__ */ g({
22
25
  disabled: { type: Boolean },
23
26
  id: {},
24
27
  emptyText: { default: "--" },
25
- request: {}
28
+ request: {},
29
+ vertical: { type: Boolean }
26
30
  },
27
31
  emits: ["update:value"],
28
32
  setup(v, { emit: y }) {
29
- const k = y, t = v, n = m(t.options), u = m(!1);
30
- h(() => {
31
- V(t.request) && (u.value = !0, t.request().then((r) => n.value = r).finally(() => {
32
- u.value = !1;
33
+ const k = y, t = v, i = m(t.options), { m: x } = N("field-checkbox"), r = m(!1);
34
+ b(() => {
35
+ V(t.request) && (r.value = !0, t.request().then((a) => i.value = a).finally(() => {
36
+ r.value = !1;
33
37
  }));
34
38
  });
35
- const { value: i, updateValue: x } = F(
39
+ const { value: u, updateValue: g } = O(
36
40
  t,
37
41
  k,
38
42
  {
39
43
  defaultValue: []
40
44
  }
41
45
  );
42
- return (r, O) => {
43
- var s;
44
- return r.mode === "read" ? (o(), a(l, { key: 0 }, [
45
- e(b)(e(i)) ? (o(), a(l, { key: 0 }, [
46
- d(f(t.emptyText), 1)
47
- ], 64)) : (o(), a(l, { key: 1 }, [
48
- d(f(((s = n.value) == null ? void 0 : s.filter((p) => e(i).indexOf(e(T)(p)) > -1).map((p) => e(U)(p)).join("、")) || t.emptyText), 1)
46
+ return (a, A) => {
47
+ var p;
48
+ return a.mode === "read" ? (o(), l(n, { key: 0 }, [
49
+ e(B)(e(u)) ? (o(), l(n, { key: 0 }, [
50
+ c(d(t.emptyText), 1)
51
+ ], 64)) : (o(), l(n, { key: 1 }, [
52
+ c(d(((p = i.value) == null ? void 0 : p.filter((s) => e(u).indexOf(e(_)(s)) > -1).map((s) => e(F)(s)).join("、")) || t.emptyText), 1)
49
53
  ], 64))
50
- ], 64)) : (o(), a(l, { key: 1 }, [
51
- u.value ? (o(), c(e(q), {
54
+ ], 64)) : (o(), l(n, { key: 1 }, [
55
+ r.value ? (o(), f(e(T), {
52
56
  key: 0,
53
57
  size: "small"
54
- })) : (o(), c(e(B), C({ key: 1 }, e(_)(t, ["onUpdate:value", "value", "request"]), {
55
- options: n.value,
56
- value: e(i),
57
- "onUpdate:value": e(x)
58
- }), null, 16, ["options", "value", "onUpdate:value"]))
58
+ })) : (o(), f(e(U), C({ key: 1 }, e(q)(t, ["onUpdate:value", "value", "request", "vertical"]), {
59
+ options: i.value,
60
+ value: e(u),
61
+ "onUpdate:value": e(g),
62
+ class: a.vertical ? e(x)("vertical") : null
63
+ }), null, 16, ["options", "value", "onUpdate:value", "class"]))
59
64
  ], 64));
60
65
  };
61
66
  }
62
67
  });
63
68
  export {
64
- E as default
69
+ w as default
65
70
  };
@@ -0,0 +1,7 @@
1
+ .aplus-field-checkbox--vertical {
2
+ display: inline-block;
3
+ }
4
+ .aplus-field-checkbox--vertical label.ant-checkbox-wrapper:not(:last-child) {
5
+ display: flex;
6
+ margin-block-end: 16px;
7
+ }
@@ -33,6 +33,7 @@ export type ApFieldTextExpose = {
33
33
  export type ApFieldCheckboxProps = BasicApFieldProps<CheckboxGroupProps> & {
34
34
  emptyText?: string;
35
35
  request?: () => Promise<CheckboxGroupProps['options']>;
36
+ vertical?: boolean;
36
37
  };
37
38
  export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' | 'value' | 'defaultValue' | 'onChange' | 'onOk' | 'format' | 'onUpdate:value'>> & {
38
39
  emptyText?: string;
@@ -64,6 +65,7 @@ export type ApiFieldNumberExpose = {
64
65
  export type ApFieldRadioProps = BasicApFieldProps<RadioGroupProps> & {
65
66
  emptyText?: string;
66
67
  request?: () => Promise<RadioGroupProps['options']>;
68
+ vertical?: boolean;
67
69
  };
68
70
  export type ApiFieldRadioExpose = {
69
71
  focus: () => void;
@@ -6,6 +6,7 @@ declare function blur(): void;
6
6
  declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldRadioProps>, {
7
7
  emptyText: string;
8
8
  mode: string;
9
+ vertical: boolean;
9
10
  }>, {
10
11
  focus: typeof focus;
11
12
  blur: typeof blur;
@@ -14,10 +15,12 @@ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRunt
14
15
  }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldRadioProps>, {
15
16
  emptyText: string;
16
17
  mode: string;
18
+ vertical: boolean;
17
19
  }>>> & {
18
20
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
19
21
  }, {
20
22
  mode: FieldMode;
23
+ vertical: boolean;
21
24
  emptyText: string;
22
25
  }, {}>;
23
26
  export default _default;
@@ -1,10 +1,13 @@
1
- import { defineComponent as V, ref as i, onMounted as q, computed as B, unref as o, openBlock as n, createElementBlock as m, Fragment as d, createTextVNode as C, toDisplayString as R, createBlock as f, mergeProps as U } from "vue";
2
- import { Spin as h, RadioGroup as G } from "ant-design-vue";
1
+ import { defineComponent as _, ref as i, onMounted as q, computed as C, unref as o, openBlock as l, createElementBlock as m, Fragment as c, createTextVNode as R, toDisplayString as U, createBlock as d, mergeProps as h } from "vue";
2
+ import { Spin as G, RadioGroup as N } from "ant-design-vue";
3
3
  import "../../hooks/index.mjs";
4
4
  import { isNil as S, omit as z } from "lodash-unified";
5
- import { getOptionValue as F, getOptionLabel as N } from "./helper.mjs";
6
- import { useControllableValue as O } from "../../hooks/useControllableValue.mjs";
7
- const j = /* @__PURE__ */ V({
5
+ import { getOptionValue as F, getOptionLabel as O } from "./helper.mjs";
6
+ import "./style.css";
7
+ import "../../config-provider/index.mjs";
8
+ import { useControllableValue as A } from "../../hooks/useControllableValue.mjs";
9
+ import { useNamespace as D } from "../../config-provider/hooks/use-namespace.mjs";
10
+ const K = /* @__PURE__ */ _({
8
11
  name: "ApFieldRadio",
9
12
  __name: "index",
10
13
  props: {
@@ -23,54 +26,66 @@ const j = /* @__PURE__ */ V({
23
26
  onChange: {},
24
27
  "onUpdate:value": {},
25
28
  emptyText: { default: "--" },
26
- request: {}
29
+ request: {},
30
+ vertical: { type: Boolean, default: !1 }
27
31
  },
28
32
  emits: ["update:value"],
29
- setup(c, { expose: v, emit: y }) {
30
- const t = c, g = y, l = i(), u = i((t == null ? void 0 : t.options) || []), { value: s, updateValue: x } = O(t, g), r = i(!1);
33
+ setup(f, { expose: v, emit: y }) {
34
+ const t = f, g = y, n = i(), u = i((t == null ? void 0 : t.options) || []), { value: s, updateValue: k } = A(t, g), { m: x } = D("field-radio"), r = i(!1);
31
35
  q(() => {
32
36
  var e;
33
37
  t.request && (r.value = !0, (e = t.request) == null || e.call(t).then((a) => u.value = a).finally(() => {
34
38
  r.value = !1;
35
39
  }));
36
40
  });
37
- const k = B(() => {
41
+ const b = C(() => {
38
42
  var p;
39
43
  const e = o(s);
40
44
  if (S(e))
41
45
  return t.emptyText;
42
46
  const a = (p = u.value) == null ? void 0 : p.find(
43
- (_) => e === F(_)
47
+ (V) => e === F(V)
44
48
  );
45
- return N(a) || t.emptyText;
49
+ return O(a) || t.emptyText;
46
50
  });
47
- function b() {
51
+ function T() {
48
52
  var e;
49
- (e = l.value) == null || e.focus();
53
+ (e = n.value) == null || e.focus();
50
54
  }
51
- function T() {
55
+ function B() {
52
56
  var e;
53
- (e = l.value) == null || e.blur();
57
+ (e = n.value) == null || e.blur();
54
58
  }
55
59
  return v({
56
- focus: b,
57
- blur: T
58
- }), (e, a) => e.mode === "read" ? (n(), m(d, { key: 0 }, [
59
- C(R(k.value), 1)
60
- ], 64)) : (n(), m(d, { key: 1 }, [
61
- r.value ? (n(), f(o(h), {
60
+ focus: T,
61
+ blur: B
62
+ }), (e, a) => e.mode === "read" ? (l(), m(c, { key: 0 }, [
63
+ R(U(b.value), 1)
64
+ ], 64)) : (l(), m(c, { key: 1 }, [
65
+ r.value ? (l(), d(o(G), {
62
66
  key: 0,
63
67
  size: "small"
64
- })) : (n(), f(o(G), U({ key: 1 }, o(z)(t, ["value", "onUpdate:value", "options", "request"]), {
65
- value: o(s),
66
- "onUpdate:value": o(x),
67
- options: u.value,
68
- ref_key: "radioGroupRef",
69
- ref: l
70
- }), null, 16, ["value", "onUpdate:value", "options"]))
68
+ })) : (l(), d(o(N), h(
69
+ { key: 1 },
70
+ o(z)(t, [
71
+ "value",
72
+ "onUpdate:value",
73
+ "options",
74
+ "request",
75
+ "vertical"
76
+ ]),
77
+ {
78
+ value: o(s),
79
+ "onUpdate:value": o(k),
80
+ options: u.value,
81
+ ref_key: "radioGroupRef",
82
+ ref: n,
83
+ class: e.vertical ? o(x)("vertical") : null
84
+ }
85
+ ), null, 16, ["value", "onUpdate:value", "options", "class"]))
71
86
  ], 64));
72
87
  }
73
88
  });
74
89
  export {
75
- j as default
90
+ K as default
76
91
  };
@@ -0,0 +1,4 @@
1
+ .aplus-field-radio--vertical label.ant-radio-wrapper:not(:last-child) {
2
+ display: flex;
3
+ margin-block-end: 16px;
4
+ }