ht-emr 0.7.25 → 0.7.26

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.
@@ -116,6 +116,7 @@ export declare class Command {
116
116
  executeSetControlPropertiesList: CommandAdapt['setControlPropertiesList'];
117
117
  executeSetControlHighlight: CommandAdapt['setControlHighlight'];
118
118
  executeSetControlQualityMarks: CommandAdapt['setControlQualityMarks'];
119
+ executeSetButtonContent: CommandAdapt['setButtonContent'];
119
120
  executeLocationControl: CommandAdapt['locationControl'];
120
121
  executeInsertControl: CommandAdapt['insertControl'];
121
122
  executeInsertTextField: CommandAdapt['insertTextField'];
@@ -149,6 +150,7 @@ export declare class Command {
149
150
  getLocale: CommandAdapt['getLocale'];
150
151
  getGroupIds: CommandAdapt['getGroupIds'];
151
152
  getControlValue: CommandAdapt['getControlValue'];
153
+ getButtonContent: CommandAdapt['getButtonContent'];
152
154
  getControlList: CommandAdapt['getControlList'];
153
155
  getContainer: CommandAdapt['getContainer'];
154
156
  getTitleValue: CommandAdapt['getTitleValue'];
@@ -10,7 +10,7 @@ import { TitleLevel } from '../../dataset/enum/Title';
10
10
  import { VerticalAlign } from '../../dataset/enum/VerticalAlign';
11
11
  import { ICatalog } from '../../interface/Catalog';
12
12
  import { DeepRequired } from '../../interface/Common';
13
- import { IGetControlValueOption, IGetControlValueResult, IControlQualityMark, ILocationControlOption, IRemoveControlOption, ISetControlExtensionOption, ISetControlHighlightOption, ISetControlProperties, ISetControlValueOption } from '../../interface/Control';
13
+ import { IGetControlValueOption, IGetControlValueResult, IGetButtonContentOption, IControlQualityMark, ILocationControlOption, IRemoveControlOption, ISetButtonContentOption, ISetControlExtensionOption, ISetControlHighlightOption, ISetControlProperties, ISetControlValueOption } from '../../interface/Control';
14
14
  import { IAppendElementListOption, IDrawImagePayload, IForceUpdateOption, IGetImageOption, IGetValueOption, IPainterOption } from '../../interface/Draw';
15
15
  import { IEditorData, IEditorHTML, IEditorOption, IFormModeTraceOption, IEditorResult, IEditorText, IFocusOption, ISetValueOption, IUpdateOption } from '../../interface/Editor';
16
16
  import { IDeleteElementByIdOption, IElement, IElementPosition, IGetElementByIdOption, IGetMacroValueOption, IImageCaption, IImageCrop, IInsertElementListOption, IMacroValueResult, ISetMacroValueOption, IUpdateElementByIdOption, IUpdateMacroPropertiesOption, IUpdateSubTemplateOption } from '../../interface/Element';
@@ -40,6 +40,15 @@ export declare class CommandAdapt {
40
40
  private zone;
41
41
  private tableOperate;
42
42
  constructor(draw: Draw);
43
+ private getButtonContentControlId;
44
+ private getButtonContentText;
45
+ private normalizeButtonContentValue;
46
+ private getButtonContentResult;
47
+ private getButtonBusinessValue;
48
+ private findButtonControlContext;
49
+ private removeButtonBusinessElements;
50
+ private appendButtonContentValue;
51
+ private createButtonBusinessElements;
43
52
  private getIsRangeInTextField;
44
53
  mode(payload: EditorMode): void;
45
54
  cut(): Promise<void>;
@@ -186,6 +195,8 @@ export declare class CommandAdapt {
186
195
  locationGroup(groupId: string): void;
187
196
  setZone(zone: EditorZone): void;
188
197
  getControlValue(payload: IGetControlValueOption): IGetControlValueResult | null;
198
+ getButtonContent(payload: IGetButtonContentOption): string | IElement[] | null;
199
+ setButtonContent(payload: ISetButtonContentOption): void;
189
200
  setControlValue(payload: ISetControlValueOption): void;
190
201
  setControlValueList(payload: ISetControlValueOption[]): void;
191
202
  setControlExtension(payload: ISetControlExtensionOption): void;
@@ -15,13 +15,13 @@ export declare class ButtonControl implements IControlInstance {
15
15
  setElement(element: IElement): void;
16
16
  getElement(): IElement;
17
17
  getIsPopup(): boolean;
18
- getValue(): IElement[];
18
+ getValue(context?: IControlContext): IElement[];
19
19
  setValue(data: IElement[], context?: IControlContext, options?: IControlRuleOption): number;
20
20
  clearSelect(context?: IControlContext, options?: IControlRuleOption): number;
21
21
  keydown(evt: KeyboardEvent): number | null;
22
22
  removeByValue(array: IElement[], controlId: string): Promise<unknown>;
23
23
  cut(): number;
24
- awake(): void;
24
+ awake(evt?: MouseEvent): void;
25
25
  private showInputModal;
26
26
  private closeInputModal;
27
27
  private showEditModal;
@@ -26,7 +26,7 @@ import { ICatalog, ICatalogItem } from './interface/Catalog';
26
26
  import { UsePlugin } from './interface/Plugin';
27
27
  import { EventBus } from './core/event/eventbus/EventBus';
28
28
  import { EventBusMap } from './interface/EventBus';
29
- import { IRangeStyle } from './interface/Listener';
29
+ import { IButtonActionPayload, IRangeStyle } from './interface/Listener';
30
30
  import { Override } from './core/override/Override';
31
31
  import { LETTER_CLASS } from './dataset/constant/Common';
32
32
  import { INTERNAL_CONTEXT_MENU_KEY } from './dataset/constant/ContextMenu';
@@ -40,7 +40,7 @@ import { AreaMode } from './dataset/enum/Area';
40
40
  import { IBadge } from './interface/Badge';
41
41
  import { WatermarkType } from './dataset/enum/Watermark';
42
42
  import { INTERNAL_SHORTCUT_KEY } from './dataset/constant/Shortcut';
43
- import { IControlQualityMark, IControlQualityMarkStyle, ISetControlQualityMarksOption } from './interface/Control';
43
+ import { IButtonContentValue, IControlAction, IControlQualityMark, IControlQualityMarkStyle, IGetButtonContentOption, ISetButtonContentOption, ISetControlQualityMarksOption } from './interface/Control';
44
44
  /**
45
45
  * Canvas编辑器主类
46
46
  *
@@ -119,4 +119,4 @@ export default class Editor {
119
119
  export { splitText, createDomFromElementList, getElementListByHTML, getTextFromElementList };
120
120
  export { EDITOR_COMPONENT, LETTER_CLASS, INTERNAL_CONTEXT_MENU_KEY, INTERNAL_SHORTCUT_KEY, EDITOR_CLIPBOARD };
121
121
  export { Editor, RowFlex, VerticalAlign, EditorZone, EditorMode, ElementType, ControlType, EditorComponent, PageMode, RenderMode, ImageDisplay, Command, KeyMap, BlockType, PaperDirection, TableBorder, TdBorder, TdSlash, MaxHeightRatio, NumberType, TitleLevel, ListType, ListStyle, WordBreak, ControlIndentation, ControlComponent, BackgroundRepeat, BackgroundSize, TextDecorationStyle, LineNumberType, LocationPosition, AreaMode, ControlState, FlexDirection, WatermarkType };
122
- export type { IElement, IEditorData, IEditorOption, IEditorResult, IFormModeTraceOption, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang, ICatalog, ICatalogItem, IRange, IRangeStyle, IBadge, IGetElementListByHTMLOption, IControlQualityMark, IControlQualityMarkStyle, ISetControlQualityMarksOption, IMacroConfig, IMacroElement, IGetMacroValueOption, IMacroValueResult, ISetMacroValueOption, IUpdateMacroPropertiesOption, ITemplateCondition, ITemplateConditionRelation, ITemplateConditionSource, ISubTemplateElement, IUpdateSubTemplateOption };
122
+ export type { IElement, IEditorData, IEditorOption, IEditorResult, IFormModeTraceOption, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang, ICatalog, ICatalogItem, IRange, IRangeStyle, IButtonActionPayload, IBadge, IGetElementListByHTMLOption, IButtonContentValue, IControlAction, IGetButtonContentOption, ISetButtonContentOption, IControlQualityMark, IControlQualityMarkStyle, ISetControlQualityMarksOption, IMacroConfig, IMacroElement, IGetMacroValueOption, IMacroValueResult, ISetMacroValueOption, IUpdateMacroPropertiesOption, ITemplateCondition, ITemplateConditionRelation, ITemplateConditionSource, ISubTemplateElement, IUpdateSubTemplateOption };
@@ -79,6 +79,12 @@ export interface IControlRule {
79
79
  hide?: boolean;
80
80
  readonly?: boolean;
81
81
  }
82
+ export interface IControlAction {
83
+ key: 'outpatient.diagnosis' | 'outpatient.orders' | 'outpatient.patient360' | string;
84
+ label: string;
85
+ writeTarget?: 'self' | string;
86
+ writeMode?: 'confirmAppend' | string;
87
+ }
82
88
  export interface IControlBasic {
83
89
  type: ControlType;
84
90
  value: IElement[] | null;
@@ -104,6 +110,7 @@ export interface IControlBasic {
104
110
  label?: string;
105
111
  buttonLabel?: string;
106
112
  code?: string | null;
113
+ action?: IControlAction;
107
114
  menstrualData?: IMenstrualData;
108
115
  }
109
116
  export interface IMenstrualData {
@@ -205,6 +212,16 @@ export interface ISetControlValueOption {
205
212
  value: string | IElement[] | null;
206
213
  isSubmitHistory?: boolean;
207
214
  }
215
+ export type IButtonContentValue = string | IElement[];
216
+ export interface IGetButtonContentOption {
217
+ controlId: string;
218
+ }
219
+ export interface ISetButtonContentOption {
220
+ controlId: string;
221
+ value: IButtonContentValue;
222
+ mode: 'replace' | 'append';
223
+ isSubmitHistory?: boolean;
224
+ }
208
225
  export interface ISetControlExtensionOption {
209
226
  id?: string;
210
227
  groupId?: string;
@@ -3,7 +3,7 @@ import { ElementType } from '../dataset/enum/Element';
3
3
  import { ListStyle, ListType } from '../dataset/enum/List';
4
4
  import { RowFlex } from '../dataset/enum/Row';
5
5
  import { TitleLevel } from '../dataset/enum/Title';
6
- import { IControlChangeResult, IControlContentChangeResult } from './Control';
6
+ import { IControl, IControlChangeResult, IControlContentChangeResult } from './Control';
7
7
  import { IEditorResult } from './Editor';
8
8
  import { IElement } from './Element';
9
9
  import { IPositionContext } from './Position';
@@ -63,14 +63,15 @@ export type IImageDblclick = (payload: {
63
63
  evt: MouseEvent;
64
64
  element: IElement;
65
65
  }) => void;
66
- export type IButtonChange = (payload: {
67
- controlId: string | undefined;
68
- element: IElement | IElement[];
69
- }) => void;
70
- export type IButtonClick = (payload: {
71
- controlId: string | undefined;
72
- element: IElement | IElement[];
73
- }) => void;
66
+ export interface IButtonActionPayload {
67
+ evt: MouseEvent;
68
+ element: IElement;
69
+ elementList: IElement[];
70
+ controlId: string;
71
+ control: IControl;
72
+ }
73
+ export type IButtonChange = (payload: IButtonActionPayload) => void;
74
+ export type IButtonClick = (payload: IButtonActionPayload) => void;
74
75
  export type IControlEditAttribute = (payload: {
75
76
  controlId: string | undefined;
76
77
  element: IElement | IElement[];
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ht-emr",
3
3
  "author": "swj",
4
4
  "license": "MIT",
5
- "version": "0.7.25",
5
+ "version": "0.7.26",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",