aloha-vue 1.2.123 → 1.2.125

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 (45) hide show
  1. package/package.json +1 -1
  2. package/src/AButton/AButton.js +5 -0
  3. package/src/AElement/AElement.js +14 -2
  4. package/src/AFilters/AFilersRight/AFilersRight.js +8 -2
  5. package/src/AFilters/AFilterCenter/AFilterCenterItem/compositionAPI/IsDataLoadingAPI.js +4 -2
  6. package/src/AFilters/AFilterCenter/AFilterCenterItem/compositionAPI/ModelValuesAPI.js +4 -2
  7. package/src/AFilters/AFilters/AFilters.js +12 -4
  8. package/src/AFilters/AFilters/compositionAPI/CloseFilterAPI.js +6 -4
  9. package/src/AFilters/AFilters/compositionAPI/FiltersAPI.js +14 -5
  10. package/src/AFilters/AFiltersHorizontal/AFiltersHorizontal.js +16 -10
  11. package/src/AFilters/AFiltersHorizontal/AFiltersHorizontalFilterUi/AFiltersHorizontalFilterUi.js +6 -0
  12. package/src/AFilters/AFiltersHorizontal/AFiltersHorizontalFilterUi/compositionAPI/ContainerAPI.js +4 -2
  13. package/src/AFilters/AFiltersMain/AFiltersMain.js +6 -0
  14. package/src/ALink/ALink.js +5 -0
  15. package/src/ATable/compositionAPI/ColumnsOrderingAPI.js +3 -1
  16. package/src/ui/ACheckbox/ACheckbox.js +22 -6
  17. package/src/ui/ADatepicker/ADatepicker.js +97 -81
  18. package/src/ui/ADatepickerRange/ADatepickerRange.js +17 -1
  19. package/src/ui/AFieldset/AFieldset.js +27 -6
  20. package/src/ui/AForm/AForm.js +17 -2
  21. package/src/ui/AForm/compositionAPI/ModelAPI.js +4 -2
  22. package/src/ui/AGroup/AGroup.js +37 -18
  23. package/src/ui/AGroup/compositionAPI/SpecificTypeAPI.js +4 -3
  24. package/src/ui/AInput/AInput.js +31 -19
  25. package/src/ui/AInputFile/AInputFile.js +28 -15
  26. package/src/ui/AInputNumber/AInputNumber.js +17 -1
  27. package/src/ui/AInputNumberRange/AInputNumberRange.js +90 -74
  28. package/src/ui/ALabel/ALabel.js +30 -17
  29. package/src/ui/AOneCheckbox/AOneCheckbox.js +17 -1
  30. package/src/ui/ARadio/ARadio.js +17 -1
  31. package/src/ui/ASelect/ASelect.js +17 -1
  32. package/src/ui/ASwitch/ASwitch.js +98 -82
  33. package/src/ui/ATemplate/ATemplate.js +17 -1
  34. package/src/ui/ATextarea/ATextarea.js +20 -4
  35. package/src/ui/ATinymce/ATinymce.js +20 -6
  36. package/src/ui/compositionApi/UIExcludeRenderAttributesAPI.js +25 -0
  37. package/src/ui/compositionApi/__tests__/UIExcludeRenderAttributesAPI.test.js +34 -0
  38. package/src/ui/const/AUiTypes.js +33 -0
  39. package/src/utils/__tests__/utilsUi.isModelForFilterNotEmpty.test.js +59 -0
  40. package/src/utils/utilsUi.js +36 -0
  41. package/src/ui/const/AUiTypesContainer.js +0 -4
  42. package/src/ui/const/AUiTypesModelArray.js +0 -4
  43. package/src/ui/const/AUiTypesModelObject.js +0 -7
  44. package/src/ui/const/AUiTypesNotFocusable.js +0 -4
  45. package/src/ui/const/AUiTypesWithData.js +0 -6
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.123",
17
+ "version": "1.2.125",
18
18
  "author": {
19
19
  "name": "Ilia Brykin",
20
20
  "email": "brykin.ilia@gmail.com"
@@ -52,6 +52,11 @@ export default {
52
52
  required: false,
53
53
  default: undefined,
54
54
  },
55
+ excludeRenderAttributes: {
56
+ type: Array,
57
+ required: false,
58
+ default: () => [],
59
+ },
55
60
  extra: {
56
61
  type: Object,
57
62
  required: false,
@@ -17,6 +17,7 @@ import SwitchAPI from "./comositionAPI/SwitchAPI";
17
17
  import TagAPI from "./comositionAPI/TagAPI";
18
18
  import TextAPI from "./comositionAPI/TextAPI";
19
19
  import TitleAPI from "./comositionAPI/TitleAPI";
20
+ import UIExcludeRenderAttributesAPI from "../ui/compositionApi/UIExcludeRenderAttributesAPI";
20
21
 
21
22
  import placements from "../const/placements";
22
23
  import {
@@ -64,6 +65,11 @@ export default {
64
65
  required: false,
65
66
  default: undefined,
66
67
  },
68
+ excludeRenderAttributes: {
69
+ type: Array,
70
+ required: false,
71
+ default: () => [],
72
+ },
67
73
  extra: {
68
74
  type: Object,
69
75
  required: false,
@@ -175,12 +181,12 @@ export default {
175
181
  required: false,
176
182
  default: undefined,
177
183
  },
178
- target: {
184
+ tag: {
179
185
  type: String,
180
186
  required: false,
181
187
  default: undefined,
182
188
  },
183
- tag: {
189
+ target: {
184
190
  type: String,
185
191
  required: false,
186
192
  default: undefined,
@@ -263,6 +269,10 @@ export default {
263
269
  "click",
264
270
  ],
265
271
  setup(props, context) {
272
+ const {
273
+ attributesToExcludeFromRender,
274
+ } = UIExcludeRenderAttributesAPI(props);
275
+
266
276
  const {
267
277
  isRouterLink,
268
278
  } = RouterLinkAPI(props);
@@ -323,6 +333,7 @@ export default {
323
333
 
324
334
  return {
325
335
  ariaLabelAttributes,
336
+ attributesToExcludeFromRender,
326
337
  componentLocal,
327
338
  elementRef,
328
339
  htmlTitleAttributes,
@@ -363,6 +374,7 @@ export default {
363
374
  isAllRowsSelected: undefined, // TODO: ATable
364
375
  onClick: this.onClick,
365
376
  ...this.attributes,
377
+ ...this.attributesToExcludeFromRender,
366
378
  }, {
367
379
  default: () => [
368
380
  (!this.isTitleHtml && this.isTitleVisible) ? h(ATranslation, {
@@ -13,6 +13,11 @@ export default {
13
13
  type: Boolean,
14
14
  required: false,
15
15
  },
16
+ excludeRenderAttributes: {
17
+ type: Array,
18
+ required: false,
19
+ default: () => [],
20
+ },
16
21
  filters: {
17
22
  type: Array,
18
23
  required: false,
@@ -59,13 +64,14 @@ export default {
59
64
  h("form", {}, [
60
65
  this.filters.map(filter => {
61
66
  return h(AFiltersHorizontalFilterUi, {
67
+ id: this.id,
62
68
  class: "a_filters_right__filter_ui",
69
+ excludeRenderAttributes: this.excludeRenderAttributes,
63
70
  filter,
64
71
  isLabelVisible: true,
72
+ onUpdateModelFilters: this.onUpdateModelFilters,
65
73
  unappliedModel: this.appliedModel,
66
74
  updateDataKeyByIdFromFilter: this.updateDataKeyByIdFromFilter,
67
- onUpdateModelFilters: this.onUpdateModelFilters,
68
- id: this.id,
69
75
  }, this.$slots);
70
76
  })
71
77
  ]),
@@ -3,7 +3,9 @@ import {
3
3
  toRef,
4
4
  } from "vue";
5
5
 
6
- import AUiTypesWithData from "../../../../ui/const/AUiTypesWithData";
6
+ import {
7
+ typesWithData,
8
+ } from "../../../../ui/const/AUiTypes";
7
9
  import {
8
10
  isEmpty,
9
11
  } from "lodash-es";
@@ -18,7 +20,7 @@ export default function IsDataLoadingAPI(props, { emit }, {
18
20
  if (!hasCurrentFilter.value) {
19
21
  return false;
20
22
  }
21
- if (AUiTypesWithData[filter.value.type]) {
23
+ if (typesWithData.value[filter.value.type]) {
22
24
  return isEmpty(dataKeyByKeyIdPerFilter.value[filter.value.id]);
23
25
  }
24
26
  return false;
@@ -6,7 +6,9 @@ import {
6
6
  import AFiltersAPI from "../../../../compositionAPI/AFiltersAPI";
7
7
 
8
8
  import AKeyLabel from "../../../../const/AKeyLabel";
9
- import AUiTypesModelArray from "../../../../ui/const/AUiTypesModelArray";
9
+ import {
10
+ typesModelArray,
11
+ } from "../../../../ui/const/AUiTypes";
10
12
  import TypesNumberRange from "../../../../ui/AInputNumberRange/utils/Types";
11
13
  import {
12
14
  filter as _filter,
@@ -69,7 +71,7 @@ export default function ModelValuesAPI(props, {
69
71
  }
70
72
  return [];
71
73
  }
72
- if (AUiTypesModelArray[filter.value.type] ||
74
+ if (typesModelArray.value[filter.value.type] ||
73
75
  (filter.value.type === "radio" && filter.value.isModelArray)) {
74
76
  if (modelArrayReal.value.length) {
75
77
  if (modelArrayReal.value.length === 1) {
@@ -37,19 +37,24 @@ export default {
37
37
  type: Boolean,
38
38
  required: false,
39
39
  },
40
- filters: {
40
+ excludeRenderAttributes: {
41
41
  type: Array,
42
42
  required: false,
43
43
  default: () => [],
44
44
  },
45
- filtersSaved: {
45
+ filterMain: {
46
+ type: Object,
47
+ required: false,
48
+ },
49
+ filters: {
46
50
  type: Array,
47
51
  required: false,
48
52
  default: () => [],
49
53
  },
50
- filterMain: {
51
- type: Object,
54
+ filtersSaved: {
55
+ type: Array,
52
56
  required: false,
57
+ default: () => [],
53
58
  },
54
59
  id: {
55
60
  type: String,
@@ -181,6 +186,7 @@ export default {
181
186
  this.view === "top" && h(AFiltersMain, {
182
187
  id: this.id,
183
188
  disabled: this.disabled,
189
+ excludeRenderAttributes: this.excludeRenderAttributes,
184
190
  filterMain: this.filterMain,
185
191
  mainModel: this.mainModel,
186
192
  updateDataKeyByIdFromFilter: this.updateDataKeyByIdFromFilter,
@@ -194,6 +200,7 @@ export default {
194
200
  h(AFilersRight, {
195
201
  id: this.id,
196
202
  disabled: this.disabled,
203
+ excludeRenderAttributes: this.excludeRenderAttributes,
197
204
  filters: this.filters,
198
205
  filtersKeyById: this.filtersKeyById,
199
206
  appliedModel: this.appliedModel,
@@ -220,6 +227,7 @@ export default {
220
227
  id: this.id,
221
228
  canSave: this.canSave,
222
229
  disabled: this.disabled,
230
+ excludeRenderAttributes: this.excludeRenderAttributes,
223
231
  filtersGroup: this.filtersGroup,
224
232
  filtersKeyById: this.filtersKeyById,
225
233
  filtersSaved: this.filtersSavedLocal,
@@ -4,8 +4,10 @@ import {
4
4
  toRef,
5
5
  } from "vue";
6
6
 
7
- import AUiTypesModelArray from "../../../ui/const/AUiTypesModelArray";
8
- import AUiTypesModelObject from "../../../ui/const/AUiTypesModelObject";
7
+ import {
8
+ typesModelArray,
9
+ typesModelObject,
10
+ } from "../../../ui/const/AUiTypes";
9
11
  import {
10
12
  cloneDeep,
11
13
  filter as _filter,
@@ -28,7 +30,7 @@ export default function CloseFilterAPI(props, { emit }, {
28
30
  const closeCurrentFilter = ({ filter, keyId, modelArray, appliedModelLocal, unappliedModelLocal }) => {
29
31
  const MODEL_ID = filter.modelId || filter.id;
30
32
 
31
- if (AUiTypesModelArray[filter.type]) {
33
+ if (typesModelArray.value[filter.type]) {
32
34
  if (appliedModelLocal[MODEL_ID] &&
33
35
  appliedModelLocal[MODEL_ID].length) {
34
36
  if (modelArray) {
@@ -49,7 +51,7 @@ export default function CloseFilterAPI(props, { emit }, {
49
51
  unappliedModelLocal[MODEL_ID] = [];
50
52
  }
51
53
  }
52
- } else if (AUiTypesModelObject[filter.type] && keyId) {
54
+ } else if (typesModelObject.value[filter.type] && keyId) {
53
55
  if (isPlainObject(unappliedModelLocal?.[MODEL_ID])) {
54
56
  unappliedModelLocal[MODEL_ID][keyId] = undefined;
55
57
  }
@@ -4,7 +4,12 @@ import {
4
4
  toRef,
5
5
  } from "vue";
6
6
 
7
- import AUiTypesContainer from "../../../ui/const/AUiTypesContainer";
7
+ import {
8
+ typesContainer,
9
+ } from "../../../ui/const/AUiTypes";
10
+ import {
11
+ isModelForFilterNotEmpty,
12
+ } from "../../../utils/utilsUi";
8
13
  import {
9
14
  cloneDeep,
10
15
  forEach,
@@ -26,7 +31,7 @@ export default function FiltersAPI(props, { emit }) {
26
31
  const FILTERS = {};
27
32
  forEach(cloneDeep(filters.value), filter => {
28
33
  FILTERS[filter.id] = filter;
29
- if (AUiTypesContainer[filter.type] &&
34
+ if (typesContainer.value[filter.type] &&
30
35
  filter.children &&
31
36
  filter.children.length) {
32
37
  forEach(filter.children, filterChild => {
@@ -69,7 +74,7 @@ export default function FiltersAPI(props, { emit }) {
69
74
  const FILERS_NEW = [];
70
75
  forEach(FILTERS, filter => {
71
76
  FILERS_NEW.push(filter);
72
- if (AUiTypesContainer[filter.type] &&
77
+ if (typesContainer.value[filter.type] &&
73
78
  filter.children &&
74
79
  filter.children.length) {
75
80
  forEach(filter.children, filterChild => {
@@ -83,7 +88,9 @@ export default function FiltersAPI(props, { emit }) {
83
88
  const setFiltersVisibleIds = () => {
84
89
  const FILTERS_VISIBLE_IDS = [];
85
90
  forEach(filtersGroup.value.filters, filter => {
86
- if (filter.id in unappliedModel.value) {
91
+ if (isModelForFilterNotEmpty({
92
+ filter, modelObj: unappliedModel.value,
93
+ })) {
87
94
  FILTERS_VISIBLE_IDS.push(filter.id);
88
95
  }
89
96
  });
@@ -94,7 +101,9 @@ export default function FiltersAPI(props, { emit }) {
94
101
  emit("update:unappliedModel", model);
95
102
 
96
103
  if (isUpdateFiltersVisible) {
97
- setFiltersVisibleIds();
104
+ setTimeout(() => {
105
+ setFiltersVisibleIds();
106
+ });
98
107
  }
99
108
  };
100
109
 
@@ -32,6 +32,11 @@ export default {
32
32
  type: Boolean,
33
33
  required: false,
34
34
  },
35
+ excludeRenderAttributes: {
36
+ type: Array,
37
+ required: false,
38
+ default: () => [],
39
+ },
35
40
  filtersGroup: {
36
41
  type: Object,
37
42
  required: true,
@@ -52,27 +57,27 @@ export default {
52
57
  type: Array,
53
58
  required: true,
54
59
  },
60
+ id: {
61
+ type: String,
62
+ required: true,
63
+ },
55
64
  mainModel: {
56
65
  type: Object,
57
66
  required: false,
58
67
  },
59
- unappliedModel: {
60
- type: Object,
61
- required: true,
62
- },
63
68
  onUpdateModelFilters: {
64
69
  type: Function,
65
70
  required: true,
66
71
  },
67
- id: {
68
- type: String,
72
+ unappliedModel: {
73
+ type: Object,
69
74
  required: true,
70
75
  },
71
- updateFiltersSaved: {
76
+ updateDataKeyByIdFromFilter: {
72
77
  type: Function,
73
78
  required: true,
74
79
  },
75
- updateDataKeyByIdFromFilter: {
80
+ updateFiltersSaved: {
76
81
  type: Function,
77
82
  required: true,
78
83
  },
@@ -253,11 +258,12 @@ export default {
253
258
  h(AForm, {
254
259
  idPrefix: this.idFilterTop,
255
260
  class: "a_filter_horizontal__body__form",
256
- classColumns: "",
257
261
  classColumnDefault: "",
262
+ classColumns: "",
258
263
  data: this.dataForForm,
259
- showErrors: false,
264
+ excludeRenderAttributes: this.excludeRenderAttributes,
260
265
  modelValue: this.unappliedModel,
266
+ showErrors: false,
261
267
  onChange: this.onUpdateModelFilters,
262
268
  }, {
263
269
  ...this.$slots,
@@ -12,6 +12,11 @@ import UpdateDataAPI from "./compositionAPI/UpdateDataAPI";
12
12
  export default {
13
13
  name: "AFiltersHorizontalFilterUi",
14
14
  props: {
15
+ excludeRenderAttributes: {
16
+ type: Array,
17
+ required: false,
18
+ default: () => [],
19
+ },
15
20
  filter: {
16
21
  type: Object,
17
22
  required: false,
@@ -79,6 +84,7 @@ export default {
79
84
  idPrefix: this.idPrefix,
80
85
  modelValue: this.isContainer ? this.unappliedModel : this.unappliedModel[this.filter.modelId || this.filter.id],
81
86
  "onUpdate:modelValue": this.onUpdateModelFiltersLocal,
87
+ excludeRenderAttributes: this.excludeRenderAttributes,
82
88
  ...this.filter,
83
89
  ...this.filterSpecificAttributes,
84
90
  label: this.isLabelVisible ? this.filter.label : undefined,
@@ -3,13 +3,15 @@ import {
3
3
  toRef,
4
4
  } from "vue";
5
5
 
6
- import AUiTypesContainer from "../../../../ui/const/AUiTypesContainer";
6
+ import {
7
+ typesContainer,
8
+ } from "../../../../ui/const/AUiTypes";
7
9
 
8
10
  export default function ContainerAPI(props) {
9
11
  const filter = toRef(props, "filter");
10
12
 
11
13
  const isContainer = computed(() => {
12
- return !!AUiTypesContainer[filter.value.type];
14
+ return !!typesContainer.value[filter.value.type];
13
15
  });
14
16
 
15
17
  return {
@@ -17,6 +17,11 @@ export default {
17
17
  type: Boolean,
18
18
  required: false,
19
19
  },
20
+ excludeRenderAttributes: {
21
+ type: Array,
22
+ required: false,
23
+ default: () => [],
24
+ },
20
25
  filterMain: {
21
26
  type: Object,
22
27
  required: false,
@@ -78,6 +83,7 @@ export default {
78
83
  classColumns: "a_filters_top__main_wrapper",
79
84
  classColumnDefault: "a_filters_top__main",
80
85
  data: this.dataMainFilter,
86
+ excludeRenderAttributes: this.excludeRenderAttributes,
81
87
  modelValue: this.mainModel,
82
88
  showErrors: false,
83
89
  onChange: this.updateMainModel,
@@ -47,6 +47,11 @@ export default {
47
47
  required: false,
48
48
  default: undefined,
49
49
  },
50
+ excludeRenderAttributes: {
51
+ type: Array,
52
+ required: false,
53
+ default: () => [],
54
+ },
50
55
  extra: {
51
56
  type: Object,
52
57
  required: false,
@@ -49,7 +49,9 @@ export default function ColumnsOrderingAPI(props, { emit }, {
49
49
  columnIndexOver,
50
50
  modelColumnsOrdering: modelColumnsOrderingLocal,
51
51
  });
52
- checkVisibleColumns();
52
+ setTimeout(() => {
53
+ checkVisibleColumns();
54
+ });
53
55
  };
54
56
 
55
57
  const checkColumnsOrdering = () => {
@@ -21,6 +21,7 @@ import UIDataGroupAPI from "../compositionApi/UIDataGroupAPI";
21
21
  import UiDataSortAPI from "../compositionApi/UiDataSortAPI";
22
22
  import UiDataWatchEmitAPI from "../compositionApi/UiDataWatchEmitAPI";
23
23
  import UiDataWithKeyIdAndLabelAPI from "../compositionApi/UiDataWithKeyIdAndLabelAPI";
24
+ import UIExcludeRenderAttributesAPI from "../compositionApi/UIExcludeRenderAttributesAPI";
24
25
  import UiLoadingAPI from "../compositionApi/UiLoadingAPI";
25
26
  import UiSearchAPI from "../compositionApi/UiSearchAPI";
26
27
  import UiStyleHideAPI from "../compositionApi/UiStyleHideAPI";
@@ -91,6 +92,11 @@ export default {
91
92
  required: false,
92
93
  default: undefined,
93
94
  },
95
+ excludeRenderAttributes: {
96
+ type: Array,
97
+ required: false,
98
+ default: () => [],
99
+ },
94
100
  extra: {
95
101
  type: Object,
96
102
  required: false,
@@ -196,11 +202,6 @@ export default {
196
202
  required: false,
197
203
  default: undefined,
198
204
  },
199
- modelId: {
200
- type: String,
201
- required: false,
202
- default: undefined,
203
- },
204
205
  label: {
205
206
  type: [String, Number],
206
207
  required: false,
@@ -220,6 +221,11 @@ export default {
220
221
  required: false,
221
222
  default: () => ({}),
222
223
  },
224
+ modelId: {
225
+ type: String,
226
+ required: false,
227
+ default: undefined,
228
+ },
223
229
  modelUndefined: {
224
230
  required: false,
225
231
  default: null,
@@ -304,6 +310,10 @@ export default {
304
310
  "update:modelValue",
305
311
  ],
306
312
  setup(props, context) {
313
+ const {
314
+ attributesToExcludeFromRender,
315
+ } = UIExcludeRenderAttributesAPI(props);
316
+
307
317
  const {
308
318
  componentStyleHide,
309
319
  } = UiStyleHideAPI(props);
@@ -422,6 +432,7 @@ export default {
422
432
 
423
433
  return {
424
434
  ariaDescribedbyLocal,
435
+ attributesToExcludeFromRender,
425
436
  componentStyleHide,
426
437
  dataExtraLocal,
427
438
  dataGrouped,
@@ -461,9 +472,14 @@ export default {
461
472
  };
462
473
  },
463
474
  render() {
464
- return this.isRender && h("div", {
475
+ if (!this.isRender) {
476
+ return "";
477
+ }
478
+
479
+ return h("div", {
465
480
  style: this.componentStyleHide,
466
481
  errorsAll: undefined,
482
+ ...this.attributesToExcludeFromRender,
467
483
  }, [
468
484
  h("div", {
469
485
  class: ["a_form_element__parent"],