@dazhicheng/ui 1.6.0 → 1.6.1

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 (124) hide show
  1. package/dist/components/tt-api-component/index.js +4 -3
  2. package/dist/components/tt-api-component/index.vue2.js +4 -3
  3. package/dist/components/tt-area/TtArea.vue3.js +8 -7
  4. package/dist/components/tt-button/index.js +5 -4
  5. package/dist/components/tt-button/index.vue2.js +4 -3
  6. package/dist/components/tt-checkbox/index.js +4 -3
  7. package/dist/components/tt-checkbox/index.vue.js +4 -3
  8. package/dist/components/tt-drawer/index.js +4 -3
  9. package/dist/components/tt-drawer/src/RenderDrawer.vue.js +4 -3
  10. package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +8 -7
  11. package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +3 -2
  12. package/dist/components/tt-drawer/src/props.js +3 -2
  13. package/dist/components/tt-drawer/src/utils/drawer-api.js +4 -2
  14. package/dist/components/tt-empty/index.js +9 -8
  15. package/dist/components/tt-form/index.js +10 -9
  16. package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +3 -2
  17. package/dist/components/tt-form/src/components/FormActions.vue2.js +4 -2
  18. package/dist/components/tt-form/src/form/FormDescription.vue.js +3 -2
  19. package/dist/components/tt-form/src/form/FormItem.vue.js +6 -5
  20. package/dist/components/tt-form/src/form/FormLabel.vue.js +8 -7
  21. package/dist/components/tt-form/src/form/RenderContent.vue.js +4 -3
  22. package/dist/components/tt-form/src/form-render/FormField.vue2.js +30 -28
  23. package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +4 -2
  24. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +1 -0
  25. package/dist/components/tt-form/src/form-render/array-register/utils.js +6 -4
  26. package/dist/components/tt-form/src/form-render/dependencies.js +19 -18
  27. package/dist/components/tt-form/src/form-render/form.vue2.js +4 -2
  28. package/dist/components/tt-form/src/form-render/helper.js +15 -14
  29. package/dist/components/tt-form/src/form-render/rootWrapperClass.js +3 -2
  30. package/dist/components/tt-form/src/formApi.js +3 -2
  31. package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +4 -3
  32. package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +2 -0
  33. package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +4 -2
  34. package/dist/components/tt-form/src/group-form/groupFormApi.js +4 -3
  35. package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +3 -2
  36. package/dist/components/tt-form/src/hooks/useSelectCollapse.js +28 -27
  37. package/dist/components/tt-form/src/index.vue2.js +3 -2
  38. package/dist/components/tt-form/src/useFormContext.js +11 -10
  39. package/dist/components/tt-form-item-error-tooltip/index.js +5 -4
  40. package/dist/components/tt-form-item-error-tooltip/index.vue.js +4 -3
  41. package/dist/components/tt-icon/index.js +6 -5
  42. package/dist/components/tt-image/index.js +6 -5
  43. package/dist/components/tt-image/src/components/ImageViewer.js +7 -6
  44. package/dist/components/tt-loading/index.js +4 -3
  45. package/dist/components/tt-loading/src/directive.js +24 -23
  46. package/dist/components/tt-log/index.js +4 -3
  47. package/dist/components/tt-log/index.vue.js +3 -2
  48. package/dist/components/tt-modal/index.js +3 -2
  49. package/dist/components/tt-modal/src/RenderModal.vue.js +3 -2
  50. package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +3 -2
  51. package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +3 -2
  52. package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +15 -14
  53. package/dist/components/tt-modal/src/props.js +3 -2
  54. package/dist/components/tt-modal/src/utils/modal-api.js +4 -2
  55. package/dist/components/tt-modal-form/index.vue.js +4 -3
  56. package/dist/components/tt-nav-anchor/index.js +4 -3
  57. package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +15 -14
  58. package/dist/components/tt-panel-select/index.js +4 -3
  59. package/dist/components/tt-panel-select/src/hooks/usePanelData.js +4 -3
  60. package/dist/components/tt-panel-select/src/index.vue.js +3 -2
  61. package/dist/components/tt-radio-group/index.js +4 -3
  62. package/dist/components/tt-radio-group/index.vue.js +7 -6
  63. package/dist/components/tt-select/index.js +4 -3
  64. package/dist/components/tt-select/src/Select.vue.d.ts +8 -8
  65. package/dist/components/tt-select/src/Select.vue.js +4 -3
  66. package/dist/components/tt-select/src/components/SelectTable.vue.d.ts +116 -7
  67. package/dist/components/tt-select/src/components/SelectTable.vue.js +3 -2
  68. package/dist/components/tt-select/src/components/Table.vue.d.ts +4 -4
  69. package/dist/components/tt-select/src/components/Table.vue.js +3 -2
  70. package/dist/components/tt-select/src/hooks/useDataSource.js +4 -3
  71. package/dist/components/tt-select/src/hooks/useKeyboard.d.ts +7 -1
  72. package/dist/components/tt-select/src/hooks/useSelect.js +3 -2
  73. package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
  74. package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +28 -27
  75. package/dist/components/tt-select/src/props.d.ts +2 -2
  76. package/dist/components/tt-table/index.d.ts +6 -6
  77. package/dist/components/tt-table/index.js +1 -1
  78. package/dist/components/tt-table/src/Table.vue.d.ts +4 -4
  79. package/dist/components/tt-table/src/Table.vue.js +3 -2
  80. package/dist/components/tt-table/src/TableForm.vue.d.ts +6 -6
  81. package/dist/components/tt-table/src/TableForm.vue.js +2 -2
  82. package/dist/components/tt-table/src/components/TableAction.vue.js +19 -17
  83. package/dist/components/tt-table/src/components/TableButtons.js +10 -9
  84. package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +4 -3
  85. package/dist/components/tt-table/src/components/TableToolbarTools.vue.js +18 -17
  86. package/dist/components/tt-table/src/emits.d.ts +10 -1
  87. package/dist/components/tt-table/src/hooks/useColumnPersistence.js +17 -16
  88. package/dist/components/tt-table/src/hooks/useColumns.js +4 -3
  89. package/dist/components/tt-table/src/hooks/useKeyboardNav.js +34 -33
  90. package/dist/components/tt-table/src/hooks/usePagination.js +12 -11
  91. package/dist/components/tt-table/src/hooks/useQuery.js +6 -5
  92. package/dist/components/tt-table/src/hooks/useRowIdentity.js +4 -3
  93. package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +2 -6
  94. package/dist/components/tt-table/src/hooks/useRowSelection.js +28 -27
  95. package/dist/components/tt-table/src/hooks/useSideSlot.js +4 -3
  96. package/dist/components/tt-table/src/hooks/useSyncProps.js +4 -3
  97. package/dist/components/tt-table/src/hooks/useTableData.js +6 -5
  98. package/dist/components/tt-table/src/hooks/useTableFooter.js +9 -8
  99. package/dist/components/tt-table/src/hooks/useTableForm.js +4 -3
  100. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +37 -4
  101. package/dist/components/tt-table/src/props.d.ts +12 -6
  102. package/dist/components/tt-table/src/props.js +14 -7
  103. package/dist/components/tt-table/src/table-mutation-events.js +10 -9
  104. package/dist/components/tt-table/src/types/table.d.ts +16 -0
  105. package/dist/components/tt-table/src/utils/action-tab-index.js +15 -14
  106. package/dist/components/tt-table/src/utils/context.js +5 -4
  107. package/dist/components/tt-table/src/utils/table-api.js +4 -2
  108. package/dist/components/tt-table/src/utils/table-form-api.js +22 -20
  109. package/dist/components/tt-text/index.js +4 -3
  110. package/dist/components/tt-upload/index.js +6 -5
  111. package/dist/components/tt-upload/src/TtUpload.vue.js +4 -3
  112. package/dist/directives/disabled-tip/index.js +9 -8
  113. package/dist/hooks/useFormSchemasLink.js +4 -3
  114. package/dist/hooks/useFormat.d.ts +35 -71
  115. package/dist/hooks/useFormat.js +28 -39
  116. package/dist/hooks/usePanelSelectSchemas.js +4 -3
  117. package/dist/hooks/useScreenshotOss.js +16 -15
  118. package/dist/packages/hooks/src/useDebounce.js +5 -4
  119. package/dist/packages/hooks/src/useElementScreenshot.js +4 -3
  120. package/dist/packages/hooks/src/usePriorityValue.js +5 -4
  121. package/dist/packages/utils/src/format.js +48 -0
  122. package/dist/plugins/default/renderCellContent.js +4 -3
  123. package/dist/plugins/vxeTable/switchStatus.js +14 -13
  124. package/package.json +3 -3
@@ -0,0 +1,48 @@
1
+ import i from "dayjs";
2
+ import f from "numeral";
3
+ import { isNumber as s, isNullOrUnDef as u } from "./is.js";
4
+ const m = "0,0.00", a = "YYYY-MM-DD HH:mm:ss", c = "YYYY-MM-DD";
5
+ function B(r, t = m) {
6
+ return r ? f(r).format(t) : "0.00";
7
+ }
8
+ function D(r, t = m) {
9
+ return r ? f(r).format(t) : "0.00";
10
+ }
11
+ function g(r) {
12
+ return r ? f(f(r).format(m)).value() : 0;
13
+ }
14
+ function A(r, t) {
15
+ if (u(r) || r === "") return "";
16
+ let n = Number.parseFloat(r.toString());
17
+ if (Number.isNaN(n)) return "";
18
+ n = Math.round(n * 10 ** t) / 10 ** t;
19
+ let o = n.toString(), e = o.indexOf(".");
20
+ for (e < 0 && (e = o.length, o += "."); o.length <= e + t; ) o += "0";
21
+ return o;
22
+ }
23
+ function Y(r, t = 2) {
24
+ if (u(r) || r === 0) return "0 Bytes";
25
+ const n = 1e3, o = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], e = Math.floor(Math.log(r) / Math.log(n));
26
+ return `${Number.parseFloat((r / n ** e).toFixed(t))} ${o[e]}`;
27
+ }
28
+ function h(r, t = "period") {
29
+ if (!r) return "";
30
+ const n = (s(r) ? r.toString() : r).replace(/[-.]/g, ""), o = n.slice(0, 4), e = n.slice(4, 6);
31
+ return t === "period" ? `${o}年${e}期` : ` ${e}/${o}`;
32
+ }
33
+ function N(r, t = a) {
34
+ return u(r) ? "--" : i(r).isValid() ? i(r).format(t) : "--";
35
+ }
36
+ function O(r, t = c, n = !1) {
37
+ return u(r) ? "--" : n ? r ? i(+r).format(t) : "--" : i(r).isValid() ? i(r).format(t) : "--";
38
+ }
39
+ export {
40
+ B as formatAmount,
41
+ D as formatAmountOfPlace,
42
+ A as formatDecimal,
43
+ Y as formatFileSize,
44
+ h as formatPeriod,
45
+ g as formatPlaceOfAmount,
46
+ O as formatToDate,
47
+ N as formatToDateTime
48
+ };
@@ -2,8 +2,9 @@ import { h as l, defineComponent as w, shallowRef as b, onMounted as $ } from "v
2
2
  import "axios";
3
3
  import "element-plus";
4
4
  import { isFunction as c } from "../../packages/utils/src/is.js";
5
- import "xe-utils";
6
5
  import "dayjs";
6
+ import "numeral";
7
+ import "xe-utils";
7
8
  import "dayjs/plugin/utc";
8
9
  import "dayjs/plugin/timezone";
9
10
  import "../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
@@ -12,7 +13,7 @@ import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8
12
13
  import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
13
14
  import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
14
15
  import { cloneDeep as f } from "lodash-es";
15
- function Y() {
16
+ function _() {
16
17
  return {
17
18
  install(C) {
18
19
  C.renderer.add("renderCellContent", {
@@ -65,5 +66,5 @@ function Y() {
65
66
  };
66
67
  }
67
68
  export {
68
- Y as createVxePluginRenderCellContent
69
+ _ as createVxePluginRenderCellContent
69
70
  };
@@ -3,8 +3,9 @@ import { omit as U } from "lodash-es";
3
3
  import { h as w, defineComponent as _, ref as y } from "vue";
4
4
  import "axios";
5
5
  import { isFunction as u } from "../../packages/utils/src/is.js";
6
- import "xe-utils";
7
6
  import "dayjs";
7
+ import "numeral";
8
+ import "xe-utils";
8
9
  import "dayjs/plugin/utc";
9
10
  import "dayjs/plugin/timezone";
10
11
  import "../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
@@ -35,31 +36,31 @@ function j(a) {
35
36
  inactive: t.inactiveValue ?? O
36
37
  };
37
38
  }
38
- function oe() {
39
+ function ae() {
39
40
  return {
40
41
  install(a) {
41
42
  a.renderer.add("switchStatus", {
42
43
  renderTableDefault(t, l) {
43
- const { row: i, column: n } = l, e = t.props ?? {}, v = U(e, [...D]), E = C(v);
44
+ const { row: i, column: r } = l, e = t.props ?? {}, v = U(e, [...D]), E = C(v);
44
45
  return w(
45
46
  _({
46
47
  name: "TtVxeSwitchCell",
47
48
  setup: () => {
48
- const s = y(!1), { active: r, inactive: m } = j(e);
49
+ const s = y(!1), { active: n, inactive: m } = j(e);
49
50
  return () => w(L, {
50
- activeValue: r,
51
+ activeValue: n,
51
52
  inactiveValue: m,
52
53
  ...E,
53
- modelValue: i[n.field],
54
+ modelValue: i[r.field],
54
55
  loading: s.value,
55
56
  "onUpdate:modelValue": (o) => {
56
- i[n.field] = o;
57
+ i[r.field] = o;
57
58
  },
58
59
  beforeChange: async () => {
59
60
  var d;
60
- const o = i[n.field];
61
+ const o = i[r.field];
61
62
  if ((u(e.beforeChange) ? await ((d = e.beforeChange) == null ? void 0 : d.call(e, o)) : !0) === !1 || !u(e.api)) return !1;
62
- const T = o === r ? m : r, b = `是否确认${o === r ? "关闭" : "开启"}`;
63
+ const T = o === n ? m : n, b = `是否确认${o === n ? "关闭" : "开启"}`;
63
64
  let p = !1;
64
65
  return await x({
65
66
  title: e.confirmTitle || "温馨提示",
@@ -72,9 +73,9 @@ function oe() {
72
73
  var h, V;
73
74
  if (B === "confirm") {
74
75
  f.confirmButtonLoading = !0;
75
- let c = { [n.field]: T, id: i.id };
76
+ let c = { [r.field]: T, id: i.id };
76
77
  if (s.value = !0, u(e.beforeFetch)) {
77
- const S = await ((h = e.beforeFetch) == null ? void 0 : h.call(e, c, i, n));
78
+ const S = await ((h = e.beforeFetch) == null ? void 0 : h.call(e, c, i, r));
78
79
  c = {
79
80
  ...c,
80
81
  ...S
@@ -83,7 +84,7 @@ function oe() {
83
84
  const F = await e.api(c).finally(() => {
84
85
  s.value = !1, f.confirmButtonLoading = !1;
85
86
  });
86
- (V = e.afterFetch) == null || V.call(e, F), A.success(o === r ? "禁用成功" : "启用成功"), f.confirmButtonLoading = !1, g(), p = !0;
87
+ (V = e.afterFetch) == null || V.call(e, F), A.success(o === n ? "禁用成功" : "启用成功"), f.confirmButtonLoading = !1, g(), p = !0;
87
88
  } else
88
89
  g();
89
90
  }
@@ -99,5 +100,5 @@ function oe() {
99
100
  };
100
101
  }
101
102
  export {
102
- oe as createVxePluginSwitchStatus
103
+ ae as createVxePluginSwitchStatus
103
104
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/ui",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -65,8 +65,8 @@
65
65
  "lodash-es": "^4.17.23",
66
66
  "vue": "^3.5.21",
67
67
  "vue-router": "^5.0.2",
68
- "vxe-pc-ui": "^4.12.36",
69
- "vxe-table": "^4.17.48",
68
+ "vxe-pc-ui": "^4.14.15",
69
+ "vxe-table": "^4.18.13",
70
70
  "@dazhicheng/hooks": "1.4.53",
71
71
  "@dazhicheng/utils": "1.3.50"
72
72
  },