@aplus-frontend/ui 0.0.22 → 0.0.24

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 (41) hide show
  1. package/es/src/ap-field/date/index.vue.mjs +26 -26
  2. package/es/src/ap-field/number/helper.d.ts +9 -0
  3. package/es/src/ap-field/number/helper.mjs +20 -11
  4. package/es/src/ap-table/ap-table.vue.d.ts +2137 -112
  5. package/es/src/ap-table/ap-table.vue.mjs +31 -30
  6. package/es/src/check-card/group.vue.d.ts +1 -1
  7. package/es/src/check-card/group.vue.mjs +1 -1
  8. package/es/src/check-card/index.vue.d.ts +1 -1
  9. package/es/src/check-card/index.vue2.mjs +40 -36
  10. package/es/src/check-card/interface.d.ts +1 -1
  11. package/es/src/check-card/style/index.css +1 -0
  12. package/es/src/editable-table/form-item.vue.d.ts +755 -105
  13. package/es/src/editable-table/form-item.vue.mjs +80 -65
  14. package/es/src/editable-table/hooks/use-get-columns.mjs +27 -27
  15. package/es/src/editable-table/index.vue.d.ts +527 -112
  16. package/es/src/editable-table/index.vue.mjs +93 -78
  17. package/es/src/editable-table/interface.d.ts +11 -5
  18. package/es/src/editable-table/utils.d.ts +13 -0
  19. package/es/src/editable-table/utils.mjs +26 -6
  20. package/es/src/theme/check-card/index.css +1 -0
  21. package/lib/src/ap-field/date/index.vue.js +1 -1
  22. package/lib/src/ap-field/number/helper.d.ts +9 -0
  23. package/lib/src/ap-field/number/helper.js +1 -1
  24. package/lib/src/ap-table/ap-table.vue.d.ts +2137 -112
  25. package/lib/src/ap-table/ap-table.vue.js +1 -1
  26. package/lib/src/check-card/group.vue.d.ts +1 -1
  27. package/lib/src/check-card/group.vue.js +1 -1
  28. package/lib/src/check-card/index.vue.d.ts +1 -1
  29. package/lib/src/check-card/index.vue2.js +1 -1
  30. package/lib/src/check-card/interface.d.ts +1 -1
  31. package/lib/src/check-card/style/index.css +1 -0
  32. package/lib/src/editable-table/form-item.vue.d.ts +755 -105
  33. package/lib/src/editable-table/form-item.vue.js +1 -1
  34. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  35. package/lib/src/editable-table/index.vue.d.ts +527 -112
  36. package/lib/src/editable-table/index.vue.js +1 -1
  37. package/lib/src/editable-table/interface.d.ts +11 -5
  38. package/lib/src/editable-table/utils.d.ts +13 -0
  39. package/lib/src/editable-table/utils.js +1 -1
  40. package/lib/src/theme/check-card/index.css +1 -0
  41. package/package.json +5 -5
@@ -1,16 +1,17 @@
1
- import { defineComponent as L, useSlots as z, ref as j, watch as I, unref as o, openBlock as p, createBlock as O, withCtx as i, createVNode as c, mergeProps as T, createSlots as K, createElementBlock as q, Fragment as A, createElementVNode as x, normalizeClass as G, toDisplayString as H, createCommentVNode as M, renderList as U, renderSlot as W, normalizeProps as $, guardReactiveProps as J } from "vue";
2
- import { Table as Q } from "ant-design-vue";
3
- import { ApForm as u } from "../ap-form/index.mjs";
4
- import { cloneDeep as C, omit as X } from "lodash-unified";
1
+ import { defineComponent as T, useSlots as K, ref as M, watch as q, unref as a, openBlock as w, createBlock as G, withCtx as c, createVNode as y, mergeProps as H, createSlots as U, createElementBlock as W, Fragment as $, createElementVNode as v, normalizeClass as J, toDisplayString as Q, createCommentVNode as X, renderList as Y, renderSlot as Z, normalizeProps as ee, guardReactiveProps as te } from "vue";
2
+ import { Table as ae } from "ant-design-vue";
3
+ import { ApForm as f } from "../ap-form/index.mjs";
4
+ import { isNumber as p, cloneDeep as x, omit as ne } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
6
  import "../hooks/index.mjs";
7
- import { isDef as Y } from "../utils/index.mjs";
8
- import Z from "./hooks/use-get-columns.mjs";
7
+ import { isDef as h } from "../utils/index.mjs";
8
+ import { getColumnIsRequired as oe } from "./utils.mjs";
9
+ import le from "./hooks/use-get-columns.mjs";
9
10
  import "./style/index.css";
10
- import { useNamespace as ee } from "../config-provider/hooks/use-namespace.mjs";
11
- import { useGlobalConfig as ae } from "../config-provider/hooks/use-global-config.mjs";
12
- import { useControllableValue as te } from "../hooks/useControllableValue.mjs";
13
- const xe = /* @__PURE__ */ L({
11
+ import { useNamespace as re } from "../config-provider/hooks/use-namespace.mjs";
12
+ import { useGlobalConfig as se } from "../config-provider/hooks/use-global-config.mjs";
13
+ import { useControllableValue as ue } from "../hooks/useControllableValue.mjs";
14
+ const be = /* @__PURE__ */ T({
14
15
  name: "EditableTable",
15
16
  __name: "index",
16
17
  props: {
@@ -109,94 +110,108 @@ const xe = /* @__PURE__ */ L({
109
110
  onFieldChange: {}
110
111
  },
111
112
  emits: ["update:value"],
112
- setup(g, {
113
- expose: h,
114
- emit: w
113
+ setup(b, {
114
+ expose: R,
115
+ emit: B
115
116
  }) {
116
- const l = g, {
117
- b: m,
118
- em: y
119
- } = ee("editable-table"), v = ae("uiMode", "aplus"), b = z(), R = w, {
117
+ const l = b, {
118
+ b: g,
119
+ em: F
120
+ } = re("editable-table"), D = se("uiMode", "aplus"), _ = K(), E = B, {
120
121
  value: s,
121
- updateValue: B
122
- } = te(l, R), d = j(), F = u.useWatch(l.name, d);
123
- I(() => F.value, (t) => {
122
+ updateValue: L
123
+ } = ue(l, E), u = M(), k = f.useWatch(l.name, u);
124
+ q(() => k.value, (e) => {
124
125
  var n;
125
- B(t), (n = l.onChange) == null || n.call(l, t);
126
+ L(e), (n = l.onChange) == null || n.call(l, e);
126
127
  });
127
- const D = Z(l);
128
- function E() {
128
+ const N = le(l);
129
+ function S() {
130
+ var e;
131
+ (e = u.value) == null || e.resetFields();
132
+ }
133
+ async function V(e, n) {
129
134
  var t;
130
- (t = d.value) == null || t.resetFields();
135
+ const o = await ((t = u.value) == null ? void 0 : t.validateFields(e, n));
136
+ return o == null ? void 0 : o[l.name];
131
137
  }
132
- async function _(t, n) {
133
- var a;
134
- const e = await ((a = d.value) == null ? void 0 : a.validateFields(t, n));
135
- return e == null ? void 0 : e[l.name];
138
+ function z(e, n) {
139
+ var r, d, i;
140
+ const o = ((r = a(s)) == null ? void 0 : r.length) || 0;
141
+ if (h(l.maxLength) && o >= l.maxLength)
142
+ return;
143
+ const t = [...a(s) || []];
144
+ h(n) ? t.splice(n, 0, {
145
+ ...e || {}
146
+ }) : t.push({
147
+ ...e || {}
148
+ }), (i = (d = u.value) == null ? void 0 : d.setFieldValue) == null || i.call(d, l.name, t);
136
149
  }
137
- function k(t) {
138
- var e, a, r;
139
- const n = ((e = o(s)) == null ? void 0 : e.length) || 0;
140
- Y(l.maxLength) && n >= l.maxLength || (r = (a = d.value) == null ? void 0 : a.setFieldValue) == null || r.call(a, l.name, [...o(s) || [], t || {}]);
150
+ function P(e, n = "suffix") {
151
+ var i, m, C;
152
+ const o = ((i = a(s)) == null ? void 0 : i.length) || 0, t = p(e) ? e : e.length;
153
+ if (h(l.maxLength) && o + t > l.maxLength)
154
+ return;
155
+ const r = [...a(s) || []], d = p(e) ? new Array(e).fill({}) : x(e);
156
+ n === "suffix" ? r.push(...d) : r.unshift(...d), (C = (m = u.value) == null ? void 0 : m.setFieldValue) == null || C.call(m, l.name, r);
141
157
  }
142
- function S(t) {
143
- var e, a;
144
- const n = C(o(s) || []);
145
- n.splice(t, 1), (a = (e = d.value) == null ? void 0 : e.setFieldValue) == null || a.call(e, l.name, [...n]);
158
+ function j(e) {
159
+ var t, r;
160
+ let n = x(a(s) || []);
161
+ const o = p(e) ? [e] : e;
162
+ n = n.filter((d, i) => !o.includes(i)), (r = (t = u.value) == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, n);
146
163
  }
147
- function V() {
148
- return o(s);
164
+ function A() {
165
+ return a(s);
149
166
  }
150
- function N(t) {
167
+ function I(e) {
151
168
  var n;
152
- return (n = o(s)) == null ? void 0 : n[t];
169
+ return (n = a(s)) == null ? void 0 : n[e];
153
170
  }
154
- function P(t, n) {
155
- var a, r;
156
- const e = C(o(s));
157
- e[t] && (e[t] = {
158
- ...e[t],
171
+ function O(e, n) {
172
+ var t, r;
173
+ const o = x(a(s));
174
+ o[e] && (o[e] = {
175
+ ...o[e],
159
176
  ...n
160
- }, (r = (a = d.value) == null ? void 0 : a.setFieldValue) == null || r.call(a, l.name, [...e]));
177
+ }, (r = (t = u.value) == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, [...o]));
161
178
  }
162
- return h({
163
- resetFields: E,
164
- validateFields: _,
165
- add: k,
166
- remove: S,
167
- getRowData: N,
168
- getRowsData: V,
169
- setRowData: P
170
- }), (t, n) => (p(), O(o(u), {
179
+ return R({
180
+ resetFields: S,
181
+ validateFields: V,
182
+ add: z,
183
+ remove: j,
184
+ getRowData: I,
185
+ getRowsData: A,
186
+ setRowData: O,
187
+ addMultiple: P
188
+ }), (e, n) => (w(), G(a(f), {
171
189
  "initial-values": {
172
- [l.name]: o(s)
190
+ [l.name]: a(s)
173
191
  },
174
192
  ref_key: "formRef",
175
- ref: d
193
+ ref: u
176
194
  }, {
177
- default: i(() => [c(o(u).FormItem, {
178
- name: t.name,
195
+ default: c(() => [y(a(f).FormItem, {
196
+ name: e.name,
179
197
  "no-style": ""
180
198
  }, {
181
- default: i(() => [c(o(Q), T(o(X)(l, ["name", "value", "onUpdate:value", "maxLength"]), {
182
- class: [o(m)(), o(v) === "admin" ? o(m)("admin") : null],
183
- columns: o(D),
184
- "data-source": o(s)
185
- }), K({
186
- headerCell: i(({
187
- column: e
188
- }) => {
189
- var a, r, f;
190
- return [(a = e == null ? void 0 : e.fieldProps) != null && a.required || (f = (r = e == null ? void 0 : e.fieldProps) == null ? void 0 : r.rules) != null && f.length ? (p(), q(A, {
191
- key: 0
192
- }, [x("span", {
193
- class: G(o(y)("header-cell", "required"))
194
- }, "*", 2), x("span", null, H(e.title), 1)], 64)) : M("", !0)];
195
- }),
199
+ default: c(() => [y(a(ae), H(a(ne)(l, ["name", "value", "onUpdate:value", "maxLength"]), {
200
+ class: [a(g)(), a(D) === "admin" ? a(g)("admin") : null],
201
+ columns: a(N),
202
+ "data-source": a(s)
203
+ }), U({
204
+ headerCell: c(({
205
+ column: o
206
+ }) => [a(oe)(o) ? (w(), W($, {
207
+ key: 0
208
+ }, [v("span", {
209
+ class: J(a(F)("header-cell", "required"))
210
+ }, "*", 2), v("span", null, Q(o.title), 1)], 64)) : X("", !0)]),
196
211
  _: 2
197
- }, [U(b, (e, a) => ({
198
- name: a,
199
- fn: i((r) => [W(t.$slots, a, $(J(r || {})))])
212
+ }, [Y(_, (o, t) => ({
213
+ name: t,
214
+ fn: c((r) => [Z(e.$slots, t, ee(te(r || {})))])
200
215
  }))]), 1040, ["class", "columns", "data-source"])]),
201
216
  _: 3
202
217
  }, 8, ["name"])]),
@@ -205,5 +220,5 @@ const xe = /* @__PURE__ */ L({
205
220
  }
206
221
  });
207
222
  export {
208
- xe as default
223
+ be as default
209
224
  };
@@ -124,17 +124,23 @@ export type EditableTableExpose<ModelType = any, RecordType = any> = {
124
124
  */
125
125
  validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<ModelType>> | undefined;
126
126
  /**
127
- * 添加一行数据
128
- * @param defaultValue
129
- * @returns
127
+ * 添加单条数据
128
+ * @param defaultValue 默认值,如果需要设置`insertIndex`,可以设置`defaultValue`为`{}`
129
+ * @param insertIndex 数据插入的位置
130
+ */
131
+ add: (defaultValue?: Partial<RecordType>, insertIndex?: number) => void;
132
+ /**
133
+ * 添加多条数据
134
+ * @param list 添加的条数或数据
135
+ * @param insetIn 插入的位置(前/后)
130
136
  */
131
- add: (defaultValue?: Partial<RecordType>) => void;
137
+ addMultiple: (list: number | Partial<RecordType>[], insetIn?: 'prefix' | 'suffix') => void;
132
138
  /**
133
139
  * 删除一行数据
134
140
  * @param index
135
141
  * @returns
136
142
  */
137
- remove: (index: number) => void;
143
+ remove: (index: number | number[]) => void;
138
144
  /**
139
145
  * 获取所有行的数据
140
146
  * @returns
@@ -6,3 +6,16 @@ import { EditableColumnType } from './interface';
6
6
  * @returns
7
7
  */
8
8
  export declare function getEditableComponent(valueType: EditableColumnType['valueType']): any;
9
+ /**
10
+ * 获取可编辑表格的某列字段是否是required
11
+ * @param column
12
+ * @returns
13
+ */
14
+ export declare function getColumnIsRequired(column: EditableColumnType<any, 'text'>): boolean;
15
+ /**
16
+ * 获取ellipsis模式下最终需要渲染的字符串
17
+ * @param column
18
+ * @param value
19
+ * @returns
20
+ */
21
+ export declare function getRawDisplayValue(column: EditableColumnType, value: any): any;
@@ -1,10 +1,30 @@
1
- import { apTableFormItemMap as o } from "../ap-table/constants.mjs";
2
- function r(e) {
3
- const n = o[e];
4
- return n || console.warn(
1
+ import { isFunction as i, isArray as o } from "lodash-unified";
2
+ import { apTableFormItemMap as f } from "../ap-table/constants.mjs";
3
+ import { isDef as n } from "../utils/index.mjs";
4
+ import { getValueStr as p } from "../ap-field/number/helper.mjs";
5
+ function P(e) {
6
+ const r = f[e];
7
+ return r || console.warn(
5
8
  `${e} can not render because of no default renderer, use customRender instead.`
6
- ), n;
9
+ ), r;
10
+ }
11
+ function m(e) {
12
+ if (!e.fieldProps)
13
+ return !1;
14
+ const r = i(e.fieldProps) ? e.fieldProps({}) : e.fieldProps;
15
+ return n(r.required) ? r.required : (o(r.rules) ? r.rules : r.rules ? [r.rules] : []).some((s) => s.required);
16
+ }
17
+ function b(e, r) {
18
+ if (e.valueType === "text" || e.valueType === "textArea")
19
+ return r || "--";
20
+ if (e.valueType === "number") {
21
+ const t = e.fieldProps ? i(e.fieldProps) ? e.fieldProps({}) : e.fieldProps : {};
22
+ return p(r, t) || "--";
23
+ }
24
+ return r;
7
25
  }
8
26
  export {
9
- r as getEditableComponent
27
+ m as getColumnIsRequired,
28
+ P as getEditableComponent,
29
+ b as getRawDisplayValue
10
30
  };
@@ -102,6 +102,7 @@
102
102
  top: 0;
103
103
  right: 0;
104
104
  z-index: 1;
105
+ line-height: 1;
105
106
  -webkit-user-select: none;
106
107
  -moz-user-select: none;
107
108
  user-select: none;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("dayjs"),b=require("ant-design-vue"),f=require("./constant.js");require("../../hooks/index.js");const m=require("lodash-unified"),S=require("./helper.js"),T=require("@aplus-frontend/utils"),_=require("../../hooks/useControllableValue.js"),M=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(v,{emit:y}){const o=v,h=y,{value:u,updateValue:c}=_.useControllableValue(o,h),l=e.computed(()=>f.ApFieldDatePresetFormats.indexOf(o.format)>-1),d=e.computed(()=>l.value?f.PRESET_FORMAT_MAP[o.format]:o.format),g=e.computed(()=>{if(m.isNil(e.unref(u)))return;let t=r(e.unref(u));return o.timezone&&(t=r(T.getTimeFormatToZone(e.unref(u),o.timezone))),t}),B=e.computed(()=>e.unref(l)?o.picker??f.PRESET_FORMAT_PICK_MAP[o.format]:o.picker),k=e.computed(()=>{const t=e.unref(l)?f.PRESET_FORMAT_TIME_MAP[o.format]:{};return{...m.omit(o,["value","defaultValue","onChange","onOk","format","onUpdate:value","mode"]),...t}}),p=S.formatDayWithTimezone(o.timezone);function O(t){if(m.isNil(t)){c(null);return}const n=r(t);e.unref(l)?c(p(n,e.unref(d))):c(n.valueOf())}function P(t,n){var s;const i=r(t),a=t?e.unref(l)?p(i,e.unref(d)):i.valueOf():null;(s=o.onChange)==null||s.call(o,a,n)}function C(t){var a;const n=r(t),i=t?e.unref(l)?p(n,e.unref(d)):n.valueOf():null;(a=o.onOk)==null||a.call(o,i)}return(t,n)=>t.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(u)?e.unref(r)(e.unref(u)).format(d.value):t.emptyText),1)],64)):(e.openBlock(),e.createBlock(e.unref(b.DatePicker),e.mergeProps({key:1},k.value,{value:g.value,format:d.value,"onUpdate:value":O,onChange:P,onOk:C,picker:B.value}),e.createSlots({_:2},[e.renderList(t.$slots,(i,a)=>({name:a,fn:e.withCtx(s=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(s||{})))])}))]),1040,["value","format","picker"]))}});exports.default=M;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("dayjs"),b=require("ant-design-vue"),s=require("./constant.js");require("../../hooks/index.js");const v=require("lodash-unified"),S=require("./helper.js"),T=require("@aplus-frontend/utils"),_=require("../../hooks/useControllableValue.js"),M=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,g=h,{value:f,updateValue:c}=_.useControllableValue(o,g),l=e.computed(()=>s.ApFieldDatePresetFormats.indexOf(o.format)>-1),r=e.computed(()=>l.value?s.PRESET_FORMAT_MAP[o.format]:o.format),p=e.computed(()=>{if(v.isNil(e.unref(f)))return;let t=u(e.unref(f));return o.timezone&&(t=u(T.getTimeFormatToZone(e.unref(f),o.timezone))),t}),B=e.computed(()=>e.unref(l)?o.picker??s.PRESET_FORMAT_PICK_MAP[o.format]:o.picker),k=e.computed(()=>{const t=e.unref(l)?s.PRESET_FORMAT_TIME_MAP[o.format]:{};return{...v.omit(o,["value","defaultValue","onChange","onOk","format","onUpdate:value","mode"]),...t}}),m=S.formatDayWithTimezone(o.timezone);function O(t){if(v.isNil(t)){c(null);return}const n=u(t);e.unref(l)?c(m(n,e.unref(r))):c(n.valueOf())}function P(t,n){var i;const d=u(t),a=t?e.unref(l)?m(d,e.unref(r)):d.valueOf():null;(i=o.onChange)==null||i.call(o,a,n)}function C(t){var a;const n=u(t),d=t?e.unref(l)?m(n,e.unref(r)):n.valueOf():null;(a=o.onOk)==null||a.call(o,d)}return(t,n)=>t.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(p.value?e.unref(u)(p.value).format(r.value):t.emptyText),1)],64)):(e.openBlock(),e.createBlock(e.unref(b.DatePicker),e.mergeProps({key:1},k.value,{value:p.value,format:r.value,"onUpdate:value":O,onChange:P,onOk:C,picker:B.value}),e.createSlots({_:2},[e.renderList(t.$slots,(d,a)=>({name:a,fn:e.withCtx(i=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(i||{})))])}))]),1040,["value","format","picker"]))}});exports.default=M;
@@ -1 +1,10 @@
1
+ import { ApFieldNumberProps } from '../interface';
2
+
1
3
  export declare function addZeroToDecimalPlaces(numStr: string, precision?: number): string;
4
+ /**
5
+ * 获取字符串类型的值
6
+ * @param value
7
+ * @param options
8
+ * @returns
9
+ */
10
+ export declare function getValueStr(value?: number, options?: ApFieldNumberProps): string | undefined;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lodash-unified");function a(t,l){if(o.isNil(l))return t;let[i,e=""]=t.split(".");if(e.length>=l)return t;for(let r=e.length;r<l;r++)e+="0";return i+"."+e}exports.addZeroToDecimalPlaces=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("lodash-unified"),u=require("@fruits-chain/utils");function i(l,e){if(c.isNil(e))return l;let[a,r=""]=l.split(".");if(r.length>=e)return l;for(let t=r.length;t<e;t++)r+="0";return a+"."+r}function f(l,e){const a=l;if(c.isNil(a))return e==null?void 0:e.emptyText;let r=e!=null&&e.thousands?u.toDecimalMark(a,e.precision):String(a);return e!=null&&e.precision&&e.limitDecimalsRetain&&(r=i(r,e.precision)),r}exports.addZeroToDecimalPlaces=i;exports.getValueStr=f;