ui_bibz 3.0.13 → 4.0.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +3 -3
- data/.github/workflows/linter.yml +13 -12
- data/.overcommit.yml +6 -0
- data/.rubocop.yml +6 -0
- data/.ruby-version +1 -1
- data/Gemfile +19 -12
- data/Gemfile.lock +219 -148
- data/app/assets/config/ui_bibz.js +14 -0
- data/app/assets/javascripts/controllers/combobox_controller.js +37 -0
- data/app/assets/javascripts/forms/formula.js +82 -0
- data/app/assets/javascripts/forms/input-connected.js +132 -0
- data/app/assets/javascripts/forms/jquery.multi-select-extend.js +52 -0
- data/app/assets/javascripts/forms.js +160 -0
- data/app/assets/javascripts/interfaces.js +56 -0
- data/app/assets/javascripts/tables.js +49 -0
- data/app/assets/javascripts/ui_bibz_js.js +37 -0
- data/app/assets/stylesheets/navigations/_nav.sass +2 -0
- data/app/assets/stylesheets/navigations/_navbar.sass +12 -0
- data/app/assets/stylesheets/navigations/_progress_bar.sass +2 -0
- data/app/assets/stylesheets/navigations/_toolbar.sass +3 -0
- data/app/assets/stylesheets/sass/_boxes.sass +1 -0
- data/app/assets/stylesheets/sass/_containers.sass +2 -0
- data/app/assets/stylesheets/sass/_fixes.sass +2 -0
- data/app/assets/stylesheets/sass/_forms.sass +9 -0
- data/app/assets/stylesheets/sass/_navigations.sass +4 -0
- data/app/assets/stylesheets/sass/_notifications.sass +4 -0
- data/app/assets/stylesheets/sass/_tables.sass +2 -0
- data/app/assets/stylesheets/sass/_variables_mixins_functions.sass +3 -0
- data/app/assets/stylesheets/sass/boxes/_card.sass +4 -0
- data/app/assets/stylesheets/sass/containers/_panel.scss +330 -0
- data/app/assets/stylesheets/sass/forms/_bootstrap_select.sass +5 -0
- data/app/assets/stylesheets/sass/forms/_button.sass +3 -0
- data/app/assets/stylesheets/sass/forms/_combobox.sass +32 -0
- data/app/assets/stylesheets/sass/forms/_date_picker.sass +3 -0
- data/app/assets/stylesheets/sass/forms/_form_check.sass +10 -0
- data/app/assets/stylesheets/sass/forms/_formula_field.sass +17 -0
- data/app/assets/stylesheets/sass/forms/_multiselect.sass +44 -0
- data/app/assets/stylesheets/sass/forms/_range.sass +44 -0
- data/app/assets/stylesheets/sass/forms/_slider.sass +136 -0
- data/app/assets/stylesheets/sass/forms/_surround_field.sass +25 -0
- data/app/assets/stylesheets/sass/notifications/_badge.sass +5 -0
- data/app/assets/stylesheets/sass/notifications/_glyph.sass +3 -0
- data/app/assets/stylesheets/sass/notifications/_star.sass +2 -0
- data/app/assets/stylesheets/sass/notifications/_toast.sass +3 -0
- data/app/assets/stylesheets/sass/tables/_table.sass +39 -0
- data/app/assets/stylesheets/sass/tables/_table_card.sass +39 -0
- data/app/assets/stylesheets/ui_bibz.sass +26 -0
- data/bin/test +3 -5
- data/config/importmap.rb +21 -0
- data/config/initializers/assets.rb +5 -0
- data/config/initializers/will_paginate.rb +1 -3
- data/lib/ui_bibz/builders/data_html_options_builder.rb +118 -0
- data/lib/ui_bibz/builders/html_classes_builder.rb +89 -0
- data/lib/ui_bibz/builders/html_options_builder.rb +22 -0
- data/lib/ui_bibz/factory_methods/component_initialize_factory_method.rb +33 -0
- data/lib/ui_bibz/helpers/ui/core/boxes_helper.rb +12 -12
- data/lib/ui_bibz/helpers/ui/core/forms_helper.rb +58 -50
- data/lib/ui_bibz/helpers/ui/core/icons_helper.rb +6 -6
- data/lib/ui_bibz/helpers/ui/core/layouts_helper.rb +2 -2
- data/lib/ui_bibz/helpers/ui/core/lists_helper.rb +2 -2
- data/lib/ui_bibz/helpers/ui/core/navigations_helper.rb +12 -12
- data/lib/ui_bibz/helpers/ui/core/notifications_helper.rb +4 -4
- data/lib/ui_bibz/helpers/ui/core/windows_helper.rb +10 -2
- data/lib/ui_bibz/helpers/ui/ux_helper.rb +2 -2
- data/lib/ui_bibz/helpers/utils_helper.rb +2 -2
- data/lib/ui_bibz/infos.rb +3 -3
- data/lib/ui_bibz/inputs/ui_bibz_form/ui_bibz_form_builder.rb +12 -12
- data/lib/ui_bibz/inputs/ui_bibz_inputs/collection_input.rb +1 -1
- data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_combobox_field_input.rb +15 -0
- data/lib/ui_bibz/rails/engine.rb +21 -4
- data/lib/ui_bibz/strategies/component_initialize_abstract_strategy.rb +27 -0
- data/lib/ui_bibz/strategies/component_initialize_block_strategy.rb +31 -0
- data/lib/ui_bibz/strategies/component_initialize_hash_strategy.rb +18 -0
- data/lib/ui_bibz/strategies/component_initialize_standard_strategy.rb +18 -0
- data/lib/ui_bibz/ui/concerns/card_itemable_concern.rb +4 -4
- data/lib/ui_bibz/ui/concerns/notification_concern.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card_accordion.rb +4 -4
- data/lib/ui_bibz/ui/core/boxes/card_column.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card_deck.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card_grid.rb +0 -3
- data/lib/ui_bibz/ui/core/boxes/card_group.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +9 -9
- data/lib/ui_bibz/ui/core/boxes/components/card_col.rb +2 -2
- data/lib/ui_bibz/ui/core/boxes/components/card_list_group.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/card_row.rb +1 -1
- data/lib/ui_bibz/ui/core/component.rb +13 -62
- data/lib/ui_bibz/ui/core/forms/buttons/button.rb +3 -1
- data/lib/ui_bibz/ui/core/forms/buttons/button_group.rb +11 -11
- data/lib/ui_bibz/ui/core/forms/choices/box_switch_field.rb +7 -7
- data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +2 -2
- data/lib/ui_bibz/ui/core/forms/choices/choice_group.rb +5 -6
- data/lib/ui_bibz/ui/core/forms/choices/components/choice.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb +15 -15
- data/lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_link.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +5 -5
- data/lib/ui_bibz/ui/core/forms/numbers/slider_field.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +10 -10
- data/lib/ui_bibz/ui/core/forms/selects/multi_column_field.rb +2 -2
- data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +32 -32
- data/lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb +7 -8
- data/lib/ui_bibz/ui/core/forms/texts/combobox_field.rb +96 -0
- data/lib/ui_bibz/ui/core/icons/components/glyph_text.rb +1 -1
- data/lib/ui_bibz/ui/core/icons/glyph.rb +4 -3
- data/lib/ui_bibz/ui/core/layouts/row.rb +2 -2
- data/lib/ui_bibz/ui/core/lists/components/list.rb +4 -4
- data/lib/ui_bibz/ui/core/lists/list_group.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/breadcrumb.rb +6 -4
- data/lib/ui_bibz/ui/core/navigations/components/nav_link_span.rb +1 -2
- data/lib/ui_bibz/ui/core/navigations/components/navbar_form.rb +6 -5
- data/lib/ui_bibz/ui/core/navigations/components/toolbar_form.rb +2 -2
- data/lib/ui_bibz/ui/core/navigations/nav.rb +10 -6
- data/lib/ui_bibz/ui/core/navigations/navbar.rb +21 -19
- data/lib/ui_bibz/ui/core/navigations/pagination.rb +3 -3
- data/lib/ui_bibz/ui/core/navigations/toolbar.rb +5 -5
- data/lib/ui_bibz/ui/core/notifications/alert.rb +4 -5
- data/lib/ui_bibz/ui/core/notifications/badge.rb +6 -2
- data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +1 -1
- data/lib/ui_bibz/ui/core/notifications/progress_bar.rb +3 -3
- data/lib/ui_bibz/ui/core/notifications/toast.rb +8 -9
- data/lib/ui_bibz/ui/core/windows/components/offcanvas_body.rb +47 -0
- data/lib/ui_bibz/ui/core/windows/components/offcanvas_header.rb +54 -0
- data/lib/ui_bibz/ui/core/windows/modal.rb +9 -9
- data/lib/ui_bibz/ui/core/windows/offcanvas.rb +84 -0
- data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +4 -20
- data/lib/ui_bibz/ui/extensions/core/component/klass_extension.rb +11 -19
- data/lib/ui_bibz/ui/extensions/core/forms/connect_extension.rb +1 -1
- data/lib/ui_bibz/ui/ux/containers/components/panel_column.rb +3 -3
- data/lib/ui_bibz/ui/ux/containers/components/panel_deck.rb +3 -3
- data/lib/ui_bibz/ui/ux/containers/components/panel_group.rb +3 -3
- data/lib/ui_bibz/ui/ux/containers/components/panel_header.rb +4 -4
- data/lib/ui_bibz/ui/ux/containers/panel.rb +13 -13
- data/lib/ui_bibz/ui/ux/tables/components/actions.rb +4 -4
- data/lib/ui_bibz/ui/ux/tables/components/column.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/components/columns.rb +2 -2
- data/lib/ui_bibz/ui/ux/tables/extensions/sortable.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/table.rb +5 -5
- data/lib/ui_bibz/ui/ux/tables/table_card.rb +6 -6
- data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +1 -1
- data/lib/ui_bibz/utils/breakdown_class_name_generator.rb +3 -3
- data/lib/ui_bibz/utils/screwdriver.rb +1 -1
- data/lib/ui_bibz/view_objects/glyph_component_view_object.rb +38 -0
- data/lib/ui_bibz.rb +26 -0
- data/test/builders/data_html_classes_builder_test.rb +37 -0
- data/test/builders/html_classes_builder_test.rb +76 -0
- data/test/dummy/Rakefile +1 -1
- data/test/dummy/app/assets/stylesheets/application.css +1 -15
- data/test/dummy/app/channels/application_cable/channel.rb +6 -0
- data/test/dummy/app/channels/application_cable/connection.rb +6 -0
- data/test/dummy/app/jobs/application_job.rb +9 -0
- data/test/dummy/app/mailers/application_mailer.rb +6 -0
- data/test/dummy/app/views/layouts/application.html.erb +10 -12
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/rails +3 -3
- data/test/dummy/bin/rake +2 -2
- data/test/dummy/bin/setup +12 -12
- data/test/dummy/config/application.rb +13 -17
- data/test/dummy/config/boot.rb +3 -3
- data/test/dummy/config/database.yml +2 -2
- data/test/dummy/config/environment.rb +1 -1
- data/test/dummy/config/environments/development.rb +21 -16
- data/test/dummy/config/environments/production.rb +16 -41
- data/test/dummy/config/environments/test.rb +19 -8
- data/test/dummy/config/importmap.rb +11 -0
- data/test/dummy/config/initializers/content_security_policy.rb +21 -24
- data/test/dummy/config/initializers/filter_parameter_logging.rb +6 -2
- data/test/dummy/config/initializers/inflections.rb +4 -4
- data/test/dummy/config/initializers/permissions_policy.rb +12 -0
- data/test/dummy/config/locales/en.yml +13 -3
- data/test/dummy/config/puma.rb +7 -2
- data/test/dummy/config/storage.yml +5 -5
- data/test/dummy/config.ru +2 -1
- data/test/simple_form_test.rb +24 -24
- data/test/ui/core/boxes/card_test.rb +2 -1
- data/test/ui/core/component_test.rb +2 -2
- data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_link_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_refresh_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_test.rb +2 -2
- data/test/ui/core/forms/choices/box_switch_field_test.rb +10 -10
- data/test/ui/core/forms/choices/checkbox_field_test.rb +1 -1
- data/test/ui/core/forms/choices/choice_group_test.rb +1 -1
- data/test/ui/core/forms/dropdowns/dropdown_test.rb +1 -1
- data/test/ui/core/forms/numbers/formula_field_test.rb +1 -1
- data/test/ui/core/forms/selects/dropdown_select_field_test.rb +2 -2
- data/test/ui/core/forms/selects/select_field_test.rb +1 -1
- data/test/ui/core/forms/surrounds/surround_field_test.rb +4 -4
- data/test/ui/core/forms/texts/auto_complete_field_test.rb +2 -2
- data/test/ui/core/forms/texts/combobox_field_test.rb +19 -0
- data/test/ui/core/icons/glyph_test.rb +8 -4
- data/test/ui/core/icons/star_test.rb +12 -6
- data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
- data/test/ui/core/navigations/link_test.rb +1 -1
- data/test/ui/core/navigations/nav_test.rb +11 -0
- data/test/ui/core/notifications/alert_test.rb +1 -1
- data/test/ui/core/notifications/badge_test.rb +3 -3
- data/test/ui/core/notifications/popover_test.rb +4 -4
- data/test/ui/core/notifications/spinner_test.rb +1 -1
- data/test/ui/core/notifications/toast_test.rb +1 -1
- data/test/ui/core/notifications/tooltip_test.rb +4 -4
- data/test/ui/core/windows/offcanvas_test.rb +27 -0
- data/test/ui/ux/containers/panel_test.rb +1 -1
- data/test/ui/ux/tables/table_test.rb +3 -3
- data/test/view_objects/glyph_component_view_object_test.rb +17 -0
- data/ui_bibz.gemspec +6 -20
- data/vendor/assets/fonts/fontawesome/fa-brands-400.ttf +0 -0
- data/vendor/assets/fonts/fontawesome/fa-brands-400.woff2 +0 -0
- data/vendor/assets/fonts/fontawesome/fa-regular-400.ttf +0 -0
- data/vendor/assets/fonts/fontawesome/fa-regular-400.woff2 +0 -0
- data/vendor/assets/fonts/fontawesome/fa-solid-900.ttf +0 -0
- data/vendor/assets/fonts/fontawesome/fa-solid-900.woff2 +0 -0
- data/vendor/assets/fonts/fontawesome/fa-v4compatibility.ttf +0 -0
- data/vendor/assets/fonts/fontawesome/fa-v4compatibility.woff2 +0 -0
- data/vendor/assets/javascripts/bootstrap-markdown.js +1 -1555
- data/vendor/assets/javascripts/bootstrap-multiselect.min.js +40 -1176
- data/vendor/assets/javascripts/bootstrap-switch.min.js +9 -21
- data/vendor/assets/javascripts/bs-custom-file-input.min.js +0 -1
- data/vendor/assets/javascripts/debounce.js +51 -0
- data/vendor/assets/javascripts/fontawesome/all.js +5977 -0
- data/vendor/assets/javascripts/fontawesome/all.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/brands.js +749 -0
- data/vendor/assets/javascripts/fontawesome/brands.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/conflict-detection.js +1138 -0
- data/vendor/assets/javascripts/fontawesome/conflict-detection.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/fontawesome.js +3126 -0
- data/vendor/assets/javascripts/fontawesome/fontawesome.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/regular.js +445 -0
- data/vendor/assets/javascripts/fontawesome/regular.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/solid.js +1672 -0
- data/vendor/assets/javascripts/fontawesome/solid.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/v4-shims.js +225 -0
- data/vendor/assets/javascripts/fontawesome/v4-shims.min.js +6 -0
- data/vendor/assets/javascripts/fuzzysort.js +562 -0
- data/vendor/assets/javascripts/jquery-3.7.0.min.js +2 -0
- data/vendor/assets/javascripts/jquery.multi-select.min.js +725 -1
- data/vendor/assets/stylesheets/bootstrap-multiselect.sass +115 -0
- data/vendor/assets/stylesheets/bootstrap-switch.scss +211 -0
- data/vendor/assets/stylesheets/fontawesome/_animated.scss +142 -9
- data/vendor/assets/stylesheets/fontawesome/_bordered-pulled.scss +13 -13
- data/vendor/assets/stylesheets/fontawesome/_core.scss +28 -6
- data/vendor/assets/stylesheets/fontawesome/_fixed-width.scss +2 -1
- data/vendor/assets/stylesheets/fontawesome/_functions.scss +57 -0
- data/vendor/assets/stylesheets/fontawesome/_icons.scss +7 -1438
- data/vendor/assets/stylesheets/fontawesome/_list.scss +4 -4
- data/vendor/assets/stylesheets/fontawesome/_mixins.scss +53 -34
- data/vendor/assets/stylesheets/fontawesome/_rotated-flipped.scss +25 -18
- data/vendor/assets/stylesheets/fontawesome/_screen-reader.scss +12 -3
- data/vendor/assets/stylesheets/fontawesome/_shims.scss +640 -664
- data/vendor/assets/stylesheets/fontawesome/_sizing.scss +16 -0
- data/vendor/assets/stylesheets/fontawesome/_stacked.scss +5 -4
- data/vendor/assets/stylesheets/fontawesome/_variables.scss +4896 -1393
- data/vendor/assets/stylesheets/fontawesome/brands.scss +17 -10
- data/vendor/assets/stylesheets/fontawesome/fontawesome.scss +7 -2
- data/vendor/assets/stylesheets/fontawesome/regular.scss +13 -10
- data/vendor/assets/stylesheets/fontawesome/solid.scss +13 -11
- data/vendor/assets/stylesheets/fontawesome/v4-shims.scss +6 -1
- data/vendor/assets/stylesheets/multi-select.css +92 -0
- metadata +126 -348
- data/.gitlab-ci.yml +0 -17
- data/.travis.yml +0 -24
- data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +0 -70
- data/structure.md +0 -68
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/dummy/app/javascripts/packs/index.js +0 -3
- data/test/dummy/config/initializers/application_controller_renderer.rb +0 -9
- data/test/dummy/config/initializers/assets.rb +0 -14
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -8
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -7
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/session_store.rb +0 -5
- data/test/dummy/config/initializers/ui_bibz.rb +0 -5
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -16
- data/test/dummy/config/secrets.yml +0 -22
- data/test/dummy/config/spring.rb +0 -8
- data/test/dummy/test/models/user_test.rb +0 -9
- data/vendor/assets/fonts/fa-brands-400.eot +0 -0
- data/vendor/assets/fonts/fa-brands-400.svg +0 -3570
- data/vendor/assets/fonts/fa-brands-400.ttf +0 -0
- data/vendor/assets/fonts/fa-brands-400.woff +0 -0
- data/vendor/assets/fonts/fa-brands-400.woff2 +0 -0
- data/vendor/assets/fonts/fa-regular-400.eot +0 -0
- data/vendor/assets/fonts/fa-regular-400.svg +0 -803
- data/vendor/assets/fonts/fa-regular-400.ttf +0 -0
- data/vendor/assets/fonts/fa-regular-400.woff +0 -0
- data/vendor/assets/fonts/fa-regular-400.woff2 +0 -0
- data/vendor/assets/fonts/fa-solid-900.eot +0 -0
- data/vendor/assets/fonts/fa-solid-900.svg +0 -4938
- data/vendor/assets/fonts/fa-solid-900.ttf +0 -0
- data/vendor/assets/fonts/fa-solid-900.woff +0 -0
- data/vendor/assets/fonts/fa-solid-900.woff2 +0 -0
- data/vendor/assets/javascripts/all.js +0 -4441
- data/vendor/assets/javascripts/all.min.js +0 -5
- data/vendor/assets/stylesheets/all.min.css +0 -5
- data/vendor/assets/stylesheets/fontawesome/_larger.scss +0 -23
- data/vendor/assets/stylesheets/svg-with-js.css +0 -5
- /data/{test/dummy/app/mailers/.keep → app/assets/stylesheets/sass/forms/_dropdown.sass} +0 -0
- /data/{test/dummy/app/views/users/index.html.erb → app/assets/stylesheets/sass/forms/_input_refresh_button.sass} +0 -0
@@ -0,0 +1,82 @@
|
|
1
|
+
// http://www.developpez.net/forums/d940195-2/webmasters-developpement-web/general-conception-web/contribuez/eval-calcul-risque/
|
2
|
+
export default class Formula {
|
3
|
+
|
4
|
+
constructor(){
|
5
|
+
this.res = ""
|
6
|
+
|
7
|
+
this.t = {
|
8
|
+
x: "*",
|
9
|
+
X: "*",
|
10
|
+
":": "/"
|
11
|
+
};
|
12
|
+
|
13
|
+
this.rg = {
|
14
|
+
"/[^\\+\\*\\/\\-\\(\\)\\s\\d\\.]/": "It is not a number",
|
15
|
+
"/[\\+\\*\\/\\-\\(]\\)/": "Parenthesis ending with a incorrect expression.",
|
16
|
+
"/([\\+\\x\\*\\/\\-]{2,})|([\\+\\x\\*\\/\\-]\\s[\\+\\x\\*\\/\\-])/i": "Multiple Operators in a row.",
|
17
|
+
"/(\\D\\.)|(\\.[\\D\\s]+)|(\\.\\d+\\.)/": "Wrong Decimal.",
|
18
|
+
"/\\d\\s+\\d/": "Cut Integer.",
|
19
|
+
"/\\([\\/\\*]/": "First operator within parenthesis is wrong.",
|
20
|
+
"/^[\\*\\/]+/": "First operator within string is wrong"
|
21
|
+
};
|
22
|
+
|
23
|
+
this.rg2 = {
|
24
|
+
"/\\s+/g": " ",
|
25
|
+
"/([^\\.\\,\\;\\d]|^)0+([\\,\\.\\;\\d])/g": "$10$2",
|
26
|
+
"/[,;]/g": ".",
|
27
|
+
"/([^\\d\\.\\,\\;])0+(\\d)/g": "$1$2",
|
28
|
+
"/^(0)(\\d)/g": "$2",
|
29
|
+
"/[\\[\\]\\|\\&\\=\\!]/g": "",
|
30
|
+
"/([\\d\\)])(\\()/g": "$1*$2",
|
31
|
+
"/(\\))([\\d\\(])/g": "$1*$2",
|
32
|
+
"/\\/+/g": "/",
|
33
|
+
"/[xX:]/g"(o) {
|
34
|
+
return t[o];
|
35
|
+
},
|
36
|
+
|
37
|
+
"/\\/+/g": "/"
|
38
|
+
};
|
39
|
+
}
|
40
|
+
|
41
|
+
suite(q) {
|
42
|
+
const me = this;
|
43
|
+
const par1 = q.match(/\(/g);
|
44
|
+
const par2 = q.match(/\)/g);
|
45
|
+
if (((par1 != null) && (par2 != null) && (par1.length !== par2.length)) || ((par1 == null) && (par2 != null)) || ((par1 != null) && (par2 == null))) {
|
46
|
+
return me.res = "Unclosed parenthesis.";
|
47
|
+
} else if (/.*[\+x\*\/\-]$/.test(q)) {
|
48
|
+
return me.res = "Formula ending with an operator.";
|
49
|
+
} else {
|
50
|
+
return me.res = "Undefined Error.";
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
go(ch) {
|
55
|
+
let i;
|
56
|
+
const me = this;
|
57
|
+
let flag = 0;
|
58
|
+
for (i in me.rg2) {
|
59
|
+
ch = ch.replace(eval(i), me.rg2[i]);
|
60
|
+
}
|
61
|
+
const finalvalue = ch;
|
62
|
+
try {
|
63
|
+
const op = String(ch).match(/[\+x\*\/\-]{2,}/g);
|
64
|
+
ch = ch.toUpperCase();
|
65
|
+
ch = eval(ch);
|
66
|
+
if (op != null) { me.res = "Multiple Operators in a row. <br/> Result is probably wrong."; }
|
67
|
+
const dec = (!isNaN(ch) ? ch.toFixed(3) : "It is a string.");
|
68
|
+
me.res = (String(dec).search(/\.0+$/) !== -1 ? String(dec).substring(0, String(dec).indexOf(".")) : dec);
|
69
|
+
me.res = '';
|
70
|
+
} catch (er) {
|
71
|
+
for (i in me.rg) {
|
72
|
+
if (ch.match(eval(i)) != null) {
|
73
|
+
me.res = me.rg[i];
|
74
|
+
break;
|
75
|
+
}
|
76
|
+
flag++;
|
77
|
+
if (flag === 5) { me.suite(ch); }
|
78
|
+
}
|
79
|
+
}
|
80
|
+
return [me.res, finalvalue];
|
81
|
+
}
|
82
|
+
}
|
@@ -0,0 +1,132 @@
|
|
1
|
+
(function (root, factory) {
|
2
|
+
if (root === undefined && window !== undefined) root = window;
|
3
|
+
if (typeof define === 'function' && define.amd) {
|
4
|
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
5
|
+
define(["jquery"], function (a0) {
|
6
|
+
return (factory(a0));
|
7
|
+
});
|
8
|
+
} else if (typeof module === 'object' && module.exports) {
|
9
|
+
// Node. Does not work with strict CommonJS, but
|
10
|
+
// only CommonJS-like environments that support module.exports,
|
11
|
+
// like Node.
|
12
|
+
module.exports = factory(require("jquery"));
|
13
|
+
} else {
|
14
|
+
factory(root["jQuery"]);
|
15
|
+
}
|
16
|
+
}(this, function (jQuery) {
|
17
|
+
|
18
|
+
(function($) {
|
19
|
+
var appendToElement, hasRefreshButton, updateOptionsHtml, updateTargetComponent, updateTargetRefreshButton;
|
20
|
+
updateOptionsHtml = function(data, componentTarget) {
|
21
|
+
console.log(data);
|
22
|
+
componentTarget.children('option:not([value=""])').remove();
|
23
|
+
if (Array.isArray(data)) {
|
24
|
+
return appendToElement(data, componentTarget);
|
25
|
+
} else {
|
26
|
+
return $.each(data, function(k, v) {
|
27
|
+
var optgroup;
|
28
|
+
updateOptionsHtml(data, componentTarget);
|
29
|
+
optgroup = $("<optgroup></optgroup>").attr("label", k);
|
30
|
+
appendToElement(v, optgroup);
|
31
|
+
return componentTarget.append(optgroup);
|
32
|
+
});
|
33
|
+
}
|
34
|
+
};
|
35
|
+
appendToElement = function(data, element) {
|
36
|
+
return data.forEach(function(opt) {
|
37
|
+
return element.append($("<option></option>").attr("value", opt.value || opt[1]).text(opt.text || opt[0]));
|
38
|
+
});
|
39
|
+
};
|
40
|
+
updateTargetComponent = function(data, componentTarget, component) {
|
41
|
+
updateOptionsHtml(data, componentTarget);
|
42
|
+
updateTargetRefreshButton(componentTarget, component);
|
43
|
+
if (componentTarget.hasClass('multi-column-field')) {
|
44
|
+
componentTarget.multiSelect('refresh');
|
45
|
+
}
|
46
|
+
if (componentTarget.hasClass('dropdown-select-field')) {
|
47
|
+
componentTarget.selectpicker('refresh');
|
48
|
+
}
|
49
|
+
if (componentTarget.hasClass('multi-select-field')) {
|
50
|
+
componentTarget.multiselect('rebuild');
|
51
|
+
}
|
52
|
+
componentTarget.attr("disabled", false);
|
53
|
+
componentTarget.removeClass("disabled");
|
54
|
+
return componentTarget.change();
|
55
|
+
};
|
56
|
+
updateTargetRefreshButton = function(componentTarget, component) {
|
57
|
+
var refreshBtn;
|
58
|
+
if (hasRefreshButton(componentTarget)) {
|
59
|
+
refreshBtn = componentTarget.parents('.input-group').find('.input-refresh-button');
|
60
|
+
return refreshBtn.attr('value', component.val()).attr('name', component.attr('name'));
|
61
|
+
}
|
62
|
+
};
|
63
|
+
hasRefreshButton = function(component) {
|
64
|
+
return component.parents('.input-group').hasClass('field-refresh');
|
65
|
+
};
|
66
|
+
return $.fn.inputConnected = function(options) {
|
67
|
+
var defaults, self, settings;
|
68
|
+
defaults = {
|
69
|
+
mode: "remote",
|
70
|
+
events: "change",
|
71
|
+
target: {
|
72
|
+
url: null,
|
73
|
+
selector: null,
|
74
|
+
data: []
|
75
|
+
}
|
76
|
+
};
|
77
|
+
settings = $.extend({}, defaults, options);
|
78
|
+
self = this;
|
79
|
+
return this.each(function() {
|
80
|
+
var component, connect, connectMode, events;
|
81
|
+
component = $(this);
|
82
|
+
connect = component.data().connect;
|
83
|
+
if (connect.targets == null) {
|
84
|
+
connect.target = connect.target || {};
|
85
|
+
connect.target.url = connect.target.url || settings.target.url;
|
86
|
+
connect.target.data = connect.target.data || settings.target.data;
|
87
|
+
connect.target.selector = connect.target.selector || settings.target.selector;
|
88
|
+
}
|
89
|
+
connect.targets = connect.targets || [];
|
90
|
+
if (connect.target != null) {
|
91
|
+
connect.targets.push(connect.target);
|
92
|
+
}
|
93
|
+
if (connect == null) {
|
94
|
+
return;
|
95
|
+
}
|
96
|
+
connectMode = connect.mode || settings.mode;
|
97
|
+
events = connect.events || settings.events;
|
98
|
+
return component.on(events, function(e) {
|
99
|
+
var name, values;
|
100
|
+
e.preventDefault();
|
101
|
+
values = component.val();
|
102
|
+
name = component.attr('name');
|
103
|
+
name = name != null ? name : "id";
|
104
|
+
return connect.targets.forEach(function(target) {
|
105
|
+
var componentTarget, data, mode;
|
106
|
+
componentTarget = $("" + target.selector);
|
107
|
+
mode = target.mode || connectMode;
|
108
|
+
if (mode === "remote") {
|
109
|
+
let params = []
|
110
|
+
params[`#${name}`] = values
|
111
|
+
$.ajax({
|
112
|
+
url: target.url,
|
113
|
+
data: params
|
114
|
+
}).done(function(data) {
|
115
|
+
return updateTargetComponent(data, componentTarget, component);
|
116
|
+
});
|
117
|
+
}
|
118
|
+
if (mode === "local") {
|
119
|
+
data = target.data || settings.target.data;
|
120
|
+
data = data.filter(function(value) {
|
121
|
+
values = [].concat.apply([], [values]);
|
122
|
+
return values.includes(String(value.connect_option_id));
|
123
|
+
});
|
124
|
+
return updateTargetComponent(data, componentTarget, component);
|
125
|
+
}
|
126
|
+
});
|
127
|
+
});
|
128
|
+
});
|
129
|
+
};
|
130
|
+
})(jQuery);
|
131
|
+
|
132
|
+
}));
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import "jquery.quicksearch"
|
2
|
+
|
3
|
+
export default {
|
4
|
+
qs1: null,
|
5
|
+
qs2: null,
|
6
|
+
selectableOptgroup: false,
|
7
|
+
selectableHeader: "<input type='text' class='search-input form-control' autocomplete='off' placeholder='Search in selectable items'><br/>",
|
8
|
+
selectionHeader: "<input type='text' class='search-input form-control' autocomplete='off' placeholder='Search in selected items'><br/>",
|
9
|
+
afterInit: function(ms) {
|
10
|
+
var $selectableSearch, $selectionSearch, selectableSearchString, selectionSearchString, that;
|
11
|
+
that = this;
|
12
|
+
that.options.selectableOptgroup = $(this)[0].$element.data('selectableOptgroup') ? true : false;
|
13
|
+
if ($(this)[0].$element.data('searchable')) {
|
14
|
+
$selectableSearch = that.$selectableUl.siblings('input');
|
15
|
+
$selectionSearch = that.$selectionUl.siblings('input');
|
16
|
+
$selectionSearch = that.$selectionUl.siblings('input');
|
17
|
+
selectableSearchString = "#" + that.$container.attr("id") + " .ms-elem-selectable:not(.ms-selected)";
|
18
|
+
selectionSearchString = "#" + that.$container.attr("id") + " .ms-elem-selection.ms-selected";
|
19
|
+
that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on("keydown", function(e) {
|
20
|
+
if (e.which === 40) {
|
21
|
+
that.$selectableUl.focus();
|
22
|
+
return false;
|
23
|
+
}
|
24
|
+
});
|
25
|
+
return that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on("keydown", function(e) {
|
26
|
+
if (e.which === 40) {
|
27
|
+
that.$selectionUl.focus();
|
28
|
+
return false;
|
29
|
+
}
|
30
|
+
});
|
31
|
+
} else {
|
32
|
+
that.$selectableContainer.children('.search-input').remove();
|
33
|
+
return that.$selectionContainer.children('.search-input').remove();
|
34
|
+
}
|
35
|
+
},
|
36
|
+
afterSelect: function() {
|
37
|
+
if (this.qs1 != null) {
|
38
|
+
this.qs1.cache();
|
39
|
+
}
|
40
|
+
if (this.qs2 != null) {
|
41
|
+
return this.qs2.cache();
|
42
|
+
}
|
43
|
+
},
|
44
|
+
afterDeselect: function() {
|
45
|
+
if (this.qs1 != null) {
|
46
|
+
this.qs1.cache();
|
47
|
+
}
|
48
|
+
if (this.qs2 != null) {
|
49
|
+
return this.qs2.cache();
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
@@ -0,0 +1,160 @@
|
|
1
|
+
import UiBibzFormula from 'formula'
|
2
|
+
import 'bootstrap-switch'
|
3
|
+
import "input-connected"
|
4
|
+
import "jquery.multi-select"
|
5
|
+
import "bootstrap-multiselect"
|
6
|
+
import extendMultiselect from "jquery.multi-select-extend"
|
7
|
+
import "bootstrap-markdown"
|
8
|
+
import 'fuzzysort'
|
9
|
+
import "bootstrap-datepicker.min.js"
|
10
|
+
|
11
|
+
export default class UiBibzForm {
|
12
|
+
|
13
|
+
constructor(node) {
|
14
|
+
this.node = node || document
|
15
|
+
if(node.querySelector('input.switch-field')){ this.setBootstrapSwitch() }
|
16
|
+
if(node.querySelector('.ui-bibz-connect')) { this.inputConnected() }
|
17
|
+
//if(node.querySelector('.dropdown-select-field')) { this.setMultiSelect() }
|
18
|
+
if(node.querySelector('.multi-select-field')){ this.setMultiSelect() }
|
19
|
+
if(node.querySelector('.multi-column-field')){ this.setMultiColumn() }
|
20
|
+
if(node.querySelector('.formula-field')){ this.formula() }
|
21
|
+
if(node.querySelector('.auto-complete-field')){ this.autoCompleteFix() }
|
22
|
+
if(node.querySelector('.slider')){ this.doubleSlider() }
|
23
|
+
if(node.querySelector('.dropdown-select-field')){ this.selectpicker() }
|
24
|
+
}
|
25
|
+
|
26
|
+
inputConnected() {
|
27
|
+
$('.ui-bibz-connect', this.node).inputConnected()
|
28
|
+
}
|
29
|
+
|
30
|
+
setSelectPicker() {
|
31
|
+
$('select.dropdown-select-field', this.node).selectpicker()
|
32
|
+
}
|
33
|
+
|
34
|
+
setBootstrapSwitch() {
|
35
|
+
$('input.switch-field', this.node).bootstrapSwitch({
|
36
|
+
size: 'large'
|
37
|
+
})
|
38
|
+
}
|
39
|
+
|
40
|
+
setMultiSelect() {
|
41
|
+
$('select.multi-select-field', this.node).each(function() {
|
42
|
+
var classes, data
|
43
|
+
data = $(this).data()
|
44
|
+
classes = $(this)[0].classList.value
|
45
|
+
delete data["multiselect"]
|
46
|
+
data = Object.assign({
|
47
|
+
buttonClass: "btn " + classes
|
48
|
+
}, data)
|
49
|
+
$(this).multiselect(data)
|
50
|
+
if ($(this).parent().hasClass('input-group')) {
|
51
|
+
$(this).siblings('.btn-group').addClass('input-group-btn')
|
52
|
+
}
|
53
|
+
})
|
54
|
+
}
|
55
|
+
|
56
|
+
formula() {
|
57
|
+
let me = this
|
58
|
+
let formula_input_fields = $('.formula-field', this.node)
|
59
|
+
|
60
|
+
formula_input_fields.each(function() {
|
61
|
+
me.updateFormulaField($(this))
|
62
|
+
})
|
63
|
+
|
64
|
+
formula_input_fields.on('keyup', function() {
|
65
|
+
me.updateFormulaField($(this))
|
66
|
+
})
|
67
|
+
}
|
68
|
+
|
69
|
+
updateFormulaField(field) {
|
70
|
+
let error, f, formulaAlert, formulaInputField, formulaResultField, formulaSignField, response, result
|
71
|
+
formulaInputField = field
|
72
|
+
formulaSignField = formulaInputField.siblings('.formula-field-sign')
|
73
|
+
formulaResultField = formulaInputField.siblings('.formula-field-result')
|
74
|
+
formulaAlert = formulaInputField.siblings('.formula-field-alert')
|
75
|
+
f = new UiBibzFormula()
|
76
|
+
result = f.go(formulaInputField.val())
|
77
|
+
error = result[0]
|
78
|
+
response = result[1]
|
79
|
+
|
80
|
+
if (!!error) {
|
81
|
+
formulaAlert.attr('data-original-title', error)
|
82
|
+
formulaAlert.attr('style', 'display: table-cell')
|
83
|
+
formulaResultField.addClass('fix-border-right')
|
84
|
+
} else {
|
85
|
+
formulaAlert.hide()
|
86
|
+
formulaResultField.val(eval(response))
|
87
|
+
formulaResultField.removeClass('fix-border-right')
|
88
|
+
}
|
89
|
+
if (isNaN(response)) {
|
90
|
+
formulaSignField.attr('style', 'display: table-cell')
|
91
|
+
formulaResultField.attr('style', 'display: table-cell; visible: visible')
|
92
|
+
formulaInputField.addClass('fix-border-right')
|
93
|
+
} else {
|
94
|
+
formulaSignField.hide()
|
95
|
+
formulaResultField.attr('style', 'visible: hidden')
|
96
|
+
formulaInputField.removeClass('fix-border-right')
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
setMultiColumn() {
|
101
|
+
$.fn.multiSelect.defaults = extendMultiselect
|
102
|
+
$(".multi-column-field", this.node).multiSelect()
|
103
|
+
}
|
104
|
+
|
105
|
+
autoCompleteFix() {
|
106
|
+
$(".auto-complete-field", this.node).each(function() {
|
107
|
+
var lastChild, parent, radius
|
108
|
+
parent = $(this).parent('.input-group')
|
109
|
+
if (parent.length > 0) {
|
110
|
+
lastChild = parent.children().last()
|
111
|
+
if (lastChild.is('datalist')) {
|
112
|
+
radius = parent.children().first().css("border-bottom-left-radius")
|
113
|
+
$(this).css("border-bottom-right-radius", radius)
|
114
|
+
$(this).css("border-top-right-radius", radius)
|
115
|
+
}
|
116
|
+
}
|
117
|
+
})
|
118
|
+
}
|
119
|
+
|
120
|
+
doubleSlider(){
|
121
|
+
let me = this
|
122
|
+
this.node.querySelectorAll(".slider").forEach(function(e){
|
123
|
+
let slider = e
|
124
|
+
let sliderId = slider.getAttribute("id")
|
125
|
+
let sliderMin = me.node.querySelector(`.slider-header[data-target=${sliderId}] .slider-header-min span`)
|
126
|
+
let sliderMax = me.node.querySelector(`.slider-header[data-target=${sliderId}] .slider-header-max span`)
|
127
|
+
let rangeInput1 = slider.querySelectorAll("input[type=range]")[0]
|
128
|
+
let rangeInput2 = slider.querySelectorAll("input[type=range]")[1]
|
129
|
+
let inverseLeft = slider.querySelector(".slider-inverse-left")
|
130
|
+
let inverseRight = slider.querySelector(".slider-inverse-right")
|
131
|
+
let range = slider.querySelector(".slider-range")
|
132
|
+
let thumbLeft = slider.querySelector(".slider-thumb-left")
|
133
|
+
let thumbRight = slider.querySelector(".slider-thumb-right")
|
134
|
+
let signLeft = slider.querySelector(".slider-sign-left")
|
135
|
+
let signRight = slider.querySelector(".slider-sign-right")
|
136
|
+
|
137
|
+
rangeInput1.addEventListener("input", function(e){
|
138
|
+
this.value = Math.min(this.value, rangeInput2.value-1)
|
139
|
+
let value = (100/(parseInt(this.max)-parseInt(this.min)))*parseInt(this.value)-(100/(parseInt(this.max)-parseInt(this.min)))*parseInt(this.min)
|
140
|
+
value = value + 0.01 * value
|
141
|
+
|
142
|
+
inverseLeft.style.width = `${value}%`
|
143
|
+
range.style.left = `${value}%`
|
144
|
+
thumbLeft.style.left = `${value}%`
|
145
|
+
if(sliderMin){ sliderMin.innerHTML = this.value }
|
146
|
+
})
|
147
|
+
|
148
|
+
rangeInput2.addEventListener("input", function(e){
|
149
|
+
this.value = Math.max(this.value,rangeInput1.value-(-1))
|
150
|
+
let value = (100/(parseInt(this.max)-parseInt(this.min)))*parseInt(this.value)-(100/(parseInt(this.max)-parseInt(this.min)))*parseInt(this.min)
|
151
|
+
value = value + 0.01 * value
|
152
|
+
|
153
|
+
inverseRight.style.width = `${100-value}%`
|
154
|
+
range.style.right = `${100-value}%`
|
155
|
+
thumbRight.style.left= `${value}%`
|
156
|
+
if(sliderMax){ sliderMax.innerHTML = this.value }
|
157
|
+
})
|
158
|
+
})
|
159
|
+
}
|
160
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
// Import non minified version, later minifier will make sure minified version
|
2
|
+
// is provided, while still allowing debugging to use the non minified version.
|
3
|
+
// import bootstrap from "bootstrap/dist/js/bootstrap.bundle"
|
4
|
+
import "@popperjs/core"
|
5
|
+
import "bootstrap"
|
6
|
+
import * as bootstrap from 'bootstrap'
|
7
|
+
window.bootstrap = bootstrap
|
8
|
+
|
9
|
+
export default class UiBibzInterface {
|
10
|
+
|
11
|
+
constructor(node) {
|
12
|
+
this.node = node || document
|
13
|
+
|
14
|
+
// //this.nav()
|
15
|
+
this.tooltip()
|
16
|
+
// this.dropdown()
|
17
|
+
this.popover()
|
18
|
+
this.notify()
|
19
|
+
this.toast()
|
20
|
+
}
|
21
|
+
|
22
|
+
nav(){
|
23
|
+
this.node.querySelectorAll('.nav-tabs .nav-item .nav-link').forEach(function(el){
|
24
|
+
let tabTrigger = new bootstrap.Tab(el)
|
25
|
+
el.addEventListener('click', function (e) {
|
26
|
+
e.preventDefault()
|
27
|
+
tabTrigger.show()
|
28
|
+
})
|
29
|
+
})
|
30
|
+
}
|
31
|
+
|
32
|
+
popover() {
|
33
|
+
this.node.querySelectorAll('[data-bs-toggle="popover"]').forEach(x => new bootstrap.Popover(x))
|
34
|
+
}
|
35
|
+
|
36
|
+
tooltip() {
|
37
|
+
this.node.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(x => new bootstrap.Tooltip(x))
|
38
|
+
}
|
39
|
+
|
40
|
+
dropdown() {
|
41
|
+
this.node.querySelectorAll('[data-bs-toggle="dropdown"]').forEach(x => new bootstrap.Dropdown(x))
|
42
|
+
}
|
43
|
+
|
44
|
+
toast() {
|
45
|
+
this.node.querySelectorAll('.toast').forEach(x => new bootstrap.Toast(x))
|
46
|
+
}
|
47
|
+
|
48
|
+
notify() {
|
49
|
+
new bootstrap.Alert('.myAlert')
|
50
|
+
this.node.querySelectorAll('.alert[data-timeout]').forEach(function(alertElement) {
|
51
|
+
setTimeout(function() {
|
52
|
+
alertElement.classList.add('fade')
|
53
|
+
}, alertElement.getAttribute("data-timeout") )
|
54
|
+
})
|
55
|
+
}
|
56
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
export default class UiBibzTable {
|
2
|
+
|
3
|
+
constructor(node) {
|
4
|
+
this.node = node || document
|
5
|
+
|
6
|
+
this.submitPerPageSelect()
|
7
|
+
this.clearSearch()
|
8
|
+
this.animeSearchInput()
|
9
|
+
this.focusSearchInput()
|
10
|
+
this.initializeSearchInput()
|
11
|
+
}
|
12
|
+
|
13
|
+
submitPerPageSelect() {
|
14
|
+
$('.table-pagination-per-page select', this.node).change(function() {
|
15
|
+
$(this).parents('form').find('input[name=link_type]').val('per_page')
|
16
|
+
$(this).parents('form').submit()
|
17
|
+
})
|
18
|
+
}
|
19
|
+
|
20
|
+
clearSearch() {
|
21
|
+
$('.clear-search-btn', this.node).click(function() {
|
22
|
+
$(this).parents('form').find('input[type=search]').val('')
|
23
|
+
$(this).parents('form').submit()
|
24
|
+
})
|
25
|
+
}
|
26
|
+
|
27
|
+
animeSearchInput() {
|
28
|
+
$('.table-card input[type=search]', this.node).blur(function() {
|
29
|
+
let parent = $(this).parent()
|
30
|
+
|
31
|
+
if ($(this).val() === '') { parent.removeClass('has-value') }
|
32
|
+
parent.removeClass('is-focused')
|
33
|
+
})
|
34
|
+
}
|
35
|
+
|
36
|
+
focusSearchInput() {
|
37
|
+
$('.table-card input[type=search]', this.node).focus(function() {
|
38
|
+
$(this).parent().addClass('is-focused has-value')
|
39
|
+
})
|
40
|
+
}
|
41
|
+
|
42
|
+
initializeSearchInput() {
|
43
|
+
$('.table-card input[type=search]', this.node).each(function() {
|
44
|
+
if ($(this).val() !== '') {
|
45
|
+
$(this).parent().addClass('has-value')
|
46
|
+
}
|
47
|
+
})
|
48
|
+
}
|
49
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import * as jquery from "jquery"
|
2
|
+
import UiBibzInterfaces from 'interfaces'
|
3
|
+
import UiBibzForms from 'forms'
|
4
|
+
import UiBibzTables from 'tables'
|
5
|
+
|
6
|
+
export default class UiBibzJs {
|
7
|
+
|
8
|
+
constructor(){}
|
9
|
+
|
10
|
+
start(){
|
11
|
+
if (typeof Turbo == 'undefined') {
|
12
|
+
this.init()
|
13
|
+
} else {
|
14
|
+
document.addEventListener("turbo:load", (e) => this.init())
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
init(node){
|
19
|
+
if(node === undefined) node = document
|
20
|
+
|
21
|
+
new UiBibzTables(node)
|
22
|
+
new UiBibzForms(node)
|
23
|
+
new UiBibzInterfaces(node)
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
let uiBibzJs
|
28
|
+
|
29
|
+
export function start(){
|
30
|
+
uiBibzJs = new UiBibzJs
|
31
|
+
uiBibzJs.start()
|
32
|
+
}
|
33
|
+
|
34
|
+
export function init(node) {
|
35
|
+
uiBibzJs.init(node)
|
36
|
+
return uiBibzJs
|
37
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
@import boxes/_card
|