@glodon-aiot/dataset-annotation 3.10.0-alpha.24 → 3.10.0-alpha.25

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.
@@ -1,86 +1,85 @@
1
- import { jsxs as x, jsx as i } from "react/jsx-runtime";
2
- import { useRef as w, useState as k, useEffect as v } from "react";
3
- import { Input as I } from "antd";
1
+ import { jsxs as x, jsx as c } from "react/jsx-runtime";
2
+ import { useRef as w, useState as I, useEffect as v } from "react";
3
+ import { Input as T } from "antd";
4
4
  import { UpOutlined as j } from "@ant-design/icons";
5
5
  const M = ({
6
6
  name: h,
7
- labelDefinitions: l,
8
- region: T,
7
+ labelDefinitions: m,
8
+ region: $,
9
9
  isSelected: p,
10
- isActive: n,
11
- activeLabelId: c,
12
- onChange: f,
13
- onFocus: a,
10
+ isActive: s,
11
+ activeLabelId: i,
12
+ onChange: a,
13
+ onFocus: f,
14
14
  onBlur: d,
15
15
  readOnly: N
16
16
  }) => {
17
- const s = w(null), u = w(/* @__PURE__ */ new Map()), [m, g] = k(!1);
17
+ const n = w(null), u = w(/* @__PURE__ */ new Map()), [l, g] = I(!1);
18
18
  return v(() => {
19
- p && s.current && (g(!1), setTimeout(() => {
20
- s.current && s.current.scrollIntoView({
19
+ p && n.current && (g(!1), setTimeout(() => {
20
+ n.current && n.current.scrollIntoView({
21
21
  behavior: "smooth",
22
22
  block: "nearest",
23
23
  inline: "nearest"
24
24
  });
25
25
  }, 200));
26
26
  }, [p]), v(() => {
27
- n && s.current && (g(!1), setTimeout(() => {
28
- s.current && s.current.scrollIntoView({
27
+ s && n.current && (g(!1), setTimeout(() => {
28
+ n.current && n.current.scrollIntoView({
29
29
  behavior: "smooth",
30
30
  block: "nearest",
31
31
  inline: "nearest"
32
32
  });
33
33
  }, 200));
34
- }, [n]), v(() => {
35
- if (n && c) {
36
- const t = u.current.get(c);
37
- t != null && t.input ? setTimeout(() => {
38
- t.input && t.input.focus();
39
- }, 0) : setTimeout(() => {
40
- const o = u.current.get(c);
34
+ }, [s]), v(() => {
35
+ if (s && i) {
36
+ const t = u.current.get(i);
37
+ t != null && t.input ? t.input.focus() : setTimeout(() => {
38
+ const o = u.current.get(i);
41
39
  o != null && o.input && o.input.focus();
42
40
  }, 100);
43
41
  }
44
- }, [n, c]), /* @__PURE__ */ x("div", {
45
- ref: s,
46
- className: `vlm-text-region ${p || n ? "vlm-text-region-selected" : ""} ${m ? "vlm-text-region-collapsed" : ""}`,
42
+ }, [s, i]), /* @__PURE__ */ x("div", {
43
+ ref: n,
44
+ className: `vlm-text-region ${p || s ? "vlm-text-region-selected" : ""} ${l ? "vlm-text-region-collapsed" : ""}`,
47
45
  children: [/* @__PURE__ */ x("div", {
48
46
  className: "vlm-text-region-header",
49
- onClick: () => g(!m),
50
- children: [/* @__PURE__ */ i("span", {
51
- className: `vlm-text-region-collapse-icon ${m ? "vlm-text-region-collapse-icon-collapsed" : ""}`,
52
- children: /* @__PURE__ */ i(j, {})
53
- }), /* @__PURE__ */ i("span", {
47
+ onClick: () => g(!l),
48
+ children: [/* @__PURE__ */ c("span", {
49
+ className: `vlm-text-region-collapse-icon ${l ? "vlm-text-region-collapse-icon-collapsed" : ""}`,
50
+ children: /* @__PURE__ */ c(j, {})
51
+ }), /* @__PURE__ */ c("span", {
54
52
  className: "vlm-text-region-name",
55
53
  children: h
56
54
  })]
57
- }), /* @__PURE__ */ i("div", {
58
- className: `vlm-text-region-content ${m ? "vlm-text-region-content-collapsed" : ""}`,
59
- children: l == null ? void 0 : l.map((t) => {
60
- const o = n && c === t.id;
55
+ }), /* @__PURE__ */ c("div", {
56
+ className: `vlm-text-region-content ${l ? "vlm-text-region-content-collapsed" : ""}`,
57
+ children: m == null ? void 0 : m.map((t) => {
58
+ const o = s && i === t.id;
61
59
  return /* @__PURE__ */ x("div", {
62
60
  className: "vlm-text-label",
63
- children: [t.name, /* @__PURE__ */ i("br", {}), /* @__PURE__ */ i(I, {
64
- ref: (r) => {
65
- r ? u.current.set(t.id, r) : u.current.delete(t.id);
61
+ children: [t.name, /* @__PURE__ */ c("br", {}), /* @__PURE__ */ c(T, {
62
+ ref: (e) => {
63
+ e ? u.current.set(t.id, e) : u.current.delete(t.id);
66
64
  },
67
- value: T.content[t.id],
68
- onFocus: (r) => {
69
- a == null || a(t.id, r.target.value || ""), setTimeout(() => {
70
- const e = u.current.get(t.id);
71
- e != null && e.input && e.input.focus();
65
+ value: $.content[t.id],
66
+ onFocus: (e) => {
67
+ f == null || f(t.id, e.target.value || ""), setTimeout(() => {
68
+ const r = u.current.get(t.id);
69
+ r != null && r.input && r.input.focus();
72
70
  }, 0);
73
71
  },
74
- onBlur: (r) => {
75
- const e = r.relatedTarget, $ = (e == null ? void 0 : e.tagName) === "INPUT" || (e == null ? void 0 : e.closest("input")) !== null;
76
- if (o && !$) {
77
- r.target.focus();
72
+ onBlur: (e) => {
73
+ console.log("onBlur", e);
74
+ const r = e.relatedTarget, k = (r == null ? void 0 : r.tagName) === "INPUT" || (r == null ? void 0 : r.closest("input")) !== null;
75
+ if (o && !k) {
76
+ e.target.focus();
78
77
  return;
79
78
  }
80
- d == null || d(t.id, r.target.value || "");
79
+ d == null || d(t.id, e.target.value || "");
81
80
  },
82
- onChange: (r) => {
83
- f == null || f(t.id, r.target.value || "");
81
+ onChange: (e) => {
82
+ a == null || a(t.id, e.target.value || "");
84
83
  },
85
84
  allowClear: !N,
86
85
  readOnly: N