@kompasid/lit-web-components 0.9.41 → 0.9.43
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 +3 -3
- package/demo/paywall.html +17 -20
- package/dist/src/components/kompasid-header-account/KompasHeaderAccount.d.ts +3 -7
- package/dist/src/components/kompasid-header-account/KompasHeaderAccount.js +9 -29
- package/dist/src/components/kompasid-header-account/KompasHeaderAccount.js.map +1 -1
- package/dist/src/components/kompasid-header-account-menu/KompasHeaderAccountMenu.d.ts +3 -15
- package/dist/src/components/kompasid-header-account-menu/KompasHeaderAccountMenu.js +9 -30
- package/dist/src/components/kompasid-header-account-menu/KompasHeaderAccountMenu.js.map +1 -1
- package/dist/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.d.ts +0 -1
- package/dist/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.js +0 -4
- package/dist/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.js.map +1 -1
- package/dist/src/components/kompasid-paywall/KompasPaywall.js +11 -11
- package/dist/src/components/kompasid-paywall/KompasPaywall.js.map +1 -1
- package/dist/src/components/kompasid-paywall/types.d.ts +4 -0
- package/dist/src/components/kompasid-paywall/types.js.map +1 -1
- package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.d.ts +2 -2
- package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.js +187 -159
- package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.js.map +1 -1
- package/dist/tailwind/tailwind.js +78 -91
- 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 +6 -14
- package/src/components/kompasid-header-account/readme.md +29 -7
- package/src/components/kompasid-header-account-menu/KompasHeaderAccountMenu.ts +8 -24
- package/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.ts +0 -1
- package/src/components/kompasid-paywall/KompasPaywall.ts +11 -11
- package/src/components/kompasid-paywall/readme.md +74 -352
- package/src/components/kompasid-paywall/types.ts +4 -0
- package/src/components/kompasid-paywall-body/KompasPaywallBody.ts +210 -199
- package/src/components/kompasid-paywall-body/readme.md +3 -0
- package/tailwind/tailwind.css +78 -91
- package/tailwind/tailwind.ts +78 -91
- package/tailwind.config.js +1 -1
|
@@ -8,7 +8,7 @@ import { getFontAwesomeIcon } from '../../utils/fontawesome-setup.js';
|
|
|
8
8
|
import { deviceType } from '../../utils/deviceType.js';
|
|
9
9
|
import { formatRupiah } from '../../utils/formatRupiah.js';
|
|
10
10
|
import { addGoogleFonts } from '../../utils/googleFont.js';
|
|
11
|
-
import {
|
|
11
|
+
import { redirectToLogin } from '../../utils/cta.js';
|
|
12
12
|
import { customFetch } from '../../utils/customFetch.js';
|
|
13
13
|
import { getCookie } from '../../utils/getCookies.js';
|
|
14
14
|
import { getLoginGuest } from '../../utils/api/getLoginGuest.js';
|
|
@@ -501,31 +501,33 @@ let KompasIdPaywallBody = class KompasIdPaywallBody extends LitElement {
|
|
|
501
501
|
*/
|
|
502
502
|
headerSection(type, title) {
|
|
503
503
|
let buttonContent;
|
|
504
|
-
const
|
|
504
|
+
const isPro = this.type === 'proMiningArticle' || this.type === 'proMiningOutlook';
|
|
505
|
+
const textColorDefault = isPro ? 'text-grey-600' : 'text-blue-600';
|
|
506
|
+
const textColorClass = this.isDark ? 'text-blue-300' : textColorDefault;
|
|
505
507
|
const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600';
|
|
506
508
|
const isPrevHistoryExist = window.history.length > 1;
|
|
507
509
|
if (type === 'epaper' && isPrevHistoryExist) {
|
|
508
510
|
buttonContent = html ` <button
|
|
509
511
|
@click=${this.redirectToPrevUrl}
|
|
510
|
-
class="hidden md:
|
|
512
|
+
class="absolute left-2.5 -top-1.5 hidden md:flex w-10 h-10 justify-center items-center ${textColorClass}"
|
|
511
513
|
>
|
|
512
|
-
${unsafeSVG(getFontAwesomeIcon('fas', 'arrow-left'))}
|
|
514
|
+
${unsafeSVG(getFontAwesomeIcon('fas', 'arrow-left', 20, 20))}
|
|
513
515
|
</button>`;
|
|
514
516
|
}
|
|
515
517
|
else if (type === 'proMiningOutlook' && isPrevHistoryExist) {
|
|
516
518
|
buttonContent = html ` <button
|
|
517
519
|
@click=${this.redirectToPrevUrl}
|
|
518
|
-
class="hidden md:
|
|
520
|
+
class="absolute left-2.5 -top-1.5 hidden md:flex w-10 h-10 justify-center items-center ${textColorClass}"
|
|
519
521
|
>
|
|
520
|
-
${unsafeSVG(getFontAwesomeIcon('fas', 'arrow-left'))}
|
|
522
|
+
${unsafeSVG(getFontAwesomeIcon('fas', 'arrow-left', 20, 20))}
|
|
521
523
|
</button>`;
|
|
522
524
|
}
|
|
523
525
|
else if (type === 'audio') {
|
|
524
526
|
buttonContent = html ` <button
|
|
525
527
|
@click=${this.togglePaywall}
|
|
526
|
-
class="hidden md:
|
|
528
|
+
class="absolute left-2.5 -top-1.5 hidden md:flex w-10 h-10 justify-center items-center ${textColorClass}"
|
|
527
529
|
>
|
|
528
|
-
${unsafeSVG(getFontAwesomeIcon('fas', 'xmark',
|
|
530
|
+
${unsafeSVG(getFontAwesomeIcon('fas', 'xmark', 28, 28))}
|
|
529
531
|
</button>`;
|
|
530
532
|
}
|
|
531
533
|
else {
|
|
@@ -533,40 +535,64 @@ let KompasIdPaywallBody = class KompasIdPaywallBody extends LitElement {
|
|
|
533
535
|
}
|
|
534
536
|
const headerClass = `text-base flex justify-center self-center md:block md:text-xl ${buttonTextColorClass} text-center font-lora font-bold tracking-wide md:tracking-normal max-w-xs sm:max-w-lg md:w-full md:max-w-full ${type === 'audio' && 'sm:px-16 md:px-20'}`;
|
|
535
537
|
return html `
|
|
536
|
-
<div class="flex w-full items-start justify-center">
|
|
538
|
+
<div class="flex w-full items-start justify-center relative md:px-10">
|
|
537
539
|
${buttonContent}
|
|
538
540
|
<h4 class=${headerClass}>${title}</h4>
|
|
539
|
-
${type === 'epaper' || type === 'audio'
|
|
540
|
-
? html `<div class="w-10 hidden md:flex"></div>`
|
|
541
|
-
: nothing}
|
|
542
541
|
</div>
|
|
543
542
|
`;
|
|
544
543
|
}
|
|
544
|
+
excerptSection(excerpt) {
|
|
545
|
+
return excerpt
|
|
546
|
+
? html ` <p
|
|
547
|
+
class="text-sm md:text-base ${this.isDark
|
|
548
|
+
? 'text-white'
|
|
549
|
+
: 'text-grey-600'} font-sans mt-2 md:mt-4 text-center"
|
|
550
|
+
>
|
|
551
|
+
${excerpt}
|
|
552
|
+
</p>`
|
|
553
|
+
: nothing;
|
|
554
|
+
}
|
|
545
555
|
descriptionSection(data) {
|
|
546
|
-
const
|
|
556
|
+
const isPro = this.type === 'proMiningArticle' || this.type === 'proMiningOutlook';
|
|
547
557
|
const textColorClass = this.isDark ? 'text-green-400' : 'text-green-500';
|
|
548
558
|
const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600';
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
559
|
+
const borderColorDefault = isPro ? 'border-grey-300' : 'border-blue-200';
|
|
560
|
+
const borderColorClass = this.isDark ? 'border-white' : borderColorDefault;
|
|
561
|
+
return data.length
|
|
562
|
+
? html `<div
|
|
563
|
+
class="md:max-w-[492px] flex flex-col items-center px-0 lg:px-4 py-4 lg:py-5 w-full border-b border-t ${borderColorClass} mt-4 lg:mt-5"
|
|
564
|
+
>
|
|
565
|
+
<div>
|
|
566
|
+
<div
|
|
567
|
+
class="font-bold font-sans ${buttonTextColorClass} w-full text-left"
|
|
568
|
+
>
|
|
569
|
+
Keuntungan Eksklusif yang Anda Dapatkan:
|
|
570
|
+
</div>
|
|
571
|
+
<div class="flex flex-col mt-2 md:mt-3 gap-2 text-left">
|
|
572
|
+
${data.map(item => html `
|
|
573
|
+
<div class="flex items-center text-left">
|
|
574
|
+
<div
|
|
575
|
+
class="${textColorClass} h-4 w-4 md:h-5 md:w-5 flex items-center justify-center"
|
|
576
|
+
>
|
|
577
|
+
${unsafeSVG(getFontAwesomeIcon('fas', 'check', 16, 16))}
|
|
578
|
+
</div>
|
|
579
|
+
<h6
|
|
580
|
+
class="text-sm md:text-base ml-1 md:ml-2 ${buttonTextColorClass}"
|
|
581
|
+
>
|
|
582
|
+
${item}
|
|
583
|
+
</h6>
|
|
584
|
+
</div>
|
|
585
|
+
`)}
|
|
586
|
+
</div>
|
|
587
|
+
</div>
|
|
588
|
+
</div>`
|
|
589
|
+
: nothing;
|
|
565
590
|
}
|
|
566
591
|
ctaPackages() {
|
|
567
592
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
568
|
-
const
|
|
569
|
-
const
|
|
593
|
+
const isPro = this.type === 'proMiningArticle' || this.type === 'proMiningOutlook';
|
|
594
|
+
const textColorDefault = isPro ? 'text-grey-600' : 'text-blue-600';
|
|
595
|
+
const textColorClass = this.isDark ? 'text-blue-300' : textColorDefault;
|
|
570
596
|
const getCtaText = ((_b = (_a = this.paywallData) === null || _a === void 0 ? void 0 : _a.informations) === null || _b === void 0 ? void 0 : _b.cta)
|
|
571
597
|
? (_d = (_c = this.paywallData) === null || _c === void 0 ? void 0 : _c.informations) === null || _d === void 0 ? void 0 : _d.cta.text
|
|
572
598
|
: '';
|
|
@@ -574,7 +600,7 @@ let KompasIdPaywallBody = class KompasIdPaywallBody extends LitElement {
|
|
|
574
600
|
? (_h = (_g = this.paywallData) === null || _g === void 0 ? void 0 : _g.informations) === null || _h === void 0 ? void 0 : _h.cta.show
|
|
575
601
|
: false;
|
|
576
602
|
return showCta
|
|
577
|
-
? html ` <div class="flex justify-center
|
|
603
|
+
? html ` <div class="flex justify-center mt-2 md:mt-3">
|
|
578
604
|
<button
|
|
579
605
|
@click=${this.otherPackagesClicked}
|
|
580
606
|
class="text-sm md:text-base font-bold underline ${textColorClass}"
|
|
@@ -588,7 +614,8 @@ let KompasIdPaywallBody = class KompasIdPaywallBody extends LitElement {
|
|
|
588
614
|
const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600';
|
|
589
615
|
const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600';
|
|
590
616
|
return html `
|
|
591
|
-
<div>
|
|
617
|
+
<div class="mt-4 lg:mt-5">
|
|
618
|
+
<span class="${buttonTextColorClass}">Sudah berlangganan?</span>
|
|
592
619
|
<button
|
|
593
620
|
@click=${() => redirectToLogin({
|
|
594
621
|
loc: 'hard_paywall',
|
|
@@ -598,44 +625,26 @@ let KompasIdPaywallBody = class KompasIdPaywallBody extends LitElement {
|
|
|
598
625
|
>
|
|
599
626
|
Masuk
|
|
600
627
|
</button>
|
|
601
|
-
<span class="${buttonTextColorClass}">jika sudah berlangganan.</span>
|
|
602
628
|
</div>
|
|
603
629
|
`;
|
|
604
630
|
}
|
|
605
631
|
regulerRegistrationSection() {
|
|
606
|
-
const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600';
|
|
607
|
-
const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600';
|
|
608
632
|
const isPro = this.type === 'proMiningArticle' || this.type === 'proMiningOutlook';
|
|
633
|
+
const textColorDefault = isPro ? 'text-grey-600' : 'text-blue-600';
|
|
634
|
+
const textColorClass = this.isDark ? 'text-blue-300' : textColorDefault;
|
|
635
|
+
const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600';
|
|
609
636
|
return html `
|
|
610
637
|
<div
|
|
611
|
-
class="flex flex-col items-center justify-center text-sm md:text-base"
|
|
638
|
+
class="flex flex-col items-center justify-center text-sm md:text-base mt-4 lg:mt-5"
|
|
612
639
|
>
|
|
613
|
-
${!isPro
|
|
614
|
-
? html `
|
|
615
|
-
<div>
|
|
616
|
-
<button
|
|
617
|
-
@click=${() => redirectToRegister('hard_paywall')}
|
|
618
|
-
class="font-bold underline ${textColorClass}"
|
|
619
|
-
>
|
|
620
|
-
Daftar
|
|
621
|
-
</button>
|
|
622
|
-
<span class="${buttonTextColorClass}"
|
|
623
|
-
>untuk kuota artikel gratis</span
|
|
624
|
-
>
|
|
625
|
-
</div>
|
|
626
|
-
`
|
|
627
|
-
: nothing}
|
|
628
640
|
<div>
|
|
629
|
-
${
|
|
630
|
-
? html ` <span class="${buttonTextColorClass}">atau</span>`
|
|
631
|
-
: nothing}
|
|
641
|
+
<span class="${buttonTextColorClass}">Sudah berlangganan?</span>
|
|
632
642
|
<button
|
|
633
643
|
@click=${() => redirectToLogin({ loc: 'hard_paywall' })}
|
|
634
644
|
class="font-bold underline ${textColorClass}"
|
|
635
645
|
>
|
|
636
646
|
Masuk
|
|
637
647
|
</button>
|
|
638
|
-
<span class="${buttonTextColorClass}">jika sudah punya akun.</span>
|
|
639
648
|
</div>
|
|
640
649
|
</div>
|
|
641
650
|
`;
|
|
@@ -681,34 +690,70 @@ let KompasIdPaywallBody = class KompasIdPaywallBody extends LitElement {
|
|
|
681
690
|
</div>
|
|
682
691
|
`;
|
|
683
692
|
}
|
|
684
|
-
|
|
693
|
+
renderPackage(product, isHighlight, isButtonSolid) {
|
|
685
694
|
const { isDark } = this;
|
|
686
|
-
const
|
|
687
|
-
|
|
695
|
+
const containerClass = `px-4 flex flex-wrap items-center justify-between rounded-lg md:mx-0 w-full max-w-xs md:max-w-sm md:w-3/5 min-h-[68px]
|
|
696
|
+
${isDark ? ' bg-grey-600' : ' bg-white'}
|
|
697
|
+
${isHighlight ? 'border border-yellow-400 mt-2' : ''} relative`;
|
|
688
698
|
const textColorClass = isDark ? 'text-dark-7' : 'text-grey-600';
|
|
689
|
-
|
|
690
|
-
|
|
699
|
+
let buttonBgColorClass = '';
|
|
700
|
+
if (isButtonSolid) {
|
|
701
|
+
buttonBgColorClass = isDark
|
|
702
|
+
? 'bg-green-300 border border-green-400'
|
|
703
|
+
: 'bg-green-500';
|
|
704
|
+
}
|
|
705
|
+
else {
|
|
706
|
+
buttonBgColorClass = isDark
|
|
707
|
+
? ' border border-green-500 text-green-300'
|
|
708
|
+
: ' border border-green-500 bg-white text-green-500';
|
|
709
|
+
}
|
|
710
|
+
const buttonClass = `h-8 rounded ${buttonBgColorClass} flex items-center`;
|
|
711
|
+
let buttonTextColor = '';
|
|
712
|
+
if (isButtonSolid) {
|
|
713
|
+
buttonTextColor = isDark ? ' text-black' : ' text-white';
|
|
714
|
+
}
|
|
715
|
+
else if (isDark) {
|
|
716
|
+
buttonTextColor = 'text-green-300';
|
|
717
|
+
}
|
|
718
|
+
else {
|
|
719
|
+
buttonTextColor = 'text-green-500';
|
|
720
|
+
}
|
|
721
|
+
const buttonTextClass = `text-xs md:text-sm font-bold py-2 px-4 ${buttonTextColor}`;
|
|
691
722
|
return html `
|
|
692
723
|
<div class="${containerClass}">
|
|
693
|
-
<div class="flex flex-col
|
|
694
|
-
<div class="flex
|
|
695
|
-
<h5 class="text-base
|
|
724
|
+
<div class="flex flex-col gap-1">
|
|
725
|
+
<div class="flex items-baseline">
|
|
726
|
+
<h5 class="text-base font-bold text-orange-400">
|
|
696
727
|
${formatRupiah(product.price)}
|
|
697
728
|
</h5>
|
|
698
|
-
<h6 class="text-xs
|
|
729
|
+
<h6 class="text-xs font-bold pl-1 ${textColorClass}">
|
|
699
730
|
/ ${product.periode}
|
|
700
731
|
</h6>
|
|
701
732
|
</div>
|
|
702
|
-
${product.
|
|
733
|
+
${product.priceSlice || product.saveLabel
|
|
703
734
|
? html `
|
|
704
|
-
<div class="flex
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
735
|
+
<div class="flex flex-row gap-2">
|
|
736
|
+
${product.priceSlice
|
|
737
|
+
? html `
|
|
738
|
+
<div class="flex items-center text-xs font-sans">
|
|
739
|
+
<span
|
|
740
|
+
class="${isDark
|
|
741
|
+
? 'text-white'
|
|
742
|
+
: 'text-grey-400'} line-through"
|
|
743
|
+
>${formatRupiah(product.priceSlice)}</span
|
|
744
|
+
>
|
|
745
|
+
</div>
|
|
746
|
+
`
|
|
747
|
+
: nothing}
|
|
748
|
+
${product.saveLabel
|
|
749
|
+
? html `
|
|
750
|
+
<div
|
|
751
|
+
class="flex font-bold items-center text-xs font-sans bg-red-100 rounded p-1"
|
|
752
|
+
>
|
|
753
|
+
<span class="text-red-500">${product.saveLabel}</span>
|
|
754
|
+
</div>
|
|
755
|
+
`
|
|
756
|
+
: nothing}
|
|
712
757
|
</div>
|
|
713
758
|
`
|
|
714
759
|
: nothing}
|
|
@@ -719,90 +764,70 @@ let KompasIdPaywallBody = class KompasIdPaywallBody extends LitElement {
|
|
|
719
764
|
>
|
|
720
765
|
<h6 class="${buttonTextClass}">Langganan</h6>
|
|
721
766
|
</button>
|
|
722
|
-
|
|
723
|
-
<div class="rounded bg-yellow-300 px-2 py-0.5 text-xs">
|
|
724
|
-
<b class="text-grey-600">Harga Terbaik</b>
|
|
725
|
-
</div>
|
|
726
|
-
</div>
|
|
727
|
-
</div>
|
|
728
|
-
`;
|
|
729
|
-
}
|
|
730
|
-
secondaryPackages(product) {
|
|
731
|
-
const { isDark } = this;
|
|
732
|
-
const isAudio = this.type === 'audio';
|
|
733
|
-
const containerClass = `flex flex-wrap items-center justify-between py-3 px-4 rounded-lg md:mx-0 w-full h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3${isDark ? ' bg-grey-600' : ' bg-white'}${isAudio ? ' md:mt-2.5' : ' md:mt-4'}`;
|
|
734
|
-
const textColorClass = isDark ? 'text-dark-7' : 'text-grey-600';
|
|
735
|
-
const buttonClass = `h-8 rounded border border-green-500${isDark ? ' text-green-300' : ' bg-white text-green-500'}`;
|
|
736
|
-
const buttonTextClass = `text-xs md:text-sm font-bold px-4${isDark ? ' text-green-300' : ' text-green-500'}`;
|
|
737
|
-
return html `
|
|
738
|
-
<div class="${containerClass}">
|
|
739
|
-
<div class="flex flex-col">
|
|
740
|
-
<div class="flex items-center">
|
|
741
|
-
<h5 class="text-base md:text-lg font-bold text-orange-400">
|
|
742
|
-
${formatRupiah(product.price)}
|
|
743
|
-
</h5>
|
|
744
|
-
<h6 class="text-xs md:text-base font-bold pl-1 ${textColorClass}">
|
|
745
|
-
/ ${product.periode}
|
|
746
|
-
</h6>
|
|
747
|
-
</div>
|
|
748
|
-
${product.savingPrice
|
|
767
|
+
${isHighlight
|
|
749
768
|
? html `
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
>
|
|
756
|
-
/ bulan
|
|
757
|
-
</p>
|
|
769
|
+
<div class="absolute -top-2 left-4">
|
|
770
|
+
<div
|
|
771
|
+
class="rounded bg-yellow-300 px-2 h-4 items-center text-xs"
|
|
772
|
+
>
|
|
773
|
+
<b class="text-grey-600">Harga Terbaik</b>
|
|
758
774
|
</div>
|
|
759
|
-
|
|
775
|
+
</div>
|
|
776
|
+
`
|
|
760
777
|
: nothing}
|
|
761
|
-
</div>
|
|
762
|
-
<button
|
|
763
|
-
@click=${() => this.redirectToCheckout(product.url, product.package, product.subscriptionId, product.price, product.position)}
|
|
764
|
-
class="${buttonClass}"
|
|
765
|
-
>
|
|
766
|
-
<h6 class="${buttonTextClass}">Langganan</h6>
|
|
767
|
-
</button>
|
|
768
778
|
</div>
|
|
769
779
|
`;
|
|
770
780
|
}
|
|
771
781
|
packagesSection(data) {
|
|
772
782
|
return html `
|
|
773
|
-
<div
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
783
|
+
<div
|
|
784
|
+
class="flex flex-col w-full items-center gap-2 md:gap-3 mt-4 md:mt-5"
|
|
785
|
+
>
|
|
786
|
+
${data.memberships.map(item => this.renderPackage(item, item.isHighlight, item.isButtonSolid))}
|
|
777
787
|
${this.freeTrialPackageSection()} ${this.freeTrialPopUp()}
|
|
778
788
|
${this.packages.swgEnable ? this.swgPackageSection() : nothing}
|
|
779
789
|
</div>
|
|
780
790
|
`;
|
|
781
791
|
}
|
|
792
|
+
// private packagesSection(data: Packages) {
|
|
793
|
+
// return html`
|
|
794
|
+
// <div class="flex flex-col w-full items-center mt-8 md:mt-2 px-4">
|
|
795
|
+
// ${data.memberships.map(item =>
|
|
796
|
+
// item.isHighlight
|
|
797
|
+
// ? this.primaryPackages(item)
|
|
798
|
+
// : this.secondaryPackages(item)
|
|
799
|
+
// )}
|
|
800
|
+
// ${this.freeTrialPackageSection()} ${this.freeTrialPopUp()}
|
|
801
|
+
// ${this.packages.swgEnable ? this.swgPackageSection() : nothing}
|
|
802
|
+
// </div>
|
|
803
|
+
// `
|
|
804
|
+
// }
|
|
782
805
|
topNavigator(type) {
|
|
783
806
|
let icon;
|
|
784
807
|
let buttonText;
|
|
785
808
|
let clickAction;
|
|
786
809
|
if (type === 'audio') {
|
|
787
|
-
icon = getFontAwesomeIcon('fas', 'xmark');
|
|
810
|
+
icon = getFontAwesomeIcon('fas', 'xmark', 12, 12);
|
|
788
811
|
buttonText = 'Tutup';
|
|
789
812
|
clickAction = this.togglePaywall.bind(this);
|
|
790
813
|
}
|
|
791
814
|
else {
|
|
792
|
-
icon = getFontAwesomeIcon('fas', 'arrow-left');
|
|
815
|
+
icon = getFontAwesomeIcon('fas', 'arrow-left', 10, 10);
|
|
793
816
|
buttonText = 'Kembali';
|
|
794
817
|
clickAction = this.redirectToPrevUrl.bind(this);
|
|
795
818
|
}
|
|
796
819
|
return html `
|
|
797
|
-
<div class="flex md:hidden w-full
|
|
820
|
+
<div class="flex md:hidden w-full">
|
|
798
821
|
<button
|
|
799
822
|
@click=${clickAction}
|
|
800
|
-
class="text-xs md:text-lg text-white flex flex-row"
|
|
823
|
+
class="text-xs md:text-lg font-sans font-bold text-white flex flex-row h-8 px-4 items-center gap-1"
|
|
801
824
|
>
|
|
802
|
-
<div
|
|
825
|
+
<div
|
|
826
|
+
class="icon-lg icon-white w-4 h-4 items-center justify-center flex"
|
|
827
|
+
>
|
|
803
828
|
${unsafeSVG(icon)}
|
|
804
829
|
</div>
|
|
805
|
-
${buttonText}
|
|
830
|
+
<span> ${buttonText} </span>
|
|
806
831
|
</button>
|
|
807
832
|
</div>
|
|
808
833
|
`;
|
|
@@ -822,13 +847,14 @@ let KompasIdPaywallBody = class KompasIdPaywallBody extends LitElement {
|
|
|
822
847
|
`;
|
|
823
848
|
}
|
|
824
849
|
userAction() {
|
|
850
|
+
const isPro = this.type === 'proMiningArticle' || this.type === 'proMiningOutlook';
|
|
825
851
|
const isAudio = this.type === 'audio';
|
|
826
852
|
const paddingClass = isAudio ? 'md:py-3.5' : 'md:py-6';
|
|
827
|
-
const
|
|
828
|
-
const backgroundClass = this.isDark ? 'bg-dark-4' :
|
|
853
|
+
const backgroundDefault = isPro ? 'bg-grey-500' : 'bg-blue-600';
|
|
854
|
+
const backgroundClass = this.isDark ? 'bg-dark-4' : backgroundDefault;
|
|
829
855
|
return html `
|
|
830
856
|
<div
|
|
831
|
-
class="flex py-5 px-8 w-full justify-evenly rounded-b-xl mt-
|
|
857
|
+
class="flex py-5 px-8 w-full justify-evenly rounded-b-xl mt-5 relative ${paddingClass} md:mt-7 ${backgroundClass}"
|
|
832
858
|
>
|
|
833
859
|
${this.helpDesk()}
|
|
834
860
|
</div>
|
|
@@ -837,17 +863,21 @@ let KompasIdPaywallBody = class KompasIdPaywallBody extends LitElement {
|
|
|
837
863
|
introductoryPrice() {
|
|
838
864
|
const textColorClass = this.isDark ? 'text-dark-7' : 'text-grey-600';
|
|
839
865
|
return html ` <div
|
|
840
|
-
class="flex
|
|
866
|
+
class="flex md:flex-col gap-1 items-center md:items-start md:w-1/2 md:justify-center"
|
|
841
867
|
>
|
|
842
|
-
<div class="flex items-center">
|
|
843
|
-
<h5 class="text-base
|
|
868
|
+
<div class="flex items-center gap-1 shrink-0">
|
|
869
|
+
<h5 class="text-base font-bold text-orange-400">
|
|
844
870
|
${this.packages.swgContent.introductory.price}
|
|
845
871
|
</h5>
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
872
|
+
${this.packages.swgContent.introductory.duration
|
|
873
|
+
? html `
|
|
874
|
+
<h6 class="text-xs font-bold ${textColorClass}">
|
|
875
|
+
${this.packages.swgContent.introductory.duration}
|
|
876
|
+
</h6>
|
|
877
|
+
`
|
|
878
|
+
: nothing}
|
|
849
879
|
</div>
|
|
850
|
-
<p class="text-xs ${textColorClass}">
|
|
880
|
+
<p class="text-xs flex ${textColorClass}">
|
|
851
881
|
${this.packages.swgContent.introductory.description}
|
|
852
882
|
</p>
|
|
853
883
|
</div>`;
|
|
@@ -860,9 +890,8 @@ let KompasIdPaywallBody = class KompasIdPaywallBody extends LitElement {
|
|
|
860
890
|
}
|
|
861
891
|
swgPackageSection() {
|
|
862
892
|
const { isDark } = this;
|
|
863
|
-
const
|
|
864
|
-
const
|
|
865
|
-
const buttonClass = `border space-x-2 justify-center border-grey-400 rounded-md px-[22px] md:px-6 shadow-sm flex h-max flex-row flex-nowrap py-[5.6px] md:py-1.5 items-center${isDark ? ' bg-grey-600' : ' bg-grey-100 border-grey-100'}`;
|
|
893
|
+
const containerClass = `flex flex-col md:flex-row gap-1 justify-center md:justify-between items-center px-4 rounded-lg md:mx-0 w-full min-h-[76px] md:min-h-[68px] max-w-xs md:max-w-sm md:w-3/5 ${isDark ? ' bg-grey-600' : ' bg-white'}`;
|
|
894
|
+
const buttonClass = `border space-x-2 justify-center border-grey-400 rounded-md px-[22px] md:px-6 shadow-sm flex h-max flex-row flex-nowrap py-[5.6px] md:py-1.5 items-center${isDark ? ' bg-grey-600' : ' bg-white border-grey-100'}`;
|
|
866
895
|
const textColorClass = isDark ? 'text-dark-7' : 'text-grey-500';
|
|
867
896
|
const googleImageSrc = isDark
|
|
868
897
|
? 'https://cdn-www.kompas.id/paywall-asset/google-white.png'
|
|
@@ -1039,45 +1068,44 @@ let KompasIdPaywallBody = class KompasIdPaywallBody extends LitElement {
|
|
|
1039
1068
|
* Render Statement
|
|
1040
1069
|
*/
|
|
1041
1070
|
render() {
|
|
1042
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1043
|
-
const isEpaper = this.type === 'epaper';
|
|
1071
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1072
|
+
const isEpaper = this.type === 'epaper' || this.type === 'proMiningOutlook';
|
|
1044
1073
|
const isAudio = this.type === 'audio';
|
|
1045
1074
|
const { isDark } = this;
|
|
1046
1075
|
const { isLogin } = this;
|
|
1047
1076
|
const wrapperBodyClass = `wrapper-body
|
|
1048
1077
|
${isEpaper ? 'bg-transparent mx-2' : ''}
|
|
1049
1078
|
${isAudio
|
|
1050
|
-
? 'fixed w-full h-full inset-0 flex justify-center items-center z-index-max bg-black bg-opacity-75'
|
|
1079
|
+
? 'fixed w-full h-full inset-0 flex justify-center items-center z-index-max bg-black bg-opacity-75 px-4 md:px-0'
|
|
1051
1080
|
: ''}`
|
|
1052
1081
|
.trim()
|
|
1053
1082
|
.replace(/\s+/g, ' ');
|
|
1054
|
-
const
|
|
1055
|
-
const
|
|
1083
|
+
const isPro = this.type === 'proMiningArticle' || this.type === 'proMiningOutlook';
|
|
1084
|
+
const backgroundDefault = isPro ? 'bg-grey-100' : 'bg-blue-100';
|
|
1085
|
+
const backgroundClass = isDark ? 'bg-dark-3' : backgroundDefault;
|
|
1086
|
+
const containerClass = `flex w-full flex-col items-center justify-center rounded-xl md:pt-8 pt-6 relative ${backgroundClass}`;
|
|
1087
|
+
// const borderClass = isDark ? 'border-dark-8' : 'border-blue-200'
|
|
1056
1088
|
return html `
|
|
1057
1089
|
<div class="${wrapperBodyClass}">
|
|
1058
1090
|
<div
|
|
1059
|
-
class="flex flex-col justify-center items-center
|
|
1091
|
+
class="flex flex-col justify-center items-center w-full max-w-screen-sm my-5 relative"
|
|
1060
1092
|
>
|
|
1061
1093
|
${isEpaper || isAudio ? this.topNavigator(this.type) : nothing}
|
|
1062
1094
|
<div class="${containerClass}">
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1095
|
+
<div class="px-6 md:px-0 items-center flex flex-col w-full">
|
|
1096
|
+
${this.headerSection(this.type, (_c = (_b = (_a = this.paywallData) === null || _a === void 0 ? void 0 : _a.informations) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '')}
|
|
1097
|
+
${this.excerptSection((_f = (_e = (_d = this.paywallData) === null || _d === void 0 ? void 0 : _d.informations) === null || _e === void 0 ? void 0 : _e.excerpt) !== null && _f !== void 0 ? _f : '')}
|
|
1098
|
+
${this.packagesSection((_h = (_g = this.paywallData) === null || _g === void 0 ? void 0 : _g.packages) !== null && _h !== void 0 ? _h : {})}
|
|
1099
|
+
${this.ctaPackages()}
|
|
1100
|
+
${this.descriptionSection((_l = (_k = (_j = this.paywallData) === null || _j === void 0 ? void 0 : _j.informations) === null || _k === void 0 ? void 0 : _k.description) !== null && _l !== void 0 ? _l : [])}
|
|
1101
|
+
</div>
|
|
1067
1102
|
${!isLogin
|
|
1068
|
-
? html `
|
|
1069
|
-
<div
|
|
1070
|
-
class="border-b w-1/5 flex justify-center ${borderClass} ${isAudio
|
|
1071
|
-
? 'my-4 md:my-3'
|
|
1072
|
-
: 'my-4'}"
|
|
1073
|
-
></div>
|
|
1074
|
-
${this.registrationSection(this.type)}
|
|
1075
|
-
`
|
|
1103
|
+
? html ` ${this.registrationSection(this.type)} `
|
|
1076
1104
|
: nothing}
|
|
1077
1105
|
${this.userAction()}
|
|
1078
1106
|
</div>
|
|
1079
1107
|
${this.isExtensionsOpened
|
|
1080
|
-
? this.paymentMobileExtension((
|
|
1108
|
+
? this.paymentMobileExtension((_p = (_o = (_m = this.paywallData) === null || _m === void 0 ? void 0 : _m.payment) === null || _o === void 0 ? void 0 : _o.ekstension) !== null && _p !== void 0 ? _p : [])
|
|
1081
1109
|
: nothing}
|
|
1082
1110
|
</div>
|
|
1083
1111
|
</div>
|