@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.
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +5 -1
- package/README.md +5 -0
- package/Source/Functions/getElementByVueReference.ts +105 -8
- package/Source/GUI_Components/AdmonitionBlock/AdmonitionBlock.vue +67 -0
- package/Source/GUI_Components/AdmonitionBlock/AdmonitionBlock.vue.d.ts +48 -0
- package/Source/GUI_Components/AdmonitionBlock/{AdmonitionBlock.vue.ts → AdmonitionBlockLogic.vue.ts} +83 -59
- package/Source/GUI_Components/Badge/Badge.vue.ts +98 -63
- package/Source/GUI_Components/Badge/LoadingPlaceholder/Badge-LoadingPlaceholder.vue.ts +51 -32
- package/Source/GUI_Components/Controls/Buttons/Closing/ClosingButton.vue.pug +1 -0
- package/Source/GUI_Components/Controls/Buttons/Closing/ClosingButton.vue.ts +224 -0
- package/Source/GUI_Components/Controls/Buttons/HamburgerMenu/HamburgerMenuButton-ForInheritance.vue.ts +253 -0
- package/Source/GUI_Components/Controls/Buttons/HamburgerMenu/HamburgerMenuButton.vue +24 -0
- package/Source/GUI_Components/Controls/Buttons/HamburgerMenu/HamburgerMenuButton.vue.d.ts +45 -0
- package/Source/GUI_Components/Controls/Buttons/HamburgerMenu/HamburgerMenuButton.vue.pug +0 -0
- package/Source/GUI_Components/Controls/Buttons/Plain/Button.vue.ts +217 -105
- package/Source/GUI_Components/Controls/Buttons/Plain/LoadingPlaceholder/Button-LoadingPlaceholder.vue.ts +38 -30
- package/Source/GUI_Components/Controls/ValidatableControlShell/ValidatableControlShell.vue.pug +33 -20
- package/Source/GUI_Components/Controls/ValidatableControlShell/ValidatableControlShell.vue.ts +303 -121
- package/Source/GUI_Components/Controls/Validatables/InputtableControl.vue.ts +233 -0
- package/Source/GUI_Components/Controls/Validatables/TextBox/TextBox.vue.pug +38 -0
- package/Source/GUI_Components/Controls/Validatables/TextBox/TextBox.vue.ts +538 -96
- package/Source/GUI_Components/Controls/Validatables/ValidatableControl.ts +63 -54
- package/Source/GUI_Components/Controls/Validatables/ValidatableControlsGroup.ts +176 -0
- package/Source/GUI_Components/OverflowSafeSingleLineLabel.vue +9 -2
- package/Source/GUI_Components/ThemesShowcase.vue +10 -5
- package/Source/GUI_Components/YDF_ComponentsCoordinator.ts +164 -5
- package/Source/GUI_Components/_Decorators/AccessibleFromTemplateAsNonReactive.ts +67 -0
- package/Source/GUI_Components/_Decorators/NonReactiveVueData.ts +26 -0
- package/Source/GUI_Components/_Decorators/{OptionalButNotNullableVueProperty.ts → preventNullForOptionalVueProperty.ts} +3 -4
- package/Source/GUI_Components/_Errors/InvalidVueProperty/InvalidVuePropertyError.ts +43 -0
- package/Source/GUI_Components/_Errors/InvalidVueProperty/InvalidVuePropertyErrorLocalization.english.ts +16 -0
- package/Source/GUI_Components/_VuePropertiesValidators/BooleanVuePropertyValidator.ts +25 -0
- package/Source/GUI_Components/_VuePropertiesValidators/DecorativeModifiersVuePropertyValidator.ts +22 -0
- package/Source/GUI_Components/_VuePropertiesValidators/DecorativeVariationVuePropertyValidator.ts +23 -0
- package/Source/GUI_Components/_VuePropertiesValidators/ElementOfEnumerationVuePropertyValidator.ts +29 -0
- package/Source/GUI_Components/_VuePropertiesValidators/GeometricModifiersVuePropertyValidator.ts +22 -0
- package/Source/GUI_Components/_VuePropertiesValidators/GeometricVariationVuePropertyValidator.ts +23 -0
- package/Source/GUI_Components/_VuePropertiesValidators/NaturalNumberOrZeroVuePropertyValidator.ts +25 -0
- package/Source/GUI_Components/_VuePropertiesValidators/NonEmptyStringVuePropertyValidator.ts +25 -0
- package/Source/GUI_Components/_VuePropertiesValidators/ThemeVuePropertyValidator.ts +23 -0
- package/Source/GUI_Components/_VuePropertiesValidators/VuePropertyValidator.ts +51 -0
- package/Source/index.ts +24 -8
- package/Workbenches/Source/Decorators/Decorators.workbench.pug +20 -0
- package/Workbenches/Source/Decorators/Decorators.workbench.ts +5 -0
- package/Workbenches/Source/Decorators/DecoratorsWorkbench.vue +69 -0
- package/Workbenches/Source/GUI_Components/AdmonitionBlock/AdmonitionBlockComponentTestSite.vue +9 -2
- package/Workbenches/Source/GUI_Components/Badge/BadgeBlockComponentTestSite.vue +9 -2
- package/Workbenches/Source/GUI_Components/Controls/Buttons/Plain/ButtonComponentTestSite.vue +19 -8
- package/Workbenches/Source/GUI_Components/Controls/Validatable/TextBox/TextBoxWorkbench.vue +45 -2
- package/Workbenches/Source/GUI_Components/Controls/ValidatableControlShell/ValidatableControlShellTestSite.vue +9 -2
- package/Workbenches/Source/GUI_Components/OverflowSafeSingleLineLabel/OverflowSafeSingleLineLabelComponentTestSite.vue +9 -2
- package/Workbenches/Source/Workbenches.pug +6 -0
- package/eslint.config.js +15 -0
- package/package.json +40 -48
- package/tsconfig.json +0 -3
- package/yda.config.yaml +1 -1
- package/Source/GUI_Components/AdmonitionBlock/AdmonitionBlock.vue.pug +0 -43
- package/Source/GUI_Components/Controls/Validatables/InputtableControl.ts +0 -134
- package/Source/GUI_Components/_Utils/validateVuePropertyAndLogIfInvalid.ts +0 -34
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
/* ─── Assets ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
2
2
|
import componentVueTemplate from "./Badge.vue.pug";
|
|
3
3
|
|
|
4
|
+
/* ─── Validations ─────────────────────────────────────────────────────────────────────────────────────── */
|
|
5
|
+
import VuePropertyValidator from "../_VuePropertiesValidators/VuePropertyValidator";
|
|
6
|
+
import ThemeVuePropertyValidator from "../_VuePropertiesValidators/ThemeVuePropertyValidator";
|
|
7
|
+
import GeometricVariationVuePropertyValidator from "../_VuePropertiesValidators/GeometricVariationVuePropertyValidator";
|
|
8
|
+
import GeometricModifiersVuePropertyValidator from "../_VuePropertiesValidators/GeometricModifiersVuePropertyValidator";
|
|
9
|
+
import DecorativeVariationVuePropertyValidator from "../_VuePropertiesValidators/DecorativeVariationVuePropertyValidator";
|
|
10
|
+
import DecorativeModifiersVuePropertyValidator from "../_VuePropertiesValidators/DecorativeModifiersVuePropertyValidator";
|
|
11
|
+
import NonEmptyStringVuePropertyValidator from "../_VuePropertiesValidators/NonEmptyStringVuePropertyValidator";
|
|
12
|
+
import BooleanVuePropertyValidator from "../_VuePropertiesValidators/BooleanVuePropertyValidator";
|
|
13
|
+
import preventNullForOptionalVueProperty from "../_Decorators/preventNullForOptionalVueProperty";
|
|
14
|
+
|
|
4
15
|
/* ─── Framework ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
5
16
|
import {
|
|
6
17
|
ComponentBase as VueComponentConfiguration,
|
|
@@ -9,8 +20,8 @@ import {
|
|
|
9
20
|
} from "vue-facing-decorator";
|
|
10
21
|
|
|
11
22
|
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
12
|
-
import { isString, isElementOfEnumeration } from "@yamato-daiwa/es-extensions";
|
|
13
23
|
import YDF_ComponentsCoordinator from "../YDF_ComponentsCoordinator";
|
|
24
|
+
import { isNonEmptyString, type ElementOfPseudoEnumeration } from "@yamato-daiwa/es-extensions";
|
|
14
25
|
|
|
15
26
|
|
|
16
27
|
@VueComponentConfiguration({
|
|
@@ -22,13 +33,41 @@ class Badge extends VueComponent {
|
|
|
22
33
|
public static CSS_NAMESPACE: string = "Badge--YDF";
|
|
23
34
|
|
|
24
35
|
|
|
25
|
-
@VueProperty({
|
|
26
|
-
|
|
36
|
+
@VueProperty({
|
|
37
|
+
required: false,
|
|
38
|
+
get validator(): VuePropertyValidator {
|
|
39
|
+
return NonEmptyStringVuePropertyValidator({
|
|
40
|
+
propertyName: "keyLabel",
|
|
41
|
+
componentName: Badge.CSS_NAMESPACE,
|
|
42
|
+
isPropertyRequired: this.required === true
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
@preventNullForOptionalVueProperty
|
|
47
|
+
protected readonly keyLabel?: string;
|
|
27
48
|
|
|
28
|
-
@VueProperty({
|
|
49
|
+
@VueProperty({
|
|
50
|
+
required: true,
|
|
51
|
+
get validator(): VuePropertyValidator {
|
|
52
|
+
return NonEmptyStringVuePropertyValidator({
|
|
53
|
+
propertyName: "valueLabel",
|
|
54
|
+
componentName: Badge.CSS_NAMESPACE,
|
|
55
|
+
isPropertyRequired: this.required === true
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
})
|
|
29
59
|
protected readonly valueLabel!: string;
|
|
30
60
|
|
|
31
|
-
@VueProperty({
|
|
61
|
+
@VueProperty({
|
|
62
|
+
default: "span",
|
|
63
|
+
validator: VuePropertyValidator.create({
|
|
64
|
+
checker: isNonEmptyString,
|
|
65
|
+
messageSpecificPart: "If specified, must be the valid HTML tag name",
|
|
66
|
+
propertyName: "rootElementTag",
|
|
67
|
+
componentName: Badge.CSS_NAMESPACE
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
@preventNullForOptionalVueProperty
|
|
32
71
|
protected readonly rootElementTag!: string;
|
|
33
72
|
|
|
34
73
|
|
|
@@ -36,10 +75,10 @@ class Badge extends VueComponent {
|
|
|
36
75
|
public static readonly Themes: Badge.Themes = { regular: "REGULAR" };
|
|
37
76
|
|
|
38
77
|
@VueProperty({
|
|
39
|
-
type: String,
|
|
40
78
|
default: Badge.Themes.regular,
|
|
41
|
-
validator: (
|
|
79
|
+
validator: ThemeVuePropertyValidator(Badge)
|
|
42
80
|
})
|
|
81
|
+
@preventNullForOptionalVueProperty
|
|
43
82
|
protected readonly theme!: string;
|
|
44
83
|
|
|
45
84
|
public static defineThemes(themesNames: ReadonlyArray<string>): typeof Badge {
|
|
@@ -52,7 +91,17 @@ class Badge extends VueComponent {
|
|
|
52
91
|
Badge.areThemesCSS_ClassesCommon = true;
|
|
53
92
|
}
|
|
54
93
|
|
|
55
|
-
@VueProperty({
|
|
94
|
+
@VueProperty({
|
|
95
|
+
default: Badge.areThemesCSS_ClassesCommon,
|
|
96
|
+
get validator(): VuePropertyValidator {
|
|
97
|
+
return BooleanVuePropertyValidator({
|
|
98
|
+
propertyName: "areThemesCSS_ClassesCommon",
|
|
99
|
+
componentName: Badge.CSS_NAMESPACE,
|
|
100
|
+
isPropertyRequired: this.required === true
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
@preventNullForOptionalVueProperty
|
|
56
105
|
protected readonly areThemesCSS_ClassesCommon!: boolean;
|
|
57
106
|
|
|
58
107
|
|
|
@@ -63,25 +112,27 @@ class Badge extends VueComponent {
|
|
|
63
112
|
};
|
|
64
113
|
|
|
65
114
|
@VueProperty({
|
|
66
|
-
type: String,
|
|
67
115
|
default: Badge.GeometricVariations.regular,
|
|
68
|
-
validator: (
|
|
116
|
+
validator: GeometricVariationVuePropertyValidator(Badge)
|
|
69
117
|
})
|
|
118
|
+
@preventNullForOptionalVueProperty
|
|
70
119
|
protected readonly geometricVariation!: string;
|
|
71
120
|
|
|
72
121
|
public static defineGeometricVariations(geometricVariationsNames: ReadonlyArray<string>): typeof Badge {
|
|
73
122
|
return YDF_ComponentsCoordinator.defineGeometricVariations(geometricVariationsNames, Badge);
|
|
74
123
|
}
|
|
75
124
|
|
|
125
|
+
public static readonly GeometricModifiers: Badge.GeometricModifiers = {
|
|
126
|
+
pillShape: "PILL_SHAPE",
|
|
127
|
+
singleLine: "SINGLE_LINE"
|
|
128
|
+
};
|
|
129
|
+
|
|
76
130
|
@VueProperty({
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
validator: (rawValue: ReadonlyArray<unknown>): boolean =>
|
|
80
|
-
rawValue.every(
|
|
81
|
-
(element: unknown): boolean => isString(element) && isElementOfEnumeration(element, Badge.GeometricModifiers)
|
|
82
|
-
)
|
|
131
|
+
default: (): ReadonlyArray<ElementOfPseudoEnumeration<Badge.GeometricModifiers>> => [],
|
|
132
|
+
validator: GeometricModifiersVuePropertyValidator(Badge)
|
|
83
133
|
})
|
|
84
|
-
|
|
134
|
+
@preventNullForOptionalVueProperty
|
|
135
|
+
protected readonly geometricModifiers!: ReadonlyArray<ElementOfPseudoEnumeration<Badge.GeometricModifiers>>;
|
|
85
136
|
|
|
86
137
|
|
|
87
138
|
/* ─── Decoration ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
@@ -103,9 +154,8 @@ class Badge extends VueComponent {
|
|
|
103
154
|
};
|
|
104
155
|
|
|
105
156
|
@VueProperty({
|
|
106
|
-
type: String,
|
|
107
157
|
required: true,
|
|
108
|
-
validator: (
|
|
158
|
+
validator: DecorativeVariationVuePropertyValidator(Badge)
|
|
109
159
|
})
|
|
110
160
|
protected readonly decorativeVariation!: string;
|
|
111
161
|
|
|
@@ -113,47 +163,32 @@ class Badge extends VueComponent {
|
|
|
113
163
|
return YDF_ComponentsCoordinator.defineDecorativeVariations(decorativeVariationsNames, Badge);
|
|
114
164
|
}
|
|
115
165
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
166
|
+
public static readonly DecorativeModifiers: Badge.DecorativeModifiers = {
|
|
167
|
+
bordersDisguising: "BORDERS_DISGUISING",
|
|
168
|
+
noBackground: "NO_BACKGROUND"
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
@VueProperty({
|
|
172
|
+
default: (): ReadonlyArray<ElementOfPseudoEnumeration<Badge.DecorativeModifiers>> => [],
|
|
173
|
+
validator: DecorativeModifiersVuePropertyValidator(Badge)
|
|
123
174
|
})
|
|
124
|
-
protected readonly decorativeModifiers!: ReadonlyArray<Badge.DecorativeModifiers
|
|
175
|
+
protected readonly decorativeModifiers!: ReadonlyArray<ElementOfPseudoEnumeration<Badge.DecorativeModifiers>>;
|
|
125
176
|
|
|
126
177
|
|
|
127
178
|
/* ━━━ CSS Classes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
128
179
|
protected get rootElementModifierCSS_Classes(): ReadonlyArray<string> {
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
142
|
-
}),
|
|
143
|
-
|
|
144
|
-
...YDF_ComponentsCoordinator.
|
|
145
|
-
generateDemandedGeometricModifiersCSS_Classes(Badge.CSS_NAMESPACE, this.geometricModifiers),
|
|
146
|
-
|
|
147
|
-
...YDF_ComponentsCoordinator.addDecorativeVariationCSS_ClassToArrayIfMust({
|
|
148
|
-
decorativeVariation: this.decorativeVariation,
|
|
149
|
-
allDecorativeVariations: Badge.DecorativeVariations,
|
|
150
|
-
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
151
|
-
}),
|
|
152
|
-
|
|
153
|
-
...YDF_ComponentsCoordinator.
|
|
154
|
-
generateDemandedDecorativeModifiersCSS_Classes(Badge.CSS_NAMESPACE, this.decorativeModifiers)
|
|
155
|
-
|
|
156
|
-
];
|
|
180
|
+
return YDF_ComponentsCoordinator.generateRootElementModifierCSS_Classes({
|
|
181
|
+
CSS_Namespace: Badge.CSS_NAMESPACE,
|
|
182
|
+
activeTheme: this.theme,
|
|
183
|
+
allThemes: Badge.Themes,
|
|
184
|
+
areThemesCSS_ClassesCommon: this.areThemesCSS_ClassesCommon,
|
|
185
|
+
activeGeometricVariation: this.geometricVariation,
|
|
186
|
+
allGeometricVariations: Badge.GeometricVariations,
|
|
187
|
+
activeGeometricModifiers: this.geometricModifiers,
|
|
188
|
+
activeDecorativeVariation: this.decorativeVariation,
|
|
189
|
+
allDecorativeVariations: Badge.DecorativeVariations,
|
|
190
|
+
activeDecorativeModifiers: this.decorativeModifiers
|
|
191
|
+
});
|
|
157
192
|
}
|
|
158
193
|
|
|
159
194
|
}
|
|
@@ -171,10 +206,10 @@ namespace Badge {
|
|
|
171
206
|
[variationName: string]: string;
|
|
172
207
|
};
|
|
173
208
|
|
|
174
|
-
export
|
|
175
|
-
pillShape
|
|
176
|
-
singleLine
|
|
177
|
-
}
|
|
209
|
+
export type GeometricModifiers = Readonly<{
|
|
210
|
+
pillShape: "PILL_SHAPE";
|
|
211
|
+
singleLine: "SINGLE_LINE";
|
|
212
|
+
}>;
|
|
178
213
|
|
|
179
214
|
export type DecorativeVariations = {
|
|
180
215
|
readonly veryCatchyBright: "VERY_CATCHY_BRIGHT";
|
|
@@ -194,10 +229,10 @@ namespace Badge {
|
|
|
194
229
|
[variationName: string]: string;
|
|
195
230
|
};
|
|
196
231
|
|
|
197
|
-
export
|
|
198
|
-
bordersDisguising
|
|
199
|
-
noBackground
|
|
200
|
-
}
|
|
232
|
+
export type DecorativeModifiers = Readonly<{
|
|
233
|
+
bordersDisguising: "BORDERS_DISGUISING";
|
|
234
|
+
noBackground: "NO_BACKGROUND";
|
|
235
|
+
}>;
|
|
201
236
|
|
|
202
237
|
}
|
|
203
238
|
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
/* ─── Assets ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
2
|
-
import Badge from "../Badge.vue";
|
|
3
2
|
import componentVueTemplate from "./Badge-LoadingPlaceholder.vue.pug";
|
|
4
3
|
|
|
4
|
+
/* ─── GUI Components ─────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
5
|
+
import Badge from "../Badge.vue";
|
|
6
|
+
|
|
7
|
+
/* ─── Validations ─────────────────────────────────────────────────────────────────────────────────────── */
|
|
8
|
+
import type VuePropertyValidator from "../../_VuePropertiesValidators/VuePropertyValidator";
|
|
9
|
+
import ThemeVuePropertyValidator from "../../_VuePropertiesValidators/ThemeVuePropertyValidator";
|
|
10
|
+
import GeometricVariationVuePropertyValidator from "../../_VuePropertiesValidators/GeometricVariationVuePropertyValidator";
|
|
11
|
+
import GeometricModifiersVuePropertyValidator from "../../_VuePropertiesValidators/GeometricModifiersVuePropertyValidator";
|
|
12
|
+
import preventNullForOptionalVueProperty from "../../_Decorators/preventNullForOptionalVueProperty";
|
|
13
|
+
import BooleanVuePropertyValidator from "../../_VuePropertiesValidators/BooleanVuePropertyValidator";
|
|
14
|
+
|
|
5
15
|
/* ─── Framework ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
6
16
|
import {
|
|
7
17
|
ComponentBase as VueComponentConfiguration,
|
|
@@ -10,65 +20,74 @@ import {
|
|
|
10
20
|
} from "vue-facing-decorator";
|
|
11
21
|
|
|
12
22
|
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
13
|
-
import { isString, isElementOfEnumeration } from "@yamato-daiwa/es-extensions";
|
|
14
23
|
import YDF_ComponentsCoordinator from "../../YDF_ComponentsCoordinator";
|
|
24
|
+
import { type ElementOfPseudoEnumeration } from "@yamato-daiwa/es-extensions";
|
|
15
25
|
|
|
16
26
|
|
|
17
27
|
@VueComponentConfiguration({
|
|
18
|
-
name: "Badge--
|
|
28
|
+
name: "Badge--YDF__LoadingPlaceholder",
|
|
19
29
|
template: componentVueTemplate
|
|
20
30
|
})
|
|
21
31
|
export default class BadgeLoadingPlaceholder extends VueComponent {
|
|
22
32
|
|
|
23
33
|
@VueProperty({
|
|
24
|
-
type: String,
|
|
25
34
|
default: Badge.Themes.regular,
|
|
26
|
-
validator: (
|
|
35
|
+
validator: ThemeVuePropertyValidator({
|
|
36
|
+
Themes: Badge.Themes,
|
|
37
|
+
CSS_NAMESPACE: "Badge--YDF__LoadingPlaceholder"
|
|
38
|
+
})
|
|
27
39
|
})
|
|
40
|
+
@preventNullForOptionalVueProperty
|
|
28
41
|
protected readonly theme!: string;
|
|
29
42
|
|
|
30
|
-
|
|
43
|
+
|
|
44
|
+
@VueProperty({
|
|
45
|
+
default: Badge.areThemesCSS_ClassesCommon,
|
|
46
|
+
get validator(): VuePropertyValidator {
|
|
47
|
+
return BooleanVuePropertyValidator({
|
|
48
|
+
propertyName: "areThemesCSS_ClassesCommon",
|
|
49
|
+
componentName: Badge.name,
|
|
50
|
+
isPropertyRequired: this.required === true
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
@preventNullForOptionalVueProperty
|
|
31
55
|
protected readonly areThemesCSS_ClassesCommon!: boolean;
|
|
32
56
|
|
|
33
57
|
|
|
34
58
|
@VueProperty({
|
|
35
|
-
type: String,
|
|
36
59
|
default: Badge.GeometricVariations.regular,
|
|
37
|
-
validator: (
|
|
60
|
+
validator: GeometricVariationVuePropertyValidator({
|
|
61
|
+
GeometricVariations: Badge.GeometricVariations,
|
|
62
|
+
CSS_NAMESPACE: "Badge--YDF__LoadingPlaceholder"
|
|
63
|
+
})
|
|
38
64
|
})
|
|
65
|
+
@preventNullForOptionalVueProperty
|
|
39
66
|
protected readonly geometricVariation!: string;
|
|
40
67
|
|
|
68
|
+
|
|
41
69
|
@VueProperty({
|
|
42
|
-
type: Array,
|
|
43
70
|
default: (): ReadonlyArray<Badge.GeometricModifiers> => [],
|
|
44
|
-
validator: (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
71
|
+
validator: GeometricModifiersVuePropertyValidator({
|
|
72
|
+
GeometricModifiers: Badge.GeometricModifiers,
|
|
73
|
+
CSS_NAMESPACE: "Badge--YDF__LoadingPlaceholder"
|
|
74
|
+
})
|
|
48
75
|
})
|
|
49
|
-
|
|
76
|
+
@preventNullForOptionalVueProperty
|
|
77
|
+
protected readonly geometricModifiers!: ReadonlyArray<ElementOfPseudoEnumeration<Badge.GeometricModifiers>>;
|
|
50
78
|
|
|
51
79
|
|
|
52
80
|
protected get rootElementModifierCSS_Classes(): ReadonlyArray<string> {
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
...YDF_ComponentsCoordinator.addGeometricVariationCSS_ClassToArrayIfMust({
|
|
63
|
-
geometricVariation: this.geometricVariation,
|
|
64
|
-
allGeometricVariations: Badge.GeometricVariations,
|
|
65
|
-
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
66
|
-
}),
|
|
67
|
-
|
|
68
|
-
...YDF_ComponentsCoordinator.
|
|
69
|
-
generateDemandedGeometricModifiersCSS_Classes(Badge.CSS_NAMESPACE, this.geometricModifiers)
|
|
81
|
+
return YDF_ComponentsCoordinator.generateRootElementModifierCSS_Classes({
|
|
82
|
+
CSS_Namespace: Badge.CSS_NAMESPACE,
|
|
83
|
+
activeTheme: this.theme,
|
|
84
|
+
allThemes: Badge.Themes,
|
|
85
|
+
areThemesCSS_ClassesCommon: this.areThemesCSS_ClassesCommon,
|
|
86
|
+
activeGeometricVariation: this.geometricVariation,
|
|
87
|
+
allGeometricVariations: Badge.GeometricVariations,
|
|
88
|
+
activeGeometricModifiers: this.geometricModifiers
|
|
89
|
+
});
|
|
70
90
|
|
|
71
|
-
];
|
|
72
91
|
}
|
|
73
92
|
|
|
74
93
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ClosingButton--YDF Closing!
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/* ─── Assets ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
2
|
+
import componentVueTemplate from "./ClosingButton.vue.pug";
|
|
3
|
+
|
|
4
|
+
/* ─── Validations ─────────────────────────────────────────────────────────────────────────────────────── */
|
|
5
|
+
import type VuePropertyValidator from "../../../_VuePropertiesValidators/VuePropertyValidator";
|
|
6
|
+
import BooleanVuePropertyValidator from "../../../_VuePropertiesValidators/BooleanVuePropertyValidator";
|
|
7
|
+
import ElementOfEnumerationVuePropertyValidator from "../../../_VuePropertiesValidators/ElementOfEnumerationVuePropertyValidator";
|
|
8
|
+
import NonEmptyStringVuePropertyValidator from "../../../_VuePropertiesValidators/NonEmptyStringVuePropertyValidator";
|
|
9
|
+
import ThemeVuePropertyValidator from "../../../_VuePropertiesValidators/ThemeVuePropertyValidator";
|
|
10
|
+
import GeometricVariationVuePropertyValidator from "../../../_VuePropertiesValidators/GeometricVariationVuePropertyValidator";
|
|
11
|
+
import GeometricModifiersVuePropertyValidator from "../../../_VuePropertiesValidators/GeometricModifiersVuePropertyValidator";
|
|
12
|
+
import DecorativeVariationVuePropertyValidator from "../../../_VuePropertiesValidators/DecorativeVariationVuePropertyValidator";
|
|
13
|
+
import DecorativeModifiersVuePropertyValidator from "../../../_VuePropertiesValidators/DecorativeModifiersVuePropertyValidator";
|
|
14
|
+
import preventNullForOptionalVueProperty from "../../../_Decorators/preventNullForOptionalVueProperty";
|
|
15
|
+
|
|
16
|
+
/* ─── Framework ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
17
|
+
import {
|
|
18
|
+
ComponentBase as VueComponentConfiguration,
|
|
19
|
+
Vue as VueComponent,
|
|
20
|
+
Prop as VueProperty
|
|
21
|
+
} from "vue-facing-decorator";
|
|
22
|
+
|
|
23
|
+
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
24
|
+
import YDF_ComponentsCoordinator from "../../../YDF_ComponentsCoordinator";
|
|
25
|
+
import { type ElementOfPseudoEnumeration } from "@yamato-daiwa/es-extensions";
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@VueComponentConfiguration({
|
|
29
|
+
name: ClosingButton.CSS_NAMESPACE,
|
|
30
|
+
template: componentVueTemplate
|
|
31
|
+
})
|
|
32
|
+
class ClosingButton extends VueComponent {
|
|
33
|
+
|
|
34
|
+
/* ━━━ Static Fields ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
35
|
+
public static CSS_NAMESPACE: string = "ClosingButton--YDF";
|
|
36
|
+
|
|
37
|
+
public static LabelLetterCases: ClosingButton.LabelLetterCases = {
|
|
38
|
+
uppercase: "UPPERCASE",
|
|
39
|
+
lowercase: "LOWERCASE",
|
|
40
|
+
capitalisation: "CAPITALISATION"
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/* ━━━ Common Properties ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
45
|
+
/* ─── Textings ─────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
46
|
+
@VueProperty({
|
|
47
|
+
required: false,
|
|
48
|
+
get validator(): VuePropertyValidator {
|
|
49
|
+
return NonEmptyStringVuePropertyValidator({
|
|
50
|
+
isPropertyRequired: this.required === true,
|
|
51
|
+
propertyName: "customLabel",
|
|
52
|
+
componentName: ClosingButton.CSS_NAMESPACE
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
@preventNullForOptionalVueProperty
|
|
57
|
+
protected readonly customLabel?: string;
|
|
58
|
+
|
|
59
|
+
@VueProperty({
|
|
60
|
+
default: false,
|
|
61
|
+
get validator(): VuePropertyValidator {
|
|
62
|
+
return BooleanVuePropertyValidator({
|
|
63
|
+
propertyName: "noLabel",
|
|
64
|
+
componentName: ClosingButton.CSS_NAMESPACE,
|
|
65
|
+
isPropertyRequired: this.required === true
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
@preventNullForOptionalVueProperty
|
|
70
|
+
protected readonly noLabel!: boolean;
|
|
71
|
+
|
|
72
|
+
@VueProperty({
|
|
73
|
+
default: ClosingButton.LabelLetterCases.lowercase,
|
|
74
|
+
get validator(): VuePropertyValidator {
|
|
75
|
+
return ElementOfEnumerationVuePropertyValidator({
|
|
76
|
+
enumerationFullyQualifiedName: "ClosingButton.LabelLetterCases",
|
|
77
|
+
enumeration: ClosingButton.LabelLetterCases,
|
|
78
|
+
propertyName: "labelLetterCase",
|
|
79
|
+
componentName: ClosingButton.CSS_NAMESPACE,
|
|
80
|
+
isPropertyRequired: this.required === true
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
@preventNullForOptionalVueProperty
|
|
85
|
+
protected readonly labelLetterCase!: ElementOfPseudoEnumeration<ClosingButton.LabelLetterCases>;
|
|
86
|
+
|
|
87
|
+
@VueProperty({
|
|
88
|
+
required: false,
|
|
89
|
+
get validator(): VuePropertyValidator {
|
|
90
|
+
return NonEmptyStringVuePropertyValidator({
|
|
91
|
+
isPropertyRequired: this.required === true,
|
|
92
|
+
propertyName: "accessibilityGuidance",
|
|
93
|
+
componentName: ClosingButton.CSS_NAMESPACE
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
@preventNullForOptionalVueProperty
|
|
98
|
+
protected readonly accessibilityGuidance?: string;
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
/* ━━━ Theming ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
102
|
+
public static readonly Themes: ClosingButton.Themes = { regular: "REGULAR" };
|
|
103
|
+
|
|
104
|
+
@VueProperty({
|
|
105
|
+
default: ClosingButton.Themes.regular,
|
|
106
|
+
validator: ThemeVuePropertyValidator(ClosingButton)
|
|
107
|
+
})
|
|
108
|
+
@preventNullForOptionalVueProperty
|
|
109
|
+
protected readonly theme!: string;
|
|
110
|
+
|
|
111
|
+
public static defineThemes(themesNames: ReadonlyArray<string>): typeof ClosingButton {
|
|
112
|
+
return YDF_ComponentsCoordinator.defineThemes(themesNames, ClosingButton);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
public static areThemesCSS_ClassesCommon: boolean = YDF_ComponentsCoordinator.areThemesCSS_ClassesCommon;
|
|
116
|
+
|
|
117
|
+
public static considerThemesAsCommon(): void {
|
|
118
|
+
ClosingButton.areThemesCSS_ClassesCommon = true;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@VueProperty({
|
|
122
|
+
default: ClosingButton.areThemesCSS_ClassesCommon,
|
|
123
|
+
get validator(): VuePropertyValidator {
|
|
124
|
+
return BooleanVuePropertyValidator({
|
|
125
|
+
propertyName: "areThemesCSS_ClassesCommon",
|
|
126
|
+
componentName: ClosingButton.CSS_NAMESPACE,
|
|
127
|
+
isPropertyRequired: this.required === true
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
@preventNullForOptionalVueProperty
|
|
132
|
+
protected readonly areThemesCSS_ClassesCommon!: boolean;
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
/* ─── Geometry ─────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
136
|
+
public static readonly GeometricVariations: ClosingButton.GeometricVariations = { regular: "REGULAR" };
|
|
137
|
+
|
|
138
|
+
@VueProperty({
|
|
139
|
+
default: ClosingButton.GeometricVariations.regular,
|
|
140
|
+
validator: GeometricVariationVuePropertyValidator(ClosingButton)
|
|
141
|
+
})
|
|
142
|
+
@preventNullForOptionalVueProperty
|
|
143
|
+
protected readonly geometricVariation!: string;
|
|
144
|
+
|
|
145
|
+
public static defineGeometricVariations(geometricVariationsNames: ReadonlyArray<string>): typeof ClosingButton {
|
|
146
|
+
return YDF_ComponentsCoordinator.defineGeometricVariations(geometricVariationsNames, ClosingButton);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
public static readonly GeometricModifiers: ClosingButton.GeometricModifiers = { noRoundings: "NO_ROUNDINGS" };
|
|
150
|
+
|
|
151
|
+
@VueProperty({
|
|
152
|
+
default: (): ReadonlyArray<ElementOfPseudoEnumeration<ClosingButton.GeometricModifiers>> => [],
|
|
153
|
+
validator: GeometricModifiersVuePropertyValidator(ClosingButton)
|
|
154
|
+
})
|
|
155
|
+
@preventNullForOptionalVueProperty
|
|
156
|
+
protected readonly geometricModifiers!: ReadonlyArray<ElementOfPseudoEnumeration<ClosingButton.GeometricModifiers>>;
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
/* ─── Decoration ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
160
|
+
public static readonly DecorativeVariations: ClosingButton.DecorativeVariations = { regular: "REGULAR" };
|
|
161
|
+
|
|
162
|
+
@VueProperty({
|
|
163
|
+
default: ClosingButton.DecorativeVariations.regular,
|
|
164
|
+
validator: DecorativeVariationVuePropertyValidator(ClosingButton)
|
|
165
|
+
})
|
|
166
|
+
@preventNullForOptionalVueProperty
|
|
167
|
+
protected readonly decorativeVariation!: string;
|
|
168
|
+
|
|
169
|
+
public static defineDecorativeVariations(decorativeVariationsNames: ReadonlyArray<string>): typeof ClosingButton {
|
|
170
|
+
return YDF_ComponentsCoordinator.defineDecorativeVariations(decorativeVariationsNames, ClosingButton);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
public static readonly DecorativeModifiers: ClosingButton.DecorativeModifiers = {
|
|
174
|
+
bordersDisguising: "BORDERS_DISGUISING",
|
|
175
|
+
noBackground: "NO_BACKGROUND",
|
|
176
|
+
noBackgroundInDefaultState: "NO_BACKGROUND_IN_DEFAULT_STATE"
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
@VueProperty({
|
|
180
|
+
default: (): ReadonlyArray<ElementOfPseudoEnumeration<ClosingButton.DecorativeModifiers>> => [],
|
|
181
|
+
validator: DecorativeModifiersVuePropertyValidator(ClosingButton)
|
|
182
|
+
})
|
|
183
|
+
protected readonly decorativeModifiers!: ReadonlyArray<ElementOfPseudoEnumeration<ClosingButton.DecorativeModifiers>>;
|
|
184
|
+
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
namespace ClosingButton {
|
|
189
|
+
|
|
190
|
+
export type LabelLetterCases = Readonly<{
|
|
191
|
+
uppercase: "UPPERCASE";
|
|
192
|
+
lowercase: "LOWERCASE";
|
|
193
|
+
capitalisation: "CAPITALISATION";
|
|
194
|
+
}>;
|
|
195
|
+
|
|
196
|
+
export type Themes = {
|
|
197
|
+
readonly regular: "REGULAR";
|
|
198
|
+
[themeName: string]: string;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export type GeometricVariations = {
|
|
202
|
+
readonly regular: "REGULAR";
|
|
203
|
+
[variationName: string]: string;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export type GeometricModifiers = Readonly<{
|
|
207
|
+
noRoundings: "NO_ROUNDINGS";
|
|
208
|
+
}>;
|
|
209
|
+
|
|
210
|
+
export type DecorativeVariations = {
|
|
211
|
+
readonly regular: "REGULAR";
|
|
212
|
+
[variationName: string]: string;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export type DecorativeModifiers = Readonly<{
|
|
216
|
+
bordersDisguising: "BORDERS_DISGUISING";
|
|
217
|
+
noBackground: "NO_BACKGROUND";
|
|
218
|
+
noBackgroundInDefaultState: "NO_BACKGROUND_IN_DEFAULT_STATE";
|
|
219
|
+
}>;
|
|
220
|
+
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
export default ClosingButton;
|