cnhis-design-vue 3.1.57-beta.3 → 3.1.57-beta.32
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/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/button-print/index.d.ts +8 -8
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +8 -8
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/button-print/src/components/EditFormat.vue.d.ts +3 -3
- package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +7 -7
- package/es/components/button-print/style/index.css +1 -1
- package/es/components/calendar/index.d.ts +277 -0
- package/es/components/calendar/index.js +1 -0
- package/es/components/calendar/src/Calendar.vue.d.ts +266 -0
- package/es/components/calendar/src/Calendar.vue.js +1 -0
- package/es/components/calendar/src/Calendar.vue2.js +1 -0
- package/es/components/calendar/src/types/index.d.ts +6 -0
- package/es/components/calendar/src/types/index.js +1 -0
- package/es/components/calendar/style/index.css +1 -0
- package/es/components/callback/src/components/render/popupMaps.d.ts +259 -224
- package/es/components/classification/index.d.ts +3 -3
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +3 -3
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +3 -3
- package/es/components/classification/src/index.vue.d.ts +6 -3
- package/es/components/date-picker/index.d.ts +1 -1
- package/es/components/date-picker/src/DatePicker.vue.d.ts +1 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/drag-scroll/index.d.ts +2 -0
- package/es/components/drag-scroll/index.js +1 -0
- package/es/components/drag-scroll/src/index.d.ts +4 -0
- package/es/components/drag-scroll/src/index.js +1 -0
- package/es/components/drag-scroll/src/types.d.ts +19 -0
- package/es/components/drag-scroll/src/types.js +1 -0
- package/es/components/expand-field/index.d.ts +3 -3
- package/es/components/expand-field/src/components/form.vue.d.ts +3 -3
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/expand-field/src/index.vue.d.ts +3 -3
- package/es/components/fabric-chart/index.d.ts +4 -2
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +4 -2
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
- package/es/components/fabric-chart/src/constants/index.d.ts +2 -1
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +4 -3
- package/es/components/field-set/index.d.ts +107 -616
- package/es/components/field-set/index.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1680 -0
- package/es/components/field-set/src/FieldColor.vue.js +1 -0
- package/es/components/field-set/src/FieldColor.vue2.js +1 -0
- package/es/components/field-set/src/FieldSet.vue.d.ts +58 -16
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/Index.vue.d.ts +141 -0
- package/es/components/field-set/src/Index.vue.js +1 -0
- package/es/components/field-set/src/Index.vue2.js +1 -0
- package/es/components/field-set/src/components/Row.vue.d.ts +50 -9
- package/es/components/field-set/src/components/Row.vue2.js +1 -1
- package/es/components/field-set/src/components/condition.vue.d.ts +172 -0
- package/es/components/field-set/src/components/condition.vue.js +1 -0
- package/es/components/field-set/src/components/condition.vue2.js +1 -0
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1194 -0
- package/es/components/field-set/src/components/edit-dialog.vue.js +1 -0
- package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -0
- package/es/components/field-set/src/components/edit-filter.vue.d.ts +286 -0
- package/es/components/field-set/src/components/edit-filter.vue.js +1 -0
- package/es/components/field-set/src/components/edit-filter.vue2.js +1 -0
- package/es/components/field-set/src/constants/index.d.ts +55 -0
- package/es/components/field-set/src/constants/index.js +1 -0
- package/es/components/field-set/src/types/index.d.ts +31 -1
- package/es/components/field-set/src/utils/index.d.ts +2 -1
- package/es/components/field-set/src/utils/index.js +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +89 -30
- package/es/components/form-config/src/FormConfig.vue.d.ts +89 -30
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +31 -8
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +40 -11
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +8 -8
- package/es/components/form-config/src/constants/index.d.ts +1 -1
- package/es/components/form-config/src/types/index.d.ts +2 -2
- package/es/components/form-render/index.d.ts +31 -8
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +31 -8
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +31 -8
- package/es/components/form-render/src/components/renderer/combination/combination.d.ts +12 -0
- package/es/components/form-render/src/components/renderer/combination/combination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/jsonCombination.d.ts +12 -0
- package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/renderer/switch.js +1 -1
- package/es/components/form-render/src/hooks/index.d.ts +1 -0
- package/es/components/form-render/src/hooks/index.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +4 -2
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/hooks/useLowCodeReactions.d.ts +1 -1
- package/es/components/form-render/src/hooks/useNewLowCodeReactions.d.ts +6 -0
- package/es/components/form-render/src/hooks/useNewLowCodeReactions.js +1 -0
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
- package/es/components/form-render/src/types/index.d.ts +2 -1
- package/es/components/guide/src/renderer.d.ts +2 -2
- package/es/components/iho-table/index.d.ts +228 -216
- package/es/components/iho-table/src/IhoTable.vue.d.ts +228 -216
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -5
- package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +2 -1
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
- package/es/components/iho-table/src/plugins/{bindEventSettingPlugin/index.d.ts → bindEventSettingPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/bindEventSettingPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/{defaultConfigPlugin/index.d.ts → defaultConfigPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/dragScrollPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/dragScrollPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +4 -2
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/{keyboardEventPlugin/index.d.ts → keyboardEventPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/keyboardEventPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/{lowCodeFieldAdaptorPlugin/index.d.ts → lowCodeFieldAdaptorPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/{operationalFormPlugin/index.d.ts → operationalFormPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/operationalFormPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +32 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rowClickPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rowClickPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/rowDragPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rowDragPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/{varialbleHeightPlugin/index.d.ts → varialbleHeightPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/constants.d.ts +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/constants.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.d.ts +3 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/types.d.ts +8 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/types.js +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.d.ts +15 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.js +1 -0
- package/es/components/iho-table/src/plugins/{virtualTreePlugin/index.d.ts → virtualTreePlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/virtualTreePlugin.js +1 -0
- package/es/components/iho-table/src/types/index.d.ts +10 -1
- package/es/components/iho-table/src/types/pluginType.d.ts +3 -1
- package/es/components/iho-table/src/utils/index.d.ts +4 -7
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +3 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +74 -23
- package/es/components/info-header/src/InfoHeader.vue.d.ts +74 -23
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -1
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -1
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +33 -9
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +31 -8
- package/es/components/keyboard/index.d.ts +1 -1
- package/es/components/keyboard/src/Keyboard.vue.d.ts +1 -1
- package/es/components/quick-search/index.d.ts +3 -3
- package/es/components/quick-search/src/index.vue.d.ts +3 -3
- package/es/components/recommend-search/index.d.ts +6 -6
- package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +6 -6
- package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
- package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +1 -1
- package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +1 -1
- package/es/components/scale-view/index.d.ts +3 -3
- package/es/components/scale-view/src/ScaleView.vue.d.ts +3 -3
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +1 -1
- package/es/components/select-label/index.d.ts +2 -2
- package/es/components/select-label/src/LabelFormContent.vue.d.ts +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-label/src/SelectLabel.vue.d.ts +1 -1
- package/es/components/select-label/src/index.vue.d.ts +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +32 -8
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +32 -8
- package/es/components/table-export-field/index.d.ts +3 -3
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
- package/es/components/table-export-field/src/components/SaveProjectModal.vue.d.ts +3 -3
- package/es/components/table-export-field/src/index.vue.d.ts +3 -3
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +1 -1
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +2 -2
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +2 -2
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +2 -2
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +4 -4
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +4 -4
- package/es/components/time-line/index.d.ts +7 -7
- package/es/components/time-line/src/TimeLine.vue.d.ts +3 -3
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/hooks/selectHooks/useOptionFiltered.d.ts +3 -1
- package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -1
- package/es/shared/hooks/selectHooks/useSearchContent.d.ts +1 -1
- package/es/shared/hooks/selectHooks/useSearchContent.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +23 -3
- package/es/shared/utils/business.d.ts +2 -1
- package/es/shared/utils/business.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/index.d.ts +2 -1
- package/es/shared/utils/index.js +1 -1
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +8 -2
- package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/operationalFormPlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/rowClickPlugin/index.d.ts +0 -1
- package/es/components/iho-table/src/plugins/rowClickPlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/rowDragPlugin/index.d.ts +0 -1
- package/es/components/iho-table/src/plugins/rowDragPlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AnyObject, Nullable } from '../../../../../shared/types';
|
|
2
2
|
import { MaybeRef } from '@vueuse/core';
|
|
3
|
-
import { Ref } from 'vue';
|
|
4
3
|
import { VxeTableInstance } from 'vxe-table';
|
|
5
4
|
import { IhoTableHandlerContext, IhoTableConfig, IhoTableEmits, IhoTableFieldItem, IhoTableHandler, TableHooks } from '../../../../../components/iho-table/src/types';
|
|
6
5
|
export declare const createTableHooks: () => Readonly<{
|
|
@@ -13,10 +12,7 @@ export declare const createTableHooks: () => Readonly<{
|
|
|
13
12
|
exposeHooks: import("../../../../../components/iho-table/src/types").AbstractExposeHooks;
|
|
14
13
|
}>;
|
|
15
14
|
export declare function applyTableConfigHooks(hooks: TableHooks, config: IhoTableConfig, context: IhoTableHandlerContext): IhoTableConfig;
|
|
16
|
-
export declare function applyTableFieldHooks(hooks: TableHooks, fieldList: IhoTableFieldItem[], config: IhoTableConfig, context:
|
|
17
|
-
$table: Ref<Nullable<VxeTableInstance>>;
|
|
18
|
-
emits: IhoTableEmits;
|
|
19
|
-
}): IhoTableFieldItem[];
|
|
15
|
+
export declare function applyTableFieldHooks(hooks: TableHooks, fieldList: IhoTableFieldItem[], config: IhoTableConfig, context: IhoTableHandlerContext): IhoTableFieldItem[];
|
|
20
16
|
export declare function createTableEventHandlers({ hooks, config, $table, emits, context }: {
|
|
21
17
|
hooks: TableHooks;
|
|
22
18
|
config: MaybeRef<IhoTableConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as o}from"../../../../../shared/utils/index.js";import{cloneDeep as e,isArray as r}from"lodash-es";import{unref as
|
|
1
|
+
import{arrayed as o}from"../../../../../shared/utils/index.js";import{cloneDeep as e,isArray as r}from"lodash-es";import{unref as t,defineComponent as s}from"vue";import{VxeEventListenerNameList as n}from"../../constants/index.js";import{eventListener2EventName as i}from"../../utils/index.js";import{useConfigHooks as a}from"./useConfigHooks.js";import{useDataHooks as f}from"./useDataHooks.js";import{useDomInsertHooks as l}from"./useDomInsertHooks.js";import{useEventHooks as c}from"./useEventHooks.js";import{useExposeHooks as u}from"./useExposeHooks.js";import{useFieldHooks as d}from"./useFieldHooks.js";import{useSetupHooks as m}from"./useSetupHooks.js";const p=(()=>{let o=null;return()=>o||(o=Object.freeze({configHooks:a().create(),fieldHooks:d().create(),eventHooks:c().create(),dataHooks:f().create(),setupHooks:m().create(),domInsertHooks:l().create(),exposeHooks:u().create()}))})();function k(o,r,t){const s=o.configHooks.config.call(e(r),t);return["rowConfig","editConfig","columnConfig","resizableConfig","seqConfig","sortConfig","filterConfig","radioConfig","checkboxConfig","expandConfig","treeConfig","mouseConfig","menuConfig","keyboardConfig","scrollY","scrollX","editRules"].forEach((e=>{s[e]=o.configHooks[e].call(s[e],s,t)})),s}function H(t,s,n,i){t.fieldHooks.fieldStart.promise(n,i);let a=function e(s){return s.reduce(((s,a,f)=>{const l=[],c=[];let u=!1;return a=t.fieldHooks.field.call(a,{index:f,remove(){u=!0},insertAfter(e){c.push(...o(e))},insertBefore(e){l.push(...o(e))}},n,i),s.push(...l),u||(s.push(a),r(a.children)&&(a.children=e(a.children))),s.push(...c),s}),[])}(e(s));return a=t.fieldHooks.fieldList.call(a,n,i),t.fieldHooks.fieldEnd.promise(n,i),a}function h({hooks:o,config:e,$table:r,emits:s,context:a}){return n.reduce(((n,f)=>(n[f]=n=>function(n,f){var l;const c=i(n);s(c,f),null==(l=o.eventHooks[n])||l.promise(f,t(e),{$table:t(r),emits:s,...a})}(f,n),n)),{})}function g(e,r,s){return async n=>{e.dataHooks.dataStart.promise(t(r));let i=await n.reduce((async(n,i,a)=>{const f=[],l=[];let c=!1;await e.dataHooks.data.promise(i,t(r),{index:a,$table:s,insertBefore(e){f.push(...o(e))},insertAfter(e){l.push(...o(e))},remove(){c=!0}});const u=await n;return u.push(...f),!c&&u.push(i),u.push(...l),u}),Promise.resolve([]));return i=e.dataHooks.dataList.call(i,t(r)),e.dataHooks.dataEnd.promise(t(r)),i}}function C(o){return{header:s({name:"IhoTableHeader",render:()=>o.domInsertHooks.header.call([])}),footer:s({name:"IhoTableFooter",render:()=>o.domInsertHooks.footer.call([])})}}export{k as applyTableConfigHooks,H as applyTableFieldHooks,g as createDataTransfer,C as createDomInsertComponent,h as createTableEventHandlers,p as createTableHooks};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../../shared/types';
|
|
2
|
-
import { AsyncParallelHook, AsyncSeriesHook } from '../../../../../shared/utils/tapable';
|
|
2
|
+
import { AsyncParallelHook, AsyncSeriesHook, SyncWaterfallHook } from '../../../../../shared/utils/tapable';
|
|
3
3
|
import { AbstractDataHooks } from '../../../../../components/iho-table/src/types';
|
|
4
4
|
declare class TableDataHooks extends AbstractDataHooks {
|
|
5
5
|
readonly dataStart: AsyncParallelHook<[import("../../../../../components/iho-table/src/types").IhoTableConfig], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
@@ -11,6 +11,7 @@ declare class TableDataHooks extends AbstractDataHooks {
|
|
|
11
11
|
insertAfter(data: import("../../../../../shared/types").ArrayAble<AnyObject>): void;
|
|
12
12
|
}], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
13
13
|
readonly dataEnd: AsyncParallelHook<[import("../../../../../components/iho-table/src/types").IhoTableConfig], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
14
|
+
readonly dataList: SyncWaterfallHook<[AnyObject[], import("../../../../../components/iho-table/src/types").IhoTableConfig], import("../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
14
15
|
}
|
|
15
16
|
export declare function useDataHooks(): {
|
|
16
17
|
create: () => TableDataHooks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import
|
|
1
|
+
import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import t from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import a from"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import s from"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{AbstractDataHooks as o}from"../../types/pluginType.js";class e extends o{constructor(){super(...arguments),this.dataStart=new a(["config"]),this.data=new s(["rowData","context","config"]),this.dataEnd=new a(["config"]),this.dataList=new t(["dataList","config"])}}function r(){return{create:function(){return new e}}}export{r as useDataHooks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function bindEventSettingPlugin(): import("
|
|
1
|
+
export declare function bindEventSettingPlugin(): import("../../../../components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../../../shared/utils/index.js";import"../../index.js";import{isFunction as n}from"lodash-es";import{getBindEventSettingTrigger as t}from"../../../../shared/utils/business.js";import{defineTablePlugin as o}from"../hooks/useTablePlugin.js";function e(){const e="bindEventSettingPlugin";return o({name:e,apply(o){o.configHooks.config.tap(e,(o=>{const e=o.onFormChange;return o.onFormChange=function(o){var i;const{column:r,row:s}=o,u=null==(i=r.editRender)?void 0:i.props;if(u&&(null==u?void 0:u.bindEventSetting)){u.bindEventSetting.forEach((n=>{t(n.event_type)(n,{getter:n=>s[n],setter:(n,t)=>s[n]=t})}))}n(e)&&e(o)},o}))}})}export{e as bindEventSettingPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function defaultConfigPlugin(): import("
|
|
1
|
+
export declare function defaultConfigPlugin(): import("../../../../components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mergeWith as e,isObject as o}from"lodash-es";import{HIGHEST_PRIORITY as i}from"../constants/index.js";import{defineTablePlugin as t}from"../hooks/useTablePlugin.js";import{IhoTableStatusHelper as s}from"../utils/index.js";function n(){const n="defaultTablePlugin";return t({name:n,vxe(e){e.setup({zIndex:3e3})},apply(t){t.configHooks.config.tap({name:n,stage:i},(o=>{const i=e({border:!0,showSeq:!0,columnConfig:{resizable:!0},rowConfig:{height:36,useKey:!0,isHover:!0,isCurrent:!0,keyField:"theUniqueKey"},showOverflow:"title",showHeaderOverflow:"title",editConfig:{trigger:"click",mode:"cell"}},o,{height:o.height?"auto":void 0});return i.selectType=o.selectType||(s.isPositive(o.isBatchSelect)?"checkbox":s.isPositive(o.isSingleSelect)?"radio":void 0),i})),t.configHooks.mouseConfig.tap({name:n,stage:i},((e,i)=>o(i.keyboardConfig)?Object.assign({selected:!!i.keyboardConfig.isEdit},e):e))}})}export{n as defaultConfigPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dragScrollPlugin(): import("../../../../components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{findAncestor as e}from"../../../../shared/utils/index.js";import{noop as t}from"lodash-es";import{computed as l,unref as r,onBeforeUnmount as o}from"vue";import{useDragScroll as a}from"../../../drag-scroll/src/index.js";import"../../index.js";import{useUUIDMap as s}from"../utils/index.js";import{defineTablePlugin as u}from"../hooks/useTablePlugin.js";function n(){const e="dragScrollPlugin";return u({name:e,apply(u){const{getItemFromUUID:n,setItemFromUUID:m,removeItemFromUUID:c}=s((()=>t),!1);u.configHooks.config.tap(e,((e,{$table:t})=>!1!==e.dragScroll&&e.uuid?(m(e.uuid,a(e.uuid,{dragEle:l((()=>{var e;return r(null==(e=t.value)?void 0:e.getRefMaps().refElem)})),isDraggableEle(e){const{bodyEle:l,inEmptyArea:o}=function(e,t){const l=e.target,o="TD"===l.tagName||l.classList.contains("vxe-cell"),a=r(t);return a?{target:l,bodyEle:i(l,a),inEmptyArea:o}:{target:l,inEmptyArea:o,bodyEle:null}}(e,t);return!!l&&o},getScrollState:()=>t.value.getScroll(),setScrollState:(e,l)=>t.value.scrollTo(l.scrollLeft,l.scrollTop)})),e):e)),u.setupHooks.setup.tap(e,(e=>{o((()=>{var t;e.value.uuid&&(null==(t=n(e.value.uuid))||t(),c(e.value.uuid))}))}))}})}function i(t,l){const o=r(l.getRefMaps().refElem);let a=!1,s=!1,u=null;return e(t,(e=>(a||(a=e===o),s||(s=e.classList.contains("vxe-table--body-wrapper"),u=e),a&&s)))?u:null}export{n as dragScrollPlugin};
|
|
@@ -75,7 +75,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
75
75
|
focus: () => any;
|
|
76
76
|
blur: () => any;
|
|
77
77
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
78
|
-
onUpdateShow: (show: boolean) => void
|
|
78
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
79
79
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
80
80
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
81
81
|
NDatePicker: any;
|
|
@@ -18,7 +18,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
18
18
|
checkedRef: import("vue").WritableComputedRef<string[]>;
|
|
19
19
|
checkedCacheRef: import("vue").Ref<string[]>;
|
|
20
20
|
searchFilterText: import("vue").Ref<string>;
|
|
21
|
-
close: () => void
|
|
21
|
+
close: () => Promise<void>;
|
|
22
22
|
OPTION_ITEM_HEIGHT: number;
|
|
23
23
|
viewCapacity: import("vue").ComputedRef<number>;
|
|
24
24
|
filteredList: import("vue").ComputedRef<import("vxe-table").VxeTableDefines.FilterOption[]>;
|
|
@@ -40,8 +40,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
40
40
|
checkAll: import("vue").WritableComputedRef<boolean>;
|
|
41
41
|
indeterminate: import("vue").ComputedRef<boolean>;
|
|
42
42
|
containerStyleWithHeight: import("vue").ComputedRef<CSSProperties>;
|
|
43
|
-
|
|
43
|
+
confirm: () => void;
|
|
44
44
|
reset: () => void;
|
|
45
|
+
loading: import("vue").Ref<boolean>;
|
|
45
46
|
CancelRadio: import("vue").DefineComponent<{
|
|
46
47
|
currentValue: {};
|
|
47
48
|
cancelable: BooleanConstructor;
|
|
@@ -390,6 +391,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
390
391
|
readonly disabled: boolean | undefined;
|
|
391
392
|
readonly defaultValue: string | number | boolean | null;
|
|
392
393
|
}>;
|
|
394
|
+
NSpin: any;
|
|
393
395
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
394
396
|
payload: {
|
|
395
397
|
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as u,
|
|
1
|
+
import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as u,onMounted as i,toRaw as o,openBlock as r,createElementBlock as n,unref as v,createBlock as c,createCommentVNode as s,createElementVNode as d,createVNode as p,isRef as f,withCtx as h,mergeProps as m,normalizeProps as _,guardReactiveProps as y,Fragment as b,renderList as k,toDisplayString as g,createTextVNode as C,normalizeStyle as L}from"vue";import w from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{keywordMatcher as I,widthAppend as D}from"../../../../../shared/utils/index.js";import{useVirtualList as S}from"@vueuse/core";import{isNumber as U,isString as j,isFunction as x,isEqual as F}from"lodash-es";import{NInput as R,NCheckbox as W,NSpin as E,NCheckboxGroup as $,NRadioGroup as O,NButtonGroup as P,NButton as V}from"naive-ui";import{isVariableHeightTable as Y}from"../../utils/index.js";const q={class:"iho-table__filterWrapper"},z={key:1,class:"iho-table__filterCheckAllWrapper"},A={class:"iho-table__filterListItem"},H={class:"iho-table__filterListItem"},M=["title"],B=["title"],G={class:"iho-table__filterListItemContent"},J={class:"iho-table__filterFooter"};var K=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const K=e,N=l("$xetable"),Q=a((()=>{var e;return!!(null==(e=K.payload)?void 0:e.column.filterMultiple)})),T=a((()=>{var e,l,a;return null!=(a=null==(l=null==(e=K.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),X=a({get:()=>T.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),async set(e){if(!K.payload||!N)return;const l=N.reactData.filterStore.options||[];if(Q.value?(l.forEach((l=>l._checked=e.includes(l.value))),N.checkFilterOptions()):l.forEach((l=>l._checked=l.value===e[0])),!Y(N))return a();function a(){K.payload.$panel.confirmFilter(new CustomEvent("click"))}N.reactData.scrollYLoad=!0,a(),N.reactData.scrollYLoad=!1}}),Z=t([...X.value]),ee=t("");async function le(){N&&(N.reactData.filterStore.visible=!1)}u(le);const ae=a((()=>{var e,l;if(!K.payload||!K.payload.column)return 10;const{filterCapacity:a}=null!=(l=null==(e=K.payload.column.editRender)?void 0:e.props)?l:{};return U(a)&&a>0?a:10})),te=a((()=>ee.value?T.value.filter((e=>!!`${e.label}`.includes(ee.value)||(j(e.data)?I(ee.value,e.data):void 0))):T.value)),{list:ue,containerProps:ie,wrapperProps:oe}=S(te,{itemHeight:32,overscan:3}),re=a({get:()=>te.value.every((e=>Z.value.includes(e.value))),set(e){Z.value=e?[...new Set([...Z.value,...te.value.map((e=>e.value))])]:Z.value.filter((e=>te.value.every((l=>l.value!==e))))}}),ne=a((()=>te.value.some((e=>Z.value.includes(e.value)))&&!re.value)),ve=a({get:()=>Z.value.length===T.value.length&&0!==T.value.length,set:e=>{Z.value=e?T.value.map((e=>e.value)):[]}}),ce=a((()=>!!Z.value.length&&!ve.value)),se=a((()=>({height:D(32*ae.value)})));function de(){X.value=Q.value?Z.value:F(Z.value[0],null)?[]:[Z.value[0]],le()}function pe(){Z.value=Q.value?[]:[null]}const fe=t(!1);return i((async()=>{var e;if(!N)return;const l=null==(e=K.payload.column.editRender.props)?void 0:e.onFilterShow;if(x(l))try{fe.value=!0,await l(K.payload);const{filterStore:e}=N.reactData;o(e.options)!==o(T.value)&&(e.options=T.value)}finally{fe.value=!1}})),(e,l)=>(r(),n("section",q,[v(T).length>5?(r(),c(v(R),{key:0,value:ee.value,"onUpdate:value":l[0]||(l[0]=e=>ee.value=e)},null,8,["value"])):s("v-if",!0),v(Q)?(r(),n("div",z,[d("div",A,[p(v(W),{label:"全选当前",checked:v(re),"onUpdate:checked":l[1]||(l[1]=e=>f(re)?re.value=e:null),indeterminate:v(ne)},null,8,["checked","indeterminate"])]),d("div",H,[p(v(W),{label:"全选所有",checked:v(ve),"onUpdate:checked":l[2]||(l[2]=e=>f(ve)?ve.value=e:null),indeterminate:v(ce)},null,8,["checked","indeterminate"])])])):s("v-if",!0),p(v(E),{show:fe.value},{default:h((()=>[v(Q)?(r(),c(v($),{key:0,value:Z.value,"onUpdate:value":l[3]||(l[3]=e=>Z.value=e)},{default:h((()=>[d("section",m(v(ie),{style:v(se),class:"iho-table__filterListWrapper"}),[d("section",_(y(v(oe))),[(r(!0),n(b,null,k(v(ue),(e=>(r(),n("div",{class:"iho-table__filterListItem",key:e.data.value},[p(v(W),{value:e.data.value},{default:h((()=>[d("div",{class:"iho-table__filterListItemContent",title:e.data.label},g(e.data.label),9,M)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])):(r(),c(v(O),{key:1,value:Z.value[0],"onUpdate:value":l[5]||(l[5]=e=>Z.value[0]=e)},{default:h((()=>[d("section",m(v(ie),{style:v(se),class:"iho-table__filterListWrapper"}),[d("section",_(y(v(oe))),[(r(!0),n(b,null,k(v(ue),(e=>(r(),n("div",{class:"iho-table__filterListItem",key:e.data.value,title:e.data.label},[p(v(w),{value:e.data.value,currentValue:Z.value[0],cancelable:"",onCancel:l[4]||(l[4]=e=>Z.value=[null])},{default:h((()=>[d("div",G,g(e.data.label),1)])),_:2},1032,["value","currentValue"])],8,B)))),128))],16)],16)])),_:1},8,["value"]))])),_:1},8,["show"]),d("footer",J,[d("section",null,[v(Q)?(r(),n(b,{key:0},[C(" 已选择 "),d("span",{style:L({color:"var(--c-primary-color)"})},g(Z.value.length),5),C(" 项 ")],64)):s("v-if",!0)]),p(v(P),{size:"small"},{default:h((()=>[p(v(V),{onClick:pe},{default:h((()=>[C("清空")])),_:1}),p(v(V),{onClick:le},{default:h((()=>[C("取消")])),_:1}),p(v(V),{type:"primary",onClick:de},{default:h((()=>[C("确定")])),_:1})])),_:1})])]))}});export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useAttrs as
|
|
1
|
+
import{useAttrs as e,onBeforeUnmount as t,inject as l,createVNode as o}from"vue";import{arrayed as n,widthAppend as a}from"../../../../shared/utils/index.js";import{isObject as r,isString as i,isFunction as s}from"lodash-es";import u from"../../../annotation-edit/index.js";import"../../index.js";import{InjectionIhoTableAnnotation as d,InjectionIhoTableConfig as m}from"../constants/index.js";import{getLowCodeFieldFromField as c,IhoTableRenderHelper as h}from"../utils/index.js";import{defineTablePlugin as p}from"../hooks/useTablePlugin.js";function f(){const f="headerPlugin";return p({name:f,apply(p){let v=null;p.setupHooks.setup.tap(f,(()=>{v=e(),t((()=>{v=null}))})),p.fieldHooks.field.tap(f,(e=>{var t;const p=null==(t=e.slots)?void 0:t.header;return e.slots={...e.slots,header:t=>function(e,t,c){var p;const f=l(d),x=l(m),b=l("$xetable"),j=e.column||{},g=r(null==f?void 0:f.value)&&!1!==t.annotation,w=h.isEditableColumn(x.value,j),W=h.hasFilter(t)||h.hasDateFiler(t),k=null==(p=t.titlePrefix)?void 0:p.content,y=i(c)?c:s(c)?c(e):null;let D=!1;if(x.value){const e=x.value.editRules&&x.value.editRules[j.field];e&&(D=n(e).some((e=>e.required)))}const M=x.value.border?Math.max(2,Math.ceil(b.reactData.scrollbarWidth/b.reactData.tableColumn.length)):1,P=a(Math.max(0,j.renderWidth-20-M-(D?14:0)-(g?18:0)-(W?23:0)-(w?22:0)-(k?20:0)-(j.sortable?23:0)));return o("section",{class:"iho-table__headerWrapper"},[o("section",{style:{width:P}},[null!=y?y:o("div",{style:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},[function(){const e=j.title,t=/\\n|\n|\r/g;if(!t.test(e))return e;const l=e.replace(t,"<br>").split("<br>");return l.map(((e,t)=>[e,t===l.length-1?null:o("br",null,null)]))}()])]),g?o(u,{modelValue:f.value[j.field],"onUpdate:modelValue":e=>f.value[j.field]=e,shortcuts:v&&(v["annotation-shortcuts"]||v.annotationShortcuts)||[]},null):null])}(t,c(e),p)},e}))}})}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin
|
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin.js";import*as i from"./colorAndIconPlugin.js";import*as n from"./copyPastePlugin.js";import*as s from"./defaultConfigPlugin.js";import*as t from"./defaultValuePlugin.js";import*as l from"./dragScrollPlugin.js";import*as d from"./filterDaterangeRenderPlugin/index.js";import*as g from"./filterRenderPlugin/index.js";import*as o from"./filterVisibleEventPlugin.js";import*as u from"./forceArrowKeyPlugin.js";import*as a from"./headerPlugin.js";import*as P from"./highLightSetPlugin.js";import*as m from"./keyboardEventPlugin.js";import*as f from"./lowCodeFieldAdaptorPlugin.js";import*as p from"./maxCheckSizePlugin.js";import*as x from"./operationalFormPlugin.js";import*as j from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as b from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as c from"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js";import*as R from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as w from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as h from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as W from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as v from"./rendererPlugins/editableWidgets/switchRendererPlugin.js";import*as S from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as k from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as C from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as y from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as A from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as E from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as D from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as F from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as T from"./rowClickPlugin.js";import*as V from"./rowDragPlugin.js";import*as q from"./rowGroupSettingPlugin/index.js";import*as z from"./varialbleHeightPlugin.js";import*as G from"./verticalTablePlugin/index.js";import*as H from"./virtualTreePlugin.js";import*as I from"./wordbookSettingPlugin.js";import{separateMetaModule as K}from"../../../../shared/utils/index.js";var L=K(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin.ts":r,"./colorAndIconPlugin.ts":i,"./copyPastePlugin.ts":n,"./defaultConfigPlugin.ts":s,"./defaultValuePlugin.ts":t,"./dragScrollPlugin.ts":l,"./filterDaterangeRenderPlugin/index.tsx":d,"./filterRenderPlugin/index.tsx":g,"./filterVisibleEventPlugin.ts":o,"./forceArrowKeyPlugin.ts":u,"./headerPlugin.tsx":a,"./highLightSetPlugin.tsx":P,"./keyboardEventPlugin.ts":m,"./lowCodeFieldAdaptorPlugin.tsx":f,"./maxCheckSizePlugin.ts":p,"./operationalFormPlugin.ts":x,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":j,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":b,"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.tsx":c,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":R,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":w,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":h,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":W,"./rendererPlugins/editableWidgets/switchRendererPlugin.tsx":v,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":S,"./rendererPlugins/widgets/checkRendererPlugin.tsx":k,"./rendererPlugins/widgets/colorRendererPlugin.tsx":C,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":y,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":A,"./rendererPlugins/widgets/labelRendererPlugin.tsx":E,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":D,"./rendererPlugins/widgets/seqRendererPlugin.tsx":F,"./rowClickPlugin.ts":T,"./rowDragPlugin.ts":V,"./rowGroupSettingPlugin/index.ts":q,"./varialbleHeightPlugin.tsx":z,"./verticalTablePlugin/index.ts":G,"./virtualTreePlugin.ts":H,"./wordbookSettingPlugin.ts":I}));export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function keyboardEventPlugin(): import("
|
|
1
|
+
export declare function keyboardEventPlugin(): import("../../../../components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{promiseTimeout as e}from"@vueuse/shared";import"../../index.js";import{defineTablePlugin as o}from"../hooks/useTablePlugin.js";function t(){const t="keyboardEventPlugin";return o({name:t,apply(o){o.eventHooks.onKeydown.tap(t,(async({$event:o,$table:t},n,{emits:r})=>{await e(0);const{row:a,column:i}=t.getSelectedCell()||t.getEditRecord()||{};if(!a||!i)return;r("keyboard",{$table:t,key:o.key,index:t.getRowIndex(a),value:a[i.field],row:a,column:i})}))}})}export{t as keyboardEventPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function lowCodeFieldAdaptorPlugin(): import("
|
|
1
|
+
export declare function lowCodeFieldAdaptorPlugin(): import("../../../../components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isObject as e,isFunction as t,cloneDeep as i}from"lodash-es";import{toRaw as o,h as l}from"vue";import{HIGHEST_PRIORITY as s,IHO_TABLE_FIXED_STATUS as n,WIDGET_TYPE as d}from"../constants/index.js";import{defineTablePlugin as r}from"../hooks/useTablePlugin.js";import{getDefaultValue as a}from"./rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";import{IhoTableStatusHelper as f,IhoTableUtils as c}from"../utils/index.js";function m(){const m="lowCodeFieldAdaptorPlugin";return r({name:m,apply(r){r.fieldHooks.field.tap({name:m,stage:s},((s,r,m)=>{const p=s,u={className:p.bold?"iho-table__boldCell":"",field:p.columnName,showOverflow:"ellipsis",visible:f.notNegative(p.isShow),minWidth:p.colWidth,sortable:f.isPositive(p.isSort),fixed:n[p.isFixed],...p,title:p.alias||p.title};return function(e,i){const o={default:i.slotFn,header:i.headerSlotFn,edit:i.editSlotFn,footer:i.footerSlotFn,...i.slots};if(t(i.checkEditStatus)){const{default:e}=o;t(e)&&(o.default=t=>i.checkEditStatus(t)?e(t):[l("span",null,a(t.row,t.column.editRender.props))])}e.slots=o}(u,p),function(l,s,n){var r,a;const m=i(o(s));m.componentProps={size:"mini"===n.size?"small":n.size,...m.componentProps},n.forceClearable&&(m.componentProps.clearable=!0);l.editRender={name:c.getCellType(s),...l.editRender,props:m},l.editRender.enabled=!Reflect.get(d,l.editRender.name),!l.editRender.enabled&&t(null==(r=l.slots)?void 0:r.default)&&(l.editRender.enabled=t(null==(a=l.slots)?void 0:a.edit));if(!e(s.settingObj))return;Reflect.has(s.settingObj,"isHide")&&(l.visible=l.visible&&f.notPositive(s.settingObj.isHide))}(u,p,m),u})),r.fieldHooks.field.tap({name:m+"After",stage:1e3},(t=>(e(t.slots)&&Object.entries(t.slots).forEach((([e,i])=>{null==i&&Reflect.deleteProperty(t.slots,e)})),t)))}})}export{m as lowCodeFieldAdaptorPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function operationalFormPlugin(): import("
|
|
1
|
+
export declare function operationalFormPlugin(): import("../../../../components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../../../shared/utils/index.js";import{format as o}from"date-fns";import"../../index.js";import{isFunction as n,isNumber as t,isDate as e}from"lodash-es";import{EDITABLE_WIDGET_TYPE as r}from"../constants/index.js";import{getLowCodeFieldFromField as i,IhoTableUtils as s}from"../utils/index.js";import{getOperationalFormHandler as a,getDateOperationalFormHandler as m}from"../../../../shared/utils/business.js";import{defineTablePlugin as l}from"../hooks/useTablePlugin.js";function u(){const u="operationalFormPlugin";return l({name:u,apply(l){l.configHooks.config.tap(u,(l=>{const u=l.onFormChange;return l.onFormChange=function(d){const{column:p,row:f,$table:c}=d;!function(n,u){const{operationalFormHandler:d}=a(l.operationalForm||l.operationForm,(o=>n[o]),((o,t)=>{u.getColumns().some((n=>n.field===o))&&(n[o]=t)})),{dateOperationalFormHandler:p}=m(l.dateOperationalForm,(o=>n[o]),((a,m)=>{const l=u.getColumns().find((o=>o.field===a));if(!l)return;const d=i(l);d&&[r.DATE,r.TIME].includes(s.getCellType(d))&&(m=t(m)||e(m)?o(new Date(m),d.valueFormat||"yyyy-MM-dd HH:mm:ss"):null),n[a]=m}));return function(o){d(o),p(o)}}(f,c)(p.field),n(u)&&u(d)},l}))}})}export{u as operationalFormPlugin};
|
|
@@ -30,6 +30,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
30
|
type: StringConstructor;
|
|
31
31
|
default: string;
|
|
32
32
|
};
|
|
33
|
+
isDateDisabled: {
|
|
34
|
+
type: PropType<(current: number, row: AnyObject) => boolean>;
|
|
35
|
+
};
|
|
36
|
+
isTimeDisabled: {
|
|
37
|
+
type: PropType<(current: number, row: AnyObject) => {
|
|
38
|
+
isHourDisabled: boolean;
|
|
39
|
+
isMinuteDisabled: boolean;
|
|
40
|
+
isSecondDisabled: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
33
43
|
}, {
|
|
34
44
|
attr: AnyObject;
|
|
35
45
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -61,6 +71,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
61
71
|
type: StringConstructor;
|
|
62
72
|
default: string;
|
|
63
73
|
};
|
|
74
|
+
isDateDisabled: {
|
|
75
|
+
type: PropType<(current: number, row: AnyObject) => boolean>;
|
|
76
|
+
};
|
|
77
|
+
isTimeDisabled: {
|
|
78
|
+
type: PropType<(current: number, row: AnyObject) => {
|
|
79
|
+
isHourDisabled: boolean;
|
|
80
|
+
isMinuteDisabled: boolean;
|
|
81
|
+
isSecondDisabled: boolean;
|
|
82
|
+
}>;
|
|
83
|
+
};
|
|
64
84
|
}>> & {
|
|
65
85
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
66
86
|
}>>;
|
|
@@ -73,7 +93,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
73
93
|
timePickerProps: {
|
|
74
94
|
format: string | undefined;
|
|
75
95
|
};
|
|
76
|
-
isDateDisabled: (ts: number) =>
|
|
96
|
+
isDateDisabled: (ts: number) => boolean;
|
|
77
97
|
isTimeDisabled: ((ts: number) => any) | undefined;
|
|
78
98
|
type: any;
|
|
79
99
|
clearable: boolean;
|
|
@@ -142,7 +162,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
142
162
|
focus: () => any;
|
|
143
163
|
blur: () => any;
|
|
144
164
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
145
|
-
onUpdateShow: (show: boolean) => void
|
|
165
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
146
166
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
147
167
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
148
168
|
NDatePicker: any;
|
|
@@ -196,6 +216,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
196
216
|
type: StringConstructor;
|
|
197
217
|
default: string;
|
|
198
218
|
};
|
|
219
|
+
isDateDisabled: {
|
|
220
|
+
type: PropType<(current: number, row: AnyObject) => boolean>;
|
|
221
|
+
};
|
|
222
|
+
isTimeDisabled: {
|
|
223
|
+
type: PropType<(current: number, row: AnyObject) => {
|
|
224
|
+
isHourDisabled: boolean;
|
|
225
|
+
isMinuteDisabled: boolean;
|
|
226
|
+
isSecondDisabled: boolean;
|
|
227
|
+
}>;
|
|
228
|
+
};
|
|
199
229
|
}>> & {
|
|
200
230
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
201
231
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as t,inject as i,ref as n,computed as r,openBlock as l,createBlock as
|
|
1
|
+
import{defineComponent as e,useAttrs as t,inject as i,ref as n,computed as r,openBlock as l,createBlock as a,unref as o,mergeProps as s,isRef as u}from"vue";import{generateTimeFormat as d}from"../../../../../../../shared/utils/index.js";import{isFunction as c}from"lodash-es";import{useIhoTableFormEvent as m}from"../../../../utils/index.js";import D from"../../../../../../date-picker/index.js";var f=e({__name:"editDate",props:{value:{type:String,default:null},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},isStartDate:{type:Boolean,default:!1},isEndDate:{type:Boolean,default:!1},connectField:{type:String,default:"-_-"},isDateDisabled:{type:Function},isTimeDisabled:{type:Function}},emits:["update:value"],setup(e,{emit:f}){const p=e,v=t(),w=i("$xetable"),{emitFormChangeWithParams:b}=m({...p,$table:w}),F=n(),g=r({get:()=>p.value?p.value:null,set(e){const t=p.value;if(t===e)return;const{isDateDisabled:i,isTimeDisabled:n}=y.value;if(e){const t=Date.parse(e);if(i(t))return;const{isHourDisabled:r,isMinuteDisabled:l,isSecondDisabled:a}=(null==n?void 0:n(t))||{},{h:o,m:s,s:u}=h(new Date(e)),d=null==r?void 0:r(o),c=null==l?void 0:l(s,o),m=null==a?void 0:a(u,s,o);if(d||c||m)return}f("update:value",e),b({oldValue:t})}}),y=r((()=>{const{valueFormat:e,format:t,type:i="datetime"}=v;return{type:i,clearable:!0,allowedInvalidValue:"-",...v,timePickerProps:{format:d(e||t)},isDateDisabled:e=>{var t;return(null==(t=p.isDateDisabled)?void 0:t.call(p,e,p.row))||function(e){return!!p.row[p.connectField]&&T(e,p.isEndDate?new Date(`${p.row[p.connectField].split(" ")[0]} 00:00:00`).getTime():new Date(p.row[p.connectField]).getTime())}(e)},isTimeDisabled:(null==i?void 0:i.includes("time"))?S(p.isTimeDisabled)||$:void 0}}));function T(e,t){return p.isStartDate&&p.connectField?e>t:!(!p.isEndDate||!p.connectField)&&e<t}function $(e){const t=new Date(p.row[p.connectField]),i=new Date(e),{h:n,m:r,s:l}=h(t),a=(e,t,i,n)=>!(p.isEndDate&&i>n)&&(!(p.isStartDate&&i<n)&&T(e,t));return{isHourDisabled:t=>{if(!p.row[p.connectField])return!1;const r=new Date(`${p.row[p.connectField].split(" ")[0]} 00:00:00`).getTime(),{m:l,s:o}=h(i);return a(t,n,e-60*t*60*1e3-60*l*1e3-1e3*o,r)},isMinuteDisabled:t=>{if(!p.row[p.connectField])return!1;const l=new Date(`${p.row[p.connectField].split(" ")[0]} ${n}:00:00`).getTime(),{s:o}=h(i);return a(t,r,e-60*t*1e3-1e3*o,l)},isSecondDisabled:t=>{if(!p.row[p.connectField])return!1;const i=new Date(`${p.row[p.connectField].split(" ")[0]} ${n}:${r}:00`).getTime();return a(t,l,e-1e3*t,i)}}}function S(e){return c(e)?t=>e(t,p.row):null}function h(e){return{h:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}return(e,t)=>(l(),a(o(D),s({ref_key:"formRef",ref:F},o(y),{"formatted-value":o(g),"onUpdate:formatted-value":t[0]||(t[0]=e=>u(g)?g.value=e:null)}),null,16,["formatted-value"]))}});export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,mergeProps as o}from"vue";import{format as t}from"date-fns";import{isFunction as n}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r}from"../../../../constants/index.js";import{useAutoFocus as i}from"../hooks/useAutoFocus.js";import{
|
|
1
|
+
import{createVNode as e,mergeProps as o}from"vue";import{format as t}from"date-fns";import{isFunction as n}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r}from"../../../../constants/index.js";import{useAutoFocus as i}from"../hooks/useAutoFocus.js";import{IhoTableRenderHelper as l,isInvalidDate as d,getLowCodeFieldFromField as a}from"../../../../utils/index.js";import u from"./editDate.vue.js";import{defineTablePlugin as m}from"../../../../hooks/useTablePlugin.js";function s(){const s="dateRendererPlugin";return m({name:s,vxe(t){t.renderer.add(r.DATE,{renderCell:l.createDefaultRenderCell(),renderEdit:l.createRenderEdit((({fieldItem:t,emitFormClick:n,row:r,column:i,$rowIndex:l})=>[e(u,o({value:r[i.field],"onUpdate:value":e=>r[i.field]=e,isStartDate:t.isStartDate,isEndDate:t.isEndDate,connectField:t.connectField,valueFormat:t.valueFormat},t.componentProps,{column:i,row:r,"row-index":l,onClick:n}),null)]))})},apply(e){i(e).bindAutoFocusConfig(s,r.DATE,".n-input__input-el",{after:e=>(Reflect.set(e.editRender,"autoselect",!0),e)}),e.eventHooks.onCellDblclick.tap(s,(({row:e,column:o,columnIndex:i,rowIndex:l,$rowIndex:u},m,{$table:s,emits:f})=>{var c,p,v,x;if((null==(c=o.editRender)?void 0:c.name)!==r.DATE||e[o.field])return;if(n(null==(p=m.editConfig)?void 0:p.beforeEditMethod)){if(!(null==(v=m.editConfig)?void 0:v.beforeEditMethod({row:e,column:o,columnIndex:i,rowIndex:l,$table:s,$grid:s})))return}const w=new Date;if(d(o,e,w))return;const D=e[o.field];e[o.field]=t(w,(null==(x=a(o))?void 0:x.valueFormat)||"yyyy-MM-dd HH:mm:ss"),f("formChange",{oldValue:D,index:l>-1?l:u,value:e[o.field],row:e,column:o,$table:s})}))}})}export{s as dateRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as o,computed as e,mergeProps as
|
|
1
|
+
import{createVNode as o,computed as e,mergeProps as n}from"vue";import{isString as r,isArray as t}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as l}from"../../../../constants/index.js";import{useAutoFocus as i}from"../hooks/useAutoFocus.js";import{getLowCodeFieldFromField as d,IhoTableRenderHelper as u}from"../../../../utils/index.js";import s from"./levelSearchCascade.vue.js";import{defineTablePlugin as a}from"../../../../hooks/useTablePlugin.js";function c(){const c="levelSearchCascadePlugin";return a({name:c,vxe(i){i.renderer.add(l.LEVEL_SEARCH_CASCADE,{renderCell:(e,{column:n,row:l})=>{const i=l[n.field];return r(i)?u(i):t(i)?u(function(o){var e,r,t;const l=d(n);if(!l)return"";const i=(null==(r=null==(e=l.wordbook)?void 0:e.show_key)?void 0:r[0])||(null==(t=l.componentProps)?void 0:t.labelField)||"text";return o.reduce(((o,e,n)=>0===n?e[i]:o+" / "+e[i]),"")}(i)):"";function u(e){return o("span",{title:e,class:"iho-table__colorAndIcon"},[e])}},renderEdit:u.createRenderEdit((({fieldItem:r,row:t,column:l,emitFormClick:i,emitFormChangeWithParams:d,rowIndex:u,columnIndex:a})=>{const c=e({get:()=>t[l.field],set(o){const e=t[l.field];t[l.field]=o,d({oldValue:e})}});return[o(s,n({value:c.value,"onUpdate:value":o=>c.value=o,options:r.options,wordbook:r.wordbook,autograph:r.autograph,onClick:i},r.componentProps,{fieldKey:l.field,payload:{row:t,column:l,rowIndex:u,columnIndex:a}}),null)]}))})},apply(o){i(o).bindAutoFocusConfig(c,l.LEVEL_SEARCH_CASCADE,"input")}})}export{c as levelSearchCascadePlugin};
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,mergeProps as o,defineComponent as l,computed as
|
|
1
|
+
import{createVNode as e,mergeProps as o,defineComponent as l,computed as n}from"vue";import t from"../../../../../../shared/components/InputNumberSlash/InputNumberSlash.js";import{isNumber as r}from"lodash-es";import{NInputNumber as u}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as a}from"../../../constants/index.js";import{useAutoFocus as i}from"./hooks/useAutoFocus.js";import{IhoTableRenderHelper as s}from"../../../utils/index.js";import{defineTablePlugin as p}from"../../../hooks/useTablePlugin.js";const m=l({name:"IhoTableInputNumber",props:{value:[String,Number]},emits:["update:value"],setup(o,{emit:l}){const t=n({get:()=>r(o.value)?o.value:o.value&&r(+o.value)?+o.value:null,set(e){l("update:value",e)}});return()=>e(u,{value:t.value,"onUpdate:value":e=>t.value=e},null)}});function d(){const l="numberRendererPlugin";return p({name:l,vxe(l){l.renderer.add(a.NUMBER,{renderCell:s.createDefaultRenderCell(),renderEdit:s.createRenderEdit((({row:l,column:n,fieldItem:r,emitFormClick:u,emitFormChangeWithParams:a,$table:i})=>{var s;const{placeholder:p="请输入"}=r.componentProps||{};function d(e){const o=l[n.field];l[n.field]=e,a({oldValue:o})}const c={clearable:!0,placeholder:p,onBlur:()=>a({type:"blur",oldValue:l[n.field]}),onClick:u};return!0===r.allowSlash||"1"===r.allowSlash?e(t,o({value:l[n.field],onChange:d,onSelect:function(){i.internalData.isActivated=!0}},c,{whiteList:r.whiteList},r.componentProps,{popperProps:{...null==(s=r.componentProps)?void 0:s.popperProps,class:"iho-table_numberInputSlashPopper"}}),null):e(m,o({value:l[n.field],"onUpdate:value":d},c,r.componentProps),null)}))})},apply(e){i(e).bindAutoFocusConfig(l,a.NUMBER,".n-input__input-el",{focusType:"class"})}})}export{d as numberRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as o,createVNode as
|
|
1
|
+
import{reactive as e,inject as o,createVNode as n,mergeProps as t,onBeforeUnmount as l}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as s}from"../../../../constants/index.js";import{useAutoFocus as u}from"../hooks/useAutoFocus.js";import{getTitle as d,IhoTableRenderHelper as a,IhoTableUtils as c}from"../../../../utils/index.js";import p from"./editSelect.js";import{getDefaultValue as f,isConnectField as m,getArray as v}from"./selectUtils.js";import{getSelectOptions as w,selectOptionsMap as g}from"../hooks/useSelectOption.js";import{cloneDeep as h,isFunction as y,isEqual as b}from"lodash-es";import{defineTablePlugin as C}from"../../../../hooks/useTablePlugin.js";function x(){const x="selectRendererPlugin",E=e(new Map);function k(e){return!0===e||"1"===e}return C({name:x,vxe(e){e.renderer.add(r.SELECT,{renderCell({props:e},{row:t,column:l,$table:r}){var u;const a=o(s),c=w(a,l.field,t,r),p=f(t,e,c),m=i(p).join(","),v=e&&(k(e.variableHeight)||(null==(u=e.componentProps)?void 0:u.indexedText));return[n("span",{title:d(l,m),class:"iho-table__colorAndIcon"},[v?i(p).reduce(((e,o)=>(null!=o&&e.push([o,";",n("br",null,null)]),e)),[]):m])]},renderEdit:a.createRenderEdit((({fieldItem:e,emitFormClick:l,row:i,column:r,$rowIndex:u,$table:d})=>{var a,c,f,m;const v=o(s),g=w(v,r.field,i,d),h=k(null!=(c=null==(a=e.componentProps)?void 0:a.allowModify)?c:e.allowModify),y=k(null!=(m=null==(f=e.componentProps)?void 0:f.allowCreate)?m:e.allowCreate)||h;return[n(p,t({queryOptions:e.queryOptions},e.componentProps,{options:g,column:r,row:i,"row-index":u,value:i[r.field],"onUpdate:value":e=>i[r.field]=e,allowModify:h,allowCreate:y,onClick:l}),null)]}))})},apply(e){async function o(e,o={}){var n,t,l;const i=null==(n=e.editRender)?void 0:n.props;if(!i)return[];let r=v(i.options)||v(null==(t=i.componentProps)?void 0:t.options)||[];if(i.queryOptions)try{const n={column:e,isFullData:!0,...o};r=await(null==(l=i.queryOptions)?void 0:l.call(i,n))}catch(e){console.log(`获取${i.field}_options错误`)}return r}function n(e){return e&&c.getCellType(e)===r.SELECT}u(e).bindAutoFocusConfig(x,r.SELECT,".n-base-selection-input,.n-base-selection-tags"),e.fieldHooks.fieldList.tap(x,((e,{uuid:t})=>{if(t){g.get(t)||g.set(t,{}),E.set(t,h(e));const l=g.get(t);e.forEach((async t=>{var i;const r=null==(i=t.editRender)?void 0:i.props;if(t.field&&r&&n(r)&&!m(e,t.field)){if(y(r.queryOptions)&&l[t.field])return;l[t.field]=[],l[t.field]=await o(t)}}))}return e})),e.dataHooks.data.tap(x,((e,{uuid:t},l)=>{if(!t)return;const i=E.get(t);if(!i||!i.length)return;const r=g.get(t);i.forEach((async t=>{var l;const s=null==(l=t.editRender)?void 0:l.props;if(t.field&&s&&n(s)&&(null==s?void 0:s.connectField)){const n=s.connectField.split(","),l=e[s.columnName];n.forEach((async n=>{const u=null==i?void 0:i.find((e=>e.field===n));if(!u)return;const d=l?`${n}__${s.columnName}-${l}`:n;r[d]||(r[d]=[],r[d]=await o(u,{row:e,connectColumn:t}))}))}}))})),e.setupHooks.setup.tap(x,(e=>{l((()=>{var o;const n=null==(o=e.value)?void 0:o.uuid;n&&(g.delete(n),E.delete(n))}))})),e.eventHooks.onCellDblclick.tap(x,(({$table:e},o,{emits:t})=>{var l;const{column:i,row:r}=e.reactData.editStore.actived;if(!i||!r)return;const s=null==(l=i.editRender)?void 0:l.props,{cellDblclickSelectable:u=!1,multiple:d=!1,valueField:a="value"}=s.componentProps||{};if(!u||!n(s))return;const c=o.uuid&&w(o.uuid,i.field,r,e);if(1!==(null==c?void 0:c.length))return;const p=d?[c[0][a]]:c[0][a],f=r[i.field];e.clearEdit(),b(p,f)||(r[i.field]=p,t("formChange",{column:i,row:r,oldValue:f,value:p,index:e.getRowIndex(r),$table:e,option:c[0]}))}))}})}export{x as selectRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as t,createVNode as a,toRaw as o,h as r,onBeforeUnmount as n}from"vue";import{traverse as i,arrayed as u}from"../../../../../../../shared/utils/index.js";import{isFunction as l,isObject as s,isArray as d,compact as p,range as
|
|
1
|
+
import{reactive as e,inject as t,createVNode as a,toRaw as o,h as r,onBeforeUnmount as n}from"vue";import{traverse as i,arrayed as u}from"../../../../../../../shared/utils/index.js";import{isFunction as l,isObject as s,isArray as d,compact as p,range as f,uniq as c,flatten as _}from"lodash-es";import{NInput as m}from"naive-ui";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as E,InjectionIhoTableUUID as h,InjectionIhoTableHandler as A}from"../../../../constants/index.js";import{useAutoFocus as v}from"../hooks/useAutoFocus.js";import{getLowCodeFieldFromField as R,IhoTableRenderHelper as g,getRowHeight as D,getColumnRenderWidth as T,parseMergeField as w}from"../../../../utils/index.js";import b from"./editSeparate.vue.js";import{contentSeparate as $,getLengthDiffArray as P,getColumnInfoMaxLength as x,generateSeparateRowData as C,isSeparateColumn as S}from"./separateUtils.js";import{getSeparateInfo as k,setSeparateInfo as H,deleteSeparateInfo as j}from"../../../../utils/separateMap.js";import{defineTablePlugin as M}from"../../../../hooks/useTablePlugin.js";function O(){const O="separateRendererPlugins",F=e(new Map);return M({name:O,vxe(e){e.renderer.add(E.SEPARATE,{renderCell(e,{column:o,row:r}){var n,i;const u=t(h),l=null!=(i=null==(n=k(u,r))?void 0:n.separateData)?i:{},s=R(o),d=(null==s?void 0:s.separateFormatter)?s.separateFormatter(l[o.field]):l[o.field];return a("section",{class:"iho-table__ellipsis iho-table__colorAndIcon",title:d},[d])},renderEdit:g.createRenderEdit((({fieldItem:e,column:n,row:i,emitFormClick:u})=>{var d,p;const f=t(h),c=k(f,i),_=D(),E={};let v=null!=(p=null==(d=e.componentProps)?void 0:d.separateSlot)?p:e.separateSlot;return v&&(v=o(v),E.menu=l(v)?v:s(v)?e=>r(v,e):void 0),e.separateRowEdit?function(){if(!c)return[];if(c.ihoTableHandler=t(A),c.separateData["__"+n.field]=c.separateData["__"+n.field]||c.separateData[n.field],E.menu){const e=E.menu;return a(e,{column:n,col:n,row:i,value:c.separateData["__"+n.field],"onUpdate:value":e=>c.separateData["__"+n.field]=e},null)}return a(m,{value:c.separateData["__"+n.field],"onUpdate:value":e=>c.separateData["__"+n.field]=e},null)}():function(){var t;const o=null==(t=null==c?void 0:c.separateData)?void 0:t[n.field],r=l(e.separateFormatter)?e.separateFormatter(o):o;return[a(b,{value:i[n.field],"onUpdate:value":e=>i[n.field]=e,"row-index":null==c?void 0:c.index,height:_,column:n,row:i,"display-content":r,onClick:u},E)]}()}))})},apply(e){function t(e){return(...t)=>{var a;return!(null==(a=t[0].row)?void 0:a.$__SEPARATE)&&(!l(e)||e(...t))}}v(e).bindAutoFocusConfig(O,E.SEPARATE,".iho-table__separateText"),e.eventHooks.onEditClosed.tap(O,(({row:e,column:t,$table:a},o,{emits:r})=>{if(!e.$__uuid)return;const n=R(t);if(!n||!n.separateRowEdit)return;const i=k(e.$__uuid,e);if(!i)return;const{separateData:u,originalData:l,ihoTableHandler:s,index:p}=i,{field:f}=t;if(u["__"+f]&&u["__"+f]!==u[f]&&d(l.$__SEPARATE_DATA)){const e=l.$__SEPARATE_DATA.map((e=>{var t;return null!=(t=e["__"+f])?t:e[f]})),o=l[f];l[f]=d(l[f])?e:e.join(""),r("formChange",{value:l[f],oldValue:o,row:l,column:t,index:p,$table:a}),null==s||s.updateTableDataRef()}})),e.fieldHooks.fieldList.tap(O,((e,{uuid:t})=>(t&&F.set(t,e.reduce(((e,t)=>(i(t,(t=>{S(t)&&(e.push(o(t)),t.showOverflow="ellipsis")})),e)),[])),e))),e.dataHooks.data.tapPromise(O,(async(e,t,{insertAfter:a,index:o,$table:r})=>{var n;if(!t.uuid)return;const i=F.get(t.uuid);if(!i||!i.length)return;const l=[];for(const t of i){if(!t.field)continue;const a=await T(t,e,o,r),i={field:t.field,column:t,data:$(w(e,t),t,a,null==(n=R(t))?void 0:n.separateDeep)};l.push(i)}function s(e){return l.find((t=>t.field===e))}l.forEach((e=>{const{column:t}=e,a=R(t);if(!a)return;if(!a.separateDeep||!a.separateBinder)return;const o=p(u(a.separateBinder).map(s));if(!o.length)return;const r=o.concat(e),n=Math.max(...r.map((e=>e.data.length)));f(n).forEach((e=>{const t=r.map((t=>({item:t.data[e],data:t.data}))),a=t.map((({item:e})=>n(e)));if(1===c(a).length)return;const o=Math.max(...a);function n(e){return d(e)?e.length:1}t.forEach((({item:t,data:a})=>{const r=n(t);r!==o&&(d(t)?t.push(...P(o,r)):a[e]=f(o).map(((e,a)=>0===a?t:"")))}))}))})),l.forEach((e=>{e.data=_(e.data)})),f(x(l)).forEach(((r,n,i)=>{var u;const s=C(l,n),d={index:o,originalData:e,separateData:s,separateIndex:n,separateLength:i.length,isOriginRow:0===n,isLastRow:n===i.length-1};if(0===n)return e.$__SEPARATE_DATA=[s],e.$__SEPARATE_ROW_CACHE=e.$__SEPARATE_ROW_CACHE||[],e.$__uuid=t.uuid,void H(t.uuid,e,d);const p=null!=(u=e.$__SEPARATE_ROW_CACHE[n-1])?u:e.$__SEPARATE_ROW_CACHE[n-1]={$__SEPARATE:!0,$__uuid:t.uuid,$__SEPARATE_INDEX:n};p.$__ORIGIN_INDEX=o,H(t.uuid,p,d),e.$__SEPARATE_DATA.push(s),a(p)}))})),e.eventHooks.onResizableChange.tap(O,(async(e,t,a)=>{a.updateTableDataRef()})),e.configHooks.editConfig.tap(O,((e={},t)=>{const a=e.beforeEditMethod;return e.beforeEditMethod=(...e)=>{var o;if(!t.uuid)return f();const r=F.get(t.uuid);if(!r||!r.length)return f();const{row:n,column:i}=e[0],u=k(t.uuid,n);if(!u)return f();const s=null==(o=i.editRender)?void 0:o.props;if(!s||s.separateRowEdit)return f();const{isOriginRow:d,isLastRow:p}=u;return("bottom"===s.separatePlacement?p:d)&&f();function f(){return!l(a)||a(...e)}},e})),e.configHooks.checkboxConfig.tap(O,((e={},a)=>(e.checkMethod=t(e.checkMethod),e.visibleMethod=t(e.visibleMethod),e))),e.setupHooks.setup.tap(O,(e=>{n((()=>{e.value.uuid&&(F.delete(e.value.uuid),j(e.value.uuid))}))}))}})}export{O as separateRendererPlugins};
|
|
@@ -59,7 +59,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
59
59
|
} | {
|
|
60
60
|
style?: undefined;
|
|
61
61
|
}>;
|
|
62
|
-
__formattedValue: import("vue").WritableComputedRef<
|
|
62
|
+
__formattedValue: import("vue").WritableComputedRef<string | null>;
|
|
63
63
|
placeholder: any;
|
|
64
64
|
valueFormat: any;
|
|
65
65
|
timeConfig: AnyObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as l,inject as t,ref as a,computed as r,reactive as u,watch as o,nextTick as i,openBlock as n,createBlock as d,unref as c,withCtx as v,createVNode as m,mergeProps as s,isRef as f,createElementBlock as p,Fragment as h,renderList as y,createTextVNode as k,toDisplayString as b,createCommentVNode as w}from"vue";import{NPopover as _,NInput as g,NSpace as
|
|
1
|
+
import{defineComponent as e,useAttrs as l,inject as t,ref as a,computed as r,reactive as u,watch as o,nextTick as i,openBlock as n,createBlock as d,unref as c,withCtx as v,createVNode as m,mergeProps as s,isRef as f,createElementBlock as p,Fragment as h,renderList as y,createTextVNode as k,toDisplayString as b,createCommentVNode as w}from"vue";import{NPopover as _,NInput as g,NSpace as F,NScrollbar as V,NButton as C}from"naive-ui";import{useIhoTableFormEvent as x}from"../../../../utils/index.js";import D from"../../../../../../time-picker/index.js";import{parse as q,isValid as O,format as j,getHours as S,getMinutes as $,getSeconds as A}from"date-fns";var H=e({__name:"editTime",props:{formattedValue:{type:String},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},shortcutOptions:{type:Array,default:()=>[]}},emits:["update:formattedValue","click"],setup(e,{emit:H}){const I=e,P=l(),R=t("$xetable"),{emitFormChangeWithParams:E}=x({...I,$table:R}),M=a(null),U=a(!1),z=a(),K=a(),N=r((()=>K.value&&L(K.value)?{style:"text-decoration: line-through"}:{})),T=r({get(){if(!K.value)return null;const e=q(K.value,G.valueFormat,new Date);return O(e)?j(e,G.valueFormat):I.formattedValue||null},set(e){J(e)}}),{placeholder:W="请选择",valueFormat:B="HH:mm"}=P,G=u({...P,placeholder:W,valueFormat:B,format:B});function J(e){if(K.value=e||"",e&&L(e))return;const l=I.formattedValue;l!==e&&(H("update:formattedValue",e),E({oldValue:l}))}function L(e){var l,t,a;const r=q(e,G.format,new Date),u=S(r),o=$(r),i=A(r),n=null==(l=G.isHourDisabled)?void 0:l.call(G,u),d=null==(t=G.isMinuteDisabled)?void 0:t.call(G,o,u),c=null==(a=G.isSecondDisabled)?void 0:a.call(G,i,o,u);return n||d||c}function Q(){[G.valueFormat.replace(/[^\w]/g,""),G.valueFormat].some((e=>{const l=q(K.value,e,new Date);if(!K.value||O(l)){return J(K.value?j(l,G.valueFormat):null),!0}return!1}))}function X(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=M.value)||l.blur(),U.value=!1)}return o((()=>I.formattedValue),(e=>{if(!e)return"";K.value=e}),{immediate:!0}),o((()=>U.value),(async e=>{var l,t,a,r,u;e&&(await i(),null==(u=null==(r=null==(a=null==(t=null==(l=z.value)?void 0:l.$timePicker)?void 0:t.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var l,t;return null==(t=null==(l=null==e?void 0:e.querySelector)?void 0:l.call(e,".n-time-picker-col__item--active"))?void 0:t.scrollIntoView()})))})),(l,t)=>(n(),d(c(_),{show:U.value,trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"},onClickoutside:t[4]||(t[4]=()=>U.value=!1)},{trigger:v((()=>[m(c(g),{ref_key:"formRef",ref:M,clearable:"",placeholder:c(W),value:K.value,"onUpdate:value":t[0]||(t[0]=e=>K.value=e),valueModifiers:{trim:!0},"input-props":c(N),onClick:t[1]||(t[1]=()=>U.value=!0),onChange:Q,onKeydown:X},null,8,["placeholder","value","input-props"])])),default:v((()=>[m(c(F),null,{default:v((()=>[m(c(D),s({ref_key:"timePickerRef",ref:z,show:""},c(G),{class:"iho-table__time-picker",to:!1,"formatted-value":c(T),"onUpdate:formatted-value":t[2]||(t[2]=e=>f(T)?T.value=e:null),onConfirm:t[3]||(t[3]=()=>U.value=!1)}),null,16,["formatted-value"]),m(c(V),{class:"iho-table__scrollbar"},{default:v((()=>[e.shortcutOptions.length?(n(),d(c(F),{key:0,vertical:"",wrap:!1},{default:v((()=>[(n(!0),p(h,null,y(e.shortcutOptions,(e=>(n(),d(c(C),{size:"tiny",key:e,disabled:L(e),onClick:l=>function(e){J(e),U.value=!1}(e)},{default:v((()=>[k(b(e),1)])),_:2},1032,["disabled","onClick"])))),128))])),_:1})):w("v-if",!0)])),_:1})])),_:1})])),_:1},8,["show"]))}});export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,mergeProps as o}from"vue";import{format as
|
|
1
|
+
import{createVNode as e,mergeProps as o}from"vue";import{format as r}from"date-fns";import{isFunction as t}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as n}from"../../../../constants/index.js";import{useAutoFocus as i}from"../hooks/useAutoFocus.js";import{IhoTableRenderHelper as l,getLowCodeFieldFromField as d,isInvalidTime as m}from"../../../../utils/index.js";import u from"./editTime.vue.js";import{defineTablePlugin as a}from"../../../../hooks/useTablePlugin.js";function f(){const f="timeRendererPlugin";return a({name:f,vxe(r){r.renderer.add(n.TIME,{renderCell:l.createDefaultRenderCell(),renderEdit:l.createRenderEdit((({fieldItem:r,emitFormClick:t,row:n,column:i,$rowIndex:l})=>[e(u,o({formattedValue:n[i.field],"onUpdate:formattedValue":e=>n[i.field]=e,column:i,row:n,"row-index":l,valueFormat:r.valueFormat},r.componentProps,{onClick:t}),null)]))})},apply(e){i(e).bindAutoFocusConfig(f,n.TIME,".n-input__input-el",{after:e=>(Reflect.set(e.editRender,"autoselect",!0),e)}),e.eventHooks.onCellDblclick.tap(f,(({row:e,column:o,columnIndex:i,rowIndex:l,$rowIndex:u},a,{$table:f,emits:s})=>{var c,p,v,x;if((null==(c=o.editRender)?void 0:c.name)!==n.TIME||e[o.field])return;if(t(null==(p=a.editConfig)?void 0:p.beforeEditMethod)){if(!(null==(v=a.editConfig)?void 0:v.beforeEditMethod({row:e,column:o,columnIndex:i,rowIndex:l,$table:f,$grid:f})))return}const w=r(new Date,(null==(x=d(o))?void 0:x.valueFormat)||"HH:mm");if(m(o,w))return;const I=e[o.field];e[o.field]=w,s("formChange",{oldValue:I,index:l>-1?l:u,value:e[o.field],row:e,column:o,$table:f})}))}})}export{f as timeRendererPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function rowClickPlugin(): import("../../../../components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{onBeforeUnmount as e}from"vue";import"../../index.js";import{defineTablePlugin as o}from"../hooks/useTablePlugin.js";function n(){const n="rowClickPlugin",u=new Map;return o({name:n,apply(o){o.eventHooks.onCurrentChange.tap(n,((e,{uuid:o,rowConfig:n})=>{o&&!1!==(null==n?void 0:n.clickToCancel)&&u.set(o,!0)})),o.eventHooks.onCellClick.tap(n,(async({$table:e},{uuid:o,rowConfig:n})=>{o&&!1!==(null==n?void 0:n.clickToCancel)&&(u.get(o)?u.set(o,!1):e.clearCurrentRow())})),o.setupHooks.setup.tap(n,(o=>{e((()=>{o.value.uuid&&u.delete(o.value.uuid)}))}))}})}export{n as rowClickPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function rowDragPlugin(): import("../../../../components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{promiseTimeout as e}from"@vueuse/shared";import{isFunction as l,cloneDeep as n}from"lodash-es";import{nextTick as o,onBeforeUnmount as t}from"vue";import"../../index.js";import i from"sortablejs";import d from"xe-utils";import{defineTablePlugin as r}from"../hooks/useTablePlugin.js";function a(){const n="rowDragPlugin",d=new Map;return r({name:n,apply(r){r.fieldHooks.fieldEnd.tapPromise(n,(async(n,{$table:t,emits:r})=>{const{uuid:a}=n,s=n.sortableConfig||{};a&&s.enable&&!d.get(a)&&(await o(),async function n(o=0){if(o>2)return;const c=function(){var e,l,n,o,i,d,r,a,u,s;const c=null==(o=null==(n=null==(l=null==(e=t.value)?void 0:e.$el)?void 0:l.querySelector)?void 0:n.call(l,".vxe-table--body"))?void 0:o.scrollWidth,v=(null==(r=null==(d=null==(i=t.value)?void 0:i.$el)?void 0:d.querySelector)?void 0:r.call(d,".vxe-table.is--scroll-x"))?".fixed-left--wrapper>.vxe-table--body tbody":".body--wrapper>.vxe-table--body tbody";return c?null==(s=null==(u=null==(a=t.value)?void 0:a.$el)?void 0:u.querySelector)?void 0:s.call(u,v):null}();if(c){const e=i.create(c,{handle:".col--seq",...s,onEnd:e=>{var n,o,i,d,a,c,v;const{oldIndex:f=0,newIndex:x=0}=e,p={oldIndex:f,newIndex:x},{virtualY:b}=(null==(n=t.value)?void 0:n.getScroll())||{};if(b){const e=(null==(d=null==(i=null==(o=t.value)?void 0:o.getTableData())?void 0:i.tableData)?void 0:d[f])||{},l=null!=(v=null!=(c=e.__currentIndex)?c:null==(a=t.value)?void 0:a.getVTRowIndex(e))?v:0,n=l+(x-f);e.__currentIndex=n,p.oldIndex=l,p.newIndex=n}const y={...e,...p,...u(e,p,t.value)};r("rowDrag",y),l(s.onEnd)&&s.onEnd(y)}});return d.set(a,e)}await e(100),n(++o)}())})),r.setupHooks.setup.tap(n,(e=>{t((()=>{var l,n;const o=null==(l=e.value)?void 0:l.uuid;o&&d.has(o)&&(null==(n=d.get(o))||n.destroy(),d.delete(o))}))}))}})}function u(e,l,o){var t;const i=null==(t=null==o?void 0:o.getTableData())?void 0:t.fullData,r=o.treeConfig&&o.treeConfig.transform?function(e,l){var o,t,i,r,a;const{oldIndex:u=0,newIndex:s=0}=e,c={children:"childrenList"},{fullData:v,tableData:f}=l.getTableData(),x=null==f?void 0:f[u],p=null==f?void 0:f[s-1],b=n(v),y=d.findTree(b,(e=>e.__id===x.__id),c);if(p){const e=null==(t=null==(o=l.$el)?void 0:o.querySelector)?void 0:t.call(o,".body--wrapper>.vxe-table--body tbody"),n=null==(r=null==(i=l.$el)?void 0:i.querySelector)?void 0:r.call(i,".fixed-left--wrapper>.vxe-table--body tbody"),v=d.findTree(b,(e=>e.__id===p.__id),c);if(d.findTree(x[c.children],(e=>e.__id===p.__id),c)){const l=e.children[u],o=e.children[s];return e.insertBefore(o,l),null==(a=null==n?void 0:n.insertBefore)||a.call(n,n.children[s],n.children[u]),console.log("不允许自己给自己拖动"),b}const f=y.items.splice(y.index,1)[0];l.isTreeExpandByRow(p)?p[c.children].splice(0,0,f):v.items.splice(v.index+(y.index<v.index?0:1),0,f)}else{const e=y.items.splice(y.index,1)[0];b.unshift(e)}return b}(e,o):function(e,l){var o;const{oldIndex:t=0,newIndex:i=0}=e,d=n((null==(o=null==l?void 0:l.getTableData())?void 0:o.fullData)||[]),r=d.splice(t,1)[0];return d.splice(i,0,r),d}(l,o);return{oldData:i,newData:r}}export{a as rowDragPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function variableHeightRendererPlugin(): import("
|
|
1
|
+
export declare function variableHeightRendererPlugin(): import("../../../../components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{unref as e,onBeforeUnmount as t,shallowReactive as o,createVNode as l,defineComponent as n,inject as r,ref as a,computed as s,provide as i,watch as u,onMounted as c,h as d}from"vue";import{traverse as p,widthAppend as f}from"../../../../shared/utils/index.js";import{doAnimation as m}from"../../../../shared/utils/anime.js";import{useThrottleFn as h}from"@vueuse/core";import{promiseTimeout as g}from"@vueuse/shared";import{last as v,isFunction as x,isNumber as y}from"lodash-es";import"../../index.js";import{InjectionIhoTableUUID as b}from"../constants/index.js";import{useUUIDMap as I,isVariableHeightColumn as w}from"../utils/index.js";import{defineTablePlugin as T}from"../hooks/useTablePlugin.js";class D{constructor(){this.records={},this.maxRecords=o(new Map)}set(e,t,o){if(this.records[e]||(this.records[e]={}),this.records[e][t]===o)return;this.records[e][t]=o;const l=Math.max(...Object.values(this.records[e]),0);this.maxRecords.get(e)!==l&&this.maxRecords.set(e,l)}getMax(e){return this.maxRecords.get(e)||0}}const{getItemFromUUID:R,removeItemFromUUID:M}=I((()=>new D),!0),{getItemFromUUID:S,removeItemFromUUID:H,setItemFromUUID:U}=I((()=>null)),{getItemFromUUID:C,removeItemFromUUID:$,setItemFromUUID:k}=I((()=>{}));let F={};function j(t,o,{scrollTop:l=0}){var n,r;const{uuid:a,rowConfig:s={}}=o;if(!a)return;const i=R(a),{oSize:u=0,gt:c=100}=null!=(n=C(a))?n:{},{internalData:d,reactData:p}=t,{scrollYStore:f,elemStore:m,afterFullData:h,fullDataRowIdData:g}=d;if(c>h.length)return;const y=null!=(r=s.height)?r:36,b=m["main-body-wrapper"],I=b?e(b):null;let w=I?Math.max(8,Math.ceil(I.clientHeight/y)+2+u):8;const T=[0];let D=0;if(l&&h.find(((e,o)=>{const n=t.getRowSeq(e),r=(v(T)||0)+Math.max(y,i.getMax(n));if(T.push(r),r>l)return D=Math.max(0,o-u),w+=Math.min(D,u),!0})),D>0&&x(o.spanMethod)){const{spanMethod:e}=o,l={rowspan:1,colspan:1};for(;D>0;){if(!t.getColumns().some(((t,o)=>{const{rowspan:n,colspan:r}=e({column:t,columnIndex:o,$columnIndex:o,row:h[D],rowIndex:D,$rowIndex:D,_rowIndex:D,isHidden:!t.visible,fixed:t.fixed,type:t.type,visibleData:h})||l;if(0===n&&0===r)return D--,!0})))break}}const M=`${T[D]}px`,S=`${h.reduce(((e,o)=>{const l=t.getRowSeq(o);return e+Math.max(y,i.getMax(l))}),0)}px`;["main","left","right"].forEach((t=>{const o=m[`${t}-body-table`],n=o?e(o):null;n&&(n.style.marginTop=M,n.scrollTop=l),["header","body","footer"].forEach((o=>{const l=m[`${t}-${o}-ySpace`],n=l?e(l):null;n&&(n.style.height=S)}))}));const H=Math.min(h.length,D+w);if(f.startIndex===D&&f.endIndex===H)return;f.startIndex=D,f.endIndex=H;const U=h.slice(f.startIndex,f.endIndex);U.forEach(((e,o)=>{const l=t.getRowid(e),n=g[l];n&&(n.$index=o)})),p.tableData.length=0,p.tableData.push(...U)}const Y=h(j,300);function E(){const o="variableHeightRendererPlugin";return T({name:o,vxe(e){F=n({props:{payload:{type:Object,required:!0}},setup(t){const o=r(b),n=r("$xetable"),p=a(),m=R(o),h=s((()=>t.payload.row[t.payload.column.field]));function v(){const{row:e,column:o}=t.payload,l=n.getRowSeq(e);if(!m||null==l||!p.value)return;const r=p.value.clientHeight;m.set(l,o.field,r)}i("updateCellHeight",v),u([()=>t.payload.rowIndex,()=>t.payload.column.field,h,()=>t.payload.column.renderWidth],(async()=>{await g(0),v()})),c((()=>{n&&!S(o)&&U(o,n),v()}));const I=s((()=>{var o,l,n,r,a;const s=null!=(l=null==(o=t.payload.column.editRender)?void 0:o.props)?l:{},i=null!=(r=null==(n=s.slots)?void 0:n.default)?r:s.slotFn;if(x(i))return i;const u=null==(a=t.payload.column.editRender)?void 0:a.name;if(u){const o=e.renderer.get(u);if(null==o?void 0:o.renderCell)return()=>o.renderCell(t.payload.column.editRender,t.payload)}return()=>h.value})),w=s((()=>{if(t.payload.column.treeNode)return"";const e=t.payload.column.renderWidth;return y(e)&&e>0?f(e-20-2):""}));return()=>l("div",{ref:p,style:{padding:"7px 0",width:w.value,overflow:"hidden"}},[d(I.value,t.payload)])}})},apply(n){function r(t){const o=S(t.uuid);if(!o)return;t.scrollY={enabled:!1},o.reactData.scrollYLoad=!1;const l=function(t){const o=t.internalData.elemStore["main-body-wrapper"];return o?e(o):null}(o);l&&j(o,t,{scrollTop:l.scrollTop})}function a(e){if(!e.uuid)return;const t=C(e.uuid);t&&(e.scrollY=t),setTimeout((()=>r(e)),300)}function s(e){return l(F,{payload:e},null)}n.dataHooks.dataStart.tap(o,a),n.eventHooks.onFilterChange.tap(o,((e,t)=>a(t))),n.eventHooks.onSortChange.tap(o,((e,t)=>a(t))),n.eventHooks.onToggleTreeExpand.tap(o,((e,t)=>a(t))),n.eventHooks.onResizableChange.tap(o,(async({column:e},t)=>{e.editRender&&e.editRender.props&&w(e.editRender.props)&&a(t)})),n.eventHooks.onScroll.tap(o,h(((e,t)=>{if(e.isX)return;const{uuid:o}=t;if(!o)return;const l=S(o);l&&j(l,t,e)}),100,!0,!0)),n.fieldHooks.field.tap(o,(e=>{if(w(e)){e.slots={...e.slots,default:s};const t=e.className,o="variable-height";e.className=t?function(e){return x(t)?[t(e),o]:[t,o]}:o}return e})),n.fieldHooks.fieldList.tap(o,((t,o,{$table:l})=>(o.uuid&&p(t,((t,n)=>{var a,s;if(w(t)){const t=null!=(s=null==(a=o.rowConfig)?void 0:a.height)?s:36,i=R(o.uuid),u=o.cellStyle;if(o.cellStyle=function(e){const o={};if(l.value){const n=Math.max(t,i.getMax(l.value.getRowSeq(e.row)));o.height=`${n}px`}return Object.assign(o,u?x(u)?u(e):u:null)},o.sortableConfig&&o.sortableConfig.enable){const t=o.sortableConfig.onEnd;o.sortableConfig.onEnd=function(l){const n=S(o.uuid);if(n){const{internalData:{elemStore:t}}=n,l=t["main-table-body"];l&&e(l)&&j(n,o,{scrollTop:e(l).scrollTop})}x(t)&&t(l)}}o.scrollY={...o.scrollY,mode:"default"},o.onWheel=function(t){let o=null,l=0,n=!0;return function(r){if(!t.uuid)return;const a=S(t.uuid);if(!a)return;const{internalData:s}=a,{isHover:i}=t.rowConfig||{},{deltaX:u,deltaY:c}=r,{refTableLeftBody:d,refTableRightBody:p,refTableBody:f}=a.getRefMaps(),h=c,g=u,v=h<0,x=e(f),y=x?x.$el:null;if(!y)return;if(v?y.scrollTop<=0:y.scrollTop>=y.scrollHeight-y.clientHeight)return;const b=y.scrollTop+h,I=y.scrollLeft+g;if(b===s.lastScrollTop)return;r.preventDefault(),s.lastScrollTop=b,s.lastScrollLeft=I,s.lastScrollTime=Date.now(),i&&a.clearHoverRow();const w=d.value,T=p.value,D=w?w.$el:null,R=T?T.$el:null,M=Math.min(100,Math.abs(Math.floor(h/2)));n&&(l=y.scrollTop,n=!1),l+=M*(v?-1:1),o&&o(),o=m(y.scrollTop,l,400,(e=>{y.scrollTop=e,D&&(D.scrollTop=e),R&&(R.scrollTop=e)}),"easeOutCubic",(()=>{l=y.scrollTop,n=!0})),Y(a,t,y)}}(o),setTimeout((()=>{k(o.uuid,o.scrollY),r(o)}),300),n()}})),t))),n.setupHooks.setup.tap(o,(e=>{t((()=>{e.value.uuid&&(M(e.value.uuid),H(e.value.uuid),$(e.value.uuid))}))}))}})}export{E as variableHeightRendererPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERTICAL_CELL_TYPE = "VERTICAL_CELL_TYPE";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const E="VERTICAL_CELL_TYPE";export{E as VERTICAL_CELL_TYPE};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function verticalTablePlugin(): import("../../../../../components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{flow as e,method as t,pick as r,isArray as n,mapValues as i}from"lodash-es";import{onBeforeUnmount as o,unref as s}from"vue";import"../../../index.js";import{LOWEST_PRIORITY as l,WIDGET_TYPE as d}from"../../constants/index.js";import{VERTICAL_CELL_TYPE as a}from"./constants.js";import{renderHeader as u}from"./renderer.js";import{useUUIDMap as c}from"../../utils/index.js";import{isVerticalTable as f,isVerticalHeader as m,getSpanInfo as p,createVerticalFieldList as g,getFieldListDepth as h,bindHeaderInfoAndFlatten as v,isVerticalBody as b,getHeaderDepthByField as w}from"./utils.js";import{defineTablePlugin as D}from"../../hooks/useTablePlugin.js";const F=["RADIO","SWITCH"];function x(){const x="verticalTablePlugin";return D({name:x,vxe(n){function o(e,t){const{row:o,column:s}=t,{originalField:l={}}=o;if(m(s))return u(o,s);const{editRender:a={}}=l,c=a.name||d.DEFAULT,f=n.renderer.get(c);return f?i(f,(e=>e.bind(f,a,{...t,column:{...l,...r(s,["field"])}}))):{}}n.renderer.add(a,{renderCell:e(o,t(["renderCell"])),renderEdit:e(o,t(["renderEdit"]))})},apply(e){const{getItemFromUUID:t,removeItemFromUUID:i}=c((()=>({})),!1);e.configHooks.config.tap({name:x,stage:l},(e=>{if(!e.uuid||!f(e))return e;const{uuid:n}=e;return Reflect.set(window,"__state",t(n)),{uuid:n,showHeader:!1,...r(e,["border","height","verticalConfig","showSeq","size","rowGroupSetting","keyboardConfig"]),cellClassName({column:e}){const t=m(e);return{"vxe-header--column":t,"vxe-table--header":t}},cellStyle({column:e,row:t}){if(p(t,e).colspan>1)return{textAlign:"center"}},spanMethod:({row:e,column:t})=>p(e,t),editConfig:{...e.editConfig,beforeEditMethod({row:e,column:t}){const{originalField:r={}}=e;if(m(t))return!1;const{editRender:{name:n=d.DEFAULT}={}}=r;return!Object.values(d).concat(F).includes(n)}}}})),e.fieldHooks.fieldList.tap({name:x,stage:l},((e,r,{globProps:i})=>{const{uuid:o}=r;if(!o||!f(r))return e;const s=t(o);return s?(s.originalFieldList=e,n(i.tableData)?s.verticalFieldList=g(i.tableData,s.headerDepth=h(e)):[]):e})),e.dataHooks.dataList.tap({name:x,stage:l},((e,r)=>{const{uuid:n}=r;if(!n||!f(r))return e;const i=t(n);if(!i)return e;const{originalFieldList:o=[],headerDepth:s=0}=i,l=v(o,s);return i.verticalData=l.map((t=>new Proxy({},{get(r,n){var i;if("originalField"===n)return t;if(m({field:n}))return t[n];if(b({field:n})){const r=w({field:n});return"seq"===t.type?r+1:null==(i=e[r])?void 0:i[t.field]}return r[n]},set(r,n,i){if(!m({field:n})){const r=w({field:n});r>=0&&e[r]&&(e[r][t.field]=i)}return!0}})))})),e.setupHooks.setup.tap(x,(e=>{o((()=>{const{uuid:t}=s(e)||{};t&&i(t)}))}))}})}export{x as verticalTablePlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,n){return e[n.field]}export{e as renderHeader};
|