@mptw/skylens-ui 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.
- package/.editorconfig +12 -0
- package/.eslintrc.cjs +4 -0
- package/.nuxtrc +1 -0
- package/.playground/app.config.ts +5 -0
- package/.playground/nuxt.config.ts +3 -0
- package/README.md +73 -0
- package/app.config.ts +5 -0
- package/app.vue +3 -0
- package/assets/css/fonts/MEShPlus-font-icon.eot +0 -0
- package/assets/css/fonts/MEShPlus-font-icon.svg +186 -0
- package/assets/css/fonts/MEShPlus-font-icon.ttf +0 -0
- package/assets/css/fonts/MEShPlus-font-icon.woff +0 -0
- package/assets/css/icons.css +555 -0
- package/assets/css/layout.styl +98 -0
- package/assets/css/tailwind.css +3 -0
- package/assets/images/commons/app-logo-white.png +0 -0
- package/assets/images/commons/app-logo.png +0 -0
- package/assets/images/commons/empty-box.png +0 -0
- package/assets/images/commons/watermark.svg +15 -0
- package/components/SLAlertModal.vue +99 -0
- package/components/SLBreadcrumbs.vue +42 -0
- package/components/SLButton.vue +301 -0
- package/components/SLCalendarButton.vue +259 -0
- package/components/SLCalendarPopup.vue +832 -0
- package/components/SLCard.vue +118 -0
- package/components/SLChart.vue +181 -0
- package/components/SLCheckbox.vue +179 -0
- package/components/SLCircleButton.vue +95 -0
- package/components/SLCollapsableBlock.vue +116 -0
- package/components/SLCollapsableMulitPillSelect.vue +92 -0
- package/components/SLConfirmModal.vue +122 -0
- package/components/SLDateInput.vue +460 -0
- package/components/SLDatePicker.vue +143 -0
- package/components/SLDistributor.vue +30 -0
- package/components/SLDownloadButton.vue +410 -0
- package/components/SLDraggable.vue +151 -0
- package/components/SLDropdown.vue +277 -0
- package/components/SLDropdownItem.vue +31 -0
- package/components/SLElementWithTitle.vue +181 -0
- package/components/SLEyeCheckbox.vue +162 -0
- package/components/SLFileInput.vue +101 -0
- package/components/SLGenderAgeSelect.vue +279 -0
- package/components/SLHeatMap.vue +151 -0
- package/components/SLHourRangeInput.vue +211 -0
- package/components/SLIOSSwitch.vue +235 -0
- package/components/SLIcon.vue +35 -0
- package/components/SLIconButton.vue +130 -0
- package/components/SLInfoTip.vue +221 -0
- package/components/SLInsightSitePage.vue +27 -0
- package/components/SLLegend.vue +76 -0
- package/components/SLLinearProgressBar.vue +35 -0
- package/components/SLLink.vue +162 -0
- package/components/SLLoading.vue +127 -0
- package/components/SLMapChart.vue +151 -0
- package/components/SLModal.vue +377 -0
- package/components/SLMonthCalendarButton.vue +378 -0
- package/components/SLMonthPicker.vue +151 -0
- package/components/SLMultiSelect.vue +121 -0
- package/components/SLNoData.vue +43 -0
- package/components/SLPageModal.vue +64 -0
- package/components/SLPagination.vue +192 -0
- package/components/SLPillCheckbox.vue +207 -0
- package/components/SLPillLabel.vue +101 -0
- package/components/SLPopupMenuButton.vue +158 -0
- package/components/SLProfileButton.vue +186 -0
- package/components/SLRadioButton.vue +97 -0
- package/components/SLRadioButtonGroup.vue +113 -0
- package/components/SLRadioGroup.vue +201 -0
- package/components/SLRangeInput.vue +209 -0
- package/components/SLRegionsMapChart.vue +151 -0
- package/components/SLRightSider.vue +242 -0
- package/components/SLSearchInput.vue +87 -0
- package/components/SLSelect.vue +545 -0
- package/components/SLSelectAllToggle.vue +118 -0
- package/components/SLSiderbarNav.vue +394 -0
- package/components/SLSiderbarNavItem.vue +204 -0
- package/components/SLSitePage.vue +96 -0
- package/components/SLSkyInsightSitePage.vue +27 -0
- package/components/SLSortByDropdown.vue +189 -0
- package/components/SLSpinIcon.vue +24 -0
- package/components/SLStayRangeInput.vue +306 -0
- package/components/SLTab.vue +159 -0
- package/components/SLTable.vue +409 -0
- package/components/SLTableTooltip.vue +111 -0
- package/components/SLTabs.vue +388 -0
- package/components/SLTextInput.vue +362 -0
- package/components/SLTextarea.vue +134 -0
- package/components/SLToast.vue +71 -0
- package/components/SLToggleButton.vue +78 -0
- package/components/SLTwoLayerMultiSelect.vue +428 -0
- package/components/SLTwoLayerSelect.vue +265 -0
- package/components/SLWarnModal.vue +75 -0
- package/interface/IDateRange.ts +5 -0
- package/interface/IHourRange.ts +4 -0
- package/interface/IInputOption.ts +6 -0
- package/interface/ILegendItem.ts +7 -0
- package/interface/IPopupMenuButton.ts +5 -0
- package/interface/IStayRange.ts +15 -0
- package/interface/ITableField.ts +19 -0
- package/interface/IWeb.ts +5 -0
- package/interface/NavConfigType.ts +14 -0
- package/interface/commons.ts +7 -0
- package/models/DateRange.ts +21 -0
- package/nuxt.config.ts +22 -0
- package/package.json +52 -0
- package/plugins/googlemaps.ts +17 -0
- package/plugins/v-calendar.ts +5 -0
- package/public/assets/files/taiwan-regions.json +7 -0
- package/public/assets/files/taiwan.json +24 -0
- package/public/assets/images/commons/default-favico.png +0 -0
- package/public/assets/images/dashboard/closure-button-icon.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-bar-chart-icon-disabled.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-bar-chart-icon-poi.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-bar-chart-icon-web.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-country-heatmap-chart-icon-disabled.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-country-heatmap-chart-icon.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-geo-list-icon-disabled.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-geo-list-icon-poi.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-geo-list-icon-web.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-heatmap-chart-icon-disabled.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-heatmap-chart-icon-web.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-line-chart-icon-disabled.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-line-chart-icon-poi.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-list-icon-disabled.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-list-icon-poi.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-list-icon-web.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-pie-chart-icon-disabled.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-pie-chart-icon-poi.png +0 -0
- package/public/assets/images/dashboard/dashboard-widget-pie-chart-icon-web.png +0 -0
- package/public/assets/images/dashboard/drag-hint-icon.svg +3 -0
- package/public/assets/images/dashboard/extend-button-icon.png +0 -0
- package/public/assets/images/dashboard/map-list-chart-icon.svg +17 -0
- package/public/assets/images/dashboard/map-marker-chart-icon.svg +32 -0
- package/public/assets/images/dashboard/pie-chart-icon.svg +4 -0
- package/public/assets/images/dashboard/poi-gender-age-chart-icon.svg +20 -0
- package/public/assets/images/dashboard/poi-nav-icon.png +0 -0
- package/public/assets/images/dashboard/web-gender-age-chart-icon.svg +20 -0
- package/public/assets/images/dashboard/web-nav-icon.png +0 -0
- package/tailwind.config.js +300 -0
- package/tsconfig.json +8 -0
- package/utils/constants.ts +160 -0
- package/utils/generateSheet.ts +36 -0
- package/utils/index.ts +539 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.chart
|
|
3
|
+
ECharts(
|
|
4
|
+
:loading="loading"
|
|
5
|
+
:option="formatedOption"
|
|
6
|
+
autoresize
|
|
7
|
+
@click="onClicked"
|
|
8
|
+
ref="chartComp"
|
|
9
|
+
).vchart
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import type { PropType } from "vue";
|
|
14
|
+
import axios from "axios";
|
|
15
|
+
import ECharts from "vue-echarts";
|
|
16
|
+
import { use } from "echarts/core";
|
|
17
|
+
import { registerMap } from "echarts/core";
|
|
18
|
+
import { MapChart } from "echarts/charts";
|
|
19
|
+
import "echarts-wordcloud";
|
|
20
|
+
import {
|
|
21
|
+
GridComponent,
|
|
22
|
+
LegendComponent,
|
|
23
|
+
TooltipComponent,
|
|
24
|
+
VisualMapComponent,
|
|
25
|
+
VisualMapContinuousComponent,
|
|
26
|
+
} from "echarts/components";
|
|
27
|
+
import { CanvasRenderer } from "echarts/renderers";
|
|
28
|
+
import type { ECBasicOption } from "echarts/types/dist/shared";
|
|
29
|
+
|
|
30
|
+
use([
|
|
31
|
+
MapChart,
|
|
32
|
+
GridComponent,
|
|
33
|
+
LegendComponent,
|
|
34
|
+
TooltipComponent,
|
|
35
|
+
VisualMapComponent,
|
|
36
|
+
VisualMapContinuousComponent,
|
|
37
|
+
CanvasRenderer,
|
|
38
|
+
]);
|
|
39
|
+
|
|
40
|
+
const DefaultGrid = {
|
|
41
|
+
top: 14,
|
|
42
|
+
right: 0,
|
|
43
|
+
bottom: 0,
|
|
44
|
+
left: 30,
|
|
45
|
+
containLabel: true,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const DefaultOption = {
|
|
49
|
+
xAxis: {
|
|
50
|
+
axisLine: {
|
|
51
|
+
lineStyle: {
|
|
52
|
+
color: "#828282",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
yAxis: {
|
|
57
|
+
axisLine: {
|
|
58
|
+
show: true,
|
|
59
|
+
lineStyle: {
|
|
60
|
+
color: "#828282",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
axisTick: {
|
|
64
|
+
show: true,
|
|
65
|
+
},
|
|
66
|
+
splitLine: {
|
|
67
|
+
lineStyle: {
|
|
68
|
+
color: "#E5E6F4",
|
|
69
|
+
opacity: 0.5,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
tooltip: {
|
|
74
|
+
appendToBody: true,
|
|
75
|
+
padding: 16,
|
|
76
|
+
textStyle: {
|
|
77
|
+
color: "#4F4F4F",
|
|
78
|
+
fontSize: 16,
|
|
79
|
+
lineHeight: 21,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
grid: DefaultGrid,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export default defineComponent({
|
|
86
|
+
name: "SLMapChart",
|
|
87
|
+
components: {
|
|
88
|
+
ECharts,
|
|
89
|
+
},
|
|
90
|
+
props: {
|
|
91
|
+
option: {
|
|
92
|
+
type: Object as PropType<ECBasicOption>,
|
|
93
|
+
default: null,
|
|
94
|
+
},
|
|
95
|
+
loading: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: false,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
emits: ["click"],
|
|
101
|
+
setup(props, { emit }) {
|
|
102
|
+
const { option } = toRefs(props);
|
|
103
|
+
|
|
104
|
+
const mapJsonLoaded = ref(false);
|
|
105
|
+
|
|
106
|
+
const formatedOption = computed(() => {
|
|
107
|
+
if (mapJsonLoaded.value) {
|
|
108
|
+
return {
|
|
109
|
+
...DefaultOption,
|
|
110
|
+
...option.value,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
...DefaultOption,
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
function onClicked(e: any) {
|
|
120
|
+
emit("click", e);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function loadMapJson() {
|
|
124
|
+
axios
|
|
125
|
+
.get("/assets/files/taiwan.json")
|
|
126
|
+
.then((response) => {
|
|
127
|
+
const { data } = response;
|
|
128
|
+
registerMap("Taiwan", data);
|
|
129
|
+
mapJsonLoaded.value = true;
|
|
130
|
+
})
|
|
131
|
+
.catch((e) => {
|
|
132
|
+
console.log(e);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
onMounted(() => {
|
|
137
|
+
loadMapJson();
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
return {
|
|
141
|
+
formatedOption,
|
|
142
|
+
onClicked,
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<style lang="stylus">
|
|
149
|
+
.chart
|
|
150
|
+
@apply h-52
|
|
151
|
+
</style>
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
Transition(
|
|
3
|
+
@before-enter='beforeEnter'
|
|
4
|
+
@enter='enter'
|
|
5
|
+
@after-enter='afterEnter'
|
|
6
|
+
@before-leave='beforeLeave'
|
|
7
|
+
@leave='leave'
|
|
8
|
+
@after-leave='afterLeave'
|
|
9
|
+
:css='false'
|
|
10
|
+
)
|
|
11
|
+
.modal(
|
|
12
|
+
v-if="show"
|
|
13
|
+
:class='[{"modal-centered": centered}, modalClass]'
|
|
14
|
+
ref='modal'
|
|
15
|
+
)
|
|
16
|
+
.modal-backdrop(:class='{ show: backdrop }', @click='onClickedModalBackdrop')
|
|
17
|
+
.container.modal-dialog(:class='dialogClasses')
|
|
18
|
+
.modal-content(ref='modalContent')
|
|
19
|
+
header.modal-header(v-if='!!title || closeButton')
|
|
20
|
+
.modal-header-left
|
|
21
|
+
h5.modal-title
|
|
22
|
+
slot(name="title")
|
|
23
|
+
span {{ title }}
|
|
24
|
+
.modal-title-notice(v-if="notice !== ''") {{ notice }}
|
|
25
|
+
.modal-header-right
|
|
26
|
+
slot(name="header-right")
|
|
27
|
+
a.close-button(
|
|
28
|
+
v-if='closeButton',
|
|
29
|
+
href='javascript:;',
|
|
30
|
+
@click='hide'
|
|
31
|
+
)
|
|
32
|
+
SLIcon(icon='times')
|
|
33
|
+
.modal-body.custom-scrollbar-y(ref='modalBodyEl')
|
|
34
|
+
.modal-body-content(ref='modalBodyContentEl')
|
|
35
|
+
slot
|
|
36
|
+
.modal-footer(v-if='$slots.footer')
|
|
37
|
+
slot(name='footer')
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script lang="ts">
|
|
41
|
+
import { fromEvent, Subscription } from "rxjs";
|
|
42
|
+
import { gsap } from "gsap";
|
|
43
|
+
|
|
44
|
+
export default defineComponent({
|
|
45
|
+
name: "SLModal",
|
|
46
|
+
components: {},
|
|
47
|
+
props: {
|
|
48
|
+
show: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
52
|
+
centered: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true,
|
|
55
|
+
},
|
|
56
|
+
title: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "",
|
|
59
|
+
},
|
|
60
|
+
notice: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: "",
|
|
63
|
+
},
|
|
64
|
+
size: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "",
|
|
67
|
+
validator: (val: string) =>
|
|
68
|
+
[
|
|
69
|
+
"",
|
|
70
|
+
"xs",
|
|
71
|
+
"sm",
|
|
72
|
+
"lg",
|
|
73
|
+
"xl",
|
|
74
|
+
"2xl",
|
|
75
|
+
"3xl",
|
|
76
|
+
"4xl",
|
|
77
|
+
"5xl",
|
|
78
|
+
"free",
|
|
79
|
+
].includes(val),
|
|
80
|
+
},
|
|
81
|
+
closeButton: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: true,
|
|
84
|
+
},
|
|
85
|
+
backdrop: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false,
|
|
88
|
+
},
|
|
89
|
+
closeOnBackdrop: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: true,
|
|
92
|
+
},
|
|
93
|
+
modalClass: {
|
|
94
|
+
type: [String, Array, Object],
|
|
95
|
+
default: "",
|
|
96
|
+
},
|
|
97
|
+
withScroll: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: true,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
emits: [
|
|
103
|
+
"update:show",
|
|
104
|
+
"appearAnimationStart",
|
|
105
|
+
"appearAnimationEnd",
|
|
106
|
+
"leaveAnimationStart",
|
|
107
|
+
"leaveAnimationEnd",
|
|
108
|
+
"scroll",
|
|
109
|
+
],
|
|
110
|
+
setup(props, { emit }) {
|
|
111
|
+
const { show, centered, size, closeOnBackdrop, withScroll } = toRefs(props);
|
|
112
|
+
|
|
113
|
+
const modal = ref<HTMLElement | null>(null);
|
|
114
|
+
const modalContent = ref<HTMLElement | null>(null);
|
|
115
|
+
const modalBodyEl = ref<HTMLElement | null>(null);
|
|
116
|
+
const modalBodyContentEl = ref<HTMLDivElement | null>(null);
|
|
117
|
+
|
|
118
|
+
let bodyScrollSubscriber: Subscription | null = null;
|
|
119
|
+
|
|
120
|
+
const dialogClasses = computed(() => {
|
|
121
|
+
return [
|
|
122
|
+
{
|
|
123
|
+
"modal-dialog-centered": centered.value,
|
|
124
|
+
[`modal-dialog-${size.value}`]: size.value !== "",
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
function onClickedModalBackdrop() {
|
|
130
|
+
if (!closeOnBackdrop.value) return;
|
|
131
|
+
|
|
132
|
+
hide();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function hide() {
|
|
136
|
+
emit("update:show", false);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function setupMutation() {
|
|
140
|
+
if (!withScroll.value) return;
|
|
141
|
+
|
|
142
|
+
nextTick(() => {
|
|
143
|
+
if (!modalBodyEl.value || bodyScrollSubscriber) return;
|
|
144
|
+
|
|
145
|
+
bodyScrollSubscriber = fromEvent(modalBodyEl.value, "scroll", () => {
|
|
146
|
+
console.log("aaa");
|
|
147
|
+
emit("scroll");
|
|
148
|
+
}).subscribe();
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function destroyMutation() {
|
|
153
|
+
if (bodyScrollSubscriber) {
|
|
154
|
+
bodyScrollSubscriber.unsubscribe();
|
|
155
|
+
bodyScrollSubscriber = null;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function beforeEnter(el: Element) {
|
|
160
|
+
const backdrop = el.querySelector(".modal-backdrop");
|
|
161
|
+
const modalContent = el.querySelector(".modal-content");
|
|
162
|
+
|
|
163
|
+
gsap.set(backdrop, { alpha: 0 });
|
|
164
|
+
gsap.set(modalContent, { alpha: 0, y: 50 });
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function enter(el: Element, done: () => void) {
|
|
168
|
+
emit("appearAnimationStart");
|
|
169
|
+
const backdrop = el.querySelector(".modal-backdrop");
|
|
170
|
+
const modalContent = el.querySelector(".modal-content");
|
|
171
|
+
|
|
172
|
+
const tl = gsap.timeline({
|
|
173
|
+
onComplete: () => {
|
|
174
|
+
emit("appearAnimationStart");
|
|
175
|
+
done();
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
tl.to(
|
|
180
|
+
backdrop,
|
|
181
|
+
{
|
|
182
|
+
alpha: 1,
|
|
183
|
+
duration: 0.5,
|
|
184
|
+
},
|
|
185
|
+
0
|
|
186
|
+
);
|
|
187
|
+
tl.to(
|
|
188
|
+
modalContent,
|
|
189
|
+
{
|
|
190
|
+
y: 0,
|
|
191
|
+
alpha: 1,
|
|
192
|
+
duration: 0.5,
|
|
193
|
+
},
|
|
194
|
+
0.3
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function afterEnter(el: Element) {
|
|
199
|
+
const backdrop = el.querySelector(".modal-backdrop");
|
|
200
|
+
const modalContent = el.querySelector(".modal-content");
|
|
201
|
+
|
|
202
|
+
gsap.set(backdrop, { alpha: 1 });
|
|
203
|
+
gsap.set(modalContent, { alpha: 1, y: 0 });
|
|
204
|
+
emit("appearAnimationEnd");
|
|
205
|
+
setupMutation();
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function beforeLeave(el: Element) {
|
|
209
|
+
const backdrop = el.querySelector(".modal-backdrop");
|
|
210
|
+
const modalContent = el.querySelector(".modal-content");
|
|
211
|
+
|
|
212
|
+
gsap.set(backdrop, { alpha: 1 });
|
|
213
|
+
gsap.set(modalContent, { alpha: 1 });
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function leave(el: Element, done: () => void) {
|
|
217
|
+
emit("leaveAnimationStart");
|
|
218
|
+
const backdrop = el.querySelector(".modal-backdrop");
|
|
219
|
+
const modalContent = el.querySelector(".modal-content");
|
|
220
|
+
|
|
221
|
+
const tl = gsap.timeline({
|
|
222
|
+
onComplete: () => {
|
|
223
|
+
emit("leaveAnimationEnd");
|
|
224
|
+
done();
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
tl.to(
|
|
229
|
+
backdrop,
|
|
230
|
+
{
|
|
231
|
+
alpha: 0,
|
|
232
|
+
duration: 0.5,
|
|
233
|
+
},
|
|
234
|
+
0
|
|
235
|
+
);
|
|
236
|
+
tl.to(
|
|
237
|
+
modalContent,
|
|
238
|
+
{
|
|
239
|
+
alpha: 0,
|
|
240
|
+
duration: 0.5,
|
|
241
|
+
},
|
|
242
|
+
0
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function afterLeave(el: Element) {
|
|
247
|
+
const backdrop = el.querySelector(".modal-backdrop");
|
|
248
|
+
const modalContent = el.querySelector(".modal-content");
|
|
249
|
+
|
|
250
|
+
gsap.set(backdrop, { alpha: 0 });
|
|
251
|
+
gsap.set(modalContent, { alpha: 0 });
|
|
252
|
+
destroyMutation();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
watch(show, () => {
|
|
256
|
+
if (show.value) {
|
|
257
|
+
setupMutation();
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
destroyMutation();
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
onMounted(() => {
|
|
265
|
+
setupMutation();
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
onBeforeUnmount(() => {
|
|
269
|
+
destroyMutation();
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
return {
|
|
273
|
+
modal,
|
|
274
|
+
modalContent,
|
|
275
|
+
modalBodyEl,
|
|
276
|
+
modalBodyContentEl,
|
|
277
|
+
dialogClasses,
|
|
278
|
+
onClickedModalBackdrop,
|
|
279
|
+
hide,
|
|
280
|
+
beforeEnter,
|
|
281
|
+
enter,
|
|
282
|
+
afterEnter,
|
|
283
|
+
beforeLeave,
|
|
284
|
+
leave,
|
|
285
|
+
afterLeave,
|
|
286
|
+
};
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
</script>
|
|
290
|
+
|
|
291
|
+
<style lang="stylus" scoped>
|
|
292
|
+
.modal
|
|
293
|
+
@apply fixed top-0 left-0 w-full h-full overflow-hidden
|
|
294
|
+
&.modal-centered
|
|
295
|
+
@apply flex items-center
|
|
296
|
+
|
|
297
|
+
.modal-backdrop
|
|
298
|
+
@apply absolute top-0 left-0 w-full h-full
|
|
299
|
+
|
|
300
|
+
&.show
|
|
301
|
+
@apply s('bg-backdrop/80')
|
|
302
|
+
|
|
303
|
+
.modal-dialog
|
|
304
|
+
@apply relative w-full my-7 mx-auto
|
|
305
|
+
|
|
306
|
+
&-xs
|
|
307
|
+
@apply s('max-w-[30rem]')
|
|
308
|
+
|
|
309
|
+
&-sm
|
|
310
|
+
@apply s("max-w-149.5")
|
|
311
|
+
|
|
312
|
+
&-lg
|
|
313
|
+
@apply s('max-w-[39.75rem]')
|
|
314
|
+
|
|
315
|
+
&-xl
|
|
316
|
+
@apply s('max-w-[39rem]')
|
|
317
|
+
@apply s("lg:max-w-208")
|
|
318
|
+
|
|
319
|
+
&-2xl
|
|
320
|
+
@apply s('max-w-[41rem]')
|
|
321
|
+
@apply s("lg:max-w-[55.125rem]")
|
|
322
|
+
|
|
323
|
+
&-3xl
|
|
324
|
+
@apply s('max-w-[748px]')
|
|
325
|
+
@apply s("lg:max-w-[900px]")
|
|
326
|
+
|
|
327
|
+
&-4xl
|
|
328
|
+
@apply s('max-w-[697px]')
|
|
329
|
+
@apply s('lg:max-w-[924px]')
|
|
330
|
+
|
|
331
|
+
&-5xl
|
|
332
|
+
@apply s('max-w-[748px]')
|
|
333
|
+
@apply s("lg:max-w-[980px]")
|
|
334
|
+
|
|
335
|
+
&-free
|
|
336
|
+
@apply w-auto
|
|
337
|
+
|
|
338
|
+
&-centered
|
|
339
|
+
@apply flex
|
|
340
|
+
max-height calc(100% - (theme("spacing.7") * 2))
|
|
341
|
+
|
|
342
|
+
.modal-content
|
|
343
|
+
@apply flex flex-col w-full max-h-full rounded-lg bg-white shadow-popup-lg
|
|
344
|
+
|
|
345
|
+
.modal-header + .modal-body
|
|
346
|
+
@apply rounded-t-none
|
|
347
|
+
|
|
348
|
+
.modal-header
|
|
349
|
+
@apply flex-grow-0 flex-shrink-0 flex items-center justify-between py-2 px-4 bg-primary rounded-t-lg text-xl s("leading-6.75") text-white
|
|
350
|
+
|
|
351
|
+
&-left
|
|
352
|
+
@apply flex items-center
|
|
353
|
+
|
|
354
|
+
&-right
|
|
355
|
+
@apply flex items-baseline ml-6
|
|
356
|
+
|
|
357
|
+
.modal-title
|
|
358
|
+
@apply inline-flex items-baseline space-x-2 font-normal
|
|
359
|
+
|
|
360
|
+
&-notice
|
|
361
|
+
@apply text-xs font-normal
|
|
362
|
+
|
|
363
|
+
.close-button
|
|
364
|
+
@apply inline-flex text-base text-white
|
|
365
|
+
|
|
366
|
+
.icon
|
|
367
|
+
@apply inline-flex
|
|
368
|
+
|
|
369
|
+
.modal-body
|
|
370
|
+
@apply flex-grow relative w-full pt-4 pr-4 pl-4 bg-white rounded-lg
|
|
371
|
+
|
|
372
|
+
&:last-child
|
|
373
|
+
@apply pb-4
|
|
374
|
+
|
|
375
|
+
.modal-footer
|
|
376
|
+
@apply flex-grow-0 flex-shrink-0 p-6 rounded-b-lg
|
|
377
|
+
</style>
|