aloha-vue 1.0.88 → 1.0.90
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/package.json +2 -1
- package/docs/src/components/TheMenu/TheMenu.js +8 -0
- package/docs/src/router/index.js +5 -0
- package/docs/src/views/PageDatepicker/PageDatepicker.js +15 -0
- package/docs/src/views/PageDatepicker/PageDatepicker.pug +11 -0
- package/docs/src/views/PageDatepicker/PageDatepicker.vue +2 -0
- package/docs/src/views/PageTable/PageTable.js +10 -1
- package/package.json +2 -1
- package/src/AMenu/AMenu.js +15 -4
- package/src/AMenu/AMenuBreadcrumbs.js +3 -13
- package/src/AMenu/AMenuPanelLink.js +7 -0
- package/src/AMenu/compositionAPI/AMenuPanelsAPI.js +76 -1
- package/src/ATable/ATableHeaderThAction/ATableHeaderThAction.js +1 -1
- package/src/ATable/ATableTdAction/ATableTdAction.js +1 -1
- package/src/ATable/compositionAPI/ScrollControlAPI.js +7 -5
- package/src/const/AKeysCode.js +3 -1
- package/src/styles/components/ATable.scss +1 -0
- package/src/styles/components/ui/ADatepicker.scss +345 -0
- package/src/styles/components/ui/ui.scss +2 -2
- package/src/ui/ADatepicker/ADatepicker.js +874 -0
- package/src/ui/ADatepicker/ADatepickerCalendarPanel/ADatepickerCalendarPanel.js +800 -0
- package/src/ui/ADatepicker/ADatepickerIcon/ADatepickerIcon.js +28 -0
- package/src/ui/ADatepicker/locale/languages.js +174 -0
- package/src/ui/ADatepicker/mixins/PanelMixin.js +73 -0
- package/src/ui/ADatepicker/panel/APanelDate/APanelDate.js +354 -0
- package/src/ui/ADatepicker/panel/APanelMonth/APanelMonth.js +187 -0
- package/src/ui/ADatepicker/panel/APanelTime/APanelTime.js +303 -0
- package/src/ui/ADatepicker/panel/APanelYear/APanelYear.js +162 -0
- package/src/ui/ADatepicker/panel/APanelYearItem/APanelYearItem.js +84 -0
- package/src/ui/ADatepicker/utils/index.js +96 -0
- package/src/ui/ADatepicker/utils/scroll-into-view.js +23 -0
- package/src/ui/ADatepicker/utils/transform.js +14 -0
- package/src/ui/AInput/AInput.js +4 -29
- package/src/ui/AUiComponents.js +3 -0
- package/src/ui/compositionApi/UiInputAutofillAPI.js +41 -0
package/docs/package.json
CHANGED
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@popperjs/core": "2.11.6",
|
|
15
15
|
"aloha-css": "1.0.51",
|
|
16
|
+
"fecha": "^4.2.3",
|
|
16
17
|
"lodash-es": "^4.17.21",
|
|
17
18
|
"tiny-emitter": "2.1.0",
|
|
18
19
|
"vue": "3.2.31",
|
|
19
|
-
"vue-router": "4.
|
|
20
|
+
"vue-router": "4.1.5",
|
|
20
21
|
"vuex": "4.0.2"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
package/docs/src/router/index.js
CHANGED
|
@@ -114,6 +114,11 @@ const ROUTES = [
|
|
|
114
114
|
name: "PageList",
|
|
115
115
|
component: () => import(/* webpackChunkName: "PageList" */ "../views/PageList/PageList.vue"),
|
|
116
116
|
},
|
|
117
|
+
{
|
|
118
|
+
path: "/datepicker",
|
|
119
|
+
name: "PageDatepicker",
|
|
120
|
+
component: () => import(/* webpackChunkName: "PageDatepicker" */ "../views/PageDatepicker/PageDatepicker.vue"),
|
|
121
|
+
},
|
|
117
122
|
{
|
|
118
123
|
// If the routing configuration '*' reports an error, replace it with '/: catchAll(. *)'
|
|
119
124
|
// caught Error: Catch all routes ("*") must now be defined using a param with a custom regexp
|
|
@@ -64,6 +64,14 @@ export default {
|
|
|
64
64
|
slot: "get",
|
|
65
65
|
filter: "boolean",
|
|
66
66
|
footerPath: "obj.aloha",
|
|
67
|
+
width: 220,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: "Test",
|
|
71
|
+
id: "test",
|
|
72
|
+
path: "test",
|
|
73
|
+
sortId: "test",
|
|
74
|
+
width: 200,
|
|
67
75
|
},
|
|
68
76
|
{
|
|
69
77
|
label: "Obj2",
|
|
@@ -274,7 +282,7 @@ export default {
|
|
|
274
282
|
|
|
275
283
|
setData() {
|
|
276
284
|
const DATA = [];
|
|
277
|
-
times(
|
|
285
|
+
times(3, item => {
|
|
278
286
|
DATA.push({
|
|
279
287
|
aloha: `aloha${ item }`,
|
|
280
288
|
hola: `hola ${ item }`,
|
|
@@ -282,6 +290,7 @@ export default {
|
|
|
282
290
|
obj: {
|
|
283
291
|
aloha: `ertet ${ 100 - item }`,
|
|
284
292
|
},
|
|
293
|
+
test: "<div>aloha</div><div>aloha</div><div>aloha</div><div>aloha</div><div>aloha</div><div>aloha</div><div>aloha</div>",
|
|
285
294
|
});
|
|
286
295
|
});
|
|
287
296
|
this.data = DATA;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aloha-vue",
|
|
3
3
|
"description": "Project aloha",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.90",
|
|
5
5
|
"author": "Ilia Brykin",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build-icons": "node scriptsNode/iconsSvgToJs.js bootstrap3 && node scriptsNode/iconsSvgToJs.js bootstrap-1-9-1"
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"@popperjs/core": "2.11.5",
|
|
11
11
|
"aloha-css": "1.0.47",
|
|
12
12
|
"axios": "^0.27.2",
|
|
13
|
+
"fecha": "^4.2.3",
|
|
13
14
|
"lodash-es": "^4.17.21",
|
|
14
15
|
"tiny-emitter": "2.1.0",
|
|
15
16
|
"vue": "3.2.37"
|
package/src/AMenu/AMenu.js
CHANGED
|
@@ -16,7 +16,7 @@ import AMenuToggleAPI from "./compositionAPI/AMenuToggleAPI";
|
|
|
16
16
|
import {
|
|
17
17
|
forEach,
|
|
18
18
|
get,
|
|
19
|
-
isNil,
|
|
19
|
+
isNil, keyBy,
|
|
20
20
|
} from "lodash-es";
|
|
21
21
|
|
|
22
22
|
export default {
|
|
@@ -71,6 +71,11 @@ export default {
|
|
|
71
71
|
setup(props) {
|
|
72
72
|
const items = toRef(props, "items");
|
|
73
73
|
const keyParent = toRef(props, "keyParent");
|
|
74
|
+
const keyId = toRef(props, "keyId");
|
|
75
|
+
|
|
76
|
+
const itemsKeyById = computed(() => {
|
|
77
|
+
return keyBy(items.value, keyId.value);
|
|
78
|
+
});
|
|
74
79
|
|
|
75
80
|
const itemsProParent = computed(() => {
|
|
76
81
|
const MAIN = [];
|
|
@@ -102,16 +107,23 @@ export default {
|
|
|
102
107
|
} = AMenuSearchAPI();
|
|
103
108
|
|
|
104
109
|
const {
|
|
110
|
+
clickMenuLink,
|
|
105
111
|
panelParentsOpen,
|
|
106
112
|
togglePanel,
|
|
107
|
-
} = AMenuPanelsAPI(
|
|
113
|
+
} = AMenuPanelsAPI(props, {
|
|
114
|
+
itemsProParent,
|
|
115
|
+
itemsKeyById,
|
|
116
|
+
});
|
|
108
117
|
|
|
118
|
+
provide("clickMenuLink", clickMenuLink);
|
|
109
119
|
provide("togglePanel", togglePanel);
|
|
110
120
|
|
|
111
121
|
const isOpenDefault = toRef(props, "isOpenDefault");
|
|
122
|
+
|
|
112
123
|
initMenuOpenOrClose(isOpenDefault.value);
|
|
113
124
|
|
|
114
125
|
return {
|
|
126
|
+
itemsKeyById,
|
|
115
127
|
itemsProParent,
|
|
116
128
|
panelParentsOpen,
|
|
117
129
|
|
|
@@ -140,9 +152,8 @@ export default {
|
|
|
140
152
|
"onUpdate:modelValue": this.updateModelSearch,
|
|
141
153
|
}),
|
|
142
154
|
h(AMenuBreadcrumbs, {
|
|
143
|
-
|
|
155
|
+
itemsKeyById: this.itemsKeyById,
|
|
144
156
|
isBreadcrumbsAll: this.isBreadcrumbsAll,
|
|
145
|
-
keyId: this.keyId,
|
|
146
157
|
keyLabel: this.keyLabel,
|
|
147
158
|
panelParentsOpen: this.panelParentsOpen,
|
|
148
159
|
}),
|
|
@@ -9,25 +9,20 @@ import AMenuBreadcrumbsItem from "./AMenuBreadcrumbsItem";
|
|
|
9
9
|
import {
|
|
10
10
|
forEach,
|
|
11
11
|
get,
|
|
12
|
-
keyBy,
|
|
13
12
|
} from "lodash-es";
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
export default {
|
|
17
16
|
name: "AMenuBreadcrumbs",
|
|
18
17
|
props: {
|
|
19
|
-
|
|
20
|
-
type:
|
|
18
|
+
itemsKeyById: {
|
|
19
|
+
type: Object,
|
|
21
20
|
required: true,
|
|
22
21
|
},
|
|
23
22
|
isBreadcrumbsAll: {
|
|
24
23
|
type: Boolean,
|
|
25
24
|
required: true,
|
|
26
25
|
},
|
|
27
|
-
keyId: {
|
|
28
|
-
type: String,
|
|
29
|
-
required: true,
|
|
30
|
-
},
|
|
31
26
|
keyLabel: {
|
|
32
27
|
type: String,
|
|
33
28
|
required: true,
|
|
@@ -38,12 +33,8 @@ export default {
|
|
|
38
33
|
},
|
|
39
34
|
},
|
|
40
35
|
setup(props) {
|
|
41
|
-
const keyId = toRef(props, "keyId");
|
|
42
36
|
const keyLabel = toRef(props, "keyLabel");
|
|
43
|
-
const
|
|
44
|
-
const itemsKeyById = computed(() => {
|
|
45
|
-
return keyBy(items.value, keyId.value);
|
|
46
|
-
});
|
|
37
|
+
const itemsKeyById = toRef(props, "itemsKeyById");
|
|
47
38
|
|
|
48
39
|
const panelParentsOpen = toRef(props, "panelParentsOpen");
|
|
49
40
|
const isBreadcrumbsAll = toRef(props, "isBreadcrumbsAll");
|
|
@@ -72,7 +63,6 @@ export default {
|
|
|
72
63
|
|
|
73
64
|
return {
|
|
74
65
|
breadcrumbsItems,
|
|
75
|
-
itemsKeyById,
|
|
76
66
|
};
|
|
77
67
|
},
|
|
78
68
|
render() {
|
|
@@ -81,7 +81,13 @@ export default {
|
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
+
const clickMenuLink = inject("clickMenuLink");
|
|
85
|
+
const clickLink = () => {
|
|
86
|
+
clickMenuLink();
|
|
87
|
+
};
|
|
88
|
+
|
|
84
89
|
return {
|
|
90
|
+
clickLink,
|
|
85
91
|
icon,
|
|
86
92
|
label,
|
|
87
93
|
onKeydown,
|
|
@@ -114,6 +120,7 @@ export default {
|
|
|
114
120
|
class: "a_menu__link",
|
|
115
121
|
to: this.item.to,
|
|
116
122
|
tabindex: this.isPanelOpen ? 0 : -1,
|
|
123
|
+
onClick: this.clickLink,
|
|
117
124
|
}, () => ICON_AND_TEXT) :
|
|
118
125
|
h("a", {
|
|
119
126
|
class: "a_menu__link a_menu__link_btn",
|
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
|
+
computed,
|
|
3
|
+
getCurrentInstance,
|
|
2
4
|
ref,
|
|
5
|
+
toRef,
|
|
6
|
+
watch,
|
|
3
7
|
} from "vue";
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
import {
|
|
10
|
+
forEach,
|
|
11
|
+
get,
|
|
12
|
+
} from "lodash-es";
|
|
13
|
+
|
|
14
|
+
export default function AMenuPanelsAPI(props, {
|
|
15
|
+
itemsProParent = computed(() => ({
|
|
16
|
+
main: [],
|
|
17
|
+
children: {},
|
|
18
|
+
})),
|
|
19
|
+
itemsKeyById = computed(() => ({})),
|
|
20
|
+
}) {
|
|
21
|
+
const keyParent = toRef(props, "keyParent");
|
|
22
|
+
const APP = getCurrentInstance();
|
|
23
|
+
const $router = APP.appContext.config.globalProperties.$router;
|
|
24
|
+
|
|
6
25
|
const panelParentsOpen = ref([]);
|
|
26
|
+
const isMenuLinkClicked = ref(false);
|
|
7
27
|
|
|
8
28
|
const togglePanel = ({ parentId }) => {
|
|
9
29
|
const INDEX = panelParentsOpen.value.indexOf(parentId);
|
|
@@ -14,7 +34,62 @@ export default function AMenuPanelsAPI() {
|
|
|
14
34
|
}
|
|
15
35
|
};
|
|
16
36
|
|
|
37
|
+
const setPanelParentsOpen = ({ route = {}, panelParentsOpenLocal = [] }) => {
|
|
38
|
+
const PARENT_ID = get(route, keyParent.value);
|
|
39
|
+
if (PARENT_ID) {
|
|
40
|
+
panelParentsOpenLocal.unshift(PARENT_ID);
|
|
41
|
+
setPanelParentsOpen({ route: itemsKeyById.value[PARENT_ID], panelParentsOpenLocal });
|
|
42
|
+
}
|
|
43
|
+
return panelParentsOpenLocal;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const checkRouteInPanel = ({ routes = [], currentFullPath = "/" }) => {
|
|
47
|
+
let isRouteFound = false;
|
|
48
|
+
forEach(routes, route => {
|
|
49
|
+
if (route.to) {
|
|
50
|
+
const { fullPath } = $router.resolve(route.to);
|
|
51
|
+
if (fullPath === currentFullPath) {
|
|
52
|
+
const panelParentsOpenLocal = [];
|
|
53
|
+
panelParentsOpen.value = setPanelParentsOpen({ route, panelParentsOpenLocal });
|
|
54
|
+
isRouteFound = true;
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return isRouteFound;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const checkAllRoutes = () => {
|
|
63
|
+
const FULL_PATH = $router.currentRoute.value.fullPath;
|
|
64
|
+
let isRouteFound = false;
|
|
65
|
+
isRouteFound = checkRouteInPanel({ routes: itemsProParent.value.main, currentFullPath: FULL_PATH });
|
|
66
|
+
if (isRouteFound) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
forEach(itemsProParent.value.children, panelRoutes => {
|
|
70
|
+
isRouteFound = checkRouteInPanel({ routes: panelRoutes, currentFullPath: FULL_PATH });
|
|
71
|
+
if (isRouteFound) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const clickMenuLink = () => {
|
|
78
|
+
isMenuLinkClicked.value = true;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
watch($router.currentRoute, () => {
|
|
82
|
+
if (isMenuLinkClicked.value) {
|
|
83
|
+
isMenuLinkClicked.value = false;
|
|
84
|
+
} else {
|
|
85
|
+
checkAllRoutes();
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
immediate: true,
|
|
89
|
+
});
|
|
90
|
+
|
|
17
91
|
return {
|
|
92
|
+
clickMenuLink,
|
|
18
93
|
panelParentsOpen,
|
|
19
94
|
togglePanel
|
|
20
95
|
};
|
|
@@ -77,7 +77,7 @@ export default {
|
|
|
77
77
|
return h("div", {
|
|
78
78
|
role: "cell",
|
|
79
79
|
class: "a_table__td a_table__cell a_table__cell_action",
|
|
80
|
-
style: this.stylesTdAction,
|
|
80
|
+
// style: this.stylesTdAction,
|
|
81
81
|
}, [
|
|
82
82
|
this.isColumnsScrollInvisibleDropdownVisible && h(ADropdown, {
|
|
83
83
|
buttonClass: "a_btn a_btn_link",
|
|
@@ -29,7 +29,8 @@ export default function ScrollControlAPI(props, { emit }, {
|
|
|
29
29
|
});
|
|
30
30
|
const columnsSpecialWidth = computed(() => {
|
|
31
31
|
const columnMultipleActionsWidth = isMultipleActionsActive.value ? 50 : 0;
|
|
32
|
-
|
|
32
|
+
const scrollBarWidth = 10;
|
|
33
|
+
return columnMultipleActionsWidth + columnActionsWidthLocal.value + scrollBarWidth;
|
|
33
34
|
});
|
|
34
35
|
|
|
35
36
|
const tableWidth = ref(undefined);
|
|
@@ -106,13 +107,13 @@ export default function ScrollControlAPI(props, { emit }, {
|
|
|
106
107
|
setColumnsScrollInvisible();
|
|
107
108
|
};
|
|
108
109
|
|
|
109
|
-
|
|
110
110
|
const resizeOb = new ResizeObserver(entries => {
|
|
111
111
|
// since we are observing only a single element, so we access the first element in entries array
|
|
112
112
|
const RECT = entries[0].contentRect;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
if (tableWidth.value !== RECT.width) {
|
|
114
|
+
tableWidth.value = RECT.width;
|
|
115
|
+
checkVisibleColumns();
|
|
116
|
+
}
|
|
116
117
|
});
|
|
117
118
|
|
|
118
119
|
onMounted(() => {
|
|
@@ -122,6 +123,7 @@ export default function ScrollControlAPI(props, { emit }, {
|
|
|
122
123
|
resizeOb.unobserve(aTableRef.value);
|
|
123
124
|
});
|
|
124
125
|
|
|
126
|
+
|
|
125
127
|
return {
|
|
126
128
|
aTableRef,
|
|
127
129
|
changeModelIsTableWithoutScroll,
|
package/src/const/AKeysCode.js
CHANGED