@mittwald/flow-react-components 0.1.0-alpha.347 → 0.1.0-alpha.348

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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.1.0-alpha.348](https://github.com/mittwald/flow/compare/0.1.0-alpha.347...0.1.0-alpha.348) (2024-11-18)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **Field:** fix Select is not updating its value
11
+ ([#977](https://github.com/mittwald/flow/issues/977))
12
+ ([1adecf5](https://github.com/mittwald/flow/commit/1adecf539c9c0fe46537d6fcd87f82968860eed8))
13
+ - **List:** fix initial loading also visible on reload
14
+ ([#978](https://github.com/mittwald/flow/issues/978))
15
+ ([e4307cd](https://github.com/mittwald/flow/commit/e4307cd9823ed9e1b3982a1edee81654a14e353b))
16
+
17
+ # Change Log
18
+
19
+ All notable changes to this project will be documented in this file. See
20
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
21
+
6
22
  # [0.1.0-alpha.347](https://github.com/mittwald/flow/compare/0.1.0-alpha.346...0.1.0-alpha.347) (2024-11-15)
7
23
 
8
24
  **Note:** Version bump only for package @mittwald/flow-react-components
package/dist/js/List.js CHANGED
@@ -16,7 +16,7 @@ import { I as ot } from "./IconContextMenu-CZgbKH5A.js";
16
16
  import { a as $, C as Y } from "./ContextMenuTrigger-C_0tJ4zR.js";
17
17
  import { M as _ } from "./MenuItem-GX6Zh70q.js";
18
18
  import { useLocalizedStringFormatter as w } from "react-aria";
19
- import { TunnelProvider as ye, TunnelExit as x } from "@mittwald/react-tunnel";
19
+ import { TunnelProvider as ye, TunnelExit as N } from "@mittwald/react-tunnel";
20
20
  import T from "clsx";
21
21
  import { g as lt } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
22
22
  import { f as we } from "./flowComponent-1wOIvUIq.js";
@@ -41,16 +41,16 @@ import { getAsyncResource as ge } from "@mittwald/react-use-promise";
41
41
  import { u as pe } from "./useSelector-DpU7_HMO.js";
42
42
  import { u as Pt } from "./SettingsProvider-D9oDS5r9.js";
43
43
  import * as X from "react-aria-components";
44
- import { S as N } from "./SkeletonText-B5ZghZhO.js";
44
+ import { S as x } from "./SkeletonText-B5ZghZhO.js";
45
45
  import { I as Vt } from "./IllustratedMessage-DB1AH-Oq.js";
46
46
  import { I as kt } from "./IconSearch-BIWWMdCF.js";
47
47
  import { a as b, b as V, d as At } from "./deepHas-KHS5X1F_.js";
48
48
  import { ListLoaderAsyncResource as Mt, TypedListLoaderAsyncResource as Bt } from "./List/ListLoaderAsyncResource.js";
49
49
  import { S as Dt } from "./Skeleton-CKLaTmDR.js";
50
50
  import { a as Te, e as Ce, d as Ie, b as Le, T as Pe, c as Ve } from "./Table-BdpXhsOd.js";
51
- import { A as xt } from "./ActionGroup-D7pgHibo.js";
52
- const Nt = "flow--list--items--item--view", Rt = "flow--list--items--item--view--title", $t = "flow--list--items--item--view--top-content", zt = "flow--list--items--item--view--content", Ut = "flow--list--items--item--view--action", Kt = "flow--list--items--item--view--avatar", Ot = "flow--list--items--item--view--text", Ht = "flow--list--items--item--view--heading", m = {
53
- view: Nt,
51
+ import { A as Nt } from "./ActionGroup-D7pgHibo.js";
52
+ const xt = "flow--list--items--item--view", Rt = "flow--list--items--item--view--title", $t = "flow--list--items--item--view--top-content", zt = "flow--list--items--item--view--content", Ut = "flow--list--items--item--view--action", Kt = "flow--list--items--item--view--avatar", Ot = "flow--list--items--item--view--text", Ht = "flow--list--items--item--view--heading", m = {
53
+ view: xt,
54
54
  title: Rt,
55
55
  topContent: $t,
56
56
  content: zt,
@@ -141,7 +141,7 @@ const Nt = "flow--list--items--item--view", Rt = "flow--list--items--item--view-
141
141
  t,
142
142
  m[lt(s)]
143
143
  );
144
- return /* @__PURE__ */ i.createElement("div", { className: o }, /* @__PURE__ */ i.createElement(ve, { props: n }, /* @__PURE__ */ i.createElement(ye, null, e, /* @__PURE__ */ i.createElement("div", { className: m.title }, /* @__PURE__ */ i.createElement(x, { id: "title" })), /* @__PURE__ */ i.createElement(x, { id: "topContent" }))));
144
+ return /* @__PURE__ */ i.createElement("div", { className: o }, /* @__PURE__ */ i.createElement(ve, { props: n }, /* @__PURE__ */ i.createElement(ye, null, e, /* @__PURE__ */ i.createElement("div", { className: m.title }, /* @__PURE__ */ i.createElement(N, { id: "title" })), /* @__PURE__ */ i.createElement(N, { id: "topContent" }))));
145
145
  }, jt = "flow--list--list-summary", Wt = {
146
146
  listSummary: jt
147
147
  }, Qi = we("ListSummary", (a) => {
@@ -289,7 +289,7 @@ const Nt = "flow--list--items--item--view", Rt = "flow--list--items--item--view-
289
289
  if (s.filters.length === 0 && s.visibleSorting.length === 0 && !s.search && !s.table && !t)
290
290
  return null;
291
291
  const n = s.filters.map((o) => /* @__PURE__ */ i.createElement(Qt, { key: o.property, filter: o }));
292
- return /* @__PURE__ */ i.createElement("div", { className: T(e, F.header) }, /* @__PURE__ */ i.createElement("div", { className: F.pickerListAndSearch }, /* @__PURE__ */ i.createElement("div", { className: F.pickerList }, /* @__PURE__ */ i.createElement(ds, null), /* @__PURE__ */ i.createElement(_t, null), n), /* @__PURE__ */ i.createElement("div", { className: F.searchAndActions }, s.search && /* @__PURE__ */ i.createElement(cs, { className: F.searchField, search: s.search }), /* @__PURE__ */ i.createElement(x, { id: "actions" }))), /* @__PURE__ */ i.createElement(os, null));
292
+ return /* @__PURE__ */ i.createElement("div", { className: T(e, F.header) }, /* @__PURE__ */ i.createElement("div", { className: F.pickerListAndSearch }, /* @__PURE__ */ i.createElement("div", { className: F.pickerList }, /* @__PURE__ */ i.createElement(ds, null), /* @__PURE__ */ i.createElement(_t, null), n), /* @__PURE__ */ i.createElement("div", { className: F.searchAndActions }, s.search && /* @__PURE__ */ i.createElement(cs, { className: F.searchField, search: s.search }), /* @__PURE__ */ i.createElement(N, { id: "actions" }))), /* @__PURE__ */ i.createElement(os, null));
293
293
  }, ms = "flow--list", hs = {
294
294
  list: ms
295
295
  };
@@ -674,6 +674,9 @@ class ee {
674
674
  useIsLoading() {
675
675
  return pe(() => this.isLoading);
676
676
  }
677
+ isBatchLoaded(e) {
678
+ return e in this.dataBatches;
679
+ }
677
680
  }
678
681
  const ws = [];
679
682
  class te {
@@ -717,12 +720,13 @@ class te {
717
720
  }), this.useObserveBatchData(t, e), this.useObserveBatchLoadingState(t, e);
718
721
  }
719
722
  useObserveBatchLoadingState(e, t) {
720
- D(() => (this.loaderState.setBatchLoadingState(
721
- t,
722
- e.state.value
723
- ), e.state.observe((s) => {
724
- this.loaderState.setBatchLoadingState(t, s);
725
- })), [e, t]);
723
+ const s = (n) => {
724
+ this.loaderState.setBatchLoadingState(
725
+ t,
726
+ this.loaderState.isBatchLoaded(t) ? "loaded" : n
727
+ );
728
+ };
729
+ D(() => (s(e.state.value), e.state.observe(s)), [e, t]);
726
730
  }
727
731
  useObserveBatchData(e, t) {
728
732
  const s = (n) => {
@@ -992,7 +996,7 @@ const ks = "flow--list--items", As = "flow--list--items--is-loading", Se = {
992
996
  item: Ms,
993
997
  isSelected: Bs,
994
998
  hasAction: Ds
995
- }, Be = () => /* @__PURE__ */ i.createElement(ke, null, /* @__PURE__ */ i.createElement(Q, null, /* @__PURE__ */ i.createElement(N, { width: "200px" })), /* @__PURE__ */ i.createElement(E, null, /* @__PURE__ */ i.createElement(N, { width: "300px" }))), xs = (a) => {
999
+ }, Be = () => /* @__PURE__ */ i.createElement(ke, null, /* @__PURE__ */ i.createElement(Q, null, /* @__PURE__ */ i.createElement(x, { width: "200px" })), /* @__PURE__ */ i.createElement(E, null, /* @__PURE__ */ i.createElement(x, { width: "300px" }))), Ns = (a) => {
996
1000
  const { id: e, data: t, children: s } = a, o = g().itemView;
997
1001
  if (!o)
998
1002
  return null;
@@ -1012,18 +1016,18 @@ const ks = "flow--list--items", As = "flow--list--items--is-loading", Se = {
1012
1016
  },
1013
1017
  /* @__PURE__ */ i.createElement(Ze, { fallback: /* @__PURE__ */ i.createElement(Be, null) }, s ?? o.render(t))
1014
1018
  );
1015
- }, Ns = (a) => /* @__PURE__ */ i.createElement(X.GridListItem, { textValue: "-", className: B.item }, a.children), W = () => {
1019
+ }, xs = (a) => /* @__PURE__ */ i.createElement(X.GridListItem, { textValue: "-", className: B.item }, a.children), W = () => {
1016
1020
  const a = w(S);
1017
1021
  return /* @__PURE__ */ i.createElement(Vt, null, /* @__PURE__ */ i.createElement(kt, null), /* @__PURE__ */ i.createElement(Q, null, a.format("list.noResult.heading")), /* @__PURE__ */ i.createElement(E, null, a.format("list.noResult.text")));
1018
1022
  }, Rs = () => {
1019
1023
  var t;
1020
1024
  const e = ((t = g().itemView) == null ? void 0 : t.fallback) ?? /* @__PURE__ */ i.createElement(Be, null);
1021
- return Array.from(Array(5)).map((s, n) => /* @__PURE__ */ i.createElement(Ns, { key: n }, et(e)));
1025
+ return Array.from(Array(5)).map((s, n) => /* @__PURE__ */ i.createElement(xs, { key: n }, et(e)));
1022
1026
  }, $s = () => {
1023
1027
  const a = g(), e = a.loader.useIsLoading(), t = a.loader.useIsInitiallyLoading();
1024
1028
  if (!a.itemView)
1025
1029
  return null;
1026
- const s = a.items.entries.map((o) => /* @__PURE__ */ i.createElement(xs, { key: o.id, data: o.data, id: o.id })), n = T(Se.items, e && Se.isLoading);
1030
+ const s = a.items.entries.map((o) => /* @__PURE__ */ i.createElement(Ns, { key: o.id, data: o.data, id: o.id })), n = T(Se.items, e && Se.isLoading);
1027
1031
  return /* @__PURE__ */ i.createElement("div", { "aria-hidden": t, "aria-busy": e }, /* @__PURE__ */ i.createElement(
1028
1032
  X.GridList,
1029
1033
  {
@@ -1033,7 +1037,7 @@ const ks = "flow--list--items", As = "flow--list--items--is-loading", Se = {
1033
1037
  },
1034
1038
  t ? /* @__PURE__ */ i.createElement(Rs, null) : s
1035
1039
  ));
1036
- }, De = (a) => null, zs = () => De, xe = (a) => null, Us = () => xe, Ne = (a) => null, Ks = () => Ne, Re = (a) => null, Os = () => Re, $e = (a) => null, Hs = () => $e, qs = "flow--list--footer", Gs = {
1040
+ }, De = (a) => null, zs = () => De, Ne = (a) => null, Us = () => Ne, xe = (a) => null, Ks = () => xe, Re = (a) => null, Os = () => Re, $e = (a) => null, Hs = () => $e, qs = "flow--list--footer", Gs = {
1037
1041
  footer: qs
1038
1042
  }, js = (a) => {
1039
1043
  const e = w(S), t = g(), s = t.batches, n = t.loader.useIsInitiallyLoading(), o = t.useIsEmpty(), l = s.getTotalItemsCount(), d = s.getVisibleItemsCount();
@@ -1062,7 +1066,7 @@ const ks = "flow--list--items", As = "flow--list--items--is-loading", Se = {
1062
1066
  function ze(a) {
1063
1067
  return null;
1064
1068
  }
1065
- const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s = (a) => /* @__PURE__ */ i.createElement(Te, { ...a }, /* @__PURE__ */ i.createElement(Ce, null, /* @__PURE__ */ i.createElement(Ie, null, /* @__PURE__ */ i.createElement(N, { width: "100%" }))), /* @__PURE__ */ i.createElement(Le, null, Array.from(Array(5)).map((e, t) => /* @__PURE__ */ i.createElement(Pe, { key: t }, /* @__PURE__ */ i.createElement(Ve, null, /* @__PURE__ */ i.createElement(N, { width: "100%" })))))), Qs = "flow--list--table", Xs = "flow--list--table--is-loading", Zs = "flow--list--table--row", ei = "flow--list--table--is-selected", ti = "flow--list--table--has-action", I = {
1069
+ const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s = (a) => /* @__PURE__ */ i.createElement(Te, { ...a }, /* @__PURE__ */ i.createElement(Ce, null, /* @__PURE__ */ i.createElement(Ie, null, /* @__PURE__ */ i.createElement(x, { width: "100%" }))), /* @__PURE__ */ i.createElement(Le, null, Array.from(Array(5)).map((e, t) => /* @__PURE__ */ i.createElement(Pe, { key: t }, /* @__PURE__ */ i.createElement(Ve, null, /* @__PURE__ */ i.createElement(x, { width: "100%" })))))), Qs = "flow--list--table", Xs = "flow--list--table--is-loading", Zs = "flow--list--table--row", ei = "flow--list--table--is-selected", ti = "flow--list--table--has-action", I = {
1066
1070
  table: Qs,
1067
1071
  isLoading: Xs,
1068
1072
  row: Zs,
@@ -1147,7 +1151,7 @@ const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s =
1147
1151
  ), K = (le = b(e, Ke)) == null ? void 0 : le.props, O = (ce = b(e, qe)) == null ? void 0 : ce.props, p = (de = b(e, Ge)) == null ? void 0 : de.props, P = Vs.useNew({
1148
1152
  onChange: s,
1149
1153
  loader: u,
1150
- filters: V(e, xe).map(
1154
+ filters: V(e, Ne).map(
1151
1155
  (f) => ({
1152
1156
  ...f.props,
1153
1157
  renderItem: f.props.children
@@ -1158,7 +1162,7 @@ const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s =
1158
1162
  textFieldProps: h,
1159
1163
  defaultValue: h.defaultValue
1160
1164
  } : void 0,
1161
- sorting: V(e, Ne).map((f) => f.props),
1165
+ sorting: V(e, xe).map((f) => f.props),
1162
1166
  itemView: C ? {
1163
1167
  ...C,
1164
1168
  renderFn: C.children
@@ -1190,7 +1194,7 @@ const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s =
1190
1194
  ListSummary: {
1191
1195
  tunnelId: "listSummary"
1192
1196
  }
1193
- }, We = At(e, xt);
1197
+ }, We = At(e, Nt);
1194
1198
  return /* @__PURE__ */ i.createElement(ve, { props: je }, /* @__PURE__ */ i.createElement(ye, null, /* @__PURE__ */ i.createElement(
1195
1199
  Ae.Provider,
1196
1200
  {
@@ -1199,7 +1203,7 @@ const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s =
1199
1203
  }
1200
1204
  },
1201
1205
  /* @__PURE__ */ i.createElement(Jt, null),
1202
- /* @__PURE__ */ i.createElement("div", { className: hs.list, ref: n }, e, /* @__PURE__ */ i.createElement(us, { hasActionGroup: We }), /* @__PURE__ */ i.createElement("div", null, P.items.entries.length > 0 && /* @__PURE__ */ i.createElement(x, { id: "listSummary" }), P.viewMode === "list" && /* @__PURE__ */ i.createElement($s, null), P.viewMode === "table" && /* @__PURE__ */ i.createElement(si, null)), /* @__PURE__ */ i.createElement(Js, null))
1206
+ /* @__PURE__ */ i.createElement("div", { className: hs.list, ref: n }, e, /* @__PURE__ */ i.createElement(us, { hasActionGroup: We }), /* @__PURE__ */ i.createElement("div", null, P.items.entries.length > 0 && /* @__PURE__ */ i.createElement(N, { id: "listSummary" }), P.viewMode === "list" && /* @__PURE__ */ i.createElement($s, null), P.viewMode === "table" && /* @__PURE__ */ i.createElement(si, null)), /* @__PURE__ */ i.createElement(Js, null))
1203
1207
  )));
1204
1208
  }), ai = () => ii, aa = () => ({
1205
1209
  List: ai(),
@@ -1220,11 +1224,11 @@ const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s =
1220
1224
  });
1221
1225
  export {
1222
1226
  ii as List,
1223
- xe as ListFilter,
1227
+ Ne as ListFilter,
1224
1228
  Re as ListItem,
1225
1229
  ke as ListItemView,
1226
1230
  De as ListLoaderAsync,
1227
- Ne as ListSorting,
1231
+ xe as ListSorting,
1228
1232
  $e as ListStaticData,
1229
1233
  Qi as ListSummary,
1230
1234
  ai as TypedList,
@@ -43,7 +43,7 @@ function D(t) {
43
43
  TextField: e,
44
44
  Select: {
45
45
  ...e,
46
- defaultSelectedKey: e.value
46
+ selectedKey: e.value
47
47
  },
48
48
  Slider: e,
49
49
  DatePicker: e,
@@ -16,5 +16,6 @@ export declare class IncrementalLoaderState<T> {
16
16
  useMergedData(): T[];
17
17
  get isLoading(): boolean;
18
18
  useIsLoading(): boolean;
19
+ isBatchLoaded(batchIndex: number): boolean;
19
20
  }
20
21
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.1.0-alpha.347",
3
+ "version": "0.1.0-alpha.348",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -405,7 +405,7 @@
405
405
  "@chakra-ui/live-region": "^2.1.0",
406
406
  "@internationalized/date": "^3.5.6",
407
407
  "@internationalized/string-compiler": "^3.2.5",
408
- "@mittwald/react-tunnel": "^0.1.0-alpha.347",
408
+ "@mittwald/react-tunnel": "^0.1.0-alpha.348",
409
409
  "@mittwald/react-use-promise": "^2.5.0",
410
410
  "@react-aria/form": "^3.0.10",
411
411
  "@react-aria/utils": "^3.25.3",
@@ -435,7 +435,7 @@
435
435
  },
436
436
  "devDependencies": {
437
437
  "@faker-js/faker": "^9.0.3",
438
- "@mittwald/flow-design-tokens": "^0.1.0-alpha.347",
438
+ "@mittwald/flow-design-tokens": "^0.1.0-alpha.348",
439
439
  "@mittwald/react-use-promise": "^2.5.0",
440
440
  "@nx/storybook": "^20.0.0",
441
441
  "@storybook/addon-a11y": "^8.3.5",
@@ -530,5 +530,5 @@
530
530
  }
531
531
  }
532
532
  },
533
- "gitHead": "80449faae5d464201101580d20ade43e4c93b80d"
533
+ "gitHead": "c692dba514c04952d39cd622893fddb4e1be7a2d"
534
534
  }