alchemy-form 0.1.2 → 0.1.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 +11 -0
- package/assets/stylesheets/form/alchemy_feedback_input.scss +336 -0
- package/assets/stylesheets/form/general/_colors.scss +114 -0
- package/assets/stylesheets/form/general/_textsizes.scss +55 -0
- package/assets/stylesheets/form/general/index.scss +2 -0
- package/element/00_form_base.js +134 -0
- package/element/05_feedback_input.js +262 -3
- package/element/alchemy_field.js +60 -10
- package/element/alchemy_field_array_entry.js +53 -9
- package/element/alchemy_field_schema.js +72 -42
- package/element/alchemy_label.js +9 -3
- package/element/alchemy_table.js +20 -1
- package/element/number_input.js +106 -0
- package/element/string_input.js +333 -5
- package/helper/widgets/alchemy_form_widget.js +7 -1
- package/package.json +1 -1
- package/view/form/elements/number_input.hwk +36 -0
- package/view/form/inputs/edit/datetime.hwk +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## 0.1.3 (2022-02-20)
|
|
2
|
+
|
|
3
|
+
* Fix datetime fields never showing their value
|
|
4
|
+
* `alchemy-table` elements will now ignore old loadRemote responses
|
|
5
|
+
* The `index` property of a `alchemy-field-array-entry` element will now return the current, actual index
|
|
6
|
+
* Fix `schema` fields breaking when their schema depends on another field
|
|
7
|
+
* Populate `alchemy-form` with violations from the widget context
|
|
8
|
+
* Fix `alchemy-label` not always focusing on input after clicking on it
|
|
9
|
+
* Fix `alchemy-string-input` element and add `alchemy-number-input`
|
|
10
|
+
* Fix `alchemy-field` not setting the `for` attribute of its label
|
|
11
|
+
|
|
1
12
|
## 0.1.2 (2022-01-28)
|
|
2
13
|
|
|
3
14
|
* Add readonly attribute to fields
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
@import "./general/index.scss";
|
|
2
|
+
|
|
3
|
+
.textareabox,
|
|
4
|
+
.inputbox {
|
|
5
|
+
$inputbox: &;
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-grow: 1;
|
|
9
|
+
|
|
10
|
+
background: var(--color-input-border, $color-input-border);
|
|
11
|
+
|
|
12
|
+
.input {
|
|
13
|
+
display: block;
|
|
14
|
+
flex-grow: 1;
|
|
15
|
+
margin: 0.1rem;
|
|
16
|
+
border: 1px solid transparent;
|
|
17
|
+
outline: none;
|
|
18
|
+
padding: 1.2rem 2.2rem;
|
|
19
|
+
min-width: 0;
|
|
20
|
+
|
|
21
|
+
background-color: var(--color-input-background, $color-input-input-background);
|
|
22
|
+
|
|
23
|
+
font-size: $text-size-input-input;
|
|
24
|
+
color: var(--color-input-input, $color-input-input);
|
|
25
|
+
transition: border-color 0.2s ease-in;
|
|
26
|
+
|
|
27
|
+
&:focus {
|
|
28
|
+
border-color: var(--color-input-focus);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.error {
|
|
33
|
+
background: var(--color-input-border-error, $color-input-border-error);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.valid {
|
|
37
|
+
background: var(--color-input-border-filled, $color-input-border-filled);
|
|
38
|
+
|
|
39
|
+
&.focus {
|
|
40
|
+
background: var(--color-input-border-success, $color-input-border-success);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.inputfield,
|
|
46
|
+
alchemy-string-input {
|
|
47
|
+
$inputfield: &;
|
|
48
|
+
position: relative;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
margin: 0;
|
|
52
|
+
|
|
53
|
+
& +.rest-fields > string-input:first-of-type {
|
|
54
|
+
margin-top: 3rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.inputgrid + &,
|
|
58
|
+
&:not(.column) + &:not(.column) {
|
|
59
|
+
margin-top: 3rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&.closer {
|
|
63
|
+
margin-top: 1.5rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.connect {
|
|
67
|
+
&:not(:first-of-type) {
|
|
68
|
+
margin-top: 3rem;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.valid {
|
|
73
|
+
.icon {
|
|
74
|
+
&.cross {
|
|
75
|
+
display: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.checkmark {
|
|
79
|
+
display: block;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&.error {
|
|
85
|
+
.icon {
|
|
86
|
+
&.cross {
|
|
87
|
+
display: block;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.checkmark {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.icon {
|
|
97
|
+
display: none;
|
|
98
|
+
position: absolute;
|
|
99
|
+
height: auto;
|
|
100
|
+
top: 50%;
|
|
101
|
+
right: 1rem;
|
|
102
|
+
|
|
103
|
+
transform: translateY(-50%) scale(0) rotate(10deg);
|
|
104
|
+
animation: icon--show 200ms ease-out forwards;
|
|
105
|
+
|
|
106
|
+
&.cross {
|
|
107
|
+
//@extend .customicon, .customicon-cross;
|
|
108
|
+
font-size: 1rem;
|
|
109
|
+
color: var(--color-input-cross, $color-input-cross);
|
|
110
|
+
|
|
111
|
+
&:before {
|
|
112
|
+
content: "❌";
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&.checkmark {
|
|
117
|
+
//@extend .customicon, .customicon-checkmark;
|
|
118
|
+
font-size: 1.2rem;
|
|
119
|
+
color: var(--color-input-checkmark, $color-input-checkmark);
|
|
120
|
+
|
|
121
|
+
&:before {
|
|
122
|
+
content: "✔";
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&.locked {
|
|
127
|
+
color: var(--color-input-checkmark, $color-input-checkmark);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&[readonly],
|
|
132
|
+
&[readonly].valid {
|
|
133
|
+
.checkmark,
|
|
134
|
+
.cross {
|
|
135
|
+
display: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.locked {
|
|
139
|
+
display: block;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&,
|
|
143
|
+
input {
|
|
144
|
+
cursor: default;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.meta,
|
|
149
|
+
.errors,
|
|
150
|
+
.success {
|
|
151
|
+
margin-top: 1.8rem;
|
|
152
|
+
|
|
153
|
+
&:empty {
|
|
154
|
+
display: none;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.meta {
|
|
159
|
+
font-weight: 600;
|
|
160
|
+
font-size: $text-size-inputfield-meta;
|
|
161
|
+
color: var(--color-inputfield-meta, $color-inputfield-meta);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.inputlabel {
|
|
165
|
+
|
|
166
|
+
.spacer {
|
|
167
|
+
display: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.label:not(:empty) ~ .spacer,
|
|
171
|
+
.description:not(:empty) ~ .spacer {
|
|
172
|
+
display: block;
|
|
173
|
+
margin-bottom: 0.5rem;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
alchemy-string-input {
|
|
179
|
+
.inputlabel {
|
|
180
|
+
.label {
|
|
181
|
+
margin-bottom: 0 !important;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
alchemy-password-input {
|
|
187
|
+
@extend alchemy-string-input;
|
|
188
|
+
|
|
189
|
+
& > label:first-of-type {
|
|
190
|
+
margin-bottom: 2rem;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@keyframes icon--show {
|
|
195
|
+
0% {
|
|
196
|
+
transform: translateY(-50%) scale(0) rotate(-30deg);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
100% {
|
|
200
|
+
transform: translateY(-50%) scale(1) rotate(0deg);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.inputlabel {
|
|
205
|
+
display: flex;
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
|
|
208
|
+
.label {
|
|
209
|
+
color: var(--color-inputlabel-label);
|
|
210
|
+
font-weight: 700;
|
|
211
|
+
font-size: $text-size-inputlabel-label;
|
|
212
|
+
margin-bottom: 0.5rem;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.description {
|
|
216
|
+
margin-top: .4em;
|
|
217
|
+
|
|
218
|
+
color: var(--color-inputlabel-description);
|
|
219
|
+
font-size: $text-size-inputlabel-description;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.errorlabel {
|
|
224
|
+
display: flex;
|
|
225
|
+
justify-content: flex-start;
|
|
226
|
+
align-items: center;
|
|
227
|
+
|
|
228
|
+
font-size: $text-size-errorlabel;
|
|
229
|
+
color: var(--color--errorlabel, $color-errorlabel);
|
|
230
|
+
|
|
231
|
+
.erroricon {
|
|
232
|
+
font-style: normal;
|
|
233
|
+
|
|
234
|
+
&:before {
|
|
235
|
+
content: "❌";
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
margin-right: 1rem;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
strong {
|
|
242
|
+
color: var(--color-errorlabel-accent, $color-errorlabel-accent);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.successlabel {
|
|
247
|
+
font-size: $text-size-successlabel;
|
|
248
|
+
color: var(--color-successlabel, $color-successlabel);
|
|
249
|
+
font-weight: initial;
|
|
250
|
+
|
|
251
|
+
strong {
|
|
252
|
+
color: var(--color-successlabel-accent, $color-successlabel-accent);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
alchemy-number-input {
|
|
257
|
+
$numberinput: &;
|
|
258
|
+
display: flex;
|
|
259
|
+
flex-flow: column wrap;
|
|
260
|
+
justify-content: center;
|
|
261
|
+
align-items: center;
|
|
262
|
+
|
|
263
|
+
.label {
|
|
264
|
+
margin-bottom: 0 !important;
|
|
265
|
+
width: 100%;
|
|
266
|
+
|
|
267
|
+
color: var(--color-numberinput-label, $color-numberinput-label);
|
|
268
|
+
font-size: $text-size-numberinput-label;
|
|
269
|
+
text-align: center;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.control {
|
|
273
|
+
cursor: pointer;
|
|
274
|
+
border: 0;
|
|
275
|
+
outline: 0;
|
|
276
|
+
padding: 0;
|
|
277
|
+
background: transparent;
|
|
278
|
+
min-width: 3.5rem;
|
|
279
|
+
|
|
280
|
+
font-size: $text-size-numberinput-control;
|
|
281
|
+
line-height: 0.8;
|
|
282
|
+
|
|
283
|
+
&:disabled {
|
|
284
|
+
cursor: default;
|
|
285
|
+
opacity: 0.5;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
&.minus {
|
|
289
|
+
&:before {
|
|
290
|
+
content: "-";
|
|
291
|
+
}
|
|
292
|
+
//@extend .iconpack, .iconpack-less;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&.plus {
|
|
296
|
+
&:before {
|
|
297
|
+
content: "+";
|
|
298
|
+
}
|
|
299
|
+
//@extend .iconpack, .iconpack-plus;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.input {
|
|
304
|
+
margin: 0 2rem;
|
|
305
|
+
border: 0;
|
|
306
|
+
appearance: none;
|
|
307
|
+
-moz-appearance: textfield;
|
|
308
|
+
padding: 2rem 1rem;
|
|
309
|
+
width: 12rem;
|
|
310
|
+
|
|
311
|
+
color: var(--color-numberinput-input, $color-numberinput-input);
|
|
312
|
+
font-size: $text-size-numberinput-input;
|
|
313
|
+
font-weight: 800;
|
|
314
|
+
text-align: center;
|
|
315
|
+
|
|
316
|
+
background-color: var(--color-numberinput-background, $color-numberinput-background);
|
|
317
|
+
|
|
318
|
+
&::-webkit-inner-spin-button,
|
|
319
|
+
&::-webkit-outer-spin-button {
|
|
320
|
+
-webkit-appearance: none;
|
|
321
|
+
margin: 0;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.label {
|
|
326
|
+
#{ $numberinput }__label {
|
|
327
|
+
display: block;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.inputlabel {
|
|
332
|
+
.description:empty {
|
|
333
|
+
display: none;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
$color-dark: #000000;
|
|
2
|
+
$color-light: #ffffff;
|
|
3
|
+
|
|
4
|
+
$color-scorpion: #585858;
|
|
5
|
+
$color-mineshaft: #383838;
|
|
6
|
+
$color-silverchalice: #a8a8a8;
|
|
7
|
+
$color-mercury: #e8e8e8;
|
|
8
|
+
$color-gray: #888888;
|
|
9
|
+
$color-alto: #dddddd;
|
|
10
|
+
$color-mineshaft: #282828;
|
|
11
|
+
$color-alabaster: #f7f7f7;
|
|
12
|
+
$color-dustygray: #989898;
|
|
13
|
+
$color-concrete: #f2f2f2;
|
|
14
|
+
|
|
15
|
+
$color-light-gray: #e3e3e3;
|
|
16
|
+
$color-light-dark: #1c1c1c;
|
|
17
|
+
|
|
18
|
+
$color-red: #e5002d;
|
|
19
|
+
$color-guardsman: #cc0000;
|
|
20
|
+
$color-green: #87dd0e;
|
|
21
|
+
$color-jungle-green: #31c063;
|
|
22
|
+
$color-science: #0066cc;
|
|
23
|
+
$color-sunglow: #ffc132;
|
|
24
|
+
$color-bittersweet: #ff6b6b;
|
|
25
|
+
|
|
26
|
+
$color-facebook: #3a579a;
|
|
27
|
+
$color-messenger: #007fff;
|
|
28
|
+
$color-whatsapp: #57bb63;
|
|
29
|
+
$color-sms: #40c088;
|
|
30
|
+
|
|
31
|
+
$color-selectlistitem-background: $color-light;
|
|
32
|
+
$color-selectlistitem-background-hover: $color-concrete;
|
|
33
|
+
$color-selectlistitem-heading: $color-dark;
|
|
34
|
+
$color-selectlistitem-title: $color-gray;
|
|
35
|
+
$color-selectlistitem-subtitle: $color-gray;
|
|
36
|
+
$color-selectlistitem-description: $color-scorpion;
|
|
37
|
+
$color-selectlistitem-title-selected: $color-dark;
|
|
38
|
+
$color-selectlistitem-value: $color-dustygray;
|
|
39
|
+
$color-selectlistitem-value-selected: $color-dark;
|
|
40
|
+
$color-selectlistitem-checkmark-fill: $color-green;
|
|
41
|
+
|
|
42
|
+
$color-meta: $color-dark;
|
|
43
|
+
$color-meta-facebook: $color-facebook;
|
|
44
|
+
$color-meta-success: $color-green;
|
|
45
|
+
$color-meta-error: $color-red;
|
|
46
|
+
$color-meta-info: $color-science;
|
|
47
|
+
$color-meta-extra: $color-scorpion;
|
|
48
|
+
|
|
49
|
+
$color-button-hover: $color-dark;
|
|
50
|
+
$color-button-hover-dark: $color-light;
|
|
51
|
+
$color-button-color: $color-dark;
|
|
52
|
+
$color-button-light-color: $color-light;
|
|
53
|
+
$color-button-shadow: rgba($color-dark, 0.15);
|
|
54
|
+
$color-button-background: $color-light;
|
|
55
|
+
$color-button-black-background: $color-dark;
|
|
56
|
+
$color-button-green-background: $color-green;
|
|
57
|
+
$color-button-gray-background: $color-gray;
|
|
58
|
+
$color-button-positive-background: $color-green;
|
|
59
|
+
$color-button-negative-background: $color-red;
|
|
60
|
+
$color-button-border: $color-mercury;
|
|
61
|
+
$color-button-mark: $color-green;
|
|
62
|
+
$color-button-light-gray-background: $color-light-gray;
|
|
63
|
+
$color-button-light-gray-color: $color-alabaster;
|
|
64
|
+
|
|
65
|
+
$color-inputfield-meta: $color-scorpion;
|
|
66
|
+
|
|
67
|
+
$color-numberinput-background: $color-light;
|
|
68
|
+
$color-numberinput-label: $color-dark;
|
|
69
|
+
$color-numberinput-input: $color-dark;
|
|
70
|
+
|
|
71
|
+
$color-numberselector-number-border: linear-gradient(
|
|
72
|
+
0deg,
|
|
73
|
+
$color-alto,
|
|
74
|
+
$color-light
|
|
75
|
+
);
|
|
76
|
+
$color-numberselector-number-background: $color-light;
|
|
77
|
+
$color-numberselector-number-color: $color-dustygray;
|
|
78
|
+
$color-numberselector-number-color-hover: $color-dark;
|
|
79
|
+
$color-numberselector-number-background-hover: $color-alabaster;
|
|
80
|
+
$color-numberselector-number-active-color: $color-green;
|
|
81
|
+
|
|
82
|
+
$color-input-input: $color-dark;
|
|
83
|
+
$color-input-border: linear-gradient(0deg, $color-alto, $color-light);
|
|
84
|
+
$color-input-cross: $color-guardsman;
|
|
85
|
+
$color-input-checkmark: $color-green;
|
|
86
|
+
$color-input-input-background: $color-light;
|
|
87
|
+
$color-input-placeholder: $color-gray;
|
|
88
|
+
$color-input-border-error: linear-gradient(
|
|
89
|
+
0deg,
|
|
90
|
+
$color-guardsman,
|
|
91
|
+
$color-alto 0.1rem,
|
|
92
|
+
$color-light
|
|
93
|
+
);
|
|
94
|
+
$color-input-border-filled: linear-gradient(
|
|
95
|
+
0deg,
|
|
96
|
+
$color-dark,
|
|
97
|
+
$color-alto 0.1rem,
|
|
98
|
+
$color-light
|
|
99
|
+
);
|
|
100
|
+
$color-input-border-success: linear-gradient(
|
|
101
|
+
0deg,
|
|
102
|
+
$color-green,
|
|
103
|
+
$color-alto 0.1rem,
|
|
104
|
+
$color-light
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
$color-inputlabel-label: $color-dark;
|
|
108
|
+
$color-inputlabel-description: $color-dark;
|
|
109
|
+
|
|
110
|
+
$color-errorlabel: $color-scorpion;
|
|
111
|
+
$color-errorlabel-accent: $color-guardsman;
|
|
112
|
+
|
|
113
|
+
$color-successlabel: $color-green;
|
|
114
|
+
$color-successlabel-accent: $color-green;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
$text-size-xgiant: 6rem;
|
|
2
|
+
$text-size-giant: 4.5rem;
|
|
3
|
+
$text-size-xlarge: 4rem;
|
|
4
|
+
$text-size-large: 3.2rem;
|
|
5
|
+
$text-size-2xbig: 2.4rem;
|
|
6
|
+
$text-size-xbig: 2.2rem;
|
|
7
|
+
$text-size-big: 2rem;
|
|
8
|
+
$text-size-medium: 1.8rem;
|
|
9
|
+
$text-size-regular: 1.6rem;
|
|
10
|
+
$text-size-small: 1.3rem;
|
|
11
|
+
$text-size-xsmall: 1.2rem;
|
|
12
|
+
$text-size-tiny: 1rem;
|
|
13
|
+
|
|
14
|
+
$text-size-meta: $text-size-regular;
|
|
15
|
+
$text-size-meta-small: $text-size-small;
|
|
16
|
+
$text-size-meta-medium: $text-size-medium;
|
|
17
|
+
$text-size-meta-large: $text-size-big;
|
|
18
|
+
$text-size-meta-xlarge: $text-size-2xbig;
|
|
19
|
+
$text-size-meta-giant: $text-size-large;
|
|
20
|
+
|
|
21
|
+
$text-size-button: $text-size-regular;
|
|
22
|
+
$text-size-button-big: $text-size-2xbig;
|
|
23
|
+
$text-size-button-small: $text-size-xsmall;
|
|
24
|
+
|
|
25
|
+
$text-size-inputfield-meta: $text-size-small;
|
|
26
|
+
|
|
27
|
+
$text-size-numberinput-label: $text-size-medium;
|
|
28
|
+
$text-size-numberinput-control: $text-size-giant;
|
|
29
|
+
$text-size-numberinput-input: $text-size-2xbig;
|
|
30
|
+
|
|
31
|
+
$text-size-numberselector-number: $text-size-large;
|
|
32
|
+
|
|
33
|
+
$text-size-checkbox-info: $text-size-regular;
|
|
34
|
+
|
|
35
|
+
$text-size-checklistitem-title: $text-size-big;
|
|
36
|
+
$text-size-checklistitem-subtitle: $text-size-regular;
|
|
37
|
+
$text-size-checklistitem-suffix: $text-size-xsmall;
|
|
38
|
+
|
|
39
|
+
$text-size-input-input: $text-size-regular;
|
|
40
|
+
$text-size-input-message: $text-size-regular;
|
|
41
|
+
|
|
42
|
+
$text-size-infoblock-title: $text-size-xsmall;
|
|
43
|
+
$text-size-infoblock-value: $text-size-large;
|
|
44
|
+
|
|
45
|
+
$text-size-inputlabel-label: $text-size-big;
|
|
46
|
+
$text-size-inputlabel-description: $text-size-regular;
|
|
47
|
+
|
|
48
|
+
$text-size-errorlabel: $text-size-regular;
|
|
49
|
+
|
|
50
|
+
$text-size-successlabel: $text-size-regular;
|
|
51
|
+
|
|
52
|
+
$text-size-comboinput-item: $text-size-big;
|
|
53
|
+
|
|
54
|
+
$text-size-selectinput-item: $text-size-big;
|
|
55
|
+
$text-size-selectinput-item-suffix: $text-size-regular;
|
package/element/00_form_base.js
CHANGED
|
@@ -123,4 +123,138 @@ Base.setProperty(function wrapper_type() {
|
|
|
123
123
|
this.setAttribute('wrapper-type', value);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Get the path of this field value in the current record
|
|
130
|
+
*
|
|
131
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
132
|
+
* @since 0.1.3
|
|
133
|
+
* @version 0.1.3
|
|
134
|
+
*/
|
|
135
|
+
Base.setProperty(function field_path_in_record() {
|
|
136
|
+
|
|
137
|
+
let result = [],
|
|
138
|
+
parent = this.getParentField(),
|
|
139
|
+
name;
|
|
140
|
+
|
|
141
|
+
name = this.getPathEntryName();
|
|
142
|
+
|
|
143
|
+
if (name) {
|
|
144
|
+
result.push(name);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
while (parent) {
|
|
148
|
+
name = parent.getPathEntryName();
|
|
149
|
+
|
|
150
|
+
if (name) {
|
|
151
|
+
result.unshift(name);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
parent = parent.getParentField();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return result.join('.');
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Get the parent field/field-entry element
|
|
162
|
+
*
|
|
163
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
164
|
+
* @since 0.1.3
|
|
165
|
+
* @version 0.1.3
|
|
166
|
+
*
|
|
167
|
+
* @return {Alchemy.Element.Form.Base}
|
|
168
|
+
*/
|
|
169
|
+
Base.setMethod(function getParentField() {
|
|
170
|
+
|
|
171
|
+
let parent = this.parentElement;
|
|
172
|
+
|
|
173
|
+
while (parent) {
|
|
174
|
+
|
|
175
|
+
if (parent instanceof Classes.Alchemy.Element.Form.Base) {
|
|
176
|
+
return parent;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
parent = parent.parentElement;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return false;
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Get the name of this thing in a record path
|
|
187
|
+
*
|
|
188
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
189
|
+
* @since 0.1.3
|
|
190
|
+
* @version 0.1.3
|
|
191
|
+
*
|
|
192
|
+
* @return {String}
|
|
193
|
+
*/
|
|
194
|
+
Base.setMethod(function getPathEntryName() {
|
|
195
|
+
return '';
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Get this entry's path origin
|
|
200
|
+
* (The path to the container it's in)
|
|
201
|
+
*
|
|
202
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
203
|
+
* @since 0.1.3
|
|
204
|
+
* @version 0.1.3
|
|
205
|
+
*
|
|
206
|
+
* @return {String}
|
|
207
|
+
*/
|
|
208
|
+
Base.setMethod(function getPathOrigin() {
|
|
209
|
+
|
|
210
|
+
let current = this,
|
|
211
|
+
origin;
|
|
212
|
+
|
|
213
|
+
while (current) {
|
|
214
|
+
origin = current.field_path_in_record;
|
|
215
|
+
|
|
216
|
+
if (origin) {
|
|
217
|
+
return origin;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
current = current.getParentField();
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Resolve the given path
|
|
226
|
+
*
|
|
227
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
228
|
+
* @since 0.1.3
|
|
229
|
+
* @version 0.1.3
|
|
230
|
+
*
|
|
231
|
+
* @param {String} name The name to resolve
|
|
232
|
+
* @param {String} origin The origin to use (optional)
|
|
233
|
+
*
|
|
234
|
+
* @return {String}
|
|
235
|
+
*/
|
|
236
|
+
Base.setMethod(function resolvePath(name, origin) {
|
|
237
|
+
|
|
238
|
+
if (origin == null) {
|
|
239
|
+
origin = this.getPathOrigin();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (!origin) {
|
|
243
|
+
return name;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (!Array.isArray(origin)) {
|
|
247
|
+
origin = origin.split('.');
|
|
248
|
+
} else {
|
|
249
|
+
origin = origin.slice(0);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (!origin.length) {
|
|
253
|
+
return name;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
origin.pop();
|
|
257
|
+
origin.push(name);
|
|
258
|
+
|
|
259
|
+
return origin.join('.');
|
|
126
260
|
});
|