hl-core 0.0.8 → 0.0.9-beta.10

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 (73) hide show
  1. package/api/index.ts +202 -161
  2. package/api/interceptors.ts +23 -17
  3. package/components/Button/Btn.vue +4 -4
  4. package/components/Button/ScrollButtons.vue +2 -2
  5. package/components/Complex/ContentBlock.vue +1 -1
  6. package/components/Complex/MessageBlock.vue +26 -0
  7. package/components/Complex/Page.vue +8 -2
  8. package/components/Complex/WhiteBlock.vue +7 -0
  9. package/components/Dialog/Dialog.vue +9 -39
  10. package/components/Dialog/FamilyDialog.vue +10 -7
  11. package/components/Form/FormBlock.vue +91 -45
  12. package/components/Form/FormSection.vue +5 -2
  13. package/components/Form/FormTextSection.vue +3 -3
  14. package/components/Form/FormToggle.vue +4 -5
  15. package/components/Form/ManagerAttachment.vue +210 -0
  16. package/components/Form/ProductConditionsBlock.vue +70 -16
  17. package/components/Input/Datepicker.vue +45 -0
  18. package/components/Input/EmptyFormField.vue +1 -1
  19. package/components/Input/FileInput.vue +2 -3
  20. package/components/Input/FormInput.vue +31 -7
  21. package/components/Input/PanelInput.vue +7 -2
  22. package/components/Input/RoundedEmptyField.vue +5 -0
  23. package/components/Input/RoundedInput.vue +2 -2
  24. package/components/Input/RoundedSelect.vue +150 -0
  25. package/components/Layout/Drawer.vue +5 -2
  26. package/components/Layout/Header.vue +41 -5
  27. package/components/Layout/Loader.vue +1 -1
  28. package/components/Layout/SettingsPanel.vue +47 -13
  29. package/components/List/ListEmpty.vue +1 -1
  30. package/components/Menu/MenuHover.vue +30 -0
  31. package/components/Menu/MenuNav.vue +30 -14
  32. package/components/Menu/MenuNavItem.vue +10 -7
  33. package/components/Pages/Anketa.vue +68 -47
  34. package/components/Pages/Auth.vue +139 -46
  35. package/components/Pages/ContragentForm.vue +505 -0
  36. package/components/Pages/Documents.vue +11 -11
  37. package/components/Pages/InvoiceInfo.vue +30 -0
  38. package/components/Pages/MemberForm.vue +574 -316
  39. package/components/Pages/ProductAgreement.vue +2 -2
  40. package/components/Pages/ProductConditions.vue +671 -78
  41. package/components/Panel/PanelHandler.vue +309 -0
  42. package/components/Panel/PanelSelectItem.vue +3 -3
  43. package/components/Transitions/SlideTransition.vue +5 -0
  44. package/components/Utilities/Chip.vue +27 -0
  45. package/components/Utilities/IconBorder.vue +17 -0
  46. package/components/Utilities/JsonViewer.vue +27 -0
  47. package/composables/axios.ts +2 -2
  48. package/composables/classes.ts +227 -107
  49. package/composables/constants.ts +31 -51
  50. package/composables/index.ts +106 -2
  51. package/composables/styles.ts +33 -11
  52. package/configs/i18n.ts +15 -0
  53. package/layouts/default.vue +11 -8
  54. package/layouts/full.vue +1 -1
  55. package/locales/ru.json +647 -0
  56. package/nuxt.config.ts +14 -2
  57. package/package.json +35 -12
  58. package/pages/500.vue +4 -4
  59. package/pages/Token.vue +52 -0
  60. package/plugins/helperFunctionsPlugins.ts +11 -6
  61. package/plugins/storePlugin.ts +0 -1
  62. package/plugins/vuetifyPlugin.ts +8 -1
  63. package/store/data.store.ts +2666 -0
  64. package/store/form.store.ts +1 -1
  65. package/store/member.store.ts +164 -52
  66. package/store/rules.ts +193 -0
  67. package/types/enum.ts +83 -0
  68. package/types/env.d.ts +10 -0
  69. package/types/index.ts +279 -8
  70. package/components/Button/BtnIcon.vue +0 -47
  71. package/store/data.store.js +0 -2482
  72. package/store/messages.ts +0 -429
  73. package/store/rules.js +0 -153
package/nuxt.config.ts CHANGED
@@ -1,14 +1,21 @@
1
1
  import path from 'path';
2
+ import { resolve, dirname } from 'node:path';
3
+ import { fileURLToPath } from 'url';
4
+ import VueI18nVitePlugin from '@intlify/unplugin-vue-i18n/vite';
2
5
 
3
6
  export default defineNuxtConfig({
4
7
  ssr: false,
5
-
6
- modules: ['@pinia/nuxt', '@nuxtjs/tailwindcss', '@nuxt/devtools'],
8
+ spaLoadingTemplate: false,
9
+ modules: ['@pinia/nuxt', '@nuxtjs/tailwindcss', '@nuxt/devtools', '@vueuse/nuxt'],
7
10
 
8
11
  imports: {
9
12
  dirs: ['store', 'composables'],
10
13
  },
11
14
 
15
+ build: {
16
+ transpile: ['@vuepic/vue-datepicker'],
17
+ },
18
+
12
19
  vite: {
13
20
  build: {
14
21
  minify: false,
@@ -30,6 +37,11 @@ export default defineNuxtConfig({
30
37
  },
31
38
  },
32
39
  },
40
+ plugins: [
41
+ VueI18nVitePlugin({
42
+ include: [resolve(dirname(fileURLToPath(import.meta.url)), './locales/*.json')],
43
+ }),
44
+ ],
33
45
  },
34
46
 
35
47
  components: [{ path: './components', prefix: 'Base', pathPrefix: false }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.8",
3
+ "version": "0.0.9-beta.10",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -8,6 +8,8 @@
8
8
  "api/",
9
9
  "store/",
10
10
  "layouts/",
11
+ "locales/",
12
+ "configs/",
11
13
  "composables/",
12
14
  "components/",
13
15
  "plugins/",
@@ -17,32 +19,53 @@
17
19
  "tailwind.config.js",
18
20
  ".prettierrc"
19
21
  ],
22
+ "config": {
23
+ "project": "",
24
+ "branch": ""
25
+ },
20
26
  "scripts": {
21
27
  "build": "nuxt build",
22
- "dev": "nuxt clean && nuxt dev",
28
+ "dev": "nuxt dev",
23
29
  "generate": "nuxt generate",
24
- "preview": "nuxt preview"
30
+ "preview": "nuxt preview",
31
+ "tk:all": "cd .. && cd baiterek && yarn typecheck && cd .. && cd bolashak && yarn typecheck && cd .. && cd calculator && yarn typecheck && cd .. && cd efo && yarn typecheck && cd .. && cd gons && yarn typecheck && cd .. && cd kazyna && yarn typecheck && cd .. && cd lifebusiness && yarn typecheck && cd .. && cd liferenta && yarn typecheck && cd .. && cd lifetrip && yarn typecheck && cd .. && cd core",
32
+ "i:all": "cd .. && cd baiterek && yarn && cd .. && cd bolashak && yarn && cd .. && cd calculator && yarn && cd .. && cd efo && yarn && cd .. && cd gons && yarn && cd .. && cd kazyna && yarn && cd .. && cd lifebusiness && yarn && cd .. && cd liferenta && yarn && cd .. && cd lifetrip && yarn && cd .. && cd core",
33
+ "update:core": "git checkout -b %npm_package_version% && git add . && git commit -m \"%npm_package_version%\" && git push && git checkout main",
34
+ "update:aml": "cd ../../aml/aml && yarn && cd ../checkcontract && yarn && cd ../checkcontragent && yarn && cd.. && git checkout -b %npm_package_version% && git add . && git commit -m \"%npm_package_version%\" && git push && git checkout main && cd ../efo/core",
35
+ "update:lka": "cd .. && cd lka && yarn && git checkout -b %npm_package_version% && git add . && git commit -m \"%npm_package_version%\" && git push && git checkout main && cd .. && cd core",
36
+ "update:all": "yarn update:aml && yarn update:lka",
37
+ "pull:core": "git pull && git fetch",
38
+ "pull:aml": "cd ../../aml && git pull && cd ../efo/core",
39
+ "pull:lka": "cd ../../lka && git pull && cd ../efo/core",
40
+ "pull:all": "yarn pull:core && yarn pull:aml && yarn pull:lka",
41
+ "typecheck": "nuxt typecheck"
25
42
  },
26
43
  "devDependencies": {
27
44
  "@nuxt/devtools": "^0.4.5",
28
- "@nuxt/types": "^2.16.3",
29
- "nuxt": "^3.4.3",
30
- "prettier": "^2.8.4",
31
- "typescript": "^4.9.5"
45
+ "@vueuse/components": "^10.2.1",
46
+ "@vueuse/core": "^10.2.1",
47
+ "@vueuse/nuxt": "^10.2.1",
48
+ "nuxt": "^3.6.2",
49
+ "prettier": "^2.8.8"
32
50
  },
33
51
  "dependencies": {
52
+ "@intlify/unplugin-vue-i18n": "^0.12.2",
34
53
  "@mdi/font": "^7.2.96",
35
- "@nuxtjs/tailwindcss": "^6.6.7",
36
- "@pinia/nuxt": "^0.4.9",
54
+ "@nuxtjs/tailwindcss": "^6.8.0",
55
+ "@pinia/nuxt": "^0.4.11",
56
+ "@vuepic/vue-datepicker": "^5.3.0",
37
57
  "animate.css": "^4.1.1",
38
58
  "axios": "^1.4.0",
39
59
  "fast-xml-parser": "4.0.12",
40
60
  "jwt-decode": "^3.1.2",
41
61
  "maska": "1.5.0",
42
- "pinia": "^2.0.35",
43
- "v-idle-3": "^0.3.14",
62
+ "pinia": "^2.1.4",
63
+ "typedoc": "^0.24.8",
64
+ "typescript": "5.0.4",
65
+ "vue-i18n": "^9.2.2",
66
+ "vue-json-pretty": "^2.2.4",
44
67
  "vue-toastification": "^2.0.0-rc.5",
45
68
  "vue-uuid": "^3.0.0",
46
- "vuetify": "^3.2.1"
69
+ "vuetify": "^3.3.7"
47
70
  }
48
71
  }
package/pages/500.vue CHANGED
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <base-content class="!w-full flex-col justify-center items-center gap-[100px]" :class="[$libStyles.blueBgLight]">
2
+ <base-content class="!w-full flex-col justify-center items-center gap-[100px]" :class="[$styles.blueBgLight]">
3
3
  <svg class="w-[240px] lg:w-[330px]" draggable="false" width="277" height="99" viewBox="0 0 277 99" fill="none" xmlns="http://www.w3.org/2000/svg">
4
4
  <path
5
5
  fill-rule="evenodd"
@@ -39,7 +39,7 @@
39
39
  />
40
40
  </svg>
41
41
  <div class="text-center">
42
- <h2 :class="[$libStyles.blackText]" class="text-[26px] leading-5 mb-5">Сервис временно не доступен</h2>
42
+ <h2 :class="[$styles.blackText]" class="text-[26px] leading-5 mb-5">Сервис временно не доступен</h2>
43
43
  <p v-if="errorStack.length" class="mt-4 flex flex-col">
44
44
  <span v-for="(error, index) of errorStack" :key="error">
45
45
  <i v-if="index !== 0" class="mdi mdi-arrow-right"></i>
@@ -47,7 +47,7 @@
47
47
  >
48
48
  </p>
49
49
  </div>
50
- <base-btn text="На главную" @click="goBack" class="!w-fit px-14"></base-btn>
50
+ <base-btn text="На главную" @click="goBack" class="!w-fit px-14" />
51
51
  </base-content>
52
52
  </template>
53
53
 
@@ -69,7 +69,7 @@ export default defineComponent({
69
69
  });
70
70
 
71
71
  const goBack = () => {
72
- if (dataStore.isEFO) {
72
+ if (dataStore.isBridge) {
73
73
  router.push({ name: 'Auth' });
74
74
  } else {
75
75
  dataStore.sendToParent(constants.postActions.Error500, 500);
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <div></div>
3
+ </template>
4
+
5
+ <script lang="ts">
6
+ export default defineComponent({
7
+ setup() {
8
+ definePageMeta({
9
+ layout: 'clear',
10
+ });
11
+ const route = useRoute();
12
+ const router = useRouter();
13
+ const dataStore = useDataStore();
14
+
15
+ const getMainPageRoute = () => {
16
+ if (dataStore.isEFO) {
17
+ return 'Insurance-Product';
18
+ }
19
+ if (dataStore.isLKA) {
20
+ return 'Menu';
21
+ }
22
+ if (dataStore.isAML) {
23
+ return 'Main';
24
+ }
25
+ return 'index';
26
+ };
27
+
28
+ onMounted(async () => {
29
+ if (!dataStore.isBridge) {
30
+ dataStore.sendToParent(constants.postActions.Error401, 401);
31
+ return;
32
+ }
33
+ const mainRoute = getMainPageRoute();
34
+ if (mainRoute && route.query && 'token' in route.query) {
35
+ const token = route.query.token as string;
36
+ if (isValidToken(token)) {
37
+ localStorage.setItem('accessToken', token);
38
+ dataStore.accessToken = token;
39
+ dataStore.getUserRoles();
40
+ }
41
+ const routeQuery = route.query;
42
+ delete routeQuery.token;
43
+ await router.push({ name: mainRoute, query: Object.keys(routeQuery).length === 0 ? undefined : routeQuery });
44
+ } else {
45
+ await router.push({ name: 'Auth' });
46
+ }
47
+ });
48
+
49
+ return {};
50
+ },
51
+ });
52
+ </script>
@@ -1,21 +1,26 @@
1
1
  import { capitalize, getFullNameShorted, reformatIin, Masks } from '../composables';
2
2
  import { constants } from '../composables/constants';
3
3
  import { Styles } from '../composables/styles';
4
- import Vidle from 'v-idle-3';
4
+ import VueDatePicker from '@vuepic/vue-datepicker';
5
+ import '@vuepic/vue-datepicker/dist/main.css';
5
6
  import Maska from 'maska';
7
+ import i18n from '../configs/i18n';
6
8
 
7
9
  export default defineNuxtPlugin(nuxtApp => {
8
- nuxtApp.vueApp.use(Vidle, {});
9
10
  nuxtApp.vueApp.use(Maska);
11
+ nuxtApp.vueApp.use(i18n);
12
+ nuxtApp.vueApp.component('VueDatePicker', VueDatePicker);
10
13
 
11
14
  return {
12
15
  provide: {
13
- capitalize: capitalize,
14
- getFullNameShorted: getFullNameShorted,
15
- libStyles: new Styles(),
16
+ env: useEnv(),
16
17
  maska: new Masks(),
17
- reformatIin: reformatIin,
18
+ styles: new Styles(),
18
19
  constants: constants,
20
+ capitalize: capitalize,
21
+ display: useDisplayInfo,
22
+ reformatIin: reformatIin,
23
+ getFullNameShorted: getFullNameShorted,
19
24
  },
20
25
  };
21
26
  });
@@ -13,7 +13,6 @@ export default defineNuxtPlugin(nuxtApp => {
13
13
  provide: {
14
14
  dataStore: dataStore,
15
15
  rules: dataStore.rules,
16
- t: dataStore.t,
17
16
  toast: dataStore.showToaster,
18
17
  },
19
18
  };
@@ -8,8 +8,15 @@ import * as directives from 'vuetify/directives';
8
8
  export default defineNuxtPlugin(nuxtApp => {
9
9
  const vuetify = createVuetify({
10
10
  ssr: false,
11
- components,
11
+ components: {
12
+ ...components,
13
+ },
12
14
  directives,
15
+ defaults: {
16
+ VForm: {
17
+ validateOn: 'lazy',
18
+ },
19
+ },
13
20
  theme: {
14
21
  themes: {
15
22
  light: {