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,13 +1,19 @@
|
|
|
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
|
-
|
|
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
|
+
} %>
|
|
11
17
|
|
|
12
18
|
</div>
|
|
13
19
|
</div>
|
|
@@ -15,21 +21,37 @@
|
|
|
15
21
|
<%= render :partial => 'invoice_filterbar' %>
|
|
16
22
|
|
|
17
23
|
<div class="dropdown-container">
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
<%= render "kaui/components/button/button", {
|
|
25
|
+
label: "Download CSV",
|
|
26
|
+
icon: "kaui/download.svg",
|
|
27
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1 mx-2",
|
|
28
|
+
type: "button",
|
|
29
|
+
html_class: "kaui-button custom-hover",
|
|
30
|
+
html_options: {
|
|
31
|
+
id: "modalDownloadButton"
|
|
32
|
+
}
|
|
33
|
+
} %>
|
|
22
34
|
<div class="dropdown">
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
<%= render "kaui/components/button/button", {
|
|
36
|
+
label: "Edit Columns",
|
|
37
|
+
icon: "kaui/setting.svg",
|
|
38
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
39
|
+
type: "button",
|
|
40
|
+
html_class: "kaui-button custom-hover",
|
|
41
|
+
html_options: {
|
|
42
|
+
id: "dropdownMenu1",
|
|
43
|
+
data: {
|
|
44
|
+
bs_toggle: "dropdown"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
} %>
|
|
48
|
+
<ul class="dropdown-menu" id="column-visibility" aria-labelledby="dropdownMenu1">
|
|
28
49
|
<% Kaui.account_invoices_columns.call[0].each_with_index do |title, index| %>
|
|
29
50
|
<li class="list-group-item-manual" data-id="<%= index %>">
|
|
30
51
|
<label class="label-group-item-manual">
|
|
31
|
-
<input type="checkbox" class="column-toggle" draggable="true" data-column="<%= index %>" checked>
|
|
32
|
-
|
|
52
|
+
<input type="checkbox" class="column-toggle" draggable="true" data-column="<%= index %>" checked>
|
|
53
|
+
<%= title %>
|
|
54
|
+
<span class="icon-drag" aria-hidden="true"></span>
|
|
33
55
|
</label>
|
|
34
56
|
</li>
|
|
35
57
|
<% end %>
|
|
@@ -41,140 +63,163 @@
|
|
|
41
63
|
<div class="modal-dialog" role="document">
|
|
42
64
|
<div class="modal-content">
|
|
43
65
|
<div class="modal-header">
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
66
|
+
<h5 class="modal-title d-flex align-items-center gap-3" id="downloadCsvModalLabel">
|
|
67
|
+
<span class="icon-container">
|
|
68
|
+
<%= image_tag("kaui/download-csv.svg") %>
|
|
69
|
+
</span>
|
|
70
|
+
Download
|
|
71
|
+
</h5>
|
|
72
|
+
<button type="button" class="close close-button custom-hover" data-bs-dismiss="modal" aria-label="Close">
|
|
73
|
+
<span aria-hidden="true">
|
|
74
|
+
<%= image_tag("kaui/modal/close.svg", width: 20, height: 20) %>
|
|
75
|
+
</span>
|
|
47
76
|
</button>
|
|
48
77
|
</div>
|
|
49
78
|
<div class="modal-body">
|
|
50
79
|
<form id="downloadCsvForm">
|
|
51
80
|
<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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
<
|
|
81
|
+
<div class="d-flex align-items-center">
|
|
82
|
+
<label for="searchFieldSelect" class="field-label col-sm-3">Invoice Date</label>
|
|
83
|
+
<div class="fake-select-wrapper col-sm-9">
|
|
84
|
+
<input type="checkbox" id="single-toggle" hidden />
|
|
85
|
+
<div class="d-flex align-items-center position-relative">
|
|
86
|
+
<label for="single-toggle" class="fake-select-display">
|
|
87
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
88
|
+
<path d="M14.5833 12.5V18.3333M17.5 15.4167H11.6666" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
89
|
+
<path d="M13.75 1.6665V4.99984M6.25 1.6665V4.99984" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
90
|
+
<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"/>
|
|
91
|
+
<path d="M2.5 8.3335H17.5" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
92
|
+
</svg>
|
|
93
|
+
</label>
|
|
94
|
+
<input type="text" class="form-control center-input" id="startDate" placeholder="All Accounts" name="startDate">
|
|
95
|
+
<div id="dash" class="dash">–</div>
|
|
96
|
+
<input type="text" class="form-control right-input" id="endDate" placeholder="" name="endDate">
|
|
97
|
+
<div id="toggle-wrapper" class="position-absolute" style="width: 100%; height: 100%;" onclick="document.getElementById('single-toggle').click()"></div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<% today = Date.today %>
|
|
101
|
+
|
|
102
|
+
<% start_of_year = Date.new(today.year, 1, 1) %>
|
|
103
|
+
<% end_of_year = Date.new(today.year, 12, 31) %>
|
|
104
|
+
<% this_year_range = "#{start_of_year.strftime('%b %-d, %Y')} – #{end_of_year.strftime('%b %-d, %Y')}" %>
|
|
105
|
+
|
|
106
|
+
<% start_of_month = Date.new(today.year, today.month, 1) %>
|
|
107
|
+
<% end_of_month = Date.new(today.year, today.month, -1) %>
|
|
108
|
+
<% this_month_range = "#{start_of_month.strftime('%b %-d, %Y')} – #{end_of_month.strftime('%b %-d, %Y')}" %>
|
|
109
|
+
|
|
110
|
+
<% start_of_week = today - ((today.wday - 1) % 7) %>
|
|
111
|
+
<% end_of_week = start_of_week + 6 %>
|
|
112
|
+
<% this_week_range = "#{start_of_week.strftime('%b %-d, %Y')} – #{end_of_week.strftime('%b %-d, %Y')}" %>
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
<div class="fake-select-dropdown">
|
|
116
|
+
<label class="fake-select-option">
|
|
117
|
+
<input type="radio" name="download_option" id="allData" />
|
|
118
|
+
<span>All accounts</span>
|
|
119
|
+
</label>
|
|
120
|
+
|
|
121
|
+
<label class="fake-select-option">
|
|
122
|
+
<input type="radio" name="download_option" id="thisWeek" />
|
|
123
|
+
<span>This week <small>(<%= this_week_range %>)</small></span>
|
|
124
|
+
</label>
|
|
125
|
+
|
|
126
|
+
<label class="fake-select-option">
|
|
127
|
+
<input type="radio" name="download_option" id="thisMonth" />
|
|
128
|
+
<span>This month <small>(<%= this_month_range %>)</small></span>
|
|
129
|
+
</label>
|
|
130
|
+
|
|
131
|
+
<label class="fake-select-option">
|
|
132
|
+
<input type="radio" name="download_option" id="thisYear" />
|
|
133
|
+
<span>This year <small>(<%= this_year_range %>)</small></span>
|
|
134
|
+
</label>
|
|
135
|
+
<label class="fake-select-option">
|
|
136
|
+
<input type="radio" name="download_option" id="customDate" />
|
|
137
|
+
<span>Custom date</span>
|
|
138
|
+
</label>
|
|
139
|
+
</div>
|
|
87
140
|
</div>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
<div class="row">
|
|
92
|
-
<div class="col-md-12">
|
|
93
|
-
<h5>Additional Options</h5>
|
|
94
141
|
</div>
|
|
95
142
|
</div>
|
|
96
143
|
<div class="row">
|
|
97
|
-
<div class="
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
<
|
|
144
|
+
<div class="d-flex align-items-center">
|
|
145
|
+
<label for="searchFieldSelect" class="field-label col-sm-3">Include fields</label>
|
|
146
|
+
<div class="col-md-9">
|
|
147
|
+
<div class="chip-select">
|
|
148
|
+
<input type="checkbox" id="dropdown-toggle" hidden />
|
|
149
|
+
|
|
150
|
+
<label for="dropdown-toggle" class="chip-input-box position-relative" style="position: relative; overflow: hidden;">
|
|
151
|
+
<div class="chip-list" id="selected-fields-chips">
|
|
152
|
+
<%# This will be dynamically populated with chips for selected fields %>
|
|
153
|
+
<span class="chip" style="color: #999;">No fields selected</span>
|
|
154
|
+
<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">
|
|
155
|
+
<path d="M4 6L8 10L12 6" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
156
|
+
</svg>
|
|
157
|
+
</div>
|
|
158
|
+
<div id="" class="position-absolute" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;"></div>
|
|
159
|
+
</label>
|
|
160
|
+
<div class="chip-dropdown">
|
|
161
|
+
<label class="chip-option">
|
|
162
|
+
<input type="checkbox" id="allFields" />
|
|
163
|
+
All fields
|
|
164
|
+
</label>
|
|
165
|
+
<div class="mt-2" id="field-selection">
|
|
166
|
+
<% Kaui.account_invoices_columns.call[0].each_with_index do |title, index| %>
|
|
167
|
+
<label class="chip-option d-flex align-items-center gap-2">
|
|
168
|
+
<input type="checkbox" class="field-toggle" data-field-index="<%= index %>" checked />
|
|
169
|
+
<span><%= title %></span>
|
|
170
|
+
</label>
|
|
171
|
+
<% end %>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
101
175
|
</div>
|
|
102
176
|
</div>
|
|
103
177
|
</div>
|
|
104
178
|
</form>
|
|
105
179
|
</div>
|
|
106
180
|
<div class="modal-footer">
|
|
107
|
-
|
|
108
|
-
|
|
181
|
+
<%= render "kaui/components/button/button", {
|
|
182
|
+
label: 'Close',
|
|
183
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
184
|
+
type: "button",
|
|
185
|
+
html_class: "kaui-button custom-hover mx-2 my-0",
|
|
186
|
+
html_options: {
|
|
187
|
+
data: {
|
|
188
|
+
bs_dismiss: "modal"
|
|
189
|
+
},
|
|
190
|
+
}
|
|
191
|
+
} %>
|
|
192
|
+
<%= render "kaui/components/button/button", {
|
|
193
|
+
label: 'Download CSV',
|
|
194
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
195
|
+
type: "button",
|
|
196
|
+
html_class: "kaui-dropdown custom-hover m-0",
|
|
197
|
+
html_options: {
|
|
198
|
+
id: "downloadButton"
|
|
199
|
+
}
|
|
200
|
+
} %>
|
|
109
201
|
</div>
|
|
110
202
|
</div>
|
|
111
203
|
</div>
|
|
112
204
|
</div>
|
|
113
205
|
|
|
114
|
-
|
|
115
|
-
.dropdown-menu#column-visibility {
|
|
116
|
-
max-height: 300px;
|
|
117
|
-
width: 200px;
|
|
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>
|
|
206
|
+
</div>
|
|
175
207
|
|
|
176
208
|
<%= javascript_tag do %>
|
|
177
209
|
$(document).ready(function() {
|
|
210
|
+
// Initialize Bootstrap dropdown
|
|
211
|
+
var dropdownElementList = [].slice.call(document.querySelectorAll('.dropdown-toggle'));
|
|
212
|
+
var dropdownList = dropdownElementList.map(function (dropdownToggleEl) {
|
|
213
|
+
return new bootstrap.Dropdown(dropdownToggleEl);
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// Manual dropdown toggle as fallback
|
|
217
|
+
$('#dropdownMenu1').on('click', function(e) {
|
|
218
|
+
e.preventDefault();
|
|
219
|
+
e.stopPropagation();
|
|
220
|
+
$('#column-visibility').toggleClass('show');
|
|
221
|
+
});
|
|
222
|
+
|
|
178
223
|
$('.dropdown-menu').on('click', 'input[type="checkbox"], label', function(event) {
|
|
179
224
|
event.stopPropagation();
|
|
180
225
|
});
|
|
@@ -182,38 +227,61 @@ $(document).ready(function() {
|
|
|
182
227
|
$('#modalDownloadButton').click(function() {
|
|
183
228
|
$('#downloadCsvModal').modal('show');
|
|
184
229
|
});
|
|
185
|
-
|
|
186
|
-
dateFormat: 'yy-mm-dd'
|
|
187
|
-
});
|
|
230
|
+
// Native date inputs are used; no jQuery UI datepicker initialization needed
|
|
188
231
|
|
|
189
232
|
$('#downloadCsvModal').on('show.bs.modal', function (e) {
|
|
190
233
|
$('#allData').prop('checked', true);
|
|
191
234
|
$('#startDate, #endDate').prop('disabled', true);
|
|
235
|
+
$('#toggle-wrapper').show();
|
|
236
|
+
$('#dash').hide();
|
|
192
237
|
$('#startDate').val(null);
|
|
193
238
|
$('#endDate').val(null);
|
|
194
239
|
});
|
|
195
240
|
|
|
241
|
+
// Open native date picker on input click/focus
|
|
242
|
+
$('#startDate, #endDate').on('click focus', function() {
|
|
243
|
+
if (!this.disabled && typeof this.showPicker === 'function') {
|
|
244
|
+
this.showPicker();
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
|
|
196
248
|
$('#allData').change(function() {
|
|
197
249
|
$('#startDate').val(null);
|
|
198
250
|
$('#endDate').val(null);
|
|
251
|
+
$('#toggle-wrapper').show();
|
|
252
|
+
$('#dash').hide();
|
|
199
253
|
$('#startDate, #endDate').prop('disabled', true);
|
|
254
|
+
// Change to text inputs to show placeholder
|
|
255
|
+
$('#startDate, #endDate').attr('type', 'text');
|
|
200
256
|
});
|
|
201
257
|
|
|
202
258
|
$('#thisWeek').change(function() {
|
|
203
259
|
if ($(this).is(':checked')) {
|
|
204
260
|
setDateRange("week");
|
|
261
|
+
$('#toggle-wrapper').show();
|
|
262
|
+
$('#dash').show();
|
|
263
|
+
// Change back to date inputs
|
|
264
|
+
$('#startDate, #endDate').attr('type', 'date');
|
|
205
265
|
}
|
|
206
266
|
});
|
|
207
267
|
|
|
208
268
|
$('#thisMonth').change(function() {
|
|
209
269
|
if ($(this).is(':checked')) {
|
|
210
270
|
setDateRange("month");
|
|
271
|
+
$('#toggle-wrapper').show();
|
|
272
|
+
$('#dash').show();
|
|
273
|
+
// Change back to date inputs
|
|
274
|
+
$('#startDate, #endDate').attr('type', 'date');
|
|
211
275
|
}
|
|
212
276
|
});
|
|
213
277
|
|
|
214
278
|
$('#thisYear').change(function() {
|
|
215
279
|
if ($(this).is(':checked')) {
|
|
216
280
|
setDateRange("year");
|
|
281
|
+
$('#toggle-wrapper').show();
|
|
282
|
+
$('#dash').show();
|
|
283
|
+
// Change back to date inputs
|
|
284
|
+
$('#startDate, #endDate').attr('type', 'date');
|
|
217
285
|
}
|
|
218
286
|
});
|
|
219
287
|
|
|
@@ -221,6 +289,10 @@ $(document).ready(function() {
|
|
|
221
289
|
if ($(this).is(':checked')) {
|
|
222
290
|
setDateRange("day");
|
|
223
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');
|
|
224
296
|
}
|
|
225
297
|
});
|
|
226
298
|
|
|
@@ -233,16 +305,26 @@ $(document).ready(function() {
|
|
|
233
305
|
var startDate = $('#startDate').val();
|
|
234
306
|
var endDate = $('#endDate').val();
|
|
235
307
|
var downloadAll = $('#allData').is(':checked');
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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('#invoices-table th');
|
|
319
|
+
selectedFields = Array.from(thElements).map(function(th) {
|
|
320
|
+
return th.textContent.trim();
|
|
321
|
+
});
|
|
322
|
+
}
|
|
241
323
|
|
|
242
324
|
var url = new URL("<%= download_invoices_path %>", window.location.origin);
|
|
243
325
|
var params = new URLSearchParams();
|
|
244
326
|
params.append('account_id', "<%=@account.account_id%>");
|
|
245
|
-
params.append('columnsString',
|
|
327
|
+
params.append('columnsString', selectedFields.join(','));
|
|
246
328
|
if (!downloadAll) {
|
|
247
329
|
params.append('startDate', startDate);
|
|
248
330
|
params.append('endDate', endDate);
|
|
@@ -286,7 +368,13 @@ $(document).ready(function() {
|
|
|
286
368
|
class: "column-toggle"
|
|
287
369
|
});
|
|
288
370
|
$label.append($checkbox).append(" " + col_name);
|
|
289
|
-
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
|
+
`);
|
|
290
378
|
$label.append($icon);
|
|
291
379
|
$item.append($label);
|
|
292
380
|
$list.append($item);
|
|
@@ -333,5 +421,128 @@ $(document).ready(function() {
|
|
|
333
421
|
var column = table.column($(this).attr('data-column'));
|
|
334
422
|
column.visible(!column.visible());
|
|
335
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
|
+
});
|
|
336
547
|
});
|
|
337
548
|
<% end %>
|