dlg-ui 1.0.30 → 1.0.32
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/form.hbs +3 -3
- package/addon/components/form.js +4 -0
- package/addon/components/modal.hbs +10 -6
- package/addon/components/modal.js +11 -7
- package/addon/components/radio.hbs +5 -3
- package/addon/components/text-input.js +1 -1
- package/addon/styles/addon.css +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<form>
|
|
3
3
|
{{yield (hash Field=(component "form/field" addValidator=this.addValidator didValidate=this.didValidate errors=this.errors validate=this.validate))}}
|
|
4
4
|
</form>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<ButtonPrimary @onClick={{this.submitForm}}>
|
|
6
|
+
{{this.submitButtonText}}
|
|
7
|
+
</ButtonPrimary>
|
|
8
8
|
</div>
|
package/addon/components/form.js
CHANGED
|
@@ -10,6 +10,10 @@ export default class FormComponent extends Component {
|
|
|
10
10
|
return this.validations.didValidate;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
get submitButtonText() {
|
|
14
|
+
return this.args.submitButtonText || 'Submit';
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
addValidator = (validator) => {
|
|
14
18
|
this.validations.addValidation(validator);
|
|
15
19
|
}
|
|
@@ -8,12 +8,16 @@
|
|
|
8
8
|
{{yield to="body"}}
|
|
9
9
|
</div>
|
|
10
10
|
<div class="modal-footer">
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
{{#unless this.hideSecondaryButton}}
|
|
12
|
+
<ButtonPrimary @onClick={{this.toggleModal}}>
|
|
13
|
+
{{this.secondaryButtonText}}
|
|
14
|
+
</ButtonPrimary>
|
|
15
|
+
{{/unless}}
|
|
16
|
+
{{#unless this.hidePrimaryButton}}
|
|
17
|
+
<ButtonPrimary @onClick={{this.acceptAndClose}} style="margin-left: 1em;">
|
|
18
|
+
{{this.primaryButtonText}}
|
|
19
|
+
</ButtonPrimary>
|
|
20
|
+
{{/unless}}
|
|
17
21
|
{{yield to="footer"}}
|
|
18
22
|
</div>
|
|
19
23
|
</div>
|
|
@@ -10,16 +10,20 @@ export default class ModalComponent extends Component {
|
|
|
10
10
|
return faCircleXmark;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
get primaryButtonText() {
|
|
14
|
+
return this.args.primaryButtonText || 'Done';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
get secondaryButtonText() {
|
|
18
|
+
return this.args.secondaryButtonText || 'Cancel';
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
acceptAndClose = () => {
|
|
14
|
-
|
|
15
|
-
this.args.onAccept();
|
|
16
|
-
}
|
|
22
|
+
this.args.onAccept?.();
|
|
17
23
|
this.toggleModal();
|
|
18
24
|
}
|
|
19
|
-
|
|
25
|
+
|
|
20
26
|
toggleModal = () => {
|
|
21
|
-
|
|
22
|
-
this.args.toggleModal();
|
|
23
|
-
}
|
|
27
|
+
this.args.toggleModal?.();
|
|
24
28
|
}
|
|
25
29
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<div class="radio-container {{@class}}">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
{{#if this.args.label}}
|
|
3
|
+
<div class="label">
|
|
4
|
+
{{this.args.label}}
|
|
5
|
+
</div>
|
|
6
|
+
{{/if}}
|
|
5
7
|
<div class="radio-options">
|
|
6
8
|
{{#each this.options as |option|}}
|
|
7
9
|
<div class="radio-option">
|
|
@@ -9,7 +9,7 @@ export default class TextInputComponent extends Component {
|
|
|
9
9
|
|
|
10
10
|
get value() {
|
|
11
11
|
const value = get(this.args.model, this.args.valuePath);
|
|
12
|
-
return value !== undefined ? value :
|
|
12
|
+
return value !== undefined ? value : null;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
set value(newValue) {
|
package/addon/styles/addon.css
CHANGED