Plugin Directory

Changeset 3698061


Ignore:
Timestamp:
09/16/2026 07:20:55 AM (2 months ago)
Author:
vhamed32
Message:

Release version 1.3.5

Location:
technopay-payment-gateway-for-woocommerce/trunk
Files:
1 added
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • technopay-payment-gateway-for-woocommerce/trunk/assets/css/admin-orders.css

    r3698020 r3698061  
    284284
    285285.tpfw-orders-field input,
    286 .tpfw-orders-field select {
     286.tpfw-orders-field select,
     287.tpfw-orders-field .tpfw-dropdown__toggle {
    287288    width: 100%;
    288289    min-height: 46px;
    … …  
    303304
    304305.tpfw-orders-field input:focus,
    305 .tpfw-orders-field select:focus {
     306.tpfw-orders-field select:focus,
     307.tpfw-orders-field .tpfw-dropdown__toggle:focus-visible,
     308.tpfw-orders-field .tpfw-dropdown__toggle.is-open {
    306309    border-color: var(--tpfw-cyan);
    307310    box-shadow: 0 0 0 1px var(--tpfw-cyan);
    308311    outline: 0;
     312}
     313
     314.tpfw-orders-field .tpfw-dropdown__toggle {
     315    display: flex;
     316    min-height: 46px;
     317    align-items: center;
     318    justify-content: space-between;
     319    cursor: pointer;
     320}
     321
     322.tpfw-orders-field .tpfw-dropdown__toggle .tpfw-dropdown__chevron {
     323    margin: 0 0 0 4px;
     324}
     325
     326.tpfw-orders-field .tpfw-dropdown__toggle.is-open .tpfw-dropdown__chevron {
     327    transform: translateY(2px) rotate(225deg);
    309328}
    310329
    … …  
    767786}
    768787
    769 .tpfw-refund-modal__reason-field {
    770     position: relative;
    771 }
    772 
    773 .tpfw-refund-modal__select {
     788.tpfw-refund-modal__reason-field > span {
     789    flex: 0 0 auto;
     790}
     791
     792.tpfw-dropdown__native {
     793    display: none !important;
     794}
     795
     796.tpfw-dropdown__toggle {
    774797    display: flex;
    775798    flex: 1 1 auto;
    776799    min-width: 0;
    777 }
    778 
    779 .tpfw-refund-modal__select .ss-content.ss-relative {
    780     position: absolute;
    781     top: 100%;
    782     right: -1px;
    783     left: -1px;
    784     width: auto;
    785     height: auto;
    786     margin: 4px 0 0 !important;
    787 }
     800    min-height: 58px;
     801    margin: 0;
     802    padding: 0;
     803    border: 0;
     804    align-items: center;
     805    justify-content: space-between;
     806    gap: 12px;
     807    background: transparent;
     808    color: #28323e;
     809    font: inherit;
     810    font-size: 14px;
     811    text-align: right;
     812    cursor: pointer;
     813}
     814
     815.tpfw-dropdown__toggle:focus {
     816    outline: 0;
     817    box-shadow: none;
     818}
     819
     820.tpfw-dropdown__toggle:focus-visible {
     821    outline: 2px solid var(--tpfw-cyan);
     822    outline-offset: 4px;
     823    border-radius: 4px;
     824}
     825
     826.tpfw-dropdown__value {
     827    flex: 1 1 auto;
     828    min-width: 0;
     829    overflow: hidden;
     830    text-overflow: ellipsis;
     831    white-space: nowrap;
     832}
     833
     834.tpfw-dropdown__chevron {
     835    flex: 0 0 auto;
     836    width: 9px;
     837    height: 9px;
     838    margin: 0 6px 0 22px;
     839    border-right: 2px solid currentColor;
     840    border-bottom: 2px solid currentColor;
     841    transform: translateY(-3px) rotate(45deg);
     842    transition: transform 0.2s ease;
     843}
     844
     845.tpfw-refund-modal__reason-field.is-open .tpfw-dropdown__chevron {
     846    transform: translateY(2px) rotate(225deg);
     847}
     848
     849.tpfw-dropdown__menu {
     850    position: fixed;
     851    z-index: 200001;
     852    box-sizing: border-box;
     853    border: 1px solid #cfd4d8;
     854    border-radius: 8px;
     855    background: #fff;
     856    box-shadow: 0 8px 24px rgba(32, 45, 57, 0.12);
     857    direction: rtl;
     858    font-family: 'YekanBakh', Tahoma, Arial, sans-serif;
     859    overflow: hidden;
     860    opacity: 0;
     861    transition: opacity 0.15s ease;
     862}
     863
     864.tpfw-dropdown__menu.is-visible {
     865    opacity: 1;
     866}
     867
     868.tpfw-dropdown__menu[hidden] {
     869    display: none;
     870}
     871
     872.tpfw-dropdown__list {
     873    max-height: 176px;
     874    overflow-y: auto;
     875}
     876
     877@supports not selector(::-webkit-scrollbar) {
     878    .tpfw-dropdown__list {
     879        scrollbar-width: thin;
     880        scrollbar-color: #b9c0c6 transparent;
     881    }
     882}
     883
     884.tpfw-dropdown__list::-webkit-scrollbar {
     885    width: 8px;
     886}
     887
     888.tpfw-dropdown__list::-webkit-scrollbar-track {
     889    background: transparent;
     890}
     891
     892.tpfw-dropdown__list::-webkit-scrollbar-thumb {
     893    border: 2px solid #fff;
     894    border-radius: 8px;
     895    background: #b9c0c6;
     896}
     897
     898.tpfw-dropdown__option {
     899    display: flex;
     900    min-height: 44px;
     901    padding: 0 14px;
     902    align-items: center;
     903    color: #27313c;
     904    font-size: 13px;
     905    cursor: pointer;
     906    user-select: none;
     907}
     908
     909.tpfw-dropdown__option.is-highlighted {
     910    background: #eaf9fb;
     911    color: #078b9d;
     912}
     913
     914.tpfw-dropdown__option.is-selected {
     915    background: #eaf9fb;
     916    color: #078b9d;
     917    font-weight: 600;
     918}
     919
    788920
    789921.tpfw-refund-modal__field input,
    … …  
    9201052}
    9211053
    922 .tpfw-slim.ss-main,
    923 .tpfw-orders-page .ss-main {
    924     min-height: 46px;
    925     padding: 0 14px;
    926     border: 1px solid #cfd4d8;
    927     border-radius: 8px;
    928     background-color: #fff;
    929     color: var(--tpfw-ink);
    930     font-size: 13px;
    931     direction: rtl;
    932     box-shadow: none;
    933 }
    934 
    935 .tpfw-slim.ss-main:focus,
    936 .tpfw-orders-page .ss-main:focus {
    937     border-color: var(--tpfw-cyan);
    938     box-shadow: 0 0 0 1px var(--tpfw-cyan);
    939     outline: 0;
    940 }
    941 
    942 .tpfw-slim.ss-main.ss-open-below,
    943 .tpfw-slim.ss-main.ss-open-above,
    944 .tpfw-orders-page .ss-main.ss-open-below,
    945 .tpfw-orders-page .ss-main.ss-open-above {
    946     border-color: var(--tpfw-cyan);
    947     box-shadow: 0 0 0 1px var(--tpfw-cyan);
    948 }
    949 
    950 .tpfw-slim.ss-content,
    951 .tpfw-orders-page .ss-content {
    952     font-family: 'YekanBakh', Tahoma, Arial, sans-serif !important;
    953     margin-top: -24px !important;
    954     border: 1px solid #cfd4d8;
    955     border-radius: 8px;
    956     box-shadow: 0 8px 24px rgba(32, 45, 57, 0.12);
    957     direction: rtl;
    958     overflow: hidden;
    959     z-index: 200001 !important;
    960 }
    961 
    962 .tpfw-slim.ss-content .ss-list .ss-option,
    963 .tpfw-orders-page .ss-content .ss-list .ss-option {
    964     padding: 10px 14px;
    965     font-size: 13px;
    966     color: var(--tpfw-ink);
    967     font-family: 'YekanBakh', Tahoma, Arial, sans-serif !important;
    968 }
    969 
    970 .tpfw-slim.ss-content .ss-list .ss-option:hover,
    971 .tpfw-slim.ss-content .ss-list .ss-option.ss-highlighted,
    972 .tpfw-orders-page .ss-content .ss-list .ss-option:hover,
    973 .tpfw-orders-page .ss-content .ss-list .ss-option.ss-highlighted {
    974     background: #eaf9fb;
    975     color: var(--tpfw-cyan-dark);
    976 }
    977 
    978 .tpfw-slim.ss-content .ss-list .ss-option.ss-selected,
    979 .tpfw-orders-page .ss-content .ss-list .ss-option.ss-selected {
    980     background: #eaf9fb;
    981     color: var(--tpfw-cyan-dark);
    982     font-weight: 600;
    983 }
    984 
    985 .tpfw-slim.ss-content .ss-list .ss-option.ss-disabled,
    986 .tpfw-orders-page .ss-content .ss-list .ss-option.ss-disabled {
    987     color: var(--tpfw-muted);
    988     background: transparent;
    989 }
    990 
    991 .tpfw-refund-modal__panel .ss-main,
    992 .tpfw-refund-modal__panel .tpfw-slim.ss-main {
    993     min-height: 58px;
    994     padding: 0 20px;
    995     border: 0;
    996     border-radius: 0;
    997     background: transparent;
    998     flex: 1 1 auto;
    999     font-size: 14px;
    1000     box-shadow: none !important;
    1001 }
    1002 
    1003 .tpfw-refund-modal__panel .ss-main:focus,
    1004 .tpfw-refund-modal__panel .ss-main.ss-open-below,
    1005 .tpfw-refund-modal__panel .ss-main.ss-open-above,
    1006 .tpfw-refund-modal__panel .tpfw-slim.ss-main:focus,
    1007 .tpfw-refund-modal__panel .tpfw-slim.ss-main.ss-open-below,
    1008 .tpfw-refund-modal__panel .tpfw-slim.ss-main.ss-open-above {
    1009     border: 0;
    1010     box-shadow: none !important;
    1011     outline: 0;
    1012 }
    1013 
    1014 .ss-content {
    1015     z-index: 200001 !important;
    1016 }
    1017 
    10181054@media screen and (max-width: 1280px) {
    10191055    .tpfw-orders-filters {
  • technopay-payment-gateway-for-woocommerce/trunk/assets/js/admin-orders.js

    r3698020 r3698061  
    1818    var detailsReasonsList = detailsModal ? detailsModal.querySelector('[data-details-reasons-list]') : null;
    1919
    20     var reasonSlim = null;
    21     var reasonSlimInitialized = false;
     20    var reasonDropdown = null;
    2221
    2322    function initFilterSelects() {
    2423        document.querySelectorAll('.tpfw-orders-filters select').forEach(function (select) {
    25             new SlimSelect({
    26                 select: select,
    27                 settings: {
    28                     showSearch: false,
    29                     openPosition: 'down',
    30                     contentLocation: document.querySelector('.tpfw-orders-page'),
    31                     contentPosition: 'absolute',
    32                     class: 'tpfw-slim',
    33                 },
    34             });
    35         });
    36     }
    37 
    38     function initReasonSlim() {
    39         if (reasonSlimInitialized || !reasonSelect) {
    40             return;
    41         }
    42 
    43         reasonSlimInitialized = true;
    44 
    45         reasonSlim = new SlimSelect({
    46             select: reasonSelect,
    47             settings: {
    48                 showSearch: false,
    49                 openPosition: 'down',
    50                 contentLocation: reasonSelect.parentElement,
    51                 contentPosition: 'relative',
    52                 class: 'tpfw-slim',
    53                 placeholderText: 'انتخاب کنید...',
    54             },
    55             events: {
    56                 afterChange: function (selected) {
    57                     var needsDescription = selected.length && selected[0].data['needsDescription'] === '1';
    58 
    59                     descriptionField.hidden = !needsDescription;
    60                     descriptionInput.required = needsDescription;
    61 
    62                     if (!needsDescription) {
    63                         descriptionInput.value = '';
    64                         descriptionInput.setCustomValidity('');
    65                     }
    66                 },
    67             },
     24            new TpfwDropdown(select);
     25        });
     26    }
     27
     28    function initReasonDropdown() {
     29        if (reasonDropdown || !reasonSelect) {
     30            return;
     31        }
     32
     33        reasonDropdown = new TpfwDropdown(reasonSelect, {
     34            anchor: reasonSelect.closest('.tpfw-refund-modal__field'),
     35            placeholder: true,
     36        });
     37
     38        reasonSelect.addEventListener('change', function () {
     39            var option = reasonSelect.options[reasonSelect.selectedIndex];
     40            var needsDescription = !!option && option.getAttribute('data-needs-description') === '1';
     41
     42            descriptionField.hidden = !needsDescription;
     43            descriptionInput.required = needsDescription;
     44
     45            if (!needsDescription) {
     46                descriptionInput.value = '';
     47                descriptionInput.setCustomValidity('');
     48            }
    6849        });
    6950    }
    … …  
    146127
    147128    function prepareRefundModal(trigger) {
    148         initReasonSlim();
     129        initReasonDropdown();
    149130
    150131        refundForm.reset();
    151 
    152         if (reasonSlim) {
    153             reasonSlim.setSelected('');
    154         }
     132        reasonDropdown.sync();
    155133
    156134        trackNumberInput.value = trigger.getAttribute('data-track-number') || '';
    … …  
    236214        if (!activeModal || activeModal.hidden) {
    237215            return;
     216        }
     217
     218        if (reasonDropdown) {
     219            reasonDropdown.close();
    238220        }
    239221
  • technopay-payment-gateway-for-woocommerce/trunk/includes/class-tpfw-admin-orders-page.php

    r3685297 r3698061  
    5151                $style_path     = TPFW_PLUGIN_PATH . 'assets/css/admin-orders.css';
    5252                $script_path    = TPFW_PLUGIN_PATH . 'assets/js/admin-orders.js';
    53                 $slimselect_js  = TPFW_PLUGIN_PATH . 'assets/js/slimselect.min.js';
    54                 $slimselect_css = TPFW_PLUGIN_PATH . 'assets/css/slimselect.css';
    55 
    56                 wp_enqueue_style(
    57                         'tpfw-slimselect',
    58                         TPFW_PLUGIN_URL . 'assets/css/slimselect.css',
    59                         array(),
    60                         (string) filemtime( $slimselect_css )
    61                 );
     53                $dropdown_path  = TPFW_PLUGIN_PATH . 'assets/js/dropdown.js';
    6254
    6355                wp_enqueue_style(
    6456                        'tpfw-admin-orders',
    6557                        TPFW_PLUGIN_URL . 'assets/css/admin-orders.css',
    66                         array( 'dashicons', 'tpfw-slimselect' ),
     58                        array( 'dashicons' ),
    6759                        (string) filemtime( $style_path )
    6860                );
    6961
    7062                wp_enqueue_script(
    71                         'tpfw-slimselect',
    72                         TPFW_PLUGIN_URL . 'assets/js/slimselect.min.js',
     63                        'tpfw-dropdown',
     64                        TPFW_PLUGIN_URL . 'assets/js/dropdown.js',
    7365                        array(),
    74                         (string) filemtime( $slimselect_js ),
     66                        (string) filemtime( $dropdown_path ),
    7567                        true
    7668                );
    … …  
    7971                        'tpfw-admin-orders',
    8072                        TPFW_PLUGIN_URL . 'assets/js/admin-orders.js',
    81                         array( 'tpfw-slimselect' ),
     73                        array( 'tpfw-dropdown' ),
    8274                        (string) filemtime( $script_path ),
    8375                        true
    … …  
    430422
    431423        private function reason_requires_description( $reason ) {
    432                 if ( isset( $reason['group'] ) && 'other_issues' === $reason['group'] ) {
    433                         return true;
    434                 }
    435 
    436424                return '' === $this->formatter->get_scalar_value( $reason, 'text' );
    437425        }
  • technopay-payment-gateway-for-woocommerce/trunk/readme.txt

    r3698020 r3698061  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.3.4
     7Stable tag: 1.3.5
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    5656== Changelog ==
    5757
     58= 1.3.5 =
     59* Fix: Description field is shown only for refund reasons without a predefined text
     60
    5861= 1.3.4 =
    59 * Fix: Refund reason dropdown is now anchored inside its field and no longer drifts on scroll
     62* Update: Replaced the third-party select library with a lightweight custom dropdown for filters and the refund reason field
     63* Fix: Refund reason dropdown always opens attached to its field, in front of the modal, with a visible scrollbar
    6064
    6165= 1.3.3 =
  • technopay-payment-gateway-for-woocommerce/trunk/technopay-woocommerce.php

    r3698020 r3698061  
    33 * Plugin Name: تکنوپی برای ووکامرس | Technopay
    44 * Description: افزونه درگاه پرداخت اعتباری امن برای ووکامرس توسط تکنوپی
    5  * Version: 1.3.4
     5 * Version: 1.3.5
    66 * Author: حامد نجاری
    77 * Author URI: https://www.linkedin.com/in/hamed-najari
    … …  
    2121if (!defined('ABSPATH')) exit;
    2222
    23 define('TPFW_VERSION', '1.3.4');
     23define('TPFW_VERSION', '1.3.5');
    2424define('TPFW_PLUGIN_FILE', __FILE__);
    2525define('TPFW_PLUGIN_PATH', plugin_dir_path(__FILE__));
  • technopay-payment-gateway-for-woocommerce/trunk/templates/admin-orders-page.php

    r3698020 r3698061  
    200200                                <label class="tpfw-refund-modal__field tpfw-refund-modal__reason-field">
    201201                                        <span>دلیل استرداد:</span>
    202                                         <span class="tpfw-refund-modal__select">
    203                                                 <select name="refund_reason" class="tpfw-refund-modal__reason" aria-label="دلیل استرداد" required>
    204                                                         <option value="">انتخاب کنید...</option>
    205                                                         <?php foreach ( $view['reasons'] as $tpfw_reason ) : ?>
    206                                                                 <option value="<?php echo esc_attr( $tpfw_reason['code'] ); ?>" data-needs-description="<?php echo $tpfw_reason['requires_description'] ? '1' : '0'; ?>" title="<?php echo esc_attr( $tpfw_reason['text'] ); ?>"><?php echo esc_html( $tpfw_reason['reason'] ); ?></option>
    207                                                         <?php endforeach; ?>
    208                                                 </select>
    209                                         </span>
     202                                        <select name="refund_reason" class="tpfw-refund-modal__reason" aria-label="دلیل استرداد" required>
     203                                                <option value="">انتخاب کنید...</option>
     204                                                <?php foreach ( $view['reasons'] as $tpfw_reason ) : ?>
     205                                                        <option value="<?php echo esc_attr( $tpfw_reason['code'] ); ?>" data-needs-description="<?php echo $tpfw_reason['requires_description'] ? '1' : '0'; ?>" title="<?php echo esc_attr( $tpfw_reason['text'] ); ?>"><?php echo esc_html( $tpfw_reason['reason'] ); ?></option>
     206                                                <?php endforeach; ?>
     207                                        </select>
    210208                                </label>
    211209                                <label class="tpfw-refund-modal__field tpfw-refund-modal__custom-reason" hidden>
Note: See TracChangeset for help on using the changeset viewer.