@maggioli-design-system/mds-input 6.1.0 → 6.1.2
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/dist/cjs/mds-input.cjs.entry.js +8 -10
- package/dist/collection/common/locale.js +8 -10
- package/dist/collection/type/language.js +1 -0
- package/dist/components/mds-input.js +8 -10
- package/dist/documentation.json +1 -1
- package/dist/esm/mds-input.entry.js +8 -10
- package/dist/esm-es5/mds-input.entry.js +1 -1
- package/dist/mds-input/mds-input.esm.js +1 -1
- package/dist/mds-input/p-16ddda69.system.js +1 -1
- package/dist/mds-input/{p-6eab8763.system.entry.js → p-910aeff6.system.entry.js} +1 -1
- package/dist/mds-input/{p-5b1ed554.entry.js → p-9e2335ec.entry.js} +1 -1
- package/dist/stats.json +18 -16
- package/dist/types/common/locale.d.ts +5 -3
- package/dist/types/type/language.d.ts +1 -0
- package/dist/types/type/preference.d.ts +1 -1
- package/documentation.json +17 -2
- package/package.json +6 -6
- package/src/common/locale.ts +14 -10
- package/src/type/language.ts +4 -0
- package/src/type/preference.ts +1 -0
- package/www/build/mds-input.esm.js +1 -1
- package/www/build/p-16ddda69.system.js +1 -1
- package/www/build/{p-6eab8763.system.entry.js → p-910aeff6.system.entry.js} +1 -1
- package/www/build/{p-5b1ed554.entry.js → p-9e2335ec.entry.js} +1 -1
|
@@ -4757,20 +4757,19 @@ const Handlebars = /*@__PURE__*/getDefaultExportFromCjs(handlebars.exports);
|
|
|
4757
4757
|
|
|
4758
4758
|
class Locale {
|
|
4759
4759
|
constructor(configData) {
|
|
4760
|
-
this.
|
|
4760
|
+
this.rollbackLanguage = 'en';
|
|
4761
4761
|
this.lang = (element) => {
|
|
4762
|
-
|
|
4763
|
-
if (closestElement) {
|
|
4764
|
-
if (closestElement.lang) {
|
|
4765
|
-
this.language = closestElement.lang;
|
|
4762
|
+
this.closestElement = element.closest('[lang]');
|
|
4763
|
+
if (this.closestElement) {
|
|
4764
|
+
if (this.closestElement.lang) {
|
|
4765
|
+
this.language = this.closestElement.lang;
|
|
4766
4766
|
return;
|
|
4767
4767
|
}
|
|
4768
4768
|
}
|
|
4769
|
-
this.language = this.
|
|
4769
|
+
this.language = this.rollbackLanguage;
|
|
4770
4770
|
};
|
|
4771
4771
|
this.pluralize = (tag, context) => {
|
|
4772
|
-
|
|
4773
|
-
const languagePhrase = (_a = this.config[this.language][tag]) !== null && _a !== void 0 ? _a : this.config[this.defaultLanguage][tag];
|
|
4772
|
+
const languagePhrase = this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag];
|
|
4774
4773
|
const phrases = [];
|
|
4775
4774
|
if (Array.isArray(languagePhrase)) {
|
|
4776
4775
|
phrases.push(languagePhrase[0]);
|
|
@@ -4795,11 +4794,10 @@ class Locale {
|
|
|
4795
4794
|
return template(context);
|
|
4796
4795
|
};
|
|
4797
4796
|
this.get = (tag, context) => {
|
|
4798
|
-
var _a;
|
|
4799
4797
|
if (context) {
|
|
4800
4798
|
return this.pluralize(tag, context);
|
|
4801
4799
|
}
|
|
4802
|
-
return
|
|
4800
|
+
return this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag];
|
|
4803
4801
|
};
|
|
4804
4802
|
this.config = configData;
|
|
4805
4803
|
}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import Handlebars from "handlebars";
|
|
2
2
|
export class Locale {
|
|
3
3
|
constructor(configData) {
|
|
4
|
-
this.
|
|
4
|
+
this.rollbackLanguage = 'en';
|
|
5
5
|
this.lang = (element) => {
|
|
6
|
-
|
|
7
|
-
if (closestElement) {
|
|
8
|
-
if (closestElement.lang) {
|
|
9
|
-
this.language = closestElement.lang;
|
|
6
|
+
this.closestElement = element.closest('[lang]');
|
|
7
|
+
if (this.closestElement) {
|
|
8
|
+
if (this.closestElement.lang) {
|
|
9
|
+
this.language = this.closestElement.lang;
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
this.language = this.
|
|
13
|
+
this.language = this.rollbackLanguage;
|
|
14
14
|
};
|
|
15
15
|
this.pluralize = (tag, context) => {
|
|
16
|
-
|
|
17
|
-
const languagePhrase = (_a = this.config[this.language][tag]) !== null && _a !== void 0 ? _a : this.config[this.defaultLanguage][tag];
|
|
16
|
+
const languagePhrase = this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag];
|
|
18
17
|
const phrases = [];
|
|
19
18
|
if (Array.isArray(languagePhrase)) {
|
|
20
19
|
phrases.push(languagePhrase[0]);
|
|
@@ -39,11 +38,10 @@ export class Locale {
|
|
|
39
38
|
return template(context);
|
|
40
39
|
};
|
|
41
40
|
this.get = (tag, context) => {
|
|
42
|
-
var _a;
|
|
43
41
|
if (context) {
|
|
44
42
|
return this.pluralize(tag, context);
|
|
45
43
|
}
|
|
46
|
-
return
|
|
44
|
+
return this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag];
|
|
47
45
|
};
|
|
48
46
|
this.config = configData;
|
|
49
47
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4753,20 +4753,19 @@ const Handlebars = /*@__PURE__*/getDefaultExportFromCjs(handlebars.exports);
|
|
|
4753
4753
|
|
|
4754
4754
|
class Locale {
|
|
4755
4755
|
constructor(configData) {
|
|
4756
|
-
this.
|
|
4756
|
+
this.rollbackLanguage = 'en';
|
|
4757
4757
|
this.lang = (element) => {
|
|
4758
|
-
|
|
4759
|
-
if (closestElement) {
|
|
4760
|
-
if (closestElement.lang) {
|
|
4761
|
-
this.language = closestElement.lang;
|
|
4758
|
+
this.closestElement = element.closest('[lang]');
|
|
4759
|
+
if (this.closestElement) {
|
|
4760
|
+
if (this.closestElement.lang) {
|
|
4761
|
+
this.language = this.closestElement.lang;
|
|
4762
4762
|
return;
|
|
4763
4763
|
}
|
|
4764
4764
|
}
|
|
4765
|
-
this.language = this.
|
|
4765
|
+
this.language = this.rollbackLanguage;
|
|
4766
4766
|
};
|
|
4767
4767
|
this.pluralize = (tag, context) => {
|
|
4768
|
-
|
|
4769
|
-
const languagePhrase = (_a = this.config[this.language][tag]) !== null && _a !== void 0 ? _a : this.config[this.defaultLanguage][tag];
|
|
4768
|
+
const languagePhrase = this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag];
|
|
4770
4769
|
const phrases = [];
|
|
4771
4770
|
if (Array.isArray(languagePhrase)) {
|
|
4772
4771
|
phrases.push(languagePhrase[0]);
|
|
@@ -4791,11 +4790,10 @@ class Locale {
|
|
|
4791
4790
|
return template(context);
|
|
4792
4791
|
};
|
|
4793
4792
|
this.get = (tag, context) => {
|
|
4794
|
-
var _a;
|
|
4795
4793
|
if (context) {
|
|
4796
4794
|
return this.pluralize(tag, context);
|
|
4797
4795
|
}
|
|
4798
|
-
return
|
|
4796
|
+
return this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag];
|
|
4799
4797
|
};
|
|
4800
4798
|
this.config = configData;
|
|
4801
4799
|
}
|
package/dist/documentation.json
CHANGED
|
@@ -4753,20 +4753,19 @@ const Handlebars = /*@__PURE__*/getDefaultExportFromCjs(handlebars.exports);
|
|
|
4753
4753
|
|
|
4754
4754
|
class Locale {
|
|
4755
4755
|
constructor(configData) {
|
|
4756
|
-
this.
|
|
4756
|
+
this.rollbackLanguage = 'en';
|
|
4757
4757
|
this.lang = (element) => {
|
|
4758
|
-
|
|
4759
|
-
if (closestElement) {
|
|
4760
|
-
if (closestElement.lang) {
|
|
4761
|
-
this.language = closestElement.lang;
|
|
4758
|
+
this.closestElement = element.closest('[lang]');
|
|
4759
|
+
if (this.closestElement) {
|
|
4760
|
+
if (this.closestElement.lang) {
|
|
4761
|
+
this.language = this.closestElement.lang;
|
|
4762
4762
|
return;
|
|
4763
4763
|
}
|
|
4764
4764
|
}
|
|
4765
|
-
this.language = this.
|
|
4765
|
+
this.language = this.rollbackLanguage;
|
|
4766
4766
|
};
|
|
4767
4767
|
this.pluralize = (tag, context) => {
|
|
4768
|
-
|
|
4769
|
-
const languagePhrase = (_a = this.config[this.language][tag]) !== null && _a !== void 0 ? _a : this.config[this.defaultLanguage][tag];
|
|
4768
|
+
const languagePhrase = this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag];
|
|
4770
4769
|
const phrases = [];
|
|
4771
4770
|
if (Array.isArray(languagePhrase)) {
|
|
4772
4771
|
phrases.push(languagePhrase[0]);
|
|
@@ -4791,11 +4790,10 @@ class Locale {
|
|
|
4791
4790
|
return template(context);
|
|
4792
4791
|
};
|
|
4793
4792
|
this.get = (tag, context) => {
|
|
4794
|
-
var _a;
|
|
4795
4793
|
if (context) {
|
|
4796
4794
|
return this.pluralize(tag, context);
|
|
4797
4795
|
}
|
|
4798
|
-
return
|
|
4796
|
+
return this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag];
|
|
4799
4797
|
};
|
|
4800
4798
|
this.config = configData;
|
|
4801
4799
|
}
|