@progress/kendo-react-labels 14.4.1-develop.6 → 14.4.1-develop.8

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 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 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;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),e=require("prop-types"),u=require("@progress/kendo-react-common"),d=require("./messages/index.js"),q=require("@progress/kendo-react-intl");function R(a){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const n in a)if(n!=="default"){const t=Object.getOwnPropertyDescriptor(a,n);Object.defineProperty(o,n,t.get?t:{enumerable:!0,get:()=>a[n]})}}return o.default=a,Object.freeze(o)}const c=R(S),b=a=>{const{id:o,editorId:n,editorRef:t,editorDisabled:s,children:r,editorValid:p,style:L,className:f,optional:N}=a,v=q.useLocalization(),m=N?v.toLanguageString(d.labelsOptional,d.messages[d.labelsOptional]):"",D=m&&c.createElement("span",{className:"k-label-optional"},m),y=u.useUnstyled(),g=y&&y.uLabel,j=c.useCallback(i=>{var O,k;if(!s){if(t!=null&&t.current){t.current.focus&&(i.preventDefault(),t.current.focus());const l=t.current.actionElement;l&&(i.preventDefault(),l.click())}else if(n){const l=document.getElementById(n);l&&(i.preventDefault(),(O=l.focus)==null||O.call(l),(k=l.click)==null||k.call(l))}}},[t,n,s]),C=c.useMemo(()=>u.classNames(u.uLabel.label({c:g,empty:!r,invalid:p===!1,disabled:s===!0}),f),[g,r,p,s,f]);return c.createElement("label",{id:o,htmlFor:n,onClick:j,style:L,className:C},r,D)};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
@@ -7,39 +7,40 @@
7
7
  */
8
8
  import * as s from "react";
9
9
  import e from "prop-types";
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(
10
+ import { useUnstyled as z, classNames as E, uLabel as I } from "@progress/kendo-react-common";
11
+ import { labelsOptional as b, messages as O } from "./messages/index.mjs";
12
+ import { useLocalization as T } from "@progress/kendo-react-intl";
13
+ const y = (g) => {
14
+ const { id: L, editorId: o, editorRef: l, editorDisabled: a, children: n, editorValid: c, style: N, className: r, optional: k } = g, v = T(), m = k ? v.toLanguageString(b, O[b]) : "", C = m && /* @__PURE__ */ s.createElement("span", { className: "k-label-optional" }, m), p = z(), u = p && p.uLabel, D = s.useCallback(
15
15
  (i) => {
16
+ var d, f;
16
17
  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());
18
+ if (l != null && l.current) {
19
+ l.current.focus && (i.preventDefault(), l.current.focus());
20
+ const t = l.current.actionElement;
21
+ t && (i.preventDefault(), t.click());
21
22
  } else if (o) {
22
- const l = document.getElementById(o);
23
- l && (i.preventDefault(), l.focus());
23
+ const t = document.getElementById(o);
24
+ t && (i.preventDefault(), (d = t.focus) == null || d.call(t), (f = t.click) == null || f.call(t));
24
25
  }
25
26
  }
26
27
  },
27
- [t, o, a]
28
- ), v = s.useMemo(
29
- () => D(
30
- h.label({
31
- c: p,
28
+ [l, o, a]
29
+ ), h = s.useMemo(
30
+ () => E(
31
+ I.label({
32
+ c: u,
32
33
  empty: !n,
33
- invalid: r === !1,
34
+ invalid: c === !1,
34
35
  disabled: a === !0
35
36
  }),
36
- c
37
+ r
37
38
  ),
38
- [p, n, r, a, c]
39
+ [u, n, c, a, r]
39
40
  );
40
- return /* @__PURE__ */ s.createElement("label", { id: y, htmlFor: o, onClick: k, style: g, className: v }, n, N);
41
+ return /* @__PURE__ */ s.createElement("label", { id: L, htmlFor: o, onClick: D, style: N, className: h }, n, C);
41
42
  };
42
- f.propTypes = {
43
+ y.propTypes = {
43
44
  id: e.string,
44
45
  editorId: e.string,
45
46
  editorRef: e.oneOfType([e.func, e.shape({ current: e.any })]),
@@ -49,7 +50,7 @@ f.propTypes = {
49
50
  className: e.string,
50
51
  optional: e.bool
51
52
  };
52
- f.displayName = "KendoReactLabel";
53
+ y.displayName = "KendoReactLabel";
53
54
  export {
54
- f as Label
55
+ y as Label
55
56
  };
@@ -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,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});
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,l,a,o){"use strict";function s(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(l){if("default"!==l){var a=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,a.get?a:{enumerable:!0,get:function(){return e[l]}})}}),t.default=e,Object.freeze(t)}var r=s(t);const n="labels.optional",i={[n]:"(Optional)"},c=e=>{const{id:t,editorId:l,editorRef:s,editorDisabled:c,children:d,editorValid:u,style:p,className:m,optional:b}=e,f=o.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=>{var t,a;if(!c)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(l){const o=document.getElementById(l);o&&(e.preventDefault(),null==(t=o.focus)||t.call(o),null==(a=o.click)||a.call(o))}},[s,l,c]),L=r.useMemo(()=>a.classNames(a.uLabel.label({c:E,empty:!d,invalid:!1===u,disabled:!0===c}),m),[E,d,u,c,m]);return r.createElement("label",{id:t,htmlFor:l,onClick:h,style:p,className:L},d,g)};c.propTypes={id:l.string,editorId:l.string,editorRef:l.oneOfType([l.func,l.shape({current:l.any})]),editorValid:l.bool,editorDisabled:l.bool,style:l.object,className:l.string,optional:l.bool},c.displayName="KendoReactLabel";const d=e=>{const t={direction:"start",...e},l=a.useUnstyled(),o=l&&l.uError,s=r.useMemo(()=>a.classNames(a.uError.wrapper({c:o,direction:t.direction}),t.className),[o,t.direction,t.className]);return r.createElement("div",{id:t.id,role:"alert",style:t.style,className:s},t.children)};d.propTypes={id:l.string,direction:l.oneOf(["start","end"]),children:l.oneOfType([l.element,l.node]),style:l.object,className:l.string},d.displayName="KendoReactError";const u=e=>{const t={direction:"start",...e},l=a.useUnstyled(),o=l&&l.uHint,s=r.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 r.createElement("div",{id:t.id,style:t.style,className:s},t.children)};u.propTypes={id:l.string,direction:l.oneOf(["start","end"]),children:l.oneOfType([l.element,l.node]),style:l.object,className:l.string,editorDisabled:l.bool},u.displayName="KendoReactHint";const p=e=>{const[t,l]=r.useState({focused:!1}),{label:s,editorId:c,className:d,labelClassName:u,editorValue:p,editorPlaceholder:m,editorValid:b,editorDisabled:f,style:y,id:g,optional:N,unstyled:E,...h}=e,L=o.useLocalization(),O=N?L.toLanguageString(n,i[n]):"",k=O&&r.createElement("span",{className:"k-label-optional"},O),v=E&&E.uFloatingLabel,D=!m&&!p&&0!==p,T=a.classNames(a.uFloatingLabel.wrapper({c:v,focused:t.focused,empty:D,notEmpty:!D,disabled:f,isRtl:"rtl"===e.dir}),d),j=a.classNames(a.uFloatingLabel.label({c:v,focused:t.focused,empty:D,notEmpty:!D,invalid:!1===b,disabled:f}),u);return r.createElement("span",{...h,id:e.id,className:T,onFocus:e=>{l({focused:!0})},onBlur:e=>{l({focused:!1})},style:y,dir:e.dir},e.children,s?c?r.createElement("label",{id:g,htmlFor:c,className:j},s,k):r.createElement("span",{id:g,className:j},s,k):null)};p.propTypes={label:l.node,editorId:l.string,editorValue:l.oneOfType([l.string,l.bool,l.number]),editorPlaceholder:l.string,editorValid:l.bool,editorDisabled:l.bool,id:l.string,style:l.object,className:l.string,labelClassName:l.string,optional:l.bool},e.Error=d,e.FloatingLabel=p,e.Hint=u,e.Label=c});
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
7
7
  productName: 'KendoReact',
8
8
  productCode: 'KENDOUIREACT',
9
9
  productCodes: ['KENDOUIREACT'],
10
- publishDate: 1776857615,
11
- version: '14.4.1-develop.6',
10
+ publishDate: 1776932732,
11
+ version: '14.4.1-develop.8',
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.1-develop.6",
3
+ "version": "14.4.1-develop.8",
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.1-develop.6",
30
- "@progress/kendo-react-intl": "14.4.1-develop.6",
29
+ "@progress/kendo-react-common": "14.4.1-develop.8",
30
+ "@progress/kendo-react-intl": "14.4.1-develop.8",
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": 1776857615,
60
+ "publishDate": 1776932732,
61
61
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
62
62
  }
63
63
  },