@progress/kendo-react-labels 14.4.0-develop.9 → 14.4.1-develop.1
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/Label.js +1 -1
- package/Label.mjs +29 -24
- package/dist/cdn/js/kendo-react-labels.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +4 -4
package/Label.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),e=require("prop-types"),u=require("@progress/kendo-react-common"),d=require("./messages/index.js"),j=require("@progress/kendo-react-intl");function C(n){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const l in n)if(l!=="default"){const t=Object.getOwnPropertyDescriptor(n,l);Object.defineProperty(o,l,t.get?t:{enumerable:!0,get:()=>n[l]})}}return o.default=n,Object.freeze(o)}const c=C(E),b=n=>{const{id:o,editorId:l,editorRef:t,editorDisabled:s,children:r,editorValid:p,style:O,className:m,optional:k}=n,L=j.useLocalization(),f=k?L.toLanguageString(d.labelsOptional,d.messages[d.labelsOptional]):"",N=f&&c.createElement("span",{className:"k-label-optional"},f),y=u.useUnstyled(),g=y&&y.uLabel,v=c.useCallback(i=>{if(!s){if(t!=null&&t.current){t.current.focus&&(i.preventDefault(),t.current.focus());const a=t.current.actionElement;a&&(i.preventDefault(),a.click())}else if(l){const a=document.getElementById(l);a&&(i.preventDefault(),a.focus())}}},[t,l,s]),D=c.useMemo(()=>u.classNames(u.uLabel.label({c:g,empty:!r,invalid:p===!1,disabled:s===!0}),m),[g,r,p,s,m]);return c.createElement("label",{id:o,htmlFor:l,onClick:v,style:O,className:D},r,N)};b.propTypes={id:e.string,editorId:e.string,editorRef:e.oneOfType([e.func,e.shape({current:e.any})]),editorValid:e.bool,editorDisabled:e.bool,style:e.object,className:e.string,optional:e.bool};b.displayName="KendoReactLabel";exports.Label=b;
|
package/Label.mjs
CHANGED
|
@@ -5,36 +5,41 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
8
|
+
import * as s from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
import { useUnstyled as
|
|
11
|
-
import { labelsOptional as
|
|
12
|
-
import { useLocalization as
|
|
13
|
-
const
|
|
14
|
-
const { id:
|
|
15
|
-
(
|
|
16
|
-
if (
|
|
17
|
-
t
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
import { useUnstyled as C, classNames as D, uLabel as h } from "@progress/kendo-react-common";
|
|
11
|
+
import { labelsOptional as u, messages as z } from "./messages/index.mjs";
|
|
12
|
+
import { useLocalization as I } from "@progress/kendo-react-intl";
|
|
13
|
+
const f = (b) => {
|
|
14
|
+
const { id: y, editorId: o, editorRef: t, editorDisabled: a, children: n, editorValid: r, style: g, className: c, optional: E } = b, L = I(), m = E ? L.toLanguageString(u, z[u]) : "", N = m && /* @__PURE__ */ s.createElement("span", { className: "k-label-optional" }, m), d = C(), p = d && d.uLabel, k = s.useCallback(
|
|
15
|
+
(i) => {
|
|
16
|
+
if (!a) {
|
|
17
|
+
if (t != null && t.current) {
|
|
18
|
+
t.current.focus && (i.preventDefault(), t.current.focus());
|
|
19
|
+
const l = t.current.actionElement;
|
|
20
|
+
l && (i.preventDefault(), l.click());
|
|
21
|
+
} else if (o) {
|
|
22
|
+
const l = document.getElementById(o);
|
|
23
|
+
l && (i.preventDefault(), l.focus());
|
|
24
|
+
}
|
|
20
25
|
}
|
|
21
26
|
},
|
|
22
|
-
[t]
|
|
23
|
-
),
|
|
27
|
+
[t, o, a]
|
|
28
|
+
), v = s.useMemo(
|
|
24
29
|
() => D(
|
|
25
|
-
|
|
26
|
-
c,
|
|
27
|
-
empty: !
|
|
28
|
-
invalid:
|
|
29
|
-
disabled:
|
|
30
|
+
h.label({
|
|
31
|
+
c: p,
|
|
32
|
+
empty: !n,
|
|
33
|
+
invalid: r === !1,
|
|
34
|
+
disabled: a === !0
|
|
30
35
|
}),
|
|
31
|
-
|
|
36
|
+
c
|
|
32
37
|
),
|
|
33
|
-
[
|
|
38
|
+
[p, n, r, a, c]
|
|
34
39
|
);
|
|
35
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ s.createElement("label", { id: y, htmlFor: o, onClick: k, style: g, className: v }, n, N);
|
|
36
41
|
};
|
|
37
|
-
|
|
42
|
+
f.propTypes = {
|
|
38
43
|
id: e.string,
|
|
39
44
|
editorId: e.string,
|
|
40
45
|
editorRef: e.oneOfType([e.func, e.shape({ current: e.any })]),
|
|
@@ -44,7 +49,7 @@ u.propTypes = {
|
|
|
44
49
|
className: e.string,
|
|
45
50
|
optional: e.bool
|
|
46
51
|
};
|
|
47
|
-
|
|
52
|
+
f.displayName = "KendoReactLabel";
|
|
48
53
|
export {
|
|
49
|
-
|
|
54
|
+
f as Label
|
|
50
55
|
};
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-intl"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactLabels={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactIntl)}(this,function(e,t,o,a
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-intl"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactLabels={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactIntl)}(this,function(e,t,o,l,a){"use strict";function s(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if("default"!==o){var l=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:function(){return e[o]}})}}),t.default=e,Object.freeze(t)}var r=s(t);const n="labels.optional",i={[n]:"(Optional)"},d=e=>{const{id:t,editorId:o,editorRef:s,editorDisabled:d,children:c,editorValid:u,style:p,className:m,optional:b}=e,f=a.useLocalization(),y=b?f.toLanguageString(n,i[n]):"",g=y&&r.createElement("span",{className:"k-label-optional"},y),N=l.useUnstyled(),E=N&&N.uLabel,h=r.useCallback(e=>{if(!d)if(null!=s&&s.current){s.current.focus&&(e.preventDefault(),s.current.focus());const t=s.current.actionElement;t&&(e.preventDefault(),t.click())}else if(o){const t=document.getElementById(o);t&&(e.preventDefault(),t.focus())}},[s,o,d]),L=r.useMemo(()=>l.classNames(l.uLabel.label({c:E,empty:!c,invalid:!1===u,disabled:!0===d}),m),[E,c,u,d,m]);return r.createElement("label",{id:t,htmlFor:o,onClick:h,style:p,className:L},c,g)};d.propTypes={id:o.string,editorId:o.string,editorRef:o.oneOfType([o.func,o.shape({current:o.any})]),editorValid:o.bool,editorDisabled:o.bool,style:o.object,className:o.string,optional:o.bool},d.displayName="KendoReactLabel";const c=e=>{const t={direction:"start",...e},o=l.useUnstyled(),a=o&&o.uError,s=r.useMemo(()=>l.classNames(l.uError.wrapper({c:a,direction:t.direction}),t.className),[a,t.direction,t.className]);return r.createElement("div",{id:t.id,role:"alert",style:t.style,className:s},t.children)};c.propTypes={id:o.string,direction:o.oneOf(["start","end"]),children:o.oneOfType([o.element,o.node]),style:o.object,className:o.string},c.displayName="KendoReactError";const u=e=>{const t={direction:"start",...e},o=l.useUnstyled(),a=o&&o.uHint,s=r.useMemo(()=>l.classNames(l.uHint.wrapper({c:a,direction:t.direction,disabled:!0===t.editorDisabled}),t.className),[a,t.direction,t.editorDisabled,t.className]);return r.createElement("div",{id:t.id,style:t.style,className:s},t.children)};u.propTypes={id:o.string,direction:o.oneOf(["start","end"]),children:o.oneOfType([o.element,o.node]),style:o.object,className:o.string,editorDisabled:o.bool},u.displayName="KendoReactHint";const p=e=>{const[t,o]=r.useState({focused:!1}),{label:s,editorId:d,className:c,labelClassName:u,editorValue:p,editorPlaceholder:m,editorValid:b,editorDisabled:f,style:y,id:g,optional:N,unstyled:E,...h}=e,L=a.useLocalization(),O=N?L.toLanguageString(n,i[n]):"",D=O&&r.createElement("span",{className:"k-label-optional"},O),T=E&&E.uFloatingLabel,j=!m&&!p&&0!==p,k=l.classNames(l.uFloatingLabel.wrapper({c:T,focused:t.focused,empty:j,notEmpty:!j,disabled:f,isRtl:"rtl"===e.dir}),c),v=l.classNames(l.uFloatingLabel.label({c:T,focused:t.focused,empty:j,notEmpty:!j,invalid:!1===b,disabled:f}),u);return r.createElement("span",{...h,id:e.id,className:k,onFocus:e=>{o({focused:!0})},onBlur:e=>{o({focused:!1})},style:y,dir:e.dir},e.children,s?d?r.createElement("label",{id:g,htmlFor:d,className:v},s,D):r.createElement("span",{id:g,className:v},s,D):null)};p.propTypes={label:o.node,editorId:o.string,editorValue:o.oneOfType([o.string,o.bool,o.number]),editorPlaceholder:o.string,editorValid:o.bool,editorDisabled:o.bool,id:o.string,style:o.object,className:o.string,labelClassName:o.string,optional:o.bool},e.Error=c,e.FloatingLabel=p,e.Hint=u,e.Label=d});
|
package/package-metadata.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
|
|
|
7
7
|
productName: 'KendoReact',
|
|
8
8
|
productCode: 'KENDOUIREACT',
|
|
9
9
|
productCodes: ['KENDOUIREACT'],
|
|
10
|
-
publishDate:
|
|
11
|
-
version: '14.4.
|
|
10
|
+
publishDate: 1776415578,
|
|
11
|
+
version: '14.4.1-develop.1',
|
|
12
12
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
|
|
13
13
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-labels",
|
|
3
|
-
"version": "14.4.
|
|
3
|
+
"version": "14.4.1-develop.1",
|
|
4
4
|
"description": "React Labels package provides components for labelling form editors. KendoReact Labels package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-licensing": "^1.7.2",
|
|
29
|
-
"@progress/kendo-react-common": "14.4.
|
|
30
|
-
"@progress/kendo-react-intl": "14.4.
|
|
29
|
+
"@progress/kendo-react-common": "14.4.1-develop.1",
|
|
30
|
+
"@progress/kendo-react-intl": "14.4.1-develop.1",
|
|
31
31
|
"react": "^18.0.0 || ^19.0.0",
|
|
32
32
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
33
33
|
},
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"package": {
|
|
58
58
|
"productName": "KendoReact",
|
|
59
59
|
"productCode": "KENDOUIREACT",
|
|
60
|
-
"publishDate":
|
|
60
|
+
"publishDate": 1776415578,
|
|
61
61
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
62
62
|
}
|
|
63
63
|
},
|