From 034c8dba4ddf6677b27bb650a3db19d2b936059a Mon Sep 17 00:00:00 2001 From: "Michael K. Ocansey" Date: Fri, 6 May 2022 04:10:10 +0300 Subject: [PATCH 1/9] updated component sizes --- src/resources/views/components/centered-content.blade.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/resources/views/components/centered-content.blade.php b/src/resources/views/components/centered-content.blade.php index fc7dee3..c1dc4ff 100644 --- a/src/resources/views/components/centered-content.blade.php +++ b/src/resources/views/components/centered-content.blade.php @@ -1,10 +1,10 @@ @props([ - 'size' => 'default', + 'size' => 'xl', 'width' => [ - 'xxl' => '7xl', - 'default' => '6xl', + 'omg' => '7xl', + 'xxl' => '6xl', 'xl' => '4xl', - 'large' => '3xl', + 'big' => '3xl', 'medium' => '2xl', 'small' => 'lg', 'tiny' => 'md' From 087dd60ffee976638d5ce184506d5f3c021d9806 Mon Sep 17 00:00:00 2001 From: "Michael K. Ocansey" Date: Mon, 9 May 2022 18:46:43 +0300 Subject: [PATCH 2/9] added component/statistic --- .../assets/compiled/css/bladewind-ui.min.css | 12 +++++++ src/resources/assets/compiled/js/dropdown.js | 14 ++++---- src/resources/assets/compiled/js/helpers.js | 32 ++++++++--------- src/resources/views/components/card.blade.php | 18 ++++++++-- .../views/components/dropdown.blade.php | 2 +- src/resources/views/components/stat.blade.php | 35 ------------------- .../views/components/statistic.blade.php | 35 +++++++++++++++++++ 7 files changed, 87 insertions(+), 61 deletions(-) delete mode 100644 src/resources/views/components/stat.blade.php create mode 100644 src/resources/views/components/statistic.blade.php diff --git a/src/resources/assets/compiled/css/bladewind-ui.min.css b/src/resources/assets/compiled/css/bladewind-ui.min.css index d96c744..f406aac 100644 --- a/src/resources/assets/compiled/css/bladewind-ui.min.css +++ b/src/resources/assets/compiled/css/bladewind-ui.min.css @@ -485,6 +485,7 @@ table.with-hover-effect tr:nth-child(even):hover>td:last-child{border-right-widt .z-10{z-index:10} .m-0{margin:0px} .-m-1{margin:-0.25rem} +.-m-8{margin:-2rem} .mx-auto{margin-left:auto;margin-right:auto} .-mx-1{margin-left:-0.25rem;margin-right:-0.25rem} .my-4{margin-top:1rem;margin-bottom:1rem} @@ -535,6 +536,8 @@ table.with-hover-effect tr:nth-child(even):hover>td:last-child{border-right-widt .mr-\[-5px\]{margin-right:-5px} .mr-\[-3px\]{margin-right:-3px} .ml-\[-3px\]{margin-left:-3px} +.-mt-8{margin-top:-2rem} +.\!-mt-8{margin-top:-2rem !important} .block{display:block} .inline-block{display:inline-block} .inline{display:inline} @@ -699,6 +702,7 @@ table.with-hover-effect tr:nth-child(even):hover>td:last-child{border-right-widt .flex-none{flex:none} .flex-grow{flex-grow:1} .grow{flex-grow:1} +.grow-0{flex-grow:0} @-webkit-keyframes spin{ to{transform:rotate(360deg)}} @keyframes spin{ @@ -714,6 +718,7 @@ to{transform:rotate(360deg)}} .justify-center{justify-content:center} .justify-between{justify-content:space-between} .gap-2{gap:0.5rem} +.space-x-4 > :not([hidden]) ~ :not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))} .divide-y > :not([hidden]) ~ :not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))} .overflow-hidden{overflow:hidden} .whitespace-nowrap{white-space:nowrap} @@ -728,6 +733,7 @@ to{transform:rotate(360deg)}} .border-2{border-width:2px} .border-b{border-bottom-width:1px} .border-b-2{border-bottom-width:2px} +.border-t{border-top-width:1px} .border-dashed{border-style:dashed} .\!border-red-400{--tw-border-opacity:1 !important;border-color:rgb(248 113 113 / var(--tw-border-opacity)) !important} .border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity))} @@ -739,6 +745,10 @@ to{transform:rotate(360deg)}} .border-blue-400\/80{border-color:rgb(96 165 250 / 0.8)} .border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235 / var(--tw-border-opacity))} .border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity))} +.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity))} +.border-gray-50{--tw-border-opacity:1;border-color:rgb(249 250 251 / var(--tw-border-opacity))} +.border-gray-50\/70{border-color:rgb(249 250 251 / 0.7)} +.border-gray-100\/30{border-color:rgb(243 244 246 / 0.3)} .bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))} .bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94 / var(--tw-bg-opacity))} .bg-yellow-500{--tw-bg-opacity:1;background-color:rgb(234 179 8 / var(--tw-bg-opacity))} @@ -789,6 +799,8 @@ to{transform:rotate(360deg)}} .bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))} .bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))} .bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60 / var(--tw-bg-opacity))} +.bg-slate-500{--tw-bg-opacity:1;background-color:rgb(100 116 139 / var(--tw-bg-opacity))} +.bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))} .object-cover{-o-object-fit:cover;object-fit:cover} .object-top{-o-object-position:top;object-position:top} .p-3{padding:0.75rem} diff --git a/src/resources/assets/compiled/js/dropdown.js b/src/resources/assets/compiled/js/dropdown.js index 27d1ac6..9afd423 100644 --- a/src/resources/assets/compiled/js/dropdown.js +++ b/src/resources/assets/compiled/js/dropdown.js @@ -15,7 +15,8 @@ dom_els(`.${el_name} .dropdown-items>div.dd-item`).forEach((el) => { let user_function = el.getAttribute('aria-user-function'); if(parent_tag != null) { dom_el(`.bw-${parent_tag}`).value = value; - dom_el(`.${parent_tag}>button>label`).innerHTML = `
${el.innerHTML}
`; + console.log(el.innerHTML); + dom_el(`.${parent_tag}>button>label`).innerHTML = `
${el.innerHTML}
`; el.parentElement.parentElement.classList.toggle('hidden'); if(href !== '' && href !== null && href !== undefined) { @@ -54,10 +55,11 @@ searchDropdown = (value, parent) => { }); } -dom_els('.search-dropdown').forEach((el) => { - el.addEventListener('click', function (e){ - e.stopImmediatePropagation(); +if(dom_els('.search-dropdown')){ + dom_els('.search-dropdown').forEach((el) => { + el.addEventListener('click', function (e){ + e.stopImmediatePropagation(); + }); }); -}); - +} window.onload = () => { selectSelectedValues(); } \ No newline at end of file diff --git a/src/resources/assets/compiled/js/helpers.js b/src/resources/assets/compiled/js/helpers.js index f04b3c6..c12e4c8 100644 --- a/src/resources/assets/compiled/js/helpers.js +++ b/src/resources/assets/compiled/js/helpers.js @@ -11,9 +11,9 @@ var dropdownIsOpen = false; dom_el = (element) => { return (document.querySelector(element) != null) ? document.querySelector(element) : false; } -dom_els = function(element) { return (document.querySelectorAll(element).length>0) ? document.querySelectorAll(element) : false; } +dom_els = (element) => { return (document.querySelectorAll(element).length>0) ? document.querySelectorAll(element) : false; } -validateForm = function(element) { +validateForm = (element) => { let has_error = 0; let BreakException = {}; try{ @@ -33,7 +33,7 @@ validateForm = function(element) { return has_error === 0; } -isNumberKey = function(evt) { // usage: onkeypress="return isNumberKey(event)" +isNumberKey = (evt) => { // usage: onkeypress="return isNumberKey(event)" var charCode = (evt.which) ? evt.which : evt.keyCode if (charCode > 31 && (charCode != 46 && (charCode < 48 || charCode > 57))) { return false; @@ -45,7 +45,7 @@ callUserFunction = (func) => { if (func !== '' && func !== undefined) eval(func); }; -serialize = function(form){ +serialize = (form) => { let data = new FormData(dom_el(form)); let obj = {}; for (let [key, value] of data) { @@ -62,7 +62,7 @@ serialize = function(form){ } return obj; } -showMessage = function(message, type, dismissable=true) { +showMessage = (message, type, dismissable=true) => { clearTimeout(notification_timeout); let notification_bar = dom_el('.bw-notification'); let message_container = dom_el('.bw-notification .message-container'); @@ -95,7 +95,7 @@ showMessage = function(message, type, dismissable=true) { } } -displayFormErrors = function(errors){ +displayFormErrors = (errors) => { if( errors) { let number_of_errors = Object.keys(errors).length; if ( number_of_errors > 0 ) { @@ -105,14 +105,14 @@ displayFormErrors = function(errors){ } } -stringContains = function(str, keyword) { +stringContains = (str, keyword) => { if(typeof(str) !== 'string') return false; return (str.indexOf(keyword) != -1); } -doNothing = function() { } +doNothing = () => { } -changeCssForDomArray = function(els, css, mode='add') { +changeCssForDomArray = (els, css, mode='add') => { if(dom_els(els).length > 0){ dom_els(els).forEach((el) => { changeCss(el, css, mode, true); @@ -120,7 +120,7 @@ changeCssForDomArray = function(els, css, mode='add') { } } -changeCss = function(el, css, mode='add', elIsDomObject=false) { +changeCss = (el, css, mode='add', elIsDomObject=false) => { // css can be comma separated // if elIsDomObject dont run it through dom_el if( (! elIsDomObject && dom_el(el) != null) || (elIsDomObject && el != null)){ @@ -141,17 +141,17 @@ changeCss = function(el, css, mode='add', elIsDomObject=false) { } } -showModal = function(el) { unhide(`.bw-${el}-modal`); } +showModal = (el) => { unhide(`.bw-${el}-modal`); } -hideModal = function(el) { hide(`.bw-${el}-modal`); } +hideModal = (el) => { hide(`.bw-${el}-modal`); } -hide = function(el, elIsDomObject=false) { +hide = (el, elIsDomObject=false) => { if( (! elIsDomObject && dom_el(el) != null) || (elIsDomObject && el != null)){ changeCss(el, 'hidden', 'add', elIsDomObject); } } -unhide = function(el, elIsDomObject=false) { +unhide = (el, elIsDomObject=false) => { if( (! elIsDomObject && dom_el(el) != null) || (elIsDomObject && el != null)){ changeCss(el, 'hidden', 'remove', elIsDomObject); } @@ -193,10 +193,10 @@ animateCSS = (element, animation) => } } - removeCommas = function(amount) { + removeCommas = (amount) => { return amount.toString().replace(/,/g, ''); } - toCurrency = function(amount) { + toCurrency = (amount) => { return ((parseFloat(amount).toFixed(2))*1).toLocaleString(); } \ No newline at end of file diff --git a/src/resources/views/components/card.blade.php b/src/resources/views/components/card.blade.php index 705d795..aafd3bc 100644 --- a/src/resources/views/components/card.blade.php +++ b/src/resources/views/components/card.blade.php @@ -3,11 +3,23 @@ 'css' => '', 'has_shadow' => 'true', 'reduce_padding' => 'false', + 'header' => '', + 'footer' => '', ]) -
- @if($title !== '')
{{ $title}}
@endif -
+
+ @if($header != '') +
+ {{$header}} +
+ @endif + @if($title !== '' && $header == '')
{{ $title}}
@endif +
{{ $slot }}
+ @if($footer != '') +
+ {{$footer}} +
+ @endif
\ No newline at end of file diff --git a/src/resources/views/components/dropdown.blade.php b/src/resources/views/components/dropdown.blade.php index 944639b..cd89a0b 100644 --- a/src/resources/views/components/dropdown.blade.php +++ b/src/resources/views/components/dropdown.blade.php @@ -104,7 +104,7 @@ @endphp
-