@gct-paas/render 0.1.4-dev.8 → 0.1.5-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/index.min.css +2 -0
  2. package/dist/loader.esm.min.js +1 -0
  3. package/es/Event/Dependency/controller.d.ts +13 -0
  4. package/es/Event/Dependency/controller.mjs +84 -0
  5. package/es/Event/Dependency/displayRule.d.ts +19 -0
  6. package/es/Event/Dependency/displayRule.mjs +138 -0
  7. package/es/Event/Dependency/useDependency.d.ts +7 -0
  8. package/es/Event/Dependency/useDependency.mjs +117 -0
  9. package/es/Event/Dependency/useDependencyToShow.d.ts +10 -0
  10. package/es/Event/Dependency/useDependencyToShow.mjs +113 -0
  11. package/es/Event/baseEvent.d.ts +156 -0
  12. package/es/Event/baseEvent.mjs +389 -0
  13. package/es/Event/bizServiceRequest.d.ts +26 -0
  14. package/es/Event/bizServiceRequest.mjs +35 -0
  15. package/es/Event/eventType.d.ts +20 -0
  16. package/es/Event/eventType.mjs +1 -0
  17. package/es/Event/index.d.ts +7 -0
  18. package/es/Event/index.mjs +7 -0
  19. package/es/Event/utils/appRedis.d.ts +29 -0
  20. package/es/Event/utils/appRedis.mjs +40 -0
  21. package/es/Event/utils/globalLoading.d.ts +13 -0
  22. package/es/Event/utils/globalLoading.mjs +104 -0
  23. package/es/Event/utils/processRovedInfo.d.ts +100 -0
  24. package/es/Event/utils/processRovedInfo.mjs +231 -0
  25. package/es/Event/utils/runGlobalByPage.d.ts +335 -0
  26. package/es/Event/utils/runGlobalByPage.mjs +302 -0
  27. package/es/Event/utils/verificationVar.d.ts +2 -0
  28. package/es/Event/utils/verificationVar.mjs +36 -0
  29. package/es/_virtual/_plugin-vue_export-helper.mjs +8 -0
  30. package/es/_virtual/_rolldown/runtime.mjs +13 -0
  31. package/es/components/HandwritingPad.vue.d.ts +27 -0
  32. package/es/components/HandwritingPad.vue.mjs +7 -0
  33. package/es/components/HandwritingPad.vue_vue_type_script_setup_true_name_HandwritingPad_lang.mjs +109 -0
  34. package/es/components/HandwritingPad.vue_vue_type_style_index_0_scoped_d5b980b7_lang.css +9 -0
  35. package/es/components/index.d.ts +2 -0
  36. package/es/components/index.mjs +1 -0
  37. package/es/constant/data-format.d.ts +52 -0
  38. package/es/constant/data-format.mjs +66 -0
  39. package/es/constant/date-time.d.ts +99 -0
  40. package/es/constant/date-time.mjs +187 -0
  41. package/es/constant/index.d.ts +94 -0
  42. package/es/constant/index.mjs +100 -0
  43. package/es/controller/design-render/design-render.controller.d.ts +18 -0
  44. package/es/controller/design-render/design-render.controller.mjs +78 -0
  45. package/es/controller/design-render-base/design-render-base.controller.d.ts +9 -0
  46. package/es/controller/design-render-base/design-render-base.controller.mjs +12 -0
  47. package/es/controller/design-render-container/design-render-container.controller.d.ts +4 -0
  48. package/es/controller/design-render-container/design-render-container.controller.mjs +5 -0
  49. package/es/controller/design-render-item/design-render-item.controller.d.ts +4 -0
  50. package/es/controller/design-render-item/design-render-item.controller.mjs +5 -0
  51. package/es/controller/index.d.ts +4 -0
  52. package/es/controller/index.mjs +4 -0
  53. package/es/enums/index.d.ts +14 -0
  54. package/es/enums/index.mjs +18 -0
  55. package/es/hooks/index.d.ts +2 -0
  56. package/es/hooks/index.mjs +2 -0
  57. package/es/hooks/use-design-render-controller/use-design-render-controller.d.ts +11 -0
  58. package/es/hooks/use-design-render-controller/use-design-render-controller.mjs +32 -0
  59. package/es/hooks/useStorageRef.d.ts +9 -0
  60. package/es/hooks/useStorageRef.mjs +37 -0
  61. package/es/index.d.ts +6 -0
  62. package/es/index.mjs +36 -1
  63. package/es/interface/controller/i-design-render-base.controller.d.ts +43 -0
  64. package/es/interface/controller/i-design-render-container.controller.d.ts +7 -0
  65. package/es/interface/controller/i-design-render-item.controller.d.ts +7 -0
  66. package/es/interface/controller/i-design-render.controller.d.ts +93 -0
  67. package/es/interface/index.d.ts +12 -0
  68. package/es/interface/provider/i-render-base-node.provider.d.ts +45 -0
  69. package/es/interface/provider/i-render-container-node.provider.d.ts +30 -0
  70. package/es/interface/provider/i-render-editor-node.provider.d.ts +29 -0
  71. package/es/interface/provider/i-render-item-node.provider.d.ts +30 -0
  72. package/es/interface/state/i-design-render-base.state.d.ts +19 -0
  73. package/es/interface/state/i-design-render-container.state.d.ts +11 -0
  74. package/es/interface/state/i-design-render-item.state.d.ts +11 -0
  75. package/es/interface/state/i-design-render.state.d.ts +18 -0
  76. package/es/loader.d.ts +1 -0
  77. package/es/register/index.d.ts +2 -0
  78. package/es/register/index.mjs +2 -0
  79. package/es/register/node/node.register.d.ts +92 -0
  80. package/es/register/node/node.register.mjs +116 -0
  81. package/es/register/render-register/render-register.d.ts +54 -0
  82. package/es/register/render-register/render-register.mjs +64 -0
  83. package/es/state/design-render/design-render.state.d.ts +13 -0
  84. package/es/state/design-render/design-render.state.mjs +15 -0
  85. package/es/state/design-render-base/design-render-base.state.d.ts +4 -0
  86. package/es/state/design-render-base/design-render-base.state.mjs +6 -0
  87. package/es/state/design-render-container/design-render-container.state.d.ts +4 -0
  88. package/es/state/design-render-item/design-render-item.state.d.ts +4 -0
  89. package/es/state/index.d.ts +4 -0
  90. package/es/types/index.d.ts +6 -0
  91. package/es/utils/cacheAdapter.d.ts +7 -0
  92. package/es/utils/cacheAdapter.mjs +65 -0
  93. package/es/utils/expression/index.d.ts +6 -0
  94. package/es/utils/expression/index.mjs +116 -0
  95. package/es/utils/expression/regularExpression/methods.d.ts +77 -0
  96. package/es/utils/expression/regularExpression/methods.mjs +588 -0
  97. package/es/utils/field-attrs/basicAttrs.mjs +56 -80
  98. package/es/utils/field-attrs/index.d.ts +1 -1
  99. package/es/utils/field-attrs/index.mjs +16 -13
  100. package/es/utils/get-ref-data.d.ts +1 -0
  101. package/es/utils/get-ref-data.mjs +44 -0
  102. package/es/utils/getFieldSchema.d.ts +1 -3
  103. package/es/utils/getFieldSchema.mjs +69 -0
  104. package/es/utils/index.d.ts +8 -0
  105. package/es/utils/index.mjs +11 -0
  106. package/es/utils/model-transformer.d.ts +46 -0
  107. package/es/utils/model-transformer.mjs +87 -0
  108. package/es/utils/render-plugin-pkg-util/render-plugin-pkg-util.d.ts +43 -0
  109. package/es/utils/render-plugin-pkg-util/render-plugin-pkg-util.mjs +65 -0
  110. package/es/utils/search/index.d.ts +2 -0
  111. package/es/utils/search/index.mjs +2 -0
  112. package/es/utils/search/search-default-value.d.ts +7 -0
  113. package/es/utils/search/search-default-value.mjs +244 -0
  114. package/es/utils/search/search-hooks.d.ts +6 -0
  115. package/es/utils/search/search-hooks.mjs +67 -0
  116. package/es/utils/useStyle.d.ts +21 -0
  117. package/es/utils/useStyle.mjs +22 -0
  118. package/package.json +33 -11
  119. package/dist/index.esm.min.mjs +0 -89
  120. package/dist/index.min.cjs +0 -1
  121. package/dist/index.system.min.js +0 -1
@@ -0,0 +1,27 @@
1
+ type __VLS_Props = {
2
+ width?: number;
3
+ height?: number;
4
+ backgroundColor?: string;
5
+ lineWidth?: number;
6
+ strokeStyle?: string;
7
+ };
8
+ /** 清空 */
9
+ declare function clear(): void;
10
+ /** 获取签名 */
11
+ declare function getValue(): string | undefined;
12
+ /** 回显 */
13
+ declare function setValue(base64: string): void;
14
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
15
+ getValue: typeof getValue;
16
+ setValue: typeof setValue;
17
+ clear: typeof clear;
18
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
19
+ width: number;
20
+ height: number;
21
+ backgroundColor: string;
22
+ lineWidth: number;
23
+ strokeStyle: string;
24
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
25
+ canvasRef: HTMLCanvasElement;
26
+ }, HTMLDivElement>;
27
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import HandwritingPad_vue_vue_type_script_setup_true_name_HandwritingPad_lang_default from "./HandwritingPad.vue_vue_type_script_setup_true_name_HandwritingPad_lang.mjs";
2
+ import './HandwritingPad.vue_vue_type_style_index_0_scoped_d5b980b7_lang.css';/* empty css */
3
+ import _plugin_vue_export_helper_default from "../_virtual/_plugin-vue_export-helper.mjs";
4
+ //#region src/components/HandwritingPad.vue
5
+ var HandwritingPad_default = /* @__PURE__ */ _plugin_vue_export_helper_default(HandwritingPad_vue_vue_type_script_setup_true_name_HandwritingPad_lang_default, [["__scopeId", "data-v-d5b980b7"]]);
6
+ //#endregion
7
+ export { HandwritingPad_default as default };
@@ -0,0 +1,109 @@
1
+ import { createElementBlock, createElementVNode, defineComponent, onMounted, openBlock, ref } from "vue";
2
+ //#region src/components/HandwritingPad.vue?vue&type=script&setup=true&name=HandwritingPad&lang.ts
3
+ var _hoisted_1 = { class: "handwriting-pad" };
4
+ var _hoisted_2 = ["width", "height"];
5
+ var HandwritingPad_vue_vue_type_script_setup_true_name_HandwritingPad_lang_default = /* @__PURE__ */ defineComponent({
6
+ __name: "HandwritingPad",
7
+ props: {
8
+ width: { default: 300 },
9
+ height: { default: 150 },
10
+ backgroundColor: { default: "transparent" },
11
+ lineWidth: { default: 2 },
12
+ strokeStyle: { default: "#000" }
13
+ },
14
+ setup(__props, { expose: __expose }) {
15
+ const props = __props;
16
+ const canvasRef = ref(null);
17
+ let ctx = null;
18
+ let isDrawing = false;
19
+ let startX = 0;
20
+ let startY = 0;
21
+ onMounted(() => {
22
+ ctx = canvasRef.value.getContext("2d");
23
+ if (props.backgroundColor !== "transparent") {
24
+ ctx.fillStyle = props.backgroundColor;
25
+ ctx.fillRect(0, 0, props.width, props.height);
26
+ }
27
+ ctx.lineWidth = props.lineWidth;
28
+ ctx.strokeStyle = props.strokeStyle;
29
+ });
30
+ /** 统一坐标获取 */
31
+ function getPoint(e) {
32
+ const rect = canvasRef.value.getBoundingClientRect();
33
+ if ("touches" in e) return {
34
+ x: e.touches[0].clientX - rect.left,
35
+ y: e.touches[0].clientY - rect.top
36
+ };
37
+ return {
38
+ x: e.offsetX,
39
+ y: e.offsetY
40
+ };
41
+ }
42
+ function start(e) {
43
+ e.preventDefault();
44
+ isDrawing = true;
45
+ const { x, y } = getPoint(e);
46
+ startX = x;
47
+ startY = y;
48
+ }
49
+ function move(e) {
50
+ if (!isDrawing || !ctx) return;
51
+ e.preventDefault();
52
+ const { x, y } = getPoint(e);
53
+ ctx.beginPath();
54
+ ctx.moveTo(startX, startY);
55
+ ctx.lineTo(x, y);
56
+ ctx.stroke();
57
+ ctx.closePath();
58
+ startX = x;
59
+ startY = y;
60
+ }
61
+ function end(e) {
62
+ e.preventDefault();
63
+ isDrawing = false;
64
+ }
65
+ /** 清空 */
66
+ function clear() {
67
+ ctx?.clearRect(0, 0, props.width, props.height);
68
+ if (props.backgroundColor !== "transparent") {
69
+ ctx.fillStyle = props.backgroundColor;
70
+ ctx.fillRect(0, 0, props.width, props.height);
71
+ }
72
+ }
73
+ /** 获取签名 */
74
+ function getValue() {
75
+ return canvasRef.value?.toDataURL();
76
+ }
77
+ /** 回显 */
78
+ function setValue(base64) {
79
+ const img = new Image();
80
+ img.src = base64;
81
+ img.onload = () => {
82
+ ctx?.drawImage(img, 0, 0);
83
+ };
84
+ }
85
+ __expose({
86
+ getValue,
87
+ setValue,
88
+ clear
89
+ });
90
+ return (_ctx, _cache) => {
91
+ return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("canvas", {
92
+ ref_key: "canvasRef",
93
+ ref: canvasRef,
94
+ width: __props.width,
95
+ height: __props.height,
96
+ class: "canvas",
97
+ onMousedown: start,
98
+ onMousemove: move,
99
+ onMouseup: end,
100
+ onMouseleave: end,
101
+ onTouchstart: start,
102
+ onTouchmove: move,
103
+ onTouchend: end
104
+ }, null, 40, _hoisted_2)]);
105
+ };
106
+ }
107
+ });
108
+ //#endregion
109
+ export { HandwritingPad_vue_vue_type_script_setup_true_name_HandwritingPad_lang_default as default };
@@ -0,0 +1,9 @@
1
+
2
+ .handwriting-pad[data-v-d5b980b7] {
3
+ display: inline-block;
4
+ }
5
+ .canvas[data-v-d5b980b7] {
6
+ display: block;
7
+ background: transparent;
8
+ touch-action: none;
9
+ }
@@ -0,0 +1,2 @@
1
+ import { default as HandwritingPad } from './HandwritingPad.vue';
2
+ export { HandwritingPad };
@@ -0,0 +1 @@
1
+ import "./HandwritingPad.vue.mjs";
@@ -0,0 +1,52 @@
1
+ export declare const DateFormat: {
2
+ YYYY: {
3
+ valueFormat: string;
4
+ picker: string;
5
+ columnsType: string[];
6
+ };
7
+ 'YYYY HH': {
8
+ valueFormat: string;
9
+ columnsType: string[];
10
+ };
11
+ 'YYYY-MM HH:mm': {
12
+ valueFormat: string;
13
+ columnsType: string[];
14
+ };
15
+ 'YYYY-MM': {
16
+ valueFormat: string;
17
+ picker: string;
18
+ columnsType: string[];
19
+ };
20
+ 'YYYY-MM-DD': {
21
+ valueFormat: string;
22
+ picker: string;
23
+ columnsType: string[];
24
+ };
25
+ 'YYYY-MM-DD HH': {
26
+ valueFormat: string;
27
+ columnsType: string[];
28
+ };
29
+ 'YYYY-MM-DD HH:mm': {
30
+ valueFormat: string;
31
+ columnsType: string[];
32
+ };
33
+ 'YYYY-MM-DD HH:mm:ss': {
34
+ valueFormat: string;
35
+ columnsType: string[];
36
+ };
37
+ 'HH:mm:ss': {
38
+ valueFormat: string;
39
+ columnsType: string[];
40
+ };
41
+ 'HH:mm': {
42
+ valueFormat: string;
43
+ columnsType: string[];
44
+ };
45
+ HH: {
46
+ valueFormat: string;
47
+ columnsType: string[];
48
+ };
49
+ };
50
+ export declare const DatepickerRanges: {
51
+ "sys.pageDesigner.dateRange.weekNow": string;
52
+ };
@@ -0,0 +1,66 @@
1
+ import { DateRangeEnums } from "@gct-paas/core";
2
+ //#region src/constant/data-format.ts
3
+ var DateFormat = {
4
+ YYYY: {
5
+ valueFormat: "YYYY-01-01",
6
+ picker: "year",
7
+ columnsType: ["year"]
8
+ },
9
+ "YYYY HH": {
10
+ valueFormat: "YYYY-01-01 HH:00:00",
11
+ columnsType: ["hour"]
12
+ },
13
+ "YYYY-MM HH:mm": {
14
+ valueFormat: "YYYY-MM-01 HH:mm:00",
15
+ columnsType: ["hour", "minute"]
16
+ },
17
+ "YYYY-MM": {
18
+ valueFormat: "YYYY-MM-01",
19
+ picker: "month",
20
+ columnsType: ["year", "month"]
21
+ },
22
+ "YYYY-MM-DD": {
23
+ valueFormat: "YYYY-MM-DD",
24
+ picker: "date",
25
+ columnsType: [
26
+ "year",
27
+ "month",
28
+ "day"
29
+ ]
30
+ },
31
+ "YYYY-MM-DD HH": {
32
+ valueFormat: "YYYY-MM-DD HH:00:00",
33
+ columnsType: ["hour"]
34
+ },
35
+ "YYYY-MM-DD HH:mm": {
36
+ valueFormat: "YYYY-MM-DD HH:mm:00",
37
+ columnsType: ["hour", "minute"]
38
+ },
39
+ "YYYY-MM-DD HH:mm:ss": {
40
+ valueFormat: "YYYY-MM-DD HH:mm:ss",
41
+ columnsType: [
42
+ "hour",
43
+ "minute",
44
+ "second"
45
+ ]
46
+ },
47
+ "HH:mm:ss": {
48
+ valueFormat: "HH:mm:ss",
49
+ columnsType: [
50
+ "hour",
51
+ "minute",
52
+ "second"
53
+ ]
54
+ },
55
+ "HH:mm": {
56
+ valueFormat: "HH:mm:00",
57
+ columnsType: ["hour", "minute"]
58
+ },
59
+ HH: {
60
+ valueFormat: "HH:00:00",
61
+ columnsType: ["hour"]
62
+ }
63
+ };
64
+ var DatepickerRanges = { [DateRangeEnums.WEEK_NOW]: "" };
65
+ //#endregion
66
+ export { DateFormat, DatepickerRanges };
@@ -0,0 +1,99 @@
1
+ import { FieldSysVarDefaultValueEnum } from '@gct-paas/core';
2
+ import { default as dayjs, Dayjs } from 'dayjs';
3
+ export declare const DESIGN_TYPE = "view-design";
4
+ export declare const DESIGN_DATA_KEY_TAG = "id";
5
+ /**
6
+ * 设计项标识标签属性
7
+ */
8
+ export declare enum DesignItemAttribute {
9
+ /**
10
+ * 可以激活项的标识
11
+ */
12
+ ACTIVE_TAG = "design-active-item",
13
+ /**
14
+ * 拖拽项标识属性
15
+ */
16
+ DRAG_TAG = "design-drop-item",
17
+ /**
18
+ * 项排序值标识
19
+ */
20
+ INDEX_TAG = "design-item-index",
21
+ /**
22
+ * 设计项标识属性
23
+ */
24
+ NODE_ID_TAG = "design-item-id",
25
+ /**
26
+ * 项文本名称
27
+ */
28
+ DESIGN_NAME = "design-item-name",
29
+ /**
30
+ * 分组标识
31
+ */
32
+ GROUP_TAG = "design-group-tag",
33
+ /**
34
+ * 拖拽组类型
35
+ */
36
+ DRAG_GROUP_TYPE = "drag-group-type",
37
+ /**
38
+ * 是否为行内元素
39
+ */
40
+ IS_INLINE_BLOCK = "is-inline-block",
41
+ /**
42
+ * 特殊情况下,例如表格将表格元素自己复制了好几份,需要指定实际呈现元素在 querySelectorAll 中的位置。便于悬浮或者选中时位置的计算
43
+ */
44
+ SELECTOR_INDEX = "selector-index"
45
+ }
46
+ /** 日期时间可选范围 */
47
+ export declare const DateRangeMap: {
48
+ WEEK_NOW: (current: number) => {
49
+ disabled: boolean;
50
+ minDate: dayjs.Dayjs;
51
+ maxDate: dayjs.Dayjs;
52
+ };
53
+ MONTH_NOW: (current: number) => {
54
+ disabled: boolean;
55
+ minDate: dayjs.Dayjs;
56
+ maxDate: dayjs.Dayjs;
57
+ };
58
+ QUARTER_NOW: (current: number) => {
59
+ disabled: boolean;
60
+ minDate: dayjs.Dayjs;
61
+ maxDate: dayjs.Dayjs;
62
+ };
63
+ YEAR_NOW: (current: number) => {
64
+ disabled: boolean;
65
+ minDate: dayjs.Dayjs;
66
+ maxDate: dayjs.Dayjs;
67
+ };
68
+ WEEk_BEFORE: (current: number) => {
69
+ disabled: boolean;
70
+ minDate: dayjs.Dayjs;
71
+ maxDate: dayjs.Dayjs;
72
+ };
73
+ MONTH_BEFORE: (current: number) => {
74
+ disabled: boolean;
75
+ minDate: dayjs.Dayjs;
76
+ maxDate: dayjs.Dayjs;
77
+ };
78
+ QUARTER_BEFORE: (current: number) => {
79
+ disabled: boolean;
80
+ minDate: dayjs.Dayjs;
81
+ maxDate: dayjs.Dayjs;
82
+ };
83
+ YEAR_BEFORE: (current: number) => {
84
+ disabled: boolean;
85
+ minDate: dayjs.Dayjs;
86
+ maxDate: dayjs.Dayjs;
87
+ };
88
+ DATE_BEFORE: (current: number) => {
89
+ disabled: boolean;
90
+ maxDate: dayjs.Dayjs;
91
+ };
92
+ DATE_AFTER: (current: number) => {
93
+ disabled: boolean;
94
+ minDate: dayjs.Dayjs;
95
+ };
96
+ };
97
+ export declare const getDisabledDate: (current: Dayjs, rangeType: keyof typeof DateRangeMap) => boolean;
98
+ export declare const getMobileDateRange: (rangeType: keyof typeof DateRangeMap) => any;
99
+ export declare const getDefaultDate: (type: FieldSysVarDefaultValueEnum | undefined, formatType: string) => string | undefined;
@@ -0,0 +1,187 @@
1
+ import { FieldSysVarDefaultValueEnum } from "@gct-paas/core";
2
+ import dayjs from "dayjs";
3
+ //#region src/constant/date-time.ts
4
+ var DESIGN_TYPE = "view-design";
5
+ var DESIGN_DATA_KEY_TAG = "id";
6
+ /**
7
+ * 设计项标识标签属性
8
+ */
9
+ var DesignItemAttribute = /* @__PURE__ */ function(DesignItemAttribute) {
10
+ /**
11
+ * 可以激活项的标识
12
+ */
13
+ DesignItemAttribute["ACTIVE_TAG"] = "design-active-item";
14
+ /**
15
+ * 拖拽项标识属性
16
+ */
17
+ DesignItemAttribute["DRAG_TAG"] = "design-drop-item";
18
+ /**
19
+ * 项排序值标识
20
+ */
21
+ DesignItemAttribute["INDEX_TAG"] = "design-item-index";
22
+ /**
23
+ * 设计项标识属性
24
+ */
25
+ DesignItemAttribute["NODE_ID_TAG"] = "design-item-id";
26
+ /**
27
+ * 项文本名称
28
+ */
29
+ DesignItemAttribute["DESIGN_NAME"] = "design-item-name";
30
+ /**
31
+ * 分组标识
32
+ */
33
+ DesignItemAttribute["GROUP_TAG"] = "design-group-tag";
34
+ /**
35
+ * 拖拽组类型
36
+ */
37
+ DesignItemAttribute["DRAG_GROUP_TYPE"] = "drag-group-type";
38
+ /**
39
+ * 是否为行内元素
40
+ */
41
+ DesignItemAttribute["IS_INLINE_BLOCK"] = "is-inline-block";
42
+ /**
43
+ * 特殊情况下,例如表格将表格元素自己复制了好几份,需要指定实际呈现元素在 querySelectorAll 中的位置。便于悬浮或者选中时位置的计算
44
+ */
45
+ DesignItemAttribute["SELECTOR_INDEX"] = "selector-index";
46
+ return DesignItemAttribute;
47
+ }({});
48
+ /** 日期时间可选范围 */
49
+ var DateRangeMap = {
50
+ WEEK_NOW: (current) => {
51
+ const startDate = dayjs().startOf("week").add(1, "day");
52
+ const endDate = dayjs().endOf("week").add(1, "day");
53
+ const startTDS = startDate.valueOf();
54
+ const endTDS = endDate.valueOf();
55
+ return {
56
+ disabled: current < startTDS || current > endTDS,
57
+ minDate: startDate,
58
+ maxDate: endDate
59
+ };
60
+ },
61
+ MONTH_NOW: (current) => {
62
+ const startDate = dayjs().startOf("month");
63
+ const endDate = dayjs().endOf("month");
64
+ const startTDS = startDate.valueOf();
65
+ const endTDS = endDate.valueOf();
66
+ return {
67
+ disabled: current < startTDS || current > endTDS,
68
+ minDate: startDate,
69
+ maxDate: endDate
70
+ };
71
+ },
72
+ QUARTER_NOW: (current) => {
73
+ const startDate = dayjs().startOf("quarter");
74
+ const endDate = dayjs().endOf("quarter");
75
+ const startTDS = startDate.valueOf();
76
+ const endTDS = endDate.valueOf();
77
+ return {
78
+ disabled: current < startTDS || current > endTDS,
79
+ minDate: startDate,
80
+ maxDate: endDate
81
+ };
82
+ },
83
+ YEAR_NOW: (current) => {
84
+ const startDate = dayjs().startOf("year");
85
+ const endDate = dayjs().endOf("year");
86
+ const startTDS = startDate.valueOf();
87
+ const endTDS = endDate.valueOf();
88
+ return {
89
+ disabled: current < startTDS || current > endTDS,
90
+ minDate: startDate,
91
+ maxDate: endDate
92
+ };
93
+ },
94
+ WEEk_BEFORE: (current) => {
95
+ dayjs.locale("zh-cn");
96
+ const lastWeekStart = dayjs().startOf("week").subtract(1, "week");
97
+ const lastWeekEnd = lastWeekStart.clone().endOf("week");
98
+ const startTDS = lastWeekStart.valueOf();
99
+ const endTDS = lastWeekEnd.valueOf();
100
+ return {
101
+ disabled: current < startTDS || current > endTDS,
102
+ minDate: lastWeekStart,
103
+ maxDate: lastWeekEnd
104
+ };
105
+ },
106
+ MONTH_BEFORE: (current) => {
107
+ const startDate = dayjs().add(-1, "month").startOf("month");
108
+ const endDate = dayjs().add(-1, "month").endOf("month");
109
+ const startTDS = startDate.valueOf();
110
+ const endTDS = endDate.valueOf();
111
+ return {
112
+ disabled: current < startTDS || current > endTDS,
113
+ minDate: startDate,
114
+ maxDate: endDate
115
+ };
116
+ },
117
+ QUARTER_BEFORE: (current) => {
118
+ const startDate = dayjs().add(-1, "quarter").startOf("quarter");
119
+ const endDate = dayjs().add(-1, "quarter").endOf("quarter");
120
+ const startTDS = startDate.valueOf();
121
+ const endTDS = endDate.valueOf();
122
+ return {
123
+ disabled: current < startTDS || current > endTDS,
124
+ minDate: startDate,
125
+ maxDate: endDate
126
+ };
127
+ },
128
+ YEAR_BEFORE: (current) => {
129
+ const startDate = dayjs().add(-1, "year").startOf("year");
130
+ const endDate = dayjs().add(-1, "year").endOf("year");
131
+ const startTDS = startDate.valueOf();
132
+ const endTDS = endDate.valueOf();
133
+ return {
134
+ disabled: current < startTDS || current > endTDS,
135
+ minDate: startDate,
136
+ maxDate: endDate
137
+ };
138
+ },
139
+ DATE_BEFORE: (current) => {
140
+ const endDate = dayjs().add(-1, "day");
141
+ return {
142
+ disabled: current < endDate.valueOf(),
143
+ maxDate: endDate
144
+ };
145
+ },
146
+ DATE_AFTER: (current) => {
147
+ const startDate = dayjs();
148
+ return {
149
+ disabled: current > startDate.valueOf(),
150
+ minDate: startDate
151
+ };
152
+ }
153
+ };
154
+ var getDisabledDate = (current, rangeType) => {
155
+ const tds = dayjs(current).valueOf();
156
+ const func = DateRangeMap[rangeType];
157
+ if (func) {
158
+ const { disabled } = func(tds);
159
+ return disabled;
160
+ }
161
+ return false;
162
+ };
163
+ var getMobileDateRange = (rangeType) => {
164
+ const func = DateRangeMap[rangeType];
165
+ if (func) {
166
+ const { minDate, maxDate } = func(0);
167
+ return Object.assign({}, minDate && { minDate: new Date(minDate) }, maxDate && { maxDate: new Date(maxDate) });
168
+ }
169
+ return {};
170
+ };
171
+ var getDefaultDate = (type, formatType) => {
172
+ let defaultDate;
173
+ switch (type) {
174
+ case FieldSysVarDefaultValueEnum.SYS_DATE:
175
+ defaultDate = dayjs().format(formatType ?? "YYYY-MM-DD");
176
+ break;
177
+ case FieldSysVarDefaultValueEnum.SYS_DATE_TIME:
178
+ defaultDate = dayjs().format(formatType ?? "YYYY-MM-DD HH:mm:ss");
179
+ break;
180
+ case FieldSysVarDefaultValueEnum.SYS_TIME:
181
+ defaultDate = dayjs().format(formatType ?? "HH:mm:ss");
182
+ break;
183
+ }
184
+ return defaultDate;
185
+ };
186
+ //#endregion
187
+ export { DESIGN_DATA_KEY_TAG, DESIGN_TYPE, DateRangeMap, DesignItemAttribute, getDefaultDate, getDisabledDate, getMobileDateRange };
@@ -0,0 +1,94 @@
1
+ /**
2
+ * 控制器类型
3
+ *
4
+ * @author zhanghanrui
5
+ * @date 2024-07-05 13:07:45
6
+ * @export
7
+ * @enum {number}
8
+ */
9
+ export declare enum ControllerType {
10
+ /**
11
+ * 设计视图
12
+ */
13
+ DESIGN_RENDER = "design-render"
14
+ }
15
+ /**
16
+ * 绘制界面模式前缀(主要用于插件的区分,此设计界面是通用的,通过此标识区分不同界面加载不同组件)
17
+ *
18
+ * @author zhanghanrui
19
+ * @date 2024-07-15 14:07:42
20
+ * @export
21
+ * @enum {number}
22
+ */
23
+ export declare enum DesignRenderViewPrefix {
24
+ /**
25
+ * 自定义视图
26
+ */
27
+ CUSTOM_HOME = "custom-home",
28
+ /**
29
+ * 卡片绘制
30
+ */
31
+ CARD_VIEW = "card-view",
32
+ /**
33
+ * 卡片绘制
34
+ */
35
+ MOBILE_CARD_VIEW = "mobile-card-view",
36
+ /**
37
+ * 设计编辑器
38
+ */
39
+ DESIGN_EDITOR = "design-editor"
40
+ }
41
+ /**
42
+ * 绘制节点类型
43
+ *
44
+ * @author zhanghanrui
45
+ * @date 2024-07-15 15:07:16
46
+ * @export
47
+ * @enum {number}
48
+ */
49
+ export declare enum RenderNodeType {
50
+ /**
51
+ * 页面
52
+ */
53
+ PAGE = "PAGE",
54
+ /**
55
+ * 页面小写标识
56
+ */
57
+ PAGE_LOWER = "page",
58
+ /**
59
+ * 属性
60
+ */
61
+ FIELD = "field",
62
+ /**
63
+ * 面板
64
+ */
65
+ PANEL = "panel",
66
+ /**
67
+ * 选项卡
68
+ */
69
+ TABS = "tabs",
70
+ /**
71
+ * 选项卡子项
72
+ */
73
+ TAB_ITEM = "tab-item",
74
+ /**
75
+ * 菜单列表
76
+ */
77
+ MENU_LIST = "menu-list",
78
+ /**
79
+ * 选择组件
80
+ */
81
+ SELECT_COMPONENT = "select-component",
82
+ GRID = "grid",
83
+ GRID_ITEM = "grid-item",
84
+ /**消息 */
85
+ MESSAGE = "message",
86
+ /**工作台 */
87
+ WORKBENCH = "workbench",
88
+ /**个人中心 */
89
+ PERSONAL_CENTER = "personal-center",
90
+ /**待办 */
91
+ TODO = "todo"
92
+ }
93
+ export * from './date-time';
94
+ export * from './data-format';