rmr-util 1.1.137 → 1.1.140
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/docs/index.html +7 -2
- package/index.js +11 -7
- package/package.json +1 -1
- package/src/styles/_rmr-reset.scss +8 -4
- package/src/styles/rmr-util.scss +14 -0
package/docs/index.html
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
|
|
6
6
|
<title>rmr-util</title>
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
<!--
|
|
8
|
+
<link rel="stylesheet" type="text/css" href="https://davidfmiller.github.io/man/man.css">
|
|
9
|
+
-->
|
|
9
10
|
<link rel="stylesheet" type="text/css" href="build/rmr-util.css?bust=0">
|
|
10
11
|
|
|
11
12
|
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
|
@@ -101,6 +102,10 @@
|
|
|
101
102
|
<form class="xhr" action="xhr/form.php" method="get" enctype="application/x-www-form-urlencoded">
|
|
102
103
|
<input type="checkbox" name="check" value="rmr">
|
|
103
104
|
<input type="text" name="text" value="" placeholder="text">
|
|
105
|
+
<select multiple name="select">
|
|
106
|
+
<option value="1">1</option>
|
|
107
|
+
<option value="2">2</option>
|
|
108
|
+
</select>
|
|
104
109
|
<textarea name="textarea" placeholder="text"></textarea>
|
|
105
110
|
<button class="">Submit</button>
|
|
106
111
|
</form>
|
package/index.js
CHANGED
|
@@ -915,16 +915,11 @@
|
|
|
915
915
|
return {};
|
|
916
916
|
}
|
|
917
917
|
|
|
918
|
-
if (typeof FormData !== 'undefined') {
|
|
919
|
-
// const f = new FormData(form);
|
|
920
|
-
// console.log(f);
|
|
921
|
-
// return f;
|
|
922
|
-
}
|
|
923
918
|
|
|
924
919
|
const
|
|
925
920
|
inputs = form.querySelectorAll('select,input,textarea'),
|
|
926
921
|
params = {};
|
|
927
|
-
|
|
922
|
+
//
|
|
928
923
|
for (const i in inputs) {
|
|
929
924
|
if (! objectHas(inputs, i)) {
|
|
930
925
|
continue;
|
|
@@ -933,7 +928,7 @@
|
|
|
933
928
|
name = inputs[i].getAttribute('name'),
|
|
934
929
|
type = inputs[i].type ? inputs[i].type : 'text';
|
|
935
930
|
|
|
936
|
-
if (inputs[i].hasAttribute('disabled')) {
|
|
931
|
+
if (inputs[i].hasAttribute('disabled') || !name) {
|
|
937
932
|
continue;
|
|
938
933
|
}
|
|
939
934
|
|
|
@@ -941,6 +936,15 @@
|
|
|
941
936
|
if (inputs[i].checked) {
|
|
942
937
|
params[name] = inputs[i].value;
|
|
943
938
|
}
|
|
939
|
+
} else if ((type === 'select' || type === 'select-multiple') && inputs[i].hasAttribute('multiple')) {
|
|
940
|
+
|
|
941
|
+
let arr = [];
|
|
942
|
+
const opts = inputs[i].querySelectorAll('option:checked');
|
|
943
|
+
opts.forEach((o) => {
|
|
944
|
+
arr.push(o.value);
|
|
945
|
+
});
|
|
946
|
+
params[name] = arr;
|
|
947
|
+
|
|
944
948
|
} else {
|
|
945
949
|
params[name] = inputs[i].value;
|
|
946
950
|
}
|
package/package.json
CHANGED
package/src/styles/rmr-util.scss
CHANGED
|
@@ -56,6 +56,20 @@ div.grecaptcha-badge {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
&[data-rmr-aspect="32-9"] {
|
|
60
|
+
&:before {
|
|
61
|
+
padding-bottom: 28.125%;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
&[data-rmr-aspect="7-3"] {
|
|
67
|
+
&:before {
|
|
68
|
+
padding-bottom: 42.8571428571%;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
59
73
|
& > svg,
|
|
60
74
|
& > div,
|
|
61
75
|
& > img,
|