ywana-core8 0.0.881 → 0.0.883

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.0.881",
3
+ "version": "0.0.883",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -390,9 +390,11 @@ export const MultiSelectionEditor = ({ field, value = [], content, onChange }) =
390
390
  return opts
391
391
  }
392
392
 
393
+
394
+
393
395
  return (
394
396
  <div className="multiselection-editor">
395
- <label>{label}</label>
397
+ <label><Text>{label}</Text></label>
396
398
  {buildOptions().map(option => {
397
399
  const checked = value.includes(option.value)
398
400
  switch (format) {
package/src/html/text.js CHANGED
@@ -44,4 +44,5 @@ export const Text = ({ format = TEXTFORMATS.HTML, children, className }) => {
44
44
  default: return <span className={className}>{value}</span>
45
45
  }
46
46
 
47
- }
47
+ }
48
+
@@ -9,6 +9,7 @@ const TextTest = (prop) => {
9
9
  <>
10
10
  <Text format={TEXTFORMATS.NUMERIC}>846964.4199142859</Text>
11
11
  <Text format={TEXTFORMATS.NUMERIC}>{"345356345.345"}</Text>
12
+ <Text format={TEXTFORMATS.STRING}>Lorem Ipsum dolro sit amet....</Text>
12
13
  </>
13
14
  )
14
15
  }
@@ -45,7 +45,7 @@ export const TextField = (props) => {
45
45
  const labelPositionStyle = labelPosition == 'left' ? "label-left" : "label-top"
46
46
  const style = `${labelStyle} ${labelPositionStyle} ${borderStyle} textfield-${type}`
47
47
  const labelTxt = <Text>{label}</Text>
48
- const placeholderTxt = placeholder ? <Text format={TEXTFORMATS.STRING}>{placeholder}</Text> : null
48
+ const placeholderTxt = site.translate ? site.translate(placeholder) : placeholder
49
49
 
50
50
  return (
51
51
  <div className={`${style} ${id}`} onClick={onClick}>
@@ -98,7 +98,8 @@ export const TextArea = (props) => {
98
98
  const labelStyle = label ? "" : "no-label"
99
99
  const style = `textarea ${labelStyle} textarea-${type}`
100
100
  const labelTxt = <Text>{label}</Text>
101
- const placeholderTxt = <Text format={TEXTFORMATS.STRING} >{placeholder}</Text>
101
+
102
+ const placeholderTxt = site.translate ? site.translate(placeholder) : placeholder
102
103
 
103
104
  return (
104
105
  <div className={`${style}`} onClick={onClick}>
@@ -43,7 +43,7 @@ const TextFieldTest = (prop) => {
43
43
  <TokenField id="token2" label="Tokens DropDown" onChange={change} options={options} tokens={form.token2}/>
44
44
  <br/>
45
45
  <br/>
46
- <TextArea id="text1" label="Text 1" value={form.text1} onChange={change} />
46
+ <TextArea id="text1" label="Text 1" value={form.text1} onChange={change} placeholder="loremitsum"/>
47
47
  <TextField id="date1" type="DATE" label="Date" value={form.date1} onChange={change} />
48
48
  <DateRange id="range1" value={form.range1} onChange={change}/>
49
49
  </>
package/src/site/site.js CHANGED
@@ -34,6 +34,12 @@ export const SiteProvider = ({ children, siteLang, siteDictionary }) => {
34
34
 
35
35
  dictionary,
36
36
  setDictionary,
37
+ translate: (key) => {
38
+ if (!key) return key
39
+ if (dictionary === undefined) return key
40
+ const term = dictionary[key]
41
+ return term ? term[lang] : key
42
+ },
37
43
 
38
44
  sideNav,
39
45
  setSideNav,