mensa 0.8.0 → 0.8.2
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.
- checksums.yaml +4 -4
- data/.shipkit.yml +1 -1
- data/Gemfile.lock +2 -2
- data/app/assets/tailwind/mensa/engine.css +6 -0
- data/app/components/mensa/add_filter/component.css +68 -70
- data/app/components/mensa/add_filter/component.html.erb +1 -1
- data/app/components/mensa/column_customizer/component.css +33 -32
- data/app/components/mensa/column_customizer/component_controller.js +1 -1
- data/app/components/mensa/control_bar/component.css +121 -125
- data/app/components/mensa/empty_state/component.css +13 -13
- data/app/components/mensa/filter_pill/component.css +26 -26
- data/app/components/mensa/filter_pill_list/component.css +35 -37
- data/app/components/mensa/filter_pill_list/component_controller.js +13 -6
- data/app/components/mensa/group_by/component.css +28 -32
- data/app/components/mensa/group_by/component_controller.js +3 -3
- data/app/components/mensa/group_header/component.css +21 -23
- data/app/components/mensa/group_header/component_controller.js +7 -2
- data/app/components/mensa/search/component.css +53 -55
- data/app/components/mensa/table/component.css +7 -7
- data/app/components/mensa/table/component.html.erb +1 -0
- data/app/components/mensa/table/component_controller.js +3 -2
- data/app/components/mensa/view/component.css +10 -10
- data/app/components/mensa/view/component.html.erb +1 -1
- data/app/components/mensa/view/paging.css +2 -2
- data/app/components/mensa/views/component.css +103 -105
- data/app/javascript/mensa/controllers/application_controller.js +6 -0
- data/app/tables/mensa/base.rb +16 -2
- data/lib/generators/mensa/tailwind_config_generator.rb +4 -0
- data/lib/mensa/version.rb +1 -1
- data/lib/tasks/mensa_tasks.rake +3 -1
- data/mensa.gemspec +1 -1
- metadata +11 -4
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
.mensa-filter-pill {
|
|
2
2
|
@apply inline-flex items-stretch text-xs rounded-md overflow-hidden;
|
|
3
|
+
}
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
.mensa-filter-pill__chip {
|
|
6
|
+
@apply flex items-center gap-1 pl-2 pr-1.5 py-0.5 bg-gray-100 dark:bg-gray-700 rounded-md cursor-pointer transition-all;
|
|
7
|
+
}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
.mensa-filter-pill:hover .mensa-filter-pill__chip,
|
|
10
|
+
.mensa-filter-pill:focus-within .mensa-filter-pill__chip {
|
|
11
|
+
@apply bg-gray-200 dark:bg-gray-600 rounded-r-none;
|
|
12
|
+
}
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
.mensa-filter-pill__column {
|
|
15
|
+
@apply text-gray-600 dark:text-gray-300;
|
|
16
|
+
}
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
.mensa-filter-pill__operator {
|
|
19
|
+
@apply rounded px-1 bg-violet-100 dark:bg-violet-900/40 text-violet-700 dark:text-violet-300;
|
|
20
|
+
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
.mensa-filter-pill__value {
|
|
23
|
+
@apply rounded pl-1 bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-400 font-medium;
|
|
24
|
+
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
.mensa-filter-pill__remove {
|
|
27
|
+
@apply inline-flex items-center justify-center w-0 px-0 text-gray-400 bg-gray-100 dark:bg-gray-700 cursor-pointer overflow-hidden opacity-0 -translate-x-1 pointer-events-none transition-all duration-200;
|
|
28
|
+
}
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
.mensa-filter-pill:hover .mensa-filter-pill__remove,
|
|
31
|
+
.mensa-filter-pill:focus-within .mensa-filter-pill__remove {
|
|
32
|
+
@apply w-7 px-1.5 opacity-100 translate-x-0 pointer-events-auto;
|
|
33
|
+
}
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
35
|
+
.mensa-filter-pill__remove:hover {
|
|
36
|
+
@apply text-gray-700 bg-gray-200 dark:bg-gray-600 dark:text-gray-200;
|
|
37
37
|
}
|
|
@@ -1,48 +1,46 @@
|
|
|
1
|
-
.mensa-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
&__pills-area {
|
|
6
|
-
@apply flex flex-1 flex-wrap items-center gap-1 min-w-0;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
&__input-wrapper {
|
|
10
|
-
@apply relative flex items-center flex-1 min-w-[4rem];
|
|
11
|
-
}
|
|
1
|
+
.mensa-table__search-bar {
|
|
2
|
+
@apply flex items-center gap-1.5 flex-1 min-w-0 h-full px-2;
|
|
3
|
+
}
|
|
12
4
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/* icon is after input in DOM but floats left via absolute positioning */
|
|
17
|
-
}
|
|
5
|
+
.mensa-table__search-bar__pills-area {
|
|
6
|
+
@apply flex flex-1 flex-wrap items-center gap-1 min-w-0;
|
|
7
|
+
}
|
|
18
8
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
background-color: transparent !important;
|
|
23
|
-
border: none !important;
|
|
24
|
-
outline: none !important;
|
|
25
|
-
box-shadow: none !important;
|
|
26
|
-
padding: 0 0.25rem 0 1.5rem;
|
|
9
|
+
.mensa-table__search-bar__input-wrapper {
|
|
10
|
+
@apply relative flex items-center flex-1 min-w-[4rem];
|
|
11
|
+
}
|
|
27
12
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
.mensa-table__search-bar__search-icon {
|
|
14
|
+
@apply absolute left-2 text-gray-400 pointer-events-none -ml-4;
|
|
15
|
+
font-size: 0.9rem;
|
|
16
|
+
/* icon is after input in DOM but floats left via absolute positioning */
|
|
17
|
+
}
|
|
33
18
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
.mensa-table__search-bar__input {
|
|
20
|
+
@apply w-full bg-transparent text-xs text-gray-700 dark:text-gray-200 placeholder:text-gray-400;
|
|
21
|
+
/* Override @tailwindcss/forms — direct CSS beats attribute selector specificity */
|
|
22
|
+
background-color: transparent !important;
|
|
23
|
+
border: none !important;
|
|
24
|
+
outline: none !important;
|
|
25
|
+
box-shadow: none !important;
|
|
26
|
+
padding: 0 0.25rem 0 1.5rem;
|
|
27
|
+
|
|
28
|
+
&:focus {
|
|
29
|
+
border: none !important;
|
|
30
|
+
outline: none !important;
|
|
31
|
+
box-shadow: none !important;
|
|
32
|
+
}
|
|
39
33
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
/* Hide the icon that follows when input has content (placeholder not shown) */
|
|
35
|
+
&:not(:placeholder-shown) ~ .mensa-table__search-bar__search-icon {
|
|
36
|
+
display: none;
|
|
43
37
|
}
|
|
44
38
|
}
|
|
45
39
|
|
|
40
|
+
.mensa-table__search-bar__clear {
|
|
41
|
+
@apply flex-none p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 cursor-pointer;
|
|
42
|
+
}
|
|
43
|
+
|
|
46
44
|
/* Hide placeholder when visible filter pills exist.
|
|
47
45
|
User-added pills (no data-view-filter) are always visible.
|
|
48
46
|
View-filter pills are only visible when the eye toggle is showing them. */
|
|
@@ -313,7 +313,14 @@ export default class FilterPillListComponentController extends ApplicationContro
|
|
|
313
313
|
Object.keys(order).length > 0 ||
|
|
314
314
|
columnOrder.length > 0;
|
|
315
315
|
|
|
316
|
-
|
|
316
|
+
// Pills rendered by the server (e.g. a view's default filters) must not win
|
|
317
|
+
// over filters the user changed or cleared.
|
|
318
|
+
const rendered = this.renderedFilters();
|
|
319
|
+
const filtersDiffer =
|
|
320
|
+
filtersProvided &&
|
|
321
|
+
JSON.stringify(rendered) !== JSON.stringify(filters);
|
|
322
|
+
const alreadyRendered =
|
|
323
|
+
Object.keys(rendered).length > 0 && !filtersDiffer;
|
|
317
324
|
|
|
318
325
|
if (!hasState || alreadyRendered || table.frameLoadHandled) {
|
|
319
326
|
if (typeof table.loadFrame === "function") {
|
|
@@ -480,8 +487,8 @@ export default class FilterPillListComponentController extends ApplicationContro
|
|
|
480
487
|
filter.value = isMultiple
|
|
481
488
|
? this.mensaAddFilterOutlet.selectedValues
|
|
482
489
|
: this.mensaAddFilterOutlet.hasValueTarget
|
|
483
|
-
|
|
484
|
-
|
|
490
|
+
? this.mensaAddFilterOutlet.valueTarget.value
|
|
491
|
+
: "";
|
|
485
492
|
}
|
|
486
493
|
filters[this.mensaAddFilterOutlet.selectedFilterColumn] = filter;
|
|
487
494
|
}
|
|
@@ -580,7 +587,7 @@ export default class FilterPillListComponentController extends ApplicationContro
|
|
|
580
587
|
this.updateSearchPlaceholder();
|
|
581
588
|
}
|
|
582
589
|
|
|
583
|
-
updateSearchPlaceholder() {}
|
|
590
|
+
updateSearchPlaceholder() { }
|
|
584
591
|
|
|
585
592
|
_supportsColumnFilters() {
|
|
586
593
|
return (
|
|
@@ -722,7 +729,7 @@ export default class FilterPillListComponentController extends ApplicationContro
|
|
|
722
729
|
} else {
|
|
723
730
|
window.localStorage.setItem(key, value);
|
|
724
731
|
}
|
|
725
|
-
} catch (e) {}
|
|
732
|
+
} catch (e) { }
|
|
726
733
|
}
|
|
727
734
|
|
|
728
735
|
readStorage(key) {
|
|
@@ -772,7 +779,7 @@ export default class FilterPillListComponentController extends ApplicationContro
|
|
|
772
779
|
|
|
773
780
|
// Tables built with different params keep separate browser state.
|
|
774
781
|
get storageName() {
|
|
775
|
-
return this.storageKeyValue || this.tableNameValue;
|
|
782
|
+
return this.tableStorageKey || this.storageKeyValue || this.tableNameValue;
|
|
776
783
|
}
|
|
777
784
|
|
|
778
785
|
get filtersStorageKey() {
|
|
@@ -1,44 +1,40 @@
|
|
|
1
|
-
.mensa-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
.mensa-table__control_bar__button[aria-pressed="true"] {
|
|
2
|
+
@apply text-primary-600 dark:text-primary-400;
|
|
3
|
+
}
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
5
|
+
.mensa-table__group_by__popover {
|
|
6
|
+
@apply fixed z-50 w-72 max-h-96 overflow-y-auto rounded-xl bg-white dark:bg-gray-800 shadow-lg ring-1 ring-black/5 py-2;
|
|
7
|
+
}
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
.mensa-table__group_by__heading {
|
|
10
|
+
@apply px-4 pt-2 pb-1 text-sm font-semibold tracking-wider text-gray-900 dark:text-gray-500;
|
|
11
|
+
}
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
.mensa-table__group_by__option {
|
|
14
|
+
@apply w-full flex items-center gap-3 px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer;
|
|
15
|
+
}
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
.mensa-table__group_by__check {
|
|
18
|
+
@apply w-3 flex-none text-xs text-gray-700 dark:text-gray-200;
|
|
19
|
+
}
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
.mensa-table__group_by__option:not([aria-checked="true"]) .mensa-table__group_by__check {
|
|
22
|
+
@apply invisible;
|
|
23
|
+
}
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
.mensa-table__group_by__aggregates {
|
|
26
|
+
@apply mt-1 border-t border-gray-100 dark:border-gray-700 pt-1;
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
&[aria-disabled="true"] {
|
|
29
|
+
@apply opacity-50 pointer-events-none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
.mensa-table__group_by__aggregate {
|
|
34
|
+
@apply block px-4 py-1.5;
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
}
|
|
36
|
+
label {
|
|
37
|
+
@apply mb-1 block truncate text-sm font-medium text-gray-900 dark:text-gray-100;
|
|
42
38
|
}
|
|
43
39
|
}
|
|
44
40
|
|
|
@@ -135,11 +135,11 @@ export default class GroupByController extends ApplicationController {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
get groupByStorageKey() {
|
|
138
|
-
return `mensa:group_by:${this.storageKeyValue}`;
|
|
138
|
+
return `mensa:group_by:${this.tableStorageKey || this.storageKeyValue}`;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
get aggregatesStorageKey() {
|
|
142
|
-
return `mensa:aggregates:${this.storageKeyValue}`;
|
|
142
|
+
return `mensa:aggregates:${this.tableStorageKey || this.storageKeyValue}`;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
_readJson(key) {
|
|
@@ -155,7 +155,7 @@ export default class GroupByController extends ApplicationController {
|
|
|
155
155
|
_writeStorage(key, value) {
|
|
156
156
|
try {
|
|
157
157
|
window.localStorage.setItem(key, value);
|
|
158
|
-
} catch (e) {}
|
|
158
|
+
} catch (e) { }
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
_readStorage(key) {
|
|
@@ -6,34 +6,32 @@
|
|
|
6
6
|
@apply pt-3 pb-2 text-gray-900 dark:text-gray-100;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
+
}
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
11
|
+
.mensa-table__group-header__title {
|
|
12
|
+
@apply flex items-center gap-2;
|
|
13
|
+
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
.mensa-table__group-header__toggle {
|
|
16
|
+
@apply inline-flex w-4 justify-center text-xs text-gray-500 dark:text-gray-400 transition-transform;
|
|
17
|
+
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
.mensa-table__group-header[aria-expanded="false"] .mensa-table__group-header__toggle {
|
|
20
|
+
@apply -rotate-90;
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
.mensa-table__group-header__value {
|
|
24
|
+
@apply font-semibold;
|
|
25
|
+
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
.mensa-table__group-header__count {
|
|
28
|
+
@apply rounded-full bg-gray-200 dark:bg-gray-700 px-2 py-0.5 text-xs font-medium text-gray-600 dark:text-gray-300;
|
|
29
|
+
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
.mensa-table__group-header__aggregate {
|
|
32
|
+
@apply text-sm font-medium text-gray-700 dark:text-gray-200;
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
}
|
|
35
|
+
.mensa-table__group-header__aggregate-label {
|
|
36
|
+
@apply mr-1 text-xs font-normal uppercase text-gray-400 dark:text-gray-500;
|
|
39
37
|
}
|
|
@@ -4,7 +4,12 @@ import ApplicationController from "mensa/controllers/application_controller";
|
|
|
4
4
|
// remembered per table and group column.
|
|
5
5
|
export default class GroupsController extends ApplicationController {
|
|
6
6
|
static targets = ["header", "row"];
|
|
7
|
-
static values = {
|
|
7
|
+
static values = { column: String };
|
|
8
|
+
|
|
9
|
+
// The frame is rendered by Mensa's own controller, so the page's key is read from the table element.
|
|
10
|
+
get storageKeyValue() {
|
|
11
|
+
return `mensa:collapsed_groups:${this.tableStorageKey}:${this.columnValue}`;
|
|
12
|
+
}
|
|
8
13
|
|
|
9
14
|
connect() {
|
|
10
15
|
super.connect();
|
|
@@ -58,6 +63,6 @@ export default class GroupsController extends ApplicationController {
|
|
|
58
63
|
} else {
|
|
59
64
|
window.localStorage.removeItem(this.storageKeyValue);
|
|
60
65
|
}
|
|
61
|
-
} catch (e) {}
|
|
66
|
+
} catch (e) { }
|
|
62
67
|
}
|
|
63
68
|
}
|
|
@@ -1,72 +1,70 @@
|
|
|
1
|
-
.mensa-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
.mensa-table__search {
|
|
2
|
+
@apply dark:bg-gray-800 dark:border-gray-800 border-b p-2;
|
|
3
|
+
}
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
.mensa-table__search__button {
|
|
6
|
+
@apply cursor-pointer w-6 h-full text-gray-400;
|
|
7
|
+
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
9
|
+
input.mensa-table__search__input {
|
|
10
|
+
@apply pl-2 h-6 w-full border-0 bg-transparent pr-4 text-gray-600 dark:text-gray-400 placeholder:text-gray-400 focus:ring-0 text-sm;
|
|
11
|
+
}
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
.mensa-table__save-view-dialog {
|
|
14
|
+
@apply w-[26rem] max-w-[90vw] rounded-2xl border-0 p-0 bg-white dark:bg-gray-800 shadow-2xl ring-1 ring-black/5 dark:ring-white/10 text-gray-900 dark:text-gray-100;
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
&::backdrop {
|
|
17
|
+
@apply bg-gray-900/40;
|
|
18
|
+
backdrop-filter: blur(2px);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
.mensa-table__save-view-dialog__form {
|
|
23
|
+
@apply flex flex-col gap-5 p-6;
|
|
24
|
+
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
.mensa-table__save-view-dialog__header {
|
|
27
|
+
@apply flex flex-col gap-1;
|
|
28
|
+
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
.mensa-table__save-view-dialog__title {
|
|
31
|
+
@apply text-lg font-semibold leading-6 text-gray-900 dark:text-gray-100;
|
|
32
|
+
}
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
.mensa-table__save-view-dialog__subtitle {
|
|
35
|
+
@apply text-sm text-gray-500 dark:text-gray-400;
|
|
36
|
+
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
.mensa-table__save-view-dialog__field {
|
|
39
|
+
@apply flex flex-col gap-1.5;
|
|
40
|
+
}
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
.mensa-table__save-view-dialog__label {
|
|
43
|
+
@apply text-sm font-medium text-gray-700 dark:text-gray-300;
|
|
44
|
+
}
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
input.mensa-table__save-view-dialog__input,
|
|
47
|
+
textarea.mensa-table__save-view-dialog__textarea {
|
|
48
|
+
@apply w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 shadow-sm placeholder:text-gray-400 focus:border-primary-500 focus:ring-2 focus:ring-primary-500 focus:outline-none;
|
|
49
|
+
border-radius: 0.5rem;
|
|
50
|
+
}
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
textarea.mensa-table__save-view-dialog__textarea {
|
|
53
|
+
@apply resize-y min-h-[5rem];
|
|
54
|
+
}
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
.mensa-table__save-view-dialog__actions {
|
|
57
|
+
@apply flex justify-end gap-2 pt-1;
|
|
58
|
+
}
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
.mensa-table__save-view-dialog__button {
|
|
61
|
+
@apply rounded-lg px-3.5 py-2 text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-gray-800 transition-colors;
|
|
62
|
+
}
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
.mensa-table__save-view-dialog__button--secondary {
|
|
65
|
+
@apply bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 ring-1 ring-inset ring-gray-300 dark:ring-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600 focus:ring-gray-400;
|
|
66
|
+
}
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
68
|
+
.mensa-table__save-view-dialog__button--primary {
|
|
69
|
+
@apply bg-primary-600 text-white hover:bg-primary-500 focus:ring-primary-500;
|
|
72
70
|
}
|
|
@@ -20,10 +20,6 @@
|
|
|
20
20
|
@apply w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 py-2 pl-3 pr-10 text-gray-900 dark:text-gray-100 shadow-sm focus:border-primary-500 focus:outline-none focus:ring-1 focus:ring-primary-500 sm:text-sm;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
&__toolbar {
|
|
24
|
-
@apply flex items-center gap-2 px-2 py-1 border-b border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
23
|
turbo-frame {
|
|
28
24
|
@apply relative block;
|
|
29
25
|
}
|
|
@@ -41,8 +37,12 @@
|
|
|
41
37
|
@apply absolute inset-0 z-10 bg-gray-50/30 dark:bg-gray-900/50;
|
|
42
38
|
pointer-events: all;
|
|
43
39
|
}
|
|
40
|
+
}
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
.mensa-table__toolbar {
|
|
43
|
+
@apply flex items-center gap-2 px-2 py-1 border-b border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.mensa-table__search-container {
|
|
47
|
+
@apply flex flex-1 min-w-0 items-stretch h-8 rounded-md bg-white dark:bg-gray-800;
|
|
48
48
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
data-mensa-table-views-url-value="<%= table.path_with_params(helpers.mensa.table_views_path(table.name)) %>"
|
|
7
7
|
data-mensa-table-exports-url-value="<%= table.path_with_params(helpers.mensa.table_exports_path(table.name)) %>"
|
|
8
8
|
data-controller="mensa-table"
|
|
9
|
+
data-mensa-table-storage-key-value="<%= table.storage_key %>"
|
|
9
10
|
data-action="click@document->mensa-table#saveDropdownOutsideHandler"
|
|
10
11
|
data-mensa-table-mensa-filter-pill-outlet="[data-controller='mensa-filter-pill']"
|
|
11
12
|
data-mensa-table-mensa-filter-pill-list-outlet="#mensa-filter-pill-list-<%= table.table_id %>"
|
|
@@ -27,6 +27,7 @@ export default class TableComponentController extends ApplicationController {
|
|
|
27
27
|
saveViewUrl: String,
|
|
28
28
|
viewsUrl: String,
|
|
29
29
|
exportsUrl: String,
|
|
30
|
+
storageKey: String,
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
connect() {
|
|
@@ -372,7 +373,7 @@ export default class TableComponentController extends ApplicationController {
|
|
|
372
373
|
let aggregates = {};
|
|
373
374
|
try {
|
|
374
375
|
aggregates = JSON.parse(element.dataset.aggregates || "{}");
|
|
375
|
-
} catch (e) {}
|
|
376
|
+
} catch (e) { }
|
|
376
377
|
this.groupState = {
|
|
377
378
|
group_by: element.dataset.groupBy || "",
|
|
378
379
|
aggregates,
|
|
@@ -505,7 +506,7 @@ export default class TableComponentController extends ApplicationController {
|
|
|
505
506
|
} else {
|
|
506
507
|
window.localStorage.removeItem(this._viewFiltersStorageKey());
|
|
507
508
|
}
|
|
508
|
-
} catch (e) {}
|
|
509
|
+
} catch (e) { }
|
|
509
510
|
}
|
|
510
511
|
|
|
511
512
|
// --- Export ---
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import "paging.css";
|
|
1
|
+
@import "./paging.css";
|
|
2
2
|
|
|
3
3
|
.mensa-batch-bar {
|
|
4
4
|
/* Sits on top of the thead row. Positioned relative to the .overflow-y-auto.relative
|
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
left: 0;
|
|
11
11
|
z-index: 10;
|
|
12
12
|
@apply pt-[7px] pb-2 bg-gray-100 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600;
|
|
13
|
+
}
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
.mensa-batch-bar__content {
|
|
16
|
+
@apply h-5 flex items-center gap-2 pl-2;
|
|
17
|
+
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
.mensa-batch-bar__count {
|
|
20
|
+
@apply text-xs font-medium text-gray-700 dark:text-gray-200 mr-1;
|
|
21
|
+
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
23
|
+
.mensa-batch-bar__button {
|
|
24
|
+
@apply inline-flex items-center gap-1 rounded px-3 py-1 text-xs font-medium text-gray-700 dark:text-gray-200 ring-1 ring-inset ring-gray-300 dark:ring-gray-500 bg-white dark:bg-gray-600 hover:bg-gray-50 dark:hover:bg-gray-500 focus:outline-none transition-colors cursor-pointer leading-none;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.mensa-table {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<table class="w-full"
|
|
22
22
|
<% if table.grouped? %>
|
|
23
23
|
data-controller="mensa-groups"
|
|
24
|
-
data-mensa-groups-
|
|
24
|
+
data-mensa-groups-column-value="<%= table.group_column.name %>"
|
|
25
25
|
<% end %>>
|
|
26
26
|
<% if table.show_header? %>
|
|
27
27
|
<thead>
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
|
|
25
25
|
&:not([href]) {
|
|
26
26
|
/* disabled links */
|
|
27
|
-
@apply bg-gray-100 dark:bg-gray-800 hover:bg-gray-100 hover:dark:bg-gray-800 text-gray-700 dark:text-gray-100
|
|
27
|
+
@apply bg-gray-100 dark:bg-gray-800 hover:bg-gray-100 hover:dark:bg-gray-800 text-gray-700/25 dark:text-gray-100/50 cursor-default;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
&[aria-current="page"] {
|
|
31
|
-
@apply z-10 bg-primary-200 dark:bg-primary-800 hover:bg-primary-200 hover:dark:bg-primary-800 text-gray-900 dark:text-white
|
|
31
|
+
@apply z-10 bg-primary-200 dark:bg-primary-800 hover:bg-primary-200 hover:dark:bg-primary-800 text-gray-900 dark:text-white border-none font-semibold;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|