valtech-components 2.0.981 → 2.0.983
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/esm2022/lib/components/organisms/faq/faq.component.mjs +6 -3
- package/esm2022/lib/components/organisms/preferences-view/preferences-view.component.mjs +36 -63
- package/esm2022/lib/services/content-platform/content.service.mjs +3 -2
- package/esm2022/lib/services/markdown-article/markdown-article-parser.service.mjs +3 -3
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +42 -66
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/faq/faq.component.d.ts +1 -0
- package/lib/components/organisms/preferences-view/preferences-view.component.d.ts +5 -8
- package/lib/services/markdown-article/markdown-article-parser.service.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -54,7 +54,7 @@ import 'prismjs/components/prism-json';
|
|
|
54
54
|
* Current version of valtech-components.
|
|
55
55
|
* This is automatically updated during the publish process.
|
|
56
56
|
*/
|
|
57
|
-
const VERSION = '2.0.
|
|
57
|
+
const VERSION = '2.0.983';
|
|
58
58
|
|
|
59
59
|
// Control de estado de refresco (singleton a nivel de módulo)
|
|
60
60
|
let isRefreshing = false;
|
|
@@ -42668,12 +42668,6 @@ class PreferencesViewComponent {
|
|
|
42668
42668
|
this.langHint = computed(() => this.t('languageHint'));
|
|
42669
42669
|
this.fontSizeTitle = computed(() => this.t('fontSizeTitle'));
|
|
42670
42670
|
this.fontSizeHint = computed(() => this.t('fontSizeHint'));
|
|
42671
|
-
this.themeLight = computed(() => this.t('themeLight'));
|
|
42672
|
-
this.themeDark = computed(() => this.t('themeDark'));
|
|
42673
|
-
this.themeAuto = computed(() => this.t('themeAuto'));
|
|
42674
|
-
this.fontSizeSmall = computed(() => this.t('fontSizeSmall'));
|
|
42675
|
-
this.fontSizeMedium = computed(() => this.t('fontSizeMedium'));
|
|
42676
|
-
this.fontSizeLarge = computed(() => this.t('fontSizeLarge'));
|
|
42677
42671
|
this.langProps = computed(() => ({
|
|
42678
42672
|
currentLanguage: this.prefs.language(),
|
|
42679
42673
|
availableLanguages: this.resolvedConfig().supportedLanguages,
|
|
@@ -42682,6 +42676,28 @@ class PreferencesViewComponent {
|
|
|
42682
42676
|
expand: 'block',
|
|
42683
42677
|
fill: 'outline',
|
|
42684
42678
|
}));
|
|
42679
|
+
this.themePickerProps = computed(() => ({
|
|
42680
|
+
selectedValue: this.prefs.theme(),
|
|
42681
|
+
disabled: this.saving(),
|
|
42682
|
+
fill: 'outline',
|
|
42683
|
+
interface: 'popover',
|
|
42684
|
+
options: [
|
|
42685
|
+
{ value: 'light', label: this.t('themeLight') },
|
|
42686
|
+
{ value: 'dark', label: this.t('themeDark') },
|
|
42687
|
+
{ value: 'auto', label: this.t('themeAuto') },
|
|
42688
|
+
],
|
|
42689
|
+
}));
|
|
42690
|
+
this.fontSizePickerProps = computed(() => ({
|
|
42691
|
+
selectedValue: this.prefs.fontSize(),
|
|
42692
|
+
disabled: this.saving(),
|
|
42693
|
+
fill: 'outline',
|
|
42694
|
+
interface: 'popover',
|
|
42695
|
+
options: [
|
|
42696
|
+
{ value: 'small', label: this.t('fontSizeSmall') },
|
|
42697
|
+
{ value: 'medium', label: this.t('fontSizeMedium') },
|
|
42698
|
+
{ value: 'large', label: this.t('fontSizeLarge') },
|
|
42699
|
+
],
|
|
42700
|
+
}));
|
|
42685
42701
|
// Auto-registro i18n — respeta override del consumer. El namespace puede
|
|
42686
42702
|
// venir de @Input.config o del route data; lo resolvemos acá.
|
|
42687
42703
|
const ns = this.ns;
|
|
@@ -42691,14 +42707,16 @@ class PreferencesViewComponent {
|
|
|
42691
42707
|
this.nav.setBackHeader('pageTitle', ns, { withMenu: true });
|
|
42692
42708
|
}
|
|
42693
42709
|
async onThemeChange(value) {
|
|
42694
|
-
|
|
42710
|
+
const v = Array.isArray(value) ? value[0] : value;
|
|
42711
|
+
if (this.saving() || v === this.prefs.theme())
|
|
42695
42712
|
return;
|
|
42696
|
-
const theme =
|
|
42713
|
+
const theme = v;
|
|
42697
42714
|
await this.dispatch(() => this.prefs.setTheme(theme), () => this.resolvedConfig().onThemeChanged?.(theme));
|
|
42698
42715
|
}
|
|
42699
42716
|
async onFontSizeChange(value) {
|
|
42700
|
-
const
|
|
42701
|
-
|
|
42717
|
+
const v = Array.isArray(value) ? value[0] : value;
|
|
42718
|
+
const fontSize = v;
|
|
42719
|
+
if (this.saving() || v === this.prefs.fontSize())
|
|
42702
42720
|
return;
|
|
42703
42721
|
await this.dispatch(() => this.prefs.setFontSize(fontSize), () => this.resolvedConfig().onFontSizeChanged?.(fontSize));
|
|
42704
42722
|
}
|
|
@@ -42765,18 +42783,7 @@ class PreferencesViewComponent {
|
|
|
42765
42783
|
content: themeHint(),
|
|
42766
42784
|
}"
|
|
42767
42785
|
/>
|
|
42768
|
-
<
|
|
42769
|
-
[value]="prefs.theme()"
|
|
42770
|
-
[disabled]="saving()"
|
|
42771
|
-
fill="outline"
|
|
42772
|
-
expand="block"
|
|
42773
|
-
interface="popover"
|
|
42774
|
-
(ionChange)="onThemeChange($event.detail.value)"
|
|
42775
|
-
>
|
|
42776
|
-
<ion-select-option value="light">{{ themeLight() }}</ion-select-option>
|
|
42777
|
-
<ion-select-option value="dark">{{ themeDark() }}</ion-select-option>
|
|
42778
|
-
<ion-select-option value="auto">{{ themeAuto() }}</ion-select-option>
|
|
42779
|
-
</ion-select>
|
|
42786
|
+
<val-popover-selector [props]="themePickerProps()" (selectionChange)="onThemeChange($event)" />
|
|
42780
42787
|
</div>
|
|
42781
42788
|
</section>
|
|
42782
42789
|
}
|
|
@@ -42824,30 +42831,18 @@ class PreferencesViewComponent {
|
|
|
42824
42831
|
content: fontSizeHint(),
|
|
42825
42832
|
}"
|
|
42826
42833
|
/>
|
|
42827
|
-
<
|
|
42828
|
-
[value]="prefs.fontSize()"
|
|
42829
|
-
[disabled]="saving()"
|
|
42830
|
-
fill="outline"
|
|
42831
|
-
expand="block"
|
|
42832
|
-
interface="popover"
|
|
42833
|
-
(ionChange)="onFontSizeChange($event.detail.value)"
|
|
42834
|
-
>
|
|
42835
|
-
<ion-select-option value="small">{{ fontSizeSmall() }}</ion-select-option>
|
|
42836
|
-
<ion-select-option value="medium">{{ fontSizeMedium() }}</ion-select-option>
|
|
42837
|
-
<ion-select-option value="large">{{ fontSizeLarge() }}</ion-select-option>
|
|
42838
|
-
</ion-select>
|
|
42834
|
+
<val-popover-selector [props]="fontSizePickerProps()" (selectionChange)="onFontSizeChange($event)" />
|
|
42839
42835
|
</div>
|
|
42840
42836
|
</section>
|
|
42841
42837
|
}
|
|
42842
42838
|
</div>
|
|
42843
|
-
`, isInline: true, styles: [".page{padding:16px 0;max-width:720px;margin:0 auto}.settings-section{padding:16px 0}.settings-section+.settings-section{border-top:1px solid var(--val-border-color, rgba(0, 0, 0, .08))}.section-body{display:flex;flex-direction:column;gap:10px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type:
|
|
42839
|
+
`, isInline: true, styles: [".page{padding:16px 0;max-width:720px;margin:0 auto}.settings-section{padding:16px 0}.settings-section+.settings-section{border-top:1px solid var(--val-border-color, rgba(0, 0, 0, .08))}.section-body{display:flex;flex-direction:column;gap:10px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: PopoverSelectorComponent, selector: "val-popover-selector", inputs: ["props"], outputs: ["selectionChange"] }, { kind: "component", type: LanguageSelectorComponent, selector: "val-language-selector", inputs: ["props"], outputs: ["languageChange"] }, { kind: "component", type: DisplayComponent, selector: "val-display", inputs: ["props"] }, { kind: "component", type: TitleComponent, selector: "val-title", inputs: ["props"] }, { kind: "component", type: TextComponent, selector: "val-text", inputs: ["props"] }] }); }
|
|
42844
42840
|
}
|
|
42845
42841
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PreferencesViewComponent, decorators: [{
|
|
42846
42842
|
type: Component,
|
|
42847
42843
|
args: [{ selector: 'val-preferences-view', standalone: true, imports: [
|
|
42848
42844
|
CommonModule,
|
|
42849
|
-
|
|
42850
|
-
IonSelectOption,
|
|
42845
|
+
PopoverSelectorComponent,
|
|
42851
42846
|
LanguageSelectorComponent,
|
|
42852
42847
|
DisplayComponent,
|
|
42853
42848
|
TitleComponent,
|
|
@@ -42885,18 +42880,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
42885
42880
|
content: themeHint(),
|
|
42886
42881
|
}"
|
|
42887
42882
|
/>
|
|
42888
|
-
<
|
|
42889
|
-
[value]="prefs.theme()"
|
|
42890
|
-
[disabled]="saving()"
|
|
42891
|
-
fill="outline"
|
|
42892
|
-
expand="block"
|
|
42893
|
-
interface="popover"
|
|
42894
|
-
(ionChange)="onThemeChange($event.detail.value)"
|
|
42895
|
-
>
|
|
42896
|
-
<ion-select-option value="light">{{ themeLight() }}</ion-select-option>
|
|
42897
|
-
<ion-select-option value="dark">{{ themeDark() }}</ion-select-option>
|
|
42898
|
-
<ion-select-option value="auto">{{ themeAuto() }}</ion-select-option>
|
|
42899
|
-
</ion-select>
|
|
42883
|
+
<val-popover-selector [props]="themePickerProps()" (selectionChange)="onThemeChange($event)" />
|
|
42900
42884
|
</div>
|
|
42901
42885
|
</section>
|
|
42902
42886
|
}
|
|
@@ -42944,18 +42928,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
42944
42928
|
content: fontSizeHint(),
|
|
42945
42929
|
}"
|
|
42946
42930
|
/>
|
|
42947
|
-
<
|
|
42948
|
-
[value]="prefs.fontSize()"
|
|
42949
|
-
[disabled]="saving()"
|
|
42950
|
-
fill="outline"
|
|
42951
|
-
expand="block"
|
|
42952
|
-
interface="popover"
|
|
42953
|
-
(ionChange)="onFontSizeChange($event.detail.value)"
|
|
42954
|
-
>
|
|
42955
|
-
<ion-select-option value="small">{{ fontSizeSmall() }}</ion-select-option>
|
|
42956
|
-
<ion-select-option value="medium">{{ fontSizeMedium() }}</ion-select-option>
|
|
42957
|
-
<ion-select-option value="large">{{ fontSizeLarge() }}</ion-select-option>
|
|
42958
|
-
</ion-select>
|
|
42931
|
+
<val-popover-selector [props]="fontSizePickerProps()" (selectionChange)="onFontSizeChange($event)" />
|
|
42959
42932
|
</div>
|
|
42960
42933
|
</section>
|
|
42961
42934
|
}
|
|
@@ -43708,6 +43681,7 @@ function makeTable(rows) {
|
|
|
43708
43681
|
*/
|
|
43709
43682
|
class FaqComponent {
|
|
43710
43683
|
constructor() {
|
|
43684
|
+
this.i18n = inject(I18nService);
|
|
43711
43685
|
this.props_ = signal({ categories: [] });
|
|
43712
43686
|
/** Término de búsqueda actual. */
|
|
43713
43687
|
this.query = signal('');
|
|
@@ -43717,10 +43691,11 @@ class FaqComponent {
|
|
|
43717
43691
|
* Keyed por id de item (los ids son únicos en toda la FAQ).
|
|
43718
43692
|
*/
|
|
43719
43693
|
this.parsedAnswers = computed(() => {
|
|
43694
|
+
const locale = (this.i18n.lang() ?? 'es');
|
|
43720
43695
|
const map = new Map();
|
|
43721
43696
|
for (const cat of this.props_().categories ?? []) {
|
|
43722
43697
|
for (const item of cat.items) {
|
|
43723
|
-
map.set(item.id, parseMarkdownArticle(item.answer));
|
|
43698
|
+
map.set(item.id, parseMarkdownArticle(item.answer, { locale }));
|
|
43724
43699
|
}
|
|
43725
43700
|
}
|
|
43726
43701
|
return map;
|
|
@@ -45532,8 +45507,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
45532
45507
|
* `markdown-article-parser.ts` and is also usable from Node scripts (build-time generation).
|
|
45533
45508
|
*/
|
|
45534
45509
|
class MarkdownArticleParserService {
|
|
45535
|
-
parse(markdown, config) {
|
|
45536
|
-
return parseMarkdownArticle(markdown, config);
|
|
45510
|
+
parse(markdown, config, locale) {
|
|
45511
|
+
return parseMarkdownArticle(markdown, { ...config, locale });
|
|
45537
45512
|
}
|
|
45538
45513
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MarkdownArticleParserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
45539
45514
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MarkdownArticleParserService, providedIn: 'root' }); }
|
|
@@ -49728,7 +49703,8 @@ class ContentService {
|
|
|
49728
49703
|
* @param config - Override parcial de la `ArticleMetadata` resultante.
|
|
49729
49704
|
*/
|
|
49730
49705
|
toArticle(doc, config) {
|
|
49731
|
-
|
|
49706
|
+
const locale = (doc.locale ?? 'es');
|
|
49707
|
+
return this.parser.parse(doc.body, config, locale);
|
|
49732
49708
|
}
|
|
49733
49709
|
/** Limpia la cache de fuentes estáticas. Llamar al cambiar de locale en runtime. */
|
|
49734
49710
|
invalidate() {
|