@public-ui/react 1.7.15 → 1.7.17
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 +17 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.mjs +16 -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;
|
|
@@ -228,6 +234,14 @@ const KolToast = /* @__PURE__ */ createReactComponent("kol-toast");
|
|
|
228
234
|
const KolToastContainer = /* @__PURE__ */ createReactComponent("kol-toast-container");
|
|
229
235
|
const KolVersion = /* @__PURE__ */ createReactComponent("kol-version");
|
|
230
236
|
|
|
237
|
+
function createReactRenderElement(hostElement) {
|
|
238
|
+
const renderElement = document.createElement("div");
|
|
239
|
+
renderElement.setAttribute("role", "presentation");
|
|
240
|
+
hostElement.innerHTML = "";
|
|
241
|
+
hostElement.appendChild(renderElement);
|
|
242
|
+
return renderElement;
|
|
243
|
+
}
|
|
244
|
+
|
|
231
245
|
exports.KolAbbr = KolAbbr;
|
|
232
246
|
exports.KolAccordion = KolAccordion;
|
|
233
247
|
exports.KolAlert = KolAlert;
|
|
@@ -279,3 +293,5 @@ exports.KolTextarea = KolTextarea;
|
|
|
279
293
|
exports.KolToast = KolToast;
|
|
280
294
|
exports.KolToastContainer = KolToastContainer;
|
|
281
295
|
exports.KolVersion = KolVersion;
|
|
296
|
+
exports.createReactRenderElement = createReactRenderElement;
|
|
297
|
+
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,6 @@ declare const KolToast: react.ForwardRefExoticComponent<JSX.KolToast & Omit<reac
|
|
|
61
64
|
declare const KolToastContainer: react.ForwardRefExoticComponent<JSX.KolToastContainer & Omit<react.HTMLAttributes<HTMLKolToastContainerElement>, "style"> & StyleReactProps & react.RefAttributes<HTMLKolToastContainerElement>>;
|
|
62
65
|
declare const KolVersion: react.ForwardRefExoticComponent<JSX.KolVersion & Omit<react.HTMLAttributes<HTMLKolVersionElement>, "style"> & StyleReactProps & react.RefAttributes<HTMLKolVersionElement>>;
|
|
63
66
|
|
|
64
|
-
|
|
67
|
+
declare function createReactRenderElement(hostElement: HTMLElement): HTMLDivElement;
|
|
68
|
+
|
|
69
|
+
export { KolAbbr, KolAccordion, KolAlert, KolAvatar, KolBadge, KolBreadcrumb, KolButton, KolButtonGroup, KolButtonLink, KolCard, KolDetails, KolForm, KolHeading, KolIcon, KolIconFontAwesome, KolIconIcofont, KolImage, KolIndentedText, KolInputAdapterLeanup, 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, KolToast, KolToastContainer, KolVersion, createReactRenderElement, 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,12 @@ const KolToast = /* @__PURE__ */ createReactComponent("kol-toast");
|
|
|
222
228
|
const KolToastContainer = /* @__PURE__ */ createReactComponent("kol-toast-container");
|
|
223
229
|
const KolVersion = /* @__PURE__ */ createReactComponent("kol-version");
|
|
224
230
|
|
|
225
|
-
|
|
231
|
+
function createReactRenderElement(hostElement) {
|
|
232
|
+
const renderElement = document.createElement("div");
|
|
233
|
+
renderElement.setAttribute("role", "presentation");
|
|
234
|
+
hostElement.innerHTML = "";
|
|
235
|
+
hostElement.appendChild(renderElement);
|
|
236
|
+
return renderElement;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export { KolAbbr, KolAccordion, KolAlert, KolAvatar, KolBadge, KolBreadcrumb, KolButton, KolButtonGroup, KolButtonLink, KolCard, KolDetails, KolForm, KolHeading, KolIcon, KolIconFontAwesome, KolIconIcofont, KolImage, KolIndentedText, KolInputAdapterLeanup, 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, KolToast, KolToastContainer, KolVersion, createReactRenderElement, setTagNameTransformer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/react",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.17",
|
|
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": "1.7.
|
|
45
|
+
"@public-ui/components": "1.7.17",
|
|
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": "1.7.
|
|
58
|
+
"@public-ui/components": "1.7.17",
|
|
59
59
|
"react": ">=16.14.0",
|
|
60
60
|
"react-dom": ">=16.14.0"
|
|
61
61
|
},
|