ywana-core8 0.1.38 → 0.1.40

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,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.1.38",
3
+ "version": "0.1.40",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -191,6 +191,7 @@ export const FieldEditor = ({ field, onChange, content, outlined = false, onRelo
191
191
  function renderField() {
192
192
  const value1 = field.value || field.value === "" ? field.value : field.default
193
193
  const isHidden = CHECK['isFunction'](hidden) ? hidden(field, value1) : hidden
194
+ const editable = field.editable === false ? false : true
194
195
  if (isHidden) {
195
196
  return null
196
197
  } else {
@@ -200,7 +201,7 @@ export const FieldEditor = ({ field, onChange, content, outlined = false, onRelo
200
201
  case TYPES.STRING:
201
202
  return <StringEditor outlined={outlined} field={field} value={value1} onChange={change} content={content} />
202
203
  case TYPES.BOOLEAN:
203
- return <CheckBox outlined id={id} label={label} value={value1} onChange={change} />
204
+ return <CheckBox outlined id={id} label={label} value={value1} onChange={change} readOnly={!editable} />
204
205
  case TYPES.NUMBER:
205
206
  return <NumberEditor outlined={outlined} field={field} value={value1} onChange={change} />
206
207
  case TYPES.ARRAY:
@@ -49,3 +49,7 @@ input:checked ~ .checkmark:after {
49
49
  font-size: 1rem;
50
50
  font-weight: normal;
51
51
  }
52
+
53
+ .checkbox .icon {
54
+ position: absolute;
55
+ }
@@ -1,5 +1,6 @@
1
1
  import React from 'react'
2
2
  import { Text } from './text'
3
+ import { Icon } from './icon'
3
4
  import './checkbox.css'
4
5
 
5
6
  /**
@@ -7,7 +8,7 @@ import './checkbox.css'
7
8
  */
8
9
  export const CheckBox = (props) => {
9
10
 
10
- const { id, label, placeholder, value, onChange } = props
11
+ const { id, label, placeholder, value, readOnly=false, onChange } = props
11
12
 
12
13
  function change(event) {
13
14
  event.stopPropagation()
@@ -18,18 +19,47 @@ export const CheckBox = (props) => {
18
19
 
19
20
  const labelTxt = <Text>{label}</Text>
20
21
  const placeholderTxt = <Text>{placeholder}</Text>
21
-
22
- return value === true ? (
22
+
23
+
24
+ if (readOnly===true) {
25
+ return value === true ? (
26
+ <div className="checkbox" key={`${id}1`}>
27
+ <Icon id={id} icon="check" size="small" />
28
+ <span className="checkmark" />
29
+ <label htmlFor={id}>{labelTxt}</label>
30
+ </div>
31
+ ) : (
32
+ <div className="checkbox" key={`${id}0`}>
33
+ <span className="checkmark" />
34
+ <label htmlFor={id}>{labelTxt}</label>
35
+ </div>
36
+ )
37
+ }
38
+
39
+ return value === true ? (
23
40
  <div className="checkbox" key={`${id}1`}>
24
- <input id={id} type="checkbox" placeholder={placeholderTxt} checked value={value} onChange={change} />
41
+ <input id={id} type="checkbox" placeholder={placeholderTxt} checked value={value} onChange={change} readOnly />
25
42
  <span className="checkmark" />
26
43
  <label htmlFor={id}>{labelTxt}</label>
27
44
  </div>
28
45
  ) : (
29
46
  <div className="checkbox" key={`${id}0`}>
30
- <input id={id} type="checkbox" placeholder={placeholderTxt} value={value} onChange={change} />
31
- <span className="checkmark" />
32
- <label htmlFor={id}>{labelTxt}</label>
33
- </div>
47
+ <input id={id} type="checkbox" placeholder={placeholderTxt} value={value} onChange={change} readOnly />
48
+ <span className="checkmark" />
49
+ <label htmlFor={id}>{labelTxt}</label>
50
+ </div>
51
+ )
52
+ }
53
+
54
+
55
+ const CheckBoxTest = (props) => {
56
+
57
+ return (
58
+ <div>
59
+ <CheckBox id="check1" label="Check 1" placeholder="Check 1" value={true} />
60
+ <CheckBox id="check2" label="Check 2" placeholder="Check 2" value={false} />
61
+ <CheckBox id="check3" label="Check 3" placeholder="Check 3" value={true} readOnly />
62
+ <CheckBox id="check4" label="Check 4" placeholder="Check 4" value={false} readOnly />
63
+ </div>
34
64
  )
35
65
  }
@@ -22,7 +22,7 @@ export const ForgetUserPasswordAction = (props) => {
22
22
  })
23
23
  } catch (error) {
24
24
  site.notify({
25
- title: "Errorrrrr",
25
+ title: "Error",
26
26
  body: error.message,
27
27
  type: "danger",
28
28
  icon: "error"
@@ -30,7 +30,6 @@ export const ForgetUserPasswordAction = (props) => {
30
30
  }
31
31
  }
32
32
 
33
-
34
33
  return icon ? (
35
34
  <Icon icon="mail_lock" clickable action={execute} size="small" tooltip={{ text: label, top: "-.5rem", left: "-14rem" }} />
36
35
  ) : (
@@ -70,7 +69,7 @@ export const UnlockUserAction = (props) => {
70
69
  return icon ? (
71
70
  <Icon icon="key_off" clickable action={execute} size="small" />
72
71
  ) : (
73
- <Button label={label} action={execute} outlined className="" />
72
+ <Button label={label} action={execute} className="" />
74
73
  )
75
74
  }
76
75
 
@@ -1,5 +1,25 @@
1
1
  export const LOGIN_DICTIONARY = {
2
2
 
3
+ 'New Password': {
4
+ en: 'New Password',
5
+ es: 'Nueva Contraseña',
6
+ de: 'Neues Passwort',
7
+ pt: 'Nova Senha',
8
+ ca: 'Nova Contrasenya',
9
+ it: 'Nuova Password',
10
+ fr: 'Nouveau mot de passe'
11
+ },
12
+
13
+ 'Confirm New Password': {
14
+ en: 'Confirm New Password',
15
+ es: 'Confirmar Nueva Contraseña',
16
+ de: 'Bestätigen Sie das neue Passwort',
17
+ pt: 'Confirmar Nova Senha',
18
+ ca: 'Confirma la nova contrasenya',
19
+ it: 'Conferma la nuova password',
20
+ fr: 'Confirmer le nouveau mot de passe'
21
+ },
22
+
3
23
  'Forgot Password': {
4
24
  en: 'Forgot Password',
5
25
  es: 'Olvidé mi contraseña',