@qin-ui/antdv-next-pro 1.0.1 → 1.0.3

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.
@@ -10,11 +10,11 @@
10
10
  .pro-table_search-form .transition[data-v-37368080] {
11
11
  transition: all 0.25s;
12
12
  }
13
- .pro-table_search-form-container[data-v-8f67830d] {
13
+ .pro-table_search-form-container[data-v-f115fbbe] {
14
14
  margin-bottom: 24px;
15
15
  padding: 24px;
16
16
  }
17
- .pro-table_table-container[data-v-02fe26ae] {
17
+ .pro-table_table-container[data-v-bdd22db3] {
18
18
  flex: 1;
19
19
  padding: 24px 24px 0;
20
20
  }
@@ -36,23 +36,23 @@
36
36
  .pro-table_column-control_button[data-v-246b0faf] svg {
37
37
  transform: scale(1.2, 1.4);
38
38
  }
39
- .pro-table_header[data-v-270ae6c9] {
39
+ .pro-table_header[data-v-a5d71b88] {
40
40
  display: flex;
41
41
  align-items: center;
42
42
  justify-content: flex-end;
43
43
  }
44
- .pro-table_header[data-v-270ae6c9]:empty {
44
+ .pro-table_header[data-v-a5d71b88]:empty {
45
45
  display: none;
46
46
  }
47
- .pro-table_header + .pro-table_header_content[data-v-270ae6c9] {
47
+ .pro-table_header + .pro-table_header_content[data-v-a5d71b88] {
48
48
  margin-top: 16px;
49
49
  }
50
- .pro-table_header_button-bar[data-v-270ae6c9] {
50
+ .pro-table_header_button-bar[data-v-a5d71b88] {
51
51
  flex: 1;
52
52
  }
53
- .pro-table_header_toolbar[data-v-270ae6c9] {
53
+ .pro-table_header_toolbar[data-v-a5d71b88] {
54
54
  margin-left: 12px;
55
55
  }
56
- .pro-table[data-v-270ae6c9] .ant-pagination .ant-pagination-total-text {
56
+ .pro-table[data-v-a5d71b88] .ant-pagination .ant-pagination-total-text {
57
57
  flex: 1;
58
58
  }
@@ -60,7 +60,7 @@ const INJECT_CONFIG = {
60
60
  style: { width: "100%" }
61
61
  }
62
62
  },
63
- "input-opt": {
63
+ "input-otp": {
64
64
  injectionKey: Symbol(""),
65
65
  default: {}
66
66
  },
@@ -118,7 +118,7 @@ const INJECT_CONFIG = {
118
118
  },
119
119
  switch: {
120
120
  injectionKey: Symbol(""),
121
- default: { modelName: "checked" }
121
+ default: { modelProp: "checked" }
122
122
  },
123
123
  slider: {
124
124
  injectionKey: Symbol(""),
@@ -1,4 +1,4 @@
1
- import { a, _ } from "./index-B-Yy-eoc.js";
1
+ import { a, _ } from "./index-Cy8dTKpN.js";
2
2
  export {
3
3
  a as INJECT_CONFIG,
4
4
  _ as default
@@ -1,8 +1,8 @@
1
- import { defineComponent, provide, inject, useSlots, watchEffect, createBlock, openBlock, unref, mergeProps, withCtx, createVNode, renderSlot, toValue, computed, normalizeProps, guardReactiveProps, resolveComponent, createElementBlock, Fragment, renderList, createSlots, ref, useAttrs, createCommentVNode, resolveDynamicComponent, isVNode, createTextVNode, toDisplayString } from "vue";
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, Row, Table, Form, Input, TextArea, InputSearch, InputPassword, InputNumber, InputOTP, Select, Cascader, DatePicker, DateRangePicker, TimePicker, TimeRangePicker, CheckboxGroup, RadioGroup, Switch, Slider, TreeSelect, Transfer, Col } from "antdv-next";
3
3
  import { useDisabledContextProvider, useDisabledContext } from "antdv-next/dist/config-provider/DisabledContext";
4
4
  import "antdv-next/dist/config-provider/SizeContext";
5
- 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-B-Yy-eoc.js";
5
+ 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-Cy8dTKpN.js";
6
6
  import { i as isPlainObject, t as toPath, o as omit, c as cloneDeep } from "../vendor/utils/lodash-es-p6jau26B.js";
7
7
  const tableProps = () => Table.props || {};
8
8
  const gridItemProps = () => Row.props || {};
@@ -17,6 +17,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
17
17
  setup(__props) {
18
18
  provide(InjectionFormKey, __props.form);
19
19
  const { formData, fields, setFormRef } = __props.form;
20
+ const _fields = computed(() => fields.value);
20
21
  const config = INJECT_CONFIG["pro-form"];
21
22
  const { grid: _injectGrid, ...injectAttrs } = inject(
22
23
  config.injectionKey,
@@ -39,7 +40,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
39
40
  }, mergeProps(injectAttrs, unref(camelizeProperties)(_ctx.$attrs)), { class: "pro-form" }), {
40
41
  default: withCtx(() => [
41
42
  createVNode(unref(_sfc_main$3), {
42
- fields: toValue(unref(fields)),
43
+ fields: _fields.value,
43
44
  grid: __props.grid
44
45
  }, null, 8, ["fields", "grid"]),
45
46
  renderSlot(_ctx.$slots, "default")
@@ -93,7 +94,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
93
94
  field: {}
94
95
  },
95
96
  setup(__props) {
96
- const formItemPropKeys = Object.keys(formItemProps()).concat(["container"]);
97
+ const formItemPropKeys = Object.keys(formItemProps());
97
98
  const gridItemPropKeys = Object.keys(gridItemProps());
98
99
  const props = __props;
99
100
  const config = INJECT_CONFIG["pro-form-item"];
@@ -104,11 +105,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
104
105
  const componentProps = { slots: {} };
105
106
  const formItemSlots = {};
106
107
  if (isPlainObject(props.field)) {
107
- const { path, name, fields, className, style, hidden, span, getFormItemRef, getComponentRef, getFormItemComputedProps, getComponentComputedProps, slots = {}, ...rest } = props.field;
108
+ const { path, name, fields, formItemClass, formItemStyle, formItemContainer, hidden, span, getFormItemRef, getComponentRef, getFormItemComputedProps, getComponentComputedProps, slots = {}, ...rest } = props.field;
108
109
  const {
109
110
  class: injectClassName,
110
111
  style: injectStyle,
111
112
  span: injectSpan,
113
+ formItemContainer: injectFormItemContainer,
112
114
  xs,
113
115
  sm,
114
116
  md,
@@ -122,8 +124,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
122
124
  formItemProps2 = mergeProps(
123
125
  injectRest,
124
126
  { class: injectClassName, style: injectStyle },
125
- { class: toValue(className), style: toValue(style) }
127
+ { class: toValue(formItemClass), style: toValue(formItemStyle) }
126
128
  );
129
+ formItemProps2.container = formItemContainer ?? injectFormItemContainer;
127
130
  Object.keys(rest).forEach((k) => {
128
131
  if (gridItemPropKeys.includes(k)) {
129
132
  gridItemProps2[k] = rest[k];
@@ -332,21 +335,26 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
332
335
  component: __props.component,
333
336
  type: attrs.type
334
337
  });
338
+ const modelPropName = attrs.modelProp ?? initProps.modelProp ?? "value";
335
339
  const mergedProps = mergeProps(
336
340
  initProps,
337
341
  attrs,
338
- { class: attrs.componentClassName, style: attrs.componentStyle },
339
- { class: initProps.componentClassName, style: initProps.componentStyle },
342
+ { class: attrs.componentClass, style: attrs.componentStyle },
343
+ { class: initProps.componentClass, style: initProps.componentStyle },
340
344
  { disabled: attrs.disabled ?? parentDisabled.value ?? initProps.disabled },
341
- { modelName: attrs.modelName ?? initProps.modelName ?? "value" }
345
+ { modelProp: modelPropName }
342
346
  );
343
- const { valueFormatter, modelName, slots, componentClassName, componentStyle, componentContainer, ...rest } = mergedProps;
344
- const bindAttrs = omit(rest, [modelName, `onUpdate:${modelName}`]);
347
+ const { valueFormatter, modelProp, slots, componentClass, componentStyle, componentContainer, ...rest } = mergedProps;
348
+ const modelBindingProp = modelProp ?? "value";
349
+ const bindAttrs = omit(rest, [
350
+ modelBindingProp,
351
+ `onUpdate:${modelBindingProp}`
352
+ ]);
345
353
  return {
346
354
  attrs: bindAttrs,
347
355
  slots,
348
356
  componentContainer,
349
- modelName,
357
+ modelProp: modelBindingProp,
350
358
  valueFormatter
351
359
  };
352
360
  });
@@ -370,8 +378,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
370
378
  is.value ? (openBlock(), createBlock(resolveDynamicComponent(is.value), mergeProps({ key: 0 }, groupedAttrs.value.attrs, {
371
379
  ref_key: "componentRef",
372
380
  ref: componentRef,
373
- [`${groupedAttrs.value.modelName}`]: value.value,
374
- [`onUpdate:${groupedAttrs.value.modelName}`]: _cache[0] || (_cache[0] = ($event) => value.value = $event),
381
+ [`${groupedAttrs.value.modelProp}`]: value.value,
382
+ [`onUpdate:${groupedAttrs.value.modelProp}`]: _cache[0] || (_cache[0] = ($event) => value.value = $event),
375
383
  path: __props.path
376
384
  }), createSlots({ _: 2 }, [
377
385
  renderList(groupedAttrs.value.slots, (slot, name) => {
package/es/form/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { c, _, b, C, a, F, d, T, _ as _2, g, e, u, f } from "./index-DnjfDQC_.js";
2
- import { I, b as b2, f as f2 } from "../component-provider/index-B-Yy-eoc.js";
1
+ import { c, _, b, C, a, F, d, T, _ as _2, g, e, u, f } from "./index-DShboSl2.js";
2
+ import { I, b as b2, f as f2 } from "../component-provider/index-Cy8dTKpN.js";
3
3
  export {
4
4
  c as BaseField,
5
5
  _ as BaseForm,
package/es/index.d.ts CHANGED
@@ -159,12 +159,12 @@ export declare interface Base<D extends Data = Data> {
159
159
  * @description 字段formItem样式属性
160
160
  * @example { marginBottom: '8px', padding: '12px' }
161
161
  */
162
- style?: CSSProperties;
162
+ formItemStyle?: CSSProperties;
163
163
  /**
164
164
  * @description 字段formItem样式类名
165
165
  * @example 'custom-form-item' | 'required-field'
166
166
  */
167
- className?: string;
167
+ formItemClass?: string;
168
168
  /**
169
169
  * @description 嵌套子字段配置
170
170
  * @example [{ key: 'firstName', label: '名' }, { key: 'lastName', label: '姓' }]
@@ -179,7 +179,7 @@ export declare interface Base<D extends Data = Data> {
179
179
  * @description 字段formItem容器包裹组件
180
180
  * @example (props, ctx) => h('div', { class: 'custom-container' }, ctx.slots.default?.())
181
181
  */
182
- container?: ContainerComponent;
182
+ formItemContainer?: ContainerComponent;
183
183
  /**
184
184
  * @description 字段component样式属性
185
185
  * @example { width: '100%', borderColor: '#d9d9d9' }
@@ -189,7 +189,7 @@ export declare interface Base<D extends Data = Data> {
189
189
  * @description 字段component样式类名
190
190
  * @example 'custom-input' | 'error-input'
191
191
  */
192
- componentClassName?: string;
192
+ componentClass?: string;
193
193
  /**
194
194
  * @description 字段component容器包裹组件
195
195
  * @example (props, ctx) => h('div', { class: 'input-wrapper' }, ctx.slots.default?.())
@@ -203,7 +203,7 @@ export declare interface Base<D extends Data = Data> {
203
203
  /**
204
204
  * @description 组件v-model双向绑定更新属性名,默认'value'
205
205
  */
206
- modelName?: string;
206
+ modelProp?: string;
207
207
  /**
208
208
  * @description 以data-form-item-开始的属性名将会被渲染至formItem的dom节点
209
209
  * @example { 'data-form-item-test': 'test-value' }
@@ -348,7 +348,7 @@ declare const _default_2: <T extends Table<any> = Table>(__VLS_props: NonNullabl
348
348
  index: number;
349
349
  column: Column<T extends Table<infer U extends Data> ? U : never>;
350
350
  }) => void;
351
- }> & Readonly<Partial<Record<"table" | "toolbar" | "search-form" | "button-bar", Slot>>>, "default">> & Omit<Omit<Readonly<{
351
+ }> & Readonly<Partial<Record<"table" | "search-form" | "button-bar" | "toolbar", Slot>>>, "default">> & Omit<Omit<Readonly<{
352
352
  default?: (() => any) | undefined;
353
353
  title?: ((data: readonly AnyObject[]) => any) | undefined;
354
354
  footer?: ((data: readonly AnyObject[]) => any) | undefined;
@@ -387,7 +387,7 @@ declare const _default_2: <T extends Table<any> = Table>(__VLS_props: NonNullabl
387
387
  index: number;
388
388
  column: Column<T extends Table<infer U extends Data> ? U : never>;
389
389
  }) => void;
390
- }> & Readonly<Partial<Record<"table" | "toolbar" | "search-form" | "button-bar", Slot>>>, "default">;
390
+ }> & Readonly<Partial<Record<"table" | "search-form" | "button-bar" | "toolbar", Slot>>>, "default">;
391
391
  emit: ((evt: "update:size", value: ButtonSize) => void) & ((evt: "update:loading", value: boolean) => void);
392
392
  }>) => VNode & {
393
393
  __ctx?: Awaited<typeof __VLS_setup>;
@@ -511,7 +511,7 @@ declare type FormItemInstance = InstanceType<typeof FormItem>;
511
511
 
512
512
  declare type _FormProps = Pick<Partial<FormProps>, 'colon' | 'disabled' | 'labelAlign' | 'labelCol' | 'labelWrap' | 'name' | 'wrapperCol'>;
513
513
 
514
- declare type FP<T extends Record<string, any>> = Partial<T & Pick<Base, 'valueFormatter' | 'componentContainer' | 'modelName'> & AllowedComponentProps>;
514
+ declare type FP<T extends Record<string, any>> = Partial<T & Pick<Base, 'valueFormatter' | 'componentContainer' | 'modelProp' | 'componentClass' | 'componentStyle'> & AllowedComponentProps>;
515
515
 
516
516
  export declare const getInitProps: (field: Field) => Record<string, any>;
517
517
 
@@ -533,7 +533,7 @@ declare type MaybeRefOrComputedRef<T = any> = MaybeRef<T> | ComputedRef<T>;
533
533
  /**
534
534
  * @description 不支持响应式的属性名
535
535
  */
536
- declare type NotSupportedRefOrGetterProps = 'component' | 'container' | 'componentContainer' | 'valueFormatter' | 'fields' | 'slots' | 'modelName';
536
+ declare type NotSupportedRefOrGetterProps = 'component' | 'formItemContainer' | 'componentContainer' | 'valueFormatter' | 'fields' | 'slots' | 'modelProp';
537
537
 
538
538
  declare type Option_2 = {
539
539
  label: string;
@@ -695,13 +695,13 @@ export declare type RequiredComponentVars = {
695
695
  'pro-form': PP<Omit<ProFormProps, 'form' | 'grid'> & {
696
696
  grid: Exclude<Grid, undefined | boolean>;
697
697
  }>;
698
- 'pro-form-item': PP<FormItemProps & Pick<ColProps, 'span' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'> & Pick<Base, 'container'>>;
698
+ 'pro-form-item': PP<FormItemProps & Pick<ColProps, 'span' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'> & Pick<Base, 'formItemContainer'>>;
699
699
  'input': FP<InputProps>;
700
700
  'textarea': FP<TextAreaProps>;
701
701
  'input-password': FP<InputProps>;
702
702
  'input-search': FP<InputProps>;
703
703
  'input-number': FP<InputNumberProps>;
704
- 'input-opt': FP<InputOTPProps>;
704
+ 'input-otp': FP<InputOTPProps>;
705
705
  'select': FP<SelectProps>;
706
706
  'cascader': FP<CascaderProps>;
707
707
  'date-picker': FP<DatePickerProps>;
package/es/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import "./antdv-next-pro.css";
2
- import { _ as _sfc_main } from "./form/index-DnjfDQC_.js";
3
- import { c, b, C, a, F, d, T, g, e, u, f } from "./form/index-DnjfDQC_.js";
4
- import { _ as _sfc_main$1 } from "./component-provider/index-B-Yy-eoc.js";
5
- import { a as a2, I, b as b2, f as f2 } from "./component-provider/index-B-Yy-eoc.js";
2
+ import { _ as _sfc_main } from "./form/index-DShboSl2.js";
3
+ import { c, b, C, a, F, d, T, g, e, u, f } from "./form/index-DShboSl2.js";
4
+ import { _ as _sfc_main$1 } from "./component-provider/index-Cy8dTKpN.js";
5
+ import { a as a2, I, b as b2, f as f2 } from "./component-provider/index-Cy8dTKpN.js";
6
6
  import BaseTable from "./table/index.js";
7
7
  import { useTable } from "./table/index.js";
8
8
  const withInstall = (comp) => {
package/es/table/index.js CHANGED
@@ -2,8 +2,8 @@ import { createElementBlock, openBlock, createElementVNode, defineComponent, ref
2
2
  import { Space, Button, theme, useConfig, Dropdown, Menu, Checkbox, Table } from "antdv-next";
3
3
  import "antdv-next/dist/config-provider/DisabledContext";
4
4
  import "antdv-next/dist/config-provider/SizeContext";
5
- import { _ as _sfc_main$9, t as tableProps, a as _sfc_main$a } from "../form/index-DnjfDQC_.js";
6
- import { a as INJECT_CONFIG, g as getObject, c as camelizeProperties, h as useTable$1 } from "../component-provider/index-B-Yy-eoc.js";
5
+ import { _ as _sfc_main$9, t as tableProps, a as _sfc_main$a } from "../form/index-DShboSl2.js";
6
+ import { a as INJECT_CONFIG, g as getObject, c as camelizeProperties, h as useTable$1 } from "../component-provider/index-Cy8dTKpN.js";
7
7
  import { p as pick } from "../vendor/utils/lodash-es-p6jau26B.js";
8
8
  const _export_sfc = (sfc, props) => {
9
9
  const target = sfc.__vccOpts || sfc;
@@ -227,34 +227,40 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
227
227
  __name: "DefaultSearchFormContainer",
228
228
  setup(__props) {
229
229
  const { token } = theme.useToken();
230
- return (_ctx, _cache) => {
230
+ const bgColor = computed(() => {
231
231
  var _a;
232
+ return (_a = token.value) == null ? void 0 : _a.colorBgContainer;
233
+ });
234
+ return (_ctx, _cache) => {
232
235
  return openBlock(), createElementBlock("div", {
233
236
  class: "pro-table_search-form-container",
234
- style: normalizeStyle({ backgroundColor: (_a = unref(token).value) == null ? void 0 : _a.colorBgContainer })
237
+ style: normalizeStyle({ backgroundColor: bgColor.value })
235
238
  }, [
236
239
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
237
240
  ], 4);
238
241
  };
239
242
  }
240
243
  });
241
- const DefaultSearchFormContainer = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-8f67830d"]]);
244
+ const DefaultSearchFormContainer = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-f115fbbe"]]);
242
245
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
243
246
  __name: "DefaultTableContainer",
244
247
  setup(__props) {
245
248
  const { token } = theme.useToken();
246
- return (_ctx, _cache) => {
249
+ const bgColor = computed(() => {
247
250
  var _a;
251
+ return (_a = token.value) == null ? void 0 : _a.colorBgContainer;
252
+ });
253
+ return (_ctx, _cache) => {
248
254
  return openBlock(), createElementBlock("div", {
249
255
  class: "pro-table_table-container",
250
- style: normalizeStyle({ backgroundColor: (_a = unref(token).value) == null ? void 0 : _a.colorBgContainer })
256
+ style: normalizeStyle({ backgroundColor: bgColor.value })
251
257
  }, [
252
258
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
253
259
  ], 4);
254
260
  };
255
261
  }
256
262
  });
257
- const DefaultTableContainer = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-02fe26ae"]]);
263
+ const DefaultTableContainer = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-bdd22db3"]]);
258
264
  const _sfc_main$4 = {};
259
265
  const _hoisted_1$2 = {
260
266
  focusable: "false",
@@ -671,7 +677,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
671
677
  };
672
678
  }
673
679
  });
674
- const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-270ae6c9"]]);
680
+ const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a5d71b88"]]);
675
681
  const useTable = useTable$1;
676
682
  export {
677
683
  BaseTable as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qin-ui/antdv-next-pro",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "基于 antdv-next 的二次封装组件",
5
5
  "type": "module",
6
6
  "module": "es/index.js",