cnhis-design-vue 3.1.43-beta.10 → 3.1.43-beta.12
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/README.md +87 -87
- package/es/components/base-search/index.d.ts +4 -0
- package/es/components/base-search/src/index.vue.d.ts +4 -0
- package/es/components/base-search/src/index.vue.js +1 -1
- package/es/components/base-search/style/index.css +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/classification/index.d.ts +3 -1
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +3 -1
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +3 -1
- package/es/components/classification/src/index.vue.d.ts +3 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
- package/es/components/form-render/src/components/renderer/dist/levelSearchCascader.d.ts +77 -0
- package/es/components/form-render/src/components/renderer/dist/searchCascade.d.ts +93 -0
- package/es/components/iho-table/index.d.ts +1 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +1 -0
- package/es/components/iho-table/src/IhoTable.vue.js +1 -1
- package/es/components/iho-table/src/plugins/dist/highLightSetPlugin.d.ts +3 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/dist/index.d.ts +3 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/dist/index.d.ts +3 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/defaultRendererPlugin.d.ts +3 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/seqRendererPlugin.d.ts +3 -0
- package/es/components/iho-table/src/utils/dist/index.d.ts +44 -0
- package/es/components/index.css +1 -1
- package/es/components/quick-search/style/index.css +1 -1
- package/es/components/scale-view/src/ScaleView.vue.js +1 -1
- package/es/components/scale-view/src/components/formitem/dist/r-address.d.ts +36 -0
- package/es/components/scale-view/src/components/formitem/dist/r-sign.d.ts +36 -0
- package/es/components/scale-view/src/components/formitem/dist/standard-modal.d.ts +82 -0
- package/es/components/search-cascader/src/components/dist/SearchMenu.d.ts +57 -0
- package/es/components/search-cascader/src/components/dist/SearchMenu1.d.ts +57 -0
- package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +3 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +3 -1
- package/es/components/table-filter/src/components/render-widget/basicData.d.ts +4 -0
- package/es/components/table-filter/src/components/render-widget/basicData.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/Date.vue.d.ts +3 -28
- package/es/components/table-filter/src/components/render-widget/components/Date.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRange.vue.d.ts +117 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRange.vue.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/Select.vue.d.ts +0 -1
- package/es/components/table-filter/src/components/render-widget/components/Select.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +2 -1
- package/es/components/table-filter/src/components/render-widget/components/index.js +1 -1
- package/es/components/table-filter/src/components/render-widget/enums.d.ts +17 -0
- package/es/components/table-filter/src/components/render-widget/enums.js +1 -1
- package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.d.ts +5 -0
- package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +1 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +124 -19
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/types/enums.d.ts +3 -1
- package/es/components/table-filter/src/types/enums.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import CheckboxGroup from './CheckboxGroup.vue';
|
|
2
2
|
import InputNumberGroup from './InputNumberGroup.vue';
|
|
3
3
|
import Date from './Date.vue';
|
|
4
|
-
|
|
4
|
+
import DateRange from './DateRange.vue';
|
|
5
|
+
export { CheckboxGroup, InputNumberGroup, Date, DateRange };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as CheckboxGroup}from"./CheckboxGroup.vue.js";export{default as InputNumberGroup}from"./InputNumberGroup.vue.js";export{default as Date}from"./Date.vue.js";
|
|
1
|
+
export{default as CheckboxGroup}from"./CheckboxGroup.vue.js";export{default as InputNumberGroup}from"./InputNumberGroup.vue.js";export{default as Date}from"./Date.vue.js";export{default as DateRange}from"./DateRange.vue.js";
|
|
@@ -15,3 +15,20 @@ export declare const DatePresetValEnums: {
|
|
|
15
15
|
MONTH_START: string;
|
|
16
16
|
MONTH_END: string;
|
|
17
17
|
};
|
|
18
|
+
export declare const DateRangeValEnums: {
|
|
19
|
+
TODAY: string;
|
|
20
|
+
TOMORROW: string;
|
|
21
|
+
YESTERDAY: string;
|
|
22
|
+
THIS_WEEK: string;
|
|
23
|
+
NEXT_WEEK: string;
|
|
24
|
+
PREV_WEEK: string;
|
|
25
|
+
THIS_MONTH: string;
|
|
26
|
+
NEXT_MONTH: string;
|
|
27
|
+
PREV_MONTH: string;
|
|
28
|
+
THIS_QUATER: string;
|
|
29
|
+
NEXT_QUATER: string;
|
|
30
|
+
PREV_QUATER: string;
|
|
31
|
+
THIS_YEAR: string;
|
|
32
|
+
NEXT_YEAR: string;
|
|
33
|
+
PREV_YEAR: string;
|
|
34
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const T={CUSTOM:"CUSTOM",NOW:"NOW",TODAY:"TODAY",TODAY_START:"TODAY_START",TODAY_END:"TODAY_END",TOMORROW:"TOMORROW",TOMORROW_START:"TOMORROW_START",TOMORROW_END:"TOMORROW_END",YESTERDAY:"YESTERDAY",YESTERDAY_START:"YESTERDAY_START",YESTERDAY_END:"YESTERDAY_END",WEEK_START:"THIS_WEEK_START",WEEK_END:"THIS_WEEK_END",MONTH_START:"THIS_MONTH_START",MONTH_END:"THIS_MONTH_END"};export{T as DatePresetValEnums};
|
|
1
|
+
const T={CUSTOM:"CUSTOM",NOW:"NOW",TODAY:"TODAY",TODAY_START:"TODAY_START",TODAY_END:"TODAY_END",TOMORROW:"TOMORROW",TOMORROW_START:"TOMORROW_START",TOMORROW_END:"TOMORROW_END",YESTERDAY:"YESTERDAY",YESTERDAY_START:"YESTERDAY_START",YESTERDAY_END:"YESTERDAY_END",WEEK_START:"THIS_WEEK_START",WEEK_END:"THIS_WEEK_END",MONTH_START:"THIS_MONTH_START",MONTH_END:"THIS_MONTH_END"},E={TODAY:"TODAY",TOMORROW:"TOMORROW",YESTERDAY:"YESTERDAY",THIS_WEEK:"THIS_WEEK",NEXT_WEEK:"NEXT_WEEK",PREV_WEEK:"PREV_WEEK",THIS_MONTH:"THIS_MONTH",NEXT_MONTH:"NEXT_MONTH",PREV_MONTH:"PREV_MONTH",THIS_QUATER:"THIS_QUATER",NEXT_QUATER:"NEXT_QUATER",PREV_QUATER:"PREV_QUATER",THIS_YEAR:"THIS_YEAR",NEXT_YEAR:"NEXT_YEAR",PREV_YEAR:"PREV_YEAR"};export{T as DatePresetValEnums,E as DateRangeValEnums};
|
package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
1
|
export declare const presetValToTimestamp: (presetVal: string, format?: string) => any;
|
|
2
|
+
export declare const getAllDateRangeInfo: (format?: string) => {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string | number | never[];
|
|
5
|
+
}[];
|
|
6
|
+
export declare const formatDateRangeInfo: (key: string, format?: string) => string | number | never[];
|
package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DatePresetValEnums as t}from"../enums.js";import
|
|
1
|
+
import{DatePresetValEnums as t,DateRangeValEnums as a}from"../enums.js";import{DateRangeOptions as r}from"../basicData.js";import d from"moment";const e=new Map([[t.NOW,()=>d()],[t.TODAY,()=>d().startOf("day")],[t.TODAY_START,()=>d().startOf("day")],[t.TODAY_END,()=>d().endOf("day")],[t.TOMORROW,()=>d().add(1,"days").startOf("day")],[t.TOMORROW_START,()=>d().add(1,"days").startOf("day")],[t.TOMORROW_END,()=>d().add(1,"days").endOf("day")],[t.YESTERDAY,()=>d().subtract(1,"days").startOf("day")],[t.YESTERDAY_START,()=>d().subtract(1,"days").startOf("day")],[t.YESTERDAY_END,()=>d().subtract(1,"days").endOf("day")],[t.WEEK_START,()=>d().startOf("week")],[t.WEEK_END,()=>d().endOf("week")],[t.MONTH_START,()=>d().startOf("month")],[t.MONTH_END,()=>d().endOf("month")]]),O=(t,a="x")=>{if(!e.has(t))return;const r=e.get(t)().format(a);return"x"===a||"X"===a?Number(r):r},s=new Map([[a.TODAY,()=>[d().startOf("day"),d().endOf("day")]],[a.TOMORROW,()=>[d().add(1,"days").startOf("day"),d().add(1,"days").endOf("day")]],[a.YESTERDAY,()=>[d().subtract(1,"days").startOf("day"),d().subtract(1,"days").endOf("day")]],[a.THIS_WEEK,()=>[d().startOf("week"),d().endOf("week")]],[a.NEXT_WEEK,()=>[d().add(1,"w").startOf("week"),d().add(1,"w").endOf("week")]],[a.PREV_WEEK,()=>[d().subtract(1,"w").startOf("week"),d().subtract(1,"w").endOf("week")]],[a.THIS_MONTH,()=>[d().startOf("month"),d().endOf("month")]],[a.NEXT_MONTH,()=>[d().add(1,"months").startOf("month"),d().add(1,"months").endOf("month")]],[a.PREV_MONTH,()=>[d().subtract(1,"months").startOf("month"),d().subtract(1,"months").endOf("month")]],[a.THIS_QUATER,()=>[d().startOf("quarter"),d().endOf("quarter")]],[a.NEXT_QUATER,()=>[d().add(1,"Q").startOf("quarter"),d().add(1,"Q").endOf("quarter")]],[a.PREV_QUATER,()=>[d().subtract(1,"Q").startOf("quarter"),d().subtract(1,"Q").endOf("quarter")]],[a.THIS_YEAR,()=>[d().startOf("year"),d().endOf("year")]],[a.NEXT_YEAR,()=>[d().add(1,"y").startOf("year"),d().add(1,"y").endOf("year")]],[a.PREV_YEAR,()=>[d().subtract(1,"y").startOf("year"),d().subtract(1,"y").endOf("year")]]]),f=(t="x")=>r.map((a=>{const r=n(a.value,t);return{label:a.label,value:r}})),n=(t,a="x")=>{const r=s.get(t);if(r){const[t,d]=r(),e=`${t.format(a)} ~ ${d.format(a)}`;return"x"===a||"X"===a?Number(e):e}return[]};export{n as formatDateRangeInfo,f as getAllDateRangeInfo,O as presetValToTimestamp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,h as t}from"vue";import{WidgetTypeEnums as i}from"../../types/enums.js";import{WidgetCfgMaps as r}from"./widgetCfgMaps.js";import n from"../../../../../_virtual/plugin-vue_export-helper.js";const a=[i.DATE,i.DATE_TIME,i.CHECKBOX_GROUP];var l=n(e({props:{cfg:{type:Object,required:!0},modelValue:{type:[Array,String,Number]},filterApiConfig:{type:Object}},emits:["update:modelValue","outFilterChange","changeInit"],computed:{valueCp(){return this.cfg.value}},data:()=>({initialProps:{}}),methods:{search(){this.$emit("outFilterChange")},getEleWidth(e){var t;const{widgetType:i,rangeFilter:r}=e;if(!a.includes(i))return r?void 0:{width:`${null!=(t=e.advanceColWidth)?t:200}px`}},initComponentProps(e){const{_frontId:t,widgetType:i,alias:n,title:a,placeholder:l,widgetCfg:s,rangeFilter:o}=e,{props:h,handlerProps:
|
|
1
|
+
import{defineComponent as e,h as t}from"vue";import{WidgetTypeEnums as i}from"../../types/enums.js";import{WidgetCfgMaps as r}from"./widgetCfgMaps.js";import n from"../../../../../_virtual/plugin-vue_export-helper.js";const a=[i.DATE,i.DATE_TIME,i.CHECKBOX_GROUP];var l=n(e({props:{cfg:{type:Object,required:!0},modelValue:{type:[Array,String,Number]},filterApiConfig:{type:Object}},emits:["update:modelValue","outFilterChange","changeInit"],computed:{valueCp(){return this.cfg.value}},data:()=>({initialProps:{}}),methods:{search(){this.$emit("outFilterChange")},getEleWidth(e){var t;const{widgetType:i,rangeFilter:r}=e;if(!a.includes(i))return r?void 0:{width:`${null!=(t=e.advanceColWidth)?t:200}px`}},initComponentProps(e){const{_frontId:t,widgetType:i,alias:n,title:a,placeholder:l,widgetCfg:s,rangeFilter:o,filterExplicit:p}=e,{props:h,handlerProps:d}=r.get(i);let u={...h};d&&(u=d(u,{...s,title:n||a,rangeFilter:o,_frontId:t,filterExplicit:p})),!o&&l&&(u.placeholder=l),this.initialProps=u,u.value&&(this.valueCp=u.value)},generateWidget(e){const{widgetType:i}=e;if(!r.has(i))return null;const{value:n}=e,{component:a,style:l,eventsBySearch:s=[]}=r.get(i),o={...this.initialProps,value:n,filterApiConfig:this.filterApiConfig},p=s.reduce(((e,t)=>{const{name:i,handler:r}=t;let n=this.search;return r&&(n=e=>{r(e,this.search,o)}),{...e,[`on${i}`]:n}}),{});return t(a,{...l,...o,style:this.getEleWidth(e),value:this.valueCp,"onUpdate:value":e=>this.handleUpdate(e),onChangeInitState:(...e)=>this.handleChangeInitState(...e),...p})},handleUpdate(e){this.$emit("update:modelValue",e)},handleChangeInitState(e,t){this.$emit("changeInit",e,t)}},created(){this.initComponentProps(this.cfg)},render(){return this.generateWidget(this.cfg)}}),[["__file","index.vue"]]);export{l as default};
|
|
@@ -5,6 +5,7 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
5
5
|
clearable: boolean;
|
|
6
6
|
filterable?: undefined;
|
|
7
7
|
multiple?: undefined;
|
|
8
|
+
maxTagCount?: undefined;
|
|
8
9
|
type?: undefined;
|
|
9
10
|
valueFormat?: undefined;
|
|
10
11
|
};
|
|
@@ -44,7 +45,6 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
44
45
|
isRemote: import("vue").Ref<boolean>;
|
|
45
46
|
isLoading: import("vue").Ref<boolean>;
|
|
46
47
|
valueCp: import("vue").WritableComputedRef<any>;
|
|
47
|
-
maxTagCount: import("vue").ComputedRef<"responsive" | undefined>;
|
|
48
48
|
searchOptions: (keyword: string) => Promise<any>;
|
|
49
49
|
_handleSearch: (query: string) => Promise<void>;
|
|
50
50
|
handleSearch: (query: string) => Promise<void>;
|
|
@@ -72,6 +72,7 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
72
72
|
clearable: boolean;
|
|
73
73
|
filterable: boolean;
|
|
74
74
|
multiple: boolean;
|
|
75
|
+
maxTagCount: string;
|
|
75
76
|
type?: undefined;
|
|
76
77
|
valueFormat?: undefined;
|
|
77
78
|
};
|
|
@@ -85,7 +86,7 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
85
86
|
} | {
|
|
86
87
|
component: import("vue").DefineComponent<{
|
|
87
88
|
type: {
|
|
88
|
-
type: import("vue").PropType<"
|
|
89
|
+
type: import("vue").PropType<"date" | "datetime">;
|
|
89
90
|
default: string;
|
|
90
91
|
};
|
|
91
92
|
clearable: {
|
|
@@ -96,11 +97,54 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
96
97
|
type: StringConstructor;
|
|
97
98
|
default: string;
|
|
98
99
|
};
|
|
99
|
-
|
|
100
|
+
placeholder: {
|
|
100
101
|
type: StringConstructor;
|
|
101
102
|
default: string;
|
|
102
103
|
};
|
|
103
|
-
|
|
104
|
+
value: {
|
|
105
|
+
type: StringConstructor;
|
|
106
|
+
default: string;
|
|
107
|
+
};
|
|
108
|
+
}, {
|
|
109
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
110
|
+
type: {
|
|
111
|
+
type: import("vue").PropType<"date" | "datetime">;
|
|
112
|
+
default: string;
|
|
113
|
+
};
|
|
114
|
+
clearable: {
|
|
115
|
+
type: BooleanConstructor;
|
|
116
|
+
default: boolean;
|
|
117
|
+
};
|
|
118
|
+
valueFormat: {
|
|
119
|
+
type: StringConstructor;
|
|
120
|
+
default: string;
|
|
121
|
+
};
|
|
122
|
+
placeholder: {
|
|
123
|
+
type: StringConstructor;
|
|
124
|
+
default: string;
|
|
125
|
+
};
|
|
126
|
+
value: {
|
|
127
|
+
type: StringConstructor;
|
|
128
|
+
default: string;
|
|
129
|
+
};
|
|
130
|
+
}>> & {
|
|
131
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
132
|
+
}>>;
|
|
133
|
+
emit: (event: "update:value", ...args: any[]) => void;
|
|
134
|
+
valueCp: import("vue").Ref<any>;
|
|
135
|
+
dateFormat: import("vue").ComputedRef<string>;
|
|
136
|
+
handleChange: (val: any) => void;
|
|
137
|
+
NDatePicker: any;
|
|
138
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
139
|
+
type: {
|
|
140
|
+
type: import("vue").PropType<"date" | "datetime">;
|
|
141
|
+
default: string;
|
|
142
|
+
};
|
|
143
|
+
clearable: {
|
|
144
|
+
type: BooleanConstructor;
|
|
145
|
+
default: boolean;
|
|
146
|
+
};
|
|
147
|
+
valueFormat: {
|
|
104
148
|
type: StringConstructor;
|
|
105
149
|
default: string;
|
|
106
150
|
};
|
|
@@ -112,12 +156,67 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
112
156
|
type: StringConstructor;
|
|
113
157
|
default: string;
|
|
114
158
|
};
|
|
159
|
+
}>> & {
|
|
160
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
161
|
+
}, {
|
|
162
|
+
type: "date" | "datetime";
|
|
163
|
+
value: string;
|
|
164
|
+
placeholder: string;
|
|
165
|
+
clearable: boolean;
|
|
166
|
+
valueFormat: string;
|
|
167
|
+
}>;
|
|
168
|
+
props: {
|
|
169
|
+
type: string;
|
|
170
|
+
clearable: boolean;
|
|
171
|
+
valueFormat: string;
|
|
172
|
+
filterable?: undefined;
|
|
173
|
+
multiple?: undefined;
|
|
174
|
+
maxTagCount?: undefined;
|
|
175
|
+
};
|
|
176
|
+
handlerProps(props: any, data?: any): any;
|
|
177
|
+
setDefaultValue(defaultValue: any, defValueUnit: any): any;
|
|
178
|
+
eventsBySearch?: undefined;
|
|
179
|
+
style?: undefined;
|
|
180
|
+
} | {
|
|
181
|
+
component: import("vue").DefineComponent<{
|
|
182
|
+
type: {
|
|
183
|
+
type: import("vue").PropType<"date" | "datetime">;
|
|
184
|
+
default: string;
|
|
185
|
+
};
|
|
186
|
+
filterExplicit: {
|
|
187
|
+
type: NumberConstructor;
|
|
188
|
+
default: number;
|
|
189
|
+
};
|
|
190
|
+
clearable: {
|
|
191
|
+
type: BooleanConstructor;
|
|
192
|
+
default: boolean;
|
|
193
|
+
};
|
|
194
|
+
valueFormat: {
|
|
195
|
+
type: StringConstructor;
|
|
196
|
+
default: string;
|
|
197
|
+
};
|
|
198
|
+
startPlaceholder: {
|
|
199
|
+
type: StringConstructor;
|
|
200
|
+
default: string;
|
|
201
|
+
};
|
|
202
|
+
endPlaceholder: {
|
|
203
|
+
type: StringConstructor;
|
|
204
|
+
default: string;
|
|
205
|
+
};
|
|
206
|
+
value: {
|
|
207
|
+
type: StringConstructor;
|
|
208
|
+
default: string;
|
|
209
|
+
};
|
|
115
210
|
}, {
|
|
116
211
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
117
212
|
type: {
|
|
118
|
-
type: import("vue").PropType<"
|
|
213
|
+
type: import("vue").PropType<"date" | "datetime">;
|
|
119
214
|
default: string;
|
|
120
215
|
};
|
|
216
|
+
filterExplicit: {
|
|
217
|
+
type: NumberConstructor;
|
|
218
|
+
default: number;
|
|
219
|
+
};
|
|
121
220
|
clearable: {
|
|
122
221
|
type: BooleanConstructor;
|
|
123
222
|
default: boolean;
|
|
@@ -134,10 +233,6 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
134
233
|
type: StringConstructor;
|
|
135
234
|
default: string;
|
|
136
235
|
};
|
|
137
|
-
placeholder: {
|
|
138
|
-
type: StringConstructor;
|
|
139
|
-
default: string;
|
|
140
|
-
};
|
|
141
236
|
value: {
|
|
142
237
|
type: StringConstructor;
|
|
143
238
|
default: string;
|
|
@@ -146,14 +241,26 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
146
241
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
147
242
|
}>>;
|
|
148
243
|
emit: (event: "update:value", ...args: any[]) => void;
|
|
149
|
-
|
|
150
|
-
|
|
244
|
+
dateList: import("vue").Ref<any[]>;
|
|
245
|
+
isShow: import("vue").Ref<boolean>;
|
|
246
|
+
radioValue: import("vue").Ref<string>;
|
|
247
|
+
startDate: import("vue").Ref<any>;
|
|
248
|
+
endDate: import("vue").Ref<any>;
|
|
249
|
+
dateFormat: import("vue").ComputedRef<string>;
|
|
250
|
+
initData: () => void;
|
|
251
|
+
handleRadioClick: (value: string) => void;
|
|
252
|
+
handleChange: (val: any, type: "end" | "start") => void;
|
|
151
253
|
NDatePicker: any;
|
|
254
|
+
NButton: any;
|
|
152
255
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
153
256
|
type: {
|
|
154
|
-
type: import("vue").PropType<"
|
|
257
|
+
type: import("vue").PropType<"date" | "datetime">;
|
|
155
258
|
default: string;
|
|
156
259
|
};
|
|
260
|
+
filterExplicit: {
|
|
261
|
+
type: NumberConstructor;
|
|
262
|
+
default: number;
|
|
263
|
+
};
|
|
157
264
|
clearable: {
|
|
158
265
|
type: BooleanConstructor;
|
|
159
266
|
default: boolean;
|
|
@@ -170,10 +277,6 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
170
277
|
type: StringConstructor;
|
|
171
278
|
default: string;
|
|
172
279
|
};
|
|
173
|
-
placeholder: {
|
|
174
|
-
type: StringConstructor;
|
|
175
|
-
default: string;
|
|
176
|
-
};
|
|
177
280
|
value: {
|
|
178
281
|
type: StringConstructor;
|
|
179
282
|
default: string;
|
|
@@ -181,9 +284,9 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
181
284
|
}>> & {
|
|
182
285
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
183
286
|
}, {
|
|
184
|
-
type: "
|
|
287
|
+
type: "date" | "datetime";
|
|
185
288
|
value: string;
|
|
186
|
-
|
|
289
|
+
filterExplicit: number;
|
|
187
290
|
clearable: boolean;
|
|
188
291
|
startPlaceholder: string;
|
|
189
292
|
endPlaceholder: string;
|
|
@@ -195,9 +298,10 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
195
298
|
valueFormat: string;
|
|
196
299
|
filterable?: undefined;
|
|
197
300
|
multiple?: undefined;
|
|
301
|
+
maxTagCount?: undefined;
|
|
198
302
|
};
|
|
199
303
|
handlerProps(props: any, data?: any): any;
|
|
200
|
-
setDefaultValue(defaultValue: any
|
|
304
|
+
setDefaultValue: (defaultValue: any) => any;
|
|
201
305
|
eventsBySearch?: undefined;
|
|
202
306
|
style?: undefined;
|
|
203
307
|
} | {
|
|
@@ -306,6 +410,7 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
|
306
410
|
clearable?: undefined;
|
|
307
411
|
filterable?: undefined;
|
|
308
412
|
multiple?: undefined;
|
|
413
|
+
maxTagCount?: undefined;
|
|
309
414
|
type?: undefined;
|
|
310
415
|
valueFormat?: undefined;
|
|
311
416
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WidgetTypeEnums as e}from"../../types/enums.js";import{DatePresetValEnums as t}from"./enums.js";import{NInputNumber as l,NInput as a}from"naive-ui";import r from"./components/CheckboxGroup.vue.js";import
|
|
1
|
+
import{WidgetTypeEnums as e}from"../../types/enums.js";import{DatePresetValEnums as t}from"./enums.js";import{NInputNumber as l,NInput as a}from"naive-ui";import r from"./components/CheckboxGroup.vue.js";import o from"./components/InputNumberGroup.vue.js";import n from"./components/Date.vue.js";import p from"./components/DateRange.vue.js";import s from"./components/Select.vue.js";import{presetValToTimestamp as m}from"./helpers/presetValToTimestamp.js";const i=e=>null==e?null:e,u=new Map([[e.INPUT_NUMBER,{component:l,props:{clearable:!0},eventsBySearch:[{name:"keydown",handler(e,t){"Enter"===e.key&&t()}}],handlerProps:(e,{title:t}={})=>({...e,placeholder:`输入${t}`}),setDefaultValue:i}],[e.INPUTNUMBER_RANGE,{component:o,props:{clearable:!0},eventsBySearch:[{name:"keydown",handler(e,t){"Enter"===e.key&&t()}}],handlerProps:(e,{title:t}={})=>({...e,startPlaceholder:`起始${t}`,endPlaceholder:`截止${t}`}),setDefaultValue:i}],[e.INPUT,{component:a,props:{clearable:!0},eventsBySearch:[{name:"keydown",handler(e,t){"Enter"===e.key&&t()}}],handlerProps:(e,{title:t}={})=>({...e,placeholder:`搜索${t}`}),setDefaultValue:i}],[e.SELECT,{component:s,props:{clearable:!0,filterable:!0,multiple:!1,maxTagCount:"responsive"},eventsBySearch:[{name:"change",handler(e,t,l){const{multiple:a}=l;a&&t()}}],handlerProps(e,t={}){const{valueList:l,multiple:a,title:r,manualMapping:o,dynamicOptionInfo:n,defaultValue:p,defValueUnit:s,_frontId:m,isInit:i}=t,u={...e,placeholder:`请选择${r}`,manualMapping:o,dynamicOptionInfo:n,valueList:l,defValue:p,defValueUnit:s,_frontId:m,isInit:i};return a&&(u.multiple=!0),u},setDefaultValue:i}],[e.DATE,{component:n,props:{type:"date",clearable:!0,valueFormat:"yyyy-MM-dd"},handlerProps(e,t={}){const{title:l,rangeFilter:a}=t,r={...e,placeholder:`请选择${l}`};return a&&(r.type="daterange",r.startPlaceholder=`起始${l}`,r.endPlaceholder=`截止${l}`),r},setDefaultValue:(e,l)=>l&&l!==t.CUSTOM?m(l,"YYYY-MM-DD HH:mm:ss"):e}],[e.DATE_RANGE,{component:p,props:{type:"date",clearable:!0,valueFormat:"yyyy-MM-dd"},handlerProps(e,t={}){const{title:l,filterExplicit:a}=t;return{...e,filterExplicit:a,startPlaceholder:`起始${l}`,endPlaceholder:`截止${l}`}},setDefaultValue:i}],[e.DATE_TIME,{component:n,props:{type:"datetime",clearable:!0,valueFormat:"yyyy-MM-dd HH:mm:ss"},handlerProps(e,t={}){const{title:l,rangeFilter:a}=t,r={...e,placeholder:`请选择${l}`};return a&&(r.type="datetimerange",r.startPlaceholder=`起始${l}`,r.endPlaceholder=`截止${l}`),r},setDefaultValue:(e,l)=>l&&l!==t.CUSTOM?m(l,"YYYY-MM-DD HH:mm:ss"):e}],[e.DATETIME_RANGE,{component:p,props:{type:"datetime",clearable:!0,valueFormat:"yyyy-MM-dd HH:mm:ss"},handlerProps(e,t={}){const{title:l,filterExplicit:a}=t;return{...e,filterExplicit:a,startPlaceholder:`起始${l}`,endPlaceholder:`截止${l}`}},setDefaultValue:i}],[e.CHECKBOX_GROUP,{component:r,props:{},style:{"line-height":"32px"},handlerProps(e,{valueList:t,multiple:l}={}){const a={...e,multiple:l};return Array.isArray(t)&&(a.options=t.map((({value:e,label:t})=>({value:e,label:t})))),a},setDefaultValue:i}]]);export{u as WidgetCfgMaps};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WidgetOptionEnums as e,WidgetTypeEnums as t}from"../types/enums.js";import{presetValToTimestamp as i}from"../components/render-widget/helpers/presetValToTimestamp.js";import{DatePresetValEnums as n}from"../components/render-widget/enums.js";const l={[e.RADIO]:"0",[e.MULTIPLE]:"1",[e.ALL]:"0",[e.SELECT_TIME]:"1",[e.PAST_TIME]:"2",[e.FUTURE_TIME]:"3"};function a(){return{transformData:function(i){return i.map((i=>{var n,a;const{optionInfo:o={list:[],manualMapping:!0,dynamicOptionInfo:{}},type:u,defaultValue:r,optionType:s,filterExplicit:p,rangeFilter:d}=i,c={},m={title:(f=i).title,alias:f.customTitle,isShowSearch:f.isShowSearch?1:0,filterExplicit:f.filterExplicit?1:0,explicitRequired:f.explicitRequired?1:0,advanceOptionSetting:f.optionType?l[f.optionType]:"",placeholder:f.remark,advanceColWidth:f.width};var f;let
|
|
1
|
+
import{WidgetOptionEnums as e,WidgetTypeEnums as t}from"../types/enums.js";import{presetValToTimestamp as i}from"../components/render-widget/helpers/presetValToTimestamp.js";import{DatePresetValEnums as n}from"../components/render-widget/enums.js";const l={[e.RADIO]:"0",[e.MULTIPLE]:"1",[e.ALL]:"0",[e.SELECT_TIME]:"1",[e.PAST_TIME]:"2",[e.FUTURE_TIME]:"3"};function a(){return{transformData:function(i){return i.map((i=>{var n,a;const{optionInfo:o={list:[],manualMapping:!0,dynamicOptionInfo:{}},type:u,defaultValue:r,optionType:s,filterExplicit:p,rangeFilter:d}=i,c={},m={title:(f=i).title,alias:f.customTitle,isShowSearch:f.isShowSearch?1:0,filterExplicit:f.filterExplicit?1:0,explicitRequired:f.explicitRequired?1:0,advanceOptionSetting:f.optionType?l[f.optionType]:"",placeholder:f.remark,advanceColWidth:f.width};var f;let E,T,v=u;p?(E=u===t.SELECT&&s===e.MULTIPLE?null==r?void 0:r.valueList:null==(n=null==r?void 0:r.valueList)?void 0:n[0],T=null==r?void 0:r.unit):u===t.SELECT&&(null==o?void 0:o.list)&&(null==o?void 0:o.list.length)<10&&(v="CHECKBOX_GROUP"),d&&(u===t.INPUT_NUMBER&&(v="INPUTNUMBER_RANGE"),u===t.DATE&&(v="DATE_RANGE"),u===t.DATE_TIME&&(v="DATETIME_RANGE"));const g={isRender:!0,isInit:!1,widgetType:v,valueList:null==(a=null==o?void 0:o.list)?void 0:a.map((({name:e,value:t})=>({value:t,label:e}))),defaultValue:E,defValueUnit:T,multiple:s===e.MULTIPLE,manualMapping:null==o?void 0:o.manualMapping,dynamicOptionInfo:null==o?void 0:o.dynamicOptionInfo};return{...m,fieldType:i.dataType,columnName:i.name,settingObj:c,setting:JSON.stringify(c),widgetCfg:g,rangeFilter:d}}))},getCacheDef:function(e,i){const{widgetType:n,widgetCfg:l}=e;return n!==t.SELECT&&n!==t.CHECKBOX_GROUP||!l.multiple?i[0]:i},transformClassifyChild:function(e){const t={};return e&&e.length>0&&e.forEach((e=>{const l=e.field_key,a=e.value&&e.value.length>1?e.value:e.value.toString();if(t[l]=a,e.unit&&e.unit!==n.CUSTOM){const n=i(e.unit,"YYYY-MM-DD HH:mm:ss");t[l]=n}})),t},transformParams:function(e){const t={};return e&&e.length>0&&e.forEach((e=>{const i=e.field_key,n=e.value&&e.value.length>1?e.value:e.value.toString();t[i]=n})),t}}}export{a as default};
|
|
@@ -21,7 +21,9 @@ export declare const WidgetTypeEnums: {
|
|
|
21
21
|
DATE: string;
|
|
22
22
|
DATE_TIME: string;
|
|
23
23
|
CHECKBOX_GROUP: string;
|
|
24
|
-
|
|
24
|
+
INPUTNUMBER_RANGE: string;
|
|
25
|
+
DATE_RANGE: string;
|
|
26
|
+
DATETIME_RANGE: string;
|
|
25
27
|
};
|
|
26
28
|
export declare const WidgetOptionEnums: {
|
|
27
29
|
RADIO: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const T={TEXT:"TEXT",NUMBER:"NUMBER",DATE:"DATE",DATE_TIME:"DATETIME",TIME:"TIME",BOOLEAN:"BOOLEAN"},E={SQL:"SQL",API:"API"},A={MANUAL:"manual",DICT:"dict"},_={INPUT_NUMBER:"NUMBER",INPUT:"TEXT",SELECT:"SELECT",DATE:"DATE",DATE_TIME:"DATETIME",CHECKBOX_GROUP:"CHECKBOX_GROUP",
|
|
1
|
+
const T={TEXT:"TEXT",NUMBER:"NUMBER",DATE:"DATE",DATE_TIME:"DATETIME",TIME:"TIME",BOOLEAN:"BOOLEAN"},E={SQL:"SQL",API:"API"},A={MANUAL:"manual",DICT:"dict"},_={INPUT_NUMBER:"NUMBER",INPUT:"TEXT",SELECT:"SELECT",DATE:"DATE",DATE_TIME:"DATETIME",CHECKBOX_GROUP:"CHECKBOX_GROUP",INPUTNUMBER_RANGE:"INPUTNUMBER_RANGE",DATE_RANGE:"DATE_RANGE",DATETIME_RANGE:"DATETIME_RANGE"},R={RADIO:"SELECT_SINGLE",MULTIPLE:"SELECT_MULTIPLE",ALL:"DATETIME_WHOLE",SELECT_TIME:"DATETIME_SELECT",PAST_TIME:"DATETIME_PAST",FUTURE_TIME:"DATETIME_FUTURE"},N={CUSTOM:"CUSTOM",FIRST_VAL:"FIRST",NOW:"NOW",TODAY:"TODAY",TODAY_START:"TODAY_START",TODAY_END:"TODAY_END",TOMORROW:"TOMORROW",TOMORROW_START:"TOMORROW_START",TOMORROW_END:"TOMORROW_END",YESTERDAY:"YESTERDAY",YESTERDAY_START:"YESTERDAY_START",YESTERDAY_END:"YESTERDAY_END",THIS_WEEK:"THIS_WEEK",WEEK_START:"THIS_WEEK_START",WEEK_END:"THIS_WEEK_END",NEXT_WEEK:"NEXT_WEEK",LAST_WEEK:"LAST_WEEK",THIS_MONTH:"THIS_MONTH",MONTH_START:"THIS_MONTH_START",MONTH_END:"THIS_MONTH_END",NEXT_MONTH:"NEXT_MONTH",LAST_MONTH:"LAST_MONTH",THIS_QUARTER:"THIS_QUARTER",NEXT_QUARTER:"NEXT_QUARTER",LAST_QUARTER:"LAST_QUARTER",THIS_YEAR:"THIS_YEAR",NEXT_YEAR:"NEXT_YEAR",LAST_YEAR:"LAST_YEAR"},S={NULL:"NULL",EQUAL:"EQ"};export{S as ConditionEnums,E as DataTypeEnums,T as FieldTypeEnums,A as MappingMethodEnums,R as WidgetOptionEnums,_ as WidgetTypeEnums,N as WidgetValEnums};
|
package/es/env.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
2
|
-
|
|
3
|
-
interface ImportMetaEnv {
|
|
4
|
-
readonly VITE_APP_TYPE: string;
|
|
5
|
-
// 更多环境变量...
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface ImportMeta {
|
|
9
|
-
readonly env: ImportMetaEnv;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
declare module '*.vue' {
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
import type { App, defineComponent } from 'vue';
|
|
15
|
-
// // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
16
|
-
// // const component: DefineComponent<{}, {}, any>
|
|
17
|
-
const component: ReturnType<typeof defineComponent> & {
|
|
18
|
-
install(app: App): void;
|
|
19
|
-
};
|
|
20
|
-
// @ts-ignore
|
|
21
|
-
export default component;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare module '*.js';
|
|
25
|
-
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
interface ImportMetaEnv {
|
|
4
|
+
readonly VITE_APP_TYPE: string;
|
|
5
|
+
// 更多环境变量...
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface ImportMeta {
|
|
9
|
+
readonly env: ImportMetaEnv;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare module '*.vue' {
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
import type { App, defineComponent } from 'vue';
|
|
15
|
+
// // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
16
|
+
// // const component: DefineComponent<{}, {}, any>
|
|
17
|
+
const component: ReturnType<typeof defineComponent> & {
|
|
18
|
+
install(app: App): void;
|
|
19
|
+
};
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
export default component;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.js';
|
|
25
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
declare const draggableComponent: import('vue').DefineComponent<
|
|
2
|
+
{
|
|
3
|
+
list: {
|
|
4
|
+
type: ArrayConstructor;
|
|
5
|
+
required: boolean;
|
|
6
|
+
default: any;
|
|
7
|
+
};
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: ArrayConstructor;
|
|
10
|
+
required: boolean;
|
|
11
|
+
default: any;
|
|
12
|
+
};
|
|
13
|
+
itemKey: {
|
|
14
|
+
type: (FunctionConstructor | StringConstructor)[];
|
|
15
|
+
required: boolean;
|
|
16
|
+
};
|
|
17
|
+
clone: {
|
|
18
|
+
type: FunctionConstructor;
|
|
19
|
+
default: (original: any) => any;
|
|
20
|
+
};
|
|
21
|
+
tag: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
move: {
|
|
26
|
+
type: FunctionConstructor;
|
|
27
|
+
default: any;
|
|
28
|
+
};
|
|
29
|
+
componentData: {
|
|
30
|
+
type: ObjectConstructor;
|
|
31
|
+
required: boolean;
|
|
32
|
+
default: any;
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
unknown,
|
|
36
|
+
{
|
|
37
|
+
error: boolean;
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
realList(): any;
|
|
41
|
+
getKey(): any;
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
getUnderlyingVm(domElement: any): any;
|
|
45
|
+
getUnderlyingPotencialDraggableComponent(htmElement: any): any;
|
|
46
|
+
emitChanges(evt: any): void;
|
|
47
|
+
alterList(onList: any): void;
|
|
48
|
+
spliceList(): void;
|
|
49
|
+
updatePosition(oldIndex: any, newIndex: any): void;
|
|
50
|
+
getRelatedContextFromMoveEvent({ to, related }: { to: any; related: any }): any;
|
|
51
|
+
getVmIndexFromDomIndex(domIndex: any): any;
|
|
52
|
+
onDragStart(evt: any): void;
|
|
53
|
+
onDragAdd(evt: any): void;
|
|
54
|
+
onDragRemove(evt: any): void;
|
|
55
|
+
onDragUpdate(evt: any): void;
|
|
56
|
+
computeFutureIndex(relatedContext: any, evt: any): any;
|
|
57
|
+
onDragMove(evt: any, originalEvent: any): any;
|
|
58
|
+
onDragEnd(): void;
|
|
59
|
+
},
|
|
60
|
+
import('vue').ComponentOptionsMixin,
|
|
61
|
+
import('vue').ComponentOptionsMixin,
|
|
62
|
+
any[],
|
|
63
|
+
any,
|
|
64
|
+
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
|
|
65
|
+
Readonly<
|
|
66
|
+
{
|
|
67
|
+
move: Function;
|
|
68
|
+
tag: string;
|
|
69
|
+
clone: Function;
|
|
70
|
+
list: unknown[];
|
|
71
|
+
modelValue: unknown[];
|
|
72
|
+
componentData: Record<string, any>;
|
|
73
|
+
} & {
|
|
74
|
+
itemKey?: string | Function;
|
|
75
|
+
}
|
|
76
|
+
>,
|
|
77
|
+
{
|
|
78
|
+
move: Function;
|
|
79
|
+
tag: string;
|
|
80
|
+
clone: Function;
|
|
81
|
+
list: unknown[];
|
|
82
|
+
modelValue: unknown[];
|
|
83
|
+
componentData: Record<string, any>;
|
|
84
|
+
}
|
|
85
|
+
>;
|
|
86
|
+
export default draggableComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.43-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.43-beta.12",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.43-beta.12",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};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
type FixedSizeArray<T extends number, U> = T extends 0
|
|
2
|
+
? void[]
|
|
3
|
+
: ReadonlyArray<U> & {
|
|
4
|
+
0: U;
|
|
5
|
+
length: T;
|
|
6
|
+
};
|
|
7
|
+
type Measure<T extends number> = T extends 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ? T : never;
|
|
8
|
+
type Append<T extends any[], U> = {
|
|
9
|
+
0: [U];
|
|
10
|
+
1: [T[0], U];
|
|
11
|
+
2: [T[0], T[1], U];
|
|
12
|
+
3: [T[0], T[1], T[2], U];
|
|
13
|
+
4: [T[0], T[1], T[2], T[3], U];
|
|
14
|
+
5: [T[0], T[1], T[2], T[3], T[4], U];
|
|
15
|
+
6: [T[0], T[1], T[2], T[3], T[4], T[5], U];
|
|
16
|
+
7: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], U];
|
|
17
|
+
8: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], T[7], U];
|
|
18
|
+
}[Measure<T['length']>];
|
|
19
|
+
type AsArray<T> = T extends any[] ? T : [T];
|
|
20
|
+
|
|
21
|
+
declare class UnsetAdditionalOptions {
|
|
22
|
+
_UnsetAdditionalOptions: true;
|
|
23
|
+
}
|
|
24
|
+
type IfSet<X> = X extends UnsetAdditionalOptions ? {} : X;
|
|
25
|
+
|
|
26
|
+
type Callback<E, T> = (error: E | null, result?: T) => void;
|
|
27
|
+
type InnerCallback<E, T> = (error?: E | null | false, result?: T) => void;
|
|
28
|
+
|
|
29
|
+
type FullTap = Tap & {
|
|
30
|
+
type: 'sync' | 'async' | 'promise';
|
|
31
|
+
fn: Function;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type Tap = TapOptions & {
|
|
35
|
+
name: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type TapOptions = {
|
|
39
|
+
before?: string;
|
|
40
|
+
stage?: number;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
interface HookInterceptor<T, R, AdditionalOptions = UnsetAdditionalOptions> {
|
|
44
|
+
name?: string;
|
|
45
|
+
tap?: (tap: FullTap & IfSet<AdditionalOptions>) => void;
|
|
46
|
+
call?: (...args: any[]) => void;
|
|
47
|
+
loop?: (...args: any[]) => void;
|
|
48
|
+
error?: (err: Error) => void;
|
|
49
|
+
result?: (result: R) => void;
|
|
50
|
+
done?: () => void;
|
|
51
|
+
register?: (tap: FullTap & IfSet<AdditionalOptions>) => FullTap & IfSet<AdditionalOptions>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type ArgumentNames<T extends any[]> = FixedSizeArray<T['length'], string>;
|
|
55
|
+
|
|
56
|
+
declare class Hook<T, R, AdditionalOptions = UnsetAdditionalOptions> {
|
|
57
|
+
constructor(args?: ArgumentNames<AsArray<T>>, name?: string);
|
|
58
|
+
name: string | undefined;
|
|
59
|
+
taps: FullTap[];
|
|
60
|
+
intercept(interceptor: HookInterceptor<T, R, AdditionalOptions>): void;
|
|
61
|
+
isUsed(): boolean;
|
|
62
|
+
callAsync(...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
63
|
+
promise(...args: AsArray<T>): Promise<R>;
|
|
64
|
+
tap(options: string | (Tap & IfSet<AdditionalOptions>), fn: (...args: AsArray<T>) => R): void;
|
|
65
|
+
withOptions(options: TapOptions & IfSet<AdditionalOptions>): Omit<this, 'call' | 'callAsync' | 'promise'>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export class SyncHook<T, R = void, AdditionalOptions = UnsetAdditionalOptions> extends Hook<T, R, AdditionalOptions> {
|
|
69
|
+
call(...args: AsArray<T>): R;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export class SyncBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends SyncHook<T, R, AdditionalOptions> {}
|
|
73
|
+
export class SyncLoopHook<T, AdditionalOptions = UnsetAdditionalOptions> extends SyncHook<T, void, AdditionalOptions> {}
|
|
74
|
+
export class SyncWaterfallHook<T, AdditionalOptions = UnsetAdditionalOptions> extends SyncHook<
|
|
75
|
+
T,
|
|
76
|
+
AsArray<T>[0],
|
|
77
|
+
AdditionalOptions
|
|
78
|
+
> {}
|
|
79
|
+
|
|
80
|
+
declare class AsyncHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends Hook<T, R, AdditionalOptions> {
|
|
81
|
+
tapAsync(
|
|
82
|
+
options: string | (Tap & IfSet<AdditionalOptions>),
|
|
83
|
+
fn: (...args: Append<AsArray<T>, InnerCallback<Error, R>>) => void
|
|
84
|
+
): void;
|
|
85
|
+
tapPromise(options: string | (Tap & IfSet<AdditionalOptions>), fn: (...args: AsArray<T>) => Promise<R>): void;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export class AsyncParallelHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
|
|
89
|
+
T,
|
|
90
|
+
void,
|
|
91
|
+
AdditionalOptions
|
|
92
|
+
> {}
|
|
93
|
+
export class AsyncParallelBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
|
|
94
|
+
T,
|
|
95
|
+
R,
|
|
96
|
+
AdditionalOptions
|
|
97
|
+
> {}
|
|
98
|
+
export class AsyncSeriesHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
|
|
99
|
+
T,
|
|
100
|
+
void,
|
|
101
|
+
AdditionalOptions
|
|
102
|
+
> {}
|
|
103
|
+
export class AsyncSeriesBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
|
|
104
|
+
T,
|
|
105
|
+
R,
|
|
106
|
+
AdditionalOptions
|
|
107
|
+
> {}
|
|
108
|
+
export class AsyncSeriesLoopHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
|
|
109
|
+
T,
|
|
110
|
+
void,
|
|
111
|
+
AdditionalOptions
|
|
112
|
+
> {}
|
|
113
|
+
export class AsyncSeriesWaterfallHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
|
|
114
|
+
T,
|
|
115
|
+
AsArray<T>[0],
|
|
116
|
+
AdditionalOptions
|
|
117
|
+
> {}
|
|
118
|
+
|
|
119
|
+
type HookFactory<H> = (key: any, hook?: H) => H;
|
|
120
|
+
|
|
121
|
+
interface HookMapInterceptor<H> {
|
|
122
|
+
factory?: HookFactory<H>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export class HookMap<H> {
|
|
126
|
+
constructor(factory: HookFactory<H>, name?: string);
|
|
127
|
+
name: string | undefined;
|
|
128
|
+
get(key: any): H | undefined;
|
|
129
|
+
for(key: any): H;
|
|
130
|
+
intercept(interceptor: HookMapInterceptor<H>): void;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export class MultiHook<H> {
|
|
134
|
+
constructor(hooks: H[], name?: string);
|
|
135
|
+
name: string | undefined;
|
|
136
|
+
tap(options: string | Tap, fn?: Function): void;
|
|
137
|
+
tapAsync(options: string | Tap, fn?: Function): void;
|
|
138
|
+
tapPromise(options: string | Tap, fn?: Function): void;
|
|
139
|
+
}
|