@qin-ui/antd-vue-pro 1.0.20 → 1.0.22

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,7 @@
1
1
  import { defineComponent, provide, renderSlot } from "vue";
2
2
  import "ant-design-vue";
3
3
  import { I as INJECT_COMPONENT_PROPS_KEYS } from "../form/index-2b6aeb25.js";
4
+ import { PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS } from "../table/index.js";
4
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
6
  __name: "index",
6
7
  props: {
@@ -10,7 +11,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10
11
  const props = __props;
11
12
  if (props.componentVars) {
12
13
  Object.values(props.componentVars).forEach((item) => {
13
- const injectKeys = { ...INJECT_COMPONENT_PROPS_KEYS };
14
+ const injectKeys = {
15
+ ...INJECT_COMPONENT_PROPS_KEYS,
16
+ ...PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS
17
+ };
14
18
  Object.entries(item).forEach(([key, value]) => {
15
19
  if (Object.hasOwn(injectKeys, key)) {
16
20
  provide(injectKeys[key], value);
package/es/index.d.ts CHANGED
@@ -281,7 +281,7 @@ export declare type ComponentVars = {
281
281
  proForm?: Record<string, Record<string, any>>;
282
282
  proFormItems?: Record<string, Record<string, any>>;
283
283
  proFormField?: Partial<Record<keyof typeof INJECT_COMPONENT_PROPS_KEYS, Record<string, any>>>;
284
- proTable?: Partial<Record<keyof typeof INJECT_COMPONENT_PROPS_KEYS_2, Record<string, any>>>;
284
+ proTable?: Partial<Record<keyof typeof PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS, Record<string, any>>>;
285
285
  };
286
286
 
287
287
  /**
@@ -1911,12 +1911,6 @@ export declare const INJECT_COMPONENT_PROPS_KEYS: {
1911
1911
  transfer: symbol;
1912
1912
  };
1913
1913
 
1914
- declare const INJECT_COMPONENT_PROPS_KEYS_2: {
1915
- table: symbol;
1916
- searchForm: symbol;
1917
- control: symbol;
1918
- };
1919
-
1920
1914
  declare type InputNumberSlots = FieldSlot<'addonAfter' | 'addonBefore' | 'prefix' | 'upIcon' | 'downIcon'>;
1921
1915
 
1922
1916
  declare type InputSlots = FieldSlot<'addonAfter' | 'addonBefore' | 'clearIcon' | 'prefix' | 'suffix'>;
@@ -1961,6 +1955,14 @@ export declare type ParamCache = {
1961
1955
 
1962
1956
  export declare type PrependField = (path: string | undefined, field: Field) => void;
1963
1957
 
1958
+ export declare const PRO_TABLE_INIT_COMPONENT_PROPS_MAP: Map<symbol, {}>;
1959
+
1960
+ export declare const PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS: {
1961
+ table: symbol;
1962
+ searchForm: symbol;
1963
+ control: symbol;
1964
+ };
1965
+
1964
1966
  export declare const ProComponentProvider: SFCWithInstall<{
1965
1967
  new (...args: any[]): {
1966
1968
  $: ComponentInternalInstance;
package/es/index.js CHANGED
@@ -2,7 +2,7 @@ import "./style.css";
2
2
  import { _ as _sfc_main } from "./form/index-2b6aeb25.js";
3
3
  import { j, B, c, g, C, b, e, F, i, k, I, R, d, h, U, f, l, n, m, r, p, u, q, s } from "./form/index-2b6aeb25.js";
4
4
  import BaseTable from "./table/index.js";
5
- import { useTable } from "./table/index.js";
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";
7
7
  import "vue";
8
8
  import "ant-design-vue";
@@ -35,6 +35,8 @@ export {
35
35
  i as FunctionRegexp,
36
36
  k as INIT_COMPONENT_PROPS_MAP,
37
37
  I as INJECT_COMPONENT_PROPS_KEYS,
38
+ PRO_TABLE_INIT_COMPONENT_PROPS_MAP,
39
+ PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS,
38
40
  ProComponentProvider,
39
41
  ProForm,
40
42
  ProTable,
package/es/style.css CHANGED
@@ -41,11 +41,11 @@
41
41
  padding: 24px 24px 16px;
42
42
  background-color: #fff;
43
43
  }
44
- .pro-table[data-v-4ec30d1d] {
44
+ .pro-table[data-v-381e47da] {
45
45
  display: flex;
46
46
  flex-direction: column;
47
47
  min-width: 800px;
48
48
  }
49
- .pro-table[data-v-4ec30d1d] .ant-pagination .ant-pagination-total-text {
49
+ .pro-table[data-v-381e47da] .ant-pagination .ant-pagination-total-text {
50
50
  flex: 1;
51
51
  }
package/es/table/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createVNode, defineComponent, ref, onMounted, openBlock, createElementBlock, unref, normalizeStyle, createElementVNode, withCtx, createTextVNode, createBlock, toDisplayString, createCommentVNode, computed, watch, Fragment, renderList, withModifiers, renderSlot, useSlots, useAttrs, inject, onBeforeUnmount, mergeProps, createSlots, normalizeProps, guardReactiveProps, nextTick } from "vue";
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
3
  import { A as AntdIcon, _ as _sfc_main$6, a as _export_sfc, o as omit, b as _sfc_main$7, u as useForm } from "../form/index-2b6aeb25.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" };
@@ -188,13 +188,16 @@ const SearchForm_vue_vue_type_style_index_0_scoped_41c82259_lang = "";
188
188
  const SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-41c82259"]]);
189
189
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
190
190
  __name: "Control",
191
- props: {
191
+ props: mergeModels({
192
192
  columns: {},
193
193
  table: { default: void 0 }
194
- },
194
+ }, {
195
+ "size": { default: "large" }
196
+ }),
197
+ emits: ["update:size"],
195
198
  setup(__props) {
196
199
  const props = __props;
197
- const size = defineModel("size", { default: "large" });
200
+ const size = useModel(__props, "size");
198
201
  const onSizeChange = (val) => {
199
202
  size.value = val.key;
200
203
  };
@@ -367,11 +370,17 @@ function _sfc_render(_ctx, _cache) {
367
370
  ]);
368
371
  }
369
372
  const DefaultControlContainer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-1d26ef2f"]]);
370
- const INJECT_COMPONENT_PROPS_KEYS = {
373
+ const PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS = {
371
374
  "table": Symbol(""),
372
375
  "searchForm": Symbol(""),
373
376
  "control": Symbol("")
374
377
  };
378
+ const PROPS_KEYS = PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS;
379
+ const PRO_TABLE_INIT_COMPONENT_PROPS_MAP = /* @__PURE__ */ new Map([
380
+ [PROPS_KEYS.table, {}],
381
+ [PROPS_KEYS.searchForm, {}],
382
+ [PROPS_KEYS.control, {}]
383
+ ]);
375
384
  const _hoisted_1 = {
376
385
  key: 0,
377
386
  style: { "flex": "1" }
@@ -396,6 +405,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
396
405
  setup(__props, { emit: __emit }) {
397
406
  var _a, _b, _c, _d, _e, _f;
398
407
  const props = __props;
408
+ const injectProps = inject(
409
+ PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS.table
410
+ );
411
+ const cache = props.paramCache ?? (injectProps == null ? void 0 : injectProps.paramCache);
412
+ const size = ref(unref(props.size));
413
+ const attrs = useAttrs();
414
+ const { table = {} } = props;
415
+ const {
416
+ columns,
417
+ dataSource,
418
+ pagination,
419
+ setPagination,
420
+ checkedColumns,
421
+ searchParam,
422
+ setSearchParam
423
+ } = table;
399
424
  const emit = __emit;
400
425
  const search = () => {
401
426
  var _a2, _b2;
@@ -405,13 +430,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
405
430
  current,
406
431
  pageSize
407
432
  });
408
- };
409
- const searchPage1st = () => {
410
- var _a2;
411
- if (props.table) {
412
- (_a2 = props.table) == null ? void 0 : _a2.setPagination({ ...props.table.pagination.value, current: 1 });
413
- search();
414
- }
433
+ cache == null ? void 0 : cache.set({
434
+ pagination: unref(pagination),
435
+ searchParam: unref(searchParam)
436
+ });
415
437
  };
416
438
  const reset = () => {
417
439
  var _a2;
@@ -429,19 +451,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
429
451
  setFormData: (_c = props.table) == null ? void 0 : _c.setSearchParam,
430
452
  setField: (_d = props.table) == null ? void 0 : _d.setSearchField
431
453
  };
432
- const size = ref(unref(props.size));
433
- const attrs = useAttrs();
434
- const { table = {} } = props;
435
- const {
436
- columns,
437
- dataSource,
438
- pagination,
439
- setPagination,
440
- checkedColumns,
441
- searchParam,
442
- setSearchParam
443
- } = table;
444
- const cache = props.paramCache ?? inject(INJECT_COMPONENT_PROPS_KEYS.table);
445
454
  if (cache) {
446
455
  setPagination({
447
456
  ...unref(pagination),
@@ -451,14 +460,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
451
460
  ...unref(searchParam),
452
461
  ...unref(((_f = cache.get()) == null ? void 0 : _f.searchParam) ?? {})
453
462
  });
454
- onBeforeUnmount(() => {
455
- cache == null ? void 0 : cache.set({
456
- ...(cache == null ? void 0 : cache.get()) || {},
457
- pagination: unref(pagination),
458
- searchParam: unref(searchParam)
459
- });
460
- });
461
463
  }
464
+ const searchPage1st = () => {
465
+ var _a2;
466
+ if (props.table) {
467
+ (_a2 = props.table) == null ? void 0 : _a2.setPagination({ ...props.table.pagination.value, current: 1 });
468
+ search();
469
+ }
470
+ };
462
471
  const onPaginationChange = () => {
463
472
  nextTick(() => search());
464
473
  };
@@ -570,8 +579,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
570
579
  };
571
580
  }
572
581
  });
573
- const Table_vue_vue_type_style_index_0_scoped_4ec30d1d_lang = "";
574
- const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4ec30d1d"]]);
582
+ const Table_vue_vue_type_style_index_0_scoped_381e47da_lang = "";
583
+ const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-381e47da"]]);
575
584
  const getDefaultPagination = () => ({ current: 1, pageSize: 10, total: 0 });
576
585
  const useTable = ({
577
586
  columns: initColumns = [],
@@ -625,6 +634,8 @@ const useTable = ({
625
634
  };
626
635
  };
627
636
  export {
637
+ PRO_TABLE_INIT_COMPONENT_PROPS_MAP,
638
+ PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS,
628
639
  BaseTable as default,
629
640
  useTable
630
641
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qin-ui/antd-vue-pro",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "二次封装antd vue组件",
5
5
  "type": "module",
6
6
  "main": "",