aloha-vue 1.2.75 → 1.2.77
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/docs/src/views/Functions/PageFilterLimitTo/i18n/de.json +1 -1
- package/docs/src/views/Functions/PageFilterLimitTo/i18n/ru.json +1 -1
- package/docs/src/views/PageNotification/PageNotification.pug +5 -1
- package/jest.config.js +9 -7
- package/package.json +2 -1
- package/src/AList/AListItem/AListItem.js +2 -2
- package/src/AList/__tests__/AList.test.js +30 -0
- package/src/AMenu2/AMenuPanel/AMenuPanel.js +20 -0
- package/src/AMenu2/AMenuPanel/compositionAPI/HeaderAPI.js +36 -0
- package/src/AMenu2/AMenuPanelLink/AMenuPanelLink.js +1 -1
- package/src/compositionAPI/ANotificationAPI.js +10 -2
- package/src/filters/__tests__/filterFileSize.test.js +27 -20
- package/src/filters/filterFileSize.js +16 -7
- package/src/plugins/AIconPlugin.js +6 -4
- package/src/styles/components/AMenu2.scss +33 -8
- package/src/utils/utils.js +10 -0
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"_PAGE_FILTER_LIMIT_TO_ARGUMENTS_TEXT_": "Der Eingangsstring, der beschnitten werden soll",
|
|
3
3
|
"_PAGE_FILTER_LIMIT_TO_ARGUMENTS_LIMIT_": "Die maximale Länge des zurückgegebenen Strings",
|
|
4
4
|
"_PAGE_FILTER_LIMIT_TO_ARGUMENTS_MAX_THREE_DOTS_": "Gibt an, ob maximal drei Punkten am Ende des Strings angezeigt werden",
|
|
5
|
-
"_PAGE_FILTER_LIMIT_TO_DESCRIPTION_": "Die Funktion <strong>filterLimitTo</strong> dient dazu, einen
|
|
5
|
+
"_PAGE_FILTER_LIMIT_TO_DESCRIPTION_": "Die Funktion <strong>filterLimitTo</strong> dient dazu, einen Eingabestring auf eine bestimmte maximale Länge zu begrenzen und optional eine spezielle Logik für Auslassungspunkte am Ende des Strings anzuwenden."
|
|
6
6
|
}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"_PAGE_FILTER_LIMIT_TO_ARGUMENTS_TEXT_": "Входная строка, которую нужно обрезать",
|
|
3
3
|
"_PAGE_FILTER_LIMIT_TO_ARGUMENTS_LIMIT_": "Максимальная длина возвращаемой строки",
|
|
4
4
|
"_PAGE_FILTER_LIMIT_TO_ARGUMENTS_MAX_THREE_DOTS_": "Определяет, должны ли отображаться максимум три точки в конце строки",
|
|
5
|
-
"_PAGE_FILTER_LIMIT_TO_DESCRIPTION_": "Функция <strong>filterLimitTo</strong> предназначена для ограничения входной строки определенной максимальной длиной
|
|
5
|
+
"_PAGE_FILTER_LIMIT_TO_DESCRIPTION_": "Функция <strong>filterLimitTo</strong> предназначена для ограничения входной строки определенной максимальной длиной и, по желанию, применения специальной логики многоточия в конце строки."
|
|
6
6
|
}
|
|
@@ -8,5 +8,9 @@ div
|
|
|
8
8
|
:text="'_ADD_NOTIFICATION_{{type}}_'"
|
|
9
9
|
:extra="{type: type}"
|
|
10
10
|
@click="addNotificationLocal(type)"
|
|
11
|
-
text="Open Modal"
|
|
12
11
|
)
|
|
12
|
+
.a_mt_4
|
|
13
|
+
a-button.a_btn.a_btn_primary(
|
|
14
|
+
text="Object"
|
|
15
|
+
@click="addNotificationLocal({ sdf: 'x', abc: 'y', aloha: 'z' })"
|
|
16
|
+
)
|
package/jest.config.js
CHANGED
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
5
|
coverageDirectory: "coverage",
|
|
6
|
-
moduleNameMapper: {
|
|
7
|
-
"@/(.*)$": "<rootDir>/src/$1"
|
|
8
|
-
},
|
|
9
|
-
testEnvironment: "node",
|
|
10
|
-
transform: {
|
|
11
|
-
"^.+\\.jsx?$": "babel-jest"
|
|
12
|
-
},
|
|
13
6
|
transformIgnorePatterns: [
|
|
14
7
|
"<rootDir>/node_modules/(?!lodash-es)"
|
|
15
8
|
],
|
|
9
|
+
globals: {},
|
|
10
|
+
testEnvironment: "jsdom",
|
|
11
|
+
testEnvironmentOptions: {
|
|
12
|
+
customExportConditions: ["node", "node-addons"],
|
|
13
|
+
},
|
|
14
|
+
transform: {
|
|
15
|
+
"^.+\\js$": "babel-jest"
|
|
16
|
+
},
|
|
17
|
+
moduleFileExtensions: ["vue", "js", "json", "jsx", "ts", "tsx", "node"]
|
|
16
18
|
};
|
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.2.
|
|
17
|
+
"version": "1.2.77",
|
|
18
18
|
"author": {
|
|
19
19
|
"name": "Ilia Brykin",
|
|
20
20
|
"email": "brykin.ilia@gmail.com"
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"@vue/test-utils": "^2.4.3",
|
|
56
56
|
"eslint-plugin-jest": "^27.6.1",
|
|
57
57
|
"jest": "^29.7.0",
|
|
58
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
58
59
|
"lodash": "^4.17.21",
|
|
59
60
|
"@babel/cli": "^7.23.4",
|
|
60
61
|
"@babel/core": "^7.23.7",
|
|
@@ -98,7 +98,7 @@ export default {
|
|
|
98
98
|
withDirectives(h(this.labelTag), [
|
|
99
99
|
[ASafeHtml, this.label]
|
|
100
100
|
]),
|
|
101
|
-
this.hasChildren
|
|
101
|
+
this.hasChildren ? h(AList, {
|
|
102
102
|
classItem: this.classItem,
|
|
103
103
|
classMain: this.classMain,
|
|
104
104
|
data: this.children,
|
|
@@ -110,7 +110,7 @@ export default {
|
|
|
110
110
|
labelTag: this.labelTag,
|
|
111
111
|
listItemTag: this.listItemTag,
|
|
112
112
|
tag: this.tag,
|
|
113
|
-
}, this.$slots),
|
|
113
|
+
}, this.$slots) : "",
|
|
114
114
|
]);
|
|
115
115
|
},
|
|
116
116
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
mount,
|
|
3
|
+
} from "@vue/test-utils";
|
|
4
|
+
|
|
5
|
+
import AList from "../AList";
|
|
6
|
+
|
|
7
|
+
describe("AList", () => {
|
|
8
|
+
test("displays message", () => {
|
|
9
|
+
const ITEMS = [
|
|
10
|
+
{ label: "label 1" },
|
|
11
|
+
{ label: "label 2" },
|
|
12
|
+
{ label: "label 3" },
|
|
13
|
+
{ label: "label 4" },
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const wrapper = mount(AList, {
|
|
17
|
+
props: {
|
|
18
|
+
data: ITEMS,
|
|
19
|
+
keyLabel: "label",
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
console.log("component.text()", wrapper.text());
|
|
23
|
+
|
|
24
|
+
// Assert the rendered text of the component
|
|
25
|
+
expect(wrapper.findAll("li")).toHaveLength(4);
|
|
26
|
+
expect(wrapper.text()).toContain("label 1label 2label 3label 4");
|
|
27
|
+
expect(wrapper.html({ raw: true })).toBe("<ul><li><span>label 1</span></li><li><span>label 2</span></li><li><span>label 3</span></li><li><span>label 4</span></li></ul>");
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
@@ -6,8 +6,10 @@ import {
|
|
|
6
6
|
|
|
7
7
|
import AMenuBreadcrumbs from "../AMenuBreadcrumbs/AMenuBreadcrumbs";
|
|
8
8
|
import AMenuPanelGroup from "../AMenuPanelGroup/AMenuPanelGroup";
|
|
9
|
+
import ATranslation from "../../ATranslation/ATranslation";
|
|
9
10
|
|
|
10
11
|
import GroupAPI from "./compositionAPI/GroupAPI";
|
|
12
|
+
import HeaderAPI from "./compositionAPI/HeaderAPI";
|
|
11
13
|
import IdAPI from "./compositionAPI/IdAPI";
|
|
12
14
|
import LevelAPI from "./compositionAPI/LevelAPI";
|
|
13
15
|
import PanelOpenAPI from "./compositionAPI/PanelOpenAPI";
|
|
@@ -103,15 +105,24 @@ export default {
|
|
|
103
105
|
openedLevelIndex,
|
|
104
106
|
});
|
|
105
107
|
|
|
108
|
+
const {
|
|
109
|
+
isHeaderPanelVisible,
|
|
110
|
+
parentLabel,
|
|
111
|
+
} = HeaderAPI(props, {
|
|
112
|
+
openedLevelIndex,
|
|
113
|
+
});
|
|
114
|
+
|
|
106
115
|
provide("isChildPanelOpen", isChildPanelOpen);
|
|
107
116
|
provide("isPanelMain", isPanelMain);
|
|
108
117
|
|
|
109
118
|
return {
|
|
110
119
|
isChildPanelOpen,
|
|
120
|
+
isHeaderPanelVisible,
|
|
111
121
|
isItemsWithoutGroup,
|
|
112
122
|
isPanelOpen,
|
|
113
123
|
itemsGroup,
|
|
114
124
|
panelId,
|
|
125
|
+
parentLabel,
|
|
115
126
|
styleZIndex,
|
|
116
127
|
};
|
|
117
128
|
},
|
|
@@ -135,6 +146,15 @@ export default {
|
|
|
135
146
|
isSearchActive: this.isSearchActive,
|
|
136
147
|
panelParentsOpen: this.panelParentsOpen,
|
|
137
148
|
}),
|
|
149
|
+
(this.isHeaderPanelVisible) && h("div", {
|
|
150
|
+
class: "a_menu_2__panel_header",
|
|
151
|
+
}, [
|
|
152
|
+
h(ATranslation, {
|
|
153
|
+
class: "a_menu_2__panel_header__text",
|
|
154
|
+
html: this.parentLabel,
|
|
155
|
+
tag: "strong",
|
|
156
|
+
}),
|
|
157
|
+
]),
|
|
138
158
|
h("ul", {
|
|
139
159
|
class: "a_menu_2__listview",
|
|
140
160
|
}, [
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
inject,
|
|
4
|
+
toRef,
|
|
5
|
+
} from "vue";
|
|
6
|
+
|
|
7
|
+
import AKeyLabel from "../../../const/AKeyLabel";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
get,
|
|
11
|
+
} from "lodash-es";
|
|
12
|
+
|
|
13
|
+
export default function HeaderAPI(props, {
|
|
14
|
+
openedLevelIndex = computed(() => 0),
|
|
15
|
+
}) {
|
|
16
|
+
const dataKeyById = toRef(props, "dataKeyById");
|
|
17
|
+
const isPanelMain = toRef(props, "isPanelMain");
|
|
18
|
+
const parentId = toRef(props, "parentId");
|
|
19
|
+
|
|
20
|
+
const isMenuOpen = inject("isMenuOpen");
|
|
21
|
+
|
|
22
|
+
const isHeaderPanelVisible = computed(() => {
|
|
23
|
+
return !isPanelMain.value &&
|
|
24
|
+
!isMenuOpen.value &&
|
|
25
|
+
openedLevelIndex.value === 0;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const parentLabel = computed(() => {
|
|
29
|
+
return get(dataKeyById.value, `${ parentId.value }.${ AKeyLabel }`);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
isHeaderPanelVisible,
|
|
34
|
+
parentLabel,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -3,8 +3,12 @@ import {
|
|
|
3
3
|
ref,
|
|
4
4
|
} from "vue";
|
|
5
5
|
|
|
6
|
+
import {
|
|
7
|
+
createListFromObject,
|
|
8
|
+
} from "../utils/utils";
|
|
6
9
|
import {
|
|
7
10
|
isNil,
|
|
11
|
+
isPlainObject,
|
|
8
12
|
values,
|
|
9
13
|
} from "lodash-es";
|
|
10
14
|
|
|
@@ -28,13 +32,17 @@ export function setNotificationTimeout(timeout) {
|
|
|
28
32
|
notificationTimeout = timeout;
|
|
29
33
|
}
|
|
30
34
|
|
|
31
|
-
export function addNotification({ text, type = "success", timeout, extra }) {
|
|
35
|
+
export function addNotification({ text, type = "success", timeout, extra, useValuesFromObject = true }) {
|
|
32
36
|
const TIMEOUT_LOCAL = isNil(timeout) ? notificationTimeout : timeout;
|
|
33
37
|
const CURRENT_INDEX = notificationsCount;
|
|
34
38
|
const TYPE = type === "error" ? "danger" : type;
|
|
39
|
+
let textLocal = text;
|
|
40
|
+
if (isPlainObject(text) && useValuesFromObject) {
|
|
41
|
+
textLocal = createListFromObject(text); // TODO: filterList
|
|
42
|
+
}
|
|
35
43
|
|
|
36
44
|
notificationsObj.value[CURRENT_INDEX] = {
|
|
37
|
-
text,
|
|
45
|
+
text: textLocal,
|
|
38
46
|
type: TYPE,
|
|
39
47
|
index: CURRENT_INDEX,
|
|
40
48
|
extra,
|
|
@@ -2,31 +2,38 @@ import filterFileSize from "../filterFileSize.js";
|
|
|
2
2
|
|
|
3
3
|
describe("filterFileSize", () => {
|
|
4
4
|
test("default", () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
expect(filterFileSize(1024)).toBe("1,00 _A_FILE_SIZE_KB_");
|
|
6
|
+
expect(filterFileSize(0)).toBe("0,00 _A_FILE_SIZE_KB_");
|
|
7
|
+
expect(filterFileSize(500)).toBe("0,49 _A_FILE_SIZE_KB_");
|
|
8
|
+
expect(filterFileSize(504547643)).toBe("492.722,31 _A_FILE_SIZE_KB_");
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
test("units", () => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
expect(filterFileSize(1048576, { units: "mb" })).toBe("1,00 _A_FILE_SIZE_MB_");
|
|
13
|
+
expect(filterFileSize(0, { units: "mb" })).toBe("0,00 _A_FILE_SIZE_MB_");
|
|
14
|
+
expect(filterFileSize(9226889999, { units: "gb" })).toBe("8,59 _A_FILE_SIZE_GB_");
|
|
15
|
+
expect(filterFileSize(1024, { units: "" })).toBe("1,00 _A_FILE_SIZE_KB_");
|
|
16
|
+
expect(filterFileSize(0, { units: "" })).toBe("0,00 _A_FILE_SIZE_B_");
|
|
17
|
+
});
|
|
17
18
|
|
|
18
19
|
test("sourceUnits", () => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})
|
|
20
|
+
expect(filterFileSize(1, { units: "mb", sourceUnits: "mb" })).toBe("1,00 _A_FILE_SIZE_MB_");
|
|
21
|
+
expect(filterFileSize(1, { units: "kb", sourceUnits: "gb" })).toBe("1.048.576,00 _A_FILE_SIZE_KB_");
|
|
22
|
+
expect(filterFileSize(0, { sourceUnits: "mb" })).toBe("0,00 _A_FILE_SIZE_KB_");
|
|
23
|
+
expect(filterFileSize(1024, { sourceUnits: "b" })).toBe("1,00 _A_FILE_SIZE_KB_");
|
|
24
|
+
expect(filterFileSize(12, { units: "tb", sourceUnits: "pb" })).toBe("12.288,00 _A_FILE_SIZE_TB_");
|
|
25
|
+
});
|
|
26
|
+
|
|
25
27
|
test("digits", () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
})
|
|
28
|
+
expect(filterFileSize(1024, { digits: 0 })).toBe("1 _A_FILE_SIZE_KB_");
|
|
29
|
+
expect(filterFileSize(500, { digits: 1 })).toBe("0,5 _A_FILE_SIZE_KB_");
|
|
30
|
+
});
|
|
31
|
+
|
|
29
32
|
test("combined", () => {
|
|
30
|
-
|
|
33
|
+
expect(filterFileSize(133889, { units: "tb", sourceUnits: "mb", digits: 3 })).toBe("0,128 _A_FILE_SIZE_TB_");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test("value (String)", () => {
|
|
37
|
+
expect(filterFileSize("1024.1")).toBe("1,00 _A_FILE_SIZE_KB_");
|
|
31
38
|
});
|
|
32
|
-
});
|
|
39
|
+
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import filterFloat from "./filterFloat";
|
|
2
2
|
import {
|
|
3
3
|
getTranslatedText,
|
|
4
4
|
} from "../ATranslation/compositionAPI/UtilsAPI";
|
|
5
5
|
import {
|
|
6
|
-
|
|
6
|
+
isNaN,
|
|
7
|
+
toNumber,
|
|
7
8
|
toUpper,
|
|
8
9
|
} from "lodash-es";
|
|
9
10
|
|
|
@@ -20,26 +21,34 @@ export default function(value, { units = "kb", sourceUnits = "b", digits = 2 } =
|
|
|
20
21
|
"zb",
|
|
21
22
|
"yb",
|
|
22
23
|
];
|
|
24
|
+
const VALUE_NUMBER = toNumber(value);
|
|
25
|
+
if (isNaN(VALUE_NUMBER)) {
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
28
|
+
|
|
23
29
|
const INDEX_SOURCE_UNITS = UNITS_ORDER.indexOf(sourceUnits);
|
|
24
30
|
let indexUnits = UNITS_ORDER.indexOf(units);
|
|
25
31
|
if (INDEX_SOURCE_UNITS === -1) {
|
|
26
32
|
return "";
|
|
27
33
|
}
|
|
28
|
-
const VALUE_IN_BYTES =
|
|
34
|
+
const VALUE_IN_BYTES = VALUE_NUMBER * Math.pow(KB, INDEX_SOURCE_UNITS);
|
|
29
35
|
if (indexUnits === -1) {
|
|
30
36
|
indexUnits = Math.floor(Math.log(VALUE_IN_BYTES) / Math.log(KB));
|
|
37
|
+
if (indexUnits < 0) {
|
|
38
|
+
indexUnits = 0;
|
|
39
|
+
}
|
|
31
40
|
units = UNITS_ORDER[indexUnits];
|
|
32
41
|
}
|
|
33
42
|
|
|
34
43
|
const UNITS_TRANSLATED = getTranslatedText({ placeholder: `_A_FILE_SIZE_${ toUpper(units) }_` });
|
|
35
44
|
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
45
|
+
if (VALUE_NUMBER === 0) {
|
|
46
|
+
return filterFloat(0, { suffix: UNITS_TRANSLATED, digits });
|
|
38
47
|
}
|
|
39
48
|
if (INDEX_SOURCE_UNITS === indexUnits) {
|
|
40
|
-
return
|
|
49
|
+
return filterFloat(VALUE_NUMBER, { suffix: UNITS_TRANSLATED, digits });
|
|
41
50
|
}
|
|
42
51
|
const size = VALUE_IN_BYTES / Math.pow(KB, Math.abs(indexUnits));
|
|
43
52
|
|
|
44
|
-
return
|
|
53
|
+
return filterFloat(size, { suffix: UNITS_TRANSLATED, digits });
|
|
45
54
|
}
|
|
@@ -18,6 +18,7 @@ import CheckLg from "../AIcon/Icons/CheckLg";
|
|
|
18
18
|
import ChevronDown from "../AIcon/Icons/ChevronDown";
|
|
19
19
|
import ChevronLeft from "../AIcon/Icons/ChevronLeft";
|
|
20
20
|
import ChevronRight from "../AIcon/Icons/ChevronRight";
|
|
21
|
+
import ChevronRightThin from "../AIcon/Icons/bootstrap-1-9-1/ChevronRight";
|
|
21
22
|
import ChevronUp from "../AIcon/Icons/ChevronUp";
|
|
22
23
|
import Close from "../AIcon/Icons/Close";
|
|
23
24
|
import Cog from "../AIcon/Icons/Cog";
|
|
@@ -48,11 +49,12 @@ import Trash from "../AIcon/Icons/Trash";
|
|
|
48
49
|
|
|
49
50
|
export const iconPluginOptions = ref({
|
|
50
51
|
icons: {
|
|
51
|
-
|
|
52
|
+
_NoImage,
|
|
52
53
|
AlertDanger,
|
|
53
|
-
AlertSuccess,
|
|
54
54
|
AlertInfo,
|
|
55
|
+
AlertSuccess,
|
|
55
56
|
AlertWarning,
|
|
57
|
+
Aloha,
|
|
56
58
|
AngleDown,
|
|
57
59
|
AngleLeft,
|
|
58
60
|
AngleRight,
|
|
@@ -64,8 +66,8 @@ export const iconPluginOptions = ref({
|
|
|
64
66
|
ChevronLeft,
|
|
65
67
|
ChevronRight,
|
|
66
68
|
ChevronUp,
|
|
67
|
-
Cog,
|
|
68
69
|
Close,
|
|
70
|
+
Cog,
|
|
69
71
|
Cross,
|
|
70
72
|
Dnd,
|
|
71
73
|
DoubleAngleDown,
|
|
@@ -78,6 +80,7 @@ export const iconPluginOptions = ref({
|
|
|
78
80
|
FloppyDisk,
|
|
79
81
|
Home,
|
|
80
82
|
Lock,
|
|
83
|
+
MenuChevronRight: ChevronRightThin,
|
|
81
84
|
Minus,
|
|
82
85
|
Ok,
|
|
83
86
|
OptionHorizontal,
|
|
@@ -90,7 +93,6 @@ export const iconPluginOptions = ref({
|
|
|
90
93
|
ThList,
|
|
91
94
|
ThreeDots,
|
|
92
95
|
Trash,
|
|
93
|
-
_NoImage,
|
|
94
96
|
},
|
|
95
97
|
});
|
|
96
98
|
|
|
@@ -24,28 +24,38 @@
|
|
|
24
24
|
--a_menu_2_panel_iconpanel_size: var(--a_menu_2_width_collapsed);
|
|
25
25
|
--a_menu_2_panel_color: var(--a_color_gray_600);
|
|
26
26
|
--a_menu_2_link_color: var(--a_color_gray_900);
|
|
27
|
+
--a_menu_2_link_hover_color: var(--a_color_gray_900);
|
|
28
|
+
--a_menu_2_link_hover_bg: var(--a_color_gray_200);
|
|
27
29
|
--a_menu_2_listitem_padding: .3rem;
|
|
28
30
|
--a_menu_2_listitem_panel_secondary_padding_x: .6rem;
|
|
29
31
|
--a_menu_2_listitem_panel_secondary_padding_y: .3rem;
|
|
30
32
|
--a_menu_2_link_padding_x: .7rem;
|
|
31
|
-
--a_menu_2_link_padding_y: .
|
|
33
|
+
--a_menu_2_link_padding_y: .5rem;
|
|
32
34
|
--a_menu_2_link_selected_bg: var(--a_color_gray_200);
|
|
33
35
|
--a_menu_2_link_selected_color: inherit;
|
|
34
36
|
--a_menu_2_link_border_color: transparent;
|
|
35
37
|
--a_menu_2_link_border_radius: .3rem;
|
|
38
|
+
--a_menu_2_link_focus_size: 0 0 1px 3px;
|
|
36
39
|
--a_menu_2_icon_color: var(--a_menu_2_link_color);
|
|
37
|
-
--
|
|
40
|
+
--a_menu_2_focus_shadow_color: var(--a_color_focus);
|
|
38
41
|
--a_menu_2_list_header_bg: var(--a_color_gray_200);
|
|
39
|
-
--a_menu_2_breadcrumb_min_height:
|
|
42
|
+
--a_menu_2_breadcrumb_min_height: 65px;
|
|
40
43
|
--a_menu_2_breadcrumb_border_bottom_width: 1px;
|
|
41
44
|
--a_menu_2_submenu_open_bg: var(--a_color_primary);
|
|
42
45
|
--a_menu_2_submenu_open_color: var(--a_color_white);
|
|
43
46
|
--a_menu_2_submenu_border_radius: 1rem;
|
|
44
47
|
--a_menu_2_submenu_border_width: 2px;
|
|
45
48
|
--a_menu_2_search_height: 50px;
|
|
49
|
+
--a_menu_2_search_link_focus_size: inset 0 0 1px 2px;
|
|
46
50
|
--a_menu_2_close_panel_width: 300px;
|
|
47
51
|
--a_menu_2_close_panel_max_height: 400px;
|
|
48
52
|
--a_menu_2_close_panel_border_radius: .3rem;
|
|
53
|
+
--a_menu_2_close_panel_box_shadow_color: var(--a_color_gray_600);
|
|
54
|
+
--a_menu_2_close_panel_box_shadow_size: 0 0 7px 3px;
|
|
55
|
+
--a_menu_2_close_panel_header_color: var(--a_color_gray_900);
|
|
56
|
+
--a_menu_2_close_panel_header_border_bottom_color: var(--a_color_gray_600);
|
|
57
|
+
--a_menu_2_close_panel_header_border_bottom_width: 1px;
|
|
58
|
+
--a_menu_2_link_line_horizontal_display: none;
|
|
49
59
|
|
|
50
60
|
width: var(--a_menu_2_width);
|
|
51
61
|
position: absolute;
|
|
@@ -101,7 +111,7 @@
|
|
|
101
111
|
border-color: inherit;
|
|
102
112
|
border-bottom-width: 1px;
|
|
103
113
|
border-bottom-style: solid;
|
|
104
|
-
display:
|
|
114
|
+
display: var(--a_menu_2_link_line_horizontal_display);
|
|
105
115
|
position: absolute;
|
|
106
116
|
inset-inline-start: 20px;
|
|
107
117
|
inset-inline-end: 0;
|
|
@@ -135,11 +145,15 @@
|
|
|
135
145
|
text-decoration: none;
|
|
136
146
|
color: var(--a_menu_2_link_color);
|
|
137
147
|
}
|
|
138
|
-
&:focus
|
|
148
|
+
&:focus {
|
|
149
|
+
outline: 0;
|
|
150
|
+
box-shadow: var(--a_menu_2_link_focus_size) var(--a_menu_2_focus_shadow_color);
|
|
151
|
+
color: var(--a_menu_2_link_color);
|
|
152
|
+
}
|
|
139
153
|
&:hover {
|
|
140
154
|
outline: 0;
|
|
141
|
-
box-shadow: inset 0 0 1px 4px var(--a_menu_2_icon_focus_shadow_color);
|
|
142
155
|
color: var(--a_menu_2_link_color);
|
|
156
|
+
background-color: var(--a_menu_2_link_hover_bg);
|
|
143
157
|
}
|
|
144
158
|
&.a_menu_2__link_active {
|
|
145
159
|
--a_menu_2_icon_color: var(--a_menu_2_submenu_open_bg);
|
|
@@ -480,7 +494,8 @@
|
|
|
480
494
|
top: auto;
|
|
481
495
|
border: none;
|
|
482
496
|
border-radius: var(--a_menu_2_close_panel_border_radius);
|
|
483
|
-
|
|
497
|
+
// Aloha
|
|
498
|
+
box-shadow: var(--a_menu_2_close_panel_box_shadow_size) var(--a_color_gray_600);
|
|
484
499
|
max-height: var(--a_menu_2_close_panel_max_height);
|
|
485
500
|
overflow-y: auto;
|
|
486
501
|
z-index: 2;
|
|
@@ -545,7 +560,7 @@
|
|
|
545
560
|
padding: 0.2rem 0.3rem;
|
|
546
561
|
&:focus,
|
|
547
562
|
&:hover {
|
|
548
|
-
box-shadow:
|
|
563
|
+
box-shadow: var(--a_menu_2_search_link_focus_size) var(--a_menu_2_focus_shadow_color);
|
|
549
564
|
}
|
|
550
565
|
}
|
|
551
566
|
.a_menu_2__breadcrumbs__item__divider {
|
|
@@ -568,4 +583,14 @@
|
|
|
568
583
|
.a_menu_2__breadcrumb__ul_truncated__dropdown {
|
|
569
584
|
padding: .2rem;
|
|
570
585
|
min-width: auto;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.a_menu_2__panel_header {
|
|
589
|
+
color: var(--a_menu_2_close_panel_header_color);
|
|
590
|
+
border-bottom: var(--a_menu_2_close_panel_header_border_bottom_width) solid var(--a_menu_2_close_panel_header_border_bottom_color);
|
|
591
|
+
padding: var(--a_menu_2_listitem_panel_secondary_padding_y) var(--a_menu_2_listitem_panel_secondary_padding_x);
|
|
592
|
+
}
|
|
593
|
+
.a_menu_2__panel_header__text {
|
|
594
|
+
display: inline-block;
|
|
595
|
+
padding: var(--a_menu_2_link_padding_y) var(--a_menu_2_link_padding_x);
|
|
571
596
|
}
|
package/src/utils/utils.js
CHANGED
|
@@ -65,3 +65,13 @@ export function isArrayOfArrays(array) {
|
|
|
65
65
|
|
|
66
66
|
return every(array, isArray);
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
export function createListFromObject(obj) { // TODO: filterList, soll gelöscht werden
|
|
70
|
+
const keys = Object.keys(obj);
|
|
71
|
+
if (keys.length === 0) {
|
|
72
|
+
return "";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const items = keys.map(key => `<li>${ obj[key] }</li>`).join("");
|
|
76
|
+
return `<ul class="a_list_without_styles">${ items }</ul>`;
|
|
77
|
+
}
|