keystone_ui 0.15.1 → 0.16.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: efab888e379841270a79e3d2410df8c4905eb0270f5e13091b2f7db40d96f0fc
|
|
4
|
+
data.tar.gz: f5487f7756e4771a754d7bba15ccb009519ac0af076c4dc04dd28015586f9672
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4f0c8f0433e90eb500c28eb36201b69d141968a6c482db81e9ccb4fd3e0cf0e81ed202d8b6f8b1dae6cd2e8f325b1d92674aa1464c9029470a4d26082e92fd20
|
|
7
|
+
data.tar.gz: 4e5c1a2317719013e90221c344248aecb5b88649722e968806af6b7d7001b994a5bf9cc9a6f05d16cc75384c66a04ff49b4702f21d20696d8516d6f65b354058
|
|
@@ -11,7 +11,7 @@ module Keystone
|
|
|
11
11
|
CHECKBOX_CLASSES = "ks-checkbox"
|
|
12
12
|
CHECKBOX_WRAPPER_CLASSES = "flex items-center gap-2"
|
|
13
13
|
|
|
14
|
-
def initialize(attribute:, label: nil, type: :text, required: false, hint: nil, placeholder: nil, min: nil, max: nil, step: nil, value: nil, options: [], errors: [], include_blank: nil)
|
|
14
|
+
def initialize(attribute:, label: nil, type: :text, required: false, hint: nil, placeholder: nil, min: nil, max: nil, step: nil, value: nil, options: [], errors: [], include_blank: nil, disabled: false)
|
|
15
15
|
@attribute = attribute
|
|
16
16
|
@label = label
|
|
17
17
|
@type = type
|
|
@@ -25,6 +25,7 @@ module Keystone
|
|
|
25
25
|
@options = options
|
|
26
26
|
@errors = Array(errors)
|
|
27
27
|
@include_blank = include_blank.to_s
|
|
28
|
+
@disabled = disabled
|
|
28
29
|
end
|
|
29
30
|
|
|
30
31
|
def label_text
|
|
@@ -81,6 +82,7 @@ module Keystone
|
|
|
81
82
|
options[:min] = @min unless @min.nil?
|
|
82
83
|
options[:max] = @max unless @max.nil?
|
|
83
84
|
options[:step] = @step unless @step.nil?
|
|
85
|
+
options[:disabled] = true if @disabled
|
|
84
86
|
options
|
|
85
87
|
end
|
|
86
88
|
end
|
data/lib/keystone_ui/version.rb
CHANGED
|
@@ -102,7 +102,7 @@ outer element. See Conventions before using it.
|
|
|
102
102
|
The `<form>` wrapper. `method:` may be `:patch`/`:put`/`:delete` and is
|
|
103
103
|
translated for Rails. Set `multipart: true` when the form contains a file
|
|
104
104
|
upload.
|
|
105
|
-
- `ui_form_field(attribute:, label: nil, type: :text, required: false, hint: nil, placeholder: nil, min: nil, max: nil, step: nil, value: nil, options: [], errors: [], include_blank: nil)`
|
|
105
|
+
- `ui_form_field(attribute:, label: nil, type: :text, required: false, hint: nil, placeholder: nil, min: nil, max: nil, step: nil, value: nil, options: [], errors: [], include_blank: nil, disabled: false)`
|
|
106
106
|
— a labeled field with hint and error text. This is the default way to render
|
|
107
107
|
an input. `type:` `:text` `:number` `:email` `:password` `:date` `:textarea`
|
|
108
108
|
`:checkbox` `:select`. `attribute:` is used verbatim as the input's `name`, so
|