@kong-ui-public/entities-plugins 9.244.0 → 9.246.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.
@@ -1,4 +1,4 @@
1
- import { s as f, i as h, c as p, g as k, w as S, a as F, b as v, d as A } from "../field-walker-Cc7ahQwd.js";
1
+ import { s as f, i as h, c as p, g as k, w as S, a as v, b as F, d as A } from "../field-walker-BKYEagiA.js";
2
2
  async function B(o) {
3
3
  const { page: a, fieldKey: n, value: t } = o, e = f.field(n), i = a.locator(e);
4
4
  await i.clear(), t != null && t !== "" && await i.fill(String(t));
@@ -12,14 +12,13 @@ async function E(o) {
12
12
  t === !0 ? await i.check() : t === !1 && await i.uncheck();
13
13
  }
14
14
  async function I(o) {
15
- var b;
16
15
  const { page: a, fieldKey: n, fieldSchema: t, value: e } = o, i = h(t), w = i ? Array.isArray(e) ? e : [e] : [e], d = f.field(n);
17
16
  await a.locator(d).click();
18
17
  const m = f.selectTrigger(n);
19
- for (const u of t.one_of ?? ((b = t.elements) == null ? void 0 : b.one_of) ?? [])
18
+ for (const u of t.one_of ?? t.elements?.one_of ?? [])
20
19
  if (u != null) {
21
- const l = i ? f.multiSelectItem(String(u)) : f.selectItem(String(u));
22
- i && await a.locator(m).locator(`${l} button.selected`).count() > 0 && await a.locator(m).locator(l).click(), w.includes(u) && await a.locator(m).locator(l).click();
20
+ const b = i ? f.multiSelectItem(String(u)) : f.selectItem(String(u));
21
+ i && await a.locator(m).locator(`${b} button.selected`).count() > 0 && await a.locator(m).locator(b).click(), w.includes(u) && await a.locator(m).locator(b).click();
23
22
  }
24
23
  }
25
24
  async function j(o) {
@@ -29,14 +28,14 @@ async function j(o) {
29
28
  async function M(o) {
30
29
  const { page: a, fieldKey: n, value: t, onFillItem: e } = o, i = f.arrayTabContainer(n), w = f.arrayBasicContainer(n), d = await a.locator(i).count() > 0, m = await a.locator(w).count() > 0;
31
30
  if (d || m) {
32
- const b = f.arrayRemoveBtns(n), u = async () => {
33
- await a.locator(b).count() > 0 && (await a.locator(b).first().click(), await u());
31
+ const u = f.arrayRemoveBtns(n), b = async () => {
32
+ await a.locator(u).count() > 0 && (await a.locator(u).first().click(), await b());
34
33
  };
35
- if (await u(), !Array.isArray(t))
34
+ if (await b(), !Array.isArray(t))
36
35
  return;
37
- for (let l = 0; l < t.length; l++) {
36
+ for (let r = 0; r < t.length; r++) {
38
37
  const c = f.arrayAddBtn(n);
39
- await a.locator(c).click(), await e(l, t[l]);
38
+ await a.locator(c).click(), await e(r, t[r]);
40
39
  }
41
40
  }
42
41
  }
@@ -66,16 +65,16 @@ async function R(o) {
66
65
  const w = Object.entries(t);
67
66
  if (w.length !== 0)
68
67
  for (let d = 0; d < w.length; d++) {
69
- const [m, b] = w[d];
68
+ const [m, u] = w[d];
70
69
  await a.locator(f.mapAddBtn(n)).click();
71
- const u = f.mapContainer(n, d), l = a.locator(u);
72
- await l.waitFor();
70
+ const b = f.mapContainer(n, d), r = a.locator(b);
71
+ await r.waitFor();
73
72
  const c = a.locator(f.mapKey(n, d));
74
73
  await c.clear(), await c.fill(String(m));
75
- const r = l.locator(`[data-testid*="${n}.kid:"]`).first();
76
- await r.waitFor();
77
- const s = x(await r.getAttribute("data-testid"), n);
78
- await e(s, b);
74
+ const l = r.locator(`[data-testid*="${n}.kid:"]`).first();
75
+ await l.waitFor();
76
+ const s = x(await l.getAttribute("data-testid"), n);
77
+ await e(s, u);
79
78
  }
80
79
  }
81
80
  async function $(o) {
@@ -85,7 +84,7 @@ async function $(o) {
85
84
  async function N(o) {
86
85
  const { page: a, fieldKey: n, value: t } = o, e = f.field(n);
87
86
  await a.locator(e).click();
88
- const i = typeof t == "object" && (t != null && t.id) ? t.id : t;
87
+ const i = typeof t == "object" && t?.id ? t.id : t;
89
88
  i && await a.locator(`[data-testid="select-item-${i}"]`).click();
90
89
  }
91
90
  const J = {
@@ -102,32 +101,32 @@ const J = {
102
101
  };
103
102
  function K(o, a, n) {
104
103
  const t = p(a), e = { ...J, ...n };
105
- async function i(l, c, r = "") {
106
- for (const s of S(l, c, t, r))
104
+ async function i(r, c, l = "") {
105
+ for (const s of S(r, c, t, l))
107
106
  await w(s);
108
107
  }
109
- async function w({ handlerType: l, fieldKey: c, fieldSchema: r, value: s }) {
110
- switch (l) {
108
+ async function w({ handlerType: r, fieldKey: c, fieldSchema: l, value: s }) {
109
+ switch (r) {
111
110
  case "string":
112
- await e.fillString({ page: o, fieldKey: c, fieldSchema: r, value: s });
111
+ await e.fillString({ page: o, fieldKey: c, fieldSchema: l, value: s });
113
112
  break;
114
113
  case "number":
115
- await e.fillNumber({ page: o, fieldKey: c, fieldSchema: r, value: s });
114
+ await e.fillNumber({ page: o, fieldKey: c, fieldSchema: l, value: s });
116
115
  break;
117
116
  case "boolean":
118
- await e.fillBoolean({ page: o, fieldKey: c, fieldSchema: r, value: s });
117
+ await e.fillBoolean({ page: o, fieldKey: c, fieldSchema: l, value: s });
119
118
  break;
120
119
  case "enum":
121
- await e.fillEnum({ page: o, fieldKey: c, fieldSchema: r, value: s });
120
+ await e.fillEnum({ page: o, fieldKey: c, fieldSchema: l, value: s });
122
121
  break;
123
122
  case "tag":
124
- await e.fillTag({ page: o, fieldKey: c, fieldSchema: r, value: s });
123
+ await e.fillTag({ page: o, fieldKey: c, fieldSchema: l, value: s });
125
124
  break;
126
125
  case "map":
127
126
  await e.fillMap({
128
127
  page: o,
129
128
  fieldKey: c,
130
- fieldSchema: r,
129
+ fieldSchema: l,
131
130
  value: s,
132
131
  onFillEntry: async (g, y) => {
133
132
  await m(t, c, g, y);
@@ -135,16 +134,16 @@ function K(o, a, n) {
135
134
  });
136
135
  break;
137
136
  case "json":
138
- await e.fillJson({ page: o, fieldKey: c, fieldSchema: r, value: s });
137
+ await e.fillJson({ page: o, fieldKey: c, fieldSchema: l, value: s });
139
138
  break;
140
139
  case "foreign":
141
- await e.fillForeign({ page: o, fieldKey: c, fieldSchema: r, value: s });
140
+ await e.fillForeign({ page: o, fieldKey: c, fieldSchema: l, value: s });
142
141
  break;
143
142
  case "array":
144
143
  await e.fillArray({
145
144
  page: o,
146
145
  fieldKey: c,
147
- fieldSchema: r,
146
+ fieldSchema: l,
148
147
  value: s,
149
148
  onFillItem: async (g, y) => {
150
149
  await d(t, c, g, y);
@@ -155,26 +154,26 @@ function K(o, a, n) {
155
154
  await e.fillRecord({
156
155
  page: o,
157
156
  fieldKey: c,
158
- fieldSchema: r,
157
+ fieldSchema: l,
159
158
  value: s,
160
159
  onFillChildren: async () => {
161
- await i(r.fields, s, c);
160
+ await i(l.fields, s, c);
162
161
  }
163
162
  });
164
163
  break;
165
164
  }
166
165
  }
167
- async function d(l, c, r, s) {
168
- const { itemKey: g, itemSchema: y } = F(c, r, l);
169
- v(y) ? await i(y.fields, s, g) : await w({
166
+ async function d(r, c, l, s) {
167
+ const { itemKey: g, itemSchema: y } = v(c, l, r);
168
+ F(y) ? await i(y.fields, s, g) : await w({
170
169
  handlerType: k(y),
171
170
  fieldKey: g,
172
171
  fieldSchema: y,
173
172
  value: s
174
173
  });
175
174
  }
176
- async function m(l, c, r, s) {
177
- const { entryKey: g, entrySchema: y } = A(c, r, l);
175
+ async function m(r, c, l, s) {
176
+ const { entryKey: g, entrySchema: y } = A(c, l, r);
178
177
  await w({
179
178
  handlerType: k(y),
180
179
  fieldKey: g,
@@ -182,23 +181,23 @@ function K(o, a, n) {
182
181
  value: s
183
182
  });
184
183
  }
185
- async function b(l) {
186
- a.fields && Array.isArray(a.fields) && await i(a.fields, l);
184
+ async function u(r) {
185
+ a.fields && Array.isArray(a.fields) && await i(a.fields, r);
187
186
  }
188
- async function u(l, c) {
189
- const r = t.schemaMap[l];
190
- if (!r)
191
- throw new Error(`Field schema for "${l}" not found in schema map`);
187
+ async function b(r, c) {
188
+ const l = t.schemaMap[r];
189
+ if (!l)
190
+ throw new Error(`Field schema for "${r}" not found in schema map`);
192
191
  await w({
193
- handlerType: k(r),
194
- fieldKey: l,
195
- fieldSchema: r,
192
+ handlerType: k(l),
193
+ fieldKey: r,
194
+ fieldSchema: l,
196
195
  value: c
197
196
  });
198
197
  }
199
198
  return {
200
- fill: b,
201
- fillField: u,
199
+ fill: u,
200
+ fillField: b,
202
201
  schemaMap: t.schemaMap,
203
202
  handlers: e
204
203
  };