@itfin/components 1.2.88 → 1.2.90

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.2.88",
3
+ "version": "1.2.90",
4
4
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -20,6 +20,7 @@
20
20
  ],
21
21
  "dependencies": {
22
22
  "@egjs/vue-flicking": "^4.10.4",
23
+ "@mdi/js": "^7.2.96",
23
24
  "@popperjs/core": "^2.11.8",
24
25
  "@vue/cli-service": "^5.0.1",
25
26
  "@vue/composition-api": "^1.7.1",
@@ -0,0 +1,124 @@
1
+ // 1. Include functions first (so you can manipulate colors, SVGs, calc, etc)
2
+ @import "~bootstrap/scss/functions.scss";
3
+
4
+ // 2. Include any default variable overrides here
5
+ $font-family-base: 'Fira Sans', sans-serif;
6
+ $headings-font-family: 'Fira Sans', sans-serif;
7
+ $font-family-monospace: "Fira Mono", "Courier New", monospace;
8
+
9
+ $headings-font-size-base: 1rem;
10
+ $h1-font-size: $headings-font-size-base * 2;
11
+ $h2-font-size: $headings-font-size-base * 1.75;
12
+ $h3-font-size: $headings-font-size-base * 1.5;
13
+ $h4-font-size: $headings-font-size-base * 1.25;
14
+ $h5-font-size: $headings-font-size-base * 1.125;
15
+ $h6-font-size: $headings-font-size-base;
16
+
17
+ $zindex-toaster: 1071 !default;
18
+
19
+ $border-radius: .5rem;
20
+ $border-radius-sm: .375rem;
21
+ $border-radius-lg: .75rem;
22
+
23
+ $project-tnm: #311b92;
24
+ $project-fixed: #388E3C;
25
+ $project-nonprofit: #D32F2F;
26
+
27
+ $info: #5981c0;
28
+ $success: #10834e;
29
+ $warning: #cda277;
30
+ $danger: #cb4839;
31
+
32
+ $primary: #0B314F;
33
+ $link-color: #0B314F;
34
+ $input-btn-focus-width: .125rem;
35
+
36
+ $input-bg: #f3f3f3;
37
+ $input-border-color: rgba(#000, .08);
38
+ $input-border-radius: 10px;
39
+ $input-font-size: 0.875rem;
40
+ $input-font-family: "Fira Mono", "Courier New", monospace;
41
+
42
+ $input-focus-bg: #fff;
43
+ $input-focus-border-color: #fff;
44
+
45
+ $form-label-margin-bottom: .1rem;
46
+ $input-focus-border: rgb(11 49 79 / 25%);
47
+
48
+ $form-check-input-border: 1px solid rgba(#000, .08);
49
+ $form-switch-focus-color: tint-color($primary, 50%);
50
+
51
+ $modal-backdrop-bg: #999;
52
+ $modal-backdrop-opacity: .25;
53
+ $modal-content-border-radius: 0;
54
+
55
+ $secondary: #dfe1e6;
56
+
57
+ // popover
58
+ $popover-border-width: 2px;
59
+
60
+ // dropdown
61
+
62
+ // Dark theme
63
+ $dark-body-bg: #2e3136;
64
+ $dark-border-color: #4a4a4a;
65
+ $dark-body-color: #ddd;
66
+ $dark-input-bg: #383b41;
67
+
68
+ $dark-primary: #FFCC00;
69
+ $dark-link-color: #ead272;
70
+ $dark-secondary: #464a53;
71
+ $dark-input-focus-border-color: #3d3d3d;
72
+ $dark-btn-primary-color: $dark-primary;
73
+ $dark-btn-secondary-color: $dark-secondary;
74
+ $dark-input-box-shadow: #3d3d3d;
75
+ $dark-input-focus-border: rgb(244 206 176 / 25%);
76
+
77
+ $pagination-border-width: 0;
78
+
79
+ // 3. Include remainder of required Bootstrap stylesheets
80
+ @import "~bootstrap/scss/variables.scss";
81
+ @import "~bootstrap/scss/mixins.scss";
82
+ @import "~bootstrap/scss/maps.scss";
83
+ @import "~bootstrap/scss/utilities.scss";
84
+
85
+ $custom-colors: (
86
+ "white": #fff,
87
+ "black": #1e1e1e
88
+ );
89
+ $theme-colors: map-merge($theme-colors, $custom-colors);
90
+
91
+ // Text colors
92
+ $all-colors: map-merge-multiple($theme-colors, $custom-colors, $blues, $indigos, $purples, $pinks, $reds, $oranges, $yellows, $greens, $teals, $cyans);
93
+ $utilities: map-merge(
94
+ $utilities,
95
+ (
96
+ "color": map-merge(
97
+ map-get($utilities, "color"),
98
+ (
99
+ values: map-merge(
100
+ map-get(map-get($utilities, "color"), "values"),
101
+ (
102
+ $all-colors
103
+ ),
104
+ ),
105
+ ),
106
+ ),
107
+ )
108
+ );
109
+ @import "~bootstrap/scss/utilities/api";
110
+
111
+ // Fonts
112
+ $baseFontSize: 16px;
113
+ $hintFontSize: 12px;
114
+
115
+ // Border radius
116
+ $borderRadiusM: 4px;
117
+ $borderRadiusL: 8px;
118
+
119
+ // Colors
120
+ $primaryColor: #0B314F;
121
+ $primaryColor15: #DAE0E5;
122
+ $baseText: #1e1e1e;
123
+ $gray5: #F0F0F1;
124
+ $gray50: #787885;
@@ -47,3 +47,14 @@
47
47
  .color-outcome {
48
48
  color: #b91e1e !important;
49
49
  }
50
+
51
+ kbd {
52
+ background-color: rgba(0, 0, 0, .15) !important;
53
+ color: #000 !important;
54
+ font-size: .75rem !important;
55
+
56
+ [data-theme="dark"] &, .btn-primary & {
57
+ background-color: rgba(255, 255, 255, .25) !important;
58
+ color: #fff !important;
59
+ }
60
+ }
@@ -33,12 +33,10 @@ import itfTextField from '../../text-field/TextField.vue';
33
33
  import itfDatePickerInline from '../../datepicker/DatePickerInline.vue';
34
34
  import tippy from 'tippy.js';
35
35
  import { formatDate } from '../../../helpers/formatters';
36
- import PropertyInlineEdit from "@/components/customize/PropertyInlineEdit.vue";
37
36
 
38
37
  export default @Component({
39
38
  name: 'itfCustomizeInlineDate',
40
39
  components: {
41
- PropertyInlineEdit,
42
40
  itfTextField,
43
41
  itfDatePickerInline
44
42
  },
@@ -37,12 +37,10 @@
37
37
  <script>
38
38
  import { Vue, Component, Model, Prop } from 'vue-property-decorator';
39
39
  import itfTextField from '../../text-field/TextField.vue';
40
- import PropertyInlineEdit from "@/components/customize/PropertyInlineEdit.vue";
41
40
 
42
41
  export default @Component({
43
42
  name: 'itfCustomizeInlineText',
44
43
  components: {
45
- PropertyInlineEdit,
46
44
  itfTextField
47
45
  }
48
46
  })
@@ -91,9 +91,9 @@ import itfIcon from '../icon/Icon';
91
91
  import itfButton from '../button/Button';
92
92
  import Sortable from '../sortable/Sortable';
93
93
  import itfIconPopover from '../popover/IconPopover.vue';
94
- import {INLINE_TYPES} from "@/components/customize/constants";
95
- import itfDeleteConfirmModal from "@/components/modal/DeleteConfirmModal.vue";
96
- import PropertyItem from "@/components/customize/PropertyItem.vue";
94
+ import {INLINE_TYPES} from './constants';
95
+ import itfDeleteConfirmModal from "../modal/DeleteConfirmModal.vue";
96
+ import PropertyItem from "./PropertyItem.vue";
97
97
 
98
98
  export default @Component({
99
99
  components: {
@@ -13,6 +13,7 @@
13
13
  ref="properties"
14
14
  :field="field"
15
15
  :editable="editable"
16
+ :lock-fields="lockFields"
16
17
  :value="value[field.Id]"
17
18
  @input="$emit('input', { ...value, [field.Id]: $event })"
18
19
  @delete="onDelete(field)"
@@ -21,20 +22,29 @@
21
22
  />
22
23
  </sortable>
23
24
 
24
- <div v-if="editable" class="text-start">
25
- <itf-dropdown ref="newItemDd" autoclose="outside" class="flex-grow-1 mw-100" shadow :button-options="{ class: 'text-muted', small: true }">
26
- <template #button>
27
- <itf-icon name="plus" />
28
- Add property
29
- </template>
30
- <div><h6 class="dropdown-header">{{ $t('components.customize.type') }}</h6></div>
31
- <div v-for="type of types" :keys="type.Type">
32
- <a class="dropdown-item d-flex align-items-center" @click.prevent="createNewField(type)">
33
- <itf-icon :name="type.Icon" :size="16" class="me-1" />
34
- {{ type.Name }}
35
- </a>
36
- </div>
37
- </itf-dropdown>
25
+ <div v-if="editable && !lockFields" class="text-start">
26
+ <div v-if="isShowAll">
27
+ <itf-dropdown ref="newItemDd" autoclose="outside" class="flex-grow-1 mw-100" shadow :button-options="{ small: true }">
28
+ <template #button>
29
+ <span class="text-muted d-flex align-items-center">
30
+ <itf-icon name="plus" />
31
+ Add property
32
+ </span>
33
+ </template>
34
+ <div><h6 class="dropdown-header">{{ $t('components.customize.type') }}</h6></div>
35
+ <div v-for="type of types" :keys="type.Type">
36
+ <a class="dropdown-item d-flex align-items-center" @click.prevent="createNewField(type)">
37
+ <itf-icon :name="type.Icon" :size="16" class="me-1" />
38
+ {{ type.Name }}
39
+ </a>
40
+ </div>
41
+ </itf-dropdown>
42
+ </div>
43
+
44
+ <itf-button small class="text-muted" @click="toggleShowAll">
45
+ <itf-icon :name="isShowAll ? 'chevron_up' : 'chevron_down'" />
46
+ {{isShowAll ? $tc('components.customize.hideMoreProperties', 1, { n: 1 }) : $tc('components.customize.showMoreProperties', 1, { n: 1 })}}
47
+ </itf-button>
38
48
  </div>
39
49
  </div>
40
50
  </template>
@@ -91,6 +101,13 @@ class itfPropertiesList extends Vue {
91
101
  @PropSync('fields') list;
92
102
  @Prop({ type: Boolean, default: false }) loading;
93
103
  @Prop({ type: Boolean, default: false }) editable;
104
+ @Prop({ type: Boolean, default: false }) lockFields;
105
+
106
+ isShowAll = false;
107
+
108
+ toggleShowAll() {
109
+ this.isShowAll = !this.isShowAll;
110
+ }
94
111
 
95
112
  get types() {
96
113
  return INLINE_TYPES;
@@ -117,7 +134,6 @@ class itfPropertiesList extends Vue {
117
134
  newItem.Name = `${newItem.Name}${index ? ` (${parseInt(index[1], 10) + 1})` : ' (1)'}`;
118
135
  list.push(newItem);
119
136
  this.$emit('update:fields', list);
120
- this.$refs.newItemDd.hide();
121
137
 
122
138
  this.$nextTick(() => {
123
139
  for (const prop of this.$refs.properties) {
@@ -139,7 +155,9 @@ class itfPropertiesList extends Vue {
139
155
  Visible: 'show'
140
156
  });
141
157
  this.$emit('update:fields', list);
142
- this.$refs.newItemDd.hide();
158
+ if (this.$refs.newItemDd) {
159
+ this.$refs.newItemDd.hide();
160
+ }
143
161
 
144
162
  this.$nextTick(() => {
145
163
  setTimeout(() => {
@@ -2,12 +2,12 @@
2
2
  <div class="b-properties-list__inner">
3
3
  <div class="b-properties-list__name" :class="{'editable': editable}">
4
4
  <div class="b-properties-list__icon">
5
- <div v-if="editable" role="button" tabindex="-1" class="b-properties-list__draghandler" sortable>
5
+ <div v-if="editable && !lockFields" role="button" tabindex="-1" class="b-properties-list__draghandler" sortable>
6
6
  <itf-icon class="dragHandle" name="drag_vertical" />
7
7
  </div>
8
8
  </div>
9
9
 
10
- <itf-dropdown :disabled="!editable" ref="editDd" autoclose="outside" class="flex-grow-1 mw-100" shadow :button-options="{ icon: true, block: true }" @close="onClose">
10
+ <itf-dropdown :disabled="!editable || lockFields" ref="editDd" autoclose="outside" class="flex-grow-1 mw-100" shadow :button-options="{ icon: true, block: true }" @close="onClose">
11
11
  <template #button>
12
12
  <div class="d-flex align-items-center">
13
13
  <itf-icon :name="field.Icon" :size="16" class="me-1" />
@@ -144,6 +144,7 @@ class itfPropertyItem extends Vue {
144
144
  @Prop() field;
145
145
  @Prop({ type: Boolean, default: false }) loading;
146
146
  @Prop({ type: Boolean, default: false }) editable;
147
+ @Prop({ type: Boolean, default: false }) lockFields;
147
148
 
148
149
  isEditMode = false;
149
150
  focusId = null;
@@ -60,6 +60,8 @@ storiesOf('Common', module)
60
60
 
61
61
  <itf-properties-list editable :fields.sync="list" v-model="value"></itf-properties-list>
62
62
 
63
+ <itf-properties-list lock-fields editable :fields.sync="list" v-model="value"></itf-properties-list>
64
+
63
65
  </itf-app>
64
66
  </div>`,
65
67
  }));
@@ -0,0 +1,70 @@
1
+ <style lang="scss">
2
+ .mdi-icon {
3
+ align-items: center;
4
+ display: inline-flex;
5
+ font-feature-settings: "liga";
6
+ font-size: 24px;
7
+ justify-content: center;
8
+ letter-spacing: normal;
9
+ line-height: 1;
10
+ position: relative;
11
+ text-indent: 0;
12
+ transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1), visibility 0s;
13
+ vertical-align: middle;
14
+ -webkit-user-select: none;
15
+ -moz-user-select: none;
16
+ -ms-user-select: none;
17
+ user-select: none;
18
+
19
+ &--left {
20
+ margin-right: 5px;
21
+ }
22
+ &--right {
23
+ margin-left: 5px;
24
+ }
25
+ }
26
+ </style>
27
+ <script>
28
+ import { Vue, Component } from 'vue-property-decorator';
29
+
30
+ export default @Component({
31
+ functional: true,
32
+ name: 'mdiIcon'
33
+ })
34
+ class mdiIcon extends Vue {
35
+ render (createElement, { data, slots, children, props, listeners }) {
36
+ const defaultSlot = slots().default;
37
+ if (!defaultSlot) {
38
+ return;
39
+ }
40
+ const [node] = defaultSlot;
41
+ const icon = (node.text || '').trim();
42
+ let alignClass = '';
43
+ if (typeof props.dark !== 'undefined') {
44
+ alignClass = 'text-white';
45
+ }
46
+ if (typeof props.left !== 'undefined') {
47
+ alignClass = 'mdi-icon--left';
48
+ }
49
+ if (typeof props.right !== 'undefined') {
50
+ alignClass = 'mdi-icon--right';
51
+ }
52
+ const attrs = {
53
+ staticClass: `mdi-icon notranslate mdi ${icon} ${alignClass} ${data.staticClass || ''}`,
54
+ on: {
55
+ click: e => listeners.click && listeners.click(e)
56
+ }
57
+ };
58
+ if (typeof props.small !== 'undefined') {
59
+ attrs.style = { 'font-size': '16px' };
60
+ }
61
+ if (typeof props.size !== 'undefined') {
62
+ attrs.style = { 'font-size': `${props.size}px` };
63
+ }
64
+ return createElement(
65
+ 'i',
66
+ attrs
67
+ );
68
+ }
69
+ }
70
+ </script>
@@ -32,7 +32,7 @@
32
32
  <div class="py-1 text-muted">Recent</div>
33
33
  <div class="d-flex align-items-start flex-wrap flex-grow-0">
34
34
  <itf-button v-for="icon of recentIcons" :key="icon" icon v-tooltip="icon" @click="onSelectIcon(icon)">
35
- <itf-icon :name="icon" />
35
+ <itf-mdi-icon :name="icon" />
36
36
  </itf-button>
37
37
  </div>
38
38
 
@@ -40,7 +40,7 @@
40
40
  </template>
41
41
  <div class="d-flex align-items-start flex-wrap flex-grow-0">
42
42
  <itf-button v-for="icon of iconsList" :key="icon" icon v-tooltip="icon" @click="onSelectIcon(icon)">
43
- <itf-icon :name="icon" />
43
+ <itf-mdi-icon>{{ icon }}</itf-mdi-icon>
44
44
  </itf-button>
45
45
  </div>
46
46
  <div v-if="!iconsList.length" class="text-muted pt-1">
@@ -73,6 +73,7 @@
73
73
  import { Vue, Component, Model, Prop, PropSync } from 'vue-property-decorator';
74
74
  import itfPopover from './Popover';
75
75
  import itfIcon from '../icon/Icon';
76
+ import itfMdiIcon from '../icon/MdiIcon';
76
77
  import iconsList from '../icon/icons';
77
78
  import itfButton from '../button/Button';
78
79
  import itfTextField from '../text-field/TextField.vue';
@@ -87,6 +88,7 @@ export default @Component({
87
88
  },
88
89
  components: {
89
90
  itfIcon,
91
+ itfMdiIcon,
90
92
  itfPopover,
91
93
  itfButton,
92
94
  itfTextField
@@ -101,14 +103,17 @@ class itfIconPopover extends Vue {
101
103
 
102
104
  isVisible = false;
103
105
  search = '';
106
+ icons = [];
104
107
  recentIcons = [];
105
108
 
106
- created() {
109
+ async created() {
107
110
  this.recentIcons = this.getRecentIcons();
111
+ this.icons = await import('@mdi/js');
108
112
  }
109
113
 
110
114
  get iconsList() {
111
- return Object.keys(iconsList).filter((icon) => icon.includes(this.search.toLowerCase()));
115
+ // from cames case
116
+ return Object.keys(this.icons).map(key => key.replace(/([A-Z])/g, '-$1').toLowerCase()).filter((icon) => icon.includes(this.search.toLowerCase()));
112
117
  }
113
118
 
114
119
  onSelectIcon(icon) {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="itf-money-field">
2
+ <div class="itf-money-field" :class="{'currency-arrow': !currencyDisabled}">
3
3
  <div :style="`--itf-money-field-padding-left: ${selectedCurrencySymbol.length * 0.6 + 1}rem`">
4
4
  <span class="itf-money-field__prepend">{{ selectedCurrencySymbol }}</span>
5
5
  <itf-text-field
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
 
14
14
  <div v-if="currencySelect" class="itf-money-field__currency">
15
- <span>{{ selectedCurrencyCode }}</span>
15
+ <span>{{ selectedCurrencyCode }}<itf-icon v-if="!currencyDisabled" name="chevron_down" /></span>
16
16
  <select v-if="!disabled && !currencyDisabled" :value="currencyId" @input="onCurrencyChanged">
17
17
  <option v-for="currency in currencies" :key="currency.Id" :value="currency.Id" :selected="currencyId === currency.Id">
18
18
  {{ currency.Symbol }}, {{ currency.Code }} - {{ currency.Title }}
@@ -33,6 +33,11 @@
33
33
  padding-right: 4rem;
34
34
  }
35
35
  }
36
+ &.currency-arrow {
37
+ .itf-text-field input {
38
+ padding-right: 4.5rem;
39
+ }
40
+ }
36
41
 
37
42
  &__prepend {
38
43
  z-index: 6;
@@ -64,10 +69,12 @@ import { Component, Emit, Model, Prop, Vue } from 'vue-property-decorator';
64
69
  import itfTextField from './TextField';
65
70
  import itfSelect from '../select/Select';
66
71
  import itfLabel from '../form/Label';
72
+ import itfIcon from '../icon/Icon';
67
73
 
68
74
  export default @Component({
69
75
  name: 'itfMoneyField',
70
76
  components: {
77
+ itfIcon,
71
78
  itfLabel,
72
79
  itfSelect,
73
80
  itfTextField
package/src/locales/en.js CHANGED
@@ -89,5 +89,7 @@ module.exports = {
89
89
  type: 'Type',
90
90
  options: 'Options',
91
91
  addOption: 'Add an option',
92
+ showMoreProperties: '{n} more property|{n} more properties',
93
+ hideMoreProperties: 'Hide {n} property|Hide {n} properties',
92
94
  }
93
95
  };