@tager/admin-banners 0.3.5 → 1.0.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.
Files changed (75) hide show
  1. package/dist/constants/paths.d.ts +5 -10
  2. package/dist/constants/routes.d.ts +4 -4
  3. package/dist/dev/App.vue.d.ts +5 -0
  4. package/dist/dev/config.d.ts +2 -0
  5. package/dist/dev/env.d.ts +1 -0
  6. package/dist/dev/main.d.ts +3 -0
  7. package/dist/hooks/index.d.ts +2 -2
  8. package/dist/hooks/useFetchBanner.d.ts +7 -8
  9. package/dist/hooks/useFetchBanners.d.ts +3 -6
  10. package/dist/hooks/useFetchZoneFields.d.ts +7 -0
  11. package/dist/hooks/useFetchZones.d.ts +3 -6
  12. package/dist/index.mjs +993 -0
  13. package/dist/locales/apply.d.ts +1 -0
  14. package/dist/locales/en.d.ts +41 -40
  15. package/dist/locales/ru.d.ts +2 -3
  16. package/dist/main.d.ts +3 -4
  17. package/dist/services/requests.d.ts +25 -24
  18. package/dist/style.css +1 -0
  19. package/dist/typings/banners.d.ts +47 -40
  20. package/dist/typings/common.d.ts +1 -1
  21. package/dist/typings/model.d.ts +104 -104
  22. package/dist/typings/zones.d.ts +9 -5
  23. package/dist/utils/common.d.ts +2 -2
  24. package/dist/utils/paths.d.ts +5 -0
  25. package/dist/views/Banners/BannerForm/BannerForm.helpers.d.ts +5 -5
  26. package/dist/views/Banners/BannerForm/BannerForm.vue.d.ts +2694 -81
  27. package/dist/views/Banners/BannerForm/index.d.ts +1 -1
  28. package/dist/views/Banners/BannerList/BannerList.helpers.d.ts +6 -6
  29. package/dist/views/Banners/BannerList/BannerList.vue.d.ts +25 -55
  30. package/dist/views/Banners/BannerList/hooks/index.d.ts +1 -1
  31. package/dist/views/Banners/BannerList/hooks/useAdvancedSearch.d.ts +23 -21
  32. package/dist/views/Banners/BannerList/index.d.ts +1 -1
  33. package/dist/views/Zones/ZoneList/ZoneList.helpers.d.ts +5 -5
  34. package/dist/views/Zones/ZoneList/ZoneList.vue.d.ts +11 -28
  35. package/dist/views/Zones/ZoneList/index.d.ts +1 -1
  36. package/package.json +51 -49
  37. package/src/constants/paths.ts +1 -15
  38. package/src/constants/routes.ts +7 -7
  39. package/src/dev/App.vue +46 -0
  40. package/src/dev/config.ts +23 -0
  41. package/src/dev/env.ts +17 -0
  42. package/src/dev/main.ts +47 -0
  43. package/src/hooks/useFetchBanner.ts +3 -6
  44. package/src/hooks/useFetchBanners.ts +2 -5
  45. package/src/hooks/useFetchZoneFields.ts +39 -0
  46. package/src/hooks/useFetchZones.ts +2 -5
  47. package/src/locales/apply.ts +9 -0
  48. package/src/locales/en.ts +2 -1
  49. package/src/locales/ru.ts +40 -41
  50. package/src/main.ts +3 -8
  51. package/src/services/requests.ts +7 -1
  52. package/src/typings/banners.ts +14 -2
  53. package/src/typings/zones.ts +6 -0
  54. package/src/utils/paths.ts +15 -0
  55. package/src/views/Banners/BannerForm/BannerForm.helpers.ts +10 -0
  56. package/src/views/Banners/BannerForm/BannerForm.vue +168 -83
  57. package/src/views/Banners/BannerList/BannerList.helpers.ts +11 -4
  58. package/src/views/Banners/BannerList/BannerList.vue +60 -47
  59. package/src/views/Banners/BannerList/hooks/useAdvancedSearch.ts +14 -14
  60. package/src/views/Zones/ZoneList/ZoneList.helpers.ts +1 -1
  61. package/src/views/Zones/ZoneList/ZoneList.vue +18 -19
  62. package/CHANGELOG.md +0 -13
  63. package/dist/constants/menu.d.ts +0 -5
  64. package/dist/dev.d.ts +0 -1
  65. package/dist/index.esm.js +0 -3621
  66. package/dist/index.umd.js +0 -3640
  67. package/dist/router/index.d.ts +0 -4
  68. package/src/constants/menu.ts +0 -26
  69. package/src/dev.ts +0 -34
  70. package/src/router/index.ts +0 -38
  71. package/src/typings/sfc.d.ts +0 -12
  72. package/src/typings/shims-tsx.d.ts +0 -13
  73. package/src/typings/shims-vue.d.ts +0 -11
  74. package/src/views/App.vue +0 -22
  75. package/src/views/Home.vue +0 -37
@@ -3,7 +3,7 @@ import { TFunction } from 'i18next';
3
3
  import { ColumnDefinition } from '@tager/admin-ui';
4
4
 
5
5
  import { Zone } from '../../../typings/zones';
6
- import { getBannersBannerListUrl } from '../../../constants/paths';
6
+ import { getBannersBannerListUrl } from '../../../utils/paths';
7
7
 
8
8
  export function getColumnDefs(t: TFunction): ColumnDefinition<Zone>[] {
9
9
  return [
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <page :title="$t('banners:zones')">
3
- <template v-slot:content>
4
- <data-table
2
+ <Page :title="$i18n.t('banners:zones')">
3
+ <template #content>
4
+ <DataTable
5
5
  :column-defs="columnDefs"
6
6
  :row-data="rowData"
7
7
  :loading="isRowDataLoading"
@@ -11,29 +11,26 @@
11
11
  :use-pagination="false"
12
12
  @change="handleChange"
13
13
  >
14
- <template v-slot:cell(banners-count)="{ row }">
15
- <count-button
14
+ <template #cell(banners-count)="{ row }">
15
+ <CountButton
16
16
  :href="getLinkToBannersByZone(row.id)"
17
17
  variant="outline-secondary"
18
18
  :count="row.bannersCount"
19
19
  >
20
- {{ $t('banners:banners') }}
21
- </count-button>
20
+ {{ $i18n.t('banners:banners') }}
21
+ </CountButton>
22
22
  </template>
23
- </data-table>
23
+ </DataTable>
24
24
  </template>
25
- </page>
25
+ </Page>
26
26
  </template>
27
27
 
28
28
  <script lang="ts">
29
- import {
30
- computed,
31
- defineComponent,
32
- onMounted,
33
- SetupContext,
34
- } from '@vue/composition-api';
29
+ import { computed, defineComponent, onMounted, SetupContext } from 'vue';
35
30
 
36
- import { useDataTable } from '@tager/admin-ui';
31
+ import { CountButton, useDataTable, DataTable } from '@tager/admin-ui';
32
+ import { Page } from '@tager/admin-layout';
33
+ import { useI18n } from '@tager/admin-services';
37
34
 
38
35
  import { Zone } from '../../../typings/zones';
39
36
  import { getZones } from '../../../services/requests';
@@ -42,7 +39,10 @@ import { getColumnDefs, getLinkToBannersByZone } from './ZoneList.helpers';
42
39
 
43
40
  export default defineComponent({
44
41
  name: 'ZoneList',
45
- setup(props, context: SetupContext) {
42
+ components: { CountButton, Page, DataTable },
43
+ setup() {
44
+ const i18n = useI18n();
45
+
46
46
  const {
47
47
  fetchEntityList: fetchZones,
48
48
  isLoading: isZonesLoading,
@@ -52,7 +52,6 @@ export default defineComponent({
52
52
  } = useDataTable<Zone>({
53
53
  fetchEntityList: getZones,
54
54
  initialValue: [],
55
- context,
56
55
  resourceName: 'Banner Zones',
57
56
  });
58
57
 
@@ -60,7 +59,7 @@ export default defineComponent({
60
59
  fetchZones();
61
60
  });
62
61
 
63
- const columnDefs = computed(() => getColumnDefs(context.root.$t));
62
+ const columnDefs = computed(() => getColumnDefs(i18n.t));
64
63
 
65
64
  return {
66
65
  columnDefs,
package/CHANGELOG.md DELETED
@@ -1,13 +0,0 @@
1
- # [0.0.2] (2020-06-06)
2
-
3
- ### Features
4
-
5
- * **services:** Use VUE_APP_API_ORIGIN env variable as initial api origin value in ApiService
6
-
7
- # [0.0.3] (2020-06-06)
8
-
9
- ### Bug Fixes
10
-
11
- * **services:** Use api origin from ApiService to configure url for file upload
12
-
13
-
@@ -1,5 +0,0 @@
1
- import { MenuItemType } from '@tager/admin-layout';
2
- import { TranslateFunction } from '@tager/admin-services';
3
- export declare function getBannersMenuItem(params: {
4
- t: TranslateFunction;
5
- }): MenuItemType;
package/dist/dev.d.ts DELETED
@@ -1 +0,0 @@
1
- import '@tager/admin-ui/dist/admin-ui.css';