trestle 0.9.8 → 0.10.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rspec.yml +34 -4
- data/.gitignore +7 -0
- data/Gemfile +5 -1
- data/README.md +2 -1
- data/app/assets/bundle/trestle/admin.css +23 -0
- data/app/assets/bundle/trestle/admin.js +83 -0
- data/app/assets/bundle/trestle/fa-brands-400.ttf +0 -0
- data/app/assets/bundle/trestle/fa-brands-400.woff2 +0 -0
- data/app/assets/bundle/trestle/fa-regular-400.ttf +0 -0
- data/app/assets/bundle/trestle/fa-regular-400.woff2 +0 -0
- data/app/assets/bundle/trestle/fa-solid-900.ttf +0 -0
- data/app/assets/bundle/trestle/fa-solid-900.woff2 +0 -0
- data/app/assets/bundle/trestle/locale/cs.js +110 -0
- data/app/assets/bundle/trestle/locale/de.js +116 -0
- data/app/assets/bundle/trestle/locale/en.js +329 -0
- data/app/assets/bundle/trestle/locale/es-MX.js +109 -0
- data/app/assets/bundle/trestle/locale/es.js +109 -0
- data/app/assets/bundle/trestle/locale/fr.js +111 -0
- data/app/assets/bundle/trestle/locale/ko.js +111 -0
- data/app/assets/bundle/trestle/locale/lv.js +109 -0
- data/app/assets/bundle/trestle/locale/nl.js +96 -0
- data/app/assets/bundle/trestle/locale/pl.js +99 -0
- data/app/assets/bundle/trestle/locale/pt-BR.js +98 -0
- data/app/assets/bundle/trestle/locale/vi.js +116 -0
- data/app/assets/bundle/trestle/locale/zh-CN.js +109 -0
- data/app/assets/bundle/trestle/photoswipe-7aa1aec9c3c1fd65c382.digested.js +6 -0
- data/app/assets/sprockets/trestle/custom.css +1 -0
- data/app/assets/sprockets/trestle/icons/font-awesome.css.erb +32 -0
- data/app/assets/sprockets/trestle/manifest.js +4 -0
- data/app/assets/stylesheets/trestle/custom.css +6 -1
- data/app/controllers/concerns/trestle/controller/helpers.rb +2 -0
- data/app/controllers/concerns/trestle/controller/location.rb +1 -6
- data/app/controllers/concerns/trestle/controller/modal.rb +23 -0
- data/app/controllers/concerns/trestle/controller/toolbars.rb +1 -1
- data/app/controllers/concerns/trestle/controller/turbo.rb +21 -0
- data/app/controllers/concerns/trestle/resource/controller/actions.rb +40 -29
- data/app/controllers/concerns/trestle/resource/controller/redirection.rb +7 -5
- data/app/controllers/trestle/admin_controller.rb +4 -0
- data/app/controllers/trestle/application_controller.rb +2 -1
- data/app/helpers/trestle/card_helper.rb +2 -2
- data/app/helpers/trestle/flash_helper.rb +10 -0
- data/app/helpers/trestle/form_helper.rb +3 -2
- data/app/helpers/trestle/format_helper.rb +2 -1
- data/app/helpers/trestle/i18n_helper.rb +46 -7
- data/app/helpers/trestle/modal_helper.rb +34 -0
- data/app/helpers/trestle/navigation_helper.rb +3 -1
- data/app/helpers/trestle/tab_helper.rb +1 -1
- data/app/helpers/trestle/toolbars_helper.rb +1 -1
- data/app/helpers/trestle/turbo_frame_helper.rb +34 -0
- data/app/helpers/trestle/url_helper.rb +7 -4
- data/app/views/layouts/trestle/admin.html.erb +16 -18
- data/app/views/layouts/trestle/admin.turbo_stream.erb +11 -0
- data/app/views/layouts/trestle/modal.html.erb +5 -0
- data/app/views/trestle/_i18n.html.erb +12 -0
- data/app/views/trestle/_theme.html.erb +15 -0
- data/app/views/trestle/application/_header.html.erb +1 -1
- data/app/views/trestle/application/_layout.html.erb +6 -3
- data/app/views/trestle/application/_modal.html.erb +36 -0
- data/app/views/trestle/application/_tabs.html.erb +4 -4
- data/app/views/trestle/flash/_alert.html.erb +1 -1
- data/app/views/trestle/flash/_debug.html.erb +1 -1
- data/app/views/trestle/resource/_form.html.erb +5 -0
- data/app/views/trestle/resource/_scopes.html.erb +1 -1
- data/app/views/trestle/resource/create.turbo_stream.erb +5 -0
- data/app/views/trestle/resource/destroy.turbo_stream.erb +1 -0
- data/app/views/trestle/resource/edit.html.erb +4 -2
- data/app/views/trestle/resource/index.html.erb +12 -10
- data/app/views/trestle/resource/new.html.erb +4 -2
- data/app/views/trestle/resource/show.html.erb +4 -2
- data/app/views/trestle/resource/update.turbo_stream.erb +5 -0
- data/app/views/trestle/shared/_sidebar.html.erb +9 -9
- data/config/locales/vi.yml +1 -1
- data/frontend/css/components/_alerts.scss +19 -17
- data/frontend/css/components/_background.scss +7 -35
- data/frontend/css/components/_badges.scss +31 -0
- data/frontend/css/components/_breadcrumbs.scss +4 -4
- data/frontend/css/components/_buttons.scss +5 -4
- data/frontend/css/components/_datepicker.scss +12 -8
- data/frontend/css/components/_dropdown.scss +23 -3
- data/frontend/css/components/{_fields.scss → _forms.scss} +16 -3
- data/frontend/css/components/_media-grid.scss +52 -44
- data/frontend/css/components/_modal.scss +33 -4
- data/frontend/css/components/_pagination.scss +1 -1
- data/frontend/css/components/_photoswipe.scss +8 -0
- data/frontend/css/components/_popover.scss +1 -0
- data/frontend/css/components/_scopes.scss +1 -1
- data/frontend/css/components/_select.scss +161 -31
- data/frontend/css/components/_table.scss +60 -65
- data/frontend/css/components/_tabs.scss +10 -3
- data/frontend/css/components/_tags.scss +71 -16
- data/frontend/css/components/_toolbars.scss +18 -31
- data/frontend/css/components/_turbo.scss +3 -0
- data/frontend/css/core/_bootstrap.scss +46 -0
- data/frontend/css/core/_dependencies.scss +4 -3
- data/frontend/css/core/_functions.scss +39 -0
- data/frontend/css/core/_mixins.scss +3 -40
- data/frontend/css/core/_theme.scss +258 -0
- data/frontend/css/core/_typography.scss +10 -1
- data/frontend/css/icons/_fontawesome.scss +3 -15
- data/frontend/css/index.scss +12 -6
- data/frontend/css/layout/_base.scss +3 -3
- data/frontend/css/layout/_content.scss +11 -7
- data/frontend/css/layout/_footer.scss +1 -1
- data/frontend/css/layout/_header.scss +5 -3
- data/frontend/css/layout/_navigation.scss +2 -2
- data/frontend/css/layout/_sidebar.scss +19 -9
- data/frontend/css/support/_sprockets.scss +2 -0
- data/frontend/css/support/_webpack.scss +2 -0
- data/frontend/css/variables/_bootstrap.scss +134 -40
- data/frontend/css/variables/_maps.scss +15 -0
- data/frontend/css/variables/_trestle.scss +55 -26
- data/frontend/js/controllers/application_controller.js +17 -0
- data/frontend/js/controllers/checkbox_select_controller.js +43 -0
- data/frontend/js/controllers/confirm_controller.js +115 -0
- data/frontend/js/controllers/confirm_delete_controller.js +11 -0
- data/frontend/js/controllers/datepicker_controller.js +12 -0
- data/frontend/js/controllers/datetimepicker_controller.js +13 -0
- data/frontend/js/controllers/deprecated/init_controller.js +9 -0
- data/frontend/js/controllers/flatpickr_controller.js +50 -0
- data/frontend/js/controllers/follow_url_controller.js +36 -0
- data/frontend/js/controllers/form_error_controller.js +24 -0
- data/frontend/js/controllers/form_loading_controller.js +50 -0
- data/frontend/js/controllers/gallery_controller.js +10 -0
- data/frontend/js/controllers/index.js +19 -0
- data/frontend/js/controllers/keyboard_submit_controller.js +25 -0
- data/frontend/js/controllers/lightbox_controller.js +160 -0
- data/frontend/js/controllers/mobile_sidebar_controller.js +30 -0
- data/frontend/js/controllers/modal_controller.js +36 -0
- data/frontend/js/controllers/modal_frame_controller.js +11 -0
- data/frontend/js/controllers/modal_trigger_controller.js +74 -0
- data/frontend/js/{components/navigation.js → controllers/navigation_controller.js} +14 -10
- data/frontend/js/controllers/navigation_tooltip_controller.js +32 -0
- data/frontend/js/controllers/popover_controller.js +87 -0
- data/frontend/js/controllers/reloadable_controller.js +34 -0
- data/frontend/js/controllers/select_controller.js +49 -0
- data/frontend/js/controllers/sidebar_controller.js +33 -0
- data/frontend/js/controllers/tab_errors_controller.js +45 -0
- data/frontend/js/controllers/tabs_controller.js +45 -0
- data/frontend/js/controllers/timepicker_controller.js +14 -0
- data/frontend/js/controllers/toggle_attr_controller.js +27 -0
- data/frontend/js/controllers/toggle_class_controller.js +27 -0
- data/frontend/js/controllers/tooltip_controller.js +13 -0
- data/frontend/js/controllers/wrapper_controller.js +43 -0
- data/frontend/js/core/backdrop.js +100 -0
- data/frontend/js/core/error_modal.js +65 -0
- data/frontend/js/core/fetch.js +32 -0
- data/frontend/js/core/i18n.js +24 -10
- data/frontend/js/core/modal.js +52 -0
- data/frontend/js/core/stream_actions.js +56 -0
- data/frontend/js/core/turbo_errors.js +9 -0
- data/frontend/js/{core → deprecated}/events.js +1 -8
- data/frontend/js/deprecated/tooltip.js +8 -0
- data/frontend/js/index.js +28 -40
- data/frontend/js/mixins/index.js +5 -0
- data/frontend/js/mixins/photoswipe.js +10 -0
- data/frontend/js/util/bootstrap.js +93 -0
- data/i18n/config.yml +14 -0
- data/i18n/environment.rb +8 -0
- data/i18n/export +3 -0
- data/i18n/template.erb +1 -0
- data/lib/generators/trestle/install/install_generator.rb +3 -8
- data/lib/generators/trestle/install/templates/trestle.rb.erb +5 -5
- data/lib/trestle/adapters/active_record_adapter.rb +1 -1
- data/lib/trestle/admin/builder.rb +7 -0
- data/lib/trestle/admin.rb +12 -6
- data/lib/trestle/color.rb +113 -0
- data/lib/trestle/configurable.rb +2 -2
- data/lib/trestle/configuration.rb +16 -8
- data/lib/trestle/engine.rb +23 -17
- data/lib/trestle/form/automatic.rb +3 -1
- data/lib/trestle/form/fields/check_box_helpers.rb +7 -18
- data/lib/trestle/form/fields/collection_select.rb +1 -1
- data/lib/trestle/form/fields/color_field.rb +4 -0
- data/lib/trestle/form/fields/date_field.rb +4 -0
- data/lib/trestle/form/fields/date_picker.rb +10 -4
- data/lib/trestle/form/fields/date_select.rb +1 -1
- data/lib/trestle/form/fields/datetime_field.rb +4 -0
- data/lib/trestle/form/fields/datetime_select.rb +1 -1
- data/lib/trestle/form/fields/file_field.rb +3 -28
- data/lib/trestle/form/fields/form_control.rb +2 -2
- data/lib/trestle/form/fields/form_group.rb +1 -1
- data/lib/trestle/form/fields/grouped_collection_select.rb +1 -1
- data/lib/trestle/form/fields/radio_button_helpers.rb +5 -17
- data/lib/trestle/form/fields/range_field.rb +1 -5
- data/lib/trestle/form/fields/select.rb +17 -1
- data/lib/trestle/form/fields/time_field.rb +4 -0
- data/lib/trestle/form/fields/time_select.rb +1 -1
- data/lib/trestle/form/fields/time_zone_select.rb +1 -1
- data/lib/trestle/form/renderer.rb +3 -0
- data/lib/trestle/form.rb +16 -1
- data/lib/trestle/hook/helpers.rb +1 -1
- data/lib/trestle/reloader.rb +2 -11
- data/lib/trestle/resource/builder.rb +1 -8
- data/lib/trestle/resource/toolbar.rb +2 -2
- data/lib/trestle/resource.rb +2 -2
- data/lib/trestle/scopes/block.rb +7 -7
- data/lib/trestle/scopes/definition.rb +2 -2
- data/lib/trestle/scopes/scope.rb +4 -0
- data/lib/trestle/table/actions_column.rb +2 -2
- data/lib/trestle/table/row.rb +2 -1
- data/lib/trestle/table/select_column.rb +3 -6
- data/lib/trestle/table.rb +6 -1
- data/lib/trestle/toolbar/item.rb +1 -1
- data/lib/trestle/toolbar/menu.rb +3 -6
- data/lib/trestle/version.rb +1 -1
- data/lib/trestle.rb +3 -20
- data/package.json +31 -27
- data/trestle.gemspec +9 -10
- data/webpack.config.js +18 -11
- data/yarn.lock +1934 -2819
- metadata +181 -179
- data/app/assets/bundle/trestle/bundle.css +0 -12
- data/app/assets/bundle/trestle/bundle.js +0 -103
- data/app/assets/bundle/trestle/fa-brands-400.eot +0 -0
- data/app/assets/bundle/trestle/fa-brands-400.svg +0 -3717
- data/app/assets/bundle/trestle/fa-brands-400.woff +0 -0
- data/app/assets/bundle/trestle/fa-regular-400.eot +0 -0
- data/app/assets/bundle/trestle/fa-regular-400.svg +0 -801
- data/app/assets/bundle/trestle/fa-regular-400.woff +0 -0
- data/app/assets/bundle/trestle/fa-solid-900.eot +0 -0
- data/app/assets/bundle/trestle/fa-solid-900.svg +0 -5034
- data/app/assets/bundle/trestle/fa-solid-900.woff +0 -0
- data/app/assets/javascripts/trestle/admin.js +0 -3
- data/app/assets/javascripts/trestle/i18n.js.erb +0 -8
- data/app/assets/stylesheets/trestle/admin.css +0 -2
- data/app/assets/stylesheets/trestle/icons/_font-awesome.css.erb +0 -40
- data/app/controllers/concerns/trestle/controller/dialog.rb +0 -16
- data/app/views/trestle/application/_dialog.html.erb +0 -34
- data/frontend/css/components/_color-vars.scss +0 -10
- data/frontend/css/components/_custom-forms.scss +0 -35
- data/frontend/css/components/_magnific-popup.scss +0 -36
- data/frontend/css/components/_turbolinks.scss +0 -3
- data/frontend/js/components/confirmation.js +0 -32
- data/frontend/js/components/datepicker.js +0 -69
- data/frontend/js/components/dialog.js +0 -149
- data/frontend/js/components/file.js +0 -7
- data/frontend/js/components/form.js +0 -100
- data/frontend/js/components/gallery.js +0 -33
- data/frontend/js/components/pagination.js +0 -51
- data/frontend/js/components/select.js +0 -18
- data/frontend/js/components/sidebar.js +0 -75
- data/frontend/js/components/table.js +0 -61
- data/frontend/js/components/tabs.js +0 -59
- data/frontend/js/components/tooltips.js +0 -25
- data/frontend/js/core/contexts.js +0 -17
- data/frontend/js/core/turbolinks.js +0 -3
- data/frontend/js/core/visit.js +0 -16
- data/frontend/theme/trestle/_theme.scss +0 -4
- data/frontend/theme/trestle/_variables.scss +0 -4
- data/frontend/theme/trestle/theme/_defaults.scss +0 -152
- data/frontend/theme/trestle/theme/_functions.scss +0 -44
- data/frontend/theme/trestle/theme/_variables.scss +0 -15
- data/frontend/theme/trestle/theme/bootstrap/_alert.scss +0 -19
- data/frontend/theme/trestle/theme/bootstrap/_badge.scss +0 -25
- data/frontend/theme/trestle/theme/bootstrap/_buttons.scss +0 -93
- data/frontend/theme/trestle/theme/bootstrap/_color-vars.scss +0 -11
- data/frontend/theme/trestle/theme/bootstrap/_custom-forms.scss +0 -93
- data/frontend/theme/trestle/theme/bootstrap/_dropdown.scss +0 -6
- data/frontend/theme/trestle/theme/bootstrap/_forms.scss +0 -6
- data/frontend/theme/trestle/theme/bootstrap/_links.scss +0 -7
- data/frontend/theme/trestle/theme/bootstrap/_list-group.scss +0 -31
- data/frontend/theme/trestle/theme/bootstrap/_nav.scss +0 -6
- data/frontend/theme/trestle/theme/bootstrap/_pagination.scss +0 -18
- data/frontend/theme/trestle/theme/bootstrap/_progress.scss +0 -3
- data/frontend/theme/trestle/theme/bootstrap/_tables.scss +0 -41
- data/frontend/theme/trestle/theme/bootstrap/_utilities.scss +0 -3
- data/frontend/theme/trestle/theme/bootstrap/utilities/_background.scss +0 -17
- data/frontend/theme/trestle/theme/bootstrap/utilities/_borders.scss +0 -5
- data/frontend/theme/trestle/theme/bootstrap/utilities/_text.scss +0 -18
- data/frontend/theme/trestle/theme/trestle/_background.scss +0 -61
- data/frontend/theme/trestle/theme/trestle/_datepicker.scss +0 -58
- data/frontend/theme/trestle/theme/trestle/_headers.scss +0 -4
- data/frontend/theme/trestle/theme/trestle/_navbar.scss +0 -15
- data/frontend/theme/trestle/theme/trestle/_navigation.scss +0 -5
- data/frontend/theme/trestle/theme/trestle/_select2.scss +0 -22
- data/frontend/theme/trestle/theme/trestle/_tags.scss +0 -12
- data/frontend/theme/trestle/theme/trestle/_turbolinks.scss +0 -3
- data/frontend/theme/trestle/theme.scss +0 -29
- data/lib/generators/trestle/install/templates/_theme.scss +0 -13
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ar-dz.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ar.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/at.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/az.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/be.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/bg.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/bn.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/bs.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/cat.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ckb.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/cs.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/cy.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/da.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/de.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/default.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/eo.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/es.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/et.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/fa.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/fi.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/fo.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/fr.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ga.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/gr.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/he.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/hi.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/hr.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/hu.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/hy.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/id.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/is.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/it.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ja.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ka.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/km.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ko.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/kz.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/lt.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/lv.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/mk.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/mn.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ms.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/my.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/nl.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/nn.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/no.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/pa.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/pl.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/pt.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ro.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ru.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/si.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sk.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sl.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sq.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sr-cyr.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sr.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sv.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/th.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/tr.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/uk.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/uz.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/uz_latn.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/vn.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/zh-tw.js +0 -0
- /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/zh.js +0 -0
- /data/app/assets/{stylesheets → sprockets}/trestle/_custom.css +0 -0
@@ -1,75 +0,0 @@
|
|
1
|
-
import $ from 'jquery'
|
2
|
-
|
3
|
-
import { ready } from '../core/events'
|
4
|
-
import cookie from '../core/cookie'
|
5
|
-
|
6
|
-
import Navigation from './navigation'
|
7
|
-
|
8
|
-
ready(function () {
|
9
|
-
const $body = $('body')
|
10
|
-
const $wrapper = $('.app-wrapper')
|
11
|
-
const $sidebar = $('.app-sidebar')
|
12
|
-
|
13
|
-
// Toggle mobile navigation using menu button
|
14
|
-
|
15
|
-
$sidebar.find('.navbar-toggler').on('click', function (e) {
|
16
|
-
e.preventDefault()
|
17
|
-
|
18
|
-
$wrapper.addClass('animate')
|
19
|
-
$body.toggleClass('mobile-nav-expanded')
|
20
|
-
})
|
21
|
-
|
22
|
-
$wrapper.on('transitionend webkitTransitionEnd', function () {
|
23
|
-
$(this).removeClass('animate')
|
24
|
-
})
|
25
|
-
|
26
|
-
// Interacting outside of the sidebar closes the navigation
|
27
|
-
|
28
|
-
$wrapper.on('click touchstart', function (e) {
|
29
|
-
const navExpanded = $('body').hasClass('mobile-nav-expanded')
|
30
|
-
|
31
|
-
const clickInHeader = $(e.target).closest('.app-header').length
|
32
|
-
const clickInSidebar = $(e.target).closest('.app-sidebar').length
|
33
|
-
|
34
|
-
if (navExpanded && !clickInHeader && !clickInSidebar) {
|
35
|
-
e.stopPropagation()
|
36
|
-
e.preventDefault()
|
37
|
-
|
38
|
-
$wrapper.addClass('animate')
|
39
|
-
$body.removeClass('mobile-nav-expanded')
|
40
|
-
}
|
41
|
-
})
|
42
|
-
|
43
|
-
// Toggle sidebar expand/collapse
|
44
|
-
|
45
|
-
$sidebar.find('.toggle-sidebar').on('click', function (e) {
|
46
|
-
e.preventDefault()
|
47
|
-
|
48
|
-
if ($body.hasClass('sidebar-expanded') || $body.hasClass('sidebar-collapsed')) {
|
49
|
-
$body.removeClass('sidebar-expanded').removeClass('sidebar-collapsed')
|
50
|
-
cookie.delete('trestle:sidebar')
|
51
|
-
} else if ($(document).width() >= 1200) {
|
52
|
-
$body.addClass('sidebar-collapsed')
|
53
|
-
cookie.set('trestle:sidebar', 'collapsed')
|
54
|
-
} else if ($(document).width() >= 768) {
|
55
|
-
$body.addClass('sidebar-expanded')
|
56
|
-
cookie.set('trestle:sidebar', 'expanded')
|
57
|
-
}
|
58
|
-
})
|
59
|
-
|
60
|
-
// Toggle navigation groups
|
61
|
-
|
62
|
-
$sidebar.find('.nav-header a').on('click', function (e) {
|
63
|
-
e.preventDefault()
|
64
|
-
|
65
|
-
const list = $(this).closest('ul')
|
66
|
-
Navigation.toggle(list)
|
67
|
-
})
|
68
|
-
|
69
|
-
// Scroll sidebar to active item
|
70
|
-
|
71
|
-
const $active = $sidebar.find('.active')
|
72
|
-
if ($active.length) {
|
73
|
-
$sidebar.find('.app-sidebar-inner').scrollTop($active.offset().top - 100)
|
74
|
-
}
|
75
|
-
})
|
@@ -1,61 +0,0 @@
|
|
1
|
-
import $ from 'jquery'
|
2
|
-
|
3
|
-
import visit from '../core/visit'
|
4
|
-
|
5
|
-
// Allow clicking on any part of a table row to follow either the table's data-url
|
6
|
-
// or the first link within the row (that is not in the actions column).
|
7
|
-
$(document).on('click', 'tr[data-url]:not([data-behavior="dialog"])', function (e) {
|
8
|
-
const row = $(e.currentTarget)
|
9
|
-
|
10
|
-
let url
|
11
|
-
|
12
|
-
if (row.data('url') === 'auto') {
|
13
|
-
url = row.find('td:not(.actions) a:first').attr('href')
|
14
|
-
} else {
|
15
|
-
url = row.data('url')
|
16
|
-
}
|
17
|
-
|
18
|
-
if (url) {
|
19
|
-
if (e.metaKey || e.ctrlKey) {
|
20
|
-
window.open(url, '_blank')
|
21
|
-
} else {
|
22
|
-
visit(url)
|
23
|
-
}
|
24
|
-
}
|
25
|
-
})
|
26
|
-
|
27
|
-
// Ignore the above event handler when clicking directly on a link or input element
|
28
|
-
$(document).on('click', 'tr[data-url] a, tr[data-url] input, .select-row', function (e) {
|
29
|
-
e.stopPropagation()
|
30
|
-
})
|
31
|
-
|
32
|
-
// Handle clicking on select all checkbox in table header
|
33
|
-
$(document).on('click', 'th.select-row input', function (e) {
|
34
|
-
const table = $(this).closest('table')
|
35
|
-
const checked = $(this).is(':checked')
|
36
|
-
|
37
|
-
table.find('td.select-row input').prop('checked', checked)
|
38
|
-
})
|
39
|
-
|
40
|
-
// Handle single row selection to update header row status
|
41
|
-
$(document).on('click', 'td.select-row input', function (e) {
|
42
|
-
const table = $(this).closest('table')
|
43
|
-
|
44
|
-
const checkboxes = table.find('td.select-row input')
|
45
|
-
const selectedCheckboxes = checkboxes.filter(':checked')
|
46
|
-
|
47
|
-
const header = table.find('th.select-row input')
|
48
|
-
|
49
|
-
if (checkboxes.length === selectedCheckboxes.length) {
|
50
|
-
// All checked
|
51
|
-
header.prop('indeterminate', false)
|
52
|
-
header.prop('checked', true)
|
53
|
-
} else if (selectedCheckboxes.length === 0) {
|
54
|
-
// None checked
|
55
|
-
header.prop('indeterminate', false)
|
56
|
-
header.prop('checked', false)
|
57
|
-
} else {
|
58
|
-
// Some checked
|
59
|
-
header.prop('indeterminate', true)
|
60
|
-
}
|
61
|
-
})
|
@@ -1,59 +0,0 @@
|
|
1
|
-
/* global history, location */
|
2
|
-
|
3
|
-
import $ from 'jquery'
|
4
|
-
|
5
|
-
import { init } from '../core/events'
|
6
|
-
|
7
|
-
const TAB_SELECTOR = 'a[data-toggle="tab"]'
|
8
|
-
const TAB_PANE_SELECTOR = '.tab-pane'
|
9
|
-
const ERROR_SELECTOR = '.has-error'
|
10
|
-
|
11
|
-
// Save active tab to URL hash
|
12
|
-
init(function (root) {
|
13
|
-
$(root).find(TAB_SELECTOR).on('shown.bs.tab', function (e) {
|
14
|
-
const hash = $(this).attr('href')
|
15
|
-
const withinModal = $(this).closest('.modal').length > 0
|
16
|
-
|
17
|
-
if (hash.substr(0, 1) === '#' && !withinModal) {
|
18
|
-
history.replaceState({ turbolinks: {} }, '', '#!' + hash.substr(1))
|
19
|
-
}
|
20
|
-
})
|
21
|
-
})
|
22
|
-
|
23
|
-
// Restore active tab when loading
|
24
|
-
init(function () {
|
25
|
-
focusActiveTab()
|
26
|
-
})
|
27
|
-
|
28
|
-
// Add error count to tabs
|
29
|
-
init(function (root) {
|
30
|
-
$(root).find(TAB_PANE_SELECTOR).each(function () {
|
31
|
-
const errorCount = $(this).find(ERROR_SELECTOR).length
|
32
|
-
|
33
|
-
if (errorCount > 0) {
|
34
|
-
const badge = $('<span>').addClass('badge badge-danger badge-pill').text(errorCount)
|
35
|
-
const id = $(this).attr('id')
|
36
|
-
const selector = `${TAB_SELECTOR}[href='#${id}']`
|
37
|
-
|
38
|
-
$(selector).append(badge)
|
39
|
-
}
|
40
|
-
})
|
41
|
-
})
|
42
|
-
|
43
|
-
export function focusTab (id) {
|
44
|
-
const selector = `${TAB_SELECTOR}[href='#${id}']`
|
45
|
-
$(selector).tab('show')
|
46
|
-
}
|
47
|
-
|
48
|
-
export function focusActiveTab () {
|
49
|
-
if (location.hash.substr(0, 2) === '#!') {
|
50
|
-
// Focus on active tab from URL
|
51
|
-
focusTab(location.hash.substr(2))
|
52
|
-
} else {
|
53
|
-
const $errorTabs = $(`${TAB_PANE_SELECTOR}:has(${ERROR_SELECTOR})`)
|
54
|
-
|
55
|
-
if ($errorTabs.length) {
|
56
|
-
focusTab($errorTabs.first().attr('id'))
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import $ from 'jquery'
|
2
|
-
|
3
|
-
import { init, ready } from '../core/events'
|
4
|
-
|
5
|
-
// Enable general tooltips and popovers
|
6
|
-
init(function (root) {
|
7
|
-
$(root).find('[data-toggle="tooltip"]').tooltip()
|
8
|
-
$(root).find('[data-toggle="popover"]').popover()
|
9
|
-
})
|
10
|
-
|
11
|
-
// Enable navigation tooltips for non-touch devices
|
12
|
-
if (!('ontouchstart' in window)) {
|
13
|
-
ready(function () {
|
14
|
-
$(document).tooltip({
|
15
|
-
selector: '.app-nav a',
|
16
|
-
trigger: 'hover',
|
17
|
-
placement: 'right',
|
18
|
-
boundary: 'window',
|
19
|
-
template: '<div class="tooltip nav-tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',
|
20
|
-
title: function () {
|
21
|
-
return $(this).find('.nav-label').text()
|
22
|
-
}
|
23
|
-
})
|
24
|
-
})
|
25
|
-
};
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import $ from 'jquery'
|
2
|
-
|
3
|
-
import { triggerInit } from './events'
|
4
|
-
|
5
|
-
export function refreshContext ($context) {
|
6
|
-
const url = $context.data('context')
|
7
|
-
|
8
|
-
$.get(url, function (data) {
|
9
|
-
$context.html(data)
|
10
|
-
triggerInit($context)
|
11
|
-
})
|
12
|
-
}
|
13
|
-
|
14
|
-
export function refreshMainContext () {
|
15
|
-
const $context = $('.app-main[data-context]')
|
16
|
-
refreshContext($context)
|
17
|
-
}
|
data/frontend/js/core/visit.js
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
/* global Turbolinks */
|
2
|
-
|
3
|
-
import turbolinks from './turbolinks'
|
4
|
-
|
5
|
-
// The visit function is used to direct the user to the given URL. It is provided as an abstraction as the redirection
|
6
|
-
// is handled differently depending on whether or not Turbolinks is enabled.
|
7
|
-
//
|
8
|
-
// Trestle.visit("/admin/pages");
|
9
|
-
//
|
10
|
-
export default function (url) {
|
11
|
-
if (turbolinks) {
|
12
|
-
Turbolinks.visit(url)
|
13
|
-
} else {
|
14
|
-
document.location = url
|
15
|
-
}
|
16
|
-
}
|
@@ -1,152 +0,0 @@
|
|
1
|
-
// Theme colors to override
|
2
|
-
|
3
|
-
$theme-colors: (
|
4
|
-
"primary": #4d6bb2
|
5
|
-
) !default;
|
6
|
-
|
7
|
-
// Set a specific jump point for requesting color jumps
|
8
|
-
$theme-color-interval: 8% !default;
|
9
|
-
|
10
|
-
// The yiq lightness value that determines when the lightness of color changes from "dark" to "light". Acceptable values are between 0 and 255.
|
11
|
-
$yiq-contrasted-threshold: 175 !default;
|
12
|
-
|
13
|
-
// Customize the light and dark text colors for use in our YIQ color contrast function.
|
14
|
-
$yiq-text-dark: #212529 !default;
|
15
|
-
$yiq-text-light: #ffffff !default;
|
16
|
-
|
17
|
-
|
18
|
-
// Links
|
19
|
-
|
20
|
-
$link-color: theme-color("primary") !default;
|
21
|
-
$link-hover-color: darken($link-color, 15%) !default;
|
22
|
-
|
23
|
-
// Darken percentage for links with `.text-*` class (e.g. `.text-success`)
|
24
|
-
$emphasized-link-hover-darken-percentage: 15% !default;
|
25
|
-
|
26
|
-
|
27
|
-
// Components
|
28
|
-
|
29
|
-
$component-active-bg: theme-color("primary") !default;
|
30
|
-
|
31
|
-
|
32
|
-
// Tables
|
33
|
-
|
34
|
-
$table-bg-level: -11 !default;
|
35
|
-
$table-border-level: -7 !default;
|
36
|
-
|
37
|
-
|
38
|
-
// Buttons + Forms
|
39
|
-
|
40
|
-
$input-btn-focus-width: .2rem !default;
|
41
|
-
$input-btn-focus-color: rgba($component-active-bg, 0.25) !default;
|
42
|
-
$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color !default;
|
43
|
-
|
44
|
-
$btn-focus-width: $input-btn-focus-width !default;
|
45
|
-
|
46
|
-
|
47
|
-
// Forms
|
48
|
-
|
49
|
-
$input-focus-border-color: lighten($component-active-bg, 25%) !default;
|
50
|
-
$input-focus-width: $input-btn-focus-width !default;
|
51
|
-
$input-focus-box-shadow: $input-btn-focus-box-shadow !default;
|
52
|
-
|
53
|
-
$custom-control-indicator-checked-bg: $component-active-bg !default;
|
54
|
-
$custom-control-indicator-checked-disabled-bg: rgba(theme-color("primary"), 0.5) !default;
|
55
|
-
$custom-control-indicator-checked-border-color: $custom-control-indicator-checked-bg !default;
|
56
|
-
|
57
|
-
$custom-control-indicator-focus-box-shadow: $input-focus-box-shadow !default;
|
58
|
-
$custom-control-indicator-focus-border-color: $input-focus-border-color !default;
|
59
|
-
|
60
|
-
$custom-control-indicator-active-bg: lighten($component-active-bg, 35%) !default;
|
61
|
-
$custom-control-indicator-active-border-color: $custom-control-indicator-active-bg !default;
|
62
|
-
|
63
|
-
$custom-checkbox-indicator-indeterminate-bg: $component-active-bg !default;
|
64
|
-
$custom-checkbox-indicator-indeterminate-border-color: $custom-checkbox-indicator-indeterminate-bg !default;
|
65
|
-
|
66
|
-
$custom-select-focus-border-color: $input-focus-border-color !default;
|
67
|
-
$custom-select-focus-width: $input-focus-width !default;
|
68
|
-
$custom-select-focus-box-shadow: 0 0 0 $custom-select-focus-width $input-btn-focus-color !default;
|
69
|
-
|
70
|
-
$custom-range-thumb-bg: $component-active-bg !default;
|
71
|
-
$custom-range-thumb-active-bg: lighten($component-active-bg, 35%) !default;
|
72
|
-
|
73
|
-
$custom-file-focus-border-color: $input-focus-border-color !default;
|
74
|
-
$custom-file-focus-box-shadow: $input-focus-box-shadow !default;
|
75
|
-
|
76
|
-
|
77
|
-
// Navs
|
78
|
-
|
79
|
-
$nav-pills-link-active-bg: $component-active-bg !default;
|
80
|
-
|
81
|
-
|
82
|
-
// Navbar
|
83
|
-
|
84
|
-
$sidebar-mobile-toggle-bg: transparent !default;
|
85
|
-
$sidebar-mobile-toggle-color: white !default;
|
86
|
-
$sidebar-mobile-toggle-border: 1px solid rgba($sidebar-mobile-toggle-color, 0.15) !default;
|
87
|
-
|
88
|
-
$sidebar-mobile-toggle-active-bg: rgba($sidebar-mobile-toggle-color, 0.1) !default;
|
89
|
-
$sidebar-mobile-toggle-active-border: $sidebar-mobile-toggle-border !default;
|
90
|
-
|
91
|
-
$sidebar-mobile-toggle-icon-bg: str-replace(url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='#{$sidebar-mobile-toggle-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"), "#", "%23") !default;
|
92
|
-
|
93
|
-
|
94
|
-
// Dropdowns
|
95
|
-
|
96
|
-
$dropdown-link-active-bg: $component-active-bg !default;
|
97
|
-
|
98
|
-
|
99
|
-
// Pagination
|
100
|
-
|
101
|
-
$pagination-color: $link-color !default;
|
102
|
-
|
103
|
-
$pagination-focus-box-shadow: $input-btn-focus-box-shadow !default;
|
104
|
-
|
105
|
-
$pagination-hover-color: $link-hover-color !default;
|
106
|
-
|
107
|
-
$pagination-active-bg: $component-active-bg !default;
|
108
|
-
$pagination-active-border-color: $pagination-active-bg !default;
|
109
|
-
|
110
|
-
|
111
|
-
// Badges
|
112
|
-
|
113
|
-
$badge-focus-width: $input-btn-focus-width !default;
|
114
|
-
|
115
|
-
|
116
|
-
// Alerts
|
117
|
-
|
118
|
-
$alert-bg-level: 2 !default;
|
119
|
-
$alert-border-level: 3 !default;
|
120
|
-
$alert-color-level: -12 !default;
|
121
|
-
|
122
|
-
|
123
|
-
// Progress bars
|
124
|
-
|
125
|
-
$progress-bar-bg: theme-color("primary") !default;
|
126
|
-
|
127
|
-
|
128
|
-
// List group
|
129
|
-
|
130
|
-
$list-group-active-bg: $component-active-bg !default;
|
131
|
-
$list-group-active-border-color: $list-group-active-bg !default;
|
132
|
-
|
133
|
-
|
134
|
-
// Select2
|
135
|
-
|
136
|
-
$s2bs-input-border-focus: $input-focus-border-color !default;
|
137
|
-
$s2bs-form-control-focus-box-shadow: $input-focus-box-shadow !default;
|
138
|
-
$s2bs-dropdown-link-active-bg: $dropdown-link-active-bg !default;
|
139
|
-
|
140
|
-
|
141
|
-
// Trestle
|
142
|
-
|
143
|
-
$theme-bg: null !default;
|
144
|
-
$theme-bg-color: darken(theme-color("primary"), 15%) !default;
|
145
|
-
|
146
|
-
$sidebar-active-border-color: theme-color("primary") !default;
|
147
|
-
|
148
|
-
$tag-bg: lighten(theme-color("primary"), 10%) !default;
|
149
|
-
$tag-border: theme-color("primary") !default;
|
150
|
-
|
151
|
-
$tag-hover-bg: theme-color("primary") !default;
|
152
|
-
$tag-hover-border: darken(theme-color("primary"), 10%) !default;
|
@@ -1,44 +0,0 @@
|
|
1
|
-
// Replace `$search` with `$replace` in `$string`
|
2
|
-
@function str-replace($string, $search, $replace: "") {
|
3
|
-
$index: str-index($string, $search);
|
4
|
-
|
5
|
-
@if $index {
|
6
|
-
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
|
7
|
-
}
|
8
|
-
|
9
|
-
@return $string;
|
10
|
-
}
|
11
|
-
|
12
|
-
// Color contrast
|
13
|
-
@function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
|
14
|
-
$r: red($color);
|
15
|
-
$g: green($color);
|
16
|
-
$b: blue($color);
|
17
|
-
|
18
|
-
$yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
|
19
|
-
|
20
|
-
@if ($yiq >= $yiq-contrasted-threshold) {
|
21
|
-
@return $dark;
|
22
|
-
} @else {
|
23
|
-
@return $light;
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
|
-
// Retrieve color Sass maps
|
28
|
-
@function theme-color($key: "primary") {
|
29
|
-
@return map-get($theme-colors, $key);
|
30
|
-
}
|
31
|
-
|
32
|
-
// Request a theme color level
|
33
|
-
@function theme-color-level($color-name: "primary", $level: 0) {
|
34
|
-
$color: theme-color($color-name);
|
35
|
-
$color-base: if($level > 0, black, white);
|
36
|
-
$level: abs($level);
|
37
|
-
|
38
|
-
@return mix($color-base, $color, $level * $theme-color-interval);
|
39
|
-
}
|
40
|
-
|
41
|
-
@function gradient-mask($color, $alpha) {
|
42
|
-
$mask: rgba($color, $alpha);
|
43
|
-
@return linear-gradient($mask, $mask);
|
44
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
$theme-colors: null !default;
|
2
|
-
|
3
|
-
// Import deprecated user-defined variables
|
4
|
-
@import "trestle/_variables";
|
5
|
-
|
6
|
-
$brand-primary: false !default;
|
7
|
-
|
8
|
-
@if $brand-primary != false {
|
9
|
-
$theme-colors: (
|
10
|
-
"primary": $brand-primary
|
11
|
-
);
|
12
|
-
}
|
13
|
-
|
14
|
-
// Import user-defined theme variables
|
15
|
-
@import "trestle/_theme";
|
@@ -1,19 +0,0 @@
|
|
1
|
-
@mixin alert-variant($background, $border, $color) {
|
2
|
-
color: $color;
|
3
|
-
background-color: $background;
|
4
|
-
border-color: $border;
|
5
|
-
|
6
|
-
hr {
|
7
|
-
border-top-color: darken($border, 5%);
|
8
|
-
}
|
9
|
-
|
10
|
-
.alert-link {
|
11
|
-
color: darken($color, 10%);
|
12
|
-
}
|
13
|
-
}
|
14
|
-
|
15
|
-
@each $color, $value in $theme-colors {
|
16
|
-
.alert-#{$color} {
|
17
|
-
@include alert-variant(theme-color-level($color, $alert-bg-level), theme-color-level($color, $alert-border-level), theme-color-level($color, $alert-color-level));
|
18
|
-
}
|
19
|
-
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
@mixin badge-variant($bg) {
|
2
|
-
color: color-yiq($bg);
|
3
|
-
background-color: $bg;
|
4
|
-
|
5
|
-
@at-root a#{&} {
|
6
|
-
&:hover,
|
7
|
-
&:focus {
|
8
|
-
color: color-yiq($bg);
|
9
|
-
background-color: darken($bg, 10%);
|
10
|
-
}
|
11
|
-
|
12
|
-
&:focus,
|
13
|
-
&.focus {
|
14
|
-
outline: 0;
|
15
|
-
box-shadow: 0 0 0 $badge-focus-width rgba($bg, .5);
|
16
|
-
}
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
|
21
|
-
@each $color, $value in $theme-colors {
|
22
|
-
.badge-#{$color} {
|
23
|
-
@include badge-variant($value);
|
24
|
-
}
|
25
|
-
}
|
@@ -1,93 +0,0 @@
|
|
1
|
-
@mixin button-variant($background, $border, $hover-background: darken($background, 7.5%), $hover-border: darken($border, 10%), $active-background: darken($background, 10%), $active-border: darken($border, 12.5%)) {
|
2
|
-
color: color-yiq($background);
|
3
|
-
background-color: $background;
|
4
|
-
border-color: $border;
|
5
|
-
|
6
|
-
&:hover {
|
7
|
-
color: color-yiq($hover-background);
|
8
|
-
background-color: $hover-background;
|
9
|
-
border-color: $hover-border;
|
10
|
-
}
|
11
|
-
|
12
|
-
&:focus,
|
13
|
-
&.focus {
|
14
|
-
color: color-yiq($hover-background);
|
15
|
-
background-color: $hover-background;
|
16
|
-
border-color: $hover-border;
|
17
|
-
box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
|
18
|
-
}
|
19
|
-
|
20
|
-
// Disabled comes first so active can properly restyle
|
21
|
-
&.disabled,
|
22
|
-
&:disabled {
|
23
|
-
color: color-yiq($background);
|
24
|
-
background-color: $background;
|
25
|
-
border-color: $border;
|
26
|
-
}
|
27
|
-
|
28
|
-
&:not(:disabled):not(.disabled):active,
|
29
|
-
&:not(:disabled):not(.disabled).active,
|
30
|
-
.show > &.dropdown-toggle {
|
31
|
-
color: color-yiq($active-background);
|
32
|
-
background-color: $active-background;
|
33
|
-
border-color: $active-border;
|
34
|
-
|
35
|
-
&:focus {
|
36
|
-
box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
|
37
|
-
}
|
38
|
-
}
|
39
|
-
}
|
40
|
-
|
41
|
-
@mixin button-outline-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) {
|
42
|
-
color: $color;
|
43
|
-
border-color: $color;
|
44
|
-
|
45
|
-
&:hover {
|
46
|
-
color: $color-hover;
|
47
|
-
background-color: $active-background;
|
48
|
-
border-color: $active-border;
|
49
|
-
}
|
50
|
-
|
51
|
-
&:focus,
|
52
|
-
&.focus {
|
53
|
-
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
|
54
|
-
}
|
55
|
-
|
56
|
-
&.disabled,
|
57
|
-
&:disabled {
|
58
|
-
color: $color;
|
59
|
-
background-color: transparent;
|
60
|
-
}
|
61
|
-
|
62
|
-
&:not(:disabled):not(.disabled):active,
|
63
|
-
&:not(:disabled):not(.disabled).active,
|
64
|
-
.show > &.dropdown-toggle {
|
65
|
-
color: color-yiq($active-background);
|
66
|
-
background-color: $active-background;
|
67
|
-
border-color: $active-border;
|
68
|
-
|
69
|
-
&:focus {
|
70
|
-
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}
|
74
|
-
|
75
|
-
@each $color, $value in $theme-colors {
|
76
|
-
.btn-#{$color} {
|
77
|
-
@include button-variant($value, $value);
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
@each $color, $value in $theme-colors {
|
82
|
-
.btn-outline-#{$color} {
|
83
|
-
@include button-outline-variant($value);
|
84
|
-
}
|
85
|
-
}
|
86
|
-
|
87
|
-
.btn-link {
|
88
|
-
color: $link-color;
|
89
|
-
|
90
|
-
&:hover {
|
91
|
-
color: $link-hover-color;
|
92
|
-
}
|
93
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
:root {
|
2
|
-
@each $color, $value in $theme-colors {
|
3
|
-
--#{$color}: #{$value};
|
4
|
-
|
5
|
-
--#{$color}-rgb: #{red($value), green($value), blue($value)};
|
6
|
-
|
7
|
-
--#{$color}-hue: #{hue($value)};
|
8
|
-
--#{$color}-saturation: #{saturation($value)};
|
9
|
-
--#{$color}-lightness: #{lightness($value)};
|
10
|
-
}
|
11
|
-
}
|