io-sanita-theme 2.11.1 → 2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.12.0](https://github.com/RedTurtle/io-sanita-theme/compare/2.11.2...2.12.0) (2025-04-14)
4
+
5
+ ### Features
6
+
7
+ * searchable SelectFilter ([f653c01](https://github.com/RedTurtle/io-sanita-theme/commit/f653c0103823f8ef69507b8f78abd29a2126a933))
8
+
9
+ ### Bug Fixes
10
+
11
+ * bug in columns listing table, header widget and hide h1 in homepage ([#80](https://github.com/RedTurtle/io-sanita-theme/issues/80)) ([fb9a671](https://github.com/RedTurtle/io-sanita-theme/commit/fb9a671d62eefdb1f3d6f0412bccd2e885d8be46))
12
+
13
+ ## [2.11.2](https://github.com/RedTurtle/io-sanita-theme/compare/2.11.1...2.11.2) (2025-04-08)
14
+
15
+ ### Bug Fixes
16
+
17
+ * fixed title tag for a11y in Attachments component not displayed as section ([#79](https://github.com/RedTurtle/io-sanita-theme/issues/79)) ([96bed38](https://github.com/RedTurtle/io-sanita-theme/commit/96bed38f4441dde74e3e059d7c3a05ad138a7f24))
18
+ * table block sorting ([#78](https://github.com/RedTurtle/io-sanita-theme/issues/78)) ([2e1dfca](https://github.com/RedTurtle/io-sanita-theme/commit/2e1dfcad4faaafddc4991b96deb58078b56fd9be))
19
+
3
20
  ## [2.11.1](https://github.com/RedTurtle/io-sanita-theme/compare/2.11.0...2.11.1) (2025-03-31)
4
21
 
5
22
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "io-sanita-theme",
3
- "version": "2.11.1",
3
+ "version": "2.12.0",
4
4
  "description": "io-sanita-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "license": "MIT",
@@ -42,18 +42,20 @@ const TableTemplate = (props) => {
42
42
  const ct_schemas = useSelector((state) => state.ct_schema?.subrequests);
43
43
 
44
44
  useEffect(() => {
45
- const cts = columns.reduce((acc, c) => {
46
- if (acc.indexOf(c.ct) < 0) {
47
- acc.push(c.ct);
48
- }
49
- return acc;
50
- }, []);
51
-
52
- cts.forEach((c) => {
53
- if (!ct_schemas[c]) {
54
- dispatch(getCTSchema(c));
55
- }
56
- });
45
+ if(columns?.length > 0) {
46
+ const cts = columns.reduce((acc, c) => {
47
+ if (acc.indexOf(c.ct) < 0) {
48
+ acc.push(c.ct);
49
+ }
50
+ return acc;
51
+ }, []);
52
+
53
+ cts.forEach((c) => {
54
+ if (!ct_schemas[c]) {
55
+ dispatch(getCTSchema(c));
56
+ }
57
+ });
58
+ }
57
59
  }, [columns]);
58
60
 
59
61
  let render_columns =
@@ -98,7 +98,7 @@ const Attachments = ({
98
98
  </RichTextSection>
99
99
  ) : (
100
100
  <div className="mb-5 mt-3">
101
- {title && <h4 className="h5">{title}</h4>}
101
+ {title && <h3 className="h5">{title}</h3>}
102
102
  {attachments.length > 0 && attachments_view}
103
103
  {searchResults?.[key]?.loading && !searchResults?.[key]?.loaded && <></>}
104
104
  </div>
@@ -58,13 +58,14 @@ const SelectFilter = ({ options, value, id, onChange, placeholder }) => {
58
58
  <div className="filter-wrapper select-filter">
59
59
  <SelectInput
60
60
  id={id}
61
- value={value}
61
+ value={value ?? ''}
62
62
  placeholder={options?.placeholder}
63
63
  onChange={(opt) => {
64
64
  onChange(id, opt);
65
65
  }}
66
66
  options={select_options?.filter((opt) => !!opt.value?.toString()) ?? []}
67
67
  isClearable={true}
68
+ isSearchable={true}
68
69
  />
69
70
  </div>
70
71
  );
@@ -47,3 +47,8 @@
47
47
  height: 1rem;
48
48
  width: auto;
49
49
  }
50
+
51
+ .react-select__control .react-select__input input:focus:not(.focus--mouse) {
52
+ outline: none !important;
53
+ box-shadow: none !important;
54
+ }
@@ -18,7 +18,7 @@ const HeaderContactsWidget = (props) => {
18
18
  <ObjectListWidget
19
19
  schema={schema}
20
20
  block={'contatti_testata'}
21
- value={JSON.parse(value) ?? []}
21
+ value={value ? JSON.parse(value) : []}
22
22
  onChange={onChangeField}
23
23
  id={id}
24
24
  title="Contatti in testata"
@@ -88,16 +88,21 @@ const View = ({ data }) => {
88
88
 
89
89
  const handleSort = (index) => {
90
90
  if (!sortable) return;
91
- setState((prevState) => ({
91
+ setState({
92
92
  column: index,
93
93
  direction:
94
- prevState.column !== index
94
+ state.column !== index
95
+ ? 'ascending'
96
+ : state.direction === 'ascending'
97
+ ? 'descending'
98
+ : 'ascending',
99
+ sortLabel:
100
+ state.column !== index
95
101
  ? intl.formatMessage(messages.ascendingTableSort)
96
- : prevState.direction ===
97
- intl.formatMessage(messages.ascendingTableSort)
102
+ : state.direction === 'ascending'
98
103
  ? intl.formatMessage(messages.descendingTableSort)
99
104
  : intl.formatMessage(messages.ascendingTableSort),
100
- }));
105
+ });
101
106
  };
102
107
 
103
108
  return (
@@ -123,7 +128,7 @@ const View = ({ data }) => {
123
128
  verticalAlign="middle"
124
129
  sorted={state.column === index ? state.direction : null}
125
130
  aria-sort={
126
- state.column === index ? state.direction : 'none'
131
+ state.column === index ? state.sortLabel : 'none'
127
132
  }
128
133
  role="columnheader"
129
134
  onClick={() => handleSort(index)}
@@ -1,7 +1,10 @@
1
1
  .siteroot,
2
- body.public-ui.contenttype-lr:not(.section-search) {
3
- .block-editor-title,
4
- .documentFirstHeading,
2
+ body.public-ui.contenttype-lrf:not(.section-search) {
3
+ .documentFirstHeading {
4
+ visibility: hidden;
5
+ height: 0;
6
+ margin: 0;
7
+ }
5
8
  #briciole {
6
9
  display: none;
7
10
  }
@@ -10,7 +13,11 @@ body.public-ui.contenttype-lr:not(.section-search) {
10
13
  body.subsite.subsite-root:not(.section-search) {
11
14
  &,
12
15
  .public-ui {
13
- .documentFirstHeading,
16
+ .documentFirstHeading {
17
+ visibility: hidden;
18
+ height: 0;
19
+ margin: 0;
20
+ }
14
21
  #briciole {
15
22
  display: none;
16
23
  }