@helpdice/ui 1.2.3 → 1.2.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.
package/dist/index.js CHANGED
@@ -42138,69 +42138,58 @@ var TableHead = function TableHead(props) {
42138
42138
  };
42139
42139
  var generateFilterInputs = function generateFilterInputs() {
42140
42140
  return columns.map(function (col) {
42141
- var _String;
42141
+ var _String, _filters$filterName;
42142
42142
  var Header = col.label,
42143
42143
  accessor = col.filter,
42144
42144
  options = col.options;
42145
42145
  var filterName = (_String = String(col === null || col === undefined ? undefined : col.label)) === null || _String === undefined ? undefined : _String.replace(' ', '_').toLowerCase();
42146
42146
  var unq_accessor = _.uniqueId(filterName);
42147
- if (accessor === 'fixed') {
42148
- var _filters$filterName;
42149
- // Dropdown filter for categorical data (category, status)
42150
- return /*#__PURE__*/React.createElement("td", {
42151
- "data-column": Header
42152
- }, /*#__PURE__*/React.createElement(Select, {
42153
- key: unq_accessor,
42154
- name: filterName,
42155
- value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== undefined ? _filters$filterName : 'All',
42156
- onChange: function onChange(newValue) {
42157
- return handleFilterChange(filterName, newValue);
42158
- }
42159
- }, /*#__PURE__*/React.createElement(Select.Option, {
42160
- value: "All"
42161
- }, "All ", Header), options ? options.map(function (option) {
42162
- return /*#__PURE__*/React.createElement(Select.Option, {
42163
- value: option.value
42164
- }, option.name);
42165
- }) : null));
42166
- }
42167
- if (accessor === 'date') {
42168
- // Date filter
42169
- return /*#__PURE__*/React.createElement("th", {
42170
- "data-column": Header,
42171
- key: unq_accessor
42172
- }, /*#__PURE__*/React.createElement(Input, {
42173
- id: "filter-date-".concat(filterName),
42174
- htmlType: "date",
42175
- name: filterName,
42176
- value: filters[filterName],
42177
- onChange: function onChange(e) {
42178
- return handleFilterChange(filterName, e.target.value);
42179
- }
42180
- }));
42181
- }
42182
- if (accessor === 'search') {
42183
- // Text search filter
42184
- return /*#__PURE__*/React.createElement("th", {
42185
- "data-column": Header
42186
- }, /*#__PURE__*/React.createElement(Input, {
42187
- id: "filter-search-".concat(filterName),
42188
- htmlType: "text"
42189
- // ref={filterRefs.current[filterName]} // Dynamically set ref}
42190
- ,
42191
- name: filterName,
42192
- style: {
42193
- height: 30,
42194
- minWidth: 160
42195
- },
42196
- value: filters[filterName],
42197
- onChange: function onChange(e) {
42198
- return handleFilterChange(filterName, e.target.value);
42199
- },
42200
- placeholder: "Search...",
42201
- fullWidth: true
42202
- }));
42203
- }
42147
+ return /*#__PURE__*/React.createElement("th", {
42148
+ style: {
42149
+ margin: '3px'
42150
+ },
42151
+ "data-column": Header,
42152
+ key: unq_accessor
42153
+ }, accessor === 'fixed' && /*#__PURE__*/React.createElement(Select, {
42154
+ key: unq_accessor,
42155
+ name: filterName,
42156
+ value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== undefined ? _filters$filterName : 'All',
42157
+ onChange: function onChange(newValue) {
42158
+ return handleFilterChange(filterName, newValue);
42159
+ }
42160
+ }, /*#__PURE__*/React.createElement(Select.Option, {
42161
+ value: "All"
42162
+ }, "All ", Header), options ? options.map(function (option) {
42163
+ return /*#__PURE__*/React.createElement(Select.Option, {
42164
+ value: option.value
42165
+ }, option.name);
42166
+ }) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input, {
42167
+ id: "filter-date-".concat(filterName),
42168
+ htmlType: "date",
42169
+ name: filterName,
42170
+ value: filters[filterName],
42171
+ onChange: function onChange(e) {
42172
+ return handleFilterChange(filterName, e.target.value);
42173
+ }
42174
+ }), accessor === 'search' && /*#__PURE__*/React.createElement("th", {
42175
+ "data-column": Header
42176
+ }, /*#__PURE__*/React.createElement(Input, {
42177
+ id: "filter-search-".concat(filterName),
42178
+ htmlType: "text"
42179
+ // ref={filterRefs.current[filterName]} // Dynamically set ref}
42180
+ ,
42181
+ name: filterName,
42182
+ style: {
42183
+ height: 30,
42184
+ minWidth: 160
42185
+ },
42186
+ value: filters[filterName],
42187
+ onChange: function onChange(e) {
42188
+ return handleFilterChange(filterName, e.target.value);
42189
+ },
42190
+ placeholder: "Search...",
42191
+ fullWidth: true
42192
+ })));
42204
42193
  });
42205
42194
  };
42206
42195
  return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
@@ -42209,6 +42198,13 @@ var TableHead = function TableHead(props) {
42209
42198
  className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
42210
42199
  }, columns.map(function (column, index) {
42211
42200
  return /*#__PURE__*/React.createElement("th", {
42201
+ style: {
42202
+ // textAlign: `${column?.align} !important`,
42203
+ // paddingLeft: '0.3rem',
42204
+ // paddingRight: '0.3rem',
42205
+ // color: `${column?.color}`,
42206
+ whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
42207
+ },
42212
42208
  key: "table-th-".concat(column.prop.toString(), "-").concat(index),
42213
42209
  "data-column": column.label,
42214
42210
  className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
@@ -42857,7 +42853,6 @@ function DataTable(_ref) {
42857
42853
  onDrop: onDrop,
42858
42854
  id: TABLE_ID,
42859
42855
  style: _objectSpread2({
42860
- overflow: 'hidden',
42861
42856
  height: 'calc(100vh - 8.5rem)',
42862
42857
  maxWidth: 'calc(100vw - 1rem)',
42863
42858
  width: sideMenu ? 'calc(100vw - 17.2rem)' : 'inherit !important'
@@ -42877,6 +42872,7 @@ function DataTable(_ref) {
42877
42872
  }
42878
42873
  }, COLUMNS.map(function (column, index) {
42879
42874
  return /*#__PURE__*/React.createElement(Table.Column, {
42875
+ options: column === null || column === undefined ? undefined : column.options,
42880
42876
  fontSize: column === null || column === undefined ? undefined : column.fontSize,
42881
42877
  key: "".concat(column.id, "-").concat(index),
42882
42878
  prop: column.id,
@@ -19883,69 +19883,58 @@ var TableHead = function TableHead(props) {
19883
19883
  };
19884
19884
  var generateFilterInputs = function generateFilterInputs() {
19885
19885
  return columns.map(function (col) {
19886
- var _String;
19886
+ var _String, _filters$filterName;
19887
19887
  var Header = col.label,
19888
19888
  accessor = col.filter,
19889
19889
  options = col.options;
19890
19890
  var filterName = (_String = String(col === null || col === undefined ? undefined : col.label)) === null || _String === undefined ? undefined : _String.replace(' ', '_').toLowerCase();
19891
19891
  var unq_accessor = _.uniqueId(filterName);
19892
- if (accessor === 'fixed') {
19893
- var _filters$filterName;
19894
- // Dropdown filter for categorical data (category, status)
19895
- return /*#__PURE__*/React.createElement("td", {
19896
- "data-column": Header
19897
- }, /*#__PURE__*/React.createElement(Select, {
19898
- key: unq_accessor,
19899
- name: filterName,
19900
- value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== undefined ? _filters$filterName : 'All',
19901
- onChange: function onChange(newValue) {
19902
- return handleFilterChange(filterName, newValue);
19903
- }
19904
- }, /*#__PURE__*/React.createElement(Select.Option, {
19905
- value: "All"
19906
- }, "All ", Header), options ? options.map(function (option) {
19907
- return /*#__PURE__*/React.createElement(Select.Option, {
19908
- value: option.value
19909
- }, option.name);
19910
- }) : null));
19911
- }
19912
- if (accessor === 'date') {
19913
- // Date filter
19914
- return /*#__PURE__*/React.createElement("th", {
19915
- "data-column": Header,
19916
- key: unq_accessor
19917
- }, /*#__PURE__*/React.createElement(Input, {
19918
- id: "filter-date-".concat(filterName),
19919
- htmlType: "date",
19920
- name: filterName,
19921
- value: filters[filterName],
19922
- onChange: function onChange(e) {
19923
- return handleFilterChange(filterName, e.target.value);
19924
- }
19925
- }));
19926
- }
19927
- if (accessor === 'search') {
19928
- // Text search filter
19929
- return /*#__PURE__*/React.createElement("th", {
19930
- "data-column": Header
19931
- }, /*#__PURE__*/React.createElement(Input, {
19932
- id: "filter-search-".concat(filterName),
19933
- htmlType: "text"
19934
- // ref={filterRefs.current[filterName]} // Dynamically set ref}
19935
- ,
19936
- name: filterName,
19937
- style: {
19938
- height: 30,
19939
- minWidth: 160
19940
- },
19941
- value: filters[filterName],
19942
- onChange: function onChange(e) {
19943
- return handleFilterChange(filterName, e.target.value);
19944
- },
19945
- placeholder: "Search...",
19946
- fullWidth: true
19947
- }));
19948
- }
19892
+ return /*#__PURE__*/React.createElement("th", {
19893
+ style: {
19894
+ margin: '3px'
19895
+ },
19896
+ "data-column": Header,
19897
+ key: unq_accessor
19898
+ }, accessor === 'fixed' && /*#__PURE__*/React.createElement(Select, {
19899
+ key: unq_accessor,
19900
+ name: filterName,
19901
+ value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== undefined ? _filters$filterName : 'All',
19902
+ onChange: function onChange(newValue) {
19903
+ return handleFilterChange(filterName, newValue);
19904
+ }
19905
+ }, /*#__PURE__*/React.createElement(Select.Option, {
19906
+ value: "All"
19907
+ }, "All ", Header), options ? options.map(function (option) {
19908
+ return /*#__PURE__*/React.createElement(Select.Option, {
19909
+ value: option.value
19910
+ }, option.name);
19911
+ }) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input, {
19912
+ id: "filter-date-".concat(filterName),
19913
+ htmlType: "date",
19914
+ name: filterName,
19915
+ value: filters[filterName],
19916
+ onChange: function onChange(e) {
19917
+ return handleFilterChange(filterName, e.target.value);
19918
+ }
19919
+ }), accessor === 'search' && /*#__PURE__*/React.createElement("th", {
19920
+ "data-column": Header
19921
+ }, /*#__PURE__*/React.createElement(Input, {
19922
+ id: "filter-search-".concat(filterName),
19923
+ htmlType: "text"
19924
+ // ref={filterRefs.current[filterName]} // Dynamically set ref}
19925
+ ,
19926
+ name: filterName,
19927
+ style: {
19928
+ height: 30,
19929
+ minWidth: 160
19930
+ },
19931
+ value: filters[filterName],
19932
+ onChange: function onChange(e) {
19933
+ return handleFilterChange(filterName, e.target.value);
19934
+ },
19935
+ placeholder: "Search...",
19936
+ fullWidth: true
19937
+ })));
19949
19938
  });
19950
19939
  };
19951
19940
  return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
@@ -19954,6 +19943,13 @@ var TableHead = function TableHead(props) {
19954
19943
  className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
19955
19944
  }, columns.map(function (column, index) {
19956
19945
  return /*#__PURE__*/React.createElement("th", {
19946
+ style: {
19947
+ // textAlign: `${column?.align} !important`,
19948
+ // paddingLeft: '0.3rem',
19949
+ // paddingRight: '0.3rem',
19950
+ // color: `${column?.color}`,
19951
+ whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
19952
+ },
19957
19953
  key: "table-th-".concat(column.prop.toString(), "-").concat(index),
19958
19954
  "data-column": column.label,
19959
19955
  className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
@@ -31449,7 +31445,6 @@ function DataTable(_ref) {
31449
31445
  onDrop: onDrop,
31450
31446
  id: TABLE_ID,
31451
31447
  style: _objectSpread2({
31452
- overflow: 'hidden',
31453
31448
  height: 'calc(100vh - 8.5rem)',
31454
31449
  maxWidth: 'calc(100vw - 1rem)',
31455
31450
  width: sideMenu ? 'calc(100vw - 17.2rem)' : 'inherit !important'
@@ -31469,6 +31464,7 @@ function DataTable(_ref) {
31469
31464
  }
31470
31465
  }, COLUMNS.map(function (column, index) {
31471
31466
  return /*#__PURE__*/React.createElement(Table.Column, {
31467
+ options: column === null || column === undefined ? undefined : column.options,
31472
31468
  fontSize: column === null || column === undefined ? undefined : column.fontSize,
31473
31469
  key: "".concat(column.id, "-").concat(index),
31474
31470
  prop: column.id,
@@ -301,7 +301,6 @@ function DataTable(_ref) {
301
301
  onDrop: onDrop,
302
302
  id: TABLE_ID,
303
303
  style: _extends({
304
- overflow: 'hidden',
305
304
  height: 'calc(100vh - 8.5rem)',
306
305
  maxWidth: 'calc(100vw - 1rem)',
307
306
  width: sideMenu ? 'calc(100vw - 17.2rem)' : 'inherit !important'
@@ -321,6 +320,7 @@ function DataTable(_ref) {
321
320
  }
322
321
  }, COLUMNS.map(function (column, index) {
323
322
  return /*#__PURE__*/React.createElement(Table.Column, {
323
+ options: column === null || column === void 0 ? void 0 : column.options,
324
324
  fontSize: column === null || column === void 0 ? void 0 : column.fontSize,
325
325
  key: "".concat(column.id, "-").concat(index),
326
326
  prop: column.id,
@@ -55,69 +55,58 @@ var TableHead = function TableHead(props) {
55
55
  };
56
56
  var generateFilterInputs = function generateFilterInputs() {
57
57
  return columns.map(function (col) {
58
- var _String;
58
+ var _String, _filters$filterName;
59
59
  var Header = col.label,
60
60
  accessor = col.filter,
61
61
  options = col.options;
62
62
  var filterName = (_String = String(col === null || col === void 0 ? void 0 : col.label)) === null || _String === void 0 ? void 0 : _String.replace(' ', '_').toLowerCase();
63
63
  var unq_accessor = _.uniqueId(filterName);
64
- if (accessor === 'fixed') {
65
- var _filters$filterName;
66
- // Dropdown filter for categorical data (category, status)
67
- return /*#__PURE__*/React.createElement("td", {
68
- "data-column": Header
69
- }, /*#__PURE__*/React.createElement(Select, {
70
- key: unq_accessor,
71
- name: filterName,
72
- value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== void 0 ? _filters$filterName : 'All',
73
- onChange: function onChange(newValue) {
74
- return handleFilterChange(filterName, newValue);
75
- }
76
- }, /*#__PURE__*/React.createElement(Select.Option, {
77
- value: "All"
78
- }, "All ", Header), options ? options.map(function (option) {
79
- return /*#__PURE__*/React.createElement(Select.Option, {
80
- value: option.value
81
- }, option.name);
82
- }) : null));
83
- }
84
- if (accessor === 'date') {
85
- // Date filter
86
- return /*#__PURE__*/React.createElement("th", {
87
- "data-column": Header,
88
- key: unq_accessor
89
- }, /*#__PURE__*/React.createElement(Input, {
90
- id: "filter-date-".concat(filterName),
91
- htmlType: "date",
92
- name: filterName,
93
- value: filters[filterName],
94
- onChange: function onChange(e) {
95
- return handleFilterChange(filterName, e.target.value);
96
- }
97
- }));
98
- }
99
- if (accessor === 'search') {
100
- // Text search filter
101
- return /*#__PURE__*/React.createElement("th", {
102
- "data-column": Header
103
- }, /*#__PURE__*/React.createElement(Input, {
104
- id: "filter-search-".concat(filterName),
105
- htmlType: "text"
106
- // ref={filterRefs.current[filterName]} // Dynamically set ref}
107
- ,
108
- name: filterName,
109
- style: {
110
- height: 30,
111
- minWidth: 160
112
- },
113
- value: filters[filterName],
114
- onChange: function onChange(e) {
115
- return handleFilterChange(filterName, e.target.value);
116
- },
117
- placeholder: "Search...",
118
- fullWidth: true
119
- }));
120
- }
64
+ return /*#__PURE__*/React.createElement("th", {
65
+ style: {
66
+ margin: '3px'
67
+ },
68
+ "data-column": Header,
69
+ key: unq_accessor
70
+ }, accessor === 'fixed' && /*#__PURE__*/React.createElement(Select, {
71
+ key: unq_accessor,
72
+ name: filterName,
73
+ value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== void 0 ? _filters$filterName : 'All',
74
+ onChange: function onChange(newValue) {
75
+ return handleFilterChange(filterName, newValue);
76
+ }
77
+ }, /*#__PURE__*/React.createElement(Select.Option, {
78
+ value: "All"
79
+ }, "All ", Header), options ? options.map(function (option) {
80
+ return /*#__PURE__*/React.createElement(Select.Option, {
81
+ value: option.value
82
+ }, option.name);
83
+ }) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input, {
84
+ id: "filter-date-".concat(filterName),
85
+ htmlType: "date",
86
+ name: filterName,
87
+ value: filters[filterName],
88
+ onChange: function onChange(e) {
89
+ return handleFilterChange(filterName, e.target.value);
90
+ }
91
+ }), accessor === 'search' && /*#__PURE__*/React.createElement("th", {
92
+ "data-column": Header
93
+ }, /*#__PURE__*/React.createElement(Input, {
94
+ id: "filter-search-".concat(filterName),
95
+ htmlType: "text"
96
+ // ref={filterRefs.current[filterName]} // Dynamically set ref}
97
+ ,
98
+ name: filterName,
99
+ style: {
100
+ height: 30,
101
+ minWidth: 160
102
+ },
103
+ value: filters[filterName],
104
+ onChange: function onChange(e) {
105
+ return handleFilterChange(filterName, e.target.value);
106
+ },
107
+ placeholder: "Search...",
108
+ fullWidth: true
109
+ })));
121
110
  });
122
111
  };
123
112
  return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
@@ -126,6 +115,13 @@ var TableHead = function TableHead(props) {
126
115
  className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
127
116
  }, columns.map(function (column, index) {
128
117
  return /*#__PURE__*/React.createElement("th", {
118
+ style: {
119
+ // textAlign: `${column?.align} !important`,
120
+ // paddingLeft: '0.3rem',
121
+ // paddingRight: '0.3rem',
122
+ // color: `${column?.color}`,
123
+ whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
124
+ },
129
125
  key: "table-th-".concat(column.prop.toString(), "-").concat(index),
130
126
  "data-column": column.label,
131
127
  className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpdice/ui",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "unpkg": "dist/index.min.js",