alchemy-form 0.3.0-alpha.1 → 0.3.0-alpha.3
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.
- package/CHANGELOG.md +27 -0
- package/assets/stylesheets/form/alchemy_form.scss +1 -2
- package/assets/stylesheets/form/elements/_button.scss +4 -31
- package/assets/stylesheets/form/elements/_dropdown.scss +93 -0
- package/assets/stylesheets/form/elements/_enum_badge.scss +7 -0
- package/assets/stylesheets/form/elements/_feedback_input.scss +2 -0
- package/assets/stylesheets/form/elements/_field.scss +16 -25
- package/assets/stylesheets/form/elements/_form.scss +7 -2
- package/assets/stylesheets/form/elements/_select.scss +176 -176
- package/assets/stylesheets/form/elements/_table.scss +117 -46
- package/assets/stylesheets/form/elements/_tabs.scss +25 -35
- package/assets/stylesheets/form/elements/index.scss +20 -18
- package/assets/stylesheets/form/general/index.scss +2 -2
- package/config/routes.js +10 -0
- package/controller/form_api_controller.js +28 -0
- package/element/00_form_base.js +82 -27
- package/element/10_dataprovider.js +2 -2
- package/element/al_button.js +12 -1
- package/element/al_dropdown.js +123 -0
- package/element/al_dropdown_item.js +40 -0
- package/element/al_enum_badge.js +157 -0
- package/element/al_field.js +196 -37
- package/element/al_field_array.js +22 -0
- package/element/al_field_schema.js +222 -55
- package/element/al_form.js +9 -6
- package/element/al_select.js +2 -2
- package/element/al_table.js +8 -2
- package/helper/field_recompute_handler.js +0 -2
- package/package.json +3 -2
- package/view/form/elements/al_dropdown.hwk +21 -0
- package/view/form/elements/al_enum_badge.hwk +9 -0
- package/view/form/elements/alchemy_field.hwk +3 -12
- package/view/form/elements/alchemy_field_array.hwk +16 -6
- package/view/form/elements/alchemy_field_array_entry.hwk +10 -5
- package/view/form/elements/alchemy_field_schema.hwk +2 -2
- package/view/form/inputs/edit/enum.hwk +1 -1
- package/view/form/inputs/edit_sw/fallback.hwk +1 -0
- package/view/form/inputs/view/association_alias.hwk +16 -0
- package/view/form/inputs/view/schema.hwk +4 -0
- package/view/form/inputs/view/string.hwk +1 -1
- package/view/form/inputs/view_inline/belongs_to.hwk +16 -0
- package/view/form/inputs/view_inline/boolean.hwk +24 -17
- package/view/form/inputs/view_inline/datetime.hwk +31 -24
- package/view/form/inputs/view_inline/enum.hwk +32 -1
- package/view/form/inputs/view_inline/objectid.hwk +9 -1
- package/view/form/inputs/view_inline/string.hwk +11 -3
- package/view/form/wrappers/edit_sw/default.hwk +1 -0
|
@@ -1,19 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
class="alchemy-field-value
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
{% if (value_is_empty AND self.allow_empty_value_placeholder) %}
|
|
2
|
+
<span class="alchemy-field-value">
|
|
3
|
+
<span class="badge alchemy-field-empty-value-placeholder">
|
|
4
|
+
{{ self.createEmptyValuePlaceholderText() }}
|
|
5
|
+
</span>
|
|
6
|
+
</span>
|
|
7
|
+
{% else %}
|
|
8
|
+
<span class="badge alchemy-field-value">
|
|
9
|
+
<% $0.classList.add('boolean-' + value) %>
|
|
6
10
|
|
|
7
|
-
if
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
new_class = 'boolean-null';
|
|
13
|
-
value = 'empty';
|
|
14
|
-
}
|
|
11
|
+
{% if value %}
|
|
12
|
+
<al-icon class="value-icon" icon-name="check"></al-icon>
|
|
13
|
+
{% else %}
|
|
14
|
+
<al-icon class="value-icon" icon-name="xmark"></al-icon>
|
|
15
|
+
{% /if %}
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
{%t
|
|
18
|
+
"" + value
|
|
19
|
+
field_name=self.field_name
|
|
20
|
+
model_name=self.model
|
|
21
|
+
field_type=self.field_type
|
|
22
|
+
zone=self.zone
|
|
23
|
+
path=self.config.path_in_document
|
|
24
|
+
%}
|
|
25
|
+
</span>
|
|
26
|
+
{% /if %}
|
|
@@ -1,28 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
{% if (value_is_empty AND self.allow_empty_value_placeholder) %}
|
|
2
|
+
<span class="alchemy-field-value">
|
|
3
|
+
<span class="badge alchemy-field-empty-value-placeholder">
|
|
4
|
+
{{ self.createEmptyValuePlaceholderText() }}
|
|
5
|
+
</span>
|
|
6
|
+
</span>
|
|
7
|
+
{% else %}
|
|
8
|
+
<%
|
|
9
|
+
date_format = '';
|
|
3
10
|
|
|
4
|
-
if (alchemy_field && alchemy_field.applied_options) {
|
|
5
|
-
|
|
6
|
-
}
|
|
11
|
+
if (alchemy_field && alchemy_field.applied_options) {
|
|
12
|
+
date_format = alchemy_field.applied_options.date_format;
|
|
13
|
+
}
|
|
7
14
|
|
|
8
|
-
if (!date_format || date_format == 'timeago' || date_format == 'time-ago' || date_format == 'time_ago') {
|
|
9
|
-
|
|
10
|
-
}
|
|
15
|
+
if (!date_format || date_format == 'timeago' || date_format == 'time-ago' || date_format == 'time_ago') {
|
|
16
|
+
date_format = 'relative';
|
|
17
|
+
}
|
|
11
18
|
|
|
12
|
-
if (alchemy_field?.config?.options?.time_ago) {
|
|
13
|
-
|
|
14
|
-
}
|
|
19
|
+
if (alchemy_field?.config?.options?.time_ago) {
|
|
20
|
+
date_format = 'relative';
|
|
21
|
+
}
|
|
22
|
+
%>
|
|
15
23
|
|
|
16
|
-
%>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<% } %>
|
|
24
|
+
<% if (date_format == 'relative') { %>
|
|
25
|
+
<time-ago
|
|
26
|
+
class="alchemy-field-value"
|
|
27
|
+
date={% value.toISOString() %}
|
|
28
|
+
></time-ago>
|
|
29
|
+
<% } else { %>
|
|
30
|
+
<time
|
|
31
|
+
class="alchemy-field-value"
|
|
32
|
+
datetime={% value.toISOString() %}
|
|
33
|
+
>{{ value.format(date_format) }}</time>
|
|
34
|
+
<% } %>
|
|
35
|
+
{% /if %}
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
{% if (value_is_empty AND self.allow_empty_value_placeholder) %}
|
|
2
|
+
<span class="alchemy-field-value">
|
|
3
|
+
<span class="badge alchemy-field-empty-value-placeholder">
|
|
4
|
+
{{ self.createEmptyValuePlaceholderText() }}
|
|
5
|
+
</span>
|
|
6
|
+
</span>
|
|
7
|
+
{% else %}
|
|
8
|
+
{% set enum_config to self.config.getValueConfiguration(value) %}
|
|
9
|
+
{% set display_value to OR enum_config.title OR enum_config.name OR value %}
|
|
10
|
+
|
|
11
|
+
<span class="badge alchemy-field-value alchemy-field-enum">
|
|
12
|
+
<% $0.classList.add('enum-' + value) %>
|
|
13
|
+
|
|
14
|
+
{% if enum_config.number %}
|
|
15
|
+
<% $0.dataset.badgeColorSet = enum_config.number %>
|
|
16
|
+
{% /if %}
|
|
17
|
+
|
|
18
|
+
{% if enum_config.color %}
|
|
19
|
+
<% $0.style.setProperty('--badge-bg', enum_config.color) %>
|
|
20
|
+
{% /if %}
|
|
21
|
+
|
|
22
|
+
{% if enum_config.text_color %}
|
|
23
|
+
<% $0.style.setProperty('--badge-color', enum_config.text_color) %>
|
|
24
|
+
{% /if %}
|
|
25
|
+
|
|
26
|
+
{% if enum_config.icon %}
|
|
27
|
+
<al-icon class="value-icon" icon-name={% enum_config.icon %}></al-icon>
|
|
28
|
+
{% /if %}
|
|
29
|
+
|
|
30
|
+
<span class="alchemy-enum-display-value">{{ display_value }}</span>
|
|
31
|
+
</span>
|
|
32
|
+
{% /if %}
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
{% if (value_is_empty AND self.allow_empty_value_placeholder) %}
|
|
2
|
+
<span class="alchemy-field-value">
|
|
3
|
+
<span class="badge alchemy-field-empty-value-placeholder">
|
|
4
|
+
{{ self.createEmptyValuePlaceholderText() }}
|
|
5
|
+
</span>
|
|
6
|
+
</span>
|
|
7
|
+
{% else %}
|
|
8
|
+
<code class="alchemy-field-value">{{ value }}</code>
|
|
9
|
+
{% /if %}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
<div>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
{% if (value_is_empty AND self.allow_empty_value_placeholder) %}
|
|
3
|
+
<span class="alchemy-field-value">
|
|
4
|
+
<span class="badge alchemy-field-empty-value-placeholder">
|
|
5
|
+
{{ self.createEmptyValuePlaceholderText() }}
|
|
6
|
+
</span>
|
|
7
|
+
</span>
|
|
8
|
+
{% else %}
|
|
9
|
+
<span class="alchemy-field-value">{{ value }}</span>
|
|
10
|
+
{% if alchemy_field.config.options.suffix %}
|
|
11
|
+
<span class="alchemy-field-suffix">{{ alchemy_field.config.options.suffix }}</span>
|
|
12
|
+
{% /if %}
|
|
5
13
|
{% /if %}
|
|
6
14
|
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<div class="wrapped-inline" data-he-name="field"></div>
|