@progress/kendo-react-labels 11.0.0-develop.2 → 11.0.0-develop.21
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 +1 -1
- package/FloatingLabel.mjs +6 -6
- package/dist/cdn/js/kendo-react-labels.js +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/package.json +4 -4
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.
|
|
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 [
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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.
|
|
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,
|
|
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<
|
|
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?:
|
|
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<
|
|
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?:
|
|
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.
|
|
3
|
+
"version": "11.0.0-develop.21",
|
|
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.
|
|
29
|
-
"@progress/kendo-react-common": "11.0.0-develop.
|
|
30
|
-
"@progress/kendo-react-intl": "11.0.0-develop.
|
|
28
|
+
"@progress/kendo-licensing": "^1.6.0",
|
|
29
|
+
"@progress/kendo-react-common": "11.0.0-develop.21",
|
|
30
|
+
"@progress/kendo-react-intl": "11.0.0-develop.21",
|
|
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
|
},
|