@awes-io/ui 2.60.0 → 2.61.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.61.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.60.0...@awes-io/ui@2.61.0) (2022-12-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * useless component removed ([b69fe35](https://github.com/awes-io/client/commit/b69fe35d2df567d3d79cb2cc5d8e80fb64ee9ec6))
12
+
13
+
14
+ ### Features
15
+
16
+ * aw-select tuning ([a2d55ea](https://github.com/awes-io/client/commit/a2d55ea1ccc409232c61b95ad642e2f90669e830))
17
+
18
+
19
+
20
+
21
+
6
22
  # [2.60.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.59.2...@awes-io/ui@2.60.0) (2022-12-19)
7
23
 
8
24
 
@@ -33,7 +33,7 @@
33
33
  :placeholder="_placeholder"
34
34
  :clearable="clearable && !_isEmpty"
35
35
  :is-opened="isOpened"
36
- caret
36
+ :caret="isCaretVisible"
37
37
  :class="{
38
38
  'is-filled': searchable && isOpened,
39
39
  'not-searchable': !searchable
@@ -61,6 +61,10 @@
61
61
  v-bind="{ value: inputValue }"
62
62
  ></slot>
63
63
  </template>
64
+
65
+ <template #caret="data">
66
+ <slot name="caret" v-bind="data" />
67
+ </template>
64
68
  </AwSelectFakeInput>
65
69
  <AwSelectInput
66
70
  v-else
@@ -71,7 +75,7 @@
71
75
  :readonly="!searchable"
72
76
  :clearable="clearable && !_isEmpty"
73
77
  :is-opened="isOpened"
74
- caret
78
+ :caret="isCaretVisible"
75
79
  :class="{
76
80
  'is-filled': searchable && isOpened,
77
81
  'not-searchable': !searchable
@@ -102,6 +106,10 @@
102
106
  v-bind="{ value: inputValue }"
103
107
  ></slot>
104
108
  </template>
109
+
110
+ <template #caret="data">
111
+ <slot name="caret" v-bind="data" />
112
+ </template>
105
113
  </AwSelectInput>
106
114
  </slot>
107
115
 
@@ -150,6 +158,10 @@
150
158
  }"
151
159
  ></slot>
152
160
  </template>
161
+
162
+ <template #caret="data">
163
+ <slot name="caret" v-bind="data" />
164
+ </template>
153
165
  </AwSelectInput>
154
166
  </div>
155
167
  </slot>
@@ -230,7 +242,7 @@
230
242
  </template>
231
243
 
232
244
  <script>
233
- import { path, pathOr, isNil, equals } from 'rambdax'
245
+ import { path, pathOr, isNil, equals, isType } from 'rambdax'
234
246
  import { createPopper } from '@popperjs/core'
235
247
  import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock'
236
248
  import CancelToken from 'axios/lib/cancel/CancelToken'
@@ -339,6 +351,21 @@ export default {
339
351
  return 0
340
352
  }
341
353
  }
354
+ },
355
+
356
+ desktopFrom: {
357
+ type: String,
358
+ default: 'md'
359
+ },
360
+
361
+ isCaret: {
362
+ type: [Boolean, Function],
363
+ default: true
364
+ },
365
+
366
+ isNotFound: {
367
+ type: Boolean,
368
+ default: null
342
369
  }
343
370
  },
344
371
 
@@ -483,23 +510,32 @@ export default {
483
510
  },
484
511
 
485
512
  _showNotFound() {
513
+ if (this.isNotFound !== null) return this.isNotFound
514
+
486
515
  return this._isAjax
487
516
  ? !this.selectOptions.length && !this.isLoading
488
517
  : this._searchPhraseLength && !this.optionsList.length
489
518
  },
490
519
 
491
520
  isMobile() {
492
- return !pathOr(true, 'md', this.$screen)
521
+ return !pathOr(true, this.desktopFrom, this.$screen)
493
522
  },
494
523
 
495
524
  isMobileOpened() {
496
525
  return this.isOpened && this.isMobile
497
526
  },
498
527
 
528
+ isCaretVisible() {
529
+ return isType('Function', this.isCaret)
530
+ ? this.isCaret(this.optionsList)
531
+ : !!this.isCaret
532
+ },
533
+
499
534
  _inputSlot() {
500
535
  return {
501
536
  option: this.value,
502
537
  optionLabel: this._selectedLabel,
538
+ isMobile: this.isMobile,
503
539
  isOpened: this.isOpened,
504
540
  isLoading: this.isLoading,
505
541
  applySearch: this.applySearch,
@@ -550,6 +586,8 @@ export default {
550
586
  }
551
587
 
552
588
  this.$nextTick(this._focusInput)
589
+
590
+ this.$emit('open', { target: this })
553
591
  } else {
554
592
  if (this._isAjax && this._searchPhraseLength) {
555
593
  this.searchPhrase = ''
@@ -558,6 +596,8 @@ export default {
558
596
  this.isSearching = false
559
597
  this._toggleOutsideHandler(false)
560
598
  this.cancelRequest()
599
+
600
+ this.$emit('close', { target: this })
561
601
  }
562
602
  },
563
603
 
@@ -786,6 +826,8 @@ export default {
786
826
  } else if (input) {
787
827
  input.focus()
788
828
  }
829
+
830
+ this.$emit('focus', { target: this })
789
831
  } catch (e) {
790
832
  console.log(e)
791
833
  }
@@ -59,21 +59,23 @@
59
59
  <AwIconSystemMono name="close" />
60
60
  </AwButton>
61
61
 
62
- <!-- caret and loading -->
63
- <AwButton
64
- v-if="caret"
65
- :size="$attrs.size || 'md'"
66
- tabindex="-1"
67
- theme="icon"
68
- class="h-full"
69
- @click="$emit('caret')"
70
- >
71
- <AwIconSystemMono
72
- name="triangle"
73
- class="transition-200"
74
- :class="{ 'rotate-180': isOpened }"
75
- />
76
- </AwButton>
62
+ <slot name="caret" :is-opened="isOpened">
63
+ <!-- caret and loading -->
64
+ <AwButton
65
+ v-if="caret"
66
+ :size="$attrs.size || 'md'"
67
+ tabindex="-1"
68
+ theme="icon"
69
+ class="h-full"
70
+ @click="$emit('caret')"
71
+ >
72
+ <AwIconSystemMono
73
+ name="triangle"
74
+ class="transition-200"
75
+ :class="{ 'rotate-180': isOpened }"
76
+ />
77
+ </AwButton>
78
+ </slot>
77
79
  </slot>
78
80
  </span>
79
81
  </span>
@@ -23,21 +23,23 @@
23
23
  <AwIconSystemMono name="close" />
24
24
  </AwButton>
25
25
 
26
- <!-- caret and loading -->
27
- <AwButton
28
- v-if="caret"
29
- :size="$attrs.size || 'md'"
30
- tabindex="-1"
31
- theme="icon"
32
- class="h-full"
33
- @click="$emit('caret')"
34
- >
35
- <AwIconSystemMono
36
- name="triangle"
37
- class="transition-200"
38
- :class="{ 'rotate-180': isOpened }"
39
- />
40
- </AwButton>
26
+ <slot name="caret" :is-opened="isOpened">
27
+ <!-- caret and loading -->
28
+ <AwButton
29
+ v-if="caret"
30
+ :size="$attrs.size || 'md'"
31
+ tabindex="-1"
32
+ theme="icon"
33
+ class="h-full"
34
+ @click="$emit('caret')"
35
+ >
36
+ <AwIconSystemMono
37
+ name="triangle"
38
+ class="transition-200"
39
+ :class="{ 'rotate-180': isOpened }"
40
+ />
41
+ </AwButton>
42
+ </slot>
41
43
  </template>
42
44
  </AwInput>
43
45
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.60.0",
3
+ "version": "2.61.0",
4
4
  "description": "User Interface (UI) components",
5
5
  "keywords": [
6
6
  "ui",
@@ -122,5 +122,5 @@
122
122
  "vue-template-compiler": "^2.6.10",
123
123
  "webfonts-generator": "^0.4.0"
124
124
  },
125
- "gitHead": "114c5a47467339824b67b1788302bb1e4d2eec37"
125
+ "gitHead": "a07e89bcae97c12b659db4111d75d524b545b8b0"
126
126
  }