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.
@@ -1283,7 +1283,7 @@ var Content = /*#__PURE__*/function () {
1283
1283
  * Text Field
1284
1284
  */
1285
1285
  var TextField = function TextField(props) {
1286
- useContext(SiteContext);
1286
+ var site = useContext(SiteContext);
1287
1287
  var id = props.id,
1288
1288
  _props$type = props.type,
1289
1289
  type = _props$type === void 0 ? 'text' : _props$type,
@@ -1328,9 +1328,7 @@ var TextField = function TextField(props) {
1328
1328
  var labelPositionStyle = labelPosition == 'left' ? "label-left" : "label-top";
1329
1329
  var style = labelStyle + " " + labelPositionStyle + " " + borderStyle + " textfield-" + type;
1330
1330
  var labelTxt = /*#__PURE__*/React.createElement(Text, null, label);
1331
- var placeholderTxt = placeholder ? /*#__PURE__*/React.createElement(Text, {
1332
- format: TEXTFORMATS.STRING
1333
- }, placeholder) : null;
1331
+ var placeholderTxt = site.translate ? site.translate(placeholder) : placeholder;
1334
1332
  return /*#__PURE__*/React.createElement("div", {
1335
1333
  className: style + " " + id,
1336
1334
  onClick: onClick
@@ -1401,9 +1399,7 @@ var TextArea = function TextArea(props) {
1401
1399
  var labelStyle = label ? "" : "no-label";
1402
1400
  var style = "textarea " + labelStyle + " textarea-" + type;
1403
1401
  var labelTxt = /*#__PURE__*/React.createElement(Text, null, label);
1404
- var placeholderTxt = /*#__PURE__*/React.createElement(Text, {
1405
- format: TEXTFORMATS.STRING
1406
- }, placeholder);
1402
+ var placeholderTxt = site.translate ? site.translate(placeholder) : placeholder;
1407
1403
  return /*#__PURE__*/React.createElement("div", {
1408
1404
  className: "" + style,
1409
1405
  onClick: onClick
@@ -3792,6 +3788,12 @@ var SiteProvider = function SiteProvider(_ref) {
3792
3788
  setLang: setLang,
3793
3789
  dictionary: dictionary,
3794
3790
  setDictionary: setDictionary,
3791
+ translate: function translate(key) {
3792
+ if (!key) return key;
3793
+ if (dictionary === undefined) return key;
3794
+ var term = dictionary[key];
3795
+ return term ? term[lang] : key;
3796
+ },
3795
3797
  sideNav: sideNav,
3796
3798
  setSideNav: setSideNav,
3797
3799
  showNav: showNav,
@@ -5764,7 +5766,7 @@ var MultiSelectionEditor = function MultiSelectionEditor(_ref10) {
5764
5766
  }
5765
5767
  return /*#__PURE__*/React.createElement("div", {
5766
5768
  className: "multiselection-editor"
5767
- }, /*#__PURE__*/React.createElement("label", null, label), buildOptions().map(function (option) {
5769
+ }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement(Text, null, label)), buildOptions().map(function (option) {
5768
5770
  var checked = value.includes(option.value);
5769
5771
  switch (format) {
5770
5772
  case FORMATS$1.CHECKBOX: