@icvdeveloper/common-module 0.0.44 → 0.0.46
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/dist/module.json +1 -1
- package/dist/runtime/@types/components.d.ts +40 -0
- package/dist/runtime/components/core/Modal.vue +53 -10
- package/dist/runtime/components/core/SvgIcon.vue +21 -1
- package/dist/runtime/components/presenters/PresenterModal.vue +153 -16
- package/dist/runtime/models/conference.d.ts +1 -0
- package/dist/runtime/models/icons.d.ts +1 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -58,3 +58,43 @@ export type presenterListingClassObj = {
|
|
|
58
58
|
presenterBio?: string | null;
|
|
59
59
|
presenterBioLink?: string | null;
|
|
60
60
|
};
|
|
61
|
+
export type svgIconClassObj = {
|
|
62
|
+
container?: string | null;
|
|
63
|
+
svgElement?: string | null;
|
|
64
|
+
};
|
|
65
|
+
export type modalCompObj = {
|
|
66
|
+
svgIcon?: svgIconClassObj;
|
|
67
|
+
};
|
|
68
|
+
export type modalClassObj = {
|
|
69
|
+
container?: string | null;
|
|
70
|
+
modalPositionContainer?: string | null;
|
|
71
|
+
modalContainer?: string | null;
|
|
72
|
+
modalCloseContainer?: string | null;
|
|
73
|
+
modalButton?: string | null;
|
|
74
|
+
modalButtonIcon?: string | null;
|
|
75
|
+
components?: modalCompObj;
|
|
76
|
+
};
|
|
77
|
+
export type modalContentClassObj = {
|
|
78
|
+
container?: string | null;
|
|
79
|
+
modalTitle?: string | null;
|
|
80
|
+
modalImagePositionContainer?: string | null;
|
|
81
|
+
modalImageContainer?: string | null;
|
|
82
|
+
modalImage?: string | null;
|
|
83
|
+
modalTextPositionContainer?: string | null;
|
|
84
|
+
modalTextContainer?: string | null;
|
|
85
|
+
modalName?: string | null;
|
|
86
|
+
modalTitleCompany?: string | null;
|
|
87
|
+
modalBio?: string | null;
|
|
88
|
+
components?: modalCompObj;
|
|
89
|
+
};
|
|
90
|
+
export type presenterModalCompObj = {
|
|
91
|
+
presenterListing?: presenterListingClassObj;
|
|
92
|
+
svgIcon?: svgIconClassObj;
|
|
93
|
+
modal?: modalClassObj;
|
|
94
|
+
modalContent?: modalContentClassObj;
|
|
95
|
+
};
|
|
96
|
+
export type presenterModalClassObj = {
|
|
97
|
+
container?: string | null;
|
|
98
|
+
iconContainer?: string | null;
|
|
99
|
+
components?: presenterModalCompObj;
|
|
100
|
+
};
|
|
@@ -1,25 +1,48 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { toRefs, computed } from "vue";
|
|
2
|
+
import { ref, toRefs, computed } from "vue";
|
|
3
|
+
import { useClassBinding } from "../../composables/useClassBinding";
|
|
4
|
+
import {
|
|
5
|
+
modalClassObj,
|
|
6
|
+
modalCompObj,
|
|
7
|
+
svgIconClassObj,
|
|
8
|
+
} from "../../@types/components";
|
|
3
9
|
|
|
4
|
-
|
|
10
|
+
type Props = {
|
|
5
11
|
visible?: boolean;
|
|
6
12
|
modalSize?: string;
|
|
7
13
|
noScroll?: boolean;
|
|
8
14
|
showClose?: boolean;
|
|
9
15
|
usePadding?: boolean;
|
|
10
|
-
|
|
16
|
+
classObject?: modalClassObj;
|
|
17
|
+
};
|
|
11
18
|
|
|
19
|
+
// classObject.components.svgIcon is not functioning properly and cannot be passed to svgIcon component
|
|
12
20
|
const props = withDefaults(defineProps<Props>(), {
|
|
13
21
|
visible: false,
|
|
14
|
-
modalSize: "
|
|
22
|
+
modalSize: "50",
|
|
15
23
|
noScroll: false,
|
|
16
24
|
showClose: true,
|
|
17
25
|
usePadding: true,
|
|
26
|
+
classObject: () => {
|
|
27
|
+
return {
|
|
28
|
+
container: "",
|
|
29
|
+
modalPositionContainer: "",
|
|
30
|
+
modalContainer: "",
|
|
31
|
+
modalCloseContainer: "",
|
|
32
|
+
modalButton: "",
|
|
33
|
+
modalButtonIcon: "",
|
|
34
|
+
components: ref<modalCompObj>({
|
|
35
|
+
svgIcon: ref<svgIconClassObj>({}),
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
},
|
|
18
39
|
});
|
|
19
40
|
|
|
20
41
|
const emit = defineEmits(["trigger", "clicked"]);
|
|
21
42
|
|
|
22
|
-
const { visible, modalSize, noScroll, showClose, usePadding } =
|
|
43
|
+
const { visible, modalSize, noScroll, showClose, usePadding, classObject } =
|
|
44
|
+
toRefs(props);
|
|
45
|
+
const { classBinding } = useClassBinding();
|
|
23
46
|
|
|
24
47
|
const modalClass = computed(() => {
|
|
25
48
|
const padding = usePadding.value ? "p-6" : "";
|
|
@@ -44,20 +67,37 @@ const clicked = () => {
|
|
|
44
67
|
<Transition>
|
|
45
68
|
<div
|
|
46
69
|
v-if="visible"
|
|
47
|
-
class="
|
|
70
|
+
:class="
|
|
71
|
+
classBinding(
|
|
72
|
+
classObject,
|
|
73
|
+
'modalPositionContainer',
|
|
74
|
+
'fixed top-0 bottom-0 left-0 right-0 z-50 flex bg-smoke-light p-3'
|
|
75
|
+
)
|
|
76
|
+
"
|
|
48
77
|
@click="clicked"
|
|
49
78
|
>
|
|
50
79
|
<div
|
|
51
80
|
class="custom-max-width"
|
|
52
|
-
:class="modalClass"
|
|
81
|
+
:class="classBinding(classObject, 'modalContainer', modalClass)"
|
|
53
82
|
:style="'--maxw: ' + modalSize + '%;'"
|
|
54
83
|
>
|
|
55
84
|
<span
|
|
56
85
|
v-if="showClose"
|
|
57
|
-
class="
|
|
86
|
+
:class="
|
|
87
|
+
classBinding(
|
|
88
|
+
classObject,
|
|
89
|
+
'modalCloseContainer',
|
|
90
|
+
'absolute top-0 bottom-0 right-0 z-30 max-h-1em'
|
|
91
|
+
)
|
|
92
|
+
"
|
|
58
93
|
>
|
|
59
|
-
<button
|
|
60
|
-
|
|
94
|
+
<button
|
|
95
|
+
:class="classBinding(classObject, 'modalButton', 'p-3')"
|
|
96
|
+
@click="closeModal()"
|
|
97
|
+
>
|
|
98
|
+
<span :class="classBinding(classObject, 'modalButtonIcon', '')"
|
|
99
|
+
><CommonSvgIcon icon="close" width=".7rem"
|
|
100
|
+
/></span>
|
|
61
101
|
</button>
|
|
62
102
|
</span>
|
|
63
103
|
|
|
@@ -77,6 +117,9 @@ const clicked = () => {
|
|
|
77
117
|
background-color: rgba(0, 0, 0, 0.4);
|
|
78
118
|
}
|
|
79
119
|
|
|
120
|
+
.custom-max-width {
|
|
121
|
+
max-width: 85%;
|
|
122
|
+
}
|
|
80
123
|
@screen lg {
|
|
81
124
|
.custom-max-width {
|
|
82
125
|
max-width: calc(var(--maxw) * 1.25);
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { find, get } from "lodash-es";
|
|
3
3
|
import { toRefs, computed, defineAsyncComponent } from "vue";
|
|
4
4
|
import { Icon, Icons } from "../../models/icons";
|
|
5
|
+
import { svgIconClassObj } from "../../@types/components";
|
|
6
|
+
import { useClassBinding } from "../../composables/useClassBinding";
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Delay importing only the icon file that we need
|
|
@@ -73,21 +75,35 @@ const icons: Icons = {
|
|
|
73
75
|
() => import("../../assets/svg/icon-down-arrow.svg")
|
|
74
76
|
),
|
|
75
77
|
},
|
|
78
|
+
close: {
|
|
79
|
+
color: "#000",
|
|
80
|
+
component: defineAsyncComponent(
|
|
81
|
+
() => import("../../assets/svg/icon-close.svg")
|
|
82
|
+
),
|
|
83
|
+
},
|
|
76
84
|
};
|
|
77
85
|
|
|
78
86
|
type Props = {
|
|
79
87
|
icon?: keyof Icons;
|
|
80
88
|
grayScale?: boolean;
|
|
81
89
|
width?: string;
|
|
90
|
+
classObject?: svgIconClassObj;
|
|
82
91
|
};
|
|
83
92
|
|
|
84
93
|
const props = withDefaults(defineProps<Props>(), {
|
|
85
94
|
icon: "info",
|
|
86
95
|
grayScale: false,
|
|
87
96
|
width: "20px",
|
|
97
|
+
classObject: () => {
|
|
98
|
+
return {
|
|
99
|
+
container: "",
|
|
100
|
+
svgElement: "",
|
|
101
|
+
};
|
|
102
|
+
},
|
|
88
103
|
});
|
|
89
104
|
|
|
90
105
|
const { icon, grayScale, width } = toRefs(props);
|
|
106
|
+
const { classBinding } = useClassBinding();
|
|
91
107
|
|
|
92
108
|
// computed
|
|
93
109
|
const iconDims = computed(() => ({
|
|
@@ -114,6 +130,10 @@ const iconComponent = computed(() => {
|
|
|
114
130
|
|
|
115
131
|
<template>
|
|
116
132
|
<div :style="iconDims">
|
|
117
|
-
<component
|
|
133
|
+
<component
|
|
134
|
+
:is="iconComponent"
|
|
135
|
+
:style="iconStyle"
|
|
136
|
+
:class="classBinding(classObject, 'svgElement', '')"
|
|
137
|
+
/>
|
|
118
138
|
</div>
|
|
119
139
|
</template>
|
|
@@ -2,19 +2,69 @@
|
|
|
2
2
|
import { ref, toRefs } from "vue";
|
|
3
3
|
import { Presenter } from "../../models/conference";
|
|
4
4
|
import { usePresenter } from "../../composables/usePresenter";
|
|
5
|
+
import { useClassBinding } from "../../composables/useClassBinding";
|
|
6
|
+
import {
|
|
7
|
+
presenterModalClassObj,
|
|
8
|
+
presenterListingClassObj,
|
|
9
|
+
presenterModalCompObj,
|
|
10
|
+
svgIconClassObj,
|
|
11
|
+
modalContentClassObj,
|
|
12
|
+
modalClassObj,
|
|
13
|
+
modalCompObj,
|
|
14
|
+
} from "../../@types/components";
|
|
15
|
+
import { Position } from "../../enums/general";
|
|
5
16
|
|
|
6
17
|
type Props = {
|
|
7
18
|
presenter: Presenter;
|
|
19
|
+
enableBio?: boolean;
|
|
20
|
+
showBio?: boolean;
|
|
21
|
+
isSmallGroupedTrack?: boolean;
|
|
22
|
+
bioLinkOnName?: boolean;
|
|
23
|
+
bioLinkText?: string;
|
|
8
24
|
useIcon?: boolean;
|
|
9
|
-
|
|
25
|
+
bioLinkPosition?: Position;
|
|
26
|
+
imagePosition?: Position;
|
|
27
|
+
classObject?: presenterModalClassObj;
|
|
10
28
|
};
|
|
11
29
|
|
|
12
30
|
const props = withDefaults(defineProps<Props>(), {
|
|
13
31
|
useIcon: true,
|
|
32
|
+
enableBio: true,
|
|
33
|
+
showBio: false,
|
|
34
|
+
isSmallGroupedTrack: false,
|
|
35
|
+
bioLinkOnName: true,
|
|
36
|
+
bioLinkText: "Read More >",
|
|
37
|
+
bioLinkPosition: Position.BOTTOM,
|
|
38
|
+
imagePosition: Position.LEFT,
|
|
39
|
+
|
|
40
|
+
classObject: () => {
|
|
41
|
+
return {
|
|
42
|
+
container: "",
|
|
43
|
+
iconContainer: "",
|
|
44
|
+
components: ref<presenterModalCompObj>({
|
|
45
|
+
presenterListing: ref<presenterListingClassObj>({}),
|
|
46
|
+
svgIcon: ref<svgIconClassObj>({}),
|
|
47
|
+
modal: ref<modalClassObj>({}),
|
|
48
|
+
modalContent: ref<modalContentClassObj>({}),
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
},
|
|
14
52
|
});
|
|
15
53
|
|
|
16
|
-
const {
|
|
54
|
+
const {
|
|
55
|
+
presenter,
|
|
56
|
+
useIcon,
|
|
57
|
+
enableBio,
|
|
58
|
+
showBio,
|
|
59
|
+
isSmallGroupedTrack,
|
|
60
|
+
bioLinkOnName,
|
|
61
|
+
bioLinkText,
|
|
62
|
+
bioLinkPosition,
|
|
63
|
+
imagePosition,
|
|
64
|
+
classObject,
|
|
65
|
+
} = toRefs(props);
|
|
17
66
|
const modalVisible = ref<boolean>(false);
|
|
67
|
+
const { classBinding } = useClassBinding();
|
|
18
68
|
|
|
19
69
|
// methods
|
|
20
70
|
const { fullName, presenterImageStyle, itemWidthStyle, isGrayScale } =
|
|
@@ -23,10 +73,21 @@ const { fullName, presenterImageStyle, itemWidthStyle, isGrayScale } =
|
|
|
23
73
|
|
|
24
74
|
<template>
|
|
25
75
|
<div>
|
|
26
|
-
<div
|
|
76
|
+
<div
|
|
77
|
+
v-if="useIcon"
|
|
78
|
+
:class="
|
|
79
|
+
classBinding(
|
|
80
|
+
classObject,
|
|
81
|
+
'iconContainer',
|
|
82
|
+
'presenter-icon cursor-pointer'
|
|
83
|
+
)
|
|
84
|
+
"
|
|
85
|
+
>
|
|
27
86
|
<CommonSvgIcon
|
|
28
87
|
icon="info"
|
|
29
88
|
:greyscale="isGrayScale"
|
|
89
|
+
:class="classBinding(classObject.components.svgIcon, 'container', '')"
|
|
90
|
+
:class-object="classObject.components.svgIcon"
|
|
30
91
|
@click="modalVisible = true"
|
|
31
92
|
></CommonSvgIcon>
|
|
32
93
|
</div>
|
|
@@ -34,41 +95,109 @@ const { fullName, presenterImageStyle, itemWidthStyle, isGrayScale } =
|
|
|
34
95
|
<CommonPresenterListing
|
|
35
96
|
v-else
|
|
36
97
|
:presenter="presenter"
|
|
37
|
-
:enable-bio="
|
|
38
|
-
:show-bio="
|
|
98
|
+
:enable-bio="enableBio"
|
|
99
|
+
:show-bio="showBio"
|
|
100
|
+
:is-small-grouped-track="isSmallGroupedTrack"
|
|
101
|
+
:bio-link-on-name="bioLinkOnName"
|
|
102
|
+
:bio-link-text="bioLinkText"
|
|
103
|
+
:bio-link-position="bioLinkPosition"
|
|
104
|
+
:image-position="imagePosition"
|
|
39
105
|
text-class="font-bold text-base"
|
|
40
106
|
link-class="agenda-presenter-color"
|
|
41
|
-
:
|
|
107
|
+
:class="
|
|
108
|
+
classBinding(classObject.components.presenterListing, 'container', '')
|
|
109
|
+
"
|
|
110
|
+
:class-object="classObject.components.presenterListing"
|
|
111
|
+
@clicked="modalVisible = true"
|
|
42
112
|
>
|
|
43
113
|
</CommonPresenterListing>
|
|
44
114
|
|
|
45
|
-
<CommonModal
|
|
115
|
+
<CommonModal
|
|
116
|
+
:visible="modalVisible"
|
|
117
|
+
:class="classBinding(classObject.components.modal, 'container', '')"
|
|
118
|
+
:class-object="classObject.components.modal"
|
|
119
|
+
@trigger="modalVisible = false"
|
|
120
|
+
>
|
|
46
121
|
<template #modal-title>
|
|
47
122
|
<div
|
|
48
|
-
class="
|
|
123
|
+
:class="
|
|
124
|
+
classBinding(
|
|
125
|
+
classObject.components.modalContent,
|
|
126
|
+
'modalTitle',
|
|
127
|
+
'flex flex-col lg:flex-row w-full pb-8 mb-8 border-b border-solid border-grey-light'
|
|
128
|
+
)
|
|
129
|
+
"
|
|
49
130
|
>
|
|
50
|
-
<div
|
|
131
|
+
<div
|
|
132
|
+
:class="
|
|
133
|
+
classBinding(
|
|
134
|
+
classObject.components.modalContent,
|
|
135
|
+
'modalImagePositionContainer',
|
|
136
|
+
'flex-1 mb-6 lg:mb-0 lg:flex-initial flex justify-center'
|
|
137
|
+
)
|
|
138
|
+
"
|
|
139
|
+
>
|
|
51
140
|
<div
|
|
52
141
|
v-if="presenter.photo"
|
|
53
142
|
:style="presenterImageStyle"
|
|
54
|
-
class="
|
|
143
|
+
:class="
|
|
144
|
+
classBinding(
|
|
145
|
+
classObject.components.modalContent,
|
|
146
|
+
'modalImageContainer',
|
|
147
|
+
'border-white border-2 shadow-md bg-white'
|
|
148
|
+
)
|
|
149
|
+
"
|
|
55
150
|
>
|
|
56
151
|
<img
|
|
57
152
|
:src="presenter.photo"
|
|
58
|
-
class="
|
|
153
|
+
:class="
|
|
154
|
+
classBinding(
|
|
155
|
+
classObject.components.modalContent,
|
|
156
|
+
'modalImage',
|
|
157
|
+
'invisible'
|
|
158
|
+
)
|
|
159
|
+
"
|
|
59
160
|
:style="itemWidthStyle"
|
|
60
161
|
/>
|
|
61
162
|
</div>
|
|
62
163
|
</div>
|
|
63
|
-
<div
|
|
64
|
-
|
|
164
|
+
<div
|
|
165
|
+
:class="
|
|
166
|
+
classBinding(
|
|
167
|
+
classObject.components.modalContent,
|
|
168
|
+
'modalTextPositionContainer',
|
|
169
|
+
'flex-1 pl-4 text-center lg:text-left flex'
|
|
170
|
+
)
|
|
171
|
+
"
|
|
172
|
+
>
|
|
173
|
+
<div
|
|
174
|
+
:class="
|
|
175
|
+
classBinding(
|
|
176
|
+
classObject.components.modalContent,
|
|
177
|
+
'modalTextContainer',
|
|
178
|
+
'flex-1 self-center'
|
|
179
|
+
)
|
|
180
|
+
"
|
|
181
|
+
>
|
|
65
182
|
<h1
|
|
66
|
-
class="
|
|
183
|
+
:class="
|
|
184
|
+
classBinding(
|
|
185
|
+
classObject.components.modalContent,
|
|
186
|
+
'modalName',
|
|
187
|
+
'flex-1 font-light mb-0 body-color-4 presenter-name-color'
|
|
188
|
+
)
|
|
189
|
+
"
|
|
67
190
|
>
|
|
68
191
|
{{ fullName }}
|
|
69
192
|
</h1>
|
|
70
193
|
<p
|
|
71
|
-
class="
|
|
194
|
+
:class="
|
|
195
|
+
classBinding(
|
|
196
|
+
classObject.components.modalContent,
|
|
197
|
+
'modalTitleCompany',
|
|
198
|
+
'flex-1 font-normal text-base pt-2 leading-tight mb-0 body-color-5 presenter-title-color'
|
|
199
|
+
)
|
|
200
|
+
"
|
|
72
201
|
>
|
|
73
202
|
{{ presenter.title }}<br />{{ presenter.company }}
|
|
74
203
|
</p>
|
|
@@ -77,7 +206,15 @@ const { fullName, presenterImageStyle, itemWidthStyle, isGrayScale } =
|
|
|
77
206
|
</div>
|
|
78
207
|
</template>
|
|
79
208
|
<template #modal-body>
|
|
80
|
-
<p
|
|
209
|
+
<p
|
|
210
|
+
:class="
|
|
211
|
+
classBinding(
|
|
212
|
+
classObject.components.modalContent,
|
|
213
|
+
'modalBio',
|
|
214
|
+
'font-normal text-center lg:text-left'
|
|
215
|
+
)
|
|
216
|
+
"
|
|
217
|
+
>
|
|
81
218
|
<CommonDynamicHtml
|
|
82
219
|
:template="presenter.biography"
|
|
83
220
|
></CommonDynamicHtml>
|