@itfin/components 1.2.47 → 1.2.49
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
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// 2. Include any default variable overrides here
|
|
5
5
|
$font-family-base: 'Fira Sans', sans-serif;
|
|
6
6
|
$headings-font-family: 'Fira Sans', sans-serif;
|
|
7
|
+
$font-family-monospace: 'Fira Mono', monospace;
|
|
7
8
|
|
|
8
9
|
$headings-font-size-base: 1rem;
|
|
9
10
|
$h1-font-size: $headings-font-size-base * 2;
|
|
@@ -6,6 +6,7 @@ const MessageConstructor = Vue.extend(ToastContainer);
|
|
|
6
6
|
const instances = [];
|
|
7
7
|
let count = 1;
|
|
8
8
|
const containers = {};
|
|
9
|
+
const instancesIds = {};
|
|
9
10
|
|
|
10
11
|
const Message = function (options) {
|
|
11
12
|
const userOnClose = options.onClose;
|
|
@@ -28,6 +29,11 @@ const Message = function (options) {
|
|
|
28
29
|
containerEl.style.zIndex = options.zIndex;
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
if (options.Id && options.closeById) {
|
|
33
|
+
Message.closeById(options.Id);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
31
37
|
const id = count++;
|
|
32
38
|
options.onClose = function () {
|
|
33
39
|
Message.close(id, userOnClose);
|
|
@@ -51,6 +57,7 @@ const Message = function (options) {
|
|
|
51
57
|
instance.show = true;
|
|
52
58
|
|
|
53
59
|
instances.push(instance);
|
|
60
|
+
instancesIds[options.Id] = instance;
|
|
54
61
|
|
|
55
62
|
return instance;
|
|
56
63
|
};
|
|
@@ -97,6 +104,13 @@ Message.closeAll = function () {
|
|
|
97
104
|
}
|
|
98
105
|
};
|
|
99
106
|
|
|
107
|
+
Message.closeById = function (id) {
|
|
108
|
+
if (instancesIds[id]) {
|
|
109
|
+
instancesIds[id].close();
|
|
110
|
+
delete instancesIds.id;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
100
114
|
const types = ['info', 'success', 'error', 'warning', 'loading'];
|
|
101
115
|
|
|
102
116
|
types.forEach((type) => {
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
|
-
<div class="itf-label" :class="{'has-validation': hasState, 'no-details': hideDetails}">
|
|
4
|
-
<slot name="label" v-bind="{ required, label }">
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
<div class="itf-label" :class="{'has-validation': hasState, 'no-details': hideDetails, 'row': left}">
|
|
4
|
+
<slot name="label" v-bind="{ required, label, left }">
|
|
5
|
+
<div :class="{'col-md-4': left}">
|
|
6
|
+
<label class="itf-label__label form-label" v-if="label">
|
|
7
|
+
{{label}}
|
|
8
|
+
<span class="star" v-if="required">*</span>
|
|
9
|
+
</label>
|
|
10
|
+
<div v-if="left && helpText">
|
|
11
|
+
<small class="text-muted" v-html="helpText"></small>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
9
14
|
</slot>
|
|
10
15
|
|
|
11
|
-
<div :class="{'is-invalid': hasState && hasError, 'is-valid': hasState && hasSuccess}">
|
|
16
|
+
<div :class="{'is-invalid': hasState && hasError, 'is-valid': hasState && hasSuccess, 'col-md-8': left}">
|
|
12
17
|
<slot :validate="doValidation"></slot>
|
|
13
18
|
</div>
|
|
14
19
|
|
|
@@ -18,7 +23,7 @@
|
|
|
18
23
|
<slot name="error-text"><span v-html="error"></span></slot>
|
|
19
24
|
</div>
|
|
20
25
|
</slot>
|
|
21
|
-
<div v-else-if="helpText" v-html="helpText"></div>
|
|
26
|
+
<div v-else-if="helpText && !left" v-html="helpText"></div>
|
|
22
27
|
</div>
|
|
23
28
|
</div>
|
|
24
29
|
|
|
@@ -44,6 +49,7 @@ class itfLabel extends Mixins(ValidatableMixin) {
|
|
|
44
49
|
@Prop(String) helpText;
|
|
45
50
|
@Prop(Boolean) required;
|
|
46
51
|
@Prop(Boolean) hideDetails;
|
|
52
|
+
@Prop(Boolean) left;
|
|
47
53
|
|
|
48
54
|
isHasError() {
|
|
49
55
|
return this.hasState && this.hasError;
|