@progress/kendo-react-labels 9.0.0-develop.8 → 9.0.0-develop.9
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 +64 -73
- package/dist/cdn/js/kendo-react-labels.js +1 -1
- package/index.d.mts +4 -30
- package/index.d.ts +4 -30
- package/package-metadata.mjs +1 -1
- package/package.json +3 -3
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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),e=require("prop-types"),s=require("@progress/kendo-react-common"),T=require("@progress/kendo-react-intl"),r=require("./messages/index.js"),_=require("./package-metadata.js");function z(t){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(l,a,n.get?n:{enumerable:!0,get:()=>t[a]})}}return l.default=t,Object.freeze(l)}const o=z(R),O=t=>{s.validatePackage(_.packageMetadata);const[l,a]=o.useState({focused:!1}),n=v=>{a({focused:!0})},F=v=>{a({focused:!1})},{label:c,editorId:d,className:L,labelClassName:S,editorValue:u,editorPlaceholder:h,editorValid:k,editorDisabled:b,style:E,id:m,optional:P,unstyled:g,...j}=t,q=T.useLocalization(),p=P?q.toLanguageString(r.labelsOptional,r.messages[r.labelsOptional]):"",f=p&&o.createElement("span",{className:"k-label-optional"},p),y=g&&g.uFloatingLabel,i=!h&&!u&&u!==0,C=s.classNames(s.uFloatingLabel.wrapper({c:y,focused:l.focused,empty:i,notEmpty:!i,disabled:b,isRtl:t.dir==="rtl"}),L),N=s.classNames(s.uFloatingLabel.label({c:y,focused:l.focused,empty:i,notEmpty:!i,invalid:k===!1,disabled:b}),S);return o.createElement("span",{...j,id:t.id,className:C,onFocus:n,onBlur:F,style:E,dir:t.dir},t.children,c?d?o.createElement("label",{id:m,htmlFor:d,className:N},c,f):o.createElement("span",{id:m,className:N},c,f):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;
|
package/FloatingLabel.mjs
CHANGED
|
@@ -6,78 +6,71 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
9
|
+
import * as l from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { validatePackage as
|
|
12
|
-
import {
|
|
13
|
-
import { labelsOptional as
|
|
14
|
-
import { packageMetadata as
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
style: v,
|
|
73
|
-
dir: this.props.dir
|
|
74
|
-
},
|
|
75
|
-
this.props.children,
|
|
76
|
-
s ? a ? /* @__PURE__ */ t.createElement("label", { id: c, htmlFor: a, className: h }, s, m) : /* @__PURE__ */ t.createElement("span", { id: c, className: h }, s, m) : null
|
|
77
|
-
);
|
|
78
|
-
}
|
|
11
|
+
import { validatePackage as T, classNames as g, uFloatingLabel as N } from "@progress/kendo-react-common";
|
|
12
|
+
import { useLocalization as B } from "@progress/kendo-react-intl";
|
|
13
|
+
import { labelsOptional as y, messages as D } from "./messages/index.mjs";
|
|
14
|
+
import { packageMetadata as I } from "./package-metadata.mjs";
|
|
15
|
+
const R = (a) => {
|
|
16
|
+
T(I);
|
|
17
|
+
const [s, i] = l.useState({
|
|
18
|
+
focused: !1
|
|
19
|
+
}), h = (O) => {
|
|
20
|
+
i({ focused: !0 });
|
|
21
|
+
}, E = (O) => {
|
|
22
|
+
i({ focused: !1 });
|
|
23
|
+
}, {
|
|
24
|
+
label: o,
|
|
25
|
+
editorId: n,
|
|
26
|
+
className: F,
|
|
27
|
+
labelClassName: L,
|
|
28
|
+
editorValue: r,
|
|
29
|
+
editorPlaceholder: C,
|
|
30
|
+
editorValid: P,
|
|
31
|
+
editorDisabled: c,
|
|
32
|
+
style: S,
|
|
33
|
+
id: d,
|
|
34
|
+
optional: V,
|
|
35
|
+
unstyled: m,
|
|
36
|
+
...k
|
|
37
|
+
} = a, v = B(), u = V ? v.toLanguageString(y, D[y]) : "", b = u && /* @__PURE__ */ l.createElement("span", { className: "k-label-optional" }, u), p = m && m.uFloatingLabel, t = !C && !r && r !== 0, z = g(
|
|
38
|
+
N.wrapper({
|
|
39
|
+
c: p,
|
|
40
|
+
focused: s.focused,
|
|
41
|
+
empty: t,
|
|
42
|
+
notEmpty: !t,
|
|
43
|
+
disabled: c,
|
|
44
|
+
isRtl: a.dir === "rtl"
|
|
45
|
+
}),
|
|
46
|
+
F
|
|
47
|
+
), f = g(
|
|
48
|
+
N.label({
|
|
49
|
+
c: p,
|
|
50
|
+
focused: s.focused,
|
|
51
|
+
empty: t,
|
|
52
|
+
notEmpty: !t,
|
|
53
|
+
invalid: P === !1,
|
|
54
|
+
disabled: c
|
|
55
|
+
}),
|
|
56
|
+
L
|
|
57
|
+
);
|
|
58
|
+
return /* @__PURE__ */ l.createElement(
|
|
59
|
+
"span",
|
|
60
|
+
{
|
|
61
|
+
...k,
|
|
62
|
+
id: a.id,
|
|
63
|
+
className: z,
|
|
64
|
+
onFocus: h,
|
|
65
|
+
onBlur: E,
|
|
66
|
+
style: S,
|
|
67
|
+
dir: a.dir
|
|
68
|
+
},
|
|
69
|
+
a.children,
|
|
70
|
+
o ? n ? /* @__PURE__ */ l.createElement("label", { id: d, htmlFor: n, className: f }, o, b) : /* @__PURE__ */ l.createElement("span", { id: d, className: f }, o, b) : null
|
|
71
|
+
);
|
|
79
72
|
};
|
|
80
|
-
|
|
73
|
+
R.propTypes = {
|
|
81
74
|
label: e.string,
|
|
82
75
|
editorId: e.string,
|
|
83
76
|
editorValue: e.oneOfType([e.string, e.bool, e.number]),
|
|
@@ -90,8 +83,6 @@ i.propTypes = {
|
|
|
90
83
|
labelClassName: e.string,
|
|
91
84
|
optional: e.bool
|
|
92
85
|
};
|
|
93
|
-
let l = i;
|
|
94
|
-
k(l);
|
|
95
86
|
export {
|
|
96
|
-
|
|
87
|
+
R as FloatingLabel
|
|
97
88
|
};
|
|
@@ -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
|
-
!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,
|
|
8
|
+
!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,s){"use strict";function l(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=l(t);const n="labels.optional",i={[n]:"(Optional)"},c={name:"@progress/kendo-react-labels",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},d=e=>{o.validatePackage(c);const{id:t,editorId:a,editorRef:l,editorDisabled:d,children:p,editorValid:u,style:m,className:b,optional:y}=e,f=s.useLocalization(),g=y?f.toLanguageString(n,i[n]):"",N=g&&r.createElement("span",{className:"k-label-optional"},g),E=o.useUnstyled(),h=E&&E.uLabel,k=r.useCallback((e=>{if(l&&l.current&&!d){l.current.focus&&(e.preventDefault(),l.current.focus());const t=l.current.actionElement;t&&(e.preventDefault(),t.click())}}),[l]),O=r.useMemo((()=>o.classNames(o.uLabel.label({c:h,empty:!p,invalid:!1===u,disabled:!0===d}),b)),[h,p,u,d,b]);return r.createElement("label",{id:t,htmlFor:a,onClick:k,style:m,className:O},p,N)};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 p=e=>{const t={direction:"start",...e};o.validatePackage(c);const a=o.useUnstyled(),s=a&&a.uError,l=r.useMemo((()=>o.classNames(o.uError.wrapper({c:s,direction:t.direction}),t.className)),[s,t.direction,t.className]);return r.createElement("div",{id:t.id,role:"alert",style:t.style,className:l},t.children)};p.propTypes={id:a.string,direction:a.oneOf(["start","end"]),children:a.oneOfType([a.element,a.node]),style:a.object,className:a.string},p.displayName="KendoReactError";const u=e=>{const t={direction:"start",...e};o.validatePackage(c);const a=o.useUnstyled(),s=a&&a.uHint,l=r.useMemo((()=>o.classNames(o.uHint.wrapper({c:s,direction:t.direction,disabled:!0===t.editorDisabled}),t.className)),[s,t.direction,t.editorDisabled,t.className]);return r.createElement("div",{id:t.id,style:t.style,className:l},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 m=e=>{o.validatePackage(c);const[t,a]=r.useState({focused:!1}),{label:l,editorId:d,className:p,labelClassName:u,editorValue:m,editorPlaceholder:b,editorValid:y,editorDisabled:f,style:g,id:N,optional:E,unstyled:h,...k}=e,O=s.useLocalization(),v=E?O.toLanguageString(n,i[n]):"",D=v&&r.createElement("span",{className:"k-label-optional"},v),L=h&&h.uFloatingLabel,T=!b&&!m&&0!==m,R=o.classNames(o.uFloatingLabel.wrapper({c:L,focused:t.focused,empty:T,notEmpty:!T,disabled:f,isRtl:"rtl"===e.dir}),p),j=o.classNames(o.uFloatingLabel.label({c:L,focused:t.focused,empty:T,notEmpty:!T,invalid:!1===y,disabled:f}),u);return r.createElement("span",{...k,id:e.id,className:R,onFocus:e=>{a({focused:!0})},onBlur:e=>{a({focused:!1})},style:g,dir:e.dir},e.children,l?d?r.createElement("label",{id:N,htmlFor:d,className:j},l,D):r.createElement("span",{id:N,className:j},l,D):null)};m.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=p,e.FloatingLabel=m,e.Hint=u,e.Label=d}));
|
package/index.d.mts
CHANGED
|
@@ -87,11 +87,9 @@ export declare interface ErrorProps {
|
|
|
87
87
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
88
88
|
* ```
|
|
89
89
|
*/
|
|
90
|
-
export declare
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
*/
|
|
94
|
-
static propTypes: {
|
|
90
|
+
export declare const FloatingLabel: {
|
|
91
|
+
(props: FloatingLabelProps): JSX_2.Element;
|
|
92
|
+
propTypes: {
|
|
95
93
|
label: PropTypes.Requireable<string>;
|
|
96
94
|
editorId: PropTypes.Requireable<string>;
|
|
97
95
|
editorValue: PropTypes.Requireable<NonNullable<string | number | boolean | null | undefined>>;
|
|
@@ -104,24 +102,7 @@ export declare class FloatingLabel extends React_2.Component<FloatingLabelProps,
|
|
|
104
102
|
labelClassName: PropTypes.Requireable<string>;
|
|
105
103
|
optional: PropTypes.Requireable<boolean>;
|
|
106
104
|
};
|
|
107
|
-
|
|
108
|
-
* @hidden
|
|
109
|
-
*/
|
|
110
|
-
readonly state: FloatingLabelState;
|
|
111
|
-
constructor(props: FloatingLabelProps);
|
|
112
|
-
/**
|
|
113
|
-
* @hidden
|
|
114
|
-
*/
|
|
115
|
-
handleFocus: (_: React_2.SyntheticEvent<HTMLSpanElement>) => void;
|
|
116
|
-
/**
|
|
117
|
-
* @hidden
|
|
118
|
-
*/
|
|
119
|
-
handleBlur: (_: React_2.SyntheticEvent<HTMLSpanElement>) => void;
|
|
120
|
-
/**
|
|
121
|
-
* @hidden
|
|
122
|
-
*/
|
|
123
|
-
render(): JSX_2.Element;
|
|
124
|
-
}
|
|
105
|
+
};
|
|
125
106
|
|
|
126
107
|
/**
|
|
127
108
|
* Represents the props of the KendoReact FloatingLabel component.
|
|
@@ -183,13 +164,6 @@ export declare interface FloatingLabelProps extends KendoReactComponentBaseProps
|
|
|
183
164
|
unstyled?: LabelsClassStructure;
|
|
184
165
|
}
|
|
185
166
|
|
|
186
|
-
/**
|
|
187
|
-
* @hidden
|
|
188
|
-
*/
|
|
189
|
-
declare interface FloatingLabelState {
|
|
190
|
-
focused?: boolean;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
167
|
/**
|
|
194
168
|
* Represents the KendoReact Hint component.
|
|
195
169
|
* Render the hint text that will be shown underneath the form editor.
|
package/index.d.ts
CHANGED
|
@@ -87,11 +87,9 @@ export declare interface ErrorProps {
|
|
|
87
87
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
88
88
|
* ```
|
|
89
89
|
*/
|
|
90
|
-
export declare
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
*/
|
|
94
|
-
static propTypes: {
|
|
90
|
+
export declare const FloatingLabel: {
|
|
91
|
+
(props: FloatingLabelProps): JSX_2.Element;
|
|
92
|
+
propTypes: {
|
|
95
93
|
label: PropTypes.Requireable<string>;
|
|
96
94
|
editorId: PropTypes.Requireable<string>;
|
|
97
95
|
editorValue: PropTypes.Requireable<NonNullable<string | number | boolean | null | undefined>>;
|
|
@@ -104,24 +102,7 @@ export declare class FloatingLabel extends React_2.Component<FloatingLabelProps,
|
|
|
104
102
|
labelClassName: PropTypes.Requireable<string>;
|
|
105
103
|
optional: PropTypes.Requireable<boolean>;
|
|
106
104
|
};
|
|
107
|
-
|
|
108
|
-
* @hidden
|
|
109
|
-
*/
|
|
110
|
-
readonly state: FloatingLabelState;
|
|
111
|
-
constructor(props: FloatingLabelProps);
|
|
112
|
-
/**
|
|
113
|
-
* @hidden
|
|
114
|
-
*/
|
|
115
|
-
handleFocus: (_: React_2.SyntheticEvent<HTMLSpanElement>) => void;
|
|
116
|
-
/**
|
|
117
|
-
* @hidden
|
|
118
|
-
*/
|
|
119
|
-
handleBlur: (_: React_2.SyntheticEvent<HTMLSpanElement>) => void;
|
|
120
|
-
/**
|
|
121
|
-
* @hidden
|
|
122
|
-
*/
|
|
123
|
-
render(): JSX_2.Element;
|
|
124
|
-
}
|
|
105
|
+
};
|
|
125
106
|
|
|
126
107
|
/**
|
|
127
108
|
* Represents the props of the KendoReact FloatingLabel component.
|
|
@@ -183,13 +164,6 @@ export declare interface FloatingLabelProps extends KendoReactComponentBaseProps
|
|
|
183
164
|
unstyled?: LabelsClassStructure;
|
|
184
165
|
}
|
|
185
166
|
|
|
186
|
-
/**
|
|
187
|
-
* @hidden
|
|
188
|
-
*/
|
|
189
|
-
declare interface FloatingLabelState {
|
|
190
|
-
focused?: boolean;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
167
|
/**
|
|
194
168
|
* Represents the KendoReact Hint component.
|
|
195
169
|
* Render the hint text that will be shown underneath the form editor.
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-labels",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1730208178,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-labels",
|
|
3
|
-
"version": "9.0.0-develop.
|
|
3
|
+
"version": "9.0.0-develop.9",
|
|
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",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-licensing": "^1.3.4",
|
|
26
|
-
"@progress/kendo-react-common": "9.0.0-develop.
|
|
27
|
-
"@progress/kendo-react-intl": "9.0.0-develop.
|
|
26
|
+
"@progress/kendo-react-common": "9.0.0-develop.9",
|
|
27
|
+
"@progress/kendo-react-intl": "9.0.0-develop.9",
|
|
28
28
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
29
29
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
30
30
|
},
|