@beda.software/web-item-controls 0.1.19 → 0.1.21
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.
|
@@ -37,11 +37,11 @@ function ve() {
|
|
|
37
37
|
const m = p.key.toString(), E = a[m];
|
|
38
38
|
if (!E)
|
|
39
39
|
return p;
|
|
40
|
-
const h = Xe(E), C = F[m],
|
|
40
|
+
const h = Xe(E), C = F[m], D = h ? (R) => /* @__PURE__ */ b(qe, { ...R, filter: h, onChange: (W, O) => d(W, O, h) }) : void 0, V = !!((w = F[m]) != null && w.value);
|
|
41
41
|
return {
|
|
42
42
|
...p,
|
|
43
|
-
filterDropdown:
|
|
44
|
-
filtered:
|
|
43
|
+
filterDropdown: D,
|
|
44
|
+
filtered: V,
|
|
45
45
|
filteredValue: C ? [m] : [],
|
|
46
46
|
onFilter: (R, W) => {
|
|
47
47
|
if (!s.isString(R))
|
|
@@ -114,7 +114,7 @@ function Je(F) {
|
|
|
114
114
|
t.disconnect(), l.current = null;
|
|
115
115
|
};
|
|
116
116
|
}, [u]);
|
|
117
|
-
const
|
|
117
|
+
const D = g((t) => (e) => {
|
|
118
118
|
const r = l.current, o = f.current[t];
|
|
119
119
|
o && o !== e && r && (r.unobserve(o), i.current.delete(o)), e ? (f.current[t] = e, i.current.set(e, t), r == null || r.observe(e)) : (o && i.current.delete(o), delete f.current[t]);
|
|
120
120
|
}, []);
|
|
@@ -132,7 +132,7 @@ function Je(F) {
|
|
|
132
132
|
return r.length === e.length ? e : r;
|
|
133
133
|
});
|
|
134
134
|
}, [d]);
|
|
135
|
-
const
|
|
135
|
+
const V = g(() => {
|
|
136
136
|
const t = a.current + u, e = {};
|
|
137
137
|
Object.entries(f.current).forEach(([r, o]) => {
|
|
138
138
|
o && (e[r] = o.clientHeight > t);
|
|
@@ -143,19 +143,19 @@ function Je(F) {
|
|
|
143
143
|
}, [u]);
|
|
144
144
|
z(() => {
|
|
145
145
|
const t = () => {
|
|
146
|
-
|
|
146
|
+
V();
|
|
147
147
|
};
|
|
148
148
|
return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
|
|
149
|
-
}, [
|
|
149
|
+
}, [V]);
|
|
150
150
|
const M = g((t) => {
|
|
151
151
|
var o;
|
|
152
152
|
const e = p[t];
|
|
153
153
|
return e !== void 0 ? e : (((o = f.current[t]) == null ? void 0 : o.clientHeight) ?? 0) > y + u;
|
|
154
154
|
}, [u, y, p]), I = g(() => {
|
|
155
155
|
requestAnimationFrame(() => {
|
|
156
|
-
requestAnimationFrame(
|
|
156
|
+
requestAnimationFrame(V);
|
|
157
157
|
});
|
|
158
|
-
}, [
|
|
158
|
+
}, [V]), N = g((t, e) => {
|
|
159
159
|
h((r) => t ? r.includes(e) ? r : [...r, e] : r.includes(e) ? r.filter((o) => o !== e) : r);
|
|
160
160
|
}, []), w = g(() => {
|
|
161
161
|
const t = d.map((e) => e.key).filter((e) => M(e));
|
|
@@ -164,7 +164,7 @@ function Je(F) {
|
|
|
164
164
|
h((t) => t.length === 0 ? t : []);
|
|
165
165
|
}, []), W = S(() => d.map((t) => t.key).filter((t) => M(t)), [d, M]), O = W.length > 0, _ = S(() => new Set(E.map(String)), [E]), B = O && W.every((t) => _.has(t)), Z = E.length > 0;
|
|
166
166
|
return {
|
|
167
|
-
observeRow:
|
|
167
|
+
observeRow: D,
|
|
168
168
|
rowHeightExceedsMaxHeight: M,
|
|
169
169
|
handleRowHeightRecompute: I,
|
|
170
170
|
handleRowExpand: N,
|
|
@@ -189,13 +189,13 @@ function ut(F) {
|
|
|
189
189
|
text: a,
|
|
190
190
|
hidden: p,
|
|
191
191
|
item: m
|
|
192
|
-
} = d, E = a || l, h = S(() => [...y, l], [y, l]), C = (ue = d.enableChart) == null ? void 0 : ue.linkIdX,
|
|
192
|
+
} = d, E = a || l, h = S(() => [...y, l], [y, l]), C = (ue = d.enableChart) == null ? void 0 : ue.linkIdX, D = (pe = d.enableChart) == null ? void 0 : pe.linkIdY, V = Be(d), M = d.chartHighlight, {
|
|
193
193
|
onChange: I
|
|
194
194
|
} = _e(h, d), {
|
|
195
195
|
control: N,
|
|
196
196
|
getValues: w,
|
|
197
197
|
reset: R
|
|
198
|
-
} = Ge(), [W, O] = P(!C && !
|
|
198
|
+
} = Ge(), [W, O] = P(!C && !D), [_, B] = P(!1), [Z, t] = P(void 0), [e, r] = P(null), [o, k] = P(null), {
|
|
199
199
|
populateColumnWithFilters: H
|
|
200
200
|
} = ve(), {
|
|
201
201
|
populateColumnWithSorters: X
|
|
@@ -223,9 +223,7 @@ function ut(F) {
|
|
|
223
223
|
const n = s.cloneDeep(w());
|
|
224
224
|
s.set(n, h, s.cloneDeep(e)), R(n, {
|
|
225
225
|
keepDirty: !0
|
|
226
|
-
}), I(
|
|
227
|
-
items: e ?? void 0
|
|
228
|
-
}), r(null), k(null), t(void 0), B(!1);
|
|
226
|
+
}), I(s.cloneDeep(e) ?? void 0), r(null), k(null), t(void 0), B(!1);
|
|
229
227
|
}, [h, w, I, R, e]), Ce = g(() => {
|
|
230
228
|
r(null), k(null);
|
|
231
229
|
const n = w();
|
|
@@ -282,7 +280,7 @@ function ut(F) {
|
|
|
282
280
|
};
|
|
283
281
|
}), x = X(n, d);
|
|
284
282
|
return H(x, d);
|
|
285
|
-
})(),
|
|
283
|
+
})(), De = S(() => {
|
|
286
284
|
const n = q == null ? void 0 : q.find((c) => c.type === "text"), x = n == null ? void 0 : n.linkId;
|
|
287
285
|
if (x)
|
|
288
286
|
return {
|
|
@@ -322,20 +320,20 @@ function ut(F) {
|
|
|
322
320
|
}
|
|
323
321
|
) }) })
|
|
324
322
|
] })
|
|
325
|
-
}), [Y, L, $]),
|
|
326
|
-
if (!(!C || !
|
|
323
|
+
}), [Y, L, $]), Ve = S(() => [...ce, de], [de, ce]), Me = S(() => {
|
|
324
|
+
if (!(!C || !D))
|
|
327
325
|
return (n) => {
|
|
328
326
|
O(n);
|
|
329
327
|
};
|
|
330
|
-
}, [C,
|
|
328
|
+
}, [C, D]);
|
|
331
329
|
return {
|
|
332
330
|
repeats: i,
|
|
333
331
|
hidden: p,
|
|
334
332
|
title: E,
|
|
335
333
|
handleAdd: He,
|
|
336
334
|
dataSource: G,
|
|
337
|
-
columns:
|
|
338
|
-
expandable:
|
|
335
|
+
columns: Ve,
|
|
336
|
+
expandable: De,
|
|
339
337
|
isModalVisible: _,
|
|
340
338
|
editIndex: Z,
|
|
341
339
|
handleCancel: ke,
|
|
@@ -349,8 +347,8 @@ function ut(F) {
|
|
|
349
347
|
isAllExpandableRowsExpanded: Se,
|
|
350
348
|
hasExpandedRows: Fe,
|
|
351
349
|
chartLinkIdX: C,
|
|
352
|
-
chartLinkIdY:
|
|
353
|
-
chartYRange:
|
|
350
|
+
chartLinkIdY: D,
|
|
351
|
+
chartYRange: V,
|
|
354
352
|
chartHighlightAreas: M
|
|
355
353
|
};
|
|
356
354
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beda.software/web-item-controls",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@babel/preset-typescript": "^7.26.0",
|
|
73
|
-
"@beda.software/fhir-questionnaire": "^0.1.0-alpha.
|
|
73
|
+
"@beda.software/fhir-questionnaire": "^0.1.0-alpha.10",
|
|
74
74
|
"@beda.software/fhir-react": "^1.11.1",
|
|
75
75
|
"@beda.software/vite-plugin-dts": "4.0.0-beta.1",
|
|
76
76
|
"@chromatic-com/storybook": "^3.2.2",
|