native-document 1.0.264 → 1.0.265

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": "native-document",
3
- "version": "1.0.264",
3
+ "version": "1.0.265",
4
4
  "description": "A reactive JavaScript framework that preserves native DOM simplicity without sacrificing modern features",
5
5
  "author": "AfroCodeur <https://github.com/afrocodeur>",
6
6
  "license": "MIT",
@@ -27,10 +27,18 @@ const I18nService = (function () {
27
27
  }());
28
28
 
29
29
  const tr = (key, params = {}) => {
30
+
30
31
  const isContainObservable = hasObservableParams(params);
31
- const observable = isContainObservable
32
- ? Observable.computed(() => I18nService.tr(key, getParams(params)), getObservableParams(params))
33
- : Observable(I18nService.tr(key, params));
32
+ let observable = null;
33
+ if(key?.__$Observable) {
34
+ observable = isContainObservable
35
+ ? Observable.computed(() => I18nService.tr(key.val(), getParams(params)), [key, ...getObservableParams(params)])
36
+ : Observable.computed(() => I18nService.tr(key.val(), params), [key]);
37
+ } else {
38
+ observable = isContainObservable
39
+ ? Observable.computed(() => I18nService.tr(key, getParams(params)), getObservableParams(params))
40
+ : Observable(I18nService.tr(key, params));
41
+ }
34
42
 
35
43
  i18next.on('languageChanged', (lng) => {
36
44
  const data = isContainObservable ? getParams(params) : params;
@@ -37,7 +37,7 @@ const buildOptions = ($desc, instance) => {
37
37
  if(!$selected?.__$isObservable) {
38
38
  return false;
39
39
  }
40
- return $selected.transform(v => v === optValue);
40
+ return $selected.transform(v => v.valueOf() === optValue?.valueOf());
41
41
  };
42
42
 
43
43
  const onSelect = (optValue) => {