glib-web 6.10.1 → 7.0.0.beta1
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/controllers/concerns/glib/auth/policy.rb +1 -5
- data/app/helpers/glib/json_ui/action_builder/bottom_banners.rb +0 -1
- data/app/helpers/glib/json_ui/action_builder/components.rb +1 -16
- data/app/helpers/glib/json_ui/action_builder/logics.rb +1 -2
- data/app/helpers/glib/json_ui/action_builder/snackbars.rb +0 -16
- data/app/helpers/glib/json_ui/response_helper.rb +0 -12
- data/app/helpers/glib/json_ui/view_builder/fields.rb +2 -66
- data/app/views/json_ui/garage/actions/_components.json.jbuilder +2 -2
- data/app/views/json_ui/garage/forms/bulk_edit_post.json.jbuilder +1 -1
- data/app/views/json_ui/garage/forms/checkboxes.json.jbuilder +3 -3
- data/app/views/json_ui/garage/forms/selects.json.jbuilder +5 -5
- data/app/views/json_ui/garage/forms/update_options.json.jbuilder +1 -1
- data/app/views/json_ui/garage/panels/flow.json.jbuilder +6 -6
- data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +10 -10
- data/app/views/json_ui/garage/panels/responsive.json.jbuilder +10 -10
- data/app/views/json_ui/garage/panels/ul.json.jbuilder +2 -2
- data/app/views/json_ui/garage/panels/vertical.json.jbuilder +10 -10
- data/app/views/json_ui/garage/tables/bulk_edit.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/calendar.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/carousel.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/charts.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/column.json.jbuilder +3 -3
- data/app/views/json_ui/garage/test_page/components.json.jbuilder +7 -7
- data/app/views/json_ui/garage/test_page/custom.json.jbuilder +3 -3
- data/app/views/json_ui/garage/test_page/dialog.json.jbuilder +0 -21
- data/app/views/json_ui/garage/test_page/fields_creditCard.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/fields_date_time.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/fields_dynamicSelect.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/fields_location.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/fields_otp.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/fields_phone.json.jbuilder +9 -9
- data/app/views/json_ui/garage/test_page/fields_radio.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/fields_rating.json.jbuilder +10 -10
- data/app/views/json_ui/garage/test_page/fields_richText.json.jbuilder +10 -10
- data/app/views/json_ui/garage/test_page/fields_select.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/fields_sign.json.jbuilder +8 -10
- data/app/views/json_ui/garage/test_page/fields_stripeExternalAccount.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/fields_stripeToken.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/fields_text.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/fields_timer.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/flow.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/form.json.jbuilder +9 -9
- data/app/views/json_ui/garage/test_page/grid.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/horizontal.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/image.json.jbuilder +9 -9
- data/app/views/json_ui/garage/test_page/lifecycle.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/list.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/multimedia_docx.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/multimedia_video.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/pagination.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/panels_bulkEdit2.json.jbuilder +13 -13
- data/app/views/json_ui/garage/test_page/panels_bulkEdit3.json.jbuilder +1 -1
- data/app/views/json_ui/garage/test_page/progressCircle.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/responsive.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/scroll.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/split.json.jbuilder +1 -1
- data/app/views/json_ui/garage/test_page/table.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/timeline.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/ul.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/vertical.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/web.json.jbuilder +5 -5
- data/app/views/json_ui/garage/views/_expand_shrink_ex.json.jbuilder +4 -4
- data/app/views/json_ui/garage/views/controls.json.jbuilder +4 -4
- data/app/views/json_ui/garage/views/{components_set.json.jbuilder → logics_set.json.jbuilder} +2 -2
- data/lib/glib/engine.rb +0 -32
- data/lib/glib/json_crawler/router.rb +0 -24
- data/lib/glib/json_ui/config.rb +1 -1
- data/lib/glib/test/changed_files_rubocop.rb +55 -0
- data/lib/glib/test_helpers.rb +6 -9
- metadata +5 -35
- data/app/controllers/concerns/glib/auth/token_authenticatable.rb +0 -37
- data/app/controllers/glib/api_controller.rb +0 -52
- data/app/jobs/glib/purge_unattached_job.rb +0 -28
- data/app/models/concerns/glib/snapshot_v2.rb +0 -462
- data/app/models/glib/model.rb +0 -40
- data/app/models/glib/plain_model.rb +0 -23
- data/app/models/snapshot_blob_reference.rb +0 -20
- data/lib/generators/glib/snapshot_v2_generator.rb +0 -54
- data/lib/generators/templates/snapshot_v2/add_snapshot_v2_columns.rb +0 -18
- data/lib/generators/templates/snapshot_v2/create_snapshot_blob_references.rb +0 -10
- data/lib/glib/test/full_suite_rubocop.rb +0 -87
- data/lib/glib/test/rubocop_guards.rb +0 -42
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 38b655bd80465e224c8ed56c8e63694af4786e89a4028da3915737bf8ac96120
|
|
4
|
+
data.tar.gz: 6baa89e800c1223673fe1d9bbad61694e6a59c46123f42faff344d819e143dbf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 30a1adca1ba187b2f23ff52f54b41259742e15582abf95404b07b658e6eb4a408e2a236b8ffe7b4b45459e7ad3abfb9f8017e8701887fe5b4f5028d045834d23
|
|
7
|
+
data.tar.gz: c4645773a9b5aea3d3b3ba0aea2e24c609e09b45bc7b4904b76bad3af3dd486ed9b4b1b38dba4b956da4620656127462970a1b73c960c231a21da42685fd6f71
|
|
@@ -22,11 +22,7 @@ module Glib::Auth
|
|
|
22
22
|
# - Need to find a solution where we can reuse a single public policy
|
|
23
23
|
# after_action :verify_authorized
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
# does, but bare ActionController::API does not (gems like jbuilder may include
|
|
27
|
-
# ActionController::Helpers into it in a booted app, and a plain non-controller
|
|
28
|
-
# class never has it). Same guard Pundit's own included block uses.
|
|
29
|
-
helper_method :policy, :can?, :cannot? if respond_to?(:helper_method)
|
|
25
|
+
helper_method :policy, :can?, :cannot?
|
|
30
26
|
end
|
|
31
27
|
|
|
32
28
|
def assert_current_user_present
|
|
@@ -25,7 +25,7 @@ class Glib::JsonUi::ActionBuilder
|
|
|
25
25
|
views :childViews
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
# Consider deprecating this. See `
|
|
28
|
+
# Consider deprecating this. See `logics_set` example in app/views/json_ui/garage/forms/selects.json.jbuilder
|
|
29
29
|
class Replace < Action
|
|
30
30
|
string :targetId
|
|
31
31
|
action :onReplace
|
|
@@ -37,20 +37,5 @@ class Glib::JsonUi::ActionBuilder
|
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
# Deprecated: use `logics_set` instead. `logics_set` is a superset of this
|
|
41
|
-
# action (same `targetId`/`data`/`onSet`/`skipOnChange`, plus
|
|
42
|
-
# `conditionalData`, `targetIds`, `variables` and `cacheData`).
|
|
43
|
-
class Set < Action
|
|
44
|
-
string :targetId
|
|
45
|
-
hash :data
|
|
46
|
-
action :onSet
|
|
47
|
-
bool :skipOnChange
|
|
48
|
-
|
|
49
|
-
def dataBuilder(block)
|
|
50
|
-
json.data do
|
|
51
|
-
block.call(page.sview_builder)
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
40
|
end
|
|
56
41
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
class Glib::JsonUi::ActionBuilder
|
|
2
2
|
module Logics
|
|
3
|
-
# The canonical setter action.
|
|
4
|
-
# `components_set`: it supports plain static `data` as well as
|
|
3
|
+
# The canonical setter action. It supports plain static `data` as well as
|
|
5
4
|
# `conditionalData` (JsonLogic), `targetIds`, `variables` and `cacheData`.
|
|
6
5
|
class Set < Action
|
|
7
6
|
string :targetId
|
|
@@ -7,31 +7,15 @@ class Glib::JsonUi::ActionBuilder
|
|
|
7
7
|
int :timeout
|
|
8
8
|
action :onClose
|
|
9
9
|
|
|
10
|
-
string :verticalPosition # Deprecated
|
|
11
|
-
string :horizontalPosition # Deprecated
|
|
12
|
-
|
|
13
10
|
string :location
|
|
14
11
|
singleton_array :styleClass, :styleClasses
|
|
15
12
|
end
|
|
16
13
|
|
|
17
|
-
# class Confirm < Action
|
|
18
|
-
# string :message
|
|
19
|
-
# action :onConfirm
|
|
20
|
-
# action :onCancel
|
|
21
|
-
|
|
22
|
-
# string :verticalPosition
|
|
23
|
-
# string :horizontalPosition
|
|
24
|
-
# singleton_array :styleClass, :styleClasses
|
|
25
|
-
# end
|
|
26
|
-
|
|
27
14
|
class Select < Action
|
|
28
15
|
string :message
|
|
29
16
|
int :timeout
|
|
30
17
|
action :onClose
|
|
31
18
|
|
|
32
|
-
string :verticalPosition # Deprecated
|
|
33
|
-
string :horizontalPosition # Deprecated
|
|
34
|
-
|
|
35
19
|
string :location
|
|
36
20
|
singleton_array :styleClass, :styleClasses
|
|
37
21
|
|
|
@@ -10,18 +10,6 @@ module Glib
|
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
# Deprecated
|
|
14
|
-
def json_ui_response_with_view(json)
|
|
15
|
-
json.analytics do
|
|
16
|
-
json.disabled true
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
json.onResponse do
|
|
20
|
-
response = Glib::JsonUi::PageHelper::Page.new(json, self)
|
|
21
|
-
yield response.action_builder
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
13
|
class Response
|
|
26
14
|
attr_reader :action_builder
|
|
27
15
|
|
|
@@ -659,10 +659,7 @@ class Glib::JsonUi::ViewBuilder
|
|
|
659
659
|
class ChipGroup < AbstractField
|
|
660
660
|
color :color
|
|
661
661
|
array :options
|
|
662
|
-
|
|
663
|
-
# multiple-selection ChipGroup submits under a single key and only the
|
|
664
|
-
# last selected value survives server-side parsing.
|
|
665
|
-
bool :multiple, cache: true
|
|
662
|
+
bool :multiple
|
|
666
663
|
end
|
|
667
664
|
|
|
668
665
|
class TimeZone < AbstractField
|
|
@@ -800,11 +797,7 @@ class Glib::JsonUi::ViewBuilder
|
|
|
800
797
|
include Glib::JsonUi::FileUploadErrorHandler
|
|
801
798
|
|
|
802
799
|
action :onFinishUpload
|
|
803
|
-
|
|
804
|
-
# the submit key — without it the `[]` array suffix is dropped and a
|
|
805
|
-
# multi-file submit collapses to the last file server-side (silently
|
|
806
|
-
# saves one Document per drop instead of one per file).
|
|
807
|
-
bool :multiple, cache: true
|
|
800
|
+
bool :multiple
|
|
808
801
|
hash :placeholderView, required: [:type, :width, :height], optional: [:url]
|
|
809
802
|
hash :inputView, optional: [:files, :variant]
|
|
810
803
|
hash :clipboardView, optional: [:icon]
|
|
@@ -862,67 +855,10 @@ class Glib::JsonUi::ViewBuilder
|
|
|
862
855
|
end
|
|
863
856
|
end
|
|
864
857
|
|
|
865
|
-
# Signature field that lets the user draw a signature on a canvas and
|
|
866
|
-
# upload it as an image via ActiveStorage direct upload.
|
|
867
|
-
#
|
|
868
|
-
# The form shows a placeholder sized by `width`/`height`; tapping it opens
|
|
869
|
-
# a dialog with the drawing canvas, and Confirm uploads the drawing as a
|
|
870
|
-
# PNG to `directUploadUrl` and submits the resulting signed id under
|
|
871
|
-
# `name`. The placeholder then shows the signature, and reopening the
|
|
872
|
-
# dialog lets the user edit it. Because the canvas is not in the form,
|
|
873
|
-
# the placeholder can be given the same height as a neighbouring input
|
|
874
|
-
# (e.g. a typed-name alternative) without losing drawing space.
|
|
875
|
-
#
|
|
876
|
-
# `label` titles the dialog; `placeholder` replaces the "Tap to sign"
|
|
877
|
-
# prompt.
|
|
878
|
-
#
|
|
879
|
-
# With `typedName` the dialog gains Draw/Type tabs: the user can type
|
|
880
|
-
# their name instead of drawing, and the placeholder then shows the name
|
|
881
|
-
# in a handwriting style (the `glib-sign-typed` hook carries the font).
|
|
882
|
-
# The typed name is submitted under `typedName[:name]`; exactly one of the
|
|
883
|
-
# signed id and the typed name is ever non-blank. `typedName[:value]`
|
|
884
|
-
# pre-populates an existing name.
|
|
885
|
-
#
|
|
886
|
-
# @example Basic signature field
|
|
887
|
-
# form.fields_sign \
|
|
888
|
-
# name: 'user[signature]',
|
|
889
|
-
# label: 'Your signature',
|
|
890
|
-
# directUploadUrl: glib_direct_uploads_url,
|
|
891
|
-
# width: 320,
|
|
892
|
-
# height: 160,
|
|
893
|
-
# validation: { required: { message: 'add your signature!' } }
|
|
894
|
-
#
|
|
895
|
-
# @example Drawn or typed
|
|
896
|
-
# form.fields_sign \
|
|
897
|
-
# name: 'user[signature]',
|
|
898
|
-
# label: 'Your signature',
|
|
899
|
-
# typedName: { name: 'user[signature_name]', label: 'Type your full name', placeholder: 'Full name' },
|
|
900
|
-
# directUploadUrl: glib_direct_uploads_url,
|
|
901
|
-
# width: 320,
|
|
902
|
-
# height: 160
|
|
903
|
-
#
|
|
904
|
-
# @example Compact signature without validation
|
|
905
|
-
# form.fields_sign \
|
|
906
|
-
# id: 'signature_compact',
|
|
907
|
-
# name: 'user[signature_compact]',
|
|
908
|
-
# directUploadUrl: glib_direct_uploads_url,
|
|
909
|
-
# width: 220,
|
|
910
|
-
# height: 100
|
|
911
|
-
#
|
|
912
|
-
# @note The field deliberately has no pre-populated value: a saved
|
|
913
|
-
# signature is a signed id that cannot be redrawn from the canvas.
|
|
914
|
-
# Resize it via `components_set`/`logics_set` with `width`/`height`.
|
|
915
|
-
#
|
|
916
|
-
# @see app/views/json_ui/garage/test_page/fields_sign.json.jbuilder Garage examples
|
|
917
858
|
class Sign < AbstractField
|
|
918
859
|
string :directUploadUrl
|
|
919
860
|
required :directUploadUrl
|
|
920
861
|
|
|
921
|
-
# Enables the Type tab. `name` is the param the typed name is submitted
|
|
922
|
-
# under; `value` pre-populates it; `label`/`placeholder` decorate the
|
|
923
|
-
# text input in the dialog.
|
|
924
|
-
hash :typedName, required: [:name], optional: [:value, :label, :placeholder]
|
|
925
|
-
|
|
926
862
|
# Override
|
|
927
863
|
# Signature field doesn't have default value
|
|
928
864
|
def value(value)
|
|
@@ -8,7 +8,7 @@ section.rows builder: ->(template) do
|
|
|
8
8
|
action.windows_open url: json_ui_garage_url(path: 'views/components_replace')
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
template.thumbnail title: '
|
|
12
|
-
action.windows_open url: json_ui_garage_url(path: 'views/
|
|
11
|
+
template.thumbnail title: 'logics/set', onClick: ->(action) do
|
|
12
|
+
action.windows_open url: json_ui_garage_url(path: 'views/logics_set')
|
|
13
13
|
end
|
|
14
14
|
end
|
|
@@ -5,7 +5,7 @@ json_ui_response json do |action|
|
|
|
5
5
|
status_view_id = "row_status_#{params[:_index]}"
|
|
6
6
|
# TODO: This doesn't work. It should update the status icon to indicate that the
|
|
7
7
|
# import is successful.
|
|
8
|
-
multiple.
|
|
8
|
+
multiple.logics_set \
|
|
9
9
|
targetId: status_view_id,
|
|
10
10
|
data: {
|
|
11
11
|
color: 'success',
|
|
@@ -109,13 +109,13 @@ page.scroll childViews: ->(scroll) do
|
|
|
109
109
|
childViews: ->(group) do
|
|
110
110
|
group.panels_flow id: 'flow', xs: { gap: { all: 8 } }, backgroundColor: 'grey', width: 'matchParent', childViews: ->(flow) do
|
|
111
111
|
flow.fields_check checkValue: '1', label: 'Choice 1', onChange: ->(action) do
|
|
112
|
-
action.
|
|
112
|
+
action.logics_set targetId: 'flow', data: { backgroundColor: '#ff0000' }
|
|
113
113
|
end
|
|
114
114
|
flow.fields_check checkValue: '2', label: 'Choice 2', onChange: ->(action) do
|
|
115
|
-
action.
|
|
115
|
+
action.logics_set targetId: 'flow', data: { backgroundColor: '#00ff00' }
|
|
116
116
|
end
|
|
117
117
|
flow.fields_check checkValue: '3', label: 'Choice 3', onChange: ->(action) do
|
|
118
|
-
action.
|
|
118
|
+
action.logics_set targetId: 'flow', data: { backgroundColor: '#0000ff' }
|
|
119
119
|
end
|
|
120
120
|
end
|
|
121
121
|
end
|
|
@@ -38,9 +38,9 @@ page.form(
|
|
|
38
38
|
action.components_findClosest(
|
|
39
39
|
view: 'panels/responsive',
|
|
40
40
|
onFind: ->(find) do
|
|
41
|
-
# This is to demonstrate that `
|
|
41
|
+
# This is to demonstrate that `logics_set` can be a more flexible version
|
|
42
42
|
# of `components_replace`.
|
|
43
|
-
find.
|
|
43
|
+
find.logics_set(
|
|
44
44
|
dataBuilder: ->(set) do
|
|
45
45
|
# Don't update the childViews, just update the footer
|
|
46
46
|
set.panels_responsive(
|
|
@@ -159,7 +159,7 @@ page.form(
|
|
|
159
159
|
action.components_findClosest(
|
|
160
160
|
view: 'fields/select',
|
|
161
161
|
onFind: ->(subaction) do
|
|
162
|
-
subaction.
|
|
162
|
+
subaction.logics_set(
|
|
163
163
|
data: { value: 'pt' },
|
|
164
164
|
onSet: ->(subsubaction) do
|
|
165
165
|
subsubaction.fields_blur
|
|
@@ -194,7 +194,7 @@ page.form(
|
|
|
194
194
|
text: 'Reset',
|
|
195
195
|
styleClass: 'text-primary',
|
|
196
196
|
onClick: ->(action) do
|
|
197
|
-
action.
|
|
197
|
+
action.logics_set targetId: 'lang', data: { value: [] }
|
|
198
198
|
end
|
|
199
199
|
)
|
|
200
200
|
hori.spacer width: 16
|
|
@@ -276,7 +276,7 @@ page.form(
|
|
|
276
276
|
form.button(
|
|
277
277
|
text: 'Swap spec options',
|
|
278
278
|
onClick: ->(action) do
|
|
279
|
-
action.
|
|
279
|
+
action.logics_set targetId: 'spec_options_select', data: { 'spec.options' => spec_options_alt }
|
|
280
280
|
end
|
|
281
281
|
)
|
|
282
282
|
form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
|
@@ -17,10 +17,10 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
|
17
17
|
panel.button text: '3'
|
|
18
18
|
end
|
|
19
19
|
scroll.button text: 'show', onClick: ->(action) do
|
|
20
|
-
action.
|
|
20
|
+
action.logics_set targetId: 'flow1', data: { displayed: true }
|
|
21
21
|
end
|
|
22
22
|
scroll.button text: 'hide', onClick: ->(action) do
|
|
23
|
-
action.
|
|
23
|
+
action.logics_set targetId: 'flow1', data: { displayed: false }
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
scroll.h1 text: 'Basic'
|
|
@@ -86,8 +86,8 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
|
86
86
|
backgroundColor: '#b3bac2',
|
|
87
87
|
onMouseEnter: ->(action) {
|
|
88
88
|
action.runMultiple childActions: ->(saction) do
|
|
89
|
-
saction.
|
|
90
|
-
saction.
|
|
89
|
+
saction.logics_set targetId: 'default1', data: { displayed: false }
|
|
90
|
+
saction.logics_set targetId: 'hovered1', data: { displayed: true }
|
|
91
91
|
end
|
|
92
92
|
}, childViews: ->(panel) do
|
|
93
93
|
panel.label text: 'Hover me'
|
|
@@ -99,8 +99,8 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
|
99
99
|
backgroundColor: '#b3bac2',
|
|
100
100
|
onMouseLeave: ->(action) {
|
|
101
101
|
action.runMultiple childActions: ->(saction) do
|
|
102
|
-
saction.
|
|
103
|
-
saction.
|
|
102
|
+
saction.logics_set targetId: 'default1', data: { displayed: true }
|
|
103
|
+
saction.logics_set targetId: 'hovered1', data: { displayed: false }
|
|
104
104
|
end
|
|
105
105
|
}, childViews: ->(panel) do
|
|
106
106
|
panel.label text: 'Hover active'
|
|
@@ -9,10 +9,10 @@ json_ui_page json do |page|
|
|
|
9
9
|
panel.button text: '1'
|
|
10
10
|
end
|
|
11
11
|
scroll.button text: 'show', onClick: ->(action) do
|
|
12
|
-
action.
|
|
12
|
+
action.logics_set targetId: 'hor1', data: { displayed: true }
|
|
13
13
|
end
|
|
14
14
|
scroll.button text: 'hide', onClick: ->(action) do
|
|
15
|
-
action.
|
|
15
|
+
action.logics_set targetId: 'hor1', data: { displayed: false }
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
scroll.label text: "\n"
|
|
@@ -170,8 +170,8 @@ json_ui_page json do |page|
|
|
|
170
170
|
backgroundColor: '#b3bac2',
|
|
171
171
|
onMouseEnter: ->(action) {
|
|
172
172
|
action.runMultiple childActions: ->(saction) do
|
|
173
|
-
saction.
|
|
174
|
-
saction.
|
|
173
|
+
saction.logics_set targetId: 'default1', data: { displayed: false }
|
|
174
|
+
saction.logics_set targetId: 'hovered1', data: { displayed: true }
|
|
175
175
|
end
|
|
176
176
|
}, childViews: ->(panel) do
|
|
177
177
|
panel.label text: 'Hover me'
|
|
@@ -183,8 +183,8 @@ json_ui_page json do |page|
|
|
|
183
183
|
backgroundColor: '#b3bac2',
|
|
184
184
|
onMouseLeave: ->(action) {
|
|
185
185
|
action.runMultiple childActions: ->(saction) do
|
|
186
|
-
saction.
|
|
187
|
-
saction.
|
|
186
|
+
saction.logics_set targetId: 'default1', data: { displayed: true }
|
|
187
|
+
saction.logics_set targetId: 'hovered1', data: { displayed: false }
|
|
188
188
|
end
|
|
189
189
|
}, childViews: ->(panel) do
|
|
190
190
|
panel.label text: 'Hover active'
|
|
@@ -198,8 +198,8 @@ json_ui_page json do |page|
|
|
|
198
198
|
backgroundColor: '#b3bac2',
|
|
199
199
|
onMouseEnter: ->(action) {
|
|
200
200
|
action.runMultiple childActions: ->(saction) do
|
|
201
|
-
saction.
|
|
202
|
-
saction.
|
|
201
|
+
saction.logics_set targetId: 'default2', data: { displayed: false }
|
|
202
|
+
saction.logics_set targetId: 'hovered2', data: { displayed: true }
|
|
203
203
|
end
|
|
204
204
|
}, childViews: ->(panel) do
|
|
205
205
|
panel.label text: 'Hover me'
|
|
@@ -211,8 +211,8 @@ json_ui_page json do |page|
|
|
|
211
211
|
backgroundColor: '#b3bac2',
|
|
212
212
|
onMouseLeave: ->(action) {
|
|
213
213
|
action.runMultiple childActions: ->(saction) do
|
|
214
|
-
saction.
|
|
215
|
-
saction.
|
|
214
|
+
saction.logics_set targetId: 'default2', data: { displayed: true }
|
|
215
|
+
saction.logics_set targetId: 'hovered2', data: { displayed: false }
|
|
216
216
|
end
|
|
217
217
|
}, childViews: ->(panel) do
|
|
218
218
|
panel.label text: 'Click me'
|
|
@@ -10,10 +10,10 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
|
10
10
|
panel.button text: '2'
|
|
11
11
|
end
|
|
12
12
|
scroll.button text: 'show', onClick: ->(action) do
|
|
13
|
-
action.
|
|
13
|
+
action.logics_set targetId: 'res1', data: { displayed: true }
|
|
14
14
|
end
|
|
15
15
|
scroll.button text: 'hide', onClick: ->(action) do
|
|
16
|
-
action.
|
|
16
|
+
action.logics_set targetId: 'res1', data: { displayed: false }
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
scroll.h1 text: 'Panels Columns'
|
|
@@ -167,8 +167,8 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
|
167
167
|
backgroundColor: '#c3cad2',
|
|
168
168
|
onMouseEnter: ->(action) {
|
|
169
169
|
action.runMultiple childActions: ->(saction) do
|
|
170
|
-
saction.
|
|
171
|
-
saction.
|
|
170
|
+
saction.logics_set targetId: 'default1', data: { displayed: false }
|
|
171
|
+
saction.logics_set targetId: 'hovered1', data: { displayed: true }
|
|
172
172
|
end
|
|
173
173
|
}, childViews: ->(panel) do
|
|
174
174
|
panel.label text: 'Hover me'
|
|
@@ -180,8 +180,8 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
|
180
180
|
backgroundColor: '#c3cad2',
|
|
181
181
|
onMouseLeave: ->(action) {
|
|
182
182
|
action.runMultiple childActions: ->(saction) do
|
|
183
|
-
saction.
|
|
184
|
-
saction.
|
|
183
|
+
saction.logics_set targetId: 'default1', data: { displayed: true }
|
|
184
|
+
saction.logics_set targetId: 'hovered1', data: { displayed: false }
|
|
185
185
|
end
|
|
186
186
|
}, childViews: ->(panel) do
|
|
187
187
|
panel.label text: 'Hover active'
|
|
@@ -196,8 +196,8 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
|
196
196
|
backgroundColor: '#c3cad2',
|
|
197
197
|
onMouseEnter: ->(action) {
|
|
198
198
|
action.runMultiple childActions: ->(saction) do
|
|
199
|
-
saction.
|
|
200
|
-
saction.
|
|
199
|
+
saction.logics_set targetId: 'default2', data: { displayed: false }
|
|
200
|
+
saction.logics_set targetId: 'hovered2', data: { displayed: true }
|
|
201
201
|
end
|
|
202
202
|
}, childViews: ->(panel) do
|
|
203
203
|
panel.label text: 'Hover me'
|
|
@@ -209,8 +209,8 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
|
209
209
|
backgroundColor: '#c3cad2',
|
|
210
210
|
onMouseLeave: ->(action) {
|
|
211
211
|
action.runMultiple childActions: ->(saction) do
|
|
212
|
-
saction.
|
|
213
|
-
saction.
|
|
212
|
+
saction.logics_set targetId: 'default2', data: { displayed: true }
|
|
213
|
+
saction.logics_set targetId: 'hovered2', data: { displayed: false }
|
|
214
214
|
end
|
|
215
215
|
}, childViews: ->(panel) do
|
|
216
216
|
panel.label text: 'Click me'
|
|
@@ -11,10 +11,10 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
|
11
11
|
li.label text: 'text2'
|
|
12
12
|
end
|
|
13
13
|
scroll.button text: 'show', onClick: ->(action) do
|
|
14
|
-
action.
|
|
14
|
+
action.logics_set targetId: 'ul', data: { displayed: true }
|
|
15
15
|
end
|
|
16
16
|
scroll.button text: 'hide', onClick: ->(action) do
|
|
17
|
-
action.
|
|
17
|
+
action.logics_set targetId: 'ul', data: { displayed: false }
|
|
18
18
|
end
|
|
19
19
|
scroll.spacer height: 14
|
|
20
20
|
scroll.h2 text: 'Standard Usage'
|
|
@@ -10,10 +10,10 @@ json_ui_page json do |page|
|
|
|
10
10
|
panel.button text: 'Button1'
|
|
11
11
|
end
|
|
12
12
|
scroll.button text: 'show', onClick: ->(action) do
|
|
13
|
-
action.
|
|
13
|
+
action.logics_set targetId: 'vert1', data: { displayed: true }
|
|
14
14
|
end
|
|
15
15
|
scroll.button text: 'hide', onClick: ->(action) do
|
|
16
|
-
action.
|
|
16
|
+
action.logics_set targetId: 'vert1', data: { displayed: false }
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
scroll.label text: "\n"
|
|
@@ -71,16 +71,16 @@ json_ui_page json do |page|
|
|
|
71
71
|
scroll.h1 text: 'Changed when Hover'
|
|
72
72
|
scroll.panels_vertical id: 'default1', width: 100, height: 100, backgroundColor: '#b3bac2', align: 'center', onMouseEnter: ->(action) {
|
|
73
73
|
action.runMultiple childActions: ->(saction) do
|
|
74
|
-
saction.
|
|
75
|
-
saction.
|
|
74
|
+
saction.logics_set targetId: 'default1', data: { displayed: false }
|
|
75
|
+
saction.logics_set targetId: 'hovered1', data: { displayed: true }
|
|
76
76
|
end
|
|
77
77
|
}, childViews: ->(panel) do
|
|
78
78
|
panel.label text: 'Hover me'
|
|
79
79
|
end
|
|
80
80
|
scroll.panels_vertical id: 'hovered1', displayed: false, width: 100, height: 100, backgroundColor: '#b3bac2', align: 'center', onMouseLeave: ->(action) {
|
|
81
81
|
action.runMultiple childActions: ->(saction) do
|
|
82
|
-
saction.
|
|
83
|
-
saction.
|
|
82
|
+
saction.logics_set targetId: 'default1', data: { displayed: true }
|
|
83
|
+
saction.logics_set targetId: 'hovered1', data: { displayed: false }
|
|
84
84
|
end
|
|
85
85
|
}, childViews: ->(panel) do
|
|
86
86
|
panel.label text: 'Hover active'
|
|
@@ -90,16 +90,16 @@ json_ui_page json do |page|
|
|
|
90
90
|
scroll.h1 text: 'Changed when Hover (with onClick)'
|
|
91
91
|
scroll.panels_vertical id: 'default2', width: 100, height: 100, backgroundColor: '#b3bac2', align: 'center', onMouseEnter: ->(action) {
|
|
92
92
|
action.runMultiple childActions: ->(saction) do
|
|
93
|
-
saction.
|
|
94
|
-
saction.
|
|
93
|
+
saction.logics_set targetId: 'default2', data: { displayed: false }
|
|
94
|
+
saction.logics_set targetId: 'hovered2', data: { displayed: true }
|
|
95
95
|
end
|
|
96
96
|
}, childViews: ->(panel) do
|
|
97
97
|
panel.label text: 'Hover me'
|
|
98
98
|
end
|
|
99
99
|
scroll.panels_vertical id: 'hovered2', displayed: false, width: 100, height: 100, backgroundColor: '#b3bac2', align: 'center', onMouseLeave: ->(action) {
|
|
100
100
|
action.runMultiple childActions: ->(saction) do
|
|
101
|
-
saction.
|
|
102
|
-
saction.
|
|
101
|
+
saction.logics_set targetId: 'default2', data: { displayed: true }
|
|
102
|
+
saction.logics_set targetId: 'hovered2', data: { displayed: false }
|
|
103
103
|
end
|
|
104
104
|
}, childViews: ->(panel) do
|
|
105
105
|
panel.label text: 'Click me'
|
|
@@ -72,16 +72,16 @@ page.scroll childViews: ->(scroll) do
|
|
|
72
72
|
end,
|
|
73
73
|
onSubmitStart: ->(action) do
|
|
74
74
|
action.runMultiple childActions: ->(multiple) do
|
|
75
|
-
multiple.
|
|
76
|
-
multiple.
|
|
77
|
-
multiple.
|
|
75
|
+
multiple.logics_set targetId: 'submit_top', data: { disabled: true }
|
|
76
|
+
multiple.logics_set targetId: 'submit_bottom', data: { disabled: true }
|
|
77
|
+
multiple.logics_set targetId: 'cancel_button', data: { displayed: true }
|
|
78
78
|
end
|
|
79
79
|
end,
|
|
80
80
|
onSubmitEnd: ->(action) do
|
|
81
81
|
action.runMultiple childActions: ->(multiple) do
|
|
82
|
-
multiple.
|
|
83
|
-
multiple.
|
|
84
|
-
multiple.
|
|
82
|
+
multiple.logics_set targetId: 'submit_top', data: { disabled: false }
|
|
83
|
+
multiple.logics_set targetId: 'submit_bottom', data: { disabled: false }
|
|
84
|
+
multiple.logics_set targetId: 'cancel_button', data: { displayed: false }
|
|
85
85
|
end
|
|
86
86
|
end,
|
|
87
87
|
onRowsLoad: ->(action) do
|
|
@@ -94,8 +94,8 @@ page.scroll childViews: ->(scroll) do
|
|
|
94
94
|
conditionalData: {
|
|
95
95
|
text: { "count": [{ "var": 'data.loadedRows' }] }
|
|
96
96
|
}
|
|
97
|
-
multiple.
|
|
98
|
-
multiple.
|
|
97
|
+
multiple.logics_set targetId: 'submit_top', data: { displayed: true }
|
|
98
|
+
multiple.logics_set targetId: 'submit_bottom', data: { displayed: true }
|
|
99
99
|
end
|
|
100
100
|
end,
|
|
101
101
|
onRowsSelect: ->(action) do
|
|
@@ -36,7 +36,7 @@ page.body(
|
|
|
36
36
|
flow.button(
|
|
37
37
|
text: 'Default size',
|
|
38
38
|
onClick: ->(action) do
|
|
39
|
-
action.
|
|
39
|
+
action.logics_set(
|
|
40
40
|
targetId: 'calendar_main',
|
|
41
41
|
data: {
|
|
42
42
|
height: 420,
|
|
@@ -50,21 +50,21 @@ page.body(
|
|
|
50
50
|
flow.button(
|
|
51
51
|
text: 'Compact',
|
|
52
52
|
onClick: ->(action) do
|
|
53
|
-
action.
|
|
53
|
+
action.logics_set targetId: 'calendar_main', data: { height: 320 }
|
|
54
54
|
end
|
|
55
55
|
)
|
|
56
56
|
flow.spacer width: 6
|
|
57
57
|
flow.button(
|
|
58
58
|
text: 'Tall',
|
|
59
59
|
onClick: ->(action) do
|
|
60
|
-
action.
|
|
60
|
+
action.logics_set targetId: 'calendar_main', data: { height: 560 }
|
|
61
61
|
end
|
|
62
62
|
)
|
|
63
63
|
flow.spacer width: 6
|
|
64
64
|
flow.button(
|
|
65
65
|
text: 'Fixed width',
|
|
66
66
|
onClick: ->(action) do
|
|
67
|
-
action.
|
|
67
|
+
action.logics_set targetId: 'calendar_main', data: { width: 720 }
|
|
68
68
|
end
|
|
69
69
|
)
|
|
70
70
|
end
|
|
@@ -87,7 +87,7 @@ page.body(
|
|
|
87
87
|
flow.button(
|
|
88
88
|
text: 'Empty data',
|
|
89
89
|
onClick: ->(action) do
|
|
90
|
-
action.
|
|
90
|
+
action.logics_set(
|
|
91
91
|
targetId: 'calendar_main',
|
|
92
92
|
data: { dataUrl: json_ui_garage_url(path: 'test_page/calendar_empty_data') }
|
|
93
93
|
)
|
|
@@ -97,7 +97,7 @@ page.body(
|
|
|
97
97
|
flow.button(
|
|
98
98
|
text: 'Restore data',
|
|
99
99
|
onClick: ->(action) do
|
|
100
|
-
action.
|
|
100
|
+
action.logics_set(
|
|
101
101
|
targetId: 'calendar_main',
|
|
102
102
|
data: { dataUrl: json_ui_garage_url(path: 'views/calendar_data') }
|
|
103
103
|
)
|
|
@@ -30,15 +30,15 @@ page.body childViews: ->(body) do
|
|
|
30
30
|
res.spacer height: 8
|
|
31
31
|
res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
|
|
32
32
|
flow.button text: 'Fill equally', onClick: ->(action) do
|
|
33
|
-
action.
|
|
33
|
+
action.logics_set targetId: 'carousel_main', data: { distribution: 'fillEqually' }
|
|
34
34
|
end
|
|
35
35
|
flow.spacer width: 4
|
|
36
36
|
flow.button text: 'Space equally', onClick: ->(action) do
|
|
37
|
-
action.
|
|
37
|
+
action.logics_set targetId: 'carousel_main', data: { distribution: 'spaceEqually' }
|
|
38
38
|
end
|
|
39
39
|
flow.spacer width: 4
|
|
40
40
|
flow.button text: 'Clear distribution', onClick: ->(action) do
|
|
41
|
-
action.
|
|
41
|
+
action.logics_set targetId: 'carousel_main', data: { distribution: nil }
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
@@ -53,7 +53,7 @@ page.body childViews: ->(body) do
|
|
|
53
53
|
['A', 'B', 'C'].each do |label|
|
|
54
54
|
carousel.panels_vertical width: 120, height: 60, backgroundColor: '#e6e6e6', align: 'center', childViews: ->(panel) do
|
|
55
55
|
panel.button text: "Pick #{label}", onClick: ->(action) do
|
|
56
|
-
action.
|
|
56
|
+
action.logics_set targetId: 'carousel_action_status', data: { text: "Action status: #{label}" }
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
59
|
end
|