@qin-ui/antd-vue-pro 1.1.10 → 1.1.11

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.
package/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present pro-components
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -15738,6 +15738,7 @@ const UPDATE_FORM_DATA = Symbol(
15738
15738
  "updateFormData"
15739
15739
  );
15740
15740
  const UPDATE_REFS = Symbol("updateRefs");
15741
+ const GET_REF = Symbol("getRef");
15741
15742
  const COMMAND = Symbol("command");
15742
15743
  const UPDATE_ACTIVE_PATH = Symbol(
15743
15744
  "setActivePath"
@@ -15787,7 +15788,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
15787
15788
  if (!el)
15788
15789
  return;
15789
15790
  const path = getPath(field.key);
15790
- updateRefs == null ? void 0 : updateRefs(path, el, "formItemRefs");
15791
+ updateRefs == null ? void 0 : updateRefs("formItemRefs", path, el);
15791
15792
  };
15792
15793
  const proFormPropKeys = computed(() => {
15793
15794
  return [
@@ -16160,7 +16161,6 @@ async function validateConditions(conditions, baseParam) {
16160
16161
  return result;
16161
16162
  }
16162
16163
  async function runRules(rules2, baseParam) {
16163
- var _a, _b;
16164
16164
  const { form, run, refs, message: message2, logQueue } = baseParam;
16165
16165
  logQueue.push([[`逻辑执行规则: `, ["purple", "indent2"]]]);
16166
16166
  for (let ruleIndex = 0; ruleIndex < rules2.length; ruleIndex += 1) {
@@ -16235,10 +16235,8 @@ async function runRules(rules2, baseParam) {
16235
16235
  form.setField(path, (preField) => ({ ...preField, ...value }));
16236
16236
  break;
16237
16237
  case "validate":
16238
- (_a = refs.formItemRefs[path]) == null ? void 0 : _a.validate();
16239
16238
  break;
16240
16239
  case "clearValidate":
16241
- (_b = refs.formItemRefs[path]) == null ? void 0 : _b.restoreValidation();
16242
16240
  break;
16243
16241
  case "message":
16244
16242
  message2.info(value);
@@ -16366,9 +16364,16 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
16366
16364
  const formData = inject(FORM_DATA);
16367
16365
  const updateFormData = inject(UPDATE_FORM_DATA);
16368
16366
  const updateRefs = inject(UPDATE_REFS);
16367
+ const getRef = inject(GET_REF);
16369
16368
  const command = inject(COMMAND);
16370
16369
  const updateActivePath = inject(UPDATE_ACTIVE_PATH);
16371
16370
  const { getInitProps } = useInitProps();
16371
+ const triggerRefChange = () => {
16372
+ if (typeof props.component === "string" && COMPONENT_MAP.has(props.component))
16373
+ return;
16374
+ const formItemRef = getRef == null ? void 0 : getRef("formItemRefs", props.path);
16375
+ formItemRef == null ? void 0 : formItemRef.onFieldChange();
16376
+ };
16372
16377
  const value = computed({
16373
16378
  get() {
16374
16379
  return get$1(formData == null ? void 0 : formData.value, props.path);
@@ -16380,6 +16385,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
16380
16385
  return;
16381
16386
  }
16382
16387
  updateFormData == null ? void 0 : updateFormData(props.path, val);
16388
+ triggerRefChange();
16383
16389
  }
16384
16390
  });
16385
16391
  const forceUpdateKey = ref(0);
@@ -16445,7 +16451,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
16445
16451
  const setComponentRef = (el) => {
16446
16452
  if (!el)
16447
16453
  return;
16448
- updateRefs == null ? void 0 : updateRefs(props.path, el, "fieldRefs");
16454
+ updateRefs == null ? void 0 : updateRefs("fieldRefs", props.path, el);
16449
16455
  };
16450
16456
  onMounted(() => {
16451
16457
  var _a, _b, _c;
@@ -16491,7 +16497,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
16491
16497
  };
16492
16498
  }
16493
16499
  });
16494
- const index_vue_vue_type_style_index_0_scoped_7ea181bc_lang = "";
16500
+ const index_vue_vue_type_style_index_0_scoped_9a3bf1a0_lang = "";
16495
16501
  const _export_sfc = (sfc, props) => {
16496
16502
  const target = sfc.__vccOpts || sfc;
16497
16503
  for (const [key, val] of props) {
@@ -16499,7 +16505,7 @@ const _export_sfc = (sfc, props) => {
16499
16505
  }
16500
16506
  return target;
16501
16507
  };
16502
- const BaseField = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-7ea181bc"]]);
16508
+ const BaseField = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-9a3bf1a0"]]);
16503
16509
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
16504
16510
  ...{
16505
16511
  name: "ContainerFragment",
@@ -16560,12 +16566,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16560
16566
  formItemRefs: {},
16561
16567
  fieldRefs: {}
16562
16568
  };
16563
- const updateRefs = (path, childRef, type4) => {
16569
+ const updateRefs = (type4, path, childRef) => {
16564
16570
  if (!path)
16565
16571
  return;
16566
16572
  refs[type4][path] = childRef;
16567
16573
  };
16568
- const exposed = shallowReactive({ refs });
16574
+ const getRef = (type4, path) => {
16575
+ return refs[type4][path];
16576
+ };
16577
+ const exposed = shallowReactive({ refs, getRef });
16569
16578
  const updateActivePath = (path) => {
16570
16579
  var _a, _b;
16571
16580
  if (props.form) {
@@ -16610,6 +16619,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16610
16619
  provide(FORM_DATA, _formData);
16611
16620
  provide(UPDATE_FORM_DATA, updateFormData);
16612
16621
  provide(UPDATE_REFS, updateRefs);
16622
+ provide(GET_REF, getRef);
16613
16623
  provide(COMMAND, command);
16614
16624
  provide(UPDATE_ACTIVE_PATH, updateActivePath);
16615
16625
  __expose(exposed);
@@ -16637,6 +16647,7 @@ export {
16637
16647
  BaseField as B,
16638
16648
  COMPONENT_MAP as C,
16639
16649
  FORM_ITEM_SLOT_KEYS as F,
16650
+ GET_REF as G,
16640
16651
  RULE_TYPE_MAP as R,
16641
16652
  UPDATE_FORM_DATA as U,
16642
16653
  _sfc_main as _,
package/es/form/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { l, B, d, i, C, b, f, F, k, R, e, j, U, h, _, m, p, n, s, q, u, r, t } from "./index-bb61c8f9.js";
1
+ import { l, B, d, i, C, b, f, F, k, G, R, e, j, U, h, _, m, p, n, s, q, u, r, t } from "./index-2a04ad4a.js";
2
2
  import "vue";
3
3
  import "ant-design-vue";
4
4
  import "../component-provider/index.js";
@@ -12,6 +12,7 @@ export {
12
12
  f as FORM_DATA,
13
13
  F as FORM_ITEM_SLOT_KEYS,
14
14
  k as FunctionRegexp,
15
+ G as GET_REF,
15
16
  R as RULE_TYPE_MAP,
16
17
  e as SlotComponent,
17
18
  j as UPDATE_ACTIVE_PATH,
package/es/index.d.ts CHANGED
@@ -25,6 +25,7 @@ import { ExpandedRowRender } from 'ant-design-vue/es/vc-table/interface';
25
25
  import { ExtractPropTypes } from 'vue';
26
26
  import { FieldData } from 'ant-design-vue/es/form/interface';
27
27
  import { FilterValue } from 'ant-design-vue/es/table/interface';
28
+ import type { FormItemInstance } from 'ant-design-vue';
28
29
  import type { FormItemProps } from 'ant-design-vue';
29
30
  import { FormLabelAlign } from 'ant-design-vue/es/form/interface';
30
31
  import { FormProps as FormProps_2 } from 'ant-design-vue';
@@ -377,6 +378,7 @@ declare const _default_2: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefa
377
378
  activePath: undefined;
378
379
  }>, {
379
380
  refs: Refs;
381
+ getRef: GetRef;
380
382
  resetFields: (name?: NamePath | undefined) => void;
381
383
  clearValidate: (name?: NamePath | undefined) => void;
382
384
  validateFields: (nameList?: string | NamePath[] | undefined, options?: ValidateOptions | undefined) => Promise<{
@@ -1880,6 +1882,8 @@ declare interface FormProps extends FormProps_2 {
1880
1882
  */
1881
1883
  export declare const FunctionRegexp: RegExp;
1882
1884
 
1885
+ export declare const GET_REF: InjectionKey<GetRef>;
1886
+
1883
1887
  export declare type GetField = (path?: string) => Field | undefined;
1884
1888
 
1885
1889
  export declare type GetFieldPath = (path?: string) => string | undefined;
@@ -1888,6 +1892,11 @@ export declare type GetFormData = (path?: string) => DeepReadonly<any>;
1888
1892
 
1889
1893
  export declare type GetParentField = (path?: string) => Field | undefined;
1890
1894
 
1895
+ export declare type GetRef = {
1896
+ (type: 'formItemRefs', path: string): FormItemInstance;
1897
+ (type: 'fieldRefs', path: string): any;
1898
+ };
1899
+
1891
1900
  export declare type Grid = boolean | RowProps;
1892
1901
 
1893
1902
  export declare const INIT_PROPS_MAP: Map<symbol, {
@@ -4170,6 +4179,7 @@ export declare const ProForm: SFCWithInstall<{
4170
4179
  "onUpdate:activePath"?: ((val: string | undefined) => any) | undefined;
4171
4180
  }, {
4172
4181
  refs: Refs;
4182
+ getRef: GetRef;
4173
4183
  resetFields: (name?: NamePath | undefined) => void;
4174
4184
  clearValidate: (name?: NamePath | undefined) => void;
4175
4185
  validateFields: (nameList?: string | NamePath[] | undefined, options?: ValidateOptions | undefined) => Promise<{
@@ -4382,6 +4392,7 @@ export declare const ProForm: SFCWithInstall<{
4382
4392
  "onUpdate:activePath"?: ((val: string | undefined) => any) | undefined;
4383
4393
  } & ShallowUnwrapRef<{
4384
4394
  refs: Refs;
4395
+ getRef: GetRef;
4385
4396
  resetFields: (name?: NamePath | undefined) => void;
4386
4397
  clearValidate: (name?: NamePath | undefined) => void;
4387
4398
  validateFields: (nameList?: string | NamePath[] | undefined, options?: ValidateOptions | undefined) => Promise<{
@@ -4568,6 +4579,7 @@ export declare const ProForm: SFCWithInstall<{
4568
4579
  "onUpdate:activePath"?: ((val: string | undefined) => any) | undefined;
4569
4580
  }, {
4570
4581
  refs: Refs;
4582
+ getRef: GetRef;
4571
4583
  resetFields: (name?: NamePath | undefined) => void;
4572
4584
  clearValidate: (name?: NamePath | undefined) => void;
4573
4585
  validateFields: (nameList?: string | NamePath[] | undefined, options?: ValidateOptions | undefined) => Promise<{
@@ -5973,7 +5985,7 @@ export declare type ProTableInstance = ComponentExposed<typeof _default_3>;
5973
5985
  declare type RangePickerSlots = FieldSlot<'dateRender' | 'renderExtraFooter' | 'separator'>;
5974
5986
 
5975
5987
  export declare type Refs = {
5976
- formItemRefs: Record<string, any>;
5988
+ formItemRefs: Record<string, FormItemInstance>;
5977
5989
  fieldRefs: Record<string, any>;
5978
5990
  };
5979
5991
 
@@ -6061,7 +6073,7 @@ export declare const UPDATE_REFS: InjectionKey<UpdateRefs>;
6061
6073
 
6062
6074
  export declare type UpdateFormData = (path: string, value: any) => void;
6063
6075
 
6064
- export declare type UpdateRefs = (path: string, childRef: Record<string, any>, type: keyof Refs) => void;
6076
+ export declare type UpdateRefs = (type: keyof Refs, path: string, childRef: Record<string, any>) => void;
6065
6077
 
6066
6078
  export declare type UseCommand = (param: {
6067
6079
  refs: Refs;
package/es/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./style.css";
2
- import { _ as _sfc_main } from "./form/index-bb61c8f9.js";
3
- import { l, B, d, i, C, b, f, F, k, R, e, j, U, h, m, p, n, s, q, u, r, t } from "./form/index-bb61c8f9.js";
2
+ import { _ as _sfc_main } from "./form/index-2a04ad4a.js";
3
+ import { l, B, d, i, C, b, f, F, k, G, R, e, j, U, h, m, p, n, s, q, u, r, t } from "./form/index-2a04ad4a.js";
4
4
  import BaseTable from "./table/index.js";
5
5
  import { useTable } from "./table/index.js";
6
6
  import _sfc_main$1 from "./component-provider/index.js";
@@ -34,6 +34,7 @@ export {
34
34
  f as FORM_DATA,
35
35
  F as FORM_ITEM_SLOT_KEYS,
36
36
  k as FunctionRegexp,
37
+ G as GET_REF,
37
38
  INIT_PROPS_MAP,
38
39
  INJECT_KEYS,
39
40
  ProComponentProvider,
package/es/style.css CHANGED
@@ -1,7 +1,7 @@
1
1
  .ant-form-item:has(> [hide-feedback='true']) {
2
2
  margin-bottom: 0;
3
3
  }
4
- .field-component[data-v-7ea181bc]:not(.ant-switch) {
4
+ .field-component[data-v-9a3bf1a0]:not(.ant-switch) {
5
5
  width: 100%;
6
6
  min-width: 120px;
7
7
  }
package/es/table/index.js CHANGED
@@ -1,7 +1,7 @@
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, 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 { useInjectProps, INJECT_KEYS } from "../component-provider/index.js";
4
- 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-bb61c8f9.js";
4
+ 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-2a04ad4a.js";
5
5
  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" };
6
6
  const ColumnHeightOutlinedSvg = ColumnHeightOutlined$2;
7
7
  function _objectSpread$2(target) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qin-ui/antd-vue-pro",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "description": "二次封装antd vue组件",
5
5
  "type": "module",
6
6
  "main": "",
@@ -14,9 +14,6 @@
14
14
  "type": "git",
15
15
  "url": "git+https://github.com/dufan3715/pro-components.git"
16
16
  },
17
- "scripts": {
18
- "build": "vue-tsc && vite build"
19
- },
20
17
  "keywords": [
21
18
  "vue",
22
19
  "ant-design-vue",
@@ -38,5 +35,8 @@
38
35
  },
39
36
  "dependencies": {
40
37
  "@ant-design/icons-vue": "^7.0.1"
38
+ },
39
+ "scripts": {
40
+ "build": "vue-tsc && vite build"
41
41
  }
42
- }
42
+ }