@qin-ui/antd-vue-pro 2.0.18 → 2.0.19

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,5 +1,153 @@
1
- import { a, _ } from "./index-BeGPcKnM.js";
1
+ import { defineComponent, provide, renderSlot } from "vue";
2
+ import { g as getObject } from "../core/index-BrBzu6aj.js";
3
+ const getPopupContainer = (triggerNode) => triggerNode.closest(".ant-form");
4
+ const INJECT_CONFIG = {
5
+ "pro-table": {
6
+ injectionKey: Symbol(""),
7
+ default: {
8
+ pagination: {
9
+ showTotal: (total) => `共 ${total} 条`,
10
+ showSizeChanger: true,
11
+ pageSizeOptions: ["10", "20", "30", "40", "50", "100"],
12
+ showQuickJumper: true
13
+ },
14
+ searchFormConfig: {
15
+ layout: "grid",
16
+ expand: { minExpandRows: 2, expandStatus: false }
17
+ },
18
+ control: true,
19
+ addIndexColumn: true
20
+ }
21
+ },
22
+ "pro-form": {
23
+ injectionKey: Symbol(""),
24
+ default: { grid: { gutter: { xs: 8, sm: 16, md: 16, lg: 24 } } }
25
+ },
26
+ "pro-form-item": {
27
+ injectionKey: Symbol(""),
28
+ default: { validateFirst: true, span: 8 }
29
+ },
30
+ // field
31
+ input: {
32
+ injectionKey: Symbol(""),
33
+ default: { maxlength: 100, allowClear: true, placeholder: "请输入" }
34
+ },
35
+ textarea: {
36
+ injectionKey: Symbol(""),
37
+ default: {
38
+ maxlength: 200,
39
+ autoSize: { minRows: 3, maxRows: 6 },
40
+ showCount: true,
41
+ allowClear: true,
42
+ placeholder: "请输入"
43
+ }
44
+ },
45
+ "input-password": {
46
+ injectionKey: Symbol(""),
47
+ default: { maxlength: 100, allowClear: true, placeholder: "请输入" }
48
+ },
49
+ "input-search": {
50
+ injectionKey: Symbol(""),
51
+ default: {}
52
+ },
53
+ "input-number": {
54
+ injectionKey: Symbol(""),
55
+ default: {
56
+ max: 10 ** 15 - 1,
57
+ min: -1000000000000001,
58
+ controls: false,
59
+ placeholder: "请输入",
60
+ style: { width: "100%" }
61
+ }
62
+ },
63
+ select: {
64
+ injectionKey: Symbol(""),
65
+ default: { allowClear: true, placeholder: "请选择", getPopupContainer }
66
+ },
67
+ cascader: {
68
+ injectionKey: Symbol(""),
69
+ default: { allowClear: true, placeholder: "请选择", getPopupContainer }
70
+ },
71
+ "date-picker": {
72
+ injectionKey: Symbol(""),
73
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
74
+ },
75
+ "date-picker.date": {
76
+ injectionKey: Symbol(""),
77
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
78
+ },
79
+ "date-picker.week": {
80
+ injectionKey: Symbol(""),
81
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
82
+ },
83
+ "date-picker.month": {
84
+ injectionKey: Symbol(""),
85
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
86
+ },
87
+ "date-picker.year": {
88
+ injectionKey: Symbol(""),
89
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
90
+ },
91
+ "date-picker.quarter": {
92
+ injectionKey: Symbol(""),
93
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
94
+ },
95
+ "range-picker": {
96
+ injectionKey: Symbol(""),
97
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
98
+ },
99
+ "time-picker": {
100
+ injectionKey: Symbol(""),
101
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
102
+ },
103
+ "checkbox-group": {
104
+ injectionKey: Symbol(""),
105
+ default: {}
106
+ },
107
+ "radio-group": {
108
+ injectionKey: Symbol(""),
109
+ default: {}
110
+ },
111
+ switch: {
112
+ injectionKey: Symbol(""),
113
+ default: { modelName: "checked" }
114
+ },
115
+ slider: {
116
+ injectionKey: Symbol(""),
117
+ default: {}
118
+ },
119
+ "tree-select": {
120
+ injectionKey: Symbol(""),
121
+ default: {}
122
+ },
123
+ transfer: {
124
+ injectionKey: Symbol(""),
125
+ default: {}
126
+ }
127
+ };
128
+ const _sfc_main = /* @__PURE__ */ defineComponent({
129
+ ...{
130
+ inheritAttrs: false
131
+ },
132
+ __name: "index",
133
+ props: {
134
+ componentVars: {}
135
+ },
136
+ setup(__props) {
137
+ const props = __props;
138
+ if (props.componentVars) {
139
+ Object.entries(props.componentVars).forEach(([key, val]) => {
140
+ const config = INJECT_CONFIG[key];
141
+ if (!config) return;
142
+ provide(config.injectionKey, { ...config.default, ...getObject(val) });
143
+ });
144
+ }
145
+ return (_ctx, _cache) => {
146
+ return renderSlot(_ctx.$slots, "default");
147
+ };
148
+ }
149
+ });
2
150
  export {
3
- a as INJECT_CONFIG,
4
- _ as default
151
+ INJECT_CONFIG,
152
+ _sfc_main as default
5
153
  };
@@ -1,130 +1,5 @@
1
- import { inject, camelize, reactive, provide, ref, toValue, defineComponent, renderSlot } from "vue";
1
+ import { inject, camelize, reactive, provide, ref, toValue } from "vue";
2
2
  import { i as isPlainObject, c as cloneDeep, s as set, g as get, p as pick, t as toPath } from "../vendor/utils/lodash-es-p6jau26B.js";
3
- const getPopupContainer = (triggerNode) => triggerNode.closest(".ant-form");
4
- const INJECT_CONFIG = {
5
- "pro-table": {
6
- injectionKey: Symbol(""),
7
- default: {
8
- pagination: {
9
- showTotal: (total) => `共 ${total} 条`,
10
- showSizeChanger: true,
11
- pageSizeOptions: ["10", "20", "30", "40", "50", "100"],
12
- showQuickJumper: true
13
- },
14
- searchFormConfig: {
15
- layout: "grid",
16
- expand: { minExpandRows: 2, expandStatus: false }
17
- },
18
- control: true,
19
- addIndexColumn: true
20
- }
21
- },
22
- "pro-form": {
23
- injectionKey: Symbol(""),
24
- default: { grid: { gutter: { xs: 8, sm: 16, md: 16, lg: 24 } } }
25
- },
26
- "pro-form-item": {
27
- injectionKey: Symbol(""),
28
- default: { validateFirst: true, span: 8 }
29
- },
30
- // field
31
- input: {
32
- injectionKey: Symbol(""),
33
- default: { maxlength: 100, allowClear: true, placeholder: "请输入" }
34
- },
35
- textarea: {
36
- injectionKey: Symbol(""),
37
- default: {
38
- maxlength: 200,
39
- autoSize: { minRows: 3, maxRows: 6 },
40
- showCount: true,
41
- allowClear: true,
42
- placeholder: "请输入"
43
- }
44
- },
45
- "input-password": {
46
- injectionKey: Symbol(""),
47
- default: { maxlength: 100, allowClear: true, placeholder: "请输入" }
48
- },
49
- "input-search": {
50
- injectionKey: Symbol(""),
51
- default: {}
52
- },
53
- "input-number": {
54
- injectionKey: Symbol(""),
55
- default: {
56
- max: 10 ** 15 - 1,
57
- min: -1000000000000001,
58
- controls: false,
59
- placeholder: "请输入",
60
- style: { width: "100%" }
61
- }
62
- },
63
- select: {
64
- injectionKey: Symbol(""),
65
- default: { allowClear: true, placeholder: "请选择", getPopupContainer }
66
- },
67
- cascader: {
68
- injectionKey: Symbol(""),
69
- default: { allowClear: true, placeholder: "请选择", getPopupContainer }
70
- },
71
- "date-picker": {
72
- injectionKey: Symbol(""),
73
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
74
- },
75
- "date-picker.date": {
76
- injectionKey: Symbol(""),
77
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
78
- },
79
- "date-picker.week": {
80
- injectionKey: Symbol(""),
81
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
82
- },
83
- "date-picker.month": {
84
- injectionKey: Symbol(""),
85
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
86
- },
87
- "date-picker.year": {
88
- injectionKey: Symbol(""),
89
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
90
- },
91
- "date-picker.quarter": {
92
- injectionKey: Symbol(""),
93
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
94
- },
95
- "range-picker": {
96
- injectionKey: Symbol(""),
97
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
98
- },
99
- "time-picker": {
100
- injectionKey: Symbol(""),
101
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
102
- },
103
- "checkbox-group": {
104
- injectionKey: Symbol(""),
105
- default: {}
106
- },
107
- "radio-group": {
108
- injectionKey: Symbol(""),
109
- default: {}
110
- },
111
- switch: {
112
- injectionKey: Symbol(""),
113
- default: { modelName: "checked" }
114
- },
115
- slider: {
116
- injectionKey: Symbol(""),
117
- default: {}
118
- },
119
- "tree-select": {
120
- injectionKey: Symbol(""),
121
- default: {}
122
- },
123
- transfer: {
124
- injectionKey: Symbol(""),
125
- default: {}
126
- }
127
- };
128
3
  const InjectionFormKey = Symbol("form");
129
4
  const InjectionPathKey = Symbol("path");
130
5
  function getObject(val) {
@@ -474,38 +349,14 @@ const useTable = (params) => {
474
349
  resetQueryParams
475
350
  };
476
351
  };
477
- const _sfc_main = /* @__PURE__ */ defineComponent({
478
- ...{
479
- inheritAttrs: false
480
- },
481
- __name: "index",
482
- props: {
483
- componentVars: {}
484
- },
485
- setup(__props) {
486
- const props = __props;
487
- if (props.componentVars) {
488
- Object.entries(props.componentVars).forEach(([key, val]) => {
489
- const config = INJECT_CONFIG[key];
490
- if (!config) return;
491
- provide(config.injectionKey, { ...config.default, ...getObject(val) });
492
- });
493
- }
494
- return (_ctx, _cache) => {
495
- return renderSlot(_ctx.$slots, "default");
496
- };
497
- }
498
- });
499
352
  export {
500
353
  InjectionFormKey as I,
501
- _sfc_main as _,
502
- INJECT_CONFIG as a,
503
- InjectionPathKey as b,
354
+ InjectionPathKey as a,
355
+ useFields as b,
504
356
  camelizeProperties as c,
505
- useFields as d,
506
- useFormRef as e,
507
- useFormData as f,
357
+ useFormRef as d,
358
+ useFormData as e,
359
+ useTable as f,
508
360
  getObject as g,
509
- useTable as h,
510
361
  useForm as u
511
362
  };
package/es/form/index.js CHANGED
@@ -5,8 +5,9 @@ import { useProviderDisabled, useInjectDisabled } from "ant-design-vue/es/config
5
5
  import { colProps } from "ant-design-vue/es/grid/Col";
6
6
  import { formItemProps, useInjectFormItemContext } from "ant-design-vue/es/form";
7
7
  import { defineComponent, provide, inject, useSlots, watchEffect, createBlock, openBlock, unref, mergeProps, withCtx, createVNode, renderSlot, computed, toValue, normalizeProps, guardReactiveProps, resolveComponent, createElementBlock, Fragment, renderList, createSlots, ref, useAttrs, createCommentVNode, resolveDynamicComponent, isVNode, createTextVNode, toDisplayString } from "vue";
8
- import { I as InjectionFormKey, a as INJECT_CONFIG, c as camelizeProperties, b as InjectionPathKey, g as getObject, u as useForm$1, d as useFields$1, e as useFormRef$1 } from "../component-provider/index-BeGPcKnM.js";
9
- import { f } from "../component-provider/index-BeGPcKnM.js";
8
+ import { INJECT_CONFIG } from "../component-provider/index.js";
9
+ import { I as InjectionFormKey, c as camelizeProperties, a as InjectionPathKey, g as getObject, u as useForm$1, b as useFields$1, d as useFormRef$1 } from "../core/index-BrBzu6aj.js";
10
+ import { e } from "../core/index-BrBzu6aj.js";
10
11
  import { i as isPlainObject, t as toPath, o as omit, c as cloneDeep } from "../vendor/utils/lodash-es-p6jau26B.js";
11
12
  const _sfc_main$6 = /* @__PURE__ */ defineComponent({
12
13
  ...{ name: "ProForm", inheritAttrs: false },
@@ -441,6 +442,6 @@ export {
441
442
  getInitProps,
442
443
  useFields,
443
444
  useForm,
444
- f as useFormData,
445
+ e as useFormData,
445
446
  useFormRef
446
447
  };
package/es/index.js CHANGED
@@ -3,8 +3,9 @@ import _sfc_main from "./form/index.js";
3
3
  import { BaseField, BaseFormItem, COMPONENT_MAP, ContainerFragment, FORM_ITEM_SLOT_KEYS, SlotComponent, TeleportComponentNamePrefix, getInitProps, useFields, useForm, useFormRef } from "./form/index.js";
4
4
  import BaseTable from "./table/index.js";
5
5
  import { useTable } from "./table/index.js";
6
- import { _ as _sfc_main$1 } from "./component-provider/index-BeGPcKnM.js";
7
- import { a, I, b, f } from "./component-provider/index-BeGPcKnM.js";
6
+ import _sfc_main$1 from "./component-provider/index.js";
7
+ import { INJECT_CONFIG } from "./component-provider/index.js";
8
+ import { I, a, e } from "./core/index-BrBzu6aj.js";
8
9
  const withInstall = (comp) => {
9
10
  comp.install = (app) => {
10
11
  app.component(comp.name, comp);
@@ -29,9 +30,9 @@ export {
29
30
  COMPONENT_MAP,
30
31
  ContainerFragment,
31
32
  FORM_ITEM_SLOT_KEYS,
32
- a as INJECT_CONFIG,
33
+ INJECT_CONFIG,
33
34
  I as InjectionFormKey,
34
- b as InjectionPathKey,
35
+ a as InjectionPathKey,
35
36
  ProComponentProvider,
36
37
  ProForm,
37
38
  ProTable,
@@ -41,7 +42,7 @@ export {
41
42
  getInitProps,
42
43
  useFields,
43
44
  useForm,
44
- f as useFormData,
45
+ e as useFormData,
45
46
  useFormRef,
46
47
  useTable
47
48
  };
package/es/table/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import { createElementBlock, openBlock, createElementVNode, defineComponent, ref, computed, watch, watchEffect, createBlock, unref, mergeProps, withCtx, createVNode, renderSlot, resolveDynamicComponent, createTextVNode, createCommentVNode, Fragment, toDisplayString, normalizeStyle, useModel, renderList, withModifiers, mergeModels, inject, useAttrs, useSlots, onMounted, normalizeClass, createSlots, normalizeProps, guardReactiveProps, nextTick } from "vue";
2
- import { a as INJECT_CONFIG, g as getObject, c as camelizeProperties, h as useTable$1 } from "../component-provider/index-BeGPcKnM.js";
2
+ import { INJECT_CONFIG } from "../component-provider/index.js";
3
3
  import _sfc_main$9, { ContainerFragment as _sfc_main$a } from "../form/index.js";
4
4
  import { Space, Button, theme, Dropdown, Menu, MenuItem, Checkbox, MenuDivider, Table } from "ant-design-vue";
5
5
  import { p as pick } from "../vendor/utils/lodash-es-p6jau26B.js";
6
+ import { g as getObject, c as camelizeProperties, f as useTable$1 } from "../core/index-BrBzu6aj.js";
6
7
  import { useConfigContextInject } from "ant-design-vue/es/config-provider/context";
7
8
  import { tableProps } from "ant-design-vue/es/table";
8
9
  const _export_sfc = (sfc, props) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qin-ui/antd-vue-pro",
3
- "version": "2.0.18",
3
+ "version": "2.0.19",
4
4
  "description": "二次封装antd vue组件",
5
5
  "type": "module",
6
6
  "module": "es/index.js",
@@ -28,9 +28,6 @@
28
28
  "author": "dufan3715",
29
29
  "license": "MIT",
30
30
  "private": false,
31
- "dependencies": {
32
- "@qin-ui/core": "workspace:^"
33
- },
34
31
  "peerDependencies": {
35
32
  "ant-design-vue": "^4",
36
33
  "vue": "^3.5.0"
@@ -39,6 +36,7 @@
39
36
  "url": "https://github.com/dufan3715/pro-components/issues"
40
37
  },
41
38
  "devDependencies": {
39
+ "@qin-ui/core": "workspace:^",
42
40
  "@types/lodash-es": "^4.17.12",
43
41
  "ant-design-vue": "^4",
44
42
  "lodash-es": "^4.17.21",