_main_form.scss 11.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// Disable ms-clear pseudo-element globally to avoid confusion with the
// existing clearable integration in TYPO3
//
// https://msdn.microsoft.com/en-us/library/windows/apps/hh465740.aspx
//
*::-ms-clear {
    display: none;
}

//
// Form control state additions
//
.has-change {
    @include form-control-validation($state-info-text, $state-info-text, $state-info-bg);

    .thumbnail-status {
        border: 1px solid $state-info-text;
    }
    // A loading order issue prevents .has-change to be overridden with .has-error
    // this is a workaround needs to be cleaned up in a less file restructuring
    &.has-error {
        @extend .has-error;
    }
}

//
// Input group additions
//
.input-group-icon {
    vertical-align: middle;

    img {
        max-height: 18px;
    }
}

.input-group-addon {
39
    min-width: 2.5rem;
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
}

//
// IE: ensure DatePicker is opened on button click
//
label {
    .icon {
        img {
            pointer-events: none;
        }
    }
}

//
// Form control additions
//
.form-control {
    min-width: 120px;
}

.form-control-adapt {
    width: auto;
    max-width: 100%;
}

.form-control-wrap {
66
    margin: 0.5rem 0;
67
68
69
70
71
72
73
74
75
76
77
}

.form-control-holder {
    position: relative;
}

.row {
    > .form-group {
        > .form-control-wrap {
            margin-bottom: 0;
        }
78
79
    }
}
80

81
82
83
.form-group {
    .t3js-formengine-field-item {
        position: relative;
84

85
86
87
88
        > .t3js-charcounter {
            left: 0;
            position: absolute;
            top: 100%;
89
        }
90
    }
91
92
93
94

    > label,
    > .form-label {
        font-weight: 600;
95
        margin: 0 0 $form-label-margin-bottom;
96
        word-break: break-all;
97
    }
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
}

.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
    color: $input-color-disabled;
}

//
// Form control icon
//
.form-control-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translate(0, -50%);
    z-index: 1;
115
    pointer-events: none;
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

    + .form-control,
    + .form-control-clearable .form-control {
        padding-left: 3.25em;
    }
}

//
// Form group validation states
//
.form-group.has-error {
    label:before {
        font-family: FontAwesome;
        font-size: 12px;
        text-align: center;
        content: $fa-var-exclamation-circle;
132
        color: $danger;
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
        display: inline-block;
    }

    .btn-toolbar {
        label:before {
            font-family: inherit;
            font-size: inherit;
            margin-right: inherit;
            text-align: inherit;
            content: '';
            color: inherit;
            display: block;
        }
    }

    .input-group-btn {
        label {
150
            border-color: $danger;
151
152

            .t3-icon {
153
                color: $danger;
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
            }
        }

        label:before {
            font-family: inherit;
            font-size: inherit;
            margin-right: inherit;
            text-align: inherit;
            content: '';
            color: inherit;
            display: block;
        }
    }
}

//
// Select
//
select {
173
    &.form-select {
174
        &[multiple],
175
        &[size]:not([size="1"]) {
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
            min-height: 156px;
        }

        > optgroup {
            margin-top: 9px;

            &:first-child {
                margin-top: 0;
            }
        }

        option {
            padding-top: 2px;
            padding-bottom: 2px;
        }
    }

    &.icon-select {
        option {
            padding-left: 22px;
        }
    }
}

//
// Styles for the "clearable" jquery plugin.
//
.form-control-clearable {
    position: relative;
205
206
207
    border: 0;
    padding: 0;
    height: 100%;
208
209
210
211
212
213

    .form-control {
        padding-right: 2.3em;
    }

    .close {
214
215
        border: none;
        background-color: transparent;
216
        position: absolute;
217
        height: 16px;
218
219
220
        z-index: 3;
        top: 50%;
        right: 0.5em;
221
        transform: translate(0, -50%);
222
223
224
225
226
        opacity: 0.2;

        &:hover {
            opacity: 0.5;
        }
227

228
229
        .icon {
            vertical-align: 0;
230
231
232
        }
    }

233
234
235
    &:focus {
        box-shadow: none;
        border-color: inherit;
236
237
238
    }
}

239
.form-inline {
240
    .form-control-clearable {
241
        display: inline-block;
242
243
244
245
246
247
248
249
    }
}

//
// Styles for the "capslock" jquery plugin.
//
.form-notice-capslock {
    position: absolute;
250
    right: 25px;
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
    top: 50%;
    margin-top: -10px;
    height: 20px;
    width: 20px;
    padding: 3px;
    z-index: 10;
    background-color: #fff;

    > img {
        display: block;
        opacity: 0.5;
    }
}

//
// Form group additions
//
.form-group-dashed {
    & + .form-group-dashed {
        padding-top: 15px;
        border-top: 1px dashed #ccc;
    }
}

//
// Form Sections
//
.form-section {
    border: 1px solid #ccc;
    background-color: #fafafa;
    padding: 15px 12px 3px;

    & + .form-section {
        margin-top: -1px;
    }
}

.tab-pane {
    > .form-section:first-child {
        border-top: none;
    }
}

.form-section-headline {
    margin-top: 0;
    margin-bottom: 10px;
297
298
299
300
301

    & + .form-section-description {
        margin-top: -5px;
        margin-bottom: 10px;
    }
302
303
304
305
306
307
308
}

//
// Form Wizards
//
.form-wizards-wrap {
    width: 100%;
309
310
311
312
    display: grid;
    grid-template: "top . ." "main  side-move side-control" "bottom . .";
    grid-template-rows: auto;
    grid-template-columns: 1fr auto auto;
313
314

    > .form-wizards-element {
315
316
        grid-area: main;
        min-width: 120px;
317

318
319
        .col-icon img,
        .inline-icon img {
320
321
322
            max-width: 2em;
            max-height: 2em;
        }
323
324
325
    }

    > .form-wizards-items-top {
326
327
        width: 100%;
        grid-area: top;
328
329
330
    }

    > .form-wizards-items-aside {
331
        align-self: flex-start;
332
        white-space: nowrap;
333
334
335
336
337
338
339
340
341
        padding-left: 5px;

        &--move {
            grid-area: side-move;
        }

        &--field-control {
            grid-area: side-control;
        }
342
343
344
    }

    > .form-wizards-items-bottom {
345
        grid-area: bottom;
346
347
348
349
350

        .tablelist-item-nolink {
            padding: 6px;
            display: inline-block;
        }
351
352
353
354
355
356
357
358
359
360
361
    }

    > .form-wizards-items-bottom:first-child {
        margin-top: 4px;
    }
}

//
// Form Irre
//
.form-irre-header {
362
363
    display: flex;
    align-items: center;
364
    margin: -5px;
365
    user-select: none;
366
367
368
369
370
371
372
373
}

.form-irre-header-cell {
    vertical-align: middle;
    white-space: nowrap;
    padding: 5px;
}

374
375
376
377
378
379
380
381
382
383
384
385
.form-irre-header-button {
    display: flex;
    text-align: left;
    align-items: center;
    align-self: stretch;
    background: transparent;
    border: 0;
    width: 100%;
    margin-left: -15px;
    padding-left: 20px;
}

386
387
388
389
.form-irre-header-body {
    width: 100%;
    font-weight: normal;
    white-space: normal;
390
    padding-left: 5px;
391

392
393
394
    dl,
    dd,
    dt {
395
396
397
398
399
400
401
402
        margin-bottom: 0;
    }
}

.form-irre-header-icon {
    padding-right: 0;
}

403
404
405
406
.form-irre-header-thumbnail {
    padding-right: 5px;
}

407
408
409
410
411
412
413
414
415
416
417
418
419
.form-irre-header-control {
    cursor: auto;

    .btn-group > .btn {
        float: none;
    }
}

//
// Form Multi Group
//
.form-multigroup-wrap {
    width: 100%;
420
    display: flex;
421
422
423

    .form-multigroup-item {
        width: 50%;
424
        align-self: flex-start;
425
426
427
428
429
430
431
432
433

        + .form-multigroup-item {
            padding-left: 5px;
        }
    }

    .form-multigroup-item-wizard {
        margin-bottom: 5px;

434
435
        + select.form-select[multiple],
        + select.form-select[size] {
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
            min-height: 125px;
        }
    }

    .form-wizards-wrap {
        width: 100%;
    }
}

//
// Radio & Checkbox
//
.radio-row,
.checkbox-row {
    margin-top: 10px;
    margin-bottom: 5px;
}

.radio-column,
.checkbox-column {
    margin-bottom: 5px;

458
    > .form-check-input,
459
460
461
462
463
464
465
466
    > .radio,
    > .checkbox {
        margin: 0;
    }
}

.radio-inline,
.checkbox-inline {
467
    &.form-check-input,
468
469
470
471
472
473
474
475
476
    &.radio,
    &.checkbox {
        display: block;
        margin-left: 0;
        margin-right: 10px;
        margin-bottom: 10px;
        padding: 0;

        @media (max-width: $screen-xs-max) {
477
            & + .form-check-in,
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
            & + .radio,
            & + .checkbox {
                margin-top: -5px;
            }
        }

        @media (min-width: $screen-sm-min) {
            display: inline-block;
            margin-top: 10px;

            label {
                white-space: nowrap;
            }
        }
    }
}

//
// Autoresize for Textareas
//
// no manual resizing for textareas (works on non-IE browser only anyways)
// as it is handled by JS: "autosize"
//
textarea {
    &.formengine-textarea {
        resize: none;
    }
}
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525

//
// This is needed for input links, because the input is wrapped dynamically
// with a clearable div. If the field is unlocked for explanation view, the
// wrap should grow to 100%, else it should shrink to 0%.
//
.input-group > .form-control-clearable {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.form-control:not(.hidden) + .form-control-clearable {
    flex-grow: 0;
    width: auto;
}

.form-control.hidden + .close {
    display: none;
}
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564

/**
 * A toggle checkbox. Using TYPO3 icons.
 */
$form-toggle-color: rgba(0, 0, 0, 0.25) !default;
$form-toggle-width: 2em !default;
$form-toggle-padding-start: $form-toggle-width !default;
$form-toggle-bg-image: url("data:image/svg+xml, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><g class='icon-color'><path d='M13 2c.6 0 1 0.4 1 1v10c0 0.6-.4 1-1 1H3c-.6 0-1-.4-1-1V3c0-.6.4-1 1-1h10m0-1H3c-1.1 0-2 0.9-2 2v10c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2z'/></g></svg>") !default;
$form-toggle-checked-color: $component-active-color !default;
$form-toggle-checked-bg-image: url("data:image/svg+xml, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><g class='icon-color'><path d='M12.1 5.3l-.4-.3c-.1-.1-.3-.1-.4 0L6.6 9.8l-2-2c-.1-.1-.3-.1-.4 0l-.3.4c-.1.1-.1.3 0 0.4L6 10.7l.4.3c.1.1.3.1.4 0l.4-.4 4.9-4.9c.1-.1.1-.3 0-.4z'/><path d='M13 2c.6 0 1 0.4 1 1v10c0 0.6-.4 1-1 1H3c-.6 0-1-.4-1-1V3c0-.6.4-1 1-1h10m0-1H3c-1.1 0-2 0.9-2 2v10c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2z'/></g></svg>") !default;

.form-toggle {
    padding-left: $form-toggle-padding-start;
    width: $form-toggle-width;
    color: $form-toggle-color;

    &:hover {
        cursor: pointer;
    }

    input[type="checkbox"] {
        border: 0;
        width: 16px;
        height: 16px;
        background-size: contain;
        background-image: escape-svg($form-toggle-bg-image);

        &:hover {
            cursor: pointer;
        }

        &:active {
            filter: brightness(100%);
        }

        &:checked {
            background-image: escape-svg($form-toggle-checked-bg-image);
            background-color: $form-toggle-checked-color;
        }
565
566
567
568

        &:disabled {
            opacity: 0.5;
        }
569
570
    }
}
571
572

/**
573
 * A sticky form actions menu for the modal-body
574
575
 */
.sticky-form-actions {
576
577
    position: sticky;
    top: 0;
578
579
    z-index: 1;
    margin-left: -1rem; // revert modal-body padding
580
581
582
    margin-right: -1rem; // revert modal-body padding
    margin-bottom: -0.625rem; // revert for modal-header / modal-footer like padding
    transform: translateY(-1rem); // revert modal-body padding
583
584
585
586
    padding: 0.625rem 1rem; // modal-header / modal-footer like padding
    background: $white;

    a,
587
588
589
590
    button,
    input,
    .input-group-addon {
        margin: 0.25rem 0;
591
592
593
    }
}

594
595
596
597
598
599
.multi-record-selection-actions-wrapper {
    // Calculation of min height for the multi record selection actions, based on the fact that btn-sm is used
    min-height: floor(2px + ($padding-small-vertical * 2) + ($font-size-small * $line-height-small));
    // Consistent space between actions and listing
    margin: 0.5rem 0;
}
600
601
602
603
604

.input-group > .btn {
    display: flex;
    align-items: center;
}