aloha-vue 1.0.358 → 1.0.360

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.
Files changed (43) hide show
  1. package/docs/package.json +1 -1
  2. package/docs/src/mainTranslation.js +9 -0
  3. package/docs/src/views/PageDropdown/PageDropdown.js +2 -0
  4. package/docs/src/views/PageDropdown/PageDropdown.pug +2 -0
  5. package/docs/src/views/PageDropdown/PageDropdownButtonLoading/PageDropdownButtonLoading.js +41 -0
  6. package/docs/src/views/PageDropdown/PageDropdownButtonLoading/PageDropdownButtonLoading.pug +26 -0
  7. package/docs/src/views/PageDropdown/PageDropdownButtonLoading/PageDropdownButtonLoading.vue +2 -0
  8. package/docs/src/views/PageDropdown/PageDropdownButtonLoading/compositionAPI/HtmlAPI.js +25 -0
  9. package/docs/src/views/PageDropdown/PageDropdownButtonLoading/compositionAPI/JsAPI.js +32 -0
  10. package/docs/src/views/PageDropdown/i18n/de.json +4 -0
  11. package/docs/src/views/PageList/PageList.js +43 -0
  12. package/docs/src/views/PageList/PageList.pug +33 -20
  13. package/docs/src/views/PageList/PageListClassGroup/PageListClassGroup.js +43 -0
  14. package/docs/src/views/PageList/PageListClassGroup/PageListClassGroup.pug +27 -0
  15. package/docs/src/views/PageList/PageListClassGroup/PageListClassGroup.vue +2 -0
  16. package/docs/src/views/PageList/PageListClassGroup/compositionAPI/HtmlAPI.js +17 -0
  17. package/docs/src/views/PageList/PageListClassGroup/compositionAPI/JsAPI.js +34 -0
  18. package/docs/src/views/PageList/compositionAPI/EventsAPI.js +13 -0
  19. package/docs/src/views/PageList/compositionAPI/ExposesAPI.js +18 -0
  20. package/docs/src/views/PageList/compositionAPI/PageTitleAPI.js +24 -0
  21. package/docs/src/views/PageList/compositionAPI/PropsAPI.js +106 -0
  22. package/docs/src/views/PageList/compositionAPI/SlotsAPI.js +12 -0
  23. package/docs/src/views/PageList/i18n/PageListI18n.js +19 -0
  24. package/docs/src/views/PageList/i18n/ar.json +3 -0
  25. package/docs/src/views/PageList/i18n/de.json +3 -0
  26. package/docs/src/views/PageList/i18n/en.json +3 -0
  27. package/docs/src/views/PageList/i18n/es.json +3 -0
  28. package/docs/src/views/PageList/i18n/fr.json +3 -0
  29. package/docs/src/views/PageList/i18n/hr.json +3 -0
  30. package/docs/src/views/PageList/i18n/it.json +3 -0
  31. package/docs/src/views/PageList/i18n/ru.json +3 -0
  32. package/package.json +1 -1
  33. package/src/ATranslation/ATranslation.js +4 -19
  34. package/src/ATranslation/compositionAPI/ATranslationAPI.js +32 -8
  35. package/src/ATranslation/compositionAPI/AriaLabelAPI.js +8 -3
  36. package/src/ATranslation/compositionAPI/HtmlAPI.js +12 -4
  37. package/src/ATranslation/compositionAPI/PlaceholderAPI.js +8 -3
  38. package/src/ATranslation/compositionAPI/TextAPI.js +12 -4
  39. package/src/ATranslation/compositionAPI/TitleAPI.js +12 -4
  40. package/src/ATranslation/compositionAPI/UtilsAPI.js +3 -2
  41. package/src/compositionAPI/APageTabTitleAPI.js +13 -4
  42. package/src/directives/ASafeHtml.js +5 -2
  43. package/src/plugins/AI18nPlugin.js +2 -0
package/docs/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "@popperjs/core": "2.11.8",
15
15
  "axios": "1.4.0",
16
- "aloha-css": "1.0.103",
16
+ "aloha-css": "1.0.110",
17
17
  "dompurify": "3.0.3",
18
18
  "fecha": "4.2.3",
19
19
  "highlight.js": "11.8.0",
@@ -23,6 +23,7 @@ import PageDisclosureI18n from "./views/PageDisclosure/i18n/PageDisclosureI18n";
23
23
  import PageTooltipI18n from "./views/PageTooltip/i18n/PageTooltipI18n";
24
24
  import PageGroupButtonDropdownI18n from "./views/PageGroupButtonDropdown/i18n/PageGroupButtonDropdownI18n";
25
25
  import PageDropdownI18n from "./views/PageDropdown/i18n/PageDropdownI18n";
26
+ import PageListI18n from "./views/PageList/i18n/PageListI18n";
26
27
 
27
28
  export const mainTranslation = {
28
29
  ar: {
@@ -42,6 +43,7 @@ export const mainTranslation = {
42
43
  ...PageTooltipI18n.ar,
43
44
  ...PageGroupButtonDropdownI18n.ar,
44
45
  ...PageDropdownI18n.ar,
46
+ ...PageListI18n.ar,
45
47
  },
46
48
  de: {
47
49
  ...allLanguages.de,
@@ -60,6 +62,7 @@ export const mainTranslation = {
60
62
  ...PageTooltipI18n.de,
61
63
  ...PageGroupButtonDropdownI18n.de,
62
64
  ...PageDropdownI18n.de,
65
+ ...PageListI18n.de,
63
66
  },
64
67
  en: {
65
68
  ...allLanguages.en,
@@ -78,6 +81,7 @@ export const mainTranslation = {
78
81
  ...PageTooltipI18n.en,
79
82
  ...PageGroupButtonDropdownI18n.en,
80
83
  ...PageDropdownI18n.en,
84
+ ...PageListI18n.en,
81
85
  },
82
86
  es: {
83
87
  ...allLanguages.es,
@@ -96,6 +100,7 @@ export const mainTranslation = {
96
100
  ...PageTooltipI18n.es,
97
101
  ...PageGroupButtonDropdownI18n.es,
98
102
  ...PageDropdownI18n.es,
103
+ ...PageListI18n.es,
99
104
  },
100
105
  fr: {
101
106
  ...allLanguages.fr,
@@ -114,6 +119,7 @@ export const mainTranslation = {
114
119
  ...PageTooltipI18n.fr,
115
120
  ...PageGroupButtonDropdownI18n.fr,
116
121
  ...PageDropdownI18n.fr,
122
+ ...PageListI18n.fr,
117
123
  },
118
124
  hr: {
119
125
  ...allLanguages.hr,
@@ -132,6 +138,7 @@ export const mainTranslation = {
132
138
  ...PageTooltipI18n.hr,
133
139
  ...PageGroupButtonDropdownI18n.hr,
134
140
  ...PageDropdownI18n.hr,
141
+ ...PageListI18n.hr,
135
142
  },
136
143
  it: {
137
144
  ...allLanguages.it,
@@ -150,6 +157,7 @@ export const mainTranslation = {
150
157
  ...PageTooltipI18n.it,
151
158
  ...PageGroupButtonDropdownI18n.it,
152
159
  ...PageDropdownI18n.it,
160
+ ...PageListI18n.it,
153
161
  },
154
162
  ru: {
155
163
  ...allLanguages.ru,
@@ -168,5 +176,6 @@ export const mainTranslation = {
168
176
  ...PageTooltipI18n.ru,
169
177
  ...PageGroupButtonDropdownI18n.ru,
170
178
  ...PageDropdownI18n.ru,
179
+ ...PageListI18n.ru,
171
180
  },
172
181
  };
@@ -5,6 +5,7 @@ import ATranslation from "../../../../src/ATranslation/ATranslation";
5
5
  import PageDropdownBasic from "./PageDropdownBasic/PageDropdownBasic.vue";
6
6
  import PageDropdownButtonClass from "./PageDropdownButtonClass/PageDropdownButtonClass.vue";
7
7
  import PageDropdownButtonIcons from "./PageDropdownButtonIcons/PageDropdownButtonIcons.vue";
8
+ import PageDropdownButtonLoading from "./PageDropdownButtonLoading/PageDropdownButtonLoading.vue";
8
9
  import PageDropdownButtonText from "./PageDropdownButtonText/PageDropdownButtonText.vue";
9
10
  import PageDropdownCaretIcon from "./PageDropdownCaretIcon/PageDropdownCaretIcon.vue";
10
11
  import PageDropdownHasCaret from "./PageDropdownHasCaret/PageDropdownHasCaret.vue";
@@ -27,6 +28,7 @@ export default {
27
28
  PageDropdownBasic,
28
29
  PageDropdownButtonClass,
29
30
  PageDropdownButtonIcons,
31
+ PageDropdownButtonLoading,
30
32
  PageDropdownButtonText,
31
33
  PageDropdownCaretIcon,
32
34
  PageDropdownHasCaret,
@@ -17,6 +17,8 @@ aloha-page(
17
17
 
18
18
  page-dropdown-button-icons
19
19
 
20
+ page-dropdown-button-loading
21
+
20
22
  page-dropdown-in-body
21
23
 
22
24
  page-dropdown-triggers
@@ -0,0 +1,41 @@
1
+ import ADropdown from "../../../../../src/ADropdown/ADropdown";
2
+ import AlohaExample from "../../../global/components/AlohaExample/AlohaExample.vue";
3
+
4
+ import HtmlAPI from "./compositionAPI/HtmlAPI";
5
+ import JsAPI from "./compositionAPI/JsAPI";
6
+
7
+ export default {
8
+ name: "PageDropdownButtonLoading",
9
+ components: {
10
+ ADropdown,
11
+ AlohaExample,
12
+ },
13
+ setup() {
14
+ const {
15
+ codeHtml,
16
+ } = HtmlAPI();
17
+
18
+ const {
19
+ codeJs,
20
+ } = JsAPI();
21
+
22
+ const dropdownActions = [
23
+ {
24
+ text: "Actions 0",
25
+ type: "button",
26
+ callback: () => {},
27
+ },
28
+ {
29
+ text: "Actions 1",
30
+ type: "button",
31
+ callback: () => {},
32
+ },
33
+ ];
34
+
35
+ return {
36
+ codeHtml,
37
+ codeJs,
38
+ dropdownActions,
39
+ };
40
+ },
41
+ };
@@ -0,0 +1,26 @@
1
+ aloha-example(
2
+ :code-html="codeHtml"
3
+ :code-js="codeJs"
4
+ header="_A_DROPDOWN_GROUP_BUTTON_LOADING_HEADER_"
5
+ description="_A_DROPDOWN_GROUP_BUTTON_LOADING_DESCRIPTION_"
6
+ :props="['button-loading', 'button-loading-align']"
7
+ )
8
+ a-dropdown(
9
+ :actions="dropdownActions"
10
+ button-text="aloha"
11
+ :button-loading="true"
12
+ )
13
+ a-dropdown(
14
+ class="a_ml_2"
15
+ :actions="dropdownActions"
16
+ button-text="aloha"
17
+ :button-loading="true"
18
+ button-loading-align="left"
19
+ )
20
+ a-dropdown(
21
+ class="a_ml_2"
22
+ :actions="dropdownActions"
23
+ button-text="aloha"
24
+ :button-loading="true"
25
+ button-loading-align="right"
26
+ )
@@ -0,0 +1,2 @@
1
+ <template lang="pug" src="./PageDropdownButtonLoading.pug"></template>
2
+ <script src="./PageDropdownButtonLoading.js"></script>
@@ -0,0 +1,25 @@
1
+ export default function HtmlAPI() {
2
+ const codeHtml = `<a-dropdown
3
+ :actions="dropdownActions"
4
+ button-text="aloha"
5
+ :button-loading="true"
6
+ ></a-dropdown>
7
+ <a-dropdown
8
+ class="a_ml_2"
9
+ :actions="dropdownActions"
10
+ button-text="aloha"
11
+ :button-loading="true"
12
+ button-loading-align="left"
13
+ ></a-dropdown>
14
+ <a-dropdown
15
+ class="a_ml_2"
16
+ :actions="dropdownActions"
17
+ button-text="aloha"
18
+ :button-loading="true"
19
+ button-loading-align="right"
20
+ ></a-dropdown>`;
21
+
22
+ return {
23
+ codeHtml,
24
+ };
25
+ }
@@ -0,0 +1,32 @@
1
+ export default function JsAPI() {
2
+ const codeJs = `import ADropdown from "aloha-vue/src/ADropdown/ADropdown";
3
+
4
+ export default {
5
+ name: "PageDropdownButtonLoading",
6
+ components: {
7
+ ADropdown,
8
+ },
9
+ setup() {
10
+ const dropdownActions = [
11
+ {
12
+ text: "Actions 0",
13
+ type: "button",
14
+ callback: () => {},
15
+ },
16
+ {
17
+ text: "Actions 1",
18
+ type: "button",
19
+ callback: () => {},
20
+ },
21
+ ];
22
+
23
+ return {
24
+ dropdownActions,
25
+ };
26
+ },
27
+ };`;
28
+
29
+ return {
30
+ codeJs,
31
+ };
32
+ }
@@ -1,5 +1,9 @@
1
1
  {
2
2
  "_A_DROPDOWN_COMPONENT_NAME_": "Dropdown",
3
+ "_A_DROPDOWN_GROUP_BUTTON_LOADING_HEADER_": "Ladezustand des Dropdown-Buttons",
4
+ "_A_DROPDOWN_GROUP_BUTTON_LOADING_DESCRIPTION_": "Der Ladezustand des Dropdown-Buttons kann mit den Props <strong>button-loading</strong> und <strong>button-loading-align</strong> angepasst werden .",
5
+ "_A_DROPDOWN_PROPS_BUTTON_LOADING_": "Die Prop ermöglicht es Ihnen, den Ladezustand des Dropdown-Buttons zu steuern.",
6
+ "_A_DROPDOWN_PROPS_BUTTON_LOADING_ALIGN_": "Die Prop ermöglicht es Ihnen, die Position des Ladezustands im Button anzupassen.",
3
7
  "_A_DROPDOWN_GROUP_BUTTON_ICONS_HEADER_": "Anpassbare Button-Icons",
4
8
  "_A_DROPDOWN_GROUP_BUTTON_ICONS_DESCRIPTION_": "Icons vor und nach dem Text des Dropdown-Buttons können mit den Props <strong>button-icon-left</strong> und <strong>button-icon-right</strong> angepasst werden.",
5
9
  "_A_DROPDOWN_PROPS_BUTTON_ICON_LEFT_": "Die Props ermöglichen es Ihnen, den Icon vor dem Text des Dropdown-Buttons anzuzeigen.",
@@ -1,9 +1,52 @@
1
+ import AlohaPage from "../../global/components/AlohaPage/AlohaPage.vue";
2
+ import AlohaTableProps from "../../global/components/AlohaTableProps/AlohaTableProps.vue";
3
+ import ATranslation from "../../../../src/ATranslation/ATranslation";
1
4
  import AList from "../../../../src/AList/AList";
5
+ import PageListClassGroup from "./PageListClassGroup/PageListClassGroup.vue";
6
+
7
+ import EventsAPI from "./compositionAPI/EventsAPI";
8
+ import ExposesAPI from "./compositionAPI/ExposesAPI";
9
+ import PageTitleAPI from "./compositionAPI/PageTitleAPI";
10
+ import PropsAPI from "./compositionAPI/PropsAPI";
11
+ import SlotsAPI from "./compositionAPI/SlotsAPI";
2
12
 
3
13
  export default {
4
14
  name: "PageList",
5
15
  components: {
16
+ AlohaPage,
17
+ AlohaTableProps,
18
+ ATranslation,
6
19
  AList,
20
+ PageListClassGroup,
21
+ },
22
+ setup() {
23
+ const {
24
+ pageTitle,
25
+ } = PageTitleAPI();
26
+
27
+ const {
28
+ dataProps,
29
+ } = PropsAPI();
30
+
31
+ const {
32
+ dataSlots,
33
+ } = SlotsAPI();
34
+
35
+ const {
36
+ dataEvents,
37
+ } = EventsAPI();
38
+
39
+ const {
40
+ dataExposes,
41
+ } = ExposesAPI();
42
+
43
+ return {
44
+ dataEvents,
45
+ dataExposes,
46
+ dataProps,
47
+ dataSlots,
48
+ pageTitle,
49
+ };
7
50
  },
8
51
  data() {
9
52
  return {
@@ -1,23 +1,36 @@
1
- div
2
- h1 PageList
3
- h2 without children
4
- a-list(
5
- :data="items"
6
- key-label="label"
1
+ aloha-page(
2
+ :page-title="pageTitle"
3
+ )
4
+ template(
5
+ v-slot:body
7
6
  )
8
- h2 with children
9
- a-list(
10
- :data="items"
11
- key-label="label"
12
- key-children="items"
13
- )
14
- h2 with slot
15
- a-list(
16
- :data="items"
17
- key-children="items"
18
- )
19
- template(
20
- v-slot:listItem="vm"
7
+ a-translation(
8
+ tag="p"
9
+ html="_A_LIST_COMPONENT_DESCRIPTION_"
10
+ )
11
+
12
+ page-list-class-group
13
+
14
+
15
+
16
+ h2 without children
17
+ a-list(
18
+ :data="items"
19
+ key-label="label"
20
+ )
21
+ h2 with children
22
+ a-list(
23
+ :data="items"
24
+ key-label="label"
25
+ key-children="items"
26
+ )
27
+ h2 with slot
28
+ a-list(
29
+ :data="items"
30
+ key-children="items"
21
31
  )
22
- pre {{ vm.item.label }}
32
+ template(
33
+ v-slot:listItem="vm"
34
+ )
35
+ pre {{ vm.item.label }}
23
36
 
@@ -0,0 +1,43 @@
1
+ import AList from "../../../../../src/AList/AList";
2
+ import AlohaExample from "../../../global/components/AlohaExample/AlohaExample.vue";
3
+
4
+ import HtmlAPI from "./compositionAPI/HtmlAPI";
5
+ import JsAPI from "./compositionAPI/JsAPI";
6
+
7
+ export default {
8
+ name: "PageListClassGroup",
9
+ components: {
10
+ AList,
11
+ AlohaExample,
12
+ },
13
+ setup() {
14
+ const {
15
+ codeHtml,
16
+ } = HtmlAPI();
17
+
18
+ const {
19
+ codeJs,
20
+ } = JsAPI();
21
+
22
+ const items = [
23
+ {
24
+ label: "label 1",
25
+ },
26
+ {
27
+ label: "label 2",
28
+ },
29
+ {
30
+ label: "label 3",
31
+ },
32
+ {
33
+ label: "label 4",
34
+ },
35
+ ];
36
+
37
+ return {
38
+ codeHtml,
39
+ codeJs,
40
+ items,
41
+ };
42
+ },
43
+ };
@@ -0,0 +1,27 @@
1
+ aloha-example(
2
+ :code-html="codeHtml"
3
+ :code-js="codeJs"
4
+ header="_A_LIST_GROUP_CLASS_GROUP_HEADER_"
5
+ description="_A_LIST_GROUP_CLASS_GROUP_DESCRIPTION_"
6
+ :props="['class-main', 'class-item']"
7
+ )
8
+ a-list(
9
+ :data="items"
10
+ key-label="label"
11
+ class-main="a_list_group"
12
+ class-item="a_list_group__item"
13
+ )
14
+
15
+ a-list.a_mt_5(
16
+ :data="items"
17
+ key-label="label"
18
+ class-main="a_list_group a_list_group_gap"
19
+ class-item="a_list_group__item"
20
+ )
21
+
22
+ a-list.a_mt_5(
23
+ :data="items"
24
+ key-label="label"
25
+ class-main="a_list_group a_list_group_edge"
26
+ class-item="a_list_group__item"
27
+ )
@@ -0,0 +1,2 @@
1
+ <template lang="pug" src="./PageListClassGroup.pug"></template>
2
+ <script src="./PageListClassGroup.js"></script>
@@ -0,0 +1,17 @@
1
+ export default function HtmlAPI() {
2
+ const codeHtml = `<a-dropdown
3
+ :actions="dropdownActions"
4
+ :in-body="true"
5
+ button-text="in-body='true'"
6
+ ></a-dropdown>
7
+ <a-dropdown
8
+ class="a_ml_2"
9
+ :actions="dropdownActions"
10
+ :in-body="false"
11
+ button-text="in-body='false'"
12
+ ></a-dropdown>`;
13
+
14
+ return {
15
+ codeHtml,
16
+ };
17
+ }
@@ -0,0 +1,34 @@
1
+ export default function JsAPI() {
2
+ const codeJs = `import AList from "aloha-vue/src/AList/AList";
3
+
4
+ export default {
5
+ name: "PageListClassGroup",
6
+ components: {
7
+ AList,
8
+ },
9
+ setup() {
10
+ const items = [
11
+ {
12
+ label: "label 1",
13
+ },
14
+ {
15
+ label: "label 2",
16
+ },
17
+ {
18
+ label: "label 3",
19
+ },
20
+ {
21
+ label: "label 4",
22
+ },
23
+ ];
24
+
25
+ return {
26
+ items,
27
+ };
28
+ },
29
+ };`;
30
+
31
+ return {
32
+ codeJs,
33
+ };
34
+ }
@@ -0,0 +1,13 @@
1
+ export default function EventsAPI() {
2
+ const dataEvents = [
3
+ {
4
+ name: "close",
5
+ description: "_A_ALERT_EVENTS_CLOSE_DESCRIPTION_",
6
+ type: "Function",
7
+ },
8
+ ];
9
+
10
+ return {
11
+ dataEvents,
12
+ };
13
+ }
@@ -0,0 +1,18 @@
1
+ export default function ExposesAPI() {
2
+ const dataExposes = [
3
+ {
4
+ name: "close",
5
+ description: "_A_ALERT_EXPOSES_CLOSE_DESCRIPTION_",
6
+ type: "Function",
7
+ },
8
+ {
9
+ name: "isHidden",
10
+ description: "_A_ALERT_EXPOSES_IS_HIDDEN_DESCRIPTION_",
11
+ type: "Boolean",
12
+ },
13
+ ];
14
+
15
+ return {
16
+ dataExposes,
17
+ };
18
+ }
@@ -0,0 +1,24 @@
1
+ import {
2
+ computed,
3
+ } from "vue";
4
+
5
+ import {
6
+ getTranslatedText,
7
+ } from "../../../../../src/ATranslation/compositionAPI/UtilsAPI";
8
+
9
+
10
+ export default function PageTitleAPI() {
11
+ const componentNameTranslated = computed(() => {
12
+ return getTranslatedText({
13
+ placeholder: "_A_LIST_COMPONENT_NAME_",
14
+ });
15
+ });
16
+
17
+ const pageTitle = computed(() => {
18
+ return `AList${ componentNameTranslated.value ? ` (${ componentNameTranslated.value })` : "" }`;
19
+ });
20
+
21
+ return {
22
+ pageTitle,
23
+ };
24
+ }
@@ -0,0 +1,106 @@
1
+ export default function PropsAPI() {
2
+ const dataProps = [
3
+ {
4
+ name: "alert-class",
5
+ description: "_A_ALERT_PROPS_ALERT_CLASS_DESCRIPTION_",
6
+ type: "String / Object",
7
+ default: undefined,
8
+ required: false,
9
+ },
10
+ {
11
+ name: "alert-content-class",
12
+ description: "_A_ALERT_PROPS_ALERT_CONTENT_CLASS_DESCRIPTION_",
13
+ type: "String / Object",
14
+ default: undefined,
15
+ required: false,
16
+ },
17
+ {
18
+ name: "btn-close-attributes",
19
+ description: "_A_ALERT_PROPS_BTN_CLOSE_ATTRIBUTES_DESCRIPTION_",
20
+ type: "Object",
21
+ default: "{}",
22
+ required: false,
23
+ },
24
+ {
25
+ name: "closable",
26
+ description: "_A_ALERT_PROPS_CLOSABLE_DESCRIPTION_",
27
+ type: "Boolean",
28
+ default: false,
29
+ required: false,
30
+ },
31
+ {
32
+ name: "show-icon",
33
+ description: "_A_ALERT_PROPS_HAS_ICON_DESCRIPTION_",
34
+ type: "Boolean",
35
+ default: false,
36
+ required: false,
37
+ },
38
+ {
39
+ name: "html",
40
+ description: "_A_ALERT_PROPS_HTML_DESCRIPTION_",
41
+ type: "String",
42
+ default: undefined,
43
+ required: false,
44
+ },
45
+ {
46
+ name: "icon",
47
+ description: "_A_ALERT_PROPS_ICON_DESCRIPTION_",
48
+ type: "String",
49
+ default: undefined,
50
+ required: false,
51
+ },
52
+ {
53
+ name: "icon-class",
54
+ description: "_A_ALERT_PROPS_ICON_CLASS_DESCRIPTION_",
55
+ type: "String",
56
+ default: undefined,
57
+ required: false,
58
+ },
59
+ {
60
+ name: "is-visible",
61
+ description: "_A_ALERT_PROPS_IS_VISIBLE_DESCRIPTION_",
62
+ type: "Boolean",
63
+ default: false,
64
+ required: false,
65
+ },
66
+ {
67
+ name: "removeAlertOnClose",
68
+ description: "_A_ALERT_PROPS_REMOVE_ALERT_ON_CLOSE_DESCRIPTION_",
69
+ type: "Boolean",
70
+ default: false,
71
+ required: false,
72
+ },
73
+ {
74
+ name: "safe-html",
75
+ description: "_A_ALERT_PROPS_SAFE_HTML_DESCRIPTION_",
76
+ type: "String",
77
+ default: undefined,
78
+ required: false,
79
+ },
80
+ {
81
+ name: "text",
82
+ description: "_A_ALERT_PROPS_TEXT_DESCRIPTION_",
83
+ type: "String",
84
+ default: undefined,
85
+ required: false,
86
+ },
87
+ {
88
+ name: "text-close",
89
+ description: "_A_ALERT_PROPS_TEXT_CLOSE_DESCRIPTION_",
90
+ type: "String",
91
+ default: "_ALERT_CLOSE_",
92
+ required: false,
93
+ },
94
+ {
95
+ name: "type",
96
+ description: "_A_ALERT_PROPS_TYPE_DESCRIPTION_",
97
+ type: "String",
98
+ default: "danger",
99
+ required: false,
100
+ },
101
+ ];
102
+
103
+ return {
104
+ dataProps,
105
+ };
106
+ }
@@ -0,0 +1,12 @@
1
+ export default function SlotsAPI() {
2
+ const dataSlots = [
3
+ {
4
+ name: "default",
5
+ description: "_A_ALERT_SLOTS_DEFAULT_DESCRIPTION_",
6
+ },
7
+ ];
8
+
9
+ return {
10
+ dataSlots,
11
+ };
12
+ }
@@ -0,0 +1,19 @@
1
+ import ar from "./ar.json";
2
+ import de from "./de.json";
3
+ import en from "./en.json";
4
+ import es from "./es.json";
5
+ import fr from "./fr.json";
6
+ import hr from "./hr.json";
7
+ import it from "./it.json";
8
+ import ru from "./ru.json";
9
+
10
+ export default {
11
+ ar,
12
+ de,
13
+ en,
14
+ es,
15
+ fr,
16
+ hr,
17
+ it,
18
+ ru,
19
+ };
@@ -0,0 +1,3 @@
1
+ {
2
+
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "_A_LIST_COMPONENT_NAME_": "Liste"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+
3
+ }
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "Vue.js"
15
15
  ],
16
16
  "homepage": "https://github.com/ilia-brykin/aloha/#README.md",
17
- "version": "1.0.358",
17
+ "version": "1.0.360",
18
18
  "author": {
19
19
  "name": "Ilia Brykin",
20
20
  "email": "brykin.ilia@gmail.com"
@@ -3,7 +3,6 @@ import {
3
3
  } from "vue";
4
4
 
5
5
  import AriaLabelAPI from "./compositionAPI/AriaLabelAPI";
6
- import ATranslationAPI from "./compositionAPI/ATranslationAPI";
7
6
  import AttributesAPI from "./compositionAPI/AttributesAPI";
8
7
  import HtmlAPI from "./compositionAPI/HtmlAPI";
9
8
  import PlaceholderAPI from "./compositionAPI/PlaceholderAPI";
@@ -66,10 +65,6 @@ export default {
66
65
  },
67
66
  },
68
67
  setup(props) {
69
- const {
70
- translation,
71
- } = ATranslationAPI();
72
-
73
68
  const {
74
69
  hasTextAfter,
75
70
  hasTextBefore,
@@ -82,9 +77,7 @@ export default {
82
77
  isTranslateText,
83
78
  textForCurrentDevice,
84
79
  textLocal,
85
- } = TextAPI(props, {
86
- translation,
87
- });
80
+ } = TextAPI(props);
88
81
 
89
82
  const {
90
83
  hasHtml,
@@ -99,26 +92,19 @@ export default {
99
92
  hasTextBefore,
100
93
  textAfterForCurrentDevice,
101
94
  textBeforeForCurrentDevice,
102
- translation,
103
95
  });
104
96
 
105
97
  const {
106
98
  titleLocalOptions,
107
- } = TitleAPI(props, {
108
- translation,
109
- });
99
+ } = TitleAPI(props);
110
100
 
111
101
  const {
112
102
  placeholderAttributes,
113
- } = PlaceholderAPI(props, {
114
- translation,
115
- });
103
+ } = PlaceholderAPI(props);
116
104
 
117
105
  const {
118
106
  ariaLabelAttributes,
119
- } = AriaLabelAPI(props, {
120
- translation,
121
- });
107
+ } = AriaLabelAPI(props);
122
108
 
123
109
  const {
124
110
  attributesLocal,
@@ -145,7 +131,6 @@ export default {
145
131
  textAfterForCurrentDevice,
146
132
  textBeforeForCurrentDevice,
147
133
  textLocal,
148
- translation,
149
134
  };
150
135
  },
151
136
  render() {
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  computed,
3
3
  ref,
4
+ watch,
4
5
  } from "vue";
5
6
 
6
7
  import {
@@ -8,25 +9,35 @@ import {
8
9
  } from "lodash-es";
9
10
 
10
11
  const language = ref("de");
11
- let i18n = {};
12
+ export let i18n = {};
13
+ const timeTranslation = ref(new Date());
14
+ export const timeTranslationLastChanged = ref(new Date());
15
+ export let translation = {};
12
16
  export const isTranslate = ref(true);
13
17
 
14
- export const translation = computed(() => {
15
- if (isTranslate.value) {
16
- return i18n[language.value];
17
- }
18
- return {};
18
+ export const watchList = computed(() => {
19
+ return [
20
+ language.value,
21
+ timeTranslation.value,
22
+ isTranslate.value,
23
+ ];
24
+ });
25
+
26
+ watch(watchList, () => {
27
+ _updateTranslation();
28
+ }, {
29
+ immediate: true,
19
30
  });
20
31
 
21
32
  export default function ATranslationAPI() {
22
33
  return {
23
- i18n,
24
34
  isTranslate,
25
35
  language,
26
36
  setI18n,
27
37
  setLanguage,
28
38
  toggleTranslate,
29
- translation,
39
+ translationChanges: timeTranslationLastChanged,
40
+ updateTranslation,
30
41
  };
31
42
  }
32
43
 
@@ -45,3 +56,16 @@ export function toggleTranslate(isTranslateLocal) {
45
56
  isTranslate.value = !!isTranslateLocal;
46
57
  }
47
58
  }
59
+
60
+ function _updateTranslation() {
61
+ if (isTranslate.value) {
62
+ translation = i18n[language.value];
63
+ } else {
64
+ translation = {};
65
+ }
66
+ timeTranslationLastChanged.value = new Date();
67
+ }
68
+
69
+ export function updateTranslation() {
70
+ timeTranslation.value = new Date();
71
+ }
@@ -4,7 +4,9 @@ import {
4
4
  } from "vue";
5
5
 
6
6
  import AMobileAPI from "../../compositionAPI/AMobileAPI";
7
- import ATranslationAPI from "./ATranslationAPI";
7
+ import ATranslationAPI, {
8
+ translation,
9
+ } from "./ATranslationAPI";
8
10
  import UtilsAPI from "./UtilsAPI";
9
11
 
10
12
  import {
@@ -17,7 +19,7 @@ export default function AriaLabelAPI(props) {
17
19
  const extra = toRef(props, "extra");
18
20
 
19
21
  const {
20
- translation,
22
+ translationChanges,
21
23
  } = ATranslationAPI();
22
24
 
23
25
  const {
@@ -48,10 +50,13 @@ export default function AriaLabelAPI(props) {
48
50
  });
49
51
 
50
52
  const ariaLabelLocal = computed(() => {
53
+ if (!translationChanges.value) {
54
+ return undefined;
55
+ }
51
56
  if (isTranslateAriaLabel.value) {
52
57
  return getTranslatedText({
53
58
  placeholder: ariaLabelForCurrentDevice.value,
54
- translationObj: translation.value,
59
+ translationObj: translation,
55
60
  extra: extra.value,
56
61
  });
57
62
  }
@@ -4,12 +4,14 @@ import {
4
4
  } from "vue";
5
5
 
6
6
  import AMobileAPI from "../../compositionAPI/AMobileAPI";
7
+ import ATranslationAPI, {
8
+ translation,
9
+ } from "./ATranslationAPI";
7
10
  import UtilsAPI from "./UtilsAPI";
8
11
 
9
12
  import {
10
13
  sanitizeLocal,
11
14
  } from "../../utils/utils";
12
-
13
15
  import {
14
16
  isPlainObject,
15
17
  isUndefined,
@@ -20,7 +22,6 @@ export default function HtmlAPI(props, {
20
22
  hasTextBefore = computed(() => false),
21
23
  textAfterForCurrentDevice = computed(() => ""),
22
24
  textBeforeForCurrentDevice = computed(() => ""),
23
- translation = computed(() => ({})),
24
25
  }) {
25
26
  const extra = toRef(props, "extra");
26
27
  const html = toRef(props, "html");
@@ -35,6 +36,10 @@ export default function HtmlAPI(props, {
35
36
  isMobileWidth,
36
37
  } = AMobileAPI();
37
38
 
39
+ const {
40
+ translationChanges,
41
+ } = ATranslationAPI();
42
+
38
43
  const safeHtmlForCurrentDevice = computed(() => {
39
44
  if (isPlainObject(safeHtml.value)) {
40
45
  if (isMobileWidth.value) {
@@ -84,11 +89,14 @@ export default function HtmlAPI(props, {
84
89
  });
85
90
 
86
91
  const htmlLocal = computed(() => {
92
+ if (!translationChanges.value) {
93
+ return undefined;
94
+ }
87
95
  if (hasSafeHtml.value) {
88
96
  if (isTranslateSafeHtml.value) {
89
97
  return getTranslatedText({
90
98
  placeholder: safeHtmlForCurrentDevice.value,
91
- translationObj: translation.value,
99
+ translationObj: translation,
92
100
  extra: extra.value
93
101
  });
94
102
  }
@@ -98,7 +106,7 @@ export default function HtmlAPI(props, {
98
106
  if (isTranslateHtml.value) {
99
107
  return sanitizeLocal(getTranslatedText({
100
108
  placeholder: htmlForCurrentDevice.value,
101
- translationObj: translation.value,
109
+ translationObj: translation,
102
110
  extra: extra.value
103
111
  }));
104
112
  }
@@ -4,7 +4,9 @@ import {
4
4
  } from "vue";
5
5
 
6
6
  import AMobileAPI from "../../compositionAPI/AMobileAPI";
7
- import ATranslationAPI from "./ATranslationAPI";
7
+ import ATranslationAPI, {
8
+ translation,
9
+ } from "./ATranslationAPI";
8
10
  import UtilsAPI from "./UtilsAPI";
9
11
 
10
12
  import {
@@ -17,7 +19,7 @@ export default function PlaceholderAPI(props) {
17
19
  const placeholder = toRef(props, "placeholder");
18
20
 
19
21
  const {
20
- translation,
22
+ translationChanges,
21
23
  } = ATranslationAPI();
22
24
 
23
25
  const {
@@ -48,10 +50,13 @@ export default function PlaceholderAPI(props) {
48
50
  });
49
51
 
50
52
  const placeholderLocal = computed(() => {
53
+ if (!translationChanges.value) {
54
+ return undefined;
55
+ }
51
56
  if (isTranslatePlaceholder.value) {
52
57
  return getTranslatedText({
53
58
  placeholder: placeholderForCurrentDevice.value,
54
- translationObj: translation.value,
59
+ translationObj: translation,
55
60
  extra: extra.value,
56
61
  });
57
62
  }
@@ -4,6 +4,9 @@ import {
4
4
  } from "vue";
5
5
 
6
6
  import AMobileAPI from "../../compositionAPI/AMobileAPI";
7
+ import ATranslationAPI, {
8
+ translation,
9
+ } from "./ATranslationAPI";
7
10
  import UtilsAPI from "./UtilsAPI";
8
11
 
9
12
  import {
@@ -11,9 +14,7 @@ import {
11
14
  isUndefined,
12
15
  } from "lodash-es";
13
16
 
14
- export default function TextAPI(props, {
15
- translation = computed(() => ({})),
16
- }) {
17
+ export default function TextAPI(props) {
17
18
  const extra = toRef(props, "extra");
18
19
  const text = toRef(props, "text");
19
20
 
@@ -26,6 +27,10 @@ export default function TextAPI(props, {
26
27
  isMobileWidth,
27
28
  } = AMobileAPI();
28
29
 
30
+ const {
31
+ translationChanges,
32
+ } = ATranslationAPI();
33
+
29
34
  const textForCurrentDevice = computed(() => {
30
35
  if (isPlainObject(text.value)) {
31
36
  if (isMobileWidth.value) {
@@ -45,10 +50,13 @@ export default function TextAPI(props, {
45
50
  });
46
51
 
47
52
  const textLocal = computed(() => {
53
+ if (!translationChanges.value) {
54
+ return undefined;
55
+ }
48
56
  if (isTranslateText.value) {
49
57
  return getTranslatedText({
50
58
  placeholder: textForCurrentDevice.value,
51
- translationObj: translation.value,
59
+ translationObj: translation,
52
60
  extra: extra.value
53
61
  });
54
62
  }
@@ -4,6 +4,9 @@ import {
4
4
  } from "vue";
5
5
 
6
6
  import AMobileAPI from "../../compositionAPI/AMobileAPI";
7
+ import ATranslationAPI, {
8
+ translation,
9
+ } from "./ATranslationAPI";
7
10
  import UtilsAPI from "./UtilsAPI";
8
11
 
9
12
  import {
@@ -13,9 +16,7 @@ import {
13
16
  isPlainObject,
14
17
  } from "lodash-es";
15
18
 
16
- export default function TitleAPI(props, {
17
- translation = computed(() => ({})),
18
- }) {
19
+ export default function TitleAPI(props) {
19
20
  const extra = toRef(props, "extra");
20
21
  const title = toRef(props, "title");
21
22
 
@@ -28,6 +29,10 @@ export default function TitleAPI(props, {
28
29
  isMobileWidth,
29
30
  } = AMobileAPI();
30
31
 
32
+ const {
33
+ translationChanges,
34
+ } = ATranslationAPI();
35
+
31
36
  const titleForCurrentDevice = computed(() => {
32
37
  if (isPlainObject(title.value)) {
33
38
  if (isMobileWidth.value) {
@@ -50,6 +55,9 @@ export default function TitleAPI(props, {
50
55
  });
51
56
 
52
57
  const titleLocalOptions = computed(() => {
58
+ if (!translationChanges.value) {
59
+ return undefined;
60
+ }
53
61
  const TITLE_LOCAL_OPTIONS = {
54
62
  title: undefined,
55
63
  dataTranslateTitle: undefined,
@@ -73,7 +81,7 @@ export default function TitleAPI(props, {
73
81
  if (isPlaceholderTranslate(titleEl)) {
74
82
  titleCombined += getTranslatedText({
75
83
  placeholder: titleEl,
76
- translationObj: translation.value,
84
+ translationObj: translation,
77
85
  extra: extra.value,
78
86
  });
79
87
  dataTranslateTitle += titleEl;
@@ -1,4 +1,5 @@
1
1
  import {
2
+ timeTranslationLastChanged,
2
3
  translation,
3
4
  } from "./ATranslationAPI";
4
5
 
@@ -24,8 +25,8 @@ export function isPlaceholderTranslate(text = "") {
24
25
  text[text.length - 1] !== "_");
25
26
  }
26
27
 
27
- export function getTranslatedText({ placeholder, translationObj = translation.value, extra }) {
28
- if (!translationObj) {
28
+ export function getTranslatedText({ placeholder, translationObj = translation, extra }) {
29
+ if (!translationObj || !timeTranslationLastChanged.value) {
29
30
  return undefined;
30
31
  }
31
32
  const TEXT_FROM_TRANSLATION = isNil(translationObj[placeholder]) ? placeholder : translationObj[placeholder];
@@ -5,7 +5,9 @@ import {
5
5
  watch,
6
6
  } from "vue";
7
7
 
8
- import ATranslationAPI from "../ATranslation/compositionAPI/ATranslationAPI";
8
+ import ATranslationAPI, {
9
+ translation,
10
+ } from "../ATranslation/compositionAPI/ATranslationAPI";
9
11
  import UtilsAPI from "../ATranslation/compositionAPI/UtilsAPI";
10
12
 
11
13
  const baseTitle = ref("");
@@ -15,28 +17,35 @@ export default function APageTabTitleAPI(props) {
15
17
  const extra = toRef(props, "extra");
16
18
 
17
19
  const {
18
- translation,
20
+ translationChanges,
19
21
  } = ATranslationAPI();
22
+
20
23
  const {
21
24
  isPlaceholderTranslate,
22
25
  getTranslatedText,
23
26
  } = UtilsAPI();
24
27
 
25
28
  const baseTitleTranslated = computed(() => {
29
+ if (!translationChanges.value) {
30
+ return undefined;
31
+ }
26
32
  if (isPlaceholderTranslate(baseTitle.value)) {
27
33
  return getTranslatedText({
28
34
  placeholder: baseTitle.value,
29
- translationObj: translation.value,
35
+ translationObj: translation,
30
36
  });
31
37
  }
32
38
  return baseTitle.value;
33
39
  });
34
40
 
35
41
  const titleTranslated = computed(() => {
42
+ if (!translationChanges.value) {
43
+ return undefined;
44
+ }
36
45
  if (isPlaceholderTranslate(title.value)) {
37
46
  return getTranslatedText({
38
47
  placeholder: title.value,
39
- translationObj: translation.value,
48
+ translationObj: translation,
40
49
  extra: extra.value,
41
50
  });
42
51
  }
@@ -1,12 +1,15 @@
1
1
  import {
2
2
  sanitizeLocal,
3
3
  } from "../utils/utils";
4
+ import {
5
+ isNil,
6
+ } from "lodash-es";
4
7
 
5
8
  export default {
6
9
  beforeMount(el, binding) {
7
- el.innerHTML = sanitizeLocal(binding.value);
10
+ el.innerHTML = sanitizeLocal(isNil(binding.value) ? "" : binding.value);
8
11
  },
9
12
  updated(el, binding) {
10
- el.innerHTML = sanitizeLocal(binding.value);
13
+ el.innerHTML = sanitizeLocal(isNil(binding.value) ? "" : binding.value);
11
14
  },
12
15
  };
@@ -1,11 +1,13 @@
1
1
  import {
2
2
  setI18n,
3
3
  setLanguage,
4
+ updateTranslation,
4
5
  } from "../ATranslation/compositionAPI/ATranslationAPI";
5
6
 
6
7
  export default {
7
8
  install: (app, options, language) => {
8
9
  setI18n(options);
9
10
  setLanguage(language);
11
+ updateTranslation();
10
12
  },
11
13
  };