aloha-vue 2.74.0 → 2.75.0
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/CHANGELOG.md +8 -0
- package/LICENSE +22 -21
- package/dist/aloha-vue.css +13594 -13594
- package/dist/aloha-vue.css.map +1 -1
- package/dist/aloha-vue.es.js +59266 -64918
- package/dist/aloha-vue.umd.js +338 -211
- package/package.json +27 -34
- package/scss/components/ATable.scss +2 -2
- package/scss/utils/button.scss +362 -362
- package/scss/utils/funktions.scss +162 -162
- package/src/AAccordion/AAccordionItem/AAccordionItem.js +235 -230
- package/src/ACarousel/ACarousel.js +7 -2
- package/src/ADropdown/ADropdown.js +4 -1
- package/src/AFilters/AFilterCenter/AFilterCenter.js +5 -1
- package/src/AFilters/AFilterCenter/AFilterCenterItem/AFilterCenterItem.js +7 -2
- package/src/AFilters/AFiltersHorizontal/AFiltersHorizontal.js +412 -396
- package/src/AFilters/AFiltersHorizontal/AFiltersHorizontalFilter/AFiltersHorizontalFilter.js +102 -99
- package/src/AFilters/AFiltersHorizontal/compositionAPI/FiltersSavedDeleteAPI.js +108 -108
- package/src/AFilters/AFiltersMain/AFiltersMain.js +114 -111
- package/src/AFilters/AFiltersSaveModal/compositionAPI/SaveAPI.js +65 -65
- package/src/ALinkCopy/ALinkCopy.js +98 -95
- package/src/ALinkCopy/compositionAPI/CopyAPI.js +48 -48
- package/src/AList/__tests__/AList.test.js +33 -33
- package/src/AList/compositionAPI/__tests__/TagAPI.test.js +43 -43
- package/src/AMenu/AMenu.js +4 -1
- package/src/AMenu/AMenuBreadcrumbs/AMenuBreadcrumbs.js +240 -237
- package/src/AMenu/AMenuPanelLink/AMenuPanelLink.js +4 -1
- package/src/AMenu/AMenuSearchPanelBreadcrumbs/AMenuSearchPanelBreadcrumbs.js +122 -119
- package/src/AModalWizard/AModalWizard.js +58 -53
- package/src/AModalWizard/compositionAPI/__tests__/ScrollAPI.test.js +46 -46
- package/src/APagination/APaginationPages/APaginationPages.js +15 -4
- package/src/ARate/ARate.js +254 -249
- package/src/ARate/ARateIcon/ADecimalIcon/ADecimalIcon.js +53 -50
- package/src/ARate/ARateIcon/ARateIcon.js +109 -104
- package/src/AResizer/AResizer.js +167 -162
- package/src/ATable/ATableHeaderTh/compositionAPI/SortAPI.js +172 -167
- package/src/ATable/ATableHeaderThAction/ATableHeaderThAction.js +14 -4
- package/src/ATable/ATableHeaderThAction/ATableHeaderThActionItem/ATableHeaderThActionItem.js +191 -184
- package/src/ATable/ATablePreviewDown/ATablePreviewDown.js +72 -69
- package/src/ATable/ATablePreviewRight/ATablePreviewRight.js +265 -258
- package/src/ATable/ATableSortingAdditional/ATableSortingAdditional.js +224 -219
- package/src/ATable/ATableSortingAdditional/__tests__/ATableSortingAdditional.AttributesAPI.test.js +39 -39
- package/src/ATable/ATableSortingAdditional/__tests__/ATableSortingAdditional.ColumnsAPI.test.js +68 -68
- package/src/ATable/ATableSortingAdditional/__tests__/ATableSortingAdditional.DropdownAPI.test.js +45 -45
- package/src/ATable/ATableSortingAdditional/__tests__/ATableSortingAdditional.FormAPI.test.js +95 -95
- package/src/ATable/ATableSortingAdditional/__tests__/ATableSortingAdditional.ModelAPI.test.js +1 -1
- package/src/ATable/ATableTd/ATableTd.js +4 -1
- package/src/ATable/ATableTdAction/ATableTdAction.js +19 -12
- package/src/ATable/ATableTopPanel/ATableTopPanel.js +11 -3
- package/src/ATable/ATableTr/ATableTr.js +408 -405
- package/src/ATable/__tests__/ATable.HeaderSlot.test.js +102 -97
- package/src/ATable/__tests__/ATable.RowIdsAPI.test.js +66 -66
- package/src/ATableForm/ATableForm.js +88 -85
- package/src/ATableForm/ATableFormCellAction/ATableFormCellAction.js +14 -4
- package/src/ATableForm/ATableFormCellDnd/ATableFormCellDnd.js +196 -187
- package/src/ATableForm/ATableFormRow/compositionAPI/EditAPI.js +104 -104
- package/src/ATableForm/__tests__/ATableForm.DragAndDropAPI.test.js +200 -212
- package/src/ATableForm/__tests__/ATableForm.ListView.test.js +134 -174
- package/src/ATableForm/compositionAPI/IconsAPI.js +24 -21
- package/src/AVerticalScroll/AVerticalScroll.js +182 -177
- package/src/AWizard/AWizard.js +26 -21
- package/src/AWizard/AWizardStep/AWizardStep.js +275 -270
- package/src/AWizard/compositionAPI/__tests__/ChangeStepAPI.test.js +32 -32
- package/src/AWizard/compositionAPI/__tests__/LocalAPI.test.js +55 -55
- package/src/PuxDatepicker/PuxDatepickerCalendarPanel/PuxDatepickerCalendarPanel.js +646 -648
- package/src/PuxDatepicker/panel/PanelDate/PanelDate.js +300 -301
- package/src/PuxDatepicker/panel/PanelMonth/PanelMonth.js +148 -149
- package/src/PuxDatepicker/panel/PanelTime/PanelTime.js +256 -257
- package/src/PuxDatepicker/panel/PanelYear/PanelYear.js +136 -137
- package/src/PuxDatepicker/utils/index.js +100 -100
- package/src/compositionAPI/AHttpAPI.js +593 -593
- package/src/compositionAPI/__tests__/AHttpAPI.test.js +42 -42
- package/src/filters/__tests__/filterBoolean.test.js +38 -38
- package/src/filters/__tests__/filterCapitalize.test.js +38 -38
- package/src/filters/__tests__/filterCurrency.test.js +21 -21
- package/src/filters/__tests__/filterDate.test.js +42 -42
- package/src/filters/__tests__/filterDefaultForEmpty.test.js +24 -24
- package/src/filters/__tests__/filterEmail.test.js +42 -42
- package/src/filters/__tests__/filterEscapeHtml.test.js +45 -45
- package/src/filters/__tests__/filterFileSize.test.js +45 -45
- package/src/filters/__tests__/filterFloat.test.js +74 -74
- package/src/filters/__tests__/filterJson.test.js +74 -74
- package/src/filters/__tests__/filterKeyValue.test.js +50 -50
- package/src/filters/__tests__/filterLimitTo.test.js +39 -39
- package/src/filters/__tests__/filterLink.test.js +41 -41
- package/src/filters/__tests__/filterList.test.js +149 -149
- package/src/filters/__tests__/filterLowerCase.test.js +38 -38
- package/src/filters/__tests__/filterMask.test.js +80 -80
- package/src/filters/__tests__/filterPropertyByValue.test.js +27 -27
- package/src/filters/__tests__/filterSearchHighlight.test.js +129 -129
- package/src/filters/__tests__/filterUpperCase.test.js +38 -38
- package/src/filters/__tests__/filterValueByCondition.test.js +3 -3
- package/src/filters/filterJson.js +39 -39
- package/src/filters/filterValueByCondition.js +2 -2
- package/src/plugins/AAlertPlugin.js +16 -5
- package/src/plugins/AMultiselectOrderedPlugin.js +88 -81
- package/src/plugins/ASelectPlugin.js +12 -10
- package/src/ui/ACheckbox/ACheckbox.js +82 -79
- package/src/ui/ADatepicker/compositionAPI/EventsAPI.js +297 -297
- package/src/ui/ADatepicker/utils/index.js +76 -76
- package/src/ui/ADatepickerAlt/ADatepicker.js +912 -912
- package/src/ui/ADatepickerAlt/utils/index.js +98 -98
- package/src/ui/AFieldset/__tests__/AFieldset.ClassColumn.test.js +113 -114
- package/src/ui/AFormElementBtnClear/AFormElementBtnClear.js +4 -1
- package/src/ui/AInputCurrency/AInputCurrency.js +20 -15
- package/src/ui/AInputCurrency/__tests__/AInputCurrency.ModelAPI.test.js +73 -73
- package/src/ui/AInputNumber/AInputNumber.js +17 -12
- package/src/ui/AJson/AJson.js +12 -3
- package/src/ui/AJson/compositionAPI/JsonAPI.js +116 -116
- package/src/ui/ALabel/__tests__/ALabel.IdAPI.test.js +42 -42
- package/src/ui/ALabel/__tests__/ALabel.LabelAPI.test.js +33 -33
- package/src/ui/ARadio/ARadio.js +80 -77
- package/src/ui/ASelect/ASelect.js +390 -383
- package/src/ui/ASelect/ASelectElement/ASelectElement.js +179 -176
- package/src/ui/ASelect/ASelectValueCloseable/ASelectValueCloseable.js +143 -141
- package/src/ui/ASelect/__tests__/SelectedFirstAPI.test.js +101 -101
- package/src/ui/ASelect/__tests__/SelectedVisibleAPI.test.js +98 -98
- package/src/ui/ASlider/compositionAPI/SliderAPI.js +23 -23
- package/src/ui/AValidatedJson/AValidatedJson.js +4 -1
- package/src/ui/AValidatedJson/AValidatedJsonItem/AValidatedJsonItem.js +308 -298
- package/src/ui/compositionApi/UiCollapseAPI.js +68 -63
- package/src/ui/compositionApi/UiInputAutofillAPI.js +41 -41
- package/src/ui/compositionApi/__tests__/UIDataGroupAPI.test.js +106 -106
- package/src/ui/compositionApi/__tests__/UIExcludeRenderAttributesAPI.test.js +39 -39
- package/src/ui/compositionApi/__tests__/UiDataWithKeyIdAndLabelAPI.test.js +128 -128
- package/src/ui/compositionApi/__tests__/UiSearchAPI.test.js +71 -71
- package/src/utils/EventBus.js +51 -8
- package/src/utils/__tests__/EventBus.test.js +138 -0
- package/src/utils/__tests__/utils.aOrderBy.test.js +1 -1
- package/src/utils/__tests__/utils.aSortBy.test.js +1 -1
- package/src/utils/__tests__/utils.getTotalNestedCount.test.js +56 -56
- package/src/utils/__tests__/utils.isArrayOfArrays.test.js +44 -44
- package/src/utils/__tests__/utils.isArrayOfStrings.test.js +36 -36
- package/src/utils/__tests__/utilsArray.aFirst.test.js +1 -1
- package/src/utils/__tests__/utilsArray.aLast.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isArguments.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isArray.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isArrayBuffer.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isBoolean.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isBuffer.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isDate.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isElement.test.js +5 -3
- package/src/utils/__tests__/utilsLang.isError.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isFinite.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isFunction.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isInteger.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isMap.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isNaN.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isNil.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isNull.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isNumber.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isObject.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isObjectLike.test.js +5 -3
- package/src/utils/__tests__/utilsLang.isPlainObject.test.js +3 -2
- package/src/utils/__tests__/utilsLang.isPromise.test.js +5 -2
- package/src/utils/__tests__/utilsLang.isRegExp.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isSet.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isString.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isSymbol.test.js +5 -3
- package/src/utils/__tests__/utilsLang.isUndefined.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isWeakMap.test.js +1 -1
- package/src/utils/__tests__/utilsLang.isWeakSet.test.js +1 -1
- package/src/utils/__tests__/utilsMath.isEven.test.js +43 -43
- package/src/utils/__tests__/utilsMath.isOdd.test.js +43 -43
- package/src/utils/__tests__/utilsUi.isModelForFilterNotEmpty.test.js +65 -65
- package/src/utils/autosize.js +1 -1
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
// import fecha from "fecha";
|
|
2
|
-
import moment from "moment";
|
|
3
|
-
|
|
4
|
-
export function isPlainObject(obj) {
|
|
5
|
-
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function isDateObject(value) {
|
|
9
|
-
return value instanceof Date;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function isValidDate(date) {
|
|
13
|
-
if (date === null || date === undefined) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
return !isNaN(new Date(date).getTime());
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function isValidRangeDate(date) {
|
|
20
|
-
return (
|
|
21
|
-
Array.isArray(date) &&
|
|
22
|
-
date.length === 2 &&
|
|
23
|
-
isValidDate(date[0]) &&
|
|
24
|
-
isValidDate(date[1]) &&
|
|
25
|
-
(new Date(date[1]).getTime() >= new Date(date[0]).getTime())
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function parseTime(time) {
|
|
30
|
-
const VALUES = (time || "").split(":");
|
|
31
|
-
if (VALUES.length >= 2) {
|
|
32
|
-
const hours = parseInt(VALUES[0], 10);
|
|
33
|
-
const minutes = parseInt(VALUES[1], 10);
|
|
34
|
-
return {
|
|
35
|
-
hours,
|
|
36
|
-
minutes,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function formatTime(time, type = "24", a = "a") {
|
|
43
|
-
let hours = time.hours;
|
|
44
|
-
hours = (type === "24") ? hours : (hours % 12 || 12);
|
|
45
|
-
hours = hours < 10 ? "0" + hours : hours;
|
|
46
|
-
const minutes = time.minutes < 10 ? "0" + time.minutes : time.minutes;
|
|
47
|
-
let result = hours + ":" + minutes;
|
|
48
|
-
if (type === "12") {
|
|
49
|
-
let suffix = time.hours >= 12 ? "pm" : "am";
|
|
50
|
-
if (a === "A") {
|
|
51
|
-
suffix = suffix.toUpperCase();
|
|
52
|
-
}
|
|
53
|
-
result = `${ result } ${ suffix }`;
|
|
54
|
-
}
|
|
55
|
-
return result;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function formatDate(date, format) {
|
|
59
|
-
if (!date) {
|
|
60
|
-
return "";
|
|
61
|
-
}
|
|
62
|
-
try {
|
|
63
|
-
return moment(date).format(format);
|
|
64
|
-
// return fecha.format(new Date(date), format);
|
|
65
|
-
} catch
|
|
66
|
-
return "";
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function parseDate(value, format, formatSave) {
|
|
71
|
-
try {
|
|
72
|
-
return moment(value, formatSave).format(format) || null;
|
|
73
|
-
} catch
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function throttle(action, delay) {
|
|
79
|
-
let lastRun = 0;
|
|
80
|
-
let timeout = null;
|
|
81
|
-
return function() {
|
|
82
|
-
if (timeout) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const args = arguments;
|
|
86
|
-
const elapsed = Date.now() - lastRun;
|
|
87
|
-
const callBack = () => {
|
|
88
|
-
lastRun = Date.now();
|
|
89
|
-
timeout = null;
|
|
90
|
-
action.apply(this, args);
|
|
91
|
-
};
|
|
92
|
-
if (elapsed >= delay) {
|
|
93
|
-
callBack();
|
|
94
|
-
} else {
|
|
95
|
-
timeout = setTimeout(callBack, delay);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
}
|
|
1
|
+
// import fecha from "fecha";
|
|
2
|
+
import moment from "moment";
|
|
3
|
+
|
|
4
|
+
export function isPlainObject(obj) {
|
|
5
|
+
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function isDateObject(value) {
|
|
9
|
+
return value instanceof Date;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function isValidDate(date) {
|
|
13
|
+
if (date === null || date === undefined) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return !isNaN(new Date(date).getTime());
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function isValidRangeDate(date) {
|
|
20
|
+
return (
|
|
21
|
+
Array.isArray(date) &&
|
|
22
|
+
date.length === 2 &&
|
|
23
|
+
isValidDate(date[0]) &&
|
|
24
|
+
isValidDate(date[1]) &&
|
|
25
|
+
(new Date(date[1]).getTime() >= new Date(date[0]).getTime())
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function parseTime(time) {
|
|
30
|
+
const VALUES = (time || "").split(":");
|
|
31
|
+
if (VALUES.length >= 2) {
|
|
32
|
+
const hours = parseInt(VALUES[0], 10);
|
|
33
|
+
const minutes = parseInt(VALUES[1], 10);
|
|
34
|
+
return {
|
|
35
|
+
hours,
|
|
36
|
+
minutes,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function formatTime(time, type = "24", a = "a") {
|
|
43
|
+
let hours = time.hours;
|
|
44
|
+
hours = (type === "24") ? hours : (hours % 12 || 12);
|
|
45
|
+
hours = hours < 10 ? "0" + hours : hours;
|
|
46
|
+
const minutes = time.minutes < 10 ? "0" + time.minutes : time.minutes;
|
|
47
|
+
let result = hours + ":" + minutes;
|
|
48
|
+
if (type === "12") {
|
|
49
|
+
let suffix = time.hours >= 12 ? "pm" : "am";
|
|
50
|
+
if (a === "A") {
|
|
51
|
+
suffix = suffix.toUpperCase();
|
|
52
|
+
}
|
|
53
|
+
result = `${ result } ${ suffix }`;
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function formatDate(date, format) {
|
|
59
|
+
if (!date) {
|
|
60
|
+
return "";
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
return moment(date).format(format);
|
|
64
|
+
// return fecha.format(new Date(date), format);
|
|
65
|
+
} catch(e) {
|
|
66
|
+
return "";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function parseDate(value, format, formatSave) {
|
|
71
|
+
try {
|
|
72
|
+
return moment(value, formatSave).format(format) || null;
|
|
73
|
+
} catch(e) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function throttle(action, delay) {
|
|
79
|
+
let lastRun = 0;
|
|
80
|
+
let timeout = null;
|
|
81
|
+
return function() {
|
|
82
|
+
if (timeout) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const args = arguments;
|
|
86
|
+
const elapsed = Date.now() - lastRun;
|
|
87
|
+
const callBack = () => {
|
|
88
|
+
lastRun = Date.now();
|
|
89
|
+
timeout = null;
|
|
90
|
+
action.apply(this, args);
|
|
91
|
+
};
|
|
92
|
+
if (elapsed >= delay) {
|
|
93
|
+
callBack();
|
|
94
|
+
} else {
|
|
95
|
+
timeout = setTimeout(callBack, delay);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
@@ -1,114 +1,113 @@
|
|
|
1
|
-
import {
|
|
2
|
-
h,
|
|
3
|
-
} from "vue";
|
|
4
|
-
import {
|
|
5
|
-
afterEach,
|
|
6
|
-
describe,
|
|
7
|
-
expect,
|
|
8
|
-
it,
|
|
9
|
-
|
|
10
|
-
} from "
|
|
11
|
-
import {
|
|
12
|
-
mount,
|
|
13
|
-
} from "@vue/test-utils";
|
|
14
|
-
|
|
15
|
-
import AFieldset from "../AFieldset";
|
|
16
|
-
import {
|
|
17
|
-
AFormPluginOptions,
|
|
18
|
-
} from "../../../plugins/AFormPlugin";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const {
|
|
22
|
-
computed,
|
|
23
|
-
h: hLocal,
|
|
24
|
-
ref,
|
|
25
|
-
} =
|
|
26
|
-
const {
|
|
27
|
-
AFormPluginOptions: pluginOptions,
|
|
28
|
-
} =
|
|
29
|
-
|
|
30
|
-
const componentStub = {
|
|
31
|
-
render() {
|
|
32
|
-
return hLocal("div");
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
AElement: componentStub,
|
|
38
|
-
AErrorsText: componentStub,
|
|
39
|
-
AFormHelpText: componentStub,
|
|
40
|
-
AFormLabelDescription: componentStub,
|
|
41
|
-
AFormPluginOptions: pluginOptions,
|
|
42
|
-
AFormReadonly: componentStub,
|
|
43
|
-
AGroup: componentStub,
|
|
44
|
-
AUiTypes_typesContainer: ref({}),
|
|
45
|
-
UiAPI: props => ({
|
|
46
|
-
ariaDescribedbyLocal: computed(() => undefined),
|
|
47
|
-
errorsId: computed(() => `${ props.id }_errors`),
|
|
48
|
-
helpTextId: computed(() => `${ props.id }_help`),
|
|
49
|
-
htmlIdLocal: computed(() => props.htmlId || props.id),
|
|
50
|
-
isErrors: computed(() => false),
|
|
51
|
-
labelDescriptionId: computed(() => `${ props.id }_description`),
|
|
52
|
-
}),
|
|
53
|
-
UiCollapseAPI: () => ({
|
|
54
|
-
iconCollapse: computed(() => undefined),
|
|
55
|
-
initIsCollapsedLocal: () => {},
|
|
56
|
-
isCollapsedLocal: ref(false),
|
|
57
|
-
titleCollapse: computed(() => undefined),
|
|
58
|
-
toggleCollapse: () => {},
|
|
59
|
-
}),
|
|
60
|
-
UIExcludeRenderAttributesAPI: () => ({
|
|
61
|
-
attributesToExcludeFromRender: computed(() => ({})),
|
|
62
|
-
}),
|
|
63
|
-
UiStyleHideAPI: () => ({
|
|
64
|
-
componentStyleHide: computed(() => ""),
|
|
65
|
-
}),
|
|
66
|
-
UiTextAfterLabelAPI: () => ({
|
|
67
|
-
textAfterLabel: computed(() => ""),
|
|
68
|
-
}),
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
expect(child.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
});
|
|
1
|
+
import {
|
|
2
|
+
h,
|
|
3
|
+
} from "vue";
|
|
4
|
+
import {
|
|
5
|
+
afterEach,
|
|
6
|
+
describe,
|
|
7
|
+
expect,
|
|
8
|
+
it,
|
|
9
|
+
vi,
|
|
10
|
+
} from "vitest";
|
|
11
|
+
import {
|
|
12
|
+
mount,
|
|
13
|
+
} from "@vue/test-utils";
|
|
14
|
+
|
|
15
|
+
import AFieldset from "../AFieldset";
|
|
16
|
+
import {
|
|
17
|
+
AFormPluginOptions,
|
|
18
|
+
} from "../../../plugins/AFormPlugin";
|
|
19
|
+
|
|
20
|
+
vi.mock("../../../index", async() => {
|
|
21
|
+
const {
|
|
22
|
+
computed,
|
|
23
|
+
h: hLocal,
|
|
24
|
+
ref,
|
|
25
|
+
} = await vi.importActual("vue");
|
|
26
|
+
const {
|
|
27
|
+
AFormPluginOptions: pluginOptions,
|
|
28
|
+
} = await vi.importActual("../../../plugins/AFormPlugin");
|
|
29
|
+
|
|
30
|
+
const componentStub = {
|
|
31
|
+
render() {
|
|
32
|
+
return hLocal("div");
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
AElement: componentStub,
|
|
38
|
+
AErrorsText: componentStub,
|
|
39
|
+
AFormHelpText: componentStub,
|
|
40
|
+
AFormLabelDescription: componentStub,
|
|
41
|
+
AFormPluginOptions: pluginOptions,
|
|
42
|
+
AFormReadonly: componentStub,
|
|
43
|
+
AGroup: componentStub,
|
|
44
|
+
AUiTypes_typesContainer: ref({}),
|
|
45
|
+
UiAPI: props => ({
|
|
46
|
+
ariaDescribedbyLocal: computed(() => undefined),
|
|
47
|
+
errorsId: computed(() => `${ props.id }_errors`),
|
|
48
|
+
helpTextId: computed(() => `${ props.id }_help`),
|
|
49
|
+
htmlIdLocal: computed(() => props.htmlId || props.id),
|
|
50
|
+
isErrors: computed(() => false),
|
|
51
|
+
labelDescriptionId: computed(() => `${ props.id }_description`),
|
|
52
|
+
}),
|
|
53
|
+
UiCollapseAPI: () => ({
|
|
54
|
+
iconCollapse: computed(() => undefined),
|
|
55
|
+
initIsCollapsedLocal: () => {},
|
|
56
|
+
isCollapsedLocal: ref(false),
|
|
57
|
+
titleCollapse: computed(() => undefined),
|
|
58
|
+
toggleCollapse: () => {},
|
|
59
|
+
}),
|
|
60
|
+
UIExcludeRenderAttributesAPI: () => ({
|
|
61
|
+
attributesToExcludeFromRender: computed(() => ({})),
|
|
62
|
+
}),
|
|
63
|
+
UiStyleHideAPI: () => ({
|
|
64
|
+
componentStyleHide: computed(() => ""),
|
|
65
|
+
}),
|
|
66
|
+
UiTextAfterLabelAPI: () => ({
|
|
67
|
+
textAfterLabel: computed(() => ""),
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
vi.mock("../../AUiComponents", () => ({
|
|
73
|
+
default: {},
|
|
74
|
+
}));
|
|
75
|
+
|
|
76
|
+
const COMPONENTS_ORIGINAL = AFormPluginOptions.components;
|
|
77
|
+
|
|
78
|
+
afterEach(() => {
|
|
79
|
+
AFormPluginOptions.components = COMPONENTS_ORIGINAL;
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
describe("AFieldset classColumn", () => {
|
|
83
|
+
it("applies classColumn to the child component without a wrapper element", () => {
|
|
84
|
+
AFormPluginOptions.components = {
|
|
85
|
+
testColumn: {
|
|
86
|
+
inheritAttrs: false,
|
|
87
|
+
render() {
|
|
88
|
+
return h("section", {
|
|
89
|
+
...this.$attrs,
|
|
90
|
+
"data-testid": "child",
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const wrapper = mount(AFieldset, {
|
|
97
|
+
props: {
|
|
98
|
+
children: [{
|
|
99
|
+
classColumn: "test_column",
|
|
100
|
+
id: "child",
|
|
101
|
+
type: "testColumn",
|
|
102
|
+
}],
|
|
103
|
+
modelValue: {},
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const content = wrapper.get(".a_fieldset__content");
|
|
108
|
+
const child = content.get("[data-testid='child']");
|
|
109
|
+
|
|
110
|
+
expect(child.classes()).toContain("test_column");
|
|
111
|
+
expect(child.element.parentElement).toBe(content.element);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -7,7 +7,10 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import ClearAPI from "./compositionAPI/ClearAPI";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const XLg = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">
|
|
11
|
+
<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"/>
|
|
12
|
+
</svg>`;
|
|
13
|
+
|
|
11
14
|
|
|
12
15
|
export default {
|
|
13
16
|
name: "AFormElementBtnClear",
|
|
@@ -30,12 +30,17 @@ import VerifyAPI from "./compositionAPI/VerifyAPI";
|
|
|
30
30
|
import WidthAPI from "./compositionAPI/WidthAPI";
|
|
31
31
|
|
|
32
32
|
import ASafeHtml from "../../directives/ASafeHtml";
|
|
33
|
-
import Dash from "aloha-svg/dist/js/bootstrap/Dash";
|
|
34
|
-
import Plus from "aloha-svg/dist/js/bootstrap/Plus";
|
|
35
33
|
import {
|
|
36
34
|
uniqueId,
|
|
37
35
|
} from "lodash-es";
|
|
38
36
|
|
|
37
|
+
const Dash = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-dash" viewBox="0 0 16 16">
|
|
38
|
+
<path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8"/>
|
|
39
|
+
</svg>`;
|
|
40
|
+
const Plus = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-plus" viewBox="0 0 16 16">
|
|
41
|
+
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/>
|
|
42
|
+
</svg>`;
|
|
43
|
+
|
|
39
44
|
export default {
|
|
40
45
|
name: "AInputCurrency",
|
|
41
46
|
inheritAttrs: false,
|
|
@@ -353,10 +358,10 @@ export default {
|
|
|
353
358
|
} = VerifyAPI(props);
|
|
354
359
|
|
|
355
360
|
const {
|
|
356
|
-
clearModel,
|
|
357
|
-
displayValue,
|
|
358
|
-
displayValueReadonly,
|
|
359
|
-
initLocalVars,
|
|
361
|
+
clearModel,
|
|
362
|
+
displayValue,
|
|
363
|
+
displayValueReadonly,
|
|
364
|
+
initLocalVars,
|
|
360
365
|
isInternalChange,
|
|
361
366
|
localModel,
|
|
362
367
|
modelNumber,
|
|
@@ -416,10 +421,10 @@ export default {
|
|
|
416
421
|
attributesToExcludeFromRender,
|
|
417
422
|
clearModel,
|
|
418
423
|
componentStyleHide,
|
|
419
|
-
decrease,
|
|
420
|
-
displayValue,
|
|
421
|
-
displayValueReadonly,
|
|
422
|
-
errorsId,
|
|
424
|
+
decrease,
|
|
425
|
+
displayValue,
|
|
426
|
+
displayValueReadonly,
|
|
427
|
+
errorsId,
|
|
423
428
|
hasErrorIcon,
|
|
424
429
|
handleInput,
|
|
425
430
|
handleKeydown,
|
|
@@ -454,7 +459,7 @@ export default {
|
|
|
454
459
|
label: this.label,
|
|
455
460
|
labelClass: this.labelClass,
|
|
456
461
|
labelScreenReader: this.labelScreenReader,
|
|
457
|
-
modelValue: this.displayValueReadonly,
|
|
462
|
+
modelValue: this.displayValueReadonly,
|
|
458
463
|
readonlyDefault: this.readonlyDefault,
|
|
459
464
|
required: this.required,
|
|
460
465
|
style: this.componentStyleHide,
|
|
@@ -519,10 +524,10 @@ export default {
|
|
|
519
524
|
},
|
|
520
525
|
}, [
|
|
521
526
|
((this.label || this.labelScreenReader) && this.isLabelFloat) ?
|
|
522
|
-
h(ALabel, {
|
|
523
|
-
id: this.htmlIdLocal,
|
|
524
|
-
extra: this.extra,
|
|
525
|
-
isLabelFloat: this.isLabelFloat,
|
|
527
|
+
h(ALabel, {
|
|
528
|
+
id: this.htmlIdLocal,
|
|
529
|
+
extra: this.extra,
|
|
530
|
+
isLabelFloat: this.isLabelFloat,
|
|
526
531
|
isError: this.isErrors,
|
|
527
532
|
label: this.label,
|
|
528
533
|
labelClass: this.labelClass,
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
reactive,
|
|
3
|
-
} from "vue";
|
|
4
|
-
import {
|
|
5
|
-
describe,
|
|
6
|
-
expect,
|
|
7
|
-
it,
|
|
8
|
-
} from "
|
|
9
|
-
|
|
10
|
-
import ModelAPI from "../compositionAPI/ModelAPI";
|
|
11
|
-
|
|
12
|
-
const getModelAPI = () => {
|
|
13
|
-
const props = reactive({
|
|
14
|
-
currencySymbol: "€",
|
|
15
|
-
currencySymbolPosition: "right",
|
|
16
|
-
decimalDivider: ",",
|
|
17
|
-
decimalPartLength: 2,
|
|
18
|
-
disabled: false,
|
|
19
|
-
modelType: "number",
|
|
20
|
-
modelUndefined: undefined,
|
|
21
|
-
modelValue: 1234.5,
|
|
22
|
-
required: false,
|
|
23
|
-
skipRequiredModelInit: false,
|
|
24
|
-
thousandDivider: ".",
|
|
25
|
-
});
|
|
26
|
-
const modelAPI = ModelAPI(props, {
|
|
27
|
-
adjustFloatPartAndDivider: () => "1.234,50",
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
modelAPI.initLocalVars();
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
modelAPI,
|
|
34
|
-
props,
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
describe("AInputCurrency ModelAPI", () => {
|
|
39
|
-
it("adds the currency symbol to the readonly display value at the configured position", () => {
|
|
40
|
-
const {
|
|
41
|
-
modelAPI,
|
|
42
|
-
props,
|
|
43
|
-
} = getModelAPI();
|
|
44
|
-
|
|
45
|
-
expect(modelAPI.displayValueReadonly.value).toBe("1.234,50 €");
|
|
46
|
-
|
|
47
|
-
props.currencySymbol = "$";
|
|
48
|
-
props.currencySymbolPosition = "left";
|
|
49
|
-
|
|
50
|
-
expect(modelAPI.displayValueReadonly.value).toBe("$ 1.234,50");
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it("does not add the currency symbol to an empty readonly display value", () => {
|
|
54
|
-
const {
|
|
55
|
-
modelAPI,
|
|
56
|
-
} = getModelAPI();
|
|
57
|
-
|
|
58
|
-
modelAPI.displayValue.value = "";
|
|
59
|
-
|
|
60
|
-
expect(modelAPI.displayValueReadonly.value).toBe("");
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it("keeps the readonly display value unchanged when the currency symbol is empty", () => {
|
|
64
|
-
const {
|
|
65
|
-
modelAPI,
|
|
66
|
-
props,
|
|
67
|
-
} = getModelAPI();
|
|
68
|
-
|
|
69
|
-
props.currencySymbol = "";
|
|
70
|
-
|
|
71
|
-
expect(modelAPI.displayValueReadonly.value).toBe("1.234,50");
|
|
72
|
-
});
|
|
73
|
-
});
|
|
1
|
+
import {
|
|
2
|
+
reactive,
|
|
3
|
+
} from "vue";
|
|
4
|
+
import {
|
|
5
|
+
describe,
|
|
6
|
+
expect,
|
|
7
|
+
it,
|
|
8
|
+
} from "vitest";
|
|
9
|
+
|
|
10
|
+
import ModelAPI from "../compositionAPI/ModelAPI";
|
|
11
|
+
|
|
12
|
+
const getModelAPI = () => {
|
|
13
|
+
const props = reactive({
|
|
14
|
+
currencySymbol: "€",
|
|
15
|
+
currencySymbolPosition: "right",
|
|
16
|
+
decimalDivider: ",",
|
|
17
|
+
decimalPartLength: 2,
|
|
18
|
+
disabled: false,
|
|
19
|
+
modelType: "number",
|
|
20
|
+
modelUndefined: undefined,
|
|
21
|
+
modelValue: 1234.5,
|
|
22
|
+
required: false,
|
|
23
|
+
skipRequiredModelInit: false,
|
|
24
|
+
thousandDivider: ".",
|
|
25
|
+
});
|
|
26
|
+
const modelAPI = ModelAPI(props, {
|
|
27
|
+
adjustFloatPartAndDivider: () => "1.234,50",
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
modelAPI.initLocalVars();
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
modelAPI,
|
|
34
|
+
props,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
describe("AInputCurrency ModelAPI", () => {
|
|
39
|
+
it("adds the currency symbol to the readonly display value at the configured position", () => {
|
|
40
|
+
const {
|
|
41
|
+
modelAPI,
|
|
42
|
+
props,
|
|
43
|
+
} = getModelAPI();
|
|
44
|
+
|
|
45
|
+
expect(modelAPI.displayValueReadonly.value).toBe("1.234,50 €");
|
|
46
|
+
|
|
47
|
+
props.currencySymbol = "$";
|
|
48
|
+
props.currencySymbolPosition = "left";
|
|
49
|
+
|
|
50
|
+
expect(modelAPI.displayValueReadonly.value).toBe("$ 1.234,50");
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("does not add the currency symbol to an empty readonly display value", () => {
|
|
54
|
+
const {
|
|
55
|
+
modelAPI,
|
|
56
|
+
} = getModelAPI();
|
|
57
|
+
|
|
58
|
+
modelAPI.displayValue.value = "";
|
|
59
|
+
|
|
60
|
+
expect(modelAPI.displayValueReadonly.value).toBe("");
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("keeps the readonly display value unchanged when the currency symbol is empty", () => {
|
|
64
|
+
const {
|
|
65
|
+
modelAPI,
|
|
66
|
+
props,
|
|
67
|
+
} = getModelAPI();
|
|
68
|
+
|
|
69
|
+
props.currencySymbol = "";
|
|
70
|
+
|
|
71
|
+
expect(modelAPI.displayValueReadonly.value).toBe("1.234,50");
|
|
72
|
+
});
|
|
73
|
+
});
|