cnhis-design-vue 3.1.41-beta.22 → 3.1.41-beta.23

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.
@@ -42,16 +42,4 @@ export declare enum FIELD_AGE_UNIT {
42
42
  WEEK = "W",
43
43
  MINUTE = "N"
44
44
  }
45
- export declare enum LOW_CODE_VALUE_RELATION {
46
- EQ = "EQ",
47
- NEQ = "NEQ",
48
- CL = "CL",
49
- NC = "NC",
50
- NULL = "NULL",
51
- NOT_NULL = "NOT_NULL",
52
- BIG = "BIG",
53
- BIGEQ = "BIGEQ",
54
- LESS = "LESS",
55
- LESSEQ = "LESSEQ"
56
- }
57
45
  export declare const NESTED_FORM_ITEM_TYPE: string[];
@@ -1 +1 @@
1
- const e=Symbol("InjectionAsyncQueue"),E=Symbol("InjectionSchemaField"),o=Symbol("InjectionBusinessCollector"),n=Symbol("InjectionChangeContextCollector"),t=Symbol("InjectionFormItemDepsCollector"),I=Symbol("InjectionFormUUID"),S=Symbol("InjectionFormGraph"),L=Symbol("InjectionAnnotation"),A="__dep_LINEBAR_";var N=(e=>(e.PASSWORD="password",e.ID_CARD="id_card",e.AGE="age",e.AGE_UNIT="age_unit",e.MOBILE="mobile",e.TELEPHONE="telephone",e.EMAIL="email",e.SEX="sex",e.BIRTHDAY="birthday",e.BANK_CARD="bank_card",e.WEBSITE="website",e.GESTATIONAL_WEEKS="gestational_weeks",e.GESTATIONAL_STAGE="gestational_stage",e.CUSTOMER_NAME="customer_name",e))(N||{}),l=(e=>(e.MALE="1",e.FEMALE="2",e))(l||{}),a=(e=>(e.DAY="D",e.MONTH="M",e.YEAR="Y",e.HOUR="H",e.WEEK="W",e.MINUTE="N",e))(a||{}),i=(e=>(e.EQ="EQ",e.NEQ="NEQ",e.CL="CL",e.NC="NC",e.NULL="NULL",e.NOT_NULL="NOT_NULL",e.BIG="BIG",e.BIGEQ="BIGEQ",e.LESS="LESS",e.LESSEQ="LESSEQ",e))(i||{});const c=["COMPLEX","COMBINATION"];export{a as FIELD_AGE_UNIT,N as FIELD_BUSINESS_TYPE,l as FIELD_SEX_VALUE,A as FormItemLineBarDepKeyPrepend,L as InjectionAnnotation,e as InjectionAsyncQueue,o as InjectionBusinessCollector,n as InjectionChangeContextCollector,S as InjectionFormGraph,t as InjectionFormItemDepsCollector,I as InjectionFormUUID,E as InjectionSchemaField,i as LOW_CODE_VALUE_RELATION,c as NESTED_FORM_ITEM_TYPE};
1
+ const e=Symbol("InjectionAsyncQueue"),o=Symbol("InjectionSchemaField"),n=Symbol("InjectionBusinessCollector"),t=Symbol("InjectionChangeContextCollector"),E=Symbol("InjectionFormItemDepsCollector"),A=Symbol("InjectionFormUUID"),I=Symbol("InjectionFormGraph"),l=Symbol("InjectionAnnotation"),a="__dep_LINEBAR_";var i=(e=>(e.PASSWORD="password",e.ID_CARD="id_card",e.AGE="age",e.AGE_UNIT="age_unit",e.MOBILE="mobile",e.TELEPHONE="telephone",e.EMAIL="email",e.SEX="sex",e.BIRTHDAY="birthday",e.BANK_CARD="bank_card",e.WEBSITE="website",e.GESTATIONAL_WEEKS="gestational_weeks",e.GESTATIONAL_STAGE="gestational_stage",e.CUSTOMER_NAME="customer_name",e))(i||{}),c=(e=>(e.MALE="1",e.FEMALE="2",e))(c||{}),S=(e=>(e.DAY="D",e.MONTH="M",e.YEAR="Y",e.HOUR="H",e.WEEK="W",e.MINUTE="N",e))(S||{});const m=["COMPLEX","COMBINATION"];export{S as FIELD_AGE_UNIT,i as FIELD_BUSINESS_TYPE,c as FIELD_SEX_VALUE,a as FormItemLineBarDepKeyPrepend,l as InjectionAnnotation,e as InjectionAsyncQueue,n as InjectionBusinessCollector,t as InjectionChangeContextCollector,I as InjectionFormGraph,E as InjectionFormItemDepsCollector,A as InjectionFormUUID,o as InjectionSchemaField,m as NESTED_FORM_ITEM_TYPE};
@@ -1 +1 @@
1
- import{isField as e}from"@formily/core";import{isArray as r,isString as o,includes as i,isEmpty as n,negate as t,gt as c,gte as l,lt as d,lte as u}from"lodash-es";import{computed as a,unref as f}from"vue";import{Path as s}from"@formily/path";function b(b,m){const y={EQ:(e,r)=>`${e}`===r,NEQ:(e,r)=>`${e}`!==r,CL:(e,n)=>!(!r(e)&&!o(e))&&i(e,n),NC:(e,n)=>!r(e)&&!o(e)||!i(e,n),NULL:n,NOT_NULL:t(n),BIG:c,BIGEQ:l,LESS:d,LESSEQ:u},E={hideField:h((e=>e.setDisplay("none"))),showField:h((e=>e.setDisplay("visible"))),requiredField:h((e=>e.required=!0)),notRequiredField:h((e=>{e.required=!1,e.validate()})),enabledField:h((e=>e.editable=!0)),disabledField:h((e=>e.editable=!1))};function h(r){return o=>{o.forEach((o=>{const i=m.query(o).take();i&&e(i)&&r(i)}))}}const p=a((()=>f(b)?f(b).reduce(((e,o)=>(r(o.conObj)&&o.conObj.forEach((r=>e.push(r.field_key))),e)),[]):[]));function v(e,r,o){if(o.field_key!==e)return;return(y[o.con]||(()=>!1))(r,`${o.value}`)}function F(e){Object.entries(e).forEach((([e,r])=>E[e]&&E[e](r)))}return{lowCodeReactionsHandler:function(e,r){const o=f(b);o&&p.value.includes(e)&&o.forEach((o=>{var i,n;i=e,n=r,o.conObj.every((e=>v(i,n,e)))&&F(o)}))},triggerAllReactionsHandler:function(){const e=f(b);if(!e)return;const o=m.getFormState().values;e.forEach((e=>{(function(e,o){if(!r(o.conObj))return;return o.conObj.every((r=>v(r.field_key,s.getIn(e,r.field_key),r)))})(o,e)&&F(e)}))}}}export{b as useLowCodeReactions};
1
+ import{lowCodeCompare as e}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as i}from"@formily/path";import{isArray as o}from"lodash-es";import{computed as n,unref as t}from"vue";function l(l,c){const d={hideField:f((e=>e.setDisplay("none"))),showField:f((e=>e.setDisplay("visible"))),requiredField:f((e=>e.required=!0)),notRequiredField:f((e=>{e.required=!1,e.validate()})),enabledField:f((e=>e.editable=!0)),disabledField:f((e=>e.editable=!1))};function f(e){return i=>{i.forEach((i=>{const o=c.query(i).take();o&&r(o)&&e(o)}))}}const a=n((()=>t(l)?t(l).reduce(((e,r)=>(o(r.conObj)&&r.conObj.forEach((r=>e.push(r.field_key))),e)),[]):[]));function u(r,i,o){if(o.field_key===r)return e(i,o)}function s(e){Object.entries(e).forEach((([e,r])=>d[e]&&d[e](r)))}return{lowCodeReactionsHandler:function(e,r){const i=t(l);i&&a.value.includes(e)&&i.forEach((i=>{var o,n;o=e,n=r,i.conObj.every((e=>u(o,n,e)))&&s(i)}))},triggerAllReactionsHandler:function(){const e=t(l);if(!e)return;const r=c.getFormState().values;e.forEach((e=>{(function(e,r){if(!o(r.conObj))return;return r.conObj.every((r=>u(r.field_key,i.getIn(e,r.field_key),r)))})(r,e)&&s(e)}))}}}export{l as useLowCodeReactions};
@@ -1,8 +1,9 @@
1
1
  import { AnyObject, UndefinedAble } from '../../../../../es/shared/types';
2
+ import { LOW_CODE_VALUE_RELATION } from '../../../../../es/shared/utils';
2
3
  import { DataField, Field, Form } from '@formily/core';
3
4
  import { ISchema } from '@formily/json-schema/esm/types';
4
5
  import { Component, FunctionalComponent } from 'vue';
5
- import { FIELD_BUSINESS_TYPE, LOW_CODE_VALUE_RELATION } from '../../../../../es/components/form-render/src/constants';
6
+ import { FIELD_BUSINESS_TYPE } from '../../../../../es/components/form-render/src/constants';
6
7
  import { FieldItem } from '../types';
7
8
  import { AsyncQueue, RequestInstance } from '../hooks';
8
9
  export * from './fieldItem';
@@ -87,7 +88,7 @@ export declare type FormBusinessFormatter = (payload: {
87
88
  }) => unknown;
88
89
  export declare namespace FormLowCodeReactions {
89
90
  type ConObj = {
90
- con: LOW_CODE_VALUE_RELATION | string;
91
+ con: LOW_CODE_VALUE_RELATION & string;
91
92
  field_key: string;
92
93
  value: unknown;
93
94
  };
@@ -1 +1 @@
1
- import{createVNode as r}from"vue";import{isString as n}from"lodash-es";import"../../../../index.js";import{WIDGET_TYPE as e}from"../../../constants/index.js";import{IhoTableWarn as o}from"../../../utils/index.js";import{defineTablePlugin as t}from"../../../hooks/useTablePlugin.js";function i(){return t({name:"defaultRendererPlugin",vxe(t){t.renderer.add(e.DEFAULT,{renderCell(e,{row:t,column:i}){const c=t[i.field];return n(l=c)&&l.match(/^###\{[^{}]+}$/)?function(n){const e=function(r){try{return JSON.parse(r.replace(/^###/,""))}catch(n){return o(`invalid json-content ${r}`),{}}}(n);return[r("div",{style:{color:e.background||e.icon}},[function(n){if(!n)return null;if(n.match(/#[\da-f]{6}|[\da-f]{3}/i))return r("i",{class:"icon-dot",style:{"--table-icon-color":n,"--table-icon-shadow":n}},null);return r("i",{class:e.icon},null)}(e.icon),e.change_text])]}(c):[c];var l}}),t.renderer.add(e.STATUS,t.renderer.get(e.DEFAULT))}})}export{i as defaultRendererPlugin};
1
+ import{createVNode as n}from"vue";import{lowCodeCompare as r}from"../../../../../../shared/utils/index.js";import{isString as o,isObject as e,isArray as t}from"lodash-es";import"../../../../index.js";import{WIDGET_TYPE as i}from"../../../constants/index.js";import{IhoTableWarn as c}from"../../../utils/index.js";import{defineTablePlugin as l}from"../../../hooks/useTablePlugin.js";function d(){return l({name:"defaultRendererPlugin",vxe(l){l.renderer.add(i.DEFAULT,{renderCell(i,{row:l,column:d}){const u=l[d.field],s=function(n){return o(n)&&!!n.match(/^###\{[^{}]+}$/)}(u)?function(r){const o=t(r);return[n("div",{style:{color:o.background||o.icon}},[e(o.icon),o.change_text])];function e(r){return r?r.match(/#[\da-f]{6}|[\da-f]{3}/i)?n("i",{class:"icon-dot",style:{"--table-icon-color":r,"--table-icon-shadow":r}},null):n("i",{class:o.icon},null):null}function t(n){try{return JSON.parse(n.replace(/^###/,""))}catch(r){return c(`invalid json-content ${n}`),{}}}}(u):[u];return function(o,e,i,c){if(!t(o)||!o.length)return c;const l=o.find((n=>n.condition&&n.condition.find((n=>{const o=e[n.field_key||i.field];return r(o,n)}))));return l?n("div",{style:{color:l.color},class:l.icon},[c]):c}(function(n){var r,o,t;const i=null==(r=n.editRender)?void 0:r.props;if(!e(i))return;return null!=(t=i.colorAndIcon)?t:null==(o=i.settingObj)?void 0:o.colorAndIcon}(d),l,d,s)}}),l.renderer.add(i.STATUS,l.renderer.get(i.DEFAULT))}})}export{d as defaultRendererPlugin};
@@ -1,4 +1,5 @@
1
1
  import { AnyObject, ArrayAble, MaybeString, TupleToUnion } from '../../../../../es/shared/types';
2
+ import { LOW_CODE_VALUE_RELATION } from '../../../../../es/shared/utils';
2
3
  import { VxeTableProps, VxeTableDefines, VxeTableInstance, VxeColumnPropTypes, VxeTablePropTypes } from 'vxe-table';
3
4
  import { VxeTableListeners } from 'vxe-table/types/table';
4
5
  import { IHO_TABLE_STRING_STATUS, IhoTableEventNameTuple, IhoTableRowGroupSequence } from '../../../../../es/components/iho-table/src/constants';
@@ -41,9 +42,19 @@ export declare namespace IhoTableLowCodeField {
41
42
  }>;
42
43
  };
43
44
  };
45
+ type ColorAndIconItem = {
46
+ condition?: {
47
+ con: LOW_CODE_VALUE_RELATION & string;
48
+ value: unknown;
49
+ field_key?: string;
50
+ }[];
51
+ color?: string;
52
+ icon?: string;
53
+ };
44
54
  type SettingObj = Partial<{
45
55
  attr: string;
46
56
  isHide: MaybeString<0 | 1>;
57
+ colorAndIcon: ColorAndIconItem[];
47
58
  [K: string]: unknown;
48
59
  }>;
49
60
  }
@@ -79,6 +90,7 @@ export declare type LowCodeTableFieldItem = {
79
90
  * @deprecated
80
91
  */
81
92
  checkEditStatus: (payload: VxeTableDefines.CellRenderBodyParams) => boolean | void;
93
+ colorAndIcon: IhoTableLowCodeField.ColorAndIconItem[];
82
94
  }> & Partial<VxeTableDefines.ColumnInfo>;
83
95
  export declare type IhoTableFormChangePayload = {
84
96
  column: IhoTableFieldItem;
@@ -15,3 +15,19 @@ export declare function targetStringIncludes(arr: string[], target: string): boo
15
15
  export declare const jsonParse: import("@vueuse/core").UseMemoizedFn<any, [value: string]>;
16
16
  export declare function shallowOmit<T, K extends Array<keyof T>>(target: T, keys: K): Omit<T, K[number]>;
17
17
  export declare function checkInSetupEnv(message?: string): void;
18
+ export declare enum LOW_CODE_VALUE_RELATION {
19
+ EQ = "EQ",
20
+ NEQ = "NEQ",
21
+ CL = "CL",
22
+ NC = "NC",
23
+ NULL = "NULL",
24
+ NOT_NULL = "NOT_NULL",
25
+ BIG = "BIG",
26
+ BIGEQ = "BIGEQ",
27
+ LESS = "LESS",
28
+ LESSEQ = "LESSEQ"
29
+ }
30
+ export declare function lowCodeCompare(value: unknown, condition: {
31
+ con: LOW_CODE_VALUE_RELATION & string;
32
+ value: unknown;
33
+ }): boolean;
@@ -1 +1 @@
1
- import{useMemoize as t}from"@vueuse/core";import{isArray as e,isString as r,isNumber as n,isObject as o,isFunction as u}from"lodash-es";import{getCurrentInstance as c}from"vue";function i(t,r,n="children",o){function u(){throw"silence break traverse"}try{a(t).forEach((t=>{r(t,u,o),a(n).forEach((o=>{e(t[o])&&i(t[o],r,n,t)}))}))}catch(t){if("silence break traverse"===t)return;throw t}}function s(t,e,r=e.name,n){if(!r)throw new Error(`[CUI]: invalid component name for ${e}`);const{components:o={}}=t._context;o[r]||(n?n():t.component(r,e))}function f(t){if(!r(t))return;const e=t.match(/[Hms:]+/);return e?e[0]:void 0}function a(t){return Array.isArray(t)?t:[t]}function x(){if(window.isSecureContext&&window.crypto)return`key${window.crypto.randomUUID()}`;return`key${"xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}`}const l=t((function(t){return t?[...t].reduce(((t,e)=>/[a-z]/.test(e)?t+8:/[A-Z]/.test(e)?t+12:/\d/.test(e)?t+9:/\./.test(e)?t+4:/[\u4e00-\u9fa5]/.test(e)?t+15:/-/.test(e)?t+4:/[()]/.test(e)?t+14:/[)(]/.test(e)?t+5:/-/.test(e)?t+10:/%/.test(e)?t+14:/‰/.test(e)?t+16:t+6),0):0})),m=Object.seal(Object.create(null));function d(t,r){return function t(r,n){return o(r)?e(r)?r.map((e=>t(e,n))):Object.entries(r).reduce(((e,[r,c])=>(n.includes(r)||(o(c)&&!u(c)?e[r]=t(c,n):e[r]=c),e)),{}):r}(t,r)}function h(t){return Object.values(t).reduce(((t,e)=>Object.assign(t,e)),{})}function p(t,e){if(!t)return t;if(e(t))return t;let r=t.parentElement;for(;r&&!e(r);)r=r.parentElement;return r}function w(t,e="px"){if(n(t))return`${t}${e}`;if(r(t))return t.endsWith(e)?t:`${t}${e}`;throw new Error(`invalid width value ${t}, it need to be a string or number!`)}function y(t,e){return t.some((t=>e.includes(t)))}const v=t((t=>{try{return JSON.parse(t)}catch(t){return{}}}),{getKey:t=>t});function b(t,e){if(!o(t))return t;const r={...t};for(let t=0;t<e.length;t++)Reflect.deleteProperty(r,e[t]);return r}function $(t){if(!c())throw new Error(t||"can't use this hook out of setup environment")}export{m as DMZ,a as arrayed,$ as checkInSetupEnv,d as deepOmit,p as findAncestor,f as generateTimeFormat,l as getStringWidth,v as jsonParse,s as safeComponentRegister,h as separateMetaModule,b as shallowOmit,y as targetStringIncludes,i as traverse,x as uuidGenerator,w as widthAppend};
1
+ import{useMemoize as t}from"@vueuse/core";import{isArray as e,isString as n,includes as r,isEmpty as o,negate as u,gt as c,gte as i,lt as s,lte as f,isNumber as a,isObject as x,isFunction as E}from"lodash-es";import{getCurrentInstance as l}from"vue";function m(t,n,r="children",o){function u(){throw"silence break traverse"}try{h(t).forEach((t=>{n(t,u,o),h(r).forEach((o=>{e(t[o])&&m(t[o],n,r,t)}))}))}catch(t){if("silence break traverse"===t)return;throw t}}function L(t,e,n=e.name,r){if(!n)throw new Error(`[CUI]: invalid component name for ${e}`);const{components:o={}}=t._context;o[n]||(r?r():t.component(n,e))}function d(t){if(!n(t))return;const e=t.match(/[Hms:]+/);return e?e[0]:void 0}function h(t){return Array.isArray(t)?t:[t]}function p(){if(window.isSecureContext&&window.crypto)return`key${window.crypto.randomUUID()}`;return`key${"xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}`}const N=t((function(t){return t?[...t].reduce(((t,e)=>/[a-z]/.test(e)?t+8:/[A-Z]/.test(e)?t+12:/\d/.test(e)?t+9:/\./.test(e)?t+4:/[\u4e00-\u9fa5]/.test(e)?t+15:/-/.test(e)?t+4:/[()]/.test(e)?t+14:/[)(]/.test(e)?t+5:/-/.test(e)?t+10:/%/.test(e)?t+14:/‰/.test(e)?t+16:t+6),0):0})),w=Object.seal(Object.create(null));function S(t,n){return function t(n,r){return x(n)?e(n)?n.map((e=>t(e,r))):Object.entries(n).reduce(((e,[n,o])=>(r.includes(n)||(x(o)&&!E(o)?e[n]=t(o,r):e[n]=o),e)),{}):n}(t,n)}function v(t){return Object.values(t).reduce(((t,e)=>Object.assign(t,e)),{})}function y(t,e){if(!t)return t;if(e(t))return t;let n=t.parentElement;for(;n&&!e(n);)n=n.parentElement;return n}function Q(t,e="px"){if(a(t))return`${t}${e}`;if(n(t))return t.endsWith(e)?t:`${t}${e}`;throw new Error(`invalid width value ${t}, it need to be a string or number!`)}function $(t,e){return t.some((t=>e.includes(t)))}const b=t((t=>{try{return JSON.parse(t)}catch(t){return{}}}),{getKey:t=>t});function O(t,e){if(!x(t))return t;const n={...t};for(let t=0;t<e.length;t++)Reflect.deleteProperty(n,e[t]);return n}function U(t){if(!l())throw new Error(t||"can't use this hook out of setup environment")}var C=(t=>(t.EQ="EQ",t.NEQ="NEQ",t.CL="CL",t.NC="NC",t.NULL="NULL",t.NOT_NULL="NOT_NULL",t.BIG="BIG",t.BIGEQ="BIGEQ",t.LESS="LESS",t.LESSEQ="LESSEQ",t))(C||{});const I={EQ:(t,e)=>`${t}`===e,NEQ:(t,e)=>`${t}`!==e,CL:(t,o)=>!(!e(t)&&!n(t))&&r(t,o),NC:(t,o)=>!e(t)&&!n(t)||!r(t,o),NULL:o,NOT_NULL:u(o),BIG:c,BIGEQ:i,LESS:s,LESSEQ:f};function g(t,e){return(I[e.con]||(()=>!1))(t,`${e.value}`)}export{w as DMZ,C as LOW_CODE_VALUE_RELATION,h as arrayed,U as checkInSetupEnv,S as deepOmit,y as findAncestor,d as generateTimeFormat,N as getStringWidth,b as jsonParse,g as lowCodeCompare,L as safeComponentRegister,v as separateMetaModule,O as shallowOmit,$ as targetStringIncludes,m as traverse,p as uuidGenerator,Q as widthAppend};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.41-beta.22",
3
+ "version": "3.1.41-beta.23",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -61,5 +61,5 @@
61
61
  "iOS 7",
62
62
  "last 3 iOS versions"
63
63
  ],
64
- "gitHead": "a9737ed5a31d404fee907a639fb4966334477226"
64
+ "gitHead": "a8f7d7cdca3113620c2a7b0dbaf062673dfc51cc"
65
65
  }