@progress/kendo-react-labels 14.4.0-develop.9 → 14.4.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/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 v=require("react"),e=require("prop-types"),r=require("@progress/kendo-react-common"),i=require("./messages/index.js"),C=require("@progress/kendo-react-intl");function D(l){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const o in l)if(o!=="default"){const t=Object.getOwnPropertyDescriptor(l,o);Object.defineProperty(a,o,t.get?t:{enumerable:!0,get:()=>l[o]})}}return a.default=l,Object.freeze(a)}const n=D(v),u=l=>{const{id:a,editorId:o,editorRef:t,editorDisabled:s,children:c,editorValid:d,style:O,className:b,optional:k}=l,L=C.useLocalization(),p=k?L.toLanguageString(i.labelsOptional,i.messages[i.labelsOptional]):"",N=p&&n.createElement("span",{className:"k-label-optional"},p),m=r.useUnstyled(),f=m&&m.uLabel,R=n.useCallback(y=>{if(t&&t.current&&!s){t.current.focus&&(y.preventDefault(),t.current.focus());const g=t.current.actionElement;g&&(y.preventDefault(),g.click())}},[t]),j=n.useMemo(()=>r.classNames(r.uLabel.label({c:f,empty:!c,invalid:d===!1,disabled:s===!0}),b),[f,c,d,s,b]);return n.createElement("label",{id:a,htmlFor:o,onClick:R,style:O,className:j},c,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;
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;
package/Label.mjs CHANGED
@@ -5,36 +5,41 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as o from "react";
8
+ import * as s from "react";
9
9
  import e from "prop-types";
10
- import { useUnstyled as v, classNames as D, uLabel as R } from "@progress/kendo-react-common";
11
- import { labelsOptional as p, messages as h } from "./messages/index.mjs";
12
- import { useLocalization as z } from "@progress/kendo-react-intl";
13
- const u = (b) => {
14
- const { id: f, editorId: y, editorRef: t, editorDisabled: l, children: a, editorValid: s, style: g, className: i, optional: L } = b, N = z(), n = L ? N.toLanguageString(p, h[p]) : "", k = n && /* @__PURE__ */ o.createElement("span", { className: "k-label-optional" }, n), r = v(), c = r && r.uLabel, C = o.useCallback(
15
- (d) => {
16
- if (t && t.current && !l) {
17
- t.current.focus && (d.preventDefault(), t.current.focus());
18
- const m = t.current.actionElement;
19
- m && (d.preventDefault(), m.click());
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(
15
+ (i) => {
16
+ 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());
21
+ } else if (o) {
22
+ const l = document.getElementById(o);
23
+ l && (i.preventDefault(), l.focus());
24
+ }
20
25
  }
21
26
  },
22
- [t]
23
- ), E = o.useMemo(
27
+ [t, o, a]
28
+ ), v = s.useMemo(
24
29
  () => D(
25
- R.label({
26
- c,
27
- empty: !a,
28
- invalid: s === !1,
29
- disabled: l === !0
30
+ h.label({
31
+ c: p,
32
+ empty: !n,
33
+ invalid: r === !1,
34
+ disabled: a === !0
30
35
  }),
31
- i
36
+ c
32
37
  ),
33
- [c, a, s, l, i]
38
+ [p, n, r, a, c]
34
39
  );
35
- return /* @__PURE__ */ o.createElement("label", { id: f, htmlFor: y, onClick: C, style: g, className: E }, a, k);
40
+ return /* @__PURE__ */ s.createElement("label", { id: y, htmlFor: o, onClick: k, style: g, className: v }, n, N);
36
41
  };
37
- u.propTypes = {
42
+ f.propTypes = {
38
43
  id: e.string,
39
44
  editorId: e.string,
40
45
  editorRef: e.oneOfType([e.func, e.shape({ current: e.any })]),
@@ -44,7 +49,7 @@ u.propTypes = {
44
49
  className: e.string,
45
50
  optional: e.bool
46
51
  };
47
- u.displayName = "KendoReactLabel";
52
+ f.displayName = "KendoReactLabel";
48
53
  export {
49
- u as Label
54
+ f as Label
50
55
  };
@@ -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,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});
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});
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
7
7
  productName: 'KendoReact',
8
8
  productCode: 'KENDOUIREACT',
9
9
  productCodes: ['KENDOUIREACT'],
10
- publishDate: 1776338293,
11
- version: '14.4.0-develop.9',
10
+ publishDate: 1776415578,
11
+ version: '14.4.1-develop.1',
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.0-develop.9",
3
+ "version": "14.4.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",
@@ -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.0-develop.9",
30
- "@progress/kendo-react-intl": "14.4.0-develop.9",
29
+ "@progress/kendo-react-common": "14.4.1-develop.1",
30
+ "@progress/kendo-react-intl": "14.4.1-develop.1",
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": 1776338293,
60
+ "publishDate": 1776415578,
61
61
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
62
62
  }
63
63
  },