cnhis-design-vue 3.1.54-beta.0 → 3.1.54-beta.1
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/fabric-chart/src/hooks/electrocardiogram/constants/index.d.ts +2 -0
- package/es/components/fabric-chart/src/hooks/electrocardiogram/constants/index.js +1 -0
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/index.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/index.js +1 -0
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.d.ts +11 -0
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -0
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.d.ts +2 -2
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +15 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=370,t=.1;export{o as DETAIL_RADIUS,t as POLYLINE_BASIC_SCALE};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useDetailEvent';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{useDetailEvent}from"./useDetailEvent.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { fabric } from '../../../../../../../es/shared/utils/fabricjs';
|
|
2
|
+
declare type DetailEventOptions = Partial<{
|
|
3
|
+
beforeEvent: () => any | Promise<any>;
|
|
4
|
+
showScaleText: boolean;
|
|
5
|
+
}> & {
|
|
6
|
+
scale: number;
|
|
7
|
+
endX: number;
|
|
8
|
+
endY: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function useDetailEvent(polyline: fabric.Polyline, { scale, beforeEvent, endY, endX, showScaleText }: DetailEventOptions): void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fabric as t}from"../../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../../useDraw.js";import"date-fns";import"lodash-es";import"../../useEvent.js";import"vue";import"../../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";import{POLYLINE_BASIC_SCALE as n,DETAIL_RADIUS as o}from"../constants/index.js";function r(r,{scale:s,beforeEvent:a,endY:i,endX:l,showScaleText:p=!0}){let u=null;function d(){var t;u&&(null==(t=r.canvas)||t.remove(u)),u=null}r.on("mousedown",(async f=>{var c,h;if(await(null==a?void 0:a()),1!==f.button||!f.target||!f.pointer)return;const y=f.target;if(!y.points)return;const{x:w,y:m}=f.pointer,x=(w-(y.left||0))/n;let v=x-o,g=x+o;v<=0?(v=0,g=Math.min(2*o,y.points.length-1)):g>=y.points.length-1&&(g=y.points.length-1,v=Math.max(y.points.length-2*o,0));const k=y.points.slice(v,g).map((({y:t},e)=>({x:e,y:t}))),b=x-v;let j=0,A=0;k.forEach(((t,e)=>{t.y>k[j].y&&(j=e),t.y<k[A].y&&(A=e)}));const D=n*s*o*2-1,S=n*s*(k[j].y-k[A].y)-1,E=S+30+70,L={x:l-w<=D?w-D:w,y:i-m<=E?m-E:m};var W,X,Y;d(),u=new t.Group([],{}),u.add(new t.Rect({...e,left:L.x,top:L.y,width:D,height:E,stroke:"transparent",fill:"#fff",shadow:new t.Shadow({color:"rgba(0, 0, 0, 0.3)",blur:15,offsetX:8,offsetY:8})}),(Y=k,new t.Polyline(Y,{...e,fill:"transparent",stroke:"red",strokeWidth:2,scaleX:n*s,scaleY:n*s,left:L.x,top:L.y+30})),function(n,o){const r=new t.Line(i(n[j]),{...e,stroke:"red",strokeDashArray:[3,4],width:3,left:L.x+j/k.length*D,top:L.y}),s=new t.Line(i(n[A]),{...e,stroke:"blue",strokeDashArray:[3,4],width:3,left:L.x+A/k.length*D,top:L.y}),a=new t.Line(i(n[o]),{...e,stroke:"green",strokeDashArray:[3,4],width:3,left:L.x+o/k.length*D,top:L.y});return new t.Group([r,s,a],{});function i(t){return[t.x,t.y,t.x,t.y-E]}}(k,b),(W=k,X=b,new t.Circle({...e,radius:5,fill:"transparent",stroke:"green",strokeWidth:1,left:L.x+X/k.length*D-5,top:L.y+(W[b].y-W[A].y)/(W[j].y-W[A].y)*S-5+30}))),p&&u.add(new t.Text(`x${s}`,{fill:"black",fontSize:20,left:L.x+10,top:L.y+E-30})),null==(c=r.canvas)||c.add(u),u.addWithUpdate(),null==(h=r.canvas)||h.discardActiveObject()})),r.on("mouseup",(async t=>{await(null==a?void 0:a()),1===t.button&&d()}))}export{r as useDetailEvent};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Ref } from 'vue';
|
|
2
|
-
import { fabric } from '../../../../../../es/shared/utils/fabricjs';
|
|
3
1
|
import { AnyObject } from '../../../../../../es/shared/types';
|
|
2
|
+
import { fabric } from '../../../../../../es/shared/utils/fabricjs';
|
|
3
|
+
import { type Ref } from 'vue';
|
|
4
4
|
export declare function useElectrocardiogram(canvas: Ref<fabric.Canvas>, propItems: AnyObject, flag: Ref<boolean>): {
|
|
5
5
|
updatePolyline: (value: number) => void;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as
|
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as o}from"./hooks/useDetailEvent.js";import{defaultTextStyle as n,drawLine as i}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import"date-fns";import"../useEvent.js";import"vue";import"../temperature/useShadow.js";import"naive-ui";import{POLYLINE_BASIC_SCALE as a}from"./constants/index.js";function l(l,d,c){const{borderStyle:u,originX:f,originY:m,xCellWidth:h,endY:p,yCellHeight:v,endX:g,canvasWidth:x,canvasHeight:j,dataList:k,columnNumber:w}=d,Y=new Set;function y(t=0){k.forEach(((r,i)=>{const{x:s,y:d}=r.origin,u=~~(r.data.length/w),f=r.data.reduce(((e,r,o)=>{const n=i<12&&o>=t&&o<=t+u||12===i?[{x:e.length+1,y:p-+r}]:[];return e.concat(n)}),[]),m=new e.Polyline(f,{fill:"transparent",stroke:"red",strokeWidth:10,left:s,top:d,scaleX:a,scaleY:a,originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0}),x=new e.Text(String(r.title),{...n,left:s+h,top:d-2*v,originX:"left",originY:"top"});!function(e,{scale:t=6}={}){o(e,{scale:t,endX:g,endY:p,beforeEvent:()=>c.value&&Promise.reject()})}(m),m.startIdx=t,Y.add(m),l.value.add(x,m)}))}s(l,d),function(){const{strokeWidth:t}=u,r=new e.Rect({...u,width:x-t,height:j-t,left:f,top:m,fill:"transparent"});l.value.add(r)}(),function(){const e=x/w,t=[];r(w).forEach((r=>{if(r+1>=w)return;const o=(r+1)*e,n=i([o,0,o,j],{stroke:"#000"});t.push(n)})),l.value.add(...t)}(),y();return{updatePolyline:t((e=>{if(1===w)return;const t=k[k.length-1].data.length,r=~~(t/w),o=e/100*t-r/2,n=o+r>t?t-r:Math.max(0,o);if(Y.size){const[e]=[...Y];if(e.startIdx===n)return;[...Y].forEach((e=>l.value.remove(e))),Y.clear()}y(n)}),250)}}export{l as useElectrocardiogram};
|
|
@@ -17,6 +17,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
17
17
|
type: NumberConstructor;
|
|
18
18
|
required: true;
|
|
19
19
|
};
|
|
20
|
+
shortcutOptions: {
|
|
21
|
+
type: PropType<string[]>;
|
|
22
|
+
default: () => never[];
|
|
23
|
+
};
|
|
20
24
|
}, {
|
|
21
25
|
attr: AnyObject;
|
|
22
26
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -35,6 +39,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
35
39
|
type: NumberConstructor;
|
|
36
40
|
required: true;
|
|
37
41
|
};
|
|
42
|
+
shortcutOptions: {
|
|
43
|
+
type: PropType<string[]>;
|
|
44
|
+
default: () => never[];
|
|
45
|
+
};
|
|
38
46
|
}>> & {
|
|
39
47
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
40
48
|
"onUpdate:formattedValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -50,7 +58,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
50
58
|
oldValue: any;
|
|
51
59
|
placeholder: any;
|
|
52
60
|
valueFormat: any;
|
|
53
|
-
shortcutOptions: any;
|
|
54
61
|
timeConfig: AnyObject;
|
|
55
62
|
clickShortcutOption: (item: string) => void;
|
|
56
63
|
onUpdateFormattedValue: (value: string) => void;
|
|
@@ -87,8 +94,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
87
94
|
type: NumberConstructor;
|
|
88
95
|
required: true;
|
|
89
96
|
};
|
|
97
|
+
shortcutOptions: {
|
|
98
|
+
type: PropType<string[]>;
|
|
99
|
+
default: () => never[];
|
|
100
|
+
};
|
|
90
101
|
}>> & {
|
|
91
102
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
92
103
|
"onUpdate:formattedValue"?: ((...args: any[]) => any) | undefined;
|
|
93
|
-
}, {
|
|
104
|
+
}, {
|
|
105
|
+
shortcutOptions: string[];
|
|
106
|
+
}>;
|
|
94
107
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as l,inject as t,ref as a,watch as r,nextTick as o,openBlock as u,createBlock as i,unref as n,withCtx as m,createVNode as c,mergeProps as
|
|
1
|
+
import{defineComponent as e,useAttrs as l,inject as t,ref as a,watch as r,nextTick as o,openBlock as u,createBlock as i,unref as n,withCtx as m,createVNode as c,mergeProps as d,createElementBlock as v,Fragment as f,renderList as s,createTextVNode as p,toDisplayString as h,createCommentVNode as k}from"vue";import{NPopover as y,NInput as _,NSpace as w,NScrollbar as b,NButton as g}from"naive-ui";import{useIhoTableFormEvent as V}from"../../../../utils/index.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as q,format as x}from"date-fns";var O=e({__name:"editTime",props:{formattedValue:{type:String},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},shortcutOptions:{type:Array,default:()=>[]}},emits:["update:formattedValue","click"],setup(e,{emit:O}){const j=e,$=l(),A=t("$xetable"),{emitFormChangeWithParams:I}=V({...j,$table:A}),P=a(null),R=a(!1),S=a(),E=a(),H=a();let U=j.formattedValue;const{placeholder:z="请选择",valueFormat:D="HH:mm"}=$,K={...$,placeholder:z,valueFormat:D,format:D};function M(e){if(H.value=e,U===e)return;const l=e||null;O("update:formattedValue",l),I({oldValue:U}),U=l}function N(){[K.valueFormat.replace(/:/,""),K.valueFormat].some((e=>{const l=F(E.value,e,new Date);if(!E.value||q(l)){return M(E.value?x(l,K.valueFormat):""),!0}return!1}))}function T(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=P.value)||l.blur(),R.value=!1)}return r((()=>j.formattedValue),(e=>{E.value=e,H.value=e}),{immediate:!0}),r((()=>R.value),(async e=>{var l,t,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(t=null==(l=S.value)?void 0:l.$timePicker)?void 0:t.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var l,t;return null==(t=null==(l=null==e?void 0:e.querySelector)?void 0:l.call(e,".n-time-picker-col__item--active"))?void 0:t.scrollIntoView()})))})),(l,t)=>(u(),i(n(y),{show:R.value,trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"},onClickoutside:t[3]||(t[3]=()=>R.value=!1)},{trigger:m((()=>[c(n(_),{ref_key:"formRef",ref:P,clearable:"",placeholder:n(z),value:E.value,"onUpdate:value":t[0]||(t[0]=e=>E.value=e),valueModifiers:{trim:!0},onClick:t[1]||(t[1]=()=>R.value=!0),onChange:N,onKeydown:T},null,8,["placeholder","value"])])),default:m((()=>[c(n(w),null,{default:m((()=>[c(n(C),d({ref_key:"timePickerRef",ref:S,show:"","formatted-value":H.value},n(K),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":M,onConfirm:t[2]||(t[2]=()=>R.value=!1)}),null,16,["formatted-value"]),c(n(b),{class:"iho-table__scrollbar"},{default:m((()=>[e.shortcutOptions.length?(u(),i(n(w),{key:0,vertical:"",wrap:!1},{default:m((()=>[(u(!0),v(f,null,s(e.shortcutOptions,(e=>(u(),i(n(g),{size:"tiny",key:e,onClick:l=>function(e){M(e),R.value=!1}(e)},{default:m((()=>[p(h(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):k("v-if",!0)])),_:1})])),_:1})])),_:1},8,["show"]))}});export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.54-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.54-beta.1",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.54-beta.1",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
|
|
@@ -22,3 +22,4 @@ export declare type UnionToTuple<T, Result extends unknown[] = []> = UnionToInte
|
|
|
22
22
|
export declare type MaybeString<T extends string | number> = T | `${T}`;
|
|
23
23
|
export declare type GetFn<T> = T extends (...args: any[]) => any ? T : never;
|
|
24
24
|
export declare type NumberRange<From extends number, End extends number, Result extends number[] = [], U extends readonly unknown[] = [], Flag = false> = U['length'] extends End ? [...Result, U['length']] : U['length'] extends From ? NumberRange<From, End, [...Result, U['length']], [unknown, ...U], true> : Flag extends true ? NumberRange<From, End, [...Result, U['length']], [unknown, ...U], Flag> : NumberRange<From, End, Result, [unknown, ...U], Flag>;
|
|
25
|
+
export declare type ConstructorParams<T = any> = T extends new (...args: infer P) => any ? P : never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.54-beta.
|
|
3
|
+
"version": "3.1.54-beta.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"iOS 7",
|
|
64
64
|
"last 3 iOS versions"
|
|
65
65
|
],
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "42e3adf963ca50ee04e3df4039486ee3c48213f0"
|
|
67
67
|
}
|