@dsivd/prestations-ng 19.2.0-beta.26 → 19.2.0-beta.28
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/AI_GUIDELINES.md +141 -0
- package/ANGULAR_SIGNALS.md +2 -2
- package/CHANGELOG.md +29 -0
- package/CONTRIBUTING.md +47 -8
- package/ESLINT_PLUGIN.md +56 -11
- package/GOOD_PRACTICES.md +14 -10
- package/README.md +4 -0
- package/UPGRADING_V19.md +85 -6
- package/eslint/configs/template-rules.mjs +3 -0
- package/eslint/rules/index.mjs +2 -0
- package/eslint/rules/no-item-track-in-form-list.mjs +4 -3
- package/eslint/rules/require-track-index.mjs +162 -0
- package/fesm2022/dsivd-prestations-ng.mjs +10 -19
- package/fesm2022/dsivd-prestations-ng.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/migration-collection.json +1 -1
- package/schematics/ng-update/migrations/update-19_2_0/index.js +13 -2
- package/schematics/utility/form-signal/form-signal-migration.js +4 -73
- package/schematics/utility/never-connected-migration.js +87 -0
- package/schematics/utility/typescript-files.js +95 -0
- package/src/eslint/configs/template-rules.mjs +3 -0
- package/src/eslint/rules/__tests__/require-track-index.test.mjs +106 -0
- package/src/eslint/rules/index.mjs +2 -0
- package/src/eslint/rules/no-item-track-in-form-list.mjs +4 -3
- package/src/eslint/rules/require-track-index.mjs +162 -0
- package/types/dsivd-prestations-ng.d.ts +0 -2
|
@@ -11,8 +11,9 @@ import { astOf, resolveRoot } from "../form-reads.mjs";
|
|
|
11
11
|
* `FoehnInputComponent` writes a new list in its model, its items replaced (`updateNgModel()`).
|
|
12
12
|
* A row tracked by its item is then destroyed and created again at every input, and the field
|
|
13
13
|
* being edited loses the focus; two items equal by value (e.g. two empty strings) even collide.
|
|
14
|
-
* Track the rows by `$index
|
|
15
|
-
*
|
|
14
|
+
* Track the rows by `$index`: an identifier of the item (`track child.id`), which the copy keeps,
|
|
15
|
+
* only when the rows name nothing with their index (see `require-track-index`, which reports
|
|
16
|
+
* these lists too when they do).
|
|
16
17
|
*
|
|
17
18
|
* A row edits its item when one of its elements has a `model` read from it
|
|
18
19
|
* (`[model]="child.firstName"`, `[(model)]="child"`), or read from the list at the index of
|
|
@@ -108,7 +109,7 @@ export default {
|
|
|
108
109
|
schema: [],
|
|
109
110
|
messages: {
|
|
110
111
|
itemTrack:
|
|
111
|
-
"The rows of this list are tracked by their item ('track {{item}}'): writing an item replaces it, so its row is created again and the field being edited loses the focus. Track the rows by $index
|
|
112
|
+
"The rows of this list are tracked by their item ('track {{item}}'): writing an item replaces it, so its row is created again and the field being edited loses the focus. Track the rows by $index (by an identifier of the item only when the rows name nothing with their index).",
|
|
112
113
|
trackByIndex: "Track the rows by $index",
|
|
113
114
|
},
|
|
114
115
|
},
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { isComponentReceiver } from "../template-ast.mjs";
|
|
2
|
+
import { astOf } from "../form-reads.mjs";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ESLint rule: a `@for` whose rows name their fields with the index of the row
|
|
6
|
+
* (`[name]="'children[' + $index + '].firstName'"`, `name="child{{ i }}"`), or the errors of the
|
|
7
|
+
* row (`[errorPrefix]` of `foehn-error-pill`), must track its rows by `$index`.
|
|
8
|
+
*
|
|
9
|
+
* The names of the fields follow the paths of the errors of GESDEM (`children[1].firstName`).
|
|
10
|
+
* Tracked by anything else (an identifier, the item), a row whose item moves (an earlier item
|
|
11
|
+
* removed or inserted, the list sorted) is kept with its fields renamed: `foehn-form` keeps them
|
|
12
|
+
* registered under their former names, so the row taking one of these names shares their
|
|
13
|
+
* `FormControl`, and the errors, read by name when they are emitted, stay those of the former
|
|
14
|
+
* name. Tracked by `$index`, a row never changes its names: only its item changes.
|
|
15
|
+
*
|
|
16
|
+
* The index is `$index` or an alias of it (`let i = $index`), of the innermost `@for` declaring
|
|
17
|
+
* the name: a name built with the index of an enclosing `@for` reports that one.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
// The inputs naming a field, or the errors of a row
|
|
21
|
+
const NAME_INPUTS = new Set(["name", "errorPrefix"]);
|
|
22
|
+
|
|
23
|
+
// The members of an expression node that aren't expressions
|
|
24
|
+
const NOT_EXPRESSIONS = new Set([
|
|
25
|
+
"span",
|
|
26
|
+
"sourceSpan",
|
|
27
|
+
"nameSpan",
|
|
28
|
+
"keySpan",
|
|
29
|
+
"loc",
|
|
30
|
+
"parent",
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The names read on the component by an expression (`i`, `$index`), nested reads included.
|
|
35
|
+
*/
|
|
36
|
+
function namesReadBy(expression, names = []) {
|
|
37
|
+
if (Array.isArray(expression)) {
|
|
38
|
+
expression.forEach((item) => namesReadBy(item, names));
|
|
39
|
+
return names;
|
|
40
|
+
}
|
|
41
|
+
if (!expression || typeof expression !== "object") {
|
|
42
|
+
return names;
|
|
43
|
+
}
|
|
44
|
+
if (
|
|
45
|
+
expression.type === "PropertyRead" &&
|
|
46
|
+
isComponentReceiver(expression.receiver)
|
|
47
|
+
) {
|
|
48
|
+
names.push(expression.name);
|
|
49
|
+
}
|
|
50
|
+
for (const [key, value] of Object.entries(expression)) {
|
|
51
|
+
if (!NOT_EXPRESSIONS.has(key) && value && typeof value === "object") {
|
|
52
|
+
namesReadBy(value, names);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return names;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The `@for` whose `$index` a name is: the innermost enclosing `@for` declaring the name, when
|
|
60
|
+
* it declares it as its `$index` (itself or an alias).
|
|
61
|
+
*/
|
|
62
|
+
function forBlockIndexed(name, node) {
|
|
63
|
+
for (let current = node; current; current = current.parent) {
|
|
64
|
+
if (current.type !== "ForLoopBlock") {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const variable = current.contextVariables?.find(
|
|
68
|
+
(contextVariable) => contextVariable.name === name,
|
|
69
|
+
);
|
|
70
|
+
if (variable) {
|
|
71
|
+
return variable.value === "$index" ? current : undefined;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Whether a `@for` tracks its rows by its `$index`, or an alias of it.
|
|
79
|
+
*/
|
|
80
|
+
function tracksIndex(forBlock) {
|
|
81
|
+
const track = astOf(forBlock.trackBy);
|
|
82
|
+
return (
|
|
83
|
+
track?.type === "PropertyRead" &&
|
|
84
|
+
isComponentReceiver(track.receiver) &&
|
|
85
|
+
!!forBlock.contextVariables?.some(
|
|
86
|
+
(contextVariable) =>
|
|
87
|
+
contextVariable.name === track.name &&
|
|
88
|
+
contextVariable.value === "$index",
|
|
89
|
+
)
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export default {
|
|
94
|
+
meta: {
|
|
95
|
+
type: "problem",
|
|
96
|
+
docs: {
|
|
97
|
+
description:
|
|
98
|
+
"Require tracking by $index the rows of a @for that name their fields, or their errors, with the index of the row",
|
|
99
|
+
category: "Possible Errors",
|
|
100
|
+
recommended: true,
|
|
101
|
+
},
|
|
102
|
+
hasSuggestions: true,
|
|
103
|
+
schema: [],
|
|
104
|
+
messages: {
|
|
105
|
+
indexTrack:
|
|
106
|
+
"The rows of this list name their fields with the index ({{binding}}) but are tracked by '{{track}}': a row whose item moves keeps its fields registered under their former names, and mixes up their values and errors with the row taking these names. Track the rows by $index.",
|
|
107
|
+
trackByIndex: "Track the rows by $index",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
create(context) {
|
|
112
|
+
// The @for naming the fields of their rows with their index, and the first such binding
|
|
113
|
+
const indexedBlocks = new Map();
|
|
114
|
+
const textOf = (expression) =>
|
|
115
|
+
context.sourceCode.text
|
|
116
|
+
.slice(expression.sourceSpan.start, expression.sourceSpan.end)
|
|
117
|
+
.replace(/\s+/g, " ")
|
|
118
|
+
.trim();
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
Element(node) {
|
|
122
|
+
for (const input of node.inputs ?? []) {
|
|
123
|
+
if (!NAME_INPUTS.has(input.name)) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
for (const name of namesReadBy(astOf(input.value))) {
|
|
127
|
+
const forBlock = forBlockIndexed(name, node);
|
|
128
|
+
if (forBlock && !indexedBlocks.has(forBlock)) {
|
|
129
|
+
indexedBlocks.set(
|
|
130
|
+
forBlock,
|
|
131
|
+
`${input.name}="${input.value.source ?? textOf(astOf(input.value))}"`,
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"Program:exit"() {
|
|
138
|
+
for (const [forBlock, binding] of indexedBlocks) {
|
|
139
|
+
if (tracksIndex(forBlock)) {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
const track = astOf(forBlock.trackBy);
|
|
143
|
+
const { start, end } = track.sourceSpan;
|
|
144
|
+
context.report({
|
|
145
|
+
messageId: "indexTrack",
|
|
146
|
+
data: { binding, track: textOf(track) },
|
|
147
|
+
loc: {
|
|
148
|
+
start: context.sourceCode.getLocFromIndex(start),
|
|
149
|
+
end: context.sourceCode.getLocFromIndex(end),
|
|
150
|
+
},
|
|
151
|
+
suggest: [
|
|
152
|
+
{
|
|
153
|
+
messageId: "trackByIndex",
|
|
154
|
+
fix: (fixer) => fixer.replaceTextRange([start, end], "$index"),
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
},
|
|
162
|
+
};
|
|
@@ -7912,7 +7912,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImpo
|
|
|
7912
7912
|
args: [{ selector: 'sdk-support-alert-container', imports: [SupportAlertComponent, AsyncPipe], template: "@if (hasAlerts | async) {\n <section class=\"d-flex flex-column container mt-2\">\n <h2 class=\"visually-hidden\">Messages de support</h2>\n @if (hasHiddenAlerts | async) {\n <div class=\"mb-2 mt-2\">\n <button\n type=\"button\"\n class=\"btn btn-link pe-0 ps-0\"\n (click)=\"restoreAllAlerts()\"\n >\n Afficher tous les messages\n </button>\n </div>\n }\n @for (alert of alertsToDisplay | async; track alert) {\n <sdk-support-alert [alert]=\"alert\" />\n }\n </section>\n}\n" }]
|
|
7913
7913
|
}], propDecorators: { supportAlertUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "supportAlertUrl", required: false }] }], etapeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "etapeId", required: false }] }] } });
|
|
7914
7914
|
|
|
7915
|
-
const supportedBrowsers = /Edge?\/(15[4-9]|1[6-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Firefox\/(15[3-9]|1[6-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Chrom(ium|e)\/(109|1[1-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|(Maci|X1{2}).+ Version\/(26\.([6-9]|\d{2,})|(2[7-9]|[3-9]\d|\d{3,})\.\d+)([,.]\d+|)( \(\w+\)|)( Mobile\/\w+|) Safari\/|Chrome.+OPR\/(13[89]|1[4-9]\d|[2-9]\d{2}|\d{4,})\.\d+\.\d+|(CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS|CPU iPad OS)[ +]+(18[._]([5-9]|\d{2,})|(19|[2-9]\d|\d{3,})[._]\d+)([._]\d+|)|Opera Mini|Android:?[ /-](15[7-9]|1[6-9]\d|[2-9]\d{2}|\d{4,})(\.\d+|)(\.\d+|)|Mobile Safari.+OPR\/([89]\d|\d{3,})\.\d+\.\d+|Android.+Firefox\/(
|
|
7915
|
+
const supportedBrowsers = /Edge?\/(15[4-9]|1[6-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Firefox\/(15[3-9]|1[6-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Chrom(ium|e)\/(109|1[1-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|(Maci|X1{2}).+ Version\/(26\.([6-9]|\d{2,})|(2[7-9]|[3-9]\d|\d{3,})\.\d+)([,.]\d+|)( \(\w+\)|)( Mobile\/\w+|) Safari\/|Chrome.+OPR\/(13[89]|1[4-9]\d|[2-9]\d{2}|\d{4,})\.\d+\.\d+|(CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS|CPU iPad OS)[ +]+(18[._]([5-9]|\d{2,})|(19|[2-9]\d|\d{3,})[._]\d+)([._]\d+|)|Opera Mini|Android:?[ /-](15[7-9]|1[6-9]\d|[2-9]\d{2}|\d{4,})(\.\d+|)(\.\d+|)|Mobile Safari.+OPR\/([89]\d|\d{3,})\.\d+\.\d+|Android.+Firefox\/(16\d|1[7-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Android.+Chrom(ium|e)\/(15[7-9]|1[6-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Android.+(UC? ?Browser|UCWEB|U3)[ /]?(15\.([5-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})\.\d+)\.\d+|SamsungBrowser\/([3-9]\d|\d{3,})\.\d+|Android.+MQ{2}Browser\/(14(\.(9|\d{2,})|)|(1[5-9]|[2-9]\d|\d{3,})(\.\d+|))(\.\d+|)|K[Aa][Ii]OS\/(2\.([5-9]|\d{2,})|([3-9]|\d{2,})\.\d+)(\.\d+|)/;
|
|
7916
7916
|
|
|
7917
7917
|
class FoehnAppVersionMisMatchModalComponent {
|
|
7918
7918
|
isModalVisible;
|
|
@@ -9827,7 +9827,7 @@ class FoehnCheckboxComponent extends FoehnCheckableGroupComponent {
|
|
|
9827
9827
|
provide: FoehnInputComponent,
|
|
9828
9828
|
useExisting: forwardRef(() => FoehnCheckboxComponent),
|
|
9829
9829
|
},
|
|
9830
|
-
], usesInheritance: true, ngImport: i0, template: "<div\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n <fieldset class=\"form-group\" [attr.aria-describedby]=\"getDescribedBy()\">\n <div class=\"d-flex justify-content-between\">\n @if (!!label()) {\n <legend\n [class.visually-hidden]=\"isLabelSrOnly()\"\n [class.vd-p]=\"!isLabelSrOnly()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </legend>\n }\n @if (!!helpModal()) {\n <foehn-help-modal\n [id]=\"buildChildId('HelpModal')\"\n class=\"removePaddingButton\"\n [modalContent]=\"helpModal()\"\n />\n }\n </div>\n\n <foehn-validation-alerts [component]=\"this\" />\n\n @if (hasMissingModelValue()) {\n @for (missingValue of missingModelValues(); track $index) {\n <p\n class=\"alert alert-warning\"\n role=\"alert\"\n [attr.id]=\"buildId('MissingValue') + $index\"\n >\n {{\n 'foehn-checkable-group.missing-value.warning'\n | fromDictionary\n : { value: getMissingValueLabel(missingValue) }\n }}\n </p>\n }\n }\n\n @if (!elements()) {\n <div>Chargement...</div>\n }\n\n @if (helpText()) {\n <small\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n <ng-content />\n\n @for (\n elementsGroup of groupedElements();\n track $index;\n let groupIndex = $index\n ) {\n <div>\n @if (!!elementsGroup.groupTitle) {\n <div\n class=\"pt-2 fw-bold\"\n [attr.id]=\"buildChildId('GroupTitle_' + groupIndex)\"\n >\n {{ elementsGroup.groupTitle | fromDictionary }}\n </div>\n }\n @for (\n element of elementsGroup.elements;\n track
|
|
9830
|
+
], usesInheritance: true, ngImport: i0, template: "<div\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n <fieldset class=\"form-group\" [attr.aria-describedby]=\"getDescribedBy()\">\n <div class=\"d-flex justify-content-between\">\n @if (!!label()) {\n <legend\n [class.visually-hidden]=\"isLabelSrOnly()\"\n [class.vd-p]=\"!isLabelSrOnly()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </legend>\n }\n @if (!!helpModal()) {\n <foehn-help-modal\n [id]=\"buildChildId('HelpModal')\"\n class=\"removePaddingButton\"\n [modalContent]=\"helpModal()\"\n />\n }\n </div>\n\n <foehn-validation-alerts [component]=\"this\" />\n\n @if (hasMissingModelValue()) {\n @for (missingValue of missingModelValues(); track $index) {\n <p\n class=\"alert alert-warning\"\n role=\"alert\"\n [attr.id]=\"buildId('MissingValue') + $index\"\n >\n {{\n 'foehn-checkable-group.missing-value.warning'\n | fromDictionary\n : { value: getMissingValueLabel(missingValue) }\n }}\n </p>\n }\n }\n\n @if (!elements()) {\n <div>Chargement...</div>\n }\n\n @if (helpText()) {\n <small\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n <ng-content />\n\n @for (\n elementsGroup of groupedElements();\n track $index;\n let groupIndex = $index\n ) {\n <div>\n @if (!!elementsGroup.groupTitle) {\n <div\n class=\"pt-2 fw-bold\"\n [attr.id]=\"buildChildId('GroupTitle_' + groupIndex)\"\n >\n {{ elementsGroup.groupTitle | fromDictionary }}\n </div>\n }\n @for (\n element of elementsGroup.elements;\n track $index;\n let i = $index\n ) {\n <div\n [class.disabled]=\"getDisabled(element)\"\n class=\"form-check\"\n >\n <input\n class=\"form-check-input\"\n type=\"checkbox\"\n [value]=\"getValue(element)\"\n [ngModel]=\"isElementSelected(element)\"\n (ngModelChange)=\"onCheck(element, $event)\"\n [name]=\"buildChildName('' + groupIndex + '_' + i)\"\n [attr.name]=\"\n buildChildName('' + groupIndex + '_' + i)\n \"\n [attr.id]=\"buildChildId(groupIndex + '_' + i)\"\n [attr.aria-labelledby]=\"\n (!!elementsGroup.groupTitle\n ? buildChildId('GroupTitle_' + groupIndex) +\n ' '\n : '') +\n buildChildId() +\n groupIndex +\n '_' +\n i +\n '_label'\n \"\n [attr.aria-invalid]=\"hasErrorsToDisplay() || null\"\n [disabled]=\"getDisabled(element)\"\n [attr.autocomplete]=\"getAutoComplete()\"\n (change)=\"handleChange(model())\"\n />\n <label\n class=\"form-check-label mb-0\"\n [for]=\"buildChildId(groupIndex + '_' + i)\"\n [attr.id]=\"\n buildChildId(groupIndex + '_' + i + '_label')\n \"\n [innerHTML]=\"getLabel(element)\"\n ></label>\n </div>\n }\n </div>\n }\n </fieldset>\n</div>\n", dependencies: [{ kind: "component", type: FoehnHelpModalComponent, selector: "foehn-help-modal", inputs: ["id", "modalContent", "draggable", "hideable"] }, { kind: "component", type: FoehnValidationAlertsComponent, selector: "foehn-validation-alerts", inputs: ["component", "shouldErrorsBeLive"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: SdkDictionaryPipe, name: "fromDictionary" }] });
|
|
9831
9831
|
}
|
|
9832
9832
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: FoehnCheckboxComponent, decorators: [{
|
|
9833
9833
|
type: Component,
|
|
@@ -9841,7 +9841,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImpo
|
|
|
9841
9841
|
FoehnValidationAlertsComponent,
|
|
9842
9842
|
FormsModule,
|
|
9843
9843
|
SdkDictionaryPipe,
|
|
9844
|
-
], template: "<div\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n <fieldset class=\"form-group\" [attr.aria-describedby]=\"getDescribedBy()\">\n <div class=\"d-flex justify-content-between\">\n @if (!!label()) {\n <legend\n [class.visually-hidden]=\"isLabelSrOnly()\"\n [class.vd-p]=\"!isLabelSrOnly()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </legend>\n }\n @if (!!helpModal()) {\n <foehn-help-modal\n [id]=\"buildChildId('HelpModal')\"\n class=\"removePaddingButton\"\n [modalContent]=\"helpModal()\"\n />\n }\n </div>\n\n <foehn-validation-alerts [component]=\"this\" />\n\n @if (hasMissingModelValue()) {\n @for (missingValue of missingModelValues(); track $index) {\n <p\n class=\"alert alert-warning\"\n role=\"alert\"\n [attr.id]=\"buildId('MissingValue') + $index\"\n >\n {{\n 'foehn-checkable-group.missing-value.warning'\n | fromDictionary\n : { value: getMissingValueLabel(missingValue) }\n }}\n </p>\n }\n }\n\n @if (!elements()) {\n <div>Chargement...</div>\n }\n\n @if (helpText()) {\n <small\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n <ng-content />\n\n @for (\n elementsGroup of groupedElements();\n track $index;\n let groupIndex = $index\n ) {\n <div>\n @if (!!elementsGroup.groupTitle) {\n <div\n class=\"pt-2 fw-bold\"\n [attr.id]=\"buildChildId('GroupTitle_' + groupIndex)\"\n >\n {{ elementsGroup.groupTitle | fromDictionary }}\n </div>\n }\n @for (\n element of elementsGroup.elements;\n track
|
|
9844
|
+
], template: "<div\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n <fieldset class=\"form-group\" [attr.aria-describedby]=\"getDescribedBy()\">\n <div class=\"d-flex justify-content-between\">\n @if (!!label()) {\n <legend\n [class.visually-hidden]=\"isLabelSrOnly()\"\n [class.vd-p]=\"!isLabelSrOnly()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </legend>\n }\n @if (!!helpModal()) {\n <foehn-help-modal\n [id]=\"buildChildId('HelpModal')\"\n class=\"removePaddingButton\"\n [modalContent]=\"helpModal()\"\n />\n }\n </div>\n\n <foehn-validation-alerts [component]=\"this\" />\n\n @if (hasMissingModelValue()) {\n @for (missingValue of missingModelValues(); track $index) {\n <p\n class=\"alert alert-warning\"\n role=\"alert\"\n [attr.id]=\"buildId('MissingValue') + $index\"\n >\n {{\n 'foehn-checkable-group.missing-value.warning'\n | fromDictionary\n : { value: getMissingValueLabel(missingValue) }\n }}\n </p>\n }\n }\n\n @if (!elements()) {\n <div>Chargement...</div>\n }\n\n @if (helpText()) {\n <small\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n <ng-content />\n\n @for (\n elementsGroup of groupedElements();\n track $index;\n let groupIndex = $index\n ) {\n <div>\n @if (!!elementsGroup.groupTitle) {\n <div\n class=\"pt-2 fw-bold\"\n [attr.id]=\"buildChildId('GroupTitle_' + groupIndex)\"\n >\n {{ elementsGroup.groupTitle | fromDictionary }}\n </div>\n }\n @for (\n element of elementsGroup.elements;\n track $index;\n let i = $index\n ) {\n <div\n [class.disabled]=\"getDisabled(element)\"\n class=\"form-check\"\n >\n <input\n class=\"form-check-input\"\n type=\"checkbox\"\n [value]=\"getValue(element)\"\n [ngModel]=\"isElementSelected(element)\"\n (ngModelChange)=\"onCheck(element, $event)\"\n [name]=\"buildChildName('' + groupIndex + '_' + i)\"\n [attr.name]=\"\n buildChildName('' + groupIndex + '_' + i)\n \"\n [attr.id]=\"buildChildId(groupIndex + '_' + i)\"\n [attr.aria-labelledby]=\"\n (!!elementsGroup.groupTitle\n ? buildChildId('GroupTitle_' + groupIndex) +\n ' '\n : '') +\n buildChildId() +\n groupIndex +\n '_' +\n i +\n '_label'\n \"\n [attr.aria-invalid]=\"hasErrorsToDisplay() || null\"\n [disabled]=\"getDisabled(element)\"\n [attr.autocomplete]=\"getAutoComplete()\"\n (change)=\"handleChange(model())\"\n />\n <label\n class=\"form-check-label mb-0\"\n [for]=\"buildChildId(groupIndex + '_' + i)\"\n [attr.id]=\"\n buildChildId(groupIndex + '_' + i + '_label')\n \"\n [innerHTML]=\"getLabel(element)\"\n ></label>\n </div>\n }\n </div>\n }\n </fieldset>\n</div>\n" }]
|
|
9845
9845
|
}] });
|
|
9846
9846
|
|
|
9847
9847
|
class FoehnRadioComponent extends FoehnCheckableGroupComponent {
|
|
@@ -15501,13 +15501,6 @@ class AbstractListDetailPageComponent extends AbstractPageFromMenuComponent {
|
|
|
15501
15501
|
ngOnDestroy() {
|
|
15502
15502
|
this.resetBreadCrumb();
|
|
15503
15503
|
}
|
|
15504
|
-
getNextTrackingIndex() {
|
|
15505
|
-
const list = this.getList();
|
|
15506
|
-
if (!list.length) {
|
|
15507
|
-
return 1;
|
|
15508
|
-
}
|
|
15509
|
-
return (list.at(-1)?.trackingIndex ?? 0) + 1;
|
|
15510
|
-
}
|
|
15511
15504
|
returnToParent() {
|
|
15512
15505
|
this.router.navigate([
|
|
15513
15506
|
this._gesdemService.lastResponse.meta.reference,
|
|
@@ -15544,9 +15537,7 @@ class AbstractListDetailPageComponent extends AbstractPageFromMenuComponent {
|
|
|
15544
15537
|
});
|
|
15545
15538
|
}
|
|
15546
15539
|
loadNewItem() {
|
|
15547
|
-
const
|
|
15548
|
-
newItem.trackingIndex = this.getNextTrackingIndex();
|
|
15549
|
-
const list = [...this.getList(), newItem];
|
|
15540
|
+
const list = [...this.getList(), this.getNewListItem()];
|
|
15550
15541
|
this.form.update((form) => form
|
|
15551
15542
|
? ObjectPathHelper.patchByKeys(form, this.getListPath(), list)
|
|
15552
15543
|
: form);
|
|
@@ -15651,7 +15642,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImpo
|
|
|
15651
15642
|
}], ctorParameters: () => [], propDecorators: { errorPrefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorPrefix", required: false }] }], incompleteIndicatorOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "incompleteIndicatorOnly", required: false }] }] } });
|
|
15652
15643
|
|
|
15653
15644
|
class FoehnListItem {
|
|
15654
|
-
trackingIndex = undefined;
|
|
15655
15645
|
disableEdition;
|
|
15656
15646
|
disableDeletion;
|
|
15657
15647
|
}
|
|
@@ -15692,7 +15682,8 @@ class FoehnListSummaryComponent extends FoehnInputComponent {
|
|
|
15692
15682
|
sortDirection: 'ASC',
|
|
15693
15683
|
};
|
|
15694
15684
|
confirmModalService = inject(FoehnConfirmModalService);
|
|
15695
|
-
|
|
15685
|
+
// The rows are tracked by their position: their errors are read by the index of their item
|
|
15686
|
+
trackFoehnListItem = (index) => index;
|
|
15696
15687
|
trackFoehnListItemDescription = (index, item) => item.label || index;
|
|
15697
15688
|
showLine(item, itemParam) {
|
|
15698
15689
|
const value = itemParam.getFormattedValue(item);
|
|
@@ -15763,7 +15754,7 @@ class FoehnListSummaryComponent extends FoehnInputComponent {
|
|
|
15763
15754
|
provide: FoehnInputComponent,
|
|
15764
15755
|
useExisting: forwardRef(() => FoehnListSummaryComponent),
|
|
15765
15756
|
},
|
|
15766
|
-
], viewQueries: [{ propertyName: "tableActionButtons", first: true, predicate: ["tableActionButtons"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<section\n class=\"form-group clearable-input-form-group\"\n [class.has-danger]=\"hasErrorsToDisplay()\"\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n @if (label() && type !== 'hidden') {\n <label\n [class]=\"\n 'form-label ' +\n (isLabelSrOnly()\n ? 'visually-hidden'\n : (labelStyleModifier() ?? ''))\n \"\n [attr.for]=\"buildChildId()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </label>\n }\n\n <foehn-validation-alerts [component]=\"this\" />\n\n @if (helpText() && type !== 'hidden') {\n <small\n [attr.id]=\"buildChildId('Help')\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n @if (!showAsTable()) {\n <section>\n <ul class=\"list-unstyled\" aria-describedby=\"sommaire-help-alt\">\n @for (\n item of model();\n track trackFoehnListItem(itemIndex, item);\n let itemIndex = $index\n ) {\n <li\n [id]=\"'list-summary-' + item.trackingIndex\"\n class=\"mt-3 border-bottom\"\n >\n <div class=\"d-flex align-items-baseline flex-wrap\">\n @if (getListItemTitle(); as listItemTitle) {\n <h4 class=\"mt-0 me-3\">\n {{ listItemTitle(item) }}\n </h4>\n }\n <span class=\"ms-auto\">\n <foehn-error-pill\n [incompleteIndicatorOnly]=\"true\"\n [errorPrefix]=\"\n name() + '[' + itemIndex + ']'\n \"\n />\n </span>\n </div>\n <dl class=\"mb-0\">\n @for (\n itemParam of listItemDescriptions();\n track trackFoehnListItemDescription(\n $index,\n itemParam\n )\n ) {\n @if (showLine(item, itemParam)) {\n <div class=\"d-flex flex-wrap item-line\">\n <dt class=\"me-1\">\n {{ itemParam.label }}\n </dt>\n <dd class=\"ms-auto text-end\">\n {{\n itemParam.getFormattedValue(\n item\n )\n }}\n </dd>\n </div>\n }\n }\n </dl>\n <ul class=\"list-inline mb-3 mt-0\">\n @if (item.disableEdition && item.disableDeletion) {\n <li class=\"list-inline-item\">\n <a\n [id]=\"\n buildChildId(\n '-see-link-' + itemIndex\n )\n \"\n href=\"#\"\n (click)=\"\n $event.preventDefault();\n editItem(itemIndex)\n \"\n >\n Consulter\n </a>\n @if (getListItemTitle(); as listItemTitle) {\n <span class=\"visually-hidden\">\n {{ listItemTitle(item) }}\n </span>\n }\n </li>\n }\n @if (!item.disableEdition) {\n <li class=\"list-inline-item\">\n <a\n [id]=\"\n buildChildId(\n '-edit-link-' + itemIndex\n )\n \"\n href=\"#\"\n (click)=\"\n $event.preventDefault();\n editItem(itemIndex)\n \"\n >\n Modifier\n </a>\n @if (getListItemTitle(); as listItemTitle) {\n <span class=\"visually-hidden\">\n {{ listItemTitle(item) }}\n </span>\n }\n </li>\n }\n @if (!item.disableDeletion) {\n <li class=\"list-inline-item\">\n \n <a\n [id]=\"\n buildChildId(\n '-delete-link-' + itemIndex\n )\n \"\n href=\"#\"\n (click)=\"\n $event.preventDefault();\n removeItem(itemIndex)\n \"\n >\n Supprimer\n @if (\n getListItemTitle();\n as listItemTitle\n ) {\n <span class=\"visually-hidden\">\n {{ listItemTitle(item) }}\n </span>\n }\n </a>\n </li>\n }\n </ul>\n </li>\n }\n </ul>\n </section>\n }\n\n @if (showAsTable() && !!tableConfiguration().length) {\n <section>\n @if (!!listCopyForTable()?.length) {\n <foehn-table\n [name]=\"buildChildName('table')\"\n [model]=\"listCopyForTable()\"\n [itemsPerPage]=\"1000000\"\n [columnsConfiguration]=\"tableConfiguration()\"\n [sort]=\"tableSort\"\n (sortChange)=\"changeSort($event)\"\n [trackByFn]=\"trackFoehnListItem\"\n />\n }\n </section>\n }\n\n @if (canAddItems()) {\n <section [class.mt-5]=\"!showAsTable()\">\n <h2 class=\"visually-hidden\">Action</h2>\n <ul class=\"list-inline mb-3\">\n <li class=\"list-inline-item\">\n <button\n [id]=\"buildChildId('-add-button')\"\n type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"editItem()\"\n >\n Ajouter\n </button>\n </li>\n </ul>\n </section>\n }\n</section>\n\n<ng-template #tableActionButtons let-index=\"index\" let-item=\"item\">\n <div class=\"d-inline-flex\">\n @if (item.disableEdition && item.disableDeletion) {\n <button\n [id]=\"buildChildId('-see-button-' + index)\"\n type=\"button\"\n class=\"btn bg-transparent me-3\"\n (click)=\"editItem(index)\"\n >\n <foehn-icon-search [title]=\"'Consulter'\" />\n </button>\n }\n @if (!item.disableEdition) {\n <button\n [id]=\"buildChildId('-edit-button-' + index)\"\n type=\"button\"\n class=\"btn bg-transparent me-3\"\n (click)=\"editItem(index)\"\n >\n <foehn-icon-edit [title]=\"'Modifier'\" />\n </button>\n }\n @if (!item.disableDeletion) {\n <button\n [id]=\"buildChildId('-delete-button-' + index)\"\n type=\"button\"\n class=\"btn bg-transparent\"\n (click)=\"removeItem(index)\"\n >\n <foehn-icon-trash-alt [title]=\"'Supprimer'\" />\n </button>\n }\n </div>\n</ng-template>\n", styles: [":host ::ng-deep .bg-transparent.btn .svg-inline--fa{color:var(--vd-neutral-darker)!important}\n"], dependencies: [{ kind: "component", type: FoehnValidationAlertsComponent, selector: "foehn-validation-alerts", inputs: ["component", "shouldErrorsBeLive"] }, { kind: "component", type: FoehnErrorPillComponent, selector: "foehn-error-pill", inputs: ["errorPrefix", "incompleteIndicatorOnly"] }, { kind: "component", type: FoehnTableComponent, selector: "foehn-table", inputs: ["columnsConfiguration", "itemsPerPage", "fixedPageCount", "sort", "title", "totalElements", "titleSrOnly", "previousLabel", "nextLabel", "tableClass", "trackByFn"], outputs: ["sortChange", "pageChange", "rowClick"] }, { kind: "component", type: FoehnIconSearchComponent, selector: "foehn-icon-search" }, { kind: "component", type: FoehnIconEditComponent, selector: "foehn-icon-edit" }, { kind: "component", type: FoehnIconTrashAltComponent, selector: "foehn-icon-trash-alt" }, { kind: "pipe", type: SdkDictionaryPipe, name: "fromDictionary" }] });
|
|
15757
|
+
], viewQueries: [{ propertyName: "tableActionButtons", first: true, predicate: ["tableActionButtons"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<section\n class=\"form-group clearable-input-form-group\"\n [class.has-danger]=\"hasErrorsToDisplay()\"\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n @if (label() && type !== 'hidden') {\n <label\n [class]=\"\n 'form-label ' +\n (isLabelSrOnly()\n ? 'visually-hidden'\n : (labelStyleModifier() ?? ''))\n \"\n [attr.for]=\"buildChildId()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </label>\n }\n\n <foehn-validation-alerts [component]=\"this\" />\n\n @if (helpText() && type !== 'hidden') {\n <small\n [attr.id]=\"buildChildId('Help')\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n @if (!showAsTable()) {\n <section>\n <ul class=\"list-unstyled\" aria-describedby=\"sommaire-help-alt\">\n @for (item of model(); track $index; let itemIndex = $index) {\n <li\n [id]=\"'list-summary-' + (itemIndex + 1)\"\n class=\"mt-3 border-bottom\"\n >\n <div class=\"d-flex align-items-baseline flex-wrap\">\n @if (getListItemTitle(); as listItemTitle) {\n <h4 class=\"mt-0 me-3\">\n {{ listItemTitle(item) }}\n </h4>\n }\n <span class=\"ms-auto\">\n <foehn-error-pill\n [incompleteIndicatorOnly]=\"true\"\n [errorPrefix]=\"\n name() + '[' + itemIndex + ']'\n \"\n />\n </span>\n </div>\n <dl class=\"mb-0\">\n @for (\n itemParam of listItemDescriptions();\n track trackFoehnListItemDescription(\n $index,\n itemParam\n )\n ) {\n @if (showLine(item, itemParam)) {\n <div class=\"d-flex flex-wrap item-line\">\n <dt class=\"me-1\">\n {{ itemParam.label }}\n </dt>\n <dd class=\"ms-auto text-end\">\n {{\n itemParam.getFormattedValue(\n item\n )\n }}\n </dd>\n </div>\n }\n }\n </dl>\n <ul class=\"list-inline mb-3 mt-0\">\n @if (item.disableEdition && item.disableDeletion) {\n <li class=\"list-inline-item\">\n <a\n [id]=\"\n buildChildId(\n '-see-link-' + itemIndex\n )\n \"\n href=\"#\"\n (click)=\"\n $event.preventDefault();\n editItem(itemIndex)\n \"\n >\n Consulter\n </a>\n @if (getListItemTitle(); as listItemTitle) {\n <span class=\"visually-hidden\">\n {{ listItemTitle(item) }}\n </span>\n }\n </li>\n }\n @if (!item.disableEdition) {\n <li class=\"list-inline-item\">\n <a\n [id]=\"\n buildChildId(\n '-edit-link-' + itemIndex\n )\n \"\n href=\"#\"\n (click)=\"\n $event.preventDefault();\n editItem(itemIndex)\n \"\n >\n Modifier\n </a>\n @if (getListItemTitle(); as listItemTitle) {\n <span class=\"visually-hidden\">\n {{ listItemTitle(item) }}\n </span>\n }\n </li>\n }\n @if (!item.disableDeletion) {\n <li class=\"list-inline-item\">\n \n <a\n [id]=\"\n buildChildId(\n '-delete-link-' + itemIndex\n )\n \"\n href=\"#\"\n (click)=\"\n $event.preventDefault();\n removeItem(itemIndex)\n \"\n >\n Supprimer\n @if (\n getListItemTitle();\n as listItemTitle\n ) {\n <span class=\"visually-hidden\">\n {{ listItemTitle(item) }}\n </span>\n }\n </a>\n </li>\n }\n </ul>\n </li>\n }\n </ul>\n </section>\n }\n\n @if (showAsTable() && !!tableConfiguration().length) {\n <section>\n @if (!!listCopyForTable()?.length) {\n <foehn-table\n [name]=\"buildChildName('table')\"\n [model]=\"listCopyForTable()\"\n [itemsPerPage]=\"1000000\"\n [columnsConfiguration]=\"tableConfiguration()\"\n [sort]=\"tableSort\"\n (sortChange)=\"changeSort($event)\"\n [trackByFn]=\"trackFoehnListItem\"\n />\n }\n </section>\n }\n\n @if (canAddItems()) {\n <section [class.mt-5]=\"!showAsTable()\">\n <h2 class=\"visually-hidden\">Action</h2>\n <ul class=\"list-inline mb-3\">\n <li class=\"list-inline-item\">\n <button\n [id]=\"buildChildId('-add-button')\"\n type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"editItem()\"\n >\n Ajouter\n </button>\n </li>\n </ul>\n </section>\n }\n</section>\n\n<ng-template #tableActionButtons let-index=\"index\" let-item=\"item\">\n <div class=\"d-inline-flex\">\n @if (item.disableEdition && item.disableDeletion) {\n <button\n [id]=\"buildChildId('-see-button-' + index)\"\n type=\"button\"\n class=\"btn bg-transparent me-3\"\n (click)=\"editItem(index)\"\n >\n <foehn-icon-search [title]=\"'Consulter'\" />\n </button>\n }\n @if (!item.disableEdition) {\n <button\n [id]=\"buildChildId('-edit-button-' + index)\"\n type=\"button\"\n class=\"btn bg-transparent me-3\"\n (click)=\"editItem(index)\"\n >\n <foehn-icon-edit [title]=\"'Modifier'\" />\n </button>\n }\n @if (!item.disableDeletion) {\n <button\n [id]=\"buildChildId('-delete-button-' + index)\"\n type=\"button\"\n class=\"btn bg-transparent\"\n (click)=\"removeItem(index)\"\n >\n <foehn-icon-trash-alt [title]=\"'Supprimer'\" />\n </button>\n }\n </div>\n</ng-template>\n", styles: [":host ::ng-deep .bg-transparent.btn .svg-inline--fa{color:var(--vd-neutral-darker)!important}\n"], dependencies: [{ kind: "component", type: FoehnValidationAlertsComponent, selector: "foehn-validation-alerts", inputs: ["component", "shouldErrorsBeLive"] }, { kind: "component", type: FoehnErrorPillComponent, selector: "foehn-error-pill", inputs: ["errorPrefix", "incompleteIndicatorOnly"] }, { kind: "component", type: FoehnTableComponent, selector: "foehn-table", inputs: ["columnsConfiguration", "itemsPerPage", "fixedPageCount", "sort", "title", "totalElements", "titleSrOnly", "previousLabel", "nextLabel", "tableClass", "trackByFn"], outputs: ["sortChange", "pageChange", "rowClick"] }, { kind: "component", type: FoehnIconSearchComponent, selector: "foehn-icon-search" }, { kind: "component", type: FoehnIconEditComponent, selector: "foehn-icon-edit" }, { kind: "component", type: FoehnIconTrashAltComponent, selector: "foehn-icon-trash-alt" }, { kind: "pipe", type: SdkDictionaryPipe, name: "fromDictionary" }] });
|
|
15767
15758
|
}
|
|
15768
15759
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: FoehnListSummaryComponent, decorators: [{
|
|
15769
15760
|
type: Component,
|
|
@@ -15780,7 +15771,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImpo
|
|
|
15780
15771
|
FoehnIconEditComponent,
|
|
15781
15772
|
FoehnIconTrashAltComponent,
|
|
15782
15773
|
SdkDictionaryPipe,
|
|
15783
|
-
], template: "<section\n class=\"form-group clearable-input-form-group\"\n [class.has-danger]=\"hasErrorsToDisplay()\"\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n @if (label() && type !== 'hidden') {\n <label\n [class]=\"\n 'form-label ' +\n (isLabelSrOnly()\n ? 'visually-hidden'\n : (labelStyleModifier() ?? ''))\n \"\n [attr.for]=\"buildChildId()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </label>\n }\n\n <foehn-validation-alerts [component]=\"this\" />\n\n @if (helpText() && type !== 'hidden') {\n <small\n [attr.id]=\"buildChildId('Help')\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n @if (!showAsTable()) {\n <section>\n <ul class=\"list-unstyled\" aria-describedby=\"sommaire-help-alt\">\n @for (\n item of model();\n track trackFoehnListItem(itemIndex, item);\n let itemIndex = $index\n ) {\n <li\n [id]=\"'list-summary-' + item.trackingIndex\"\n class=\"mt-3 border-bottom\"\n >\n <div class=\"d-flex align-items-baseline flex-wrap\">\n @if (getListItemTitle(); as listItemTitle) {\n <h4 class=\"mt-0 me-3\">\n {{ listItemTitle(item) }}\n </h4>\n }\n <span class=\"ms-auto\">\n <foehn-error-pill\n [incompleteIndicatorOnly]=\"true\"\n [errorPrefix]=\"\n name() + '[' + itemIndex + ']'\n \"\n />\n </span>\n </div>\n <dl class=\"mb-0\">\n @for (\n itemParam of listItemDescriptions();\n track trackFoehnListItemDescription(\n $index,\n itemParam\n )\n ) {\n @if (showLine(item, itemParam)) {\n <div class=\"d-flex flex-wrap item-line\">\n <dt class=\"me-1\">\n {{ itemParam.label }}\n </dt>\n <dd class=\"ms-auto text-end\">\n {{\n itemParam.getFormattedValue(\n item\n )\n }}\n </dd>\n </div>\n }\n }\n </dl>\n <ul class=\"list-inline mb-3 mt-0\">\n @if (item.disableEdition && item.disableDeletion) {\n <li class=\"list-inline-item\">\n <a\n [id]=\"\n buildChildId(\n '-see-link-' + itemIndex\n )\n \"\n href=\"#\"\n (click)=\"\n $event.preventDefault();\n editItem(itemIndex)\n \"\n >\n Consulter\n </a>\n @if (getListItemTitle(); as listItemTitle) {\n <span class=\"visually-hidden\">\n {{ listItemTitle(item) }}\n </span>\n }\n </li>\n }\n @if (!item.disableEdition) {\n <li class=\"list-inline-item\">\n <a\n [id]=\"\n buildChildId(\n '-edit-link-' + itemIndex\n )\n \"\n href=\"#\"\n (click)=\"\n $event.preventDefault();\n editItem(itemIndex)\n \"\n >\n Modifier\n </a>\n @if (getListItemTitle(); as listItemTitle) {\n <span class=\"visually-hidden\">\n {{ listItemTitle(item) }}\n </span>\n }\n </li>\n }\n @if (!item.disableDeletion) {\n <li class=\"list-inline-item\">\n \n <a\n [id]=\"\n buildChildId(\n '-delete-link-' + itemIndex\n )\n \"\n href=\"#\"\n (click)=\"\n $event.preventDefault();\n removeItem(itemIndex)\n \"\n >\n Supprimer\n @if (\n getListItemTitle();\n as listItemTitle\n ) {\n <span class=\"visually-hidden\">\n {{ listItemTitle(item) }}\n </span>\n }\n </a>\n </li>\n }\n </ul>\n </li>\n }\n </ul>\n </section>\n }\n\n @if (showAsTable() && !!tableConfiguration().length) {\n <section>\n @if (!!listCopyForTable()?.length) {\n <foehn-table\n [name]=\"buildChildName('table')\"\n [model]=\"listCopyForTable()\"\n [itemsPerPage]=\"1000000\"\n [columnsConfiguration]=\"tableConfiguration()\"\n [sort]=\"tableSort\"\n (sortChange)=\"changeSort($event)\"\n [trackByFn]=\"trackFoehnListItem\"\n />\n }\n </section>\n }\n\n @if (canAddItems()) {\n <section [class.mt-5]=\"!showAsTable()\">\n <h2 class=\"visually-hidden\">Action</h2>\n <ul class=\"list-inline mb-3\">\n <li class=\"list-inline-item\">\n <button\n [id]=\"buildChildId('-add-button')\"\n type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"editItem()\"\n >\n Ajouter\n </button>\n </li>\n </ul>\n </section>\n }\n</section>\n\n<ng-template #tableActionButtons let-index=\"index\" let-item=\"item\">\n <div class=\"d-inline-flex\">\n @if (item.disableEdition && item.disableDeletion) {\n <button\n [id]=\"buildChildId('-see-button-' + index)\"\n type=\"button\"\n class=\"btn bg-transparent me-3\"\n (click)=\"editItem(index)\"\n >\n <foehn-icon-search [title]=\"'Consulter'\" />\n </button>\n }\n @if (!item.disableEdition) {\n <button\n [id]=\"buildChildId('-edit-button-' + index)\"\n type=\"button\"\n class=\"btn bg-transparent me-3\"\n (click)=\"editItem(index)\"\n >\n <foehn-icon-edit [title]=\"'Modifier'\" />\n </button>\n }\n @if (!item.disableDeletion) {\n <button\n [id]=\"buildChildId('-delete-button-' + index)\"\n type=\"button\"\n class=\"btn bg-transparent\"\n (click)=\"removeItem(index)\"\n >\n <foehn-icon-trash-alt [title]=\"'Supprimer'\" />\n </button>\n }\n </div>\n</ng-template>\n", styles: [":host ::ng-deep .bg-transparent.btn .svg-inline--fa{color:var(--vd-neutral-darker)!important}\n"] }]
|
|
15774
|
+
], template: "<section\n class=\"form-group clearable-input-form-group\"\n [class.has-danger]=\"hasErrorsToDisplay()\"\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n @if (label() && type !== 'hidden') {\n <label\n [class]=\"\n 'form-label ' +\n (isLabelSrOnly()\n ? 'visually-hidden'\n : (labelStyleModifier() ?? ''))\n \"\n [attr.for]=\"buildChildId()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </label>\n }\n\n <foehn-validation-alerts [component]=\"this\" />\n\n @if (helpText() && type !== 'hidden') {\n <small\n [attr.id]=\"buildChildId('Help')\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n @if (!showAsTable()) {\n <section>\n <ul class=\"list-unstyled\" aria-describedby=\"sommaire-help-alt\">\n @for (item of model(); track $index; let itemIndex = $index) {\n <li\n [id]=\"'list-summary-' + (itemIndex + 1)\"\n class=\"mt-3 border-bottom\"\n >\n <div class=\"d-flex align-items-baseline flex-wrap\">\n @if (getListItemTitle(); as listItemTitle) {\n <h4 class=\"mt-0 me-3\">\n {{ listItemTitle(item) }}\n </h4>\n }\n <span class=\"ms-auto\">\n <foehn-error-pill\n [incompleteIndicatorOnly]=\"true\"\n [errorPrefix]=\"\n name() + '[' + itemIndex + ']'\n \"\n />\n </span>\n </div>\n <dl class=\"mb-0\">\n @for (\n itemParam of listItemDescriptions();\n track trackFoehnListItemDescription(\n $index,\n itemParam\n )\n ) {\n @if (showLine(item, itemParam)) {\n <div class=\"d-flex flex-wrap item-line\">\n <dt class=\"me-1\">\n {{ itemParam.label }}\n </dt>\n <dd class=\"ms-auto text-end\">\n {{\n itemParam.getFormattedValue(\n item\n )\n }}\n </dd>\n </div>\n }\n }\n </dl>\n <ul class=\"list-inline mb-3 mt-0\">\n @if (item.disableEdition && item.disableDeletion) {\n <li class=\"list-inline-item\">\n <a\n [id]=\"\n buildChildId(\n '-see-link-' + itemIndex\n )\n \"\n href=\"#\"\n (click)=\"\n $event.preventDefault();\n editItem(itemIndex)\n \"\n >\n Consulter\n </a>\n @if (getListItemTitle(); as listItemTitle) {\n <span class=\"visually-hidden\">\n {{ listItemTitle(item) }}\n </span>\n }\n </li>\n }\n @if (!item.disableEdition) {\n <li class=\"list-inline-item\">\n <a\n [id]=\"\n buildChildId(\n '-edit-link-' + itemIndex\n )\n \"\n href=\"#\"\n (click)=\"\n $event.preventDefault();\n editItem(itemIndex)\n \"\n >\n Modifier\n </a>\n @if (getListItemTitle(); as listItemTitle) {\n <span class=\"visually-hidden\">\n {{ listItemTitle(item) }}\n </span>\n }\n </li>\n }\n @if (!item.disableDeletion) {\n <li class=\"list-inline-item\">\n \n <a\n [id]=\"\n buildChildId(\n '-delete-link-' + itemIndex\n )\n \"\n href=\"#\"\n (click)=\"\n $event.preventDefault();\n removeItem(itemIndex)\n \"\n >\n Supprimer\n @if (\n getListItemTitle();\n as listItemTitle\n ) {\n <span class=\"visually-hidden\">\n {{ listItemTitle(item) }}\n </span>\n }\n </a>\n </li>\n }\n </ul>\n </li>\n }\n </ul>\n </section>\n }\n\n @if (showAsTable() && !!tableConfiguration().length) {\n <section>\n @if (!!listCopyForTable()?.length) {\n <foehn-table\n [name]=\"buildChildName('table')\"\n [model]=\"listCopyForTable()\"\n [itemsPerPage]=\"1000000\"\n [columnsConfiguration]=\"tableConfiguration()\"\n [sort]=\"tableSort\"\n (sortChange)=\"changeSort($event)\"\n [trackByFn]=\"trackFoehnListItem\"\n />\n }\n </section>\n }\n\n @if (canAddItems()) {\n <section [class.mt-5]=\"!showAsTable()\">\n <h2 class=\"visually-hidden\">Action</h2>\n <ul class=\"list-inline mb-3\">\n <li class=\"list-inline-item\">\n <button\n [id]=\"buildChildId('-add-button')\"\n type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"editItem()\"\n >\n Ajouter\n </button>\n </li>\n </ul>\n </section>\n }\n</section>\n\n<ng-template #tableActionButtons let-index=\"index\" let-item=\"item\">\n <div class=\"d-inline-flex\">\n @if (item.disableEdition && item.disableDeletion) {\n <button\n [id]=\"buildChildId('-see-button-' + index)\"\n type=\"button\"\n class=\"btn bg-transparent me-3\"\n (click)=\"editItem(index)\"\n >\n <foehn-icon-search [title]=\"'Consulter'\" />\n </button>\n }\n @if (!item.disableEdition) {\n <button\n [id]=\"buildChildId('-edit-button-' + index)\"\n type=\"button\"\n class=\"btn bg-transparent me-3\"\n (click)=\"editItem(index)\"\n >\n <foehn-icon-edit [title]=\"'Modifier'\" />\n </button>\n }\n @if (!item.disableDeletion) {\n <button\n [id]=\"buildChildId('-delete-button-' + index)\"\n type=\"button\"\n class=\"btn bg-transparent\"\n (click)=\"removeItem(index)\"\n >\n <foehn-icon-trash-alt [title]=\"'Supprimer'\" />\n </button>\n }\n </div>\n</ng-template>\n", styles: [":host ::ng-deep .bg-transparent.btn .svg-inline--fa{color:var(--vd-neutral-darker)!important}\n"] }]
|
|
15784
15775
|
}], propDecorators: { getListItemTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "getListItemTitle", required: false }] }], listItemDescriptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "listItemDescriptions", required: false }] }], showAsTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAsTable", required: false }] }], tableActionButtons: [{ type: i0.ViewChild, args: ['tableActionButtons', { isSignal: true }] }], canAddItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "canAddItems", required: false }] }], itemRemoved: [{ type: i0.Output, args: ["itemRemoved"] }], itemEdit: [{ type: i0.Output, args: ["itemEdit"] }] } });
|
|
15785
15776
|
|
|
15786
15777
|
class FoehnMenuItemComponent {
|
|
@@ -16321,7 +16312,7 @@ class FoehnAgendaComponent extends FoehnInputComponent {
|
|
|
16321
16312
|
provide: FoehnInputComponent,
|
|
16322
16313
|
useExisting: forwardRef(() => FoehnAgendaComponent),
|
|
16323
16314
|
},
|
|
16324
|
-
], viewQueries: [{ propertyName: "timeSlotPanelsElemRef", predicate: ["timeSlotPanelElemRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"form-group\"\n [class.has-danger]=\"hasErrors()\"\n [class.vd-form-group-danger]=\"hasErrors()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n @if (label() && type !== 'hidden') {\n <p\n [attr.id]=\"buildChildId('Label')\"\n [attr.for]=\"buildChildId()\"\n [class.visually-hidden]=\"isLabelSrOnly()\"\n [class.vd-p]=\"!isLabelSrOnly()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </p>\n }\n\n @if (helpText() && type !== 'hidden') {\n <small\n [attr.id]=\"buildChildId('Help')\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n @if (!(calendar() | async)) {\n <foehn-validation-alerts [component]=\"this\" />\n <p class=\"alert alert-warning\">\n {{ 'foehn-agenda.calendar-indisponible' | fromDictionary }}\n </p>\n }\n\n <!-- Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name() || label() || ''\" [ngModel]=\"model()\" />\n\n <p\n [id]=\"buildChildId('srOnlyAnnouncements')\"\n class=\"visually-hidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ srAnnouncements() }}\n </p>\n\n <ng-content />\n\n @if (calendar() | async; as loadedCalendar) {\n <section\n class=\"mb-3\"\n [attr.aria-describedby]=\"getDescribedBy()\"\n [attr.aria-invalid]=\"hasErrors() || null\"\n >\n <h2 class=\"h3 mt-3\">\n <output aria-live=\"polite\" aria-atomic=\"true\">\n {{ loadedCalendar.currentWeek?.label }}\n </output>\n </h2>\n\n <!-- Rappel de l'heure actuellement s\u00E9lectionn\u00E9e -->\n <p\n [id]=\"buildChildId('timeSlotSelectedSrOnly')\"\n class=\"visually-hidden\"\n >\n {{ readableSelectedTimeSlot() }}\n </p>\n\n <!-- Navigation top hidden from screen reader-->\n <foehn-agenda-navigation\n [id]=\"buildChildId('week-pagination-top')\"\n [calendar]=\"loadedCalendar\"\n [minDate]=\"loadedCalendar.minAvailableDate\"\n [maxDate]=\"loadedCalendar.maxAvailableDate\"\n (paginationChange)=\"paginate($event)\"\n aria-hidden=\"true\"\n />\n\n <!-- Link to navigation bottom only for screen reader -->\n <p\n [id]=\"buildChildId('navigationBottomAnchor')\"\n class=\"visually-hidden\"\n >\n {{\n 'foehn-agenda.pagination-anchor.first-part' | fromDictionary\n }}\n <a\n href=\"#\"\n (click)=\"$event.preventDefault(); scrollToNavigation(true)\"\n >\n {{\n 'foehn-agenda.pagination-anchor.top-next-part'\n | fromDictionary\n }}\n </a>\n </p>\n\n <foehn-validation-alerts [component]=\"this\" />\n\n <div\n class=\"row\"\n [tabIndex]=\"hasErrors() ? 0 : -1\"\n [attr.id]=\"buildChildId()\"\n #entryComponent\n >\n @for (\n currentWeek of loadedCalendar.currentWeek?.week;\n track
|
|
16315
|
+
], viewQueries: [{ propertyName: "timeSlotPanelsElemRef", predicate: ["timeSlotPanelElemRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"form-group\"\n [class.has-danger]=\"hasErrors()\"\n [class.vd-form-group-danger]=\"hasErrors()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n @if (label() && type !== 'hidden') {\n <p\n [attr.id]=\"buildChildId('Label')\"\n [attr.for]=\"buildChildId()\"\n [class.visually-hidden]=\"isLabelSrOnly()\"\n [class.vd-p]=\"!isLabelSrOnly()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </p>\n }\n\n @if (helpText() && type !== 'hidden') {\n <small\n [attr.id]=\"buildChildId('Help')\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n @if (!(calendar() | async)) {\n <foehn-validation-alerts [component]=\"this\" />\n <p class=\"alert alert-warning\">\n {{ 'foehn-agenda.calendar-indisponible' | fromDictionary }}\n </p>\n }\n\n <!-- Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name() || label() || ''\" [ngModel]=\"model()\" />\n\n <p\n [id]=\"buildChildId('srOnlyAnnouncements')\"\n class=\"visually-hidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ srAnnouncements() }}\n </p>\n\n <ng-content />\n\n @if (calendar() | async; as loadedCalendar) {\n <section\n class=\"mb-3\"\n [attr.aria-describedby]=\"getDescribedBy()\"\n [attr.aria-invalid]=\"hasErrors() || null\"\n >\n <h2 class=\"h3 mt-3\">\n <output aria-live=\"polite\" aria-atomic=\"true\">\n {{ loadedCalendar.currentWeek?.label }}\n </output>\n </h2>\n\n <!-- Rappel de l'heure actuellement s\u00E9lectionn\u00E9e -->\n <p\n [id]=\"buildChildId('timeSlotSelectedSrOnly')\"\n class=\"visually-hidden\"\n >\n {{ readableSelectedTimeSlot() }}\n </p>\n\n <!-- Navigation top hidden from screen reader-->\n <foehn-agenda-navigation\n [id]=\"buildChildId('week-pagination-top')\"\n [calendar]=\"loadedCalendar\"\n [minDate]=\"loadedCalendar.minAvailableDate\"\n [maxDate]=\"loadedCalendar.maxAvailableDate\"\n (paginationChange)=\"paginate($event)\"\n aria-hidden=\"true\"\n />\n\n <!-- Link to navigation bottom only for screen reader -->\n <p\n [id]=\"buildChildId('navigationBottomAnchor')\"\n class=\"visually-hidden\"\n >\n {{\n 'foehn-agenda.pagination-anchor.first-part' | fromDictionary\n }}\n <a\n href=\"#\"\n (click)=\"$event.preventDefault(); scrollToNavigation(true)\"\n >\n {{\n 'foehn-agenda.pagination-anchor.top-next-part'\n | fromDictionary\n }}\n </a>\n </p>\n\n <foehn-validation-alerts [component]=\"this\" />\n\n <div\n class=\"row\"\n [tabIndex]=\"hasErrors() ? 0 : -1\"\n [attr.id]=\"buildChildId()\"\n #entryComponent\n >\n @for (\n currentWeek of loadedCalendar.currentWeek?.week;\n track $index;\n let i = $index\n ) {\n <foehn-agenda-timeslot-panel\n class=\"col-12\"\n #timeSlotPanelElemRef\n [name]=\"buildChildName('TimeSlot' + (i + 1))\"\n [currentWeek]=\"currentWeek\"\n [calendar]=\"calendar()\"\n [nbVisibleElements]=\"nbVisibleElements()\"\n [(model)]=\"model\"\n (userInput)=\"handleUserInput($event)\"\n />\n }\n </div>\n </section>\n\n <!-- Navigation bottom used for screen reader only -->\n <foehn-agenda-navigation\n class=\"visually-hidden\"\n [id]=\"buildChildId('week-pagination-bottom')\"\n [calendar]=\"loadedCalendar\"\n [isSrOnly]=\"true\"\n [minDate]=\"loadedCalendar.minAvailableDate\"\n [maxDate]=\"loadedCalendar.maxAvailableDate\"\n (paginationChange)=\"paginate($event)\"\n />\n\n <!-- Link to navigation top hidden from screen reader -->\n <p [id]=\"buildChildId('navigationTopAnchor')\" aria-hidden=\"true\">\n {{ 'foehn-agenda.pagination-anchor.first-part' | fromDictionary }}\n <a\n href=\"#\"\n (click)=\"$event.preventDefault(); scrollToNavigation(false)\"\n >\n {{\n 'foehn-agenda.pagination-anchor.bottom-next-part'\n | fromDictionary\n }}\n </a>\n </p>\n }\n</div>\n", dependencies: [{ kind: "component", type: FoehnValidationAlertsComponent, selector: "foehn-validation-alerts", inputs: ["component", "shouldErrorsBeLive"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FoehnAgendaNavigationComponent, selector: "foehn-agenda-navigation", inputs: ["id", "calendar", "isSrOnly", "minDate", "maxDate"], outputs: ["paginationChange"] }, { kind: "component", type: FoehnAgendaTimeslotPanelComponent, selector: "foehn-agenda-timeslot-panel", inputs: ["calendar", "currentWeek", "nbVisibleElements"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: SdkDictionaryPipe, name: "fromDictionary" }] });
|
|
16325
16316
|
}
|
|
16326
16317
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: FoehnAgendaComponent, decorators: [{
|
|
16327
16318
|
type: Component,
|
|
@@ -16337,7 +16328,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImpo
|
|
|
16337
16328
|
FoehnAgendaTimeslotPanelComponent,
|
|
16338
16329
|
AsyncPipe,
|
|
16339
16330
|
SdkDictionaryPipe,
|
|
16340
|
-
], template: "<div\n class=\"form-group\"\n [class.has-danger]=\"hasErrors()\"\n [class.vd-form-group-danger]=\"hasErrors()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n @if (label() && type !== 'hidden') {\n <p\n [attr.id]=\"buildChildId('Label')\"\n [attr.for]=\"buildChildId()\"\n [class.visually-hidden]=\"isLabelSrOnly()\"\n [class.vd-p]=\"!isLabelSrOnly()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </p>\n }\n\n @if (helpText() && type !== 'hidden') {\n <small\n [attr.id]=\"buildChildId('Help')\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n @if (!(calendar() | async)) {\n <foehn-validation-alerts [component]=\"this\" />\n <p class=\"alert alert-warning\">\n {{ 'foehn-agenda.calendar-indisponible' | fromDictionary }}\n </p>\n }\n\n <!-- Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name() || label() || ''\" [ngModel]=\"model()\" />\n\n <p\n [id]=\"buildChildId('srOnlyAnnouncements')\"\n class=\"visually-hidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ srAnnouncements() }}\n </p>\n\n <ng-content />\n\n @if (calendar() | async; as loadedCalendar) {\n <section\n class=\"mb-3\"\n [attr.aria-describedby]=\"getDescribedBy()\"\n [attr.aria-invalid]=\"hasErrors() || null\"\n >\n <h2 class=\"h3 mt-3\">\n <output aria-live=\"polite\" aria-atomic=\"true\">\n {{ loadedCalendar.currentWeek?.label }}\n </output>\n </h2>\n\n <!-- Rappel de l'heure actuellement s\u00E9lectionn\u00E9e -->\n <p\n [id]=\"buildChildId('timeSlotSelectedSrOnly')\"\n class=\"visually-hidden\"\n >\n {{ readableSelectedTimeSlot() }}\n </p>\n\n <!-- Navigation top hidden from screen reader-->\n <foehn-agenda-navigation\n [id]=\"buildChildId('week-pagination-top')\"\n [calendar]=\"loadedCalendar\"\n [minDate]=\"loadedCalendar.minAvailableDate\"\n [maxDate]=\"loadedCalendar.maxAvailableDate\"\n (paginationChange)=\"paginate($event)\"\n aria-hidden=\"true\"\n />\n\n <!-- Link to navigation bottom only for screen reader -->\n <p\n [id]=\"buildChildId('navigationBottomAnchor')\"\n class=\"visually-hidden\"\n >\n {{\n 'foehn-agenda.pagination-anchor.first-part' | fromDictionary\n }}\n <a\n href=\"#\"\n (click)=\"$event.preventDefault(); scrollToNavigation(true)\"\n >\n {{\n 'foehn-agenda.pagination-anchor.top-next-part'\n | fromDictionary\n }}\n </a>\n </p>\n\n <foehn-validation-alerts [component]=\"this\" />\n\n <div\n class=\"row\"\n [tabIndex]=\"hasErrors() ? 0 : -1\"\n [attr.id]=\"buildChildId()\"\n #entryComponent\n >\n @for (\n currentWeek of loadedCalendar.currentWeek?.week;\n track
|
|
16331
|
+
], template: "<div\n class=\"form-group\"\n [class.has-danger]=\"hasErrors()\"\n [class.vd-form-group-danger]=\"hasErrors()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n @if (label() && type !== 'hidden') {\n <p\n [attr.id]=\"buildChildId('Label')\"\n [attr.for]=\"buildChildId()\"\n [class.visually-hidden]=\"isLabelSrOnly()\"\n [class.vd-p]=\"!isLabelSrOnly()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </p>\n }\n\n @if (helpText() && type !== 'hidden') {\n <small\n [attr.id]=\"buildChildId('Help')\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n @if (!(calendar() | async)) {\n <foehn-validation-alerts [component]=\"this\" />\n <p class=\"alert alert-warning\">\n {{ 'foehn-agenda.calendar-indisponible' | fromDictionary }}\n </p>\n }\n\n <!-- Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name() || label() || ''\" [ngModel]=\"model()\" />\n\n <p\n [id]=\"buildChildId('srOnlyAnnouncements')\"\n class=\"visually-hidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ srAnnouncements() }}\n </p>\n\n <ng-content />\n\n @if (calendar() | async; as loadedCalendar) {\n <section\n class=\"mb-3\"\n [attr.aria-describedby]=\"getDescribedBy()\"\n [attr.aria-invalid]=\"hasErrors() || null\"\n >\n <h2 class=\"h3 mt-3\">\n <output aria-live=\"polite\" aria-atomic=\"true\">\n {{ loadedCalendar.currentWeek?.label }}\n </output>\n </h2>\n\n <!-- Rappel de l'heure actuellement s\u00E9lectionn\u00E9e -->\n <p\n [id]=\"buildChildId('timeSlotSelectedSrOnly')\"\n class=\"visually-hidden\"\n >\n {{ readableSelectedTimeSlot() }}\n </p>\n\n <!-- Navigation top hidden from screen reader-->\n <foehn-agenda-navigation\n [id]=\"buildChildId('week-pagination-top')\"\n [calendar]=\"loadedCalendar\"\n [minDate]=\"loadedCalendar.minAvailableDate\"\n [maxDate]=\"loadedCalendar.maxAvailableDate\"\n (paginationChange)=\"paginate($event)\"\n aria-hidden=\"true\"\n />\n\n <!-- Link to navigation bottom only for screen reader -->\n <p\n [id]=\"buildChildId('navigationBottomAnchor')\"\n class=\"visually-hidden\"\n >\n {{\n 'foehn-agenda.pagination-anchor.first-part' | fromDictionary\n }}\n <a\n href=\"#\"\n (click)=\"$event.preventDefault(); scrollToNavigation(true)\"\n >\n {{\n 'foehn-agenda.pagination-anchor.top-next-part'\n | fromDictionary\n }}\n </a>\n </p>\n\n <foehn-validation-alerts [component]=\"this\" />\n\n <div\n class=\"row\"\n [tabIndex]=\"hasErrors() ? 0 : -1\"\n [attr.id]=\"buildChildId()\"\n #entryComponent\n >\n @for (\n currentWeek of loadedCalendar.currentWeek?.week;\n track $index;\n let i = $index\n ) {\n <foehn-agenda-timeslot-panel\n class=\"col-12\"\n #timeSlotPanelElemRef\n [name]=\"buildChildName('TimeSlot' + (i + 1))\"\n [currentWeek]=\"currentWeek\"\n [calendar]=\"calendar()\"\n [nbVisibleElements]=\"nbVisibleElements()\"\n [(model)]=\"model\"\n (userInput)=\"handleUserInput($event)\"\n />\n }\n </div>\n </section>\n\n <!-- Navigation bottom used for screen reader only -->\n <foehn-agenda-navigation\n class=\"visually-hidden\"\n [id]=\"buildChildId('week-pagination-bottom')\"\n [calendar]=\"loadedCalendar\"\n [isSrOnly]=\"true\"\n [minDate]=\"loadedCalendar.minAvailableDate\"\n [maxDate]=\"loadedCalendar.maxAvailableDate\"\n (paginationChange)=\"paginate($event)\"\n />\n\n <!-- Link to navigation top hidden from screen reader -->\n <p [id]=\"buildChildId('navigationTopAnchor')\" aria-hidden=\"true\">\n {{ 'foehn-agenda.pagination-anchor.first-part' | fromDictionary }}\n <a\n href=\"#\"\n (click)=\"$event.preventDefault(); scrollToNavigation(false)\"\n >\n {{\n 'foehn-agenda.pagination-anchor.bottom-next-part'\n | fromDictionary\n }}\n </a>\n </p>\n }\n</div>\n" }]
|
|
16341
16332
|
}], propDecorators: { calendar: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendar", required: false }] }], nbVisibleElements: [{ type: i0.Input, args: [{ isSignal: true, alias: "nbVisibleElements", required: false }] }], paginationChange: [{ type: i0.Output, args: ["paginationChange"] }], timeSlotPanelsElemRef: [{ type: i0.ViewChildren, args: ['timeSlotPanelElemRef', { isSignal: true }] }] } });
|
|
16342
16333
|
|
|
16343
16334
|
class SelectedSlot {
|