@yamato-daiwa/frontend-vue 0.1.0 → 0.2.0
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/.idea/inspectionProfiles/Project_Default.xml +0 -5
- package/README.md +8 -2
- package/Source/GUI_Components/AdmonitionBlock/AdmonitionBlock.vue.ts +8 -8
- package/Source/GUI_Components/Badge/Badge.vue.ts +10 -10
- package/Source/GUI_Components/Badge/LoadingPlaceholder/Badge-LoadingPlaceholder.vue.ts +4 -4
- package/Source/GUI_Components/Controls/Buttons/Plain/Button.vue.pug +5 -7
- package/Source/GUI_Components/Controls/Buttons/Plain/Button.vue.ts +59 -30
- package/Source/GUI_Components/Controls/Buttons/Plain/LoadingPlaceholder/Button-LoadingPlaceholder.vue.pug +1 -1
- package/Source/GUI_Components/Controls/Buttons/Plain/LoadingPlaceholder/Button-LoadingPlaceholder.vue.ts +9 -8
- package/Source/GUI_Components/Controls/ValidatableControlShell/ValidatableControlShell.vue.pug +51 -0
- package/Source/GUI_Components/Controls/ValidatableControlShell/ValidatableControlShell.vue.ts +296 -0
- package/Source/GUI_Components/Controls/Validatables/InputtableControl.ts +134 -0
- package/Source/GUI_Components/Controls/Validatables/TextBox/TextBox.vue.pug +29 -0
- package/Source/GUI_Components/Controls/Validatables/TextBox/TextBox.vue.ts +260 -0
- package/Source/GUI_Components/Controls/{ValidatableControl.ts → Validatables/ValidatableControl.ts} +1 -1
- package/Source/GUI_Components/{ComponentsAuxiliaries.ts → YDF_ComponentsCoordinator.ts} +35 -1
- package/Source/GUI_Components/_Decorators/OptionalButNotNullableVueProperty.ts +65 -0
- package/Source/GUI_Components/_Errors/ForbiddenNullValueOfOptionalVueProperty/ForbiddenNullValueOfOptionalVuePropertyError.ts +47 -0
- package/Source/GUI_Components/_Errors/ForbiddenNullValueOfOptionalVueProperty/ForbiddenNullValueOfOptionalVuePropertyErrorLocalization.english.ts +24 -0
- package/Source/GUI_Components/_Utils/validateVuePropertyAndLogIfInvalid.ts +34 -0
- package/Source/index.ts +12 -5
- package/Workbenches/Source/GUI_Components/AdmonitionBlock/AdmonitionBlockComponentTestSite.vue +15 -0
- package/Workbenches/Source/GUI_Components/Badge/BadgeBlockComponentTestSite.vue +15 -0
- package/Workbenches/Source/GUI_Components/Controls/Buttons/Plain/Button.workbench.pug +20 -0
- package/Workbenches/Source/GUI_Components/Controls/Buttons/Plain/Button.workbench.ts +5 -0
- package/Workbenches/Source/GUI_Components/Controls/Buttons/Plain/ButtonComponentTestSite.vue +49 -0
- package/Workbenches/Source/GUI_Components/Controls/Validatable/TextBox/TextBox.workbench.pug +20 -0
- package/Workbenches/Source/GUI_Components/Controls/Validatable/TextBox/TextBox.workbench.ts +5 -0
- package/Workbenches/Source/GUI_Components/Controls/Validatable/TextBox/TextBoxWorkbench.vue +43 -0
- package/Workbenches/Source/GUI_Components/Controls/ValidatableControlShell/ValidatableControlShell.workbench.pug +20 -0
- package/Workbenches/Source/GUI_Components/Controls/ValidatableControlShell/ValidatableControlShell.workbench.ts +5 -0
- package/Workbenches/Source/GUI_Components/Controls/ValidatableControlShell/ValidatableControlShellTestSite.vue +61 -0
- package/Workbenches/Source/Workbenches.pug +56 -0
- package/package.json +8 -8
- package/yda.config.yaml +65 -65
- package/Source/GUI_Components/Controls/InputtableControl.ts +0 -97
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
<profile version="1.0">
|
|
3
3
|
<option name="myName" value="Project Default" />
|
|
4
4
|
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
5
|
-
<inspection_tool class="ImplicitTypeConversion" enabled="true" level="WARNING" enabled_by_default="true">
|
|
6
|
-
<option name="BITS" value="1720" />
|
|
7
|
-
<option name="FLAG_EXPLICIT_CONVERSION" value="true" />
|
|
8
|
-
<option name="IGNORE_NODESET_TO_BOOLEAN_VIA_STRING" value="true" />
|
|
9
|
-
</inspection_tool>
|
|
10
5
|
<inspection_tool class="UsePropertyAccessSyntax" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
|
|
11
6
|
</profile>
|
|
12
7
|
</component>
|
package/README.md
CHANGED
|
@@ -11,12 +11,12 @@ The [core package](https://www.npmjs.com/package/@yamato-daiwa/frontend) is stil
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm i @yamato-daiwa/frontend-vue @yamato-daiwa/frontend@2.0.0-beta.
|
|
14
|
+
npm i @yamato-daiwa/frontend-vue @yamato-daiwa/frontend@2.0.0-beta.10
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
### Peer Dependencies
|
|
18
18
|
|
|
19
|
-
+ **@yamato-daiwa/frontend**: 2.0.0-beta.
|
|
19
|
+
+ **@yamato-daiwa/frontend**: 2.0.0-beta.10
|
|
20
20
|
+ **vue**: ~3.5.0
|
|
21
21
|
+ **vue-router**: ~4.5.0
|
|
22
22
|
|
|
@@ -26,3 +26,9 @@ npm i @yamato-daiwa/frontend-vue @yamato-daiwa/frontend@2.0.0-beta.6
|
|
|
26
26
|
|
|
27
27
|
+ [AdmonitionBlock](https://frontend.yamato-daiwa.com/AdaptationsToFrameworks/Vue/GUI_Components/Children/AdmonitionBlock/AdmonitionBlock-Vue.english.html)
|
|
28
28
|
+ [Badge](https://frontend.yamato-daiwa.com/AdaptationsToFrameworks/Vue/GUI_Components/Children/Badge/Badge-Vue.english.html)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
#### Controls
|
|
32
|
+
|
|
33
|
+
+ Buttons
|
|
34
|
+
+ [Plain (Button)](https://frontend.yamato-daiwa.com/AdaptationsToFrameworks/Vue/GUI_Components/Children/Controls/Buttons/Plain/Button-Vue.english.html)
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
|
|
24
24
|
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
25
25
|
import { isStringOfLength, isElementOfEnumeration } from "@yamato-daiwa/es-extensions";
|
|
26
|
-
import
|
|
26
|
+
import YDF_ComponentsCoordinator from "../YDF_ComponentsCoordinator";
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
@VueComponentConfiguration({
|
|
@@ -75,10 +75,10 @@ class AdmonitionBlock extends VueComponent {
|
|
|
75
75
|
protected readonly theme!: string;
|
|
76
76
|
|
|
77
77
|
public static defineThemes(themesNames: ReadonlyArray<string>): typeof AdmonitionBlock {
|
|
78
|
-
return
|
|
78
|
+
return YDF_ComponentsCoordinator.defineThemes(themesNames, AdmonitionBlock);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
protected static areThemesCSS_ClassesCommon: boolean =
|
|
81
|
+
protected static areThemesCSS_ClassesCommon: boolean = YDF_ComponentsCoordinator.areThemesCSS_ClassesCommon;
|
|
82
82
|
|
|
83
83
|
public static considerThemesAsCommon(): void {
|
|
84
84
|
AdmonitionBlock.areThemesCSS_ClassesCommon = true;
|
|
@@ -102,7 +102,7 @@ class AdmonitionBlock extends VueComponent {
|
|
|
102
102
|
protected readonly geometricVariation!: string;
|
|
103
103
|
|
|
104
104
|
public static defineGeometricVariations(geometricVariationsNames: ReadonlyArray<string>): typeof AdmonitionBlock {
|
|
105
|
-
return
|
|
105
|
+
return YDF_ComponentsCoordinator.defineGeometricVariations(geometricVariationsNames, AdmonitionBlock);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
|
|
@@ -124,7 +124,7 @@ class AdmonitionBlock extends VueComponent {
|
|
|
124
124
|
protected readonly decorativeVariation!: string;
|
|
125
125
|
|
|
126
126
|
public static defineDecorativeVariations(decorativeVariationsNames: ReadonlyArray<string>): typeof AdmonitionBlock {
|
|
127
|
-
return
|
|
127
|
+
return YDF_ComponentsCoordinator.defineDecorativeVariations(decorativeVariationsNames, AdmonitionBlock);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
|
|
@@ -149,20 +149,20 @@ class AdmonitionBlock extends VueComponent {
|
|
|
149
149
|
protected get rootElementModifierCSS_Classes(): Array<string> {
|
|
150
150
|
return [
|
|
151
151
|
|
|
152
|
-
...
|
|
152
|
+
...YDF_ComponentsCoordinator.addThemeCSS_ClassToArrayIfMust({
|
|
153
153
|
themeValue: this.theme,
|
|
154
154
|
allThemes: AdmonitionBlock.Themes,
|
|
155
155
|
areThemesCSS_ClassesCommon: this.areThemesCSS_ClassesCommon,
|
|
156
156
|
CSS_Namespace: AdmonitionBlock.CSS_NAMESPACE
|
|
157
157
|
}),
|
|
158
158
|
|
|
159
|
-
...
|
|
159
|
+
...YDF_ComponentsCoordinator.addGeometricVariationCSS_ClassToArrayIfMust({
|
|
160
160
|
geometricVariation: this.geometricVariation,
|
|
161
161
|
allGeometricVariations: AdmonitionBlock.GeometricVariations,
|
|
162
162
|
CSS_Namespace: AdmonitionBlock.CSS_NAMESPACE
|
|
163
163
|
}),
|
|
164
164
|
|
|
165
|
-
...
|
|
165
|
+
...YDF_ComponentsCoordinator.addDecorativeVariationCSS_ClassToArrayIfMust({
|
|
166
166
|
decorativeVariation: this.decorativeVariation,
|
|
167
167
|
allDecorativeVariations: AdmonitionBlock.DecorativeVariations,
|
|
168
168
|
CSS_Namespace: AdmonitionBlock.CSS_NAMESPACE
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
12
12
|
import { isString, isElementOfEnumeration } from "@yamato-daiwa/es-extensions";
|
|
13
|
-
import
|
|
13
|
+
import YDF_ComponentsCoordinator from "../YDF_ComponentsCoordinator";
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
@VueComponentConfiguration({
|
|
@@ -43,10 +43,10 @@ class Badge extends VueComponent {
|
|
|
43
43
|
protected readonly theme!: string;
|
|
44
44
|
|
|
45
45
|
public static defineThemes(themesNames: ReadonlyArray<string>): typeof Badge {
|
|
46
|
-
return
|
|
46
|
+
return YDF_ComponentsCoordinator.defineThemes(themesNames, Badge);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
public static areThemesCSS_ClassesCommon: boolean =
|
|
49
|
+
public static areThemesCSS_ClassesCommon: boolean = YDF_ComponentsCoordinator.areThemesCSS_ClassesCommon;
|
|
50
50
|
|
|
51
51
|
public static considerThemesAsCommon(): void {
|
|
52
52
|
Badge.areThemesCSS_ClassesCommon = true;
|
|
@@ -70,7 +70,7 @@ class Badge extends VueComponent {
|
|
|
70
70
|
protected readonly geometricVariation!: string;
|
|
71
71
|
|
|
72
72
|
public static defineGeometricVariations(geometricVariationsNames: ReadonlyArray<string>): typeof Badge {
|
|
73
|
-
return
|
|
73
|
+
return YDF_ComponentsCoordinator.defineGeometricVariations(geometricVariationsNames, Badge);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
@VueProperty({
|
|
@@ -110,7 +110,7 @@ class Badge extends VueComponent {
|
|
|
110
110
|
protected readonly decorativeVariation!: string;
|
|
111
111
|
|
|
112
112
|
public static defineDecorativeVariations(decorativeVariationsNames: ReadonlyArray<string>): typeof Badge {
|
|
113
|
-
return
|
|
113
|
+
return YDF_ComponentsCoordinator.defineDecorativeVariations(decorativeVariationsNames, Badge);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
@VueProperty({
|
|
@@ -128,29 +128,29 @@ class Badge extends VueComponent {
|
|
|
128
128
|
protected get rootElementModifierCSS_Classes(): ReadonlyArray<string> {
|
|
129
129
|
return [
|
|
130
130
|
|
|
131
|
-
...
|
|
131
|
+
...YDF_ComponentsCoordinator.addThemeCSS_ClassToArrayIfMust({
|
|
132
132
|
themeValue: this.theme,
|
|
133
133
|
allThemes: Badge.Themes,
|
|
134
134
|
areThemesCSS_ClassesCommon: this.areThemesCSS_ClassesCommon,
|
|
135
135
|
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
136
136
|
}),
|
|
137
137
|
|
|
138
|
-
...
|
|
138
|
+
...YDF_ComponentsCoordinator.addGeometricVariationCSS_ClassToArrayIfMust({
|
|
139
139
|
geometricVariation: this.geometricVariation,
|
|
140
140
|
allGeometricVariations: Badge.GeometricVariations,
|
|
141
141
|
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
142
142
|
}),
|
|
143
143
|
|
|
144
|
-
...
|
|
144
|
+
...YDF_ComponentsCoordinator.
|
|
145
145
|
generateDemandedGeometricModifiersCSS_Classes(Badge.CSS_NAMESPACE, this.geometricModifiers),
|
|
146
146
|
|
|
147
|
-
...
|
|
147
|
+
...YDF_ComponentsCoordinator.addDecorativeVariationCSS_ClassToArrayIfMust({
|
|
148
148
|
decorativeVariation: this.decorativeVariation,
|
|
149
149
|
allDecorativeVariations: Badge.DecorativeVariations,
|
|
150
150
|
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
151
151
|
}),
|
|
152
152
|
|
|
153
|
-
...
|
|
153
|
+
...YDF_ComponentsCoordinator.
|
|
154
154
|
generateDemandedDecorativeModifiersCSS_Classes(Badge.CSS_NAMESPACE, this.decorativeModifiers)
|
|
155
155
|
|
|
156
156
|
];
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
|
|
12
12
|
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
13
13
|
import { isString, isElementOfEnumeration } from "@yamato-daiwa/es-extensions";
|
|
14
|
-
import
|
|
14
|
+
import YDF_ComponentsCoordinator from "../../YDF_ComponentsCoordinator";
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
@VueComponentConfiguration({
|
|
@@ -52,20 +52,20 @@ export default class BadgeLoadingPlaceholder extends VueComponent {
|
|
|
52
52
|
protected get rootElementModifierCSS_Classes(): ReadonlyArray<string> {
|
|
53
53
|
return [
|
|
54
54
|
|
|
55
|
-
...
|
|
55
|
+
...YDF_ComponentsCoordinator.addThemeCSS_ClassToArrayIfMust({
|
|
56
56
|
themeValue: this.theme,
|
|
57
57
|
allThemes: Badge.Themes,
|
|
58
58
|
areThemesCSS_ClassesCommon: this.areThemesCSS_ClassesCommon,
|
|
59
59
|
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
60
60
|
}),
|
|
61
61
|
|
|
62
|
-
...
|
|
62
|
+
...YDF_ComponentsCoordinator.addGeometricVariationCSS_ClassToArrayIfMust({
|
|
63
63
|
geometricVariation: this.geometricVariation,
|
|
64
64
|
allGeometricVariations: Badge.GeometricVariations,
|
|
65
65
|
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
66
66
|
}),
|
|
67
67
|
|
|
68
|
-
...
|
|
68
|
+
...YDF_ComponentsCoordinator.
|
|
69
69
|
generateDemandedGeometricModifiersCSS_Classes(Badge.CSS_NAMESPACE, this.geometricModifiers)
|
|
70
70
|
|
|
71
71
|
];
|
|
@@ -3,7 +3,7 @@ button.Button--YDF(
|
|
|
3
3
|
:type="typeAttributeValueOfButtonOrInputElement"
|
|
4
4
|
:disabled="disabled"
|
|
5
5
|
:aria-label="accessibilityGuidance"
|
|
6
|
-
:aria-pressed="toggled
|
|
6
|
+
:aria-pressed="toggled"
|
|
7
7
|
:class="rootElementModifierCSS_Classes"
|
|
8
8
|
@click.prevent="() => {}"
|
|
9
9
|
)
|
|
@@ -25,7 +25,6 @@ component.Button--YDF(
|
|
|
25
25
|
:tabindex="disabled && -1"
|
|
26
26
|
:aria-label="accessibilityGuidance"
|
|
27
27
|
:aria-disabled="disabled"
|
|
28
|
-
:aria-pressed="toggled ? 'true' : undefined"
|
|
29
28
|
:class="rootElementModifierCSS_Classes"
|
|
30
29
|
)
|
|
31
30
|
|
|
@@ -41,13 +40,12 @@ component.Button--YDF(
|
|
|
41
40
|
|
|
42
41
|
a.Button--YDF(
|
|
43
42
|
v-else-if="isAnchorTheTagNameOfRootElement"
|
|
44
|
-
:href="disabled ?
|
|
45
|
-
:target="
|
|
46
|
-
rel="
|
|
43
|
+
:href="disabled ? null : externalURI"
|
|
44
|
+
:target="mustOpenLinkInNewTab ? '_self' : '_blank'"
|
|
45
|
+
:rel="relAttributeValueOfAnchorElement"
|
|
47
46
|
:tabindex="disabled && -1"
|
|
48
47
|
:aria-label="accessibilityGuidance"
|
|
49
48
|
:aria-disabled="disabled"
|
|
50
|
-
:aria-pressed="toggled ? 'true' : undefined"
|
|
51
49
|
:class="rootElementModifierCSS_Classes"
|
|
52
50
|
)
|
|
53
51
|
|
|
@@ -66,7 +64,7 @@ input.Button--YDF(
|
|
|
66
64
|
:type="typeAttributeValueOfButtonOrInputElement"
|
|
67
65
|
:value="label"
|
|
68
66
|
:disabled="disabled"
|
|
69
|
-
:aria-pressed="toggled
|
|
67
|
+
:aria-pressed="toggled"
|
|
70
68
|
:class="rootElementModifierCSS_Classes"
|
|
71
69
|
@click.prevent="() => {}"
|
|
72
70
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* ─── Assets ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
2
|
-
import
|
|
2
|
+
import componentVueTemplate from "./Button.vue.pug";
|
|
3
3
|
|
|
4
4
|
/* ─── Framework ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
5
5
|
import {
|
|
@@ -7,11 +7,10 @@ import {
|
|
|
7
7
|
Vue as VueComponent,
|
|
8
8
|
Prop as VueProperty
|
|
9
9
|
} from "vue-facing-decorator";
|
|
10
|
-
|
|
11
10
|
import type { RouteLocationRaw as VueRouterRawLocation } from "vue-router";
|
|
12
11
|
|
|
13
12
|
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
14
|
-
import
|
|
13
|
+
import YDF_ComponentsCoordinator from "../../../YDF_ComponentsCoordinator";
|
|
15
14
|
import InvalidVuePropertiesCombinationError from
|
|
16
15
|
"../../../_Errors/InvalidVuePropertiesCombination/InvalidVuePropertiesCombinationError";
|
|
17
16
|
import {
|
|
@@ -21,17 +20,20 @@ import {
|
|
|
21
20
|
isNonEmptyString,
|
|
22
21
|
isEitherUndefinedOrNull,
|
|
23
22
|
isNeitherUndefinedNorNull,
|
|
24
|
-
isElementOfEnumeration
|
|
23
|
+
isElementOfEnumeration,
|
|
24
|
+
isArbitraryObject,
|
|
25
|
+
emptyStringToNull,
|
|
26
|
+
type ElementOfPseudoEnumeration
|
|
25
27
|
} from "@yamato-daiwa/es-extensions";
|
|
26
|
-
import type { ElementOfPseudoEnumeration } from "@yamato-daiwa/es-extensions";
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
@VueComponentConfiguration({
|
|
30
31
|
name: Button.CSS_NAMESPACE,
|
|
31
|
-
template:
|
|
32
|
+
template: componentVueTemplate
|
|
32
33
|
})
|
|
33
34
|
class Button extends VueComponent {
|
|
34
35
|
|
|
36
|
+
/* ━━━ Static Fields ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
35
37
|
public static CSS_NAMESPACE: string = "Button--YDF";
|
|
36
38
|
|
|
37
39
|
public static HTML_Types: Button.HTML_Types = {
|
|
@@ -42,8 +44,16 @@ class Button extends VueComponent {
|
|
|
42
44
|
inputReset: "INPUT_RESET"
|
|
43
45
|
};
|
|
44
46
|
|
|
47
|
+
|
|
48
|
+
/* ━━━ Non-reactive Instance Fields ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
45
49
|
protected IS_NUXT!: boolean;
|
|
46
50
|
|
|
51
|
+
private initializeNonReactiveClassFields(): void {
|
|
52
|
+
this.IS_NUXT = "$nuxt" in window;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
/* ━━━ Common Properties ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
47
57
|
@VueProperty({
|
|
48
58
|
type: String,
|
|
49
59
|
default: Button.HTML_Types.regular,
|
|
@@ -51,21 +61,30 @@ class Button extends VueComponent {
|
|
|
51
61
|
})
|
|
52
62
|
protected readonly HTML_Type!: ElementOfPseudoEnumeration<Button.HTML_Types>;
|
|
53
63
|
|
|
54
|
-
|
|
64
|
+
|
|
65
|
+
/* ─── Textings ─────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
66
|
+
@VueProperty({ validator: (value: unknown): boolean => isNonEmptyString(value) || isNumber(value) })
|
|
55
67
|
protected readonly label?: string | number | null;
|
|
56
68
|
|
|
57
|
-
@VueProperty({
|
|
69
|
+
@VueProperty({ validator: isNonEmptyString })
|
|
58
70
|
protected readonly accessibilityGuidance?: string | null;
|
|
59
71
|
|
|
60
|
-
|
|
72
|
+
|
|
73
|
+
/* ─── Links ────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
74
|
+
@VueProperty({ validator: (value: unknown): boolean => isNonEmptyString(value) || isArbitraryObject(value) })
|
|
61
75
|
protected readonly route?: VueRouterRawLocation | null;
|
|
62
76
|
|
|
63
|
-
@VueProperty({
|
|
77
|
+
@VueProperty({ validator: isNonEmptyString })
|
|
64
78
|
protected readonly externalURI?: string | null;
|
|
65
79
|
|
|
66
80
|
@VueProperty({ type: Boolean, default: false })
|
|
67
|
-
protected readonly
|
|
81
|
+
protected readonly mustOpenLinkInNewTab!: boolean;
|
|
68
82
|
|
|
83
|
+
@VueProperty({ type: Boolean, default: false })
|
|
84
|
+
protected readonly mustRequestNotFollowLinkForCrawlingToSearchEngine!: boolean;
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
/* ─── Status ───────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
69
88
|
@VueProperty({ type: Boolean, default: false })
|
|
70
89
|
protected readonly disabled!: boolean;
|
|
71
90
|
|
|
@@ -84,14 +103,13 @@ class Button extends VueComponent {
|
|
|
84
103
|
protected readonly theme!: string;
|
|
85
104
|
|
|
86
105
|
public static defineThemes(themesNames: ReadonlyArray<string>): typeof Button {
|
|
87
|
-
return
|
|
106
|
+
return YDF_ComponentsCoordinator.defineThemes(themesNames, Button);
|
|
88
107
|
}
|
|
89
108
|
|
|
90
|
-
public static areThemesCSS_ClassesCommon: boolean =
|
|
109
|
+
public static areThemesCSS_ClassesCommon: boolean = YDF_ComponentsCoordinator.areThemesCSS_ClassesCommon;
|
|
91
110
|
|
|
92
|
-
public static considerThemesAsCommon():
|
|
111
|
+
public static considerThemesAsCommon(): void {
|
|
93
112
|
Button.areThemesCSS_ClassesCommon = true;
|
|
94
|
-
return Button;
|
|
95
113
|
}
|
|
96
114
|
|
|
97
115
|
@VueProperty({ type: Boolean, default: Button.areThemesCSS_ClassesCommon })
|
|
@@ -113,7 +131,7 @@ class Button extends VueComponent {
|
|
|
113
131
|
protected readonly geometricVariation!: string;
|
|
114
132
|
|
|
115
133
|
public static defineGeometricVariations(geometricVariationsNames: ReadonlyArray<string>): typeof Button {
|
|
116
|
-
return
|
|
134
|
+
return YDF_ComponentsCoordinator.defineGeometricVariations(geometricVariationsNames, Button);
|
|
117
135
|
}
|
|
118
136
|
|
|
119
137
|
@VueProperty({
|
|
@@ -131,6 +149,7 @@ class Button extends VueComponent {
|
|
|
131
149
|
public static readonly DecorativeVariations: Button.DecorativeVariations = {
|
|
132
150
|
regular: "REGULAR",
|
|
133
151
|
accented: "ACCENTED",
|
|
152
|
+
danger: "DANGER",
|
|
134
153
|
linkLike: "LINK_LIKE"
|
|
135
154
|
};
|
|
136
155
|
|
|
@@ -142,7 +161,7 @@ class Button extends VueComponent {
|
|
|
142
161
|
protected readonly decorativeVariation!: string;
|
|
143
162
|
|
|
144
163
|
public static defineDecorativeVariations(decorativeVariationsNames: ReadonlyArray<string>): typeof Button {
|
|
145
|
-
return
|
|
164
|
+
return YDF_ComponentsCoordinator.defineDecorativeVariations(decorativeVariationsNames, Button);
|
|
146
165
|
}
|
|
147
166
|
|
|
148
167
|
|
|
@@ -173,7 +192,7 @@ class Button extends VueComponent {
|
|
|
173
192
|
vueComponentName: Button.name,
|
|
174
193
|
messageSpecificPart:
|
|
175
194
|
"When button has HTML type \"inputButton\", \"inputSubmit\" or \"inputReset\", the \"label\" property " +
|
|
176
|
-
|
|
195
|
+
"must be specified with non-empty string of number."
|
|
177
196
|
}),
|
|
178
197
|
title: InvalidVuePropertiesCombinationError.localization.defaultTitle,
|
|
179
198
|
occurrenceLocation: `${ Button.name }.created()`
|
|
@@ -230,6 +249,15 @@ class Button extends VueComponent {
|
|
|
230
249
|
|
|
231
250
|
}
|
|
232
251
|
|
|
252
|
+
protected get relAttributeValueOfAnchorElement(): string | null {
|
|
253
|
+
return emptyStringToNull(
|
|
254
|
+
[
|
|
255
|
+
...this.mustOpenLinkInNewTab ? [ "noopener", "noreferrer" ] : [],
|
|
256
|
+
...this.mustRequestNotFollowLinkForCrawlingToSearchEngine ? [ "nofollow" ] : []
|
|
257
|
+
].join(" ")
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
|
|
233
261
|
|
|
234
262
|
/* ━━━ CSS Classes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
235
263
|
protected get rootElementModifierCSS_Classes(): ReadonlyArray<string> {
|
|
@@ -238,39 +266,34 @@ class Button extends VueComponent {
|
|
|
238
266
|
...(this.isAnchorTheTagNameOfRootElement || this.isRouterLinkTheRootElement) && this.disabled ?
|
|
239
267
|
[ `${ Button.CSS_NAMESPACE }__DisabledState` ] : [],
|
|
240
268
|
|
|
241
|
-
...
|
|
269
|
+
...YDF_ComponentsCoordinator.addThemeCSS_ClassToArrayIfMust({
|
|
242
270
|
themeValue: this.theme,
|
|
243
271
|
allThemes: Button.Themes,
|
|
244
272
|
areThemesCSS_ClassesCommon: this.areThemesCSS_ClassesCommon,
|
|
245
273
|
CSS_Namespace: Button.CSS_NAMESPACE
|
|
246
274
|
}),
|
|
247
275
|
|
|
248
|
-
...
|
|
276
|
+
...YDF_ComponentsCoordinator.addGeometricVariationCSS_ClassToArrayIfMust({
|
|
249
277
|
geometricVariation: this.geometricVariation,
|
|
250
278
|
allGeometricVariations: Button.GeometricVariations,
|
|
251
279
|
CSS_Namespace: Button.CSS_NAMESPACE
|
|
252
280
|
}),
|
|
253
281
|
|
|
254
|
-
...
|
|
282
|
+
...YDF_ComponentsCoordinator.
|
|
255
283
|
generateDemandedGeometricModifiersCSS_Classes(Button.CSS_NAMESPACE, this.geometricModifiers),
|
|
256
284
|
|
|
257
|
-
...
|
|
285
|
+
...YDF_ComponentsCoordinator.addDecorativeVariationCSS_ClassToArrayIfMust({
|
|
258
286
|
decorativeVariation: this.decorativeVariation,
|
|
259
287
|
allDecorativeVariations: Button.DecorativeVariations,
|
|
260
288
|
CSS_Namespace: Button.CSS_NAMESPACE
|
|
261
289
|
}),
|
|
262
290
|
|
|
263
|
-
...
|
|
291
|
+
...YDF_ComponentsCoordinator.
|
|
264
292
|
generateDemandedDecorativeModifiersCSS_Classes(Button.CSS_NAMESPACE, this.decorativeModifiers)
|
|
265
293
|
|
|
266
294
|
];
|
|
267
295
|
}
|
|
268
296
|
|
|
269
|
-
|
|
270
|
-
private initializeNonReactiveClassFields(): void {
|
|
271
|
-
this.IS_NUXT = "$nuxt" in window;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
297
|
}
|
|
275
298
|
|
|
276
299
|
|
|
@@ -302,19 +325,25 @@ namespace Button {
|
|
|
302
325
|
squareShapeUnlessOverflowed = "SQUARE_SHAPE_UNLESS_OVERFLOWED",
|
|
303
326
|
singleLine = "SINGLE_LINE",
|
|
304
327
|
noLeftBorderAndRoundings = "NO_LEFT_BORDER_AND_ROUNDINGS",
|
|
305
|
-
noRightBorderAndRoundings = "NO_RIGHT_BORDER_AND_ROUNDINGS"
|
|
328
|
+
noRightBorderAndRoundings = "NO_RIGHT_BORDER_AND_ROUNDINGS",
|
|
329
|
+
noTopBorderAndRoundings = "NO_TOP_BORDER_AND_ROUNDINGS",
|
|
330
|
+
noBottomBorderAndRoundings = "NO_BOTTOM_BORDER_AND_ROUNDINGS",
|
|
331
|
+
noRoundings = "NO_ROUNDINGS",
|
|
332
|
+
horizontallyShrinkable = "HORIZONTALLY_SHRINKABLE"
|
|
306
333
|
}
|
|
307
334
|
|
|
308
335
|
export type DecorativeVariations = {
|
|
309
336
|
readonly regular: "REGULAR";
|
|
310
337
|
readonly accented: "ACCENTED";
|
|
338
|
+
readonly danger: "DANGER";
|
|
311
339
|
readonly linkLike: "LINK_LIKE";
|
|
312
340
|
[variationName: string]: string;
|
|
313
341
|
};
|
|
314
342
|
|
|
315
343
|
export enum DecorativeModifiers {
|
|
316
344
|
bordersDisguising = "BORDERS_DISGUISING",
|
|
317
|
-
noBackground = "NO_BACKGROUND"
|
|
345
|
+
noBackground = "NO_BACKGROUND",
|
|
346
|
+
noBackgroundInDefaultState = "NO_BACKGROUND_IN_DEFAULT_STATE"
|
|
318
347
|
}
|
|
319
348
|
|
|
320
349
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* ─── Assets ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
2
2
|
import Button from "../Button.vue";
|
|
3
|
-
import
|
|
3
|
+
import componentVueTemplate from "./Button-LoadingPlaceholder.vue.pug";
|
|
4
4
|
|
|
5
5
|
/* ─── Framework ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
6
6
|
import {
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
|
|
12
12
|
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
13
13
|
import { isString, isElementOfEnumeration } from "@yamato-daiwa/es-extensions";
|
|
14
|
-
import
|
|
14
|
+
import YDF_ComponentsCoordinator from "../../../../YDF_ComponentsCoordinator";
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
@VueComponentConfiguration({
|
|
18
18
|
name: "Button--YDF-LoadingPlaceholder",
|
|
19
|
-
template:
|
|
19
|
+
template: componentVueTemplate
|
|
20
20
|
})
|
|
21
21
|
export default class ButtonLoadingPlaceholder extends VueComponent {
|
|
22
22
|
|
|
@@ -30,12 +30,13 @@ export default class ButtonLoadingPlaceholder extends VueComponent {
|
|
|
30
30
|
@VueProperty({ type: Boolean, default: Button.areThemesCSS_ClassesCommon })
|
|
31
31
|
protected readonly areThemesCSS_ClassesCommon!: boolean;
|
|
32
32
|
|
|
33
|
+
|
|
33
34
|
@VueProperty({
|
|
34
35
|
type: String,
|
|
35
36
|
default: Button.GeometricVariations.regular,
|
|
36
37
|
validator: (rawValue: string): boolean => isElementOfEnumeration(rawValue, Button.GeometricVariations)
|
|
37
38
|
})
|
|
38
|
-
protected readonly
|
|
39
|
+
protected readonly geometricVariation!: string;
|
|
39
40
|
|
|
40
41
|
@VueProperty({
|
|
41
42
|
type: Array,
|
|
@@ -51,20 +52,20 @@ export default class ButtonLoadingPlaceholder extends VueComponent {
|
|
|
51
52
|
protected get rootElementModifierCSS_Classes(): ReadonlyArray<string> {
|
|
52
53
|
return [
|
|
53
54
|
|
|
54
|
-
...
|
|
55
|
+
...YDF_ComponentsCoordinator.addThemeCSS_ClassToArrayIfMust({
|
|
55
56
|
themeValue: this.theme,
|
|
56
57
|
allThemes: Button.Themes,
|
|
57
58
|
areThemesCSS_ClassesCommon: this.areThemesCSS_ClassesCommon,
|
|
58
59
|
CSS_Namespace: Button.CSS_NAMESPACE
|
|
59
60
|
}),
|
|
60
61
|
|
|
61
|
-
...
|
|
62
|
-
geometricVariation: this.
|
|
62
|
+
...YDF_ComponentsCoordinator.addGeometricVariationCSS_ClassToArrayIfMust({
|
|
63
|
+
geometricVariation: this.geometricVariation,
|
|
63
64
|
allGeometricVariations: Button.GeometricVariations,
|
|
64
65
|
CSS_Namespace: Button.CSS_NAMESPACE
|
|
65
66
|
}),
|
|
66
67
|
|
|
67
|
-
...
|
|
68
|
+
...YDF_ComponentsCoordinator.
|
|
68
69
|
generateDemandedGeometricModifiersCSS_Classes(Button.CSS_NAMESPACE, this.geometricModifiers)
|
|
69
70
|
|
|
70
71
|
];
|
package/Source/GUI_Components/Controls/ValidatableControlShell/ValidatableControlShell.vue.pug
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
.ValidatableControlShell--YDF(
|
|
2
|
+
:class="rootElementModifierCSS_Classes"
|
|
3
|
+
)
|
|
4
|
+
|
|
5
|
+
.ValidatableControlShell--YDF-Header(
|
|
6
|
+
v-if="mustDisplayHeader"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
label.ValidatableControlShell--YDF-Label(
|
|
10
|
+
v-if="label"
|
|
11
|
+
:for="coreElementHTML_ID"
|
|
12
|
+
:id="labelElementHTML_ID"
|
|
13
|
+
) {{ label }}
|
|
14
|
+
|
|
15
|
+
span.ValidatableControlShell--YDF-Badge.ValidatableControlShell--YDF-Badge__RequiredInput(
|
|
16
|
+
v-if="mustDisplayRequiredInputBadge"
|
|
17
|
+
) {{ localization.requirementBadges.required }}
|
|
18
|
+
|
|
19
|
+
span.ValidatableControlShell--YDF-Badge.ValidatableControlShell--YDF-Badge__OptionalInput(
|
|
20
|
+
v-else-if="mustDisplayOptionalInputBadge"
|
|
21
|
+
) {{ localization.requirementBadges.optional }}
|
|
22
|
+
|
|
23
|
+
span.ValidatableControlShell--YDF-Badge.ValidatableControlShell--YDF-Badge__Invisible(
|
|
24
|
+
v-else-if="mustAddInvisibleBadgeForHeightEqualizingWhenNoBadge"
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
p.ValidatableControlShell--YDF-Guidance(
|
|
29
|
+
v-if="guidance"
|
|
30
|
+
v-html="guidance"
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
.ValidatableControlShell--YDF-MainSlotCustomizableWrapper(
|
|
35
|
+
:class="mainSlotWrapperAdditionalCSS_Classes"
|
|
36
|
+
): slot
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
//-
|
|
40
|
+
VerticallySlidingAlwaysMountedContainer.ValidatableControlShell--YDF-ValidationErrorsMessagesList(
|
|
41
|
+
v-model="isDisplaying"
|
|
42
|
+
expanded="invalidInputHighlightingIfAnyValidationErrorsMessages && validationErrorsMessagesCopyForAnimating.length > 0"
|
|
43
|
+
HTML_Tag="ul"
|
|
44
|
+
mustAnimateHeightWhenContentsAreChanged="true"
|
|
45
|
+
animationDuration__seconds="VALIDATION_ERRORS_MESSAGES_ANIMATION_DURATION__SECONDS"
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
li.ValidatableControlShell--YDF-ValidationErrorMessage(
|
|
49
|
+
v-for="validationErrorMessage of validationErrorsMessagesCopyForAnimating"
|
|
50
|
+
key="`VALIDATION_ERROR_MESSAGE-${ validationErrorMessage }`"
|
|
51
|
+
) {{ validationErrorMessage }}
|