@maggioli-design-system/mds-input-tip-item 1.1.0 → 1.1.1
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-tip-item.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-tip-item.js +8 -10
- package/dist/documentation.json +1 -1
- package/dist/esm/mds-input-tip-item.entry.js +8 -10
- package/dist/esm-es5/mds-input-tip-item.entry.js +1 -1
- package/dist/mds-input-tip-item/mds-input-tip-item.esm.js +1 -1
- package/dist/mds-input-tip-item/{p-4c3c132e.system.entry.js → p-7f7a0684.system.entry.js} +1 -1
- package/dist/mds-input-tip-item/{p-0f7b5474.entry.js → p-c23db9de.entry.js} +1 -1
- package/dist/mds-input-tip-item/p-f513b09b.system.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 +3 -3
- 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-tip-item.esm.js +1 -1
- package/www/build/{p-4c3c132e.system.entry.js → p-7f7a0684.system.entry.js} +1 -1
- package/www/build/{p-0f7b5474.entry.js → p-c23db9de.entry.js} +1 -1
- package/www/build/p-f513b09b.system.js +1 -1
package/documentation.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2024-09-
|
|
2
|
+
"timestamp": "2024-09-13T08:12:14",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.21.0",
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
"path": "src/components/mds-chip/meta/interface.ts"
|
|
238
238
|
},
|
|
239
239
|
"src/components/mds-dropdown/meta/types.ts::DropdownInteractionType": {
|
|
240
|
-
"declaration": "export type DropdownInteractionType =\n | 'click'\n | 'mouseover'",
|
|
240
|
+
"declaration": "export type DropdownInteractionType =\n | 'click'\n | 'none'\n | 'mouseover'",
|
|
241
241
|
"docstring": "",
|
|
242
242
|
"path": "src/components/mds-dropdown/meta/types.ts"
|
|
243
243
|
},
|
|
@@ -451,6 +451,11 @@
|
|
|
451
451
|
"docstring": "",
|
|
452
452
|
"path": "src/components/mds-pref-animation/meta/types.ts"
|
|
453
453
|
},
|
|
454
|
+
"src/event-detail/preference.ts::MdsPrefChangeEventDetail": {
|
|
455
|
+
"declaration": "export interface MdsPrefChangeEventDetail {\n preference: UIPreferenceType\n}",
|
|
456
|
+
"docstring": "",
|
|
457
|
+
"path": "src/event-detail/preference.ts"
|
|
458
|
+
},
|
|
454
459
|
"src/type/preference.ts::ConsumptionModeType": {
|
|
455
460
|
"declaration": "export type ConsumptionModeType =\n | 'high'\n | 'medium'\n | 'low'",
|
|
456
461
|
"docstring": "",
|
|
@@ -461,6 +466,16 @@
|
|
|
461
466
|
"docstring": "",
|
|
462
467
|
"path": "src/components/mds-pref-contrast/meta/types.ts"
|
|
463
468
|
},
|
|
469
|
+
"src/type/language.ts::LanguageType": {
|
|
470
|
+
"declaration": "export type LanguageType =\n | 'auto'\n | `${Lowercase<string>}${Lowercase<string>}`\n | `${Lowercase<string>}${Lowercase<string>}${Lowercase<string>}`",
|
|
471
|
+
"docstring": "",
|
|
472
|
+
"path": "src/type/language.ts"
|
|
473
|
+
},
|
|
474
|
+
"src/event-detail/language.ts::MdsPrefLanguageEventDetail": {
|
|
475
|
+
"declaration": "export interface MdsPrefLanguageEventDetail {\n language?: LanguageType\n}",
|
|
476
|
+
"docstring": "",
|
|
477
|
+
"path": "src/event-detail/language.ts"
|
|
478
|
+
},
|
|
464
479
|
"src/components/mds-pref-theme/meta/types.ts::ThemeModeType": {
|
|
465
480
|
"declaration": "export type ThemeModeType =\n | 'light'\n | 'dark'\n | 'system'",
|
|
466
481
|
"docstring": "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maggioli-design-system/mds-input-tip-item",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "mds-input-tip-item is a web-component from Magma Design System, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScirpt framework you are using.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"test": "stencil test --spec --e2e"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@maggioli-design-system/mds-text": "4.4.
|
|
28
|
-
"@maggioli-design-system/styles": "15.3.
|
|
27
|
+
"@maggioli-design-system/mds-text": "4.4.1",
|
|
28
|
+
"@maggioli-design-system/styles": "15.3.1",
|
|
29
29
|
"@stencil/core": "4.21.0"
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT",
|
package/src/common/locale.ts
CHANGED
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
import Handlebars from 'handlebars'
|
|
2
2
|
|
|
3
3
|
type LocaleConfig = {
|
|
4
|
+
el?: Record<string, string | string[]>
|
|
5
|
+
en: Record<string, string | string[]>
|
|
6
|
+
es?: Record<string, string | string[]>
|
|
4
7
|
it?: Record<string, string | string[]>
|
|
5
|
-
en?: Record<string, string | string[]>
|
|
6
|
-
gr?: Record<string, string | string[]>
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export class Locale {
|
|
10
|
-
|
|
11
|
+
rollbackLanguage: string = 'en'
|
|
11
12
|
language: string
|
|
12
13
|
config: LocaleConfig
|
|
14
|
+
closestElement:HTMLElement
|
|
13
15
|
|
|
14
16
|
constructor (configData: LocaleConfig) {
|
|
15
17
|
this.config = configData
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
lang = (element: HTMLElement): void => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
this.closestElement = element.closest('[lang]') as HTMLElement
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
if (this.closestElement) {
|
|
25
|
+
if (this.closestElement.lang) {
|
|
26
|
+
this.language = this.closestElement.lang
|
|
23
27
|
return
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
|
|
27
|
-
this.language = this.
|
|
31
|
+
this.language = this.rollbackLanguage
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
private pluralize = (tag: string | string[], context: Record<string, string | number>): string => {
|
|
31
35
|
|
|
32
|
-
const languagePhrase: string | string[] = this.config[this.language][tag]
|
|
36
|
+
const languagePhrase: string | string[] = this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag]
|
|
33
37
|
const phrases: string[] = []
|
|
34
38
|
|
|
35
39
|
if (Array.isArray(languagePhrase)) {
|
|
@@ -61,6 +65,6 @@ export class Locale {
|
|
|
61
65
|
if (context) {
|
|
62
66
|
return this.pluralize(tag, context)
|
|
63
67
|
}
|
|
64
|
-
return this.config[this.language][tag]
|
|
68
|
+
return this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag]
|
|
65
69
|
}
|
|
66
70
|
}
|
package/src/type/preference.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as a,b as
|
|
1
|
+
import{p as a,b as d}from"./p-dad0fd1d.js";export{s as setNonce}from"./p-dad0fd1d.js";import{g as t}from"./p-e1255160.js";(()=>{const d=import.meta.url,t={};return""!==d&&(t.resourcesUrl=new URL(".",d).href),a(t)})().then((async a=>(await t(),d([["p-c23db9de",[[1,"mds-input-tip-item",{variant:[513],expanded:[516]}]]]],a))));
|