@dt-frames/ui 1.0.15 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -144,7 +144,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
144
144
  getFormBindValue: import("vue").ComputedRef<Recordable<any>>;
145
145
  getFormClass: import("vue").ComputedRef<(string | {
146
146
  'basic-form--compact': boolean;
147
- 'basic-form--search': boolean;
148
147
  })[]>;
149
148
  formModel: Recordable<any>;
150
149
  getLayout: import("vue").ComputedRef<"vertical" | "horizontal" | "inline">;
@@ -1,6 +1,8 @@
1
1
  import { ComponentType } from "../types/form.type";
2
2
  import type { ValidationRule } from 'ant-design-vue/lib/form/Form';
3
3
  export declare function createPlaceholder(component: ComponentType): "" | "请输入" | "请选择" | "请设置图标";
4
+ export declare const SINGLE_DATA_TYPE: string[];
5
+ export declare const MULTIFY_DATA_TYPE: string[];
4
6
  export declare function setComponentRuleType(rule: ValidationRule, component: ComponentType, valueFormat: string): void;
5
7
  export declare function handleInputNumberValue(component?: ComponentType, val?: any): any;
6
8
  export declare const datePickerType: string[];
@@ -54,7 +54,6 @@ declare const _default: import("vue").DefineComponent<{
54
54
  getFormBindValue: import("vue").ComputedRef<Recordable<any>>;
55
55
  getFormClass: import("vue").ComputedRef<(string | {
56
56
  'basic-form--compact': boolean;
57
- 'basic-form--search': boolean;
58
57
  })[]>;
59
58
  formModel: Recordable<any>;
60
59
  getLayout: import("vue").ComputedRef<"vertical" | "horizontal" | "inline">;
package/es/index.js CHANGED
@@ -2050,7 +2050,7 @@ function useModalOut() {
2050
2050
  if (!data)
2051
2051
  return;
2052
2052
  if (openOnSet) {
2053
- dataTransfer[id] = toRaw(data);
2053
+ dataTransfer[id] = { ...toRaw(data) };
2054
2054
  return;
2055
2055
  }
2056
2056
  const equal = isEqual(toRaw(dataTransfer[id]), toRaw(data));
@@ -2894,8 +2894,10 @@ function createPlaceholder(component) {
2894
2894
  }
2895
2895
  return "";
2896
2896
  }
2897
+ const SINGLE_DATA_TYPE = ["DatePicker", "MonthPicker", "WeekPicker", "TimePicker"];
2898
+ const MULTIFY_DATA_TYPE = ["RangePicker"];
2897
2899
  function setComponentRuleType(rule, component, valueFormat) {
2898
- if (["DatePicker", "MonthPicker", "WeekPicker", "TimePicker"].includes(component)) {
2900
+ if (SINGLE_DATA_TYPE.includes(component)) {
2899
2901
  rule.type = valueFormat ? "string" : "object";
2900
2902
  } else if (["RangePicker", "Upload", "CheckboxGroup", "TimePicker"].includes(component)) {
2901
2903
  rule.type = "array";
@@ -2916,7 +2918,7 @@ function handleInputNumberValue(component, val) {
2916
2918
  }
2917
2919
  return val;
2918
2920
  }
2919
- const datePickerType = ["DatePicker", "MonthPicker", "WeekPicker", "TimePicker", "RangePicker"];
2921
+ const datePickerType = [...SINGLE_DATA_TYPE, ...MULTIFY_DATA_TYPE];
2920
2922
  const BasicProps$1 = {
2921
2923
  mode: {
2922
2924
  type: String,
@@ -3757,6 +3759,12 @@ function useFormValues({
3757
3759
  if (!key || Array.isArray(value) && value.length === 0 || isFunction(value)) {
3758
3760
  continue;
3759
3761
  }
3762
+ const schema = unref(getSchema).filter((it) => it.name === key)[0];
3763
+ if (SINGLE_DATA_TYPE.includes(schema == null ? void 0 : schema.component)) {
3764
+ value = dayjs(value).valueOf();
3765
+ } else if (MULTIFY_DATA_TYPE.includes(schema == null ? void 0 : schema.component)) {
3766
+ value = value.map((item) => dayjs(item).valueOf());
3767
+ }
3760
3768
  if (isString(value)) {
3761
3769
  value = value.trim();
3762
3770
  }
@@ -3803,6 +3811,8 @@ function useFormValues({
3803
3811
  }
3804
3812
  }
3805
3813
  } else {
3814
+ if (!names)
3815
+ return;
3806
3816
  names.forEach((key, index) => {
3807
3817
  let defaultV = null;
3808
3818
  if (component === "TreeSelect" && (mode === "multiple" || treeCheckable) || component === "Select" && mode === "multiple") {
@@ -3819,6 +3829,100 @@ function useFormValues({
3819
3829
  initDefault
3820
3830
  };
3821
3831
  }
3832
+ var weekday$1 = { exports: {} };
3833
+ (function(module, exports) {
3834
+ !function(e, t) {
3835
+ module.exports = t();
3836
+ }(commonjsGlobal, function() {
3837
+ return function(e, t) {
3838
+ t.prototype.weekday = function(e2) {
3839
+ var t2 = this.$locale().weekStart || 0, i = this.$W, n = (i < t2 ? i + 7 : i) - t2;
3840
+ return this.$utils().u(e2) ? n : this.subtract(n, "day").add(e2, "day");
3841
+ };
3842
+ };
3843
+ });
3844
+ })(weekday$1);
3845
+ var weekday = weekday$1.exports;
3846
+ var localeData$1 = { exports: {} };
3847
+ (function(module, exports) {
3848
+ !function(n, e) {
3849
+ module.exports = e();
3850
+ }(commonjsGlobal, function() {
3851
+ return function(n, e, t) {
3852
+ var r = e.prototype, o = function(n2) {
3853
+ return n2 && (n2.indexOf ? n2 : n2.s);
3854
+ }, u = function(n2, e2, t2, r2, u2) {
3855
+ var i2 = n2.name ? n2 : n2.$locale(), a2 = o(i2[e2]), s2 = o(i2[t2]), f = a2 || s2.map(function(n3) {
3856
+ return n3.slice(0, r2);
3857
+ });
3858
+ if (!u2)
3859
+ return f;
3860
+ var d = i2.weekStart;
3861
+ return f.map(function(n3, e3) {
3862
+ return f[(e3 + (d || 0)) % 7];
3863
+ });
3864
+ }, i = function() {
3865
+ return t.Ls[t.locale()];
3866
+ }, a = function(n2, e2) {
3867
+ return n2.formats[e2] || function(n3) {
3868
+ return n3.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(n4, e3, t2) {
3869
+ return e3 || t2.slice(1);
3870
+ });
3871
+ }(n2.formats[e2.toUpperCase()]);
3872
+ }, s = function() {
3873
+ var n2 = this;
3874
+ return { months: function(e2) {
3875
+ return e2 ? e2.format("MMMM") : u(n2, "months");
3876
+ }, monthsShort: function(e2) {
3877
+ return e2 ? e2.format("MMM") : u(n2, "monthsShort", "months", 3);
3878
+ }, firstDayOfWeek: function() {
3879
+ return n2.$locale().weekStart || 0;
3880
+ }, weekdays: function(e2) {
3881
+ return e2 ? e2.format("dddd") : u(n2, "weekdays");
3882
+ }, weekdaysMin: function(e2) {
3883
+ return e2 ? e2.format("dd") : u(n2, "weekdaysMin", "weekdays", 2);
3884
+ }, weekdaysShort: function(e2) {
3885
+ return e2 ? e2.format("ddd") : u(n2, "weekdaysShort", "weekdays", 3);
3886
+ }, longDateFormat: function(e2) {
3887
+ return a(n2.$locale(), e2);
3888
+ }, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal };
3889
+ };
3890
+ r.localeData = function() {
3891
+ return s.bind(this)();
3892
+ }, t.localeData = function() {
3893
+ var n2 = i();
3894
+ return { firstDayOfWeek: function() {
3895
+ return n2.weekStart || 0;
3896
+ }, weekdays: function() {
3897
+ return t.weekdays();
3898
+ }, weekdaysShort: function() {
3899
+ return t.weekdaysShort();
3900
+ }, weekdaysMin: function() {
3901
+ return t.weekdaysMin();
3902
+ }, months: function() {
3903
+ return t.months();
3904
+ }, monthsShort: function() {
3905
+ return t.monthsShort();
3906
+ }, longDateFormat: function(e2) {
3907
+ return a(n2, e2);
3908
+ }, meridiem: n2.meridiem, ordinal: n2.ordinal };
3909
+ }, t.months = function() {
3910
+ return u(i(), "months");
3911
+ }, t.monthsShort = function() {
3912
+ return u(i(), "monthsShort", "months", 3);
3913
+ }, t.weekdays = function(n2) {
3914
+ return u(i(), "weekdays", null, null, n2);
3915
+ }, t.weekdaysShort = function(n2) {
3916
+ return u(i(), "weekdaysShort", "weekdays", 3, n2);
3917
+ }, t.weekdaysMin = function(n2) {
3918
+ return u(i(), "weekdaysMin", "weekdays", 2, n2);
3919
+ };
3920
+ };
3921
+ });
3922
+ })(localeData$1);
3923
+ var localeData = localeData$1.exports;
3924
+ dayjs.extend(weekday);
3925
+ dayjs.extend(localeData);
3822
3926
  function useFormEvents({
3823
3927
  emit,
3824
3928
  getSchema,
@@ -4028,7 +4132,7 @@ const _sfc_main$N = defineComponent({
4028
4132
  const { style, mode } = unref(getProps);
4029
4133
  return {
4030
4134
  style: deepMerge({
4031
- padding: mode === "dialog" ? "20px" : null
4135
+ padding: mode === "dialog" ? "20px 30px" : null
4032
4136
  }, style)
4033
4137
  };
4034
4138
  });
@@ -4054,9 +4158,9 @@ const _sfc_main$N = defineComponent({
4054
4158
  const getCompact = compact === null ? mode === "dialog" ? false : true : compact;
4055
4159
  return [
4056
4160
  "basic-form",
4161
+ `basic-form--${mode}`,
4057
4162
  {
4058
- "basic-form--compact": getCompact,
4059
- "basic-form--search": mode === "search" || mode === void 0 ? true : false
4163
+ "basic-form--compact": getCompact
4060
4164
  }
4061
4165
  ];
4062
4166
  });
@@ -4976,11 +5080,12 @@ function useRowSelection(propsRef, emit) {
4976
5080
  return null;
4977
5081
  }
4978
5082
  return {
4979
- ...rowSelection,
4980
5083
  selectedRowKeys: toRaw(unref(selectedRowKeysRef)),
4981
5084
  onChange: (selectedRowKeys) => {
4982
5085
  setSelectedRowKeys(selectedRowKeys);
4983
- }
5086
+ },
5087
+ preserveSelectedRowKeys: true,
5088
+ ...omit(rowSelection, ["onChange"])
4984
5089
  };
4985
5090
  });
4986
5091
  watch(() => {
@@ -5079,8 +5184,20 @@ var _sfc_main$J = defineComponent({
5079
5184
  dict,
5080
5185
  date,
5081
5186
  number,
5082
- percent
5187
+ percent,
5188
+ struc
5083
5189
  } = render2;
5190
+ if (struc) {
5191
+ const {
5192
+ appConf
5193
+ } = useAppStore();
5194
+ let apiStruc = appConf.structure[struc];
5195
+ if (!apiStruc) {
5196
+ error(`${struc}\u672A\u5728structure\u4E2D\u914D\u7F6E`);
5197
+ } else {
5198
+ renderText = getDictValueByCode(text, apiStruc);
5199
+ }
5200
+ }
5084
5201
  if (dict) {
5085
5202
  renderText = getDictValueByCode(text, dict);
5086
5203
  }
@@ -6410,6 +6527,7 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
6410
6527
  bodyEl.style.height = "unset";
6411
6528
  if (unref(propsRef).dataSource.length === 0)
6412
6529
  return;
6530
+ filterSource.value = [];
6413
6531
  await nextTick();
6414
6532
  let headerHeight = 0, paginationHeight = 2, footerHeight = 0, titleHeight = (_b = (_a = tableEl.querySelector(".ant-table-title")) == null ? void 0 : _a.offsetHeight) != null ? _b : 0, marginHeight = 15;
6415
6533
  const headEl = tableEl.querySelector(".ant-table-thead ");
@@ -7075,6 +7193,7 @@ function useCurd(curdOpt) {
7075
7193
  } = curdOpt;
7076
7194
  curd.onQueryById(row[primaryKey]).then((rsp) => {
7077
7195
  formsVal.value = rsp;
7196
+ nextTick(() => dispatchResize());
7078
7197
  });
7079
7198
  openModal();
7080
7199
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dt-frames/ui",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "keywords": [
5
5
  "ui",
6
6
  "dt-ui"