Skip to content

Commit 39501e7

Browse files
committed
upd
1 parent ec3295e commit 39501e7

File tree

4 files changed

+1108
-1103
lines changed

4 files changed

+1108
-1103
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Settings
2-
version=1.3.12
2+
version=1.3.13
33
author=AlexGyver <[email protected]>
44
maintainer=AlexGyver <[email protected]>
55
sentence=Simple UI webface builder for esp8266/esp32

src/core/SettingsBase.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,6 @@ class SettingsBase {
517517
p[Code::uptime] = millis() / 1000;
518518
p[Code::mac] = getMac();
519519
p[Code::local_ip] = getIP().toString();
520-
p[Code::s_ver] = SETTINGS_VER;
521520
if (_f_ver) p[Code::f_ver] = _f_ver;
522521
if (custom.p) p[Code::custom_hash] = custom.hash;
523522
if (_title.length()) p[Code::title] = _title;

src/core/builder.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,12 +425,16 @@ class Builder {
425425

426426
// ================= PASS =================
427427
// ввод пароля [результат - строка], подключаемая переменная - любой тип
428-
bool Pass(size_t id, Text label = "", AnyPtr value = nullptr) {
429-
_widget(Code::pass, id, label, value);
428+
bool Pass(size_t id, Text label = "", AnyPtr value = nullptr, Text regex = Text(), Text format = Text()) {
429+
if (_beginWidget(Code::pass, id, label, value)) {
430+
if (regex) (*p)[Code::regex] = regex;
431+
if (format) (*p)[Code::format] = format;
432+
_endWidget();
433+
}
430434
return _isSet(id, value);
431435
}
432-
bool Pass(Text label = "", AnyPtr value = nullptr) {
433-
return Pass(_next(), label, value);
436+
bool Pass(Text label = "", AnyPtr value = nullptr, Text regex = Text(), Text format = Text()) {
437+
return Pass(_next(), label, value, regex, format);
434438
}
435439

436440
// ================= COLOR =================
@@ -499,8 +503,8 @@ class Builder {
499503
// сипннер [результат - число], подключаемая переменная - любой тип
500504
bool Spinner(size_t id, Text label = "", float min = 0, float max = 100, float step = 1, AnyPtr value = nullptr) {
501505
if (_beginWidget(Code::spinner, id, label, value)) {
502-
(*p)[Code::min] = min;
503-
(*p)[Code::max] = max;
506+
if (!isnan(min)) (*p)[Code::min] = min;
507+
if (!isnan(max)) (*p)[Code::max] = max;
504508
(*p)[Code::step] = step;
505509
_endWidget();
506510
}

0 commit comments

Comments
 (0)