This commit is contained in:
sairaj mote 2020-10-11 12:17:58 +05:30
parent 0e20f9d314
commit e523461549
5 changed files with 30 additions and 25 deletions

View File

@ -444,8 +444,7 @@ customElements.define('sm-input',
} }
checkInput = (e) => { checkInput = (e) => {
if (!this.hasAttribute('placeholder') || this.getAttribute('placeholder') === '') if (!this.hasAttribute('placeholder') || this.getAttribute('placeholder') === '') return;
return;
if (this.input.value !== '') { if (this.input.value !== '') {
if (this.animate) if (this.animate)
this.inputParent.classList.add('animate-label') this.inputParent.classList.add('animate-label')
@ -471,6 +470,7 @@ customElements.define('sm-input',
this.helperText = this.shadowRoot.querySelector('.helper-text') this.helperText = this.shadowRoot.querySelector('.helper-text')
this.valueChanged = false; this.valueChanged = false;
this.readonly = false this.readonly = false
this.isNumeric = false
this.min this.min
this.max this.max
this.animate = this.hasAttribute('animate') this.animate = this.hasAttribute('animate')
@ -478,7 +478,7 @@ customElements.define('sm-input',
this.shadowRoot.querySelector('.label').textContent = this.getAttribute('placeholder') this.shadowRoot.querySelector('.label').textContent = this.getAttribute('placeholder')
if (this.hasAttribute('value')) { if (this.hasAttribute('value')) {
this.input.value = this.getAttribute('value') this.input.value = this.getAttribute('value')
this.checkInput() this.checkInput(e)
} }
if (this.hasAttribute('required')) { if (this.hasAttribute('required')) {
this.input.setAttribute('required', '') this.input.setAttribute('required', '')
@ -518,12 +518,13 @@ customElements.define('sm-input',
if (this.getAttribute('type') === 'number') { if (this.getAttribute('type') === 'number') {
this.input.setAttribute('inputmode', 'numeric') this.input.setAttribute('inputmode', 'numeric')
this.input.setAttribute('type', 'number') this.input.setAttribute('type', 'number')
this.isNumeric = true
} else } else
this.input.setAttribute('type', this.getAttribute('type')) this.input.setAttribute('type', this.getAttribute('type'))
} else } else
this.input.setAttribute('type', 'text') this.input.setAttribute('type', 'text')
this.input.addEventListener('input', e => { this.input.addEventListener('input', e => {
this.checkInput() this.checkInput(e)
}) })
this.clearBtn.addEventListener('click', e => { this.clearBtn.addEventListener('click', e => {
this.value = '' this.value = ''
@ -2076,8 +2077,8 @@ customElements.define('sm-popup', class extends HTMLElement {
) )
this.setAttribute('open', '') this.setAttribute('open', '')
this.pinned = pinned this.pinned = pinned
this.popupContainer.classList.remove('hide')
} }
this.popupContainer.classList.remove('hide')
this.popup.style.transform = 'translateY(0)'; this.popup.style.transform = 'translateY(0)';
document.body.setAttribute('style', `overflow: hidden; top: -${window.scrollY}px`) document.body.setAttribute('style', `overflow: hidden; top: -${window.scrollY}px`)
return this.popupStack return this.popupStack
@ -2181,8 +2182,8 @@ customElements.define('sm-popup', class extends HTMLElement {
this.touchEndY = 0 this.touchEndY = 0
this.touchStartTime = 0 this.touchStartTime = 0
this.touchEndTime = 0 this.touchEndTime = 0
this.threshold = this.popup.getBoundingClientRect().height * 0.3
this.touchEndAnimataion; this.touchEndAnimataion;
this.threshold
if (this.hasAttribute('open')) if (this.hasAttribute('open'))
this.show() this.show()
@ -2197,6 +2198,9 @@ customElements.define('sm-popup', class extends HTMLElement {
}) })
this.popupBodySlot.addEventListener('slotchange', () => { this.popupBodySlot.addEventListener('slotchange', () => {
setTimeout(() => {
this.threshold = this.popup.getBoundingClientRect().height * 0.3
}, 200);
this.inputFields = this.querySelectorAll('sm-input', 'sm-checkbox', 'textarea', 'radio') this.inputFields = this.querySelectorAll('sm-input', 'sm-checkbox', 'textarea', 'radio')
}) })

View File

@ -462,7 +462,8 @@ sm-popup h5:not(.tag) {
} }
#qr_code_popup::part(popup) { #qr_code_popup::part(popup) {
height: 90vh; min-height: 30rem;
max-height: 90vh;
} }
#qr_code_popup::part(popup-body) { #qr_code_popup::part(popup-body) {
padding: 0; padding: 0;

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -478,7 +478,8 @@ sm-popup{
} }
#qr_code_popup{ #qr_code_popup{
&::part(popup){ &::part(popup){
height: 90vh; min-height: 30rem;
max-height: 90vh;
} }
&::part(popup-body){ &::part(popup-body){
padding: 0; padding: 0;

View File

@ -428,10 +428,10 @@
</svg> </svg>
<svg id="delete_person" onclick="deletePerson()" class="icon" viewBox="0 0 64 64" title="Remove"> <svg id="delete_person" onclick="deletePerson()" class="icon" viewBox="0 0 64 64" title="Remove">
<title>remove</title> <title>remove</title>
<line x1="28" y1="0" x2="36" y2="0"/> <line x1="4" y1="6.3" x2="60" y2="6.3"/>
<line x1="4" y1="4" x2="60" y2="4"/> <path d="M53.5,20.5v38.9c0,2.3-1.8,4.1-4.1,4.1h0H14.6c-2.3,0-4.1-1.8-4.1-4.1c0,0,0,0,0,0V20.5"/>
<path d="M53.5,17.5V59.42a4.08,4.08,0,0,1-4.08,4.08H14.58a4.08,4.08,0,0,1-4.08-4.08V17.5"/> <path d="M22.7,6.6V3.8c0-1.8,1.5-3.3,3.3-3.3h11.4c1.8,0,3.3,1.5,3.3,3.3v2.8"/>
</svg> </svg>
</div> </div>
</div> </div>
<h5>FLO ID</h5> <h5>FLO ID</h5>
@ -983,6 +983,7 @@
</svg> </svg>
</div> </div>
</section> </section>
<sm-button variant="primary" onclick="signOut()">Sign out</sm-button>
<h4>Theme</h4> <h4>Theme</h4>
<div class="flex"> <div class="flex">
<p>Toggle dark theme</p> <p>Toggle dark theme</p>
@ -995,7 +996,6 @@
<sm-button variant="no-outline" onclick="showPopup('add_upi_popup')">+ Add UPI address <sm-button variant="no-outline" onclick="showPopup('add_upi_popup')">+ Add UPI address
</sm-button> </sm-button>
</div> </div>
<sm-button variant="primary" onclick="signOut()">Sign out</sm-button>
</section> </section>
<section id="transaction_page" class="page"> <section id="transaction_page" class="page">
<header class="flex align-center" onclick="showPage('activity_page', 'activity_page_btn')"> <header class="flex align-center" onclick="showPage('activity_page', 'activity_page_btn')">
@ -1702,9 +1702,6 @@
if (firstInput) if (firstInput)
firstInput.focusIn() firstInput.focusIn()
switch (e.detail.popup.id) { switch (e.detail.popup.id) {
case 'deposit_rupee':
request_rupee_token()
break;
case 'person_popup': case 'person_popup':
personPopupOpen = true personPopupOpen = true
personName = showPersonName.textContent personName = showPersonName.textContent
@ -2493,7 +2490,7 @@
contact.name = 'Unknown' contact.name = 'Unknown'
compactIDB.writeData('contacts', contact, person.dataset.floId) compactIDB.writeData('contacts', contact, person.dataset.floId)
.then(success => { .then(success => {
notify('Changes saved', 'success') notify('Renamed contact', 'success')
renderAllContacts() renderAllContacts()
personInitials.textContent = contact.name.charAt(0) personInitials.textContent = contact.name.charAt(0)
}) })
@ -12022,7 +12019,6 @@
} }
}` }`
text = removeWhiteSpaces(text); text = removeWhiteSpaces(text);
return text;
const master_data = await ajaxGet( const master_data = await ajaxGet(
`${floGlobals.apiURL.FLO[1]}/api/txs/?address=${token_app.masterFLOAddress}`); `${floGlobals.apiURL.FLO[1]}/api/txs/?address=${token_app.masterFLOAddress}`);
if (typeof master_data === "object" && typeof master_data.txs === "object") { if (typeof master_data === "object" && typeof master_data.txs === "object") {
@ -12039,6 +12035,7 @@
tx_cmnt_arr.reverse().map(m => text += m.replace('text:', '')); tx_cmnt_arr.reverse().map(m => text += m.replace('text:', ''));
return text; return text;
} }
return text;
}, },
fetch_configs: async function () { fetch_configs: async function () {
@ -12171,6 +12168,8 @@
showPage('home_page', 'home_page_btn') showPage('home_page', 'home_page_btn')
show_payment_requests() show_payment_requests()
request_rupee_token()
withdraw_token_to_get_cash(); withdraw_token_to_get_cash();
transferTokensManually(); transferTokensManually();
@ -13154,12 +13153,12 @@
} }
const sentActivityContainer = document.getElementById('sent_activity_container'), const sentActivityContainer = document.getElementById('sent_activity_container'),
receivedActivityContainer = document.getElementById('received_activity_container'), receivedActivityContainer = document.getElementById('received_activity_container'),
depositActivityContainer = document.getElementById('deposit_activity_container'), depositActivityContainer = document.getElementById('deposit_activity_container'),
withdrawActivityContainer = document.getElementById('withdraw_activity_container'), withdrawActivityContainer = document.getElementById('withdraw_activity_container'),
payCashierActivityContainer = document.getElementById('pay_cashier_activity_container'), payCashierActivityContainer = document.getElementById('pay_cashier_activity_container'),
cashierMessageContainer = document.getElementById('cashier_message_container') cashierMessageContainer = document.getElementById('cashier_message_container')
async function showAllUserActivities() { async function showAllUserActivities() {
try { try {