muigui 0.0.2 → 0.0.3
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/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muigui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "A Simple GUI",
|
|
5
5
|
"main": "muigui.js",
|
|
6
6
|
"module": "src/muigui.js",
|
|
7
|
+
"type": "module",
|
|
7
8
|
"scripts": {
|
|
8
|
-
"build": "npm run build-
|
|
9
|
+
"build": "npm run build-normal",
|
|
9
10
|
"build-normal": "rollup -c",
|
|
10
11
|
"build-min": "rollup -c",
|
|
11
12
|
"eslint": "eslint \"**/*.js\"",
|
|
@@ -35,9 +36,9 @@
|
|
|
35
36
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
36
37
|
"@rollup/plugin-terser": "^0.4.0",
|
|
37
38
|
"eslint": "^8.20.0",
|
|
38
|
-
"eslint-plugin-html": "^
|
|
39
|
+
"eslint-plugin-html": "^7.1.0",
|
|
39
40
|
"eslint-plugin-optional-comma-spacing": "0.0.4",
|
|
40
41
|
"eslint-plugin-require-trailing-comma": "0.0.1",
|
|
41
|
-
"rollup": "^
|
|
42
|
+
"rollup": "^3.20.2"
|
|
42
43
|
}
|
|
43
44
|
}
|
|
@@ -28,6 +28,12 @@ export function createController(object, property, ...args) {
|
|
|
28
28
|
const t = typeof object[property];
|
|
29
29
|
switch (t) {
|
|
30
30
|
case 'number':
|
|
31
|
+
if (typeof args[0] === 'number' && typeof args[1] === 'number') {
|
|
32
|
+
const min = args[0];
|
|
33
|
+
const max = args[1];
|
|
34
|
+
const step = args[2];
|
|
35
|
+
return new Range(object, property, {min, max, ...(step && {step})});
|
|
36
|
+
}
|
|
31
37
|
return args.length === 0
|
|
32
38
|
? new TextNumber(object, property, ...args)
|
|
33
39
|
: new Range(object, property, ...args);
|
package/src/styles/muigui.css.js
CHANGED
|
@@ -2,6 +2,7 @@ const css = `
|
|
|
2
2
|
.muigui {
|
|
3
3
|
--width: 250px;
|
|
4
4
|
--label-width: 45%;
|
|
5
|
+
--number-width: 40%;
|
|
5
6
|
|
|
6
7
|
--bg-color: #222222;
|
|
7
8
|
--color: #dddddd;
|
|
@@ -182,10 +183,10 @@ const css = `
|
|
|
182
183
|
min-width: 0;
|
|
183
184
|
}
|
|
184
185
|
.muigui-value>*:nth-child(1) {
|
|
185
|
-
flex: 1 1
|
|
186
|
+
flex: 1 1 calc(100% - var(--number-width));
|
|
186
187
|
}
|
|
187
188
|
.muigui-value>*:nth-child(2) {
|
|
188
|
-
flex: 1 1
|
|
189
|
+
flex: 1 1 var(--number-width);
|
|
189
190
|
margin-left: 0.2em;
|
|
190
191
|
}
|
|
191
192
|
|