@kws3/ui 1.1.0 → 1.2.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.
- package/buttons/SubmitButton.svelte +4 -4
- package/controls/NumberInput.svelte +4 -1
- package/datagrid/DataSearch/DataSearch.svelte +45 -11
- package/datagrid/DataSearch/SearchFilter.svelte +82 -19
- package/datagrid/DataSort/DataSort.svelte +16 -6
- package/datagrid/GridView/GridCell.svelte +23 -7
- package/datagrid/GridView/GridRow.svelte +60 -15
- package/datagrid/GridView/GridView.svelte +79 -19
- package/datagrid/Pagination/Pagination.svelte +8 -2
- package/datagrid/TileView/TileView.svelte +64 -16
- package/datagrid/TileView/TileViewItem.svelte +36 -9
- package/forms/Datepicker.svelte +4 -4
- package/forms/select/MultiSelect.svelte +581 -0
- package/forms/select/SearchableSelect.svelte +149 -0
- package/helpers/ClipboardCopier.svelte +2 -2
- package/helpers/FloatingUI/Floatie.svelte +141 -0
- package/helpers/FloatingUI/FloatingUIOutput.svelte +34 -0
- package/helpers/FloatingUI/index.js +156 -0
- package/helpers/Icon.svelte +2 -2
- package/index.js +8 -1
- package/package.json +2 -2
- package/settings.js +15 -3
- package/styles/FloatingUI.scss +163 -0
- package/styles/Panel.scss +2 -3
- package/styles/Select.scss +203 -0
- package/forms/SearchableSelect.svelte +0 -438
- package/styles/SearchableSelect.scss +0 -128
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
$kws-theme-colors: $colors !default;
|
|
2
|
+
$kws3-floating-item-width: 25rem !default;
|
|
3
|
+
|
|
4
|
+
.kws-floatie-output {
|
|
5
|
+
position: fixed;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
right: 0;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
padding: 0.5em;
|
|
12
|
+
z-index: 1000;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
display: flex;
|
|
15
|
+
&.is-top {
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
}
|
|
18
|
+
&.is-bottom {
|
|
19
|
+
flex-direction: column-reverse;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.kws-floatie-item {
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
transform: translate3d(0, 0, 0);
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
margin-bottom: 1rem;
|
|
28
|
+
max-width: $kws3-floating-item-width;
|
|
29
|
+
min-width: $kws3-floating-item-width;
|
|
30
|
+
&.has-toast {
|
|
31
|
+
max-width: 100%;
|
|
32
|
+
width: fit-content;
|
|
33
|
+
}
|
|
34
|
+
&.is-top,
|
|
35
|
+
&.is-bottom {
|
|
36
|
+
align-self: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
}
|
|
39
|
+
&.is-top-left,
|
|
40
|
+
&.is-bottom-left {
|
|
41
|
+
align-self: flex-start;
|
|
42
|
+
justify-content: flex-start;
|
|
43
|
+
}
|
|
44
|
+
&.is-top-right,
|
|
45
|
+
&.is-bottom-right {
|
|
46
|
+
align-self: flex-end;
|
|
47
|
+
justify-content: flex-end;
|
|
48
|
+
}
|
|
49
|
+
.floatie-progress {
|
|
50
|
+
background: currentColor;
|
|
51
|
+
height: 0.25em;
|
|
52
|
+
position: absolute;
|
|
53
|
+
bottom: 0;
|
|
54
|
+
left: 0;
|
|
55
|
+
width: 0%;
|
|
56
|
+
animation-name: floatie-progress-running;
|
|
57
|
+
animation-fill-mode: forwards;
|
|
58
|
+
animation-timing-function: linear;
|
|
59
|
+
border-radius: 0 $radius $radius $radius;
|
|
60
|
+
}
|
|
61
|
+
.notification {
|
|
62
|
+
padding: 0.5em 0.75em;
|
|
63
|
+
position: relative;
|
|
64
|
+
font-size: 1rem;
|
|
65
|
+
width: 100%;
|
|
66
|
+
pointer-events: auto;
|
|
67
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
|
68
|
+
p {
|
|
69
|
+
margin: 0;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
.snackbar {
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
position: relative;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: space-around;
|
|
77
|
+
border-radius: $radius;
|
|
78
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
|
79
|
+
pointer-events: auto;
|
|
80
|
+
min-height: 3em;
|
|
81
|
+
background: $scheme-invert;
|
|
82
|
+
color: $scheme-main;
|
|
83
|
+
font-size: 1rem;
|
|
84
|
+
|
|
85
|
+
.text {
|
|
86
|
+
margin: 0.5em 0.75em;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.action {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
align-items: flex-end;
|
|
92
|
+
margin-left: auto;
|
|
93
|
+
margin-right: 0.5em;
|
|
94
|
+
padding-left: 0;
|
|
95
|
+
|
|
96
|
+
.button {
|
|
97
|
+
font-weight: 600;
|
|
98
|
+
text-transform: uppercase;
|
|
99
|
+
position: relative;
|
|
100
|
+
background: transparent;
|
|
101
|
+
color: currentColor;
|
|
102
|
+
border: none;
|
|
103
|
+
padding-left: 0.5em;
|
|
104
|
+
padding-right: 0.5em;
|
|
105
|
+
&:hover {
|
|
106
|
+
background: rgba(0, 0, 0, 0.1);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@each $name, $pair in $kws-theme-colors {
|
|
112
|
+
$color: nth($pair, 1);
|
|
113
|
+
$color-invert: nth($pair, 2);
|
|
114
|
+
$color-light: findLightColor($color);
|
|
115
|
+
$color-dark: findDarkColor($color);
|
|
116
|
+
&.is-#{$name} {
|
|
117
|
+
background: $color;
|
|
118
|
+
color: $color-invert;
|
|
119
|
+
&.is-light {
|
|
120
|
+
background: $color-light;
|
|
121
|
+
color: $color-dark;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.toast {
|
|
128
|
+
text-align: center;
|
|
129
|
+
padding: 0.5em 0.75em;
|
|
130
|
+
border-radius: 1.5em;
|
|
131
|
+
margin: 0;
|
|
132
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
|
133
|
+
pointer-events: none;
|
|
134
|
+
background: $scheme-invert;
|
|
135
|
+
color: $scheme-main;
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
text-overflow: ellipsis;
|
|
139
|
+
@each $name, $pair in $kws-theme-colors {
|
|
140
|
+
$color: nth($pair, 1);
|
|
141
|
+
$color-invert: nth($pair, 2);
|
|
142
|
+
$color-light: findLightColor($color);
|
|
143
|
+
$color-dark: findDarkColor($color);
|
|
144
|
+
&.is-#{$name} {
|
|
145
|
+
background: $color;
|
|
146
|
+
color: $color-invert;
|
|
147
|
+
&.is-light {
|
|
148
|
+
background: $color-light;
|
|
149
|
+
color: $color-dark;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@keyframes floatie-progress-running {
|
|
157
|
+
0% {
|
|
158
|
+
width: 0%;
|
|
159
|
+
}
|
|
160
|
+
100% {
|
|
161
|
+
width: 100%;
|
|
162
|
+
}
|
|
163
|
+
}
|
package/styles/Panel.scss
CHANGED
|
@@ -40,7 +40,7 @@ $kws-panel-caret-closed-color: #00a4d8 !default;
|
|
|
40
40
|
.collapsor {
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
|
-
.collapsor
|
|
43
|
+
.collapsor .icon-i {
|
|
44
44
|
transition: transform 0.4s, color 0.4s;
|
|
45
45
|
transform: rotate(-90deg);
|
|
46
46
|
color: $kws-panel-caret-open-color;
|
|
@@ -54,14 +54,13 @@ $kws-panel-caret-closed-color: #00a4d8 !default;
|
|
|
54
54
|
margin: 0 10px 0 20px;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
&.collapsed .collapsor
|
|
57
|
+
&.collapsed .collapsor .icon-i {
|
|
58
58
|
transform: rotate(90deg) translate(5px, 0);
|
|
59
59
|
color: $kws-panel-caret-closed-color;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
&.collapsible .panel-content-outer {
|
|
63
63
|
transition: max-height 0.3s;
|
|
64
|
-
transform: translate3d(0, 0, 0);
|
|
65
64
|
|
|
66
65
|
max-height: 5000px;
|
|
67
66
|
overflow: hidden;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
$kws-theme-colors: $colors !default;
|
|
2
|
+
$kws-select-radius: $radius !default;
|
|
3
|
+
$kws-select-focus-border-color: $input-focus-border-color !default;
|
|
4
|
+
$kws-select-focus-box-shadow-size: $input-focus-box-shadow-size !default;
|
|
5
|
+
$kws-select-focus-box-shadow-color: $input-focus-box-shadow-color !default;
|
|
6
|
+
$kws-select-disabled-background-color: $input-disabled-background-color !default;
|
|
7
|
+
$kws-select-disabled-border-color: $input-disabled-border-color !default;
|
|
8
|
+
$kws-select-disabled-color: $input-disabled-color !default;
|
|
9
|
+
$kws-select-selecting-color: $primary-invert !default;
|
|
10
|
+
$kws-select-selecting-background: $primary !default;
|
|
11
|
+
$kws-select-selected-color: $primary-dark !default;
|
|
12
|
+
$kws-select-selected-background: $primary-light !default;
|
|
13
|
+
|
|
14
|
+
.searchableselect {
|
|
15
|
+
position: relative;
|
|
16
|
+
align-items: center;
|
|
17
|
+
display: flex;
|
|
18
|
+
cursor: text;
|
|
19
|
+
height: auto;
|
|
20
|
+
min-height: 2.5em;
|
|
21
|
+
padding-top: calc(0.4em - 1px);
|
|
22
|
+
padding-bottom: calc(0.4em - 1px);
|
|
23
|
+
&:focus-within {
|
|
24
|
+
border-color: $kws-select-focus-border-color;
|
|
25
|
+
box-shadow: $kws-select-focus-box-shadow-size
|
|
26
|
+
$kws-select-focus-box-shadow-color;
|
|
27
|
+
}
|
|
28
|
+
&.is-disabled {
|
|
29
|
+
background-color: $kws-select-disabled-background-color;
|
|
30
|
+
border-color: $kws-select-disabled-border-color;
|
|
31
|
+
color: $kws-select-disabled-color;
|
|
32
|
+
cursor: not-allowed;
|
|
33
|
+
}
|
|
34
|
+
&.is-readonly {
|
|
35
|
+
box-shadow: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ul.tokens {
|
|
39
|
+
flex-wrap: wrap;
|
|
40
|
+
flex: 1;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
&.tags {
|
|
43
|
+
margin: 0;
|
|
44
|
+
margin-top: -0.25rem;
|
|
45
|
+
margin-bottom: -0.25rem;
|
|
46
|
+
margin-left: -0.25rem;
|
|
47
|
+
margin-right: 0.25rem;
|
|
48
|
+
.tag.is-small {
|
|
49
|
+
font-size: 0.6rem;
|
|
50
|
+
.delete.is-small {
|
|
51
|
+
height: 14px;
|
|
52
|
+
max-height: 14px;
|
|
53
|
+
max-width: 14px;
|
|
54
|
+
min-height: 14px;
|
|
55
|
+
min-width: 14px;
|
|
56
|
+
width: 14px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
& > li.tag {
|
|
61
|
+
margin: 0.25rem !important;
|
|
62
|
+
}
|
|
63
|
+
li.tag.summary-count {
|
|
64
|
+
font-weight: bold;
|
|
65
|
+
margin-right: 0 !important;
|
|
66
|
+
}
|
|
67
|
+
li.tag.summary-text {
|
|
68
|
+
margin-left: 0 !important;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
input {
|
|
73
|
+
border: none !important;
|
|
74
|
+
outline: none !important;
|
|
75
|
+
background: none !important;
|
|
76
|
+
/* needed to hide red shadow around required inputs in some browsers */
|
|
77
|
+
box-shadow: none !important;
|
|
78
|
+
color: inherit;
|
|
79
|
+
flex: 1;
|
|
80
|
+
padding: 1pt;
|
|
81
|
+
height: auto;
|
|
82
|
+
min-height: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
ul.options {
|
|
86
|
+
list-style: none;
|
|
87
|
+
max-height: 50vh;
|
|
88
|
+
padding: 0;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
border-radius: 0 0 $kws-select-radius $kws-select-radius;
|
|
91
|
+
overflow: auto;
|
|
92
|
+
background: #fff;
|
|
93
|
+
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.4);
|
|
94
|
+
position: relative;
|
|
95
|
+
z-index: 4;
|
|
96
|
+
&[data-popper-placement="top"] {
|
|
97
|
+
border-radius: $kws-select-radius $kws-select-radius 0 0;
|
|
98
|
+
box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.4);
|
|
99
|
+
}
|
|
100
|
+
&.hidden {
|
|
101
|
+
display: none;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
li {
|
|
105
|
+
padding: 0.3em 0.5em;
|
|
106
|
+
position: relative;
|
|
107
|
+
padding-left: 2em;
|
|
108
|
+
word-break: break-all;
|
|
109
|
+
&:before,
|
|
110
|
+
.kws-selected-icon {
|
|
111
|
+
position: absolute;
|
|
112
|
+
width: 1em;
|
|
113
|
+
height: 1em;
|
|
114
|
+
top: calc(50% - 0.5em);
|
|
115
|
+
left: 0.5em;
|
|
116
|
+
content: "";
|
|
117
|
+
display: inline-block;
|
|
118
|
+
}
|
|
119
|
+
&:before {
|
|
120
|
+
border: 0.05em solid currentColor;
|
|
121
|
+
border-radius: 0.14em;
|
|
122
|
+
}
|
|
123
|
+
.kws-selected-icon {
|
|
124
|
+
display: none;
|
|
125
|
+
.icon {
|
|
126
|
+
align-items: center;
|
|
127
|
+
width: 1em !important;
|
|
128
|
+
height: 1em !important;
|
|
129
|
+
.icon-i {
|
|
130
|
+
font-size: 0.7em;
|
|
131
|
+
line-height: 1.5;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
&.selected {
|
|
136
|
+
color: $kws-select-selected-color;
|
|
137
|
+
background: $kws-select-selected-background;
|
|
138
|
+
.kws-selected-icon {
|
|
139
|
+
display: inline-flex;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
&.active {
|
|
143
|
+
// keyboard focused item
|
|
144
|
+
color: $kws-select-selecting-color;
|
|
145
|
+
background: $kws-select-selecting-background;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&.is-single {
|
|
150
|
+
li {
|
|
151
|
+
&:before,
|
|
152
|
+
.kws-selected-icon {
|
|
153
|
+
display: none;
|
|
154
|
+
}
|
|
155
|
+
&.selected {
|
|
156
|
+
.kws-selected-icon {
|
|
157
|
+
display: inline-flex;
|
|
158
|
+
}
|
|
159
|
+
.icon-i {
|
|
160
|
+
font-size: 1em;
|
|
161
|
+
line-height: 1.5;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
li.no-options {
|
|
168
|
+
pointer-events: none;
|
|
169
|
+
padding: 0.3em 0.5em !important;
|
|
170
|
+
&:before,
|
|
171
|
+
&:after {
|
|
172
|
+
display: none;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@each $name, $pair in $kws-theme-colors {
|
|
179
|
+
$color: nth($pair, 1);
|
|
180
|
+
$color-invert: nth($pair, 2);
|
|
181
|
+
$color-light: findLightColor($color);
|
|
182
|
+
$color-dark: findDarkColor($color);
|
|
183
|
+
.searchableselect {
|
|
184
|
+
&.is-#{$name} {
|
|
185
|
+
border-color: $color;
|
|
186
|
+
&:focus-within {
|
|
187
|
+
box-shadow: $input-focus-box-shadow-size bulmaRgba($color, 0.25);
|
|
188
|
+
}
|
|
189
|
+
ul.options {
|
|
190
|
+
li {
|
|
191
|
+
&.selected {
|
|
192
|
+
color: $color-dark;
|
|
193
|
+
background: $color-light;
|
|
194
|
+
}
|
|
195
|
+
&.active {
|
|
196
|
+
color: $color-invert;
|
|
197
|
+
background: $color;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|