@swiftwc/ui 0.0.0-dev.80 → 0.0.0-dev.82

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.
@@ -1,4 +1,5 @@
1
- import { $, devFlags, renderLabelIcon, renderLabelTitle } from '../internal/utils';
1
+ import { $, devFlags } from '../internal/utils';
2
+ import { html, render } from '../tpl';
2
3
  /**
3
4
  *
4
5
  * @attr {@fontSet} font - Sets the default font for text in this view.
@@ -38,11 +39,17 @@ export class LabelView extends HTMLElement {
38
39
  // this.#scheduleReflect()
39
40
  switch (name) {
40
41
  case 'system-image':
41
- renderLabelIcon(this, newValue);
42
- break;
43
42
  case 'title':
44
- renderLabelTitle(this, newValue);
43
+ render(html `${this.getAttribute('title') ? html `<span>${this.getAttribute('title')}</span>` : null}${this.getAttribute('system-image')
44
+ ? html `<image-view slot="icon" system-name="${this.getAttribute('system-image')}"></image-view>`
45
+ : null}`, this);
45
46
  break;
47
+ // case 'system-image':
48
+ // renderLabelIcon(this, newValue)
49
+ // break
50
+ // case 'title':
51
+ // renderLabelTitle(this, newValue)
52
+ // break
46
53
  }
47
54
  }
48
55
  disconnectedCallback() {
@@ -3,7 +3,6 @@ type LocaleInput = Intl.UnicodeBCP47LocaleIdentifier | Intl.Locale;
3
3
  type DeepStringify<T> = {
4
4
  [K in keyof T]: T[K] extends object ? DeepStringify<T[K]> : string;
5
5
  };
6
- export declare function defineTranslations<const T extends object>(factory: () => T): () => T;
7
6
  type EnTranslations = DeepStringify<ReturnType<typeof en>>;
8
7
  /**
9
8
  * @fires localechange - On html[lang] change!
@@ -1,7 +1,4 @@
1
1
  import { el, en } from './locales';
2
- export function defineTranslations(factory) {
3
- return factory;
4
- }
5
2
  /**
6
3
  * @fires localechange - On html[lang] change!
7
4
  */
@@ -1,4 +1,4 @@
1
- import { defineTranslations } from '../index';
1
+ import { defineTranslations } from '../../internal/utils';
2
2
  export default defineTranslations(() => ({
3
3
  SearchUnavailableContent: {
4
4
  NoLabel: 'Κανένα αποτέλεσμα',
@@ -1,4 +1,4 @@
1
- import { defineTranslations } from '../index';
1
+ import { defineTranslations } from '../../internal/utils';
2
2
  export default defineTranslations(() => ({
3
3
  SearchUnavailableContent: {
4
4
  NoLabel: 'No Results',
@@ -0,0 +1 @@
1
+ export default function <const T extends object>(factory: () => T): () => T;
@@ -0,0 +1,3 @@
1
+ export default function (factory) {
2
+ return factory;
3
+ }
@@ -4,6 +4,7 @@ export { default as clamp } from './clamp';
4
4
  export { default as compareBigDecimals } from './compare-big-decimals';
5
5
  export { default as cssTime } from './css-time';
6
6
  export { default as debounce } from './debounce';
7
+ export { default as defineTranslations } from './define-translations';
7
8
  export { default as devFlags } from './dev-flags';
8
9
  export { default as ensurePlaceholder } from './ensure-placeholder';
9
10
  export { default as frame } from './frame';
@@ -6,6 +6,7 @@ export { default as clamp } from './clamp';
6
6
  export { default as compareBigDecimals } from './compare-big-decimals';
7
7
  export { default as cssTime } from './css-time';
8
8
  export { default as debounce } from './debounce';
9
+ export { default as defineTranslations } from './define-translations';
9
10
  export { default as devFlags } from './dev-flags';
10
11
  export { default as ensurePlaceholder } from './ensure-placeholder';
11
12
  export { default as frame } from './frame';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swiftwc/ui",
3
- "version": "0.0.0-dev.80",
3
+ "version": "0.0.0-dev.82",
4
4
  "description": "Elegant SwiftUI-inspired web components for standalone web apps and web extensions.",
5
5
  "publishConfig": {
6
6
  "access": "public"