@yamato-daiwa/frontend-vue 0.2.0 → 0.3.0-alpha.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.

Potentially problematic release.


This version of @yamato-daiwa/frontend-vue might be problematic. Click here for more details.

Files changed (60) hide show
  1. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  2. package/.idea/inspectionProfiles/Project_Default.xml +5 -1
  3. package/README.md +5 -0
  4. package/Source/Functions/getElementByVueReference.ts +105 -8
  5. package/Source/GUI_Components/AdmonitionBlock/AdmonitionBlock.vue +67 -0
  6. package/Source/GUI_Components/AdmonitionBlock/AdmonitionBlock.vue.d.ts +48 -0
  7. package/Source/GUI_Components/AdmonitionBlock/{AdmonitionBlock.vue.ts → AdmonitionBlockLogic.vue.ts} +83 -59
  8. package/Source/GUI_Components/Badge/Badge.vue.ts +98 -63
  9. package/Source/GUI_Components/Badge/LoadingPlaceholder/Badge-LoadingPlaceholder.vue.ts +51 -32
  10. package/Source/GUI_Components/Controls/Buttons/Closing/ClosingButton.vue.pug +1 -0
  11. package/Source/GUI_Components/Controls/Buttons/Closing/ClosingButton.vue.ts +224 -0
  12. package/Source/GUI_Components/Controls/Buttons/HamburgerMenu/HamburgerMenuButton-ForInheritance.vue.ts +253 -0
  13. package/Source/GUI_Components/Controls/Buttons/HamburgerMenu/HamburgerMenuButton.vue +24 -0
  14. package/Source/GUI_Components/Controls/Buttons/HamburgerMenu/HamburgerMenuButton.vue.d.ts +45 -0
  15. package/Source/GUI_Components/Controls/Buttons/HamburgerMenu/HamburgerMenuButton.vue.pug +0 -0
  16. package/Source/GUI_Components/Controls/Buttons/Plain/Button.vue.ts +217 -105
  17. package/Source/GUI_Components/Controls/Buttons/Plain/LoadingPlaceholder/Button-LoadingPlaceholder.vue.ts +38 -30
  18. package/Source/GUI_Components/Controls/ValidatableControlShell/ValidatableControlShell.vue.pug +33 -20
  19. package/Source/GUI_Components/Controls/ValidatableControlShell/ValidatableControlShell.vue.ts +303 -121
  20. package/Source/GUI_Components/Controls/Validatables/InputtableControl.vue.ts +233 -0
  21. package/Source/GUI_Components/Controls/Validatables/TextBox/TextBox.vue.pug +38 -0
  22. package/Source/GUI_Components/Controls/Validatables/TextBox/TextBox.vue.ts +538 -96
  23. package/Source/GUI_Components/Controls/Validatables/ValidatableControl.ts +63 -54
  24. package/Source/GUI_Components/Controls/Validatables/ValidatableControlsGroup.ts +176 -0
  25. package/Source/GUI_Components/OverflowSafeSingleLineLabel.vue +9 -2
  26. package/Source/GUI_Components/ThemesShowcase.vue +10 -5
  27. package/Source/GUI_Components/YDF_ComponentsCoordinator.ts +164 -5
  28. package/Source/GUI_Components/_Decorators/AccessibleFromTemplateAsNonReactive.ts +67 -0
  29. package/Source/GUI_Components/_Decorators/NonReactiveVueData.ts +26 -0
  30. package/Source/GUI_Components/_Decorators/{OptionalButNotNullableVueProperty.ts → preventNullForOptionalVueProperty.ts} +3 -4
  31. package/Source/GUI_Components/_Errors/InvalidVueProperty/InvalidVuePropertyError.ts +43 -0
  32. package/Source/GUI_Components/_Errors/InvalidVueProperty/InvalidVuePropertyErrorLocalization.english.ts +16 -0
  33. package/Source/GUI_Components/_VuePropertiesValidators/BooleanVuePropertyValidator.ts +25 -0
  34. package/Source/GUI_Components/_VuePropertiesValidators/DecorativeModifiersVuePropertyValidator.ts +22 -0
  35. package/Source/GUI_Components/_VuePropertiesValidators/DecorativeVariationVuePropertyValidator.ts +23 -0
  36. package/Source/GUI_Components/_VuePropertiesValidators/ElementOfEnumerationVuePropertyValidator.ts +29 -0
  37. package/Source/GUI_Components/_VuePropertiesValidators/GeometricModifiersVuePropertyValidator.ts +22 -0
  38. package/Source/GUI_Components/_VuePropertiesValidators/GeometricVariationVuePropertyValidator.ts +23 -0
  39. package/Source/GUI_Components/_VuePropertiesValidators/NaturalNumberOrZeroVuePropertyValidator.ts +25 -0
  40. package/Source/GUI_Components/_VuePropertiesValidators/NonEmptyStringVuePropertyValidator.ts +25 -0
  41. package/Source/GUI_Components/_VuePropertiesValidators/ThemeVuePropertyValidator.ts +23 -0
  42. package/Source/GUI_Components/_VuePropertiesValidators/VuePropertyValidator.ts +51 -0
  43. package/Source/index.ts +24 -8
  44. package/Workbenches/Source/Decorators/Decorators.workbench.pug +20 -0
  45. package/Workbenches/Source/Decorators/Decorators.workbench.ts +5 -0
  46. package/Workbenches/Source/Decorators/DecoratorsWorkbench.vue +69 -0
  47. package/Workbenches/Source/GUI_Components/AdmonitionBlock/AdmonitionBlockComponentTestSite.vue +9 -2
  48. package/Workbenches/Source/GUI_Components/Badge/BadgeBlockComponentTestSite.vue +9 -2
  49. package/Workbenches/Source/GUI_Components/Controls/Buttons/Plain/ButtonComponentTestSite.vue +19 -8
  50. package/Workbenches/Source/GUI_Components/Controls/Validatable/TextBox/TextBoxWorkbench.vue +45 -2
  51. package/Workbenches/Source/GUI_Components/Controls/ValidatableControlShell/ValidatableControlShellTestSite.vue +9 -2
  52. package/Workbenches/Source/GUI_Components/OverflowSafeSingleLineLabel/OverflowSafeSingleLineLabelComponentTestSite.vue +9 -2
  53. package/Workbenches/Source/Workbenches.pug +6 -0
  54. package/eslint.config.js +15 -0
  55. package/package.json +40 -48
  56. package/tsconfig.json +0 -3
  57. package/yda.config.yaml +1 -1
  58. package/Source/GUI_Components/AdmonitionBlock/AdmonitionBlock.vue.pug +0 -43
  59. package/Source/GUI_Components/Controls/Validatables/InputtableControl.ts +0 -134
  60. package/Source/GUI_Components/_Utils/validateVuePropertyAndLogIfInvalid.ts +0 -34
@@ -1,12 +1,25 @@
1
- import { Vue3SlideUpDown as VerticallySlidingAlwaysMountedContainer } from "vue3-slide-up-down";
2
-
3
1
  /* ─── Assets ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
4
2
  import componentVueTemplate from "./ValidatableControlShell.vue.pug";
5
3
  import {
6
4
  type ValidatableControlShellLocalization,
7
- validatableControlShellYDF_ComponentLocalization__english
5
+ validatableControlShellYDF_ComponentLocalization__english,
6
+ replaceMarkdownBold,
7
+ replaceMarkdownLink
8
8
  } from "@yamato-daiwa/frontend";
9
9
 
10
+ /* ─── Related GUI Components ─────────────────────────────────────────────────────────────────────────────────────── */
11
+ import Badge from "../../Badge/Badge.vue";
12
+ import { Vue3SlideUpDown as VerticallySlidingAlwaysMountedContainer } from "vue3-slide-up-down";
13
+
14
+ /* ─── Validations ────────────────────────────────────────────────────────────────────────────────────────────────── */
15
+ import VuePropertyValidator from "../../_VuePropertiesValidators/VuePropertyValidator";
16
+ import preventNullForOptionalVueProperty from "../../_Decorators/preventNullForOptionalVueProperty";
17
+ import NonEmptyStringVuePropertyValidator from "../../_VuePropertiesValidators/NonEmptyStringVuePropertyValidator";
18
+ import BooleanVuePropertyValidator from "../../_VuePropertiesValidators/BooleanVuePropertyValidator";
19
+ import ThemeVuePropertyValidator from "../../_VuePropertiesValidators/ThemeVuePropertyValidator";
20
+ import GeometricVariationVuePropertyValidator from "../../_VuePropertiesValidators/GeometricVariationVuePropertyValidator";
21
+ import DecorativeVariationVuePropertyValidator from "../../_VuePropertiesValidators/DecorativeVariationVuePropertyValidator";
22
+
10
23
  /* ─── Framework ──────────────────────────────────────────────────────────────────────────────────────────────────── */
11
24
  import {
12
25
  ComponentBase as VueComponentConfiguration,
@@ -17,13 +30,12 @@ import {
17
30
 
18
31
  /* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
19
32
  import YDF_ComponentsCoordinator from "../../YDF_ComponentsCoordinator";
20
- import OptionalButNotNullableVueProperty from "../../_Decorators/OptionalButNotNullableVueProperty";
21
- import validateVuePropertyAndLogIfInvalid from "../../_Utils/validateVuePropertyAndLogIfInvalid";
33
+ import AccessibleFromTemplateAsNonReactive from "../../_Decorators/AccessibleFromTemplateAsNonReactive";
22
34
  import {
23
- isNonEmptyString,
24
- isElementOfEnumeration,
25
35
  secondsToMilliseconds,
26
- isNeitherUndefinedNorNull
36
+ isArrayOfCertainTypeElements,
37
+ isNonEmptyString,
38
+ isNotUndefined
27
39
  } from "@yamato-daiwa/es-extensions";
28
40
 
29
41
 
@@ -31,6 +43,7 @@ import {
31
43
  name: ValidatableControlShell.CSS_NAMESPACE,
32
44
  template: componentVueTemplate,
33
45
  components: {
46
+ Badge,
34
47
  VerticallySlidingAlwaysMountedContainer
35
48
  }
36
49
  })
@@ -42,95 +55,210 @@ class ValidatableControlShell extends VueComponent {
42
55
  /* ━━━ Component Common Properties ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
43
56
  /* ─── Textings ─────────────────────────────────────────────────────────────────────────────────────────────────── */
44
57
  @VueProperty({
45
- validator: validateVuePropertyAndLogIfInvalid({
46
- checker: isNonEmptyString,
47
- message: "If string specified it must be non-empty."
48
- })
58
+ required: false,
59
+ get validator(): VuePropertyValidator {
60
+ return NonEmptyStringVuePropertyValidator({
61
+ propertyName: "label",
62
+ isPropertyRequired: this.required === true,
63
+ componentName: ValidatableControlShell.CSS_NAMESPACE
64
+ });
65
+ }
49
66
  })
50
- @OptionalButNotNullableVueProperty
67
+ @preventNullForOptionalVueProperty
51
68
  protected readonly label?: string;
52
69
 
53
70
  @VueProperty({
54
- validator: validateVuePropertyAndLogIfInvalid({
55
- checker: isNonEmptyString,
56
- message: "If string specified it must be non-empty."
57
- })
71
+ required: false,
72
+ get validator(): VuePropertyValidator {
73
+ return NonEmptyStringVuePropertyValidator({
74
+ propertyName: "guidance",
75
+ isPropertyRequired: this.required === true,
76
+ componentName: ValidatableControlShell.CSS_NAMESPACE
77
+ });
78
+ }
58
79
  })
59
- @OptionalButNotNullableVueProperty
80
+ @preventNullForOptionalVueProperty
60
81
  protected readonly guidance?: string;
61
82
 
83
+ protected get formattedGuidance(): string | null {
84
+ return isNotUndefined(this.guidance) ?
85
+ replaceMarkdownLink(
86
+ replaceMarkdownBold(
87
+ this.guidance,
88
+ (boldedContent: string): string =>
89
+ `<span class="ValidatableControlShell--YDF-Guidance-AccentedFragment">${ boldedContent }</span>`
90
+ ),
91
+ ({ URI, anchorText }: Readonly<{ URI: string; anchorText: string; }>): string =>
92
+ "<a " +
93
+ "class=\"Link--YDF ValidatableControlShell--YDF-Guidance-Link\" " +
94
+ `href="${ URI }" ` +
95
+ "target=\"_blank\" " +
96
+ "rel=\"noopener noreferrer nofollow\"" +
97
+ ">" +
98
+ anchorText +
99
+ "</a>"
100
+ ) :
101
+ null;
102
+ }
103
+
62
104
 
63
105
  /* ─── Inputting Requirement ────────────────────────────────────────────────────────────────────────────────────── */
64
- @VueProperty({ type: Boolean, default: false })
65
- @OptionalButNotNullableVueProperty
106
+ @VueProperty({
107
+ default: false,
108
+ get validator(): VuePropertyValidator {
109
+ return BooleanVuePropertyValidator({
110
+ propertyName: "required",
111
+ isPropertyRequired: this.required === true,
112
+ componentName: ValidatableControlShell.CSS_NAMESPACE
113
+ });
114
+ }
115
+ })
116
+ @preventNullForOptionalVueProperty
66
117
  protected readonly required!: boolean;
67
118
 
68
- @VueProperty({ type: Boolean, default: false })
69
- @OptionalButNotNullableVueProperty
119
+ @VueProperty({
120
+ default: false,
121
+ get validator(): VuePropertyValidator {
122
+ return BooleanVuePropertyValidator({
123
+ propertyName: "mustDisplayAppropriateBadgeIfInputIsRequired",
124
+ isPropertyRequired: this.required === true,
125
+ componentName: ValidatableControlShell.CSS_NAMESPACE
126
+ });
127
+ }
128
+ })
129
+ @preventNullForOptionalVueProperty
70
130
  protected readonly mustDisplayAppropriateBadgeIfInputIsRequired!: boolean;
71
131
 
72
- @VueProperty({ type: Boolean, default: false })
73
- @OptionalButNotNullableVueProperty
132
+ @VueProperty({
133
+ default: false,
134
+ get validator(): VuePropertyValidator {
135
+ return BooleanVuePropertyValidator({
136
+ propertyName: "mustDisplayAppropriateBadgeIfInputIsOptional",
137
+ isPropertyRequired: this.required === true,
138
+ componentName: ValidatableControlShell.CSS_NAMESPACE
139
+ });
140
+ }
141
+ })
142
+ @preventNullForOptionalVueProperty
74
143
  protected readonly mustDisplayAppropriateBadgeIfInputIsOptional!: boolean;
75
144
 
76
- @VueProperty({ type: Boolean, default: false })
77
- @OptionalButNotNullableVueProperty
145
+ @VueProperty({
146
+ default: false,
147
+ get validator(): VuePropertyValidator {
148
+ return BooleanVuePropertyValidator({
149
+ propertyName: "mustAddInvisibleBadgeForHeightEqualizingWhenNoBadge",
150
+ isPropertyRequired: this.required === true,
151
+ componentName: ValidatableControlShell.CSS_NAMESPACE
152
+ });
153
+ }
154
+ })
155
+ @preventNullForOptionalVueProperty
78
156
  protected readonly mustAddInvisibleBadgeForHeightEqualizingWhenNoBadge!: boolean;
79
157
 
80
- /* ─── HTML IDs ─────────────────────────────────────────────────────────────────────────────────────────────────── */
158
+
159
+ /* ─── Displaying of Validation Messages ────────────────────────────────────────────────────────────────────────── */
81
160
  @VueProperty({
82
- validator: validateVuePropertyAndLogIfInvalid({
83
- checker: isNonEmptyString,
84
- message: "If string specified it must be non-empty."
85
- })
161
+ default: false,
162
+ get validator(): VuePropertyValidator {
163
+ return BooleanVuePropertyValidator({
164
+ propertyName: "invalidInputHighlightingIfAnyValidationErrorsMessages",
165
+ isPropertyRequired: this.required === true,
166
+ componentName: ValidatableControlShell.CSS_NAMESPACE
167
+ });
168
+ }
86
169
  })
87
- @OptionalButNotNullableVueProperty
88
- protected readonly coreElementHTML_ID?: string;
170
+ @preventNullForOptionalVueProperty
171
+ protected readonly invalidInputHighlightingIfAnyValidationErrorsMessages!: boolean;
89
172
 
90
173
  @VueProperty({
91
- validator: validateVuePropertyAndLogIfInvalid({
92
- checker: isNonEmptyString,
93
- message: "If string specified it must be non-empty."
94
- })
174
+ default: false,
175
+ get validator(): VuePropertyValidator {
176
+ return BooleanVuePropertyValidator({
177
+ propertyName: "validValueHighlightingIfNoValidationErrorsMessages",
178
+ isPropertyRequired: this.required === true,
179
+ componentName: ValidatableControlShell.CSS_NAMESPACE
180
+ });
181
+ }
95
182
  })
96
- @OptionalButNotNullableVueProperty
97
- protected readonly labelElementHTML_ID?: string;
183
+ @preventNullForOptionalVueProperty
184
+ protected readonly validValueHighlightingIfNoValidationErrorsMessages!: boolean;
98
185
 
99
186
 
100
- /* ─── Displaying of Validation Messages ────────────────────────────────────────────────────────────────────────── */
101
- @VueProperty({ type: Boolean, default: false })
102
- @OptionalButNotNullableVueProperty
103
- protected readonly invalidInputHighlightingIfAnyValidationErrorsMessages!: boolean;
187
+ /* ─── HTML IDs ─────────────────────────────────────────────────────────────────────────────────────────────────── */
188
+ @VueProperty({
189
+ required: false,
190
+ get validator(): VuePropertyValidator {
191
+ return NonEmptyStringVuePropertyValidator({
192
+ propertyName: "coreElementHTML_ID",
193
+ isPropertyRequired: this.required === true,
194
+ componentName: ValidatableControlShell.CSS_NAMESPACE
195
+ });
196
+ }
197
+ })
198
+ @preventNullForOptionalVueProperty
199
+ protected readonly coreElementHTML_ID?: string;
104
200
 
105
- @VueProperty({ type: Boolean, default: false })
106
- @OptionalButNotNullableVueProperty
107
- protected readonly validValueHighlightingIfNoValidationErrorsMessages!: boolean;
201
+ @VueProperty({
202
+ required: false,
203
+ get validator(): VuePropertyValidator {
204
+ return NonEmptyStringVuePropertyValidator({
205
+ propertyName: "labelElementHTML_ID",
206
+ isPropertyRequired: this.required === true,
207
+ componentName: ValidatableControlShell.CSS_NAMESPACE
208
+ });
209
+ }
210
+ })
211
+ @preventNullForOptionalVueProperty
212
+ protected readonly labelElementHTML_ID?: string;
108
213
 
109
214
 
110
215
  /* ─── CSS Classes ──────────────────────────────────────────────────────────────────────────────────────────────── */
111
- @VueProperty({ type: [ Array ], default: (): ReadonlyArray<string> => [] })
112
- @OptionalButNotNullableVueProperty
216
+ @VueProperty({
217
+ default: (): ReadonlyArray<string> => [],
218
+ validator: VuePropertyValidator.create({
219
+ checker: (rawValue: unknown): boolean => isArrayOfCertainTypeElements(rawValue, isNonEmptyString),
220
+ messageSpecificPart: "If specified, must be an array of non-empty strings.",
221
+ propertyName: "mainSlotWrapperAdditionalCSS_Classes",
222
+ componentName: ValidatableControlShell.CSS_NAMESPACE
223
+ })
224
+ })
225
+ @preventNullForOptionalVueProperty
113
226
  protected readonly mainSlotWrapperAdditionalCSS_Classes!: ReadonlyArray<string>;
114
227
 
115
228
 
116
229
  /* ━━━ Validation Errors Messages ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
117
- @VueProperty({ type: Array, default: (): ReadonlyArray<string> => [] })
118
- @OptionalButNotNullableVueProperty
230
+ @VueProperty({
231
+ default: (): ReadonlyArray<string> => [],
232
+ validator: VuePropertyValidator.create({
233
+ checker: (rawValue: unknown): boolean => isArrayOfCertainTypeElements(rawValue, isNonEmptyString),
234
+ messageSpecificPart: "If specified, must be an array of non-empty strings.",
235
+ propertyName: "validationErrorsMessages",
236
+ componentName: ValidatableControlShell.CSS_NAMESPACE
237
+ })
238
+ })
239
+ @preventNullForOptionalVueProperty
119
240
  protected readonly validationErrorsMessages!: ReadonlyArray<string>;
120
241
 
121
242
  /* [ Theory ]
122
243
  * Even if `validationErrorsMessages` has become to empty array, the validation errors messages are still
123
- * require to animate the expanding. */
244
+ * required to animate the collapsing. */
124
245
  protected validationErrorsMessagesCopyForAnimating: ReadonlyArray<string> = [ ...this.validationErrorsMessages ];
125
246
 
126
247
  protected static readonly ERRORS_LIST_EXPANDING_ANIMATION_DURATION_PER_ONE_ERROR_MESSAGE__SECONDS: number = 0.2;
127
- protected static readonly ERRORS_LIST_COLLAPSING_ANIMATION_DURATION__SECONDS: number = 0.2;
128
248
 
249
+ protected get errorsListExpandingAnimationDuration__milliseconds(): number {
250
+ return secondsToMilliseconds(
251
+ ValidatableControlShell.ERRORS_LIST_EXPANDING_ANIMATION_DURATION_PER_ONE_ERROR_MESSAGE__SECONDS *
252
+ this.validationErrorsMessagesCopyForAnimating.length
253
+ );
254
+ }
255
+
256
+ @onVueComponentFieldUpdated("invalidInputHighlightingIfAnyValidationErrorsMessages")
129
257
  @onVueComponentFieldUpdated("validationErrorsMessages")
130
- protected onValidationErrorsMessagesUpdated(newValidationErrorsMessages: ReadonlyArray<string>): void {
258
+ protected onValidationErrorsMessagesUpdated(): void {
131
259
 
132
- if (newValidationErrorsMessages.length > 0) {
133
- this.validationErrorsMessagesCopyForAnimating = [ ...newValidationErrorsMessages ];
260
+ if (this.validationErrorsMessages.length > 0) {
261
+ this.validationErrorsMessagesCopyForAnimating = [ ...this.validationErrorsMessages ];
134
262
  return;
135
263
  }
136
264
 
@@ -139,30 +267,55 @@ class ValidatableControlShell extends VueComponent {
139
267
  (): void => {
140
268
  this.validationErrorsMessagesCopyForAnimating = [];
141
269
  },
142
- secondsToMilliseconds(ValidatableControlShell.ERRORS_LIST_COLLAPSING_ANIMATION_DURATION__SECONDS)
270
+ this.errorsListExpandingAnimationDuration__milliseconds
143
271
  );
144
272
 
145
273
  }
146
274
 
147
275
 
276
+ /* ━━━ Conditional Rendering ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
277
+ protected get mustDisplayRequiredInputBadge(): boolean {
278
+ return this.required && this.mustDisplayAppropriateBadgeIfInputIsRequired;
279
+ }
280
+
281
+ protected get mustDisplayOptionalInputBadge(): boolean {
282
+ return !this.required && this.mustDisplayAppropriateBadgeIfInputIsOptional;
283
+ }
284
+
285
+ protected get mustDisplayHeader(): boolean {
286
+ return isNotUndefined(this.label) ||
287
+ this.mustDisplayRequiredInputBadge ||
288
+ this.mustDisplayOptionalInputBadge ||
289
+ this.mustAddInvisibleBadgeForHeightEqualizingWhenNoBadge;
290
+ }
291
+
292
+
148
293
  /* ━━━ Theming ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
149
294
  public static readonly Themes: ValidatableControlShell.Themes = { regular: "REGULAR" };
150
295
 
296
+ public static readonly selfAndChildrenComponentsThemesCorrespondence:
297
+ { badge: { [ownThemeValue: string]: string; }; } =
298
+ { badge: { [ValidatableControlShell.Themes.regular]: Badge.Themes.regular } };
299
+
151
300
  @VueProperty({
152
- type: String,
153
301
  default: ValidatableControlShell.Themes.regular,
154
- validator: validateVuePropertyAndLogIfInvalid({
155
- checker: (rawValue: string): boolean => isElementOfEnumeration(rawValue, ValidatableControlShell.Themes),
156
- message:
157
- "Must be the one among values of `ValidatableControlShell.Themes` associative array including the ones " +
158
- "defined via `ValidatableControlShell.defineThemes()`."
159
- })
302
+ validator: ThemeVuePropertyValidator(ValidatableControlShell)
160
303
  })
161
- @OptionalButNotNullableVueProperty
304
+ @preventNullForOptionalVueProperty
162
305
  protected readonly theme!: string;
163
306
 
164
- public static defineThemes(themesNames: ReadonlyArray<string>): typeof ValidatableControlShell {
165
- return YDF_ComponentsCoordinator.defineThemes(themesNames, ValidatableControlShell);
307
+ protected get badgeTheme(): string {
308
+ return ValidatableControlShell.selfAndChildrenComponentsThemesCorrespondence.badge[this.theme];
309
+ }
310
+
311
+ public static defineThemes(
312
+ ownAndChildrenThemesCorrespondenceDefinition: Readonly<{
313
+ [ownThemeKey: string]: Readonly<{ badge: string; }>;
314
+ }>
315
+ ): typeof ValidatableControlShell {
316
+ return YDF_ComponentsCoordinator.defineThemesAndSetCorrespondenceWithOnesOfChildrenComponents(
317
+ ownAndChildrenThemesCorrespondenceDefinition, ValidatableControlShell
318
+ );
166
319
  }
167
320
 
168
321
  public static areThemesCSS_ClassesCommon: boolean = YDF_ComponentsCoordinator.areThemesCSS_ClassesCommon;
@@ -171,9 +324,18 @@ class ValidatableControlShell extends VueComponent {
171
324
  ValidatableControlShell.areThemesCSS_ClassesCommon = true;
172
325
  }
173
326
 
174
- @VueProperty({ type: Boolean, default: ValidatableControlShell.areThemesCSS_ClassesCommon })
175
- @OptionalButNotNullableVueProperty
176
- private readonly areThemesCSS_ClassesCommon!: boolean;
327
+ @VueProperty({
328
+ default: ValidatableControlShell.areThemesCSS_ClassesCommon,
329
+ get validator(): VuePropertyValidator {
330
+ return BooleanVuePropertyValidator({
331
+ propertyName: "areThemesCSS_ClassesCommon",
332
+ componentName: ValidatableControlShell.CSS_NAMESPACE,
333
+ isPropertyRequired: this.required === true
334
+ });
335
+ }
336
+ })
337
+ @preventNullForOptionalVueProperty
338
+ protected readonly areThemesCSS_ClassesCommon!: boolean;
177
339
 
178
340
 
179
341
  /* ─── Geometry ─────────────────────────────────────────────────────────────────────────────────────────────────── */
@@ -182,43 +344,88 @@ class ValidatableControlShell extends VueComponent {
182
344
  small: "SMALL"
183
345
  };
184
346
 
347
+ public static readonly selfAndChildrenComponentsGeometricVariationsCorrespondence:
348
+ { badge: { [ownGeometricVariationValue: string]: string; }; } =
349
+ {
350
+ badge: {
351
+
352
+ [ValidatableControlShell.GeometricVariations.regular]: Badge.GeometricVariations.regular,
353
+
354
+ /* [ Approach ]
355
+ * `Badge__YDF.GeometricVariations.regular` is NOT a mistake because `Badge__YDF.GeometricVariations.small`
356
+ * is too small, while the actual size can be flexibly adjusted by relative CSS units.
357
+ * */
358
+ [ValidatableControlShell.GeometricVariations.small]: Badge.GeometricVariations.regular
359
+
360
+ }
361
+ };
362
+
185
363
  @VueProperty({
186
- type: String,
187
364
  default: ValidatableControlShell.GeometricVariations.regular,
188
- validator: validateVuePropertyAndLogIfInvalid({
189
- checker: (rawValue: string): boolean => isElementOfEnumeration(rawValue, ValidatableControlShell.GeometricVariations),
190
- message:
191
- "Must be the one among values of `ValidatableControlShell.GeometricVariations` associative array including the ones " +
192
- "defined via `ValidatableControlShell.defineGeometricVariations()`."
193
- })
365
+ validator: GeometricVariationVuePropertyValidator(ValidatableControlShell)
194
366
  })
195
- @OptionalButNotNullableVueProperty
367
+ @preventNullForOptionalVueProperty
196
368
  protected readonly geometricVariation!: string;
197
369
 
198
- public static defineGeometricVariations(geometricVariationsNames: ReadonlyArray<string>): typeof ValidatableControlShell {
199
- return YDF_ComponentsCoordinator.defineGeometricVariations(geometricVariationsNames, ValidatableControlShell);
370
+ protected get badgeGeometricVariation(): string {
371
+ return ValidatableControlShell.selfAndChildrenComponentsGeometricVariationsCorrespondence.badge[this.geometricVariation];
372
+ }
373
+
374
+ public static defineGeometricVariations(
375
+ ownAndChildrenGeometricVariationsAndCorrespondenceDefinition: Readonly<{
376
+ [ownGeometricVariationKey: string]: Readonly<{ badge: string; }>;
377
+ }>
378
+ ): typeof ValidatableControlShell {
379
+ return YDF_ComponentsCoordinator.defineGeometricVariationsAndSetCorrespondenceWithOnesOfChildrenComponents(
380
+ ownAndChildrenGeometricVariationsAndCorrespondenceDefinition, ValidatableControlShell
381
+ );
200
382
  }
201
383
 
202
384
 
203
385
  /* ─── Decoration ───────────────────────────────────────────────────────────────────────────────────────────────── */
204
- public static readonly DecorativeVariations: ValidatableControlShell.DecorativeVariations = {
205
- regular: "REGULAR"
206
- };
386
+ public static readonly DecorativeVariations: ValidatableControlShell.DecorativeVariations = { regular: "REGULAR" };
387
+
388
+ public static readonly selfAndChildrenComponentsDecorativeVariationsCorrespondence:
389
+ {
390
+ requiredInputBadge: { [ownDecorativeVariationValue: string]: string; };
391
+ optionalInputBadge: { [ownDecorativeVariationValue: string]: string; };
392
+ } =
393
+ {
394
+ requiredInputBadge: {
395
+ [ValidatableControlShell.DecorativeVariations.regular]: Badge.DecorativeVariations.veryCatchyBright
396
+ },
397
+ optionalInputBadge: {
398
+ [ValidatableControlShell.DecorativeVariations.regular]: Badge.DecorativeVariations.modestlyCalmingBright
399
+ }
400
+ };
207
401
 
208
402
  @VueProperty({
209
- type: String,
210
- default: ValidatableControlShell.DecorativeVariations.regular,
211
- validator: validateVuePropertyAndLogIfInvalid({
212
- checker: (rawValue: string): boolean => isElementOfEnumeration(rawValue, ValidatableControlShell.DecorativeVariations),
213
- message:
214
- "Must be the one among values of `ValidatableControlShell.DecorativeVariations` associative array including the ones " +
215
- "defined via `ValidatableControlShell.defineDecorativeVariations()`."
216
- })
403
+ default: ValidatableControlShell.GeometricVariations.regular,
404
+ validator: DecorativeVariationVuePropertyValidator(ValidatableControlShell)
217
405
  })
218
406
  protected readonly decorativeVariation!: string;
219
407
 
220
- public static defineDecorativeVariations(decorativeVariationsNames: ReadonlyArray<string>): typeof ValidatableControlShell {
221
- return YDF_ComponentsCoordinator.defineDecorativeVariations(decorativeVariationsNames, ValidatableControlShell);
408
+ protected get requiredInputBadgeDecorativeVariation(): string {
409
+ return ValidatableControlShell.selfAndChildrenComponentsDecorativeVariationsCorrespondence.
410
+ requiredInputBadge[this.decorativeVariation];
411
+ }
412
+
413
+ protected get optionalInputBadgeDecorativeVariation(): string {
414
+ return ValidatableControlShell.selfAndChildrenComponentsDecorativeVariationsCorrespondence.
415
+ optionalInputBadge[this.decorativeVariation];
416
+ }
417
+
418
+ public static defineDecorativeVariations(
419
+ ownAndChildrenDecorativeVariationsAndCorrespondenceDefinition: Readonly<{
420
+ [ownDecorativeVariationKey: string]: Readonly<{
421
+ requiredInputBadge: string;
422
+ optionalInputBadge: string;
423
+ }>;
424
+ }>
425
+ ): typeof ValidatableControlShell {
426
+ return YDF_ComponentsCoordinator.defineDecorativeVariationsAndSetCorrespondenceWithOnesOfChildrenComponents(
427
+ ownAndChildrenDecorativeVariationsAndCorrespondenceDefinition, ValidatableControlShell
428
+ );
222
429
  }
223
430
 
224
431
 
@@ -237,37 +444,12 @@ class ValidatableControlShell extends VueComponent {
237
444
  }
238
445
 
239
446
 
240
- // ━━━ TODO ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
241
- /* ━━━ Conditional Rendering ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
242
- private get mustDisplayRequiredInputBadge(): boolean {
243
- return this.required && this.mustDisplayAppropriateBadgeIfInputIsRequired;
244
- }
245
-
246
- private get mustDisplayOptionalInputBadge(): boolean {
247
- return this.required && this.mustDisplayAppropriateBadgeIfInputIsOptional;
248
- }
249
-
250
- protected get mustDisplayHeader(): boolean {
251
- return isNeitherUndefinedNorNull(this.label) ||
252
- this.mustDisplayRequiredInputBadge ||
253
- this.mustDisplayOptionalInputBadge ||
254
- this.mustAddInvisibleBadgeForHeightEqualizingWhenNoBadge;
255
- }
256
-
257
-
258
- /* ━━━ Lifecycle Hooks ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
259
- public created(): void {
260
- this.initializeNonReactiveClassFields();
261
- }
262
-
263
-
264
447
  /* ━━━ Non-reactive Fields ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
265
- public static localization: ValidatableControlShellLocalization = validatableControlShellYDF_ComponentLocalization__english;
266
- protected localization!: ValidatableControlShellLocalization;
448
+ @AccessibleFromTemplateAsNonReactive
449
+ protected static readonly Badge: typeof Badge = Badge;
267
450
 
268
- private initializeNonReactiveClassFields(): void {
269
- this.localization = ValidatableControlShell.localization;
270
- }
451
+ @AccessibleFromTemplateAsNonReactive
452
+ public static localization: ValidatableControlShellLocalization = validatableControlShellYDF_ComponentLocalization__english;
271
453
 
272
454
  }
273
455