@projectcaluma/ember-form-builder 9.0.2 → 9.0.6
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/addon/components/cfb-float-input.hbs +14 -0
- package/addon/components/cfb-float-input.js +10 -4
- package/addon/components/cfb-form-editor/general.hbs +90 -86
- package/addon/components/cfb-form-editor/general.js +43 -45
- package/addon/components/cfb-form-editor/question/default/table.js +12 -0
- package/addon/components/cfb-form-editor/question/default.hbs +11 -9
- package/addon/components/cfb-form-editor/question/default.js +19 -29
- package/addon/components/cfb-form-editor/question/options.hbs +80 -82
- package/addon/components/cfb-form-editor/question/options.js +116 -105
- package/addon/components/cfb-form-editor/question/validation.hbs +14 -12
- package/addon/components/cfb-form-editor/question/validation.js +21 -30
- package/addon/components/cfb-form-editor/question-list/item.js +2 -4
- package/addon/components/cfb-form-editor/question.hbs +386 -360
- package/addon/components/cfb-form-editor/question.js +136 -145
- package/addon/components/cfb-form-list.hbs +1 -1
- package/addon/components/cfb-jexl-boolean-toggle-switch.hbs +12 -10
- package/addon/components/cfb-jexl-boolean-toggle-switch.js +11 -10
- package/addon/components/cfb-label.hbs +12 -4
- package/addon/components/cfb-navigation.js +1 -1
- package/addon/components/cfb-toggle-switch.hbs +14 -12
- package/addon/controllers/edit/questions/edit.js +4 -1
- package/addon/controllers/edit/questions/new.js +4 -1
- package/addon/controllers/edit.js +4 -4
- package/addon/controllers/index.js +5 -2
- package/addon/controllers/new.js +4 -1
- package/addon/engine.js +1 -8
- package/addon/validators/gt-lt.js +3 -2
- package/app/components/{cfb-float-input/input.js → cfb-form-editor/question/default/table.js} +1 -1
- package/package.json +18 -16
- package/translations/de.yaml +2 -2
- package/translations/en.yaml +2 -2
- package/addon/components/cfb-float-input/input.js +0 -12
- package/addon/components/cfb-label.js +0 -5
|
@@ -1,88 +1,96 @@
|
|
|
1
|
-
{{
|
|
2
|
-
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
<div class="uk-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
<div {{did-insert this.fetchData}} {{did-update this.fetchData @slug @form}}>
|
|
2
|
+
{{#if this.data.isRunning}}
|
|
3
|
+
<div class="uk-flex uk-flex-center uk-flex-middle uk-height-small">
|
|
4
|
+
<UkSpinner @ratio={{2}} />
|
|
5
|
+
</div>
|
|
6
|
+
{{else if this.model}}
|
|
7
|
+
<ValidatedForm
|
|
8
|
+
@model={{this.changeset}}
|
|
9
|
+
@on-submit={{perform this.submit}}
|
|
10
|
+
as |f|
|
|
11
|
+
>
|
|
12
|
+
{{#if (and f.model.isDirty @slug)}}
|
|
13
|
+
<div class="uk-alert-warning uk-animation-fade" uk-alert>
|
|
14
|
+
<a href="#" class="uk-alert-close" uk-close></a>
|
|
15
|
+
<div uk-grid class="uk-grid-small">
|
|
16
|
+
<div class="uk-width-auto uk-flex uk-flex-middle">
|
|
17
|
+
<UkIcon @icon="warning" @ratio={{1.2}} />
|
|
18
|
+
</div>
|
|
19
|
+
<div class="uk-width-expand">
|
|
20
|
+
<strong>{{t
|
|
21
|
+
"caluma.form-builder.question.minor-info-title"
|
|
22
|
+
}}</strong>
|
|
23
|
+
{{t "caluma.form-builder.question.minor-info"}}
|
|
24
|
+
</div>
|
|
23
25
|
</div>
|
|
24
26
|
</div>
|
|
25
|
-
|
|
26
|
-
{{/if}}
|
|
27
|
+
{{/if}}
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
<f.input
|
|
30
|
+
@type="select"
|
|
31
|
+
@options={{this.possibleTypes}}
|
|
32
|
+
@optionLabelPath="label"
|
|
33
|
+
@optionTargetPath="value"
|
|
34
|
+
@label={{t "caluma.form-builder.question.type"}}
|
|
35
|
+
@hint={{t "caluma.form-builder.question.type-disabled"}}
|
|
36
|
+
@name="__typename"
|
|
37
|
+
@required={{true}}
|
|
38
|
+
@disabled={{@slug}}
|
|
39
|
+
@on-update={{changeset-set f.model "__typename"}}
|
|
40
|
+
/>
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
<f.input
|
|
43
|
+
@label={{t "caluma.form-builder.question.label"}}
|
|
44
|
+
@name="label"
|
|
45
|
+
@required={{true}}
|
|
46
|
+
@on-update={{this.updateLabel}}
|
|
47
|
+
/>
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
49
|
+
<div uk-grid class="uk-grid-small uk-margin">
|
|
50
|
+
<div class="uk-width-expand">
|
|
51
|
+
{{#if (or @slug (not this.prefix))}}
|
|
52
|
+
<f.input
|
|
53
|
+
@name="slug"
|
|
54
|
+
@label={{t "caluma.form-builder.question.slug"}}
|
|
55
|
+
@required={{true}}
|
|
56
|
+
@disabled={{@slug}}
|
|
57
|
+
@on-update={{this.updateSlug}}
|
|
58
|
+
/>
|
|
59
|
+
{{else}}
|
|
60
|
+
<f.input
|
|
61
|
+
@name="slug"
|
|
62
|
+
@label={{t "caluma.form-builder.question.slug"}}
|
|
63
|
+
@required={{true}}
|
|
64
|
+
@disabled={{@slug}}
|
|
65
|
+
@on-update={{this.updateSlug value="target.value"}}
|
|
66
|
+
as |fi|
|
|
67
|
+
>
|
|
68
|
+
<div class="cfb-prefixed">
|
|
69
|
+
<span class="cfb-prefixed-slug">{{this.prefix}}</span>
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
<f.input
|
|
72
|
+
@model={{fi.model}}
|
|
73
|
+
@name={{fi.name}}
|
|
74
|
+
@value={{fi.value}}
|
|
75
|
+
@update={{fi.update}}
|
|
76
|
+
@setDirty={{fi.setDirty}}
|
|
77
|
+
@inputId={{fi.inputId}}
|
|
78
|
+
@isValid={{fi.isValid}}
|
|
79
|
+
@isInvalid={{fi.isInvalid}}
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
</f.input>
|
|
83
|
+
{{/if}}
|
|
84
|
+
</div>
|
|
83
85
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
{{#if
|
|
87
|
+
(not
|
|
88
|
+
(or
|
|
89
|
+
(has-question-type f.model "static" "calculated-float")
|
|
90
|
+
(not (includes f.model.isRequired (array "true" "false")))
|
|
91
|
+
)
|
|
92
|
+
)
|
|
93
|
+
}}
|
|
86
94
|
<f.input
|
|
87
95
|
@name="isRequired"
|
|
88
96
|
@label={{t "caluma.form-builder.question.isRequired"}}
|
|
@@ -91,32 +99,50 @@
|
|
|
91
99
|
"cfb-jexl-boolean-toggle-switch"
|
|
92
100
|
size="small"
|
|
93
101
|
}}
|
|
94
|
-
class="uk-flex uk-flex-between uk-flex-column"
|
|
95
102
|
/>
|
|
96
|
-
|
|
103
|
+
{{/if}}
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
{{#if (has-question-type f.model "calculated-float")}}
|
|
107
|
+
<f.input
|
|
108
|
+
@label={{t "caluma.form-builder.question.calcExpression"}}
|
|
109
|
+
@name="calcExpression"
|
|
110
|
+
@renderComponent={{component "cfb-code-editor" language="jexl"}}
|
|
111
|
+
/>
|
|
97
112
|
{{/if}}
|
|
98
|
-
</div>
|
|
99
113
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
{{#if (has-question-type f.model "static")}}
|
|
115
|
+
<div class="uk-margin">
|
|
116
|
+
<f.input
|
|
117
|
+
@label={{t "caluma.form-builder.question.staticContent"}}
|
|
118
|
+
@name="staticContent"
|
|
119
|
+
@renderComponent={{component
|
|
120
|
+
"cfb-code-editor"
|
|
121
|
+
language="markdown"
|
|
122
|
+
className="uk-margin-remove-bottom"
|
|
123
|
+
}}
|
|
124
|
+
class="uk-margin-remove-bottom"
|
|
125
|
+
/>
|
|
126
|
+
<small class="uk-text-muted">
|
|
127
|
+
{{t "caluma.form-builder.question.supportsMarkdownPrefix"}}
|
|
128
|
+
<a
|
|
129
|
+
target="_blank"
|
|
130
|
+
rel="noopener noreferrer"
|
|
131
|
+
href="https://www.markdownguide.org/basic-syntax"
|
|
132
|
+
>{{t "caluma.form-builder.question.markdown"}}</a>
|
|
133
|
+
</small>
|
|
134
|
+
</div>
|
|
135
|
+
{{/if}}
|
|
108
136
|
|
|
109
|
-
{{#if (has-question-type f.model "static")}}
|
|
110
137
|
<div class="uk-margin">
|
|
111
138
|
<f.input
|
|
112
|
-
@label={{t "caluma.form-builder.question.
|
|
113
|
-
@name="
|
|
139
|
+
@label={{t "caluma.form-builder.question.infoText"}}
|
|
140
|
+
@name="infoText"
|
|
114
141
|
@renderComponent={{component
|
|
115
142
|
"cfb-code-editor"
|
|
116
143
|
language="markdown"
|
|
117
144
|
className="uk-margin-remove-bottom"
|
|
118
145
|
}}
|
|
119
|
-
class="uk-margin-remove-bottom"
|
|
120
146
|
/>
|
|
121
147
|
<small class="uk-text-muted">
|
|
122
148
|
{{t "caluma.form-builder.question.supportsMarkdownPrefix"}}
|
|
@@ -127,148 +153,125 @@
|
|
|
127
153
|
>{{t "caluma.form-builder.question.markdown"}}</a>
|
|
128
154
|
</small>
|
|
129
155
|
</div>
|
|
130
|
-
{{/if}}
|
|
131
|
-
|
|
132
|
-
<div class="uk-margin">
|
|
133
|
-
<f.input
|
|
134
|
-
@label={{t "caluma.form-builder.question.infoText"}}
|
|
135
|
-
@name="infoText"
|
|
136
|
-
@renderComponent={{component
|
|
137
|
-
"cfb-code-editor"
|
|
138
|
-
language="markdown"
|
|
139
|
-
className="uk-margin-remove-bottom"
|
|
140
|
-
}}
|
|
141
|
-
/>
|
|
142
|
-
<small class="uk-text-muted">
|
|
143
|
-
{{t "caluma.form-builder.question.supportsMarkdownPrefix"}}
|
|
144
|
-
<a
|
|
145
|
-
target="_blank"
|
|
146
|
-
rel="noopener noreferrer"
|
|
147
|
-
href="https://www.markdownguide.org/basic-syntax"
|
|
148
|
-
>{{t "caluma.form-builder.question.markdown"}}</a>
|
|
149
|
-
</small>
|
|
150
|
-
</div>
|
|
151
156
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
{{#if (has-question-type f.model "text" "textarea" "integer" "float")}}
|
|
158
|
+
<f.input
|
|
159
|
+
@name="placeholder"
|
|
160
|
+
@label={{t "caluma.form-builder.question.placeholder"}}
|
|
161
|
+
/>
|
|
162
|
+
{{/if}}
|
|
158
163
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
{{#if
|
|
165
|
+
(and
|
|
166
|
+
@slug
|
|
167
|
+
(has-question-type
|
|
168
|
+
f.model
|
|
169
|
+
"text"
|
|
170
|
+
"textarea"
|
|
171
|
+
"integer"
|
|
172
|
+
"float"
|
|
173
|
+
"choice"
|
|
174
|
+
"multiple-choice"
|
|
175
|
+
"date"
|
|
176
|
+
"table"
|
|
177
|
+
)
|
|
172
178
|
)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
{{/if}}
|
|
179
|
+
}}
|
|
180
|
+
<f.input
|
|
181
|
+
@name="defaultAnswer"
|
|
182
|
+
@label={{t "caluma.form-builder.question.defaultValue"}}
|
|
183
|
+
@renderComponent={{component "cfb-form-editor/question/default"}}
|
|
184
|
+
/>
|
|
185
|
+
{{/if}}
|
|
181
186
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
{{#if (has-question-type f.model "text" "textarea")}}
|
|
188
|
+
<f.input
|
|
189
|
+
@type="number"
|
|
190
|
+
@name="minLength"
|
|
191
|
+
@label={{t "caluma.form-builder.question.min-length"}}
|
|
192
|
+
/>
|
|
188
193
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
+
<f.input
|
|
195
|
+
@type="number"
|
|
196
|
+
@name="maxLength"
|
|
197
|
+
@label={{t "caluma.form-builder.question.max-length"}}
|
|
198
|
+
/>
|
|
194
199
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
200
|
+
<f.input
|
|
201
|
+
@name="meta.formatValidators"
|
|
202
|
+
@label={{t "caluma.form-builder.question.formatValidators"}}
|
|
203
|
+
@placeholder={{t "caluma.form-builder.question.choose"}}
|
|
204
|
+
@required={{false}}
|
|
205
|
+
@renderComponent={{component "cfb-form-editor/question/validation"}}
|
|
206
|
+
@on-update={{changeset-set f.model "meta.formatValidators"}}
|
|
207
|
+
@value={{changeset-get f.model "meta.formatValidators"}}
|
|
208
|
+
/>
|
|
209
|
+
{{/if}}
|
|
205
210
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
{{#if (has-question-type f.model "float")}}
|
|
212
|
+
<div uk-grid class="uk-grid-small uk-child-width-1-2 uk-margin">
|
|
213
|
+
<div>
|
|
214
|
+
<f.input
|
|
215
|
+
@name="floatMinValue"
|
|
216
|
+
@label={{t "caluma.form-builder.question.min-value"}}
|
|
217
|
+
@renderComponent={{component "cfb-float-input"}}
|
|
218
|
+
/>
|
|
219
|
+
</div>
|
|
215
220
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
221
|
+
<div>
|
|
222
|
+
<f.input
|
|
223
|
+
@name="floatMaxValue"
|
|
224
|
+
@label={{t "caluma.form-builder.question.max-value"}}
|
|
225
|
+
@renderComponent={{component "cfb-float-input"}}
|
|
226
|
+
/>
|
|
227
|
+
</div>
|
|
222
228
|
</div>
|
|
223
|
-
|
|
224
|
-
{{/if}}
|
|
229
|
+
{{/if}}
|
|
225
230
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
231
|
+
{{#if (has-question-type f.model "integer")}}
|
|
232
|
+
<div uk-grid class="uk-grid-small uk-child-width-1-2 uk-margin">
|
|
233
|
+
<div>
|
|
234
|
+
<f.input
|
|
235
|
+
@type="number"
|
|
236
|
+
@name="integerMinValue"
|
|
237
|
+
@label={{t "caluma.form-builder.question.min-value"}}
|
|
238
|
+
/>
|
|
239
|
+
</div>
|
|
235
240
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
<div>
|
|
242
|
+
<f.input
|
|
243
|
+
@type="number"
|
|
244
|
+
@name="integerMaxValue"
|
|
245
|
+
@label={{t "caluma.form-builder.question.max-value"}}
|
|
246
|
+
/>
|
|
247
|
+
</div>
|
|
242
248
|
</div>
|
|
243
|
-
|
|
244
|
-
{{/if}}
|
|
249
|
+
{{/if}}
|
|
245
250
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
{{#if (has-question-type f.model "choice" "multiple-choice")}}
|
|
252
|
+
<f.input
|
|
253
|
+
@name="options"
|
|
254
|
+
@label={{t "caluma.form-builder.question.options"}}
|
|
255
|
+
@required={{true}}
|
|
256
|
+
@renderComponent={{component "cfb-form-editor/question/options"}}
|
|
257
|
+
/>
|
|
258
|
+
{{/if}}
|
|
254
259
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
{{/if}}
|
|
260
|
+
{{#if
|
|
261
|
+
(has-question-type f.model "dynamic-choice" "dynamic-multiple-choice")
|
|
262
|
+
}}
|
|
263
|
+
<f.input
|
|
264
|
+
@name="dataSource"
|
|
265
|
+
@type="select"
|
|
266
|
+
@required={{true}}
|
|
267
|
+
@label={{t "caluma.form-builder.question.dataSource"}}
|
|
268
|
+
@options={{or this.availableDataSources.lastSuccessful.value array}}
|
|
269
|
+
@optionTargetPath="name"
|
|
270
|
+
@optionLabelPath="info"
|
|
271
|
+
@includeBlank={{t "caluma.form-builder.question.choose"}}
|
|
272
|
+
/>
|
|
273
|
+
{{/if}}
|
|
270
274
|
|
|
271
|
-
<div data-test-hide-label>
|
|
272
275
|
<f.input
|
|
273
276
|
@name="meta.hideLabel"
|
|
274
277
|
@required={{true}}
|
|
@@ -276,131 +279,146 @@
|
|
|
276
279
|
@renderComponent={{component "cfb-toggle-switch" size="small"}}
|
|
277
280
|
@on-update={{changeset-set f.model "meta.hideLabel"}}
|
|
278
281
|
@value={{changeset-get f.model "meta.hideLabel"}}
|
|
279
|
-
class="uk-flex uk-flex-between uk-flex-column"
|
|
280
282
|
/>
|
|
281
|
-
</div>
|
|
282
283
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
<PowerSelect
|
|
297
|
-
@options={{or this.availableForms.lastSuccessful.value array}}
|
|
298
|
-
@selected={{fi.value}}
|
|
299
|
-
@placeholder={{t "caluma.form-builder.question.choose"}}
|
|
300
|
-
@onBlur={{fi.setDirty}}
|
|
301
|
-
@onChange={{queue fi.update (fn (mut fi.value))}}
|
|
302
|
-
@searchField="slug"
|
|
303
|
-
@searchEnabled={{true}}
|
|
304
|
-
@searchPlaceholder={{t
|
|
305
|
-
"caluma.form-builder.question.search-placeholder"
|
|
306
|
-
}}
|
|
307
|
-
@noMatchesMessage={{t "caluma.form-builder.question.search-empty"}}
|
|
308
|
-
as |form|
|
|
309
|
-
>
|
|
310
|
-
<span class="uk-width-auto uk-margin-small-right uk-text-truncate">
|
|
311
|
-
{{form.slug}}
|
|
312
|
-
</span>
|
|
313
|
-
<span
|
|
314
|
-
class="highlight-option uk-text-muted uk-width-expand uk-margin-small-right uk-text-small uk-text-truncate"
|
|
284
|
+
{{#if (has-question-type f.model "table")}}
|
|
285
|
+
<div class="uk-margin">
|
|
286
|
+
<f.input
|
|
287
|
+
@name="rowForm.slug"
|
|
288
|
+
@label={{t "caluma.form-builder.question.rowForm"}}
|
|
289
|
+
@required={{true}}
|
|
290
|
+
@on-update={{this.updateRowForm}}
|
|
291
|
+
@value={{find-by
|
|
292
|
+
"slug"
|
|
293
|
+
(changeset-get f.model "rowForm.slug")
|
|
294
|
+
this.availableForms.lastSuccessful.value
|
|
295
|
+
}}
|
|
296
|
+
as |fi|
|
|
315
297
|
>
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
298
|
+
<PowerSelect
|
|
299
|
+
@options={{or this.availableForms.lastSuccessful.value array}}
|
|
300
|
+
@selected={{fi.value}}
|
|
301
|
+
@placeholder={{t "caluma.form-builder.question.choose"}}
|
|
302
|
+
@onBlur={{fi.setDirty}}
|
|
303
|
+
@onChange={{fi.update}}
|
|
304
|
+
@searchField="slug"
|
|
305
|
+
@searchEnabled={{true}}
|
|
306
|
+
@searchPlaceholder={{t
|
|
307
|
+
"caluma.form-builder.question.search-placeholder"
|
|
308
|
+
}}
|
|
309
|
+
@noMatchesMessage={{t
|
|
310
|
+
"caluma.form-builder.question.search-empty"
|
|
311
|
+
}}
|
|
312
|
+
as |form|
|
|
313
|
+
>
|
|
314
|
+
<span
|
|
315
|
+
class="uk-width-auto uk-margin-small-right uk-text-truncate"
|
|
316
|
+
>
|
|
317
|
+
{{form.slug}}
|
|
318
|
+
</span>
|
|
319
|
+
<span
|
|
320
|
+
class="highlight-option uk-text-muted uk-width-expand uk-margin-small-right uk-text-small uk-text-truncate"
|
|
321
|
+
>
|
|
322
|
+
{{form.name}}
|
|
323
|
+
</span>
|
|
324
|
+
</PowerSelect>
|
|
325
|
+
</f.input>
|
|
326
|
+
</div>
|
|
320
327
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
328
|
+
{{#if @slug}}
|
|
329
|
+
<div class="uk-margin">
|
|
330
|
+
<f.input
|
|
331
|
+
@name="meta.columnsToDisplay"
|
|
332
|
+
@label={{t "caluma.form-builder.question.columnsToDisplay"}}
|
|
333
|
+
>
|
|
334
|
+
{{#each this.model.rowForm.questions.edges as |rowEdge|}}
|
|
335
|
+
{{#let rowEdge.node as |row|}}
|
|
336
|
+
<label class="cf-checkbox_label">
|
|
337
|
+
<input
|
|
338
|
+
type="checkbox"
|
|
339
|
+
value={{row.slug}}
|
|
340
|
+
checked={{includes
|
|
341
|
+
row.slug
|
|
342
|
+
this.model.meta.columnsToDisplay
|
|
343
|
+
}}
|
|
344
|
+
class="uk-checkbox uk-margin-small-right"
|
|
345
|
+
{{on
|
|
346
|
+
"change"
|
|
347
|
+
(fn this.toggleColumnToDisplay row.slug f.model)
|
|
348
|
+
}}
|
|
349
|
+
/>
|
|
350
|
+
{{row.label}}
|
|
351
|
+
</label>
|
|
352
|
+
{{/let}}
|
|
353
|
+
{{/each}}
|
|
354
|
+
</f.input>
|
|
355
|
+
</div>
|
|
356
|
+
{{/if}}
|
|
357
|
+
{{/if}}
|
|
343
358
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}}
|
|
355
|
-
as |fi|
|
|
356
|
-
>
|
|
357
|
-
<PowerSelect
|
|
358
|
-
@options={{or this.availableForms.lastSuccessful.value array}}
|
|
359
|
-
@selected={{fi.value}}
|
|
360
|
-
@placeholder={{t "caluma.form-builder.question.choose"}}
|
|
361
|
-
@onBlur={{fi.setDirty}}
|
|
362
|
-
@onChange={{queue fi.update (fn (mut fi.value))}}
|
|
363
|
-
@searchField="slug"
|
|
364
|
-
@searchEnabled={{true}}
|
|
365
|
-
@searchPlaceholder={{t
|
|
366
|
-
"caluma.form-builder.question.search-placeholder"
|
|
359
|
+
{{#if (has-question-type f.model "form")}}
|
|
360
|
+
<f.input
|
|
361
|
+
@name="subForm.slug"
|
|
362
|
+
@label={{t "caluma.form-builder.question.subForm"}}
|
|
363
|
+
@required={{true}}
|
|
364
|
+
@on-update={{this.updateSubForm}}
|
|
365
|
+
@value={{find-by
|
|
366
|
+
"slug"
|
|
367
|
+
(changeset-get f.model "subForm.slug")
|
|
368
|
+
this.availableForms.lastSuccessful.value
|
|
367
369
|
}}
|
|
368
|
-
|
|
369
|
-
as |form|
|
|
370
|
+
as |fi|
|
|
370
371
|
>
|
|
371
|
-
<
|
|
372
|
-
{{
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
372
|
+
<PowerSelect
|
|
373
|
+
@options={{or this.availableForms.lastSuccessful.value array}}
|
|
374
|
+
@selected={{fi.value}}
|
|
375
|
+
@placeholder={{t "caluma.form-builder.question.choose"}}
|
|
376
|
+
@onBlur={{fi.setDirty}}
|
|
377
|
+
@onChange={{fi.update}}
|
|
378
|
+
@searchField="slug"
|
|
379
|
+
@searchEnabled={{true}}
|
|
380
|
+
@searchPlaceholder={{t
|
|
381
|
+
"caluma.form-builder.question.search-placeholder"
|
|
382
|
+
}}
|
|
383
|
+
@noMatchesMessage={{t "caluma.form-builder.question.search-empty"}}
|
|
384
|
+
as |form|
|
|
376
385
|
>
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
386
|
+
<span class="uk-width-auto uk-margin-small-right uk-text-truncate">
|
|
387
|
+
{{form.slug}}
|
|
388
|
+
</span>
|
|
389
|
+
<span
|
|
390
|
+
class="highlight-option uk-text-muted uk-width-expand uk-margin-small-right uk-text-small uk-text-truncate"
|
|
391
|
+
>
|
|
392
|
+
{{form.name}}
|
|
393
|
+
</span>
|
|
394
|
+
</PowerSelect>
|
|
395
|
+
</f.input>
|
|
396
|
+
{{/if}}
|
|
382
397
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
398
|
+
<f.input
|
|
399
|
+
@name="meta.widgetOverride"
|
|
400
|
+
@label={{t "caluma.form-builder.question.widgetOverride"}}
|
|
401
|
+
@type="select"
|
|
402
|
+
@allowClear={{true}}
|
|
403
|
+
@optionTargetPath="component"
|
|
404
|
+
@optionLabelPath="label"
|
|
405
|
+
@options={{this.availableOverrides}}
|
|
406
|
+
class="uk-flex uk-flex-between uk-flex-column"
|
|
407
|
+
/>
|
|
393
408
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
409
|
+
<f.input
|
|
410
|
+
@name="isArchived"
|
|
411
|
+
@label={{t "caluma.form-builder.question.isArchived"}}
|
|
412
|
+
@required={{true}}
|
|
413
|
+
@renderComponent={{component "cfb-toggle-switch" size="small"}}
|
|
414
|
+
class="uk-flex uk-flex-between uk-flex-column"
|
|
415
|
+
/>
|
|
401
416
|
|
|
402
|
-
|
|
403
|
-
|
|
417
|
+
<UkButton
|
|
418
|
+
@color="link"
|
|
419
|
+
@on-click={{toggle-action "showAdvanced" this}}
|
|
420
|
+
class="uk-flex uk-flex-middle uk-margin"
|
|
421
|
+
>
|
|
404
422
|
{{#if this.showAdvanced}}
|
|
405
423
|
<UkIcon @icon="triangle-down" />
|
|
406
424
|
{{else}}
|
|
@@ -408,32 +426,40 @@
|
|
|
408
426
|
{{/if}}
|
|
409
427
|
{{t "caluma.form-builder.question.advancedSettings"}}
|
|
410
428
|
</UkButton>
|
|
411
|
-
</p>
|
|
412
|
-
{{#if this.showAdvanced}}
|
|
413
|
-
<f.input
|
|
414
|
-
@label={{t "caluma.form-builder.question.isHidden"}}
|
|
415
|
-
@name="isHidden"
|
|
416
|
-
@renderComponent={{component "cfb-code-editor" language="jexl"}}
|
|
417
|
-
/>
|
|
418
429
|
|
|
419
|
-
{{#
|
|
420
|
-
<
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
430
|
+
{{#if this.showAdvanced}}
|
|
431
|
+
<div class="uk-margin">
|
|
432
|
+
<f.input
|
|
433
|
+
@label={{t "caluma.form-builder.question.isHidden"}}
|
|
434
|
+
@name="isHidden"
|
|
435
|
+
@renderComponent={{component "cfb-code-editor" language="jexl"}}
|
|
436
|
+
/>
|
|
437
|
+
</div>
|
|
427
438
|
|
|
428
|
-
|
|
429
|
-
|
|
439
|
+
{{#if (not (has-question-type f.model "static" "calculated-float"))}}
|
|
440
|
+
<div class="uk-margin">
|
|
441
|
+
<f.input
|
|
442
|
+
@label={{t "caluma.form-builder.question.isRequired"}}
|
|
443
|
+
@name="isRequired"
|
|
444
|
+
@renderComponent={{component "cfb-code-editor" language="jexl"}}
|
|
445
|
+
/>
|
|
446
|
+
</div>
|
|
447
|
+
{{/if}}
|
|
448
|
+
{{/if}}
|
|
449
|
+
|
|
450
|
+
<div class="uk-text-right">
|
|
451
|
+
<f.submit
|
|
452
|
+
@disabled={{or f.loading f.model.isInvalid}}
|
|
453
|
+
@label={{t "caluma.form-builder.global.save"}}
|
|
454
|
+
/>
|
|
455
|
+
</div>
|
|
456
|
+
</ValidatedForm>
|
|
457
|
+
{{else}}
|
|
458
|
+
<div
|
|
459
|
+
class="uk-text-center uk-text-muted uk-padding uk-padding-remove-horizontal"
|
|
460
|
+
>
|
|
461
|
+
<UkIcon @icon="bolt" @ratio={{5}} />
|
|
462
|
+
<p>{{t "caluma.form-builder.question.not-found" slug=@slug}}</p>
|
|
430
463
|
</div>
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
<div
|
|
434
|
-
class="uk-text-center uk-text-muted uk-padding uk-padding-remove-horizontal"
|
|
435
|
-
>
|
|
436
|
-
<UkIcon @icon="bolt" @ratio={{5}} />
|
|
437
|
-
<p>{{t "caluma.form-builder.question.not-found" slug=@slug}}</p>
|
|
438
|
-
</div>
|
|
439
|
-
{{/if}}
|
|
464
|
+
{{/if}}
|
|
465
|
+
</div>
|