@itfin/components 1.0.60 → 1.0.65

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": "@itfin/components",
3
- "version": "1.0.60",
3
+ "version": "1.0.65",
4
4
  "main": "dist/itfin-components.umd.js",
5
5
  "unpkg": "dist/itfin-components.common.js",
6
6
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
@@ -1,7 +1,7 @@
1
1
  @import '../variables';
2
2
 
3
3
  /* Selected Tags */
4
- .vs__selected {
4
+ .vs__selected, .badge.vs__selected {
5
5
  display: flex;
6
6
  align-items: center;
7
7
  background-color: $vs-selected-bg;
@@ -31,7 +31,6 @@
31
31
  <style lang="scss">
32
32
  .itf-toast-wrapper {
33
33
  max-width: 100%;
34
- z-index: $zindex-toaster;
35
34
  }
36
35
  .itf-toast-fade-enter-active {
37
36
  animation: itf-toast-fade-in-down 0.3s;
@@ -1,5 +1,6 @@
1
1
  import Vue from 'vue';
2
2
  import ToastContainer from './ToastContainer.vue';
3
+
3
4
  const MessageConstructor = Vue.extend(ToastContainer);
4
5
 
5
6
  const instances = [];
@@ -19,8 +20,8 @@ const Message = function (options) {
19
20
  'itf-toast-container toast-container',
20
21
  'is-' + position,
21
22
  hasMask ? 'has-mask' : ''
22
- ].filter(function (e) { return !!e; }).join(' ');
23
- document.getElementById('itf-app').appendChild(containerEl);
23
+ ].filter(Boolean).join(' ');
24
+ document.body.appendChild(containerEl);
24
25
  }
25
26
 
26
27
  if (options.zIndex) {
@@ -2,9 +2,11 @@
2
2
 
3
3
  <div class="itf-checkbox form-check" :class="{ 'form-switch': this.switch, 'itf-checkbox__large': large, 'itf-checkbox__medium': medium }">
4
4
  <input class="form-check-input" :id="id" type="checkbox" name="checkbox" v-model="isChecked" :disabled="isDisabled" />
5
- <label :for="id" slot="label" class="form-check-label">
6
- {{label}}
7
- <slot name="icon"></slot>
5
+ <label :for="id" class="form-check-label">
6
+ <slot name="label">
7
+ {{label}}
8
+ <slot name="icon"></slot>
9
+ </slot>
8
10
  </label>
9
11
  </div>
10
12
 
@@ -121,8 +121,7 @@ class itfModal extends Vue {
121
121
  }
122
122
  if (this.appendToBody && this.$el instanceof Node && this.$el.parentNode) {
123
123
  this.$el.parentNode.removeChild(this.$el);
124
- const elContext = this.$el.closest('.itf-append-context') || document.body; // @todo getElementById remove when cleanup vuetify
125
- elContext.appendChild(this.$el);
124
+ document.body.appendChild(this.$el); // should append only to body
126
125
  }
127
126
  const { default: Modal } = await import('bootstrap/js/src/modal.js');
128
127
  this.modalEl = new Modal(this.$el);
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
 
3
3
  <div class="itf-text-field input-group" :class="{ 'with-addon addon-start': prependIcon, 'with-addon addon-end': clearable }">
4
- <div class="addon" v-if="prependIcon">
4
+ <div class="addon" v-if="prependIcon || $slots.addon">
5
5
  <slot name="addon">
6
6
  <itf-icon :name="prependIcon"/>
7
7
  </slot>
@@ -13,12 +13,15 @@
13
13
  :placeholder="placeholder"
14
14
  :class="{ 'is-invalid': isInvalid(), 'is-valid': isSuccess() }"
15
15
  class="itf-text-field__input form-control"
16
- type="text"
16
+ :type="type"
17
17
  :value="value"
18
18
  :disabled="disabled"
19
19
  :readonly="readonly"
20
20
  @input="onInput($event.target.value)"
21
21
  @keydown="$emit('keydown', $event)"
22
+ :min="min"
23
+ :max="max"
24
+ :step="step"
22
25
  />
23
26
 
24
27
  <div class="addon-end" v-if="clearable && value">
@@ -68,9 +71,13 @@ class itfTextField extends Vue {
68
71
  @Model('input') value;
69
72
  @Prop(String) prependIcon;
70
73
  @Prop(String) placeholder;
74
+ @Prop() step;
75
+ @Prop() min;
76
+ @Prop() max;
71
77
  @Prop(Boolean) clearable;
72
78
  @Prop(Boolean) disabled;
73
79
  @Prop(Boolean) readonly;
80
+ @Prop({ type: String, default: 'text' }) type;
74
81
  @Prop({ type: [Number, String], default: 0 }) delayInput;
75
82
 
76
83
  onInput = null;
@@ -0,0 +1,113 @@
1
+ // modified copy of https://github.com/vuejs/vue-loader/blob/master/lib/runtime/componentNormalizer.js
2
+ // contains code to inject styles from options.injectStyles
3
+
4
+ /* eslint-disable */
5
+ /* globals __VUE_SSR_CONTEXT__ */
6
+
7
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
8
+ // This module is a runtime utility for cleaner component module output and will
9
+ // be included in the final webpack user bundle.
10
+
11
+ export default function normalizeComponent (
12
+ scriptExports,
13
+ render,
14
+ staticRenderFns,
15
+ functionalTemplate,
16
+ injectStyles,
17
+ scopeId,
18
+ moduleIdentifier, /* server only */
19
+ shadowMode /* vue-cli only */
20
+ ) {
21
+ // Vue.extend constructor export interop
22
+ var options = typeof scriptExports === 'function'
23
+ ? scriptExports.options
24
+ : scriptExports
25
+
26
+
27
+ // render functions
28
+ if (render) {
29
+ options.render = render
30
+ options.staticRenderFns = staticRenderFns
31
+ options._compiled = true
32
+ }
33
+
34
+ // functional template
35
+ if (functionalTemplate) {
36
+ options.functional = true
37
+ }
38
+
39
+ // scopedId
40
+ if (scopeId) {
41
+ options._scopeId = 'data-v-' + scopeId
42
+ }
43
+
44
+ var hook
45
+ if (moduleIdentifier) { // server build
46
+ hook = function (context) {
47
+ // 2.3 injection
48
+ context =
49
+ context || // cached call
50
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
51
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
52
+ // 2.2 with runInNewContext: true
53
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
54
+ context = __VUE_SSR_CONTEXT__
55
+ }
56
+ // modification start
57
+ if (Array.isArray(options.injectStyles)) {
58
+ options.injectStyles.forEach((style) => {
59
+ if (style.__inject__) { // eslint-disable-line no-underscore-dangle
60
+ style.__inject__(context); // eslint-disable-line no-underscore-dangle
61
+ }
62
+ });
63
+ }
64
+ // modification end
65
+
66
+ // inject component styles
67
+ if (injectStyles) {
68
+ injectStyles.call(this, context)
69
+ }
70
+ // register component module identifier for async chunk inferrence
71
+ if (context && context._registeredComponents) {
72
+ context._registeredComponents.add(moduleIdentifier)
73
+ }
74
+ }
75
+ // used by ssr in case component is cached and beforeCreate
76
+ // never gets called
77
+ options._ssrRegister = hook
78
+ } else if (injectStyles) {
79
+ hook = shadowMode
80
+ ? function () {
81
+ injectStyles.call(
82
+ this,
83
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
84
+ )
85
+ }
86
+ : injectStyles
87
+ }
88
+
89
+ if (hook) {
90
+ if (options.functional) {
91
+ // for template-only hot-reload because in that case the render fn doesn't
92
+ // go through the normalizer
93
+ options._injectStyles = hook
94
+ // register for functional component in vue file
95
+ var originalRender = options.render
96
+ options.render = function renderWithStyleInjection (h, context) {
97
+ hook.call(context)
98
+ return originalRender(h, context)
99
+ }
100
+ } else {
101
+ // inject component registration as beforeCreate hook
102
+ var existing = options.beforeCreate
103
+ options.beforeCreate = existing
104
+ ? [].concat(existing, hook)
105
+ : [hook]
106
+ }
107
+ }
108
+
109
+ return {
110
+ exports: scriptExports,
111
+ options: options
112
+ }
113
+ }
@@ -0,0 +1,9 @@
1
+ import webpack from 'webpack';
2
+ import path from 'path';
3
+
4
+ export default function extend(config) {
5
+ config.plugins.push(new webpack.NormalModuleReplacementPlugin(
6
+ /vue-loader\/lib\/runtime\/componentNormalizer.js/,
7
+ path.join(__dirname, 'componentNormalizer.js'),
8
+ ));
9
+ };