@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.
- package/dist/dataset-annotation.js +123591 -0
- package/dist/dataset-annotation.umd.cjs +1017 -0
- package/dist/example/DatasetAnnotationDemo.d.ts +3 -0
- package/dist/example/DemoTabs.d.ts +3 -0
- package/dist/example/DetectionDatasetDemo.d.ts +5 -0
- package/dist/example/DetectionImageDemo.d.ts +5 -0
- package/dist/example/OcrDatasetDemo.d.ts +5 -0
- package/dist/example/OcrImageDemo.d.ts +5 -0
- package/dist/example/OcrkvcDatasetDemo.d.ts +5 -0
- package/dist/example/constant.local.d.ts +6 -0
- package/dist/example/index.d.ts +1 -0
- package/dist/src/Common/Page/index.d.ts +2 -1
- package/dist/src/Common/PageHeader/index.d.ts +1 -0
- package/dist/src/DatasetContext/index.d.ts +4 -3
- package/dist/src/components/CompositionInput/index.d.ts +2 -2
- package/dist/src/components/DataEmpty/index.d.ts +2 -1
- package/dist/src/components/DetectionAnnotation/PreSamplesPage/index.d.ts +2 -1
- package/dist/src/components/DetectionAnnotation/components/DisabledTooltip/index.d.ts +2 -2
- package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +2 -1
- package/dist/src/components/DetectionAnnotation/components/LabelMaker/Drawable.d.ts +2 -2
- package/dist/src/components/DetectionAnnotation/components/LabelMaker/RectLabel.d.ts +2 -2
- package/dist/src/components/DetectionAnnotation/components/LabelMaker/index.d.ts +1 -0
- package/dist/src/components/DetectionAnnotation/components/Labels/index.d.ts +1 -0
- package/dist/src/components/DetectionAnnotation/components/TagItem/index.d.ts +2 -1
- package/dist/src/components/DetectionAnnotation/index.d.ts +2 -1
- package/dist/src/components/DetectionImageAnnotation/index.d.ts +2 -0
- package/dist/src/components/Iconfont/index.d.ts +1 -1
- package/dist/src/components/MarkDescriptions/index.d.ts +1 -0
- package/dist/src/components/OCRImageViewer/index.d.ts +2 -1
- package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorInput.d.ts +2 -2
- package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorItem.d.ts +2 -1
- package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LableEditor.d.ts +1 -0
- package/dist/src/components/OcrAnnotation/MarkKVOCRModal/index.d.ts +1 -0
- package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/ImageDetail/index.d.ts +2 -1
- package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LabelEditorInput.d.ts +2 -2
- package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LabelEditorItem.d.ts +1 -0
- package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LableEditor.d.ts +1 -0
- package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.d.ts +1 -0
- package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/index.d.ts +1 -0
- package/dist/src/components/OcrAnnotation/OcrModal/index.d.ts +2 -1
- package/dist/src/components/OcrAnnotation/PreLabelOCR/PreLabelModal.d.ts +2 -1
- package/dist/src/components/OcrAnnotation/PreLabelOCR/index.d.ts +2 -1
- package/dist/src/components/OcrAnnotation/index.d.ts +2 -1
- package/dist/src/components/OcrImageAnnotation/index.d.ts +2 -0
- package/dist/src/components/PageNav/index.d.ts +2 -1
- package/dist/src/components/PicZipImportModal/index.d.ts +2 -1
- package/dist/src/components/PreLabelOCR/PreLabelModal.d.ts +2 -1
- package/dist/src/components/PreLabelOCR/index.d.ts +2 -1
- package/dist/src/components/ScanTable/index.d.ts +2 -1
- package/dist/src/components/Thumbnail/index.d.ts +2 -1
- package/dist/src/components/hooks/useBlocker.d.ts +1 -1
- package/dist/src/featuresConfig.d.ts +1 -1
- package/package.json +15 -22
- package/dist/es/Common/Page/index.mjs +0 -28
- package/dist/es/Common/PageContent/index.mjs +0 -18
- package/dist/es/Common/PageHeader/index.mjs +0 -38
- package/dist/es/DatasetContext/index.mjs +0 -11
- package/dist/es/_virtual/_commonjsHelpers.mjs +0 -6
- package/dist/es/_virtual/index.mjs +0 -4
- package/dist/es/access/images/data_empty.svg.mjs +0 -4
- package/dist/es/components/CompositionInput/index.mjs +0 -53
- package/dist/es/components/DataEmpty/index.mjs +0 -50
- package/dist/es/components/DetectionAnnotation/PreSamplesPage/index.mjs +0 -291
- package/dist/es/components/DetectionAnnotation/components/DisabledTooltip/index.mjs +0 -23
- package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +0 -165
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/Drawable.mjs +0 -51
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/FabricCustomize.mjs +0 -42
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/RectLabel.mjs +0 -283
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/icons/delete-icon.svg.mjs +0 -4
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +0 -314
- package/dist/es/components/DetectionAnnotation/components/Labels/index.mjs +0 -200
- package/dist/es/components/DetectionAnnotation/components/TagItem/index.mjs +0 -143
- package/dist/es/components/DetectionAnnotation/icon_item_empty.svg.mjs +0 -4
- package/dist/es/components/DetectionAnnotation/index.mjs +0 -712
- package/dist/es/components/DetectionImageAnnotation/index.mjs +0 -61
- package/dist/es/components/Iconfont/index.mjs +0 -16
- package/dist/es/components/MarkDescriptions/index.mjs +0 -65
- package/dist/es/components/OCRImageViewer/index.mjs +0 -212
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/CategoryDrawer.mjs +0 -136
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorInput.mjs +0 -57
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorItem.mjs +0 -72
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LableEditor.mjs +0 -54
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/index.mjs +0 -366
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/index.mjs +0 -254
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/ImageDetail/index.mjs +0 -100
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/images/delete.png.mjs +0 -4
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.mjs +0 -755
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/index.mjs +0 -230
- package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +0 -179
- package/dist/es/components/OcrAnnotation/PreLabelOCR/PreLabelModal.mjs +0 -280
- package/dist/es/components/OcrAnnotation/PreLabelOCR/index.mjs +0 -43
- package/dist/es/components/OcrAnnotation/constant.mjs +0 -5
- package/dist/es/components/OcrAnnotation/index.mjs +0 -381
- package/dist/es/components/OcrImageAnnotation/index.mjs +0 -39
- package/dist/es/components/PageNav/index.mjs +0 -29
- package/dist/es/components/PicZipImportModal/index.mjs +0 -583
- package/dist/es/components/PicZipImportModal/pic_zip.svg.mjs +0 -4
- package/dist/es/components/PicZipImportModal/pic_zip_json.svg.mjs +0 -4
- package/dist/es/components/PreLabelOCR/PreLabelModal.mjs +0 -275
- package/dist/es/components/PreLabelOCR/index.mjs +0 -43
- package/dist/es/components/ScanTable/index.mjs +0 -96
- package/dist/es/components/Thumbnail/default.png.mjs +0 -4
- package/dist/es/components/Thumbnail/index.mjs +0 -30
- package/dist/es/components/hooks/Prompt.mjs +0 -33
- package/dist/es/constant.mjs +0 -13
- package/dist/es/createDatasetAnnotation/index.mjs +0 -133
- package/dist/es/createDetectionDatasetAnnotation/index.mjs +0 -129
- package/dist/es/createDetectionImageAnnotation/index.mjs +0 -31
- package/dist/es/createOcrDatasetAnnotation/index.mjs +0 -129
- package/dist/es/createOcrImageAnnotation/index.mjs +0 -33
- package/dist/es/featuresConfig.mjs +0 -79
- package/dist/es/index.mjs +0 -35
- package/dist/es/node_modules/classnames/index.mjs +0 -42
- package/dist/es/utils/color.mjs +0 -30
- package/dist/es/utils/index.mjs +0 -22
- package/dist/es/utils/sign.mjs +0 -33
- package/dist/lib/index.js +0 -7
- package/dist/src/components/Iconfont/font_3140028_iptomfpgyu.d.ts +0 -0
- package/dist/src/components/Iconfont/font_3454453_gu5ijeufyng.d.ts +0 -0
- package/dist/src/components/Iconfont/font_4108228_3slzqhoow93.d.ts +0 -0
- package/dist/src/components/Iconfont/font_4439177_k3mjwv7kzfd.d.ts +0 -0
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
var _ = Object.defineProperty, $ = Object.defineProperties;
|
|
2
|
-
var H = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var P = Object.getOwnPropertySymbols;
|
|
4
|
-
var I = Object.prototype.hasOwnProperty, L = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var R = (i, o, s) => o in i ? _(i, o, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[o] = s, g = (i, o) => {
|
|
6
|
-
for (var s in o || (o = {}))
|
|
7
|
-
I.call(o, s) && R(i, s, o[s]);
|
|
8
|
-
if (P)
|
|
9
|
-
for (var s of P(o))
|
|
10
|
-
L.call(o, s) && R(i, s, o[s]);
|
|
11
|
-
return i;
|
|
12
|
-
}, N = (i, o) => $(i, H(o));
|
|
13
|
-
import { jsxs as h, jsx as a } from "react/jsx-runtime";
|
|
14
|
-
import { Row as B, Button as U, Input as ee, Space as te, Empty as ie, Modal as le } from "antd";
|
|
15
|
-
import { useState as m, useContext as re, useEffect as w } from "react";
|
|
16
|
-
import Z from "../TagItem/index.mjs";
|
|
17
|
-
/* empty css */import { PlusOutlined as oe } from "@ant-design/icons";
|
|
18
|
-
import q from "../DisabledTooltip/index.mjs";
|
|
19
|
-
import ne from "../../../../DatasetContext/index.mjs";
|
|
20
|
-
import { tagColors as k } from "../../../../utils/index.mjs";
|
|
21
|
-
import se from "../../../Iconfont/index.mjs";
|
|
22
|
-
const Ae = ({
|
|
23
|
-
datasetId: i,
|
|
24
|
-
data: o,
|
|
25
|
-
selected: s = [],
|
|
26
|
-
showZero: ce = !0,
|
|
27
|
-
shortcut: F = !1,
|
|
28
|
-
selectMode: G = "multiple",
|
|
29
|
-
onItemClick: y,
|
|
30
|
-
onSelectedChange: M,
|
|
31
|
-
onListChange: u,
|
|
32
|
-
isPreLabel: v = !1,
|
|
33
|
-
settingHide: C = !1
|
|
34
|
-
}) => {
|
|
35
|
-
const [n, A] = m([]), [ae, T] = m(!1), [r, p] = m([]), [j, z] = m(""), [x, S] = m(null), [D, J] = m(!1), {
|
|
36
|
-
services: {
|
|
37
|
-
cvforceDatahub: d
|
|
38
|
-
},
|
|
39
|
-
featuresConfig: {
|
|
40
|
-
labelManager: f
|
|
41
|
-
} = {
|
|
42
|
-
labelManager: !1
|
|
43
|
-
}
|
|
44
|
-
} = re(ne);
|
|
45
|
-
w(() => {
|
|
46
|
-
r.length && A(s.map((e) => r.find((t) => t.id === e.id)));
|
|
47
|
-
}, [s, r]), w(() => {
|
|
48
|
-
i && E();
|
|
49
|
-
}, [i]), w(() => {
|
|
50
|
-
!i && o && p(o.map((e) => N(g({}, e), {
|
|
51
|
-
createdAt: 0,
|
|
52
|
-
updatedAt: 0
|
|
53
|
-
})));
|
|
54
|
-
}, [i, o]);
|
|
55
|
-
const E = () => {
|
|
56
|
-
!i || !d || (T(!0), d.listLabels(i, {
|
|
57
|
-
pageNo: 1,
|
|
58
|
-
pageSize: 1e4
|
|
59
|
-
}).then((e) => {
|
|
60
|
-
p(e.recordList.sort((t, l) => t.createdAt - l.createdAt > 0 ? -1 : t.createdAt - l.createdAt < 0 ? 1 : 0).map((t, l) => N(g({}, t), {
|
|
61
|
-
color: k[l % 40]
|
|
62
|
-
})));
|
|
63
|
-
}).finally(() => T(!1)));
|
|
64
|
-
}, K = (e) => !i || !d ? Promise.resolve(!1) : d.postLabels(i, {
|
|
65
|
-
labels: [{
|
|
66
|
-
label: e
|
|
67
|
-
}]
|
|
68
|
-
}).then((t) => {
|
|
69
|
-
p([...r, {
|
|
70
|
-
label: e,
|
|
71
|
-
id: t[0],
|
|
72
|
-
color: k[r.length % 40],
|
|
73
|
-
createdAt: Date.now(),
|
|
74
|
-
updatedAt: Date.now()
|
|
75
|
-
}]), S(null), u && u([...r]);
|
|
76
|
-
}).then(() => !0).catch(() => !1), Q = (e) => {
|
|
77
|
-
let t = [];
|
|
78
|
-
G === "multiple" ? n != null && n.some((l) => l.id === e.id) ? t = n == null ? void 0 : n.filter((l) => l.id !== e.id) : t = [...n, e] : n != null && n.some((l) => l.id === e.id) ? t = [] : t = [e], A(t), M && M(t);
|
|
79
|
-
}, V = (e) => {
|
|
80
|
-
z(e);
|
|
81
|
-
}, W = (e) => {
|
|
82
|
-
if (!i || !d)
|
|
83
|
-
return Promise.resolve(!1);
|
|
84
|
-
const t = r.findIndex((l) => l.id === e.id);
|
|
85
|
-
return d.patchLabel(i, e.id, e).then(() => (t < 0 || (r[t] = e, p([...r]), u && u([...r])), !0)).catch(() => !1);
|
|
86
|
-
}, X = (e) => {
|
|
87
|
-
le.confirm({
|
|
88
|
-
title: "确认要删除当前标签吗?",
|
|
89
|
-
content: "删除后,将会删除当前数据集中所有与当前标签关联的数据,删除后无法恢复,请确认是否删除!",
|
|
90
|
-
onOk: () => {
|
|
91
|
-
if (!i || !d)
|
|
92
|
-
return;
|
|
93
|
-
const t = r.findIndex((c) => c.id === e), l = n.findIndex((c) => c.id === e);
|
|
94
|
-
return d.deleteLabel(i, e).then(() => {
|
|
95
|
-
l > -1 && (n.splice(l, 1), A([...n])), r.splice(t, 1), p([...r]), u && u([...r]), E();
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}, b = (r == null ? void 0 : r.filter((e) => !j || e.label.includes(j))) || [];
|
|
100
|
-
return /* @__PURE__ */ h("div", {
|
|
101
|
-
className: "label-list-wrap",
|
|
102
|
-
children: [/* @__PURE__ */ h(B, {
|
|
103
|
-
justify: "space-between",
|
|
104
|
-
className: "label-list-title",
|
|
105
|
-
children: [/* @__PURE__ */ a("span", {
|
|
106
|
-
className: "label-list-title",
|
|
107
|
-
children: "标签列表"
|
|
108
|
-
}), /* @__PURE__ */ a("span", {
|
|
109
|
-
className: "label-list-icon",
|
|
110
|
-
children: !C && f && f.visible && /* @__PURE__ */ a(q, {
|
|
111
|
-
isPreLabel: v,
|
|
112
|
-
placement: "topRight",
|
|
113
|
-
children: /* @__PURE__ */ a(U, {
|
|
114
|
-
type: D ? "link" : "text",
|
|
115
|
-
size: "small",
|
|
116
|
-
onClick: () => J(!D),
|
|
117
|
-
icon: /* @__PURE__ */ a(se, {
|
|
118
|
-
type: "icon-shezhi"
|
|
119
|
-
}),
|
|
120
|
-
disabled: v
|
|
121
|
-
})
|
|
122
|
-
})
|
|
123
|
-
})]
|
|
124
|
-
}), /* @__PURE__ */ h(B, {
|
|
125
|
-
className: "label-list-opration",
|
|
126
|
-
children: [!C && f && f.add && /* @__PURE__ */ a(q, {
|
|
127
|
-
isPreLabel: v,
|
|
128
|
-
children: /* @__PURE__ */ a(U, {
|
|
129
|
-
className: "label-list-create",
|
|
130
|
-
type: "default",
|
|
131
|
-
icon: /* @__PURE__ */ a(oe, {}),
|
|
132
|
-
disabled: x !== null || v,
|
|
133
|
-
onClick: () => {
|
|
134
|
-
S({
|
|
135
|
-
color: k[r.length % 40],
|
|
136
|
-
label: ""
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
})
|
|
140
|
-
}), /* @__PURE__ */ a("span", {
|
|
141
|
-
className: "label-list-search",
|
|
142
|
-
children: /* @__PURE__ */ a(ee.Search, {
|
|
143
|
-
placeholder: "请输入标签名称搜索",
|
|
144
|
-
onSearch: V,
|
|
145
|
-
onChange: (e) => {
|
|
146
|
-
z(e.target.value);
|
|
147
|
-
}
|
|
148
|
-
})
|
|
149
|
-
})]
|
|
150
|
-
}), /* @__PURE__ */ h(te, {
|
|
151
|
-
direction: "vertical",
|
|
152
|
-
className: "label-list",
|
|
153
|
-
children: [x && /* @__PURE__ */ a(Z, {
|
|
154
|
-
onSave: K,
|
|
155
|
-
onCancel: () => {
|
|
156
|
-
S(null);
|
|
157
|
-
},
|
|
158
|
-
label: x.label || "",
|
|
159
|
-
color: x.color || "",
|
|
160
|
-
editMode: !0,
|
|
161
|
-
isActive: !1,
|
|
162
|
-
onCheckDuplication: (e) => {
|
|
163
|
-
const t = b.findIndex((l) => l.label === e);
|
|
164
|
-
return Promise.resolve(t > -1);
|
|
165
|
-
}
|
|
166
|
-
}), b.length ? b.reverse().map((e, t) => {
|
|
167
|
-
var l;
|
|
168
|
-
return /* @__PURE__ */ a(Z, {
|
|
169
|
-
isActive: n.some((c) => (c == null ? void 0 : c.id) === e.id),
|
|
170
|
-
editable: D,
|
|
171
|
-
shortcut: t < 10 ? t.toString() : void 0,
|
|
172
|
-
extra: F ? t < 10 ? /* @__PURE__ */ h("span", {
|
|
173
|
-
className: "shortcut",
|
|
174
|
-
children: ["快捷键", t]
|
|
175
|
-
}) : null : ((l = o.find((c) => c.label === e.label)) == null ? void 0 : l.count) || 0,
|
|
176
|
-
label: e.label,
|
|
177
|
-
color: e.color,
|
|
178
|
-
onClick: () => {
|
|
179
|
-
Q(e), y && y(e);
|
|
180
|
-
},
|
|
181
|
-
onSave: f && f.edit ? (c) => W(N(g({}, e), {
|
|
182
|
-
label: c
|
|
183
|
-
})) : void 0,
|
|
184
|
-
onDelete: f && f.delete ? () => X(e.id) : void 0,
|
|
185
|
-
onCheckDuplication: (c) => {
|
|
186
|
-
const Y = b.findIndex((O) => O.label === c && e.id !== O.id);
|
|
187
|
-
return Promise.resolve(Y > -1);
|
|
188
|
-
}
|
|
189
|
-
}, e.id);
|
|
190
|
-
}) : /* @__PURE__ */ a(ie, {
|
|
191
|
-
className: "label-list-empty",
|
|
192
|
-
image: !1,
|
|
193
|
-
description: "请先添加标签,然后在图中框选标注"
|
|
194
|
-
})]
|
|
195
|
-
})]
|
|
196
|
-
});
|
|
197
|
-
};
|
|
198
|
-
export {
|
|
199
|
-
Ae as default
|
|
200
|
-
};
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as h, useRef as K, useEffect as O } from "react";
|
|
3
|
-
import E from "../../../../node_modules/classnames/index.mjs";
|
|
4
|
-
/* empty css */import { Tooltip as S, Input as R, Space as I, Button as p } from "antd";
|
|
5
|
-
import { CheckOutlined as U, CloseOutlined as W } from "@ant-design/icons";
|
|
6
|
-
import { useKeyPress as P } from "ahooks";
|
|
7
|
-
import _ from "../../../Iconfont/index.mjs";
|
|
8
|
-
const H = (j) => {
|
|
9
|
-
const {
|
|
10
|
-
label: o,
|
|
11
|
-
color: g,
|
|
12
|
-
isActive: C = !1,
|
|
13
|
-
extra: A,
|
|
14
|
-
editMode: T = !1,
|
|
15
|
-
editable: $ = !1,
|
|
16
|
-
shortcut: f,
|
|
17
|
-
onClick: l,
|
|
18
|
-
onSave: a,
|
|
19
|
-
onCancel: k,
|
|
20
|
-
onDelete: u,
|
|
21
|
-
onCheckDuplication: N
|
|
22
|
-
} = j, [y, r] = h(T), [e, x] = h(o), [c, i] = h(""), m = K(null), b = (n) => {
|
|
23
|
-
var s;
|
|
24
|
-
((s = n.target) == null ? void 0 : s.tagName) === "INPUT" || f === void 0 || l && l();
|
|
25
|
-
};
|
|
26
|
-
P(f || "", b), P(`Numpad${f}` || "", b);
|
|
27
|
-
const z = () => {
|
|
28
|
-
if (!(e != null && e.length)) {
|
|
29
|
-
i("标签名称不能为空");
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if ((e == null ? void 0 : e.length) > 256) {
|
|
33
|
-
i("标签名称不能超过256字符");
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
if (!/^[\u4e00-\u9fa5A-Za-z0-9_]+$/.test(e)) {
|
|
37
|
-
i("标签名称不能含特殊符号");
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
N ? N(e).then((s) => {
|
|
41
|
-
s ? i("标签名称已存在") : a && a(e).then((D) => {
|
|
42
|
-
r(!D);
|
|
43
|
-
});
|
|
44
|
-
}) : a && a(e).then((s) => {
|
|
45
|
-
r(!s);
|
|
46
|
-
});
|
|
47
|
-
}, v = () => {
|
|
48
|
-
r(!1), x(o), k && k();
|
|
49
|
-
};
|
|
50
|
-
return O(() => {
|
|
51
|
-
if (!e)
|
|
52
|
-
return;
|
|
53
|
-
const n = /^[\u4e00-\u9fa5A-Za-z0-9_]+$/;
|
|
54
|
-
(e == null ? void 0 : e.length) > 256 ? i("标签名称不能超过256字符") : n.test(e) ? i("") : i("标签名称不能含特殊符号");
|
|
55
|
-
}, [e]), /* @__PURE__ */ d("div", {
|
|
56
|
-
className: E({
|
|
57
|
-
"tag-item": !0,
|
|
58
|
-
"tag-item__active": C
|
|
59
|
-
}),
|
|
60
|
-
style: {
|
|
61
|
-
backgroundColor: g + (C ? "60" : "14")
|
|
62
|
-
// 底色透明度
|
|
63
|
-
},
|
|
64
|
-
onClick: () => {
|
|
65
|
-
l && l();
|
|
66
|
-
},
|
|
67
|
-
children: [/* @__PURE__ */ t("span", {
|
|
68
|
-
className: "tag-item-decorate-line",
|
|
69
|
-
style: {
|
|
70
|
-
borderColor: g
|
|
71
|
-
}
|
|
72
|
-
}), y ? /* @__PURE__ */ d("div", {
|
|
73
|
-
className: "editing",
|
|
74
|
-
onClick: (n) => n.stopPropagation(),
|
|
75
|
-
children: [/* @__PURE__ */ t(S, {
|
|
76
|
-
open: !!c,
|
|
77
|
-
title: c,
|
|
78
|
-
children: /* @__PURE__ */ t(R, {
|
|
79
|
-
value: e,
|
|
80
|
-
autoFocus: !0,
|
|
81
|
-
onChange: (n) => {
|
|
82
|
-
x(n.target.value);
|
|
83
|
-
},
|
|
84
|
-
className: E({
|
|
85
|
-
error: c
|
|
86
|
-
}),
|
|
87
|
-
onKeyUp: (n) => {
|
|
88
|
-
n.key === "Enter" ? z() : n.key === "Escape" && v();
|
|
89
|
-
}
|
|
90
|
-
})
|
|
91
|
-
}), /* @__PURE__ */ d(I, {
|
|
92
|
-
size: 4,
|
|
93
|
-
className: "editing-operation",
|
|
94
|
-
children: [/* @__PURE__ */ t(p, {
|
|
95
|
-
className: "save-btn",
|
|
96
|
-
type: "text",
|
|
97
|
-
size: "small",
|
|
98
|
-
disabled: !!c || !e,
|
|
99
|
-
icon: /* @__PURE__ */ t(U, {}),
|
|
100
|
-
onClick: z
|
|
101
|
-
}), /* @__PURE__ */ t(p, {
|
|
102
|
-
className: "cancel-btn",
|
|
103
|
-
type: "text",
|
|
104
|
-
size: "small",
|
|
105
|
-
icon: /* @__PURE__ */ t(W, {}),
|
|
106
|
-
onClick: v
|
|
107
|
-
})]
|
|
108
|
-
})]
|
|
109
|
-
}) : /* @__PURE__ */ t(S, {
|
|
110
|
-
title: o === "nocode" ? "无标签" : o,
|
|
111
|
-
open: m.current && m.current.scrollWidth > m.current.clientWidth ? void 0 : !1,
|
|
112
|
-
children: /* @__PURE__ */ t("span", {
|
|
113
|
-
className: "tag-item-name",
|
|
114
|
-
ref: m,
|
|
115
|
-
children: o === "nocode" ? "无标签" : o
|
|
116
|
-
})
|
|
117
|
-
}), !y && /* @__PURE__ */ t("span", {
|
|
118
|
-
className: "tag-item-extra",
|
|
119
|
-
children: $ ? /* @__PURE__ */ d(I, {
|
|
120
|
-
className: "item-operations",
|
|
121
|
-
onClick: (n) => n.stopPropagation(),
|
|
122
|
-
children: [a && /* @__PURE__ */ t(p, {
|
|
123
|
-
type: "link",
|
|
124
|
-
size: "small",
|
|
125
|
-
icon: /* @__PURE__ */ t(_, {
|
|
126
|
-
type: "icon-bianji2"
|
|
127
|
-
}),
|
|
128
|
-
onClick: () => r(!0)
|
|
129
|
-
}), u && /* @__PURE__ */ t(p, {
|
|
130
|
-
type: "link",
|
|
131
|
-
size: "small",
|
|
132
|
-
icon: /* @__PURE__ */ t(_, {
|
|
133
|
-
type: "icon-del"
|
|
134
|
-
}),
|
|
135
|
-
onClick: () => u && u()
|
|
136
|
-
})]
|
|
137
|
-
}) : A
|
|
138
|
-
})]
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
export {
|
|
142
|
-
H as default
|
|
143
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const M = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODIiIGhlaWdodD0iOTAiIHZpZXdCb3g9IjAgMCA4MiA5MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yOS4xMiA2MC4zMTAxQzI5LjA0IDYwLjg2MDEgMjkgNjEuNDMgMjkgNjJDMjkgNjguNjMgMzQuMzcgNzQgNDEgNzRDNDcuNjMgNzQgNTMgNjguNjMgNTMgNjJDNTMgNjEuNDMgNTIuOTYgNjAuODYwMSA1Mi44OCA2MC4zMTAxSDgyVjg3QzgyIDg4LjY2IDgwLjY2IDkwIDc5IDkwSDNDMS4zNCA5MCAwIDg4LjY2IDAgODdWNjAuMzEwMUgyOS4xMloiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNTIuMSA2MC45NUM1Mi4xIDY2LjUgNDcuMTMgNzIgNDEgNzJDMzQuODcgNzIgMjkuOSA2Ni41IDI5LjkgNjAuOTVDMjkuOSA2MC43NyAyOS45MSA1OS42IDI5LjkyIDU5LjQySDlMMTcuMTYgMzkuNThDMTcuNTEgMzguNjMgMTguNDkgMzggMTkuNTkgMzhINjIuNDFDNjMuNTEgMzggNjQuNDkgMzguNjMgNjQuODQgMzkuNThMNzMgNTkuNDJINTIuMDhDNTIuMDkgNTkuNiA1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