@public-ui/react 2.0.9 → 2.0.10
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/index.cjs +8 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +8 -2
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -99,6 +99,11 @@ const arrayToMap = (arr) => {
|
|
|
99
99
|
return map;
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
+
let tagNameTransformer;
|
|
103
|
+
const setTagNameTransformer = (_tagNameTransformer) => {
|
|
104
|
+
tagNameTransformer = _tagNameTransformer;
|
|
105
|
+
};
|
|
106
|
+
|
|
102
107
|
const setRef = (ref, value) => {
|
|
103
108
|
if (typeof ref === "function") {
|
|
104
109
|
ref(value);
|
|
@@ -164,7 +169,8 @@ const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFun
|
|
|
164
169
|
ref: mergeRefs(forwardedRef, this.setComponentElRef),
|
|
165
170
|
style
|
|
166
171
|
};
|
|
167
|
-
|
|
172
|
+
const newTagName = typeof tagNameTransformer === "function" ? tagNameTransformer(tagName) : tagName;
|
|
173
|
+
return React.createElement(newTagName, newProps, children);
|
|
168
174
|
}
|
|
169
175
|
static get displayName() {
|
|
170
176
|
return displayName;
|
|
@@ -279,3 +285,4 @@ exports.KolTreeItem = KolTreeItem;
|
|
|
279
285
|
exports.KolTreeItemWc = KolTreeItemWc;
|
|
280
286
|
exports.KolTreeWc = KolTreeWc;
|
|
281
287
|
exports.KolVersion = KolVersion;
|
|
288
|
+
exports.setTagNameTransformer = setTagNameTransformer;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ interface StyleReactProps {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
type TagNameTransformer = (tagName: string) => string;
|
|
13
|
+
declare const setTagNameTransformer: (_tagNameTransformer: TagNameTransformer) => void;
|
|
14
|
+
|
|
12
15
|
declare const KolAbbr: react.ForwardRefExoticComponent<JSX.KolAbbr & Omit<react.HTMLAttributes<HTMLKolAbbrElement>, "style"> & StyleReactProps & react.RefAttributes<HTMLKolAbbrElement>>;
|
|
13
16
|
declare const KolAccordion: react.ForwardRefExoticComponent<JSX.KolAccordion & Omit<react.HTMLAttributes<HTMLKolAccordionElement>, "style"> & StyleReactProps & react.RefAttributes<HTMLKolAccordionElement>>;
|
|
14
17
|
declare const KolAlert: react.ForwardRefExoticComponent<JSX.KolAlert & Omit<react.HTMLAttributes<HTMLKolAlertElement>, "style"> & StyleReactProps & react.RefAttributes<HTMLKolAlertElement>>;
|
|
@@ -61,4 +64,4 @@ declare const KolTreeItemWc: react.ForwardRefExoticComponent<JSX.KolTreeItemWc &
|
|
|
61
64
|
declare const KolTreeWc: react.ForwardRefExoticComponent<JSX.KolTreeWc & Omit<react.HTMLAttributes<HTMLKolTreeWcElement>, "style"> & StyleReactProps & react.RefAttributes<HTMLKolTreeWcElement>>;
|
|
62
65
|
declare const KolVersion: react.ForwardRefExoticComponent<JSX.KolVersion & Omit<react.HTMLAttributes<HTMLKolVersionElement>, "style"> & StyleReactProps & react.RefAttributes<HTMLKolVersionElement>>;
|
|
63
66
|
|
|
64
|
-
export { KolAbbr, KolAccordion, KolAlert, KolAvatar, KolBadge, KolBreadcrumb, KolButton, KolButtonGroup, KolButtonLink, KolCard, KolDetails, KolForm, KolHeading, KolIcon, KolImage, KolIndentedText, KolInputCheckbox, KolInputColor, KolInputDate, KolInputEmail, KolInputFile, KolInputNumber, KolInputPassword, KolInputRadio, KolInputRange, KolInputText, KolKolibri, KolLink, KolLinkButton, KolLinkGroup, KolLogo, KolModal, KolNav, KolPagination, KolProgress, KolQuote, KolSelect, KolSkipNav, KolSpan, KolSpin, KolSplitButton, KolSymbol, KolTable, KolTabs, KolTextarea, KolToastContainer, KolTree, KolTreeItem, KolTreeItemWc, KolTreeWc, KolVersion };
|
|
67
|
+
export { KolAbbr, KolAccordion, KolAlert, KolAvatar, KolBadge, KolBreadcrumb, KolButton, KolButtonGroup, KolButtonLink, KolCard, KolDetails, KolForm, KolHeading, KolIcon, KolImage, KolIndentedText, KolInputCheckbox, KolInputColor, KolInputDate, KolInputEmail, KolInputFile, KolInputNumber, KolInputPassword, KolInputRadio, KolInputRange, KolInputText, KolKolibri, KolLink, KolLinkButton, KolLinkGroup, KolLogo, KolModal, KolNav, KolPagination, KolProgress, KolQuote, KolSelect, KolSkipNav, KolSpan, KolSpin, KolSplitButton, KolSymbol, KolTable, KolTabs, KolTextarea, KolToastContainer, KolTree, KolTreeItem, KolTreeItemWc, KolTreeWc, KolVersion, setTagNameTransformer };
|
package/dist/index.mjs
CHANGED
|
@@ -93,6 +93,11 @@ const arrayToMap = (arr) => {
|
|
|
93
93
|
return map;
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
+
let tagNameTransformer;
|
|
97
|
+
const setTagNameTransformer = (_tagNameTransformer) => {
|
|
98
|
+
tagNameTransformer = _tagNameTransformer;
|
|
99
|
+
};
|
|
100
|
+
|
|
96
101
|
const setRef = (ref, value) => {
|
|
97
102
|
if (typeof ref === "function") {
|
|
98
103
|
ref(value);
|
|
@@ -158,7 +163,8 @@ const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFun
|
|
|
158
163
|
ref: mergeRefs(forwardedRef, this.setComponentElRef),
|
|
159
164
|
style
|
|
160
165
|
};
|
|
161
|
-
|
|
166
|
+
const newTagName = typeof tagNameTransformer === "function" ? tagNameTransformer(tagName) : tagName;
|
|
167
|
+
return createElement(newTagName, newProps, children);
|
|
162
168
|
}
|
|
163
169
|
static get displayName() {
|
|
164
170
|
return displayName;
|
|
@@ -222,4 +228,4 @@ const KolTreeItemWc = /* @__PURE__ */ createReactComponent("kol-tree-item-wc");
|
|
|
222
228
|
const KolTreeWc = /* @__PURE__ */ createReactComponent("kol-tree-wc");
|
|
223
229
|
const KolVersion = /* @__PURE__ */ createReactComponent("kol-version");
|
|
224
230
|
|
|
225
|
-
export { KolAbbr, KolAccordion, KolAlert, KolAvatar, KolBadge, KolBreadcrumb, KolButton, KolButtonGroup, KolButtonLink, KolCard, KolDetails, KolForm, KolHeading, KolIcon, KolImage, KolIndentedText, KolInputCheckbox, KolInputColor, KolInputDate, KolInputEmail, KolInputFile, KolInputNumber, KolInputPassword, KolInputRadio, KolInputRange, KolInputText, KolKolibri, KolLink, KolLinkButton, KolLinkGroup, KolLogo, KolModal, KolNav, KolPagination, KolProgress, KolQuote, KolSelect, KolSkipNav, KolSpan, KolSpin, KolSplitButton, KolSymbol, KolTable, KolTabs, KolTextarea, KolToastContainer, KolTree, KolTreeItem, KolTreeItemWc, KolTreeWc, KolVersion };
|
|
231
|
+
export { KolAbbr, KolAccordion, KolAlert, KolAvatar, KolBadge, KolBreadcrumb, KolButton, KolButtonGroup, KolButtonLink, KolCard, KolDetails, KolForm, KolHeading, KolIcon, KolImage, KolIndentedText, KolInputCheckbox, KolInputColor, KolInputDate, KolInputEmail, KolInputFile, KolInputNumber, KolInputPassword, KolInputRadio, KolInputRange, KolInputText, KolKolibri, KolLink, KolLinkButton, KolLinkGroup, KolLogo, KolModal, KolNav, KolPagination, KolProgress, KolQuote, KolSelect, KolSkipNav, KolSpan, KolSpin, KolSplitButton, KolSymbol, KolTable, KolTabs, KolTextarea, KolToastContainer, KolTree, KolTreeItem, KolTreeItemWc, KolTreeWc, KolVersion, setTagNameTransformer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": "https://github.com/public-ui/kolibri",
|
|
@@ -42,20 +42,20 @@
|
|
|
42
42
|
"react"
|
|
43
43
|
],
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@public-ui/components": "2.0.
|
|
45
|
+
"@public-ui/components": "2.0.10",
|
|
46
46
|
"@types/minimatch": "5.1.2",
|
|
47
47
|
"@types/minimist": "1.2.5",
|
|
48
|
-
"@types/node": "ts5.
|
|
48
|
+
"@types/node": "ts5.4",
|
|
49
49
|
"@types/normalize-package-data": "2.4.4",
|
|
50
|
-
"@types/react": "18.2.
|
|
51
|
-
"@types/react-dom": "18.2.
|
|
50
|
+
"@types/react": "18.2.68",
|
|
51
|
+
"@types/react-dom": "18.2.22",
|
|
52
52
|
"react": "18.2.0",
|
|
53
53
|
"react-dom": "18.2.0",
|
|
54
|
-
"typescript": "5.4.
|
|
54
|
+
"typescript": "5.4.3",
|
|
55
55
|
"unbuild": "1.2.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@public-ui/components": "2.0.
|
|
58
|
+
"@public-ui/components": "2.0.10",
|
|
59
59
|
"react": ">=16.14.0",
|
|
60
60
|
"react-dom": ">=16.14.0"
|
|
61
61
|
},
|