@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
|
@@ -2,6 +2,10 @@
|
|
|
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="
|
|
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>
|
|
6
10
|
</profile>
|
|
7
11
|
</component>
|
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ npm i @yamato-daiwa/frontend-vue @yamato-daiwa/frontend@2.0.0-beta.10
|
|
|
18
18
|
|
|
19
19
|
+ **@yamato-daiwa/frontend**: 2.0.0-beta.10
|
|
20
20
|
+ **vue**: ~3.5.0
|
|
21
|
+
+ **vue-facing-decorator**: ~3.0.0
|
|
21
22
|
+ **vue-router**: ~4.5.0
|
|
22
23
|
|
|
23
24
|
|
|
@@ -32,3 +33,7 @@ npm i @yamato-daiwa/frontend-vue @yamato-daiwa/frontend@2.0.0-beta.10
|
|
|
32
33
|
|
|
33
34
|
+ Buttons
|
|
34
35
|
+ [Plain (Button)](https://frontend.yamato-daiwa.com/AdaptationsToFrameworks/Vue/GUI_Components/Children/Controls/Buttons/Plain/Button-Vue.english.html)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
#### Validatables
|
|
39
|
+
|
|
@@ -1,30 +1,127 @@
|
|
|
1
1
|
import type { ComponentPublicInstance } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Logger,
|
|
4
|
+
DOM_ElementRetrievingFailedError,
|
|
5
|
+
isUndefined,
|
|
6
|
+
isNotUndefined,
|
|
7
|
+
UnexpectedEventError
|
|
8
|
+
} from "@yamato-daiwa/es-extensions";
|
|
3
9
|
|
|
4
10
|
|
|
5
11
|
export default function getElementByVueReference(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
compoundParameter: Readonly<{
|
|
13
|
+
vueReferenceID: string;
|
|
14
|
+
parentVueComponent: ComponentPublicInstance;
|
|
15
|
+
mustExpectExactlyOneElement: true;
|
|
16
|
+
}>
|
|
17
|
+
): Element;
|
|
18
|
+
|
|
19
|
+
export default function getElementByVueReference(
|
|
20
|
+
compoundParameter: Readonly<{
|
|
21
|
+
vueReferenceID: string;
|
|
22
|
+
parentVueComponent: ComponentPublicInstance;
|
|
23
|
+
mustExpectExactlyOneElement: false;
|
|
24
|
+
}>
|
|
25
|
+
): Element | null;
|
|
26
|
+
|
|
27
|
+
export default function getElementByVueReference<DOM_ElementSubtype extends Element>(
|
|
28
|
+
compoundParameter: Readonly<{
|
|
29
|
+
vueReferenceID: string;
|
|
30
|
+
parentVueComponent: ComponentPublicInstance;
|
|
31
|
+
expectedDOM_ElementSubtype: new () => DOM_ElementSubtype;
|
|
32
|
+
mustExpectExactlyOneElement: true;
|
|
33
|
+
}>
|
|
34
|
+
): DOM_ElementSubtype;
|
|
35
|
+
|
|
36
|
+
export default function getElementByVueReference<DOM_ElementSubtype extends Element>(
|
|
37
|
+
compoundParameter: Readonly<{
|
|
38
|
+
vueReferenceID: string;
|
|
39
|
+
parentVueComponent: ComponentPublicInstance;
|
|
40
|
+
expectedDOM_ElementSubtype: new () => DOM_ElementSubtype;
|
|
41
|
+
mustExpectExactlyOneElement: false;
|
|
42
|
+
}>
|
|
43
|
+
): DOM_ElementSubtype | null;
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
export default function getElementByVueReference<DOM_ElementSubtype extends Element>(
|
|
47
|
+
{
|
|
48
|
+
parentVueComponent,
|
|
49
|
+
vueReferenceID,
|
|
50
|
+
expectedDOM_ElementSubtype,
|
|
51
|
+
mustExpectExactlyOneElement
|
|
52
|
+
}: Readonly<{
|
|
53
|
+
vueReferenceID: string;
|
|
54
|
+
parentVueComponent: ComponentPublicInstance;
|
|
55
|
+
expectedDOM_ElementSubtype?: new () => DOM_ElementSubtype;
|
|
56
|
+
mustExpectExactlyOneElement: boolean;
|
|
57
|
+
}>
|
|
58
|
+
): DOM_ElementSubtype | null {
|
|
9
59
|
|
|
10
60
|
const referenceContent: unknown = parentVueComponent.$refs[vueReferenceID];
|
|
11
61
|
|
|
12
62
|
if (isUndefined(referenceContent)) {
|
|
63
|
+
|
|
64
|
+
if (mustExpectExactlyOneElement) {
|
|
65
|
+
Logger.throwErrorWithFormattedMessage({
|
|
66
|
+
errorInstance: new UnexpectedEventError(
|
|
67
|
+
`Expected that the Vue reference with ID "${ vueReferenceID }" refers to single DOM element while actually ` +
|
|
68
|
+
"no such mounted element."
|
|
69
|
+
),
|
|
70
|
+
title: UnexpectedEventError.localization.defaultTitle,
|
|
71
|
+
occurrenceLocation: "getElementByVueReference(compoundParameter)"
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
return null;
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
if (Array.isArray(referenceContent)) {
|
|
82
|
+
|
|
83
|
+
if (mustExpectExactlyOneElement) {
|
|
84
|
+
Logger.throwErrorWithFormattedMessage({
|
|
85
|
+
errorInstance: new UnexpectedEventError(
|
|
86
|
+
`Expected that the Vue reference with ID "${ vueReferenceID }" refers to single DOM element while actually ` +
|
|
87
|
+
"refers to multiples ones."
|
|
88
|
+
),
|
|
89
|
+
title: UnexpectedEventError.localization.defaultTitle,
|
|
90
|
+
occurrenceLocation: "getElementByVueReference(compoundParameter)"
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
13
95
|
return null;
|
|
96
|
+
|
|
14
97
|
}
|
|
15
98
|
|
|
16
99
|
|
|
17
100
|
if (!(referenceContent instanceof Element)) {
|
|
18
|
-
Logger.
|
|
101
|
+
Logger.throwErrorWithFormattedMessage({
|
|
19
102
|
errorInstance: new DOM_ElementRetrievingFailedError({
|
|
20
|
-
customMessage:
|
|
103
|
+
customMessage:
|
|
104
|
+
`The Vue reference with ID "${ vueReferenceID }" refers to non-empty object while it is not the instance ` +
|
|
105
|
+
"of `Element`."
|
|
21
106
|
}),
|
|
22
|
-
occurrenceLocation: "getElementByVueReference(
|
|
107
|
+
occurrenceLocation: "getElementByVueReference(compoundParameter)",
|
|
23
108
|
title: DOM_ElementRetrievingFailedError.localization.defaultTitle
|
|
24
109
|
});
|
|
25
110
|
}
|
|
26
111
|
|
|
27
112
|
|
|
28
|
-
|
|
113
|
+
if (isNotUndefined(expectedDOM_ElementSubtype) && !(referenceContent instanceof expectedDOM_ElementSubtype)) {
|
|
114
|
+
Logger.throwErrorWithFormattedMessage({
|
|
115
|
+
errorInstance: new UnexpectedEventError(
|
|
116
|
+
`The Vue reference with ID "${ vueReferenceID }" refers instance of \`Element\` but contrary to expectations ` +
|
|
117
|
+
`it is not instance of ${ expectedDOM_ElementSubtype.name }".`
|
|
118
|
+
),
|
|
119
|
+
title: UnexpectedEventError.localization.defaultTitle,
|
|
120
|
+
occurrenceLocation: "getElementByVueReference(compoundParameter)"
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
return null;
|
|
29
126
|
|
|
30
127
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
|
|
3
|
+
VerticallySlidingAlwaysMountedContainer.AdmonitionBlock--YDF(
|
|
4
|
+
v-model="isDisplaying"
|
|
5
|
+
role="alert"
|
|
6
|
+
:class="rootElementModifierCSS_Classes"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
slot(
|
|
10
|
+
v-if="$slots.CustomSVG_Icon"
|
|
11
|
+
name="CustomSVG_Icon"
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
component.AdmonitionBlock--YDF-SVG_Icon(
|
|
15
|
+
v-else-if="hasDefaultSVG_Icon"
|
|
16
|
+
:is="defaultSVG_IconComponentName"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
.AdmonitionBlock--YDF-Title(
|
|
20
|
+
v-if="title"
|
|
21
|
+
id=TITLE_HTML_ID
|
|
22
|
+
) {{ title }}
|
|
23
|
+
|
|
24
|
+
.AdmonitionBlock--YDF-MainContent(
|
|
25
|
+
:aria-labelledby="title ? TITLE_HTML_ID : null"
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<script lang="ts">
|
|
32
|
+
|
|
33
|
+
import { Component as VueComponentConfiguration, toNative as transformToOptionAPI_Component } from "vue-facing-decorator";
|
|
34
|
+
import AdmonitionBlockLogic from "./AdmonitionBlockLogic.vue";
|
|
35
|
+
import { Vue3SlideUpDown as VerticallySlidingAlwaysMountedContainer } from "vue3-slide-up-down";
|
|
36
|
+
import PencilIcon__Circled__Filled from "../../SVG_Icons/Pencil/PencilIcon__Circled__Filled.vue";
|
|
37
|
+
import ExclamationMarkIcon__Circled__Filled
|
|
38
|
+
from "../../SVG_Icons/ExclamationMark/ExclamationMarkIcon__Circled__Filled.vue";
|
|
39
|
+
import ExclamationMarkIcon__Triangled__Filled
|
|
40
|
+
from "../../SVG_Icons/ExclamationMark/ExclamationMarkIcon__Triangled__Filled.vue";
|
|
41
|
+
import CheckmarkIcon__Circled__Filled from "../../SVG_Icons/Checkmark/CheckmarkIcon__Circled__Filled.vue";
|
|
42
|
+
import InfoSignIcon__Circled__Filled from "../../SVG_Icons/InfoSign/InfoSignIcon__Circled__Filled.vue";
|
|
43
|
+
import QuestionMarkIcon__Circled__Filled from "../../SVG_Icons/QuestionMark/QuestionMarkIcon__Circled__Filled.vue";
|
|
44
|
+
import MultiplicationSignIcon__Boxed__Filled
|
|
45
|
+
from "../../SVG_Icons/MultiplicationSign/MultiplicationSignIcon__Boxed__Filled.vue";
|
|
46
|
+
|
|
47
|
+
@VueComponentConfiguration({
|
|
48
|
+
name: AdmonitionBlockLogic.CSS_NAMESPACE,
|
|
49
|
+
components: {
|
|
50
|
+
VerticallySlidingAlwaysMountedContainer,
|
|
51
|
+
PencilIcon__Circled__Filled,
|
|
52
|
+
ExclamationMarkIcon__Circled__Filled,
|
|
53
|
+
ExclamationMarkIcon__Triangled__Filled,
|
|
54
|
+
CheckmarkIcon__Circled__Filled,
|
|
55
|
+
InfoSignIcon__Circled__Filled,
|
|
56
|
+
QuestionMarkIcon__Circled__Filled,
|
|
57
|
+
MultiplicationSignIcon__Boxed__Filled
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
class AdmonitionBlock extends AdmonitionBlockLogic {}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export default AdmonitionBlock.applyStaticMembersToInheritorTransformedToOptionAPI(
|
|
64
|
+
transformToOptionAPI_Component(AdmonitionBlock)
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
</script>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Vue as VueComponent } from "vue-facing-decorator";
|
|
2
|
+
import type { AdmonitionBlockLocalization } from "@yamato-daiwa/frontend";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default class AdmonitionBlock extends VueComponent {
|
|
6
|
+
|
|
7
|
+
public static readonly Themes: AdmonitionBlock.Themes;
|
|
8
|
+
|
|
9
|
+
public static defineThemes(themesNames: ReadonlyArray<string>): typeof AdmonitionBlock;
|
|
10
|
+
|
|
11
|
+
public static readonly GeometricVariations: AdmonitionBlock.GeometricVariations;
|
|
12
|
+
|
|
13
|
+
public static defineGeometricVariations(geometricVariationsNames: ReadonlyArray<string>): typeof AdmonitionBlock;
|
|
14
|
+
|
|
15
|
+
public static readonly DecorativeVariations: AdmonitionBlock.DecorativeVariations;
|
|
16
|
+
|
|
17
|
+
public static defineDecorativeVariations(decorativeVariationsNames: ReadonlyArray<string>): typeof AdmonitionBlock;
|
|
18
|
+
|
|
19
|
+
public static localization: AdmonitionBlockLocalization;
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
export namespace AdmonitionBlock {
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export type Themes = {
|
|
28
|
+
readonly regular: "REGULAR";
|
|
29
|
+
[themeName: string]: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type GeometricVariations = {
|
|
33
|
+
readonly regular: "REGULAR";
|
|
34
|
+
readonly stickyNoteLike: "STICKY_NOTE_LIKE";
|
|
35
|
+
[variationName: string]: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type DecorativeVariations = {
|
|
39
|
+
readonly notice: "NOTICE";
|
|
40
|
+
readonly error: "ERROR";
|
|
41
|
+
readonly warning: "WARNING";
|
|
42
|
+
readonly success: "SUCCESS";
|
|
43
|
+
readonly guidance: "GUIDANCE";
|
|
44
|
+
readonly question: "QUESTION";
|
|
45
|
+
[variationName: string]: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
}
|
package/Source/GUI_Components/AdmonitionBlock/{AdmonitionBlock.vue.ts → AdmonitionBlockLogic.vue.ts}
RENAMED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
/* ─── Assets ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
2
|
-
import componentVueTemplate from "./AdmonitionBlock.vue.pug";
|
|
3
|
-
import PencilIcon__Circled__Filled from "../../SVG_Icons/Pencil/PencilIcon__Circled__Filled.vue";
|
|
4
|
-
import ExclamationMarkIcon__Circled__Filled from "./../../SVG_Icons/ExclamationMark/ExclamationMarkIcon__Circled__Filled.vue";
|
|
5
|
-
import ExclamationMarkIcon__Triangled__Filled from "./../../SVG_Icons/ExclamationMark/ExclamationMarkIcon__Triangled__Filled.vue";
|
|
6
|
-
import CheckmarkIcon__Circled__Filled from "../../SVG_Icons/Checkmark/CheckmarkIcon__Circled__Filled.vue";
|
|
7
|
-
import InfoSignIcon__Circled__Filled from "../../SVG_Icons/InfoSign/InfoSignIcon__Circled__Filled.vue";
|
|
8
|
-
import QuestionMarkIcon__Circled__Filled from "../../SVG_Icons/QuestionMark/QuestionMarkIcon__Circled__Filled.vue";
|
|
9
|
-
import MultiplicationSignIcon__Boxed__Filled from
|
|
10
|
-
"../../SVG_Icons/MultiplicationSign/MultiplicationSignIcon__Boxed__Filled.vue";
|
|
11
2
|
import type { AdmonitionBlockLocalization } from "@yamato-daiwa/frontend";
|
|
12
3
|
import { admonitionBlockYDF_ComponentLocalization__english } from "@yamato-daiwa/frontend";
|
|
13
4
|
|
|
14
|
-
/* ───
|
|
15
|
-
import
|
|
5
|
+
/* ─── Validations ─────────────────────────────────────────────────────────────────────────────────────── */
|
|
6
|
+
import type VuePropertyValidator from "../_VuePropertiesValidators/VuePropertyValidator";
|
|
7
|
+
import ThemeVuePropertyValidator from "../_VuePropertiesValidators/ThemeVuePropertyValidator";
|
|
8
|
+
import BooleanVuePropertyValidator from "../_VuePropertiesValidators/BooleanVuePropertyValidator";
|
|
9
|
+
import NonEmptyStringVuePropertyValidator from "../_VuePropertiesValidators/NonEmptyStringVuePropertyValidator";
|
|
10
|
+
import GeometricVariationVuePropertyValidator from "../_VuePropertiesValidators/GeometricVariationVuePropertyValidator";
|
|
11
|
+
import DecorativeVariationVuePropertyValidator from "../_VuePropertiesValidators/DecorativeVariationVuePropertyValidator";
|
|
12
|
+
import preventNullForOptionalVueProperty from "../_Decorators/preventNullForOptionalVueProperty";
|
|
16
13
|
|
|
17
14
|
/* ─── Framework ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
18
15
|
import {
|
|
@@ -22,22 +19,17 @@ import {
|
|
|
22
19
|
} from "vue-facing-decorator";
|
|
23
20
|
|
|
24
21
|
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
25
|
-
import { isStringOfLength, isElementOfEnumeration } from "@yamato-daiwa/es-extensions";
|
|
26
22
|
import YDF_ComponentsCoordinator from "../YDF_ComponentsCoordinator";
|
|
23
|
+
import AccessibleFromTemplateAsNonReactive from "../_Decorators/AccessibleFromTemplateAsNonReactive";
|
|
24
|
+
import InfoSignIcon__Circled__Filled from "../../SVG_Icons/InfoSign/InfoSignIcon__Circled__Filled.vue";
|
|
25
|
+
import { Vue3SlideUpDown as VerticallySlidingAlwaysMountedContainer } from "vue3-slide-up-down";
|
|
27
26
|
|
|
28
27
|
|
|
29
28
|
@VueComponentConfiguration({
|
|
30
29
|
name: AdmonitionBlock.CSS_NAMESPACE,
|
|
31
|
-
template: componentVueTemplate,
|
|
32
30
|
components: {
|
|
33
|
-
VerticallySlidingAlwaysMountedContainer,
|
|
34
|
-
PencilIcon__Circled__Filled,
|
|
35
|
-
ExclamationMarkIcon__Circled__Filled,
|
|
36
|
-
ExclamationMarkIcon__Triangled__Filled,
|
|
37
|
-
CheckmarkIcon__Circled__Filled,
|
|
38
31
|
InfoSignIcon__Circled__Filled,
|
|
39
|
-
|
|
40
|
-
MultiplicationSignIcon__Boxed__Filled
|
|
32
|
+
VerticallySlidingAlwaysMountedContainer
|
|
41
33
|
}
|
|
42
34
|
})
|
|
43
35
|
class AdmonitionBlock extends VueComponent {
|
|
@@ -46,15 +38,31 @@ class AdmonitionBlock extends VueComponent {
|
|
|
46
38
|
|
|
47
39
|
|
|
48
40
|
@VueProperty({
|
|
49
|
-
type: String,
|
|
50
41
|
required: false,
|
|
51
|
-
validator
|
|
42
|
+
get validator(): VuePropertyValidator {
|
|
43
|
+
return NonEmptyStringVuePropertyValidator({
|
|
44
|
+
propertyName: "title",
|
|
45
|
+
componentName: AdmonitionBlock.CSS_NAMESPACE,
|
|
46
|
+
isPropertyRequired: this.required === true
|
|
47
|
+
});
|
|
48
|
+
}
|
|
52
49
|
})
|
|
53
|
-
|
|
50
|
+
@preventNullForOptionalVueProperty
|
|
51
|
+
protected readonly title?: string;
|
|
54
52
|
|
|
55
53
|
|
|
56
54
|
/* ━━━ Dismissing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
57
|
-
@VueProperty({
|
|
55
|
+
@VueProperty({
|
|
56
|
+
default: false,
|
|
57
|
+
get validator(): VuePropertyValidator {
|
|
58
|
+
return BooleanVuePropertyValidator({
|
|
59
|
+
propertyName: "dismissible",
|
|
60
|
+
componentName: AdmonitionBlock.CSS_NAMESPACE,
|
|
61
|
+
isPropertyRequired: this.required === true
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
@preventNullForOptionalVueProperty
|
|
58
66
|
protected readonly dismissible!: boolean;
|
|
59
67
|
|
|
60
68
|
protected isDisplaying: boolean = true;
|
|
@@ -68,10 +76,10 @@ class AdmonitionBlock extends VueComponent {
|
|
|
68
76
|
public static readonly Themes: AdmonitionBlock.Themes = { regular: "REGULAR" };
|
|
69
77
|
|
|
70
78
|
@VueProperty({
|
|
71
|
-
type: String,
|
|
72
79
|
default: AdmonitionBlock.Themes.regular,
|
|
73
|
-
validator: (
|
|
80
|
+
validator: ThemeVuePropertyValidator(AdmonitionBlock)
|
|
74
81
|
})
|
|
82
|
+
@preventNullForOptionalVueProperty
|
|
75
83
|
protected readonly theme!: string;
|
|
76
84
|
|
|
77
85
|
public static defineThemes(themesNames: ReadonlyArray<string>): typeof AdmonitionBlock {
|
|
@@ -84,7 +92,17 @@ class AdmonitionBlock extends VueComponent {
|
|
|
84
92
|
AdmonitionBlock.areThemesCSS_ClassesCommon = true;
|
|
85
93
|
}
|
|
86
94
|
|
|
87
|
-
@VueProperty({
|
|
95
|
+
@VueProperty({
|
|
96
|
+
default: AdmonitionBlock.areThemesCSS_ClassesCommon,
|
|
97
|
+
get validator(): VuePropertyValidator {
|
|
98
|
+
return BooleanVuePropertyValidator({
|
|
99
|
+
propertyName: "areThemesCSS_ClassesCommon",
|
|
100
|
+
componentName: AdmonitionBlock.CSS_NAMESPACE,
|
|
101
|
+
isPropertyRequired: this.required === true
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
@preventNullForOptionalVueProperty
|
|
88
106
|
protected readonly areThemesCSS_ClassesCommon!: boolean;
|
|
89
107
|
|
|
90
108
|
|
|
@@ -95,10 +113,10 @@ class AdmonitionBlock extends VueComponent {
|
|
|
95
113
|
};
|
|
96
114
|
|
|
97
115
|
@VueProperty({
|
|
98
|
-
type: String,
|
|
99
116
|
default: AdmonitionBlock.GeometricVariations.regular,
|
|
100
|
-
validator: (
|
|
117
|
+
validator: GeometricVariationVuePropertyValidator(AdmonitionBlock)
|
|
101
118
|
})
|
|
119
|
+
@preventNullForOptionalVueProperty
|
|
102
120
|
protected readonly geometricVariation!: string;
|
|
103
121
|
|
|
104
122
|
public static defineGeometricVariations(geometricVariationsNames: ReadonlyArray<string>): typeof AdmonitionBlock {
|
|
@@ -117,9 +135,8 @@ class AdmonitionBlock extends VueComponent {
|
|
|
117
135
|
};
|
|
118
136
|
|
|
119
137
|
@VueProperty({
|
|
120
|
-
type: String,
|
|
121
138
|
required: true,
|
|
122
|
-
validator: (
|
|
139
|
+
validator: DecorativeVariationVuePropertyValidator(AdmonitionBlock)
|
|
123
140
|
})
|
|
124
141
|
protected readonly decorativeVariation!: string;
|
|
125
142
|
|
|
@@ -129,7 +146,17 @@ class AdmonitionBlock extends VueComponent {
|
|
|
129
146
|
|
|
130
147
|
|
|
131
148
|
/* ━━━ SVG Icon ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
132
|
-
@VueProperty({
|
|
149
|
+
@VueProperty({
|
|
150
|
+
default: false,
|
|
151
|
+
get validator(): VuePropertyValidator {
|
|
152
|
+
return BooleanVuePropertyValidator({
|
|
153
|
+
propertyName: "hasDefaultSVG_Icon",
|
|
154
|
+
componentName: AdmonitionBlock.CSS_NAMESPACE,
|
|
155
|
+
isPropertyRequired: this.required === true
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
})
|
|
159
|
+
@preventNullForOptionalVueProperty
|
|
133
160
|
protected readonly hasDefaultSVG_Icon!: boolean;
|
|
134
161
|
|
|
135
162
|
protected get defaultSVG_IconComponentName(): string | null {
|
|
@@ -147,32 +174,21 @@ class AdmonitionBlock extends VueComponent {
|
|
|
147
174
|
|
|
148
175
|
/* ━━━ CSS Classes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
149
176
|
protected get rootElementModifierCSS_Classes(): Array<string> {
|
|
150
|
-
return
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
geometricVariation: this.geometricVariation,
|
|
161
|
-
allGeometricVariations: AdmonitionBlock.GeometricVariations,
|
|
162
|
-
CSS_Namespace: AdmonitionBlock.CSS_NAMESPACE
|
|
163
|
-
}),
|
|
164
|
-
|
|
165
|
-
...YDF_ComponentsCoordinator.addDecorativeVariationCSS_ClassToArrayIfMust({
|
|
166
|
-
decorativeVariation: this.decorativeVariation,
|
|
167
|
-
allDecorativeVariations: AdmonitionBlock.DecorativeVariations,
|
|
168
|
-
CSS_Namespace: AdmonitionBlock.CSS_NAMESPACE
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
];
|
|
177
|
+
return YDF_ComponentsCoordinator.generateRootElementModifierCSS_Classes({
|
|
178
|
+
CSS_Namespace: AdmonitionBlock.CSS_NAMESPACE,
|
|
179
|
+
activeTheme: this.theme,
|
|
180
|
+
allThemes: AdmonitionBlock.Themes,
|
|
181
|
+
areThemesCSS_ClassesCommon: this.areThemesCSS_ClassesCommon,
|
|
182
|
+
activeGeometricVariation: this.geometricVariation,
|
|
183
|
+
allGeometricVariations: AdmonitionBlock.GeometricVariations,
|
|
184
|
+
activeDecorativeVariation: this.decorativeVariation,
|
|
185
|
+
allDecorativeVariations: AdmonitionBlock.DecorativeVariations
|
|
186
|
+
});
|
|
172
187
|
}
|
|
173
188
|
|
|
174
189
|
|
|
175
190
|
/* ━━━ Localization ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
191
|
+
@AccessibleFromTemplateAsNonReactive
|
|
176
192
|
public static localization: AdmonitionBlockLocalization = admonitionBlockYDF_ComponentLocalization__english;
|
|
177
193
|
|
|
178
194
|
|
|
@@ -191,11 +207,19 @@ class AdmonitionBlock extends VueComponent {
|
|
|
191
207
|
protected TITLE_HTML_ID: string = `${ this.INSTANCE_ID }-TITLE`;
|
|
192
208
|
|
|
193
209
|
|
|
194
|
-
/* ━━━
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
210
|
+
/* ━━━ Transforming to Options API ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
211
|
+
public static applyStaticMembersToInheritorTransformedToOptionAPI(inheritedComponent: object): object {
|
|
212
|
+
return Object.defineProperties(
|
|
213
|
+
inheritedComponent,
|
|
214
|
+
{
|
|
215
|
+
Themes: { value: AdmonitionBlock.Themes },
|
|
216
|
+
defineThemes: { value: AdmonitionBlock.defineThemes },
|
|
217
|
+
GeometricVariations: { value: AdmonitionBlock.GeometricVariations },
|
|
218
|
+
defineGeometricVariations: { value: AdmonitionBlock.defineGeometricVariations },
|
|
219
|
+
DecorativeVariations: { value: AdmonitionBlock.DecorativeVariations },
|
|
220
|
+
defineDecorativeVariations: { value: AdmonitionBlock.defineDecorativeVariations }
|
|
221
|
+
}
|
|
222
|
+
);
|
|
199
223
|
}
|
|
200
224
|
|
|
201
225
|
}
|