@avakhula/ui 0.0.505 → 0.0.506-alpha-spa.1

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.
Files changed (185) hide show
  1. package/.babelrc.json +0 -0
  2. package/.eslintrc.cjs +0 -0
  3. package/.nvmrc +0 -0
  4. package/.storybook/main.js +0 -0
  5. package/.storybook/preview-head.html +0 -0
  6. package/.storybook/preview.js +0 -0
  7. package/dist/index.css +1 -0
  8. package/dist/index.js +14352 -12501
  9. package/dist/index.umd.cjs +93 -82
  10. package/package.json +8 -7
  11. package/src/App.vue +7 -126
  12. package/src/assets/scss/mixins/dropdown-list-item.scss +6 -1
  13. package/src/assets/scss/mixins/tooltip-position.scss +0 -0
  14. package/src/assets/scss/mixins.scss +0 -0
  15. package/src/assets/scss/style.scss +0 -0
  16. package/src/assets/scss/typography.scss +3 -3
  17. package/src/assets/scss/variables/colors.json +0 -0
  18. package/src/assets/scss/variables/colors.scss +0 -0
  19. package/src/assets/scss/variables/shadows.json +0 -0
  20. package/src/assets/scss/variables/shadows.scss +0 -0
  21. package/src/components/Accordion/Accordion.scss +0 -0
  22. package/src/components/Accordion/Accordion.stories.js +0 -0
  23. package/src/components/Accordion/Accordion.vue +0 -0
  24. package/src/components/Accordion/Acordion.spec.js +0 -0
  25. package/src/components/Accordion/readme.mdx +0 -0
  26. package/src/components/Alert/Alert.spec.js +0 -0
  27. package/src/components/Alert/Alert.stories.js +0 -0
  28. package/src/components/Alert/Alert.vue +5 -0
  29. package/src/components/Alert/alert.scss +6 -1
  30. package/src/components/Alert/constants.js +0 -0
  31. package/src/components/Alert/readme.mdx +0 -0
  32. package/src/components/Avatar/Avatar.stories.js +5 -1
  33. package/src/components/Avatar/Avatar.vue +25 -2
  34. package/src/components/Avatar/constants.js +6 -0
  35. package/src/components/Badge/Badge.spec.js +0 -0
  36. package/src/components/Badge/Badge.vue +0 -0
  37. package/src/components/Badge/readme.mdx +0 -0
  38. package/src/components/Breadcrumbs/Breadcrumbs.vue +23 -8
  39. package/src/components/Breadcrumbs/breadcrumbs.scss +0 -0
  40. package/src/components/Breadcrumbs/breadcrumbs.stories.js +0 -0
  41. package/src/components/Button/Button.spec.js +0 -0
  42. package/src/components/Button/Button.vue +19 -3
  43. package/src/components/Button/button.scss +5 -0
  44. package/src/components/Button/readme.mdx +0 -0
  45. package/src/components/ButtonGroup/ButtonGroup.stories.js +0 -0
  46. package/src/components/ButtonGroup/readme.mdx +0 -0
  47. package/src/components/Chips/Chips.stories.js +30 -0
  48. package/src/components/Chips/Chips.vue +125 -0
  49. package/src/components/Dropdown/Dropdown.spec.js +0 -0
  50. package/src/components/Dropdown/Dropdown.stories.js +0 -0
  51. package/src/components/Dropdown/Dropdown.vue +93 -23
  52. package/src/components/Dropdown/DropdownDivider.vue +0 -0
  53. package/src/components/Dropdown/DropdownItem.vue +26 -4
  54. package/src/components/Dropdown/DropdownList.stories.js +0 -0
  55. package/src/components/Dropdown/DropdownList.vue +15 -1
  56. package/src/components/Dropdown/readme.mdx +0 -0
  57. package/src/components/Form/CharactersCount.vue +10 -7
  58. package/src/components/Form/Checkbox/Checkbox.scss +0 -0
  59. package/src/components/Form/Checkbox/Checkbox.stories.js +0 -0
  60. package/src/components/Form/Checkbox/Checkbox.vue +24 -11
  61. package/src/components/Form/Checkbox/readme.mdx +0 -0
  62. package/src/components/Form/CheckboxGroup/CheckboxGroup.stories.js +0 -0
  63. package/src/components/Form/CheckboxGroup/CheckboxGroup.vue +15 -0
  64. package/src/components/Form/CheckboxGroup/readme.mdx +2 -0
  65. package/src/components/Form/DatePicker/DatePicker.scss +352 -261
  66. package/src/components/Form/DatePicker/DatePicker.stories.js +0 -0
  67. package/src/components/Form/DatePicker/DatePicker.vue +72 -17
  68. package/src/components/Form/DatePicker/readme.mdx +0 -0
  69. package/src/components/Form/FormGroup/FormGroup.vue +3 -3
  70. package/src/components/Form/FormGroup/FormGroupSet.vue +0 -0
  71. package/src/components/Form/Input/Input.stories.js +0 -0
  72. package/src/components/Form/Input/Input.vue +119 -13
  73. package/src/components/Form/Input/constants.js +0 -0
  74. package/src/components/Form/Input/input.scss +61 -2
  75. package/src/components/Form/Input/readme.mdx +0 -0
  76. package/src/components/Form/Label/Label.stories.js +0 -0
  77. package/src/components/Form/Label/Label.vue +22 -10
  78. package/src/components/Form/Label/readme.mdx +0 -0
  79. package/src/components/Form/PhoneInput/PhoneInput.stories.js +0 -0
  80. package/src/components/Form/PhoneInput/PhoneInput.vue +76 -27
  81. package/src/components/Form/PhoneInput/phoneInput.scss +38 -6
  82. package/src/components/Form/PhoneInput/readme.mdx +0 -0
  83. package/src/components/Form/Radio/Radio.stories.js +0 -0
  84. package/src/components/Form/Radio/Radio.vue +16 -44
  85. package/src/components/Form/Radio/radio.scss +5 -2
  86. package/src/components/Form/Radio/readme.mdx +0 -0
  87. package/src/components/Form/TextEditor/TextEditor.stories.js +0 -0
  88. package/src/components/Form/TextEditor/TextEditor.vue +91 -137
  89. package/src/components/Form/TextEditor/Toolbar.vue +723 -0
  90. package/src/components/Form/TextEditor/icons/toolbarIcons.js +8 -0
  91. package/src/components/Form/TextEditor/plugins/imageBlot.js +23 -0
  92. package/src/components/Form/TextEditor/readme.mdx +0 -0
  93. package/src/components/Form/TextEditor/setupTextEditor.js +71 -0
  94. package/src/components/Form/TextEditor/textEditor.scss +11 -335
  95. package/src/components/Form/Textarea/Textarea.spec.js +0 -0
  96. package/src/components/Form/Textarea/Textarea.stories.js +0 -0
  97. package/src/components/Form/Textarea/Textarea.vue +20 -6
  98. package/src/components/Form/Textarea/readme.mdx +0 -0
  99. package/src/components/Form/Textarea/textarea.scss +30 -2
  100. package/src/components/Form/Toggle/Toggle.stories.js +0 -0
  101. package/src/components/Form/Toggle/Toggle.vue +0 -0
  102. package/src/components/Form/Toggle/readme.mdx +0 -0
  103. package/src/components/Form/Toggle/toggle.scss +0 -0
  104. package/src/components/IconButton/IconButton.scss +11 -0
  105. package/src/components/IconButton/IconButton.vue +10 -3
  106. package/src/components/IconButton/readme.mdx +0 -0
  107. package/src/components/List.vue +0 -0
  108. package/src/components/Modal/Modal.stories.js +0 -0
  109. package/src/components/Modal/Modal.vue +42 -9
  110. package/src/components/Modal/constants.js +0 -0
  111. package/src/components/Modal/readme.mdx +0 -0
  112. package/src/components/Pagination/LimitSelector.vue +5 -0
  113. package/src/components/Pagination/Pagination.vue +36 -4
  114. package/src/components/Pagination/pagination.scss +17 -1
  115. package/src/components/Panel/Panel.stories.js +0 -0
  116. package/src/components/Panel/Panel.vue +68 -2
  117. package/src/components/Popover/Popover.vue +25 -9
  118. package/src/components/Popover/constants.js +0 -0
  119. package/src/components/Popover/popover.scss +1 -1
  120. package/src/components/Popover/readme.mdx +0 -0
  121. package/src/components/ProgressBar/ProgressBar.vue +0 -0
  122. package/src/components/ProgressBar/constants.js +0 -0
  123. package/src/components/ProgressBar/progressBar.scss +0 -0
  124. package/src/components/ProgressBar/readme.mdx +0 -0
  125. package/src/components/Sorting/Sorting.stories.js +0 -0
  126. package/src/components/Sorting/Sorting.vue +24 -26
  127. package/src/components/Sorting/sorting.scss +0 -0
  128. package/src/components/SplitButton/SplitButton.stories.js +0 -0
  129. package/src/components/SplitButton/SplitButton.vue +51 -8
  130. package/src/components/SplitButton/SplitButtonItem.vue +13 -1
  131. package/src/components/SplitButton/readme.mdx +0 -0
  132. package/src/components/SplitButton/splitButton.scss +0 -0
  133. package/src/components/StatusIndicator/StatusIndicator.stories.js +0 -0
  134. package/src/components/StatusIndicator/StatusIndicator.vue +0 -0
  135. package/src/components/StatusIndicator/constants.js +0 -0
  136. package/src/components/StatusIndicator/icons.js +0 -0
  137. package/src/components/StatusIndicator/readme.mdx +0 -0
  138. package/src/components/Table/Cells/Cell.vue +0 -0
  139. package/src/components/Table/Cells/CheckboxCell.vue +0 -0
  140. package/src/components/Table/Row.vue +0 -0
  141. package/src/components/Table/Table.stories.js +0 -0
  142. package/src/components/Table/Table.vue +0 -0
  143. package/src/components/Tabs/Tab.vue +4 -0
  144. package/src/components/Tabs/TabDropdown.vue +0 -0
  145. package/src/components/Tabs/Tabs.stories.js +0 -0
  146. package/src/components/Tabs/Tabs.vue +20 -5
  147. package/src/components/Tabs/tabs.scss +8 -2
  148. package/src/components/TagPill/TagPill.stories.js +0 -0
  149. package/src/components/TagPill/TagPill.vue +6 -0
  150. package/src/components/TagPill/readme.mdx +0 -0
  151. package/src/components/ToggleTip/ToggleTip.vue +0 -0
  152. package/src/components/ToggleTip/constants.js +0 -0
  153. package/src/components/ToggleTip/readme.mdx +0 -0
  154. package/src/components/ToggleTip/toggleTip.scss +0 -0
  155. package/src/components/Tooltip/Tooltip.vue +1 -1
  156. package/src/components/Tooltip/readme.mdx +0 -0
  157. package/src/components/TreeSelect/Option.vue +58 -24
  158. package/src/components/TreeSelect/Select.stories.js +0 -0
  159. package/src/components/TreeSelect/Select.vue +281 -147
  160. package/src/components/TreeSelect/TreeSelect.stories.js +0 -0
  161. package/src/components/TreeSelect/mixins/InfinityLoaderMixin.js +40 -0
  162. package/src/components/TreeSelect/scss/option.scss +31 -0
  163. package/src/components/TreeSelect/scss/select.scss +93 -2
  164. package/src/constants/keyCodes.js +1 -0
  165. package/src/directives/outside/outside.stories.js +0 -0
  166. package/src/directives/outside/readme.mdx +0 -0
  167. package/src/directives/tooltip/TooltipController.js +2 -0
  168. package/src/directives/tooltip/readme.mdx +0 -0
  169. package/src/directives/tooltip/textOverflowTooltip.js +3 -1
  170. package/src/directives/tooltip/tooltip.js +61 -0
  171. package/src/directives/tooltip/tooltip.stories.js +0 -0
  172. package/src/helpers/debounce.js +23 -0
  173. package/src/helpers/removeEvents.js +0 -0
  174. package/src/helpers/stripHtml.js +4 -0
  175. package/src/index.js +7 -0
  176. package/src/main.js +0 -0
  177. package/src/mixins/expandAnimation.js +0 -0
  178. package/src/scripts/parseScssVariables.js +0 -0
  179. package/src/stories/link.readme.mdx +0 -0
  180. package/src/stories/variables/colors.stories.js +0 -0
  181. package/src/stories/variables/shadows.stories.js +0 -0
  182. package/static/docks/button.pdf +0 -0
  183. package/static/favicon.ico +0 -0
  184. package/vite.config.js +0 -0
  185. package/dist/style.css +0 -1
@@ -1,10 +1,11 @@
1
1
  <template>
2
2
  <div
3
- class="flatpickr-wrapper"
3
+ class="ib-flatpickr-wrapper"
4
4
  :class="{
5
5
  'has-labels': label.length || endDateLabel.length,
6
6
  'has-label': label.length,
7
7
  'has-error': errorMessage.length,
8
+ 'is-disabled': disabled,
8
9
  'is-range': mode === 'range',
9
10
  }"
10
11
  >
@@ -12,17 +13,22 @@
12
13
  errorMessage
13
14
  }}</ib-alert>
14
15
 
15
- <div class="inputs-wrapper">
16
+ <div ref="inputsWrapper" class="inputs-wrapper">
16
17
  <div class="input-group-wrapper">
17
18
  <ib-label class="label" v-if="label.length" :required="required">
18
19
  {{ label }}
19
20
  </ib-label>
20
21
  <div class="input-wrapper" @click="open" :class="{ active: isOpen }">
21
- <input
22
- :placeholder="placeholder"
23
- ref="date"
24
- class="date-picker-input"
25
- />
22
+ <label :aria-label="ariaLabel">
23
+ <input
24
+ :placeholder="placeholder"
25
+ :name="name"
26
+ ref="date"
27
+ id="date"
28
+ :disabled="disabled"
29
+ class="date-picker-input"
30
+ />
31
+ </label>
26
32
 
27
33
  <ib-icon name="today-outline" class="calendar-icon" />
28
34
  </div>
@@ -46,12 +52,14 @@
46
52
  @click="openEndDate"
47
53
  :class="{ active: isOpenEndDate }"
48
54
  >
49
- <input
50
- class="date-picker-input"
51
- :placeholder="placeholder"
52
- ref="toDate"
53
- />
54
-
55
+ <label :aria-label="endDateAriaLabel">
56
+ <input
57
+ class="date-picker-input"
58
+ :placeholder="endDatePlaceholder"
59
+ ref="toDate"
60
+ @keydown="onKeydownEndField"
61
+ />
62
+ </label>
55
63
  <ib-icon name="today-outline" class="calendar-icon" />
56
64
  </div>
57
65
 
@@ -73,7 +81,7 @@ import "flatpickr/dist/flatpickr.css";
73
81
  import rangePlugin from "flatpickr/dist/plugins/rangePlugin";
74
82
  import chevronBackIcon from "./Icons/chevron-back";
75
83
  import chevronForwardIcon from "./Icons/chevron-forward";
76
- import { ESC_KEY_CODE } from "../../../constants/keyCodes";
84
+ import { ESC_KEY_CODE, BACKSPACE_KEY_CODE } from "../../../constants/keyCodes";
77
85
 
78
86
  export const SINGLE_MODE = "single";
79
87
  export const RANGE_MODE = "range";
@@ -90,6 +98,10 @@ export default {
90
98
  type: String,
91
99
  default: "",
92
100
  },
101
+ endDatePlaceholder: {
102
+ type: String,
103
+ default: "",
104
+ },
93
105
  required: {
94
106
  type: Boolean,
95
107
  default: false,
@@ -102,6 +114,14 @@ export default {
102
114
  type: String,
103
115
  default: SINGLE_MODE,
104
116
  },
117
+ ariaLabel: {
118
+ type: String,
119
+ default: "",
120
+ },
121
+ endDateAriaLabel: {
122
+ type: String,
123
+ default: "",
124
+ },
105
125
  label: {
106
126
  type: String,
107
127
  default: "",
@@ -122,9 +142,14 @@ export default {
122
142
  type: String,
123
143
  default: "",
124
144
  },
145
+ disabled: {
146
+ type: Boolean,
147
+ default: false,
148
+ }
125
149
  },
126
150
  mounted() {
127
151
  document.addEventListener("keyup", this.onDocumentKeyDown, true);
152
+ this.$refs.inputsWrapper.addEventListener("keyup", this.backspaceHandler);
128
153
 
129
154
  this.$nextTick(() => {
130
155
  this.initFlatpickr();
@@ -137,8 +162,22 @@ export default {
137
162
  value() {
138
163
  this.initFlatpickr();
139
164
  },
165
+ disabled() {
166
+ this.$nextTick(() => {
167
+ this.initFlatpickr();
168
+ });
169
+ },
140
170
  modelValue() {
141
- this.initFlatpickr();
171
+ if (JSON.stringify(this.modelValue) === JSON.stringify(this.data)) return;
172
+
173
+ let value;
174
+ if (Array.isArray(this.modelValue)) {
175
+ value = this.modelValue[0] && this.modelValue[1] ? this.modelValue : [];
176
+ } else {
177
+ value = this.modelValue;
178
+ }
179
+
180
+ this.flat?.setDate(value, true);
142
181
  },
143
182
  },
144
183
  data() {
@@ -196,7 +235,7 @@ export default {
196
235
  if (this.mode === RANGE_MODE) {
197
236
  defaultConfig.defaultDate = this.modelValue.length
198
237
  ? [this.modelValue[0], this.modelValue[1]]
199
- : [this.value[0], this.value[1]];
238
+ : [this.value?.[0], this.value?.[1]];
200
239
  } else {
201
240
  defaultConfig.defaultDate = this.modelValue
202
241
  ? this.modelValue
@@ -213,6 +252,7 @@ export default {
213
252
  this.$nextTick(() => {
214
253
  this.isOpen = false;
215
254
  this.isOpenEndDate = false;
255
+ this.$emit("blur");
216
256
  });
217
257
  },
218
258
  onChange(value) {
@@ -224,7 +264,18 @@ export default {
224
264
  },
225
265
  onDocumentKeyDown(e) {
226
266
  if (e.keyCode === ESC_KEY_CODE) {
227
- this.close();
267
+ this.onClose();
268
+ }
269
+ },
270
+ onKeydownEndField(e) {
271
+ if (e.key === "ArrowDown") {
272
+ this.flat.selectedDateElem.focus();
273
+ }
274
+ },
275
+ backspaceHandler(e) {
276
+ if(e.keyCode === BACKSPACE_KEY_CODE) {
277
+ this.$emit("input", "");
278
+ this.$emit("update:modelValue", '');
228
279
  }
229
280
  },
230
281
  triggerChange() {
@@ -247,6 +298,8 @@ export default {
247
298
  this.$emit("input", this.data);
248
299
  this.$emit("update:modelValue", this.data);
249
300
  }
301
+
302
+ this.$emit("blur");
250
303
  }
251
304
  });
252
305
  },
@@ -271,12 +324,14 @@ export default {
271
324
  },
272
325
  beforeUnmount() {
273
326
  document.removeEventListener("keyup", this.onDocumentKeyDown);
327
+ this.$refs.inputsWrapper.removeEventListener("keyup", this.backspaceHandler);
274
328
  },
275
329
  components: {
276
330
  IbIcon,
277
331
  IbLabel,
278
332
  IbAlert,
279
333
  },
334
+ emits: ["input", "update:modelValue"],
280
335
  };
281
336
  </script>
282
337
  <style lang="scss">
File without changes
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="ib-form-group" :class="{ disable: disable }">
2
+ <div class="ib-form-group" :class="{ disabled: disabled }">
3
3
  <slot></slot>
4
4
  <p class="support-text" v-if="supportText.length">{{ supportText }}</p>
5
5
  </div>
@@ -13,7 +13,7 @@ export default {
13
13
  type: String,
14
14
  default: "",
15
15
  },
16
- disable: {
16
+ disabled: {
17
17
  type: Boolean,
18
18
  default: false,
19
19
  },
@@ -34,7 +34,7 @@ export default {
34
34
  margin-top: 5px;
35
35
  }
36
36
 
37
- &.disable {
37
+ &.disabled {
38
38
  .support-text {
39
39
  color: $neutral-500;
40
40
  }
File without changes
File without changes
@@ -2,18 +2,29 @@
2
2
  <div>
3
3
  <ib-alert v-if="errorMessage">{{ errorMessage }}</ib-alert>
4
4
 
5
- <div class="ib-input-wrapper" :class="{ 'has-settings': hasSettings }">
5
+ <div
6
+ class="ib-input-wrapper"
7
+ :class="{
8
+ 'has-settings': hasSettings,
9
+ 'success': isSuccess,
10
+ 'numbers-type': type === 'number' && !hideNumberActions,
11
+ }"
12
+ >
6
13
  <ib-icon v-if="showIcon" class="icon-search" name="search-outline" />
7
14
 
8
15
  <input
9
16
  v-bind="attrs"
10
- v-model="actualValue"
17
+ v-model.trim="actualValue"
11
18
  ref="field"
12
19
  :aria-invalid="hasErrorState ? true : false"
13
20
  :readonly="readonly"
14
21
  :disabled="disabled"
15
22
  :id="id"
23
+ :autocomplete="autocomplete"
16
24
  :class="classes"
25
+ :min="min"
26
+ :max="max"
27
+ :step="step"
17
28
  @input="onInput($event)"
18
29
  @blur="onBlur($event)"
19
30
  @focus="onFocus($event)"
@@ -29,21 +40,56 @@
29
40
  @click="clearInput"
30
41
  @keypress.enter="clearInput"
31
42
  v-if="type !== 'password' && showClearButton"
32
- v-show="actualValue?.length"
43
+ v-show="hasValue"
33
44
  >
34
45
  <ib-icon name="close-outline"></ib-icon>
35
46
  </ib-icon-button>
36
47
 
48
+ <ib-icon v-if="isSuccess" class="succes-checkmark" name="checkmark-circle" />
49
+ <div v-if="type === 'number' && !hideNumberActions" class="number-button-group">
50
+ <div v-show="hasValue" class="divider"></div>
51
+
52
+ <ib-icon-button
53
+ kind="ghost"
54
+ class="button-decrement"
55
+ :disabled="readonly || disabled"
56
+ prevent-default
57
+ type="button"
58
+ aria-label="Decrement value"
59
+ v-tooltip="decrementButtonMessage"
60
+ @blur="onBlur"
61
+ @click="decrement"
62
+ @keypress.enter="decrement"
63
+ >
64
+ <ib-icon name="remove-outline"></ib-icon>
65
+ </ib-icon-button>
66
+
67
+ <ib-icon-button
68
+ kind="ghost"
69
+ class="button-increment"
70
+ :disabled="readonly || disabled"
71
+ prevent-default
72
+ type="button"
73
+ aria-label="Increment value"
74
+ v-tooltip="incrementButtonMessage"
75
+ @blur="onBlur"
76
+ @click="increment"
77
+ @keypress.enter="increment"
78
+ >
79
+ <ib-icon name="add-outline"></ib-icon>
80
+ </ib-icon-button>
81
+ </div>
82
+
37
83
  <ib-icon-button
38
84
  kind="ghost"
39
85
  class="toggle-password"
40
86
  prevent-default
41
87
  type="button"
42
- :disabled="readonly || disabled"
88
+ :disabled="disabled"
43
89
  :help-text="showPassword ? hidePasswordMessage : showPasswordMessage"
44
90
  @click.prevent="toggleShowPassword"
45
91
  v-if="type === 'password'"
46
- v-show="actualValue?.length"
92
+ v-show="hasValue"
47
93
  >
48
94
  <ib-icon
49
95
  :name="showPassword ? 'eye-off-outline' : 'eye-outline'"
@@ -85,6 +131,7 @@ import IbDropdown from "../../Dropdown/Dropdown.vue";
85
131
  import { inputTypeOptions } from "./constants";
86
132
  import generateUID from "../../../helpers/generateUID";
87
133
  import removeEvents from "../../../helpers/removeEvents";
134
+ import { TooltipDirective as Tooltip } from "../../../directives/tooltip/tooltip"
88
135
 
89
136
  import {
90
137
  verticalPosition,
@@ -164,6 +211,41 @@ export default {
164
211
  type: Boolean,
165
212
  default: false,
166
213
  },
214
+ autocomplete: {
215
+ type: String
216
+ },
217
+ isSuccess: {
218
+ type: Boolean,
219
+ default: false,
220
+ },
221
+ hideNumberActions: {
222
+ type: Boolean,
223
+ default: false,
224
+ },
225
+ decrementButtonMessage: {
226
+ type: String,
227
+ default: "Decrement"
228
+ },
229
+ incrementButtonMessage: {
230
+ type: String,
231
+ default: "Increment"
232
+ },
233
+ step: {
234
+ type: Number,
235
+ default: 1
236
+ },
237
+ min: {
238
+ type: Number,
239
+ default: 0,
240
+ },
241
+ max: {
242
+ type: Number,
243
+ default: Infinity,
244
+ },
245
+ toFixed: {
246
+ type: Number,
247
+ default: 0,
248
+ }
167
249
  },
168
250
  data() {
169
251
  return {
@@ -181,10 +263,10 @@ export default {
181
263
  this.showPassword = !this.showPassword;
182
264
  },
183
265
  clearInput() {
184
- this.actualValue = "";
185
- this.$emit("update:modelValue", this.actualValue);
186
- this.$emit("input", this.actualValue);
187
- this.$emit("clear");
266
+ this.actualValue = "";
267
+ this.$emit("update:modelValue", this.actualValue);
268
+ this.$emit("input", this.actualValue);
269
+ this.$emit("clear");
188
270
  },
189
271
  onBlur() {
190
272
  this.$emit("blur", this.actualValue);
@@ -193,12 +275,30 @@ export default {
193
275
  this.$emit("focus", this.actualValue);
194
276
  },
195
277
  onInput() {
196
- if (this.debounce) {
197
- this.delayedInput(this.actualValue);
198
- } else {
278
+ if (this.debounce) {
279
+ this.delayedInput(this.actualValue);
280
+ } else {
281
+ this.$emit("update:modelValue", this.actualValue);
282
+ this.$emit("input", this.actualValue);
283
+ }
284
+ },
285
+ decrement() {
286
+ if (this.actualValue > this.min) {
287
+ this.actualValue = (+this.actualValue - +this.step).toFixed(this.toFixed);
288
+ }
289
+
199
290
  this.$emit("update:modelValue", this.actualValue);
200
291
  this.$emit("input", this.actualValue);
201
- }
292
+ this.$emit("blur", this.actualValue);
293
+ },
294
+ increment() {
295
+ if (this.actualValue < this.max) {
296
+ this.actualValue = (+this.actualValue + +this.step).toFixed(this.toFixed);
297
+ }
298
+
299
+ this.$emit("update:modelValue", this.actualValue);
300
+ this.$emit("input", this.actualValue);
301
+ this.$emit("blur", this.actualValue);
202
302
  },
203
303
  delayedInput(value) {
204
304
  if (this.timer) {
@@ -219,6 +319,9 @@ export default {
219
319
  hasSettings() {
220
320
  return !!this.$slots.settings;
221
321
  },
322
+ hasValue() {
323
+ return this.actualValue?.toString().length;
324
+ },
222
325
  classes() {
223
326
  const classList = ["ib-input"];
224
327
 
@@ -272,6 +375,9 @@ export default {
272
375
  IbIcon,
273
376
  IbDropdown,
274
377
  },
378
+ directives: {
379
+ Tooltip,
380
+ },
275
381
  inheritAttrs: false,
276
382
  };
277
383
  </script>
File without changes
@@ -28,6 +28,36 @@ $input-border-error-color: $red-800;
28
28
  z-index: 11;
29
29
  }
30
30
 
31
+ .number-button-group {
32
+ display: flex;
33
+ position: absolute;
34
+ align-items: center;
35
+ right: 5px;
36
+ top: 50%;
37
+ transform: translateY(-50%);
38
+
39
+ .divider {
40
+ width: 1px;
41
+ height: 16px;
42
+ background-color: $gray-500;
43
+ margin-right: 5px;
44
+ }
45
+
46
+ .button-decrement {
47
+ margin-right: 5px;
48
+ }
49
+ }
50
+
51
+ &.numbers-type {
52
+ .button-clear {
53
+ right: 67px;
54
+ }
55
+
56
+ input[type="number"] {
57
+ padding-right: 90px;
58
+ }
59
+ }
60
+
31
61
  .icon-search {
32
62
  font-size: 12px;
33
63
  position: absolute;
@@ -71,6 +101,24 @@ $input-border-error-color: $red-800;
71
101
  }
72
102
  }
73
103
 
104
+ &.success {
105
+ .ib-input {
106
+ border-radius: 4px;
107
+ border-bottom: 0px;
108
+ @include outline(0px, $green-800);
109
+ padding-right: 60px;
110
+ }
111
+
112
+ .succes-checkmark {
113
+ position: absolute;
114
+ right: 35px;
115
+ top: 50%;
116
+ transform: translateY(-50%);
117
+ z-index: 11;
118
+ color: $green-800;
119
+ }
120
+ }
121
+
74
122
  .ib-input {
75
123
  width: 100%;
76
124
  @include Ib-H4-regular;
@@ -114,14 +162,25 @@ $input-border-error-color: $red-800;
114
162
  display: none;
115
163
  }
116
164
 
165
+ &::-webkit-outer-spin-button,
166
+ &::-webkit-inner-spin-button {
167
+ -webkit-appearance: none;
168
+ margin: 0;
169
+ }
170
+
171
+ &[type="number"] {
172
+ -moz-appearance:textfield;
173
+ }
174
+
175
+
117
176
  &:disabled {
118
177
  color: $input-disabled-color;
119
178
  background-color: $input-disabled-bg;
120
179
  border-bottom-color: $input-disabled-border-color;
121
180
 
122
181
  &:-webkit-autofill,
123
- &:-webkit-autofill:hover,
124
- &:-webkit-autofill:focus,
182
+ &:-webkit-autofill:hover,
183
+ &:-webkit-autofill:focus,
125
184
  &:-webkit-autofill:active {
126
185
  -webkit-box-shadow: 0 0 0 30px $input-disabled-bg inset !important;
127
186
  -webkit-text-fill-color: $input-disabled-color;
File without changes
File without changes
@@ -1,26 +1,25 @@
1
1
  <template>
2
- <label :class="classes" :for="for">
2
+ <label :class="classes" :for>
3
3
  <span v-if="required" class="required">* </span>
4
4
  <slot></slot>
5
5
 
6
6
  <ib-icon-button
7
- v-if="infoText.length"
7
+ v-if="infoText.length || Object.keys(infoText).length"
8
8
  size="xs"
9
9
  class="info-button"
10
10
  kind="ghost"
11
11
  type="button"
12
+ v-tooltip:[tooltipPosition]="infoText"
12
13
  >
13
14
  <ib-icon name="information-circle-outline" />
14
-
15
- <ib-tooltip :text="infoText" :position="tooltipPosition"></ib-tooltip>
16
15
  </ib-icon-button>
17
16
  </label>
18
17
  </template>
19
18
 
20
19
  <script>
21
20
  import IbIconButton from "../../IconButton/IconButton.vue";
22
- import IbTooltip from "../../Tooltip/Tooltip.vue";
23
21
  import IbIcon from "../../Icon.vue";
22
+ import { TooltipDirective as Tooltip } from "../../../directives/tooltip/tooltip";
24
23
 
25
24
  export default {
26
25
  name: "IbLabel",
@@ -33,23 +32,32 @@ export default {
33
32
  default: false,
34
33
  },
35
34
  infoText: {
36
- type: String,
35
+ type: [String, Object],
37
36
  default: "",
38
37
  },
39
38
  tooltipPosition: {
40
39
  type: String,
41
40
  },
41
+ disabled: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
42
45
  },
43
46
  mounted() {
44
47
  this.$globalEvents.$on(`label:disabled:${this.for}`, (value) => {
45
- this.disabled = value;
48
+ this.idDisabled = value;
46
49
  });
47
50
  },
48
51
  data() {
49
52
  return {
50
- disabled: false,
53
+ idDisabled: this.disabled,
51
54
  };
52
55
  },
56
+ watch: {
57
+ disabled(value) {
58
+ this.idDisabled = value;
59
+ },
60
+ },
53
61
  computed: {
54
62
  classes() {
55
63
  const classList = ["ib-label"];
@@ -58,7 +66,7 @@ export default {
58
66
  classList.push("has-info-text");
59
67
  }
60
68
 
61
- if (this.disabled) {
69
+ if (this.idDisabled) {
62
70
  classList.push("label-disabled");
63
71
  }
64
72
 
@@ -68,7 +76,9 @@ export default {
68
76
  components: {
69
77
  IbIconButton,
70
78
  IbIcon,
71
- IbTooltip,
79
+ },
80
+ directives: {
81
+ Tooltip,
72
82
  },
73
83
  };
74
84
  </script>
@@ -109,6 +119,8 @@ export default {
109
119
  .info-button {
110
120
  display: inline-block;
111
121
  margin-left: 3px;
122
+ position: relative;
123
+
112
124
  .ib-icon {
113
125
  color: $gray-600;
114
126
  font-size: 16px;
File without changes