@kong-ui-public/entities-plugins 9.244.0 → 9.245.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,114 +1,112 @@
1
- import { s as a, i as w, c as S, g as k, w as v, a as A, b as B, d as F } from "../field-walker-Cc7ahQwd.js";
1
+ import { s as a, i as w, c as v, g as k, w as S, a as A, b as B, d as F } from "../field-walker-BKYEagiA.js";
2
2
  const f = { scrollBehavior: "center" };
3
- function m(i) {
3
+ function p(i) {
4
4
  cy.get(i).then((n) => {
5
- var t;
6
- (t = n[0]) == null || t.scrollIntoView({ block: "center", inline: "nearest" });
5
+ n[0]?.scrollIntoView({ block: "center", inline: "nearest" });
7
6
  });
8
7
  }
9
8
  function I(i) {
10
- const { fieldKey: n, value: t } = i, e = a.field(n);
11
- m(e), cy.get(e).then((o) => {
12
- cy.wrap(o).clear(f), t != null && t !== "" && cy.wrap(o).type(String(t), f);
9
+ const { fieldKey: n, value: e } = i, t = a.field(n);
10
+ p(t), cy.get(t).then((o) => {
11
+ cy.wrap(o).clear(f), e != null && e !== "" && cy.wrap(o).type(String(e), f);
13
12
  });
14
13
  }
15
14
  function C(i) {
16
- const { fieldKey: n, value: t } = i, e = a.field(n);
17
- m(e), cy.get(e).then((o) => {
18
- cy.wrap(o).clear(f), t != null && cy.wrap(o).type(String(t), f);
15
+ const { fieldKey: n, value: e } = i, t = a.field(n);
16
+ p(t), cy.get(t).then((o) => {
17
+ cy.wrap(o).clear(f), e != null && cy.wrap(o).type(String(e), f);
19
18
  });
20
19
  }
21
20
  function E(i) {
22
- const { fieldKey: n, value: t } = i, e = a.field(n);
23
- m(e), t === !0 ? cy.get(e).check(f) : t === !1 && cy.get(e).uncheck(f);
21
+ const { fieldKey: n, value: e } = i, t = a.field(n);
22
+ p(t), e === !0 ? cy.get(t).check(f) : e === !1 && cy.get(t).uncheck(f);
24
23
  }
25
24
  function j(i) {
26
- var u;
27
- const { fieldKey: n, fieldSchema: t, value: e } = i, o = w(t), y = o ? Array.isArray(e) ? e : [e] : [e], d = a.field(n);
28
- m(d), cy.get(d).click(f);
25
+ const { fieldKey: n, fieldSchema: e, value: t } = i, o = w(e), y = o ? Array.isArray(t) ? t : [t] : [t], d = a.field(n);
26
+ p(d), cy.get(d).click(f);
29
27
  const g = a.selectTrigger(n);
30
- for (const h of t.one_of ?? ((u = t.elements) == null ? void 0 : u.one_of) ?? [])
31
- if (h != null) {
32
- const l = o ? a.multiSelectItem(String(h)) : a.selectItem(String(h));
33
- o && cy.get(g).find(l).within((c) => {
34
- c.find("button.selected").length > 0 && cy.get("button").click(f);
35
- }), y.includes(h) && cy.get(g).find(l).click(f);
28
+ for (const u of e.one_of ?? e.elements?.one_of ?? [])
29
+ if (u != null) {
30
+ const m = o ? a.multiSelectItem(String(u)) : a.selectItem(String(u));
31
+ o && cy.get(g).find(m).within((l) => {
32
+ l.find("button.selected").length > 0 && cy.get("button").click(f);
33
+ }), y.includes(u) && cy.get(g).find(m).click(f);
36
34
  }
37
35
  }
38
36
  function x(i) {
39
- const { fieldKey: n, value: t } = i, e = Array.isArray(t) ? t : [t], o = a.tagInput(n);
40
- m(o), cy.get(o).type(e.join(","), f);
37
+ const { fieldKey: n, value: e } = i, t = Array.isArray(e) ? e : [e], o = a.tagInput(n);
38
+ p(o), cy.get(o).type(t.join(","), f);
41
39
  }
42
40
  function M(i) {
43
- const { fieldKey: n, value: t, onFillItem: e } = i, o = a.arrayTabContainer(n), y = a.arrayBasicContainer(n);
41
+ const { fieldKey: n, value: e, onFillItem: t } = i, o = a.arrayTabContainer(n), y = a.arrayBasicContainer(n);
44
42
  cy.get("body").then((d) => {
45
43
  const g = d.find(o).length > 0, u = d.find(y).length > 0;
46
44
  if (g || u) {
47
- const h = a.arrayRemoveBtns(n), l = () => {
45
+ const m = a.arrayRemoveBtns(n), l = () => {
48
46
  cy.get("body").then((c) => {
49
- const r = c.find(h).first();
47
+ const r = c.find(m).first();
50
48
  r.length > 0 && (cy.wrap(r).click(f), l());
51
49
  });
52
50
  };
53
- if (l(), !Array.isArray(t))
51
+ if (l(), !Array.isArray(e))
54
52
  return;
55
- for (let c = 0; c < t.length; c++) {
53
+ for (let c = 0; c < e.length; c++) {
56
54
  const r = a.arrayAddBtn(n);
57
- m(r), cy.get(r).click(f), cy.get(a.arrayItem(n, c)).should("exist"), e(c, t[c]);
55
+ p(r), cy.get(r).click(f), cy.get(a.arrayItem(n, c)).should("exist"), t(c, e[c]);
58
56
  }
59
57
  }
60
58
  });
61
59
  }
62
60
  function R(i) {
63
- const { fieldKey: n, value: t, onFillChildren: e } = i, o = a.objectSwitch(n);
61
+ const { fieldKey: n, value: e, onFillChildren: t } = i, o = a.objectSwitch(n);
64
62
  cy.get("body").then((y) => {
65
63
  const d = y.find(o).length > 0;
66
- if (t == null && d) {
64
+ if (e == null && d) {
67
65
  cy.get(o).uncheck({ force: !0 });
68
66
  return;
69
67
  }
70
- d && (cy.get(o).check({ force: !0 }), cy.get(a.objectContent(n)).should("not.have.class", "ff-slide-active")), e();
68
+ d && (cy.get(o).check({ force: !0 }), cy.get(a.objectContent(n)).should("not.have.class", "ff-slide-active")), t();
71
69
  });
72
70
  }
73
71
  function T(i, n) {
74
72
  if (!i)
75
73
  throw new Error(`Unable to find map entry test id for "${n}"`);
76
- const t = i.match(/kid:\d+/);
77
- if (!t)
74
+ const e = i.match(/kid:\d+/);
75
+ if (!e)
78
76
  throw new Error(`Unable to extract map entry kid id from test id "${i}"`);
79
- return t[0];
77
+ return e[0];
80
78
  }
81
79
  function N(i) {
82
- const { fieldKey: n, value: t, onFillEntry: e } = i, o = a.mapRemoveBtns(n), y = () => {
80
+ const { fieldKey: n, value: e, onFillEntry: t } = i, o = a.mapRemoveBtns(n), y = () => {
83
81
  cy.get("body").then((g) => {
84
82
  const u = g.find(o).first();
85
83
  u.length > 0 && (cy.wrap(u).click(f), y());
86
84
  });
87
85
  };
88
- if (y(), typeof t != "object" || t == null)
86
+ if (y(), typeof e != "object" || e == null)
89
87
  return;
90
- const d = Object.entries(t);
88
+ const d = Object.entries(e);
91
89
  if (d.length !== 0)
92
90
  for (let g = 0; g < d.length; g++) {
93
- const [u, h] = d[g], l = a.mapAddBtn(n);
94
- m(l), cy.get(l).click(f);
91
+ const [u, m] = d[g], l = a.mapAddBtn(n);
92
+ p(l), cy.get(l).click(f);
95
93
  const c = a.mapKey(n, g);
96
- m(c), cy.get(c).clear(f), cy.get(c).type(String(u), f), cy.get(a.mapContainer(n, g)).find(`[data-testid*="${n}.kid:"]`).first().invoke("attr", "data-testid").then((r) => {
94
+ p(c), cy.get(c).clear(f), cy.get(c).type(String(u), f), cy.get(a.mapContainer(n, g)).find(`[data-testid*="${n}.kid:"]`).first().invoke("attr", "data-testid").then((r) => {
97
95
  const s = T(r, n);
98
- e(s, h);
96
+ t(s, m);
99
97
  });
100
98
  }
101
99
  }
102
100
  function O(i) {
103
- const { fieldKey: n, value: t } = i, e = a.json(n), o = typeof t == "string" ? t : JSON.stringify(t, null, 2);
104
- m(e), cy.get(e).then((y) => {
101
+ const { fieldKey: n, value: e } = i, t = a.json(n), o = typeof e == "string" ? e : JSON.stringify(e, null, 2);
102
+ p(t), cy.get(t).then((y) => {
105
103
  cy.wrap(y.find("textarea")).clear(f), cy.wrap(y.find("textarea")).type(o, f);
106
104
  });
107
105
  }
108
106
  function V(i) {
109
- const { fieldKey: n, value: t } = i, e = a.field(n);
110
- m(e), cy.get(e).click(f);
111
- const o = typeof t == "object" && (t != null && t.id) ? t.id : t;
107
+ const { fieldKey: n, value: e } = i, t = a.field(n);
108
+ p(t), cy.get(t).click(f);
109
+ const o = typeof e == "object" && e?.id ? e.id : e;
112
110
  o && cy.get(`[data-testid="select-item-${o}"]`).click(f);
113
111
  }
114
112
  const H = {
@@ -124,56 +122,56 @@ const H = {
124
122
  fillForeign: V
125
123
  };
126
124
  function K(i, n) {
127
- const t = S(i), e = { ...H, ...n };
125
+ const e = v(i), t = { ...H, ...n };
128
126
  function o(l, c, r = "") {
129
- for (const s of v(l, c, t, r))
127
+ for (const s of S(l, c, e, r))
130
128
  y(s);
131
129
  }
132
130
  function y({ handlerType: l, fieldKey: c, fieldSchema: r, value: s }) {
133
131
  switch (l) {
134
132
  case "string":
135
- e.fillString({ fieldKey: c, fieldSchema: r, value: s });
133
+ t.fillString({ fieldKey: c, fieldSchema: r, value: s });
136
134
  break;
137
135
  case "number":
138
- e.fillNumber({ fieldKey: c, fieldSchema: r, value: s });
136
+ t.fillNumber({ fieldKey: c, fieldSchema: r, value: s });
139
137
  break;
140
138
  case "boolean":
141
- e.fillBoolean({ fieldKey: c, fieldSchema: r, value: s });
139
+ t.fillBoolean({ fieldKey: c, fieldSchema: r, value: s });
142
140
  break;
143
141
  case "enum":
144
- e.fillEnum({ fieldKey: c, fieldSchema: r, value: s });
142
+ t.fillEnum({ fieldKey: c, fieldSchema: r, value: s });
145
143
  break;
146
144
  case "tag":
147
- e.fillTag({ fieldKey: c, fieldSchema: r, value: s });
145
+ t.fillTag({ fieldKey: c, fieldSchema: r, value: s });
148
146
  break;
149
147
  case "map":
150
- e.fillMap({
148
+ t.fillMap({
151
149
  fieldKey: c,
152
150
  fieldSchema: r,
153
151
  value: s,
154
- onFillEntry: (b, p) => {
155
- g(t, c, b, p);
152
+ onFillEntry: (b, h) => {
153
+ g(e, c, b, h);
156
154
  }
157
155
  });
158
156
  break;
159
157
  case "json":
160
- e.fillJson({ fieldKey: c, fieldSchema: r, value: s });
158
+ t.fillJson({ fieldKey: c, fieldSchema: r, value: s });
161
159
  break;
162
160
  case "foreign":
163
- e.fillForeign({ fieldKey: c, fieldSchema: r, value: s });
161
+ t.fillForeign({ fieldKey: c, fieldSchema: r, value: s });
164
162
  break;
165
163
  case "array":
166
- e.fillArray({
164
+ t.fillArray({
167
165
  fieldKey: c,
168
166
  fieldSchema: r,
169
167
  value: s,
170
- onFillItem: (b, p) => {
171
- d(t, c, b, p);
168
+ onFillItem: (b, h) => {
169
+ d(e, c, b, h);
172
170
  }
173
171
  });
174
172
  break;
175
173
  case "record":
176
- e.fillRecord({
174
+ t.fillRecord({
177
175
  fieldKey: c,
178
176
  fieldSchema: r,
179
177
  value: s,
@@ -185,28 +183,28 @@ function K(i, n) {
185
183
  }
186
184
  }
187
185
  function d(l, c, r, s) {
188
- const { itemKey: b, itemSchema: p } = A(c, r, l);
189
- B(p) ? o(p.fields, s, b) : y({
190
- handlerType: k(p),
186
+ const { itemKey: b, itemSchema: h } = A(c, r, l);
187
+ B(h) ? o(h.fields, s, b) : y({
188
+ handlerType: k(h),
191
189
  fieldKey: b,
192
- fieldSchema: p,
190
+ fieldSchema: h,
193
191
  value: s
194
192
  });
195
193
  }
196
194
  function g(l, c, r, s) {
197
- const { entryKey: b, entrySchema: p } = F(c, r, l);
195
+ const { entryKey: b, entrySchema: h } = F(c, r, l);
198
196
  y({
199
- handlerType: k(p),
197
+ handlerType: k(h),
200
198
  fieldKey: b,
201
- fieldSchema: p,
199
+ fieldSchema: h,
202
200
  value: s
203
201
  });
204
202
  }
205
203
  function u(l) {
206
204
  i.fields && Array.isArray(i.fields) && o(i.fields, l);
207
205
  }
208
- function h(l, c) {
209
- const r = t.schemaMap[l];
206
+ function m(l, c) {
207
+ const r = e.schemaMap[l];
210
208
  if (!r)
211
209
  throw new Error(`Field schema for "${l}" not found in schema map`);
212
210
  y({
@@ -218,9 +216,9 @@ function K(i, n) {
218
216
  }
219
217
  return {
220
218
  fill: u,
221
- fillField: h,
222
- schemaMap: t.schemaMap,
223
- handlers: e
219
+ fillField: m,
220
+ schemaMap: e.schemaMap,
221
+ handlers: t
224
222
  };
225
223
  }
226
224
  export {
@@ -237,5 +235,5 @@ export {
237
235
  I as fillString,
238
236
  x as fillTag,
239
237
  H as handlers,
240
- m as scrollIntoViewNative
238
+ p as scrollIntoViewNative
241
239
  };