@massimo-cassandro/minimo 1.21.2 → 1.21.3

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.
Files changed (54) hide show
  1. package/package.json +1 -1
  2. package/src/components/autocomplete/autocomplete.css +116 -118
  3. package/src/components/inner-nav/inner-nav.css +10 -13
  4. package/src/components/modal-alert/modal-alert.module.css +156 -159
  5. package/src/components/modal-popup/modal-popup.module.css +84 -88
  6. package/src/components/overlay/overlay.css +10 -14
  7. package/src/components/sf-macro/sf-macro.css +68 -72
  8. package/src/components/slide-up-down-toggle/slide-up-down-toggle.module.css +90 -94
  9. package/src/components/snackbar/snackbar.module.css +89 -93
  10. package/src/components/spinner/spinner-circle-basic.css +14 -18
  11. package/src/components/spinner/spinner.module.css +4 -8
  12. package/src/components/unsplash-page/unsplash-page.module.css +255 -260
  13. package/src/css/alerts.css +81 -85
  14. package/src/css/badge.css +13 -15
  15. package/src/css/buttons/btn-close.css +53 -56
  16. package/src/css/buttons/buttons-primary.css +34 -37
  17. package/src/css/buttons/buttons-secondary.css +34 -37
  18. package/src/css/buttons/buttons.css +80 -83
  19. package/src/css/buttons/status-buttons.css +87 -90
  20. package/src/css/container.css +5 -8
  21. package/src/css/data-formats.css +24 -28
  22. package/src/css/details.css +13 -17
  23. package/src/css/dimensions.css +9 -12
  24. package/src/css/display.css +37 -41
  25. package/src/css/flex.css +35 -39
  26. package/src/css/forms/fieldset.css +56 -59
  27. package/src/css/forms/form-collections.css +12 -16
  28. package/src/css/forms/form-disabled-readonly.css +28 -31
  29. package/src/css/forms/form-group.css +13 -18
  30. package/src/css/forms/form-utilities.css +34 -39
  31. package/src/css/forms/forms.css +132 -136
  32. package/src/css/forms/input-group.css +43 -47
  33. package/src/css/forms/switch.css +75 -78
  34. package/src/css/forms/validation.css +22 -26
  35. package/src/css/grid.css +62 -66
  36. package/src/css/headings.css +28 -32
  37. package/src/css/icons.css +57 -63
  38. package/src/css/layout-base.css +13 -15
  39. package/src/css/links.css +36 -39
  40. package/src/css/margin-padding-bootstrap-media.css +1832 -1835
  41. package/src/css/margin-padding-bootstrap.css +440 -443
  42. package/src/css/margin-padding-media.css +1832 -1835
  43. package/src/css/margin-padding.css +440 -443
  44. package/src/css/overflow.css +3 -7
  45. package/src/css/position.css +1 -6
  46. package/src/css/reset.css +46 -48
  47. package/src/css/svg.css +2 -5
  48. package/src/css/table.css +61 -63
  49. package/src/css/text.css +95 -98
  50. package/src/css/visibility.css +42 -45
  51. package/src/minimo.css +3 -2
  52. package/src/utilities/dom-builder-helpers/form-tags.js +21 -6
  53. package/src/web-components/s-datatable-component/s-datatable-component.module.css +172 -175
  54. package/types/classes.d.ts +1 -0
@@ -1,6 +1,7 @@
1
1
  import { classnames } from '../classnames.js';
2
2
  import { randomId } from '../random-id.js';
3
3
 
4
+
4
5
  /**
5
6
  * Shared `.form-group` wrapper for the tag builders below: handles the
6
7
  * `condition` guard, `wrapperClass`, optional help text and `callback` in
@@ -45,6 +46,7 @@ function buildFormGroup({
45
46
  * @param {Object} args
46
47
  * @param {string} args.label - input label.
47
48
  * @param {string | null} args.name - input `name` attribute.
49
+ * @param {string | null} args.id - `id` attribute.
48
50
  * @param {string | number | null} args.value - input `value` attribute.
49
51
  * @param {string | null} [args.type='text'] - input `type` attribute.
50
52
  * @param {string | null} [args.wrapperClass=null] - optional class to be added to the `.form-group` wrapper.
@@ -58,6 +60,7 @@ function buildFormGroup({
58
60
  export function buildInput({
59
61
  label,
60
62
  name,
63
+ id = null,
61
64
  value = null,
62
65
  type = 'text',
63
66
  wrapperClass = null,
@@ -68,7 +71,7 @@ export function buildInput({
68
71
  callback = null
69
72
  }){
70
73
 
71
- const id = randomId();
74
+ id = id || randomId();
72
75
 
73
76
  return buildFormGroup({
74
77
  condition,
@@ -98,8 +101,11 @@ export function buildInput({
98
101
  * @param {Object} args
99
102
  * @param {string} args.label - select label.
100
103
  * @param {string | null} args.name - select `name` attribute.
104
+ * @param {string | null} args.id - `id` attribute.
101
105
  * @param {string | number | null} args.selectedValue - selected value
102
- * @param {Array<[string|number, string]> | Record<string, string> | null} args.options - options value/text pairs, as an array of two-element `[value, text]` arrays or as a `{value: text, ...}` object
106
+ * @param {Array<[string|number, string]> | Array<Record<string, string>> | Record<string, string> | null} args.options -
107
+ * options value/text pairs, as an array of two-element `[[value, text], ...]` arrays,
108
+ * as an array of objects `[{somekey: value, somekey2: text},...]` objects, or as a single `{value: text, ...}` object
103
109
  * @param {boolean} [args.addEmptyOption=true] - When true, and empty option tag is added at top
104
110
  * @param {string | null} [args.wrapperClass=null] - optional class to be added to the `.form-group` wrapper.
105
111
  * @param {string | null} [args.className=null] - optional class to be added to the `input`.
@@ -112,6 +118,7 @@ export function buildInput({
112
118
  export function buildSelect({
113
119
  label,
114
120
  name,
121
+ id = null,
115
122
  selectedValue = null,
116
123
  options = null,
117
124
  addEmptyOption = true,
@@ -123,13 +130,17 @@ export function buildSelect({
123
130
  callback = null
124
131
  }){
125
132
 
126
- const id = randomId();
133
+ id = id || randomId();
127
134
 
128
135
  // normalizing option as an array
129
136
  if(options && !Array.isArray(options)) {
130
137
  options = Object.entries(options);
138
+
139
+ } else if(options && !Array.isArray(options[0])) {
140
+ options = options.map(o => Object.values(o));
131
141
  }
132
142
 
143
+
133
144
  return buildFormGroup({
134
145
  condition,
135
146
  wrapperClass,
@@ -145,7 +156,7 @@ export function buildSelect({
145
156
  name: name,
146
157
  },
147
158
  children: [
148
- ...(addEmptyOption? ['option[value=""]'] : []),
159
+ ...(addEmptyOption? ['option[value:]'] : []),
149
160
  ...(options
150
161
  ? options.map(([value, text]) => ({
151
162
  tag: 'option',
@@ -171,6 +182,7 @@ export function buildSelect({
171
182
  * @param {Object} args
172
183
  * @param {string} args.label - checkbox label.
173
184
  * @param {string | null} args.name - checkbox `name` attribute.
185
+ * @param {string | null} args.id - `id` attribute.
174
186
  * @param {string | number | null} [args.value=1] - checkbox `value` attribute.
175
187
  * @param {boolean} [args.checked=false] - checkbox `checked` attribute.
176
188
  * @param {string | null} [args.wrapperClass=null] - optional class to be added to the `.form-group` wrapper (used only when `addFormGroup` is true).
@@ -184,6 +196,7 @@ export function buildSelect({
184
196
  export function buildCheckbox({
185
197
  label,
186
198
  name,
199
+ id = null,
187
200
  value = 1,
188
201
  checked = false,
189
202
  wrapperClass = null,
@@ -206,7 +219,7 @@ export function buildCheckbox({
206
219
  </div>
207
220
  </div>
208
221
  */
209
- const id = randomId();
222
+ id = id || randomId();
210
223
 
211
224
  const tag = {
212
225
  className: classnames('form-check', !addFormGroup && !help && wrapperClass),
@@ -248,6 +261,7 @@ export function buildCheckbox({
248
261
  * @param {Object} args
249
262
  * @param {string} args.label - textarea label.
250
263
  * @param {string | null} args.name - textarea `name` attribute.
264
+ * @param {string | null} args.id - `id` attribute.
251
265
  * @param {string | number | null} args.value - textarea content.
252
266
  * @param {boolean} [args.autosize=true] - adds `autosize` class
253
267
  * @param {string | null} [args.wrapperClass=null] - optional class to be added to the `.form-group` wrapper.
@@ -261,6 +275,7 @@ export function buildCheckbox({
261
275
  export function buildTextarea({
262
276
  label,
263
277
  name,
278
+ id = null,
264
279
  value = null,
265
280
  wrapperClass = null,
266
281
  className = null,
@@ -271,7 +286,7 @@ export function buildTextarea({
271
286
  autosize = true
272
287
  }) {
273
288
 
274
- const id = randomId();
289
+ id = id || randomId();
275
290
 
276
291
  return buildFormGroup({
277
292
  condition,
@@ -1,223 +1,220 @@
1
- @layer components {
2
1
 
3
- /* frontend/src/web-components/s-datatable-component.module.css */
2
+ /* frontend/src/web-components/s-datatable-component.module.css */
4
3
 
5
- /* import delle custom properties gestito da jit-props */
4
+ /* import delle custom properties gestito da jit-props */
6
5
 
7
6
 
8
- /* purgecss start ignore */
7
+ /* purgecss start ignore */
9
8
 
10
- /* .datatable-wrapper.no-header .datatable-container {
11
- border-top: 1px solid #d9d9d9;
9
+ /* .datatable-wrapper.no-header .datatable-container {
10
+ border-top: 1px solid #d9d9d9;
12
11
  } */
13
- .datatableWrapper {
14
- margin-block: var(--size-md);
15
- }
12
+ .datatableWrapper {
13
+ margin-block: var(--size-md);
14
+ }
16
15
 
17
- .topArea {
18
- display: flex;
19
- flex-flow: row nowrap;
20
- gap: 2rem;
21
- align-items: center;
22
- justify-content: flex-end;
23
- padding-block-end: var(--size-xs);
16
+ .topArea {
17
+ display: flex;
18
+ flex-flow: row nowrap;
19
+ gap: 2rem;
20
+ align-items: center;
21
+ justify-content: flex-end;
22
+ padding-block-end: var(--size-xs);
24
23
 
25
- /* stylelint-disable-next-line selector-class-pattern */
26
- &:has(.info), &:has(:global(.datatable-top-slot)) {
27
- justify-content: space-between;
28
- }
24
+ /* stylelint-disable-next-line selector-class-pattern */
25
+ &:has(.info), &:has(:global(.datatable-top-slot)) {
26
+ justify-content: space-between;
29
27
  }
28
+ }
30
29
 
31
- .searchWrapper {
32
- max-width: 50%;
33
- }
30
+ .searchWrapper {
31
+ max-width: 50%;
32
+ }
34
33
 
35
- .table {
36
- margin-block: 0;
37
- border-block: var(--_border); /* definito in minimo table */
34
+ .table {
35
+ margin-block: 0;
36
+ border-block: var(--_border); /* definito in minimo table */
38
37
 
39
- thead {
40
- th:has(.sortBtn) {
41
- padding-inline-end: 0;
42
- }
38
+ thead {
39
+ th:has(.sortBtn) {
40
+ padding-inline-end: 0;
43
41
  }
44
-
45
42
  }
46
43
 
47
- /* cella unica per indicare l'assenza di record */
48
- .empty {
49
- /* stylelint-disable-next-line declaration-no-important */
50
- padding-block: var(--size-sm) !important;
51
- font-style: italic;
52
- color: var(--text-muted);
53
- /* stylelint-disable-next-line declaration-no-important */
54
- text-align: center !important;
55
- }
44
+ }
56
45
 
57
- .hasIcon {
58
- /* stylelint-disable-next-line declaration-no-important */
59
- text-align: center !important;
60
- svg {
61
- display: inline-block;
62
- width: 1.05em;
63
- }
64
- }
46
+ /* cella unica per indicare l'assenza di record */
47
+ .empty {
48
+ /* stylelint-disable-next-line declaration-no-important */
49
+ padding-block: var(--size-sm) !important;
50
+ font-style: italic;
51
+ color: var(--text-muted);
52
+ /* stylelint-disable-next-line declaration-no-important */
53
+ text-align: center !important;
54
+ }
65
55
 
56
+ .hasIcon {
57
+ /* stylelint-disable-next-line declaration-no-important */
58
+ text-align: center !important;
59
+ svg {
60
+ display: inline-block;
61
+ width: 1.05em;
62
+ }
63
+ }
66
64
 
67
- [data-sortable='true'] {
68
65
 
69
- @media (hover: hover) {
70
- &:hover {
71
- background-color: var(--sdt-thead-hover-background-color);
72
- }
73
- }
66
+ [data-sortable='true'] {
74
67
 
75
- .sortBtn {
76
- padding: 0 1.5em 0 0;
77
- &::after {
78
- position: absolute;
79
- top: 50%;
80
- right: .1em;
81
- display: block;
82
- width: 1em;
83
- height: 1em;
84
- translate: 0 -50%;
85
- }
68
+ @media (hover: hover) {
69
+ &:hover {
70
+ background-color: var(--sdt-thead-hover-background-color);
86
71
  }
72
+ }
87
73
 
88
- &:not(.sortAscending):not(.sortDescending){
89
- .sortBtn::after {
90
- content: url('../../icons/arrows-down-up.svg?cssInline');
91
- opacity: .4;
92
- }
74
+ .sortBtn {
75
+ padding: 0 1.5em 0 0;
76
+ &::after {
77
+ position: absolute;
78
+ top: 50%;
79
+ right: .1em;
80
+ display: block;
81
+ width: 1em;
82
+ height: 1em;
83
+ translate: 0 -50%;
93
84
  }
94
85
  }
95
- .sortAscending {
86
+
87
+ &:not(.sortAscending):not(.sortDescending){
96
88
  .sortBtn::after {
97
- content: url('../../icons/arrow-up.svg?cssInline');
89
+ content: url('../../icons/arrows-down-up.svg?cssInline');
90
+ opacity: .4;
98
91
  }
99
92
  }
100
- .sortDescending {
101
- .sortBtn::after {
102
- content: url('../../icons/arrow-down.svg?cssInline');
103
- }
93
+ }
94
+ .sortAscending {
95
+ .sortBtn::after {
96
+ content: url('../../icons/arrow-up.svg?cssInline');
97
+ }
98
+ }
99
+ .sortDescending {
100
+ .sortBtn::after {
101
+ content: url('../../icons/arrow-down.svg?cssInline');
104
102
  }
103
+ }
105
104
 
106
- .sortBtn {
107
- position: relative;
108
- display: block;
109
- width: 100%;
110
- height: 100%;
105
+ .sortBtn {
106
+ position: relative;
107
+ display: block;
108
+ width: 100%;
109
+ height: 100%;
111
110
 
112
- padding: var(--table-cell-padding-block) var(--table-cell-padding-inline);
113
- line-height: var(--table-cell-line-height);
111
+ padding: var(--table-cell-padding-block) var(--table-cell-padding-inline);
112
+ line-height: var(--table-cell-line-height);
114
113
 
115
- text-align: start;
116
- }
114
+ text-align: start;
115
+ }
117
116
 
118
- /* stylelint-disable selector-class-pattern */
119
- :global(.text-start), :global(.text-left) {
120
- .sortBtn {
121
- text-align: start;
122
- }
117
+ /* stylelint-disable selector-class-pattern */
118
+ :global(.text-start), :global(.text-left) {
119
+ .sortBtn {
120
+ text-align: start;
123
121
  }
124
- :global(.text-end), :global(.text-right) {
125
- .sortBtn {
126
- text-align: end;
127
- }
122
+ }
123
+ :global(.text-end), :global(.text-right) {
124
+ .sortBtn {
125
+ text-align: end;
128
126
  }
129
- :global(.text-center) {
130
- .sortBtn {
131
- text-align: center;
132
- }
127
+ }
128
+ :global(.text-center) {
129
+ .sortBtn {
130
+ text-align: center;
133
131
  }
134
- /* stylelint-enable selector-class-pattern */
135
-
136
- .bottomArea {
137
- display: flex;
138
- flex-flow: row wrap;
139
- gap: var(--size-md);
140
- align-content: center;
141
- align-items: center;
142
- justify-content: flex-end;
143
- margin-block-start: var(--size-xs);
144
- }
145
- .info {
146
- font-size: var(--font-size-sm);
147
- font-style: italic;
148
- color: var(--text-muted);
149
- }
150
-
151
- /* pagination */
152
- /* .paginationNav {} */
153
- .paginationList, .paginationListItem, .paginationListItemBtn {
154
- padding: 0;
155
- margin: 0;
156
- }
157
-
158
- .paginationList {
159
- display: flex;
160
- flex-flow: row wrap;
161
- gap: 0;
162
- align-items: stretch;
163
- justify-content: flex-start;
164
- list-style: none;
165
- }
166
- .paginationListItem {
167
- border: var(--sdt-pagination-border);
168
- border-style: solid solid solid none;
169
-
170
- &:first-child {
171
- border-inline-start-style: solid;
172
- border-radius: var(--radius-xxs) 0 0 var(--radius-xxs);
173
- }
174
- &:last-child {
175
- border-radius: 0 var(--radius-xxs) var(--radius-xxs) 0;
176
- }
132
+ }
133
+ /* stylelint-enable selector-class-pattern */
134
+
135
+ .bottomArea {
136
+ display: flex;
137
+ flex-flow: row wrap;
138
+ gap: var(--size-md);
139
+ align-content: center;
140
+ align-items: center;
141
+ justify-content: flex-end;
142
+ margin-block-start: var(--size-xs);
143
+ }
144
+ .info {
145
+ font-size: var(--font-size-sm);
146
+ font-style: italic;
147
+ color: var(--text-muted);
148
+ }
177
149
 
178
- @media (hover: hover) {
179
- &:hover {
180
- color: var(--sdt-hover-color);
181
- background-color: var(--sdt-hover-background-color);
182
- }
183
- }
150
+ /* pagination */
151
+ /* .paginationNav {} */
152
+ .paginationList, .paginationListItem, .paginationListItemBtn {
153
+ padding: 0;
154
+ margin: 0;
155
+ }
184
156
 
185
- }
157
+ .paginationList {
158
+ display: flex;
159
+ flex-flow: row wrap;
160
+ gap: 0;
161
+ align-items: stretch;
162
+ justify-content: flex-start;
163
+ list-style: none;
164
+ }
165
+ .paginationListItem {
166
+ border: var(--sdt-pagination-border);
167
+ border-style: solid solid solid none;
186
168
 
187
- .paginationDisabled {
188
- pointer-events: none;
169
+ &:first-child {
170
+ border-inline-start-style: solid;
171
+ border-radius: var(--radius-xxs) 0 0 var(--radius-xxs);
172
+ }
173
+ &:last-child {
174
+ border-radius: 0 var(--radius-xxs) var(--radius-xxs) 0;
175
+ }
189
176
 
190
- .paginationListItemBtn {
191
- opacity: .7;
177
+ @media (hover: hover) {
178
+ &:hover {
179
+ color: var(--sdt-hover-color);
180
+ background-color: var(--sdt-hover-background-color);
192
181
  }
193
182
  }
194
183
 
195
- .paginationActive {
196
- color: var(--sdt-hover-color);
197
- background-color: var(--sdt-hover-background-color);
198
- }
184
+ }
199
185
 
200
- .paginationListItemBtn {
201
- display: flex;
202
- align-items: center;
203
- justify-content: center;
204
- height: 100%;
205
- padding: var(--sdt-pagination-padding-block) var(--sdt-pagination-padding-inline);
206
- color: inherit;
207
- background-color: transparent;
208
- border: none;
209
-
210
- &.hasSvg {
211
- padding-inline: calc(var(--sdt-pagination-padding-inline) / 2);
212
- }
186
+ .paginationDisabled {
187
+ pointer-events: none;
213
188
 
214
- svg {
215
- width: 1em;
216
- aspect-ratio: 1;
217
- fill: currentColor;
218
- }
189
+ .paginationListItemBtn {
190
+ opacity: .7;
219
191
  }
192
+ }
193
+
194
+ .paginationActive {
195
+ color: var(--sdt-hover-color);
196
+ background-color: var(--sdt-hover-background-color);
197
+ }
220
198
 
221
- /* purgecss end ignore */
199
+ .paginationListItemBtn {
200
+ display: flex;
201
+ align-items: center;
202
+ justify-content: center;
203
+ height: 100%;
204
+ padding: var(--sdt-pagination-padding-block) var(--sdt-pagination-padding-inline);
205
+ color: inherit;
206
+ background-color: transparent;
207
+ border: none;
222
208
 
209
+ &.hasSvg {
210
+ padding-inline: calc(var(--sdt-pagination-padding-inline) / 2);
211
+ }
212
+
213
+ svg {
214
+ width: 1em;
215
+ aspect-ratio: 1;
216
+ fill: currentColor;
217
+ }
223
218
  }
219
+
220
+ /* purgecss end ignore */
@@ -1169,6 +1169,7 @@ export type MinimoClass =
1169
1169
  | 'pis-xxs-lap'
1170
1170
  | 'pis-xxs-mob'
1171
1171
  | 'pis-xxs-tab'
1172
+ | 'position-relative'
1172
1173
  | 'ps'
1173
1174
  | 'ps-0'
1174
1175
  | 'ps-0-dsk'