aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/CollectionSchemaView.scss
blob: 5c0b6d88b29b54c4496bdf0c161cf941dd38c22e (plain)
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
39
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
@import '../../global/globalCssVariables.scss';

.collectionSchemaView {
    cursor: default;
    height: 100%;
    display: flex;
    flex-direction: row;

    .schema-table {
        background-color: $white;

        .schema-header-row {
            justify-content: flex-end;

            .schema-column-header {
                font-weight: bold;
                display: flex;
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
                padding: 0;

                .schema-column-title {
                    flex-grow: 2;
                    margin: 5px;
                }

                .schema-header-menu {
                    margin: 5px;
                }

                .schema-column-resizer {
                    height: 100%;
                    width: 3px;
                    cursor: ew-resize;

                    &:hover {
                        background-color: $light-blue;
                    }
                }

                .schema-column-resizer.right {
                    align-self: flex-end;
                }

                .schema-column-resizer.left {
                    align-self: flex-start;
                }

                .schema-column-menu {
                    background: $light-gray;
                    width: inherit;
                    position: absolute;
                    top: 35px;
                    min-width: 200px;
                    display: flex;
                    flex-direction: column;
                    align-items: flex-start;

                    .schema-key-search-input {
                        width: calc(100% - 20px);
                        margin: 10px;
                    }

                    .schema-key-search-result {
                        cursor: pointer;
                        padding: 2px 10px;
                        width: 100%;

                        &:hover {
                            background-color: $medium-gray;
                        }
                    }

                    .schema-key-search,
                    .schema-new-key-options {
                        width: 100%;
                        display: flex;
                        flex-direction: column;
                        align-items: flex-start;
                    }

                    .schema-new-key-options {
                        margin: 10px;
                        .schema-key-warning {
                            color: red;
                            font-weight: normal;
                            align-self: center;
                        }
                    }

                    .schema-key-list {
                        width: 100%;
                        max-height: 300px;
                        overflow-y: auto;
                    }

                    .schema-key-type-option {
                        margin: 2px 0px;

                        input {
                            margin-right: 5px;
                        }
                    }

                    .schema-key-default-val {
                        margin: 5px 0;
                    }

                    .schema-column-menu-button {
                        cursor: pointer;
                        padding: 2px 5px;
                        background: $medium-blue;
                        border-radius: 9999px;
                        color: $white;
                        width: fit-content;
                        margin: 5px;
                        align-self: center;
                    }
                }
            }
        }

        .schema-header-menu {
            display: flex;
            flex-direction: row;
        }
    }

    .schema-preview-divider {
        height: 100%;
        background: black;
        cursor: ew-resize;
    }
}

.schema-row-wrapper {
    // max-height: 70px;
    overflow: hidden;
}

.schema-header-row,
.schema-row {
    display: flex;
    flex-direction: row;
    height: 100%;
    // max-height: 70px;
    overflow: auto;

    .schema-column-header,
    .schema-table-cell,
    .row-menu {
        border: 1px solid $medium-gray;
        padding: 5px;
        overflow: hidden;
    }
}

.schema-row {
    justify-content: flex-end;
    background: white;

    .row-menu {
        display: flex;
        flex-direction: row;
        justify-content: center;
        min-width: 50px;
    }

    .row-cells {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
    }
}

.schema-row-button,
.schema-header-button {
    width: 20px;
    height: 20px;
    border-radius: 100%;
    background-color: $dark-gray;
    color: white;
    margin: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    svg {
        width: 12px;
    }
}