@htmlplus/element 0.6.8 → 0.6.9
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,6 +1,6 @@
|
|
|
1
1
|
import { camelCase, paramCase } from 'change-case';
|
|
2
2
|
import * as CONSTANTS from '../../constants/index.js';
|
|
3
|
-
import { call, fromAttribute, getMembers, isServer, request } from '../utils/index.js';
|
|
3
|
+
import { call, fromAttribute, getConfig, getMembers, getTag, isServer, request } from '../utils/index.js';
|
|
4
4
|
export function Element(tag) {
|
|
5
5
|
return function (constructor) {
|
|
6
6
|
if (isServer())
|
|
@@ -42,6 +42,8 @@ export function Element(tag) {
|
|
|
42
42
|
}
|
|
43
43
|
connectedCallback() {
|
|
44
44
|
const instance = this[CONSTANTS.API_INSTANCE];
|
|
45
|
+
// TODO: experimental for global config
|
|
46
|
+
Object.assign(instance, getConfig('component', getTag(instance), 'property'));
|
|
45
47
|
const connect = () => {
|
|
46
48
|
instance[CONSTANTS.API_CONNECTED] = true;
|
|
47
49
|
call(instance, CONSTANTS.LIFECYCLE_CONNECTED);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as CONSTANTS from '../../constants/index.js';
|
|
2
|
-
import { addMember, appendToMethod, defineProperty,
|
|
2
|
+
import { addMember, appendToMethod, defineProperty, host, request, updateAttribute } from '../utils/index.js';
|
|
3
3
|
export function Property(options) {
|
|
4
4
|
return function (target, propertyKey) {
|
|
5
5
|
const name = String(propertyKey);
|
|
@@ -23,14 +23,7 @@ export function Property(options) {
|
|
|
23
23
|
}
|
|
24
24
|
defineProperty(target, propertyKey, { get, set });
|
|
25
25
|
appendToMethod(target, CONSTANTS.LIFECYCLE_CONNECTED, function () {
|
|
26
|
-
var _a;
|
|
27
26
|
const element = host(this);
|
|
28
|
-
// TODO: experimental for global config
|
|
29
|
-
if (((_a = getMembers(this.constructor)[name]) === null || _a === void 0 ? void 0 : _a.default) === this[name]) {
|
|
30
|
-
const config = getConfig('component', getTag(target), 'property', name);
|
|
31
|
-
if (typeof config != 'undefined')
|
|
32
|
-
this[name] = config;
|
|
33
|
-
}
|
|
34
27
|
// TODO: experimental for isolated options
|
|
35
28
|
if (element === this)
|
|
36
29
|
return;
|