epos-unit 1.8.0 → 1.9.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/dist/epos-unit.js CHANGED
@@ -30,12 +30,12 @@ var Unit = class {
30
30
  }
31
31
  for (const key of keys) {
32
32
  if (typeof key === "symbol") continue;
33
- if (!key.startsWith("ui")) continue;
33
+ if (!key.endsWith("View")) continue;
34
34
  const descriptor = descriptors[key];
35
35
  if (descriptor.get || descriptor.set) continue;
36
36
  if (typeof _this[key] !== "function") continue;
37
- const componentName = [this["@"], key.replace("ui", "")].filter(Boolean).join("-");
38
- _this[key] = epos.component(componentName, _this[key]);
37
+ _this[key] = epos.component(_this[key]);
38
+ _this[key].displayName = `${this["@"]}.${key}`;
39
39
  }
40
40
  const log = createLog(this["@"]);
41
41
  Reflect.defineProperty(this, "log", { get: () => log });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epos-unit",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "imkost",
@@ -25,6 +25,6 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@eposlabs/utils": "^1.10.0",
28
- "epos": "^1.19.0"
28
+ "epos": "^1.23.0"
29
29
  }
30
30
  }
package/src/epos-unit.ts CHANGED
@@ -47,15 +47,15 @@ export class Unit<TRoot = unknown> {
47
47
  _this[key] = descriptor.value.bind(this)
48
48
  }
49
49
 
50
- // Wrap UI methods to components
50
+ // Create components out of `View` methods
51
51
  for (const key of keys) {
52
52
  if (typeof key === 'symbol') continue
53
- if (!key.startsWith('ui')) continue
53
+ if (!key.endsWith('View')) continue
54
54
  const descriptor = descriptors[key]
55
55
  if (descriptor.get || descriptor.set) continue
56
56
  if (typeof _this[key] !== 'function') continue
57
- const componentName = [this['@'], key.replace('ui', '')].filter(Boolean).join('-')
58
- _this[key] = epos.component(componentName, _this[key] as FC)
57
+ _this[key] = epos.component(_this[key] as FC)
58
+ _this[key].displayName = `${this['@']}.${key}`
59
59
  }
60
60
 
61
61
  // Define log method