@neovici/cosmoz-autocomplete 10.11.1 → 10.12.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.
@@ -3,6 +3,7 @@ import '@neovici/cosmoz-input';
3
3
  import { useHost } from '@neovici/cosmoz-utils/hooks/use-host';
4
4
  import { useImperativeApi } from '@neovici/cosmoz-utils/hooks/use-imperative-api';
5
5
  import { useEffect } from '@pionjs/pion';
6
+ import { t } from 'i18next';
6
7
  import { html } from 'lit-html';
7
8
  import { live } from 'lit-html/directives/live.js';
8
9
  import { ref } from 'lit-html/directives/ref.js';
@@ -100,7 +101,9 @@ const autocomplete = (props) => {
100
101
  // TODO: revert https://github.com/Neovici/cosmoz-autocomplete/pull/206 after https://github.com/pionjs/pion/issues/64 is fixed
101
102
  display: hasResultsOrQuery ? undefined : 'none',
102
103
  },
103
- }, when(loading, () => html `<cosmoz-autocomplete-skeleton-span></cosmoz-autocomplete-skeleton-span>`, () => when(text != null && text.length > 0 && items.length === 0, () => html `<slot name="no-result"></slot>`))))}`;
104
+ }, when(loading, () => html `<cosmoz-autocomplete-skeleton-span></cosmoz-autocomplete-skeleton-span>`, () => when(text != null && text.length > 0 && items.length === 0, () => html `<slot name="no-result">
105
+ <p class="no-result">${t('No results found')}</p>
106
+ </slot>`))))}`;
104
107
  }, Autocomplete = (props) => {
105
108
  const thru = {
106
109
  ...props,
@@ -52,4 +52,11 @@ export default css `
52
52
  slot {
53
53
  display: contents !important;
54
54
  }
55
+
56
+ .no-result {
57
+ font-size: var(--cosmoz-autocomplete-listbox-font-size, 13px);
58
+ font-weight: var(--cosmoz-autocomplete-listbox-font-weight, 400);
59
+ padding: 0 22px;
60
+ color: var(--cosmoz-listbox-color, #101010);
61
+ }
55
62
  `;
@@ -1,5 +1,5 @@
1
1
  import { virtualize, virtualizerRef, } from '@lit-labs/virtualizer/virtualize.js';
2
- import { connectable } from '@neovici/cosmoz-dropdown/connectable';
2
+ import { connectable } from '@neovici/cosmoz-utils/connectable';
3
3
  import { sheet } from '@neovici/cosmoz-utils';
4
4
  import { spreadProps } from '@neovici/cosmoz-utils/directives/spread-props';
5
5
  import { noop } from '@neovici/cosmoz-utils/function';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-autocomplete",
3
- "version": "10.11.1",
3
+ "version": "10.12.1",
4
4
  "type": "module",
5
5
  "description": "A autocomplete input web component",
6
6
  "keywords": [
@@ -77,8 +77,9 @@
77
77
  "@lit-labs/virtualizer": "^2.0.0",
78
78
  "@neovici/cosmoz-dropdown": "^6.0.0 || ^7.0.0",
79
79
  "@neovici/cosmoz-input": "^5.0.2",
80
- "@neovici/cosmoz-utils": "^6.0.0",
80
+ "@neovici/cosmoz-utils": "^6.19.0",
81
81
  "@pionjs/pion": "^2.7.1",
82
+ "i18next": "^23.16.8",
82
83
  "lit-html": "^2.0.0 || ^3.0.0"
83
84
  },
84
85
  "devDependencies": {