cnhis-design-vue 3.1.15-beta.1 → 3.1.15-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/packages/annotation-edit/src/AnnotationEdit.js +2 -1
- package/es/packages/big-table/index.d.ts +8 -11
- package/es/packages/big-table/src/BigTable.vue.d.ts +24 -19
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +17 -11
- package/es/packages/big-table/src/bigTableProps.d.ts +4 -3
- package/es/packages/big-table/src/bigTableProps.js +1 -1
- package/es/packages/big-table/src/components/edit-form/edit-date.js +2 -1
- package/es/packages/big-table/src/components/edit-form/edit-select.js +2 -1
- package/es/packages/big-table/src/components/edit-form/edit-separate.js +8 -1
- package/es/packages/big-table/src/components/edit-form/edit-separate.vue.d.ts +2 -1
- package/es/packages/big-table/src/hooks/useAnnotation.d.ts +4 -0
- package/es/packages/big-table/src/hooks/useAnnotation.js +21 -0
- package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +7 -2
- package/es/packages/big-table/src/hooks/useEdit.d.ts +2 -1
- package/es/packages/big-table/style/index.css +27 -1
- package/es/packages/bpmn-workflow/src/BpmnWorkflow.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/BpmnRenderer.js +8 -8
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomContextPadProvider.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomPalette.js +1 -1
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRenderer.js +4 -3
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRules.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/index.js +1 -1
- package/es/packages/bpmn-workflow/src/custom/customOtherModule/CustomPopupMenu.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customOtherModule/zoomScroll.js +3 -3
- package/es/packages/button-print/src/utils/print.d.ts +1 -1
- package/es/packages/button-print/src/utils/print.js +1 -1
- package/es/packages/fabric-chart/index.d.ts +1 -0
- package/es/packages/fabric-chart/src/FabricChart.js +17 -17
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +12 -10
- package/es/packages/fabric-chart/src/hooks/useCenter.js +7 -5
- package/es/packages/fabric-chart/src/hooks/useCumputedPoint.js +4 -2
- package/es/packages/fabric-chart/src/hooks/useDraw.js +1 -0
- package/es/packages/fabric-chart/src/hooks/useLeft.js +5 -4
- package/es/packages/field-set/index.d.ts +4365 -0
- package/es/packages/field-set/src/FieldSet.js +53 -54
- package/es/packages/field-set/src/FieldSet.vue.d.ts +4365 -0
- package/es/packages/field-set/style/index.css +0 -9
- package/es/packages/form-config/index.d.ts +12111 -0
- package/es/packages/form-config/index.js +10 -0
- package/es/packages/form-config/src/FormConfig.js +113 -0
- package/es/packages/form-config/src/FormConfig.vue.d.ts +12113 -0
- package/es/packages/form-config/src/components/FormConfigCreator.js +97 -0
- package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +5094 -0
- package/es/packages/form-config/src/components/FormConfigEdit.js +81 -0
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +3591 -0
- package/es/packages/form-config/src/constants/index.d.ts +28 -0
- package/es/packages/form-config/src/constants/index.js +28 -0
- package/es/packages/form-config/src/hooks/index.d.ts +2 -0
- package/es/packages/form-config/src/hooks/index.js +2 -0
- package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +6 -0
- package/es/packages/form-config/src/hooks/useConfigurationField.js +103 -0
- package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +5 -0
- package/es/packages/form-config/src/hooks/usePresetRenderer.js +117 -0
- package/es/packages/form-config/src/hooks/useSortable.d.ts +11 -0
- package/es/packages/form-config/src/hooks/useSortable.js +31 -0
- package/es/packages/form-config/src/types/index.d.ts +18 -0
- package/es/packages/form-config/src/types/index.js +1 -0
- package/es/packages/form-config/style/index.css +108 -0
- package/es/packages/form-render/index.d.ts +24 -3
- package/es/packages/form-render/src/FormRender.js +10 -6
- package/es/packages/form-render/src/FormRender.vue.d.ts +24 -3
- package/es/packages/form-render/src/components/renderer/cascader.js +7 -7
- package/es/packages/form-render/src/components/renderer/combination/hooks/useDeepValidate.d.ts +5 -0
- package/es/packages/form-render/src/components/renderer/combination/hooks/useDeepValidate.js +32 -0
- package/es/packages/form-render/src/components/renderer/{combination.d.ts → combination/index.d.ts} +7 -1
- package/es/packages/form-render/src/components/renderer/combination/index.js +157 -0
- package/es/packages/form-render/src/components/renderer/complex.d.ts +2 -0
- package/es/packages/form-render/src/components/renderer/complex.js +2 -5
- package/es/packages/form-render/src/components/renderer/date.d.ts +29 -0
- package/es/packages/form-render/src/components/renderer/date.js +63 -56
- package/es/packages/form-render/src/components/renderer/formItem.js +3 -3
- package/es/packages/form-render/src/components/renderer/index.js +1 -1
- package/es/packages/form-render/src/components/renderer/radio.js +4 -1
- package/es/packages/form-render/src/components/renderer/select.d.ts +9 -0
- package/es/packages/form-render/src/components/renderer/select.js +28 -17
- package/es/packages/form-render/src/constants/index.d.ts +2 -1
- package/es/packages/form-render/src/hooks/useAnchor.d.ts +7 -6
- package/es/packages/form-render/src/hooks/useAnchor.js +1 -2
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +6 -1
- package/es/packages/form-render/src/hooks/useAsyncQueue.js +12 -7
- package/es/packages/form-render/src/hooks/useCommonInjection.d.ts +6 -0
- package/es/packages/form-render/src/hooks/useCommonInjection.js +19 -0
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +4 -5
- package/es/packages/form-render/src/hooks/useFormContext.d.ts +3 -3
- package/es/packages/form-render/src/hooks/useFormContext.js +21 -3
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +13 -0
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.js +10 -0
- package/es/packages/form-render/src/types/fieldItem.d.ts +16 -0
- package/es/packages/form-render/src/types/index.d.ts +30 -2
- package/es/packages/form-render/src/utils/index.d.ts +7 -5
- package/es/packages/form-render/src/utils/index.js +59 -11
- package/es/packages/form-render/style/index.css +11 -10
- package/es/packages/form-table/src/hooks/useNuiThemeOverrides.js +1 -1
- package/es/packages/index.css +147 -21
- package/es/packages/index.d.ts +3 -1
- package/es/packages/index.js +4 -1
- package/es/packages/info-header/index.d.ts +1 -3
- package/es/packages/info-header/src/HiddenContent.js +1 -1
- package/es/packages/info-header/src/HiddenContent.vue.d.ts +1 -3
- package/es/packages/info-header/src/InfoHeader.vue.d.ts +1 -3
- package/es/packages/info-header/style/index.css +1 -1
- package/es/packages/shortcut-provider/index.d.ts +2 -11
- package/es/packages/shortcut-provider/src/ShortcutProvider.js +1 -5
- package/es/packages/shortcut-provider/src/ShortcutProvider.vue.d.ts +2 -11
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.d.ts +11 -8
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +44 -28
- package/es/packages/shortcut-provider/src/types/index.d.ts +32 -4
- package/es/packages/shortcut-provider/src/utils/index.d.ts +3 -0
- package/es/packages/shortcut-provider/src/utils/index.js +15 -5
- package/es/packages/shortcut-setter/index.d.ts +32 -9
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +32 -9
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +8 -6
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +8 -6
- package/es/src/utils/state.d.ts +29 -0
- package/es/src/utils/state.js +44 -0
- package/package.json +10 -1
- package/es/_virtual/_commonjsHelpers.js +0 -7
- package/es/_virtual/css.escape.js +0 -3
- package/es/_virtual/inherits.js +0 -3
- package/es/_virtual/inherits_browser.js +0 -3
- package/es/node_modules/@formily/path/esm/contexts.js +0 -22
- package/es/node_modules/@formily/path/esm/destructor.js +0 -124
- package/es/node_modules/@formily/path/esm/index.js +0 -579
- package/es/node_modules/@formily/path/esm/matcher.js +0 -199
- package/es/node_modules/@formily/path/esm/parser.js +0 -402
- package/es/node_modules/@formily/path/esm/shared.js +0 -73
- package/es/node_modules/@formily/path/esm/tokenizer.js +0 -287
- package/es/node_modules/@formily/path/esm/tokens.js +0 -240
- package/es/node_modules/@formily/path/esm/types.js +0 -17
- package/es/node_modules/css.escape/css.escape.js +0 -110
- package/es/node_modules/date-fns/esm/_lib/defaultOptions/index.js +0 -6
- package/es/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js +0 -18
- package/es/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js +0 -17
- package/es/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js +0 -27
- package/es/node_modules/date-fns/esm/_lib/getUTCWeek/index.js +0 -17
- package/es/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js +0 -38
- package/es/node_modules/date-fns/esm/_lib/requiredArgs/index.js +0 -7
- package/es/node_modules/date-fns/esm/_lib/setUTCDay/index.js +0 -27
- package/es/node_modules/date-fns/esm/_lib/setUTCISODay/index.js +0 -23
- package/es/node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/setUTCWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js +0 -25
- package/es/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js +0 -21
- package/es/node_modules/date-fns/esm/_lib/toInteger/index.js +0 -15
- package/es/node_modules/date-fns/esm/compareAsc/index.js +0 -52
- package/es/node_modules/date-fns/esm/constants/index.js +0 -40
- package/es/node_modules/date-fns/esm/differenceInCalendarDays/index.js +0 -49
- package/es/node_modules/date-fns/esm/differenceInCalendarMonths/index.js +0 -35
- package/es/node_modules/date-fns/esm/differenceInCalendarYears/index.js +0 -33
- package/es/node_modules/date-fns/esm/differenceInDays/index.js +0 -86
- package/es/node_modules/date-fns/esm/differenceInMonths/index.js +0 -59
- package/es/node_modules/date-fns/esm/differenceInYears/index.js +0 -43
- package/es/node_modules/date-fns/esm/endOfDay/index.js +0 -30
- package/es/node_modules/date-fns/esm/endOfMonth/index.js +0 -32
- package/es/node_modules/date-fns/esm/isLastDayOfMonth/index.js +0 -30
- package/es/node_modules/date-fns/esm/parse/_lib/Parser.js +0 -32
- package/es/node_modules/date-fns/esm/parse/_lib/Setter.js +0 -37
- package/es/node_modules/date-fns/esm/parse/_lib/constants.js +0 -48
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMMidnightParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DateParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayOfYearParser.js +0 -52
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayPeriodParser.js +0 -56
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/EraParser.js +0 -53
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ExtendedYearParser.js +0 -30
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/FractionOfSecondParser.js +0 -29
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0To11Parser.js +0 -48
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0to23Parser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1To24Parser.js +0 -42
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1to12Parser.js +0 -50
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISODayParser.js +0 -99
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneParser.js +0 -46
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneWithZParser.js +0 -46
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekParser.js +0 -43
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekYearParser.js +0 -33
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalDayParser.js +0 -96
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekParser.js +0 -43
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekYearParser.js +0 -61
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/MinuteParser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/MonthParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/QuarterParser.js +0 -73
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/SecondParser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneLocalDayParser.js +0 -96
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneMonthParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneQuarterParser.js +0 -73
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampMillisecondsParser.js +0 -26
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampSecondsParser.js +0 -26
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/YearParser.js +0 -66
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/index.js +0 -109
- package/es/node_modules/date-fns/esm/parse/_lib/utils.js +0 -133
- package/es/node_modules/date-fns/esm/startOfDay/index.js +0 -30
- package/es/node_modules/date-fns/esm/toDate/index.js +0 -55
- package/es/node_modules/diagram-js/lib/command/CommandInterceptor.js +0 -139
- package/es/node_modules/diagram-js/lib/draw/BaseRenderer.js +0 -88
- package/es/node_modules/diagram-js/lib/features/popup-menu/PopupMenu.js +0 -591
- package/es/node_modules/diagram-js/lib/features/rules/RuleProvider.js +0 -88
- package/es/node_modules/diagram-js/lib/navigation/movecanvas/MoveCanvas.js +0 -120
- package/es/node_modules/diagram-js/lib/navigation/movecanvas/index.js +0 -8
- package/es/node_modules/diagram-js/lib/navigation/zoomscroll/ZoomScroll.js +0 -227
- package/es/node_modules/diagram-js/lib/navigation/zoomscroll/ZoomUtil.js +0 -24
- package/es/node_modules/diagram-js/lib/util/ClickTrap.js +0 -23
- package/es/node_modules/diagram-js/lib/util/Cursor.js +0 -20
- package/es/node_modules/diagram-js/lib/util/Event.js +0 -22
- package/es/node_modules/diagram-js/lib/util/Math.js +0 -9
- package/es/node_modules/diagram-js/lib/util/Mouse.js +0 -30
- package/es/node_modules/diagram-js/lib/util/Platform.js +0 -5
- package/es/node_modules/diagram-js/lib/util/PositionUtil.js +0 -8
- package/es/node_modules/diagram-js/lib/util/RenderUtil.js +0 -25
- package/es/node_modules/diagram-js/lib/util/SvgTransformUtil.js +0 -48
- package/es/node_modules/ids/dist/index.esm.js +0 -164
- package/es/node_modules/inherits/inherits.js +0 -19
- package/es/node_modules/inherits/inherits_browser.js +0 -38
- package/es/node_modules/inherits-browser/dist/index.es.js +0 -3
- package/es/node_modules/min-dash/dist/index.esm.js +0 -169
- package/es/node_modules/min-dom/dist/index.esm.js +0 -588
- package/es/node_modules/tiny-svg/dist/index.esm.js +0 -525
- package/es/packages/form-render/src/components/renderer/combination.js +0 -168
package/es/packages/index.css
CHANGED
|
@@ -291,7 +291,7 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
291
291
|
width: 100%;
|
|
292
292
|
}
|
|
293
293
|
.custom-big-table .filter-box .text-over-tooltip-components {
|
|
294
|
-
max-width: calc(100% -
|
|
294
|
+
max-width: calc(100% - 40px);
|
|
295
295
|
}
|
|
296
296
|
.custom-big-table .filter-box .vxe-filter--btn {
|
|
297
297
|
border-top-color: #c0c4cc;
|
|
@@ -539,6 +539,21 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
539
539
|
margin-right: 6px;
|
|
540
540
|
box-shadow: 0px 2px 4px 0px rgba(99, 129, 249, 0.5);
|
|
541
541
|
}
|
|
542
|
+
.annotation-edit {
|
|
543
|
+
cursor: pointer;
|
|
544
|
+
color: #0067ee;
|
|
545
|
+
font-size: 16px;
|
|
546
|
+
user-select: none;
|
|
547
|
+
display: inline-flex;
|
|
548
|
+
align-items: center;
|
|
549
|
+
}
|
|
550
|
+
.annotation-edit.is-active {
|
|
551
|
+
color: rgba(255, 152, 40);
|
|
552
|
+
}
|
|
553
|
+
.annotation-edit__icon {
|
|
554
|
+
display: inline-flex;
|
|
555
|
+
align-items: center;
|
|
556
|
+
}
|
|
542
557
|
.no-data-tip {
|
|
543
558
|
display: flex;
|
|
544
559
|
flex-direction: column;
|
|
@@ -601,6 +616,17 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
601
616
|
fill: currentColor;
|
|
602
617
|
overflow: hidden;
|
|
603
618
|
}
|
|
619
|
+
.vxe-header--column [annotation-hover-show='true'] {
|
|
620
|
+
visibility: hidden;
|
|
621
|
+
}
|
|
622
|
+
.vxe-header--column:hover [annotation-hover-show='true'] {
|
|
623
|
+
visibility: visible;
|
|
624
|
+
}
|
|
625
|
+
.big-table__annotationWrapper {
|
|
626
|
+
width: 20px;
|
|
627
|
+
display: inline-flex;
|
|
628
|
+
align-items: center;
|
|
629
|
+
}
|
|
604
630
|
.people-tree {
|
|
605
631
|
display: flex;
|
|
606
632
|
}
|
|
@@ -1027,15 +1053,6 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
1027
1053
|
height: 52px;
|
|
1028
1054
|
line-height: 52px;
|
|
1029
1055
|
}
|
|
1030
|
-
.c-field-set .set-show .alias-style {
|
|
1031
|
-
outline: none;
|
|
1032
|
-
border-radius: 4px 4px 4px 4px;
|
|
1033
|
-
border: solid 1px #d5d5d5;
|
|
1034
|
-
height: 32px;
|
|
1035
|
-
text-indent: 16px;
|
|
1036
|
-
color: #38454f;
|
|
1037
|
-
width: 100%;
|
|
1038
|
-
}
|
|
1039
1056
|
.c-field-set .set-show .is-sort-style {
|
|
1040
1057
|
outline: none;
|
|
1041
1058
|
border-radius: 4px 4px 4px 4px;
|
|
@@ -2694,7 +2711,7 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2694
2711
|
@font-face {
|
|
2695
2712
|
font-family: 'iconfont';
|
|
2696
2713
|
/* Project id 3468756 */
|
|
2697
|
-
src: url('./iconfont.ttf
|
|
2714
|
+
src: url('./iconfont.ttf') format('truetype');
|
|
2698
2715
|
}
|
|
2699
2716
|
.c-info-header .iconfont {
|
|
2700
2717
|
font-family: 'iconfont' !important;
|
|
@@ -2830,7 +2847,8 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2830
2847
|
.form-render__formItem {
|
|
2831
2848
|
grid-column: span var(--form-item-column) / span var(--form-item-column);
|
|
2832
2849
|
}
|
|
2833
|
-
.form-render__formItem .n-date-picker
|
|
2850
|
+
.form-render__formItem .n-date-picker,
|
|
2851
|
+
.form-render__formItem .n-input-number {
|
|
2834
2852
|
width: 100%;
|
|
2835
2853
|
}
|
|
2836
2854
|
.form-render__formItemLabel {
|
|
@@ -2847,6 +2865,15 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2847
2865
|
transform: translateY(-50%);
|
|
2848
2866
|
right: calc(var(--icon-right) * 1px);
|
|
2849
2867
|
}
|
|
2868
|
+
.form-render__formItem .n-form-item-label {
|
|
2869
|
+
display: inline-flex;
|
|
2870
|
+
}
|
|
2871
|
+
.form-render__formItem .n-form-item-label [annotation-hover-show='true'] {
|
|
2872
|
+
visibility: hidden;
|
|
2873
|
+
}
|
|
2874
|
+
.form-render__formItem .n-form-item-label:hover [annotation-hover-show='true'] {
|
|
2875
|
+
visibility: visible;
|
|
2876
|
+
}
|
|
2850
2877
|
.form-render__linebar {
|
|
2851
2878
|
grid-column: span var(--column) / span var(--column);
|
|
2852
2879
|
}
|
|
@@ -2936,15 +2963,6 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2936
2963
|
display: flex !important;
|
|
2937
2964
|
gap: 0 8px;
|
|
2938
2965
|
}
|
|
2939
|
-
.form-render .n-form-item-label {
|
|
2940
|
-
display: inline-flex;
|
|
2941
|
-
}
|
|
2942
|
-
.form-render .n-form-item-label [annotation-hover-show='true'] {
|
|
2943
|
-
visibility: hidden;
|
|
2944
|
-
}
|
|
2945
|
-
.form-render .n-form-item-label:hover [annotation-hover-show='true'] {
|
|
2946
|
-
visibility: visible;
|
|
2947
|
-
}
|
|
2948
2966
|
.c-fabric-chart-popup-tip,
|
|
2949
2967
|
.c-fabric-chart-popup-menu {
|
|
2950
2968
|
position: absolute;
|
|
@@ -3160,3 +3178,111 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3160
3178
|
.nodeTipContent li p {
|
|
3161
3179
|
margin: 0;
|
|
3162
3180
|
}
|
|
3181
|
+
.form-config {
|
|
3182
|
+
display: flex;
|
|
3183
|
+
justify-content: space-between;
|
|
3184
|
+
}
|
|
3185
|
+
.form-config__material {
|
|
3186
|
+
padding: 16px;
|
|
3187
|
+
box-sizing: border-box;
|
|
3188
|
+
width: 200px;
|
|
3189
|
+
min-height: 400px;
|
|
3190
|
+
background: white;
|
|
3191
|
+
}
|
|
3192
|
+
.form-config__materialHeader {
|
|
3193
|
+
display: flex;
|
|
3194
|
+
align-items: center;
|
|
3195
|
+
justify-content: space-between;
|
|
3196
|
+
height: 40px;
|
|
3197
|
+
}
|
|
3198
|
+
.form-config__materialContent {
|
|
3199
|
+
padding: 8px;
|
|
3200
|
+
display: flex;
|
|
3201
|
+
flex-direction: column;
|
|
3202
|
+
gap: 8px;
|
|
3203
|
+
}
|
|
3204
|
+
.form-config__materialContentItem {
|
|
3205
|
+
display: flex;
|
|
3206
|
+
align-items: center;
|
|
3207
|
+
padding: 8px;
|
|
3208
|
+
border: 1px dashed #d9d9d9;
|
|
3209
|
+
box-sizing: border-box;
|
|
3210
|
+
background-color: #fafafa;
|
|
3211
|
+
grid-column: span var(--item-column) / span var(--item-column);
|
|
3212
|
+
}
|
|
3213
|
+
.form-config__displayWrapper {
|
|
3214
|
+
padding: 16px;
|
|
3215
|
+
box-sizing: border-box;
|
|
3216
|
+
flex: 1;
|
|
3217
|
+
padding: 16px 0;
|
|
3218
|
+
}
|
|
3219
|
+
.form-config__displayHeader {
|
|
3220
|
+
display: flex;
|
|
3221
|
+
align-items: center;
|
|
3222
|
+
justify-content: space-between;
|
|
3223
|
+
height: 40px;
|
|
3224
|
+
}
|
|
3225
|
+
.form-config__displayContent {
|
|
3226
|
+
padding: 16px;
|
|
3227
|
+
box-sizing: border-box;
|
|
3228
|
+
height: fit-content;
|
|
3229
|
+
background: #eeeeee;
|
|
3230
|
+
display: grid !important;
|
|
3231
|
+
grid-template-columns: repeat(12, minmax(0px, 1fr));
|
|
3232
|
+
gap: 8px 16px;
|
|
3233
|
+
}
|
|
3234
|
+
.form-config__displayContentItem {
|
|
3235
|
+
grid-column: span var(--item-column) / span var(--item-column);
|
|
3236
|
+
position: relative;
|
|
3237
|
+
}
|
|
3238
|
+
.form-config__config {
|
|
3239
|
+
padding: 16px;
|
|
3240
|
+
box-sizing: border-box;
|
|
3241
|
+
width: 220px;
|
|
3242
|
+
background: white;
|
|
3243
|
+
}
|
|
3244
|
+
.form-config__renderer--default {
|
|
3245
|
+
display: flex;
|
|
3246
|
+
align-items: center;
|
|
3247
|
+
padding: 8px;
|
|
3248
|
+
border: 1px dashed #d9d9d9;
|
|
3249
|
+
box-sizing: border-box;
|
|
3250
|
+
background-color: #fafafa;
|
|
3251
|
+
user-select: none;
|
|
3252
|
+
position: relative;
|
|
3253
|
+
width: 100%;
|
|
3254
|
+
}
|
|
3255
|
+
.form-config__renderer--complex {
|
|
3256
|
+
border: 1px dashed lightblue;
|
|
3257
|
+
padding: 8px;
|
|
3258
|
+
}
|
|
3259
|
+
.form-config__renderer--complex--grid {
|
|
3260
|
+
display: grid !important;
|
|
3261
|
+
grid-template-columns: repeat(12, minmax(0px, 1fr));
|
|
3262
|
+
gap: 8px 16px;
|
|
3263
|
+
grid-column: span var(--item-column) / span var(--item-column);
|
|
3264
|
+
}
|
|
3265
|
+
.form-config__renderer--complex--flex {
|
|
3266
|
+
display: flex;
|
|
3267
|
+
}
|
|
3268
|
+
.form-config .is-disabled {
|
|
3269
|
+
background: #e5e5e5;
|
|
3270
|
+
}
|
|
3271
|
+
.form-config .is-required {
|
|
3272
|
+
padding-left: 16px !important;
|
|
3273
|
+
}
|
|
3274
|
+
.form-config .is-required::before {
|
|
3275
|
+
position: absolute;
|
|
3276
|
+
content: '*';
|
|
3277
|
+
left: 8px;
|
|
3278
|
+
color: red;
|
|
3279
|
+
}
|
|
3280
|
+
.form-config .is-active {
|
|
3281
|
+
color: #5585f5;
|
|
3282
|
+
}
|
|
3283
|
+
.form-config .is-choosing {
|
|
3284
|
+
box-shadow: #5585f5 0 0 0 2px !important;
|
|
3285
|
+
}
|
|
3286
|
+
.form-config .is-choosing-area {
|
|
3287
|
+
background: #f0f7ff;
|
|
3288
|
+
}
|
package/es/packages/index.d.ts
CHANGED
|
@@ -19,12 +19,14 @@ import CFormRender from './form-render';
|
|
|
19
19
|
import CFabricChart from './fabric-chart';
|
|
20
20
|
import CShortcutProvider from './shortcut-provider';
|
|
21
21
|
import CShortcutSetter from './shortcut-setter';
|
|
22
|
+
import CFormConfig from './form-config';
|
|
22
23
|
export * from './form-render';
|
|
23
24
|
export * from './shortcut-provider';
|
|
24
25
|
export * from './big-table';
|
|
25
26
|
export * from './button-print';
|
|
27
|
+
export * from './form-config';
|
|
26
28
|
declare function install(app: App): void;
|
|
27
|
-
export { CGrid, CBigTable, CFieldSet, CDragLayout, CButtonPrint, CSelectPerson, CSelectLabel, CLabelFormContent, CScaleView, CMap, CVodChunkUpload, CRadio, CCheckbox, CSelect, CDatetime, CFormTable, CInfoHeader, CTimeLine, CBpmnWorkflow, CStepsWheel, Editor, CFormRender, CFabricChart, CShortcutProvider, CShortcutSetter };
|
|
29
|
+
export { CGrid, CBigTable, CFieldSet, CDragLayout, CButtonPrint, CSelectPerson, CSelectLabel, CLabelFormContent, CScaleView, CMap, CVodChunkUpload, CRadio, CCheckbox, CSelect, CDatetime, CFormTable, CInfoHeader, CTimeLine, CBpmnWorkflow, CStepsWheel, Editor, CFormRender, CFabricChart, CShortcutProvider, CShortcutSetter, CFormConfig };
|
|
28
30
|
declare const _default: {
|
|
29
31
|
install: typeof install;
|
|
30
32
|
};
|
package/es/packages/index.js
CHANGED
|
@@ -38,6 +38,8 @@ import ShortcutProvider from './shortcut-provider/index.js';
|
|
|
38
38
|
export { default as CShortcutProvider } from './shortcut-provider/index.js';
|
|
39
39
|
import ShortcutSetter from './shortcut-setter/index.js';
|
|
40
40
|
export { default as CShortcutSetter } from './shortcut-setter/index.js';
|
|
41
|
+
import FormConfig from './form-config/index.js';
|
|
42
|
+
export { default as CFormConfig } from './form-config/index.js';
|
|
41
43
|
export { useFieldListAdaptor } from './form-render/src/hooks/useFieldListAdaptor.js';
|
|
42
44
|
export { useFormRequest } from './form-render/src/hooks/useFormRequest.js';
|
|
43
45
|
export { useCommonLog } from './form-render/src/hooks/useCommonLog.js';
|
|
@@ -82,7 +84,8 @@ const components = {
|
|
|
82
84
|
CFormRender: FormRender,
|
|
83
85
|
CFabricChart: FabricChart,
|
|
84
86
|
CShortcutProvider: ShortcutProvider,
|
|
85
|
-
CShortcutSetter: ShortcutSetter
|
|
87
|
+
CShortcutSetter: ShortcutSetter,
|
|
88
|
+
CFormConfig: FormConfig
|
|
86
89
|
};
|
|
87
90
|
function install(app) {
|
|
88
91
|
Object.values(components).forEach((component) => {
|
|
@@ -1965,9 +1965,7 @@ declare const InfoHeader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1965
1965
|
maxWidth: string;
|
|
1966
1966
|
width: string;
|
|
1967
1967
|
}>;
|
|
1968
|
-
parsedContentStyle: import("vue").ComputedRef<
|
|
1969
|
-
maxWidth: string;
|
|
1970
|
-
})>;
|
|
1968
|
+
parsedContentStyle: import("vue").ComputedRef<{}>;
|
|
1971
1969
|
displayContent: import("vue").ComputedRef<string>;
|
|
1972
1970
|
InfoEllipsis: import("vue").DefineComponent<{
|
|
1973
1971
|
content: {
|
|
@@ -23,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
23
|
});
|
|
24
24
|
const parsedContentStyle = computed(() => {
|
|
25
25
|
if (!props.width)
|
|
26
|
-
return
|
|
26
|
+
return {};
|
|
27
27
|
const maxWidth = props.width - 40 + "px";
|
|
28
28
|
return Object.assign({}, props.contentStyle, { maxWidth });
|
|
29
29
|
});
|
|
@@ -35,9 +35,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
35
35
|
maxWidth: string;
|
|
36
36
|
width: string;
|
|
37
37
|
}>;
|
|
38
|
-
parsedContentStyle: import("vue").ComputedRef<
|
|
39
|
-
maxWidth: string;
|
|
40
|
-
})>;
|
|
38
|
+
parsedContentStyle: import("vue").ComputedRef<{}>;
|
|
41
39
|
displayContent: import("vue").ComputedRef<string>;
|
|
42
40
|
InfoEllipsis: import("vue").DefineComponent<{
|
|
43
41
|
content: {
|
|
@@ -1966,9 +1966,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1966
1966
|
maxWidth: string;
|
|
1967
1967
|
width: string;
|
|
1968
1968
|
}>;
|
|
1969
|
-
parsedContentStyle: import("vue").ComputedRef<
|
|
1970
|
-
maxWidth: string;
|
|
1971
|
-
})>;
|
|
1969
|
+
parsedContentStyle: import("vue").ComputedRef<{}>;
|
|
1972
1970
|
displayContent: import("vue").ComputedRef<string>;
|
|
1973
1971
|
InfoEllipsis: import("vue").DefineComponent<{
|
|
1974
1972
|
content: {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
@font-face {
|
|
11
11
|
font-family: 'iconfont';
|
|
12
12
|
/* Project id 3468756 */
|
|
13
|
-
src: url('./iconfont.ttf
|
|
13
|
+
src: url('./iconfont.ttf') format('truetype');
|
|
14
14
|
}
|
|
15
15
|
.c-info-header .iconfont {
|
|
16
16
|
font-family: 'iconfont' !important;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { SFCWithInstall } from '../../../es/src/types';
|
|
2
2
|
export * from './src/hooks';
|
|
3
3
|
export * from './src/types';
|
|
4
|
-
declare const ShortcutProvider: SFCWithInstall<import("vue").DefineComponent<{
|
|
5
|
-
cacheKey: StringConstructor;
|
|
6
|
-
}, {
|
|
4
|
+
declare const ShortcutProvider: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
7
5
|
shortcutWrapperRef: import("vue").Ref<HTMLElement | undefined>;
|
|
8
|
-
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
-
cacheKey: StringConstructor;
|
|
10
|
-
}>> & {
|
|
11
|
-
[x: `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
12
|
-
}>>;
|
|
13
6
|
manager: import("./src/hooks").ShortcutManager;
|
|
14
|
-
},
|
|
15
|
-
cacheKey: StringConstructor;
|
|
16
|
-
}>>, {}>>;
|
|
7
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
17
8
|
export default ShortcutProvider;
|
|
@@ -5,13 +5,9 @@ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
|
5
5
|
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "ShortcutProvider",
|
|
8
|
-
props: {
|
|
9
|
-
cacheKey: String
|
|
10
|
-
},
|
|
11
8
|
setup(__props) {
|
|
12
|
-
const props = __props;
|
|
13
9
|
const shortcutWrapperRef = ref();
|
|
14
|
-
const manager = new ShortcutManager(shortcutWrapperRef
|
|
10
|
+
const manager = new ShortcutManager(shortcutWrapperRef).start();
|
|
15
11
|
provide(InjectionShortcutManager, manager);
|
|
16
12
|
onBeforeUnmount(() => {
|
|
17
13
|
manager.destroy();
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { ShortcutManager } from '../../../../es/packages/shortcut-provider';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<{
|
|
3
|
-
cacheKey: StringConstructor;
|
|
4
|
-
}, {
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
5
3
|
shortcutWrapperRef: import("vue").Ref<HTMLElement | undefined>;
|
|
6
|
-
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
-
cacheKey: StringConstructor;
|
|
8
|
-
}>> & {
|
|
9
|
-
[x: `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
10
|
-
}>>;
|
|
11
4
|
manager: ShortcutManager;
|
|
12
|
-
},
|
|
13
|
-
cacheKey: StringConstructor;
|
|
14
|
-
}>>, {}>;
|
|
5
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
15
6
|
export default _default;
|
|
@@ -5,12 +5,13 @@ export declare class ShortcutManager {
|
|
|
5
5
|
private readonly shortcutCache;
|
|
6
6
|
private readonly environmentEle;
|
|
7
7
|
private handle?;
|
|
8
|
+
disabled: boolean;
|
|
8
9
|
static log(message: string, dryRun?: boolean): string;
|
|
9
|
-
constructor(environmentEle?: MaybeRef<HTMLElement | undefined
|
|
10
|
-
get traverse():
|
|
11
|
-
query(key: string):
|
|
12
|
-
|
|
13
|
-
update(key: string, info
|
|
10
|
+
constructor(environmentEle?: MaybeRef<HTMLElement | undefined>);
|
|
11
|
+
get traverse(): Omit<ShortcutItem, "callback">[];
|
|
12
|
+
query(key: string): Omit<ShortcutItem, "callback">;
|
|
13
|
+
updateDisabled(key: string, state?: boolean): Promise<void>;
|
|
14
|
+
update(key: string, info?: KeyboardEvent | Partial<ShortcutSignatureInfo>): Promise<void>;
|
|
14
15
|
register(shortcutItem: ShortcutItem): {
|
|
15
16
|
stop: () => void;
|
|
16
17
|
signature: () => string;
|
|
@@ -23,8 +24,10 @@ export declare function useShortcuts(glob?: boolean): {
|
|
|
23
24
|
stop: () => void;
|
|
24
25
|
signature: () => string;
|
|
25
26
|
};
|
|
26
|
-
traverse: () =>
|
|
27
|
-
query: (key: string) =>
|
|
27
|
+
traverse: () => Omit<ShortcutItem, "callback">[];
|
|
28
|
+
query: (key: string) => Omit<ShortcutItem, "callback">;
|
|
28
29
|
update: (key: string, info: KeyboardEvent | Partial<ShortcutSignatureInfo>) => void;
|
|
29
|
-
|
|
30
|
+
onReset: (key: string) => void;
|
|
31
|
+
updateDisabled: (key: string, state?: boolean) => void;
|
|
32
|
+
updateManagerDisabled: (disabled?: boolean) => void;
|
|
30
33
|
};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { ShortcutStatus, InjectionShortcutManager } from '../../../../packages/shortcut-provider/src/constants';
|
|
2
|
-
import { getKeySignature, getDisplaySignature, isKeyboardEvent, findAncestor, isShortcutProvider } from '../../../../packages/shortcut-provider/src/utils';
|
|
3
|
-
import { reactive, unref, getCurrentInstance, inject, onBeforeUnmount } from 'vue';
|
|
4
|
-
import {
|
|
2
|
+
import { normalizeSignatureInfo, getKeySignature, getDisplaySignature, isInvalidSignature, isKeyboardEvent, findAncestor, isShortcutProvider } from '../../../../packages/shortcut-provider/src/utils';
|
|
3
|
+
import { reactive, ref, unref, getCurrentInstance, inject, onBeforeUnmount } from 'vue';
|
|
4
|
+
import { useEventListener, useDebounceFn } from '@vueuse/core';
|
|
5
5
|
import { pick, omit, isFunction, isString } from 'lodash-es';
|
|
6
6
|
|
|
7
7
|
class ShortcutManager {
|
|
8
|
-
constructor(environmentEle
|
|
8
|
+
constructor(environmentEle) {
|
|
9
9
|
this.shortcutCallbackMap = reactive(/* @__PURE__ */ new Map());
|
|
10
|
+
this.shortcutCache = ref({});
|
|
11
|
+
this.disabled = false;
|
|
10
12
|
this.environmentEle = environmentEle || window;
|
|
11
|
-
this.shortcutCache = useStorage(cacheKey, {}, localStorage, {
|
|
12
|
-
listenToStorageChanges: true,
|
|
13
|
-
deep: true
|
|
14
|
-
});
|
|
15
13
|
}
|
|
16
14
|
static log(message, dryRun = false) {
|
|
17
15
|
const _message = `[ShortcutManager] ${message}`;
|
|
@@ -24,30 +22,43 @@ class ShortcutManager {
|
|
|
24
22
|
query(key) {
|
|
25
23
|
return this.shortcutCache.value[key];
|
|
26
24
|
}
|
|
27
|
-
|
|
28
|
-
this.query(key) && (this.query(key).disabled = !!state);
|
|
29
|
-
}
|
|
30
|
-
update(key, info) {
|
|
25
|
+
async updateDisabled(key, state) {
|
|
31
26
|
var _a;
|
|
27
|
+
const item = this.query(key);
|
|
28
|
+
await ((_a = item.onUpdateDisabled) == null ? void 0 : _a.call(item, key, state));
|
|
29
|
+
item.disabled = !!state;
|
|
30
|
+
}
|
|
31
|
+
async update(key, info) {
|
|
32
|
+
var _a, _b;
|
|
32
33
|
const oldKeySignature = (_a = this.query(key)) == null ? void 0 : _a.currentKeySignature;
|
|
33
|
-
|
|
34
|
-
return;
|
|
35
|
-
if (Object.values(this.shortcutCache.value).some((v) => v.currentKeySignature === getKeySignature(info))) {
|
|
36
|
-
throw `\u91CD\u590D\u7684\u5FEB\u6377\u952E=> ${getDisplaySignature(info)}`;
|
|
37
|
-
}
|
|
34
|
+
info && checkSignature(this.shortcutCache, info);
|
|
38
35
|
const item = this.query(key);
|
|
39
36
|
if (!item)
|
|
40
37
|
return;
|
|
41
|
-
item.
|
|
42
|
-
|
|
38
|
+
const newInfo = await ((_b = item.onUpdate) == null ? void 0 : _b.call(item, key, info ? normalizeSignatureInfo(info) : void 0)) || info;
|
|
39
|
+
if (!newInfo)
|
|
40
|
+
return;
|
|
41
|
+
checkSignature(this.shortcutCache, newInfo);
|
|
42
|
+
item.currentKeySignature = getKeySignature(newInfo);
|
|
43
|
+
this.shortcutCallbackMap.set(item.currentKeySignature, this.shortcutCallbackMap.get(oldKeySignature));
|
|
43
44
|
this.shortcutCallbackMap.delete(oldKeySignature);
|
|
45
|
+
function checkSignature(shortcutCache, info2) {
|
|
46
|
+
if (oldKeySignature === getKeySignature(info2))
|
|
47
|
+
return;
|
|
48
|
+
if (Object.values(shortcutCache.value).some((v) => v.currentKeySignature === getKeySignature(info2))) {
|
|
49
|
+
throw `\u91CD\u590D\u7684\u5FEB\u6377\u952E=> ${getDisplaySignature(info2)}`;
|
|
50
|
+
}
|
|
51
|
+
if (isInvalidSignature(info2)) {
|
|
52
|
+
throw `\u975E\u6CD5\u7684\u5FEB\u6377\u952E=>${info2.key}`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
44
55
|
}
|
|
45
56
|
register(shortcutItem) {
|
|
46
57
|
const item = this.query(shortcutItem.key);
|
|
47
58
|
if (item) {
|
|
48
59
|
item.status = ShortcutStatus.ACTIVE;
|
|
49
60
|
this.shortcutCallbackMap.set(item.currentKeySignature, shortcutItem.callback);
|
|
50
|
-
Object.assign(item, pick(shortcutItem, ["debounce", "debounceOption", "label", "
|
|
61
|
+
Object.assign(item, pick(shortcutItem, ["debounce", "debounceOption", "label", "order", "key"]));
|
|
51
62
|
return createHandler(item);
|
|
52
63
|
}
|
|
53
64
|
this.shortcutCache.value[shortcutItem.key] = omit(shortcutItem, ["callback"]);
|
|
@@ -68,7 +79,7 @@ class ShortcutManager {
|
|
|
68
79
|
return this;
|
|
69
80
|
}
|
|
70
81
|
this.handle = async (event) => {
|
|
71
|
-
if (!isKeyboardEvent(event))
|
|
82
|
+
if (!isKeyboardEvent(event) || this.disabled)
|
|
72
83
|
return;
|
|
73
84
|
const providerWrapper = findAncestor(event.target, isShortcutProvider);
|
|
74
85
|
if (providerWrapper && providerWrapper !== unref(this.environmentEle)) {
|
|
@@ -107,10 +118,9 @@ function useShortcuts(glob = false) {
|
|
|
107
118
|
function createShortcutItem(shortcut) {
|
|
108
119
|
return {
|
|
109
120
|
...shortcut,
|
|
110
|
-
currentKeySignature: getKeySignature(shortcut.
|
|
121
|
+
currentKeySignature: getKeySignature(shortcut.shortcutSignature),
|
|
111
122
|
key: keyFor(shortcut),
|
|
112
123
|
status: ShortcutStatus.ACTIVE,
|
|
113
|
-
disabled: false,
|
|
114
124
|
callback: callbackFor(shortcut)
|
|
115
125
|
};
|
|
116
126
|
function callbackFor(shortcut2) {
|
|
@@ -132,10 +142,10 @@ function useShortcuts(glob = false) {
|
|
|
132
142
|
}
|
|
133
143
|
function register(shortcut) {
|
|
134
144
|
const { stop, signature } = manager.register(createShortcutItem(shortcut));
|
|
135
|
-
if (getCurrentInstance()) {
|
|
145
|
+
if (getCurrentInstance() && !glob) {
|
|
136
146
|
onBeforeUnmount(stop);
|
|
137
147
|
} else {
|
|
138
|
-
ShortcutManager.log("\u5728\u975Esetup\u8BED\u5883\u4E0B\u4F7F\u7528register\u51FD\u6570,\u7EC4\u4EF6\u9500\u6BC1\u65F6\u9700\u8981\u624B\u52A8\u8C03\u7528stop\u51FD\u6570\u4F7F\u5FEB\u6377\u952E\u5931\u6D3B");
|
|
148
|
+
ShortcutManager.log("\u5728\u975Esetup\u8BED\u5883\u4E0B\u4F7F\u7528register\u51FD\u6570,\u7EC4\u4EF6\u9500\u6BC1\u65F6\u53EF\u80FD\u9700\u8981\u624B\u52A8\u8C03\u7528stop\u51FD\u6570\u4F7F\u5FEB\u6377\u952E\u5931\u6D3B");
|
|
139
149
|
}
|
|
140
150
|
return { stop, signature };
|
|
141
151
|
}
|
|
@@ -148,10 +158,16 @@ function useShortcuts(glob = false) {
|
|
|
148
158
|
function update(key, info) {
|
|
149
159
|
manager.update(key, info);
|
|
150
160
|
}
|
|
151
|
-
function
|
|
152
|
-
manager.
|
|
161
|
+
function onReset(key) {
|
|
162
|
+
manager.update(key);
|
|
163
|
+
}
|
|
164
|
+
function updateDisabled(key, state) {
|
|
165
|
+
manager.updateDisabled(key, state);
|
|
166
|
+
}
|
|
167
|
+
function updateManagerDisabled(disabled) {
|
|
168
|
+
manager.disabled = !!disabled;
|
|
153
169
|
}
|
|
154
|
-
return { register, traverse, query, update,
|
|
170
|
+
return { register, traverse, query, update, onReset, updateDisabled, updateManagerDisabled };
|
|
155
171
|
}
|
|
156
172
|
|
|
157
173
|
export { ShortcutManager, useShortcuts };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrayAble } from '../../../../../es/src/types';
|
|
1
|
+
import { ArrayAble, WithUndefined } from '../../../../../es/src/types';
|
|
2
2
|
import { VNode } from 'vue';
|
|
3
3
|
import { ShortcutStatus } from '../../../../../es/packages/shortcut-provider/src/constants';
|
|
4
4
|
declare type Render = () => ArrayAble<VNode>;
|
|
@@ -8,25 +8,53 @@ export interface ShortcutSignatureInfo {
|
|
|
8
8
|
alt?: boolean;
|
|
9
9
|
key: string;
|
|
10
10
|
}
|
|
11
|
+
declare type UpdateResult = Promise<WithUndefined<ShortcutSignatureInfo> | void>;
|
|
11
12
|
export declare type ShortcutOption = {
|
|
12
13
|
label: string | Render;
|
|
13
|
-
|
|
14
|
+
shortcutSignature: ShortcutSignatureInfo;
|
|
14
15
|
callback(): void;
|
|
15
16
|
} & Partial<{
|
|
17
|
+
/**
|
|
18
|
+
* @description 重置时回调
|
|
19
|
+
* @param key
|
|
20
|
+
*/
|
|
21
|
+
onReset(key: string): Promise<any>;
|
|
22
|
+
/**
|
|
23
|
+
* @description 更新快捷键回调
|
|
24
|
+
* @param key
|
|
25
|
+
* @param newSignature 用户输入的快捷键签名
|
|
26
|
+
* @return
|
|
27
|
+
*/
|
|
28
|
+
onUpdate(key: string, newSignature?: ShortcutSignatureInfo): UpdateResult;
|
|
29
|
+
/**
|
|
30
|
+
* @description 更新快捷键disabled状态回调
|
|
31
|
+
* @param key
|
|
32
|
+
* @param newState
|
|
33
|
+
*/
|
|
34
|
+
onUpdateDisabled(key: string, newState?: boolean): Promise<any>;
|
|
35
|
+
/**
|
|
36
|
+
* 快捷键输入框展位文本
|
|
37
|
+
*/
|
|
16
38
|
placeholder: string;
|
|
39
|
+
/**
|
|
40
|
+
* 快捷键输入框编辑状态下的展位文本
|
|
41
|
+
*/
|
|
17
42
|
editPlaceholder: string;
|
|
18
43
|
key: string;
|
|
19
44
|
order: number;
|
|
45
|
+
disabled: boolean;
|
|
20
46
|
debounce: boolean;
|
|
21
47
|
debounceOption: {
|
|
22
48
|
duration?: number;
|
|
23
49
|
};
|
|
24
|
-
|
|
50
|
+
/**
|
|
51
|
+
* 快捷键编辑组件的操作按钮
|
|
52
|
+
*/
|
|
53
|
+
operation: Array<'state' | 'reset'>;
|
|
25
54
|
}>;
|
|
26
55
|
export interface ShortcutItem extends ShortcutOption {
|
|
27
56
|
status: ShortcutStatus;
|
|
28
57
|
currentKeySignature: string;
|
|
29
58
|
key: string;
|
|
30
|
-
disabled: boolean;
|
|
31
59
|
}
|
|
32
60
|
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ShortcutSignatureInfo } from '../../../../../es/packages/shortcut-provider/src/types';
|
|
2
2
|
export declare function isKeyboardEvent(event: any): event is KeyboardEvent;
|
|
3
|
+
export declare function normalizeSignatureInfo(info: KeyboardEvent | Partial<ShortcutSignatureInfo>): Required<ShortcutSignatureInfo>;
|
|
3
4
|
export declare function getKeySignature(info: KeyboardEvent | Partial<ShortcutSignatureInfo>): string;
|
|
5
|
+
export declare function inKeyBlackList(key: string): boolean | undefined;
|
|
6
|
+
export declare function isInvalidSignature(info: KeyboardEvent | Partial<ShortcutSignatureInfo>): boolean | undefined;
|
|
4
7
|
export declare function getDisplaySignature(info: KeyboardEvent | Partial<ShortcutSignatureInfo>): string;
|
|
5
8
|
export declare function transformKey2DisplaySignature(keySignature: string): string;
|
|
6
9
|
export declare function isShortcutProvider(ele: HTMLElement): boolean;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isString } from 'lodash-es';
|
|
2
|
+
|
|
1
3
|
function isKeyboardEvent(event) {
|
|
2
4
|
return Reflect.get(event, "view") === window && Reflect.get(event, "shiftKey") != void 0;
|
|
3
5
|
}
|
|
@@ -21,12 +23,20 @@ function getKeySignature(info) {
|
|
|
21
23
|
return `${ctrl ? "Ctrl_" : ""}${shift ? "Shift_" : ""}${alt ? "Alt_" : ""}${key}`;
|
|
22
24
|
}
|
|
23
25
|
const keyBlackList = ["CONTROL", "ALT", "SHIFT"];
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
function inKeyBlackList(key) {
|
|
27
|
+
if (!isString(key))
|
|
28
|
+
return;
|
|
29
|
+
return keyBlackList.includes(key.toUpperCase());
|
|
30
|
+
}
|
|
31
|
+
function isInvalidSignature(info) {
|
|
32
|
+
const { ctrl, shift, alt, key } = normalizeSignatureInfo(info);
|
|
33
|
+
if (!ctrl && !shift && !alt)
|
|
34
|
+
return !/F\d/.test(key);
|
|
35
|
+
return inKeyBlackList(key);
|
|
36
|
+
}
|
|
27
37
|
function getDisplaySignature(info) {
|
|
28
38
|
const { ctrl, shift, alt, key } = normalizeSignatureInfo(info);
|
|
29
|
-
return `${ctrl ? "Ctrl+ " : ""}${alt ? "Alt + " : ""}${shift ? "Shift + " : ""}${
|
|
39
|
+
return `${ctrl ? "Ctrl+ " : ""}${alt ? "Alt + " : ""}${shift ? "Shift + " : ""}${inKeyBlackList(key) ? "" : key}`;
|
|
30
40
|
}
|
|
31
41
|
function transformKey2DisplaySignature(keySignature) {
|
|
32
42
|
return keySignature.replace(/_/g, " + ");
|
|
@@ -46,4 +56,4 @@ function findAncestor(ele, finder) {
|
|
|
46
56
|
return next;
|
|
47
57
|
}
|
|
48
58
|
|
|
49
|
-
export { findAncestor, getDisplaySignature, getKeySignature, isKeyboardEvent, isShortcutProvider, transformKey2DisplaySignature };
|
|
59
|
+
export { findAncestor, getDisplaySignature, getKeySignature, inKeyBlackList, isInvalidSignature, isKeyboardEvent, isShortcutProvider, normalizeSignatureInfo, transformKey2DisplaySignature };
|