@hortiview/shared-components 1.11.0 → 1.12.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,7 +1,7 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { useMemo as a } from "react";
3
- import { ContextMenu as x } from "../ContextMenu/ContextMenu.js";
4
- const j = ({
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { useMemo as d } from "react";
3
+ import { ContextMenu as v } from "../ContextMenu/ContextMenu.js";
4
+ const b = ({
5
5
  data: r = [],
6
6
  order: n = [],
7
7
  cellTemplates: e = void 0,
@@ -10,9 +10,9 @@ const j = ({
10
10
  customColumnWidth: o,
11
11
  cardTitleColumn: u,
12
12
  cardSubTitleColumn: s
13
- }) => a(() => {
13
+ }) => d(() => {
14
14
  if (r?.length === 0) return [];
15
- const c = v(r[0], n).map((i) => {
15
+ const c = x(r[0], n).map((i) => {
16
16
  const p = o ? o[i] : void 0;
17
17
  return {
18
18
  id: i,
@@ -20,6 +20,7 @@ const j = ({
20
20
  accessor: i,
21
21
  cellTemplate: e ? e[i] : void 0,
22
22
  cellProps: p ? { width: p } : void 0,
23
+ headerCellProps: p ? { width: p } : void 0,
23
24
  asCardTitle: i === u,
24
25
  asCardSubtitle: i === s
25
26
  };
@@ -37,13 +38,13 @@ const j = ({
37
38
  o,
38
39
  u,
39
40
  s
40
- ]), l = ({
41
+ ]), j = ({
41
42
  data: r = [],
42
43
  getRowActions: n = void 0
43
- }) => a(() => n ? r.map((e) => {
44
- const t = /* @__PURE__ */ d(x, { actions: n(e), iconOrientation: "horizontal" });
44
+ }) => d(() => n ? r.map((e) => {
45
+ const t = /* @__PURE__ */ a(v, { actions: n(e), iconOrientation: "horizontal" });
45
46
  return { ...e, actions: t };
46
- }) : r, [r, n]), v = (r, n) => {
47
+ }) : r, [r, n]), x = (r, n) => {
47
48
  if (!r) return [];
48
49
  let e = Object.keys(r).map((t) => t);
49
50
  return n?.length > 0 && (e = e.sort((t, f) => {
@@ -52,6 +53,6 @@ const j = ({
52
53
  })), e;
53
54
  };
54
55
  export {
55
- j as useGenerateColumns,
56
- l as useGenerateTableData
56
+ b as useGenerateColumns,
57
+ j as useGenerateTableData
57
58
  };
@@ -1,4 +1,6 @@
1
- type SearchBarProps = {
1
+ import { TextfieldProps } from '@element-public/react-textfield';
2
+
3
+ type SearchBarProps = Pick<TextfieldProps, 'placeholder' | 'dense' | 'className' | 'fullWidth'> & {
2
4
  /**
3
5
  * the current search term
4
6
  */
@@ -7,18 +9,6 @@ type SearchBarProps = {
7
9
  * the function to set the search term
8
10
  */
9
11
  setSearchTerm: (value: string) => void;
10
- /**
11
- * the placeholder of the search input
12
- */
13
- placeholder?: string;
14
- /**
15
- * if true the field is smaller, normal size otherwise, default: false
16
- */
17
- dense?: boolean;
18
- /**
19
- * optional className to customize the searchbar style
20
- */
21
- className?: string;
22
12
  };
23
- export declare const SearchBar: ({ className, dense, searchTerm, setSearchTerm, placeholder, }: SearchBarProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const SearchBar: ({ className, dense, searchTerm, setSearchTerm, placeholder, fullWidth, }: SearchBarProps) => import("react/jsx-runtime").JSX.Element;
24
14
  export {};
@@ -1,27 +1,28 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { I as c } from "../../index.es-0lQcz8m1.js";
3
- import { T as i } from "../../index.es-25EARqhH.js";
4
- import '../../assets/SearchBar.css';const l = "_searchbar_gnvwc_1", u = {
5
- searchbar: l
6
- }, f = ({
2
+ import { I as i } from "../../index.es-0lQcz8m1.js";
3
+ import { T as l } from "../../index.es-25EARqhH.js";
4
+ import '../../assets/SearchBar.css';const u = "_searchbar_gnvwc_1", b = {
5
+ searchbar: u
6
+ }, p = ({
7
7
  className: o = "",
8
8
  dense: n = !1,
9
9
  searchTerm: a,
10
10
  setSearchTerm: t,
11
- placeholder: s
11
+ placeholder: s,
12
+ fullWidth: e = !0
12
13
  }) => /* @__PURE__ */ r(
13
- i,
14
+ l,
14
15
  {
15
16
  "data-testid": "search-bar-input",
16
- className: `${o ?? ""} ${u.searchbar}`,
17
+ className: `${o ?? ""} ${b.searchbar}`,
17
18
  dense: n,
18
19
  variant: "outlined",
19
20
  placeholder: s,
20
21
  value: a,
21
- onChange: (e) => t(e.target.value),
22
- fullWidth: !0,
22
+ onChange: (c) => t(c.target.value),
23
+ fullWidth: e,
23
24
  trailingIcon: /* @__PURE__ */ r(
24
- c,
25
+ i,
25
26
  {
26
27
  "data-testid": "search-bar-icon-button",
27
28
  icon: a ? "close" : "search",
@@ -31,5 +32,5 @@ import '../../assets/SearchBar.css';const l = "_searchbar_gnvwc_1", u = {
31
32
  }
32
33
  );
33
34
  export {
34
- f as SearchBar
35
+ p as SearchBar
35
36
  };
@@ -41,6 +41,11 @@ export type TableLayoutProps<T> = {
41
41
  * ```
42
42
  */
43
43
  tableActions?: JSX.Element[];
44
+ /**
45
+ * position of the table actions, can be 'start' or 'end'
46
+ * @default 'end'
47
+ */
48
+ tableActionPosition?: 'start' | 'end';
44
49
  /**
45
50
  * text to be displayed when no data is available
46
51
  */
@@ -99,6 +104,16 @@ export type TableLayoutProps<T> = {
99
104
  * @default 'Rows per page'
100
105
  */
101
106
  rowsPerPageTranslation?: string;
107
+ /**
108
+ * the elevation level of the table, used to set the shadow of the table
109
+ * @default 1
110
+ */
111
+ tableElevationLevel?: number;
112
+ /**
113
+ * the layout of the table, can be 'standard' or 'flex'
114
+ * @default 'standard'
115
+ */
116
+ tableLayout?: 'standard' | 'flex';
102
117
  };
103
118
  /**
104
119
  * Props for the CellTemplate component {@link CellTemplate}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hortiview/shared-components",
3
3
  "description": "This is a shared component library. It should used in the HortiView platform and its modules.",
4
- "version": "1.11.0",
4
+ "version": "1.12.0",
5
5
  "type": "module",
6
6
  "repository": "https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared",
7
7
  "author": "Falk Menge <falk.menge.ext@bayer.com>",