@progress/kendo-react-labels 8.4.0-develop.3 → 8.4.0-develop.4

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 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"),o=require("@progress/kendo-react-common"),N=require("@progress/kendo-react-intl"),c=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 n=Object.getOwnPropertyDescriptor(a,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>a[s]})}}return t.default=a,Object.freeze(t)}const i=L(j),d=class d extends i.Component{constructor(t){super(t),this.state={focused:!1},this.handleFocus=s=>{this.setState({focused:!0})},this.handleBlur=s=>{this.setState({focused:!1})},o.validatePackage(q.packageMetadata)}render(){const{label:t,editorId:s,className:n,labelClassName:O,editorValue:u,editorPlaceholder:S,editorValid:k,editorDisabled:p,style:v,id:b,optional:C,unstyled:m,...E}=this.props,F=N.provideLocalizationService(this),g=C?F.toLanguageString(c.labelsOptional,c.messages[c.labelsOptional]):"",h=g&&i.createElement("span",{className:"k-label-optional"},g),f=m&&m.uFloatingLabel,l=!S&&!u&&u!==0,P=o.classNames(o.uFloatingLabel.wrapper({c:f,focused:this.state.focused,empty:l,notEmpty:!l,disabled:p,isRtl:this.props.dir==="rtl"}),n),y=o.classNames(o.uFloatingLabel.label({c:f,focused:this.state.focused||!l,empty:l,notEmpty:!l,invalid:k===!1,disabled:p}),O);return i.createElement("span",{...E,id:this.props.id,className:P,onFocus:this.handleFocus,onBlur:this.handleBlur,style:v,dir:this.props.dir},this.props.children,t?s?i.createElement("label",{id:b,htmlFor:s,className:y},t,h):i.createElement("span",{id:b,className:y},t,h):null)}};d.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=d;N.registerForLocalization(r);exports.FloatingLabel=r;
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"),c=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),d=class d 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:O,editorValue:u,editorPlaceholder:S,editorValid:k,editorDisabled:p,style:v,id:b,optional:C,unstyled:m,...E}=this.props,F=N.provideLocalizationService(this),g=C?F.toLanguageString(c.labelsOptional,c.messages[c.labelsOptional]):"",h=g&&o.createElement("span",{className:"k-label-optional"},g),f=m&&m.uFloatingLabel,n=!S&&!u&&u!==0,P=l.classNames(l.uFloatingLabel.wrapper({c:f,focused:this.state.focused,empty:n,notEmpty:!n,disabled:p,isRtl:this.props.dir==="rtl"}),i),y=l.classNames(l.uFloatingLabel.label({c:f,focused:this.state.focused,empty:n,notEmpty:!n,invalid:k===!1,disabled:p}),O);return o.createElement("span",{...E,id:this.props.id,className:P,onFocus:this.handleFocus,onBlur:this.handleBlur,style:v,dir:this.props.dir},this.props.children,t?s?o.createElement("label",{id:b,htmlFor:s,className:y},t,h):o.createElement("span",{id:b,className:y},t,h):null)}};d.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=d;N.registerForLocalization(r);exports.FloatingLabel=r;
package/FloatingLabel.mjs CHANGED
@@ -6,19 +6,19 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as a from "react";
9
+ import * as t from "react";
10
10
  import e from "prop-types";
11
11
  import { validatePackage as P, classNames as b, uFloatingLabel as f } from "@progress/kendo-react-common";
12
12
  import { provideLocalizationService as V, registerForLocalization as k } from "@progress/kendo-react-intl";
13
13
  import { labelsOptional as g, messages as B } from "./messages/index.mjs";
14
14
  import { packageMetadata as O } from "./package-metadata.mjs";
15
- const i = class i extends a.Component {
15
+ const i = class i extends t.Component {
16
16
  constructor(s) {
17
17
  super(s), this.state = {
18
18
  focused: !1
19
- }, this.handleFocus = (o) => {
19
+ }, this.handleFocus = (a) => {
20
20
  this.setState({ focused: !0 });
21
- }, this.handleBlur = (o) => {
21
+ }, this.handleBlur = (a) => {
22
22
  this.setState({ focused: !1 });
23
23
  }, P(O);
24
24
  }
@@ -26,26 +26,26 @@ const i = class i extends a.Component {
26
26
  * @hidden
27
27
  */
28
28
  render() {
29
- const { label: s, editorId: o, className: N, labelClassName: y, editorValue: r, editorPlaceholder: E, editorValid: C, editorDisabled: n, style: v, id: c, optional: F, unstyled: d, ...S } = this.props, z = V(this), p = F ? z.toLanguageString(g, B[g]) : "", m = p && /* @__PURE__ */ a.createElement("span", { className: "k-label-optional" }, p), u = d && d.uFloatingLabel, t = !E && !r && r !== 0, L = b(f.wrapper(
29
+ const { label: s, editorId: a, className: N, labelClassName: y, editorValue: r, editorPlaceholder: E, editorValid: C, editorDisabled: n, style: v, id: c, optional: F, unstyled: d, ...S } = this.props, z = V(this), p = F ? z.toLanguageString(g, B[g]) : "", m = p && /* @__PURE__ */ t.createElement("span", { className: "k-label-optional" }, p), u = d && d.uFloatingLabel, o = !E && !r && r !== 0, L = b(f.wrapper(
30
30
  {
31
31
  c: u,
32
32
  focused: this.state.focused,
33
- empty: t,
34
- notEmpty: !t,
33
+ empty: o,
34
+ notEmpty: !o,
35
35
  disabled: n,
36
36
  isRtl: this.props.dir === "rtl"
37
37
  }
38
38
  ), N), h = b(f.label(
39
39
  {
40
40
  c: u,
41
- focused: this.state.focused || !t,
42
- empty: t,
43
- notEmpty: !t,
41
+ focused: this.state.focused,
42
+ empty: o,
43
+ notEmpty: !o,
44
44
  invalid: C === !1,
45
45
  disabled: n
46
46
  }
47
47
  ), y);
48
- return /* @__PURE__ */ a.createElement(
48
+ return /* @__PURE__ */ t.createElement(
49
49
  "span",
50
50
  {
51
51
  ...S,
@@ -57,7 +57,7 @@ const i = class i extends a.Component {
57
57
  dir: this.props.dir
58
58
  },
59
59
  this.props.children,
60
- s ? o ? /* @__PURE__ */ a.createElement("label", { id: c, htmlFor: o, className: h }, s, m) : /* @__PURE__ */ a.createElement("span", { id: c, className: h }, s, m) : null
60
+ s ? a ? /* @__PURE__ */ t.createElement("label", { id: c, htmlFor: a, className: h }, s, m) : /* @__PURE__ */ t.createElement("span", { id: c, className: h }, s, m) : null
61
61
  );
62
62
  }
63
63
  };
@@ -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,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:y}=e,f=o.useLocalization(),g=y?f.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:y,unstyled:f,...g}=this.props,h=o.provideLocalizationService(this),N=y?h.toLanguageString(i,n[i]):"",E=N&&l.createElement("span",{className:"k-label-optional"},N),k=f&&f.uFloatingLabel,v=!d&&!c&&0!==c,O=a.classNames(a.uFloatingLabel.wrapper({c:k,focused:this.state.focused,empty:v,notEmpty:!v,disabled:u,isRtl:"rtl"===this.props.dir}),s),L=a.classNames(a.uFloatingLabel.label({c:k,focused:this.state.focused||!v,empty:v,notEmpty:!v,invalid:!1===p,disabled:u}),r);return l.createElement("span",{...g,id:this.props.id,className:O,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:L},e,E):l.createElement("span",{id:b,className:L},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}));
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:y}=e,f=o.useLocalization(),g=y?f.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:y,unstyled:f,...g}=this.props,h=o.provideLocalizationService(this),N=y?h.toLanguageString(i,n[i]):"",E=N&&l.createElement("span",{className:"k-label-optional"},N),k=f&&f.uFloatingLabel,v=!d&&!c&&0!==c,O=a.classNames(a.uFloatingLabel.wrapper({c:k,focused:this.state.focused,empty:v,notEmpty:!v,disabled:u,isRtl:"rtl"===this.props.dir}),s),L=a.classNames(a.uFloatingLabel.label({c:k,focused:this.state.focused,empty:v,notEmpty:!v,invalid:!1===p,disabled:u}),r);return l.createElement("span",{...g,id:this.props.id,className:O,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:L},e,E):l.createElement("span",{id:b,className:L},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}));
@@ -10,7 +10,7 @@ const e = {
10
10
  name: "@progress/kendo-react-labels",
11
11
  productName: "KendoReact",
12
12
  productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
13
- publishDate: 1727193715,
13
+ publishDate: 1727785045,
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.4.0-develop.3",
3
+ "version": "8.4.0-develop.4",
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.4.0-develop.3",
27
- "@progress/kendo-react-intl": "8.4.0-develop.3",
26
+ "@progress/kendo-react-common": "8.4.0-develop.4",
27
+ "@progress/kendo-react-intl": "8.4.0-develop.4",
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
  },