cnhis-design-vue 3.1.42-beta.1 → 3.1.42-beta.10

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.
Files changed (142) hide show
  1. package/README.md +87 -87
  2. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  3. package/es/components/base-search/index.d.ts +0 -22
  4. package/es/components/base-search/src/index.vue.d.ts +0 -22
  5. package/es/components/base-search/src/index.vue.js +1 -1
  6. package/es/components/base-search/style/index.css +1 -1
  7. package/es/components/big-table/index.d.ts +3 -4
  8. package/es/components/big-table/src/BigTable.vue.d.ts +3 -4
  9. package/es/components/big-table/src/BigTable.vue2.js +1 -1
  10. package/es/components/big-table/style/index.css +1 -1
  11. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  12. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  13. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  14. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  15. package/es/components/button-print/index.d.ts +4 -4
  16. package/es/components/button-print/src/ButtonPrint.vue.d.ts +4 -4
  17. package/es/components/button-print/src/components/EditFormat.vue.d.ts +4 -4
  18. package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +4 -4
  19. package/es/components/classification/src/index.vue.js +1 -1
  20. package/es/components/date-picker/index.d.ts +5 -13
  21. package/es/components/date-picker/src/DatePicker.vue.d.ts +5 -13
  22. package/es/components/date-picker/src/DatePicker.vue.js +1 -1
  23. package/es/components/fabric-chart/index.d.ts +2 -2
  24. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +2 -2
  25. package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
  26. package/es/components/field-set/index.d.ts +84 -15
  27. package/es/components/field-set/src/FieldSet.vue.d.ts +80 -29
  28. package/es/components/field-set/src/types/index.d.ts +18 -0
  29. package/es/components/field-set/src/types/index.js +1 -0
  30. package/es/components/form-config/index.d.ts +24 -24
  31. package/es/components/form-config/src/FormConfig.vue.d.ts +24 -24
  32. package/es/components/form-config/src/FormConfig.vue.js +1 -1
  33. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +12 -12
  34. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +12 -12
  35. package/es/components/form-render/index.d.ts +12 -12
  36. package/es/components/form-render/index.js +1 -1
  37. package/es/components/form-render/src/FormRender.vue.d.ts +12 -12
  38. package/es/components/form-render/src/FormRender.vue.js +1 -1
  39. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +12 -12
  40. package/es/components/form-render/src/components/renderer/complex.d.ts +1 -1
  41. package/es/components/form-render/src/components/renderer/date.js +1 -1
  42. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -1
  43. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -1
  44. package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +2 -2
  45. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  46. package/es/components/form-render/src/components/renderer/select.js +1 -1
  47. package/es/components/form-render/src/hooks/index.d.ts +1 -1
  48. package/es/components/form-render/src/hooks/index.js +1 -1
  49. package/es/components/form-render/src/hooks/useFormAsyncQueue.d.ts +16 -0
  50. package/es/components/form-render/src/hooks/useFormAsyncQueue.js +1 -0
  51. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  52. package/es/components/form-render/src/types/index.d.ts +2 -1
  53. package/es/components/iho-table/index.d.ts +1523 -0
  54. package/es/components/iho-table/src/IhoTable.vue.d.ts +1523 -0
  55. package/es/components/iho-table/src/IhoTable.vue.js +1 -1
  56. package/es/components/iho-table/src/constants/index.d.ts +2 -1
  57. package/es/components/iho-table/src/constants/index.js +1 -1
  58. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -1
  59. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  60. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +3 -1
  61. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
  62. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -1
  63. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  64. package/es/components/iho-table/src/plugins/index.js +1 -1
  65. package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +1 -1
  66. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +5 -13
  67. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  68. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  69. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +1 -1
  70. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
  71. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +4 -10
  72. package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.d.ts +1 -0
  73. package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +1 -0
  74. package/es/components/iho-table/src/types/index.d.ts +1 -0
  75. package/es/components/iho-table/src/types/pluginType.d.ts +3 -1
  76. package/es/components/iho-table/src/utils/index.d.ts +1 -0
  77. package/es/components/iho-table/src/utils/index.js +1 -1
  78. package/es/components/iho-table/style/index.css +1 -1
  79. package/es/components/index.css +1 -1
  80. package/es/components/index.d.ts +1 -0
  81. package/es/components/index.js +1 -1
  82. package/es/components/info-header/index.d.ts +28 -28
  83. package/es/components/info-header/src/InfoHeader.vue.d.ts +28 -28
  84. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +3 -3
  85. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +3 -3
  86. package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.d.ts +2 -2
  87. package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue.d.ts +1 -1
  88. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +15 -15
  89. package/es/components/info-header/src/components/infoDescription/index.vue.js +1 -1
  90. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +12 -12
  91. package/es/components/info-header/style/index.css +1 -1
  92. package/es/components/keyboard/index.d.ts +1 -1
  93. package/es/components/keyboard/src/Keyboard.vue.d.ts +1 -1
  94. package/es/components/keyboard/src/Keyboard.vue.js +1 -1
  95. package/es/components/scale-view/src/ScaleView.vue.js +1 -1
  96. package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +1 -1
  97. package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
  98. package/es/components/select-person/index.d.ts +1 -1
  99. package/es/components/select-person/src/SelectPerson.vue.d.ts +1 -1
  100. package/es/components/shortcut-setter/index.d.ts +12 -12
  101. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +12 -12
  102. package/es/components/steps-wheel/src/StepsWheel.vue.js +1 -1
  103. package/es/components/table-filter/index.d.ts +0 -1
  104. package/es/components/table-filter/index.js +1 -1
  105. package/es/components/table-filter/src/components/classify-filter/index.vue.js +1 -1
  106. package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.d.ts +1 -1
  107. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +1 -1
  108. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  109. package/es/components/table-filter/src/hooks/useMixins.js +1 -1
  110. package/es/components/table-filter/src/tool/baseOptions.d.ts +0 -10
  111. package/es/components/table-filter/src/tool/baseOptions.js +1 -1
  112. package/es/components/table-filter/src/tool/generateDefOptions.d.ts +0 -7
  113. package/es/components/table-filter/src/tool/generateDefOptions.js +1 -1
  114. package/es/components/table-filter/src/types/index.d.ts +0 -74
  115. package/es/components/time-picker/index.d.ts +4 -10
  116. package/es/components/time-picker/src/TimePicker.vue.d.ts +4 -10
  117. package/es/components/time-picker/src/TimePicker.vue.js +1 -1
  118. package/es/env.d.ts +24 -24
  119. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  120. package/es/shared/hooks/index.d.ts +3 -0
  121. package/es/shared/hooks/index.js +1 -0
  122. package/es/{components/form-render/src → shared}/hooks/useAsyncQueue.d.ts +0 -14
  123. package/es/shared/hooks/useAsyncQueue.js +1 -0
  124. package/es/shared/hooks/useDateTime.d.ts +6 -0
  125. package/es/shared/hooks/useDateTime.js +1 -0
  126. package/es/shared/utils/tapable/index.d.ts +139 -0
  127. package/package.json +2 -2
  128. package/es/components/base-search/src/directive/resize.d.ts +0 -4
  129. package/es/components/base-search/src/directive/resize.js +0 -1
  130. package/es/components/base-search/src/tool/resizeSensor.d.ts +0 -16
  131. package/es/components/base-search/src/tool/resizeSensor.js +0 -1
  132. package/es/components/form-render/src/hooks/useAsyncQueue.js +0 -1
  133. package/es/components/table-filter/src/hooks/export.d.ts +0 -1
  134. package/es/components/table-filter/src/hooks/export.js +0 -1
  135. package/es/components/table-filter/src/tool/getWidgetType.d.ts +0 -1
  136. package/es/components/table-filter/src/tool/getWidgetType.js +0 -1
  137. package/es/shared/mixins/index.d.ts +0 -1
  138. package/es/shared/mixins/index.js +0 -1
  139. package/es/shared/utils/colorLog.d.ts +0 -31
  140. package/es/shared/utils/colorLog.js +0 -1
  141. /package/es/shared/{mixins → hooks}/useTheme.d.ts +0 -0
  142. /package/es/shared/{mixins → hooks}/useTheme.js +0 -0
@@ -1 +1 @@
1
- import{WidgetTypeEnums as l,WidgetOptionEnums as e,DataTypeEnums as a,WidgetValEnums as T}from"../types/enums.js";const E=[{label:"数字框",value:l.INPUT_NUMBER},{label:"文本框",value:l.INPUT},{label:"下拉框",value:l.SELECT},{label:"日期框",value:l.DATE},{label:"日期时间框",value:l.DATE_TIME}],u={[l.SELECT]:[{label:"单选",value:e.RADIO},{label:"多选",value:e.MULTIPLE}],[l.DATE_TIME]:[{label:"全部",value:e.ALL},{label:"选择时间",value:e.SELECT_TIME},{label:"过去时间",value:e.PAST_TIME},{label:"未来时间",value:e.FUTURE_TIME}]},b={[a.API]:{[l.DATE]:[{label:"今天",value:T.TODAY},{label:"明天",value:T.TOMORROW},{label:"昨天",value:T.YESTERDAY},{label:"本周初",value:T.WEEK_START},{label:"本周末",value:T.WEEK_END},{label:"本月初",value:T.MONTH_START},{label:"本月末",value:T.MONTH_END}],[l.DATE_TIME]:[{label:"当前时间",value:T.NOW},{label:"今天初",value:T.TODAY_START},{label:"今天末",value:T.TODAY_END},{label:"昨天初",value:T.YESTERDAY_START},{label:"昨天末",value:T.YESTERDAY_END},{label:"明天初",value:T.TOMORROW_START},{label:"明天末",value:T.TOMORROW_END},{label:"本周初",value:T.WEEK_START},{label:"本周末",value:T.WEEK_END},{label:"本月初",value:T.MONTH_START},{label:"本月末",value:T.MONTH_END}]},[a.SQL]:{[l.DATE_TIME]:[{label:"今天",value:T.TODAY},{label:"明天",value:T.TOMORROW},{label:"昨天",value:T.YESTERDAY},{label:"本周",value:T.THIS_WEEK},{label:"下周",value:T.NEXT_WEEK},{label:"上周",value:T.LAST_WEEK},{label:"本月",value:T.THIS_MONTH},{label:"下月",value:T.NEXT_MONTH},{label:"上月",value:T.LAST_MONTH},{label:"本季度",value:T.THIS_QUARTER},{label:"下季度",value:T.NEXT_QUARTER},{label:"上季度",value:T.LAST_QUARTER},{label:"本年",value:T.THIS_YEAR},{label:"下年",value:T.NEXT_YEAR},{label:"上年",value:T.LAST_YEAR}]}};export{u as widgetCfgOptions,E as widgetTypeOptions,b as widgetValOptions};
1
+ import{DataTypeEnums as l,WidgetTypeEnums as e,WidgetValEnums as a}from"../types/enums.js";const T={[l.API]:{[e.DATE]:[{label:"今天",value:a.TODAY},{label:"明天",value:a.TOMORROW},{label:"昨天",value:a.YESTERDAY},{label:"本周初",value:a.WEEK_START},{label:"本周末",value:a.WEEK_END},{label:"本月初",value:a.MONTH_START},{label:"本月末",value:a.MONTH_END}],[e.DATE_TIME]:[{label:"当前时间",value:a.NOW},{label:"今天初",value:a.TODAY_START},{label:"今天末",value:a.TODAY_END},{label:"昨天初",value:a.YESTERDAY_START},{label:"昨天末",value:a.YESTERDAY_END},{label:"明天初",value:a.TOMORROW_START},{label:"明天末",value:a.TOMORROW_END},{label:"本周初",value:a.WEEK_START},{label:"本周末",value:a.WEEK_END},{label:"本月初",value:a.MONTH_START},{label:"本月末",value:a.MONTH_END}]}};export{T as widgetValOptions};
@@ -1,10 +1,3 @@
1
- export declare const generateDefOptionsInSql: (widgetType: string, mappingConfig?: {
2
- mappingMethod: null;
3
- mapping: never[];
4
- }, optionSetting?: null) => {
5
- label: string;
6
- value: string;
7
- }[];
8
1
  export declare const generateDefOptionsInApi: (widgetType: string, mappingConfig?: {
9
2
  mappingMethod: null;
10
3
  mapping: never[];
@@ -1 +1 @@
1
- import{WidgetTypeEnums as T,MappingMethodEnums as n,WidgetValEnums as E,DataTypeEnums as r,WidgetOptionEnums as t}from"../types/enums.js";import{widgetValOptions as i}from"./baseOptions.js";import{isNil as l}from"./transformData.js";const e=(e,p={mappingMethod:null,mapping:[]},o=null)=>{var u,_;if(l(e))return[];if(e===T.SELECT){const{mapping:T,mappingMethod:r}=p;if(T&&r)return r===n.DICT?[{label:"默认选中第一项",value:E.FIRST_VAL}]:T}let A=null!=(_=null==(u=i[r.SQL])?void 0:u[e])?_:[];if(o===t.FUTURE_TIME){const T=[E.TODAY,E.TOMORROW,E.THIS_WEEK,E.NEXT_WEEK,E.THIS_MONTH,E.NEXT_MONTH,E.THIS_QUARTER,E.NEXT_QUARTER,E.THIS_YEAR,E.NEXT_YEAR];A=A.filter((({value:n})=>T.includes(n)))}if(o===t.PAST_TIME){const T=[E.TODAY,E.YESTERDAY,E.THIS_WEEK,E.LAST_WEEK,E.THIS_MONTH,E.LAST_MONTH,E.THIS_QUARTER,E.LAST_QUARTER,E.THIS_YEAR,E.LAST_YEAR];A=A.filter((({value:n})=>T.includes(n)))}return A},p=(n,E={mappingMethod:null,mapping:[]})=>{var t,e;if(l(n))return[];if(n===T.SELECT){const{mapping:T}=E;return T}return null!=(e=null==(t=i[r.API])?void 0:t[n])?e:[]};export{p as generateDefOptionsInApi,e as generateDefOptionsInSql};
1
+ import{WidgetTypeEnums as r,DataTypeEnums as n}from"../types/enums.js";import{widgetValOptions as t}from"./baseOptions.js";import{isNil as o}from"./transformData.js";const p=(p,m={mappingMethod:null,mapping:[]})=>{var i,s;if(o(p))return[];if(p===r.SELECT){const{mapping:r}=m;return r}return null!=(s=null==(i=t[n.API])?void 0:i[p])?s:[]};export{p as generateDefOptionsInApi};
@@ -113,19 +113,6 @@ export declare type ISaveType = {
113
113
  setting: any;
114
114
  conditionList: string;
115
115
  };
116
- export declare type ILabelItemListType = {
117
- allowCreateByPersonal: number;
118
- color: string;
119
- isPublic: string;
120
- isSelect: boolean;
121
- labelId: string;
122
- labelName: string;
123
- parentColor: string;
124
- parentId: string;
125
- parentType: string;
126
- typeId: string;
127
- typeName: string;
128
- };
129
116
  export declare type IClassifyListType = {
130
117
  displayCategory: string;
131
118
  isDefault: boolean;
@@ -174,70 +161,9 @@ export declare type IConditionMapType = {
174
161
  countTabCondition?: string;
175
162
  settingId?: string;
176
163
  };
177
- export declare type IbtnType = {
178
- buttonType: string;
179
- color: string;
180
- icon: string;
181
- id: string;
182
- isShow: number;
183
- name: string;
184
- setting: string;
185
- settingList: string;
186
- settingObj: IsettingObjType[];
187
- showStyle: string;
188
- sid: string;
189
- tableId: string;
190
- toggle: string;
191
- type: string;
192
- alias?: string;
193
- buttonRemark?: string;
194
- buttonGroup?: any;
195
- canHandleUniline?: boolean;
196
- chooseTwoData?: string;
197
- createdTime?: string;
198
- dataSource?: string;
199
- isButtonGroup?: boolean;
200
- isHide?: boolean;
201
- isImportGuage?: boolean;
202
- iconSetting?: string;
203
- isShowFoldGroupBtn?: boolean;
204
- isVisible?: boolean;
205
- printType?: any;
206
- quoteSetting?: string;
207
- showStyleSetting?: string;
208
- strategy?: string;
209
- updatedTime?: string;
210
- __printConfig?: any;
211
- };
212
- export declare type IsettingObjType = {
213
- obj_id: string;
214
- trigger_type: string;
215
- isTips: string;
216
- trigger_id?: string;
217
- trigger_name?: string;
218
- params?: IparamsType[];
219
- editAllRow?: number;
220
- tipsMsg?: any;
221
- newTitle?: string;
222
- display?: string;
223
- importComponentId?: string;
224
- importComponentName?: string;
225
- prevStepSetting?: any;
226
- linkShowType?: string;
227
- conditionExpression?: string;
228
- conditionParams?: any;
229
- };
230
- export declare type IparamsType = Record<'p_name' | 'p_value', string>;
231
164
  export declare type IsettingsType = {
232
165
  hideQuickSearch: number;
233
166
  };
234
- export declare type IeditTableWrapperItem = {
235
- options?: IeditTableWrapperDetail;
236
- };
237
- export declare type IeditTableWrapperDetail = {
238
- isButtonFolding?: boolean;
239
- extendParams?: any;
240
- };
241
167
  export declare type ICheckboxType = Record<'label' | 'value', string>;
242
168
  export declare type IApiServerType = {
243
169
  name: string;
@@ -3,16 +3,10 @@ declare const TimePicker: SFCWithInstall<import("vue").DefineComponent<{}, {
3
3
  attrs: {
4
4
  [x: string]: unknown;
5
5
  };
6
- emits: (event: "update:formattedValue", ...args: any[]) => void;
7
- timePickerRef: import("vue").Ref<null>;
8
- __formattedValue: import("vue").Ref<any>;
9
- keyupValue: import("vue").Ref<string>;
6
+ timePickerRef: import("vue").Ref<import("../../../es/shared/types").AnyObject | null>;
10
7
  formatRef: import("vue").ComputedRef<string>;
11
- updateFormattedValue: (value: any) => void;
12
- onBlur: () => void;
13
- onKeyUp: (event: import("../../../es/shared/types").AnyObject) => any;
8
+ focus: () => any;
9
+ blur: () => any;
14
10
  NTimePicker: any;
15
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formattedValue"[], "update:formattedValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
16
- "onUpdate:formattedValue"?: ((...args: any[]) => any) | undefined;
17
- }, {}>>;
11
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
18
12
  export default TimePicker;
@@ -3,16 +3,10 @@ declare const _default: import("vue").DefineComponent<{}, {
3
3
  attrs: {
4
4
  [x: string]: unknown;
5
5
  };
6
- emits: (event: "update:formattedValue", ...args: any[]) => void;
7
- timePickerRef: import("vue").Ref<null>;
8
- __formattedValue: import("vue").Ref<any>;
9
- keyupValue: import("vue").Ref<string>;
6
+ timePickerRef: import("vue").Ref<AnyObject | null>;
10
7
  formatRef: import("vue").ComputedRef<string>;
11
- updateFormattedValue: (value: any) => void;
12
- onBlur: () => void;
13
- onKeyUp: (event: AnyObject) => any;
8
+ focus: () => any;
9
+ blur: () => any;
14
10
  NTimePicker: any;
15
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formattedValue"[], "update:formattedValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
16
- "onUpdate:formattedValue"?: ((...args: any[]) => any) | undefined;
17
- }, {}>;
11
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
18
12
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as t,ref as u,computed as l,watch as a,openBlock as r,createBlock as o,unref as i,mergeProps as n,createSlots as v,renderList as m,withCtx as f,renderSlot as d}from"vue";import{NTimePicker as s}from"naive-ui";import{parse as c,isValid as p,format as _}from"date-fns";import k from"../../../_virtual/plugin-vue_export-helper.js";var P=k(e({__name:"TimePicker",emits:["update:formattedValue"],setup(e,{expose:k,emit:P}){const $=t(),b=u(null),x=u(),y=u(""),V=l((()=>$.format?$.format:"HH:mm:ss"));function g(e){P("update:formattedValue",e)}function H(){const e=c(y.value,V.value.replace(/:/,""),new Date);p(e)&&(x.value=_(e,V.value),g(x.value))}function T(e){var t,u;const{keyCode:l=0}=e;if(13==l)return null==(t=b.value)?void 0:t.blur();y.value=(null==(u=e.target)?void 0:u.value)||""}return a((()=>$["formatted-value"]),(e=>{x.value=e}),{immediate:!0}),k({$timePicker:b,focus:()=>{var e,t;return null==(t=null==(e=b.value)?void 0:e.focus)?void 0:t.call(e)},blur:()=>{var e,t;return null==(t=null==(e=b.value)?void 0:e.blur)?void 0:t.call(e)}}),(e,t)=>(r(),o(i(s),n({ref_key:"timePickerRef",ref:b},e.$attrs,{"formatted-value":x.value,"onUpdate:formattedValue":g,onBlur:H,onKeyup:T}),v({_:2},[m(e.$slots,((t,u)=>({name:u,fn:f((()=>[d(e.$slots,u)]))})))]),1040,["formatted-value"]))}}),[["__file","TimePicker.vue"]]);export{P as default};
1
+ import{defineComponent as e,useAttrs as r,ref as o,computed as s,openBlock as t,createBlock as i,unref as m,mergeProps as u,createSlots as a,renderList as f,withCtx as l,renderSlot as p}from"vue";import{NTimePicker as n}from"naive-ui";import"../../../shared/utils/index.js";import"lodash-es";import{useDateTime as _}from"../../../shared/hooks/useDateTime.js";import c from"../../../_virtual/plugin-vue_export-helper.js";var k=c(e({__name:"TimePicker",setup(e,{expose:c}){const k=r(),v=o(null),d=s((()=>k.format?k.format:"HH:mm:ss")),{focus:h,blur:x}=_(v,d);return c({$timePicker:v,focus:h,blur:x}),(e,r)=>(t(),i(m(n),u({ref_key:"timePickerRef",ref:v},e.$attrs),a({_:2},[f(e.$slots,((r,o)=>({name:o,fn:l((()=>[p(e.$slots,o)]))})))]),1040))}}),[["__file","TimePicker.vue"]]);export{k as default};
package/es/env.d.ts CHANGED
@@ -1,24 +1,24 @@
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';
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';
@@ -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;
@@ -0,0 +1,3 @@
1
+ export * from './useTheme';
2
+ export * from './useDateTime';
3
+ export * from './useAsyncQueue';
@@ -0,0 +1 @@
1
+ export{useTheme}from"./useTheme.js";export{useDateTime}from"./useDateTime.js";export{AsyncQueue}from"./useAsyncQueue.js";
@@ -1,11 +1,3 @@
1
- import { AnyObject, UndefinedAble } from '../../../../../es/shared/types';
2
- import { ComputedRef } from 'vue';
3
- import { FormAsyncQueueItem } from '../types';
4
- import { RequestInstance } from '../../../../../es/components/form-render';
5
- declare type ProcessorOption = Partial<{
6
- afterRequest(key: string, payload?: unknown): AnyObject[];
7
- beforeRequest(key: string, params?: unknown): UndefinedAble<AnyObject> | void;
8
- }>;
9
1
  interface EntryCallback {
10
2
  (err?: any, result?: any): void;
11
3
  }
@@ -38,10 +30,4 @@ export declare class AsyncQueue<T = any, K = any, R = any> {
38
30
  private _startProcess;
39
31
  private _handlerResult;
40
32
  }
41
- export declare function useAsyncQueue(requestInstance: ComputedRef<UndefinedAble<RequestInstance>>): {
42
- create: (parallelism?: number, option?: ProcessorOption) => AsyncQueue<FormAsyncQueueItem, any, {
43
- label: string;
44
- value: unknown;
45
- }[]>;
46
- };
47
33
  export {};
@@ -0,0 +1 @@
1
+ import{cloneDeep as s}from"lodash-es";class e{constructor(s,e,t){this.item=s,this.key=e,this.state=0,this.callback=t}}class t{constructor(s){this._list=s?Array.from(s):[]}enqueue(s){this._list.push(s)}dequeue(){return this._list.shift()}}class i{constructor({name:s,processor:e,getKey:i,parallelism:r}){this._queued=new t,this._entries=new Map,this._activeTasks=0,this._processingLock=!1,this._stopped=!1,this.name=s,this.processor=e,this.getKey=i,this.parallelism=r||100}add(t,i){if(this._stopped)return i(new Error("Queue was stopped"));const r=this.getKey(t);if(this._entries.has(r)){const e=this._entries.get(r);return void(1===e.state?setTimeout((()=>{i&&i(s(e.error),s(e.result))})):e.callbacks?e.callbacks.push(i):e.callbacks=[i])}const c=new e(t,r,i);this._entries.set(r,c),this._queued.enqueue(c),this._processingLock||(this._processingLock=!0,Promise.resolve().then(this._ensureProcessing.bind(this)))}addAsync(s){return new Promise(((e,t)=>{this.add(s,((s,i)=>{s&&t(s),e(i)}))}))}_ensureProcessing(){for(;this._activeTasks<this.parallelism;){const s=this._queued.dequeue();if(!s)break;this._activeTasks++,s.state=0,this._startProcess(s)}this._processingLock=!1}_startProcess(s){this.processor(s.item,((e,t)=>{e?this._handlerResult(s,e):this._handlerResult(s,e,t)}),(()=>this._entries.delete(s.key)))}_handlerResult(e,t,i){const r=e.callback;e.state=1,e.callback=void 0,e.result=s(i),e.error=s(t),this._activeTasks--,r&&r(t,i),e.callbacks&&e.callbacks.forEach((s=>s(t,i))),this._processingLock||(this._processingLock=!0,Promise.resolve().then(this._ensureProcessing.bind(this)))}}export{i as AsyncQueue};
@@ -0,0 +1,6 @@
1
+ import { Ref } from 'vue';
2
+ import { AnyObject } from '../../../es/shared/types';
3
+ export declare function useDateTime(datePickerRef: Ref<AnyObject | null>, formatRef: Ref<string>): {
4
+ focus: () => any;
5
+ blur: () => any;
6
+ };
@@ -0,0 +1 @@
1
+ import{computed as e,onMounted as t,onUnmounted as n}from"vue";import{useDebounceFn as l}from"@vueuse/core";function o(o,c){const u=l((e=>{!function(e){const t=e.target;if(["INPUT"].includes(t.tagName)){const{selectionStart:e=0,selectionEnd:n=0}=t;e===n&&t.select()}}(e)}),200),s=e((()=>{var e;return null==(e=o.value)?void 0:e.$el}));function r(e){const t=e.target;t.value&&Reflect.get(t,"_f_")&&(Reflect.set(t,"_f_",0),a(t,!0)&&(e.preventDefault(),e.stopPropagation()))}function i(e){const{key:t,target:n}=e;/\d/.test(t)&&n?Reflect.set(n,"_f_",1):"Enter"===t&&a(e.target,!1,!0)}function a(e,t,n){const l=e.value;if(!l)return;const o=e.selectionEnd||0,u=l.length;let s=0,r=0,i=0,a="",v=0;for(;s<u;){const e=l[s++];if(/\d/.test(e)&&(a+=e),s===o){i=a.length;const e=l.slice(s).match(/^\d+/);v=e?e[0].length:0}}const d=c.value;let f="",g=0,h=0;for(s=0;s<d.length&&(n||!(r>=a.length));){const e=d[s++];if(/[yMdHms]/.test(e)?f+=a[r++]||"0":f+=e,t&&r===i){i=-1,g=f.length,h=g;let e=d.slice(s).match(/^[yMdHms]+/);e?(v=Math.min(v,e[0].length),v&&(f+=a.slice(r,r+v),r+=v),s+=e[0].length):(e=d.slice(s).match(/^([^yMdHms]+)([yMdHms]*)/),e&&(g+=e[1].length,h=g+e[2].length))}}const m=f!==l;if(m){e.value=f;const t=new InputEvent("input");e.dispatchEvent(t)}return t&&(g=g||f.length+1,h=h||f.length+1,e.setSelectionRange(g,h)),m}return t((()=>{s.value&&(s.value.addEventListener("input",r,!0),s.value.addEventListener("keydown",i,!0),s.value.addEventListener("click",u,!0))})),n((()=>{s.value&&(s.value.removeEventListener("input",r,!0),s.value.removeEventListener("keydown",i,!0),s.value.removeEventListener("click",u,!0))})),{focus:()=>{var e,t;return null==(t=null==(e=o.value)?void 0:e.focus)?void 0:t.call(e)},blur:()=>{var e,t;return null==(t=null==(e=o.value)?void 0:e.blur)?void 0:t.call(e)}}}export{o as useDateTime};
@@ -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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.42-beta.1",
3
+ "version": "3.1.42-beta.10",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -61,5 +61,5 @@
61
61
  "iOS 7",
62
62
  "last 3 iOS versions"
63
63
  ],
64
- "gitHead": "6b2e7a963042d08e0a8707365e3078f6b1b57b36"
64
+ "gitHead": "01f897687a1f9ee175e4ea36f02546e49ed40d5b"
65
65
  }
@@ -1,4 +0,0 @@
1
- declare const Resize: {
2
- mounted(el: any, binding: any): void;
3
- };
4
- export default Resize;
@@ -1 +0,0 @@
1
- import o from"../tool/resizeSensor.js";import{useDebounceFn as e}from"@vueuse/core";const r={mounted(r,t){const s=t.value,m=e(s,10);new o(r,m)}};export{r as default};
@@ -1,16 +0,0 @@
1
- /**
2
- * Class for dimension change detection.
3
- *
4
- * @param {Element|Element[]} element
5
- * @param {Function} callback
6
- *
7
- * @constructor
8
- */
9
- declare class ResizeSensor {
10
- _isCollectionTyped: boolean;
11
- _element: any;
12
- constructor(element: any, callback: any);
13
- static detach(element: any): void;
14
- detach(): void;
15
- }
16
- export default ResizeSensor;
@@ -1 +0,0 @@
1
- const e=window.requestAnimationFrame||function(e){return window.setTimeout(e,20)};class t{constructor(e){let t;this.q=[],this.add=function(e){this.q.push(e)},this.call=function(){for(t=0;t<this.q.length;t++)this.q[t].call(this,e)}}}function s(s,i){if(s.resizedAttached){if(s.resizedAttached)return void s.resizedAttached.add(i)}else s.resizedAttached=new t(s),s.resizedAttached.add(i);s.resizeSensor=document.createElement("div"),s.resizeSensor.className="resize-sensor";const o="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden; opacity: 0;direction: ltr;",n="position: absolute; left: 0; top: 0; transition: 0s;";s.resizeSensor.style.cssText=o,s.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="'+o+'"><div style="'+n+'"></div></div><div class="resize-sensor-shrink" style="'+o+'"><div style="'+n+' width: 200%; height: 200%"></div></div>',s.appendChild(s.resizeSensor),"static"==function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null).getPropertyValue(t):e.style[t]}(s,"position")&&(s.style.position="relative");const l=s.resizeSensor.childNodes[0],r=l.childNodes[0],d=s.resizeSensor.childNodes[1],c=function(){r.style.width="100000px",r.style.height="100000px",l.scrollLeft=1e5,l.scrollTop=1e5,d.scrollLeft=1e5,d.scrollTop=1e5};c();let h=!1;const a=function(){s.resizedAttached&&(h&&(s.resizedAttached.call(),h=!1),e(a))};let u,f,p,z;e(a);const y=function(){(p=s.offsetWidth)==u&&(z=s.offsetHeight)==f||(h=!0,u=p,f=z),c()},v=function(e,t,s){e.attachEvent?e.attachEvent("on"+t,s):e.addEventListener(t,s)};v(l,"scroll",y),v(d,"scroll",y)}class i{constructor(e,t){const i=Object.prototype.toString.call(e);if(this._isCollectionTyped="[object Array]"===i||"[object NodeList]"===i||"[object HTMLCollection]"===i,this._element=e,this._isCollectionTyped)for(let i=0;i<e.length;i++)s(e[i],t);else s(e,t)}static detach(e){e.resizeSensor&&(e.removeChild(e.resizeSensor),delete e.resizeSensor,delete e.resizedAttached)}detach(){const e=this._isCollectionTyped,t=this._element;if(e)for(let e=0;e<t.length;e++)i.detach(t[e]);else i.detach(t)}}export{i as default};
@@ -1 +0,0 @@
1
- import{uuidGenerator as s}from"../../../../shared/utils/index.js";import{cloneDeep as e,isFunction as t}from"lodash-es";import{unref as r}from"vue";import"../../index.js";import{useCommonLog as i}from"./useCommonLog.js";import{useFormRequest as o}from"./useFormRequest.js";class a{constructor(s,e,t){this.item=s,this.key=e,this.state=0,this.callback=t}}class c{constructor(s){this._list=s?Array.from(s):[]}enqueue(s){this._list.push(s)}dequeue(){return this._list.shift()}}class n{constructor({name:s,processor:e,getKey:t,parallelism:r}){this._queued=new c,this._entries=new Map,this._activeTasks=0,this._processingLock=!1,this._stopped=!1,this.name=s,this.processor=e,this.getKey=t,this.parallelism=r||100}add(s,t){if(this._stopped)return t(new Error("Queue was stopped"));const r=this.getKey(s);if(this._entries.has(r)){const s=this._entries.get(r);return void(1===s.state?setTimeout((()=>{t&&t(e(s.error),e(s.result))})):s.callbacks?s.callbacks.push(t):s.callbacks=[t])}const i=new a(s,r,t);this._entries.set(r,i),this._queued.enqueue(i),this._processingLock||(this._processingLock=!0,Promise.resolve().then(this._ensureProcessing.bind(this)))}addAsync(s){return new Promise(((e,t)=>{this.add(s,((s,r)=>{s&&t(s),e(r)}))}))}_ensureProcessing(){for(;this._activeTasks<this.parallelism;){const s=this._queued.dequeue();if(!s)break;this._activeTasks++,s.state=0,this._startProcess(s)}this._processingLock=!1}_startProcess(s){this.processor(s.item,((e,t)=>{e?this._handlerResult(s,e):this._handlerResult(s,e,t)}),(()=>this._entries.delete(s.key)))}_handlerResult(s,t,r){const i=s.callback;s.state=1,s.callback=void 0,s.result=e(r),s.error=e(t),this._activeTasks--,i&&i(t,r),s.callbacks&&s.callbacks.forEach((s=>s(t,r))),this._processingLock||(this._processingLock=!0,Promise.resolve().then(this._ensureProcessing.bind(this)))}}function h(e){const{getHttpInstance:a}=o();return{create:function(o=3,c){return new n({name:"FormRenderAsyncQueue",parallelism:o,async processor({key:s,method:o="post",cache:n,params:h,url:l},u,p){var m,d;const _=null!=(m=r(e))?m:a();if(!_)return i().invalidHttpInstanceLog(),u(),void p();try{c&&t(c.beforeRequest)&&(h=null!=(d=c.beforeRequest(s,h))?d:{});let e=await _[o](l,h);c&&t(c.afterRequest)&&(e=c.afterRequest(s,e)),u(void 0,Array.isArray(e)?e:[]),!n&&p()}catch(s){u(new Error(`Request error => ${s}`)),p()}},getKey:({url:e,method:t="post",cache:r,params:i})=>r?e+t+JSON.stringify(i||{}):s()})}}}export{n as AsyncQueue,h as useAsyncQueue};
@@ -1 +0,0 @@
1
- export * from './useAdvanced';
@@ -1 +0,0 @@
1
- import"./useAdvanced.js";
@@ -1 +0,0 @@
1
- export declare const getWidgetTypeInSql: (fieldType: string, mappingConfig?: any) => string;
@@ -1 +0,0 @@
1
- import{WidgetTypeEnums as e,FieldTypeEnums as t}from"../types/enums.js";const r=(r,E={mappingMethod:null,mapping:[]})=>{switch(r){case t.NUMBER:return E.mappingMethod?e.SELECT:e.INPUT_NUMBER;case t.TEXT:return E.mappingMethod?e.SELECT:e.INPUT;case t.DATE_TIME:return e.DATE_TIME;case t.DATE:return e.DATE;default:return e.INPUT}};export{r as getWidgetTypeInSql};
@@ -1 +0,0 @@
1
- export * from './useTheme';
@@ -1 +0,0 @@
1
- export{useTheme}from"./useTheme.js";
@@ -1,31 +0,0 @@
1
- export declare enum LogsType {
2
- DEFAULT = "default",
3
- PRIMARY = "primary",
4
- SUCCESS = "success",
5
- WARNING = "warning",
6
- DANGER = "danger"
7
- }
8
- declare class Log {
9
- /**
10
- * @description 打印一个 [ title | text ] 样式的信息
11
- * @param {String} title title text
12
- * @param {String} info info text
13
- * @param {String} type style
14
- * @param {any[]} appendInfo
15
- */
16
- capsule(title: string, info: any, type?: LogsType, ...appendInfo: any[]): void;
17
- /**
18
- * @description 打印彩色文字
19
- */
20
- colorful(textArr: {
21
- text: any;
22
- type: LogsType;
23
- }[]): void;
24
- text(text: any): void;
25
- primary(text: any): void;
26
- success(text: any): void;
27
- warning(text: any): void;
28
- danger(text: any): void;
29
- }
30
- declare const log: Log;
31
- export default log;
@@ -1 +0,0 @@
1
- var r=(r=>(r.DEFAULT="default",r.PRIMARY="primary",r.SUCCESS="success",r.WARNING="warning",r.DANGER="danger",r))(r||{});function t(r="primary"){return{default:"#f5f5f5",primary:"#409EFF",success:"#67C23A",warning:"#E6A23C",danger:"#F56C6C"}[r]}const e=new class{capsule(r,e,a="primary",...o){console.log(`%c ${r} %c ${e} %c`,"background:#35495E; padding: 1px; border-radius: 3px 0 0 3px; color: #fff;",`background:${t(a)}; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;`,"background:transparent",...o)}colorful(r){console.log(`%c${r.map((r=>r.text||"")).join("%c")}`,...r.map((r=>`color: ${t(r.type)};`)))}text(r){this.colorful([{text:r,type:"default"}])}primary(r){this.colorful([{text:r,type:"primary"}])}success(r){this.colorful([{text:r,type:"success"}])}warning(r){this.colorful([{text:r,type:"warning"}])}danger(r){this.colorful([{text:r,type:"danger"}])}};export{r as LogsType,e as default};
File without changes
File without changes