kaui 3.0.9 → 4.0.0
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.
- checksums.yaml +4 -4
- data/app/assets/images/kaui/account/authorize.svg +4 -0
- data/app/assets/images/kaui/account/credit.svg +4 -0
- data/app/assets/images/kaui/account/down-arrow.svg +3 -0
- data/app/assets/images/kaui/account/edit.svg +4 -0
- data/app/assets/images/kaui/account/pay-all.svg +5 -0
- data/app/assets/images/kaui/account/plus.svg +3 -0
- data/app/assets/images/kaui/account/purchase.svg +5 -0
- data/app/assets/images/kaui/account/refresh.svg +5 -0
- data/app/assets/images/kaui/arrow.svg +3 -0
- data/app/assets/images/kaui/card.svg +5 -0
- data/app/assets/images/kaui/copy.svg +12 -0
- data/app/assets/images/kaui/dashboard/aviate.svg +6 -0
- data/app/assets/images/kaui/dashboard/custom-field.svg +5 -0
- data/app/assets/images/kaui/dashboard/kaui-doc-img.png +0 -0
- data/app/assets/images/kaui/dashboard/plugins.svg +7 -0
- data/app/assets/images/kaui/dashboard/tags.svg +4 -0
- data/app/assets/images/kaui/dashboard/users.svg +6 -0
- data/app/assets/images/kaui/delete.svg +6 -0
- data/app/assets/images/kaui/dots.svg +5 -0
- data/app/assets/images/kaui/download-csv.svg +5 -0
- data/app/assets/images/kaui/download.svg +4 -0
- data/app/assets/images/kaui/eye-off.svg +9 -0
- data/app/assets/images/kaui/eye.svg +7 -0
- data/app/assets/images/kaui/file-upload.svg +34 -0
- data/app/assets/images/kaui/generate.svg +5 -0
- data/app/assets/images/kaui/header/account.svg +4 -0
- data/app/assets/images/kaui/header/cog_icon.svg +4 -0
- data/app/assets/images/kaui/header/invoice.svg +5 -0
- data/app/assets/images/kaui/header/payment.svg +5 -0
- data/app/assets/images/kaui/header/search_icon.svg +4 -0
- data/app/assets/images/kaui/header/subscription.svg +6 -0
- data/app/assets/images/kaui/logout.svg +4 -0
- data/app/assets/images/kaui/modal/close.svg +3 -0
- data/app/assets/images/kaui/modal/plus.svg +3 -0
- data/app/assets/images/kaui/modal/red-close.svg +10 -0
- data/app/assets/images/kaui/modal/search.svg +4 -0
- data/app/assets/images/kaui/payment/payment.svg +4 -0
- data/app/assets/images/kaui/payment/refund.svg +4 -0
- data/app/assets/images/kaui/plus.svg +3 -0
- data/app/assets/images/kaui/search.svg +4 -0
- data/app/assets/images/kaui/setting/account.svg +10 -0
- data/app/assets/images/kaui/setting/analytics.svg +7 -0
- data/app/assets/images/kaui/setting/custom-field.svg +5 -0
- data/app/assets/images/kaui/setting/e-notifications.svg +6 -0
- data/app/assets/images/kaui/setting/plugins.svg +7 -0
- data/app/assets/images/kaui/setting/plus.svg +3 -0
- data/app/assets/images/kaui/setting/reset.svg +4 -0
- data/app/assets/images/kaui/setting/tag-definitions.svg +5 -0
- data/app/assets/images/kaui/setting/tags.svg +4 -0
- data/app/assets/images/kaui/setting/tenants.svg +6 -0
- data/app/assets/images/kaui/setting/users.svg +6 -0
- data/app/assets/images/kaui/setting.svg +4 -0
- data/app/assets/images/kaui/sidebar/account.svg +4 -0
- data/app/assets/images/kaui/sidebar/audit.svg +5 -0
- data/app/assets/images/kaui/sidebar/custom-fields.svg +5 -0
- data/app/assets/images/kaui/sidebar/invoices.svg +5 -0
- data/app/assets/images/kaui/sidebar/payments.svg +5 -0
- data/app/assets/images/kaui/sidebar/queues.svg +5 -0
- data/app/assets/images/kaui/sidebar/subscriptions.svg +6 -0
- data/app/assets/images/kaui/sidebar/tags.svg +5 -0
- data/app/assets/images/kaui/sidebar/timeline.svg +5 -0
- data/app/assets/images/kaui/sign_in_background.svg +57 -0
- data/app/assets/images/kaui/sort-down.svg +3 -0
- data/app/assets/images/kaui/sort-up.svg +3 -0
- data/app/assets/images/kaui/subscription/add-on.svg +7 -0
- data/app/assets/images/kaui/subscription/cancel.svg +6 -0
- data/app/assets/images/kaui/subscription/change.svg +6 -0
- data/app/assets/images/kaui/subscription/date.svg +6 -0
- data/app/assets/images/kaui/subscription/pause.svg +4 -0
- data/app/assets/images/kaui/timeline/authorize.svg +5 -0
- data/app/assets/images/kaui/timeline/capture.svg +5 -0
- data/app/assets/images/kaui/timeline/chargeback.svg +3 -0
- data/app/assets/images/kaui/timeline/credit.svg +6 -0
- data/app/assets/images/kaui/timeline/invoice.svg +5 -0
- data/app/assets/images/kaui/timeline/purchase.svg +5 -0
- data/app/assets/images/kaui/timeline/refund.svg +4 -0
- data/app/assets/images/kaui/timeline/void.svg +4 -0
- data/app/assets/images/kaui/view-doc.svg +6 -0
- data/app/assets/images/kaui/warning.png +0 -0
- data/app/assets/javascripts/application.js +2 -2
- data/app/assets/javascripts/kaui/kaui_override.js +232 -0
- data/app/assets/javascripts/kaui/multi_functions_bar_utils.js +125 -24
- data/app/assets/stylesheets/application.css +13 -1
- data/app/assets/stylesheets/kaui/account.css +2028 -14
- data/app/assets/stylesheets/kaui/account_timeline.css +183 -0
- data/app/assets/stylesheets/kaui/admin_allowed_users.css +260 -0
- data/app/assets/stylesheets/kaui/audit.css +26 -16
- data/app/assets/stylesheets/kaui/audit_logs.css +443 -0
- data/app/assets/stylesheets/kaui/auth_pages.css +72 -0
- data/app/assets/stylesheets/kaui/breadcrumb.css +38 -0
- data/app/assets/stylesheets/kaui/chargebacks.css +118 -0
- data/app/assets/stylesheets/kaui/clock.css +103 -0
- data/app/assets/stylesheets/kaui/common.css +1744 -401
- data/app/assets/stylesheets/kaui/custom_fields.css +546 -0
- data/app/assets/stylesheets/kaui/dashboard.css +26 -0
- data/app/assets/stylesheets/kaui/datatable.css +114 -56
- data/app/assets/stylesheets/kaui/header.css +221 -114
- data/app/assets/stylesheets/kaui/home.css +89 -62
- data/app/assets/stylesheets/kaui/invoice.css +1061 -27
- data/app/assets/stylesheets/kaui/kaui.css +217 -145
- data/app/assets/stylesheets/kaui/overdue.css +5 -3
- data/app/assets/stylesheets/kaui/payment.css +1102 -13
- data/app/assets/stylesheets/kaui/queues.css +269 -0
- data/app/assets/stylesheets/kaui/refunds.css +185 -0
- data/app/assets/stylesheets/kaui/role_definitions.css +111 -0
- data/app/assets/stylesheets/kaui/sidebar.css +122 -0
- data/app/assets/stylesheets/kaui/subscription.css +677 -0
- data/app/assets/stylesheets/kaui/tag_definitions.css +524 -0
- data/app/assets/stylesheets/kaui/tags.css +592 -121
- data/app/assets/stylesheets/kaui/tenants.css +1478 -0
- data/app/assets/stylesheets/kaui/tooltip.css +9 -5
- data/app/assets/stylesheets/kaui/wallets.css +121 -0
- data/app/controllers/kaui/accounts_controller.rb +3 -2
- data/app/controllers/kaui/admin_tenants_controller.rb +33 -0
- data/app/controllers/kaui/custom_fields_controller.rb +1 -1
- data/app/controllers/kaui/engine_controller.rb +1 -2
- data/app/controllers/kaui/engine_controller_util.rb +5 -7
- data/app/controllers/kaui/home_controller.rb +24 -17
- data/app/controllers/kaui/invoices_controller.rb +4 -15
- data/app/controllers/kaui/payments_controller.rb +1 -1
- data/app/controllers/kaui/sessions_controller.rb +1 -0
- data/app/controllers/kaui/tag_definitions_controller.rb +1 -0
- data/app/helpers/kaui/account_helper.rb +13 -0
- data/app/helpers/kaui/plugin_helper.rb +27 -0
- data/app/views/kaui/account_custom_fields/index.html.erb +95 -29
- data/app/views/kaui/account_emails/_account_emails_table.html.erb +13 -3
- data/app/views/kaui/account_emails/_form.html.erb +23 -6
- data/app/views/kaui/account_emails/new.html.erb +12 -6
- data/app/views/kaui/account_tags/_form_bar.html.erb +10 -1
- data/app/views/kaui/account_tags/index.html.erb +103 -24
- data/app/views/kaui/account_timelines/_multi_functions_bar.html.erb +302 -69
- data/app/views/kaui/account_timelines/show.html.erb +360 -254
- data/app/views/kaui/accounts/_account_details.html.erb +165 -0
- data/app/views/kaui/accounts/_account_filterbar.html.erb +70 -80
- data/app/views/kaui/accounts/_add_parent.html.erb +26 -0
- data/app/views/kaui/accounts/_billing_details.html.erb +196 -0
- data/app/views/kaui/accounts/_close_account_modal.html.erb +62 -40
- data/app/views/kaui/accounts/_form_account.html.erb +157 -0
- data/app/views/kaui/accounts/_functions_bar.html.erb +606 -0
- data/app/views/kaui/accounts/_link_parent_modal.html.erb +1 -1
- data/app/views/kaui/accounts/_link_parent_to_modal.html.erb +62 -0
- data/app/views/kaui/accounts/_multi_functions_bar.html.erb +67 -28
- data/app/views/kaui/accounts/_payment_gateways.html.erb +43 -0
- data/app/views/kaui/accounts/_personal_details.html.erb +67 -0
- data/app/views/kaui/accounts/edit.html.erb +15 -9
- data/app/views/kaui/accounts/index.html.erb +77 -27
- data/app/views/kaui/accounts/new.html.erb +14 -8
- data/app/views/kaui/accounts/show.html.erb +17 -11
- data/app/views/kaui/admin/index.html.erb +44 -19
- data/app/views/kaui/admin_allowed_users/_form.html.erb +123 -31
- data/app/views/kaui/admin_allowed_users/edit.html.erb +15 -9
- data/app/views/kaui/admin_allowed_users/index.html.erb +150 -30
- data/app/views/kaui/admin_allowed_users/new.html.erb +14 -8
- data/app/views/kaui/admin_allowed_users/show.html.erb +137 -32
- data/app/views/kaui/admin_tenants/_add_allowed_user_modal.html.erb +42 -15
- data/app/views/kaui/admin_tenants/_clock.html.erb +72 -0
- data/app/views/kaui/admin_tenants/_form.html.erb +32 -20
- data/app/views/kaui/admin_tenants/_form_catalog_translation.erb +21 -8
- data/app/views/kaui/admin_tenants/_form_invoice_template.erb +25 -9
- data/app/views/kaui/admin_tenants/_form_invoice_translation.erb +36 -20
- data/app/views/kaui/admin_tenants/_form_plugin_config.erb +16 -20
- data/app/views/kaui/admin_tenants/_show_catalog.erb +13 -6
- data/app/views/kaui/admin_tenants/_show_catalog_simple.erb +95 -46
- data/app/views/kaui/admin_tenants/_show_catalog_xml.erb +62 -37
- data/app/views/kaui/admin_tenants/_show_overdue.erb +91 -75
- data/app/views/kaui/admin_tenants/_tenant_details.html.erb +106 -17
- data/app/views/kaui/admin_tenants/_tenants_table.html.erb +67 -6
- data/app/views/kaui/admin_tenants/_useful_links.html.erb +21 -16
- data/app/views/kaui/admin_tenants/index.html.erb +35 -11
- data/app/views/kaui/admin_tenants/index.js.erb +3 -0
- data/app/views/kaui/admin_tenants/new.html.erb +19 -13
- data/app/views/kaui/admin_tenants/new_catalog.html.erb +230 -98
- data/app/views/kaui/admin_tenants/new_overdue_config.html.erb +152 -80
- data/app/views/kaui/admin_tenants/new_plan_currency.html.erb +44 -30
- data/app/views/kaui/admin_tenants/show.html.erb +211 -78
- data/app/views/kaui/admin_tenants/show.js.erb +3 -0
- data/app/views/kaui/audit_logs/_multi_functions_bar.html.erb +298 -101
- data/app/views/kaui/audit_logs/index.html.erb +137 -38
- data/app/views/kaui/bundle_tags/_form_bar.html.erb +11 -4
- data/app/views/kaui/bundles/_bundle_details.html.erb +24 -12
- data/app/views/kaui/bundles/index.html.erb +79 -104
- data/app/views/kaui/bundles/pause_resume.html.erb +73 -38
- data/app/views/kaui/chargebacks/_form.html.erb +35 -18
- data/app/views/kaui/chargebacks/new.html.erb +16 -9
- data/app/views/kaui/charges/_form.html.erb +54 -42
- data/app/views/kaui/charges/new.html.erb +15 -8
- data/app/views/kaui/components/breadcrumb/_breadcrumb.html.erb +146 -0
- data/app/views/kaui/components/button/_button.html.erb +16 -0
- data/app/views/kaui/components/dashboard/_card.html.erb +15 -0
- data/app/views/kaui/components/dashboard/_setting.html.erb +15 -0
- data/app/views/kaui/components/form_input/_form_input.html.erb +4 -0
- data/app/views/kaui/components/form_password/_form_password.html.erb +6 -0
- data/app/views/kaui/components/logo/_logo.html.erb +1 -0
- data/app/views/kaui/components/menu_dropdown/_menu_dropdown.html.erb +59 -0
- data/app/views/kaui/components/search_input/_search_input.html.erb +81 -0
- data/app/views/kaui/credits/_form.html.erb +42 -25
- data/app/views/kaui/credits/new.html.erb +15 -8
- data/app/views/kaui/custom_fields/_form.html.erb +37 -25
- data/app/views/kaui/custom_fields/_list_bar.html.erb +11 -10
- data/app/views/kaui/custom_fields/index.html.erb +121 -27
- data/app/views/kaui/custom_fields/new.html.erb +19 -8
- data/app/views/kaui/errors/500.html.erb +1 -1
- data/app/views/kaui/home/index.html.erb +77 -30
- data/app/views/kaui/invoice_items/_edit_form.html.erb +30 -14
- data/app/views/kaui/invoice_items/edit.html.erb +15 -7
- data/app/views/kaui/invoice_tags/_form_bar.html.erb +13 -3
- data/app/views/kaui/invoices/_invoice_filterbar.html.erb +53 -69
- data/app/views/kaui/invoices/_invoice_table.html.erb +77 -92
- data/app/views/kaui/invoices/_multi_functions_bar.html.erb +351 -140
- data/app/views/kaui/invoices/index.html.erb +89 -27
- data/app/views/kaui/invoices/show.html.erb +392 -80
- data/app/views/kaui/layouts/kaui_account_sidebar.html.erb +42 -0
- data/app/views/kaui/layouts/kaui_application.html.erb +29 -15
- data/app/views/kaui/layouts/kaui_flash.html.erb +82 -31
- data/app/views/kaui/layouts/kaui_navbar.html.erb +109 -82
- data/app/views/kaui/layouts/kaui_setting_sidebar.html.erb +36 -0
- data/app/views/kaui/payment_methods/_form.html.erb +32 -11
- data/app/views/kaui/payment_methods/_new_creditcard_payment_method.html.erb +35 -34
- data/app/views/kaui/payment_methods/_payment_methods_details_table.html.erb +27 -29
- data/app/views/kaui/payment_methods/_payment_methods_table.html.erb +116 -38
- data/app/views/kaui/payment_methods/_plugin_properties.html.erb +19 -9
- data/app/views/kaui/payment_methods/new.html.erb +14 -8
- data/app/views/kaui/payments/_form.html.erb +30 -13
- data/app/views/kaui/payments/_multi_functions_bar.html.erb +351 -141
- data/app/views/kaui/payments/_payment_filterbar.html.erb +63 -79
- data/app/views/kaui/payments/_payment_invoice_table.html.erb +105 -0
- data/app/views/kaui/payments/_payment_table.html.erb +4 -67
- data/app/views/kaui/payments/index.html.erb +90 -26
- data/app/views/kaui/payments/new.html.erb +15 -8
- data/app/views/kaui/payments/show.html.erb +222 -28
- data/app/views/kaui/queues/index.html.erb +329 -111
- data/app/views/kaui/refunds/_form.html.erb +68 -45
- data/app/views/kaui/refunds/new.html.erb +15 -8
- data/app/views/kaui/role_definitions/_form.html.erb +104 -17
- data/app/views/kaui/role_definitions/new.html.erb +15 -8
- data/app/views/kaui/sessions/_form.html.erb +9 -19
- data/app/views/kaui/sessions/new.html.erb +10 -9
- data/app/views/kaui/subscriptions/_cancel_by_date_modal.html.erb +65 -35
- data/app/views/kaui/subscriptions/_edit_form.html.erb +66 -35
- data/app/views/kaui/subscriptions/_form.html.erb +63 -32
- data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +215 -57
- data/app/views/kaui/subscriptions/edit.html.erb +19 -8
- data/app/views/kaui/subscriptions/edit_bcd.erb +46 -16
- data/app/views/kaui/subscriptions/new.html.erb +22 -15
- data/app/views/kaui/tag_definitions/_form.html.erb +51 -30
- data/app/views/kaui/tag_definitions/index.html.erb +151 -40
- data/app/views/kaui/tag_definitions/new.html.erb +15 -8
- data/app/views/kaui/tags/index.html.erb +136 -47
- data/app/views/kaui/tenants/_form.html.erb +8 -5
- data/app/views/kaui/tenants/index.html.erb +15 -9
- data/app/views/kaui/transactions/_control_plugin_names.html.erb +18 -10
- data/app/views/kaui/transactions/_form.html.erb +86 -25
- data/app/views/kaui/transactions/new.html.erb +15 -9
- data/config/routes.rb +1 -0
- data/lib/kaui/engine.rb +11 -0
- data/lib/kaui/version.rb +1 -1
- data/lib/kaui.rb +0 -1
- metadata +120 -2
|
@@ -1,35 +1,56 @@
|
|
|
1
|
+
<div class="d-flex">
|
|
1
2
|
<div class="filter-bar-container">
|
|
2
3
|
<div class="filter-bar">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
<%= render "kaui/components/button/button", {
|
|
5
|
+
label: "Advance Search",
|
|
6
|
+
icon: "kaui/search.svg",
|
|
7
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
8
|
+
type: "button",
|
|
9
|
+
html_class: "kaui-button custom-hover",
|
|
10
|
+
html_options: {
|
|
11
|
+
data: {
|
|
12
|
+
bs_toggle: "modal",
|
|
13
|
+
bs_target: "#advanceSearchModal"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
} %>
|
|
12
17
|
</div>
|
|
13
18
|
</div>
|
|
14
19
|
|
|
15
20
|
<%= render :partial => 'payment_filterbar' %>
|
|
16
21
|
|
|
17
22
|
<div class="dropdown-container">
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
<%= render "kaui/components/button/button", {
|
|
24
|
+
label: "Download CSV",
|
|
25
|
+
icon: "kaui/download.svg",
|
|
26
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1 mx-2",
|
|
27
|
+
type: "button",
|
|
28
|
+
html_class: "kaui-button custom-hover",
|
|
29
|
+
html_options: {
|
|
30
|
+
id: "modalDownloadButton"
|
|
31
|
+
}
|
|
32
|
+
} %>
|
|
22
33
|
<div class="dropdown">
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
<%= render "kaui/components/button/button", {
|
|
35
|
+
label: "Edit Columns",
|
|
36
|
+
icon: "kaui/setting.svg",
|
|
37
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
38
|
+
type: "button",
|
|
39
|
+
html_class: "kaui-button custom-hover",
|
|
40
|
+
html_options: {
|
|
41
|
+
id: "dropdownMenu1",
|
|
42
|
+
data: {
|
|
43
|
+
bs_toggle: "dropdown"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
} %>
|
|
47
|
+
<ul class="dropdown-menu" id="column-visibility" aria-labelledby="dropdownMenu1">
|
|
28
48
|
<% Kaui.account_payments_columns.call()[0].each_with_index do |title, index| %>
|
|
29
49
|
<li class="list-group-item-manual" data-id="<%= index %>">
|
|
30
50
|
<label class="label-group-item-manual">
|
|
31
|
-
<input type="checkbox" class="column-toggle" draggable="true" data-column="<%= index %>" checked>
|
|
32
|
-
|
|
51
|
+
<input type="checkbox" class="column-toggle" draggable="true" data-column="<%= index %>" checked>
|
|
52
|
+
<%= title %>
|
|
53
|
+
<span class="icon-drag" aria-hidden="true"></span>
|
|
33
54
|
</label>
|
|
34
55
|
</li>
|
|
35
56
|
<% end %>
|
|
@@ -41,140 +62,163 @@
|
|
|
41
62
|
<div class="modal-dialog" role="document">
|
|
42
63
|
<div class="modal-content">
|
|
43
64
|
<div class="modal-header">
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
65
|
+
<h5 class="modal-title d-flex align-items-center gap-3" id="downloadCsvModalLabel">
|
|
66
|
+
<span class="icon-container">
|
|
67
|
+
<%= image_tag("kaui/download-csv.svg") %>
|
|
68
|
+
</span>
|
|
69
|
+
Download
|
|
70
|
+
</h5>
|
|
71
|
+
<button type="button" class="close close-button custom-hover" data-bs-dismiss="modal" aria-label="Close">
|
|
72
|
+
<span aria-hidden="true">
|
|
73
|
+
<%= image_tag("kaui/modal/close.svg", width: 20, height: 20) %>
|
|
74
|
+
</span>
|
|
47
75
|
</button>
|
|
48
76
|
</div>
|
|
49
77
|
<div class="modal-body">
|
|
50
78
|
<form id="downloadCsvForm">
|
|
51
79
|
<div class="row">
|
|
52
|
-
<div class="
|
|
53
|
-
<
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
<div class="d-flex align-items-center">
|
|
81
|
+
<label for="searchFieldSelect" class="field-label col-sm-3">Payment Date</label>
|
|
82
|
+
<div class="fake-select-wrapper col-sm-9">
|
|
83
|
+
<input type="checkbox" id="single-toggle" hidden />
|
|
84
|
+
<div class="d-flex align-items-center position-relative">
|
|
85
|
+
<label for="single-toggle" class="fake-select-display">
|
|
86
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
87
|
+
<path d="M14.5833 12.5V18.3333M17.5 15.4167H11.6666" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
88
|
+
<path d="M13.75 1.6665V4.99984M6.25 1.6665V4.99984" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
89
|
+
<path d="M17.5 10.8335V5.00016C17.5 4.07969 16.7538 3.3335 15.8333 3.3335H4.16667C3.24619 3.3335 2.5 4.07969 2.5 5.00016V16.6668C2.5 17.5873 3.24619 18.3335 4.16667 18.3335H10" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
90
|
+
<path d="M2.5 8.3335H17.5" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
91
|
+
</svg>
|
|
92
|
+
</label>
|
|
93
|
+
<input type="text" class="form-control center-input" id="startDate" placeholder="All Accounts" name="startDate">
|
|
94
|
+
<div id="dash" class="dash">–</div>
|
|
95
|
+
<input type="text" class="form-control right-input" id="endDate" placeholder="" name="endDate">
|
|
96
|
+
<div id="toggle-wrapper" class="position-absolute" style="width: 100%; height: 100%;" onclick="document.getElementById('single-toggle').click()"></div>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<% today = Date.today %>
|
|
100
|
+
|
|
101
|
+
<% start_of_year = Date.new(today.year, 1, 1) %>
|
|
102
|
+
<% end_of_year = Date.new(today.year, 12, 31) %>
|
|
103
|
+
<% this_year_range = "#{start_of_year.strftime('%b %-d, %Y')} – #{end_of_year.strftime('%b %-d, %Y')}" %>
|
|
104
|
+
|
|
105
|
+
<% start_of_month = Date.new(today.year, today.month, 1) %>
|
|
106
|
+
<% end_of_month = Date.new(today.year, today.month, -1) %>
|
|
107
|
+
<% this_month_range = "#{start_of_month.strftime('%b %-d, %Y')} – #{end_of_month.strftime('%b %-d, %Y')}" %>
|
|
108
|
+
|
|
109
|
+
<% start_of_week = today - ((today.wday - 1) % 7) %>
|
|
110
|
+
<% end_of_week = start_of_week + 6 %>
|
|
111
|
+
<% this_week_range = "#{start_of_week.strftime('%b %-d, %Y')} – #{end_of_week.strftime('%b %-d, %Y')}" %>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
<div class="fake-select-dropdown">
|
|
115
|
+
<label class="fake-select-option">
|
|
116
|
+
<input type="radio" name="download_option" id="allData" />
|
|
117
|
+
<span>All accounts</span>
|
|
118
|
+
</label>
|
|
119
|
+
|
|
120
|
+
<label class="fake-select-option">
|
|
121
|
+
<input type="radio" name="download_option" id="thisWeek" />
|
|
122
|
+
<span>This week <small>(<%= this_week_range %>)</small></span>
|
|
123
|
+
</label>
|
|
124
|
+
|
|
125
|
+
<label class="fake-select-option">
|
|
126
|
+
<input type="radio" name="download_option" id="thisMonth" />
|
|
127
|
+
<span>This month <small>(<%= this_month_range %>)</small></span>
|
|
128
|
+
</label>
|
|
129
|
+
|
|
130
|
+
<label class="fake-select-option">
|
|
131
|
+
<input type="radio" name="download_option" id="thisYear" />
|
|
132
|
+
<span>This year <small>(<%= this_year_range %>)</small></span>
|
|
133
|
+
</label>
|
|
134
|
+
<label class="fake-select-option">
|
|
135
|
+
<input type="radio" name="download_option" id="customDate" />
|
|
136
|
+
<span>Custom date</span>
|
|
137
|
+
</label>
|
|
138
|
+
</div>
|
|
83
139
|
</div>
|
|
84
|
-
<div>
|
|
85
|
-
<input type="radio" id="thisYear" name="download_option" value="thisYear">
|
|
86
|
-
<label for="thisYear">This year</label>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
140
|
</div>
|
|
90
141
|
</div>
|
|
91
142
|
<div class="row">
|
|
92
|
-
<div class="
|
|
93
|
-
<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
143
|
+
<div class="d-flex align-items-center">
|
|
144
|
+
<label for="searchFieldSelect" class="field-label col-sm-3">Include fields</label>
|
|
145
|
+
<div class="col-md-9">
|
|
146
|
+
<div class="chip-select">
|
|
147
|
+
<input type="checkbox" id="dropdown-toggle" hidden />
|
|
148
|
+
|
|
149
|
+
<label for="dropdown-toggle" class="chip-input-box position-relative" style="position: relative; overflow: hidden;">
|
|
150
|
+
<div class="chip-list" id="selected-fields-chips">
|
|
151
|
+
<%# This will be dynamically populated with chips for selected fields %>
|
|
152
|
+
<span class="chip" style="color: #999;">No fields selected</span>
|
|
153
|
+
<svg width="16" height="16" class="position-absolute" style="top: 0.625rem; right: 0.625rem;" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
154
|
+
<path d="M4 6L8 10L12 6" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
155
|
+
</svg>
|
|
156
|
+
</div>
|
|
157
|
+
<div id="" class="position-absolute" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;"></div>
|
|
158
|
+
</label>
|
|
159
|
+
<div class="chip-dropdown">
|
|
160
|
+
<label class="chip-option">
|
|
161
|
+
<input type="checkbox" id="allFields" />
|
|
162
|
+
All fields
|
|
163
|
+
</label>
|
|
164
|
+
<div class="mt-2" id="field-selection">
|
|
165
|
+
<% Kaui.account_payments_columns.call[0].each_with_index do |title, index| %>
|
|
166
|
+
<label class="chip-option d-flex align-items-center gap-2">
|
|
167
|
+
<input type="checkbox" class="field-toggle" data-field-index="<%= index %>" checked />
|
|
168
|
+
<span><%= title %></span>
|
|
169
|
+
</label>
|
|
170
|
+
<% end %>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
101
174
|
</div>
|
|
102
175
|
</div>
|
|
103
176
|
</div>
|
|
104
177
|
</form>
|
|
105
178
|
</div>
|
|
106
179
|
<div class="modal-footer">
|
|
107
|
-
|
|
108
|
-
|
|
180
|
+
<%= render "kaui/components/button/button", {
|
|
181
|
+
label: 'Close',
|
|
182
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
183
|
+
type: "button",
|
|
184
|
+
html_class: "kaui-button custom-hover mx-2 my-0",
|
|
185
|
+
html_options: {
|
|
186
|
+
data: {
|
|
187
|
+
bs_dismiss: "modal"
|
|
188
|
+
},
|
|
189
|
+
}
|
|
190
|
+
} %>
|
|
191
|
+
<%= render "kaui/components/button/button", {
|
|
192
|
+
label: 'Download CSV',
|
|
193
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
194
|
+
type: "button",
|
|
195
|
+
html_class: "kaui-dropdown custom-hover m-0",
|
|
196
|
+
html_options: {
|
|
197
|
+
id: "downloadButton"
|
|
198
|
+
}
|
|
199
|
+
} %>
|
|
109
200
|
</div>
|
|
110
201
|
</div>
|
|
111
202
|
</div>
|
|
112
203
|
</div>
|
|
113
204
|
|
|
114
|
-
|
|
115
|
-
.dropdown-menu#column-visibility {
|
|
116
|
-
max-height: 300px;
|
|
117
|
-
width: 220px;
|
|
118
|
-
overflow-y: auto;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.dropdown-menu {
|
|
122
|
-
padding: 5px;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.dropdown-menu#column-visibility::before {
|
|
126
|
-
content: 'Drag to reorder columns';
|
|
127
|
-
display: block;
|
|
128
|
-
height: 30px;
|
|
129
|
-
text-align: center;
|
|
130
|
-
color: darkgrey;
|
|
131
|
-
padding-top: 5px;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.toggle-button-right {
|
|
135
|
-
float: right;
|
|
136
|
-
margin-bottom: 10px;
|
|
137
|
-
margin-left: 10px;
|
|
138
|
-
background-color: white;
|
|
139
|
-
color: black;
|
|
140
|
-
text-transform: none;
|
|
141
|
-
border: 1px solid #ccc;
|
|
142
|
-
padding: 8px 15px;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.download-button-right {
|
|
146
|
-
float: right;
|
|
147
|
-
margin-bottom: 10px;
|
|
148
|
-
margin-left: 10px;
|
|
149
|
-
background-color: white;
|
|
150
|
-
color: black;
|
|
151
|
-
text-transform: none;
|
|
152
|
-
border: 1px solid #ccc;
|
|
153
|
-
padding: 8px 15px;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.icon-drag {
|
|
157
|
-
float: right;
|
|
158
|
-
padding: 5px;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.dropdown-container {
|
|
162
|
-
display: flex;
|
|
163
|
-
justify-content: flex-end;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.label-group-item-manual {
|
|
167
|
-
margin: 5px;
|
|
168
|
-
width: -webkit-fill-available;
|
|
169
|
-
cursor: grab;
|
|
170
|
-
}
|
|
171
|
-
.label-group-item-manual:active {
|
|
172
|
-
cursor: grabbing;
|
|
173
|
-
}
|
|
174
|
-
</style>
|
|
205
|
+
</div>
|
|
175
206
|
|
|
176
207
|
<%= javascript_tag do %>
|
|
177
208
|
$(document).ready(function() {
|
|
209
|
+
// Initialize Bootstrap dropdown
|
|
210
|
+
var dropdownElementList = [].slice.call(document.querySelectorAll('.dropdown-toggle'));
|
|
211
|
+
var dropdownList = dropdownElementList.map(function (dropdownToggleEl) {
|
|
212
|
+
return new bootstrap.Dropdown(dropdownToggleEl);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// Manual dropdown toggle as fallback
|
|
216
|
+
$('#dropdownMenu1').on('click', function(e) {
|
|
217
|
+
e.preventDefault();
|
|
218
|
+
e.stopPropagation();
|
|
219
|
+
$('#column-visibility').toggleClass('show');
|
|
220
|
+
});
|
|
221
|
+
|
|
178
222
|
$('.dropdown-menu').on('click', 'input[type="checkbox"], label', function(event) {
|
|
179
223
|
event.stopPropagation();
|
|
180
224
|
});
|
|
@@ -183,13 +227,20 @@ $(document).ready(function() {
|
|
|
183
227
|
$('#downloadCsvModal').modal('show');
|
|
184
228
|
});
|
|
185
229
|
|
|
186
|
-
|
|
187
|
-
|
|
230
|
+
// Native date inputs are used; no jQuery UI datepicker initialization needed
|
|
231
|
+
|
|
232
|
+
// Open native date picker on input click/focus
|
|
233
|
+
$('#startDate, #endDate').on('click focus', function() {
|
|
234
|
+
if (!this.disabled && typeof this.showPicker === 'function') {
|
|
235
|
+
this.showPicker();
|
|
236
|
+
}
|
|
188
237
|
});
|
|
189
238
|
|
|
190
239
|
$('#downloadCsvModal').on('show.bs.modal', function (e) {
|
|
191
240
|
$('#allData').prop('checked', true);
|
|
192
241
|
$('#startDate, #endDate').prop('disabled', true);
|
|
242
|
+
$('#toggle-wrapper').show();
|
|
243
|
+
$('#dash').hide();
|
|
193
244
|
$('#startDate').val(null);
|
|
194
245
|
$('#endDate').val(null);
|
|
195
246
|
});
|
|
@@ -197,24 +248,40 @@ $(document).ready(function() {
|
|
|
197
248
|
$('#allData').change(function() {
|
|
198
249
|
$('#startDate').val(null);
|
|
199
250
|
$('#endDate').val(null);
|
|
251
|
+
$('#toggle-wrapper').show();
|
|
252
|
+
$('#dash').hide();
|
|
200
253
|
$('#startDate, #endDate').prop('disabled', true);
|
|
254
|
+
// Change to text inputs to show placeholder
|
|
255
|
+
$('#startDate, #endDate').attr('type', 'text');
|
|
201
256
|
});
|
|
202
257
|
|
|
203
258
|
$('#thisWeek').change(function() {
|
|
204
259
|
if ($(this).is(':checked')) {
|
|
205
260
|
setDateRange("week");
|
|
261
|
+
$('#toggle-wrapper').show();
|
|
262
|
+
$('#dash').show();
|
|
263
|
+
// Change back to date inputs
|
|
264
|
+
$('#startDate, #endDate').attr('type', 'date');
|
|
206
265
|
}
|
|
207
266
|
});
|
|
208
267
|
|
|
209
268
|
$('#thisMonth').change(function() {
|
|
210
269
|
if ($(this).is(':checked')) {
|
|
211
270
|
setDateRange("month");
|
|
271
|
+
$('#toggle-wrapper').show();
|
|
272
|
+
$('#dash').show();
|
|
273
|
+
// Change back to date inputs
|
|
274
|
+
$('#startDate, #endDate').attr('type', 'date');
|
|
212
275
|
}
|
|
213
276
|
});
|
|
214
277
|
|
|
215
278
|
$('#thisYear').change(function() {
|
|
216
279
|
if ($(this).is(':checked')) {
|
|
217
280
|
setDateRange("year");
|
|
281
|
+
$('#toggle-wrapper').show();
|
|
282
|
+
$('#dash').show();
|
|
283
|
+
// Change back to date inputs
|
|
284
|
+
$('#startDate, #endDate').attr('type', 'date');
|
|
218
285
|
}
|
|
219
286
|
});
|
|
220
287
|
|
|
@@ -222,6 +289,10 @@ $(document).ready(function() {
|
|
|
222
289
|
if ($(this).is(':checked')) {
|
|
223
290
|
setDateRange("day");
|
|
224
291
|
$('#startDate, #endDate').prop('disabled', false);
|
|
292
|
+
$('#toggle-wrapper').hide();
|
|
293
|
+
$('#dash').show();
|
|
294
|
+
// Change back to date inputs
|
|
295
|
+
$('#startDate, #endDate').attr('type', 'date');
|
|
225
296
|
}
|
|
226
297
|
});
|
|
227
298
|
|
|
@@ -230,20 +301,30 @@ $(document).ready(function() {
|
|
|
230
301
|
downloadButton.addEventListener('click', function() {
|
|
231
302
|
event.preventDefault();
|
|
232
303
|
|
|
233
|
-
var allFieldsChecked =
|
|
304
|
+
var allFieldsChecked = $('#allFields').is(':checked');
|
|
234
305
|
var startDate = $('#startDate').val();
|
|
235
306
|
var endDate = $('#endDate').val();
|
|
236
307
|
var downloadAll = $('#allData').is(':checked');
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
308
|
+
|
|
309
|
+
// Get selected fields
|
|
310
|
+
var selectedFields = [];
|
|
311
|
+
if (!allFieldsChecked) {
|
|
312
|
+
$('#field-selection input.field-toggle:checked').each(function() {
|
|
313
|
+
var labelText = $(this).closest('label').find('span').text().trim();
|
|
314
|
+
selectedFields.push(labelText);
|
|
315
|
+
});
|
|
316
|
+
} else {
|
|
317
|
+
// If all fields checked, get all column titles from the table
|
|
318
|
+
var thElements = document.querySelectorAll('#payments-table th');
|
|
319
|
+
selectedFields = Array.from(thElements).map(function(th) {
|
|
320
|
+
return th.textContent.trim();
|
|
321
|
+
});
|
|
322
|
+
}
|
|
242
323
|
|
|
243
324
|
var url = new URL("<%= download_payments_path %>", window.location.origin);
|
|
244
325
|
var params = new URLSearchParams();
|
|
245
326
|
params.append('account_id', "<%=@account.account_id%>");
|
|
246
|
-
params.append('columnsString',
|
|
327
|
+
params.append('columnsString', selectedFields.join(','));
|
|
247
328
|
if (!downloadAll) {
|
|
248
329
|
params.append('startDate', startDate);
|
|
249
330
|
params.append('endDate', endDate);
|
|
@@ -287,7 +368,13 @@ $(document).ready(function() {
|
|
|
287
368
|
class: "column-toggle"
|
|
288
369
|
});
|
|
289
370
|
$label.append($checkbox).append(" " + col_name);
|
|
290
|
-
var $icon = $(
|
|
371
|
+
var $icon = $(`
|
|
372
|
+
<span class="icon-drag" aria-hidden="true">
|
|
373
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
374
|
+
<path d="M6.66669 5H6.67198M6.66669 10H6.67198M6.66669 15H6.67198M13.3281 5H13.3334M13.3281 10H13.3334M13.3281 15H13.3334" stroke="#A4A7AE" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
375
|
+
</svg>
|
|
376
|
+
</span>
|
|
377
|
+
`);
|
|
291
378
|
$label.append($icon);
|
|
292
379
|
$item.append($label);
|
|
293
380
|
$list.append($item);
|
|
@@ -334,5 +421,128 @@ $(document).ready(function() {
|
|
|
334
421
|
var column = table.column($(this).attr('data-column'));
|
|
335
422
|
column.visible(!column.visible());
|
|
336
423
|
});
|
|
424
|
+
|
|
425
|
+
document.addEventListener('click', function (e) {
|
|
426
|
+
const wrapper = document.querySelector('.chip-select');
|
|
427
|
+
const toggle = document.getElementById('dropdown-toggle');
|
|
428
|
+
|
|
429
|
+
if (wrapper && !wrapper.contains(e.target)) {
|
|
430
|
+
toggle.checked = false; // close dropdown
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
document.addEventListener('click', function (e) {
|
|
435
|
+
const wrapper = document.querySelector('.fake-select-wrapper');
|
|
436
|
+
const toggle = document.getElementById('single-toggle');
|
|
437
|
+
if (!wrapper.contains(e.target)) toggle.checked = false;
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
// Handle click outside for Edit Columns dropdown
|
|
441
|
+
document.addEventListener('click', function (e) {
|
|
442
|
+
const dropdownContainer = document.querySelector('.dropdown-container .dropdown');
|
|
443
|
+
const dropdownMenu = document.getElementById('column-visibility');
|
|
444
|
+
|
|
445
|
+
if (dropdownContainer && !dropdownContainer.contains(e.target)) {
|
|
446
|
+
// Close dropdown if clicking outside
|
|
447
|
+
if (dropdownMenu && dropdownMenu.classList.contains('show')) {
|
|
448
|
+
dropdownMenu.classList.remove('show');
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
// Initialize on modal open
|
|
454
|
+
$('#downloadCsvModal').on('show.bs.modal', function () {
|
|
455
|
+
$('#allFields').prop('checked', true);
|
|
456
|
+
updateChipLabel();
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
// Initial binding
|
|
460
|
+
bindAllFieldsToggle();
|
|
461
|
+
bindDropdownAllFieldsToggle();
|
|
462
|
+
|
|
463
|
+
// Toggle behavior - this will be re-bound in updateChipLabel
|
|
464
|
+
function bindAllFieldsToggle() {
|
|
465
|
+
$('#allFields').off('change').on('change', function() {
|
|
466
|
+
var checked = $(this).is(':checked');
|
|
467
|
+
|
|
468
|
+
// When "All fields" is checked, select all individual fields
|
|
469
|
+
// When unchecked, deselect all individual fields
|
|
470
|
+
$('#field-selection input.field-toggle').prop('checked', checked);
|
|
471
|
+
$('#allFieldsDropdown').prop('checked', checked);
|
|
472
|
+
|
|
473
|
+
updateChipLabel();
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// Also bind to the dropdown "All fields" checkbox
|
|
478
|
+
function bindDropdownAllFieldsToggle() {
|
|
479
|
+
$('#allFields').off('change').on('change', function() {
|
|
480
|
+
var checked = $(this).is(':checked');
|
|
481
|
+
|
|
482
|
+
// When "All fields" is checked, select all individual fields
|
|
483
|
+
// When unchecked, deselect all individual fields
|
|
484
|
+
$('#field-selection input.field-toggle').prop('checked', checked);
|
|
485
|
+
|
|
486
|
+
updateChipLabel();
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// Update chip display based on selected fields
|
|
491
|
+
function updateChipLabel() {
|
|
492
|
+
var allFieldsChecked = $('#allFields').is(':checked');
|
|
493
|
+
var $chipList = $('#selected-fields-chips');
|
|
494
|
+
|
|
495
|
+
if (allFieldsChecked) {
|
|
496
|
+
// Show "All fields" chip
|
|
497
|
+
$chipList.html(`
|
|
498
|
+
<span class="chip">All fields</span>
|
|
499
|
+
<svg width="16" height="16" class="position-absolute" style="top: 0.625rem; right: 0.625rem;" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
500
|
+
<path d="M4 6L8 10L12 6" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
501
|
+
</svg>
|
|
502
|
+
`);
|
|
503
|
+
} else {
|
|
504
|
+
// Show individual field chips
|
|
505
|
+
var selectedFields = [];
|
|
506
|
+
$('#field-selection input.field-toggle:checked').each(function() {
|
|
507
|
+
var labelText = $(this).closest('label').find('span').text().trim();
|
|
508
|
+
selectedFields.push(labelText);
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
if (selectedFields.length === 0) {
|
|
512
|
+
$chipList.html(`
|
|
513
|
+
<span class="chip" style="color: #999;">No fields selected</span>
|
|
514
|
+
<svg width="16" height="16" class="position-absolute" style="top: 0.625rem; right: 0.625rem;" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
515
|
+
<path d="M4 6L8 10L12 6" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
516
|
+
</svg>
|
|
517
|
+
`);
|
|
518
|
+
} else {
|
|
519
|
+
var chipsHtml = selectedFields.map(function(field) {
|
|
520
|
+
return `<span class="chip">${field}</span>`;
|
|
521
|
+
}).join('');
|
|
522
|
+
chipsHtml = chipsHtml + `
|
|
523
|
+
<svg width="16" height="16" class="position-absolute" style="top: 0.625rem; right: 0.625rem;" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
524
|
+
<path d="M4 6L8 10L12 6" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
525
|
+
</svg>
|
|
526
|
+
`;
|
|
527
|
+
$chipList.html(chipsHtml);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// Update chip label when individual fields change
|
|
533
|
+
$('#field-selection input.field-toggle').on('change', function() {
|
|
534
|
+
// Check if all individual fields are selected
|
|
535
|
+
var totalFields = $('#field-selection input.field-toggle').length;
|
|
536
|
+
var checkedFields = $('#field-selection input.field-toggle:checked').length;
|
|
537
|
+
|
|
538
|
+
// Update "All fields" checkbox based on individual field selections
|
|
539
|
+
if (checkedFields === totalFields) {
|
|
540
|
+
$('#allFields').prop('checked', true);
|
|
541
|
+
} else {
|
|
542
|
+
$('#allFields').prop('checked', false);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
updateChipLabel();
|
|
546
|
+
});
|
|
337
547
|
});
|
|
338
548
|
<% end %>
|