cnhis-design-vue 3.2.10-beta.4 → 3.2.10-beta.7
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/audio-sdk/src/audioSDK.d.ts +22 -24
- package/es/components/audio-sdk/src/audioSDK.js +1 -1
- package/es/components/audio-sdk/src/components/{recordingDialog.vue.d.ts → recording.vue.d.ts} +8 -18
- package/es/components/audio-sdk/src/components/recording.vue.js +1 -0
- package/es/components/audio-sdk/src/components/recording.vue2.js +1 -0
- package/es/components/audio-sdk/src/utils/recordingModal.d.ts +10 -0
- package/es/components/audio-sdk/src/utils/recordingModal.js +1 -0
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +4 -4
- package/es/components/field-set/src/FieldFilter.vue.d.ts +4 -4
- package/es/components/field-set/src/FieldSet.vue.d.ts +5 -5
- package/es/components/field-set/src/components/table-row.vue.d.ts +4 -4
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/scale-view/src/components/formitem/r-upload.d.ts +4 -4
- package/es/components/scale-view/src/components/formitem/r-upload.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +10 -8
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +4 -4
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +4 -4
- package/es/components/vod-chunk-upload/index.d.ts +2 -0
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue.d.ts +18 -4
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/hooks/upload-data.d.ts +5 -1
- package/es/components/vod-chunk-upload/src/hooks/upload-data.js +1 -1
- package/es/components/vod-chunk-upload/src/hooks/vod-computed.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +2 -0
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/audio-sdk/src/components/recordingDialog.vue.js +0 -1
- package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +0 -1
- package/es/components/audio-sdk/src/utils/recordingDialog.d.ts +0 -11
- package/es/components/audio-sdk/src/utils/recordingDialog.js +0 -1
@@ -1,42 +1,40 @@
|
|
1
1
|
import { ComponentInternalInstance } from 'vue';
|
2
2
|
import 'recorder-core/src/engine/mp3';
|
3
3
|
import 'recorder-core/src/engine/mp3-engine';
|
4
|
-
import { AnyObject } from '../../../shared/types';
|
5
4
|
export default class AudioSDK {
|
5
|
+
static instance: AudioSDK | null;
|
6
|
+
static sendInterval: number;
|
7
|
+
private recordingModal;
|
8
|
+
private webSocket;
|
9
|
+
private messageHandlerQueue;
|
6
10
|
private recorder;
|
7
|
-
private recordingDialog;
|
8
11
|
private contentRef;
|
9
|
-
private realTimeRecognition;
|
10
|
-
private allowPunctuationMark;
|
11
|
-
private timed;
|
12
|
-
private timer;
|
13
12
|
private realTimeSendStartTime;
|
14
13
|
private realTimeSendBytesChunks;
|
15
14
|
private realTimeSendClearPrevBufferIdx;
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
private timer;
|
16
|
+
private option;
|
17
|
+
private hasEventListener;
|
18
|
+
isReady: boolean;
|
19
19
|
constructor();
|
20
|
-
static create(
|
20
|
+
static create(): AudioSDK;
|
21
21
|
private initRecorder;
|
22
|
-
private takeoffEncodeChunk;
|
23
22
|
private onProcess;
|
24
|
-
private
|
25
|
-
|
26
|
-
|
23
|
+
private takeoffEncodeChunk;
|
24
|
+
run(instance: ComponentInternalInstance, handle: {
|
25
|
+
resolve: Function;
|
26
|
+
reject: Function;
|
27
|
+
}): void;
|
28
|
+
start(instance: ComponentInternalInstance, option?: {
|
27
29
|
realTimeRecognition?: boolean;
|
28
30
|
allowPunctuationMark?: boolean;
|
29
31
|
timed?: number;
|
30
|
-
}): Promise<
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
private
|
32
|
+
}): Promise<unknown>;
|
33
|
+
stop(): void;
|
34
|
+
private handleError;
|
35
|
+
private handleMessage;
|
36
|
+
private handleKeydown;
|
35
37
|
private reset;
|
36
38
|
destroy(): void;
|
37
|
-
static
|
38
|
-
static audioRevise(params: {
|
39
|
-
file_id: string;
|
40
|
-
audio_txt: string;
|
41
|
-
}): Promise<import("axios").AxiosResponse<any, any>>;
|
39
|
+
static destroy(): void;
|
42
40
|
}
|
@@ -1 +1 @@
|
|
1
|
-
import{ref as e}from"vue";import t from"
|
1
|
+
import{ref as e}from"vue";import t from"recorder-core";import"recorder-core/src/engine/mp3";import"recorder-core/src/engine/mp3-engine";import{RecordingModal as s}from"./utils/recordingModal.js";const i=class{constructor(){if(this.recordingModal=new s,this.webSocket=null,this.messageHandlerQueue=[],this.recorder=null,this.contentRef=e(""),this.realTimeSendStartTime=0,this.realTimeSendBytesChunks=[],this.realTimeSendClearPrevBufferIdx=0,this.timer=null,this.option={},this.hasEventListener=!1,this.isReady=!1,i.instance)return i.instance;i.instance=this}static create(){return new i}initRecorder(){this.recorder=t({type:"mp3",sampleRate:16e3,bitRate:16,...this.option.realTimeRecognition?{onProcess:this.onProcess.bind(this),takeoffEncodeChunk:this.takeoffEncodeChunk.bind(this)}:{}})}async onProcess(e,t,s,i,r){0===this.realTimeSendStartTime&&(this.realTimeSendStartTime=Date.now(),this.realTimeSendBytesChunks=[],this.realTimeSendClearPrevBufferIdx=0);for(let t=this.realTimeSendClearPrevBufferIdx;t<r;t++)e[t]=null;this.realTimeSendClearPrevBufferIdx=r}async takeoffEncodeChunk(e){var t;e&&this.realTimeSendBytesChunks.push(e);const s=Date.now();if(s-this.realTimeSendStartTime<i.sendInterval)return;this.realTimeSendStartTime=s;let r=0;for(let e=0;e<this.realTimeSendBytesChunks.length;e++)r+=this.realTimeSendBytesChunks[e].length;const n=new Uint8Array(r);for(let e=0,t=0;e<this.realTimeSendBytesChunks.length;e++){const s=this.realTimeSendBytesChunks[e];n.set(s,t),t+=s.length}if(this.realTimeSendBytesChunks=[],n.length>0){const e=new Blob([n],{type:"audio/wav"});null==(t=this.webSocket)||t.send(e)}}run(e,t){this.recorder||this.initRecorder(),this.messageHandlerQueue.push(t),this.option.timed&&(this.timer=setTimeout((()=>{this.stop()}),1e3*this.option.timed)),this.recorder.open((()=>{this.recorder.start(),this.recordingModal.show(e,{contentRef:this.contentRef,onClose:()=>this.stop()})}),((e,t)=>{this.handleError({msg:e,isUserNotAllow:t})}))}start(e,t={}){return Object.assign(this.option,t),new Promise(((t,s)=>{if(this.messageHandlerQueue.length>0)return void s({result:"fail",msg:"当前已存在正在录音的任务"});if(this.hasEventListener||(document.addEventListener("keydown",this.handleKeydown),this.hasEventListener=!0),!this.webSocket)return this.webSocket=new WebSocket("wss://emr-tl.cnhis.com/audio/socket"),this.webSocket.onopen=()=>{this.isReady=!0,this.run(e,{resolve:t,reject:s})},this.webSocket.onmessage=this.handleMessage.bind(this),this.webSocket.onerror=()=>console.log("WebSocket连接失败"),void(this.webSocket.binaryType="blob");const i=this;!async function r(n=0){if(n>5)return s({result:"fail",msg:"WebSocket连接失败"});i.isReady?i.run(e,{resolve:t,reject:s}):setTimeout((()=>{r(++n)}),100)}()}))}stop(){if(this.recordingModal.hide(),this.option.realTimeRecognition){const e=this.messageHandlerQueue.shift();if(!e)return;const{resolve:t,reject:s}=e;t({result:"success",data:{text:this.contentRef.value}}),this.reset()}else this.recorder.stop((async(e,t)=>{var s;null==(s=this.webSocket)||s.send(e)}),(e=>{this.handleError({msg:e})}),!0)}handleError(e){const t=this.messageHandlerQueue.shift();if(!t)return;const{resolve:s,reject:i}=t;i({result:"fail",...e}),this.reset()}handleMessage(e){const{data:t}=e||{};if(!function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(t))return void this.handleError({msg:"接收数据不是一个有效SJON"});const s=JSON.parse(t);if("success"===s.msg)if(this.option.realTimeRecognition)this.contentRef.value+=s.data.text.replace(/[??,。,.\s]/g,"");else{const e=this.messageHandlerQueue.shift();if(!e)return;const{resolve:t,reject:i}=e;t({result:"success",data:s.data.text.replace(/[??,。,.\s]/g,"")}),this.reset()}else this.handleError({msg:s.msg})}handleKeydown(e){var t,s,r,n;if(" "===e.key||"Space"===e.code){if(!(null==(s=null==(t=i.instance)?void 0:t.recordingModal)?void 0:s.rendered)||0===(null==(r=i.instance)?void 0:r.messageHandlerQueue.length))return;e.preventDefault(),null==(n=i.instance)||n.stop()}}reset(){var e;null==(e=this.recorder)||e.close(),this.realTimeSendStartTime=0,this.contentRef.value="",this.timer&&(clearTimeout(this.timer),this.timer=null),this.option={realTimeRecognition:!1,allowPunctuationMark:!0,timed:5},this.messageHandlerQueue=[]}destroy(){this.webSocket&&(this.webSocket.close(),this.webSocket=null,this.isReady=!1),document.removeEventListener("keydown",this.handleKeydown),this.hasEventListener=!1,this.reset(),this.recorder=null}static destroy(){i.instance&&(i.instance.destroy(),i.instance=null)}};let r=i;r.sendInterval=1500;export{r as default};
|
package/es/components/audio-sdk/src/components/{recordingDialog.vue.d.ts → recording.vue.d.ts}
RENAMED
@@ -1,8 +1,4 @@
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
2
|
-
visible: {
|
3
|
-
type: BooleanConstructor;
|
4
|
-
default: boolean;
|
5
|
-
};
|
6
2
|
content: {
|
7
3
|
type: StringConstructor;
|
8
4
|
default: string;
|
@@ -10,32 +6,26 @@ declare const _default: import("vue").DefineComponent<{
|
|
10
6
|
}, {
|
11
7
|
cssVars: import("vue").ComputedRef<import("../../../../shared/types").AnyObject>;
|
12
8
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
13
|
-
visible: {
|
14
|
-
type: BooleanConstructor;
|
15
|
-
default: boolean;
|
16
|
-
};
|
17
9
|
content: {
|
18
10
|
type: StringConstructor;
|
19
11
|
default: string;
|
20
12
|
};
|
21
|
-
}>> & {
|
22
|
-
|
23
|
-
|
13
|
+
}>> & {
|
14
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
15
|
+
}>>;
|
16
|
+
emit: (event: "close", ...args: any[]) => void;
|
24
17
|
close: () => void;
|
25
18
|
NModal: any;
|
26
19
|
NIcon: any;
|
27
20
|
Mic: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
28
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
29
|
-
visible: {
|
30
|
-
type: BooleanConstructor;
|
31
|
-
default: boolean;
|
32
|
-
};
|
21
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
33
22
|
content: {
|
34
23
|
type: StringConstructor;
|
35
24
|
default: string;
|
36
25
|
};
|
37
|
-
}
|
38
|
-
|
26
|
+
}>> & {
|
27
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
28
|
+
}, {
|
39
29
|
content: string;
|
40
30
|
}>;
|
41
31
|
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import r from"./recording.vue2.js";import e from"../../../../_virtual/_plugin-vue_export-helper.js";var o=e(r,[["__file","recording.vue"]]);export{o as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as o,openBlock as e,createBlock as s,unref as t,normalizeStyle as r,withCtx as i,createElementVNode as n,toDisplayString as c,createVNode as a}from"vue";import{NModal as p,NIcon as l}from"naive-ui";import{Mic as m}from"@vicons/ionicons5";import{useTheme as u}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";const d={class:"c-recording-wrapper"},f={class:"content"},h=n("div",{class:"animation"},null,-1),v=n("p",{class:"tip"},"按下空格键停止录音",-1);var k=o({__name:"recording",props:{content:{type:String,default:""}},emits:["close"],setup(o,{emit:k}){const g=u();function j(){k("close")}return(u,k)=>(e(),s(t(p),{style:r(t(g))},{default:i((()=>[n("div",d,[n("p",f,c(o.content||"正在聆听..."),1),h,n("div",{class:"icon-box",onClick:j},[a(t(l),{size:"60",color:"#fff",component:t(m)},null,8,["component"])]),v])])),_:1},8,["style"]))}});export{k as default};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { ComponentInternalInstance, Ref } from 'vue';
|
2
|
+
export declare class RecordingModal {
|
3
|
+
rendered: boolean;
|
4
|
+
target: HTMLElement | null;
|
5
|
+
show(instance: ComponentInternalInstance, { contentRef, onClose }: {
|
6
|
+
contentRef: Ref<string>;
|
7
|
+
onClose: () => void;
|
8
|
+
}): void;
|
9
|
+
hide(): void;
|
10
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
import{ref as e,render as t,createVNode as n,withCtx as r,nextTick as o}from"vue";import{createProviderWrapper as s}from"../../../../shared/utils/index.js";import l from"../components/recording.vue.js";class i{constructor(){this.rendered=!1,this.target=null}show(i,{contentRef:d,onClose:a}){if(this.rendered)return;this.rendered=!0;const u=document.createElement("div"),h=e(!1),c=s(i);t(n(c,null,{default:r((()=>n(l,{to:u,content:d.value,show:h.value,"onUpdate:show":e=>h.value=e,onClose:()=>p(),onAfterLeave:()=>p()},null)),i)}),u);const m=this;var v;function p(){a()}v=u,document.body.appendChild(v),m.target=v,o((()=>h.value=!0))}hide(){var e;(null==(e=this.target)?void 0:e.parentElement)&&(this.rendered=!1,this.target.parentElement.removeChild(this.target),this.target=null)}}export{i as RecordingModal};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as a,computed as l,onBeforeUnmount as n,watch as o,openBlock as r,createBlock as u,unref as
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as a,computed as l,onBeforeUnmount as n,watch as o,openBlock as r,createBlock as u,unref as d,isRef as s,createSlots as i,renderList as p,withCtx as c,renderSlot as y,nextTick as f}from"vue";import{NDatePicker as m}from"naive-ui";import"../../../shared/utils/index.js";import{useDateTime as v,handleInputEvent as h}from"../../../shared/hooks/useDateTime.js";import{isArray as g,isEqual as w,isString as D,isNumber as k}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{format as V,sub as S,startOfDay as _,endOfDay as A}from"date-fns";var I=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:[String,Array]},placeholder:{type:String},allowedInvalidValue:{type:String},to:{type:[Object,String,Boolean],default:"body"},holidays:{type:Array,default:()=>[]},type:{type:String,default:"date"}},emits:["update:formatted-value"],setup(e,{expose:I,emit:M}){const R=e,C=t(),$=a(null),b=a(null),j=a();let P="";const U=l({get:()=>z(R.formattedValue)?null:R.formattedValue,set(e){g(e)&&g(P)&&w(P,e)||P===e||(M("update:formatted-value",e,D(e)?Date.parse(e):g(e)?[Date.parse(e[0]),Date.parse(e[1])]:null),P=e)}}),q=l((()=>R.type.includes("datetime"))),x=l((()=>Reflect.get(C,"format")?C.format:q.value?"yyyy-MM-dd HH:mm:ss":"month"===R.type?"yyyy-MM":"year"===R.type?"yyyy":"yyyy-MM-dd")),E=l((()=>q.value?x.value.split(" "):"")),{focus:F,blur:H,handleConfirm:L}=v($,{formatRef:x,attrs:{...C,type:R.type},emit:M,allowedInvalidValue:R.allowedInvalidValue});async function B(e){!async function(e){var t;if(!e||!R.holidays.length)return;await f();const a=null==(t=$.value)?void 0:t.panelInstRef;if(!a)return;const l=a.$el;if(!l)return;O(),"daterange"===R.type?Y.push(n((()=>a.startDateArray),".n-date-panel-calendar--start .n-date-panel-dates>div"),n((()=>a.endDateArray),".n-date-panel-calendar--end .n-date-panel-dates>div")):"date"===R.type&&Y.push(n((()=>a.dateArray),".n-date-panel-calendar .n-date-panel-dates>div"));function n(e,t){const a=[],n=o(e,(e=>{a.forEach((e=>e.classList.remove("c-date-picker__holiday"))),a.length=0,g(e)&&Array.from(l.querySelectorAll(t)).forEach(((t,l)=>{const{ts:n}=e[l]||{};if(!k(n))return;const o=new Date(n);R.holidays.some((e=>e.getDate()===o.getDate()&&e.getMonth()===o.getMonth()&&e.getFullYear()===o.getFullYear()))&&(f((()=>t.classList.add("c-date-picker__holiday"))),a.push(t))}))}),{immediate:!0,deep:!0});return()=>{n(),a.length=0}}}(e),e&&q.value&&(await f(),async function e(t=0){var a;t>2||(b.value=null==(a=$.value)?void 0:a.panelInstRef,b.value?v(b,{formatRef:E,attrs:{...C,type:R.type},isPanel:!0}):(await f(),e(++t)))}())}const Y=[];function O(){Y.forEach((e=>e())),Y.length=0}async function T(...e){var t,a,l,n,o,r;const u=null==(n=null==(l=null==(a=null==(t=$.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(R.type.includes("range")?null==(o=R.onConfirm)||o.call(R,...e):(await f(),u.focus(),L(u),u.blur(),null==(r=R.onConfirm)||r.call(R,Date.parse(u.value),u.value)),!(null==u?void 0:u.value)||!R.updateUnchangedValue||R.type.includes("range"))return;const d=u.value;h(u,V(new Date,x.value)),h(u,d)}function z(e){return R.allowedInvalidValue&&R.allowedInvalidValue===e}return n(O),o((()=>R.formattedValue),(e=>{j.value=z(e)?e:R.placeholder?R.placeholder:"选择日期时间",z(e)||(P=e)}),{immediate:!0}),I({$datePicker:$,focus:F,blur:H,setShortcutValue:async function(e){if(!R.type||!R.type.includes("range")||!$.value)return;const t=$.value.$el.querySelectorAll(".n-input__input-el");let a,l;const n=new Date;if("week"===e){const e=S(n,{weeks:1});a=V(_(e),x.value)}else{const e=S(n,{months:1});a=V(_(e),x.value)}l=V(A(n),x.value),h(t[0],a),await f(),h(t[1],l)}}),(t,a)=>(r(),u(d(m),{ref_key:"datePickerRef",ref:$,"onUpdate:show":B,onConfirm:T,placeholder:j.value,to:e.to,type:e.type,"formatted-value":d(U),"onUpdate:formatted-value":a[0]||(a[0]=e=>s(U)?U.value=e:null)},i({_:2},[p(t.$slots,((e,a)=>({name:a,fn:c((()=>[y(t.$slots,a)]))})))]),1032,["placeholder","to","type","formatted-value"]))}});export{I as default};
|
@@ -527,12 +527,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
527
527
|
}>;
|
528
528
|
developMode: boolean;
|
529
529
|
draggable: boolean;
|
530
|
-
isHighlightRow: boolean;
|
531
|
-
idx: number;
|
532
|
-
isHighlight: boolean;
|
533
|
-
isFieldSet: boolean;
|
534
530
|
fieldDescribeMode: "column" | "tooltip";
|
531
|
+
isFieldSet: boolean;
|
535
532
|
hideExpressionOption: AnyObject[];
|
533
|
+
idx: number;
|
534
|
+
isHighlight: boolean;
|
535
|
+
isHighlightRow: boolean;
|
536
536
|
}>;
|
537
537
|
EditDialog: import("vue").DefineComponent<{
|
538
538
|
visible: {
|
@@ -549,12 +549,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
549
549
|
}>;
|
550
550
|
developMode: boolean;
|
551
551
|
draggable: boolean;
|
552
|
-
isHighlightRow: boolean;
|
553
|
-
idx: number;
|
554
|
-
isHighlight: boolean;
|
555
|
-
isFieldSet: boolean;
|
556
552
|
fieldDescribeMode: "column" | "tooltip";
|
553
|
+
isFieldSet: boolean;
|
557
554
|
hideExpressionOption: AnyObject[];
|
555
|
+
idx: number;
|
556
|
+
isHighlight: boolean;
|
557
|
+
isHighlightRow: boolean;
|
558
558
|
}>;
|
559
559
|
setStyle: typeof setStyle;
|
560
560
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "save" | "reset")[], "close" | "save" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -717,12 +717,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
717
717
|
}>;
|
718
718
|
developMode: boolean;
|
719
719
|
draggable: boolean;
|
720
|
-
isHighlightRow: boolean;
|
721
|
-
idx: number;
|
722
|
-
isHighlight: boolean;
|
723
|
-
isFieldSet: boolean;
|
724
720
|
fieldDescribeMode: "column" | "tooltip";
|
721
|
+
isFieldSet: boolean;
|
725
722
|
hideExpressionOption: AnyObject[];
|
723
|
+
idx: number;
|
724
|
+
isHighlight: boolean;
|
725
|
+
isHighlightRow: boolean;
|
726
726
|
}>;
|
727
727
|
isArray: {
|
728
728
|
(value?: any): value is any[];
|
@@ -852,9 +852,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
852
852
|
showSeq: boolean;
|
853
853
|
developMode: boolean;
|
854
854
|
footerFlag: boolean;
|
855
|
-
fieldDescribeMode: "column" | "tooltip";
|
856
855
|
customColumns: FieldSetColumnItem[];
|
857
856
|
showSortPriority: boolean;
|
858
857
|
showHeadFilter: boolean;
|
858
|
+
fieldDescribeMode: "column" | "tooltip";
|
859
859
|
}>;
|
860
860
|
export default _default;
|
@@ -380,11 +380,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
380
380
|
}>;
|
381
381
|
developMode: boolean;
|
382
382
|
draggable: boolean;
|
383
|
-
isHighlightRow: boolean;
|
384
|
-
idx: number;
|
385
|
-
isHighlight: boolean;
|
386
|
-
isFieldSet: boolean;
|
387
383
|
fieldDescribeMode: "column" | "tooltip";
|
384
|
+
isFieldSet: boolean;
|
388
385
|
hideExpressionOption: AnyObject[];
|
386
|
+
idx: number;
|
387
|
+
isHighlight: boolean;
|
388
|
+
isHighlightRow: boolean;
|
389
389
|
}>;
|
390
390
|
export default _default;
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{inject as e,createVNode as t,mergeProps as o}from"vue";import{NInput as n}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as i}from"../../../constants/index.js";import{useAutoFocus as a}from"./hooks/useAutoFocus.js";import{IhoTableRenderHelper as l}from"../../../utils/index.js";import{defineTablePlugin as s}from"../../../hooks/useTablePlugin.js";import{getSeparateInfo as d}from"../../../utils/separateMap.js";function u(){const u="inputRendererPlugins";return s({name:u,vxe(a){let s="";a.renderer.add(r.INPUT,{renderCell:l.createDefaultRenderCell(),renderEdit:l.createRenderEdit((({fieldItem:r,row:a,rowIndex:l,column:u,emitFormChangeWithParams:m,emitFormClickWithParams:c,$table:f})=>{let p=l,g=a;if("bottom"===r.separatePlacement){const t=e(i),o=d(t,a);if(o&&o.isLastRow&&a!==o.originalData){const{originalData:e=a,index:t}=o;g=e,p=t}}return[t(n,o({value:g[u.field],"onUpdate:value":e=>g[u.field]=e},r.componentProps,{onChange:()=>{m({oldValue:s,index:p,row:g,value:g[u.field]})},onClick:()=>c({index:p,row:g,value:g[u.field]}),onFocus:()=>s=g[u.field],onKeydown:async e=>{if("Enter"!==e.key)return;const{fullData:t}=f.getTableData();if(t.length!==l+1)return;const{editStore:{actived:o}={}}=f.reactData;if(o&&o.row){const t=o.args;await f.clearEdit(),f.handleSelected(t,e)}}}),null)]}))})},apply(e){a(e).bindAutoFocusConfig(u,r.INPUT,".n-input__input-el",{focusType:"class"})}})}export{u as inputRendererPlugin};
|
1
|
+
import{inject as e,createVNode as t,mergeProps as o}from"vue";import{NInput as n}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as i}from"../../../constants/index.js";import{useAutoFocus as a}from"./hooks/useAutoFocus.js";import{IhoTableRenderHelper as l}from"../../../utils/index.js";import{defineTablePlugin as s}from"../../../hooks/useTablePlugin.js";import{getSeparateInfo as d}from"../../../utils/separateMap.js";function u(){const u="inputRendererPlugins";return s({name:u,vxe(a){let s="";a.renderer.add(r.INPUT,{renderCell:l.createDefaultRenderCell(),renderEdit:l.createRenderEdit((({fieldItem:r,row:a,rowIndex:l,column:u,emitFormChangeWithParams:m,emitFormClickWithParams:c,$table:f})=>{let p=l,g=a;if("bottom"===r.separatePlacement){const t=e(i),o=d(t,a);if(o&&o.isLastRow&&a!==o.originalData){const{originalData:e=a,index:t}=o;g=e,p=t}}return[t(n,o({value:g[u.field],"onUpdate:value":e=>g[u.field]=e},r.componentProps,{onChange:()=>{m({oldValue:s,index:p,row:g,value:g[u.field]})},onClick:()=>c({index:p,row:g,value:g[u.field]}),onFocus:()=>s=g[u.field],onKeydown:async e=>{if("Enter"!==e.key)return;const{fullData:t}=f.getTableData();if(t.length!==l+1)return;const{editStore:{actived:o}={}}=f.reactData;if(o&&o.row){const t=o.args;await f.clearEdit(),f.handleSelected(t,e)}}}),null)]}))})},apply(e){a(e).bindAutoFocusConfig(u,r.INPUT,".n-input__input-el,.n-input__textarea-el",{focusType:"class"})}})}export{u as inputRendererPlugin};
|
@@ -1 +1 @@
|
|
1
|
-
import{traverse as e,findAncestor as n,getStringWidth as t}from"../../../../../../shared/utils/index.js";import{isString as r,isNumber as i,constant as o,isFunction as
|
1
|
+
import{traverse as e,findAncestor as n,getStringWidth as t}from"../../../../../../shared/utils/index.js";import{isString as r,isNumber as i,constant as o,isFunction as a,noop as l,range as d,property as u}from"lodash-es";import{IhoTableRenderHelper as c}from"../../../utils/index.js";import{VERTICAL_CELL_TYPE as f}from"./constants.js";function s(e){var n;return!!(null==(n=e.verticalConfig)?void 0:n.enable)}function h(e){return!!r(e)&&e.startsWith("header_")}function p(e){return!!r(e)&&e.startsWith("body_")}function _(e){var n;return r(e)?+(null!=(n=e.split("_")[1])?n:-1):-1}function m(n,t){const r=[];return e(n,((e,n,o)=>{e.parent=o,e.children||(!function(e,n){let t=e,r=n;if(!e.parent)return e[`header_${n}`]=e.title,void d(n+1).forEach((t=>{e[`header_${t}_colspan`]=t===n?n+1:0,e[`header_${t}_rowspan`]=t===n?1:0}));for(;t;)e[`header_${r}`]=t.title,e[`header_${r}_rowspan`]=i(t),e[`header_${r}_colspan`]=1,r--,t=t.parent}(e,t),r.push(e))})),r.forEach(((e,n)=>{const i=r[n-1];i&&Object.entries(e).forEach((([n,r])=>{n.match(/^header_(\d+)$/)&&r===i[n]&&r&&n!==`header_${t}`&&(e[`${n}_colspan`]=0,e[`${n}_rowspan`]=0)}))})),r;function i(n){if(!n.children)return 1;let t=0;return e(n.children,(e=>{e.children||t++})),t}}function g({row:e,column:n}){var t,r;return h(n.field)?{rowspan:null!=(t=e[n.field+"_rowspan"])?t:1,colspan:null!=(r=e[n.field+"_colspan"])?r:1}:{colspan:1,rowspan:1}}const x=({cell:e}={})=>{const n=e&&e.querySelector("input,.n-input__input-el,.n-input__textarea-el");return n&&n.click(),n};function w(n,r){let i=120;return e(r,((e,r,o,a)=>{a===n&&(i=Math.max(i,t(e.title||"")+20+(c.hasTitlePrefix(e)?20:0)))})),Math.ceil(i)}function $(e,n,t){const r=T(t);let u=r.getTableConfig("verticalConfig.headerWidth");u="auto"===u?w:i(u)?o(u):a(u)?u:w;let c=r.getTableConfig("verticalConfig.bodyWidth");c=i(c)?o(c):a(c)?c:l;let s=r.getTableConfig("verticalConfig.bodyMinWidth");return s=i(s)?o(s):a(s)?s:o(120),[...d(n+1).map((e=>({field:`header_${e}`,title:`header_${e}`,width:u(e,t.originalFieldList),fixed:"left",editRender:{name:f,props:{},enable:!1}}))),...e.map(((e,n)=>({field:`body_${n}`,title:`body_${n}`,minWidth:s(n),width:c(n),editRender:{name:f,props:{},enable:!0,autofocus:x}})))]}function y(e){const t=n(e.target,(e=>"TD"===e.tagName||"TH"===e.tagName));if(!t)return;const r=t.className.match(/(body|header)_(\d+)/);if(!r)return;const[i,o,a]=r;return{fieldKey:i,type:o,sequence:+a}}function b(e){return u("originalField")(e)}function v(e,n){return u(`originalData.${n}`)(e)}function I(e,n){const t=_(n.field),r=b(e);return{row:v(e,t),rowIndex:t,$rowIndex:t,column:r,fixed:r.fixed,type:r.type}}function C(n){const t=[];return e(n,(e=>{"left"===e.fixed&&t.push(e)})),t}function T(e){return{getOriginDataByColumn(n){const{originalData:t=[]}=e;return t[_(n.field)]},getTableConfig:n=>u(n)(e.originalTableConfig)}}function D(e,n){return new Proxy({},{get(t,r){var i;if("originalField"===r)return e;if("originalData"===r)return a(n)?n():n;if(h(r))return e[r];if(p(r)){const t=_(r);return"seq"===e.type?t+1:null==(i=n[t])?void 0:i[e.field]}return t[r]},set(t,r,i){if(!h(r)){const t=_(r);t>=0&&n[t]&&(n[t][e.field]=i)}return!0}})}function W({$columnIndex:e,$rowIndex:n,column:t,columnIndex:r,row:i,rowIndex:o,type:a,_columnIndex:l,_rowIndex:d},u){var c;if(t){const f=a;if(a=h(t.field)?"header":"body",i){const s=_(t.field);t=b(i),i="header"===a?void 0:v(i,s),l=r=e="header"===f?n||0:((null==(c=u.fixedLeftVerticalData)?void 0:c.length)||0)+(n||0),d=o=n="header"===a?-1:s}}return{column:t,row:i,_columnIndex:l,_rowIndex:d,columnIndex:r,rowIndex:o,$columnIndex:e,$rowIndex:n,type:a}}x.toString=()=>"input,.n-input__input-el";export{W as basicParamsConvert,m as bindHeaderInfoAndFlatten,D as createDataProxy,$ as createVerticalFieldList,T as createVerticalStateHandler,C as findFixedLeftFields,_ as getHeaderDepthByField,I as getOriginBasePayload,b as getOriginFieldFromRowData,v as getOriginRowFromRowData,g as getSpanInfo,y as getVerticalInfoFromEvent,p as isVerticalBody,h as isVerticalHeader,s as isVerticalTable};
|