aloha-vue 1.2.6 → 1.2.8

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/main.js CHANGED
@@ -2,6 +2,7 @@ import App from "./App/App.vue";
2
2
  import { createApp } from "vue";
3
3
  import router from "./router/index";
4
4
  // import AGroupButtonDropdownPlugin from "../../src/plugins/AGroupButtonDropdownPlugin";
5
+ import AFiltersPlugin from "../../src/plugins/AFiltersPlugin";
5
6
  import {
6
7
  AIconPlugin,
7
8
  AI18nPlugin,
@@ -9,7 +10,6 @@ import {
9
10
  AModalPlugin,
10
11
  ASafeHtml,
11
12
  ASelectPlugin,
12
- ATablePlugin,
13
13
  } from "../../dist";
14
14
  import mainIcons from "./mainIcons";
15
15
 
@@ -37,9 +37,25 @@ APP.use(ASelectPlugin, {
37
37
  menuWidthType: "by_content",
38
38
  },
39
39
  });
40
- APP.use(ATablePlugin, {
40
+ APP.use(AFiltersPlugin, {
41
41
  config: {
42
-
42
+ headerBottomGroups: [
43
+ {
44
+ props: {},
45
+ children: [
46
+ {
47
+ component: "addFilterSelect",
48
+ props: {
49
+ keyGroup: "group",
50
+ },
51
+ },
52
+ {
53
+ component: "buttonSearch",
54
+ props: {},
55
+ },
56
+ ],
57
+ },
58
+ ],
43
59
  },
44
60
  });
45
61
  // APP.use(AGroupButtonDropdownPlugin, {
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.6",
17
+ "version": "1.2.8",
18
18
  "author": {
19
19
  "name": "Ilia Brykin",
20
20
  "email": "brykin.ilia@gmail.com"
@@ -137,13 +137,13 @@ export default {
137
137
  filtersTopFooter,
138
138
  filtersTopHeader,
139
139
  } = FiltersLayoutAPI({
140
- filterMainComponent,
140
+ addFilterSelectComponent,
141
+ buttonDeleteFiltersSavedComponent,
142
+ buttonSaveTopComponent,
141
143
  buttonSearchComponent,
142
144
  buttonToggleComponent,
145
+ filterMainComponent,
143
146
  selectFiltersSavedComponent,
144
- buttonDeleteFiltersSavedComponent,
145
- buttonSaveTopComponent,
146
- addFilterSelectComponent,
147
147
  });
148
148
 
149
149
  initEventBus();
@@ -6,6 +6,10 @@ import {
6
6
 
7
7
  import AFiltersHorizontalFilterUi from "../AFiltersHorizontalFilterUi/AFiltersHorizontalFilterUi";
8
8
 
9
+ import {
10
+ filtersPluginComponentsProps,
11
+ } from "../../../plugins/AFiltersPlugin";
12
+
9
13
  export default function FilterMainAPI(props) {
10
14
  const filtersGroup = toRef(props, "filtersGroup");
11
15
  const id = toRef(props, "id");
@@ -23,6 +27,7 @@ export default function FilterMainAPI(props) {
23
27
  unappliedModel: unappliedModel.value,
24
28
  onUpdateModelFilters: onUpdateModelFilters.value,
25
29
  updateDataKeyByIdFromFilter: updateDataKeyByIdFromFilter.value,
30
+ ...filtersPluginComponentsProps.value.filterMain || {},
26
31
  });
27
32
  });
28
33
 
@@ -5,6 +5,10 @@ import {
5
5
 
6
6
  import ASelect from "../../../ui/ASelect/ASelect";
7
7
 
8
+ import {
9
+ filtersPluginComponentsProps,
10
+ } from "../../../plugins/AFiltersPlugin";
11
+
8
12
  import {
9
13
  filter,
10
14
  forEach,
@@ -59,6 +63,7 @@ export default function FiltersHiddenAPI(props, { emit }) {
59
63
  disabled: !filtersHidden.value.length,
60
64
  search: true,
61
65
  change: addFiltersVisible,
66
+ ...filtersPluginComponentsProps.value.addFilterSelect || {},
62
67
  });
63
68
  });
64
69
 
@@ -4,36 +4,36 @@ import {
4
4
  } from "vue";
5
5
 
6
6
  import {
7
- tablePluginOptions,
8
- } from "../../../plugins/ATablePlugin";
7
+ filtersPluginOptions,
8
+ } from "../../../plugins/AFiltersPlugin";
9
9
 
10
10
  import {
11
11
  map,
12
12
  } from "lodash-es";
13
13
 
14
14
  export default function FiltersLayoutAPI({
15
- filterMainComponent,
15
+ addFilterSelectComponent,
16
+ buttonDeleteFiltersSavedComponent,
17
+ buttonSaveTopComponent,
16
18
  buttonSearchComponent,
17
19
  buttonToggleComponent,
20
+ filterMainComponent,
18
21
  selectFiltersSavedComponent,
19
- buttonDeleteFiltersSavedComponent,
20
- buttonSaveTopComponent,
21
- addFilterSelectComponent,
22
22
  }) {
23
23
  const availableElements = {
24
- filterMainComponent,
24
+ addFilterSelectComponent,
25
+ buttonDeleteFiltersSavedComponent,
26
+ buttonSaveTopComponent,
25
27
  buttonSearchComponent,
26
28
  buttonToggleComponent,
29
+ filterMainComponent,
27
30
  selectFiltersSavedComponent,
28
- buttonDeleteFiltersSavedComponent,
29
- buttonSaveTopComponent,
30
- addFilterSelectComponent,
31
31
  };
32
32
 
33
33
  const filtersTopHeader = computed(() => {
34
34
  return h("div", {
35
35
  class: "a_table__filters_top__header",
36
- }, map(tablePluginOptions.value.config.headerTopGroups, group => {
36
+ }, map(filtersPluginOptions.value.config.headerTopGroups, group => {
37
37
  return h("div", {
38
38
  class: "a_table__filters_top__header__group",
39
39
  ...group.props,
@@ -45,7 +45,7 @@ export default function FiltersLayoutAPI({
45
45
  const filtersTopFooter = computed(() => {
46
46
  return h("div", {
47
47
  class: "a_table__filters_top__footer",
48
- }, map(tablePluginOptions.value.config.headerBottomGroups, group => {
48
+ }, map(filtersPluginOptions.value.config.headerBottomGroups, group => {
49
49
  return h("div", {
50
50
  class: "a_table__filters_top__footer__group",
51
51
  ...group.props,
@@ -9,8 +9,8 @@ import AButton from "../../../AButton/AButton";
9
9
  import ASelect from "../../../ui/ASelect/ASelect";
10
10
 
11
11
  import {
12
- tablePluginComponentsProps,
13
- } from "../../../plugins/ATablePlugin";
12
+ filtersPluginComponentsProps,
13
+ } from "../../../plugins/AFiltersPlugin";
14
14
 
15
15
  export default function FiltersSaveAPI(props, {
16
16
  onOpen = () => ({}),
@@ -66,7 +66,7 @@ export default function FiltersSaveAPI(props, {
66
66
  id: buttonSaveComponentTopId.value,
67
67
  onClick: openModalSaveTop,
68
68
  ...buttonSaveComponentPropsDefault.value,
69
- ...tablePluginComponentsProps.value.buttonSaveTop,
69
+ ...filtersPluginComponentsProps.value.buttonSaveTop || {},
70
70
  });
71
71
  });
72
72
 
@@ -113,7 +113,7 @@ export default function FiltersSaveAPI(props, {
113
113
  search: true,
114
114
  deselect: true,
115
115
  change: changeModelFiltersSaved,
116
- ...tablePluginComponentsProps.value.selectFiltersSaved,
116
+ ...filtersPluginComponentsProps.value.selectFiltersSaved || {},
117
117
  });
118
118
  });
119
119
 
@@ -11,8 +11,8 @@ import AConfirmAPI from "../../../compositionAPI/AConfirmAPI";
11
11
  import ANotificationAPI from "../../../compositionAPI/ANotificationAPI";
12
12
 
13
13
  import {
14
- tablePluginComponentsProps,
15
- } from "../../../plugins/ATablePlugin";
14
+ filtersPluginComponentsProps,
15
+ } from "../../../plugins/AFiltersPlugin";
16
16
 
17
17
  export default function FiltersSavedDeleteAPI(props, {
18
18
  changeModelFiltersSaved = () => {},
@@ -107,7 +107,7 @@ export default function FiltersSavedDeleteAPI(props, {
107
107
  },
108
108
  ariaDisabled: disabledButtonDeleteFiltersSaved.value,
109
109
  onClick: openDeleteConfirm,
110
- ...tablePluginComponentsProps.value.buttonDeleteFiltersSaved,
110
+ ...filtersPluginComponentsProps.value.buttonDeleteFiltersSaved || {},
111
111
  });
112
112
  });
113
113
 
@@ -7,8 +7,8 @@ import {
7
7
  import AButton from "../../../AButton/AButton";
8
8
 
9
9
  import {
10
- tablePluginComponentsProps,
11
- } from "../../../plugins/ATablePlugin";
10
+ filtersPluginComponentsProps,
11
+ } from "../../../plugins/AFiltersPlugin";
12
12
 
13
13
  export default function SearchAPI(props, { emit }, {
14
14
  onClose = () => {},
@@ -39,7 +39,7 @@ export default function SearchAPI(props, { emit }, {
39
39
  stop: true,
40
40
  disabled: disabled.value,
41
41
  onClick: onSearch,
42
- ...tablePluginComponentsProps.value.buttonSearch,
42
+ ...filtersPluginComponentsProps.value.buttonSearch || {},
43
43
  });
44
44
  });
45
45
 
@@ -8,8 +8,8 @@ import {
8
8
  import AButton from "../../../AButton/AButton";
9
9
 
10
10
  import {
11
- tablePluginComponentsProps,
12
- } from "../../../plugins/ATablePlugin";
11
+ filtersPluginComponentsProps,
12
+ } from "../../../plugins/AFiltersPlugin";
13
13
 
14
14
  export default function ToggleAPI(props) {
15
15
  const filtersGroup = toRef(props, "filtersGroup");
@@ -55,7 +55,7 @@ export default function ToggleAPI(props) {
55
55
  text: textToggle,
56
56
  iconRight: iconToggle,
57
57
  onClick: onToggle,
58
- ...tablePluginComponentsProps.value.buttonToggle,
58
+ ...filtersPluginComponentsProps.value.buttonToggle || {},
59
59
  });
60
60
  });
61
61
 
@@ -0,0 +1,99 @@
1
+ import {
2
+ computed,
3
+ ref,
4
+ } from "vue";
5
+
6
+ import {
7
+ forEach,
8
+ } from "lodash-es";
9
+
10
+ export const filtersPluginOptions = ref({
11
+ propsDefault: {
12
+
13
+ },
14
+ config: {
15
+ isHtmlTitleSort: false,
16
+ headerTopGroups: [
17
+ {
18
+ props: {},
19
+ children: [
20
+ {
21
+ component: "filterMain",
22
+ props: {},
23
+ },
24
+ {
25
+ component: "buttonSearch",
26
+ props: {},
27
+ },
28
+ {
29
+ component: "buttonToggle",
30
+ props: {},
31
+ },
32
+ ],
33
+ },
34
+ {
35
+ props: {},
36
+ children: [
37
+ {
38
+ component: "selectFiltersSaved",
39
+ props: {},
40
+ },
41
+ {
42
+ component: "buttonSaveTop",
43
+ props: {},
44
+ },
45
+ {
46
+ component: "buttonDeleteFiltersSaved",
47
+ props: {},
48
+ },
49
+ ],
50
+ },
51
+ ],
52
+ headerBottomGroups: [
53
+ {
54
+ props: {},
55
+ children: [
56
+ {
57
+ component: "addFilterSelect",
58
+ props: {},
59
+ },
60
+ {
61
+ component: "buttonSearch",
62
+ props: {},
63
+ },
64
+ ],
65
+ },
66
+ ],
67
+ },
68
+ });
69
+
70
+ export const filtersPluginComponentsProps = computed(() => {
71
+ const propsByKey = {};
72
+ forEach(filtersPluginOptions.value.config.headerTopGroups, group => {
73
+ forEach(group.children, child => {
74
+ propsByKey[child.component] = child.props;
75
+ });
76
+ });
77
+ forEach(filtersPluginOptions.value.config.headerBottomGroups, group => {
78
+ forEach(group.children, child => {
79
+ propsByKey[child.component] = child.props;
80
+ });
81
+ });
82
+ return propsByKey;
83
+ });
84
+
85
+ export default {
86
+ install: (app, {
87
+ propsDefault = {},
88
+ config = {},
89
+ } = {}) => {
90
+ filtersPluginOptions.value.propsDefault = {
91
+ ...filtersPluginOptions.value.propsDefault,
92
+ ...propsDefault,
93
+ };
94
+ filtersPluginOptions.value.config = {
95
+ ...filtersPluginOptions.value.config,
96
+ ...config,
97
+ };
98
+ },
99
+ };
@@ -1,83 +1,16 @@
1
1
  import {
2
- computed,
3
2
  ref,
4
3
  } from "vue";
5
4
 
6
- import {
7
- forEach,
8
- } from "lodash-es";
9
-
10
5
  export const tablePluginOptions = ref({
11
6
  propsDefault: {
12
7
 
13
8
  },
14
9
  config: {
15
10
  isHtmlTitleSort: false,
16
- headerTopGroups: [
17
- {
18
- props: {},
19
- children: [
20
- {
21
- component: "filterMain",
22
- props: {},
23
- },
24
- {
25
- component: "buttonSearch",
26
- props: {},
27
- },
28
- {
29
- component: "buttonToggle",
30
- props: {},
31
- },
32
- ],
33
- },
34
- {
35
- props: {},
36
- children: [
37
- {
38
- component: "selectFiltersSaved",
39
- props: {},
40
- },
41
- {
42
- component: "buttonSaveTop",
43
- props: {},
44
- },
45
- {
46
- component: "buttonDeleteFiltersSaved",
47
- props: {},
48
- },
49
- ],
50
- },
51
- ],
52
- headerBottomGroups: [
53
- {
54
- props: {},
55
- children: [
56
- {
57
- component: "addFilterSelect",
58
- props: {},
59
- },
60
- {
61
- component: "buttonSearch",
62
- props: {},
63
- },
64
- ],
65
- },
66
- ],
67
11
  },
68
12
  });
69
13
 
70
- export const tablePluginComponentsProps = computed(() => {
71
- const propsByKey = {};
72
- forEach(tablePluginOptions.value.config.headerTopGroups, group => {
73
- forEach(group.children, child => {
74
- propsByKey[child.component] = child.props;
75
- });
76
- });
77
-
78
- return propsByKey;
79
- });
80
-
81
14
  export default {
82
15
  install: (app, {
83
16
  propsDefault = {},