@progress/kendo-react-labels 7.3.0 → 7.4.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/FloatingLabel.js +1 -1
- package/FloatingLabel.mjs +9 -8
- package/dist/cdn/js/kendo-react-labels.js +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/package-metadata.mjs +1 -1
- package/package.json +3 -3
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 q=require("react"),e=require("prop-types"),i=require("@progress/kendo-react-common"),g=require("@progress/kendo-react-intl"),n=require("./messages/index.js"),v=require("./package-metadata.js");function C(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const s in a)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(a,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>a[s]})}}return t.default=a,Object.freeze(t)}const l=C(q),c=class c extends l.Component{constructor(t){super(t),this.state={focused:!1},this.handleFocus=s=>{this.setState({focused:!0})},this.handleBlur=s=>{this.setState({focused:!1})},i.validatePackage(v.packageMetadata)}render(){const{label:t,editorId:s,className:o,labelClassName:f,editorValue:d,editorPlaceholder:k,editorValid:N,editorDisabled:u,style:y,id:p,optional:O,...S}=this.props,P=g.provideLocalizationService(this),m=O?P.toLanguageString(n.labelsOptional,n.messages[n.labelsOptional]):"",b=m&&l.createElement("span",{className:"k-label-optional"},m),j=i.classNames({"k-floating-label-container":!0,"k-focus":this.state.focused,"k-empty":!k&&!d&&d!==0,"k-text-disabled":u,"k-rtl":this.props.dir==="rtl"},o),h=i.classNames({"k-label":!0,"k-text-error":N===!1,"k-text-disabled":u},f);return l.createElement("span",{...S,id:this.props.id,className:j,onFocus:this.handleFocus,onBlur:this.handleBlur,style:y,dir:this.props.dir},this.props.children,t?s?l.createElement("label",{id:p,htmlFor:s,className:h},t,b):l.createElement("span",{id:p,className:h},t,b):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;g.registerForLocalization(r);exports.FloatingLabel=r;
|
package/FloatingLabel.mjs
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as s from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { validatePackage as
|
|
12
|
-
import { provideLocalizationService as
|
|
13
|
-
import { labelsOptional as h, messages as
|
|
14
|
-
import { packageMetadata as
|
|
11
|
+
import { validatePackage as E, classNames as m } from "@progress/kendo-react-common";
|
|
12
|
+
import { provideLocalizationService as S, registerForLocalization as v } from "@progress/kendo-react-intl";
|
|
13
|
+
import { labelsOptional as h, messages as z } from "./messages/index.mjs";
|
|
14
|
+
import { packageMetadata as P } from "./package-metadata.mjs";
|
|
15
15
|
const l = class l extends s.Component {
|
|
16
16
|
constructor(t) {
|
|
17
17
|
super(t), this.state = {
|
|
@@ -20,13 +20,13 @@ const l = class l extends s.Component {
|
|
|
20
20
|
this.setState({ focused: !0 });
|
|
21
21
|
}, this.handleBlur = (a) => {
|
|
22
22
|
this.setState({ focused: !1 });
|
|
23
|
-
},
|
|
23
|
+
}, E(P);
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* @hidden
|
|
27
27
|
*/
|
|
28
28
|
render() {
|
|
29
|
-
const { label: t, editorId: a, className: u, labelClassName: b, editorValue: r, editorPlaceholder: f, editorValid: g, editorDisabled: i, style: k, id: n, optional: N } = this.props,
|
|
29
|
+
const { label: t, editorId: a, className: u, labelClassName: b, editorValue: r, editorPlaceholder: f, editorValid: g, editorDisabled: i, style: k, id: n, optional: N, ...y } = this.props, x = S(this), c = N ? x.toLanguageString(h, z[h]) : "", d = c && /* @__PURE__ */ s.createElement("span", { className: "k-label-optional" }, c), C = m(
|
|
30
30
|
{
|
|
31
31
|
"k-floating-label-container": !0,
|
|
32
32
|
"k-focus": this.state.focused,
|
|
@@ -46,8 +46,9 @@ const l = class l extends s.Component {
|
|
|
46
46
|
return /* @__PURE__ */ s.createElement(
|
|
47
47
|
"span",
|
|
48
48
|
{
|
|
49
|
+
...y,
|
|
49
50
|
id: this.props.id,
|
|
50
|
-
className:
|
|
51
|
+
className: C,
|
|
51
52
|
onFocus: this.handleFocus,
|
|
52
53
|
onBlur: this.handleBlur,
|
|
53
54
|
style: k,
|
|
@@ -72,7 +73,7 @@ l.propTypes = {
|
|
|
72
73
|
optional: e.bool
|
|
73
74
|
};
|
|
74
75
|
let o = l;
|
|
75
|
-
|
|
76
|
+
v(o);
|
|
76
77
|
export {
|
|
77
78
|
o as FloatingLabel
|
|
78
79
|
};
|
|
@@ -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,r,a){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var l=o(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=>{r.validatePackage(c);const{id:t,editorId:s,editorRef:o,editorDisabled:d,children:p,editorValid:m,style:u,className:b,optional:f}=e,g=a.useLocalization(),y=f?g.toLanguageString(i,n[i]):"",h=y&&l.createElement("span",{className:"k-label-optional"},y),k=l.useCallback((e=>{if(o&&o.current&&!d){o.current.focus&&(e.preventDefault(),o.current.focus());const t=o.current.actionElement;t&&(e.preventDefault(),t.click())}}),[o]),N=r.classNames({"k-label":!0,"k-label-empty":!p,"k-text-error":!1===m,"k-text-disabled":!0===d},b);return l.createElement("label",{id:t,htmlFor:s,onClick:k,style:u,className:N},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};r.validatePackage(c);const s=r.classNames({"k-form-error":!0,"k-text-start":"start"===t.direction,"k-text-end":"end"===t.direction},t.className);return l.createElement("div",{id:t.id,role:"alert",style:t.style,className:s},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 m=e=>{const t={direction:"start",...e};r.validatePackage(c);const s=r.classNames({"k-form-hint":!0,"k-text-start":"start"===t.direction,"k-text-end":"end"===t.direction,"k-text-disabled":!0===t.editorDisabled},t.className);return l.createElement("div",{id:t.id,style:t.style,className:s},t.children)};m.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},m.displayName="KendoReactHint";const u=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})},r.validatePackage(c)}render(){const{label:e,editorId:t,className:s,labelClassName:o,editorValue:c,editorPlaceholder:d,editorValid:p,editorDisabled:m,style:u,id:b,optional:f}=this.props,
|
|
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,r,a){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var l=o(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=>{r.validatePackage(c);const{id:t,editorId:s,editorRef:o,editorDisabled:d,children:p,editorValid:m,style:u,className:b,optional:f}=e,g=a.useLocalization(),y=f?g.toLanguageString(i,n[i]):"",h=y&&l.createElement("span",{className:"k-label-optional"},y),k=l.useCallback((e=>{if(o&&o.current&&!d){o.current.focus&&(e.preventDefault(),o.current.focus());const t=o.current.actionElement;t&&(e.preventDefault(),t.click())}}),[o]),N=r.classNames({"k-label":!0,"k-label-empty":!p,"k-text-error":!1===m,"k-text-disabled":!0===d},b);return l.createElement("label",{id:t,htmlFor:s,onClick:k,style:u,className:N},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};r.validatePackage(c);const s=r.classNames({"k-form-error":!0,"k-text-start":"start"===t.direction,"k-text-end":"end"===t.direction},t.className);return l.createElement("div",{id:t.id,role:"alert",style:t.style,className:s},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 m=e=>{const t={direction:"start",...e};r.validatePackage(c);const s=r.classNames({"k-form-hint":!0,"k-text-start":"start"===t.direction,"k-text-end":"end"===t.direction,"k-text-disabled":!0===t.editorDisabled},t.className);return l.createElement("div",{id:t.id,style:t.style,className:s},t.children)};m.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},m.displayName="KendoReactHint";const u=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})},r.validatePackage(c)}render(){const{label:e,editorId:t,className:s,labelClassName:o,editorValue:c,editorPlaceholder:d,editorValid:p,editorDisabled:m,style:u,id:b,optional:f,...g}=this.props,y=a.provideLocalizationService(this),h=f?y.toLanguageString(i,n[i]):"",k=h&&l.createElement("span",{className:"k-label-optional"},h),N=r.classNames({"k-floating-label-container":!0,"k-focus":this.state.focused,"k-empty":!d&&!c&&0!==c,"k-text-disabled":m,"k-rtl":"rtl"===this.props.dir},s),E=r.classNames({"k-label":!0,"k-text-error":!1===p,"k-text-disabled":m},o);return l.createElement("span",{...g,id:this.props.id,className:N,onFocus:this.handleFocus,onBlur:this.handleBlur,style:u,dir:this.props.dir},this.props.children,e?t?l.createElement("label",{id:b,htmlFor:t,className:E},e,k):l.createElement("span",{id:b,className:E},e,k):null)}};u.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=u;a.registerForLocalization(b),e.Error=p,e.FloatingLabel=b,e.Hint=m,e.Label=d}));
|
package/index.d.mts
CHANGED
|
@@ -123,7 +123,7 @@ export declare class FloatingLabel extends React_2.Component<FloatingLabelProps,
|
|
|
123
123
|
*/
|
|
124
124
|
export declare interface FloatingLabelProps extends KendoReactComponentBaseProps {
|
|
125
125
|
/**
|
|
126
|
-
* Represent the [`htmlFor`](https://
|
|
126
|
+
* Represent the [`htmlFor`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/htmlFor) property, which will be set to the `label` element.
|
|
127
127
|
*/
|
|
128
128
|
editorId?: string;
|
|
129
129
|
/**
|
|
@@ -292,7 +292,7 @@ export declare interface LabelProps {
|
|
|
292
292
|
id?: string;
|
|
293
293
|
/**
|
|
294
294
|
* The id of the editor.
|
|
295
|
-
* Represent the [`htmlFor`](https://
|
|
295
|
+
* Represent the [`htmlFor`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/htmlFor) property, which will be set to the `label` element.
|
|
296
296
|
*/
|
|
297
297
|
editorId?: string;
|
|
298
298
|
/**
|
package/index.d.ts
CHANGED
|
@@ -123,7 +123,7 @@ export declare class FloatingLabel extends React_2.Component<FloatingLabelProps,
|
|
|
123
123
|
*/
|
|
124
124
|
export declare interface FloatingLabelProps extends KendoReactComponentBaseProps {
|
|
125
125
|
/**
|
|
126
|
-
* Represent the [`htmlFor`](https://
|
|
126
|
+
* Represent the [`htmlFor`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/htmlFor) property, which will be set to the `label` element.
|
|
127
127
|
*/
|
|
128
128
|
editorId?: string;
|
|
129
129
|
/**
|
|
@@ -292,7 +292,7 @@ export declare interface LabelProps {
|
|
|
292
292
|
id?: string;
|
|
293
293
|
/**
|
|
294
294
|
* The id of the editor.
|
|
295
|
-
* Represent the [`htmlFor`](https://
|
|
295
|
+
* Represent the [`htmlFor`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/htmlFor) property, which will be set to the `label` element.
|
|
296
296
|
*/
|
|
297
297
|
editorId?: string;
|
|
298
298
|
/**
|
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: 1711700545,
|
|
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": "7.
|
|
3
|
+
"version": "7.4.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": "7.
|
|
27
|
-
"@progress/kendo-react-intl": "7.
|
|
26
|
+
"@progress/kendo-react-common": "7.4.0-develop.10",
|
|
27
|
+
"@progress/kendo-react-intl": "7.4.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
|
},
|