@progress/kendo-react-labels 14.4.1-develop.1 → 14.4.1-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/Label.js +1 -1
- package/Label.mjs +24 -23
- package/dist/cdn/js/kendo-react-labels.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +4 -4
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
|
|
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
|
|
11
|
-
import { labelsOptional as
|
|
12
|
-
import { useLocalization as
|
|
13
|
-
const
|
|
14
|
-
const { id:
|
|
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 (
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
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
|
|
23
|
-
|
|
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
|
-
[
|
|
28
|
-
),
|
|
29
|
-
() =>
|
|
30
|
-
|
|
31
|
-
c:
|
|
28
|
+
[l, o, a]
|
|
29
|
+
), h = s.useMemo(
|
|
30
|
+
() => E(
|
|
31
|
+
I.label({
|
|
32
|
+
c: u,
|
|
32
33
|
empty: !n,
|
|
33
|
-
invalid:
|
|
34
|
+
invalid: c === !1,
|
|
34
35
|
disabled: a === !0
|
|
35
36
|
}),
|
|
36
|
-
|
|
37
|
+
r
|
|
37
38
|
),
|
|
38
|
-
[
|
|
39
|
+
[u, n, c, a, r]
|
|
39
40
|
);
|
|
40
|
-
return /* @__PURE__ */ s.createElement("label", { id:
|
|
41
|
+
return /* @__PURE__ */ s.createElement("label", { id: L, htmlFor: o, onClick: D, style: N, className: h }, n, C);
|
|
41
42
|
};
|
|
42
|
-
|
|
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
|
-
|
|
53
|
+
y.displayName = "KendoReactLabel";
|
|
53
54
|
export {
|
|
54
|
-
|
|
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,
|
|
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});
|
package/package-metadata.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
|
|
|
7
7
|
productName: 'KendoReact',
|
|
8
8
|
productCode: 'KENDOUIREACT',
|
|
9
9
|
productCodes: ['KENDOUIREACT'],
|
|
10
|
-
publishDate:
|
|
11
|
-
version: '14.4.1-develop.
|
|
10
|
+
publishDate: 1776956184,
|
|
11
|
+
version: '14.4.1-develop.10',
|
|
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.
|
|
3
|
+
"version": "14.4.1-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",
|
|
@@ -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.
|
|
30
|
-
"@progress/kendo-react-intl": "14.4.1-develop.
|
|
29
|
+
"@progress/kendo-react-common": "14.4.1-develop.10",
|
|
30
|
+
"@progress/kendo-react-intl": "14.4.1-develop.10",
|
|
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":
|
|
60
|
+
"publishDate": 1776956184,
|
|
61
61
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
62
62
|
}
|
|
63
63
|
},
|