lexgui 0.1.2 → 0.1.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/build/lexgui.js +31 -18
- package/build/lexgui.module.js +31 -18
- package/examples/area_tabs.html +3 -3
- package/examples/asset_view.html +3 -3
- package/examples/code_editor.html +3 -3
- package/examples/dialogs.html +3 -3
- package/examples/node_graph.html +3 -3
- package/examples/overlay_area.html +3 -3
- package/package.json +1 -1
package/build/lexgui.js
CHANGED
|
@@ -3049,6 +3049,7 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
|
|
|
3049
3049
|
|
|
3050
3050
|
options.placeholder = placeholder.constructor == String ? placeholder : "Filter properties..";
|
|
3051
3051
|
options.skipWidget = options.skipWidget ?? true;
|
|
3052
|
+
options.skipInlineCount = true;
|
|
3052
3053
|
|
|
3053
3054
|
let widget = this.create_widget(null, Widget.TEXT, options);
|
|
3054
3055
|
let element = widget.domEl;
|
|
@@ -3264,6 +3265,7 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
|
|
|
3264
3265
|
* trigger: Choose onchange trigger (default, input) [default]
|
|
3265
3266
|
* inputWidth: Width of the text input
|
|
3266
3267
|
* float: Justify text
|
|
3268
|
+
* skipReset: Don't add the reset value button when value changes
|
|
3267
3269
|
*/
|
|
3268
3270
|
|
|
3269
3271
|
addText( name, value, callback, options = {} ) {
|
|
@@ -3280,7 +3282,7 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
|
|
|
3280
3282
|
let element = widget.domEl;
|
|
3281
3283
|
|
|
3282
3284
|
// Add reset functionality
|
|
3283
|
-
if(widget.name && !(options.
|
|
3285
|
+
if(widget.name && !(options.skipReset ?? false)) {
|
|
3284
3286
|
Panel._add_reset_property(element.domName, function() {
|
|
3285
3287
|
wValue.value = wValue.iValue;
|
|
3286
3288
|
this.style.display = "none";
|
|
@@ -3391,7 +3393,7 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
|
|
|
3391
3393
|
let element = widget.domEl;
|
|
3392
3394
|
|
|
3393
3395
|
// Add reset functionality
|
|
3394
|
-
if(widget.name && !(options.
|
|
3396
|
+
if(widget.name && !(options.skipReset ?? false)) {
|
|
3395
3397
|
Panel._add_reset_property(element.domName, function() {
|
|
3396
3398
|
wValue.value = wValue.iValue;
|
|
3397
3399
|
this.style.display = "none";
|
|
@@ -3719,6 +3721,7 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
|
|
|
3719
3721
|
* @param {*} options:
|
|
3720
3722
|
* filter: Add a search bar to the widget [false]
|
|
3721
3723
|
* disabled: Make the widget disabled [false]
|
|
3724
|
+
* skipReset: Don't add the reset value button when value changes
|
|
3722
3725
|
*/
|
|
3723
3726
|
|
|
3724
3727
|
addDropdown( name, values, value, callback, options = {} ) {
|
|
@@ -3739,7 +3742,7 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
|
|
|
3739
3742
|
let that = this;
|
|
3740
3743
|
|
|
3741
3744
|
// Add reset functionality
|
|
3742
|
-
if(widget.name)
|
|
3745
|
+
if(widget.name && !(options.skipReset ?? false))
|
|
3743
3746
|
{
|
|
3744
3747
|
Panel._add_reset_property(element.domName, function() {
|
|
3745
3748
|
value = wValue.iValue;
|
|
@@ -3750,7 +3753,7 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
|
|
|
3750
3753
|
|
|
3751
3754
|
let container = document.createElement('div');
|
|
3752
3755
|
container.className = "lexdropdown";
|
|
3753
|
-
container.style.width = "calc( 100% - " + LX.DEFAULT_NAME_WIDTH + ")";
|
|
3756
|
+
container.style.width = options.inputWidth || "calc( 100% - " + LX.DEFAULT_NAME_WIDTH + ")";
|
|
3754
3757
|
|
|
3755
3758
|
// Add widget value
|
|
3756
3759
|
let wValue = document.createElement('div');
|
|
@@ -3857,7 +3860,7 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
|
|
|
3857
3860
|
});
|
|
3858
3861
|
|
|
3859
3862
|
// Add string option
|
|
3860
|
-
if(
|
|
3863
|
+
if( iValue.constructor != Object ) {
|
|
3861
3864
|
option.style.flexDirection = 'unset';
|
|
3862
3865
|
option.innerHTML = "<a class='fa-solid fa-check'></a><span>" + iValue + "</span>";
|
|
3863
3866
|
option.value = iValue;
|
|
@@ -3910,6 +3913,7 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
|
|
|
3910
3913
|
* @param {Array of Array} values Array of 2N Arrays of each value of the curve
|
|
3911
3914
|
* @param {Function} callback Callback function on change
|
|
3912
3915
|
* @param {*} options:
|
|
3916
|
+
* skipReset: Don't add the reset value button when value changes
|
|
3913
3917
|
*/
|
|
3914
3918
|
|
|
3915
3919
|
addCurve( name, values, callback, options = {} ) {
|
|
@@ -3935,12 +3939,15 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
|
|
|
3935
3939
|
let defaultValues = JSON.parse(JSON.stringify(values));
|
|
3936
3940
|
|
|
3937
3941
|
// Add reset functionality
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3942
|
+
if( !(options.skipReset ?? false) )
|
|
3943
|
+
{
|
|
3944
|
+
Panel._add_reset_property(element.domName, function(e) {
|
|
3945
|
+
this.style.display = "none";
|
|
3946
|
+
curve_instance.element.value = JSON.parse(JSON.stringify(defaultValues));
|
|
3947
|
+
curve_instance.redraw();
|
|
3948
|
+
that._trigger( new IEvent(name, curve_instance.element.value, e), callback );
|
|
3949
|
+
});
|
|
3950
|
+
}
|
|
3944
3951
|
|
|
3945
3952
|
// Add widget value
|
|
3946
3953
|
|
|
@@ -4134,23 +4141,29 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
|
|
|
4134
4141
|
for( let i = 0; i < values.length; ++i )
|
|
4135
4142
|
{
|
|
4136
4143
|
const value = values[i];
|
|
4137
|
-
|
|
4144
|
+
let baseclass = options.innerValues ? 'dropdown' : value.constructor;
|
|
4138
4145
|
|
|
4139
4146
|
this.sameLine(2);
|
|
4140
4147
|
|
|
4141
4148
|
switch(baseclass)
|
|
4142
4149
|
{
|
|
4143
4150
|
case String:
|
|
4144
|
-
this.addText(i+"", value, function(value, event) {
|
|
4151
|
+
this.addText(i + "", value, function(value, event) {
|
|
4145
4152
|
values[i] = value;
|
|
4146
4153
|
callback( values );
|
|
4147
|
-
}, { nameWidth: itemNameWidth, inputWidth: "95%",
|
|
4154
|
+
}, { nameWidth: itemNameWidth, inputWidth: "95%", skipReset: true });
|
|
4148
4155
|
break;
|
|
4149
4156
|
case Number:
|
|
4150
|
-
this.addNumber(i+"", value, function(value, event) {
|
|
4157
|
+
this.addNumber(i + "", value, function(value, event) {
|
|
4158
|
+
values[i] = value;
|
|
4159
|
+
callback( values );
|
|
4160
|
+
}, { nameWidth: itemNameWidth, inputWidth: "95%", skipReset: true });
|
|
4161
|
+
break;
|
|
4162
|
+
case 'dropdown':
|
|
4163
|
+
this.addDropdown(i + "", options.innerValues, value, function(value, event) {
|
|
4151
4164
|
values[i] = value;
|
|
4152
4165
|
callback( values );
|
|
4153
|
-
}, { nameWidth: itemNameWidth, inputWidth: "95%",
|
|
4166
|
+
}, { nameWidth: itemNameWidth, inputWidth: "95%", skipReset: true });
|
|
4154
4167
|
break;
|
|
4155
4168
|
}
|
|
4156
4169
|
|
|
@@ -4158,11 +4171,11 @@ console.warn( 'Script "build/lexgui.js" is depracated and will be removed soon.
|
|
|
4158
4171
|
values.splice(values.indexOf( value ), 1);
|
|
4159
4172
|
updateItems();
|
|
4160
4173
|
this._trigger( new IEvent(name, values, event), callback );
|
|
4161
|
-
}, { title: "Remove item", className: '
|
|
4174
|
+
}, { title: "Remove item", className: 'micro'} );
|
|
4162
4175
|
}
|
|
4163
4176
|
|
|
4164
4177
|
buttonName = "Add item";
|
|
4165
|
-
buttonName += "<a class='fa-solid fa-plus' style='float:right; margin-right: 6px;'></a>";
|
|
4178
|
+
buttonName += "<a class='fa-solid fa-plus' style='float:right; margin-right: 6px; margin-top: 2px;'></a>";
|
|
4166
4179
|
this.addButton(null, buttonName, (v, event) => {
|
|
4167
4180
|
values.push( "" );
|
|
4168
4181
|
updateItems();
|
package/build/lexgui.module.js
CHANGED
|
@@ -3045,6 +3045,7 @@ class Panel {
|
|
|
3045
3045
|
|
|
3046
3046
|
options.placeholder = placeholder.constructor == String ? placeholder : "Filter properties..";
|
|
3047
3047
|
options.skipWidget = options.skipWidget ?? true;
|
|
3048
|
+
options.skipInlineCount = true;
|
|
3048
3049
|
|
|
3049
3050
|
let widget = this.create_widget(null, Widget.TEXT, options);
|
|
3050
3051
|
let element = widget.domEl;
|
|
@@ -3260,6 +3261,7 @@ class Panel {
|
|
|
3260
3261
|
* trigger: Choose onchange trigger (default, input) [default]
|
|
3261
3262
|
* inputWidth: Width of the text input
|
|
3262
3263
|
* float: Justify text
|
|
3264
|
+
* skipReset: Don't add the reset value button when value changes
|
|
3263
3265
|
*/
|
|
3264
3266
|
|
|
3265
3267
|
addText( name, value, callback, options = {} ) {
|
|
@@ -3276,7 +3278,7 @@ class Panel {
|
|
|
3276
3278
|
let element = widget.domEl;
|
|
3277
3279
|
|
|
3278
3280
|
// Add reset functionality
|
|
3279
|
-
if(widget.name && !(options.
|
|
3281
|
+
if(widget.name && !(options.skipReset ?? false)) {
|
|
3280
3282
|
Panel._add_reset_property(element.domName, function() {
|
|
3281
3283
|
wValue.value = wValue.iValue;
|
|
3282
3284
|
this.style.display = "none";
|
|
@@ -3387,7 +3389,7 @@ class Panel {
|
|
|
3387
3389
|
let element = widget.domEl;
|
|
3388
3390
|
|
|
3389
3391
|
// Add reset functionality
|
|
3390
|
-
if(widget.name && !(options.
|
|
3392
|
+
if(widget.name && !(options.skipReset ?? false)) {
|
|
3391
3393
|
Panel._add_reset_property(element.domName, function() {
|
|
3392
3394
|
wValue.value = wValue.iValue;
|
|
3393
3395
|
this.style.display = "none";
|
|
@@ -3715,6 +3717,7 @@ class Panel {
|
|
|
3715
3717
|
* @param {*} options:
|
|
3716
3718
|
* filter: Add a search bar to the widget [false]
|
|
3717
3719
|
* disabled: Make the widget disabled [false]
|
|
3720
|
+
* skipReset: Don't add the reset value button when value changes
|
|
3718
3721
|
*/
|
|
3719
3722
|
|
|
3720
3723
|
addDropdown( name, values, value, callback, options = {} ) {
|
|
@@ -3735,7 +3738,7 @@ class Panel {
|
|
|
3735
3738
|
let that = this;
|
|
3736
3739
|
|
|
3737
3740
|
// Add reset functionality
|
|
3738
|
-
if(widget.name)
|
|
3741
|
+
if(widget.name && !(options.skipReset ?? false))
|
|
3739
3742
|
{
|
|
3740
3743
|
Panel._add_reset_property(element.domName, function() {
|
|
3741
3744
|
value = wValue.iValue;
|
|
@@ -3746,7 +3749,7 @@ class Panel {
|
|
|
3746
3749
|
|
|
3747
3750
|
let container = document.createElement('div');
|
|
3748
3751
|
container.className = "lexdropdown";
|
|
3749
|
-
container.style.width = "calc( 100% - " + LX.DEFAULT_NAME_WIDTH + ")";
|
|
3752
|
+
container.style.width = options.inputWidth || "calc( 100% - " + LX.DEFAULT_NAME_WIDTH + ")";
|
|
3750
3753
|
|
|
3751
3754
|
// Add widget value
|
|
3752
3755
|
let wValue = document.createElement('div');
|
|
@@ -3853,7 +3856,7 @@ class Panel {
|
|
|
3853
3856
|
});
|
|
3854
3857
|
|
|
3855
3858
|
// Add string option
|
|
3856
|
-
if(
|
|
3859
|
+
if( iValue.constructor != Object ) {
|
|
3857
3860
|
option.style.flexDirection = 'unset';
|
|
3858
3861
|
option.innerHTML = "<a class='fa-solid fa-check'></a><span>" + iValue + "</span>";
|
|
3859
3862
|
option.value = iValue;
|
|
@@ -3906,6 +3909,7 @@ class Panel {
|
|
|
3906
3909
|
* @param {Array of Array} values Array of 2N Arrays of each value of the curve
|
|
3907
3910
|
* @param {Function} callback Callback function on change
|
|
3908
3911
|
* @param {*} options:
|
|
3912
|
+
* skipReset: Don't add the reset value button when value changes
|
|
3909
3913
|
*/
|
|
3910
3914
|
|
|
3911
3915
|
addCurve( name, values, callback, options = {} ) {
|
|
@@ -3931,12 +3935,15 @@ class Panel {
|
|
|
3931
3935
|
let defaultValues = JSON.parse(JSON.stringify(values));
|
|
3932
3936
|
|
|
3933
3937
|
// Add reset functionality
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3938
|
+
if( !(options.skipReset ?? false) )
|
|
3939
|
+
{
|
|
3940
|
+
Panel._add_reset_property(element.domName, function(e) {
|
|
3941
|
+
this.style.display = "none";
|
|
3942
|
+
curve_instance.element.value = JSON.parse(JSON.stringify(defaultValues));
|
|
3943
|
+
curve_instance.redraw();
|
|
3944
|
+
that._trigger( new IEvent(name, curve_instance.element.value, e), callback );
|
|
3945
|
+
});
|
|
3946
|
+
}
|
|
3940
3947
|
|
|
3941
3948
|
// Add widget value
|
|
3942
3949
|
|
|
@@ -4130,23 +4137,29 @@ class Panel {
|
|
|
4130
4137
|
for( let i = 0; i < values.length; ++i )
|
|
4131
4138
|
{
|
|
4132
4139
|
const value = values[i];
|
|
4133
|
-
|
|
4140
|
+
let baseclass = options.innerValues ? 'dropdown' : value.constructor;
|
|
4134
4141
|
|
|
4135
4142
|
this.sameLine(2);
|
|
4136
4143
|
|
|
4137
4144
|
switch(baseclass)
|
|
4138
4145
|
{
|
|
4139
4146
|
case String:
|
|
4140
|
-
this.addText(i+"", value, function(value, event) {
|
|
4147
|
+
this.addText(i + "", value, function(value, event) {
|
|
4141
4148
|
values[i] = value;
|
|
4142
4149
|
callback( values );
|
|
4143
|
-
}, { nameWidth: itemNameWidth, inputWidth: "95%",
|
|
4150
|
+
}, { nameWidth: itemNameWidth, inputWidth: "95%", skipReset: true });
|
|
4144
4151
|
break;
|
|
4145
4152
|
case Number:
|
|
4146
|
-
this.addNumber(i+"", value, function(value, event) {
|
|
4153
|
+
this.addNumber(i + "", value, function(value, event) {
|
|
4154
|
+
values[i] = value;
|
|
4155
|
+
callback( values );
|
|
4156
|
+
}, { nameWidth: itemNameWidth, inputWidth: "95%", skipReset: true });
|
|
4157
|
+
break;
|
|
4158
|
+
case 'dropdown':
|
|
4159
|
+
this.addDropdown(i + "", options.innerValues, value, function(value, event) {
|
|
4147
4160
|
values[i] = value;
|
|
4148
4161
|
callback( values );
|
|
4149
|
-
}, { nameWidth: itemNameWidth, inputWidth: "95%",
|
|
4162
|
+
}, { nameWidth: itemNameWidth, inputWidth: "95%", skipReset: true });
|
|
4150
4163
|
break;
|
|
4151
4164
|
}
|
|
4152
4165
|
|
|
@@ -4154,11 +4167,11 @@ class Panel {
|
|
|
4154
4167
|
values.splice(values.indexOf( value ), 1);
|
|
4155
4168
|
updateItems();
|
|
4156
4169
|
this._trigger( new IEvent(name, values, event), callback );
|
|
4157
|
-
}, { title: "Remove item", className: '
|
|
4170
|
+
}, { title: "Remove item", className: 'micro'} );
|
|
4158
4171
|
}
|
|
4159
4172
|
|
|
4160
4173
|
buttonName = "Add item";
|
|
4161
|
-
buttonName += "<a class='fa-solid fa-plus' style='float:right; margin-right: 6px;'></a>";
|
|
4174
|
+
buttonName += "<a class='fa-solid fa-plus' style='float:right; margin-right: 6px; margin-top: 2px;'></a>";
|
|
4162
4175
|
this.addButton(null, buttonName, (v, event) => {
|
|
4163
4176
|
values.push( "" );
|
|
4164
4177
|
updateItems();
|
package/examples/area_tabs.html
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
5
5
|
<title>LexGUI Area Tabs Demo</title>
|
|
6
|
-
<link rel="stylesheet" href="
|
|
6
|
+
<link rel="stylesheet" href="../build/lexgui.css">
|
|
7
7
|
<link rel="icon" href="../images/icon.png">
|
|
8
8
|
<script type="importmap">
|
|
9
9
|
{
|
|
10
10
|
"imports": {
|
|
11
|
-
"lexgui": "
|
|
12
|
-
"lexgui/components/": "
|
|
11
|
+
"lexgui": "../build/lexgui.module.js",
|
|
12
|
+
"lexgui/components/": "../build/components/"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
</script>
|
package/examples/asset_view.html
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
5
5
|
<title>LexGUI AssetView Demo</title>
|
|
6
|
-
<link rel="stylesheet" href="
|
|
6
|
+
<link rel="stylesheet" href="../build/lexgui.css">
|
|
7
7
|
<link rel="icon" href="../images/icon.png">
|
|
8
8
|
<script type="importmap">
|
|
9
9
|
{
|
|
10
10
|
"imports": {
|
|
11
|
-
"lexgui": "
|
|
12
|
-
"lexgui/components/": "
|
|
11
|
+
"lexgui": "../build/lexgui.module.js",
|
|
12
|
+
"lexgui/components/": "../build/components/"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
</script>
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
5
5
|
<title>LexGUI Code Editor Demo</title>
|
|
6
|
-
<link rel="stylesheet" href="
|
|
6
|
+
<link rel="stylesheet" href="../build/lexgui.css">
|
|
7
7
|
<link rel="icon" href="../images/icon.png">
|
|
8
8
|
<script type="importmap">
|
|
9
9
|
{
|
|
10
10
|
"imports": {
|
|
11
|
-
"lexgui": "
|
|
12
|
-
"lexgui/components/": "
|
|
11
|
+
"lexgui": "../build/lexgui.module.js",
|
|
12
|
+
"lexgui/components/": "../build/components/"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
</script>
|
package/examples/dialogs.html
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
5
5
|
<title>LexGUI Dialogs Demo</title>
|
|
6
|
-
<link rel="stylesheet" href="
|
|
6
|
+
<link rel="stylesheet" href="../build/lexgui.css">
|
|
7
7
|
<link rel="icon" href="../images/icon.png">
|
|
8
8
|
<script type="importmap">
|
|
9
9
|
{
|
|
10
10
|
"imports": {
|
|
11
|
-
"lexgui": "
|
|
12
|
-
"lexgui/components/": "
|
|
11
|
+
"lexgui": "../build/lexgui.module.js",
|
|
12
|
+
"lexgui/components/": "../build/components/"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
</script>
|
package/examples/node_graph.html
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
5
5
|
<title>LexGUI Node Graph Demo</title>
|
|
6
|
-
<link rel="stylesheet" href="
|
|
6
|
+
<link rel="stylesheet" href="../build/lexgui.css">
|
|
7
7
|
<link rel="icon" href="../images/icon.png">
|
|
8
8
|
<script type="importmap">
|
|
9
9
|
{
|
|
10
10
|
"imports": {
|
|
11
|
-
"lexgui": "
|
|
12
|
-
"lexgui/components/": "
|
|
11
|
+
"lexgui": "../build/lexgui.module.js",
|
|
12
|
+
"lexgui/components/": "../build/components/"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
</script>
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
5
5
|
<title>LexGUI Overlay Timeline Demo</title>
|
|
6
|
-
<link rel="stylesheet" href="
|
|
6
|
+
<link rel="stylesheet" href="../build/lexgui.css">
|
|
7
7
|
<link rel="icon" href="../images/icon.png">
|
|
8
8
|
<script type="importmap">
|
|
9
9
|
{
|
|
10
10
|
"imports": {
|
|
11
|
-
"lexgui": "
|
|
12
|
-
"lexgui/components/": "
|
|
11
|
+
"lexgui": "../build/lexgui.module.js",
|
|
12
|
+
"lexgui/components/": "../build/components/"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
</script>
|