@kompasid/lit-web-components 0.9.48 → 0.9.50
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/demo/header.html +18 -2
- package/demo/paywall.html +3 -2
- package/dist/src/components/kompasid-header-account/KompasHeaderAccount.d.ts +1 -0
- package/dist/src/components/kompasid-header-account/KompasHeaderAccount.js +8 -0
- package/dist/src/components/kompasid-header-account/KompasHeaderAccount.js.map +1 -1
- package/dist/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.d.ts +3 -0
- package/dist/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.js +83 -6
- package/dist/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.js.map +1 -1
- package/dist/src/components/kompasid-paywall/types.d.ts +1 -0
- package/dist/src/components/kompasid-paywall/types.js.map +1 -1
- package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.d.ts +1 -0
- package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.js +22 -1
- package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.js.map +1 -1
- package/dist/src/components/kompasid-paywall-modal-register/KompasPaywallModalRegister.d.ts +36 -0
- package/dist/src/components/kompasid-paywall-modal-register/KompasPaywallModalRegister.js +605 -0
- package/dist/src/components/kompasid-paywall-modal-register/KompasPaywallModalRegister.js.map +1 -0
- package/dist/src/components/kompasid-paywall-modal-register/types.d.ts +33 -0
- package/dist/src/components/kompasid-paywall-modal-register/types.js +2 -0
- package/dist/src/components/kompasid-paywall-modal-register/types.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/tailwind/tailwind.js +165 -0
- package/dist/tailwind/tailwind.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/kompasid-header-account/KompasHeaderAccount.ts +5 -0
- package/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.ts +78 -6
- package/src/components/kompasid-paywall/types.ts +1 -0
- package/src/components/kompasid-paywall-body/KompasPaywallBody.ts +22 -1
- package/src/components/kompasid-paywall-modal-register/KompasPaywallModalRegister.ts +629 -0
- package/src/components/kompasid-paywall-modal-register/types.ts +39 -0
- package/src/index.ts +1 -0
- package/tailwind/tailwind.css +165 -0
- package/tailwind/tailwind.ts +165 -0
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
import { LitElement, html, css, nothing } from 'lit'
|
|
2
|
+
import { customElement, state, property } from 'lit/decorators.js'
|
|
3
|
+
import { unsafeSVG } from 'lit/directives/unsafe-svg.js'
|
|
4
|
+
import { addGoogleFonts } from '../../utils/googleFont.js'
|
|
5
|
+
import { getFontAwesomeIcon } from '../../utils/fontawesome-setup.js'
|
|
6
|
+
import { TWStyles } from '../../../tailwind/tailwind.js'
|
|
7
|
+
import { deviceType } from '../../utils/deviceType.js'
|
|
8
|
+
import { ModalRegister } from './types.js'
|
|
9
|
+
|
|
10
|
+
@customElement('kompasid-paywall-modal-register')
|
|
11
|
+
export class KompasPaywallModalRegister extends LitElement {
|
|
12
|
+
static styles = [
|
|
13
|
+
css`
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bold-yellow b {
|
|
19
|
+
color: #dbaa00;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.modal-overlay {
|
|
23
|
+
position: fixed;
|
|
24
|
+
top: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
align-items: center;
|
|
32
|
+
z-index: 1000;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.modal-content {
|
|
36
|
+
background-color: #222222;
|
|
37
|
+
border-radius: 12px;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
position: relative;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.close-button {
|
|
43
|
+
position: absolute;
|
|
44
|
+
top: 10px;
|
|
45
|
+
right: 10px;
|
|
46
|
+
background: none;
|
|
47
|
+
border: none;
|
|
48
|
+
font-size: 1.5em;
|
|
49
|
+
color: #999999;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
z-index: 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.transparent-linear-dark {
|
|
55
|
+
background-image: -webkit-gradient(
|
|
56
|
+
linear,
|
|
57
|
+
left top,
|
|
58
|
+
left bottom,
|
|
59
|
+
from(hsla(0, 0%, 18%, 0)),
|
|
60
|
+
to(#333333)
|
|
61
|
+
);
|
|
62
|
+
background-image: linear-gradient(180deg, hsla(0, 0%, 18%, 0), #333333);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.font-lora {
|
|
66
|
+
font-family: 'Lora', 'Georgia', 'serif';
|
|
67
|
+
}
|
|
68
|
+
`,
|
|
69
|
+
TWStyles,
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Properties
|
|
74
|
+
*/
|
|
75
|
+
@property({ type: String }) subscriptionStatus = ''
|
|
76
|
+
@property({ type: String }) userGuid = ''
|
|
77
|
+
|
|
78
|
+
@state() private isModalOpen = false
|
|
79
|
+
@state() private confirmation = false
|
|
80
|
+
@state() private dataModalRegister: ModalRegister = {} as ModalRegister
|
|
81
|
+
@state() private showModalRegister = false
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Lifecycle
|
|
85
|
+
*/
|
|
86
|
+
override connectedCallback() {
|
|
87
|
+
super.connectedCallback()
|
|
88
|
+
addGoogleFonts(['pt-sans', 'lora', 'roboto-condensed'])
|
|
89
|
+
this.getRegisterProData()
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async getRegisterProData() {
|
|
93
|
+
try {
|
|
94
|
+
const response = await fetch(
|
|
95
|
+
'https://cdn-www.kompas.id/web-component/form-b2b-kompas-pro.json'
|
|
96
|
+
)
|
|
97
|
+
const data = await response.json()
|
|
98
|
+
this.dataModalRegister = data
|
|
99
|
+
} catch (error) {
|
|
100
|
+
if (error instanceof Error) {
|
|
101
|
+
console.log(error.message)
|
|
102
|
+
}
|
|
103
|
+
} finally {
|
|
104
|
+
this.showModalRegister = true
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
openModal() {
|
|
109
|
+
this.isModalOpen = true
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
closeModal() {
|
|
113
|
+
this.isModalOpen = false
|
|
114
|
+
this.confirmation = false
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@state()
|
|
118
|
+
private showMobileBenefit = false
|
|
119
|
+
|
|
120
|
+
@state()
|
|
121
|
+
private formData = {
|
|
122
|
+
nameUser: '',
|
|
123
|
+
email: '',
|
|
124
|
+
nomor: '',
|
|
125
|
+
nameCompany: '',
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@state()
|
|
129
|
+
private formErrors = {
|
|
130
|
+
nameUser: '',
|
|
131
|
+
email: '',
|
|
132
|
+
nomor: '',
|
|
133
|
+
nameCompany: '',
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@state()
|
|
137
|
+
private formTouched = {
|
|
138
|
+
nameUser: false,
|
|
139
|
+
email: false,
|
|
140
|
+
nomor: false,
|
|
141
|
+
nameCompany: false,
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@state()
|
|
145
|
+
private formSubmitted = false
|
|
146
|
+
|
|
147
|
+
private toggleMobileBenefit() {
|
|
148
|
+
this.showMobileBenefit = !this.showMobileBenefit
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
private handleInput(e: InputEvent) {
|
|
152
|
+
const target = e.target as HTMLInputElement
|
|
153
|
+
const name = target.name as keyof typeof this.formData
|
|
154
|
+
this.formData = {
|
|
155
|
+
...this.formData,
|
|
156
|
+
[name]: target.value,
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (this.formTouched[name] || this.formSubmitted) {
|
|
160
|
+
this.validateField(name)
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
private handleBlur(e: FocusEvent) {
|
|
165
|
+
const target = e.target as HTMLInputElement
|
|
166
|
+
const name = target.name as keyof typeof this.formData
|
|
167
|
+
this.formTouched = {
|
|
168
|
+
...this.formTouched,
|
|
169
|
+
[name]: true,
|
|
170
|
+
}
|
|
171
|
+
this.validateField(name)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
private validateField(field: keyof typeof this.formData) {
|
|
175
|
+
const value = this.formData[field].trim()
|
|
176
|
+
let error = ''
|
|
177
|
+
|
|
178
|
+
if (!value) {
|
|
179
|
+
switch (field) {
|
|
180
|
+
case 'nameUser':
|
|
181
|
+
error = 'Nama lengkap harus diisi.'
|
|
182
|
+
break
|
|
183
|
+
case 'email':
|
|
184
|
+
error = 'Email harus diisi.'
|
|
185
|
+
break
|
|
186
|
+
case 'nomor':
|
|
187
|
+
error = 'Nomor kontak harus diisi.'
|
|
188
|
+
break
|
|
189
|
+
case 'nameCompany':
|
|
190
|
+
error = 'Nama perusahaan/asosiasi harus diisi.'
|
|
191
|
+
break
|
|
192
|
+
default:
|
|
193
|
+
error = ''
|
|
194
|
+
break
|
|
195
|
+
}
|
|
196
|
+
} else if (field === 'email' && !/^\S+@\S+\.\S+$/.test(value)) {
|
|
197
|
+
error = 'Masukan email yang valid.'
|
|
198
|
+
} else if (field === 'nomor' && !/^[0-9+\-\s()]{6,20}$/.test(value)) {
|
|
199
|
+
error = 'Masukan nomor kontak yang valid.'
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
this.formErrors = {
|
|
203
|
+
...this.formErrors,
|
|
204
|
+
[field]: error,
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
private validateForm() {
|
|
209
|
+
this.validateField('nameUser')
|
|
210
|
+
this.validateField('email')
|
|
211
|
+
this.validateField('nomor')
|
|
212
|
+
this.validateField('nameCompany')
|
|
213
|
+
|
|
214
|
+
return (
|
|
215
|
+
Object.values(this.formErrors).every(error => !error) &&
|
|
216
|
+
Object.values(this.formData).every(value => value.trim() !== '')
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
private async handleSubmit(e: Event) {
|
|
221
|
+
e.preventDefault()
|
|
222
|
+
this.formSubmitted = true
|
|
223
|
+
|
|
224
|
+
const isValid = this.validateForm()
|
|
225
|
+
if (!isValid) {
|
|
226
|
+
return
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const formResult = {
|
|
230
|
+
name: this.formData.nameUser,
|
|
231
|
+
email: this.formData.email,
|
|
232
|
+
phone: this.formData.nomor,
|
|
233
|
+
company: this.formData.nameCompany,
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
this.confirmation = true
|
|
237
|
+
|
|
238
|
+
// Send form data to Zapier
|
|
239
|
+
try {
|
|
240
|
+
const formBody = new URLSearchParams(formResult)
|
|
241
|
+
await fetch('https://hooks.zapier.com/hooks/catch/14222434/uedqovx/', {
|
|
242
|
+
method: 'POST',
|
|
243
|
+
body: formBody,
|
|
244
|
+
})
|
|
245
|
+
} catch (err) {
|
|
246
|
+
console.error('Form submission error:', err)
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
private customerServiceClicked() {
|
|
251
|
+
this.redirectToHelpdesk()
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
private redirectToHelpdesk(): void {
|
|
255
|
+
this.sendDataLayeronHelpDesk()
|
|
256
|
+
window.open(
|
|
257
|
+
this.dataModalRegister.modal.registerPopUp.hotline.url ||
|
|
258
|
+
'https://api.whatsapp.com/send/?phone=6281290050800&text=Halo,%20saya%20perlu%20informasi%20mengenai%20kompas.id'
|
|
259
|
+
)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
private sendDataLayeronHelpDesk(): void {
|
|
263
|
+
window.dataLayer.push({
|
|
264
|
+
event: 'helpOfferClick',
|
|
265
|
+
userType: this.subscriptionStatus,
|
|
266
|
+
GUID: this.userGuid,
|
|
267
|
+
interface: deviceType(),
|
|
268
|
+
})
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
private templateForm = () => html`
|
|
272
|
+
<div class="text-white text-center font-sans py-6 px-4 md:px-20 md:py-16">
|
|
273
|
+
<h1 class="font-lora text-xl md:text-2xl font-bold">
|
|
274
|
+
Akses Penuh Media Intelligence dengan Paket Langganan Korporasi
|
|
275
|
+
</h1>
|
|
276
|
+
<div class="text-grey-200 text-sm md:text-base mt-4">
|
|
277
|
+
Lengkapi formulir ini untuk dapatkan konsultasi paket korporasi Kompas
|
|
278
|
+
Professional dan penawaran harga terbaik bagi organisasi Anda.
|
|
279
|
+
</div>
|
|
280
|
+
<div>
|
|
281
|
+
<form
|
|
282
|
+
@submit="${this.handleSubmit}"
|
|
283
|
+
action=""
|
|
284
|
+
class="mt-8 gap-6 flex flex-col"
|
|
285
|
+
>
|
|
286
|
+
<div class="flex flex-col gap-2">
|
|
287
|
+
<label for="nameUser" class="font-bold flex flex-row">
|
|
288
|
+
Nama Lengkap
|
|
289
|
+
<span class="text-[#F57A7A] flex items-start">*</span>
|
|
290
|
+
</label>
|
|
291
|
+
<input
|
|
292
|
+
id="nameUser"
|
|
293
|
+
name="nameUser"
|
|
294
|
+
type="text"
|
|
295
|
+
placeholder=""
|
|
296
|
+
class="p-2 bg-grey-500 rounded border border-grey-400"
|
|
297
|
+
.value="${this.formData.nameUser}"
|
|
298
|
+
@input="${this.handleInput}"
|
|
299
|
+
@blur="${this.handleBlur}"
|
|
300
|
+
aria-invalid="${!!this.formErrors.nameUser}"
|
|
301
|
+
/>
|
|
302
|
+
${(this.formTouched.nameUser || this.formSubmitted) &&
|
|
303
|
+
this.formErrors.nameUser
|
|
304
|
+
? html`
|
|
305
|
+
<div
|
|
306
|
+
class="text-sm text-[#F57A7A] flex flex-row items-center"
|
|
307
|
+
>
|
|
308
|
+
<div class="h-4 w-4 flex items-center justify-center mr-2">
|
|
309
|
+
${unsafeSVG(
|
|
310
|
+
getFontAwesomeIcon('fas', 'exclamation-circle', 10, 10)
|
|
311
|
+
)}
|
|
312
|
+
</div>
|
|
313
|
+
${this.formErrors.nameUser}
|
|
314
|
+
</div>
|
|
315
|
+
`
|
|
316
|
+
: ''}
|
|
317
|
+
</div>
|
|
318
|
+
<div class="flex flex-col gap-2">
|
|
319
|
+
<label for="email" class="font-bold flex flex-row">
|
|
320
|
+
Email
|
|
321
|
+
<span class="text-[#F57A7A] flex items-start">*</span>
|
|
322
|
+
</label>
|
|
323
|
+
<input
|
|
324
|
+
autocomplete="off"
|
|
325
|
+
id="email"
|
|
326
|
+
name="email"
|
|
327
|
+
type="email"
|
|
328
|
+
placeholder=""
|
|
329
|
+
class="p-2 bg-grey-500 rounded border border-grey-400"
|
|
330
|
+
.value="${this.formData.email}"
|
|
331
|
+
@input="${this.handleInput}"
|
|
332
|
+
@blur="${this.handleBlur}"
|
|
333
|
+
aria-invalid="${!!this.formErrors.email}"
|
|
334
|
+
/>
|
|
335
|
+
${(this.formTouched.email || this.formSubmitted) &&
|
|
336
|
+
this.formErrors.email
|
|
337
|
+
? html`
|
|
338
|
+
<div
|
|
339
|
+
class="text-sm text-[#F57A7A] flex flex-row items-center"
|
|
340
|
+
>
|
|
341
|
+
<div class="h-4 w-4 flex items-center justify-center mr-2">
|
|
342
|
+
${unsafeSVG(
|
|
343
|
+
getFontAwesomeIcon('fas', 'exclamation-circle', 10, 10)
|
|
344
|
+
)}
|
|
345
|
+
</div>
|
|
346
|
+
${this.formErrors.email}
|
|
347
|
+
</div>
|
|
348
|
+
`
|
|
349
|
+
: ''}
|
|
350
|
+
</div>
|
|
351
|
+
<div class="flex flex-col gap-2">
|
|
352
|
+
<label for="nomor" class="font-bold flex flex-row">
|
|
353
|
+
Nomor Kontak (WhatsApp/Ponsel)
|
|
354
|
+
<span class="text-[#F57A7A] flex items-start">*</span>
|
|
355
|
+
</label>
|
|
356
|
+
<input
|
|
357
|
+
autocomplete="off"
|
|
358
|
+
id="nomor"
|
|
359
|
+
name="nomor"
|
|
360
|
+
type="tel"
|
|
361
|
+
placeholder=""
|
|
362
|
+
class="p-2 bg-grey-500 rounded border border-grey-400"
|
|
363
|
+
.value="${this.formData.nomor}"
|
|
364
|
+
@input="${this.handleInput}"
|
|
365
|
+
@blur="${this.handleBlur}"
|
|
366
|
+
aria-invalid="${!!this.formErrors.nomor}"
|
|
367
|
+
/>
|
|
368
|
+
${(this.formTouched.nomor || this.formSubmitted) &&
|
|
369
|
+
this.formErrors.nomor
|
|
370
|
+
? html`
|
|
371
|
+
<div
|
|
372
|
+
class="text-sm text-[#F57A7A] flex flex-row items-center"
|
|
373
|
+
>
|
|
374
|
+
<div class="h-4 w-4 flex items-center justify-center mr-2">
|
|
375
|
+
${unsafeSVG(
|
|
376
|
+
getFontAwesomeIcon('fas', 'exclamation-circle', 10, 10)
|
|
377
|
+
)}
|
|
378
|
+
</div>
|
|
379
|
+
${this.formErrors.nomor}
|
|
380
|
+
</div>
|
|
381
|
+
`
|
|
382
|
+
: ''}
|
|
383
|
+
</div>
|
|
384
|
+
<div class="flex flex-col gap-2">
|
|
385
|
+
<label for="name_company" class="font-bold flex flex-row">
|
|
386
|
+
Nama Perusahaan/Asosiasi
|
|
387
|
+
<span class="text-[#F57A7A] flex items-start">*</span>
|
|
388
|
+
</label>
|
|
389
|
+
<input
|
|
390
|
+
id="name_company"
|
|
391
|
+
name="nameCompany"
|
|
392
|
+
type="text"
|
|
393
|
+
placeholder=""
|
|
394
|
+
class="p-2 bg-grey-500 rounded border border-grey-400"
|
|
395
|
+
.value="${this.formData.nameCompany}"
|
|
396
|
+
@input="${this.handleInput}"
|
|
397
|
+
@blur="${this.handleBlur}"
|
|
398
|
+
aria-invalid="${!!this.formErrors.nameCompany}"
|
|
399
|
+
/>
|
|
400
|
+
${(this.formTouched.nameCompany || this.formSubmitted) &&
|
|
401
|
+
this.formErrors.nameCompany
|
|
402
|
+
? html`
|
|
403
|
+
<div
|
|
404
|
+
class="text-sm text-[#F57A7A] flex flex-row items-center"
|
|
405
|
+
>
|
|
406
|
+
<div class="h-4 w-4 flex items-center justify-center mr-2">
|
|
407
|
+
${unsafeSVG(
|
|
408
|
+
getFontAwesomeIcon('fas', 'exclamation-circle', 10, 10)
|
|
409
|
+
)}
|
|
410
|
+
</div>
|
|
411
|
+
${this.formErrors.nameCompany}
|
|
412
|
+
</div>
|
|
413
|
+
`
|
|
414
|
+
: ''}
|
|
415
|
+
</div>
|
|
416
|
+
<button
|
|
417
|
+
type="submit"
|
|
418
|
+
class="bg-yellow-500 text-center h-10 rounded text-grey-600 mt-2 w-full font-bold"
|
|
419
|
+
>
|
|
420
|
+
Kirim
|
|
421
|
+
</button>
|
|
422
|
+
</form>
|
|
423
|
+
</div>
|
|
424
|
+
</div>
|
|
425
|
+
`
|
|
426
|
+
|
|
427
|
+
render() {
|
|
428
|
+
return this.showModalRegister
|
|
429
|
+
? html`<div
|
|
430
|
+
class="px-4 font-sans flex flex-wrap items-center justify-between rounded-lg md:mx-0 w-full min-h-[68px] bg-white relative"
|
|
431
|
+
>
|
|
432
|
+
<div class="flex flex-col gap-1">
|
|
433
|
+
<span class="text-xs leading-tight text-grey-500">
|
|
434
|
+
${this.dataModalRegister.card.labelPackage}
|
|
435
|
+
</span>
|
|
436
|
+
<div class="flex items-baseline">
|
|
437
|
+
<h5 class="text-base font-bold text-orange-400 leading-none">
|
|
438
|
+
${this.dataModalRegister.card.textInvitation}
|
|
439
|
+
</h5>
|
|
440
|
+
</div>
|
|
441
|
+
</div>
|
|
442
|
+
<button
|
|
443
|
+
@click="${this.openModal}"
|
|
444
|
+
class="h-8 rounded ${this.dataModalRegister.card.isButtonSolid
|
|
445
|
+
? 'bg-green-500 text-white'
|
|
446
|
+
: 'bg-white border border-green-500 text-green-500'} flex items-center"
|
|
447
|
+
>
|
|
448
|
+
<h6 class="text-xs md:text-sm font-bold py-2 px-4">
|
|
449
|
+
${this.dataModalRegister.card.textButton}
|
|
450
|
+
</h6>
|
|
451
|
+
</button>
|
|
452
|
+
</div>
|
|
453
|
+
|
|
454
|
+
${this.isModalOpen && !this.confirmation
|
|
455
|
+
? html`
|
|
456
|
+
<div
|
|
457
|
+
class="modal-overlay p-4"
|
|
458
|
+
@click="${this.closeModal}"
|
|
459
|
+
@keydown=${() => this.closeModal()}
|
|
460
|
+
>
|
|
461
|
+
<div
|
|
462
|
+
class="modal-content max-w-7xl w-full flex flex-col lg:flex-row max-h-full overflow-auto"
|
|
463
|
+
@click="${(e: { stopPropagation: () => any }) =>
|
|
464
|
+
e.stopPropagation()}"
|
|
465
|
+
@keydown=${(e: { stopPropagation: () => any }) =>
|
|
466
|
+
e.stopPropagation()}
|
|
467
|
+
>
|
|
468
|
+
<button class="close-button" @click="${this.closeModal}">
|
|
469
|
+
${unsafeSVG(getFontAwesomeIcon('fa', 'times', 20, 20))}
|
|
470
|
+
</button>
|
|
471
|
+
<div
|
|
472
|
+
class="bg-grey-600 lg:max-w-[515px] w-full p-4 md:p-16 justify-between items-center flex flex-col relative"
|
|
473
|
+
>
|
|
474
|
+
<div class="items-center flex flex-col">
|
|
475
|
+
${this.dataModalRegister.modal.registerPopUp.logo
|
|
476
|
+
? html`
|
|
477
|
+
<img
|
|
478
|
+
class=" max-w-[214px] md:max-w-[321px] pt-2 md:pt-0"
|
|
479
|
+
src="${this.dataModalRegister.modal
|
|
480
|
+
.registerPopUp.logo}"
|
|
481
|
+
alt="logo kompas pro mining"
|
|
482
|
+
/>
|
|
483
|
+
`
|
|
484
|
+
: nothing}
|
|
485
|
+
<div
|
|
486
|
+
class="flex flex-col mt-6 md:mt-10 gap-2 text-left overflow-hidden ${this
|
|
487
|
+
.showMobileBenefit
|
|
488
|
+
? 'max-h-fit'
|
|
489
|
+
: 'max-h-[150px] lg:max-h-fit'}"
|
|
490
|
+
>
|
|
491
|
+
${this.dataModalRegister.modal.registerPopUp
|
|
492
|
+
.benefits &&
|
|
493
|
+
this.dataModalRegister.modal.registerPopUp.benefits
|
|
494
|
+
.length
|
|
495
|
+
? this.dataModalRegister.modal.registerPopUp.benefits.map(
|
|
496
|
+
item =>
|
|
497
|
+
html`
|
|
498
|
+
<div
|
|
499
|
+
class="flex items-baseline text-left text-white"
|
|
500
|
+
>
|
|
501
|
+
<div
|
|
502
|
+
class="text-green-400 h-5 w-5 md:h-6 md:w-6 flex shrink-0 items-center justify-center"
|
|
503
|
+
>
|
|
504
|
+
${unsafeSVG(
|
|
505
|
+
getFontAwesomeIcon(
|
|
506
|
+
'fas',
|
|
507
|
+
'check',
|
|
508
|
+
16,
|
|
509
|
+
16
|
|
510
|
+
)
|
|
511
|
+
)}
|
|
512
|
+
</div>
|
|
513
|
+
<h6
|
|
514
|
+
class="text-sm md:text-lg font-sans ml-1 leading-6"
|
|
515
|
+
>
|
|
516
|
+
${item}
|
|
517
|
+
</h6>
|
|
518
|
+
</div>
|
|
519
|
+
`
|
|
520
|
+
)
|
|
521
|
+
: nothing}
|
|
522
|
+
</div>
|
|
523
|
+
</div>
|
|
524
|
+
<button
|
|
525
|
+
@click="${this.toggleMobileBenefit}"
|
|
526
|
+
class="bg-grey-600 absolute text-grey-100 py-6 w-full bottom-0 left-0 text-center lg:hidden"
|
|
527
|
+
>
|
|
528
|
+
<div
|
|
529
|
+
class="h-12 transparent-linear-dark -mt-[72px] z-0 w-full absolute ${this
|
|
530
|
+
.showMobileBenefit
|
|
531
|
+
? 'hidden'
|
|
532
|
+
: ''}"
|
|
533
|
+
></div>
|
|
534
|
+
<div
|
|
535
|
+
class="flex flex-row items-center justify-center gap-4"
|
|
536
|
+
>
|
|
537
|
+
${this.showMobileBenefit
|
|
538
|
+
? 'Sembunyikan'
|
|
539
|
+
: 'Lihat keuntungan lainnnya'}
|
|
540
|
+
${unsafeSVG(
|
|
541
|
+
getFontAwesomeIcon(
|
|
542
|
+
'fas',
|
|
543
|
+
this.showMobileBenefit
|
|
544
|
+
? 'chevron-up'
|
|
545
|
+
: 'chevron-down'
|
|
546
|
+
)
|
|
547
|
+
)}
|
|
548
|
+
</div>
|
|
549
|
+
</button>
|
|
550
|
+
<div
|
|
551
|
+
class="hidden lg:block text-grey-300 pt-10 border-t border-grey-500 w-full text-center"
|
|
552
|
+
>
|
|
553
|
+
Butuh bantuan? Hubungi
|
|
554
|
+
<button
|
|
555
|
+
@click=${this.customerServiceClicked}
|
|
556
|
+
class="font-bold underline"
|
|
557
|
+
>
|
|
558
|
+
${this.dataModalRegister.modal.registerPopUp.hotline
|
|
559
|
+
.text}
|
|
560
|
+
</button>
|
|
561
|
+
</div>
|
|
562
|
+
</div>
|
|
563
|
+
<div class="w-full h-full">
|
|
564
|
+
${this.templateForm()}
|
|
565
|
+
<div
|
|
566
|
+
class="block lg:hidden text-grey-300 py-5 bg-grey-600 w-full text-center"
|
|
567
|
+
>
|
|
568
|
+
Butuh bantuan? Hubungi
|
|
569
|
+
<button
|
|
570
|
+
@click=${this.customerServiceClicked}
|
|
571
|
+
class="font-bold underline"
|
|
572
|
+
>
|
|
573
|
+
${this.dataModalRegister.modal.registerPopUp.hotline
|
|
574
|
+
.text}
|
|
575
|
+
</button>
|
|
576
|
+
</div>
|
|
577
|
+
</div>
|
|
578
|
+
</div>
|
|
579
|
+
</div>
|
|
580
|
+
`
|
|
581
|
+
: ''}
|
|
582
|
+
${this.isModalOpen && this.confirmation
|
|
583
|
+
? html` <div
|
|
584
|
+
class="modal-overlay px-4"
|
|
585
|
+
@click="${this.closeModal}"
|
|
586
|
+
@keydown=${() => this.closeModal()}
|
|
587
|
+
>
|
|
588
|
+
<div
|
|
589
|
+
class="modal-content max-w-[624px] max-h-[577px] items-end flex flex-col justify-end h-full w-full p-4 md:p-10"
|
|
590
|
+
@click="${(e: { stopPropagation: () => any }) =>
|
|
591
|
+
e.stopPropagation()}"
|
|
592
|
+
@keydown=${(e: { stopPropagation: () => any }) =>
|
|
593
|
+
e.stopPropagation()}
|
|
594
|
+
>
|
|
595
|
+
<button class="close-button" @click="${this.closeModal}">
|
|
596
|
+
${unsafeSVG(getFontAwesomeIcon('fa', 'times', 20, 20))}
|
|
597
|
+
</button>
|
|
598
|
+
${this.dataModalRegister.modal.successPopUp.logo
|
|
599
|
+
? html`
|
|
600
|
+
<img
|
|
601
|
+
class="w-full max-w-[242px] mx-auto"
|
|
602
|
+
src="${this.dataModalRegister.modal.successPopUp
|
|
603
|
+
.logo}"
|
|
604
|
+
alt="konfirmasi"
|
|
605
|
+
/>
|
|
606
|
+
`
|
|
607
|
+
: nothing}
|
|
608
|
+
<div class="text-grey-300 text-center mt-8">
|
|
609
|
+
<h1 class="text-lg md:text-xl font-bold ">
|
|
610
|
+
${this.dataModalRegister.modal.successPopUp.title}
|
|
611
|
+
</h1>
|
|
612
|
+
<p
|
|
613
|
+
class="text-sm md:text-base mt-4 bold-yellow"
|
|
614
|
+
.innerHTML="${this.dataModalRegister.modal.successPopUp
|
|
615
|
+
.description}"
|
|
616
|
+
></p>
|
|
617
|
+
<button
|
|
618
|
+
@click="${this.closeModal}"
|
|
619
|
+
class="bg-yellow-500 text-center h-10 rounded text-grey-600 mt-6 w-full font-bold"
|
|
620
|
+
>
|
|
621
|
+
Oke
|
|
622
|
+
</button>
|
|
623
|
+
</div>
|
|
624
|
+
</div>
|
|
625
|
+
</div>`
|
|
626
|
+
: ''} `
|
|
627
|
+
: nothing
|
|
628
|
+
}
|
|
629
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface CardRegister {
|
|
2
|
+
labelPackage: string
|
|
3
|
+
textInvitation: string
|
|
4
|
+
isButtonSolid: boolean
|
|
5
|
+
textButton: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface hotline {
|
|
9
|
+
text: string
|
|
10
|
+
url: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface sectionRegister {
|
|
14
|
+
title: string
|
|
15
|
+
description: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface popUpRegister {
|
|
19
|
+
logo: string
|
|
20
|
+
benefits: string[]
|
|
21
|
+
sectionRegister: sectionRegister
|
|
22
|
+
hotline: hotline
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface popUpSuccess {
|
|
26
|
+
logo: string
|
|
27
|
+
title: string
|
|
28
|
+
description: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface PopUp {
|
|
32
|
+
registerPopUp: popUpRegister
|
|
33
|
+
successPopUp: popUpSuccess
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ModalRegister {
|
|
37
|
+
card: CardRegister
|
|
38
|
+
modal: PopUp
|
|
39
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { KompasHeaderAccount } from './components/kompasid-header-account/Kompas
|
|
|
11
11
|
export { KompasHeaderNotification } from './components/kompasid-header-notification/KompasHeaderNotification.js'
|
|
12
12
|
export { KompasGracePeriod } from './components/kompasid-grace-period/KompasGracePeriod.js'
|
|
13
13
|
export { KompasMeteredPaywallPersonalize } from './components/kompasid-metered-paywall-personalize/KompasMeteredPaywallPersonalize.js'
|
|
14
|
+
export { KompasPaywallModalRegister } from './components/kompasid-paywall-modal-register/KompasPaywallModalRegister.js'
|
|
14
15
|
|
|
15
16
|
declare global {
|
|
16
17
|
interface Window {
|