cja-phoenix 0.0.13 → 0.0.14

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.
@@ -1,10 +1,10 @@
1
1
  @font-face {
2
2
  font-family: 'CGG-icomoon';
3
- src: url('fonts/CGG-icomoon.eot?qf25ux');
4
- src: url('fonts/CGG-icomoon.eot?qf25ux#iefix') format('embedded-opentype'),
5
- url('fonts/CGG-icomoon.ttf?qf25ux') format('truetype'),
6
- url('fonts/CGG-icomoon.woff?qf25ux') format('woff'),
7
- url('fonts/CGG-icomoon.svg?qf25ux#CGG-icomoon') format('svg');
3
+ src: url('fonts/CGG-icomoon.eot?cjnnpy');
4
+ src: url('fonts/CGG-icomoon.eot?cjnnpy#iefix') format('embedded-opentype'),
5
+ url('fonts/CGG-icomoon.ttf?cjnnpy') format('truetype'),
6
+ url('fonts/CGG-icomoon.woff?cjnnpy') format('woff'),
7
+ url('fonts/CGG-icomoon.svg?cjnnpy#CGG-icomoon') format('svg');
8
8
  font-weight: normal;
9
9
  font-style: normal;
10
10
  font-display: block;
@@ -2,11 +2,11 @@
2
2
 
3
3
  @font-face {
4
4
  font-family: '#{$icomoon-font-family}';
5
- src: url('#{$icomoon-font-path}/#{$icomoon-font-family}.eot?qf25ux');
6
- src: url('#{$icomoon-font-path}/#{$icomoon-font-family}.eot?qf25ux#iefix') format('embedded-opentype'),
7
- url('#{$icomoon-font-path}/#{$icomoon-font-family}.ttf?qf25ux') format('truetype'),
8
- url('#{$icomoon-font-path}/#{$icomoon-font-family}.woff?qf25ux') format('woff'),
9
- url('#{$icomoon-font-path}/#{$icomoon-font-family}.svg?qf25ux##{$icomoon-font-family}') format('svg');
5
+ src: url('#{$icomoon-font-path}/#{$icomoon-font-family}.eot?cjnnpy');
6
+ src: url('#{$icomoon-font-path}/#{$icomoon-font-family}.eot?cjnnpy#iefix') format('embedded-opentype'),
7
+ url('#{$icomoon-font-path}/#{$icomoon-font-family}.ttf?cjnnpy') format('truetype'),
8
+ url('#{$icomoon-font-path}/#{$icomoon-font-family}.woff?cjnnpy') format('woff'),
9
+ url('#{$icomoon-font-path}/#{$icomoon-font-family}.svg?cjnnpy##{$icomoon-font-family}') format('svg');
10
10
  font-weight: normal;
11
11
  font-style: normal;
12
12
  font-display: block;
@@ -1,12 +1,7 @@
1
1
  <template>
2
2
  <Teleport to="body">
3
3
  <Transition name="details">
4
- <div
5
- class="overlay"
6
- v-if="active"
7
- :style="{ height: overlayHeight }"
8
- @click.self="closeDetails"
9
- >
4
+ <div class="overlay" v-if="active" @click.self="closeDetails">
10
5
  <div ref="detailsEl" class="details-container">
11
6
  <div class="details-header">
12
7
  <slot name="header"></slot>
@@ -15,7 +10,7 @@
15
10
  <span class="m-cgg-icon--cross2"></span>
16
11
  </div>
17
12
  </div>
18
- <div class="details-wrapper">
13
+ <div class="details-body">
19
14
  <slot name="body"></slot>
20
15
  </div>
21
16
  <div class="details-footer" v-if="$slots.footer">
@@ -28,37 +23,18 @@
28
23
  </template>
29
24
 
30
25
  <script lang="ts" setup>
31
- import { ref, watch } from "vue";
26
+ import { ref, watch, computed } from "vue";
32
27
 
33
28
  const active = ref();
34
29
  const detailsEl = ref();
35
- const overlayHeight = ref();
30
+ const headerEl = ref();
31
+ const bodyEl = ref();
32
+ const footerEl = ref();
36
33
 
37
34
  watch(active, () => {
38
35
  if (active.value) {
39
36
  document.body.style.overflow = "hidden";
40
37
  document.documentElement.style.overflow = "hidden";
41
-
42
- if (window.outerWidth >= 992) {
43
- requestAnimationFrame(() => {
44
- const pageHeader = document.querySelector(".header") as HTMLElement;
45
- const appHeader = document.querySelector("#app header") as HTMLElement;
46
- const comboOffset = appHeader
47
- ? pageHeader.clientHeight + appHeader.clientHeight
48
- : pageHeader.clientHeight;
49
- const headerOffset = appHeader?.clientHeight;
50
-
51
- if (appHeader?.classList.contains("position-fixed")) {
52
- overlayHeight.value = `calc(100% - ${headerOffset}px)`;
53
- } else if (window.pageYOffset < comboOffset) {
54
- overlayHeight.value = `calc(100% - ${
55
- comboOffset - window.pageYOffset
56
- }px)`;
57
- }
58
- });
59
- } else {
60
- overlayHeight.value = "";
61
- }
62
38
  } else {
63
39
  document.body.style.overflow = "";
64
40
  document.documentElement.style.overflow = "";
@@ -90,23 +66,31 @@ defineExpose({ openDetails, closeDetails });
90
66
  }
91
67
 
92
68
  .details-container {
69
+ display: flex;
70
+ flex-direction: column;
93
71
  position: absolute;
94
72
  top: 0;
95
73
  right: 0;
96
74
  background-color: #fff;
97
- height: calc(100% - 105px);
75
+ height: 100%;
98
76
  transition: all 0.3s linear;
99
77
 
100
78
  @media screen and (min-width: 992px) {
101
- height: 100%;
79
+ width: 620px;
102
80
  }
103
81
 
104
82
  .details-header {
105
83
  display: flex;
106
84
  justify-content: space-between;
85
+ gap: 15px;
107
86
  align-items: center;
108
87
  background-color: #fff;
109
- padding: 20px 30px;
88
+ padding: 15px;
89
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
90
+
91
+ @media screen and (min-width: 992px) {
92
+ padding: 20px 50px;
93
+ }
110
94
 
111
95
  .btn-close {
112
96
  display: flex;
@@ -121,19 +105,24 @@ defineExpose({ openDetails, closeDetails });
121
105
  }
122
106
  }
123
107
 
124
- .details-wrapper {
108
+ .details-body {
109
+ flex-grow: 1;
125
110
  position: relative;
126
- max-height: 100%;
127
111
  overflow-y: auto;
128
- padding: 0 30px;
112
+ padding: 15px 15px 30px;
129
113
 
130
114
  @media screen and (min-width: 992px) {
131
- width: 570px;
115
+ padding: 20px 50px 50px;
132
116
  }
133
117
  }
134
118
 
135
119
  .details-footer {
136
- padding: 20px 30px;
120
+ padding: 15px;
121
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
122
+
123
+ @media screen and (min-width: 992px) {
124
+ padding: 20px 50px;
125
+ }
137
126
  }
138
127
  }
139
128
  }
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <div class="input-title" v-if="title">
3
+ <span>{{ title }}</span>
4
+ <span
5
+ v-if="tooltip"
6
+ class="tooltip m-cgg-icon--help"
7
+ v-tippy="tooltip"
8
+ ></span>
9
+ </div>
10
+ </template>
11
+
12
+ <script lang="ts" setup>
13
+ const props = defineProps<{
14
+ title: string;
15
+ tooltip?: string;
16
+ }>();
17
+ </script>
18
+
19
+ <style lang="scss" scoped>
20
+ .input-title {
21
+ display: flex;
22
+ justify-content: space-between;
23
+ gap: 10px;
24
+ font-size: 14px;
25
+ line-height: 18px;
26
+ font-weight: bold;
27
+ margin-bottom: 10px;
28
+
29
+ @media screen and (min-width: 768px) {
30
+ font-size: 16px;
31
+ line-height: 20px;
32
+ }
33
+
34
+ .tooltip {
35
+ font-size: 18px;
36
+ color: #076b9c;
37
+
38
+ @media screen and (min-width: 768px) {
39
+ font-size: 20px;
40
+ }
41
+ }
42
+ }
43
+ </style>
@@ -1,12 +1,13 @@
1
1
  <template>
2
2
  <div class="form-group">
3
- <div class="input-title" v-if="title">{{ title }}</div>
3
+ <InputTitle v-bind="{ title, tooltip }" v-if="title" />
4
4
 
5
5
  <div class="input-container" :class="{ error: errorMessage }">
6
6
  <input
7
7
  ref="inputEl"
8
8
  :id="id"
9
- v-maska="'#########'"
9
+ v-maska
10
+ data-maska="#########"
10
11
  :placeholder="placeholder && placeholder"
11
12
  type="tel"
12
13
  :value="value"
@@ -26,34 +27,31 @@
26
27
  <script lang="ts" setup>
27
28
  import { useField } from "vee-validate";
28
29
  import intlTelInput from "intl-tel-input";
29
- import { ref, onMounted, watch } from "vue";
30
+ import { ref, onMounted, watch, InputHTMLAttributes } from "vue";
31
+ import { vMaska } from "maska";
32
+ import InputTitle from "./InputTitle.vue";
30
33
 
31
34
  const inputEl = ref();
32
- const props = defineProps({
33
- placeholder: {
34
- type: String,
35
- default: "",
36
- },
37
- title: {
38
- type: String,
39
- required: true,
40
- },
41
- modelValue: {
42
- type: String,
43
- default: "",
44
- },
45
- phoneCountryCode: {
46
- type: String,
47
- default: "",
48
- },
49
- errorDisplay: {
50
- type: Boolean,
51
- default: true,
52
- },
53
- validation: Object,
54
- autocomplete: String,
55
- id: String,
56
- });
35
+
36
+ const props = withDefaults(
37
+ defineProps<{
38
+ placeholder?: string;
39
+ title?: string;
40
+ tooltip?: string;
41
+ modelValue: InputHTMLAttributes["value"];
42
+ phoneCountryCode: number;
43
+ errorDisplay?: boolean;
44
+ validation?: any;
45
+ autocomplete?: InputHTMLAttributes["autocomplete"];
46
+ id?: InputHTMLAttributes["id"];
47
+ }>(),
48
+ {
49
+ placeholder: "",
50
+ modelValue: "",
51
+ errorDisplay: true,
52
+ phoneCountryCode: 351,
53
+ }
54
+ );
57
55
 
58
56
  const { value, errorMessage, meta, validate, setValue } = useField(
59
57
  "input",
@@ -1,9 +1,6 @@
1
1
  <template>
2
2
  <div class="form-group">
3
- <div class="input-title" v-if="title">
4
- <span>{{ title }}</span>
5
- <span v-if="tooltip" class="tooltip" v-tippy="tooltip">?</span>
6
- </div>
3
+ <InputTitle v-bind="{ title, tooltip }" v-if="title" />
7
4
 
8
5
  <div
9
6
  ref="inputEl"
@@ -73,6 +70,7 @@ import {
73
70
  SelectHTMLAttributes,
74
71
  } from "vue";
75
72
  import { SelectOption } from "../../types/SelectOption";
73
+ import InputTitle from "./InputTitle.vue";
76
74
 
77
75
  const open = ref(false);
78
76
  const search = ref("");
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="form-group">
3
- <div class="input-title" v-if="title">{{ title }}</div>
3
+ <InputTitle v-bind="{ title, tooltip }" v-if="title" />
4
4
 
5
5
  <div
6
6
  class="input-container"
@@ -9,7 +9,8 @@
9
9
  }"
10
10
  >
11
11
  <input
12
- v-maska="mask"
12
+ v-maska
13
+ :data-maska="mask"
13
14
  :id="id"
14
15
  :inputmode="inputmode"
15
16
  :placeholder="placeholder && placeholder"
@@ -42,13 +43,16 @@ import {
42
43
  onMounted,
43
44
  ref,
44
45
  } from "vue";
46
+ import { vMaska } from "maska";
47
+ import InputTitle from "./InputTitle.vue";
45
48
 
46
49
  const props = withDefaults(
47
50
  defineProps<{
51
+ title?: string;
52
+ tooltip?: string;
48
53
  mask?: string;
49
54
  placeholder?: InputHTMLAttributes["placeholder"];
50
55
  icon?: string;
51
- title?: string;
52
56
  inputmode?: HTMLAttributes["inputmode"];
53
57
  type?: InputHTMLAttributes["type"];
54
58
  error?: string;
package/src/index.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { App } from "vue";
2
2
  import * as components from "./components";
3
- import Maska from "maska";
4
3
  import VueTippy from "vue-tippy";
5
4
 
6
5
  function install(app: App) {
@@ -9,7 +8,6 @@ function install(app: App) {
9
8
  app.component(key, components[key]);
10
9
  }
11
10
 
12
- app.use(Maska);
13
11
  app.use(VueTippy, {
14
12
  defaultProps: { theme: "light-border", allowHTML: true },
15
13
  });