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.
@@ -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
- <ButtonPrimary @onClick={{this.submitForm}}>
6
- Submit
7
- </ButtonPrimary>
5
+ <ButtonPrimary @onClick={{this.submitForm}}>
6
+ {{this.submitButtonText}}
7
+ </ButtonPrimary>
8
8
  </div>
@@ -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
- <ButtonPrimary @onClick={{this.toggleModal}}>
12
- Cancel
13
- </ButtonPrimary>
14
- <ButtonPrimary @onClick={{this.acceptAndClose}} style="margin-left: 1em;">
15
- Done
16
- </ButtonPrimary>
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
- if (this.args.onAccept) {
15
- this.args.onAccept();
16
- }
22
+ this.args.onAccept?.();
17
23
  this.toggleModal();
18
24
  }
19
-
25
+
20
26
  toggleModal = () => {
21
- if (this.args.toggleModal) {
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
- <div class="label">
3
- {{this.args.label}}
4
- </div>
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 : this.placeholder;
12
+ return value !== undefined ? value : null;
13
13
  }
14
14
 
15
15
  set value(newValue) {
@@ -25,5 +25,5 @@
25
25
  .radio-options {
26
26
  display: flex;
27
27
  flex-direction: column;
28
- margin: 5px 0px 5px 0px;
28
+ margin: 2px 0px 2px 0px;
29
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlg-ui",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "The default blueprint for ember-cli addons.",
5
5
  "keywords": [
6
6
  "ember-addon"