uniform-ui 3.0.0.beta5 → 3.0.0.beta8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assets/javascripts/uniform/component.js +8 -1
- data/lib/assets/javascripts/uniform/floating-label-input.js +3 -1
- data/lib/assets/javascripts/uniform/modal.js +22 -20
- data/lib/assets/javascripts/uniform/popover.js +2 -1
- data/lib/assets/stylesheets/uniform/base.scss +4 -4
- data/lib/assets/stylesheets/uniform/components/input-group.scss +9 -0
- data/lib/assets/stylesheets/uniform/components/modal.scss +21 -36
- data/lib/assets/stylesheets/uniform/components/z-input.scss +6 -0
- data/lib/assets/stylesheets/uniform/utilities/layout.scss +6 -2
- data/lib/assets/stylesheets/uniform/utilities/sizing.scss +14 -8
- data/lib/assets/stylesheets/uniform/utilities/spacing.scss +6 -0
- data/lib/assets/stylesheets/uniform/variables.scss +2 -0
- data/lib/uniform/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 412523e9eff8e56b4f3874670f9b43dd0fe8deea00dc41fc59d9ca57e1f4b808
|
4
|
+
data.tar.gz: 91e4e049712982119860f56e3942f02d6bbc622bc9af779027100b7eeab6c66a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfe6402b702439be8cfe35a287d7dcffcb2eab8fa899a9bd2dceb0a10e4fc937e40580379242a7e94d62c57e2bf6bfb65aea1b4b9b2bf5a7a8d0b4c7e60d628f
|
7
|
+
data.tar.gz: e8394e0e62e9d03691ff63799387101f9b892e6715cead997885e530c73da034532422fc71fe07e6c0413fb924f88cec2f06cf90016dc5b7a68b4942025e542c
|
@@ -12,7 +12,14 @@ export default class Component {
|
|
12
12
|
options = options || {};
|
13
13
|
this.eventListens = new Array();
|
14
14
|
this.eventListeners = new Array();
|
15
|
-
|
15
|
+
const htmlAttributes = {}
|
16
|
+
Object.keys(options).forEach(key => {
|
17
|
+
if (HTML_ATTRIBUTES.includes(key)) {
|
18
|
+
htmlAttributes[key] = options[key]
|
19
|
+
}
|
20
|
+
})
|
21
|
+
delete htmlAttributes.content;
|
22
|
+
this.el = options.el || createElement('div', htmlAttributes);
|
16
23
|
this.cid = uniqueId('c');
|
17
24
|
|
18
25
|
this.on = function (type, handler) {
|
@@ -25,7 +25,7 @@ export default class FloatingLabel extends Component {
|
|
25
25
|
}
|
26
26
|
|
27
27
|
render () {
|
28
|
-
if(!isVisible(this.input)) return;
|
28
|
+
if(!isVisible(this.input)) return this;
|
29
29
|
|
30
30
|
let internalHeight = parseInt(css(this.input, 'height')) - parseInt(css(this.input, 'borderTopWidth')) - parseInt(css(this.input, 'borderBottomWidth'));
|
31
31
|
this.input.style.lineHeight = 1;
|
@@ -49,6 +49,8 @@ export default class FloatingLabel extends Component {
|
|
49
49
|
if(this.input.value != ""){
|
50
50
|
this.focus()
|
51
51
|
}
|
52
|
+
|
53
|
+
return this;
|
52
54
|
}
|
53
55
|
|
54
56
|
focus (e) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import Component from './component';
|
2
|
-
import {css, trigger, append} from 'dolla';
|
2
|
+
import {css, trigger, append, createElement} from 'dolla';
|
3
3
|
|
4
4
|
/* UniformModal.initialize
|
5
5
|
Options
|
@@ -30,11 +30,8 @@ export default class Modal extends Component {
|
|
30
30
|
var that = this;
|
31
31
|
|
32
32
|
this.highest_z_index = 0;
|
33
|
-
this.overlay =
|
34
|
-
this.
|
35
|
-
|
36
|
-
this.blur = document.createElement('div');
|
37
|
-
this.blur.classList.add('uniformModal-blur');
|
33
|
+
this.overlay = createElement('div', {class: 'uniformModal-overlay'});
|
34
|
+
this.blur = createElement('div', {class: 'uniformModal-blur'});
|
38
35
|
|
39
36
|
this.original_scroll = window.scrollY;
|
40
37
|
this.blur.style.top = 0 - this.original_scroll + "px";
|
@@ -46,8 +43,6 @@ export default class Modal extends Component {
|
|
46
43
|
this.el.style.zIndex = this.highest_z_index + 2;
|
47
44
|
}
|
48
45
|
|
49
|
-
this.el.appendChild(this.overlay);
|
50
|
-
|
51
46
|
let next_element = document.body.children[0]
|
52
47
|
while(next_element){
|
53
48
|
const element = next_element;
|
@@ -61,18 +56,24 @@ export default class Modal extends Component {
|
|
61
56
|
document.body.appendChild(this.blur);
|
62
57
|
document.body.appendChild(this.el);
|
63
58
|
|
64
|
-
var container = document.createElement('div');
|
65
|
-
container.classList.add('uniformModal-container');
|
66
|
-
|
67
|
-
append(container, this.content);
|
68
|
-
|
69
|
-
var closeButton = document.createElement('div');
|
70
|
-
closeButton.classList.add('uniformModal-close');
|
71
|
-
this.el.appendChild(closeButton);
|
72
|
-
|
73
59
|
this.el.style.top = window.scrollY;
|
74
60
|
this.listenTo(this.overlay, 'click', this.close);
|
75
|
-
|
61
|
+
|
62
|
+
const container = createElement('div', {
|
63
|
+
class: 'uniformModal-container',
|
64
|
+
children: this.content
|
65
|
+
});
|
66
|
+
|
67
|
+
const closeButton = createElement('div', {
|
68
|
+
class: 'uniformModal-close-container',
|
69
|
+
children: {
|
70
|
+
class: 'uniformModal-close'
|
71
|
+
}
|
72
|
+
});
|
73
|
+
|
74
|
+
this.el.append(this.overlay);
|
75
|
+
this.el.append(container);
|
76
|
+
this.el.append(closeButton);
|
76
77
|
|
77
78
|
if (this.options.klass) container.classList.add(this.options.klass);
|
78
79
|
if (this.content.innerHTML) trigger(this.content, 'rendered');
|
@@ -82,8 +83,9 @@ export default class Modal extends Component {
|
|
82
83
|
}
|
83
84
|
|
84
85
|
checkCloseButton (e) {
|
85
|
-
if(e.target.classList.contains('uniformModal-close'))
|
86
|
-
|
86
|
+
if(e.target.classList.contains('uniformModal-close')){
|
87
|
+
this.close();
|
88
|
+
}
|
87
89
|
}
|
88
90
|
|
89
91
|
close () {
|
@@ -117,7 +117,8 @@ export default class Popover extends Component {
|
|
117
117
|
if(leftAlign == 'left'){
|
118
118
|
position.right = outerWidth(container) - anchorOffset.left;
|
119
119
|
} else if(leftAlign == 'center'){
|
120
|
-
position.left = anchorOffset.left + outerWidth(this.options.anchor) / 2
|
120
|
+
position.left = anchorOffset.left + outerWidth(this.options.anchor) / 2;
|
121
|
+
position.transform = "translateX(-50%)";
|
121
122
|
} else if (leftAlign == 'right'){
|
122
123
|
position.left = anchorOffset.left + outerWidth(this.options.anchor);
|
123
124
|
} else if (leftAlign.includes("px")){
|
@@ -2,10 +2,6 @@
|
|
2
2
|
@import 'uniform/variables';
|
3
3
|
@import 'uniform/mixins';
|
4
4
|
*{
|
5
|
-
--bg-opacity: 1.0;
|
6
|
-
--shadow-opacity: 0.1;
|
7
|
-
--border-opacity: 1.0;
|
8
|
-
--border-color: #{red(color('gray'))}, #{green(color('gray'))}, #{blue(color('gray'))};
|
9
5
|
border-width: 0;
|
10
6
|
border-style: solid;
|
11
7
|
border-color: rgba(var(--border-color), var(--border-opacity));
|
@@ -19,4 +15,8 @@
|
|
19
15
|
|
20
16
|
body{
|
21
17
|
--breakpoints: #{mapToString($breakpoints)};
|
18
|
+
--bg-opacity: 1.0;
|
19
|
+
--shadow-opacity: 0.1;
|
20
|
+
--border-opacity: 1.0;
|
21
|
+
--border-color: #{red(color('gray'))}, #{green(color('gray'))}, #{blue(color('gray'))};
|
22
22
|
}
|
@@ -17,6 +17,11 @@
|
|
17
17
|
padding-right: 0.5em;
|
18
18
|
}
|
19
19
|
}
|
20
|
+
|
21
|
+
*:focus {
|
22
|
+
box-shadow: none;
|
23
|
+
}
|
24
|
+
|
20
25
|
input,
|
21
26
|
.input{
|
22
27
|
flex: 1 1 auto;
|
@@ -27,4 +32,8 @@
|
|
27
32
|
padding: 0.5em;
|
28
33
|
box-shadow: none;
|
29
34
|
}
|
35
|
+
|
36
|
+
.uniformInput {
|
37
|
+
border: none !important;
|
38
|
+
}
|
30
39
|
}
|
@@ -12,46 +12,29 @@
|
|
12
12
|
position: absolute;
|
13
13
|
top: 0;
|
14
14
|
width: 100%;
|
15
|
-
text-align:center;
|
16
15
|
padding: 2em;
|
17
16
|
z-index: 9999;
|
17
|
+
display: flex;
|
18
|
+
justify-content: center;
|
19
|
+
& > * {
|
20
|
+
z-index: 2;
|
21
|
+
}
|
18
22
|
}
|
19
23
|
|
20
|
-
.uniformModal-container{
|
21
|
-
|
22
|
-
|
23
|
-
position:relative;
|
24
|
-
margin: auto;
|
25
|
-
background: white;
|
26
|
-
border-radius: 0.25em;
|
27
|
-
max-width: 90%;
|
28
|
-
z-index: 2;
|
29
|
-
&.-fill{
|
30
|
-
width: 90%;
|
31
|
-
}
|
32
|
-
&.-reset{
|
33
|
-
margin: -2em;
|
34
|
-
max-width: none;
|
35
|
-
border-radius: 0;
|
36
|
-
&.-fill{
|
37
|
-
width: 100%;
|
38
|
-
}
|
39
|
-
}
|
24
|
+
.uniformModal-close-container {
|
25
|
+
position: relative;
|
26
|
+
width: 0;
|
40
27
|
}
|
41
28
|
|
42
29
|
.uniformModal-close{
|
43
30
|
z-index: 2;
|
44
|
-
position: absolute;
|
45
|
-
padding: 0.3em;
|
46
|
-
top: 0;
|
47
|
-
right: 0;
|
48
|
-
font-size:1.5em;
|
49
31
|
color: white;
|
50
|
-
opacity: 0.5;
|
51
|
-
line-height:1;
|
52
32
|
cursor: pointer;
|
53
|
-
|
54
|
-
|
33
|
+
position: absolute;
|
34
|
+
bottom: 100%;
|
35
|
+
height: 2em;
|
36
|
+
width: 2em;
|
37
|
+
opacity: 0.5;
|
55
38
|
&:hover{
|
56
39
|
opacity: 1;
|
57
40
|
}
|
@@ -59,19 +42,21 @@
|
|
59
42
|
&:before{
|
60
43
|
content: "";
|
61
44
|
width: 1px;
|
62
|
-
height: 1.
|
63
|
-
|
64
|
-
transform: rotate(-45deg);
|
65
|
-
background: white;
|
45
|
+
height: 1.5em;
|
46
|
+
background: currentColor;
|
66
47
|
position:absolute;
|
67
48
|
left: 50%;
|
68
|
-
top:
|
49
|
+
top: 50%;
|
50
|
+
transform-origin: 50% 50%;
|
51
|
+
transform: translateY(-50%) rotate(-45deg);
|
69
52
|
}
|
70
53
|
&:before{
|
71
|
-
transform: rotate(45deg);
|
54
|
+
transform: translateY(-50%) rotate(45deg);
|
72
55
|
}
|
73
56
|
}
|
74
57
|
|
58
|
+
// TODO replace with backdrop-filter: blur(4px);
|
59
|
+
// when supported by Firefox https://caniuse.com/css-backdrop-filter
|
75
60
|
.uniformModal-blur{
|
76
61
|
top: 0;
|
77
62
|
left: 0;
|
@@ -15,6 +15,12 @@
|
|
15
15
|
box-shadow: 0 0 0 2px rgba(var(--focus-color), 1);
|
16
16
|
}
|
17
17
|
}
|
18
|
+
|
19
|
+
select.uniformInput {
|
20
|
+
padding-right: 1em;
|
21
|
+
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>') no-repeat center right;
|
22
|
+
}
|
23
|
+
|
18
24
|
@include color-rule('.focus') using ($color) {
|
19
25
|
--focus-color: #{red($color)}, #{green($color)}, #{blue($color)};
|
20
26
|
}
|
@@ -124,6 +124,8 @@
|
|
124
124
|
center
|
125
125
|
stretch
|
126
126
|
baseline
|
127
|
+
flex-start
|
128
|
+
flex-end
|
127
129
|
) {
|
128
130
|
@include responsive-rule('justify-#{$selector}') {
|
129
131
|
justify-items: $selector;
|
@@ -139,13 +141,15 @@
|
|
139
141
|
end
|
140
142
|
center
|
141
143
|
stretch
|
144
|
+
flex-start
|
145
|
+
flex-end
|
142
146
|
) {
|
143
147
|
.flex,
|
144
148
|
.grid{
|
145
|
-
@include responsive-rule('justify-#{$selector}') {
|
149
|
+
@include responsive-rule('justify-self-#{$selector}') {
|
146
150
|
justify-self: $selector;
|
147
151
|
}
|
148
|
-
@include responsive-rule('align-#{$selector}') {
|
152
|
+
@include responsive-rule('align-self-#{$selector}') {
|
149
153
|
align-self: $selector;
|
150
154
|
}
|
151
155
|
}
|
@@ -32,6 +32,12 @@
|
|
32
32
|
@include responsive-rule(".min-width-#{$i * 5}-vw"){ min-width: $i * 5vw };
|
33
33
|
@include responsive-rule(".max-width-#{$i * 5}-vw"){ max-width: $i * 5vw };
|
34
34
|
}
|
35
|
+
|
36
|
+
@for $i from 0 through 20 {
|
37
|
+
@include responsive-rule(".height-#{$i * 5}-vh"){ height: $i * 5vh };
|
38
|
+
@include responsive-rule(".min-height-#{$i * 5}-vh"){ min-height: $i * 5vh };
|
39
|
+
@include responsive-rule(".max-height-#{$i * 5}-vh"){ max-height: $i * 5vh };
|
40
|
+
}
|
35
41
|
@include responsive-rule(".height-100-vh"){ height: 100vh; };
|
36
42
|
@include responsive-rule(".min-height-100-vh"){ min-height: 100vh; };
|
37
43
|
@include responsive-rule(".max-height-100-vh"){ max-height: 100vh; };
|
@@ -41,14 +47,14 @@
|
|
41
47
|
//----------------------------------------------------------------
|
42
48
|
@include responsive-rule(".height-auto"){ height: auto; };
|
43
49
|
@include responsive-rule(".height-full"){ height: 100%; };
|
44
|
-
@include responsive-rule(".max-height-auto"){ height: auto; };
|
45
|
-
@include responsive-rule(".max-height-full"){ height: 100%; };
|
46
|
-
@include responsive-rule(".min-height-auto"){ height: auto; };
|
47
|
-
@include responsive-rule(".min-height-full"){ height: 100%; };
|
50
|
+
@include responsive-rule(".max-height-auto"){ max-height: auto; };
|
51
|
+
@include responsive-rule(".max-height-full"){ max-height: 100%; };
|
52
|
+
@include responsive-rule(".min-height-auto"){ min-height: auto; };
|
53
|
+
@include responsive-rule(".min-height-full"){ min-height: 100%; };
|
48
54
|
|
49
55
|
@include responsive-rule(".width-auto"){ width: auto; };
|
50
56
|
@include responsive-rule(".width-full"){ width: 100%; };
|
51
|
-
@include responsive-rule(".max-width-auto"){ width: auto; };
|
52
|
-
@include responsive-rule(".max-width-full"){ width: 100%; };
|
53
|
-
@include responsive-rule(".min-width-auto"){ width: auto; };
|
54
|
-
@include responsive-rule(".min-width-full"){ width: 100%; };
|
57
|
+
@include responsive-rule(".max-width-auto"){ max-width: auto; };
|
58
|
+
@include responsive-rule(".max-width-full"){ max-width: 100%; };
|
59
|
+
@include responsive-rule(".min-width-auto"){ min-width: auto; };
|
60
|
+
@include responsive-rule(".min-width-full"){ min-width: 100%; };
|
data/lib/uniform/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uniform-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.beta8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Ehmke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: 1.3.1
|
112
112
|
requirements: []
|
113
|
-
rubygems_version: 3.2.
|
113
|
+
rubygems_version: 3.2.15
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: Sass UI
|