@webority/ui-react 0.13.4 → 0.13.5

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.
@@ -14,7 +14,10 @@
14
14
  * @param {number} [props.sourceCount]
15
15
  * @param {(row: object) => import('react').ReactNode} [props.rowActions]
16
16
  * @param {string} [props.rowActionsLabel]
17
- * @param {object} [props.pagination]
17
+ * @param {object} [props.pagination] The footer's state, usually straight from usePagination:
18
+ * `{ page, totalPages, pageSize, total, firstRow, lastRow, setPage, setPageSize }`, plus the
19
+ * optional `pageSizes` and `mode` that AppTablePagination takes. The footer shows once `total`
20
+ * is above 0 and stays in place while `loading`, so the table does not jump between pages.
18
21
  * @param {string} [props.ariaLabel]
19
22
  * @param {string} [props.className] Extra classes on the <table> (column/table styling).
20
23
  * @param {string} [props.wrapperClassName] Extra classes on the `.table-wrap` outer div — the
@@ -17,7 +17,8 @@
17
17
  * @param {boolean} [props.multiple=false]
18
18
  * @param {number} [props.maxFiles] Cap on total files in multiple mode.
19
19
  * @param {string} [props.accept=".jpg,.jpeg,.png"] Accepted file types (the `accept` attribute).
20
- * @param {number} [props.maxSizeMb] Defaults to the shared DEFAULT_MAX_SIZE_MB.
20
+ * @param {number} [props.maxSizeMb] Defaults to the shared DEFAULT_MAX_SIZE_MB. 0 means no size
21
+ * limit: nothing is rejected for its size, and the hint names no size.
21
22
  * @param {boolean} [props.required]
22
23
  * @param {string} [props.error]
23
24
  * @param {string} [props.hint] Helper text below the control; an error (the caller's or a rejected
package/dist/ui-react.js CHANGED
@@ -2511,7 +2511,7 @@ function Gt({ columns: e, rows: n, rowKey: r = (e) => e.id, sort: i, onSort: a,
2511
2511
  children: I
2512
2512
  }) : I
2513
2513
  })]
2514
- }), m && !o && m.total > 0 && /* @__PURE__ */ E(Ht, {
2514
+ }), m && m.total > 0 && /* @__PURE__ */ E(Ht, {
2515
2515
  page: m.page,
2516
2516
  totalPages: m.totalPages,
2517
2517
  pageSize: m.pageSize,
@@ -2519,7 +2519,9 @@ function Gt({ columns: e, rows: n, rowKey: r = (e) => e.id, sort: i, onSort: a,
2519
2519
  firstRow: m.firstRow,
2520
2520
  lastRow: m.lastRow,
2521
2521
  onPageChange: m.setPage,
2522
- onPageSizeChange: m.setPageSize
2522
+ onPageSizeChange: m.setPageSize,
2523
+ pageSizes: m.pageSizes,
2524
+ mode: m.mode
2523
2525
  })] });
2524
2526
  }
2525
2527
  //#endregion
@@ -2809,15 +2811,15 @@ function rn({ item: e, isImage: t, onRemove: n, noun: r = "attachment" }) {
2809
2811
  //#region src/components/AppFileAttachment.jsx
2810
2812
  function an({ label: e = "Attachment", value: t, name: n, onChange: r, multiple: i = !1, accept: a = k, maxSizeMb: o = A, optional: c = !1, validate: l = !0, error: u, id: d, ...p }) {
2811
2813
  U("AppFileAttachment", p);
2812
- let m = s(), h = d || m, [g, _] = f(""), v = i && Array.isArray(t) ? t : t ? [t] : [], y = F(a), b = (e) => e instanceof File ? P(e) : y || P(e), x = !i && v.length === 1 && b(v[0]), S = o > 0, C = on(a, S ? o : 0);
2813
- function w(e) {
2814
+ let m = s(), h = d || m, [g, _] = f(""), v = i && Array.isArray(t) ? t : t ? [t] : [], y = F(a), b = (e) => e instanceof File ? P(e) : y || P(e), x = !i && v.length === 1 && b(v[0]), S = on(a, o);
2815
+ function C(e) {
2814
2816
  let n = Array.from(e.target.files || []);
2815
2817
  if (e.target.value = "", !n.length) return;
2816
2818
  let s = [], c = "";
2817
2819
  for (let e of n) {
2818
2820
  let t = l ? I(e, {
2819
2821
  accept: a,
2820
- maxSizeMb: S ? o : Infinity
2822
+ maxSizeMb: o
2821
2823
  }) : null;
2822
2824
  if (t) {
2823
2825
  c ||= t;
@@ -2830,10 +2832,10 @@ function an({ label: e = "Attachment", value: t, name: n, onChange: r, multiple:
2830
2832
  r(e.concat(s.filter((e) => !n.has($t(e)))));
2831
2833
  } else r(s[0]);
2832
2834
  }
2833
- function O(e) {
2835
+ function w(e) {
2834
2836
  _(""), r(i ? v.filter((t, n) => n !== e) : null);
2835
2837
  }
2836
- let j = u || g, M = j ? `${h}-error` : void 0, N = i || v.length === 0, L = y ? "image" : "file", R = i ? `Add ${L}s` : `Add ${y ? "an" : "a"} ${L}`;
2838
+ let O = u || g, j = O ? `${h}-error` : void 0, M = i || v.length === 0, N = y ? "image" : "file", L = i ? `Add ${N}s` : `Add ${y ? "an" : "a"} ${N}`;
2837
2839
  return /* @__PURE__ */ D("div", {
2838
2840
  className: "field",
2839
2841
  children: [
@@ -2845,7 +2847,7 @@ function an({ label: e = "Attachment", value: t, name: n, onChange: r, multiple:
2845
2847
  children: " (optional)"
2846
2848
  })]
2847
2849
  }),
2848
- N && /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ D("label", {
2850
+ M && /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ D("label", {
2849
2851
  className: "attach-drop",
2850
2852
  htmlFor: h,
2851
2853
  children: [
@@ -2860,10 +2862,10 @@ function an({ label: e = "Attachment", value: t, name: n, onChange: r, multiple:
2860
2862
  className: "attach-drop-copy",
2861
2863
  children: [/* @__PURE__ */ E("span", {
2862
2864
  className: "attach-drop-title",
2863
- children: R
2864
- }), C && /* @__PURE__ */ E("span", {
2865
+ children: L
2866
+ }), S && /* @__PURE__ */ E("span", {
2865
2867
  className: "attach-drop-hint",
2866
- children: C
2868
+ children: S
2867
2869
  })]
2868
2870
  }),
2869
2871
  /* @__PURE__ */ E("span", {
@@ -2878,26 +2880,26 @@ function an({ label: e = "Attachment", value: t, name: n, onChange: r, multiple:
2878
2880
  name: n,
2879
2881
  accept: a || void 0,
2880
2882
  multiple: i || void 0,
2881
- "aria-describedby": M,
2882
- onChange: w,
2883
+ "aria-describedby": j,
2884
+ onChange: C,
2883
2885
  ...p
2884
2886
  })] }),
2885
2887
  x ? /* @__PURE__ */ E(sn, {
2886
2888
  item: v[0],
2887
2889
  isImage: !0,
2888
- onRemove: () => O(0)
2890
+ onRemove: () => w(0)
2889
2891
  }) : v.length > 0 && /* @__PURE__ */ E("div", {
2890
2892
  className: "attach-list",
2891
2893
  children: v.map((e, t) => /* @__PURE__ */ E(rn, {
2892
2894
  item: e,
2893
2895
  isImage: b(e),
2894
- onRemove: () => O(t)
2896
+ onRemove: () => w(t)
2895
2897
  }, $t(e)))
2896
2898
  }),
2897
- j && /* @__PURE__ */ E("div", {
2899
+ O && /* @__PURE__ */ E("div", {
2898
2900
  className: "field-error",
2899
2901
  id: `${h}-error`,
2900
- children: j
2902
+ children: O
2901
2903
  })
2902
2904
  ]
2903
2905
  });
@@ -3103,14 +3105,9 @@ function cn({ label: e, value: t, name: n, id: r, onPick: i, multiple: a = !1, m
3103
3105
  children: "Click to upload"
3104
3106
  }), " or drag & drop"]
3105
3107
  }),
3106
- /* @__PURE__ */ D("span", {
3108
+ /* @__PURE__ */ E("span", {
3107
3109
  className: "file-input-text",
3108
- children: [
3109
- j(l),
3110
- " · up to ",
3111
- u,
3112
- " MB"
3113
- ]
3110
+ children: u > 0 ? `${j(l)} · up to ${u} MB` : j(l)
3114
3111
  })
3115
3112
  ]
3116
3113
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-react",
3
- "version": "0.13.4",
3
+ "version": "0.13.5",
4
4
  "description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -28,8 +28,8 @@
28
28
  },
29
29
  "sideEffects": false,
30
30
  "dependencies": {
31
- "@webority/theme": "0.13.4",
32
- "@webority/ui-elements": "0.13.4"
31
+ "@webority/theme": "0.13.5",
32
+ "@webority/ui-elements": "0.13.5"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@webority/analytics": "^0.5.2",