@progress/kendo-react-labels 8.3.0-develop.1 → 8.3.0-develop.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/Error.js +1 -1
- package/Error.mjs +29 -30
- package/FloatingLabel.js +1 -1
- package/FloatingLabel.mjs +31 -33
- package/Hint.js +1 -1
- package/Hint.mjs +30 -31
- package/Label.js +1 -1
- package/Label.mjs +28 -28
- package/dist/cdn/js/kendo-react-labels.js +1 -1
- package/index.d.mts +17 -0
- package/index.d.ts +17 -0
- package/package-metadata.mjs +1 -1
- package/package.json +3 -3
package/Error.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),o=require("prop-types"),n=require("@progress/kendo-react-common"),d=require("./package-metadata.js");function u(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const c=u(l),s=t=>{const e={direction:"start",...t};n.validatePackage(d.packageMetadata);const r=n.useUnstyled(),a=r&&r.uError,i=c.useMemo(()=>n.classNames(n.uError.wrapper({c:a,direction:e.direction}),e.className),[a,e.direction,e.className]);return c.createElement("div",{id:e.id,role:"alert",style:e.style,className:i},e.children)};s.propTypes={id:o.string,direction:o.oneOf(["start","end"]),children:o.oneOfType([o.element,o.node]),style:o.object,className:o.string};s.displayName="KendoReactError";exports.Error=s;
|
package/Error.mjs
CHANGED
|
@@ -6,46 +6,45 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import { validatePackage as
|
|
12
|
-
import { packageMetadata as
|
|
13
|
-
const
|
|
14
|
-
const
|
|
9
|
+
import * as o from "react";
|
|
10
|
+
import r from "prop-types";
|
|
11
|
+
import { validatePackage as n, useUnstyled as l, classNames as d, uError as m } from "@progress/kendo-react-common";
|
|
12
|
+
import { packageMetadata as p } from "./package-metadata.mjs";
|
|
13
|
+
const a = (c) => {
|
|
14
|
+
const e = {
|
|
15
15
|
direction: "start",
|
|
16
|
-
...
|
|
16
|
+
...c
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
r.className
|
|
18
|
+
n(p);
|
|
19
|
+
const s = l(), t = s && s.uError, i = o.useMemo(
|
|
20
|
+
() => d(m.wrapper({
|
|
21
|
+
c: t,
|
|
22
|
+
direction: e.direction
|
|
23
|
+
}), e.className),
|
|
24
|
+
[t, e.direction, e.className]
|
|
26
25
|
);
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ o.createElement(
|
|
28
27
|
"div",
|
|
29
28
|
{
|
|
30
|
-
id:
|
|
29
|
+
id: e.id,
|
|
31
30
|
role: "alert",
|
|
32
|
-
style:
|
|
33
|
-
className:
|
|
31
|
+
style: e.style,
|
|
32
|
+
className: i
|
|
34
33
|
},
|
|
35
|
-
|
|
34
|
+
e.children
|
|
36
35
|
);
|
|
37
36
|
};
|
|
38
|
-
|
|
39
|
-
id:
|
|
40
|
-
direction:
|
|
41
|
-
children:
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
a.propTypes = {
|
|
38
|
+
id: r.string,
|
|
39
|
+
direction: r.oneOf(["start", "end"]),
|
|
40
|
+
children: r.oneOfType([
|
|
41
|
+
r.element,
|
|
42
|
+
r.node
|
|
44
43
|
]),
|
|
45
|
-
style:
|
|
46
|
-
className:
|
|
44
|
+
style: r.object,
|
|
45
|
+
className: r.string
|
|
47
46
|
};
|
|
48
|
-
|
|
47
|
+
a.displayName = "KendoReactError";
|
|
49
48
|
export {
|
|
50
|
-
|
|
49
|
+
a as Error
|
|
51
50
|
};
|
package/FloatingLabel.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),e=require("prop-types"),l=require("@progress/kendo-react-common"),N=require("@progress/kendo-react-intl"),n=require("./messages/index.js"),q=require("./package-metadata.js");function L(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const s in a)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(a,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>a[s]})}}return t.default=a,Object.freeze(t)}const o=L(j),c=class c extends o.Component{constructor(t){super(t),this.state={focused:!1},this.handleFocus=s=>{this.setState({focused:!0})},this.handleBlur=s=>{this.setState({focused:!1})},l.validatePackage(q.packageMetadata)}render(){const{label:t,editorId:s,className:i,labelClassName:y,editorValue:d,editorPlaceholder:O,editorValid:S,editorDisabled:u,style:k,id:p,optional:v,unstyled:b,...C}=this.props,F=N.provideLocalizationService(this),m=v?F.toLanguageString(n.labelsOptional,n.messages[n.labelsOptional]):"",g=m&&o.createElement("span",{className:"k-label-optional"},m),h=b&&b.uFloatingLabel,P=l.classNames(l.uFloatingLabel.wrapper({c:h,focused:this.state.focused,empty:!O&&!d&&d!==0,disabled:u,isRtl:this.props.dir==="rtl"}),i),f=l.classNames(l.uFloatingLabel.label({c:h,invalid:S===!1,disabled:u}),y);return o.createElement("span",{...C,id:this.props.id,className:P,onFocus:this.handleFocus,onBlur:this.handleBlur,style:k,dir:this.props.dir},this.props.children,t?s?o.createElement("label",{id:p,htmlFor:s,className:f},t,g):o.createElement("span",{id:p,className:f},t,g):null)}};c.propTypes={label:e.string,editorId:e.string,editorValue:e.oneOfType([e.string,e.bool,e.number]),editorPlaceholder:e.string,editorValid:e.bool,editorDisabled:e.bool,id:e.string,style:e.object,className:e.string,labelClassName:e.string,optional:e.bool};let r=c;N.registerForLocalization(r);exports.FloatingLabel=r;
|
package/FloatingLabel.mjs
CHANGED
|
@@ -6,60 +6,58 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
9
|
+
import * as t from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { validatePackage as
|
|
12
|
-
import { provideLocalizationService as
|
|
13
|
-
import { labelsOptional as
|
|
14
|
-
import { packageMetadata as
|
|
15
|
-
const
|
|
16
|
-
constructor(
|
|
17
|
-
super(
|
|
11
|
+
import { validatePackage as L, classNames as u, uFloatingLabel as b } from "@progress/kendo-react-common";
|
|
12
|
+
import { provideLocalizationService as P, registerForLocalization as V } from "@progress/kendo-react-intl";
|
|
13
|
+
import { labelsOptional as f, messages as k } from "./messages/index.mjs";
|
|
14
|
+
import { packageMetadata as B } from "./package-metadata.mjs";
|
|
15
|
+
const o = class o extends t.Component {
|
|
16
|
+
constructor(s) {
|
|
17
|
+
super(s), this.state = {
|
|
18
18
|
focused: !1
|
|
19
19
|
}, this.handleFocus = (a) => {
|
|
20
20
|
this.setState({ focused: !0 });
|
|
21
21
|
}, this.handleBlur = (a) => {
|
|
22
22
|
this.setState({ focused: !1 });
|
|
23
|
-
},
|
|
23
|
+
}, L(B);
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* @hidden
|
|
27
27
|
*/
|
|
28
28
|
render() {
|
|
29
|
-
const { label:
|
|
29
|
+
const { label: s, editorId: a, className: g, labelClassName: N, editorValue: i, editorPlaceholder: y, editorValid: C, editorDisabled: r, style: v, id: n, optional: E, unstyled: d, ...F } = this.props, S = P(this), c = E ? S.toLanguageString(f, k[f]) : "", p = c && /* @__PURE__ */ t.createElement("span", { className: "k-label-optional" }, c), m = d && d.uFloatingLabel, z = u(b.wrapper(
|
|
30
30
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
), p = m(
|
|
31
|
+
c: m,
|
|
32
|
+
focused: this.state.focused,
|
|
33
|
+
empty: !y && !i && i !== 0,
|
|
34
|
+
disabled: r,
|
|
35
|
+
isRtl: this.props.dir === "rtl"
|
|
36
|
+
}
|
|
37
|
+
), g), h = u(b.label(
|
|
39
38
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return /* @__PURE__ */ s.createElement(
|
|
39
|
+
c: m,
|
|
40
|
+
invalid: C === !1,
|
|
41
|
+
disabled: r
|
|
42
|
+
}
|
|
43
|
+
), N);
|
|
44
|
+
return /* @__PURE__ */ t.createElement(
|
|
47
45
|
"span",
|
|
48
46
|
{
|
|
49
|
-
...
|
|
47
|
+
...F,
|
|
50
48
|
id: this.props.id,
|
|
51
|
-
className:
|
|
49
|
+
className: z,
|
|
52
50
|
onFocus: this.handleFocus,
|
|
53
51
|
onBlur: this.handleBlur,
|
|
54
|
-
style:
|
|
52
|
+
style: v,
|
|
55
53
|
dir: this.props.dir
|
|
56
54
|
},
|
|
57
55
|
this.props.children,
|
|
58
|
-
|
|
56
|
+
s ? a ? /* @__PURE__ */ t.createElement("label", { id: n, htmlFor: a, className: h }, s, p) : /* @__PURE__ */ t.createElement("span", { id: n, className: h }, s, p) : null
|
|
59
57
|
);
|
|
60
58
|
}
|
|
61
59
|
};
|
|
62
|
-
|
|
60
|
+
o.propTypes = {
|
|
63
61
|
label: e.string,
|
|
64
62
|
editorId: e.string,
|
|
65
63
|
editorValue: e.oneOfType([e.string, e.bool, e.number]),
|
|
@@ -72,8 +70,8 @@ l.propTypes = {
|
|
|
72
70
|
labelClassName: e.string,
|
|
73
71
|
optional: e.bool
|
|
74
72
|
};
|
|
75
|
-
let
|
|
76
|
-
|
|
73
|
+
let l = o;
|
|
74
|
+
V(l);
|
|
77
75
|
export {
|
|
78
|
-
|
|
76
|
+
l as FloatingLabel
|
|
79
77
|
};
|
package/Hint.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),t=require("prop-types"),i=require("@progress/kendo-react-common"),l=require("./package-metadata.js");function u(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const a in n)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(n,a);Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>n[a]})}}return e.default=n,Object.freeze(e)}const o=u(d),r=n=>{const e={direction:"start",...n};i.validatePackage(l.packageMetadata);const a=i.useUnstyled(),s=a&&a.uHint,c=o.useMemo(()=>i.classNames(i.uHint.wrapper({c:s,direction:e.direction,disabled:e.editorDisabled===!0}),e.className),[s,e.direction,e.editorDisabled,e.className]);return o.createElement("div",{id:e.id,style:e.style,className:c},e.children)};r.propTypes={id:t.string,direction:t.oneOf(["start","end"]),children:t.oneOfType([t.element,t.node]),style:t.object,className:t.string,editorDisabled:t.bool};r.displayName="KendoReactHint";exports.Hint=r;
|
package/Hint.mjs
CHANGED
|
@@ -6,47 +6,46 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import { validatePackage as
|
|
12
|
-
import { packageMetadata as
|
|
13
|
-
const
|
|
14
|
-
const
|
|
9
|
+
import * as a from "react";
|
|
10
|
+
import t from "prop-types";
|
|
11
|
+
import { validatePackage as d, useUnstyled as c, classNames as l, uHint as m } from "@progress/kendo-react-common";
|
|
12
|
+
import { packageMetadata as p } from "./package-metadata.mjs";
|
|
13
|
+
const o = (n) => {
|
|
14
|
+
const e = {
|
|
15
15
|
direction: "start",
|
|
16
|
-
...
|
|
16
|
+
...n
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
const r =
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
t.className
|
|
18
|
+
d(p);
|
|
19
|
+
const s = c(), i = s && s.uHint, r = a.useMemo(
|
|
20
|
+
() => l(m.wrapper({
|
|
21
|
+
c: i,
|
|
22
|
+
direction: e.direction,
|
|
23
|
+
disabled: e.editorDisabled === !0
|
|
24
|
+
}), e.className),
|
|
25
|
+
[i, e.direction, e.editorDisabled, e.className]
|
|
27
26
|
);
|
|
28
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ a.createElement(
|
|
29
28
|
"div",
|
|
30
29
|
{
|
|
31
|
-
id:
|
|
32
|
-
style:
|
|
30
|
+
id: e.id,
|
|
31
|
+
style: e.style,
|
|
33
32
|
className: r
|
|
34
33
|
},
|
|
35
|
-
|
|
34
|
+
e.children
|
|
36
35
|
);
|
|
37
36
|
};
|
|
38
|
-
|
|
39
|
-
id:
|
|
40
|
-
direction:
|
|
41
|
-
children:
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
o.propTypes = {
|
|
38
|
+
id: t.string,
|
|
39
|
+
direction: t.oneOf(["start", "end"]),
|
|
40
|
+
children: t.oneOfType([
|
|
41
|
+
t.element,
|
|
42
|
+
t.node
|
|
44
43
|
]),
|
|
45
|
-
style:
|
|
46
|
-
className:
|
|
47
|
-
editorDisabled:
|
|
44
|
+
style: t.object,
|
|
45
|
+
className: t.string,
|
|
46
|
+
editorDisabled: t.bool
|
|
48
47
|
};
|
|
49
|
-
|
|
48
|
+
o.displayName = "KendoReactHint";
|
|
50
49
|
export {
|
|
51
|
-
|
|
50
|
+
o as Hint
|
|
52
51
|
};
|
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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),e=require("prop-types"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),e=require("prop-types"),n=require("@progress/kendo-react-common"),i=require("./messages/index.js"),q=require("@progress/kendo-react-intl"),C=require("./package-metadata.js");function D(a){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const l in a)if(l!=="default"){const t=Object.getOwnPropertyDescriptor(a,l);Object.defineProperty(o,l,t.get?t:{enumerable:!0,get:()=>a[l]})}}return o.default=a,Object.freeze(o)}const c=D(j),u=a=>{n.validatePackage(C.packageMetadata);const{id:o,editorId:l,editorRef:t,editorDisabled:s,children:r,editorValid:d,style:k,className:b,optional:O}=a,L=q.useLocalization(),p=O?L.toLanguageString(i.labelsOptional,i.messages[i.labelsOptional]):"",N=p&&c.createElement("span",{className:"k-label-optional"},p),m=n.useUnstyled(),f=m&&m.uLabel,v=c.useCallback(g=>{if(t&&t.current&&!s){t.current.focus&&(g.preventDefault(),t.current.focus());const y=t.current.actionElement;y&&(g.preventDefault(),y.click())}},[t]),R=c.useMemo(()=>n.classNames(n.uLabel.label({c:f,empty:!r,invalid:d===!1,disabled:s===!0}),b),[f,r,d,s,b]);return c.createElement("label",{id:o,htmlFor:l,onClick:v,style:k,className:R},r,N)};u.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};u.displayName="KendoReactLabel";exports.Label=u;
|
package/Label.mjs
CHANGED
|
@@ -8,44 +8,44 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as a from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { validatePackage as
|
|
12
|
-
import { labelsOptional as
|
|
13
|
-
import { useLocalization as
|
|
14
|
-
import { packageMetadata as
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const { id:
|
|
18
|
-
(
|
|
11
|
+
import { validatePackage as E, useUnstyled as D, classNames as R, uLabel as h } from "@progress/kendo-react-common";
|
|
12
|
+
import { labelsOptional as p, messages as z } from "./messages/index.mjs";
|
|
13
|
+
import { useLocalization as O } from "@progress/kendo-react-intl";
|
|
14
|
+
import { packageMetadata as T } from "./package-metadata.mjs";
|
|
15
|
+
const u = (b) => {
|
|
16
|
+
E(T);
|
|
17
|
+
const { id: f, editorId: y, editorRef: t, editorDisabled: o, children: l, editorValid: s, style: g, className: i, optional: k } = b, L = O(), n = k ? L.toLanguageString(p, z[p]) : "", N = n && /* @__PURE__ */ a.createElement("span", { className: "k-label-optional" }, n), r = D(), c = r && r.uLabel, v = a.useCallback(
|
|
18
|
+
(d) => {
|
|
19
19
|
if (t && t.current && !o) {
|
|
20
|
-
t.current.focus && (
|
|
21
|
-
const
|
|
22
|
-
|
|
20
|
+
t.current.focus && (d.preventDefault(), t.current.focus());
|
|
21
|
+
const m = t.current.actionElement;
|
|
22
|
+
m && (d.preventDefault(), m.click());
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
[t]
|
|
26
|
-
),
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
26
|
+
), C = a.useMemo(
|
|
27
|
+
() => R(h.label({
|
|
28
|
+
c,
|
|
29
|
+
empty: !l,
|
|
30
|
+
invalid: s === !1,
|
|
31
|
+
disabled: o === !0
|
|
32
|
+
}), i),
|
|
33
|
+
[c, l, s, o, i]
|
|
34
34
|
);
|
|
35
35
|
return /* @__PURE__ */ a.createElement(
|
|
36
36
|
"label",
|
|
37
37
|
{
|
|
38
|
-
id:
|
|
39
|
-
htmlFor:
|
|
40
|
-
onClick:
|
|
41
|
-
style:
|
|
42
|
-
className:
|
|
38
|
+
id: f,
|
|
39
|
+
htmlFor: y,
|
|
40
|
+
onClick: v,
|
|
41
|
+
style: g,
|
|
42
|
+
className: C
|
|
43
43
|
},
|
|
44
44
|
l,
|
|
45
|
-
|
|
45
|
+
N
|
|
46
46
|
);
|
|
47
47
|
};
|
|
48
|
-
|
|
48
|
+
u.propTypes = {
|
|
49
49
|
id: e.string,
|
|
50
50
|
editorId: e.string,
|
|
51
51
|
editorRef: e.oneOfType([
|
|
@@ -58,7 +58,7 @@ c.propTypes = {
|
|
|
58
58
|
className: e.string,
|
|
59
59
|
optional: e.bool
|
|
60
60
|
};
|
|
61
|
-
|
|
61
|
+
u.displayName = "KendoReactLabel";
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
u as Label
|
|
64
64
|
};
|
|
@@ -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
|
-
!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,s,a,
|
|
8
|
+
!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,s,a,o){"use strict";function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var l=r(t);const i="labels.optional",n={[i]:"(Optional)"},c={name:"@progress/kendo-react-labels",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},d=e=>{a.validatePackage(c);const{id:t,editorId:s,editorRef:r,editorDisabled:d,children:p,editorValid:u,style:m,className:b,optional:f}=e,y=o.useLocalization(),g=f?y.toLanguageString(i,n[i]):"",h=g&&l.createElement("span",{className:"k-label-optional"},g),N=a.useUnstyled(),E=N&&N.uLabel,k=l.useCallback((e=>{if(r&&r.current&&!d){r.current.focus&&(e.preventDefault(),r.current.focus());const t=r.current.actionElement;t&&(e.preventDefault(),t.click())}}),[r]),v=l.useMemo((()=>a.classNames(a.uLabel.label({c:E,empty:!p,invalid:!1===u,disabled:!0===d}),b)),[E,p,u,d,b]);return l.createElement("label",{id:t,htmlFor:s,onClick:k,style:m,className:v},p,h)};d.propTypes={id:s.string,editorId:s.string,editorRef:s.oneOfType([s.func,s.shape({current:s.any})]),editorValid:s.bool,editorDisabled:s.bool,style:s.object,className:s.string,optional:s.bool},d.displayName="KendoReactLabel";const p=e=>{const t={direction:"start",...e};a.validatePackage(c);const s=a.useUnstyled(),o=s&&s.uError,r=l.useMemo((()=>a.classNames(a.uError.wrapper({c:o,direction:t.direction}),t.className)),[o,t.direction,t.className]);return l.createElement("div",{id:t.id,role:"alert",style:t.style,className:r},t.children)};p.propTypes={id:s.string,direction:s.oneOf(["start","end"]),children:s.oneOfType([s.element,s.node]),style:s.object,className:s.string},p.displayName="KendoReactError";const u=e=>{const t={direction:"start",...e};a.validatePackage(c);const s=a.useUnstyled(),o=s&&s.uHint,r=l.useMemo((()=>a.classNames(a.uHint.wrapper({c:o,direction:t.direction,disabled:!0===t.editorDisabled}),t.className)),[o,t.direction,t.editorDisabled,t.className]);return l.createElement("div",{id:t.id,style:t.style,className:r},t.children)};u.propTypes={id:s.string,direction:s.oneOf(["start","end"]),children:s.oneOfType([s.element,s.node]),style:s.object,className:s.string,editorDisabled:s.bool},u.displayName="KendoReactHint";const m=class extends l.Component{constructor(e){super(e),this.state={focused:!1},this.handleFocus=e=>{this.setState({focused:!0})},this.handleBlur=e=>{this.setState({focused:!1})},a.validatePackage(c)}render(){const{label:e,editorId:t,className:s,labelClassName:r,editorValue:c,editorPlaceholder:d,editorValid:p,editorDisabled:u,style:m,id:b,optional:f,unstyled:y,...g}=this.props,h=o.provideLocalizationService(this),N=f?h.toLanguageString(i,n[i]):"",E=N&&l.createElement("span",{className:"k-label-optional"},N),k=y&&y.uFloatingLabel,v=a.classNames(a.uFloatingLabel.wrapper({c:k,focused:this.state.focused,empty:!d&&!c&&0!==c,disabled:u,isRtl:"rtl"===this.props.dir}),s),O=a.classNames(a.uFloatingLabel.label({c:k,invalid:!1===p,disabled:u}),r);return l.createElement("span",{...g,id:this.props.id,className:v,onFocus:this.handleFocus,onBlur:this.handleBlur,style:m,dir:this.props.dir},this.props.children,e?t?l.createElement("label",{id:b,htmlFor:t,className:O},e,E):l.createElement("span",{id:b,className:O},e,E):null)}};m.propTypes={label:s.string,editorId:s.string,editorValue:s.oneOfType([s.string,s.bool,s.number]),editorPlaceholder:s.string,editorValid:s.bool,editorDisabled:s.bool,id:s.string,style:s.object,className:s.string,labelClassName:s.string,optional:s.bool};let b=m;o.registerForLocalization(b),e.Error=p,e.FloatingLabel=b,e.Hint=u,e.Label=d}));
|
package/index.d.mts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
9
9
|
import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
|
|
10
|
+
import { LabelsClassStructure } from '@progress/kendo-react-common';
|
|
10
11
|
import PropTypes from 'prop-types';
|
|
11
12
|
import * as React_2 from 'react';
|
|
12
13
|
|
|
@@ -56,6 +57,10 @@ export declare interface ErrorProps {
|
|
|
56
57
|
* Sets a class of the Error DOM element.
|
|
57
58
|
*/
|
|
58
59
|
className?: string;
|
|
60
|
+
/**
|
|
61
|
+
* @hidden
|
|
62
|
+
*/
|
|
63
|
+
unstyled?: LabelsClassStructure;
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
/**
|
|
@@ -172,6 +177,10 @@ export declare interface FloatingLabelProps extends KendoReactComponentBaseProps
|
|
|
172
177
|
* If enabled, marks the label as optional.
|
|
173
178
|
*/
|
|
174
179
|
optional?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* @hidden
|
|
182
|
+
*/
|
|
183
|
+
unstyled?: LabelsClassStructure;
|
|
175
184
|
}
|
|
176
185
|
|
|
177
186
|
/**
|
|
@@ -231,6 +240,10 @@ export declare interface HintProps {
|
|
|
231
240
|
* Specifies if the editor is disabled.
|
|
232
241
|
*/
|
|
233
242
|
editorDisabled?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* @hidden
|
|
245
|
+
*/
|
|
246
|
+
unstyled?: LabelsClassStructure;
|
|
234
247
|
}
|
|
235
248
|
|
|
236
249
|
/**
|
|
@@ -326,6 +339,10 @@ export declare interface LabelProps {
|
|
|
326
339
|
* Sets a class of the Label DOM element.
|
|
327
340
|
*/
|
|
328
341
|
className?: string;
|
|
342
|
+
/**
|
|
343
|
+
* @hidden
|
|
344
|
+
*/
|
|
345
|
+
unstyled?: LabelsClassStructure;
|
|
329
346
|
}
|
|
330
347
|
|
|
331
348
|
export { }
|
package/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
9
9
|
import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
|
|
10
|
+
import { LabelsClassStructure } from '@progress/kendo-react-common';
|
|
10
11
|
import PropTypes from 'prop-types';
|
|
11
12
|
import * as React_2 from 'react';
|
|
12
13
|
|
|
@@ -56,6 +57,10 @@ export declare interface ErrorProps {
|
|
|
56
57
|
* Sets a class of the Error DOM element.
|
|
57
58
|
*/
|
|
58
59
|
className?: string;
|
|
60
|
+
/**
|
|
61
|
+
* @hidden
|
|
62
|
+
*/
|
|
63
|
+
unstyled?: LabelsClassStructure;
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
/**
|
|
@@ -172,6 +177,10 @@ export declare interface FloatingLabelProps extends KendoReactComponentBaseProps
|
|
|
172
177
|
* If enabled, marks the label as optional.
|
|
173
178
|
*/
|
|
174
179
|
optional?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* @hidden
|
|
182
|
+
*/
|
|
183
|
+
unstyled?: LabelsClassStructure;
|
|
175
184
|
}
|
|
176
185
|
|
|
177
186
|
/**
|
|
@@ -231,6 +240,10 @@ export declare interface HintProps {
|
|
|
231
240
|
* Specifies if the editor is disabled.
|
|
232
241
|
*/
|
|
233
242
|
editorDisabled?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* @hidden
|
|
245
|
+
*/
|
|
246
|
+
unstyled?: LabelsClassStructure;
|
|
234
247
|
}
|
|
235
248
|
|
|
236
249
|
/**
|
|
@@ -326,6 +339,10 @@ export declare interface LabelProps {
|
|
|
326
339
|
* Sets a class of the Label DOM element.
|
|
327
340
|
*/
|
|
328
341
|
className?: string;
|
|
342
|
+
/**
|
|
343
|
+
* @hidden
|
|
344
|
+
*/
|
|
345
|
+
unstyled?: LabelsClassStructure;
|
|
329
346
|
}
|
|
330
347
|
|
|
331
348
|
export { }
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-labels",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1724427438,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-labels",
|
|
3
|
-
"version": "8.3.0-develop.
|
|
3
|
+
"version": "8.3.0-develop.10",
|
|
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",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-licensing": "^1.3.4",
|
|
26
|
-
"@progress/kendo-react-common": "8.3.0-develop.
|
|
27
|
-
"@progress/kendo-react-intl": "8.3.0-develop.
|
|
26
|
+
"@progress/kendo-react-common": "8.3.0-develop.10",
|
|
27
|
+
"@progress/kendo-react-intl": "8.3.0-develop.10",
|
|
28
28
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
29
29
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
30
30
|
},
|