ngx-edu-sharing-ui 0.7.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/.browserslistrc +16 -0
- package/.eslintrc.json +44 -0
- package/README.md +40 -0
- package/assets/scss/mixins.scss +95 -0
- package/assets/scss/variables.scss +33 -0
- package/karma.conf.js +42 -0
- package/ng-package.json +10 -0
- package/package.json +19 -0
- package/src/lib/actionbar/actionbar.component.html +59 -0
- package/src/lib/actionbar/actionbar.component.scss +123 -0
- package/src/lib/actionbar/actionbar.component.ts +174 -0
- package/src/lib/common/edu-sharing-ui-common.module.ts +80 -0
- package/src/lib/directives/border-box-observer.directive.ts +75 -0
- package/src/lib/directives/check-text-overflow.directive.ts +61 -0
- package/src/lib/directives/drag-nodes/drag-nodes.ts +32 -0
- package/src/lib/directives/drag-nodes/nodes-drag-source.directive.ts +79 -0
- package/src/lib/directives/drag-nodes/nodes-drag.directive.ts +43 -0
- package/src/lib/directives/drag-nodes/nodes-drop-target.directive.ts +116 -0
- package/src/lib/directives/focus-state.directive.ts +34 -0
- package/src/lib/directives/icon.directive.ts +142 -0
- package/src/lib/directives/nodes-drop-target-legacy.directive.ts +155 -0
- package/src/lib/dropdown/dropdown.component.html +32 -0
- package/src/lib/dropdown/dropdown.component.scss +67 -0
- package/src/lib/dropdown/dropdown.component.ts +71 -0
- package/src/lib/edu-sharing-ui-configuration.ts +47 -0
- package/src/lib/edu-sharing-ui.module.ts +49 -0
- package/src/lib/list-items/available-widgets.ts +30 -0
- package/src/lib/list-items/format-duration.pipe.ts +17 -0
- package/src/lib/list-items/list-base/list-base.component.html +52 -0
- package/src/lib/list-items/list-base/list-base.component.ts +44 -0
- package/src/lib/list-items/list-collection-info/list-collection-info.component.html +48 -0
- package/src/lib/list-items/list-collection-info/list-collection-info.component.scss +8 -0
- package/src/lib/list-items/list-collection-info/list-collection-info.component.ts +24 -0
- package/src/lib/list-items/list-counts/list-counts.component.html +1 -0
- package/src/lib/list-items/list-counts/list-counts.component.scss +3 -0
- package/src/lib/list-items/list-counts/list-counts.component.ts +59 -0
- package/src/lib/list-items/list-items.module.ts +33 -0
- package/src/lib/list-items/list-node-license/list-node-license.component.html +8 -0
- package/src/lib/list-items/list-node-license/list-node-license.component.ts +47 -0
- package/src/lib/list-items/list-node-replication-source/list-node-replication-source.component.html +11 -0
- package/src/lib/list-items/list-node-replication-source/list-node-replication-source.component.ts +60 -0
- package/src/lib/list-items/list-node-workflow/list-node-workflow.component.html +3 -0
- package/src/lib/list-items/list-node-workflow/list-node-workflow.component.ts +21 -0
- package/src/lib/list-items/list-text/list-text.component.html +176 -0
- package/src/lib/list-items/list-text/list-text.component.scss +3 -0
- package/src/lib/list-items/list-text/list-text.component.ts +107 -0
- package/src/lib/list-items/list-widget.ts +52 -0
- package/src/lib/list-items/node-row/node-row.component.html +31 -0
- package/src/lib/list-items/node-row/node-row.component.scss +50 -0
- package/src/lib/list-items/node-row/node-row.component.ts +16 -0
- package/src/lib/list-items/node-source.pipe.ts +48 -0
- package/src/lib/node-entries/combined-data-source.ts +51 -0
- package/src/lib/node-entries/custom-templates-data-source.ts +6 -0
- package/src/lib/node-entries/drag-preview/drag-preview.component.html +6 -0
- package/src/lib/node-entries/drag-preview/drag-preview.component.scss +35 -0
- package/src/lib/node-entries/drag-preview/drag-preview.component.ts +15 -0
- package/src/lib/node-entries/entries-model.ts +120 -0
- package/src/lib/node-entries/items-cap.ts +54 -0
- package/src/lib/node-entries/list-item-label.pipe.ts +28 -0
- package/src/lib/node-entries/mixins.scss +23 -0
- package/src/lib/node-entries/node-cache.spec.ts +199 -0
- package/src/lib/node-entries/node-cache.ts +81 -0
- package/src/lib/node-entries/node-data-source-remote.ts +33 -0
- package/src/lib/node-entries/node-data-source.ts +148 -0
- package/src/lib/node-entries/node-entries-card/node-entries-card.component.html +167 -0
- package/src/lib/node-entries/node-entries-card/node-entries-card.component.scss +28 -0
- package/src/lib/node-entries/node-entries-card/node-entries-card.component.ts +132 -0
- package/src/lib/node-entries/node-entries-card/node-entries-card.main.scss +261 -0
- package/src/lib/node-entries/node-entries-card-grid/node-entries-card-grid.component.html +205 -0
- package/src/lib/node-entries/node-entries-card-grid/node-entries-card-grid.component.scss +181 -0
- package/src/lib/node-entries/node-entries-card-grid/node-entries-card-grid.component.ts +361 -0
- package/src/lib/node-entries/node-entries-card-small/node-entries-card-small.component.html +100 -0
- package/src/lib/node-entries/node-entries-card-small/node-entries-card-small.component.scss +46 -0
- package/src/lib/node-entries/node-entries-card-small/node-entries-card-small.component.ts +40 -0
- package/src/lib/node-entries/node-entries-global-options/node-entries-global-options.component.html +23 -0
- package/src/lib/node-entries/node-entries-global-options/node-entries-global-options.component.scss +58 -0
- package/src/lib/node-entries/node-entries-global-options/node-entries-global-options.component.ts +16 -0
- package/src/lib/node-entries/node-entries-global.service.ts +79 -0
- package/src/lib/node-entries/node-entries-table/column-chooser/column-chooser.component.html +25 -0
- package/src/lib/node-entries/node-entries-table/column-chooser/column-chooser.component.scss +32 -0
- package/src/lib/node-entries/node-entries-table/column-chooser/column-chooser.component.ts +31 -0
- package/src/lib/node-entries/node-entries-table/node-entries-table.component.html +270 -0
- package/src/lib/node-entries/node-entries-table/node-entries-table.component.scss +169 -0
- package/src/lib/node-entries/node-entries-table/node-entries-table.component.ts +333 -0
- package/src/lib/node-entries/node-entries-templates.service.ts +31 -0
- package/src/lib/node-entries/node-entries-wrapper.component.ts +363 -0
- package/src/lib/node-entries/node-entries.component.html +33 -0
- package/src/lib/node-entries/node-entries.component.scss +13 -0
- package/src/lib/node-entries/node-entries.component.ts +151 -0
- package/src/lib/node-entries/node-entries.module.ts +93 -0
- package/src/lib/node-entries/node-rating/node-rating.component.html +53 -0
- package/src/lib/node-entries/node-rating/node-rating.component.scss +31 -0
- package/src/lib/node-entries/node-rating/node-rating.component.ts +105 -0
- package/src/lib/node-entries/node-stats-badges/node-stats-badges.component.html +39 -0
- package/src/lib/node-entries/node-stats-badges/node-stats-badges.component.scss +44 -0
- package/src/lib/node-entries/node-stats-badges/node-stats-badges.component.ts +43 -0
- package/src/lib/node-entries/node-type-badge/node-type-badge.component.html +31 -0
- package/src/lib/node-entries/node-type-badge/node-type-badge.component.scss +5 -0
- package/src/lib/node-entries/node-type-badge/node-type-badge.component.ts +36 -0
- package/src/lib/node-entries/option-button/option-button.component.ts +42 -0
- package/src/lib/node-entries/preview-image/preview-image.component.html +19 -0
- package/src/lib/node-entries/preview-image/preview-image.component.scss +31 -0
- package/src/lib/node-entries/preview-image/preview-image.component.ts +47 -0
- package/src/lib/node-entries/sort-select-panel/sort-select-panel.component.html +27 -0
- package/src/lib/node-entries/sort-select-panel/sort-select-panel.component.scss +9 -0
- package/src/lib/node-entries/sort-select-panel/sort-select-panel.component.ts +26 -0
- package/src/lib/node-url/node-url.component.html +66 -0
- package/src/lib/node-url/node-url.component.scss +32 -0
- package/src/lib/node-url/node-url.component.ts +136 -0
- package/src/lib/pipes/file-size.pipe.ts +24 -0
- package/src/lib/pipes/format-date.pipe.ts +39 -0
- package/src/lib/pipes/node-icon.pipe.ts +11 -0
- package/src/lib/pipes/node-image-size.pipe.ts +18 -0
- package/src/lib/pipes/node-image.pipe.ts +71 -0
- package/src/lib/pipes/node-person-name.pipe.ts +41 -0
- package/src/lib/pipes/node-title.pipe.ts +12 -0
- package/src/lib/pipes/option-tooltip.pipe.ts +32 -0
- package/src/lib/pipes/replace-chars.pipe.ts +21 -0
- package/src/lib/pipes/vcard-name.pipe.ts +11 -0
- package/src/lib/services/abstract/app.service.ts +4 -0
- package/src/lib/services/abstract/keyboard-shortcuts.service.ts +10 -0
- package/src/lib/services/abstract/options-helper.service.ts +29 -0
- package/src/lib/services/abstract/toast.service.ts +5 -0
- package/src/lib/services/accessibility.service.ts +101 -0
- package/src/lib/services/local-events.service.ts +29 -0
- package/src/lib/services/node-entries.service.ts +172 -0
- package/src/lib/services/node-helper.service.ts +239 -0
- package/src/lib/services/nodes-drag-drop.service.ts +165 -0
- package/src/lib/services/options-helper-data.service.ts +186 -0
- package/src/lib/services/repo-url.service.ts +46 -0
- package/src/lib/services/temporary-storage.service.ts +58 -0
- package/src/lib/services/ui.service.ts +182 -0
- package/src/lib/sort-dropdown/sort-dropdown.component.html +22 -0
- package/src/lib/sort-dropdown/sort-dropdown.component.scss +47 -0
- package/src/lib/sort-dropdown/sort-dropdown.component.ts +42 -0
- package/src/lib/spinner/spinner.component.html +14 -0
- package/src/lib/spinner/spinner.component.scss +141 -0
- package/src/lib/spinner/spinner.component.ts +12 -0
- package/src/lib/translations/README.md +44 -0
- package/src/lib/translations/fallback-translation-handler.ts +7 -0
- package/src/lib/translations/languages.ts +6 -0
- package/src/lib/translations/translation-loader.spec.ts +352 -0
- package/src/lib/translations/translation-loader.ts +189 -0
- package/src/lib/translations/translation-source.ts +9 -0
- package/src/lib/translations/translations.module.ts +49 -0
- package/src/lib/translations/translations.service.spec.ts +152 -0
- package/src/lib/translations/translations.service.ts +188 -0
- package/src/lib/types/accessibillity.ts +15 -0
- package/src/lib/types/api-models.ts +4 -0
- package/src/lib/types/drag-drop.ts +22 -0
- package/src/lib/types/keyboard-shortcuts.ts +29 -0
- package/src/lib/types/list-item.ts +67 -0
- package/src/lib/types/option-item.ts +247 -0
- package/src/lib/types/workflow.ts +35 -0
- package/src/lib/util/DateHelper.spec.ts +112 -0
- package/src/lib/util/DateHelper.ts +197 -0
- package/src/lib/util/VCard.ts +277 -0
- package/src/lib/util/color-helper.ts +125 -0
- package/src/lib/util/duration-helper.spec.ts +35 -0
- package/src/lib/util/duration-helper.ts +98 -0
- package/src/lib/util/functions.ts +15 -0
- package/src/lib/util/helper.ts +60 -0
- package/src/lib/util/isNumeric.ts +13 -0
- package/src/lib/util/rest-helper.ts +28 -0
- package/src/lib/util/ui-animation.ts +154 -0
- package/src/lib/util/ui-constants.ts +20 -0
- package/src/module.ts +76 -0
- package/src/test.ts +28 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
@import '../../../../assets/scss/mixins';
|
|
2
|
+
@import '../mixins';
|
|
3
|
+
|
|
4
|
+
$optionBarHeight: 50px;
|
|
5
|
+
|
|
6
|
+
.grid-card {
|
|
7
|
+
transition: all var(--transitionNormal);
|
|
8
|
+
// to prevent click animation to float across the whole screen
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
background-color: #fff;
|
|
11
|
+
@include materialShadowBottom();
|
|
12
|
+
display: grid;
|
|
13
|
+
height: 100%;
|
|
14
|
+
grid-template-columns: auto;
|
|
15
|
+
@include contrastMode {
|
|
16
|
+
border: 1px solid rgba(black, 0.42);
|
|
17
|
+
}
|
|
18
|
+
&.selected {
|
|
19
|
+
background-color: rgb(var(--palette-primary-50));
|
|
20
|
+
}
|
|
21
|
+
.dropdown-dummy {
|
|
22
|
+
position: fixed;
|
|
23
|
+
}
|
|
24
|
+
.card-options {
|
|
25
|
+
display: grid;
|
|
26
|
+
grid-template-columns: 1fr auto;
|
|
27
|
+
grid-column-gap: 10px;
|
|
28
|
+
.card-rating-area {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
height: 100%;
|
|
32
|
+
}
|
|
33
|
+
.card-options-area {
|
|
34
|
+
display: flex;
|
|
35
|
+
.card-options-spacer {
|
|
36
|
+
// margin: 0 5px;
|
|
37
|
+
// border-left: 1px solid #ccc;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
es-option-button,
|
|
41
|
+
button {
|
|
42
|
+
transition: all var(--transitionNormal);
|
|
43
|
+
margin: 0 2px;
|
|
44
|
+
border-radius: 50%;
|
|
45
|
+
|
|
46
|
+
&:hover,
|
|
47
|
+
&:focus {
|
|
48
|
+
background-color: #fff;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
&:not(.grid-card-collection) {
|
|
54
|
+
.card-top-bar {
|
|
55
|
+
background-color: rgb(var(--palette-primary-200));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
&.grid-card-virtual {
|
|
59
|
+
outline: 2px dashed var(--nodeVirtualColor);
|
|
60
|
+
}
|
|
61
|
+
.card-top-bar {
|
|
62
|
+
height: $topBarHeight;
|
|
63
|
+
display: flex;
|
|
64
|
+
gap: 15px;
|
|
65
|
+
|
|
66
|
+
align-items: center;
|
|
67
|
+
padding: 0 $entriesCardPaddingHorizontal;
|
|
68
|
+
position: relative;
|
|
69
|
+
.card-top-bar-collection-color {
|
|
70
|
+
position: absolute;
|
|
71
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
72
|
+
left: 0;
|
|
73
|
+
top: 0;
|
|
74
|
+
right: 0;
|
|
75
|
+
bottom: 0;
|
|
76
|
+
}
|
|
77
|
+
.card-top-bar-flag {
|
|
78
|
+
@include card-top-bar-badge;
|
|
79
|
+
}
|
|
80
|
+
.card-top-bar-checkbox {
|
|
81
|
+
mat-checkbox {
|
|
82
|
+
margin-right: -5px;
|
|
83
|
+
position: relative;
|
|
84
|
+
top: -1.3px;
|
|
85
|
+
&.cdk-keyboard-focused ::ng-deep .mat-focus-indicator {
|
|
86
|
+
@include removeDefaultFocus();
|
|
87
|
+
&::after {
|
|
88
|
+
content: '';
|
|
89
|
+
position: absolute;
|
|
90
|
+
left: 2px;
|
|
91
|
+
right: 2px;
|
|
92
|
+
top: 2px;
|
|
93
|
+
bottom: 2px;
|
|
94
|
+
@include setGlobalKeyboardFocus('border');
|
|
95
|
+
border-color: white;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
.card-top-bar-empty {
|
|
101
|
+
width: 0;
|
|
102
|
+
flex-grow: 1;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
.card-image-area {
|
|
106
|
+
height: $imageHeight;
|
|
107
|
+
padding: 0;
|
|
108
|
+
display: flex;
|
|
109
|
+
es-preview-image {
|
|
110
|
+
flex-grow: 1;
|
|
111
|
+
}
|
|
112
|
+
.card-collection-image {
|
|
113
|
+
display: flex;
|
|
114
|
+
width: 100%;
|
|
115
|
+
height: 100%;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
i {
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: center;
|
|
122
|
+
user-select: none;
|
|
123
|
+
color: rgba(0, 0, 0, 0.75);
|
|
124
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
125
|
+
padding: $collectionIconPadding;
|
|
126
|
+
font-size: $collectionIconSize;
|
|
127
|
+
border-radius: 50%;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
.card-meta {
|
|
132
|
+
padding: $entriesCardPaddingVertical $entriesCardPaddingHorizontal 0
|
|
133
|
+
$entriesCardPaddingHorizontal;
|
|
134
|
+
display: grid;
|
|
135
|
+
flex-direction: row;
|
|
136
|
+
.card-meta-row {
|
|
137
|
+
display: flex;
|
|
138
|
+
flex-direction: row;
|
|
139
|
+
align-items: center;
|
|
140
|
+
min-height: 2.5em;
|
|
141
|
+
gap: 5px;
|
|
142
|
+
&:not(:first-child) {
|
|
143
|
+
> label {
|
|
144
|
+
cursor: inherit;
|
|
145
|
+
color: var(--textLight);
|
|
146
|
+
font-size: 85%;
|
|
147
|
+
}
|
|
148
|
+
> es-list-base {
|
|
149
|
+
color: #000;
|
|
150
|
+
flex-grow: 1;
|
|
151
|
+
margin: 5px 0;
|
|
152
|
+
display: flex;
|
|
153
|
+
justify-content: flex-end;
|
|
154
|
+
text-align: end;
|
|
155
|
+
word-break: break-word;
|
|
156
|
+
// height: 1em;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
&:first-child {
|
|
160
|
+
> es-list-base,
|
|
161
|
+
> es-node-url {
|
|
162
|
+
width: 100%;
|
|
163
|
+
color: var(--textMain);
|
|
164
|
+
font-size: 120%;
|
|
165
|
+
height: 1.25 * 2em;
|
|
166
|
+
text-align: left;
|
|
167
|
+
word-break: break-word;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
&.dynamic-single-click:hover {
|
|
173
|
+
@include materialShadowMediumLarge(false, 0.2);
|
|
174
|
+
background-color: rgb(var(--palette-primary-50));
|
|
175
|
+
// transform: scale(1.0075);
|
|
176
|
+
}
|
|
177
|
+
&.dynamic-single-click.grid-card-collection:hover .card-meta {
|
|
178
|
+
background-color: rgba(255, 255, 255, 0.9);
|
|
179
|
+
}
|
|
180
|
+
&.grid-card-collection {
|
|
181
|
+
.card-meta {
|
|
182
|
+
background-color: rgba(255, 255, 255, 0.8);
|
|
183
|
+
}
|
|
184
|
+
.card-options {
|
|
185
|
+
background-color: rgba(255, 255, 255, 0.9);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
.card-options {
|
|
189
|
+
border-top: 1px solid #ddd;
|
|
190
|
+
// margin-top: 2px; white artefact on hover
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
:host ::ng-deep {
|
|
194
|
+
.grid-card {
|
|
195
|
+
.card-meta-row {
|
|
196
|
+
&:first-child {
|
|
197
|
+
es-list-base,
|
|
198
|
+
es-node-url a es-list-base {
|
|
199
|
+
@include limitLineCount(2, 1.25);
|
|
200
|
+
> es-list-text {
|
|
201
|
+
word-break: break-word;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
es-node-url {
|
|
206
|
+
a {
|
|
207
|
+
color: var(--textMain);
|
|
208
|
+
&.cdk-keyboard-focused {
|
|
209
|
+
display: inline-flex;
|
|
210
|
+
@include setGlobalKeyboardFocus('outline');
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
.card-meta {
|
|
217
|
+
es-list-base {
|
|
218
|
+
img {
|
|
219
|
+
max-width: 100px;
|
|
220
|
+
max-height: 20px;
|
|
221
|
+
}
|
|
222
|
+
es-list-node-license {
|
|
223
|
+
img {
|
|
224
|
+
height: 20px;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
es-list-collection-info {
|
|
228
|
+
display: flex;
|
|
229
|
+
align-items: center;
|
|
230
|
+
// justify-content: flex-end;
|
|
231
|
+
i {
|
|
232
|
+
font-size: 12pt;
|
|
233
|
+
margin: 0 6px;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
.grid-card-collection es-node-url {
|
|
239
|
+
a.cdk-keyboard-focused .card-meta {
|
|
240
|
+
// @TDOO: better focus visibility is required
|
|
241
|
+
background-color: #fff;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
custom overlay provided via template
|
|
247
|
+
*/
|
|
248
|
+
.card-overlay {
|
|
249
|
+
position: absolute;
|
|
250
|
+
z-index: 2;
|
|
251
|
+
left: 0;
|
|
252
|
+
right: 0;
|
|
253
|
+
top: 0;
|
|
254
|
+
bottom: 0;
|
|
255
|
+
// Pass pointer events through to the underlying card when the overlay template is empty...
|
|
256
|
+
pointer-events: none;
|
|
257
|
+
// ...but re-enable pointer-event handling for the overlay's content (if any).
|
|
258
|
+
& ::ng-deep > * {
|
|
259
|
+
pointer-events: auto;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<ng-template #gridTop>
|
|
2
|
+
<es-sort-select-panel
|
|
3
|
+
*ngIf="entriesService.sort?.allowed"
|
|
4
|
+
class="order-panel"
|
|
5
|
+
[active]="entriesService.sort.active"
|
|
6
|
+
[direction]="entriesService.sort.direction"
|
|
7
|
+
[columns]="getSortColumns()"
|
|
8
|
+
(sortChange)="onSortChange($event)"
|
|
9
|
+
[(customSortingInProgress)]="entriesService.sort.customSortingInProgress"
|
|
10
|
+
(customSortingInProgressChange)="onCustomSortingInProgressChange()"
|
|
11
|
+
></es-sort-select-panel>
|
|
12
|
+
</ng-template>
|
|
13
|
+
|
|
14
|
+
<es-dropdown #dropdown [options]="entriesService.options?.[Target.ListDropdown]"></es-dropdown>
|
|
15
|
+
|
|
16
|
+
<!-- Do not render the list element (`role="list"` or `li`) when there are no list items. -->
|
|
17
|
+
<ng-container *ngIf="(nodes$ | async)?.length > 0 || entriesService.globalOptions?.length > 0">
|
|
18
|
+
<!-- FIXME: Ideally, we would use native `ul` and `li` elements, but these have a strict model,
|
|
19
|
+
that only allows `li` elements as direct children of `ul` elements. So we would need to use the
|
|
20
|
+
native elements at all places without any elements between `ul` and `li`. -->
|
|
21
|
+
<div
|
|
22
|
+
*ngIf="entriesService.sort?.customSortingInProgress"
|
|
23
|
+
role="list"
|
|
24
|
+
class="card-grid card-grid-reorder"
|
|
25
|
+
cdkDropListGroup
|
|
26
|
+
>
|
|
27
|
+
<ng-container *ngIf="nodes$ | async as nodes">
|
|
28
|
+
<div
|
|
29
|
+
class="card-grid-order-wrapper"
|
|
30
|
+
*ngFor="let node of nodes; let i = index"
|
|
31
|
+
role="none"
|
|
32
|
+
cdkDropList
|
|
33
|
+
[cdkDropListConnectedTo]="dropLists"
|
|
34
|
+
[cdkDropListData]="i"
|
|
35
|
+
>
|
|
36
|
+
<es-node-entries-card
|
|
37
|
+
*ngIf="displayType === NodeEntriesDisplayType.Grid"
|
|
38
|
+
#item
|
|
39
|
+
[node]="node"
|
|
40
|
+
role="listitem"
|
|
41
|
+
cdkDrag
|
|
42
|
+
[cdkDragData]="i"
|
|
43
|
+
[cdkDragStartDelay]="getDragStartDelay()"
|
|
44
|
+
cdkDragPreviewClass="es-card-grid-rearrange-drag-preview"
|
|
45
|
+
(cdkDragEntered)="onRearrangeDragEntered($event)"
|
|
46
|
+
(cdkDragStarted)="onRearrangeDragStarted()"
|
|
47
|
+
(cdkDragEnded)="onRearrangeDragEnded()"
|
|
48
|
+
></es-node-entries-card>
|
|
49
|
+
<es-node-entries-card-small
|
|
50
|
+
*ngIf="displayType === NodeEntriesDisplayType.SmallGrid"
|
|
51
|
+
#item
|
|
52
|
+
[node]="node"
|
|
53
|
+
role="listitem"
|
|
54
|
+
cdkDrag
|
|
55
|
+
[cdkDragData]="i"
|
|
56
|
+
[cdkDragStartDelay]="getDragStartDelay()"
|
|
57
|
+
cdkDragPreviewClass="es-card-grid-rearrange-drag-preview"
|
|
58
|
+
(cdkDragEntered)="onRearrangeDragEntered($event)"
|
|
59
|
+
(cdkDragStarted)="onRearrangeDragStarted()"
|
|
60
|
+
(cdkDragEnded)="onRearrangeDragEnded()"
|
|
61
|
+
></es-node-entries-card-small>
|
|
62
|
+
</div>
|
|
63
|
+
</ng-container>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="card-grid-wrapper" *ngIf="!entriesService.sort?.customSortingInProgress">
|
|
66
|
+
<ng-container *ngTemplateOutlet="scrollHelper"></ng-container>
|
|
67
|
+
<div
|
|
68
|
+
role="list"
|
|
69
|
+
class="card-grid card-grid-layout-{{ layout }}"
|
|
70
|
+
#grid
|
|
71
|
+
(esBorderBoxObserver)="onGridSizeChanges()"
|
|
72
|
+
esInfiniteScroll
|
|
73
|
+
(scroll)="updateScrollState()"
|
|
74
|
+
(scrolled)="!visibleItemsLimited && loadData('scroll')"
|
|
75
|
+
>
|
|
76
|
+
<es-node-entries-global-options
|
|
77
|
+
*ngIf="entriesService.globalOptions?.length"
|
|
78
|
+
[displayType]="displayType"
|
|
79
|
+
>
|
|
80
|
+
</es-node-entries-global-options>
|
|
81
|
+
<ng-container *ngIf="nodes$ | async as nodes">
|
|
82
|
+
<div
|
|
83
|
+
class="card-grid-drag-wrapper"
|
|
84
|
+
*ngFor="let node of nodes; let i = index"
|
|
85
|
+
role="none"
|
|
86
|
+
[esNodesDropTarget]="node"
|
|
87
|
+
[canDropNodes]="canDropNodes"
|
|
88
|
+
(nodeDropped)="onNodesDropped($event)"
|
|
89
|
+
#dropTarget="esNodesDropTarget"
|
|
90
|
+
>
|
|
91
|
+
<ng-container *ngIf="isCustomTemplate()">
|
|
92
|
+
<ng-container *ngTemplateOutlet="$any(node)"></ng-container>
|
|
93
|
+
</ng-container>
|
|
94
|
+
<ng-container *ngIf="!isCustomTemplate()">
|
|
95
|
+
<es-node-entries-card
|
|
96
|
+
*ngIf="displayType === NodeEntriesDisplayType.Grid"
|
|
97
|
+
#item
|
|
98
|
+
[node]="node"
|
|
99
|
+
[dropdown]="dropdown"
|
|
100
|
+
role="listitem"
|
|
101
|
+
cdkDrag
|
|
102
|
+
[cdkDragDisabled]="!getDragEnabled()"
|
|
103
|
+
[cdkDragData]="getDragData(node)"
|
|
104
|
+
esNodesDrag
|
|
105
|
+
(cdkDragStarted)="onDragStarted(node)"
|
|
106
|
+
(cdkDragEnded)="onDragEnded()"
|
|
107
|
+
[class.selected-when-dragging]="
|
|
108
|
+
isDragging && entriesService.selection.isSelected(node)
|
|
109
|
+
"
|
|
110
|
+
>
|
|
111
|
+
<ng-container *ngIf="entriesService.selection.selected.length > 1">
|
|
112
|
+
<es-node-entries-card
|
|
113
|
+
*cdkDragPreview
|
|
114
|
+
[node]="node"
|
|
115
|
+
[matBadge]="
|
|
116
|
+
entriesService.selection.selected.length > 1
|
|
117
|
+
? entriesService.selection.selected.length
|
|
118
|
+
: null
|
|
119
|
+
"
|
|
120
|
+
class="card-drag-preview"
|
|
121
|
+
></es-node-entries-card>
|
|
122
|
+
</ng-container>
|
|
123
|
+
</es-node-entries-card>
|
|
124
|
+
<es-node-entries-card-small
|
|
125
|
+
*ngIf="displayType === NodeEntriesDisplayType.SmallGrid"
|
|
126
|
+
#item
|
|
127
|
+
[node]="node"
|
|
128
|
+
role="listitem"
|
|
129
|
+
cdkDrag
|
|
130
|
+
[cdkDragDisabled]="!getDragEnabled()"
|
|
131
|
+
[cdkDragData]="[node]"
|
|
132
|
+
esNodesDrag
|
|
133
|
+
>
|
|
134
|
+
</es-node-entries-card-small>
|
|
135
|
+
</ng-container>
|
|
136
|
+
<div
|
|
137
|
+
*ngIf="dropTarget.active?.canDrop?.denyExplicit"
|
|
138
|
+
class="card-grid-drop-blocked-container"
|
|
139
|
+
>
|
|
140
|
+
<i esIcon="cancel"></i>
|
|
141
|
+
</div>
|
|
142
|
+
<div *ngIf="dropTarget.active?.canDrop?.accept" class="card-grid-drop-allowed-container">
|
|
143
|
+
<i
|
|
144
|
+
[esIcon]="dropTarget.active.action === 'copy' ? 'add_circle_outline' : 'archive'"
|
|
145
|
+
></i>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</ng-container>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</ng-container>
|
|
152
|
+
<ng-container
|
|
153
|
+
*ngIf="
|
|
154
|
+
!entriesService.dataSource.isLoading &&
|
|
155
|
+
entriesService.dataSource.hasMore() &&
|
|
156
|
+
!visibleItemsLimited &&
|
|
157
|
+
entriesService.paginationStrategy === 'infinite-scroll' &&
|
|
158
|
+
layout !== 'scroll'
|
|
159
|
+
"
|
|
160
|
+
>
|
|
161
|
+
<div class="load-more">
|
|
162
|
+
<button mat-button color="primary" (click)="loadData('button')">
|
|
163
|
+
<i esIcon="refresh"></i>
|
|
164
|
+
<span>{{ 'LOAD_MORE' | translate }}</span>
|
|
165
|
+
</button>
|
|
166
|
+
</div>
|
|
167
|
+
</ng-container>
|
|
168
|
+
<ng-container
|
|
169
|
+
*ngIf="
|
|
170
|
+
entriesService.dataSource.isLoading === true ||
|
|
171
|
+
entriesService.dataSource.isLoading === 'initial' ||
|
|
172
|
+
(entriesService.dataSource.isLoading === 'page' &&
|
|
173
|
+
entriesService.paginationStrategy === 'infinite-scroll')
|
|
174
|
+
"
|
|
175
|
+
>
|
|
176
|
+
<ng-container *ngTemplateOutlet="loading"></ng-container>
|
|
177
|
+
</ng-container>
|
|
178
|
+
|
|
179
|
+
<ng-template #loading>
|
|
180
|
+
<es-spinner></es-spinner>
|
|
181
|
+
</ng-template>
|
|
182
|
+
<ng-template #scrollHelper>
|
|
183
|
+
<ng-container *ngIf="layout === 'scroll'">
|
|
184
|
+
<div
|
|
185
|
+
class="scroll-helper-left"
|
|
186
|
+
role="presentation"
|
|
187
|
+
(click)="doScroll('left')"
|
|
188
|
+
*ngIf="scroll.left"
|
|
189
|
+
>
|
|
190
|
+
<button mat-icon-button color="primary" (click)="$event.stopPropagation(); doScroll('left')">
|
|
191
|
+
<i esIcon="keyboard_arrow_left" [aria]="true"></i>
|
|
192
|
+
</button>
|
|
193
|
+
</div>
|
|
194
|
+
<div
|
|
195
|
+
class="scroll-helper-right"
|
|
196
|
+
role="presentation"
|
|
197
|
+
(click)="doScroll('right')"
|
|
198
|
+
*ngIf="scroll.right"
|
|
199
|
+
>
|
|
200
|
+
<button mat-icon-button color="primary" (click)="$event.stopPropagation(); doScroll('right')">
|
|
201
|
+
<i esIcon="keyboard_arrow_right" [aria]="true"></i>
|
|
202
|
+
</button>
|
|
203
|
+
</div>
|
|
204
|
+
</ng-container>
|
|
205
|
+
</ng-template>
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
@import '../../../../assets/scss/mixins';
|
|
3
|
+
|
|
4
|
+
$horizontalScrollPadding: 1.5em;
|
|
5
|
+
|
|
6
|
+
@keyframes OrderAnimationCards {
|
|
7
|
+
0% {
|
|
8
|
+
transform: rotate(-0.25deg);
|
|
9
|
+
}
|
|
10
|
+
50% {
|
|
11
|
+
transform: rotate(0.25deg);
|
|
12
|
+
}
|
|
13
|
+
100% {
|
|
14
|
+
transform: rotate(-0.25deg);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.order-panel {
|
|
19
|
+
margin-left: auto;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.load-more {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
}
|
|
26
|
+
.card-grid-wrapper {
|
|
27
|
+
position: relative;
|
|
28
|
+
z-index: 0;
|
|
29
|
+
.scroll-helper-left,
|
|
30
|
+
.scroll-helper-right {
|
|
31
|
+
position: absolute;
|
|
32
|
+
width: 15%;
|
|
33
|
+
min-width: 60px;
|
|
34
|
+
max-width: calc(var(--cardWidth) * 0.4);
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
// do not overlay scrollbar
|
|
38
|
+
height: calc(100% - 10px);
|
|
39
|
+
z-index: 5;
|
|
40
|
+
@include clickable();
|
|
41
|
+
> button {
|
|
42
|
+
background-color: #fff;
|
|
43
|
+
color: var(--primary);
|
|
44
|
+
@include materialShadowMediumLarge(false, 0.25);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
.scroll-helper-left {
|
|
48
|
+
left: -$horizontalScrollPadding;
|
|
49
|
+
justify-content: flex-start;
|
|
50
|
+
background: linear-gradient(
|
|
51
|
+
to left,
|
|
52
|
+
rgba(255, 255, 255, 0.000001) 0,
|
|
53
|
+
rgb(255, 255, 255) calc(100% - $horizontalScrollPadding)
|
|
54
|
+
);
|
|
55
|
+
> button {
|
|
56
|
+
margin-left: calc($horizontalScrollPadding - 8px);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
.scroll-helper-right {
|
|
60
|
+
right: -$horizontalScrollPadding;
|
|
61
|
+
justify-content: flex-end;
|
|
62
|
+
background: linear-gradient(
|
|
63
|
+
to right,
|
|
64
|
+
rgba(255, 255, 255, 0.000001) 0,
|
|
65
|
+
rgb(255, 255, 255) calc(100% - $horizontalScrollPadding)
|
|
66
|
+
);
|
|
67
|
+
> button {
|
|
68
|
+
margin-right: calc($horizontalScrollPadding - 8px);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
.card-grid {
|
|
73
|
+
display: grid;
|
|
74
|
+
grid-template-columns: repeat(auto-fill, minmax(var(--cardWidth), 1fr));
|
|
75
|
+
grid-column-gap: 20px;
|
|
76
|
+
grid-row-gap: 20px;
|
|
77
|
+
grid-template-rows: auto;
|
|
78
|
+
padding-block-start: 1em;
|
|
79
|
+
padding-block-end: 1em;
|
|
80
|
+
&.card-grid-layout-scroll {
|
|
81
|
+
position: relative;
|
|
82
|
+
overflow-x: auto;
|
|
83
|
+
overflow-y: hidden;
|
|
84
|
+
scroll-snap-type: x mandatory;
|
|
85
|
+
grid-auto-flow: column;
|
|
86
|
+
grid-template-columns: repeat(auto-fit, var(--cardWidth));
|
|
87
|
+
grid-auto-columns: minmax(var(--cardWidth), 1fr);
|
|
88
|
+
// slightly more padding to prevent shadow clipping
|
|
89
|
+
padding: $horizontalScrollPadding;
|
|
90
|
+
// compensate for larger padding
|
|
91
|
+
margin: calc(1em - $horizontalScrollPadding) (-$horizontalScrollPadding) 0;
|
|
92
|
+
&::-webkit-scrollbar-track {
|
|
93
|
+
margin: 0 $horizontalScrollPadding;
|
|
94
|
+
}
|
|
95
|
+
@include materialScrollbar();
|
|
96
|
+
> .card-grid-drag-wrapper {
|
|
97
|
+
scroll-snap-align: center;
|
|
98
|
+
scroll-snap-stop: always;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
> .card-grid-drag-wrapper {
|
|
102
|
+
position: relative;
|
|
103
|
+
// .cdk-drag-placeholder ~ .card-grid-drop-blocked-container {
|
|
104
|
+
// display: none;
|
|
105
|
+
// }
|
|
106
|
+
.card-grid-drop-allowed-container,
|
|
107
|
+
.card-grid-drop-blocked-container {
|
|
108
|
+
position: absolute;
|
|
109
|
+
z-index: 1;
|
|
110
|
+
left: 0;
|
|
111
|
+
right: 0;
|
|
112
|
+
top: 0;
|
|
113
|
+
bottom: 0;
|
|
114
|
+
display: flex;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
align-items: center;
|
|
117
|
+
> i {
|
|
118
|
+
background: radial-gradient(circle, #fff 30%, rgba(255, 255, 255, 0.0001) 70%);
|
|
119
|
+
width: 200px;
|
|
120
|
+
height: 200px;
|
|
121
|
+
font-size: 80px;
|
|
122
|
+
display: flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
justify-content: center;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
.card-grid-drop-allowed-container {
|
|
128
|
+
> i {
|
|
129
|
+
color: var(--colorStatusPositive);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
.card-grid-drop-blocked-container {
|
|
133
|
+
backdrop-filter: blur(5px);
|
|
134
|
+
> i {
|
|
135
|
+
color: var(--colorStatusNegative);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
.selected-when-dragging {
|
|
139
|
+
opacity: 0.5; // Same as .cdk-drag-placeholder
|
|
140
|
+
}
|
|
141
|
+
&.cdk-drop-list-dragging {
|
|
142
|
+
> *:first-child {
|
|
143
|
+
display: none;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
&.card-grid-reorder {
|
|
148
|
+
> .card-grid-order-wrapper {
|
|
149
|
+
$orderAnimationTime: 0.5s;
|
|
150
|
+
animation-iteration-count: infinite;
|
|
151
|
+
animation-duration: $orderAnimationTime;
|
|
152
|
+
animation-name: OrderAnimationCards;
|
|
153
|
+
&:nth-of-type(2n) {
|
|
154
|
+
animation-delay: 0s;
|
|
155
|
+
}
|
|
156
|
+
&:nth-of-type(2n + 1) {
|
|
157
|
+
animation-delay: math.div(-$orderAnimationTime, 2);
|
|
158
|
+
}
|
|
159
|
+
&:nth-of-type(3n) {
|
|
160
|
+
animation-delay: math.div(-$orderAnimationTime, 4);
|
|
161
|
+
}
|
|
162
|
+
&:nth-of-type(5n) {
|
|
163
|
+
animation-delay: math.div(-$orderAnimationTime, 8);
|
|
164
|
+
}
|
|
165
|
+
.cdk-drag-placeholder {
|
|
166
|
+
display: none;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.card-drag-preview {
|
|
173
|
+
width: 250px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Disable animations for rearranging. We misuse `entered` events for doing the rearranging, so the
|
|
177
|
+
// preview animation would go to the wrong position (see
|
|
178
|
+
// https://stackblitz.com/edit/drag-drop-dashboard).
|
|
179
|
+
::ng-deep .es-card-grid-rearrange-drag-preview.cdk-drag-animating {
|
|
180
|
+
transition: none;
|
|
181
|
+
}
|