@yamato-daiwa/frontend-vue 0.0.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.
- package/.idea/.name +1 -0
- package/.idea/Main.iml +12 -0
- package/.idea/file.template.settings.xml +8 -0
- package/.idea/fileTemplates/SVG Icon component.vue +16 -0
- package/.idea/icon.svg +1 -0
- package/.idea/inspectionProfiles/Project_Default.xml +12 -0
- package/.idea/misc.xml +5 -0
- package/.idea/modules.xml +8 -0
- package/.idea/runConfigurations/Generate_TypeScript_Types.xml +12 -0
- package/.idea/runConfigurations/Lint.xml +12 -0
- package/.idea/runConfigurations/Rebuild_Distributable.xml +12 -0
- package/.idea/runConfigurations/Start_Workbenches.xml +12 -0
- package/.idea/vcs.xml +6 -0
- package/.pug-lintrc +4 -0
- package/LICENSE +21 -0
- package/Project.d.ts +10 -0
- package/README.md +21 -0
- package/Source/Functions/Routing/extractVueRouteQueryParameterAsArray.ts +65 -0
- package/Source/Functions/getElementByVueReference.ts +30 -0
- package/Source/GUI_Components/AdmonitionBlock/AdmonitionBlock.vue.pug +43 -0
- package/Source/GUI_Components/AdmonitionBlock/AdmonitionBlock.vue.ts +230 -0
- package/Source/GUI_Components/Badge/Badge.vue.pug +12 -0
- package/Source/GUI_Components/Badge/Badge.vue.ts +205 -0
- package/Source/GUI_Components/Badge/LoadingPlaceholder/Badge-LoadingPlaceholder.vue.pug +3 -0
- package/Source/GUI_Components/Badge/LoadingPlaceholder/Badge-LoadingPlaceholder.vue.ts +74 -0
- package/Source/GUI_Components/ComponentsAuxiliaries.ts +124 -0
- package/Source/GUI_Components/Controls/Buttons/Plain/Button.vue.pug +72 -0
- package/Source/GUI_Components/Controls/Buttons/Plain/Button.vue.ts +323 -0
- package/Source/GUI_Components/Controls/Buttons/Plain/LoadingPlaceholder/Button-LoadingPlaceholder.vue.pug +3 -0
- package/Source/GUI_Components/Controls/Buttons/Plain/LoadingPlaceholder/Button-LoadingPlaceholder.vue.ts +73 -0
- package/Source/GUI_Components/Controls/InputtableControl.ts +97 -0
- package/Source/GUI_Components/Controls/ValidatableControl.ts +259 -0
- package/Source/GUI_Components/OverflowSafeSingleLineLabel.vue +25 -0
- package/Source/GUI_Components/ThemesShowcase.vue +118 -0
- package/Source/GUI_Components/_Errors/InvalidVuePropertiesCombination/InvalidVuePropertiesCombinationError.ts +40 -0
- package/Source/GUI_Components/_Errors/InvalidVuePropertiesCombination/InvalidVuePropertiesCombinationErrorLocalization.english.ts +15 -0
- package/Source/GUI_Components/_Errors/VueComponentImplementationHasNotBeenSet/VueComponentImplementationHasNotBeenSet.ts +39 -0
- package/Source/GUI_Components/_Errors/VueComponentImplementationHasNotBeenSet/VueComponentImplementationHasNotBeenSetErrorLocalization.english.ts +17 -0
- package/Source/GUI_Components/_Errors/VueComponentNotFound/VueComponentNotFoundError.ts +46 -0
- package/Source/GUI_Components/_Errors/VueComponentNotFound/VueComponentNotFoundErrorLocalization.english.ts +22 -0
- package/Source/SVG_Icons/Achievement/AchievementIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Achievement/AchievementIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/Bell/BellIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Bracket/CurlyBracketIcon__Closing.vue +16 -0
- package/Source/SVG_Icons/Bracket/CurlyBracketIcon__Opening.vue +16 -0
- package/Source/SVG_Icons/Bracket/RoundBracketIcon__Closing.vue +16 -0
- package/Source/SVG_Icons/Bracket/RoundBracketIcon__Opening.vue +16 -0
- package/Source/SVG_Icons/Bracket/SquareBracketIcon__Closing.vue +16 -0
- package/Source/SVG_Icons/Bracket/SquareBracketIcon__Opening.vue +16 -0
- package/Source/SVG_Icons/Calendar/CalendarIcon.vue +16 -0
- package/Source/SVG_Icons/Calendar/CalendarIcon__Date.vue +16 -0
- package/Source/SVG_Icons/Calendar/CalendarIcon__Repeat.vue +16 -0
- package/Source/SVG_Icons/Calendar/CalendarIcon__Time.vue +16 -0
- package/Source/SVG_Icons/Checkmark/CheckboxIcon__Checked.vue +16 -0
- package/Source/SVG_Icons/Checkmark/CheckboxIcon__Unchecked.vue +16 -0
- package/Source/SVG_Icons/Checkmark/CheckmarkIcon__Circled__Filled.vue +16 -0
- package/Source/SVG_Icons/Checkmark/CheckmarkIcon__Circled__Outlined.vue +16 -0
- package/Source/SVG_Icons/Chevron/ChevronIcon__Downward.vue +16 -0
- package/Source/SVG_Icons/Chevron/ChevronIcon__Leftward.vue +16 -0
- package/Source/SVG_Icons/Chevron/ChevronIcon__Rightward.vue +16 -0
- package/Source/SVG_Icons/Chevron/ChevronIcon__Upward.vue +16 -0
- package/Source/SVG_Icons/Comment/CommentIcon__Dots__Filled.vue +16 -0
- package/Source/SVG_Icons/Comment/CommentIcon__Dots__Outlined.vue +16 -0
- package/Source/SVG_Icons/Comment/CommentIcon__Lines__Filled.vue +16 -0
- package/Source/SVG_Icons/Comment/CommentIcon__Lines__Outlined.vue +16 -0
- package/Source/SVG_Icons/Comment/CommentIcon__Minus__Filled.vue +16 -0
- package/Source/SVG_Icons/Comment/CommentIcon__Minus__Outlined.vue +16 -0
- package/Source/SVG_Icons/Comment/CommentIcon__Pen__Filled.vue +16 -0
- package/Source/SVG_Icons/Comment/CommentIcon__Pen__Outlined.vue +16 -0
- package/Source/SVG_Icons/Comment/CommentIcon__Plus__Filled.vue +16 -0
- package/Source/SVG_Icons/Comment/CommentIcon__Plus__Outlined.vue +16 -0
- package/Source/SVG_Icons/Comment/CommentIcon__Qotemark__Filled.vue +16 -0
- package/Source/SVG_Icons/Comment/CommentIcon__Qotemark__Outlined.vue +16 -0
- package/Source/SVG_Icons/ExclamationMark/ExclamationMarkIcon__Circled__Filled.vue +16 -0
- package/Source/SVG_Icons/ExclamationMark/ExclamationMarkIcon__Circled__Outlined.vue +16 -0
- package/Source/SVG_Icons/ExclamationMark/ExclamationMarkIcon__Octagoned__Filled.vue +16 -0
- package/Source/SVG_Icons/ExclamationMark/ExclamationMarkIcon__Octagoned__Outlined.vue +16 -0
- package/Source/SVG_Icons/ExclamationMark/ExclamationMarkIcon__Rectangled__Filled.vue +16 -0
- package/Source/SVG_Icons/ExclamationMark/ExclamationMarkIcon__Rectangled__Outlined.vue +16 -0
- package/Source/SVG_Icons/ExclamationMark/ExclamationMarkIcon__Triangled__Filled.vue +16 -0
- package/Source/SVG_Icons/ExclamationMark/ExclamationMarkIcon__Triangled__Outlined.vue +16 -0
- package/Source/SVG_Icons/Filtering/FilteringIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/Folder/FolderIcon__ExclamationMark__Filled.vue +16 -0
- package/Source/SVG_Icons/Folder/FolderIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Folder/FolderIcon__MultiplicationSign__Filled.vue +16 -0
- package/Source/SVG_Icons/Folder/FolderIcon__Person__Filled.vue +16 -0
- package/Source/SVG_Icons/Folder/FolderIcon__Plus__Filled.vue +16 -0
- package/Source/SVG_Icons/Folder/FolderIcon__Stationery.vue +16 -0
- package/Source/SVG_Icons/HamburgerMenu/HamburgerMenuIcon.vue +7 -0
- package/Source/SVG_Icons/Heart/HeartIcon__Broken__Filled.vue +16 -0
- package/Source/SVG_Icons/Heart/HeartIcon__Broken__Outlined.vue +16 -0
- package/Source/SVG_Icons/Heart/HeartIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Heart/HeartIcon__Half.vue +16 -0
- package/Source/SVG_Icons/Heart/HeartIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/Inbox/InboxIcon.vue +16 -0
- package/Source/SVG_Icons/Inbox/InboxIcon__DownwardArrow.vue +16 -0
- package/Source/SVG_Icons/InfoSign/InfoSignIcon__Circled__Filled.vue +16 -0
- package/Source/SVG_Icons/InfoSign/InfoSignIcon__Circled__Outlined.vue +16 -0
- package/Source/SVG_Icons/Like/LikeIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Like/LikeIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/Like/UnlikeIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Like/UnlikeIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/List/ChecklistIcon.vue +16 -0
- package/Source/SVG_Icons/MagnifyingGlass/MagnifyingGlassIcon.vue +16 -0
- package/Source/SVG_Icons/MagnifyingGlass/ZoomInIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/MagnifyingGlass/ZoomInIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/MagnifyingGlass/ZoomingInIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/MagnifyingGlass/ZoomingOutIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Mail/MailIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Mail/MailIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/MapAndLocation/LocationIcon.vue +16 -0
- package/Source/SVG_Icons/MapAndLocation/LocationIcon__BottomCircle.vue +16 -0
- package/Source/SVG_Icons/MapAndLocation/MapIcon__Clock.vue +16 -0
- package/Source/SVG_Icons/Menu/MenuIcon__ThreeDots__Horizontal.vue +16 -0
- package/Source/SVG_Icons/Menu/MenuIcon__ThreeDots__Horizontal__Circled__Filled.vue +16 -0
- package/Source/SVG_Icons/Menu/MenuIcon__ThreeDots__Horizontal__Circled__Outlined.vue +16 -0
- package/Source/SVG_Icons/Menu/MenuIcon__ThreeDots__Vertical.vue +16 -0
- package/Source/SVG_Icons/Menu/MenuIcon__ThreeDots__Vertical__Circled__Filled.vue +16 -0
- package/Source/SVG_Icons/Menu/MenuIcon__ThreeDots__Vertical__Circled__Outlined.vue +16 -0
- package/Source/SVG_Icons/MultiplicationSign/MultiplicationSignIcon.vue +16 -0
- package/Source/SVG_Icons/MultiplicationSign/MultiplicationSignIcon__Bold.vue +16 -0
- package/Source/SVG_Icons/MultiplicationSign/MultiplicationSignIcon__Boxed__Filled.vue +16 -0
- package/Source/SVG_Icons/MultiplicationSign/MultiplicationSignIcon__Boxed__Outlined.vue +16 -0
- package/Source/SVG_Icons/MultiplicationSign/MultiplicationSignIcon__Octagoned__Filled.vue +16 -0
- package/Source/SVG_Icons/MultiplicationSign/MultiplicationSignIcon__Octagoned__Outlined.vue +16 -0
- package/Source/SVG_Icons/Pencil/PencilIcon__Boxed__Filled.vue +16 -0
- package/Source/SVG_Icons/Pencil/PencilIcon__Boxed__Outlined.vue +16 -0
- package/Source/SVG_Icons/Pencil/PencilIcon__Circled__Filled.vue +16 -0
- package/Source/SVG_Icons/Pencil/PencilIcon__Circled__Outlined.vue +16 -0
- package/Source/SVG_Icons/Pencil/PencilIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Pencil/PencilIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/Pencil/PencilWithLockIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Pencil/PencilWithLockIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/Pencil/PencilWithPlusSignIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Pencil/PencilWithPlusSignIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/Person/PersonIcon__Clock__Rectangled__Filled.vue +16 -0
- package/Source/SVG_Icons/Phone/PhoneIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Phone/PhoneIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/Phone/TelephoneIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/QuestionMark/QuestionMarkIcon__Circled__Filled.vue +16 -0
- package/Source/SVG_Icons/QuestionMark/QuestionMarkIcon__Circled__Outlined.vue +16 -0
- package/Source/SVG_Icons/QuoteMark/QuoteMarkIcon_Upward__Outlined.vue +16 -0
- package/Source/SVG_Icons/QuoteMark/QuoteMarkIcon__Downward__Filled.vue +16 -0
- package/Source/SVG_Icons/QuoteMark/QuoteMarkIcon__Downward__Outlined.vue +16 -0
- package/Source/SVG_Icons/QuoteMark/QuoteMarkIcon__Upward__Filled.vue +16 -0
- package/Source/SVG_Icons/SocialNetworks/FacebookIcon.vue +16 -0
- package/Source/SVG_Icons/SocialNetworks/GoogleIcon.vue +16 -0
- package/Source/SVG_Icons/SocialNetworks/InstagramIcon.vue +16 -0
- package/Source/SVG_Icons/SocialNetworks/LinkedInIcon.vue +16 -0
- package/Source/SVG_Icons/SocialNetworks/RSS_Icon.vue +16 -0
- package/Source/SVG_Icons/SocialNetworks/RedditIcon.vue +16 -0
- package/Source/SVG_Icons/SocialNetworks/SkypeIcon.vue +16 -0
- package/Source/SVG_Icons/SocialNetworks/TwitterIcon.vue +16 -0
- package/Source/SVG_Icons/SocialNetworks/YouTubeIcon.vue +16 -0
- package/Source/SVG_Icons/Star/StarIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/Star/StarIcon__Half.vue +16 -0
- package/Source/SVG_Icons/Star/StarIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/Star/StarIcon__Plus__Filled.vue +16 -0
- package/Source/SVG_Icons/Star/StarIcon__Plus__Outlined.vue +16 -0
- package/Source/SVG_Icons/Timeline/TimelineIcon.vue +16 -0
- package/Source/SVG_Icons/TrashCan/TrashCanIcon__Filled.vue +16 -0
- package/Source/SVG_Icons/TrashCan/TrashCanIcon__Outlined.vue +16 -0
- package/Source/SVG_Icons/Triangle/TriangleIcon__Downward__Circled__Filled.vue +16 -0
- package/Source/SVG_Icons/Triangle/TriangleIcon__Downward__Filled.vue +16 -0
- package/Source/SVG_Icons/Triangle/TriangleIcon__Leftward__Circled__Filled.vue +16 -0
- package/Source/SVG_Icons/Triangle/TriangleIcon__Leftward__Filled.vue +16 -0
- package/Source/SVG_Icons/Triangle/TriangleIcon__Rightward__Circled__Filled.vue +16 -0
- package/Source/SVG_Icons/Triangle/TriangleIcon__Rightward__Filled.vue +16 -0
- package/Source/SVG_Icons/Triangle/TriangleIcon__Upward__Circled__Filled.vue +16 -0
- package/Source/SVG_Icons/Triangle/TriangleIcon__Upward__Filled.vue +16 -0
- package/Source/index.ts +210 -0
- package/Workbenches/Source/GUI_Components/AdmonitionBlock/AdmonitionBlock.workbench.pug +20 -0
- package/Workbenches/Source/GUI_Components/AdmonitionBlock/AdmonitionBlock.workbench.ts +5 -0
- package/Workbenches/Source/GUI_Components/AdmonitionBlock/AdmonitionBlockComponentTestSite.vue +22 -0
- package/Workbenches/Source/GUI_Components/OverflowSafeSingleLineLabel/OverflowSafeSingleLineLabel.workbench.pug +20 -0
- package/Workbenches/Source/GUI_Components/OverflowSafeSingleLineLabel/OverflowSafeSingleLineLabel.workbench.ts +5 -0
- package/Workbenches/Source/GUI_Components/OverflowSafeSingleLineLabel/OverflowSafeSingleLineLabelComponentTestSite.vue +93 -0
- package/Workbenches/Source/Workbenches.pug +41 -0
- package/eslint.config.js +29 -0
- package/package.json +50 -0
- package/tsconfig.declarations.json +4 -0
- package/tsconfig.json +24 -0
- package/yda.config.yaml +120 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/* ─── Assets ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
2
|
+
import componentVueTemplate from "./Badge.vue.pug";
|
|
3
|
+
|
|
4
|
+
/* ─── Framework ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
5
|
+
import {
|
|
6
|
+
ComponentBase as VueComponentConfiguration,
|
|
7
|
+
Vue as VueComponent,
|
|
8
|
+
Prop as VueProperty
|
|
9
|
+
} from "vue-facing-decorator";
|
|
10
|
+
|
|
11
|
+
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
12
|
+
import { isString, isElementOfEnumeration } from "@yamato-daiwa/es-extensions";
|
|
13
|
+
import ComponentsAuxiliaries from "../ComponentsAuxiliaries";
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@VueComponentConfiguration({
|
|
17
|
+
name: Badge.CSS_NAMESPACE,
|
|
18
|
+
template: componentVueTemplate
|
|
19
|
+
})
|
|
20
|
+
class Badge extends VueComponent {
|
|
21
|
+
|
|
22
|
+
public static CSS_NAMESPACE: string = "Badge--YDF";
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@VueProperty({ type: String })
|
|
26
|
+
protected readonly keyLabel?: string | null;
|
|
27
|
+
|
|
28
|
+
@VueProperty({ type: String, required: true })
|
|
29
|
+
protected readonly valueLabel!: string;
|
|
30
|
+
|
|
31
|
+
@VueProperty({ type: String, default: "span" })
|
|
32
|
+
protected readonly rootElementTag!: string;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
/* ━━━ Theming ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
36
|
+
public static readonly Themes: Badge.Themes = { regular: "REGULAR" };
|
|
37
|
+
|
|
38
|
+
@VueProperty({
|
|
39
|
+
type: String,
|
|
40
|
+
default: Badge.Themes.regular,
|
|
41
|
+
validator: (rawValue: string): boolean => isElementOfEnumeration(rawValue, Badge.Themes)
|
|
42
|
+
})
|
|
43
|
+
protected readonly theme!: string;
|
|
44
|
+
|
|
45
|
+
public static defineThemes(themesNames: ReadonlyArray<string>): typeof Badge {
|
|
46
|
+
return ComponentsAuxiliaries.defineThemes(themesNames, Badge);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public static areThemesCSS_ClassesCommon: boolean = ComponentsAuxiliaries.areThemesCSS_ClassesCommon;
|
|
50
|
+
|
|
51
|
+
public static considerThemesAsCommon(): void {
|
|
52
|
+
Badge.areThemesCSS_ClassesCommon = true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@VueProperty({ type: Boolean, default: Badge.areThemesCSS_ClassesCommon })
|
|
56
|
+
protected readonly areThemesCSS_ClassesCommon!: boolean;
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
/* ─── Geometry ─────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
60
|
+
public static readonly GeometricVariations: Badge.GeometricVariations = {
|
|
61
|
+
regular: "REGULAR",
|
|
62
|
+
small: "SMALL"
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
@VueProperty({
|
|
66
|
+
type: String,
|
|
67
|
+
default: Badge.GeometricVariations.regular,
|
|
68
|
+
validator: (rawValue: string): boolean => isElementOfEnumeration(rawValue, Badge.GeometricVariations)
|
|
69
|
+
})
|
|
70
|
+
protected readonly geometricVariation!: string;
|
|
71
|
+
|
|
72
|
+
public static defineGeometricVariations(geometricVariationsNames: ReadonlyArray<string>): typeof Badge {
|
|
73
|
+
return ComponentsAuxiliaries.defineGeometricVariations(geometricVariationsNames, Badge);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@VueProperty({
|
|
77
|
+
type: Array,
|
|
78
|
+
default: (): ReadonlyArray<Badge.GeometricModifiers> => [],
|
|
79
|
+
validator: (rawValue: ReadonlyArray<unknown>): boolean =>
|
|
80
|
+
rawValue.every(
|
|
81
|
+
(element: unknown): boolean => isString(element) && isElementOfEnumeration(element, Badge.GeometricModifiers)
|
|
82
|
+
)
|
|
83
|
+
})
|
|
84
|
+
protected readonly geometricModifiers!: ReadonlyArray<Badge.GeometricModifiers>;
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
/* ─── Decoration ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
88
|
+
public static readonly DecorativeVariations: Badge.DecorativeVariations = {
|
|
89
|
+
veryCatchyBright: "VERY_CATCHY_BRIGHT",
|
|
90
|
+
catchyBright: "CATCHY_BRIGHT",
|
|
91
|
+
modestlyCatchyBright: "MODESTLY_CATCHY_BRIGHT",
|
|
92
|
+
neutralBright: "NEUTRAL_BRIGHT",
|
|
93
|
+
modestlyCalmingBright: "MODESTLY_CALMING_BRIGHT",
|
|
94
|
+
calmingBright: "CALMING_BRIGHT",
|
|
95
|
+
achromaticBright: "ACHROMATIC_BRIGHT",
|
|
96
|
+
veryCatchyPastel: "VERY_CATCHY_PASTEL",
|
|
97
|
+
catchyPastel: "CATCHY_PASTEL",
|
|
98
|
+
modestlyCatchyPastel: "MODESTLY_CATCHY_PASTEL",
|
|
99
|
+
neutralPastel: "NEUTRAL_PASTEL",
|
|
100
|
+
modestlyCalmingPastel: "MODESTLY_CALMING_PASTEL",
|
|
101
|
+
calmingPastel: "CALMING_PASTEL",
|
|
102
|
+
achromaticPastel: "ACHROMATIC_PASTEL"
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
@VueProperty({
|
|
106
|
+
type: String,
|
|
107
|
+
required: true,
|
|
108
|
+
validator: (rawValue: string): boolean => isElementOfEnumeration(rawValue, Badge.DecorativeVariations)
|
|
109
|
+
})
|
|
110
|
+
protected readonly decorativeVariation!: string;
|
|
111
|
+
|
|
112
|
+
public static defineDecorativeVariations(decorativeVariationsNames: ReadonlyArray<string>): typeof Badge {
|
|
113
|
+
return ComponentsAuxiliaries.defineDecorativeVariations(decorativeVariationsNames, Badge);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@VueProperty({
|
|
117
|
+
type: Array,
|
|
118
|
+
default: (): ReadonlyArray<Badge.DecorativeModifiers> => [],
|
|
119
|
+
validator: (rawValue: ReadonlyArray<unknown>): boolean =>
|
|
120
|
+
rawValue.every(
|
|
121
|
+
(element: unknown): boolean => isString(element) && isElementOfEnumeration(element, Badge.DecorativeModifiers)
|
|
122
|
+
)
|
|
123
|
+
})
|
|
124
|
+
protected readonly decorativeModifiers!: ReadonlyArray<Badge.DecorativeModifiers>;
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
/* ━━━ CSS Classes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
128
|
+
protected get rootElementModifierCSS_Classes(): ReadonlyArray<string> {
|
|
129
|
+
return [
|
|
130
|
+
|
|
131
|
+
...ComponentsAuxiliaries.addThemeCSS_ClassToArrayIfMust({
|
|
132
|
+
themeValue: this.theme,
|
|
133
|
+
allThemes: Badge.Themes,
|
|
134
|
+
areThemesCSS_ClassesCommon: this.areThemesCSS_ClassesCommon,
|
|
135
|
+
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
136
|
+
}),
|
|
137
|
+
|
|
138
|
+
...ComponentsAuxiliaries.addGeometricVariationCSS_ClassToArrayIfMust({
|
|
139
|
+
geometricVariation: this.geometricVariation,
|
|
140
|
+
allGeometricVariations: Badge.GeometricVariations,
|
|
141
|
+
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
142
|
+
}),
|
|
143
|
+
|
|
144
|
+
...ComponentsAuxiliaries.
|
|
145
|
+
generateDemandedGeometricModifiersCSS_Classes(Badge.CSS_NAMESPACE, this.geometricModifiers),
|
|
146
|
+
|
|
147
|
+
...ComponentsAuxiliaries.addDecorativeVariationCSS_ClassToArrayIfMust({
|
|
148
|
+
decorativeVariation: this.decorativeVariation,
|
|
149
|
+
allDecorativeVariations: Badge.DecorativeVariations,
|
|
150
|
+
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
151
|
+
}),
|
|
152
|
+
|
|
153
|
+
...ComponentsAuxiliaries.
|
|
154
|
+
generateDemandedDecorativeModifiersCSS_Classes(Badge.CSS_NAMESPACE, this.decorativeModifiers)
|
|
155
|
+
|
|
156
|
+
];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
namespace Badge {
|
|
163
|
+
|
|
164
|
+
export type Themes = {
|
|
165
|
+
readonly regular: "REGULAR";
|
|
166
|
+
[themeName: string]: string;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export type GeometricVariations = {
|
|
170
|
+
readonly regular: "REGULAR";
|
|
171
|
+
[variationName: string]: string;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export enum GeometricModifiers {
|
|
175
|
+
pillShape = "PILL_SHAPE",
|
|
176
|
+
singleLine = "SINGLE_LINE"
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export type DecorativeVariations = {
|
|
180
|
+
readonly veryCatchyBright: "VERY_CATCHY_BRIGHT";
|
|
181
|
+
readonly catchyBright: "CATCHY_BRIGHT";
|
|
182
|
+
readonly modestlyCatchyBright: "MODESTLY_CATCHY_BRIGHT";
|
|
183
|
+
readonly neutralBright: "NEUTRAL_BRIGHT";
|
|
184
|
+
readonly modestlyCalmingBright: "MODESTLY_CALMING_BRIGHT";
|
|
185
|
+
readonly calmingBright: "CALMING_BRIGHT";
|
|
186
|
+
readonly achromaticBright: "ACHROMATIC_BRIGHT";
|
|
187
|
+
readonly veryCatchyPastel: "VERY_CATCHY_PASTEL";
|
|
188
|
+
readonly catchyPastel: "CATCHY_PASTEL";
|
|
189
|
+
readonly modestlyCatchyPastel: "MODESTLY_CATCHY_PASTEL";
|
|
190
|
+
readonly neutralPastel: "NEUTRAL_PASTEL";
|
|
191
|
+
readonly modestlyCalmingPastel: "MODESTLY_CALMING_PASTEL";
|
|
192
|
+
readonly calmingPastel: "CALMING_PASTEL";
|
|
193
|
+
readonly achromaticPastel: "ACHROMATIC_PASTEL";
|
|
194
|
+
[variationName: string]: string;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export enum DecorativeModifiers {
|
|
198
|
+
bordersDisguising = "BORDERS_DISGUISING",
|
|
199
|
+
noBackground = "NO_BACKGROUND"
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
export default Badge;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* ─── Assets ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
2
|
+
import Badge from "../Badge.vue";
|
|
3
|
+
import componentVueTemplate from "./Badge-LoadingPlaceholder.vue.pug";
|
|
4
|
+
|
|
5
|
+
/* ─── Framework ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
6
|
+
import {
|
|
7
|
+
ComponentBase as VueComponentConfiguration,
|
|
8
|
+
Vue as VueComponent,
|
|
9
|
+
Prop as VueProperty
|
|
10
|
+
} from "vue-facing-decorator";
|
|
11
|
+
|
|
12
|
+
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
13
|
+
import { isString, isElementOfEnumeration } from "@yamato-daiwa/es-extensions";
|
|
14
|
+
import ComponentsAuxiliaries from "../../ComponentsAuxiliaries";
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@VueComponentConfiguration({
|
|
18
|
+
name: "Badge--YDF-LoadingPlaceholder",
|
|
19
|
+
template: componentVueTemplate
|
|
20
|
+
})
|
|
21
|
+
export default class BadgeLoadingPlaceholder extends VueComponent {
|
|
22
|
+
|
|
23
|
+
@VueProperty({
|
|
24
|
+
type: String,
|
|
25
|
+
default: Badge.Themes.regular,
|
|
26
|
+
validator: (rawValue: string): boolean => isElementOfEnumeration(rawValue, Badge.Themes)
|
|
27
|
+
})
|
|
28
|
+
protected readonly theme!: string;
|
|
29
|
+
|
|
30
|
+
@VueProperty({ type: Boolean, default: Badge.areThemesCSS_ClassesCommon })
|
|
31
|
+
protected readonly areThemesCSS_ClassesCommon!: boolean;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@VueProperty({
|
|
35
|
+
type: String,
|
|
36
|
+
default: Badge.GeometricVariations.regular,
|
|
37
|
+
validator: (rawValue: string): boolean => isElementOfEnumeration(rawValue, Badge.GeometricVariations)
|
|
38
|
+
})
|
|
39
|
+
protected readonly geometricVariation!: string;
|
|
40
|
+
|
|
41
|
+
@VueProperty({
|
|
42
|
+
type: Array,
|
|
43
|
+
default: (): ReadonlyArray<Badge.GeometricModifiers> => [],
|
|
44
|
+
validator: (rawValue: ReadonlyArray<unknown>): boolean =>
|
|
45
|
+
rawValue.every(
|
|
46
|
+
(element: unknown): boolean => isString(element) && isElementOfEnumeration(element, Badge.GeometricModifiers)
|
|
47
|
+
)
|
|
48
|
+
})
|
|
49
|
+
protected readonly geometricModifiers!: ReadonlyArray<Badge.GeometricModifiers>;
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
protected get rootElementModifierCSS_Classes(): ReadonlyArray<string> {
|
|
53
|
+
return [
|
|
54
|
+
|
|
55
|
+
...ComponentsAuxiliaries.addThemeCSS_ClassToArrayIfMust({
|
|
56
|
+
themeValue: this.theme,
|
|
57
|
+
allThemes: Badge.Themes,
|
|
58
|
+
areThemesCSS_ClassesCommon: this.areThemesCSS_ClassesCommon,
|
|
59
|
+
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
60
|
+
}),
|
|
61
|
+
|
|
62
|
+
...ComponentsAuxiliaries.addGeometricVariationCSS_ClassToArrayIfMust({
|
|
63
|
+
geometricVariation: this.geometricVariation,
|
|
64
|
+
allGeometricVariations: Badge.GeometricVariations,
|
|
65
|
+
CSS_Namespace: Badge.CSS_NAMESPACE
|
|
66
|
+
}),
|
|
67
|
+
|
|
68
|
+
...ComponentsAuxiliaries.
|
|
69
|
+
generateDemandedGeometricModifiersCSS_Classes(Badge.CSS_NAMESPACE, this.geometricModifiers)
|
|
70
|
+
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toUpperCamelCase,
|
|
3
|
+
toLowerCamelCase,
|
|
4
|
+
toScreamingSnakeCase
|
|
5
|
+
} from "@yamato-daiwa/es-extensions";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export default abstract class ComponentsAuxiliaries {
|
|
9
|
+
|
|
10
|
+
public static areThemesCSS_ClassesCommon: boolean = false;
|
|
11
|
+
|
|
12
|
+
public static defineThemes<ComponentClass extends { Themes: { [themeName: string]: string; }; }>(
|
|
13
|
+
themesNames: ReadonlyArray<string>,
|
|
14
|
+
TargetComponentClass: ComponentClass
|
|
15
|
+
): ComponentClass {
|
|
16
|
+
|
|
17
|
+
for (const themeName of themesNames) {
|
|
18
|
+
TargetComponentClass.Themes[toLowerCamelCase(themeName)] = toScreamingSnakeCase(themeName);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return TargetComponentClass;
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public static defineGeometricVariations<
|
|
26
|
+
ComponentClass extends { GeometricVariations: { [decorativeVariationName: string]: string; }; }
|
|
27
|
+
>(
|
|
28
|
+
geometricVariationsNames: ReadonlyArray<string>,
|
|
29
|
+
TargetComponentClass: ComponentClass
|
|
30
|
+
): ComponentClass {
|
|
31
|
+
|
|
32
|
+
for (const geometricVariationName of geometricVariationsNames) {
|
|
33
|
+
TargetComponentClass.GeometricVariations[toLowerCamelCase(geometricVariationName)] =
|
|
34
|
+
toScreamingSnakeCase(geometricVariationName);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return TargetComponentClass;
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public static defineDecorativeVariations<
|
|
42
|
+
ComponentClass extends { DecorativeVariations: { [decorativeVariationName: string]: string; }; }
|
|
43
|
+
>(
|
|
44
|
+
decorativeVariationsNames: ReadonlyArray<string>,
|
|
45
|
+
TargetComponentClass: ComponentClass
|
|
46
|
+
): ComponentClass {
|
|
47
|
+
|
|
48
|
+
for (const decorativeVariationName of decorativeVariationsNames) {
|
|
49
|
+
TargetComponentClass.DecorativeVariations[toLowerCamelCase(decorativeVariationName)] =
|
|
50
|
+
toScreamingSnakeCase(decorativeVariationName);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return TargetComponentClass;
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public static addThemeCSS_ClassToArrayIfMust(
|
|
58
|
+
{
|
|
59
|
+
themeValue,
|
|
60
|
+
allThemes,
|
|
61
|
+
areThemesCSS_ClassesCommon,
|
|
62
|
+
CSS_Namespace
|
|
63
|
+
}: Readonly<{
|
|
64
|
+
themeValue: string;
|
|
65
|
+
allThemes: Readonly<{ [themeKey: string]: string; }>;
|
|
66
|
+
areThemesCSS_ClassesCommon: boolean;
|
|
67
|
+
CSS_Namespace: string;
|
|
68
|
+
}>
|
|
69
|
+
): Array<string> {
|
|
70
|
+
return Object.entries(allThemes).length > 1 && !areThemesCSS_ClassesCommon ?
|
|
71
|
+
[ `${ CSS_Namespace }__${ toUpperCamelCase(themeValue) }Theme` ] : [];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public static addGeometricVariationCSS_ClassToArrayIfMust(
|
|
75
|
+
{
|
|
76
|
+
geometricVariation,
|
|
77
|
+
allGeometricVariations,
|
|
78
|
+
CSS_Namespace
|
|
79
|
+
}: Readonly<{
|
|
80
|
+
geometricVariation: string;
|
|
81
|
+
allGeometricVariations: Readonly<{ [geometricVariationKey: string]: string; }>;
|
|
82
|
+
CSS_Namespace: string;
|
|
83
|
+
}>
|
|
84
|
+
): Array<string> {
|
|
85
|
+
return Object.entries(allGeometricVariations).length > 1 ?
|
|
86
|
+
[ `${ CSS_Namespace }__${ toUpperCamelCase(geometricVariation) }GeometricVariation` ] : [];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public static addDecorativeVariationCSS_ClassToArrayIfMust(
|
|
90
|
+
{
|
|
91
|
+
decorativeVariation,
|
|
92
|
+
allDecorativeVariations,
|
|
93
|
+
CSS_Namespace
|
|
94
|
+
}: Readonly<{
|
|
95
|
+
decorativeVariation: string;
|
|
96
|
+
allDecorativeVariations: Readonly<{ [decorativeVariationKey: string]: string; }>;
|
|
97
|
+
CSS_Namespace: string;
|
|
98
|
+
}>
|
|
99
|
+
): Array<string> {
|
|
100
|
+
return Object.entries(allDecorativeVariations).length > 1 ?
|
|
101
|
+
[ `${ CSS_Namespace }__${ toUpperCamelCase(decorativeVariation) }DecorativeVariation` ] : [];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
public static generateDemandedGeometricModifiersCSS_Classes(
|
|
105
|
+
CSS_Namespace: string,
|
|
106
|
+
demandedGeometricModifiersNames: ReadonlyArray<string>
|
|
107
|
+
): Array<string> {
|
|
108
|
+
return demandedGeometricModifiersNames.map(
|
|
109
|
+
(geometricModifierName: string): string =>
|
|
110
|
+
`${ CSS_Namespace }__${ toUpperCamelCase(geometricModifierName) }GeometricModifier`
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public static generateDemandedDecorativeModifiersCSS_Classes(
|
|
115
|
+
CSS_Namespace: string,
|
|
116
|
+
demandedDecorativeModifiersNames: ReadonlyArray<string>
|
|
117
|
+
): Array<string> {
|
|
118
|
+
return demandedDecorativeModifiersNames.map(
|
|
119
|
+
(decorativeModifierName: string): string =>
|
|
120
|
+
`${ CSS_Namespace }__${ toUpperCamelCase(decorativeModifierName) }DecorativeModifier`
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
button.Button--YDF(
|
|
2
|
+
v-if="isButtonTheTagNameOfRootElement"
|
|
3
|
+
:type="typeAttributeValueOfButtonOrInputElement"
|
|
4
|
+
:disabled="disabled"
|
|
5
|
+
:aria-label="accessibilityGuidance"
|
|
6
|
+
:aria-pressed="toggled ? 'true' : undefined"
|
|
7
|
+
:class="rootElementModifierCSS_Classes"
|
|
8
|
+
@click.prevent="() => {}"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
slot(name="prependedSVG_Icon")
|
|
12
|
+
|
|
13
|
+
span.Button--YDF-Label(
|
|
14
|
+
v-if="label"
|
|
15
|
+
) {{ label }}
|
|
16
|
+
|
|
17
|
+
slot(name="appendedSVG_Icon")
|
|
18
|
+
slot(name="loneSVG_Icon")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
component.Button--YDF(
|
|
22
|
+
v-else-if="isRouterLinkTheRootElement"
|
|
23
|
+
:is="IS_NUXT ? 'NuxtLink' : 'RouterLink'"
|
|
24
|
+
:to="route"
|
|
25
|
+
:tabindex="disabled && -1"
|
|
26
|
+
:aria-label="accessibilityGuidance"
|
|
27
|
+
:aria-disabled="disabled"
|
|
28
|
+
:aria-pressed="toggled ? 'true' : undefined"
|
|
29
|
+
:class="rootElementModifierCSS_Classes"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
slot(name="prependedSVG_Icon")
|
|
33
|
+
|
|
34
|
+
span.Button--YDF-Label(
|
|
35
|
+
v-if="label"
|
|
36
|
+
) {{ label }}
|
|
37
|
+
|
|
38
|
+
slot(name="appendedSVG_Icon")
|
|
39
|
+
slot(name="loneSVG_Icon")
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
a.Button--YDF(
|
|
43
|
+
v-else-if="isAnchorTheTagNameOfRootElement"
|
|
44
|
+
:href="disabled ? undefined : externalURI"
|
|
45
|
+
:target="mustOpenExternalLinkInCurrentTab ? '_self' : '_blank'"
|
|
46
|
+
rel="noopener noreferrer"
|
|
47
|
+
:tabindex="disabled && -1"
|
|
48
|
+
:aria-label="accessibilityGuidance"
|
|
49
|
+
:aria-disabled="disabled"
|
|
50
|
+
:aria-pressed="toggled ? 'true' : undefined"
|
|
51
|
+
:class="rootElementModifierCSS_Classes"
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
slot(name="prependedSVG_Icon")
|
|
55
|
+
|
|
56
|
+
span.Button--YDF-Label(
|
|
57
|
+
v-if="label"
|
|
58
|
+
) {{ label }}
|
|
59
|
+
|
|
60
|
+
slot(name="appendedSVG_Icon")
|
|
61
|
+
slot(name="loneSVG_Icon")
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
input.Button--YDF(
|
|
65
|
+
v-else-if="isInputTheTagNameOfRootElement"
|
|
66
|
+
:type="typeAttributeValueOfButtonOrInputElement"
|
|
67
|
+
:value="label"
|
|
68
|
+
:disabled="disabled"
|
|
69
|
+
:aria-pressed="toggled ? 'true' : undefined"
|
|
70
|
+
:class="rootElementModifierCSS_Classes"
|
|
71
|
+
@click.prevent="() => {}"
|
|
72
|
+
)
|