aloha-vue 1.2.110 → 1.2.112

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.
@@ -11,6 +11,8 @@ isArrayOfArrays([[], [], []]);
11
11
  isArrayOfArrays([1, 2, 3]);
12
12
  // ${ isArrayOfArrays([1, 2, 3]) }
13
13
 
14
+ isArrayOfArrays([]);
15
+ // ${ isArrayOfArrays([]) }
14
16
  isArrayOfArrays("Aloha");
15
17
  // ${ isArrayOfArrays("Aloha") }
16
18
  isArrayOfArrays(1);
@@ -1,4 +1,4 @@
1
1
  {
2
- "_PAGE_UTILS_IS_ARRAY_OF_ARRAYS_ARGUMENTS_VALUE_": "_PAGE_UTILS_IS_ARRAY_OF_ARRAYS_ARGUMENTS_VALUE_",
3
- "_PAGE_UTILS_IS_ARRAY_OF_ARRAYS_DESCRIPTION_": "_PAGE_UTILS_IS_ARRAY_OF_ARRAYS_DESCRIPTION_"
2
+ "_PAGE_UTILS_IS_ARRAY_OF_ARRAYS_ARGUMENTS_VALUE_": "Vrijednost koju treba provjeriti.",
3
+ "_PAGE_UTILS_IS_ARRAY_OF_ARRAYS_DESCRIPTION_": "Provjerava je li ulazna vrijednost niz nizova."
4
4
  }
@@ -16,7 +16,20 @@ isArrayOfStrings(["Aloha", false]);
16
16
  isArrayOfStrings(["Aloha", undefined]);
17
17
  // ${ isArrayOfStrings(["Aloha", undefined]) }
18
18
  isArrayOfStrings(["Aloha", null]);
19
- // ${ isArrayOfStrings(["Aloha", null]) }`;
19
+ // ${ isArrayOfStrings(["Aloha", null]) }
20
+
21
+ isArrayOfStrings([]);
22
+ // ${ isArrayOfStrings([]) }
23
+ isArrayOfStrings("Aloha");
24
+ // ${ isArrayOfStrings("Aloha") }
25
+ isArrayOfStrings(1);
26
+ // ${ isArrayOfStrings(1) }
27
+ isArrayOfStrings(undefined);
28
+ // ${ isArrayOfStrings(undefined) }
29
+ isArrayOfStrings(null);
30
+ // ${ isArrayOfStrings(null) }
31
+ isArrayOfStrings({});
32
+ // ${ isArrayOfStrings({}) }`;
20
33
 
21
34
  return {
22
35
  codeJs,
@@ -1,4 +1,4 @@
1
1
  {
2
- "_PAGE_UTILS_IS_ARRAY_OF_STRINGS_ARGUMENTS_VALUE_": "_PAGE_UTILS_IS_ARRAY_OF_STRINGS_ARGUMENTS_VALUE_",
3
- "_PAGE_UTILS_IS_ARRAY_OF_STRINGS_DESCRIPTION_": "_PAGE_UTILS_IS_ARRAY_OF_STRINGS_DESCRIPTION_"
2
+ "_PAGE_UTILS_IS_ARRAY_OF_STRINGS_ARGUMENTS_VALUE_": "Vrijednost koju treba provjeriti.",
3
+ "_PAGE_UTILS_IS_ARRAY_OF_STRINGS_DESCRIPTION_": "Provjerava je li ulazna vrijednost niz stringova."
4
4
  }
@@ -2,5 +2,5 @@
2
2
  "_PAGE_FUNCTIONS_ARGUMENTS_HEADER_": "Argumenti",
3
3
  "_PAGE_FUNCTIONS_IMPORT_COMPOSITION_API_HEADER_": "Import kao kompozicijski API",
4
4
  "_PAGE_FUNCTIONS_IMPORT_FUNCTION_HEADER_": "Import kao funkcija",
5
- "_PAGE_FUNCTIONS_TESTS_HEADER_": "Tests"
5
+ "_PAGE_FUNCTIONS_TESTS_HEADER_": "Testovi"
6
6
  }
@@ -17,5 +17,4 @@ aloha-example(
17
17
  label="_A_TABLE_GROUP_SIMPLE_LABEL_"
18
18
  key-id="id"
19
19
  :is-simple-table="true"
20
- :is-action-column-visible="true"
21
20
  )
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.110",
17
+ "version": "1.2.112",
18
18
  "author": {
19
19
  "name": "Ilia Brykin",
20
20
  "email": "brykin.ilia@gmail.com"
@@ -110,7 +110,7 @@ export default {
110
110
  default: "button",
111
111
  },
112
112
  buttonText: {
113
- type: [String, Number, Object],
113
+ type: [String, Number, Object, Array],
114
114
  required: false,
115
115
  default: undefined,
116
116
  },
@@ -125,12 +125,12 @@ export default {
125
125
  default: undefined,
126
126
  },
127
127
  buttonTextScreenReader: {
128
- type: String,
128
+ type: [String, Number, Object, Array],
129
129
  required: false,
130
130
  default: undefined,
131
131
  },
132
132
  buttonTitle: {
133
- type: String,
133
+ type: [String, Number, Object, Array],
134
134
  required: false,
135
135
  default: undefined,
136
136
  },
@@ -6,7 +6,7 @@ import {
6
6
  } from "vue";
7
7
 
8
8
  import {
9
- cloneDeep,
9
+ isEqual,
10
10
  map,
11
11
  } from "lodash-es";
12
12
 
@@ -25,10 +25,9 @@ export default function RowsAPI(props, {
25
25
 
26
26
  const dataPaginated = computed(() => {
27
27
  if (limit.value && !pagination.value.isOutside && usePaginationLocal.value) {
28
- const DATA_SORTED = cloneDeep(dataSorted.value);
29
28
  const INDEX_START = offset.value;
30
29
  const INDEX_END = INDEX_START + limit.value;
31
- return DATA_SORTED.slice(INDEX_START, INDEX_END);
30
+ return dataSorted.value.slice(INDEX_START, INDEX_END);
32
31
  }
33
32
  return dataSorted.value;
34
33
  });
@@ -81,7 +80,10 @@ export default function RowsAPI(props, {
81
80
  rowsLocal.value.splice(index, 1);
82
81
  };
83
82
 
84
- watch(dataPaginated, () => {
83
+ watch(dataPaginated, (newValue, oldValue) => {
84
+ if (isEqual(newValue, oldValue)) {
85
+ return;
86
+ }
85
87
  rowsLocal.value = [];
86
88
  rowsLocalIndex = 0;
87
89
  stopRenderRows();
@@ -25,6 +25,10 @@ describe("isArrayOfArrays", () => {
25
25
  expect(isArrayOfArrays({})).toBe(false);
26
26
  });
27
27
 
28
+ it("should return false if provided with a empty array", () => {
29
+ expect(isArrayOfArrays([])).toBe(false);
30
+ });
31
+
28
32
  it("should return false if provided with an array that contains non-array elements", () => {
29
33
  const testData = [[1, 2, 3], "This is not an array", [7, 8, 9]];
30
34
  const result = isArrayOfArrays(testData);
@@ -17,6 +17,10 @@ describe("isArrayOfStrings function", () => {
17
17
  expect(result).toBe(false);
18
18
  });
19
19
 
20
+ it("should return false if provided with a empty array", () => {
21
+ expect(isArrayOfStrings([])).toBe(false);
22
+ });
23
+
20
24
  test("should return false when input is an array but not all elements are strings", () => {
21
25
  expect(isArrayOfStrings(["hello", 1234])).toBe(false);
22
26
  expect(isArrayOfStrings(["hello", false])).toBe(false);
@@ -35,7 +35,7 @@ function toCorrectFormat(value) {
35
35
  * @return {boolean} - True if the input is an array of strings, false otherwise.
36
36
  */
37
37
  export function isArrayOfStrings(array) {
38
- if (!isArray(array)) {
38
+ if (!isArray(array) || !array.length) {
39
39
  return false;
40
40
  }
41
41
 
@@ -50,7 +50,7 @@ export function isArrayOfStrings(array) {
50
50
  * @return {boolean} - True if the input is an array of arrays, false otherwise.
51
51
  */
52
52
  export function isArrayOfArrays(array) {
53
- if (!isArray(array)) {
53
+ if (!isArray(array) || !array.length) {
54
54
  return false;
55
55
  }
56
56