cnhis-design-vue 3.1.57-release.3 → 3.2.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/calendar/index.d.ts +13 -12
- package/es/components/calendar/src/Calendar.vue.d.ts +13 -12
- package/es/components/calendar/src/Calendar.vue2.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +26 -0
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/classification/src/index.vue.d.ts +3 -3
- 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/src/components/form.vue2.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/interface.d.ts +1 -1
- package/es/components/form-config/index.d.ts +34 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +34 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +14 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +17 -0
- package/es/components/form-render/index.d.ts +14 -0
- package/es/components/form-render/src/FormRender.vue.d.ts +14 -0
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +14 -0
- package/es/components/form-render/src/components/renderer/index.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/simpleComponent.js +1 -1
- package/es/components/form-render/src/components/renderer/time.d.ts +7 -0
- package/es/components/form-render/src/components/renderer/time.js +1 -0
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +6 -4
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +1 -0
- package/es/components/form-render/src/utils/business.d.ts +1 -1
- package/es/components/form-render/src/utils/business.js +1 -1
- package/es/components/iho-table/index.d.ts +12 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +12 -0
- 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/filterRenderPlugin/filter.vue.d.ts +1 -1
- 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 +31 -1
- 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 +15 -12
- 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 +9 -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.d.ts +1 -0
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +33 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +33 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +15 -0
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +14 -0
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
- package/es/components/shortcut-setter/index.d.ts +14 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +14 -0
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
- 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/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 +2 -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
package/README.md
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
# 安装
|
|
2
|
-
|
|
3
|
-
```shell
|
|
4
|
-
npm i cnhis-design-vue@[版本号]
|
|
5
|
-
# or
|
|
6
|
-
yarn add cnhis-design-vue@[版本号] #推荐
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## 1.全局引入
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
// main.ts
|
|
13
|
-
import { createApp } from 'vue';
|
|
14
|
-
import App from './App.vue';
|
|
15
|
-
import 'cnhis-design-vue/es/packages/index.css';
|
|
16
|
-
import cui from 'cnhis-design-vue';
|
|
17
|
-
|
|
18
|
-
const app = createApp(App);
|
|
19
|
-
app.use(cui).mount('#app');
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## 2. 按需引入
|
|
23
|
-
|
|
24
|
-
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
|
25
|
-
|
|
26
|
-
### 2.1 样式处理方式1 (按需引入样式)
|
|
27
|
-
|
|
28
|
-
```shell
|
|
29
|
-
# 安装自动导入样式的插件
|
|
30
|
-
npm i -d vite-plugin-style-import
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
// vite.config.ts
|
|
35
|
-
import { defineConfig } from 'vite';
|
|
36
|
-
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
|
37
|
-
|
|
38
|
-
export default defineConfig({
|
|
39
|
-
plugins: [
|
|
40
|
-
// ...otherPlugins
|
|
41
|
-
createStyleImportPlugin({
|
|
42
|
-
libs: [
|
|
43
|
-
{
|
|
44
|
-
libraryName: 'cnhis-design-vue',
|
|
45
|
-
esModule: true,
|
|
46
|
-
ensureStyleFile: true,
|
|
47
|
-
resolveStyle: name => {
|
|
48
|
-
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
})
|
|
53
|
-
]
|
|
54
|
-
});
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### 2.2 样式处理方式2 (全局引入样式)
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
// main.ts
|
|
61
|
-
import 'cnhis-design-vue/es/components/index.css';
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## 3.FAQ
|
|
65
|
-
|
|
66
|
-
### 3.1 项目打包后样式丢失
|
|
67
|
-
|
|
68
|
-
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
// vite.config.ts
|
|
72
|
-
import { defineConfig } from 'vite';
|
|
73
|
-
|
|
74
|
-
export default defineConfig({
|
|
75
|
-
build: {
|
|
76
|
-
rollupOptions: {
|
|
77
|
-
// ..otherOptions
|
|
78
|
-
output: {
|
|
79
|
-
dir: './dist',
|
|
80
|
-
manualChunks: {
|
|
81
|
-
'cnhis-vendor': ['cnhis-design-vue']
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
```
|
|
1
|
+
# 安装
|
|
2
|
+
|
|
3
|
+
```shell
|
|
4
|
+
npm i cnhis-design-vue@[版本号]
|
|
5
|
+
# or
|
|
6
|
+
yarn add cnhis-design-vue@[版本号] #推荐
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## 1.全局引入
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
// main.ts
|
|
13
|
+
import { createApp } from 'vue';
|
|
14
|
+
import App from './App.vue';
|
|
15
|
+
import 'cnhis-design-vue/es/packages/index.css';
|
|
16
|
+
import cui from 'cnhis-design-vue';
|
|
17
|
+
|
|
18
|
+
const app = createApp(App);
|
|
19
|
+
app.use(cui).mount('#app');
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 2. 按需引入
|
|
23
|
+
|
|
24
|
+
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
|
25
|
+
|
|
26
|
+
### 2.1 样式处理方式1 (按需引入样式)
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
# 安装自动导入样式的插件
|
|
30
|
+
npm i -d vite-plugin-style-import
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// vite.config.ts
|
|
35
|
+
import { defineConfig } from 'vite';
|
|
36
|
+
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
|
37
|
+
|
|
38
|
+
export default defineConfig({
|
|
39
|
+
plugins: [
|
|
40
|
+
// ...otherPlugins
|
|
41
|
+
createStyleImportPlugin({
|
|
42
|
+
libs: [
|
|
43
|
+
{
|
|
44
|
+
libraryName: 'cnhis-design-vue',
|
|
45
|
+
esModule: true,
|
|
46
|
+
ensureStyleFile: true,
|
|
47
|
+
resolveStyle: name => {
|
|
48
|
+
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 2.2 样式处理方式2 (全局引入样式)
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// main.ts
|
|
61
|
+
import 'cnhis-design-vue/es/components/index.css';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 3.FAQ
|
|
65
|
+
|
|
66
|
+
### 3.1 项目打包后样式丢失
|
|
67
|
+
|
|
68
|
+
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// vite.config.ts
|
|
72
|
+
import { defineConfig } from 'vite';
|
|
73
|
+
|
|
74
|
+
export default defineConfig({
|
|
75
|
+
build: {
|
|
76
|
+
rollupOptions: {
|
|
77
|
+
// ..otherOptions
|
|
78
|
+
output: {
|
|
79
|
+
dir: './dist',
|
|
80
|
+
manualChunks: {
|
|
81
|
+
'cnhis-vendor': ['cnhis-design-vue']
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
```
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bpmn-js/lib/Viewer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bpmn-js/lib/features/modeling';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'diagram-js/lib/navigation/movecanvas';
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { SFCWithInstall } from '../../shared/types';
|
|
3
3
|
export * from './src/types';
|
|
4
4
|
declare const Calendar: SFCWithInstall<import("vue").DefineComponent<{
|
|
5
|
-
date: {
|
|
6
|
-
type: DateConstructor;
|
|
7
|
-
default: Date;
|
|
8
|
-
};
|
|
9
5
|
showDateNavigation: {
|
|
10
6
|
type: BooleanConstructor;
|
|
11
7
|
default: boolean;
|
|
12
8
|
};
|
|
9
|
+
date: {
|
|
10
|
+
type: DateConstructor;
|
|
11
|
+
default: Date;
|
|
12
|
+
};
|
|
13
13
|
events: {
|
|
14
14
|
type: import("vue").PropType<import("../../shared/types").AnyObject[]>;
|
|
15
15
|
default: () => never[];
|
|
@@ -36,14 +36,14 @@ declare const Calendar: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
36
36
|
dayNames: string[];
|
|
37
37
|
cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
38
38
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
39
|
-
date: {
|
|
40
|
-
type: DateConstructor;
|
|
41
|
-
default: Date;
|
|
42
|
-
};
|
|
43
39
|
showDateNavigation: {
|
|
44
40
|
type: BooleanConstructor;
|
|
45
41
|
default: boolean;
|
|
46
42
|
};
|
|
43
|
+
date: {
|
|
44
|
+
type: DateConstructor;
|
|
45
|
+
default: Date;
|
|
46
|
+
};
|
|
47
47
|
events: {
|
|
48
48
|
type: import("vue").PropType<import("../../shared/types").AnyObject[]>;
|
|
49
49
|
default: () => never[];
|
|
@@ -224,20 +224,21 @@ declare const Calendar: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
224
224
|
[key: string]: any;
|
|
225
225
|
}>;
|
|
226
226
|
update: (before: () => void) => Promise<void>;
|
|
227
|
+
gotoDate: (date: Date) => void;
|
|
227
228
|
NIcon: any;
|
|
228
229
|
ChevronBackOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
229
230
|
ChevronForwardOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
230
231
|
FullCalendar: any;
|
|
231
232
|
isSameDay: typeof import("date-fns").isSameDay;
|
|
232
233
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "eventClick" | "eventDrag" | "eventResize" | "dateChange")[], "select" | "eventClick" | "eventDrag" | "eventResize" | "dateChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
233
|
-
date: {
|
|
234
|
-
type: DateConstructor;
|
|
235
|
-
default: Date;
|
|
236
|
-
};
|
|
237
234
|
showDateNavigation: {
|
|
238
235
|
type: BooleanConstructor;
|
|
239
236
|
default: boolean;
|
|
240
237
|
};
|
|
238
|
+
date: {
|
|
239
|
+
type: DateConstructor;
|
|
240
|
+
default: Date;
|
|
241
|
+
};
|
|
241
242
|
events: {
|
|
242
243
|
type: import("vue").PropType<import("../../shared/types").AnyObject[]>;
|
|
243
244
|
default: () => never[];
|
|
@@ -3,14 +3,14 @@ import { isSameDay } from 'date-fns';
|
|
|
3
3
|
import { IDayItem } from './types';
|
|
4
4
|
import { AnyObject } from '../../../shared/types';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
|
6
|
-
date: {
|
|
7
|
-
type: DateConstructor;
|
|
8
|
-
default: Date;
|
|
9
|
-
};
|
|
10
6
|
showDateNavigation: {
|
|
11
7
|
type: BooleanConstructor;
|
|
12
8
|
default: boolean;
|
|
13
9
|
};
|
|
10
|
+
date: {
|
|
11
|
+
type: DateConstructor;
|
|
12
|
+
default: Date;
|
|
13
|
+
};
|
|
14
14
|
events: {
|
|
15
15
|
type: PropType<AnyObject[]>;
|
|
16
16
|
default: () => never[];
|
|
@@ -33,14 +33,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
33
33
|
dayNames: string[];
|
|
34
34
|
cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
35
35
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
36
|
-
date: {
|
|
37
|
-
type: DateConstructor;
|
|
38
|
-
default: Date;
|
|
39
|
-
};
|
|
40
36
|
showDateNavigation: {
|
|
41
37
|
type: BooleanConstructor;
|
|
42
38
|
default: boolean;
|
|
43
39
|
};
|
|
40
|
+
date: {
|
|
41
|
+
type: DateConstructor;
|
|
42
|
+
default: Date;
|
|
43
|
+
};
|
|
44
44
|
events: {
|
|
45
45
|
type: PropType<AnyObject[]>;
|
|
46
46
|
default: () => never[];
|
|
@@ -217,20 +217,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
217
217
|
[key: string]: any;
|
|
218
218
|
}>;
|
|
219
219
|
update: (before: () => void) => Promise<void>;
|
|
220
|
+
gotoDate: (date: Date) => void;
|
|
220
221
|
NIcon: any;
|
|
221
222
|
ChevronBackOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
222
223
|
ChevronForwardOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
223
224
|
FullCalendar: any;
|
|
224
225
|
isSameDay: typeof isSameDay;
|
|
225
226
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "eventClick" | "eventDrag" | "eventResize" | "dateChange")[], "select" | "eventClick" | "eventDrag" | "eventResize" | "dateChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
226
|
-
date: {
|
|
227
|
-
type: DateConstructor;
|
|
228
|
-
default: Date;
|
|
229
|
-
};
|
|
230
227
|
showDateNavigation: {
|
|
231
228
|
type: BooleanConstructor;
|
|
232
229
|
default: boolean;
|
|
233
230
|
};
|
|
231
|
+
date: {
|
|
232
|
+
type: DateConstructor;
|
|
233
|
+
default: Date;
|
|
234
|
+
};
|
|
234
235
|
events: {
|
|
235
236
|
type: PropType<AnyObject[]>;
|
|
236
237
|
default: () => never[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,reactive as n,createVNode as a,createTextVNode as o,watch as r,openBlock as s,createElementBlock as i,normalizeStyle as l,unref as d,createElementVNode as
|
|
1
|
+
import{defineComponent as e,ref as t,reactive as n,createVNode as a,createTextVNode as o,watch as r,openBlock as s,createElementBlock as i,normalizeStyle as l,unref as d,createElementVNode as u,Fragment as c,renderList as m,normalizeClass as p,toDisplayString as v,createCommentVNode as y,createBlock as f,nextTick as h}from"vue";import{NIcon as C}from"naive-ui";import{ChevronBackOutline as g,ChevronForwardOutline as M}from"@vicons/ionicons5";import D from"@fullcalendar/vue3";import k from"@fullcalendar/resource-timegrid";import w from"@fullcalendar/scrollgrid";import b from"@fullcalendar/interaction";import{useTheme as H}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import{format as R,isSameDay as x,toDate as L,startOfMonth as j,endOfMonth as N,eachDayOfInterval as z,getDay as O,isSameMonth as S,startOfDay as T,endOfDay as F}from"date-fns";import{isFunction as I,cloneDeep as _}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";const A={key:0,class:"select-day-wrapper"},E={class:"day-wrapper"},G=["onClick"];var P=e({__name:"Calendar",props:{showDateNavigation:{type:Boolean,default:!0},date:{type:Date,default:new Date},events:{type:Array,default:()=>[]},resources:{type:Array,default:()=>[]},eventContentRender:{type:Function},resourceLabelContentRender:{type:Function},options:{type:Object,default:()=>({})}},emits:["select","eventDrag","eventClick","eventResize","dateChange"],setup(e,{expose:P,emit:B}){const K=e,V=["周一","周二","周三","周四","周五","周六","周日"],W=H(),q=t(),J=t(new Date),Q=t([]),U=t(!1),X=n({schedulerLicenseKey:"GPL-My-Project-Is-Open-Source",plugins:[k,w,b],initialView:"resourceTimeGridDay",initialDate:R(J.value,"yyyy-MM-dd"),headerToolbar:{left:"",center:"",right:""},allDaySlot:!1,slotLabelInterval:{minute:30},slotLabelFormat:{hour:"2-digit",minute:"2-digit",meridiem:!1,hour12:!1},slotLabelContent:e=>R(e.date,"HH:mm"),nowIndicator:!0,dayMaxEvents:!0,eventOverlap:!1,slotMinTime:{hour:0},slotMaxTime:{hour:24},dayMinWidth:100,expandRows:!0,droppable:!0,editable:!0,selectable:!0,refetchResourcesOnNavigate:!0,resources:[],events:[],dayCellClassNames:["custom-day-cell"],eventClassNames:["custom-event"],eventContent:function(e){const{start:t,end:n,title:r}=e.event;return I(K.eventContentRender)?K.eventContentRender(e):[a("p",{class:"text"},[R(t,"HH:mm"),o("-"),R(n,"HH:mm")]),a("p",{class:"text"},[r])]},resourceLabelContent:function(e){const{title:t}=e.resource;return I(K.resourceLabelContentRender)?K.resourceLabelContentRender(e):a("span",null,[t])},select:(...e)=>B("select",...e),eventDrop:(...e)=>B("eventDrag",...e),eventResize:(...e)=>B("eventResize",...e),eventClick:(...e)=>B("eventClick",...e)});function Y(e){const t=L(J.value);"prev"===e?t.setMonth(t.getMonth()-1):t.setMonth(t.getMonth()+1),Z(t),B("dateChange",$())}function Z(e){const t=j(e),n=N(e),a=z({start:t,end:n});Q.value=a.map((e=>({date:e,formatDate:R(e,"yyyy-MM-dd HH:mm:ss"),day:e.getDate(),week:V[O(e)]}))),J.value=S(e,new Date)?new Date:Q.value[0].date}function $(){const e=T(J.value),t=F(J.value);return{start:e,end:t,startStr:R(e,"yyyy-MM-dd HH:mm:ss"),endStr:R(t,"yyyy-MM-dd HH:mm:ss")}}return r((()=>J.value),(e=>{!async function(e){U.value=!1,await h(),e(),U.value=!0}((()=>{X.initialDate=R(e,"yyyy-MM-dd")}))})),r((()=>K.date),(e=>{Z(e)}),{immediate:!0}),r((()=>K.events),(e=>{X.events=_(e).map((e=>({...e,resourceEditable:!1})))}),{deep:!0,immediate:!0}),r((()=>K.resources),(e=>{X.resources=_(e)}),{deep:!0,immediate:!0}),r((()=>K.options),(()=>{Object.assign(X,K.options)}),{deep:!0,immediate:!0}),P({gotoDate:function(e){J.value=e}}),(t,n)=>(s(),i("div",{class:"c-calendar",style:l({...d(W),"--nav-height":e.showDateNavigation?"70px":"0px"})},[e.showDateNavigation?(s(),i("div",A,[a(d(C),{size:"20",component:d(g),onClick:n[0]||(n[0]=()=>Y("prev"))},null,8,["component"]),u("div",E,[(s(!0),i(c,null,m(Q.value,((e,t)=>(s(),i("div",{class:p(["day",{"day--active":d(x)(e.date,J.value)}]),key:t,onClick:()=>async function(e){J.value=e.date,B("dateChange",$())}(e)},[u("p",null,v(e.day),1),u("span",null,v(e.week),1)],10,G)))),128))]),a(d(C),{size:"20",component:d(M),onClick:n[1]||(n[1]=()=>Y("next"))},null,8,["component"])])):y("v-if",!0),U.value?(s(),f(d(D),{key:1,ref_key:"calendarRef",ref:q,options:X},null,8,["options"])):y("v-if",!0)],4))}});export{P as default};
|
|
@@ -169,6 +169,10 @@ export declare const CallbackMaps: Map<string, {
|
|
|
169
169
|
default: boolean;
|
|
170
170
|
};
|
|
171
171
|
forceClearable: BooleanConstructor;
|
|
172
|
+
wordSplitFilter: {
|
|
173
|
+
type: BooleanConstructor;
|
|
174
|
+
default: boolean;
|
|
175
|
+
};
|
|
172
176
|
}, {
|
|
173
177
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
174
178
|
fieldList: {
|
|
@@ -334,6 +338,10 @@ export declare const CallbackMaps: Map<string, {
|
|
|
334
338
|
default: boolean;
|
|
335
339
|
};
|
|
336
340
|
forceClearable: BooleanConstructor;
|
|
341
|
+
wordSplitFilter: {
|
|
342
|
+
type: BooleanConstructor;
|
|
343
|
+
default: boolean;
|
|
344
|
+
};
|
|
337
345
|
}>> & {
|
|
338
346
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
339
347
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
@@ -498,6 +506,7 @@ export declare const CallbackMaps: Map<string, {
|
|
|
498
506
|
operationalForm: import("../../../..").LowCodeTypes.operationalConfig[];
|
|
499
507
|
outBordered: boolean;
|
|
500
508
|
forceClearable: boolean;
|
|
509
|
+
wordSplitFilter: boolean;
|
|
501
510
|
}>) => Record<string, import("@formily/json-schema").Stringify<{
|
|
502
511
|
[key: symbol]: any;
|
|
503
512
|
[key: `x-${string}`]: any;
|
|
@@ -839,6 +848,10 @@ export declare const CallbackMaps: Map<string, {
|
|
|
839
848
|
default: boolean;
|
|
840
849
|
};
|
|
841
850
|
forceClearable: BooleanConstructor;
|
|
851
|
+
wordSplitFilter: {
|
|
852
|
+
type: BooleanConstructor;
|
|
853
|
+
default: boolean;
|
|
854
|
+
};
|
|
842
855
|
}>> & {
|
|
843
856
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
844
857
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
@@ -858,6 +871,7 @@ export declare const CallbackMaps: Map<string, {
|
|
|
858
871
|
uniqueCacheData: boolean;
|
|
859
872
|
outBordered: boolean;
|
|
860
873
|
forceClearable: boolean;
|
|
874
|
+
wordSplitFilter: boolean;
|
|
861
875
|
operationalFormInit: boolean;
|
|
862
876
|
}>;
|
|
863
877
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
@@ -3015,6 +3029,7 @@ export declare const CallbackMaps: Map<string, {
|
|
|
3015
3029
|
isTree?: import("../../../..").MaybeString<0 | 2 | 1 | 3> | undefined;
|
|
3016
3030
|
isBatchSelect?: import("../../../..").MaybeString<0 | 1> | undefined;
|
|
3017
3031
|
isSingleSelect?: import("../../../..").MaybeString<0 | 1> | undefined;
|
|
3032
|
+
dragScroll?: boolean | undefined;
|
|
3018
3033
|
selectType?: "checkbox" | "radio" | null | undefined;
|
|
3019
3034
|
rowDraggable?: boolean | undefined;
|
|
3020
3035
|
showSeq?: boolean | undefined;
|
|
@@ -3101,10 +3116,14 @@ export declare const CallbackMaps: Map<string, {
|
|
|
3101
3116
|
startDateField: string;
|
|
3102
3117
|
endDateField: string;
|
|
3103
3118
|
}[] | undefined;
|
|
3119
|
+
verticalConfig?: {
|
|
3120
|
+
enable?: boolean | undefined;
|
|
3121
|
+
} | undefined;
|
|
3104
3122
|
}>;
|
|
3105
3123
|
updateConfigRefDebounced: () => void;
|
|
3106
3124
|
updateConfigRef: () => void;
|
|
3107
3125
|
fieldListRef: import("vue").Ref<{
|
|
3126
|
+
[x: string]: any;
|
|
3108
3127
|
property?: string | undefined;
|
|
3109
3128
|
type?: import("vxe-table").VxeColumnPropTypes.Type | undefined;
|
|
3110
3129
|
field?: string | undefined;
|
|
@@ -3402,6 +3421,8 @@ export declare const CallbackMaps: Map<string, {
|
|
|
3402
3421
|
getTitle?: (() => string) | undefined;
|
|
3403
3422
|
getKey?: (() => string) | undefined;
|
|
3404
3423
|
annotation?: boolean | undefined;
|
|
3424
|
+
depth?: number | undefined;
|
|
3425
|
+
parent?: any | undefined;
|
|
3405
3426
|
}[]>;
|
|
3406
3427
|
updateFieldListRefDebounced: () => void;
|
|
3407
3428
|
updateFieldListRef: () => void;
|
|
@@ -5472,6 +5493,7 @@ export declare const CallbackMaps: Map<string, {
|
|
|
5472
5493
|
isTree?: import("../../../..").MaybeString<0 | 2 | 1 | 3> | undefined;
|
|
5473
5494
|
isBatchSelect?: import("../../../..").MaybeString<0 | 1> | undefined;
|
|
5474
5495
|
isSingleSelect?: import("../../../..").MaybeString<0 | 1> | undefined;
|
|
5496
|
+
dragScroll?: boolean | undefined;
|
|
5475
5497
|
selectType?: "checkbox" | "radio" | null | undefined;
|
|
5476
5498
|
rowDraggable?: boolean | undefined;
|
|
5477
5499
|
showSeq?: boolean | undefined;
|
|
@@ -5558,6 +5580,9 @@ export declare const CallbackMaps: Map<string, {
|
|
|
5558
5580
|
startDateField: string;
|
|
5559
5581
|
endDateField: string;
|
|
5560
5582
|
}[] | undefined;
|
|
5583
|
+
verticalConfig?: {
|
|
5584
|
+
enable?: boolean | undefined;
|
|
5585
|
+
} | undefined;
|
|
5561
5586
|
}>;
|
|
5562
5587
|
configChanged: boolean;
|
|
5563
5588
|
fieldChanged: boolean;
|
|
@@ -5567,6 +5592,7 @@ export declare const CallbackMaps: Map<string, {
|
|
|
5567
5592
|
footer: any;
|
|
5568
5593
|
slotPropertiesPicker: (args: import("../../../..").AnyObject) => Pick<import("../../../..").AnyObject, "row" | "column" | "rowIndex" | "checked" | "$rowIndex" | "disabled" | "columnIndex" | "$columnIndex" | "_columnIndex" | "indeterminate">;
|
|
5569
5594
|
useVersion: typeof import("../../../..").useVersion;
|
|
5595
|
+
NConfigProvider: any;
|
|
5570
5596
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "rowDrag" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd" | "pageChange")[], "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "rowDrag" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd" | "pageChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5571
5597
|
tableConfig: {
|
|
5572
5598
|
type: import("vue").PropType<import("../../../../../components/iho-table").IhoTableConfig>;
|
|
@@ -699,9 +699,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
699
699
|
handleInitConditions: () => Promise<void>;
|
|
700
700
|
validate: () => Promise<unknown>;
|
|
701
701
|
saveAdd: () => void;
|
|
702
|
-
/**
|
|
703
|
-
* 改变展示方式
|
|
704
|
-
*/
|
|
705
702
|
cancelSaveAdd: () => void;
|
|
706
703
|
checkActionList: () => boolean;
|
|
707
704
|
NSpin: any;
|
|
@@ -1450,6 +1447,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1450
1447
|
isSecondDisabled(second: number, minute: number | null, hour: number | null): boolean | 0;
|
|
1451
1448
|
};
|
|
1452
1449
|
NSelect: any;
|
|
1450
|
+
/**
|
|
1451
|
+
* 改变展示方式
|
|
1452
|
+
*/
|
|
1453
1453
|
NPopover: any;
|
|
1454
1454
|
CDatePicker: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
|
1455
1455
|
updateUnchangedValue: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{DragScroll,useDragScroll}from"./src/index.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Directive } from 'vue';
|
|
2
|
+
import { DragScrollConfig } from '../../../components/drag-scroll';
|
|
3
|
+
export declare function useDragScroll(uuid: any, config: DragScrollConfig): () => void;
|
|
4
|
+
export declare const DragScroll: Directive<HTMLElement, Partial<DragScrollConfig>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{findAncestor as e,isHTMLElement as t}from"../../../shared/utils/index.js";import{useThrottleFn as r}from"@vueuse/core";import{isFunction as s,isObject as l,isString as o,flow as n}from"lodash-es";import{unref as a}from"vue";const i={events:new Map,regist(e,t,r){window.addEventListener(t,r);const s=this.events.get(e)||[];s.push((()=>window.removeEventListener(t,r))),this.events.set(e,s)},stopper(e){var t;n(null!=(t=this.events.get(e))?t:[])(),this.events.delete(e)}};class c{constructor(){this.queue=[],this.lock=!1}add(e){this.queue.push(e),this.execute()}async execute(){if(!this.lock){this.lock=!0;try{for(;this.queue.length;)await this.queue.shift()()}finally{this.lock=!1}}}clear(){this.queue.length=0}}function u(t,o){var n;i.stopper(t);let a=0,u=0,g=0,d=0,p=!1;const f=new c;return i.regist(t,"mousemove",r((t=>{var r;if(!p){const r=h(o.dragEle);if(!r)return;if(!1!==o.changeCursor){const l=t.target;if(!e(l,(e=>e===r)))return;const n=!s(o.isDraggableEle)||o.isDraggableEle(t);r.style.cursor=n?"grab":"default"}return}const{pageX:l,pageY:n}=t,i=l-a,c=n-u;f.add((()=>{var e;s(o.setScrollState)?o.setScrollState(o.scrollTarget,{scrollLeft:Math.max(0,g-i),scrollTop:Math.max(0,d-c)}):null==(e=h(o.scrollTarget))||e.scrollTo(g-i,d-c)})),window.getSelection&&(null==(r=window.getSelection())||r.removeAllRanges())}),null!=(n=o.duration)?n:50)),i.regist(t,"mousedown",(t=>{const r=h(o.dragEle);if(!r)return;const n=t.target;if(!e(n,(e=>e===r)))return;if(!(!s(o.isDraggableEle)||o.isDraggableEle(t)))return;const i=s(o.getScrollState)?o.getScrollState(o.scrollTarget):h(o.scrollTarget);l(i)&&(a=t.pageX,u=t.pageY,g=i.scrollLeft,d=i.scrollTop,p=!0)})),i.regist(t,"mouseup",(()=>{p=!1,f.clear()})),()=>i.stopper(t)}const g={mounted(e,t){u(e,Object.assign({dragEle:e,scrollTarget:e},t.value))},unmounted(e){i.stopper(e)}};function h(e){return e=a(e),o(e)?document.querySelector(e):t(e)?e:l(e)?Reflect.get(e,"$el"):null}export{g as DragScroll,u as useDragScroll};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MaybeRef } from '@vueuse/shared';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
declare type TargetType = MaybeRef<HTMLElement | string | Component>;
|
|
4
|
+
export declare type DragScrollConfig = Partial<{
|
|
5
|
+
dragEle: TargetType;
|
|
6
|
+
changeCursor: boolean;
|
|
7
|
+
scrollTarget: TargetType;
|
|
8
|
+
duration: number;
|
|
9
|
+
isDraggableEle: (event: MouseEvent) => boolean;
|
|
10
|
+
getScrollState: (target: TargetType | undefined) => {
|
|
11
|
+
scrollTop: number;
|
|
12
|
+
scrollLeft: number;
|
|
13
|
+
};
|
|
14
|
+
setScrollState: (target: TargetType | undefined, state: {
|
|
15
|
+
scrollTop: number;
|
|
16
|
+
scrollLeft: number;
|
|
17
|
+
}) => void;
|
|
18
|
+
}>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|