cnhis-design-vue 3.1.51-beta.1 → 3.1.51-beta.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.
- package/es/components/callback/index.d.ts +69 -0
- package/es/components/callback/index.js +1 -0
- package/es/components/callback/src/components/dialog/drawer.vue.d.ts +353 -0
- package/es/components/callback/src/components/dialog/drawer.vue.js +1 -0
- package/es/components/callback/src/components/dialog/drawer.vue2.js +1 -0
- package/es/components/callback/src/components/dialog/modal.vue.d.ts +166 -0
- package/es/components/callback/src/components/dialog/modal.vue.js +1 -0
- package/es/components/callback/src/components/dialog/modal.vue2.js +1 -0
- package/es/components/callback/src/components/popup/index.vue.d.ts +48 -0
- package/es/components/callback/src/components/popup/index.vue.js +1 -0
- package/es/components/callback/src/components/render/drawerIframe/index.vue.d.ts +62 -0
- package/es/components/callback/src/components/render/drawerIframe/index.vue.js +1 -0
- package/es/components/callback/src/components/render/drawerIframe/index.vue2.js +1 -0
- package/es/components/callback/src/components/render/enums.d.ts +5 -0
- package/es/components/callback/src/components/render/enums.js +1 -0
- package/es/components/callback/src/components/render/index.vue.d.ts +57 -0
- package/es/components/callback/src/components/render/index.vue.js +1 -0
- package/es/components/callback/src/components/render/popupMaps.d.ts +5700 -0
- package/es/components/callback/src/components/render/popupMaps.js +1 -0
- package/es/components/callback/src/index.vue.d.ts +68 -0
- package/es/components/callback/src/index.vue.js +1 -0
- package/es/components/callback/src/index.vue2.js +1 -0
- package/es/components/callback/src/types/index.d.ts +11 -0
- package/es/components/callback/style/callback-iconfont.ttf +0 -0
- package/es/components/callback/style/index.css +1 -0
- package/es/components/expand-field/index.d.ts +0 -13
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +0 -13
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +0 -13
- package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/form.vue.d.ts +0 -13
- package/es/components/expand-field/src/index.vue.d.ts +0 -13
- package/es/components/expand-field/src/index.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/form-render/src/components/renderer/remoteSearch.d.ts +79 -2
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +16 -10
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +3 -3
- package/es/components/index.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +615 -255
- package/es/components/select-label/index.d.ts +617 -256
- package/es/components/select-label/index.js +1 -1
- package/es/components/{iho-select-label/src/LabelFormContent.vue.d.ts → select-label/src/ihoLabel/IhoLabelFormContent.vue.d.ts} +5 -5
- package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue.js +1 -0
- package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +1 -0
- package/es/components/{iho-select-label/src/SelectLabel.vue.d.ts → select-label/src/ihoLabel/IhoSelectLabel.vue.d.ts} +7 -7
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue.js +1 -0
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -0
- package/es/components/{iho-select-label/src/components/label-classify.vue.d.ts → select-label/src/ihoLabel/iho-label-classify.vue.d.ts} +1 -1
- package/es/components/select-label/src/ihoLabel/iho-label-classify.vue.js +1 -0
- package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +1 -0
- package/es/components/select-label/src/index.vue.d.ts +899 -0
- package/es/components/select-label/src/index.vue.js +1 -0
- package/es/components/select-label/src/index.vue2.js +1 -0
- package/es/components/select-label/src/types/index.js +1 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/index.d.ts +3 -3
- package/package.json +2 -2
- package/es/components/iho-select-label/index.d.ts +0 -363
- package/es/components/iho-select-label/index.js +0 -1
- package/es/components/iho-select-label/src/LabelFormContent.vue.js +0 -1
- package/es/components/iho-select-label/src/LabelFormContent.vue2.js +0 -1
- package/es/components/iho-select-label/src/SelectLabel.vue.js +0 -1
- package/es/components/iho-select-label/src/SelectLabel.vue2.js +0 -1
- package/es/components/iho-select-label/src/components/label-classify.vue.js +0 -1
- package/es/components/iho-select-label/src/components/label-classify.vue2.js +0 -1
- package/es/components/iho-select-label/style/iho-select-label-iconfont.ttf +0 -0
- package/es/components/iho-select-label/style/index.css +0 -1
- /package/es/components/{iho-select-label → callback}/src/types/index.js +0 -0
- /package/es/components/{iho-select-label → select-label}/src/types/index.d.ts +0 -0
|
@@ -2,6 +2,11 @@ import { AnyObject, Func } from '../../../../../es/shared/types';
|
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
3
|
import { FormWordbook, RecommendIds, UrlConfig } from '../../../../../es/components/form-render';
|
|
4
4
|
import { RecommendItem } from '../../../../../es/components/recommend-search/src/types';
|
|
5
|
+
declare type UseOptionHooks = Partial<Record<'onRequestConfigChange' | 'onDepsChange', (payload: {
|
|
6
|
+
fetchData: (content?: string | null, otherParams?: AnyObject) => any;
|
|
7
|
+
labelKey: string;
|
|
8
|
+
valueKey: string;
|
|
9
|
+
}) => any>>;
|
|
5
10
|
export declare const searchContentMatcher: (searchContent: string, label: string) => RegExpMatchArray | null;
|
|
6
11
|
export declare function useRecommendOptions(props: {
|
|
7
12
|
recommend: boolean;
|
|
@@ -16,15 +21,15 @@ export declare function useRecommendOptions(props: {
|
|
|
16
21
|
getRecommend: (content?: string) => Promise<void>;
|
|
17
22
|
sortedOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
18
23
|
};
|
|
19
|
-
export declare function useUrlConfigOptions(props: {
|
|
20
|
-
labelField
|
|
21
|
-
valueField
|
|
22
|
-
showField
|
|
23
|
-
urlConfig
|
|
24
|
-
options
|
|
24
|
+
export declare function useUrlConfigOptions(props: Partial<{
|
|
25
|
+
labelField: string;
|
|
26
|
+
valueField: string;
|
|
27
|
+
showField: string;
|
|
28
|
+
urlConfig: UrlConfig;
|
|
29
|
+
options: AnyObject[];
|
|
25
30
|
requestCache: boolean;
|
|
26
31
|
lazyRequest: boolean;
|
|
27
|
-
}
|
|
32
|
+
}>, valueRef: Ref, hooks?: UseOptionHooks): {
|
|
28
33
|
labelKey: import("vue").ComputedRef<string>;
|
|
29
34
|
loading: Ref<boolean>;
|
|
30
35
|
showKey: import("vue").ComputedRef<string | undefined>;
|
|
@@ -32,7 +37,7 @@ export declare function useUrlConfigOptions(props: {
|
|
|
32
37
|
remoteOptions: Ref<AnyObject[] | null>;
|
|
33
38
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
34
39
|
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
35
|
-
fetchData: (content?: string) => Promise<null | undefined>;
|
|
40
|
+
fetchData: (content?: string | null, otherParams?: AnyObject) => Promise<null | undefined>;
|
|
36
41
|
searchContent: Ref<string | undefined>;
|
|
37
42
|
};
|
|
38
43
|
export declare function useAutographOptions(props: Partial<{
|
|
@@ -44,7 +49,7 @@ export declare function useAutographOptions(props: Partial<{
|
|
|
44
49
|
autograph: string;
|
|
45
50
|
lazyRequest: boolean;
|
|
46
51
|
options: AnyObject[];
|
|
47
|
-
}>, valueRef: Ref): {
|
|
52
|
+
}>, valueRef: Ref, hooks?: UseOptionHooks): {
|
|
48
53
|
labelKey: import("vue").ComputedRef<string>;
|
|
49
54
|
showKey: import("vue").ComputedRef<string | undefined>;
|
|
50
55
|
loading: Ref<boolean>;
|
|
@@ -52,6 +57,7 @@ export declare function useAutographOptions(props: Partial<{
|
|
|
52
57
|
valueKey: import("vue").ComputedRef<string>;
|
|
53
58
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
54
59
|
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
55
|
-
fetchData: (content?: string) => Promise<null | undefined>;
|
|
60
|
+
fetchData: (content?: string | null, otherParams?: AnyObject) => Promise<null | undefined>;
|
|
56
61
|
searchContent: Ref<string | undefined>;
|
|
57
62
|
};
|
|
63
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{checkInSetupEnv as e,arrayed as l,jsonParse as n,keywordMatcher as u}from"../../../../shared/utils/index.js";import{useForm as t}from"@formily/vue";import{useMemoize as a}from"@vueuse/core";import{identity as o,uniqBy as r,isEqual as i,isString as v,omit as
|
|
1
|
+
import{checkInSetupEnv as e,arrayed as l,jsonParse as n,keywordMatcher as u}from"../../../../shared/utils/index.js";import{useForm as t}from"@formily/vue";import{useMemoize as a}from"@vueuse/core";import{identity as o,uniqBy as r,isEqual as i,isString as v,omit as s,isArray as c,isFunction as m}from"lodash-es";import{computed as f,inject as d,ref as y,watch as p,toRaw as h}from"vue";import"../../index.js";import{InjectionAsyncQueue as g,InjectionFormLifeCycleCaller as w,InjectionFormItemDepsCollector as K}from"../constants/index.js";import{createUrlConfigParams as C,formRenderLog as b}from"../utils/index.js";import{useFormField as k}from"./useFormField.js";import{useFormRequest as R}from"./useFormRequest.js";function F(e,l){const n=y();return f({get:()=>n.value?n.value:e[l],set(e){n.value=e}})}const q=(()=>{const e=a((e=>new RegExp(`(.*)${e.split("").map((e=>`(${function(e){return e.match(/[()\[\]{}$^\/]/)?"\\"+e:e}(e)})`)).join("(.*)")}(.*)`)),{getKey:o});return(l,n)=>n.match(e(l))})();function O(){const e=y();return{searchContent:e,optionSearchFilter:function(l,n,t){if(!e.value)return l;const a=c(t)?t.filter((e=>e&&v(e))):[];return l.filter((l=>function(l,n,t){if(!e.value)return!0;const a=l?l[n]:"";return!!v(a)&&(!!q(e.value,a)||!!u(e.value,l.keyword)||!!t.length&&t.some((n=>v(l[n])&&l[n].includes(e.value))))}(l,n,a)))}}}function j(e,l,u,t,a){const o=F(e,"commonList"),i=F(e,"recentList"),{searchContent:v,optionSearchFilter:c}=O();function y(e){return n(e.itemObj)}const p=f((()=>{var e,l;return null!=(l=null==(e=o.value)?void 0:e.map(y))?l:[]})),h=f((()=>{var e,l;return null!=(l=null==(e=i.value)?void 0:e.map(y))?l:[]})),w=f((()=>{if(!e.recommend||!p.value.length&&!h.value.length)return l.value;const n=r(p.value.concat(h.value),(e=>e[a.value])),u=l.value.filter((e=>n.every((function(l){return l[a.value]!==e[a.value]}))));return[...c(n,t.value),...u]})),{getRecommendRequestInfo:K,getHttpInstance:C}=R();function b(l){const{url:n,getRecommendIds:u}=K(),t=m(u)?u():{},a=m(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:n[l],info:Object.assign({},t,a)}}const{fieldKey:q,field:j}=k(),I=d(g);return{postRecommend:async function(l){if(!e.recommend)return;const n=C();if(!n)return;const{url:t,info:o}=b("post"),r=w.value.find((e=>e[a.value]===l));r&&u("postRecommend",await n.post(t,{...o,keyword:"",itemId:a.value,itemObj:JSON.stringify(r)}))},getRecommend:async function(l){if(!e.recommend)return;if(v.value=l,o.value&&i.value&&e.recommendCache)return;const n=await I.addAsync(function(l,n){const{url:u,info:o}=b("get");return{url:u,method:"get",key:l,cache:n,params:{...o,recNum:Math.max(e.commonNum,e.recentNum),keyword:""},payload:{field:j.value,labelKey:t.value,valueKey:a.value}}}(q.value,e.recommendCache)),{commonly:u,recently:r}=n.reduce(((e,l)=>("commonly"===l.type?e.commonly.push(s(l,["type"])):"recently"===l.type&&e.recently.push(s(l,["type"])),e)),{commonly:[],recently:[]});o.value=u.slice(0,e.commonNum),i.value=r.slice(0,e.recentNum)},sortedOptions:w}}function I(l,n,u){e();const t=d(g),a=d(w),o=f((()=>{var e,n,u;return null!=(u=null!=(n=null==(e=l.urlConfig)?void 0:e.nameKey)?n:l.labelField)?u:"text"})),r=f((()=>{var e,n,u;return null!=(u=null!=(n=null==(e=l.urlConfig)?void 0:e.valueKey)?n:l.valueField)?u:"value"})),s=f((()=>{var e,n;return null!=(n=null==(e=l.urlConfig)?void 0:e.showKey)?n:l.showField})),{searchContent:c,optionSearchFilter:m}=O(),R=y(null),{field:F,fieldKey:q}=k(),j=y(!1),I=async function(e,n){if(c.value=e||"",!l.urlConfig)return R.value=null;try{j.value=!0;const e={field:F.value,labelKey:o.value,valueKey:r.value},u=await t.addAsync(await C({config:{...l.urlConfig,payload:e,params:{...l.urlConfig.params,...n}},cache:l.requestCache,field:F.value}));h(R.value)!==u&&(R.value=u,a("afterOptionInit",[q.value,R.value,e]))}catch(e){v(e)&&b(e)}finally{j.value=!1}},x=f((()=>R.value?m(R.value,o.value):Array.isArray(l.options)?m(l.options,o.value):[])),D=f((()=>R.value||l.options||[])),A=d(K);return p((()=>l.urlConfig),((e,t)=>{if(i(e,t))return;if(R.value=null,!e)return R.value=null;const a={fetchData:I,labelKey:o.value,valueKey:r.value},{onRequestConfigChange:v,onDepsChange:s}=u||{};A.setDeps(q.value,e.dependKey||[],(async()=>{R.value=null,n.value=null,l.lazyRequest||(s?s(a):I())})),!n.value&&l.lazyRequest||(v?v(a):I())}),{immediate:!0}),{labelKey:o,loading:j,showKey:s,valueKey:r,remoteOptions:R,filterOptions:x,fullOptions:D,fetchData:I,searchContent:c}}function x(n,u,a){e();const o=d(g),r=d(w),s=t(),c=f((()=>{var e;const u=l(null==(e=n.wordbook)?void 0:e.show_key)[0];return v(u)?u:null})),m=f((()=>{var e,l,u,t;const a=null==(l=null==(e=n.wordbook)?void 0:e.render_key)?void 0:l[0];return v(a)?a:null!=(t=null!=(u=c.value)?u:n.labelField)?t:"text"})),C=f((()=>{var e,l,u;return null!=(u=null!=(l=null==(e=n.wordbook)?void 0:e.value_key)?l:n.valueField)?u:"value"})),F=f((()=>{var e;return(null==(e=n.wordbook)?void 0:e.search_key)||[]})),q=f((()=>{var e;return null!=(e=c.value)?e:n.showField})),{searchContent:j,optionSearchFilter:I}=O(),x=y(null),{fieldKey:D,field:A}=k(),{getSearchRequestInfo:S}=R(),N=y(!1),_=async function(e,l){if(j.value=e||"",!n.autograph||!n.wordbook)return x.value=null;try{N.value=!0;const e={field:A.value,labelKey:m.value,valueKey:C.value},u=await o.addAsync(function(e,l,u,t,a){var o,r,i;const v={autograph:l,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1,...a};if(null==(o=e.queryParams)?void 0:o.length){const l=null!=(i=null==(r=s.value)?void 0:r.getFormState().values)?i:{};e.queryParams.forEach((e=>{v[e]=l[e]}))}return{...S(),params:v,key:u,cache:n.requestCache,payload:t}}(n.wordbook,n.autograph,D.value,e,l));h(x.value)!==u&&(x.value=u,r("afterOptionInit",[D.value,x.value,e]))}catch(e){v(e)&&b(e)}finally{N.value=!1}},z=f((()=>x.value?I(x.value,m.value,F.value):Array.isArray(n.options)?I(n.options,m.value):[])),P=f((()=>x.value||n.options||[])),$=d(K);return p((()=>n.wordbook),((e,l)=>{if(i(e,l))return;if(x.value=null,!e)return x.value=null;const t={fetchData:_,labelKey:m.value,valueKey:C.value},{onRequestConfigChange:o,onDepsChange:r}=a||{};$.setDeps(D.value,e.queryParams||[],(async()=>{x.value=null,r?r(t):_()})),!u.value&&n.lazyRequest||(o?o(t):_())}),{immediate:!0}),{labelKey:m,showKey:q,loading:N,remoteOptions:x,valueKey:C,filterOptions:z,fullOptions:P,fetchData:_,searchContent:j}}export{q as searchContentMatcher,x as useAutographOptions,j as useRecommendOptions,I as useUrlConfigOptions};
|