conexys-elements 1.1.23 → 1.1.27
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/README.md +4 -2
- package/dist/components/AppFormFields.d.ts.map +1 -1
- package/dist/components/AppFormFieldsFromConfig.d.ts.map +1 -1
- package/dist/components/AppFormFieldsNoUser.d.ts.map +1 -1
- package/dist/components/AppFormFieldsTable.d.ts.map +1 -1
- package/dist/components/form/RenderForm.d.ts.map +1 -1
- package/dist/components/form/components/FormLogin.d.ts.map +1 -1
- package/dist/components/form/components/InputDate.d.ts +5 -0
- package/dist/components/form/components/InputDate.d.ts.map +1 -0
- package/dist/components/form/components/InputPassword.d.ts.map +1 -1
- package/dist/components/form/components/InputText.d.ts.map +1 -1
- package/dist/components/form/components/index.d.ts +2 -1
- package/dist/components/form/components/index.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +180 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +180 -19
- package/dist/index.js.map +1 -1
- package/dist/types/components/appFormFields.types.d.ts +1 -0
- package/dist/types/components/appFormFields.types.d.ts.map +1 -1
- package/dist/types/components/appFormFieldsFromConfig.types.d.ts +1 -0
- package/dist/types/components/appFormFieldsFromConfig.types.d.ts.map +1 -1
- package/dist/types/components/appFormFieldsNoUser.types.d.ts +1 -0
- package/dist/types/components/appFormFieldsNoUser.types.d.ts.map +1 -1
- package/dist/types/components/appFormFieldsTable.types.d.ts +1 -0
- package/dist/types/components/appFormFieldsTable.types.d.ts.map +1 -1
- package/dist/types/components/form.types.d.ts +21 -0
- package/dist/types/components/form.types.d.ts.map +1 -1
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -41,8 +41,15 @@ var Checkboxmui = require('@mui/material/Checkbox');
|
|
|
41
41
|
var FormControlLabel = require('@mui/material/FormControlLabel');
|
|
42
42
|
var reactHookForm = require('react-hook-form');
|
|
43
43
|
var Button$3 = require('@mui/material/Button');
|
|
44
|
-
var
|
|
44
|
+
var Visibility = require('@mui/icons-material/Visibility');
|
|
45
|
+
var VisibilityOff = require('@mui/icons-material/VisibilityOff');
|
|
46
|
+
var AdapterDayjs = require('@mui/x-date-pickers/AdapterDayjs');
|
|
47
|
+
var LocalizationProvider = require('@mui/x-date-pickers/LocalizationProvider');
|
|
48
|
+
var DatePicker = require('@mui/x-date-pickers/DatePicker');
|
|
45
49
|
var InputLabel = require('@mui/material/InputLabel');
|
|
50
|
+
var dayjs = require('dayjs');
|
|
51
|
+
var TextField = require('@mui/material/TextField');
|
|
52
|
+
var InputAdornment = require('@mui/material/InputAdornment');
|
|
46
53
|
var JoditEditor = require('jodit-react');
|
|
47
54
|
var Radio = require('@mui/material/Radio');
|
|
48
55
|
var RadioGroup = require('@mui/material/RadioGroup');
|
|
@@ -4188,6 +4195,7 @@ function AppFormFields({
|
|
|
4188
4195
|
maxLength: block.maxlength,
|
|
4189
4196
|
pattern: block.pattern
|
|
4190
4197
|
},
|
|
4198
|
+
showPasswordToggle: block.showPasswordToggle,
|
|
4191
4199
|
items: block.items
|
|
4192
4200
|
}, 'form')), additionalfields1.content.body.map(block => RenderForm({
|
|
4193
4201
|
component: block.component,
|
|
@@ -4211,6 +4219,7 @@ function AppFormFields({
|
|
|
4211
4219
|
maxLength: block.maxlength,
|
|
4212
4220
|
pattern: block.pattern
|
|
4213
4221
|
},
|
|
4222
|
+
showPasswordToggle: block.showPasswordToggle,
|
|
4214
4223
|
items: block.items
|
|
4215
4224
|
}, 'form')), children);
|
|
4216
4225
|
}
|
|
@@ -4285,6 +4294,7 @@ function AppFormFieldsFromConfig({
|
|
|
4285
4294
|
maxLength: block.maxlength || block.validate && block.validate.maxLength,
|
|
4286
4295
|
pattern: block.pattern || block.validate && block.validate.pattern
|
|
4287
4296
|
},
|
|
4297
|
+
showPasswordToggle: block.showPasswordToggle,
|
|
4288
4298
|
items: block.items || []
|
|
4289
4299
|
}, nouser || 'user')));
|
|
4290
4300
|
}
|
|
@@ -4644,6 +4654,7 @@ function AppFormFieldsNoUser({
|
|
|
4644
4654
|
maxLength: block.maxlength,
|
|
4645
4655
|
pattern: block.pattern
|
|
4646
4656
|
},
|
|
4657
|
+
showPasswordToggle: block.showPasswordToggle,
|
|
4647
4658
|
items: block.items
|
|
4648
4659
|
}, 'nouser')), additionalfields1.content.body.map(block => RenderForm({
|
|
4649
4660
|
component: block.component,
|
|
@@ -4667,6 +4678,7 @@ function AppFormFieldsNoUser({
|
|
|
4667
4678
|
maxLength: block.maxlength,
|
|
4668
4679
|
pattern: block.pattern
|
|
4669
4680
|
},
|
|
4681
|
+
showPasswordToggle: block.showPasswordToggle,
|
|
4670
4682
|
items: block.items
|
|
4671
4683
|
}, 'nouser')), children);
|
|
4672
4684
|
}
|
|
@@ -4820,6 +4832,7 @@ function AppFormFieldsTable({
|
|
|
4820
4832
|
maxLength: block.maxlength || block.validate && block.validate.maxLength,
|
|
4821
4833
|
pattern: block.pattern || block.validate && block.validate.pattern
|
|
4822
4834
|
},
|
|
4835
|
+
showPasswordToggle: block.showPasswordToggle,
|
|
4823
4836
|
items: block.items || [],
|
|
4824
4837
|
itemID: id1,
|
|
4825
4838
|
adminCheck: show === 'admin'
|
|
@@ -4851,6 +4864,7 @@ function AppFormFieldsTable({
|
|
|
4851
4864
|
maxLength: block.maxlength || block.validate && block.validate.maxLength,
|
|
4852
4865
|
pattern: block.pattern || block.validate && block.validate.pattern
|
|
4853
4866
|
},
|
|
4867
|
+
showPasswordToggle: block.showPasswordToggle,
|
|
4854
4868
|
items: block.items || [],
|
|
4855
4869
|
itemID: id1,
|
|
4856
4870
|
adminCheck: show === 'admin'
|
|
@@ -10312,6 +10326,11 @@ const FormLogin = ({
|
|
|
10312
10326
|
const [trigger1, setTrigger1] = React.useState(0);
|
|
10313
10327
|
const [trigger2, setTrigger2] = React.useState(0);
|
|
10314
10328
|
const [isChecked, setIsChecked] = React.useState(false);
|
|
10329
|
+
const showToggle = block.showPasswordToggle === true;
|
|
10330
|
+
const [showPassword, setShowPassword] = React.useState(false);
|
|
10331
|
+
const [showConfirmation, setShowConfirmation] = React.useState(false);
|
|
10332
|
+
const handleTogglePassword = () => setShowPassword(v => !v);
|
|
10333
|
+
const handleToggleConfirmation = () => setShowConfirmation(v => !v);
|
|
10315
10334
|
const handleChange = () => {
|
|
10316
10335
|
setIsChecked(current => !current);
|
|
10317
10336
|
};
|
|
@@ -10360,7 +10379,7 @@ const FormLogin = ({
|
|
|
10360
10379
|
}, block.label)), /*#__PURE__*/React.createElement("div", {
|
|
10361
10380
|
className: "input-group"
|
|
10362
10381
|
}, /*#__PURE__*/React.createElement("input", {
|
|
10363
|
-
type: block.type,
|
|
10382
|
+
type: showToggle && showPassword ? 'text' : block.type,
|
|
10364
10383
|
value: block.value || '',
|
|
10365
10384
|
name: block.name,
|
|
10366
10385
|
onChange: block.onChange,
|
|
@@ -10370,7 +10389,13 @@ const FormLogin = ({
|
|
|
10370
10389
|
className: "input-group-text"
|
|
10371
10390
|
}, /*#__PURE__*/React.createElement("i", {
|
|
10372
10391
|
className: "bx bx-lock text-4"
|
|
10373
|
-
}))
|
|
10392
|
+
})), showToggle && (/*#__PURE__*/React.createElement("button", {
|
|
10393
|
+
type: "button",
|
|
10394
|
+
className: "input-group-text password-toggle-btn",
|
|
10395
|
+
onClick: handleTogglePassword,
|
|
10396
|
+
"aria-label": t('System.show_password'),
|
|
10397
|
+
tabIndex: -1
|
|
10398
|
+
}, showPassword ? /*#__PURE__*/React.createElement(VisibilityOff, null) : /*#__PURE__*/React.createElement(Visibility, null)))), /*#__PURE__*/React.createElement(reactRouterDom.NavLink, {
|
|
10374
10399
|
to: forgot_passworddir,
|
|
10375
10400
|
className: "float-end"
|
|
10376
10401
|
}, t('login.recover_password')));
|
|
@@ -10474,15 +10499,23 @@ const FormLogin = ({
|
|
|
10474
10499
|
className: "col-sm-6 mb-3"
|
|
10475
10500
|
}, /*#__PURE__*/React.createElement("label", null, labels[1]), /*#__PURE__*/React.createElement("span", {
|
|
10476
10501
|
className: "required"
|
|
10477
|
-
}, "*"), /*#__PURE__*/React.createElement("
|
|
10502
|
+
}, "*"), /*#__PURE__*/React.createElement("div", {
|
|
10503
|
+
className: "input-group"
|
|
10504
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
10478
10505
|
id: ids[1],
|
|
10479
|
-
type:
|
|
10506
|
+
type: showToggle && showPassword ? 'text' : 'password',
|
|
10480
10507
|
className: errors.password ? 'form-control form-control-lg is-invalid' : 'form-control form-control-lg',
|
|
10481
10508
|
...register('password', {
|
|
10482
10509
|
required: true,
|
|
10483
10510
|
minLength: 5
|
|
10484
10511
|
})
|
|
10485
|
-
}),
|
|
10512
|
+
}), showToggle && (/*#__PURE__*/React.createElement("button", {
|
|
10513
|
+
type: "button",
|
|
10514
|
+
className: "input-group-text password-toggle-btn",
|
|
10515
|
+
onClick: handleTogglePassword,
|
|
10516
|
+
"aria-label": t('System.show_password'),
|
|
10517
|
+
tabIndex: -1
|
|
10518
|
+
}, showPassword ? /*#__PURE__*/React.createElement(VisibilityOff, null) : /*#__PURE__*/React.createElement(Visibility, null)))), errors.password?.type === 'required' && (/*#__PURE__*/React.createElement("em", {
|
|
10486
10519
|
className: "error invalid-feedback"
|
|
10487
10520
|
}, t('error.please_enter_password'))), errors.password?.type === 'minLength' && (/*#__PURE__*/React.createElement("em", {
|
|
10488
10521
|
className: "error invalid-feedback"
|
|
@@ -10490,16 +10523,24 @@ const FormLogin = ({
|
|
|
10490
10523
|
className: "col-sm-6 mb-3"
|
|
10491
10524
|
}, /*#__PURE__*/React.createElement("label", null, labels[2]), /*#__PURE__*/React.createElement("span", {
|
|
10492
10525
|
className: "required"
|
|
10493
|
-
}, "*"), /*#__PURE__*/React.createElement("
|
|
10526
|
+
}, "*"), /*#__PURE__*/React.createElement("div", {
|
|
10527
|
+
className: "input-group"
|
|
10528
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
10494
10529
|
id: ids[2],
|
|
10495
|
-
type:
|
|
10530
|
+
type: showToggle && showConfirmation ? 'text' : 'password',
|
|
10496
10531
|
className: errors.password_confirmation ? 'form-control form-control-lg is-invalid' : 'form-control form-control-lg',
|
|
10497
10532
|
...register('password_confirmation', {
|
|
10498
10533
|
required: true,
|
|
10499
10534
|
minLength: 5,
|
|
10500
10535
|
validate: value => value === password.current || t('error.passwords_do_not_match')
|
|
10501
10536
|
})
|
|
10502
|
-
}),
|
|
10537
|
+
}), showToggle && (/*#__PURE__*/React.createElement("button", {
|
|
10538
|
+
type: "button",
|
|
10539
|
+
className: "input-group-text password-toggle-btn",
|
|
10540
|
+
onClick: handleToggleConfirmation,
|
|
10541
|
+
"aria-label": t('System.show_password'),
|
|
10542
|
+
tabIndex: -1
|
|
10543
|
+
}, showConfirmation ? /*#__PURE__*/React.createElement(VisibilityOff, null) : /*#__PURE__*/React.createElement(Visibility, null)))), errors.password_confirmation?.type === 'required' && (/*#__PURE__*/React.createElement("em", {
|
|
10503
10544
|
className: "error invalid-feedback"
|
|
10504
10545
|
}, t('error.repeat_password'))), errors.password_confirmation?.type === 'minLength' && (/*#__PURE__*/React.createElement("em", {
|
|
10505
10546
|
className: "error invalid-feedback"
|
|
@@ -10778,11 +10819,78 @@ const InputFile = ({
|
|
|
10778
10819
|
}, fileName))));
|
|
10779
10820
|
};
|
|
10780
10821
|
|
|
10822
|
+
const toDayjsValue = raw => {
|
|
10823
|
+
if (raw == null || raw === '') return null;
|
|
10824
|
+
if (dayjs.isDayjs(raw)) return raw;
|
|
10825
|
+
if (typeof raw === 'string') {
|
|
10826
|
+
const parsed = dayjs(raw.trim());
|
|
10827
|
+
if (parsed.isValid()) return parsed;
|
|
10828
|
+
const fromDisplay = dayjs(raw.trim(), 'DD/MM/YYYY');
|
|
10829
|
+
if (fromDisplay.isValid()) return fromDisplay;
|
|
10830
|
+
return null;
|
|
10831
|
+
}
|
|
10832
|
+
return null;
|
|
10833
|
+
};
|
|
10834
|
+
const InputDate = /*#__PURE__*/React.memo(({
|
|
10835
|
+
block
|
|
10836
|
+
}) => {
|
|
10837
|
+
const configLogs = useConexysConfig();
|
|
10838
|
+
const [t] = reactI18next.useTranslation('global');
|
|
10839
|
+
const currentValue = toDayjsValue(block.value);
|
|
10840
|
+
const handleChange = newValue => {
|
|
10841
|
+
if (!block.onChange) return;
|
|
10842
|
+
const syntheticEvent = {
|
|
10843
|
+
target: {
|
|
10844
|
+
name: block.name,
|
|
10845
|
+
value: newValue ? newValue.format('YYYY-MM-DD') : ''
|
|
10846
|
+
}
|
|
10847
|
+
};
|
|
10848
|
+
block.onChange(syntheticEvent);
|
|
10849
|
+
};
|
|
10850
|
+
const handleError = err => {
|
|
10851
|
+
const error = err;
|
|
10852
|
+
if (error?.response?.status === 401) Uservalidationerror(configLogs);
|
|
10853
|
+
};
|
|
10854
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10855
|
+
className: `form-group ${block.ref ?? ''}`
|
|
10856
|
+
}, /*#__PURE__*/React.createElement(InputLabel, {
|
|
10857
|
+
htmlFor: block.id
|
|
10858
|
+
}, block.label, block.validate?.required && /*#__PURE__*/React.createElement("span", {
|
|
10859
|
+
className: "required"
|
|
10860
|
+
}, "*")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LocalizationProvider.LocalizationProvider, {
|
|
10861
|
+
dateAdapter: AdapterDayjs.AdapterDayjs
|
|
10862
|
+
}, /*#__PURE__*/React.createElement(DatePicker.DatePicker, {
|
|
10863
|
+
label: block.placeholder ?? block.label,
|
|
10864
|
+
value: currentValue,
|
|
10865
|
+
onChange: handleChange,
|
|
10866
|
+
slotProps: {
|
|
10867
|
+
textField: {
|
|
10868
|
+
id: block.id,
|
|
10869
|
+
name: block.name,
|
|
10870
|
+
size: 'small',
|
|
10871
|
+
fullWidth: true,
|
|
10872
|
+
required: block.validate?.required,
|
|
10873
|
+
error: Boolean(block.error),
|
|
10874
|
+
helperText: block.helperText
|
|
10875
|
+
}
|
|
10876
|
+
},
|
|
10877
|
+
format: "DD/MM/YYYY",
|
|
10878
|
+
onError: handleError
|
|
10879
|
+
}))));
|
|
10880
|
+
}, (prevProps, nextProps) => {
|
|
10881
|
+
return prevProps.block.value === nextProps.block.value && prevProps.block.name === nextProps.block.name && prevProps.block.label === nextProps.block.label && prevProps.block.onChange === nextProps.block.onChange;
|
|
10882
|
+
});
|
|
10883
|
+
|
|
10781
10884
|
const InputPassword = ({
|
|
10782
10885
|
block,
|
|
10783
10886
|
inParagraph = false
|
|
10784
10887
|
}) => {
|
|
10785
10888
|
const [t] = reactI18next.useTranslation('global');
|
|
10889
|
+
const showToggle = block.showPasswordToggle === true;
|
|
10890
|
+
const [showPassword, setShowPassword] = React.useState(false);
|
|
10891
|
+
const [showConfirmation, setShowConfirmation] = React.useState(false);
|
|
10892
|
+
const handleTogglePassword = () => setShowPassword(v => !v);
|
|
10893
|
+
const handleToggleConfirmation = () => setShowConfirmation(v => !v);
|
|
10786
10894
|
const {
|
|
10787
10895
|
register,
|
|
10788
10896
|
formState: {
|
|
@@ -10816,7 +10924,7 @@ const InputPassword = ({
|
|
|
10816
10924
|
}, block.label, block.validate.required && /*#__PURE__*/React.createElement("span", {
|
|
10817
10925
|
className: "required"
|
|
10818
10926
|
}, "*")), /*#__PURE__*/React.createElement("input", {
|
|
10819
|
-
type:
|
|
10927
|
+
type: showToggle && showPassword ? 'text' : 'password',
|
|
10820
10928
|
id: block.id,
|
|
10821
10929
|
className: errors.password ? `${block.className} is-invalid` : block.className,
|
|
10822
10930
|
...register(block.name, {
|
|
@@ -10825,7 +10933,13 @@ const InputPassword = ({
|
|
|
10825
10933
|
maxLength: block.validate.maxLength
|
|
10826
10934
|
}),
|
|
10827
10935
|
required: true
|
|
10828
|
-
}),
|
|
10936
|
+
}), showToggle && (/*#__PURE__*/React.createElement("button", {
|
|
10937
|
+
type: "button",
|
|
10938
|
+
className: "password-toggle-btn",
|
|
10939
|
+
onClick: handleTogglePassword,
|
|
10940
|
+
"aria-label": t('System.show_password'),
|
|
10941
|
+
tabIndex: -1
|
|
10942
|
+
}, showPassword ? /*#__PURE__*/React.createElement(VisibilityOff, null) : /*#__PURE__*/React.createElement(Visibility, null))), errors.password && (/*#__PURE__*/React.createElement("span", {
|
|
10829
10943
|
className: "error invalid-feedback"
|
|
10830
10944
|
}, errors.password.type === 'required' && t('error.please_enter_password'), errors.password.type === 'minLength' && `${t('error.password_minimum')} ${block.validate.minLength} ${t('characters')}`, errors.password.type === 'maxLength' && `${t('error.password_maximum')} ${block.validate.maxLength} ${t('characters')}`)))) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputLabel, {
|
|
10831
10945
|
htmlFor: block.id
|
|
@@ -10835,7 +10949,7 @@ const InputPassword = ({
|
|
|
10835
10949
|
hiddenLabel: true,
|
|
10836
10950
|
size: "small",
|
|
10837
10951
|
id: block.id,
|
|
10838
|
-
type:
|
|
10952
|
+
type: showToggle && showPassword ? 'text' : 'password',
|
|
10839
10953
|
value: resetvalue,
|
|
10840
10954
|
className: errors.password ? `${block.className} is-invalid` : block.className,
|
|
10841
10955
|
...register(block.name, {
|
|
@@ -10843,7 +10957,19 @@ const InputPassword = ({
|
|
|
10843
10957
|
minLength: block.validate.minLength,
|
|
10844
10958
|
maxLength: block.validate.maxLength
|
|
10845
10959
|
}),
|
|
10846
|
-
required: true
|
|
10960
|
+
required: true,
|
|
10961
|
+
slotProps: showToggle ? {
|
|
10962
|
+
input: {
|
|
10963
|
+
endAdornment: (/*#__PURE__*/React.createElement(InputAdornment, {
|
|
10964
|
+
position: "end"
|
|
10965
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
10966
|
+
"aria-label": t('System.show_password'),
|
|
10967
|
+
onClick: handleTogglePassword,
|
|
10968
|
+
edge: "end",
|
|
10969
|
+
tabIndex: -1
|
|
10970
|
+
}, showPassword ? /*#__PURE__*/React.createElement(VisibilityOff, null) : /*#__PURE__*/React.createElement(Visibility, null))))
|
|
10971
|
+
}
|
|
10972
|
+
} : undefined
|
|
10847
10973
|
}), errors.password?.type === 'required' && (/*#__PURE__*/React.createElement("em", {
|
|
10848
10974
|
className: "error invalid-feedback"
|
|
10849
10975
|
}, t('error.please_enter_password'))), errors.password?.type === 'minLength' && (/*#__PURE__*/React.createElement("em", {
|
|
@@ -10857,7 +10983,7 @@ const InputPassword = ({
|
|
|
10857
10983
|
}, t('System.repeat'), " ", block.label, block.validate.required && /*#__PURE__*/React.createElement("span", {
|
|
10858
10984
|
className: "required"
|
|
10859
10985
|
}, "*")), /*#__PURE__*/React.createElement("input", {
|
|
10860
|
-
type:
|
|
10986
|
+
type: showToggle && showConfirmation ? 'text' : 'password',
|
|
10861
10987
|
id: block.id + 100,
|
|
10862
10988
|
className: errors.password_confirmation ? `${block.className} is-invalid` : block.className,
|
|
10863
10989
|
...register(`${block.name}_confirmation`, {
|
|
@@ -10867,7 +10993,13 @@ const InputPassword = ({
|
|
|
10867
10993
|
validate: value => value === password.current || t('error.passwords_do_not_match')
|
|
10868
10994
|
}),
|
|
10869
10995
|
required: true
|
|
10870
|
-
}),
|
|
10996
|
+
}), showToggle && (/*#__PURE__*/React.createElement("button", {
|
|
10997
|
+
type: "button",
|
|
10998
|
+
className: "password-toggle-btn",
|
|
10999
|
+
onClick: handleToggleConfirmation,
|
|
11000
|
+
"aria-label": t('System.show_password'),
|
|
11001
|
+
tabIndex: -1
|
|
11002
|
+
}, showConfirmation ? /*#__PURE__*/React.createElement(VisibilityOff, null) : /*#__PURE__*/React.createElement(Visibility, null))), errors.password_confirmation && (/*#__PURE__*/React.createElement("span", {
|
|
10871
11003
|
className: "error invalid-feedback"
|
|
10872
11004
|
}, errors.password_confirmation.type === 'required' && t('error.repeat_password'), errors.password_confirmation.type === 'minLength' && `${t('error.password_minimum')} ${block.validate.minLength} ${t('characters')}`, errors.password_confirmation.type === 'maxLength' && `${t('error.password_maximum')} ${block.validate.maxLength} ${t('characters')}`, errors.password_confirmation.type === 'validate' && t('error.password_not_match'))))) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputLabel, {
|
|
10873
11005
|
htmlFor: block.id + 100
|
|
@@ -10877,7 +11009,7 @@ const InputPassword = ({
|
|
|
10877
11009
|
hiddenLabel: true,
|
|
10878
11010
|
size: "small",
|
|
10879
11011
|
id: block.id + 100,
|
|
10880
|
-
type:
|
|
11012
|
+
type: showToggle && showConfirmation ? 'text' : 'password',
|
|
10881
11013
|
value: resetvalue,
|
|
10882
11014
|
className: errors.password_confirmation ? `${block.className} is-invalid` : block.className,
|
|
10883
11015
|
...register(`${block.name}_confirmation`, {
|
|
@@ -10886,7 +11018,19 @@ const InputPassword = ({
|
|
|
10886
11018
|
maxLength: block.validate.maxLength,
|
|
10887
11019
|
validate: value => value === password.current || t('error.passwords_do_not_match')
|
|
10888
11020
|
}),
|
|
10889
|
-
required: true
|
|
11021
|
+
required: true,
|
|
11022
|
+
slotProps: showToggle ? {
|
|
11023
|
+
input: {
|
|
11024
|
+
endAdornment: (/*#__PURE__*/React.createElement(InputAdornment, {
|
|
11025
|
+
position: "end"
|
|
11026
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
11027
|
+
"aria-label": t('System.show_password'),
|
|
11028
|
+
onClick: handleToggleConfirmation,
|
|
11029
|
+
edge: "end",
|
|
11030
|
+
tabIndex: -1
|
|
11031
|
+
}, showConfirmation ? /*#__PURE__*/React.createElement(VisibilityOff, null) : /*#__PURE__*/React.createElement(Visibility, null))))
|
|
11032
|
+
}
|
|
11033
|
+
} : undefined
|
|
10890
11034
|
}), errors.password_confirmation?.type === 'required' && (/*#__PURE__*/React.createElement("em", {
|
|
10891
11035
|
className: "error invalid-feedback"
|
|
10892
11036
|
}, t('error.repeat_password'))), errors.password_confirmation?.type === 'minLength' && (/*#__PURE__*/React.createElement("em", {
|
|
@@ -11039,6 +11183,9 @@ const InputText = /*#__PURE__*/React.memo(({
|
|
|
11039
11183
|
const [t] = reactI18next.useTranslation('global');
|
|
11040
11184
|
const [errors, setError] = React.useState(false);
|
|
11041
11185
|
const [texterror, setTextError] = React.useState('');
|
|
11186
|
+
const showToggle = block.showPasswordToggle === true;
|
|
11187
|
+
const [showPassword, setShowPassword] = React.useState(false);
|
|
11188
|
+
const handleTogglePassword = () => setShowPassword(v => !v);
|
|
11042
11189
|
const handleInputBlur = React.useCallback(async event => {
|
|
11043
11190
|
const session = authStorage.getSessionId(configLogs) || '';
|
|
11044
11191
|
const value = event.target.value;
|
|
@@ -11130,14 +11277,26 @@ const InputText = /*#__PURE__*/React.memo(({
|
|
|
11130
11277
|
size: "small",
|
|
11131
11278
|
name: block.name,
|
|
11132
11279
|
id: block.id,
|
|
11133
|
-
type: block.type,
|
|
11280
|
+
type: showToggle && showPassword ? 'text' : block.type,
|
|
11134
11281
|
placeholder: block.placeholder,
|
|
11135
11282
|
value: block.value || '',
|
|
11136
11283
|
onChange: block.onChange,
|
|
11137
11284
|
onBlur: handleInputBlur,
|
|
11138
11285
|
autoComplete: block.autocomplete,
|
|
11139
11286
|
className: errors ? `${block.className} is-invalid` : block.className,
|
|
11140
|
-
required: block.validate.required
|
|
11287
|
+
required: block.validate.required,
|
|
11288
|
+
slotProps: showToggle ? {
|
|
11289
|
+
input: {
|
|
11290
|
+
endAdornment: (/*#__PURE__*/React.createElement(InputAdornment, {
|
|
11291
|
+
position: "end"
|
|
11292
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
11293
|
+
"aria-label": t('System.show_password'),
|
|
11294
|
+
onClick: handleTogglePassword,
|
|
11295
|
+
edge: "end",
|
|
11296
|
+
tabIndex: -1
|
|
11297
|
+
}, showPassword ? /*#__PURE__*/React.createElement(VisibilityOff, null) : /*#__PURE__*/React.createElement(Visibility, null))))
|
|
11298
|
+
}
|
|
11299
|
+
} : undefined
|
|
11141
11300
|
}));
|
|
11142
11301
|
if (block.style === 'login') {
|
|
11143
11302
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -11530,6 +11689,7 @@ const Components = {
|
|
|
11530
11689
|
info: Info,
|
|
11531
11690
|
inputwysiwyg: InputWYSIWYG,
|
|
11532
11691
|
inputfile: InputFile,
|
|
11692
|
+
inputdate: InputDate,
|
|
11533
11693
|
formlogin: FormLogin,
|
|
11534
11694
|
inputpassword: InputPassword,
|
|
11535
11695
|
text: Text,
|
|
@@ -13968,6 +14128,7 @@ exports.GenerateRandomPassword = GenerateRandomPassword;
|
|
|
13968
14128
|
exports.Heading = Heading;
|
|
13969
14129
|
exports.Image = Image;
|
|
13970
14130
|
exports.Info = Info;
|
|
14131
|
+
exports.InputDate = InputDate;
|
|
13971
14132
|
exports.InputFile = InputFile;
|
|
13972
14133
|
exports.InputPassword = InputPassword;
|
|
13973
14134
|
exports.InputText = InputText;
|