@headless-adminapp/fluent 1.3.0 → 1.3.1

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.
@@ -43,7 +43,7 @@ const Header = () => {
43
43
  eventManager.emit('INSIGHT_REFRESH_TRIGGER');
44
44
  }, children: "Refresh" }) })] }), !!config.filterAttributes && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, { style: { opacity: 0.2 } }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', gap: react_components_1.tokens.spacingHorizontalS }, children: Object.entries(config.filterAttributes).map(([attributeName, attribute]) => {
45
45
  return ((0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: filterForm.control, name: attributeName, render: ({ field }) => {
46
- return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(StandardControl_1.StandardControl, { attribute: attribute, name: attributeName, value: field.value, onChange: field.onChange, onBlur: field.onBlur }) }));
46
+ return ((0, jsx_runtime_1.jsx)("div", { style: { width: 210, minWidth: 210 }, children: (0, jsx_runtime_1.jsx)(StandardControl_1.StandardControl, { attribute: attribute, name: attributeName, value: field.value, onChange: field.onChange, onBlur: field.onBlur }) }));
47
47
  } }, attributeName));
48
48
  }) })] }))] }));
49
49
  };
@@ -11,6 +11,7 @@ const WidgetSection = ({ children }) => {
11
11
  boxShadow: 'none',
12
12
  borderRadius: react_components_1.tokens.borderRadiusXLarge,
13
13
  flexDirection: 'column',
14
+ overflow: 'hidden',
14
15
  }, children: children }));
15
16
  };
16
17
  exports.WidgetSection = WidgetSection;
@@ -8,12 +8,37 @@ const utils_1 = require("@headless-adminapp/app/utils");
8
8
  const BodyLoading_1 = require("../components/BodyLoading");
9
9
  const WidgetSection_1 = require("./WidgetSection");
10
10
  const WidgetTitleBar_1 = require("./WidgetTitleBar");
11
+ const useStyles = (0, react_components_1.makeStyles)({
12
+ table: {
13
+ borderCollapse: 'collapse',
14
+ width: '100%',
15
+ '& tr': {
16
+ borderBottom: `${react_components_1.tokens.strokeWidthThin} solid ${react_components_1.tokens.colorNeutralStroke3}`,
17
+ },
18
+ '& th': {
19
+ fontWeight: react_components_1.tokens.fontWeightMedium,
20
+ minWidth: '32px',
21
+ flexShrink: 0,
22
+ flex: 1,
23
+ position: 'sticky',
24
+ background: react_components_1.tokens.colorNeutralBackground3,
25
+ borderBottom: `${react_components_1.tokens.strokeWidthThin} solid ${react_components_1.tokens.colorNeutralStroke3}`,
26
+ },
27
+ '& td': {
28
+ height: '36px',
29
+ },
30
+ },
31
+ headerAlignRight: {
32
+ textAlign: 'right',
33
+ '& > div': {
34
+ justifyContent: 'flex-end',
35
+ },
36
+ },
37
+ });
11
38
  const WidgetTableContainer = ({ title, columns, attributes, isPending, isFetching, commands, data, }) => {
12
39
  const locale = (0, locale_1.useLocale)();
13
- return ((0, jsx_runtime_1.jsxs)(WidgetSection_1.WidgetSection, { children: [(0, jsx_runtime_1.jsx)(WidgetTitleBar_1.WidgetTitleBar, { title: title, commands: commands }), (0, jsx_runtime_1.jsxs)("div", { style: { flex: 1, position: 'relative', overflow: 'auto' }, children: [!isPending && ((0, jsx_runtime_1.jsxs)(react_components_1.Table, { style: {
14
- borderCollapse: 'collapse',
15
- width: '100%',
16
- }, children: [(0, jsx_runtime_1.jsx)(react_components_1.TableHeader, { style: {
40
+ const styles = useStyles();
41
+ return ((0, jsx_runtime_1.jsxs)(WidgetSection_1.WidgetSection, { children: [(0, jsx_runtime_1.jsx)(WidgetTitleBar_1.WidgetTitleBar, { title: title, commands: commands }), (0, jsx_runtime_1.jsxs)("div", { style: { flex: 1, position: 'relative', overflow: 'auto' }, children: [!isPending && ((0, jsx_runtime_1.jsxs)(react_components_1.Table, { className: styles.table, children: [(0, jsx_runtime_1.jsx)(react_components_1.TableHeader, { style: {
17
42
  position: 'sticky',
18
43
  top: 0,
19
44
  background: react_components_1.tokens.colorNeutralBackground3,
@@ -24,14 +49,9 @@ const WidgetTableContainer = ({ title, columns, attributes, isPending, isFetchin
24
49
  minWidth: 'calc(100% - 16px)',
25
50
  }, children: columns.map((column, index) => {
26
51
  const attribute = attributes[column];
27
- return ((0, jsx_runtime_1.jsx)(react_components_1.TableHeaderCell, { style: {
28
- minWidth: 32,
29
- flexShrink: 0,
30
- flex: 1,
31
- position: 'sticky',
32
- background: react_components_1.tokens.colorNeutralBackground3,
33
- borderBottom: `${react_components_1.tokens.strokeWidthThin} solid ${react_components_1.tokens.colorNeutralStroke3}`,
34
- }, children: attribute.label }, column + String(index)));
52
+ return ((0, jsx_runtime_1.jsx)(react_components_1.TableHeaderCell, { align: "right", className: attribute?.type === 'money'
53
+ ? styles.headerAlignRight
54
+ : '', children: attribute.label }, column + String(index)));
35
55
  }) }) }), (0, jsx_runtime_1.jsx)(react_components_1.TableBody, { children: data.map((row, index) => ((0, jsx_runtime_1.jsx)(react_components_1.TableRow, { children: columns.map((column) => {
36
56
  const attribute = attributes[column];
37
57
  const value = row[column];
@@ -39,7 +59,7 @@ const WidgetTableContainer = ({ title, columns, attributes, isPending, isFetchin
39
59
  '';
40
60
  switch (attribute?.type) {
41
61
  case 'money':
42
- return ((0, jsx_runtime_1.jsx)(react_components_1.TableCell, { children: formattedValue }, column));
62
+ return ((0, jsx_runtime_1.jsx)(react_components_1.TableCell, { style: { textAlign: 'right' }, children: formattedValue }, column));
43
63
  case 'lookup':
44
64
  return null;
45
65
  }
@@ -129,7 +129,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
129
129
  left: inputLeft,
130
130
  height: 30,
131
131
  },
132
- }, placeholder: placeholder, inputMode: "search", style: { width: '100%', height: '100%' }, autoComplete: "off", readOnly: readOnly || disabled, open: open && !readOnly && !disabled, value: searchText, onOpenChange: (e, data) => {
132
+ }, placeholder: placeholder, inputMode: "search", style: { width: '100%', height: '100%', minWidth: 'unset' }, autoComplete: "off", readOnly: readOnly || disabled, open: open && !readOnly && !disabled, value: searchText, onOpenChange: (e, data) => {
133
133
  setOpen(data.open);
134
134
  }, onChange: (e) => {
135
135
  setSearchText(e.target.value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/fluent",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -52,5 +52,5 @@
52
52
  "uuid": "11.0.3",
53
53
  "yup": "^1.4.0"
54
54
  },
55
- "gitHead": "bd466c5f536131bd6e2ff2241c1b5a48883f68c2"
55
+ "gitHead": "019339a44fae0fcce5466041f922710b08b79172"
56
56
  }