@qin-ui/antd-vue-pro 1.0.39 → 1.0.41

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.
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, provide, renderSlot } from "vue";
2
2
  import "ant-design-vue";
3
- import { I as INJECT_COMPONENT_PROPS_KEYS } from "../form/index-41d46d27.js";
3
+ import { I as INJECT_COMPONENT_PROPS_KEYS } from "../form/index-914194dc.js";
4
4
  import { PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS } from "../table/index.js";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "index",
@@ -15818,7 +15818,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
15818
15818
  ]);
15819
15819
  delete baseFormItemProps.className;
15820
15820
  const defaultProps = {
15821
- first: true
15821
+ validateFirst: true
15822
15822
  };
15823
15823
  if (field.fields) {
15824
15824
  Object.assign(defaultProps, {
@@ -16653,19 +16653,20 @@ export {
16653
16653
  _sfc_main$4 as d,
16654
16654
  _sfc_main$1 as e,
16655
16655
  FORM_DATA as f,
16656
- UPDATE_REFS as g,
16657
- COMMAND as h,
16658
- UPDATE_ACTIVE_PATH as i,
16659
- FunctionRegexp as j,
16660
- ArrowFunctionRegexp as k,
16661
- INIT_COMPONENT_PROPS_MAP as l,
16662
- isFunctionString as m,
16663
- jsonStringifyReplacer as n,
16656
+ get$1 as g,
16657
+ UPDATE_REFS as h,
16658
+ COMMAND as i,
16659
+ UPDATE_ACTIVE_PATH as j,
16660
+ FunctionRegexp as k,
16661
+ ArrowFunctionRegexp as l,
16662
+ INIT_COMPONENT_PROPS_MAP as m,
16663
+ isFunctionString as n,
16664
16664
  omit$1 as o,
16665
- jsonParseReviver as p,
16666
- useFields as q,
16667
- useFormData as r,
16668
- useCommand as s,
16669
- useInitProps as t,
16670
- useForm as u
16665
+ jsonStringifyReplacer as p,
16666
+ jsonParseReviver as q,
16667
+ useFields as r,
16668
+ useFormData as s,
16669
+ useCommand as t,
16670
+ useForm as u,
16671
+ useInitProps as v
16671
16672
  };
package/es/form/index.js CHANGED
@@ -1,30 +1,30 @@
1
- import { k, B, d, h, C, b, f, F, j, l, I, R, e, i, U, g, _, m, p, n, s, q, u, r, t } from "./index-41d46d27.js";
1
+ import { l, B, d, i, C, b, f, F, k, m, I, R, e, j, U, h, _, n, q, p, t, r, u, s, v } from "./index-914194dc.js";
2
2
  import "vue";
3
3
  import "ant-design-vue";
4
4
  export {
5
- k as ArrowFunctionRegexp,
5
+ l as ArrowFunctionRegexp,
6
6
  B as BaseField,
7
7
  d as BaseFormItem,
8
- h as COMMAND,
8
+ i as COMMAND,
9
9
  C as COMPONENT_MAP,
10
10
  b as ContainerFragment,
11
11
  f as FORM_DATA,
12
12
  F as FORM_ITEM_SLOT_KEYS,
13
- j as FunctionRegexp,
14
- l as INIT_COMPONENT_PROPS_MAP,
13
+ k as FunctionRegexp,
14
+ m as INIT_COMPONENT_PROPS_MAP,
15
15
  I as INJECT_COMPONENT_PROPS_KEYS,
16
16
  R as RULE_TYPE_MAP,
17
17
  e as SlotComponent,
18
- i as UPDATE_ACTIVE_PATH,
18
+ j as UPDATE_ACTIVE_PATH,
19
19
  U as UPDATE_FORM_DATA,
20
- g as UPDATE_REFS,
20
+ h as UPDATE_REFS,
21
21
  _ as default,
22
- m as isFunctionString,
23
- p as jsonParseReviver,
24
- n as jsonStringifyReplacer,
25
- s as useCommand,
26
- q as useFields,
22
+ n as isFunctionString,
23
+ q as jsonParseReviver,
24
+ p as jsonStringifyReplacer,
25
+ t as useCommand,
26
+ r as useFields,
27
27
  u as useForm,
28
- r as useFormData,
29
- t as useInitProps
28
+ s as useFormData,
29
+ v as useInitProps
30
30
  };
package/es/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./style.css";
2
- import { _ as _sfc_main } from "./form/index-41d46d27.js";
3
- import { k, B, d, h, C, b, f, F, j, l, I, R, e, i, U, g, m, p, n, s, q, u, r, t } from "./form/index-41d46d27.js";
2
+ import { _ as _sfc_main } from "./form/index-914194dc.js";
3
+ import { l, B, d, i, C, b, f, F, k, m, I, R, e, j, U, h, n, q, p, t, r, u, s, v } from "./form/index-914194dc.js";
4
4
  import BaseTable from "./table/index.js";
5
5
  import { PRO_TABLE_INIT_COMPONENT_PROPS_MAP, PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS, useTable } from "./table/index.js";
6
6
  import _sfc_main$1 from "./component-provider/index.js";
@@ -24,16 +24,16 @@ const index = {
24
24
  }
25
25
  };
26
26
  export {
27
- k as ArrowFunctionRegexp,
27
+ l as ArrowFunctionRegexp,
28
28
  B as BaseField,
29
29
  d as BaseFormItem,
30
- h as COMMAND,
30
+ i as COMMAND,
31
31
  C as COMPONENT_MAP,
32
32
  b as ContainerFragment,
33
33
  f as FORM_DATA,
34
34
  F as FORM_ITEM_SLOT_KEYS,
35
- j as FunctionRegexp,
36
- l as INIT_COMPONENT_PROPS_MAP,
35
+ k as FunctionRegexp,
36
+ m as INIT_COMPONENT_PROPS_MAP,
37
37
  I as INJECT_COMPONENT_PROPS_KEYS,
38
38
  PRO_TABLE_INIT_COMPONENT_PROPS_MAP,
39
39
  PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS,
@@ -42,17 +42,17 @@ export {
42
42
  ProTable,
43
43
  R as RULE_TYPE_MAP,
44
44
  e as SlotComponent,
45
- i as UPDATE_ACTIVE_PATH,
45
+ j as UPDATE_ACTIVE_PATH,
46
46
  U as UPDATE_FORM_DATA,
47
- g as UPDATE_REFS,
47
+ h as UPDATE_REFS,
48
48
  index as default,
49
- m as isFunctionString,
50
- p as jsonParseReviver,
51
- n as jsonStringifyReplacer,
52
- s as useCommand,
53
- q as useFields,
49
+ n as isFunctionString,
50
+ q as jsonParseReviver,
51
+ p as jsonStringifyReplacer,
52
+ t as useCommand,
53
+ r as useFields,
54
54
  u as useForm,
55
- r as useFormData,
56
- t as useInitProps,
55
+ s as useFormData,
56
+ v as useInitProps,
57
57
  useTable
58
58
  };
package/es/style.css CHANGED
@@ -2,21 +2,21 @@
2
2
  width: 100%;
3
3
  min-width: 120px;
4
4
  }
5
- .search[data-v-41c82259] {
5
+ .search[data-v-917bc550] {
6
6
  display: flex;
7
7
  gap: 24px;
8
8
  }
9
- .search .pro-form[data-v-41c82259] {
9
+ .search .pro-form[data-v-917bc550] {
10
10
  flex: 1;
11
11
  }
12
- .search .pro-form[data-v-41c82259] .ant-form-item {
12
+ .search .pro-form[data-v-917bc550] .ant-form-item {
13
13
  margin-bottom: 0;
14
14
  }
15
- .search .buttons[data-v-41c82259] {
15
+ .search .buttons[data-v-917bc550] {
16
16
  display: flex;
17
17
  gap: 8px;
18
18
  }
19
- .search .expand-transition[data-v-41c82259] {
19
+ .search .expand-transition[data-v-917bc550] {
20
20
  transition: all 0.25s;
21
21
  }
22
22
  .control-icon[data-v-2776fca6] {
@@ -41,11 +41,11 @@
41
41
  padding: 24px 24px 16px;
42
42
  background-color: #fff;
43
43
  }
44
- .pro-table[data-v-864e5a75] {
44
+ .pro-table[data-v-fd9aab35] {
45
45
  display: flex;
46
46
  flex-direction: column;
47
47
  min-width: 800px;
48
48
  }
49
- .pro-table[data-v-864e5a75] .ant-pagination .ant-pagination-total-text {
49
+ .pro-table[data-v-fd9aab35] .ant-pagination .ant-pagination-total-text {
50
50
  flex: 1;
51
51
  }
package/es/table/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createVNode, defineComponent, ref, onMounted, openBlock, createElementBlock, unref, normalizeStyle, createElementVNode, withCtx, createTextVNode, createBlock, toDisplayString, createCommentVNode, mergeModels, useModel, computed, watch, Fragment, renderList, withModifiers, renderSlot, inject, useAttrs, useSlots, mergeProps, createSlots, normalizeProps, guardReactiveProps, nextTick } from "vue";
2
2
  import { Button, Space, Dropdown, Menu, MenuItem, Checkbox, MenuDivider, Table } from "ant-design-vue";
3
- import { A as AntdIcon, _ as _sfc_main$6, a as _export_sfc, o as omit, b as _sfc_main$7, c as cloneDeep, u as useForm } from "../form/index-41d46d27.js";
3
+ import { A as AntdIcon, _ as _sfc_main$6, g as get, a as _export_sfc, o as omit, b as _sfc_main$7, c as cloneDeep, u as useForm } from "../form/index-914194dc.js";
4
4
  var ColumnHeightOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M840 836H184c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h656c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm0-724H184c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h656c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM610.8 378c6 0 9.4-7 5.7-11.7L515.7 238.7a7.14 7.14 0 00-11.3 0L403.6 366.3a7.23 7.23 0 005.7 11.7H476v268h-62.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7.4-11.7-5.7-11.7H548V378h62.8z" } }] }, "name": "column-height", "theme": "outlined" };
5
5
  const ColumnHeightOutlinedSvg = ColumnHeightOutlined$2;
6
6
  function _objectSpread$2(target) {
@@ -117,21 +117,46 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
117
117
  },
118
118
  emits: ["search", "reset"],
119
119
  setup(__props, { emit: __emit }) {
120
- const proFormRef = ref();
121
- const expandStatus = ref(true);
120
+ const props = __props;
122
121
  const emit = __emit;
123
122
  let initProFormHeight = "unset";
124
123
  const showExpandToggle = ref(false);
124
+ const proFormRef = ref();
125
+ const expandStatus = ref(true);
125
126
  const expand = () => {
126
127
  expandStatus.value = !expandStatus.value;
127
128
  };
129
+ const setInitExpandStatus = () => {
130
+ expandStatus.value = false;
131
+ if (proFormRef.value) {
132
+ const formEl = proFormRef.value.$el;
133
+ const formItemsEl = formEl.querySelectorAll(".ant-form-item>[path]");
134
+ const observer = new IntersectionObserver(
135
+ (entries) => {
136
+ expandStatus.value = entries.some((e) => {
137
+ if (e.intersectionRatio === 0) {
138
+ const path = e.target.getAttribute("path");
139
+ const searchFieldValue = path ? get(props.form.formData.value, path) : void 0;
140
+ return ![null, void 0].includes(searchFieldValue);
141
+ }
142
+ return false;
143
+ });
144
+ observer.disconnect();
145
+ },
146
+ { root: formEl }
147
+ );
148
+ formItemsEl.forEach((element) => {
149
+ observer.observe(element);
150
+ });
151
+ }
152
+ };
128
153
  onMounted(() => {
129
154
  var _a, _b;
130
155
  const proFormEl = (_a = proFormRef.value) == null ? void 0 : _a.$el;
131
156
  const { height = 0 } = ((_b = proFormEl == null ? void 0 : proFormEl.getBoundingClientRect) == null ? void 0 : _b.call(proFormEl)) || {};
132
157
  initProFormHeight = height;
133
158
  showExpandToggle.value = height > HEIGHT_THRESHOLD;
134
- expandStatus.value = false;
159
+ setInitExpandStatus();
135
160
  });
136
161
  return (_ctx, _cache) => {
137
162
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
@@ -184,8 +209,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
184
209
  };
185
210
  }
186
211
  });
187
- const SearchForm_vue_vue_type_style_index_0_scoped_41c82259_lang = "";
188
- const SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-41c82259"]]);
212
+ const SearchForm_vue_vue_type_style_index_0_scoped_917bc550_lang = "";
213
+ const SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-917bc550"]]);
189
214
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
190
215
  __name: "Control",
191
216
  props: mergeModels({
@@ -409,7 +434,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
409
434
  const injectProps = inject(
410
435
  PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS.table
411
436
  );
412
- const cache = props.paramCache === void 0 ? injectProps == null ? void 0 : injectProps.paramCache : props.paramCache;
437
+ const cache = props.paramCache === null ? null : props.paramCache ?? (injectProps == null ? void 0 : injectProps.paramCache);
413
438
  const size = ref(unref(props.size));
414
439
  const attrs = useAttrs();
415
440
  const { table = {} } = props;
@@ -431,11 +456,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
431
456
  current,
432
457
  pageSize
433
458
  });
434
- cache == null ? void 0 : cache.set((pre = {}) => ({
435
- ...pre,
436
- pagination: unref(pagination),
437
- searchParam: unref(searchParam)
438
- }));
459
+ cache == null ? void 0 : cache.set(
460
+ (pre = {}) => cloneDeep({
461
+ ...pre,
462
+ pagination: unref(pagination),
463
+ searchParam: unref(searchParam)
464
+ })
465
+ );
439
466
  };
440
467
  const reset = () => {
441
468
  var _a2;
@@ -538,9 +565,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
538
565
  Object.hasOwn(_ctx.$slots, "search") ? renderSlot(_ctx.$slots, "search", { key: 0 }, void 0, true) : (openBlock(), createBlock(unref(SearchForm), {
539
566
  key: 1,
540
567
  form,
568
+ cache: unref(cache),
541
569
  onSearch: searchPage1st,
542
570
  onReset: reset
543
- }, null, 8, ["form"]))
571
+ }, null, 8, ["form", "cache"]))
544
572
  ]),
545
573
  _: 3
546
574
  }, 8, ["component"])) : createCommentVNode("", true),
@@ -586,8 +614,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
586
614
  };
587
615
  }
588
616
  });
589
- const Table_vue_vue_type_style_index_0_scoped_864e5a75_lang = "";
590
- const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-864e5a75"]]);
617
+ const Table_vue_vue_type_style_index_0_scoped_fd9aab35_lang = "";
618
+ const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fd9aab35"]]);
591
619
  const getDefaultPagination = () => ({ current: 1, pageSize: 10, total: 0 });
592
620
  const useTable = ({
593
621
  columns: initColumns = [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qin-ui/antd-vue-pro",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "二次封装antd vue组件",
5
5
  "type": "module",
6
6
  "main": "",