@devschile/chucao 1.8.0 → 2.0.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/README.md +1 -0
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/p-10658dc9.entry.js +2 -0
- package/dist/chucao/p-10658dc9.entry.js.map +1 -0
- package/dist/chucao/p-19dde4f9.entry.js +2 -0
- package/dist/chucao/p-19dde4f9.entry.js.map +1 -0
- package/dist/chucao/p-2e20c7a1.entry.js +2 -0
- package/dist/chucao/p-2e20c7a1.entry.js.map +1 -0
- package/dist/chucao/{p-2d7e81b2.entry.js → p-66dce533.entry.js} +2 -2
- package/dist/chucao/p-75184fe1.entry.js +2 -0
- package/dist/chucao/p-75184fe1.entry.js.map +1 -0
- package/dist/chucao/{p-cbb2b478.entry.js → p-96c852f5.entry.js} +2 -2
- package/dist/chucao/p-BaKXvAYc.js +3 -0
- package/dist/chucao/p-BaKXvAYc.js.map +1 -0
- package/dist/chucao/{p-e8fe65bb.entry.js → p-a0ec231a.entry.js} +2 -2
- package/dist/chucao/{p-df73f786.entry.js → p-e48912c7.entry.js} +2 -2
- package/dist/chucao/{p-cfb6db53.entry.js → p-f04d2f75.entry.js} +2 -2
- package/dist/chucao/{p-1cc7042e.entry.js → p-f62e1da2.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ch-alert_8.cjs.entry.js +184 -7
- package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-checkbox.cjs.entry.js +62 -3
- package/dist/cjs/ch-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-divider.cjs.entry.js +1 -1
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +1 -1
- package/dist/cjs/ch-radio.cjs.entry.js +62 -3
- package/dist/cjs/ch-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ch-textarea.cjs.entry.js +62 -3
- package/dist/cjs/ch-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/chucao.cjs.js +2 -2
- package/dist/cjs/{index-DMeDkSQU.js → index-C9Abf0td.js} +58 -6
- package/dist/cjs/index-C9Abf0td.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/ch-checkbox/ch-checkbox.css +10 -0
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +64 -4
- package/dist/collection/components/ch-checkbox/ch-checkbox.js.map +1 -1
- package/dist/collection/components/ch-input/ch-input.css +11 -0
- package/dist/collection/components/ch-input/ch-input.js +64 -4
- package/dist/collection/components/ch-input/ch-input.js.map +1 -1
- package/dist/collection/components/ch-radio/ch-radio.css +10 -0
- package/dist/collection/components/ch-radio/ch-radio.js +64 -4
- package/dist/collection/components/ch-radio/ch-radio.js.map +1 -1
- package/dist/collection/components/ch-select/ch-select.css +11 -0
- package/dist/collection/components/ch-select/ch-select.js +64 -4
- package/dist/collection/components/ch-select/ch-select.js.map +1 -1
- package/dist/collection/components/ch-switch/ch-switch.css +10 -0
- package/dist/collection/components/ch-switch/ch-switch.js +64 -4
- package/dist/collection/components/ch-switch/ch-switch.js.map +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.css +11 -0
- package/dist/collection/components/ch-textarea/ch-textarea.js +64 -4
- package/dist/collection/components/ch-textarea/ch-textarea.js.map +1 -1
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-checkbox.js.map +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-input.js.map +1 -1
- package/dist/components/ch-link.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-radio.js.map +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-select.js.map +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-switch.js.map +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-textarea.js.map +1 -1
- package/dist/components/ch-tooltip.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-DL-bL54o.js +2 -0
- package/dist/components/p-DL-bL54o.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/ch-alert_8.entry.js +184 -7
- package/dist/esm/ch-alert_8.entry.js.map +1 -1
- package/dist/esm/ch-checkbox.entry.js +62 -3
- package/dist/esm/ch-checkbox.entry.js.map +1 -1
- package/dist/esm/ch-divider.entry.js +1 -1
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +1 -1
- package/dist/esm/ch-radio.entry.js +62 -3
- package/dist/esm/ch-radio.entry.js.map +1 -1
- package/dist/esm/ch-tabs.entry.js +1 -1
- package/dist/esm/ch-textarea.entry.js +62 -3
- package/dist/esm/ch-textarea.entry.js.map +1 -1
- package/dist/esm/ch-tooltip.entry.js +1 -1
- package/dist/esm/chucao.js +3 -3
- package/dist/esm/{index-Bvah_WQV.js → index-BaKXvAYc.js} +58 -6
- package/dist/esm/index-BaKXvAYc.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-checkbox/ch-checkbox.d.ts +9 -0
- package/dist/types/components/ch-input/ch-input.d.ts +9 -0
- package/dist/types/components/ch-radio/ch-radio.d.ts +9 -0
- package/dist/types/components/ch-select/ch-select.d.ts +9 -0
- package/dist/types/components/ch-switch/ch-switch.d.ts +9 -0
- package/dist/types/components/ch-textarea/ch-textarea.d.ts +9 -0
- package/dist/types/components.d.ts +24 -0
- package/hydrate/index.js +426 -52
- package/hydrate/index.mjs +426 -52
- package/package.json +4 -1
- package/dist/chucao/p-13ab5f9a.entry.js +0 -2
- package/dist/chucao/p-13ab5f9a.entry.js.map +0 -1
- package/dist/chucao/p-23c5220b.entry.js +0 -2
- package/dist/chucao/p-23c5220b.entry.js.map +0 -1
- package/dist/chucao/p-421cda05.entry.js +0 -2
- package/dist/chucao/p-421cda05.entry.js.map +0 -1
- package/dist/chucao/p-Bvah_WQV.js +0 -3
- package/dist/chucao/p-Bvah_WQV.js.map +0 -1
- package/dist/chucao/p-c16b18b7.entry.js +0 -2
- package/dist/chucao/p-c16b18b7.entry.js.map +0 -1
- package/dist/cjs/index-DMeDkSQU.js.map +0 -1
- package/dist/components/p-hyy-cLgi.js +0 -2
- package/dist/components/p-hyy-cLgi.js.map +0 -1
- package/dist/esm/index-Bvah_WQV.js.map +0 -1
- /package/dist/chucao/{p-2d7e81b2.entry.js.map → p-66dce533.entry.js.map} +0 -0
- /package/dist/chucao/{p-cbb2b478.entry.js.map → p-96c852f5.entry.js.map} +0 -0
- /package/dist/chucao/{p-e8fe65bb.entry.js.map → p-a0ec231a.entry.js.map} +0 -0
- /package/dist/chucao/{p-df73f786.entry.js.map → p-e48912c7.entry.js.map} +0 -0
- /package/dist/chucao/{p-cfb6db53.entry.js.map → p-f04d2f75.entry.js.map} +0 -0
- /package/dist/chucao/{p-1cc7042e.entry.js.map → p-f62e1da2.entry.js.map} +0 -0
|
@@ -170,6 +170,12 @@ var HYDRATE_CHILD_ID = "c-id";
|
|
|
170
170
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
171
171
|
var MAX_LAZY_LOAD_RETRIES = 3;
|
|
172
172
|
var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
|
|
173
|
+
var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
174
|
+
"formAssociatedCallback",
|
|
175
|
+
"formResetCallback",
|
|
176
|
+
"formDisabledCallback",
|
|
177
|
+
"formStateRestoreCallback"
|
|
178
|
+
];
|
|
173
179
|
var win = typeof window !== "undefined" ? window : {};
|
|
174
180
|
var plt = {
|
|
175
181
|
$flags$: 0,
|
|
@@ -1127,7 +1133,9 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
1127
1133
|
}
|
|
1128
1134
|
if (propValue != null && !isComplexType(propValue)) {
|
|
1129
1135
|
if (propType & 4 /* Boolean */) {
|
|
1130
|
-
{
|
|
1136
|
+
if (isFormAssociated && typeof propValue === "string") {
|
|
1137
|
+
return propValue === "" || !!propValue;
|
|
1138
|
+
} else {
|
|
1131
1139
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1132
1140
|
}
|
|
1133
1141
|
}
|
|
@@ -1580,6 +1588,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1580
1588
|
const isHostElement = isHost(renderFnResults);
|
|
1581
1589
|
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
1582
1590
|
hostTagName = hostElm.tagName;
|
|
1591
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
1592
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1593
|
+
cmpMeta.$attrsToReflect$.forEach(([propName, attribute]) => {
|
|
1594
|
+
{
|
|
1595
|
+
rootVnode.$attrs$[attribute] = hostElm[propName];
|
|
1596
|
+
}
|
|
1597
|
+
});
|
|
1598
|
+
}
|
|
1583
1599
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
1584
1600
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
1585
1601
|
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
@@ -1784,7 +1800,9 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1784
1800
|
const instance = hostRef.$lazyInstance$ ;
|
|
1785
1801
|
newVal = parsePropertyValue(
|
|
1786
1802
|
newVal,
|
|
1787
|
-
cmpMeta.$members$[propName][0]
|
|
1803
|
+
cmpMeta.$members$[propName][0],
|
|
1804
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
1805
|
+
);
|
|
1788
1806
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1789
1807
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1790
1808
|
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
@@ -1828,6 +1846,26 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1828
1846
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1829
1847
|
var _a, _b;
|
|
1830
1848
|
const prototype = Cstr.prototype;
|
|
1849
|
+
if (cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
1850
|
+
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
1851
|
+
Object.defineProperty(prototype, cbName, {
|
|
1852
|
+
value(...args) {
|
|
1853
|
+
var _a2;
|
|
1854
|
+
const hostRef = getHostRef(this);
|
|
1855
|
+
const instance = hostRef == null ? void 0 : hostRef.$lazyInstance$ ;
|
|
1856
|
+
if (!instance) {
|
|
1857
|
+
(_a2 = hostRef == null ? void 0 : hostRef.$onReadyPromise$) == null ? void 0 : _a2.then((asyncInstance) => {
|
|
1858
|
+
const cb = asyncInstance[cbName];
|
|
1859
|
+
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
1860
|
+
});
|
|
1861
|
+
} else {
|
|
1862
|
+
const cb = instance[cbName] ;
|
|
1863
|
+
typeof cb === "function" && cb.call(instance, ...args);
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
});
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1831
1869
|
if (cmpMeta.$members$ || BUILD.propChangeCallback) {
|
|
1832
1870
|
{
|
|
1833
1871
|
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
@@ -1877,7 +1915,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1877
1915
|
origSetter.apply(this, [
|
|
1878
1916
|
parsePropertyValue(
|
|
1879
1917
|
newValue,
|
|
1880
|
-
memberFlags
|
|
1918
|
+
memberFlags,
|
|
1919
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
1920
|
+
)
|
|
1881
1921
|
]);
|
|
1882
1922
|
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1883
1923
|
setValue(this, memberName, newValue, cmpMeta);
|
|
@@ -1902,7 +1942,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1902
1942
|
}
|
|
1903
1943
|
ref.$lazyInstance$[memberName] = parsePropertyValue(
|
|
1904
1944
|
newValue,
|
|
1905
|
-
memberFlags
|
|
1945
|
+
memberFlags,
|
|
1946
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
1947
|
+
);
|
|
1906
1948
|
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1907
1949
|
};
|
|
1908
1950
|
if (ref.$lazyInstance$) {
|
|
@@ -1961,8 +2003,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1961
2003
|
/* @__PURE__ */ new Set([
|
|
1962
2004
|
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
1963
2005
|
...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
|
|
2006
|
+
var _a2;
|
|
1964
2007
|
const attrName = m[1] || propName;
|
|
1965
2008
|
attrNameToPropName.set(attrName, propName);
|
|
2009
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
2010
|
+
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
2011
|
+
}
|
|
1966
2012
|
return attrName;
|
|
1967
2013
|
})
|
|
1968
2014
|
])
|
|
@@ -2192,6 +2238,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2192
2238
|
{
|
|
2193
2239
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2194
2240
|
}
|
|
2241
|
+
{
|
|
2242
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
2243
|
+
}
|
|
2195
2244
|
{
|
|
2196
2245
|
cmpMeta.$watchers$ = normalizeWatchers(compactMeta[4]);
|
|
2197
2246
|
cmpMeta.$serializers$ = (_a2 = compactMeta[5]) != null ? _a2 : {};
|
|
@@ -2262,6 +2311,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2262
2311
|
return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
|
|
2263
2312
|
}
|
|
2264
2313
|
};
|
|
2314
|
+
if (cmpMeta.$flags$ & 64 /* formAssociated */) {
|
|
2315
|
+
HostElement.formAssociated = true;
|
|
2316
|
+
}
|
|
2265
2317
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
2266
2318
|
if (!exclude.includes(tagName) && !customElements2.get(tagName)) {
|
|
2267
2319
|
cmpTags.push(tagName);
|
|
@@ -2343,6 +2395,6 @@ exports.h = h;
|
|
|
2343
2395
|
exports.promiseResolve = promiseResolve;
|
|
2344
2396
|
exports.registerInstance = registerInstance;
|
|
2345
2397
|
exports.setNonce = setNonce;
|
|
2346
|
-
//# sourceMappingURL=index-
|
|
2398
|
+
//# sourceMappingURL=index-C9Abf0td.js.map
|
|
2347
2399
|
|
|
2348
|
-
//# sourceMappingURL=index-
|
|
2400
|
+
//# sourceMappingURL=index-C9Abf0td.js.map
|