@glodon-aiot/dataset-annotation 3.1.0-beta.15 → 3.2.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.
Files changed (121) hide show
  1. package/dist/dataset-annotation.js +123591 -0
  2. package/dist/dataset-annotation.umd.cjs +1017 -0
  3. package/dist/example/DatasetAnnotationDemo.d.ts +3 -0
  4. package/dist/example/DemoTabs.d.ts +3 -0
  5. package/dist/example/DetectionDatasetDemo.d.ts +5 -0
  6. package/dist/example/DetectionImageDemo.d.ts +5 -0
  7. package/dist/example/OcrDatasetDemo.d.ts +5 -0
  8. package/dist/example/OcrImageDemo.d.ts +5 -0
  9. package/dist/example/OcrkvcDatasetDemo.d.ts +5 -0
  10. package/dist/example/constant.local.d.ts +6 -0
  11. package/dist/example/index.d.ts +1 -0
  12. package/dist/src/Common/Page/index.d.ts +2 -1
  13. package/dist/src/Common/PageHeader/index.d.ts +1 -0
  14. package/dist/src/DatasetContext/index.d.ts +4 -3
  15. package/dist/src/components/CompositionInput/index.d.ts +2 -2
  16. package/dist/src/components/DataEmpty/index.d.ts +2 -1
  17. package/dist/src/components/DetectionAnnotation/PreSamplesPage/index.d.ts +2 -1
  18. package/dist/src/components/DetectionAnnotation/components/DisabledTooltip/index.d.ts +2 -2
  19. package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +2 -1
  20. package/dist/src/components/DetectionAnnotation/components/LabelMaker/Drawable.d.ts +2 -2
  21. package/dist/src/components/DetectionAnnotation/components/LabelMaker/RectLabel.d.ts +2 -2
  22. package/dist/src/components/DetectionAnnotation/components/LabelMaker/index.d.ts +1 -0
  23. package/dist/src/components/DetectionAnnotation/components/Labels/index.d.ts +1 -0
  24. package/dist/src/components/DetectionAnnotation/components/TagItem/index.d.ts +2 -1
  25. package/dist/src/components/DetectionAnnotation/index.d.ts +2 -1
  26. package/dist/src/components/DetectionImageAnnotation/index.d.ts +2 -0
  27. package/dist/src/components/Iconfont/index.d.ts +1 -1
  28. package/dist/src/components/MarkDescriptions/index.d.ts +1 -0
  29. package/dist/src/components/OCRImageViewer/index.d.ts +2 -1
  30. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorInput.d.ts +2 -2
  31. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorItem.d.ts +2 -1
  32. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LableEditor.d.ts +1 -0
  33. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/index.d.ts +1 -0
  34. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/ImageDetail/index.d.ts +2 -1
  35. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LabelEditorInput.d.ts +2 -2
  36. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LabelEditorItem.d.ts +1 -0
  37. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LableEditor.d.ts +1 -0
  38. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.d.ts +1 -0
  39. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/index.d.ts +1 -0
  40. package/dist/src/components/OcrAnnotation/OcrModal/index.d.ts +2 -1
  41. package/dist/src/components/OcrAnnotation/PreLabelOCR/PreLabelModal.d.ts +2 -1
  42. package/dist/src/components/OcrAnnotation/PreLabelOCR/index.d.ts +2 -1
  43. package/dist/src/components/OcrAnnotation/index.d.ts +2 -1
  44. package/dist/src/components/OcrImageAnnotation/index.d.ts +2 -0
  45. package/dist/src/components/PageNav/index.d.ts +2 -1
  46. package/dist/src/components/PicZipImportModal/index.d.ts +2 -1
  47. package/dist/src/components/PreLabelOCR/PreLabelModal.d.ts +2 -1
  48. package/dist/src/components/PreLabelOCR/index.d.ts +2 -1
  49. package/dist/src/components/ScanTable/index.d.ts +2 -1
  50. package/dist/src/components/Thumbnail/index.d.ts +2 -1
  51. package/dist/src/components/hooks/useBlocker.d.ts +1 -1
  52. package/dist/src/featuresConfig.d.ts +1 -1
  53. package/package.json +15 -22
  54. package/dist/es/Common/Page/index.mjs +0 -28
  55. package/dist/es/Common/PageContent/index.mjs +0 -18
  56. package/dist/es/Common/PageHeader/index.mjs +0 -38
  57. package/dist/es/DatasetContext/index.mjs +0 -11
  58. package/dist/es/_virtual/_commonjsHelpers.mjs +0 -6
  59. package/dist/es/_virtual/index.mjs +0 -4
  60. package/dist/es/access/images/data_empty.svg.mjs +0 -4
  61. package/dist/es/components/CompositionInput/index.mjs +0 -53
  62. package/dist/es/components/DataEmpty/index.mjs +0 -50
  63. package/dist/es/components/DetectionAnnotation/PreSamplesPage/index.mjs +0 -291
  64. package/dist/es/components/DetectionAnnotation/components/DisabledTooltip/index.mjs +0 -23
  65. package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +0 -165
  66. package/dist/es/components/DetectionAnnotation/components/LabelMaker/Drawable.mjs +0 -51
  67. package/dist/es/components/DetectionAnnotation/components/LabelMaker/FabricCustomize.mjs +0 -42
  68. package/dist/es/components/DetectionAnnotation/components/LabelMaker/RectLabel.mjs +0 -283
  69. package/dist/es/components/DetectionAnnotation/components/LabelMaker/icons/delete-icon.svg.mjs +0 -4
  70. package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +0 -314
  71. package/dist/es/components/DetectionAnnotation/components/Labels/index.mjs +0 -200
  72. package/dist/es/components/DetectionAnnotation/components/TagItem/index.mjs +0 -143
  73. package/dist/es/components/DetectionAnnotation/icon_item_empty.svg.mjs +0 -4
  74. package/dist/es/components/DetectionAnnotation/index.mjs +0 -712
  75. package/dist/es/components/DetectionImageAnnotation/index.mjs +0 -61
  76. package/dist/es/components/Iconfont/index.mjs +0 -16
  77. package/dist/es/components/MarkDescriptions/index.mjs +0 -65
  78. package/dist/es/components/OCRImageViewer/index.mjs +0 -212
  79. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/CategoryDrawer.mjs +0 -136
  80. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorInput.mjs +0 -57
  81. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorItem.mjs +0 -72
  82. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LableEditor.mjs +0 -54
  83. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/index.mjs +0 -366
  84. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/index.mjs +0 -254
  85. package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/ImageDetail/index.mjs +0 -100
  86. package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/images/delete.png.mjs +0 -4
  87. package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.mjs +0 -755
  88. package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/index.mjs +0 -230
  89. package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +0 -179
  90. package/dist/es/components/OcrAnnotation/PreLabelOCR/PreLabelModal.mjs +0 -280
  91. package/dist/es/components/OcrAnnotation/PreLabelOCR/index.mjs +0 -43
  92. package/dist/es/components/OcrAnnotation/constant.mjs +0 -5
  93. package/dist/es/components/OcrAnnotation/index.mjs +0 -381
  94. package/dist/es/components/OcrImageAnnotation/index.mjs +0 -39
  95. package/dist/es/components/PageNav/index.mjs +0 -29
  96. package/dist/es/components/PicZipImportModal/index.mjs +0 -583
  97. package/dist/es/components/PicZipImportModal/pic_zip.svg.mjs +0 -4
  98. package/dist/es/components/PicZipImportModal/pic_zip_json.svg.mjs +0 -4
  99. package/dist/es/components/PreLabelOCR/PreLabelModal.mjs +0 -275
  100. package/dist/es/components/PreLabelOCR/index.mjs +0 -43
  101. package/dist/es/components/ScanTable/index.mjs +0 -96
  102. package/dist/es/components/Thumbnail/default.png.mjs +0 -4
  103. package/dist/es/components/Thumbnail/index.mjs +0 -30
  104. package/dist/es/components/hooks/Prompt.mjs +0 -33
  105. package/dist/es/constant.mjs +0 -13
  106. package/dist/es/createDatasetAnnotation/index.mjs +0 -133
  107. package/dist/es/createDetectionDatasetAnnotation/index.mjs +0 -129
  108. package/dist/es/createDetectionImageAnnotation/index.mjs +0 -31
  109. package/dist/es/createOcrDatasetAnnotation/index.mjs +0 -129
  110. package/dist/es/createOcrImageAnnotation/index.mjs +0 -33
  111. package/dist/es/featuresConfig.mjs +0 -79
  112. package/dist/es/index.mjs +0 -35
  113. package/dist/es/node_modules/classnames/index.mjs +0 -42
  114. package/dist/es/utils/color.mjs +0 -30
  115. package/dist/es/utils/index.mjs +0 -22
  116. package/dist/es/utils/sign.mjs +0 -33
  117. package/dist/lib/index.js +0 -7
  118. package/dist/src/components/Iconfont/font_3140028_iptomfpgyu.d.ts +0 -0
  119. package/dist/src/components/Iconfont/font_3454453_gu5ijeufyng.d.ts +0 -0
  120. package/dist/src/components/Iconfont/font_4108228_3slzqhoow93.d.ts +0 -0
  121. package/dist/src/components/Iconfont/font_4439177_k3mjwv7kzfd.d.ts +0 -0
@@ -1,65 +0,0 @@
1
- import { jsxs as o, jsx as a, Fragment as h } from "react/jsx-runtime";
2
- import { useState as n, useEffect as l } from "react";
3
- import k from "lodash/groupBy";
4
- /* empty css */const v = ({
5
- labels: i = [],
6
- catagory: t
7
- }) => {
8
- const [r, m] = n([]), [c, d] = n([]);
9
- return l(() => {
10
- const s = k(i, (e) => e.type);
11
- m(s.key), d(s.value);
12
- }, [i]), /* @__PURE__ */ o("div", {
13
- className: "mark-description-wrap",
14
- children: [/* @__PURE__ */ a("div", {
15
- className: "mark-description-name",
16
- children: t.name
17
- }), /* @__PURE__ */ a("div", {
18
- className: "mark-description-keys",
19
- children: r == null ? void 0 : r.map((s) => /* @__PURE__ */ a("div", {
20
- children: s.words
21
- }))
22
- }), /* @__PURE__ */ a("div", {
23
- className: "mark-description-values",
24
- children: c == null ? void 0 : c.map((s) => /* @__PURE__ */ a("div", {
25
- children: s.words
26
- }))
27
- })]
28
- });
29
- }, w = ({
30
- labels: i = [],
31
- catagories: t = []
32
- }) => {
33
- var s;
34
- const [r, m] = n({}), [c, d] = n({});
35
- return l(() => {
36
- m(k(i, (e) => e.catagoryId));
37
- }, [i]), l(() => {
38
- const e = {};
39
- t.forEach((p) => e[p.id] = p.name), d(e);
40
- }, [t]), r ? /* @__PURE__ */ o("div", {
41
- className: "mark-descriptions-wrap",
42
- children: [/* @__PURE__ */ o("div", {
43
- className: "mark-description-wrap mark-descriptions-header",
44
- children: [/* @__PURE__ */ a("div", {
45
- className: "mark-description-name",
46
- children: "字段名称"
47
- }), /* @__PURE__ */ a("div", {
48
- className: "mark-description-keys",
49
- children: "Key"
50
- }), /* @__PURE__ */ a("div", {
51
- className: "mark-description-values",
52
- children: "Value"
53
- })]
54
- }), (s = Object.keys(r)) == null ? void 0 : s.map((e) => /* @__PURE__ */ a(v, {
55
- labels: r[e],
56
- catagory: {
57
- id: e,
58
- name: c[e]
59
- }
60
- }))]
61
- }) : /* @__PURE__ */ a(h, {});
62
- };
63
- export {
64
- w as default
65
- };
@@ -1,212 +0,0 @@
1
- import { jsxs as E, jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as pt, useRef as _, useState as i, useEffect as vt, useImperativeHandle as It } from "react";
3
- /* empty css */import Mt from "../../node_modules/classnames/index.mjs";
4
- import { Space as wt, Tooltip as k, Button as L } from "antd";
5
- import { ZoomInOutlined as xt, ZoomOutOutlined as yt, DragOutlined as St } from "@ant-design/icons";
6
- import { useKeyPress as tt } from "ahooks";
7
- const Dt = pt((O, et) => {
8
- var Q;
9
- const {
10
- url: R,
11
- offsetEdge: ot = [50, 50, 50, 50],
12
- zoomable: b = !0,
13
- zoomStep: p = 0.02,
14
- zoomMax: v = 2,
15
- zoomMin: I = 0,
16
- onImageLoad: X,
17
- labels: N
18
- } = O, M = _({}), w = _({}), [j, nt] = i(0), [B, st] = i(0), [l, P] = i(1), [u, f] = i(0), [g, d] = i(0), [r, z] = i(0), [c, D] = i(0), [it, U] = i(!1), [Z, x] = i(!1), [$, rt] = i(), [y, S] = i({
19
- x: 0,
20
- y: 0
21
- }), [q, K, V, A] = ot, [a, T] = i((Q = O.draggable) != null ? Q : !0);
22
- tt("ctrl", () => {
23
- T(!0);
24
- }, {
25
- events: ["keydown"]
26
- }), tt("ctrl", () => {
27
- T(!1);
28
- }, {
29
- events: ["keyup"]
30
- }), vt(() => {
31
- U(!1);
32
- }, [R]);
33
- const F = () => {
34
- if (!w.current)
35
- return;
36
- const t = w.current.clientWidth, e = w.current.clientHeight, o = M.current.naturalWidth, n = M.current.naturalHeight, m = t / o, H = e / n, h = m < H ? m : H, mt = (t - o * h) / 2, ft = (e - n * h) / 2, dt = o * h, ht = n * h;
37
- nt(t), st(e), P(h), f(mt), d(ft), z(dt), D(ht), U(!0), X && X(M.current);
38
- }, C = () => {
39
- if (!b || l >= v)
40
- return;
41
- let t = l * (1 + p), e = p;
42
- t >= v && (t = v, e = v / l - 1), f(u - r * (e / 2)), d(g - c * (e / 2)), z(r + r * e), D(c + c * e), P(t), Y();
43
- }, W = () => {
44
- if (!b || l <= I)
45
- return;
46
- let t = l * (1 - p), e = p;
47
- t <= I && (t = I, e = 1 - I / l), f(u - r * (-e / 2)), d(g - c * (-e / 2)), z(r + r * -e), D(c + c * -e), P(t), Y();
48
- };
49
- It(et, () => ({
50
- zoomIn: C,
51
- zoomOut: W,
52
- onImageLoad: X
53
- }));
54
- const ct = (t) => (t.deltaY < 0 ? C() : W(), !1), at = (t) => {
55
- x(!0);
56
- const {
57
- pageX: e,
58
- pageY: o
59
- } = t;
60
- S({
61
- x: e,
62
- y: o
63
- });
64
- }, lt = (t) => {
65
- if (!Z)
66
- return !1;
67
- const {
68
- pageX: e,
69
- pageY: o
70
- } = t, n = e - y.x, m = o - y.y;
71
- S({
72
- x: e,
73
- y: o
74
- }), f(u + n), d(g + m), Y();
75
- }, G = () => {
76
- x(!1);
77
- };
78
- window.onmouseup = () => {
79
- x(!1);
80
- }, window.onresize = F;
81
- const Y = () => {
82
- u < -r + A && f(-r + A), g < -c + q && d(-c + q), u > j - K && f(j - K), g > B - V && d(B - V);
83
- }, ut = (t) => {
84
- const {
85
- touches: e
86
- } = t;
87
- if (x(!0), e.length < 2) {
88
- const {
89
- clientX: o,
90
- clientY: n
91
- } = e[0];
92
- S({
93
- x: o,
94
- y: n
95
- });
96
- } else
97
- rt(e);
98
- }, gt = (t) => {
99
- if (!Z || !t.touches)
100
- return !1;
101
- const {
102
- clientX: e,
103
- clientY: o
104
- } = t.touches[0];
105
- if (t.touches.length < 2) {
106
- const n = e - y.x, m = o - y.y;
107
- S({
108
- x: e,
109
- y: o
110
- }), f(u + n), d(g + m), Y();
111
- } else {
112
- const n = t.touches, m = J(n[0], n[1]), H = J($[0], $[1]);
113
- m > H ? C() : W();
114
- }
115
- }, J = (t, e) => {
116
- const o = e.pageX - t.pageX, n = e.pageY - t.pageY;
117
- return Math.sqrt(o * o + n * n);
118
- };
119
- return /* @__PURE__ */ E("div", {
120
- className: "ocr-image-viewer",
121
- children: [/* @__PURE__ */ s("div", {
122
- className: "marker-toolbar",
123
- children: /* @__PURE__ */ s("div", {
124
- className: "create-mode-select",
125
- children: /* @__PURE__ */ E(wt, {
126
- direction: "vertical",
127
- size: 16,
128
- children: [/* @__PURE__ */ s(k, {
129
- title: "放大-鼠标滚轮前滑",
130
- placement: "right",
131
- children: /* @__PURE__ */ s(L, {
132
- icon: /* @__PURE__ */ s(xt, {}),
133
- onClick: () => {
134
- C();
135
- }
136
- })
137
- }), /* @__PURE__ */ s(k, {
138
- title: "缩小-鼠标滚轮后滑",
139
- placement: "right",
140
- children: /* @__PURE__ */ s(L, {
141
- icon: /* @__PURE__ */ s(yt, {}),
142
- onClick: () => {
143
- W();
144
- }
145
- })
146
- }), /* @__PURE__ */ s(k, {
147
- title: "拖动-按住ctrl",
148
- placement: "right",
149
- children: /* @__PURE__ */ s(L, {
150
- icon: /* @__PURE__ */ s(St, {}),
151
- className: a ? "active" : "",
152
- onClick: () => {
153
- T(!a);
154
- }
155
- })
156
- })]
157
- })
158
- })
159
- }), /* @__PURE__ */ E("div", {
160
- className: Mt({
161
- "image-map": !0,
162
- draggable: a
163
- }),
164
- ref: w,
165
- onMouseDown: a ? at : void 0,
166
- onMouseMove: a ? lt : void 0,
167
- onMouseUp: a ? G : void 0,
168
- onWheel: ct,
169
- onTouchStart: a ? ut : void 0,
170
- onTouchMove: a ? gt : void 0,
171
- onTouchEnd: a ? G : void 0,
172
- onContextMenu: (t) => {
173
- t.preventDefault();
174
- },
175
- children: [/* @__PURE__ */ s("img", {
176
- draggable: "false",
177
- className: "img",
178
- style: {
179
- position: "absolute",
180
- left: u,
181
- top: g,
182
- width: r,
183
- height: c
184
- },
185
- ref: M,
186
- onLoad: F,
187
- src: R,
188
- alt: ""
189
- }), it ? /* @__PURE__ */ s("svg", {
190
- style: {
191
- position: "absolute",
192
- left: u,
193
- top: g,
194
- width: r,
195
- height: c
196
- },
197
- children: N == null ? void 0 : N.map((t, e) => {
198
- var o;
199
- return /* @__PURE__ */ s("g", {
200
- children: /* @__PURE__ */ s("polygon", {
201
- className: "label-box",
202
- points: (o = t == null ? void 0 : t.box) == null ? void 0 : o.map((n) => `${n[0] * l} ${n[1] * l}`).join(",")
203
- }, t.id)
204
- }, e);
205
- })
206
- }) : ""]
207
- })]
208
- });
209
- });
210
- export {
211
- Dt as default
212
- };
@@ -1,136 +0,0 @@
1
- var O = Object.defineProperty;
2
- var g = Object.getOwnPropertySymbols;
3
- var V = Object.prototype.hasOwnProperty, q = Object.prototype.propertyIsEnumerable;
4
- var x = (i, e, n) => e in i ? O(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, u = (i, e) => {
5
- for (var n in e || (e = {}))
6
- V.call(e, n) && x(i, n, e[n]);
7
- if (g)
8
- for (var n of g(e))
9
- q.call(e, n) && x(i, n, e[n]);
10
- return i;
11
- };
12
- import { jsxs as p, jsx as s } from "react/jsx-runtime";
13
- import { Form as h, Drawer as A, Space as y, Button as B, Table as E, Modal as F, Input as T } from "antd";
14
- import { useState as C, useContext as U, useEffect as k } from "react";
15
- import Z from "../../../DatasetContext/index.mjs";
16
- const N = (i) => {
17
- const {
18
- datasetId: e,
19
- visible: n,
20
- onClose: S
21
- } = i, [w, c] = C(!1), [I, M] = C([]), [o, a] = C(null), [r] = h.useForm(), {
22
- services: {
23
- cvforceDatahub: l
24
- },
25
- featuresConfig: {
26
- labelManager: $
27
- } = {
28
- labelManager: !1
29
- }
30
- } = U(Z), _ = (t) => {
31
- F.confirm({
32
- title: "确认要删除吗?",
33
- content: "删除后不可恢复,请谨慎操做!",
34
- onOk: () => l == null ? void 0 : l.deleteCategory(e, t).then(() => {
35
- m(), c(!0);
36
- })
37
- });
38
- }, j = [{
39
- title: "字段名称",
40
- dataIndex: "name",
41
- key: "name"
42
- }, {
43
- title: /* @__PURE__ */ s("div", {
44
- style: {
45
- padding: "0px 7px"
46
- },
47
- children: "操作"
48
- }),
49
- dataIndex: "id",
50
- key: "action",
51
- width: 100,
52
- render: (t, d) => /* @__PURE__ */ p(y, {
53
- children: [/* @__PURE__ */ s("a", {
54
- onClick: () => a(d),
55
- children: "编辑"
56
- }), /* @__PURE__ */ s("a", {
57
- onClick: () => _(t),
58
- children: "删除"
59
- })]
60
- })
61
- }], z = (t) => {
62
- function d() {
63
- m(), a(null);
64
- }
65
- t.id ? l == null || l.updateCategory(e, t.id, t.name).then(d).then(() => {
66
- c(!0);
67
- }) : l == null || l.postCategory(e, t.name).then(d).then(() => {
68
- c(!0);
69
- });
70
- }, m = () => l == null ? void 0 : l.listCategory(e).then((t) => M(t));
71
- k(() => {
72
- m();
73
- }, []), k(() => {
74
- o ? r.setFieldsValue(o) : r.resetFields();
75
- }, [o]);
76
- const f = () => {
77
- r.validateFields().then((t) => {
78
- r.resetFields(), z(u(u({}, o), t));
79
- }).catch((t) => {
80
- console.log("Validate Failed:", t);
81
- });
82
- };
83
- return /* @__PURE__ */ p(A, {
84
- title: "字段管理",
85
- open: n,
86
- width: "33.33%",
87
- onClose: () => {
88
- S(w);
89
- },
90
- children: [/* @__PURE__ */ p(y, {
91
- direction: "vertical",
92
- size: 16,
93
- style: {
94
- width: "100%"
95
- },
96
- children: [/* @__PURE__ */ s(B, {
97
- type: "primary",
98
- onClick: () => a({}),
99
- children: "+ 添加字段"
100
- }), /* @__PURE__ */ s(E, {
101
- columns: j,
102
- dataSource: I
103
- })]
104
- }), /* @__PURE__ */ s(F, {
105
- title: o != null && o.id ? "编辑字段" : "添加字段",
106
- open: !!o,
107
- onCancel: () => a(null),
108
- onOk: f,
109
- children: /* @__PURE__ */ s(h, {
110
- form: r,
111
- onFinish: f,
112
- children: /* @__PURE__ */ s(h.Item, {
113
- label: "字段名称",
114
- name: "name",
115
- rules: [{
116
- required: !0
117
- }, {
118
- type: "string",
119
- max: 256,
120
- message: "长度不超过256字符"
121
- }, {
122
- pattern: /^[\u4e00-\u9fa50-9a-zA-Z\-_]*$/,
123
- message: "仅支持中英文、数字、“-”、“_”"
124
- }],
125
- children: /* @__PURE__ */ s(T, {
126
- placeholder: "仅支持中英文、数字、“-”、“_”,长度不超过256字符",
127
- autoFocus: !0
128
- })
129
- })
130
- })
131
- })]
132
- });
133
- };
134
- export {
135
- N as default
136
- };
@@ -1,57 +0,0 @@
1
- var m = Object.defineProperty, w = Object.defineProperties;
2
- var x = Object.getOwnPropertyDescriptors;
3
- var f = Object.getOwnPropertySymbols;
4
- var h = Object.prototype.hasOwnProperty, L = Object.prototype.propertyIsEnumerable;
5
- var l = (r, o, e) => o in r ? m(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e, n = (r, o) => {
6
- for (var e in o || (o = {}))
7
- h.call(o, e) && l(r, e, o[e]);
8
- if (f)
9
- for (var e of f(o))
10
- L.call(o, e) && l(r, e, o[e]);
11
- return r;
12
- }, d = (r, o) => w(r, x(o));
13
- import { jsx as C } from "react/jsx-runtime";
14
- import { Input as E } from "antd";
15
- import { useState as b, useEffect as H } from "react";
16
- const B = (r) => {
17
- const {
18
- value: o,
19
- holdingLabel: e,
20
- clearHoldingLabel: i,
21
- onChange: s,
22
- onSelect: c,
23
- selected: I
24
- } = r, [g, u] = b(o == null ? void 0 : o.words), [p, a] = b(!1);
25
- return H(() => {
26
- u(o == null ? void 0 : o.words);
27
- }, [o == null ? void 0 : o.words]), /* @__PURE__ */ C(E, {
28
- placeholder: o != null && o.box ? "请输入" : "在图中框选内容后,点击此处进行填写",
29
- value: g,
30
- onChange: (t) => {
31
- u(t.target.value);
32
- },
33
- disabled: !(o != null && o.box || e && p),
34
- onBlur: (t) => {
35
- s && s(d(n({}, o), {
36
- words: t.target.value
37
- }));
38
- },
39
- onClick: (t) => {
40
- e && e && (s && s(d(n({}, o), {
41
- uuid: e.uuid,
42
- box: e.box,
43
- words: e.words || ""
44
- })), i && i());
45
- },
46
- onMouseOver: () => a(!0),
47
- onMouseLeave: (t) => {
48
- a(!1), t.currentTarget.blur();
49
- },
50
- onFocus: () => {
51
- c && c(o);
52
- }
53
- });
54
- };
55
- export {
56
- B as default
57
- };
@@ -1,72 +0,0 @@
1
- import { jsxs as r, jsx as o } from "react/jsx-runtime";
2
- import { useState as w, useEffect as y } from "react";
3
- import { Button as u } from "antd";
4
- /* empty css */import { DeleteOutlined as I, PlusCircleOutlined as N } from "@ant-design/icons";
5
- import E from "./LabelEditorInput.mjs";
6
- const B = (h) => {
7
- const {
8
- name: c,
9
- catagoryId: p,
10
- values: l,
11
- selectedLabel: n,
12
- holdingLabel: f,
13
- onChange: g,
14
- onRemove: b,
15
- clearHoldingLabel: C,
16
- onSelect: d
17
- } = h, s = {
18
- words: "",
19
- type: c.toLowerCase(),
20
- catagoryId: p
21
- }, [e, a] = w(l.length ? l : [s]);
22
- y(() => {
23
- a(l.length ? l : [s]);
24
- }, [l]);
25
- const v = (t) => {
26
- b(e[t]), e.length === 1 ? a([s]) : (e.splice(t, 1), a([...e]));
27
- }, x = () => {
28
- a([...l, s]);
29
- };
30
- return /* @__PURE__ */ r("div", {
31
- className: "label-editor-item",
32
- children: [/* @__PURE__ */ o("div", {
33
- className: "label-editor-item-name",
34
- children: c.toLowerCase()
35
- }), /* @__PURE__ */ o("div", {
36
- className: "label-editor-item-values",
37
- children: e == null ? void 0 : e.map((t, i) => {
38
- var m;
39
- return /* @__PURE__ */ r("div", {
40
- children: [/* @__PURE__ */ o(E, {
41
- value: t,
42
- selected: n ? (n == null ? void 0 : n.uuid) === t.uuid : !1,
43
- holdingLabel: f,
44
- clearHoldingLabel: C,
45
- onChange: (L) => {
46
- e[i] = L, a([...e]), g([...e]);
47
- },
48
- onSelect: () => {
49
- d && d(t);
50
- }
51
- }), /* @__PURE__ */ r("div", {
52
- className: "actions",
53
- children: [((m = t.box) == null ? void 0 : m.length) && t.words && /* @__PURE__ */ o(u, {
54
- size: "small",
55
- type: "text",
56
- icon: /* @__PURE__ */ o(I, {}),
57
- onClick: () => v(i)
58
- }), i === l.length - 1 && /* @__PURE__ */ o(u, {
59
- size: "small",
60
- type: "text",
61
- icon: /* @__PURE__ */ o(N, {}),
62
- onClick: () => x()
63
- })]
64
- })]
65
- }, i);
66
- })
67
- })]
68
- });
69
- };
70
- export {
71
- B as default
72
- };
@@ -1,54 +0,0 @@
1
- import { jsxs as v, jsx as n } from "react/jsx-runtime";
2
- import { useState as h, useEffect as y } from "react";
3
- /* empty css */import f from "./LabelEditorItem.mjs";
4
- const E = (p) => {
5
- const {
6
- category: t,
7
- type: a = [],
8
- value: o = [],
9
- selectedLabel: r,
10
- holdingLabel: l,
11
- clearHoldingLabel: s,
12
- onChange: i,
13
- onRemove: d,
14
- onSelect: c
15
- } = p, [m, g] = h(a || []), [b, u] = h(o || []);
16
- return y(() => {
17
- g(a);
18
- }, [a]), y(() => {
19
- u(o);
20
- }, [o]), /* @__PURE__ */ v("div", {
21
- className: `label-editor ${l ? "holding-label" : ""}`,
22
- children: [/* @__PURE__ */ n("div", {
23
- className: "label-editor-title",
24
- children: t.name
25
- }), /* @__PURE__ */ n(f, {
26
- catagoryId: t.id,
27
- name: "key",
28
- values: m,
29
- selectedLabel: r,
30
- holdingLabel: l,
31
- clearHoldingLabel: s,
32
- onRemove: d,
33
- onChange: (e) => {
34
- g(e), i(e, b);
35
- },
36
- onSelect: c
37
- }), /* @__PURE__ */ n(f, {
38
- catagoryId: t.id,
39
- name: "value",
40
- values: b,
41
- selectedLabel: r,
42
- holdingLabel: l,
43
- clearHoldingLabel: s,
44
- onRemove: d,
45
- onChange: (e) => {
46
- u(e), i(m, e);
47
- },
48
- onSelect: c
49
- })]
50
- });
51
- };
52
- export {
53
- E as default
54
- };