@propelinc/citrus-ui 0.3.10 → 0.3.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@propelinc/citrus-ui",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/propelinc/citrus-ui"
@@ -19,7 +19,7 @@
19
19
  <script lang="ts">
20
20
  import { Component, Vue, Prop } from 'vue-property-decorator';
21
21
 
22
- @Component({ name: 'CCheckbox', inheritAttrs: false })
22
+ @Component({ name: 'CCheckbox' })
23
23
  export default class CCheckbox extends Vue {
24
24
  @Prop({ type: Boolean, default: false }) value!: boolean;
25
25
  @Prop({ type: Array, default: () => [] }) rules!: ((value: string) => string | boolean)[];
@@ -1,23 +1,24 @@
1
1
  <template>
2
- <component :is="component" :to="to" :href="href" class="list-item" v-on="$listeners">
3
- <div v-if="icon || $scopedSlots.icon" class="list-item__icon">
4
- <slot name="icon">
5
- <font-awesome-icon v-if="icon" data-test="list-item-icon" :icon="icon" />
6
- </slot>
2
+ <component
3
+ :is="component"
4
+ :to="to"
5
+ :href="href"
6
+ :target="target"
7
+ class="list-item"
8
+ v-on="$listeners"
9
+ >
10
+ <div class="list-item__icon">
11
+ <font-awesome-icon v-if="icon" data-test="list-item-icon" fixed-width :icon="icon" />
12
+ <slot name="icon" />
7
13
  </div>
8
14
 
9
15
  <div class="list-item__content" data-test="list-item-content">
10
16
  <slot />
11
17
  </div>
12
18
 
13
- <div
14
- v-if="$scopedSlots.action || tappable"
15
- class="list-item__action"
16
- data-test="list-item-action"
17
- >
18
- <slot name="action">
19
- <font-awesome-icon v-if="tappable" :icon="faChevronRight" />
20
- </slot>
19
+ <div class="list-item__action" data-test="list-item-action">
20
+ <font-awesome-icon v-if="tappable" :icon="faChevronRight" />
21
+ <slot name="action" />
21
22
  </div>
22
23
  </component>
23
24
  </template>
@@ -35,6 +36,7 @@ export default class CListItem extends Vue {
35
36
  @Prop([String, Array, Object]) icon?: IconDefinition;
36
37
  @Prop({ type: Boolean, default: true }) tappable!: boolean;
37
38
  @Prop([String, Object]) to?: RawLocation;
39
+ @Prop(String) target?: string;
38
40
  @Prop(String) href?: string;
39
41
 
40
42
  get component(): string {
@@ -69,18 +71,21 @@ export default class CListItem extends Vue {
69
71
  }
70
72
  }
71
73
 
72
- .list-item__icon {
74
+ .list-item__icon:not(:empty) {
73
75
  flex: none;
76
+ font-size: @font-size-icon-medium;
74
77
  padding-right: 12px;
75
78
  }
76
79
 
77
80
  .list-item__content {
78
81
  flex: auto;
82
+ overflow: hidden;
79
83
  }
80
84
 
81
- .list-item__action {
85
+ .list-item__action:not(:empty) {
82
86
  color: @color-accent-blue;
83
87
  flex: none;
88
+ font-size: @font-size-icon-medium;
84
89
  padding-left: 12px;
85
90
  }
86
91
  </style>
@@ -6,16 +6,16 @@
6
6
  scrollable
7
7
  @input="(value) => $emit('input', value)"
8
8
  >
9
- <c-card v-if="loading" key="loading" data-test="modal-loading">
9
+ <c-card v-if="loading" key="loading" :data-test="value ? dataTest : null">
10
10
  <c-card-section>
11
- <div class="modal__loading">
11
+ <div class="modal__loading" :data-test="value ? `${dataTest}-loading` : null">
12
12
  <div class="modal__loading__icon-container">
13
13
  <font-awesome-icon :icon="faSync" class="fa-spin modal__loading__icon" />
14
14
  </div>
15
15
 
16
16
  <div
17
17
  v-if="hasLoadingMessage"
18
- data-test="modal-loading-message"
18
+ :data-test="value ? `${dataTest}-loading-message` : null"
19
19
  class="modal__loading__message"
20
20
  >
21
21
  {{ loading }}
@@ -23,14 +23,17 @@
23
23
  </div>
24
24
  </c-card-section>
25
25
  </c-card>
26
- <c-card v-else key="default" data-test="modal">
26
+ <c-card v-else key="default" :data-test="value ? dataTest : null">
27
27
  <c-card-header>
28
- <span class="modal__header__title" data-test="modal-title">{{ title }}</span>
28
+ <span class="modal__header__title" :data-test="value ? `${dataTest}-title` : null">
29
+ {{ title }}
30
+ </span>
29
31
 
30
32
  <template #append>
31
33
  <c-icon-button
32
34
  v-if="dismissible"
33
- data-test="modal-dismiss"
35
+ class="modal__header__dismiss"
36
+ :data-test="value ? `${dataTest}-dismiss` : null"
34
37
  :icon="faTimes"
35
38
  @click="$emit('input', false)"
36
39
  />
@@ -62,6 +65,8 @@ export default class CModal extends Vue {
62
65
  @Prop([String, Boolean]) loading?: string | boolean;
63
66
  /** Allows modal to be dismissed */
64
67
  @Prop({ type: Boolean, default: true }) dismissible!: boolean;
68
+ /** Prefix for test selectors */
69
+ @Prop({ type: String, default: 'modal' }) dataTest!: string;
65
70
 
66
71
  get hasLoadingMessage(): boolean {
67
72
  return typeof this.loading === 'string';
@@ -78,6 +83,10 @@ export default class CModal extends Vue {
78
83
  vertical-align: -4px;
79
84
  }
80
85
 
86
+ .modal__header__dismiss {
87
+ font-size: @font-size-icon-large;
88
+ }
89
+
81
90
  .modal__loading {
82
91
  text-align: center;
83
92
  }
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <form-field :data-test="dataTest" :field-id="id" :disabled="disabled" :label="label">
2
+ <form-field :data-test="dataTest" :field-id="id" :disabled="disabled">
3
+ <template #label>
4
+ {{ label }}
5
+ <slot name="label" />
6
+ </template>
7
+
3
8
  <select-input
4
9
  :id="id"
5
10
  v-bind="$attrs"
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <form-field :data-test="dataTest" :field-id="id" :disabled="disabled" :label="label">
2
+ <form-field :data-test="dataTest" :field-id="id" :disabled="disabled">
3
+ <template #label>
4
+ {{ label }}
5
+ <slot name="label" />
6
+ </template>
7
+
3
8
  <v-textarea
4
9
  :id="id"
5
10
  v-bind="$attrs"
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <form-field :data-test="dataTest" :field-id="id" :disabled="disabled" :label="label">
2
+ <form-field :data-test="dataTest" :field-id="id" :disabled="disabled">
3
+ <template #label>
4
+ {{ label }}
5
+ <slot name="label" />
6
+ </template>
7
+
3
8
  <v-text-field
4
9
  :id="id"
5
10
  ref="input"
@@ -1,13 +1,12 @@
1
1
  <template>
2
2
  <fieldset class="form-field" :data-test="dataTest" :disabled="disabled">
3
3
  <label
4
- v-if="label"
5
4
  :for="fieldId"
6
5
  :data-test="`${dataTest}-label`"
7
6
  class="form-field__label"
8
7
  :class="{ 'form-field__label--disabled': disabled }"
9
8
  >
10
- {{ label }}
9
+ <slot name="label" />
11
10
  </label>
12
11
 
13
12
  <slot />
@@ -19,7 +18,6 @@ import { Component, Vue, Prop } from 'vue-property-decorator';
19
18
 
20
19
  @Component({ name: 'FormField' })
21
20
  export default class FormField extends Vue {
22
- @Prop(String) label?: string;
23
21
  @Prop({ type: String, required: true }) fieldId!: string;
24
22
  @Prop({ type: Boolean, default: false }) disabled!: boolean;
25
23
  @Prop({ type: String, default: 'form-field' }) dataTest!: string;
@@ -71,7 +71,7 @@
71
71
  .title() {
72
72
  .body;
73
73
 
74
- font-weight: @font-weight-heavy;
74
+ font-weight: @font-weight-bold;
75
75
  }
76
76
 
77
77
  .body() {
@@ -98,6 +98,10 @@
98
98
  text-transform: uppercase;
99
99
  }
100
100
 
101
+ // ICONS
102
+ @font-size-icon-medium: 16px;
103
+ @font-size-icon-large: 20px;
104
+
101
105
  // CARDS
102
106
  @card-h-spacing: 16px;
103
107
  @card-header-v-spacing: 12px;