glib-web 4.33.1 → 4.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 307dc463b8d03bc6371b54112e8808fb33329817402091db465e136aa9018296
4
- data.tar.gz: 20236992e791e6a22a196bed6d0873a57966f54f30fe536e966d009366ef9088
3
+ metadata.gz: c16c0b1492e8c1d4fb291c5d0583ec13c4992ca2b5ec316a62b416d8a28b7d6b
4
+ data.tar.gz: b66e7297e95ba58a93926d161c545fbe37f4dbf74c9791709918035390c13194
5
5
  SHA512:
6
- metadata.gz: 44d1f62ca1ffa46a1ecd22473c5cc611791a8dd28cea6e35154aefbca9eecb85b97516903c197bc7ea70bfe86d1737127500326ed02e494947f487e04841c93a
7
- data.tar.gz: 6aad990cbbaae71101488d30f0f94c763e834dd3ffcef7f8e7cd201f2bc5d2413dcb2bfa94b0235e6393842c24dcb01468dc342b72b81e252512228100826f9f
6
+ metadata.gz: ba8ba85ef6ff6fedcd0099bbcd61fc9296b37aafe83b44537583b7fe61c1e1e05a35b72b70850a36b19ae6a04df35ceafad75a4c7d6b8056403960a26db4802c
7
+ data.tar.gz: a375d20580ee3e4e3df3a2134b1db9ada9758d2e2516b6ce1ce4e80be1bb47514650a2fa017f919da88e0eb267563b15c639099b924c29b7316db734558c1d9e
@@ -42,8 +42,7 @@ class Glib::JsonUi::ViewBuilder
42
42
  string :prefix
43
43
  string :suffix
44
44
  bool :formatYAxis
45
- string :indexAxis
46
- bool :horizontalStacked
45
+ bool :horizontal
47
46
  int :min
48
47
  int :max
49
48
  # https://www.chartjs.org/docs/latest/configuration/legend.html
@@ -4,7 +4,7 @@ page = json_ui_page json
4
4
 
5
5
  render "#{@path_prefix}/nav_menu", json: json, page: page
6
6
 
7
- page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
7
+ page.form id: 'form', url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
8
8
 
9
9
  form.spacer height: 20
10
10
  form.h2 text: 'Basic select fields'
@@ -62,7 +62,7 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
62
62
  options: options,
63
63
  value: ['melbourne', 'sydney'],
64
64
  multiple: true,
65
- onChange: ->(action) do
65
+ onChange: ->(action) do
66
66
  action.dialogs_alert message: 'Options selected'
67
67
  end
68
68
 
@@ -141,11 +141,25 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
141
141
  end
142
142
 
143
143
  form.fields_select \
144
+ id: 'lang',
144
145
  name: 'user[languages][]',
145
146
  width: 'matchParent',
146
147
  label: 'Primary Language',
147
148
  options: options,
148
149
  value: ['ja', 'de'],
150
+ accessory: ->(view) do
151
+ view.footer padding: { x: 16, y: 10 }, width: 'matchParent', styleClass: 'sticky-footer', childViews: ->(footer) do
152
+ footer.panels_flow width: 'matchParent', styleClass: 'justify-end', childViews: ->(hori) do
153
+ hori.label text: 'Reset', styleClass: 'text-primary', onClick: ->(action) do
154
+ action.components_set targetId: 'lang', data: { value: [] }
155
+ end
156
+ hori.spacer width: 16
157
+ hori.label text: 'Apply', styleClass: 'text-primary', onClick: ->(action) do
158
+ action.forms_submit targetId: 'form'
159
+ end
160
+ end
161
+ end
162
+ end,
149
163
  multiple: true
150
164
 
151
165
  form.spacer height: 6
@@ -196,7 +210,7 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
196
210
  label: 'Time Zone',
197
211
  clearable: true,
198
212
  value: 'America/Chicago'
199
- # value: 'Australia/Melbourne'
213
+ # value: 'Australia/Melbourne'
200
214
 
201
215
 
202
216
  form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
@@ -170,7 +170,7 @@ else
170
170
  json.points points
171
171
  end
172
172
  ],
173
- indexAxis: 'y', horizontalStacked: true,
173
+ horizontal: true, stacked: true,
174
174
  colors: ['#7A71F4', '#53B3E4', 'red'], legend: { override: true }
175
175
  scroll.h2 text: 'Column chart (Stacked)'
176
176
  scroll.charts_column stacked: true, dataGroups: [
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Glib
6
+ class Localize < Base
7
+ RESTRICT_ON_SEND = %i[h1 h2 h3 h4 h5 p label markdown
8
+ fields_text fields_number fields_select fields_password
9
+ fields_textarea fields_check fields_checkGroup fields_chipGroup
10
+ fields_timeZone fields_radioGroup fields_date fields_datetime].freeze
11
+
12
+ def_node_matcher :watched_key?, <<~PATTERN
13
+ (send _ _ (hash <(pair (sym {:title | :subtitle | :subsubtitle | :label | :placeholder | :text}) $...) ...>))
14
+ PATTERN
15
+
16
+ def on_send(node)
17
+ watched_key?(node) do |snode|
18
+ add_offense(snode.first, message: 'Unlocalized string') if snode.first.str_type? || snode.first.dstr_type?
19
+ end
20
+ end
21
+
22
+ alias on_csend on_send
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1 @@
1
+ require_relative 'rubocop/cops/localize'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.33.1
4
+ version: 4.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -417,6 +417,8 @@ files:
417
417
  - lib/glib/json_crawler/http.rb
418
418
  - lib/glib/json_crawler/router.rb
419
419
  - lib/glib/mailer_tester.rb
420
+ - lib/glib/rubocop.rb
421
+ - lib/glib/rubocop/cops/localize.rb
420
422
  - lib/glib/snapshot.rb
421
423
  - lib/glib/test_helpers.rb
422
424
  - lib/glib/time_freezable_mailer.rb