@progress/kendo-react-labels 11.0.0-develop.9 → 11.0.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/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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),e=require("prop-types"),i=require("@progress/kendo-react-common"),k=require("@progress/kendo-react-intl"),r=require("./messages/index.js");function v(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const l in t)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(a,l,s.get?s:{enumerable:!0,get:()=>t[l]})}}return a.default=t,Object.freeze(a)}const o=v(_),O=t=>{const[a,l]=o.useState({focused:!1}),s=T=>{l({focused:!0})},F=T=>{l({focused:!1})},{label:c,editorId:d,className:L,labelClassName:S,editorValue:u,editorPlaceholder:h,editorValid:E,editorDisabled:b,style:j,id:m,optional:C,unstyled:g,...P}=t,q=k.useLocalization(),f=C?q.toLanguageString(r.labelsOptional,r.messages[r.labelsOptional]):"",p=f&&o.createElement("span",{className:"k-label-optional"},f),y=g&&g.uFloatingLabel,n=!h&&!u&&u!==0,R=i.classNames(i.uFloatingLabel.wrapper({c:y,focused:a.focused,empty:n,notEmpty:!n,disabled:b,isRtl:t.dir==="rtl"}),L),N=i.classNames(i.uFloatingLabel.label({c:y,focused:a.focused,empty:n,notEmpty:!n,invalid:E===!1,disabled:b}),S);return o.createElement("span",{...P,id:t.id,className:R,onFocus:s,onBlur:F,style:j,dir:t.dir},t.children,c?d?o.createElement("label",{id:m,htmlFor:d,className:N},c,p):o.createElement("span",{id:m,className:N},c,p):null)};O.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};exports.FloatingLabel=O;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),e=require("prop-types"),i=require("@progress/kendo-react-common"),k=require("@progress/kendo-react-intl"),r=require("./messages/index.js");function v(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const l in t)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(a,l,s.get?s:{enumerable:!0,get:()=>t[l]})}}return a.default=t,Object.freeze(a)}const o=v(_),O=t=>{const[a,l]=o.useState({focused:!1}),s=T=>{l({focused:!0})},F=T=>{l({focused:!1})},{label:c,editorId:d,className:L,labelClassName:S,editorValue:u,editorPlaceholder:h,editorValid:E,editorDisabled:b,style:j,id:m,optional:C,unstyled:g,...P}=t,q=k.useLocalization(),f=C?q.toLanguageString(r.labelsOptional,r.messages[r.labelsOptional]):"",p=f&&o.createElement("span",{className:"k-label-optional"},f),y=g&&g.uFloatingLabel,n=!h&&!u&&u!==0,R=i.classNames(i.uFloatingLabel.wrapper({c:y,focused:a.focused,empty:n,notEmpty:!n,disabled:b,isRtl:t.dir==="rtl"}),L),N=i.classNames(i.uFloatingLabel.label({c:y,focused:a.focused,empty:n,notEmpty:!n,invalid:E===!1,disabled:b}),S);return o.createElement("span",{...P,id:t.id,className:R,onFocus:s,onBlur:F,style:j,dir:t.dir},t.children,c?d?o.createElement("label",{id:m,htmlFor:d,className:N},c,p):o.createElement("span",{id:m,className:N},c,p):null)};O.propTypes={label:e.node,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};exports.FloatingLabel=O;
package/FloatingLabel.mjs CHANGED
@@ -11,14 +11,14 @@ import { classNames as g, uFloatingLabel as N } from "@progress/kendo-react-comm
11
11
  import { useLocalization as B } from "@progress/kendo-react-intl";
12
12
  import { labelsOptional as y, messages as D } from "./messages/index.mjs";
13
13
  const I = (l) => {
14
- const [o, i] = a.useState({
14
+ const [s, i] = a.useState({
15
15
  focused: !1
16
16
  }), h = (v) => {
17
17
  i({ focused: !0 });
18
18
  }, E = (v) => {
19
19
  i({ focused: !1 });
20
20
  }, {
21
- label: s,
21
+ label: o,
22
22
  editorId: n,
23
23
  className: F,
24
24
  labelClassName: L,
@@ -34,7 +34,7 @@ const I = (l) => {
34
34
  } = l, P = B(), b = z ? P.toLanguageString(y, D[y]) : "", u = b && /* @__PURE__ */ a.createElement("span", { className: "k-label-optional" }, b), p = m && m.uFloatingLabel, t = !C && !r && r !== 0, T = g(
35
35
  N.wrapper({
36
36
  c: p,
37
- focused: o.focused,
37
+ focused: s.focused,
38
38
  empty: t,
39
39
  notEmpty: !t,
40
40
  disabled: c,
@@ -44,7 +44,7 @@ const I = (l) => {
44
44
  ), f = g(
45
45
  N.label({
46
46
  c: p,
47
- focused: o.focused,
47
+ focused: s.focused,
48
48
  empty: t,
49
49
  notEmpty: !t,
50
50
  invalid: S === !1,
@@ -64,11 +64,11 @@ const I = (l) => {
64
64
  dir: l.dir
65
65
  },
66
66
  l.children,
67
- s ? n ? /* @__PURE__ */ a.createElement("label", { id: d, htmlFor: n, className: f }, s, u) : /* @__PURE__ */ a.createElement("span", { id: d, className: f }, s, u) : null
67
+ o ? n ? /* @__PURE__ */ a.createElement("label", { id: d, htmlFor: n, className: f }, o, u) : /* @__PURE__ */ a.createElement("span", { id: d, className: f }, o, u) : null
68
68
  );
69
69
  };
70
70
  I.propTypes = {
71
- label: e.string,
71
+ label: e.node,
72
72
  editorId: e.string,
73
73
  editorValue: e.oneOfType([e.string, e.bool, e.number]),
74
74
  editorPlaceholder: e.string,
@@ -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,a,o,l){"use strict";function s(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var r=s(t);const i="labels.optional",n={[i]:"(Optional)"},d=e=>{const{id:t,editorId:a,editorRef:s,editorDisabled:d,children:c,editorValid:u,style:p,className:m,optional:b}=e,f=l.useLocalization(),y=b?f.toLanguageString(i,n[i]):"",g=y&&r.createElement("span",{className:"k-label-optional"},y),N=o.useUnstyled(),E=N&&N.uLabel,h=r.useCallback((e=>{if(s&&s.current&&!d){s.current.focus&&(e.preventDefault(),s.current.focus());const t=s.current.actionElement;t&&(e.preventDefault(),t.click())}}),[s]),L=r.useMemo((()=>o.classNames(o.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:a,onClick:h,style:p,className:L},c,g)};d.propTypes={id:a.string,editorId:a.string,editorRef:a.oneOfType([a.func,a.shape({current:a.any})]),editorValid:a.bool,editorDisabled:a.bool,style:a.object,className:a.string,optional:a.bool},d.displayName="KendoReactLabel";const c=e=>{const t={direction:"start",...e},a=o.useUnstyled(),l=a&&a.uError,s=r.useMemo((()=>o.classNames(o.uError.wrapper({c:l,direction:t.direction}),t.className)),[l,t.direction,t.className]);return r.createElement("div",{id:t.id,role:"alert",style:t.style,className:s},t.children)};c.propTypes={id:a.string,direction:a.oneOf(["start","end"]),children:a.oneOfType([a.element,a.node]),style:a.object,className:a.string},c.displayName="KendoReactError";const u=e=>{const t={direction:"start",...e},a=o.useUnstyled(),l=a&&a.uHint,s=r.useMemo((()=>o.classNames(o.uHint.wrapper({c:l,direction:t.direction,disabled:!0===t.editorDisabled}),t.className)),[l,t.direction,t.editorDisabled,t.className]);return r.createElement("div",{id:t.id,style:t.style,className:s},t.children)};u.propTypes={id:a.string,direction:a.oneOf(["start","end"]),children:a.oneOfType([a.element,a.node]),style:a.object,className:a.string,editorDisabled:a.bool},u.displayName="KendoReactHint";const p=e=>{const[t,a]=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=l.useLocalization(),O=N?L.toLanguageString(i,n[i]):"",T=O&&r.createElement("span",{className:"k-label-optional"},O),j=E&&E.uFloatingLabel,k=!m&&!p&&0!==p,D=o.classNames(o.uFloatingLabel.wrapper({c:j,focused:t.focused,empty:k,notEmpty:!k,disabled:f,isRtl:"rtl"===e.dir}),c),R=o.classNames(o.uFloatingLabel.label({c:j,focused:t.focused,empty:k,notEmpty:!k,invalid:!1===b,disabled:f}),u);return r.createElement("span",{...h,id:e.id,className:D,onFocus:e=>{a({focused:!0})},onBlur:e=>{a({focused:!1})},style:y,dir:e.dir},e.children,s?d?r.createElement("label",{id:g,htmlFor:d,className:R},s,T):r.createElement("span",{id:g,className:R},s,T):null)};p.propTypes={label:a.string,editorId:a.string,editorValue:a.oneOfType([a.string,a.bool,a.number]),editorPlaceholder:a.string,editorValid:a.bool,editorDisabled:a.bool,id:a.string,style:a.object,className:a.string,labelClassName:a.string,optional:a.bool},e.Error=c,e.FloatingLabel=p,e.Hint=u,e.Label=d}));
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,l){"use strict";function s(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,a.get?a:{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=l.useLocalization(),y=b?f.toLanguageString(n,i[n]):"",g=y&&r.createElement("span",{className:"k-label-optional"},y),N=a.useUnstyled(),E=N&&N.uLabel,h=r.useCallback((e=>{if(s&&s.current&&!d){s.current.focus&&(e.preventDefault(),s.current.focus());const t=s.current.actionElement;t&&(e.preventDefault(),t.click())}}),[s]),L=r.useMemo((()=>a.classNames(a.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=a.useUnstyled(),l=o&&o.uError,s=r.useMemo((()=>a.classNames(a.uError.wrapper({c:l,direction:t.direction}),t.className)),[l,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=a.useUnstyled(),l=o&&o.uHint,s=r.useMemo((()=>a.classNames(a.uHint.wrapper({c:l,direction:t.direction,disabled:!0===t.editorDisabled}),t.className)),[l,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=l.useLocalization(),O=N?L.toLanguageString(n,i[n]):"",T=O&&r.createElement("span",{className:"k-label-optional"},O),j=E&&E.uFloatingLabel,k=!m&&!p&&0!==p,D=a.classNames(a.uFloatingLabel.wrapper({c:j,focused:t.focused,empty:k,notEmpty:!k,disabled:f,isRtl:"rtl"===e.dir}),c),R=a.classNames(a.uFloatingLabel.label({c:j,focused:t.focused,empty:k,notEmpty:!k,invalid:!1===b,disabled:f}),u);return r.createElement("span",{...h,id:e.id,className:D,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:R},s,T):r.createElement("span",{id:g,className:R},s,T):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/index.d.mts CHANGED
@@ -90,7 +90,7 @@ export declare interface ErrorProps {
90
90
  export declare const FloatingLabel: {
91
91
  (props: FloatingLabelProps): JSX.Element;
92
92
  propTypes: {
93
- label: default_2.Requireable<string>;
93
+ label: default_2.Requireable<default_2.ReactNodeLike>;
94
94
  editorId: default_2.Requireable<string>;
95
95
  editorValue: default_2.Requireable<NonNullable<string | number | boolean | null | undefined>>;
96
96
  editorPlaceholder: default_2.Requireable<string>;
@@ -131,7 +131,7 @@ export declare interface FloatingLabelProps extends KendoReactComponentBaseProps
131
131
  /**
132
132
  * Adds a floating label that describes the editor.
133
133
  */
134
- label?: string;
134
+ label?: React_2.ReactNode;
135
135
  /**
136
136
  * The styles that are applied to the FloatingLabel.
137
137
  */
package/index.d.ts CHANGED
@@ -90,7 +90,7 @@ export declare interface ErrorProps {
90
90
  export declare const FloatingLabel: {
91
91
  (props: FloatingLabelProps): JSX.Element;
92
92
  propTypes: {
93
- label: default_2.Requireable<string>;
93
+ label: default_2.Requireable<default_2.ReactNodeLike>;
94
94
  editorId: default_2.Requireable<string>;
95
95
  editorValue: default_2.Requireable<NonNullable<string | number | boolean | null | undefined>>;
96
96
  editorPlaceholder: default_2.Requireable<string>;
@@ -131,7 +131,7 @@ export declare interface FloatingLabelProps extends KendoReactComponentBaseProps
131
131
  /**
132
132
  * Adds a floating label that describes the editor.
133
133
  */
134
- label?: string;
134
+ label?: React_2.ReactNode;
135
135
  /**
136
136
  * The styles that are applied to the FloatingLabel.
137
137
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-labels",
3
- "version": "11.0.0-develop.9",
3
+ "version": "11.0.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",
@@ -25,9 +25,9 @@
25
25
  },
26
26
  "sideEffects": false,
27
27
  "peerDependencies": {
28
- "@progress/kendo-licensing": "^1.5.1",
29
- "@progress/kendo-react-common": "11.0.0-develop.9",
30
- "@progress/kendo-react-intl": "11.0.0-develop.9",
28
+ "@progress/kendo-licensing": "^1.6.0",
29
+ "@progress/kendo-react-common": "11.0.1-develop.1",
30
+ "@progress/kendo-react-intl": "11.0.1-develop.1",
31
31
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
32
32
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
33
33
  },