@qin-ui/antdv-next-pro 1.0.4 → 1.0.5

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,165 @@
1
- import { a, _ } from "./index-DcaBbsiC.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
+ "input-otp": {
64
+ injectionKey: Symbol(""),
65
+ default: {}
66
+ },
67
+ "auto-complete": {
68
+ injectionKey: Symbol(""),
69
+ default: { allowClear: true, placeholder: "请选择", getPopupContainer }
70
+ },
71
+ select: {
72
+ injectionKey: Symbol(""),
73
+ default: { allowClear: true, placeholder: "请选择", getPopupContainer }
74
+ },
75
+ cascader: {
76
+ injectionKey: Symbol(""),
77
+ default: { allowClear: true, placeholder: "请选择", getPopupContainer }
78
+ },
79
+ "date-picker": {
80
+ injectionKey: Symbol(""),
81
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
82
+ },
83
+ "date-picker.date": {
84
+ injectionKey: Symbol(""),
85
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
86
+ },
87
+ "date-picker.week": {
88
+ injectionKey: Symbol(""),
89
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
90
+ },
91
+ "date-picker.month": {
92
+ injectionKey: Symbol(""),
93
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
94
+ },
95
+ "date-picker.year": {
96
+ injectionKey: Symbol(""),
97
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
98
+ },
99
+ "date-picker.quarter": {
100
+ injectionKey: Symbol(""),
101
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
102
+ },
103
+ "range-picker": {
104
+ injectionKey: Symbol(""),
105
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
106
+ },
107
+ "time-picker": {
108
+ injectionKey: Symbol(""),
109
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
110
+ },
111
+ "time-range-picker": {
112
+ injectionKey: Symbol(""),
113
+ default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
114
+ },
115
+ "checkbox-group": {
116
+ injectionKey: Symbol(""),
117
+ default: {}
118
+ },
119
+ "radio-group": {
120
+ injectionKey: Symbol(""),
121
+ default: {}
122
+ },
123
+ switch: {
124
+ injectionKey: Symbol(""),
125
+ default: { modelProp: "checked" }
126
+ },
127
+ slider: {
128
+ injectionKey: Symbol(""),
129
+ default: {}
130
+ },
131
+ "tree-select": {
132
+ injectionKey: Symbol(""),
133
+ default: {}
134
+ },
135
+ transfer: {
136
+ injectionKey: Symbol(""),
137
+ default: {}
138
+ }
139
+ };
140
+ const _sfc_main = /* @__PURE__ */ defineComponent({
141
+ ...{
142
+ inheritAttrs: false
143
+ },
144
+ __name: "index",
145
+ props: {
146
+ componentVars: {}
147
+ },
148
+ setup(__props) {
149
+ const props = __props;
150
+ if (props.componentVars) {
151
+ Object.entries(props.componentVars).forEach(([key, val]) => {
152
+ const config = INJECT_CONFIG[key];
153
+ if (!config) return;
154
+ provide(config.injectionKey, { ...config.default, ...getObject(val) });
155
+ });
156
+ }
157
+ return (_ctx, _cache) => {
158
+ return renderSlot(_ctx.$slots, "default");
159
+ };
160
+ }
161
+ });
2
162
  export {
3
- a as INJECT_CONFIG,
4
- _ as default
163
+ INJECT_CONFIG,
164
+ _sfc_main as default
5
165
  };
@@ -1,142 +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
- "input-otp": {
64
- injectionKey: Symbol(""),
65
- default: {}
66
- },
67
- "auto-complete": {
68
- injectionKey: Symbol(""),
69
- default: { allowClear: true, placeholder: "请选择", getPopupContainer }
70
- },
71
- select: {
72
- injectionKey: Symbol(""),
73
- default: { allowClear: true, placeholder: "请选择", getPopupContainer }
74
- },
75
- cascader: {
76
- injectionKey: Symbol(""),
77
- default: { allowClear: true, placeholder: "请选择", getPopupContainer }
78
- },
79
- "date-picker": {
80
- injectionKey: Symbol(""),
81
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
82
- },
83
- "date-picker.date": {
84
- injectionKey: Symbol(""),
85
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
86
- },
87
- "date-picker.week": {
88
- injectionKey: Symbol(""),
89
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
90
- },
91
- "date-picker.month": {
92
- injectionKey: Symbol(""),
93
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
94
- },
95
- "date-picker.year": {
96
- injectionKey: Symbol(""),
97
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
98
- },
99
- "date-picker.quarter": {
100
- injectionKey: Symbol(""),
101
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
102
- },
103
- "range-picker": {
104
- injectionKey: Symbol(""),
105
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
106
- },
107
- "time-picker": {
108
- injectionKey: Symbol(""),
109
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
110
- },
111
- "time-range-picker": {
112
- injectionKey: Symbol(""),
113
- default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
114
- },
115
- "checkbox-group": {
116
- injectionKey: Symbol(""),
117
- default: {}
118
- },
119
- "radio-group": {
120
- injectionKey: Symbol(""),
121
- default: {}
122
- },
123
- switch: {
124
- injectionKey: Symbol(""),
125
- default: { modelProp: "checked" }
126
- },
127
- slider: {
128
- injectionKey: Symbol(""),
129
- default: {}
130
- },
131
- "tree-select": {
132
- injectionKey: Symbol(""),
133
- default: {}
134
- },
135
- transfer: {
136
- injectionKey: Symbol(""),
137
- default: {}
138
- }
139
- };
140
3
  const InjectionFormKey = Symbol("form");
141
4
  const InjectionPathKey = Symbol("path");
142
5
  function getObject(val) {
@@ -486,38 +349,14 @@ const useTable = (params) => {
486
349
  resetQueryParams
487
350
  };
488
351
  };
489
- const _sfc_main = /* @__PURE__ */ defineComponent({
490
- ...{
491
- inheritAttrs: false
492
- },
493
- __name: "index",
494
- props: {
495
- componentVars: {}
496
- },
497
- setup(__props) {
498
- const props = __props;
499
- if (props.componentVars) {
500
- Object.entries(props.componentVars).forEach(([key, val]) => {
501
- const config = INJECT_CONFIG[key];
502
- if (!config) return;
503
- provide(config.injectionKey, { ...config.default, ...getObject(val) });
504
- });
505
- }
506
- return (_ctx, _cache) => {
507
- return renderSlot(_ctx.$slots, "default");
508
- };
509
- }
510
- });
511
352
  export {
512
353
  InjectionFormKey as I,
513
- _sfc_main as _,
514
- INJECT_CONFIG as a,
515
- InjectionPathKey as b,
354
+ InjectionPathKey as a,
355
+ useFields as b,
516
356
  camelizeProperties as c,
517
- useFields as d,
518
- useFormRef as e,
519
- useFormData as f,
357
+ useFormRef as d,
358
+ useFormData as e,
359
+ useTable as f,
520
360
  getObject as g,
521
- useTable as h,
522
361
  useForm as u
523
362
  };
@@ -1,7 +1,8 @@
1
1
  import { defineComponent, provide, computed, inject, useSlots, watchEffect, createBlock, openBlock, unref, mergeProps, withCtx, createVNode, renderSlot, toValue, normalizeProps, guardReactiveProps, resolveComponent, createElementBlock, Fragment, renderList, createSlots, ref, useAttrs, createCommentVNode, resolveDynamicComponent, isVNode, createTextVNode, toDisplayString } from "vue";
2
2
  import { FormItem, Col, Table, Form, Input, TextArea, InputSearch, InputPassword, InputNumber, InputOTP, AutoComplete, Select, Cascader, DatePicker, DateRangePicker, TimePicker, TimeRangePicker, CheckboxGroup, RadioGroup, Switch, Slider, TreeSelect, Transfer, Row } from "antdv-next";
3
3
  import { useDisabledContextProvider, useDisabledContext } from "antdv-next/dist/config-provider/DisabledContext";
4
- 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-DcaBbsiC.js";
4
+ import { INJECT_CONFIG } from "../component-provider/index.js";
5
+ 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";
5
6
  import { i as isPlainObject, t as toPath, o as omit, c as cloneDeep } from "../vendor/utils/lodash-es-p6jau26B.js";
6
7
  const tableProps = () => Table.props || {};
7
8
  const gridItemProps = () => Col.props || {};
package/es/form/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { c, _, b, C, a, F, d, T, _ as _2, g, r, e, u, f } from "./index-idQHUPJc.js";
2
- import { I, b as b2, f as f2 } from "../component-provider/index-DcaBbsiC.js";
1
+ import { c, _, b, C, a, F, d, T, _ as _2, g, r, e, u, f } from "./index-CMvNb50_.js";
2
+ import { I, a as a2, e as e2 } from "../core/index-BrBzu6aj.js";
3
3
  export {
4
4
  c as BaseField,
5
5
  _ as BaseForm,
@@ -8,7 +8,7 @@ export {
8
8
  a as ContainerFragment,
9
9
  F as FORM_ITEM_SLOT_KEYS,
10
10
  I as InjectionFormKey,
11
- b2 as InjectionPathKey,
11
+ a2 as InjectionPathKey,
12
12
  d as SlotComponent,
13
13
  T as TeleportComponentNamePrefix,
14
14
  _2 as default,
@@ -16,6 +16,6 @@ export {
16
16
  r as registerComponent,
17
17
  e as useFields,
18
18
  u as useForm,
19
- f2 as useFormData,
19
+ e2 as useFormData,
20
20
  f as useFormRef
21
21
  };
package/es/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import "./antdv-next-pro.css";
2
- import { _ as _sfc_main } from "./form/index-idQHUPJc.js";
3
- import { c, b, C, a, F, d, T, g, r, e, u, f } from "./form/index-idQHUPJc.js";
4
- import { _ as _sfc_main$1 } from "./component-provider/index-DcaBbsiC.js";
5
- import { a as a2, I, b as b2, f as f2 } from "./component-provider/index-DcaBbsiC.js";
2
+ import { _ as _sfc_main } from "./form/index-CMvNb50_.js";
3
+ import { c, b, C, a, F, d, T, g, r, e, u, f } from "./form/index-CMvNb50_.js";
4
+ import { I, a as a2, e as e2 } from "./core/index-BrBzu6aj.js";
6
5
  import BaseTable from "./table/index.js";
7
6
  import { useTable } from "./table/index.js";
7
+ import _sfc_main$1 from "./component-provider/index.js";
8
+ import { INJECT_CONFIG } from "./component-provider/index.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
  C as COMPONENT_MAP,
30
31
  a as ContainerFragment,
31
32
  F as FORM_ITEM_SLOT_KEYS,
32
- a2 as INJECT_CONFIG,
33
+ INJECT_CONFIG,
33
34
  I as InjectionFormKey,
34
- b2 as InjectionPathKey,
35
+ a2 as InjectionPathKey,
35
36
  ProComponentProvider,
36
37
  ProForm,
37
38
  ProTable,
@@ -42,7 +43,7 @@ export {
42
43
  r as registerComponent,
43
44
  e as useFields,
44
45
  u as useForm,
45
- f2 as useFormData,
46
+ e2 as useFormData,
46
47
  f as useFormRef,
47
48
  useTable
48
49
  };
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, h, mergeModels, inject, useAttrs, useSlots, onMounted, normalizeClass, createSlots, renderList, normalizeProps, guardReactiveProps, nextTick } from "vue";
2
2
  import { Space, Button, theme, useConfig, Dropdown, Menu, Checkbox, Table } from "antdv-next";
3
3
  import "antdv-next/dist/config-provider/DisabledContext";
4
- import { _ as _sfc_main$9, t as tableProps, a as _sfc_main$a } from "../form/index-idQHUPJc.js";
5
- import { a as INJECT_CONFIG, g as getObject, c as camelizeProperties, h as useTable$1 } from "../component-provider/index-DcaBbsiC.js";
4
+ import { _ as _sfc_main$9, t as tableProps, a as _sfc_main$a } from "../form/index-CMvNb50_.js";
5
+ import { INJECT_CONFIG } from "../component-provider/index.js";
6
+ import { g as getObject, c as camelizeProperties, f as useTable$1 } from "../core/index-BrBzu6aj.js";
6
7
  import { p as pick } from "../vendor/utils/lodash-es-p6jau26B.js";
7
8
  const _export_sfc = (sfc, props) => {
8
9
  const target = sfc.__vccOpts || sfc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qin-ui/antdv-next-pro",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "基于 antdv-next 的二次封装组件",
5
5
  "type": "module",
6
6
  "module": "es/index.js",
@@ -28,14 +28,12 @@
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
  "antdv-next": "^1.1.0",
36
33
  "vue": "^3.5.0"
37
34
  },
38
35
  "devDependencies": {
36
+ "@qin-ui/core": "workspace:^",
39
37
  "@types/lodash-es": "^4.17.12",
40
38
  "antdv-next": "^1.1.0",
41
39
  "lodash-es": "^4.17.21",