@progress/kendo-react-inputs 9.4.0-develop.9 → 9.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/NOTICE.txt +40 -51
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +243 -226
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +156 -151
- package/colors/Picker.js +1 -1
- package/colors/Picker.mjs +17 -17
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +8 -0
- package/index.d.ts +8 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
|
@@ -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 J=require("react"),o=require("prop-types"),r=require("@progress/kendo-react-common"),s=require("@progress/kendo-react-buttons"),b=require("@progress/kendo-svg-icons"),Q=require("./ColorPalette.js"),U=require("./ColorGradient.js"),W=require("../package-metadata.js"),X=require("@progress/kendo-react-intl"),l=require("../messages/index.js");function Y(e){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const g in e)if(g!=="default"){const f=Object.getOwnPropertyDescriptor(e,g);Object.defineProperty(h,g,f.get?f:{enumerable:!0,get:()=>e[g]})}}return h.default=e,Object.freeze(h)}const t=Y(J),_=t.forwardRef((e,h)=>{r.validatePackage(W.packageMetadata);const g=t.useRef(null),f=t.useRef(null),A=t.useRef(null),{defaultValue:E,showButtons:B=!0,showPreview:O=!0,showClearButton:x=!0,view:P=e.views?void 0:"ColorGradient",views:d=P?void 0:["gradient","palette"],activeView:w="gradient",size:i="medium"}=e,[C,z]=t.useState((P||"ColorGradient")==="ColorGradient"),[v,M]=t.useState((d!=null?d:[])[0]==="gradient"&&w==="gradient"),[c,y]=t.useState(e.value||E||void 0),[k,I]=t.useState(e.value||E||void 0),G=e.value!==void 0?e.value:void 0;t.useEffect(()=>{y(e.value)},[e.value]);const m=X.useLocalization(),V=t.useCallback(()=>{g.current&&g.current.focus()},[g]);t.useImperativeHandle(g,()=>({element:f.current,focus:V,props:e,value:G}),[G,V,e]),t.useImperativeHandle(h,()=>g.current);const L=t.useCallback(a=>{(a==="ColorGradient"&&!C||a==="ColorPalette"&&C)&&z(!C)},[C]),N=t.useCallback(a=>{a==="gradient"&&!v||a==="palette"&&v||a==="palette"&&w==="gradient"?M(!v):a==="gradient"&&w==="palette"&&M(!0)},[w,v]),F=t.useCallback(a=>{var u;const n=E||void 0;if(y(n),I(n),(u=e._gradientSettings)!=null&&u._adaptive&&e.setAdaptiveModeValue&&e.setAdaptiveModeValue(n),e.onPreviewChange){const S={value:n,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,S)}},[E,e.onPreviewChange]),R=t.useCallback(a=>{var n;if(y(a.value),e.onPreviewChange){const u={value:a.value,nativeEvent:a.nativeEvent,syntheticEvent:a.syntheticEvent};e.onPreviewChange.call(void 0,u)}(n=e._gradientSettings)!=null&&n._adaptive&&e.setAdaptiveModeValue&&e.setAdaptiveModeValue(a.value)},[e.onPreviewChange]),T=t.useCallback(a=>{if(c!==void 0&&I(c),e.onChange){const n={value:c,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onChange.call(void 0,n)}},[c,e.onChange]),j=t.useCallback(()=>{y(k),e.setOpen&&e.setOpen(!1)},[k]),D=t.useCallback(a=>{if(y(k),e.onPreviewChange){const n={value:k,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,n)}},[k,e.onPreviewChange]),K=t.useCallback(a=>{var u,S;if((!a.relatedTarget||!((u=f.current)!=null&&u.contains(a.relatedTarget)))&&!((S=e._gradientSettings)!=null&&S._adaptive)&&(!B&&c!==void 0&&I(c),!B&&e.onChange)){const $={value:c,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onChange.call(void 0,$)}},[c,B,e.onChange]),q=t.useMemo(()=>new r.Navigation({root:f,selectors:[".k-coloreditor"],tabIndex:0,keyboardEvents:{keydown:{Tab:(a,n,u)=>{r.getActiveElement(document)===a?r.disableNavigatableContainer(a):r.keepFocusInContainer(u,a)},Enter:(a,n,u)=>{r.getActiveElement(document)===a&&(r.focusFirstFocusableChild(a),r.enableNavigatableContainer(a))},Escape:(a,n,u)=>{r.getActiveElement(document)!==a&&(a.focus(),r.disableNavigatableContainer(a))}}}}),[]),H=t.useCallback(q.triggerKeyboardEvent.bind(q),[]);return t.createElement("div",{id:e.id,role:"textbox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-disabled":e.disabled?"true":void 0,style:e.style,ref:f,tabIndex:r.getTabIndex(e.tabIndex,e.disabled),className:r.classNames("k-flatcolorpicker k-coloreditor",{[`k-coloreditor-${r.kendoThemeMaps.sizeMap[i]||i}`]:i,"k-disabled":e.disabled},e.className),onBlur:K,onKeyDown:H},e.header||t.createElement("div",{className:"k-coloreditor-header k-hstack"},t.createElement("div",{className:"k-coloreditor-header-actions k-hstack"},d&&d[0]==="gradient"&&d[1]==="palette"&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:b.dropletSliderIcon,selected:v,onClick:()=>N("gradient")}),t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:b.paletteIcon,selected:!v,onClick:()=>N("palette")})),d&&d[0]==="palette"&&d[1]==="gradient"&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:b.paletteIcon,selected:!v,onClick:()=>N("palette")}),t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:b.dropletSliderIcon,selected:v,onClick:()=>N("gradient")})),P&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),togglable:!0,fillMode:"flat",size:i,selected:C,onClick:()=>L("ColorGradient"),icon:"droplet-slider",svgIcon:b.dropletSliderIcon}),t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),togglable:!0,fillMode:"flat",size:i,selected:!C,onClick:()=>L("ColorPalette"),icon:"palette",svgIcon:b.paletteIcon}))),t.createElement("div",{className:"k-spacer"}),t.createElement("div",{className:"k-coloreditor-header-actions k-hstack"},x&&t.createElement(s.Button,{type:"button",fillMode:"flat",size:i,onClick:F,"aria-label":m.toLanguageString(l.flatColorPickerClearBtn,l.messages[l.flatColorPickerClearBtn]),icon:"droplet-slash",svgIcon:b.dropletSlashIcon}),O&&t.createElement("div",{className:"k-coloreditor-preview k-vstack"},t.createElement("span",{className:r.classNames("k-coloreditor-preview-color","k-color-preview",{"k-no-color":G===void 0})},t.createElement("span",{className:"k-color-preview-mask",style:{background:c||void 0}})),t.createElement("span",{className:r.classNames("k-coloreditor-current-color","k-color-preview",{"k-no-color":k===void 0}),onClick:D},t.createElement("span",{className:"k-color-preview-mask",style:{background:k||void 0}}))))),t.createElement("div",{className:"k-coloreditor-views k-vstack"},(P&&C||d&&v)&&t.createElement(U.ColorGradient,{ref:A,role:"none",ariaLabel:void 0,value:c,onChange:R,opacity:e.opacity,format:e.format,size:i,_adaptive:e._gradientSettings?e._gradientSettings._adaptive:void 0,...e._gradientSettings}),(P&&!C||d&&!v)&&t.createElement(Q.ColorPalette,{ariaDisabled:!0,ariaLabelledBy:"required_label",value:c,onChange:R,size:i})),B&&t.createElement("div",{className:"k-coloreditor-footer k-actions k-actions-end k-actions-horizontal"},t.createElement(s.Button,{type:"button",className:"k-coloreditor-cancel",size:i,onClick:j},l.messages[l.flatColorPickerCancelBtn]),t.createElement(s.Button,{type:"button",themeColor:"primary",className:"k-coloreditor-apply",size:i,onClick:T},l.messages[l.flatColorPickerApplyBtn])))}),Z={id:o.string,style:o.any,className:o.string,value:o.string,defaultValue:o.string,onPreviewChange:o.func,onChange:o.func,opacity:o.bool,format:o.any,tabIndex:o.number,ariaLabel:o.string,ariaLabelledBy:o.string,disabled:o.bool,view:o.any,header:o.any,showClearButton:o.bool,showPreview:o.bool,showButtons:o.bool,views:o.array,size:o.oneOf([null,"small","medium","large"])};_.displayName="KendoFlatColorPicker";_.propTypes=Z;exports.FlatColorPicker=_;
|
|
@@ -5,293 +5,297 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
8
|
+
import * as a from "react";
|
|
9
9
|
import l from "prop-types";
|
|
10
|
-
import { validatePackage as
|
|
11
|
-
import { ButtonGroup as
|
|
12
|
-
import { dropletSliderIcon as
|
|
13
|
-
import { ColorPalette as
|
|
14
|
-
import { ColorGradient as
|
|
15
|
-
import { packageMetadata as
|
|
10
|
+
import { validatePackage as p, Navigation as ee, getActiveElement as _, disableNavigatableContainer as K, keepFocusInContainer as ae, focusFirstFocusableChild as te, enableNavigatableContainer as le, getTabIndex as ne, classNames as V, kendoThemeMaps as oe } from "@progress/kendo-react-common";
|
|
11
|
+
import { ButtonGroup as M, Button as s } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { dropletSliderIcon as L, paletteIcon as G, dropletSlashIcon as ie } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { ColorPalette as re } from "./ColorPalette.mjs";
|
|
14
|
+
import { ColorGradient as ce } from "./ColorGradient.mjs";
|
|
15
|
+
import { packageMetadata as de } from "../package-metadata.mjs";
|
|
16
16
|
import { useLocalization as se } from "@progress/kendo-react-intl";
|
|
17
|
-
import { flatColorPickerColorGradientBtn as
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
defaultValue:
|
|
17
|
+
import { flatColorPickerColorGradientBtn as C, messages as u, flatColorPickerColorPaletteBtn as k, flatColorPickerClearBtn as T, flatColorPickerCancelBtn as ue, flatColorPickerApplyBtn as ve } from "../messages/index.mjs";
|
|
18
|
+
const D = a.forwardRef((e, O) => {
|
|
19
|
+
p(de);
|
|
20
|
+
const f = a.useRef(null), y = a.useRef(null), H = a.useRef(null), {
|
|
21
|
+
defaultValue: b,
|
|
22
22
|
showButtons: w = !0,
|
|
23
23
|
showPreview: q = !0,
|
|
24
|
-
showClearButton:
|
|
25
|
-
view:
|
|
26
|
-
views:
|
|
24
|
+
showClearButton: $ = !0,
|
|
25
|
+
view: h = e.views ? void 0 : "ColorGradient",
|
|
26
|
+
views: r = h ? void 0 : ["gradient", "palette"],
|
|
27
27
|
activeView: P = "gradient",
|
|
28
28
|
size: o = "medium"
|
|
29
|
-
} =
|
|
30
|
-
(
|
|
31
|
-
), [
|
|
32
|
-
(
|
|
33
|
-
), [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, [
|
|
37
|
-
const m = se(),
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
} = e, [v, j] = a.useState(
|
|
30
|
+
(h || "ColorGradient") === "ColorGradient"
|
|
31
|
+
), [d, x] = a.useState(
|
|
32
|
+
(r != null ? r : [])[0] === "gradient" && P === "gradient"
|
|
33
|
+
), [i, E] = a.useState(e.value || b || void 0), [g, I] = a.useState(e.value || b || void 0), B = e.value !== void 0 ? e.value : void 0;
|
|
34
|
+
a.useEffect(() => {
|
|
35
|
+
E(e.value);
|
|
36
|
+
}, [e.value]);
|
|
37
|
+
const m = se(), R = a.useCallback(() => {
|
|
38
|
+
f.current && f.current.focus();
|
|
39
|
+
}, [f]);
|
|
40
|
+
a.useImperativeHandle(
|
|
41
|
+
f,
|
|
42
42
|
() => ({
|
|
43
43
|
element: y.current,
|
|
44
|
-
focus:
|
|
45
|
-
props:
|
|
44
|
+
focus: R,
|
|
45
|
+
props: e,
|
|
46
46
|
value: B
|
|
47
47
|
}),
|
|
48
|
-
[B,
|
|
49
|
-
),
|
|
50
|
-
const
|
|
48
|
+
[B, R, e]
|
|
49
|
+
), a.useImperativeHandle(O, () => f.current);
|
|
50
|
+
const A = a.useCallback(
|
|
51
51
|
(t) => {
|
|
52
|
-
(t === "ColorGradient" && !v || t === "ColorPalette" && v) &&
|
|
52
|
+
(t === "ColorGradient" && !v || t === "ColorPalette" && v) && j(!v);
|
|
53
53
|
},
|
|
54
54
|
[v]
|
|
55
|
-
),
|
|
55
|
+
), N = a.useCallback(
|
|
56
56
|
(t) => {
|
|
57
|
-
t === "gradient" && !
|
|
57
|
+
t === "gradient" && !d || t === "palette" && d || t === "palette" && P === "gradient" ? x(!d) : t === "gradient" && P === "palette" && x(!0);
|
|
58
58
|
},
|
|
59
|
-
[P,
|
|
60
|
-
),
|
|
59
|
+
[P, d]
|
|
60
|
+
), J = a.useCallback(
|
|
61
61
|
(t) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
var c;
|
|
63
|
+
const n = b || void 0;
|
|
64
|
+
if (E(n), I(n), (c = e._gradientSettings) != null && c._adaptive && e.setAdaptiveModeValue && e.setAdaptiveModeValue(n), e.onPreviewChange) {
|
|
65
|
+
const S = {
|
|
66
|
+
value: n,
|
|
65
67
|
nativeEvent: t.nativeEvent,
|
|
66
68
|
syntheticEvent: t
|
|
67
69
|
};
|
|
68
|
-
|
|
70
|
+
e.onPreviewChange.call(void 0, S);
|
|
69
71
|
}
|
|
70
72
|
},
|
|
71
|
-
[
|
|
72
|
-
), z =
|
|
73
|
+
[b, e.onPreviewChange]
|
|
74
|
+
), z = a.useCallback(
|
|
73
75
|
(t) => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
var n;
|
|
77
|
+
if (E(t.value), e.onPreviewChange) {
|
|
78
|
+
const c = {
|
|
76
79
|
value: t.value,
|
|
77
80
|
nativeEvent: t.nativeEvent,
|
|
78
81
|
syntheticEvent: t.syntheticEvent
|
|
79
82
|
};
|
|
80
|
-
|
|
83
|
+
e.onPreviewChange.call(void 0, c);
|
|
81
84
|
}
|
|
85
|
+
(n = e._gradientSettings) != null && n._adaptive && e.setAdaptiveModeValue && e.setAdaptiveModeValue(t.value);
|
|
82
86
|
},
|
|
83
|
-
[
|
|
84
|
-
),
|
|
87
|
+
[e.onPreviewChange]
|
|
88
|
+
), Q = a.useCallback(
|
|
85
89
|
(t) => {
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
value:
|
|
90
|
+
if (i !== void 0 && I(i), e.onChange) {
|
|
91
|
+
const n = {
|
|
92
|
+
value: i,
|
|
89
93
|
nativeEvent: t.nativeEvent,
|
|
90
94
|
syntheticEvent: t
|
|
91
95
|
};
|
|
92
|
-
|
|
96
|
+
e.onChange.call(void 0, n);
|
|
93
97
|
}
|
|
94
98
|
},
|
|
95
|
-
[
|
|
96
|
-
),
|
|
97
|
-
|
|
98
|
-
}, [g]),
|
|
99
|
+
[i, e.onChange]
|
|
100
|
+
), U = a.useCallback(() => {
|
|
101
|
+
E(g), e.setOpen && e.setOpen(!1);
|
|
102
|
+
}, [g]), W = a.useCallback(
|
|
99
103
|
(t) => {
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
104
|
+
if (E(g), e.onPreviewChange) {
|
|
105
|
+
const n = {
|
|
102
106
|
value: g,
|
|
103
107
|
nativeEvent: t.nativeEvent,
|
|
104
108
|
syntheticEvent: t
|
|
105
109
|
};
|
|
106
|
-
|
|
110
|
+
e.onPreviewChange.call(void 0, n);
|
|
107
111
|
}
|
|
108
112
|
},
|
|
109
|
-
[g,
|
|
110
|
-
),
|
|
113
|
+
[g, e.onPreviewChange]
|
|
114
|
+
), X = a.useCallback(
|
|
111
115
|
(t) => {
|
|
112
|
-
var
|
|
113
|
-
if ((!t.relatedTarget || !((
|
|
114
|
-
const
|
|
115
|
-
value:
|
|
116
|
+
var c, S;
|
|
117
|
+
if ((!t.relatedTarget || !((c = y.current) != null && c.contains(t.relatedTarget))) && !((S = e._gradientSettings) != null && S._adaptive) && (!w && i !== void 0 && I(i), !w && e.onChange)) {
|
|
118
|
+
const Z = {
|
|
119
|
+
value: i,
|
|
116
120
|
nativeEvent: t.nativeEvent,
|
|
117
121
|
syntheticEvent: t
|
|
118
122
|
};
|
|
119
|
-
|
|
123
|
+
e.onChange.call(void 0, Z);
|
|
120
124
|
}
|
|
121
125
|
},
|
|
122
|
-
[
|
|
123
|
-
), F =
|
|
124
|
-
() => new
|
|
126
|
+
[i, w, e.onChange]
|
|
127
|
+
), F = a.useMemo(
|
|
128
|
+
() => new ee({
|
|
125
129
|
root: y,
|
|
126
130
|
selectors: [".k-coloreditor"],
|
|
127
131
|
tabIndex: 0,
|
|
128
132
|
keyboardEvents: {
|
|
129
133
|
keydown: {
|
|
130
|
-
Tab: (t,
|
|
131
|
-
|
|
134
|
+
Tab: (t, n, c) => {
|
|
135
|
+
_(document) === t ? K(t) : ae(c, t);
|
|
132
136
|
},
|
|
133
|
-
Enter: (t,
|
|
134
|
-
|
|
137
|
+
Enter: (t, n, c) => {
|
|
138
|
+
_(document) === t && (te(t), le(t));
|
|
135
139
|
},
|
|
136
|
-
Escape: (t,
|
|
137
|
-
|
|
140
|
+
Escape: (t, n, c) => {
|
|
141
|
+
_(document) !== t && (t.focus(), K(t));
|
|
138
142
|
}
|
|
139
143
|
}
|
|
140
144
|
}
|
|
141
145
|
}),
|
|
142
146
|
[]
|
|
143
|
-
),
|
|
144
|
-
return /* @__PURE__ */
|
|
147
|
+
), Y = a.useCallback(F.triggerKeyboardEvent.bind(F), []);
|
|
148
|
+
return /* @__PURE__ */ a.createElement(
|
|
145
149
|
"div",
|
|
146
150
|
{
|
|
147
|
-
id:
|
|
151
|
+
id: e.id,
|
|
148
152
|
role: "textbox",
|
|
149
|
-
"aria-label":
|
|
150
|
-
"aria-labelledby":
|
|
151
|
-
"aria-disabled":
|
|
152
|
-
style:
|
|
153
|
+
"aria-label": e.ariaLabel,
|
|
154
|
+
"aria-labelledby": e.ariaLabelledBy,
|
|
155
|
+
"aria-disabled": e.disabled ? "true" : void 0,
|
|
156
|
+
style: e.style,
|
|
153
157
|
ref: y,
|
|
154
|
-
tabIndex:
|
|
155
|
-
className:
|
|
158
|
+
tabIndex: ne(e.tabIndex, e.disabled),
|
|
159
|
+
className: V(
|
|
156
160
|
"k-flatcolorpicker k-coloreditor",
|
|
157
161
|
{
|
|
158
162
|
[`k-coloreditor-${oe.sizeMap[o] || o}`]: o,
|
|
159
|
-
"k-disabled":
|
|
163
|
+
"k-disabled": e.disabled
|
|
160
164
|
},
|
|
161
|
-
|
|
165
|
+
e.className
|
|
162
166
|
),
|
|
163
|
-
onBlur:
|
|
164
|
-
onKeyDown:
|
|
167
|
+
onBlur: X,
|
|
168
|
+
onKeyDown: Y
|
|
165
169
|
},
|
|
166
|
-
|
|
170
|
+
e.header || /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header k-hstack" }, /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header-actions k-hstack" }, r && r[0] === "gradient" && r[1] === "palette" && /* @__PURE__ */ a.createElement(M, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
|
|
167
171
|
s,
|
|
168
172
|
{
|
|
169
173
|
type: "button",
|
|
170
174
|
"aria-label": m.toLanguageString(
|
|
171
|
-
|
|
172
|
-
|
|
175
|
+
C,
|
|
176
|
+
u[C]
|
|
173
177
|
),
|
|
174
178
|
togglable: !0,
|
|
175
179
|
fillMode: "flat",
|
|
176
180
|
size: o,
|
|
177
|
-
svgIcon:
|
|
178
|
-
selected:
|
|
179
|
-
onClick: () =>
|
|
181
|
+
svgIcon: L,
|
|
182
|
+
selected: d,
|
|
183
|
+
onClick: () => N("gradient")
|
|
180
184
|
}
|
|
181
|
-
), /* @__PURE__ */
|
|
185
|
+
), /* @__PURE__ */ a.createElement(
|
|
182
186
|
s,
|
|
183
187
|
{
|
|
184
188
|
type: "button",
|
|
185
189
|
"aria-label": m.toLanguageString(
|
|
186
|
-
|
|
187
|
-
|
|
190
|
+
k,
|
|
191
|
+
u[k]
|
|
188
192
|
),
|
|
189
193
|
togglable: !0,
|
|
190
194
|
fillMode: "flat",
|
|
191
195
|
size: o,
|
|
192
|
-
svgIcon:
|
|
193
|
-
selected: !
|
|
194
|
-
onClick: () =>
|
|
196
|
+
svgIcon: G,
|
|
197
|
+
selected: !d,
|
|
198
|
+
onClick: () => N("palette")
|
|
195
199
|
}
|
|
196
|
-
)),
|
|
200
|
+
)), r && r[0] === "palette" && r[1] === "gradient" && /* @__PURE__ */ a.createElement(M, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
|
|
197
201
|
s,
|
|
198
202
|
{
|
|
199
203
|
type: "button",
|
|
200
204
|
"aria-label": m.toLanguageString(
|
|
201
|
-
|
|
202
|
-
|
|
205
|
+
k,
|
|
206
|
+
u[k]
|
|
203
207
|
),
|
|
204
208
|
togglable: !0,
|
|
205
209
|
fillMode: "flat",
|
|
206
210
|
size: o,
|
|
207
|
-
svgIcon:
|
|
208
|
-
selected: !
|
|
209
|
-
onClick: () =>
|
|
211
|
+
svgIcon: G,
|
|
212
|
+
selected: !d,
|
|
213
|
+
onClick: () => N("palette")
|
|
210
214
|
}
|
|
211
|
-
), /* @__PURE__ */
|
|
215
|
+
), /* @__PURE__ */ a.createElement(
|
|
212
216
|
s,
|
|
213
217
|
{
|
|
214
218
|
type: "button",
|
|
215
219
|
"aria-label": m.toLanguageString(
|
|
216
|
-
|
|
217
|
-
|
|
220
|
+
C,
|
|
221
|
+
u[C]
|
|
218
222
|
),
|
|
219
223
|
togglable: !0,
|
|
220
224
|
fillMode: "flat",
|
|
221
225
|
size: o,
|
|
222
|
-
svgIcon:
|
|
223
|
-
selected:
|
|
224
|
-
onClick: () =>
|
|
226
|
+
svgIcon: L,
|
|
227
|
+
selected: d,
|
|
228
|
+
onClick: () => N("gradient")
|
|
225
229
|
}
|
|
226
|
-
)),
|
|
230
|
+
)), h && /* @__PURE__ */ a.createElement(M, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
|
|
227
231
|
s,
|
|
228
232
|
{
|
|
229
233
|
type: "button",
|
|
230
234
|
"aria-label": m.toLanguageString(
|
|
231
|
-
|
|
232
|
-
|
|
235
|
+
C,
|
|
236
|
+
u[C]
|
|
233
237
|
),
|
|
234
238
|
togglable: !0,
|
|
235
239
|
fillMode: "flat",
|
|
236
240
|
size: o,
|
|
237
241
|
selected: v,
|
|
238
|
-
onClick: () =>
|
|
242
|
+
onClick: () => A("ColorGradient"),
|
|
239
243
|
icon: "droplet-slider",
|
|
240
|
-
svgIcon:
|
|
244
|
+
svgIcon: L
|
|
241
245
|
}
|
|
242
|
-
), /* @__PURE__ */
|
|
246
|
+
), /* @__PURE__ */ a.createElement(
|
|
243
247
|
s,
|
|
244
248
|
{
|
|
245
249
|
type: "button",
|
|
246
250
|
"aria-label": m.toLanguageString(
|
|
247
|
-
|
|
248
|
-
|
|
251
|
+
k,
|
|
252
|
+
u[k]
|
|
249
253
|
),
|
|
250
254
|
togglable: !0,
|
|
251
255
|
fillMode: "flat",
|
|
252
256
|
size: o,
|
|
253
257
|
selected: !v,
|
|
254
|
-
onClick: () =>
|
|
258
|
+
onClick: () => A("ColorPalette"),
|
|
255
259
|
icon: "palette",
|
|
256
|
-
svgIcon:
|
|
260
|
+
svgIcon: G
|
|
257
261
|
}
|
|
258
|
-
))), /* @__PURE__ */
|
|
262
|
+
))), /* @__PURE__ */ a.createElement("div", { className: "k-spacer" }), /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header-actions k-hstack" }, $ && /* @__PURE__ */ a.createElement(
|
|
259
263
|
s,
|
|
260
264
|
{
|
|
261
265
|
type: "button",
|
|
262
266
|
fillMode: "flat",
|
|
263
267
|
size: o,
|
|
264
|
-
onClick:
|
|
268
|
+
onClick: J,
|
|
265
269
|
"aria-label": m.toLanguageString(
|
|
266
270
|
T,
|
|
267
|
-
|
|
271
|
+
u[T]
|
|
268
272
|
),
|
|
269
273
|
icon: "droplet-slash",
|
|
270
|
-
svgIcon:
|
|
274
|
+
svgIcon: ie
|
|
271
275
|
}
|
|
272
|
-
), q && /* @__PURE__ */
|
|
276
|
+
), q && /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-preview k-vstack" }, /* @__PURE__ */ a.createElement(
|
|
273
277
|
"span",
|
|
274
278
|
{
|
|
275
|
-
className:
|
|
279
|
+
className: V("k-coloreditor-preview-color", "k-color-preview", {
|
|
276
280
|
"k-no-color": B === void 0
|
|
277
281
|
})
|
|
278
282
|
},
|
|
279
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ a.createElement(
|
|
280
284
|
"span",
|
|
281
285
|
{
|
|
282
286
|
className: "k-color-preview-mask",
|
|
283
|
-
style: { background:
|
|
287
|
+
style: { background: i || void 0 }
|
|
284
288
|
}
|
|
285
289
|
)
|
|
286
|
-
), /* @__PURE__ */
|
|
290
|
+
), /* @__PURE__ */ a.createElement(
|
|
287
291
|
"span",
|
|
288
292
|
{
|
|
289
|
-
className:
|
|
293
|
+
className: V("k-coloreditor-current-color", "k-color-preview", {
|
|
290
294
|
"k-no-color": g === void 0
|
|
291
295
|
}),
|
|
292
|
-
onClick:
|
|
296
|
+
onClick: W
|
|
293
297
|
},
|
|
294
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ a.createElement(
|
|
295
299
|
"span",
|
|
296
300
|
{
|
|
297
301
|
className: "k-color-preview-mask",
|
|
@@ -299,42 +303,43 @@ const A = e.forwardRef((a, D) => {
|
|
|
299
303
|
}
|
|
300
304
|
)
|
|
301
305
|
)))),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
|
|
306
|
+
/* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-views k-vstack" }, (h && v || r && d) && /* @__PURE__ */ a.createElement(
|
|
307
|
+
ce,
|
|
304
308
|
{
|
|
305
309
|
ref: H,
|
|
306
310
|
role: "none",
|
|
307
311
|
ariaLabel: void 0,
|
|
308
|
-
value:
|
|
312
|
+
value: i,
|
|
309
313
|
onChange: z,
|
|
310
|
-
opacity:
|
|
311
|
-
format:
|
|
314
|
+
opacity: e.opacity,
|
|
315
|
+
format: e.format,
|
|
312
316
|
size: o,
|
|
313
|
-
_adaptive:
|
|
317
|
+
_adaptive: e._gradientSettings ? e._gradientSettings._adaptive : void 0,
|
|
318
|
+
...e._gradientSettings
|
|
314
319
|
}
|
|
315
|
-
), (
|
|
316
|
-
|
|
320
|
+
), (h && !v || r && !d) && /* @__PURE__ */ a.createElement(
|
|
321
|
+
re,
|
|
317
322
|
{
|
|
318
323
|
ariaDisabled: !0,
|
|
319
324
|
ariaLabelledBy: "required_label",
|
|
320
|
-
value:
|
|
325
|
+
value: i,
|
|
321
326
|
onChange: z,
|
|
322
327
|
size: o
|
|
323
328
|
}
|
|
324
329
|
)),
|
|
325
|
-
w && /* @__PURE__ */
|
|
330
|
+
w && /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-footer k-actions k-actions-end k-actions-horizontal" }, /* @__PURE__ */ a.createElement(s, { type: "button", className: "k-coloreditor-cancel", size: o, onClick: U }, u[ue]), /* @__PURE__ */ a.createElement(
|
|
326
331
|
s,
|
|
327
332
|
{
|
|
328
333
|
type: "button",
|
|
329
334
|
themeColor: "primary",
|
|
330
335
|
className: "k-coloreditor-apply",
|
|
331
336
|
size: o,
|
|
332
|
-
onClick:
|
|
337
|
+
onClick: Q
|
|
333
338
|
},
|
|
334
|
-
|
|
339
|
+
u[ve]
|
|
335
340
|
))
|
|
336
341
|
);
|
|
337
|
-
}),
|
|
342
|
+
}), ge = {
|
|
338
343
|
id: l.string,
|
|
339
344
|
style: l.any,
|
|
340
345
|
className: l.string,
|
|
@@ -356,8 +361,8 @@ const A = e.forwardRef((a, D) => {
|
|
|
356
361
|
views: l.array,
|
|
357
362
|
size: l.oneOf([null, "small", "medium", "large"])
|
|
358
363
|
};
|
|
359
|
-
|
|
360
|
-
|
|
364
|
+
D.displayName = "KendoFlatColorPicker";
|
|
365
|
+
D.propTypes = ge;
|
|
361
366
|
export {
|
|
362
|
-
|
|
367
|
+
D as FlatColorPicker
|
|
363
368
|
};
|
package/colors/Picker.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 a=require("react"),r=require("@progress/kendo-react-popup"),u=require("@progress/kendo-react-common");function s(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const o=s(a),m="bottom",d="top",i=e=>{const n=e.popupSettings||{},t=e.dir==="rtl"?"right":"left",c=o.useMemo(()=>({horizontal:t,vertical:m}),[t]),l=o.useMemo(()=>({horizontal:t,vertical:d}),[t]);return o.createElement(o.Fragment,null,e.input,e.button,!e._mobileMode&&o.createElement(r.Popup,{style:{...(n||{}).style,direction:e.dir},...n,anchor:e.popupAnchor,anchorAlign:c,popupAlign:l,show:e.open,onOpen:e.onOpen,onClose:e.onClose,className:u.classNames(n.className),popupClass:"k-colorpicker-popup"},e.content),e._mobileMode&&e._actionSheet)};i.displayName="KendoPickerComponent";exports.Picker=i;
|
package/colors/Picker.mjs
CHANGED
|
@@ -5,36 +5,36 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { Popup as
|
|
8
|
+
import * as o from "react";
|
|
9
|
+
import { Popup as c } from "@progress/kendo-react-popup";
|
|
10
10
|
import { classNames as a } from "@progress/kendo-react-common";
|
|
11
|
-
const m = "bottom", r = "top", s = (
|
|
12
|
-
const n =
|
|
11
|
+
const m = "bottom", r = "top", s = (e) => {
|
|
12
|
+
const n = e.popupSettings || {}, t = e.dir === "rtl" ? "right" : "left", i = o.useMemo(
|
|
13
13
|
() => ({ horizontal: t, vertical: m }),
|
|
14
14
|
[t]
|
|
15
|
-
),
|
|
15
|
+
), l = o.useMemo(
|
|
16
16
|
() => ({ horizontal: t, vertical: r }),
|
|
17
17
|
[t]
|
|
18
18
|
);
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
19
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, e.input, e.button, !e._mobileMode && /* @__PURE__ */ o.createElement(
|
|
20
|
+
c,
|
|
21
21
|
{
|
|
22
22
|
style: {
|
|
23
23
|
...(n || {}).style,
|
|
24
|
-
direction:
|
|
24
|
+
direction: e.dir
|
|
25
25
|
},
|
|
26
26
|
...n,
|
|
27
|
-
anchor:
|
|
28
|
-
anchorAlign:
|
|
29
|
-
popupAlign:
|
|
30
|
-
show:
|
|
31
|
-
onOpen:
|
|
32
|
-
onClose:
|
|
27
|
+
anchor: e.popupAnchor,
|
|
28
|
+
anchorAlign: i,
|
|
29
|
+
popupAlign: l,
|
|
30
|
+
show: e.open,
|
|
31
|
+
onOpen: e.onOpen,
|
|
32
|
+
onClose: e.onClose,
|
|
33
33
|
className: a(n.className),
|
|
34
|
-
popupClass: "k-colorpicker-popup
|
|
34
|
+
popupClass: "k-colorpicker-popup"
|
|
35
35
|
},
|
|
36
|
-
|
|
37
|
-
),
|
|
36
|
+
e.content
|
|
37
|
+
), e._mobileMode && e._actionSheet);
|
|
38
38
|
};
|
|
39
39
|
s.displayName = "KendoPickerComponent";
|
|
40
40
|
export {
|