@progress/kendo-react-buttons 7.2.4-develop.3 → 7.2.4-develop.4
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/Button.js +8 -0
- package/Button.mjs +124 -0
- package/ButtonGroup.js +8 -0
- package/ButtonGroup.mjs +76 -0
- package/Chip/Chip.js +8 -0
- package/Chip/Chip.mjs +220 -0
- package/Chip/ChipList.js +8 -0
- package/Chip/ChipList.mjs +190 -0
- package/Chip/chip-list-contexts.js +8 -0
- package/Chip/chip-list-contexts.mjs +18 -0
- package/Chip/data-reducer.js +8 -0
- package/Chip/data-reducer.mjs +25 -0
- package/Chip/focus-reducer.js +8 -0
- package/Chip/focus-reducer.mjs +28 -0
- package/Chip/selection-reducer.js +8 -0
- package/Chip/selection-reducer.mjs +47 -0
- package/FloatingActionButton/FloatingActionButton.js +8 -0
- package/FloatingActionButton/FloatingActionButton.mjs +343 -0
- package/FloatingActionButton/FloatingActionButtonItem.js +8 -0
- package/FloatingActionButton/FloatingActionButtonItem.mjs +93 -0
- package/FloatingActionButton/utils.js +8 -0
- package/FloatingActionButton/utils.mjs +46 -0
- package/ListButton/ButtonItem.js +8 -0
- package/ListButton/ButtonItem.mjs +63 -0
- package/ListButton/DropDownButton.js +8 -0
- package/ListButton/DropDownButton.mjs +267 -0
- package/ListButton/DropDownButtonItem.js +8 -0
- package/ListButton/DropDownButtonItem.mjs +31 -0
- package/ListButton/SplitButton.js +8 -0
- package/ListButton/SplitButton.mjs +298 -0
- package/ListButton/SplitButtonItem.js +8 -0
- package/ListButton/SplitButtonItem.mjs +30 -0
- package/ListButton/utils/navigation.js +8 -0
- package/ListButton/utils/navigation.mjs +35 -0
- package/ListButton/utils/popup.js +8 -0
- package/ListButton/utils/popup.mjs +20 -0
- package/dist/cdn/js/kendo-react-buttons.js +8 -5
- package/index.d.mts +2227 -5
- package/index.d.ts +2227 -40
- package/index.js +8 -5
- package/index.mjs +44 -1906
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +3 -3
- package/toolbar/Toolbar.js +8 -0
- package/toolbar/Toolbar.mjs +124 -0
- package/toolbar/tools/ToolbarItem.js +8 -0
- package/toolbar/tools/ToolbarItem.mjs +44 -0
- package/toolbar/tools/ToolbarSeparator.js +8 -0
- package/toolbar/tools/ToolbarSeparator.mjs +21 -0
- package/toolbar/tools/ToolbarSpacer.js +8 -0
- package/toolbar/tools/ToolbarSpacer.mjs +36 -0
- package/util.js +8 -0
- package/util.mjs +36 -0
- package/Button.d.ts +0 -146
- package/ButtonGroup.d.ts +0 -36
- package/ButtonGroupInterface.d.ts +0 -36
- package/ButtonInterface.d.ts +0 -39
- package/Chip/Chip.d.ts +0 -238
- package/Chip/ChipList.d.ts +0 -119
- package/Chip/chip-list-contexts.d.ts +0 -17
- package/Chip/data-reducer.d.ts +0 -26
- package/Chip/focus-reducer.d.ts +0 -28
- package/Chip/selection-reducer.d.ts +0 -34
- package/FloatingActionButton/FloatingActionButton.d.ts +0 -21
- package/FloatingActionButton/FloatingActionButtonItem.d.ts +0 -109
- package/FloatingActionButton/interfaces/FloatingActionButtonHandle.d.ts +0 -17
- package/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.d.ts +0 -28
- package/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +0 -219
- package/FloatingActionButton/models/align-offset.d.ts +0 -24
- package/FloatingActionButton/models/align.d.ts +0 -31
- package/FloatingActionButton/models/events.d.ts +0 -25
- package/FloatingActionButton/models/position-mode.d.ts +0 -13
- package/FloatingActionButton/models/rounded.d.ts +0 -16
- package/FloatingActionButton/models/size.d.ts +0 -15
- package/FloatingActionButton/models/theme-color.d.ts +0 -22
- package/FloatingActionButton/utils.d.ts +0 -31
- package/ListButton/ButtonItem.d.ts +0 -34
- package/ListButton/DropDownButton.d.ts +0 -127
- package/ListButton/DropDownButtonItem.d.ts +0 -34
- package/ListButton/SplitButton.d.ts +0 -129
- package/ListButton/SplitButtonItem.d.ts +0 -29
- package/ListButton/models/ButtonItem.d.ts +0 -38
- package/ListButton/models/ListButtonProps.d.ts +0 -339
- package/ListButton/models/PopupSettings.d.ts +0 -32
- package/ListButton/models/events.d.ts +0 -51
- package/ListButton/utils/navigation.d.ts +0 -9
- package/ListButton/utils/popup.d.ts +0 -13
- package/models/index.d.ts +0 -92
- package/package-metadata.d.ts +0 -9
- package/toolbar/Toolbar.d.ts +0 -175
- package/toolbar/tools/ToolbarItem.d.ts +0 -42
- package/toolbar/tools/ToolbarSeparator.d.ts +0 -20
- package/toolbar/tools/ToolbarSpacer.d.ts +0 -27
- package/util.d.ts +0 -31
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import t from "react";
|
|
10
|
+
const o = t.createContext([null, (e) => {
|
|
11
|
+
}]), s = t.createContext([null, (e) => {
|
|
12
|
+
}]), a = t.createContext([null, (e) => {
|
|
13
|
+
}]);
|
|
14
|
+
export {
|
|
15
|
+
a as ChipListDataContext,
|
|
16
|
+
s as ChipListFocusContext,
|
|
17
|
+
o as ChipListSelectionContext
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var d=(e=>(e.remove="remove",e.add="add",e.reorder="reorder",e))(d||{});const t=(e,r)=>{switch(r.type){case"add":break;case"remove":return e.filter(a=>a[r.valueField]!==r.payload);case"reorder":break;default:return e}};exports.CHIP_DATA_ACTION=d;exports.dataReducer=t;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
var a = /* @__PURE__ */ ((e) => (e.remove = "remove", e.add = "add", e.reorder = "reorder", e))(a || {});
|
|
10
|
+
const o = (e, r) => {
|
|
11
|
+
switch (r.type) {
|
|
12
|
+
case "add":
|
|
13
|
+
break;
|
|
14
|
+
case "remove":
|
|
15
|
+
return e.filter((d) => d[r.valueField] !== r.payload);
|
|
16
|
+
case "reorder":
|
|
17
|
+
break;
|
|
18
|
+
default:
|
|
19
|
+
return e;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
a as CHIP_DATA_ACTION,
|
|
24
|
+
o as dataReducer
|
|
25
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var u=(e=>(e.next="next",e.prev="prev",e.current="current",e.reset="reset",e))(u||{});const s=(e,r)=>{const t=r.items.findIndex(n=>n===e);switch(r.type){case"next":return t===r.items.length-1?e:r.items[t+1];case"prev":return t===0?e:r.items[t-1];case"current":return r.payload;case"reset":return null;default:return e}};exports.FOCUS_ACTION=u;exports.focusReducer=s;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
var u = /* @__PURE__ */ ((e) => (e.next = "next", e.prev = "prev", e.current = "current", e.reset = "reset", e))(u || {});
|
|
10
|
+
const s = (e, r) => {
|
|
11
|
+
const t = r.items.findIndex((n) => n === e);
|
|
12
|
+
switch (r.type) {
|
|
13
|
+
case "next":
|
|
14
|
+
return t === r.items.length - 1 ? e : r.items[t + 1];
|
|
15
|
+
case "prev":
|
|
16
|
+
return t === 0 ? e : r.items[t - 1];
|
|
17
|
+
case "current":
|
|
18
|
+
return r.payload;
|
|
19
|
+
case "reset":
|
|
20
|
+
return null;
|
|
21
|
+
default:
|
|
22
|
+
return e;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
u as FOCUS_ACTION,
|
|
27
|
+
s as focusReducer
|
|
28
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=(r=>(r.toggle="toggle",r.remove="remove",r))(n||{});const u=(r,e)=>{switch(e.selection){case"single":switch(e.type){case"toggle":{if(!Array.isArray(r)||r===null)return e.payload===r?null:e.payload;throw new Error("State cannot be an array in single selection")}case"remove":return e.payload===r?null:r;default:return r}case"multiple":switch(e.type){case"toggle":{if(Array.isArray(r))return r.some(l=>l===e.payload)?r.filter(l=>l!==e.payload):[...r,e.payload];if(r===null)return[e.payload];throw new Error("State cannot be non-array in multiple selection")}case"remove":return Array.isArray(r)?r.some(l=>l===e.payload)?r.filter(l=>l!==e.payload):[...r,e.payload]:r;default:return r}case"none":return null;default:return r}};exports.SELECTION_ACTION=n;exports.selectionReducer=u;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
var n = /* @__PURE__ */ ((r) => (r.toggle = "toggle", r.remove = "remove", r))(n || {});
|
|
10
|
+
const u = (r, e) => {
|
|
11
|
+
switch (e.selection) {
|
|
12
|
+
case "single":
|
|
13
|
+
switch (e.type) {
|
|
14
|
+
case "toggle": {
|
|
15
|
+
if (!Array.isArray(r) || r === null)
|
|
16
|
+
return e.payload === r ? null : e.payload;
|
|
17
|
+
throw new Error("State cannot be an array in single selection");
|
|
18
|
+
}
|
|
19
|
+
case "remove":
|
|
20
|
+
return e.payload === r ? null : r;
|
|
21
|
+
default:
|
|
22
|
+
return r;
|
|
23
|
+
}
|
|
24
|
+
case "multiple":
|
|
25
|
+
switch (e.type) {
|
|
26
|
+
case "toggle": {
|
|
27
|
+
if (Array.isArray(r))
|
|
28
|
+
return r.some((l) => l === e.payload) ? r.filter((l) => l !== e.payload) : [...r, e.payload];
|
|
29
|
+
if (r === null)
|
|
30
|
+
return [e.payload];
|
|
31
|
+
throw new Error("State cannot be non-array in multiple selection");
|
|
32
|
+
}
|
|
33
|
+
case "remove":
|
|
34
|
+
return Array.isArray(r) ? r.some((l) => l === e.payload) ? r.filter((l) => l !== e.payload) : [...r, e.payload] : r;
|
|
35
|
+
default:
|
|
36
|
+
return r;
|
|
37
|
+
}
|
|
38
|
+
case "none":
|
|
39
|
+
return null;
|
|
40
|
+
default:
|
|
41
|
+
return r;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
n as SELECTION_ACTION,
|
|
46
|
+
u as selectionReducer
|
|
47
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ke=require("react"),n=require("prop-types"),a=require("@progress/kendo-react-common"),ye=require("./FloatingActionButtonItem.js"),he=require("../package-metadata.js"),K=require("./utils.js"),Ce=require("@progress/kendo-react-popup");function ve(d){const g=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const r in d)if(r!=="default"){const k=Object.getOwnPropertyDescriptor(d,r);Object.defineProperty(g,r,k.get?k:{enumerable:!0,get:()=>d[r]})}}return g.default=d,Object.freeze(g)}const t=ve(ke),Ie=2,Ee=100,z=t.forwardRef((d,g)=>{a.validatePackage(he.packageMetadata);const{align:r=C.align,alignOffset:k,className:B,disabled:f,icon:O,svgIcon:w,iconClass:$,id:j,items:s,item:Y,text:v,positionMode:A=C.positionMode,size:I=C.size,style:ee,rounded:E=C.rounded,themeColor:F=C.themeColor,overlayStyle:te,tabIndex:ae,accessKey:ne,popupSettings:D={},modal:oe,onClick:P,onItemClick:q,onFocus:R,onBlur:_,onKeyDown:W,onOpen:Z,onClose:H,...se}=d,L=a.useZIndexContext(),X=L?L+Ie:Ee,U=t.useRef(null),i=t.useRef(null),le=t.useRef(null),ie=t.useRef(null),G=t.useCallback(()=>{i.current&&i.current.focus()},[]),p=t.useCallback(()=>({element:i.current,focus:G}),[G]);t.useImperativeHandle(U,p),t.useImperativeHandle(g,()=>U.current);const[c,u]=t.useState(!1),[x,m]=t.useState(!1),[y,l]=t.useState(-1),re=a.useId()+"-button-id",M=a.useDir(i,d.dir),h=M==="rtl",N=a.useId()+"-list-id";t.useEffect(()=>{K.position(i,r,k,h)},[i,r,k,h]),t.useEffect(()=>{x&&i&&i.current&&i.current.focus()},[x,i]);const b=t.useCallback((e,o)=>{s&&a.dispatchEvent(o?Z:H,e,p(),void 0)},[Z,H,s]),J=t.useCallback(e=>{!e.target||f||(!s&&P?a.dispatchEvent(P,e,p(),void 0):(u(!c),m(!0),l(c?-1:0),b(e,!c)))},[u,m,l,P,b,c,s,f]),ce=t.useCallback(e=>{m(!0),l(c?0:-1),R&&a.dispatchEvent(R,e,p(),void 0)},[R,m,l]),ue=t.useCallback(e=>{m(!1),u(!1),l(-1),a.dispatchEvent(_,e,p(),void 0),c&&b(e,!1)},[_,m,u,l,b]),de=t.useCallback(e=>{e.preventDefault()},[]),S=t.useCallback((e,o)=>{s&&(s[o].disabled||a.dispatchEvent(q,e,p(),{itemProps:s[o],itemIndex:o}))},[q]),fe=t.useCallback((e,o)=>{!e.target||!s||(l(o),u(!1),S(e,o),b(e,!1))},[l,u,S,b]),pe=t.useCallback(e=>{a.getActiveElement(document)===i.current&&e.preventDefault()},[i]),me=t.useCallback(e=>{const o=y,T=s?s.length:-1;if(e.altKey){!c&&e.keyCode===a.Keys.down&&(e.preventDefault(),u(!0),l(0)),c&&e.keyCode===a.Keys.up&&(e.preventDefault(),u(!1),l(-1));return}switch(e.keyCode){case a.Keys.enter:case a.Keys.space:o>=0&&S(e,o),s||J(e),e.preventDefault(),u(!c),l(c?-1:0);break;case a.Keys.esc:e.preventDefault(),u(!1),l(-1);break;case a.Keys.home:e.preventDefault(),l(0);break;case a.Keys.end:e.preventDefault(),l(T-1);break;case a.Keys.down:case a.Keys.right:e.preventDefault(),l(o+1>=T?0:o+1);break;case a.Keys.up:case a.Keys.left:e.preventDefault(),l(o-1<0?T-1:o-1);break}a.dispatchEvent(W,e,p(),void 0)},[W,y,l,h,u]),be=t.useMemo(()=>a.classNames("k-fab k-fab-solid",{"k-fab-sm":I==="small","k-fab-md":I==="medium","k-fab-lg":I==="large","k-disabled":f,"k-pos-absolute":A==="absolute","k-pos-fixed":A==="fixed","k-focus":x,[`k-rounded-${a.kendoThemeMaps.roundedMap[E]||E}`]:E,[`k-fab-solid-${F}`]:F},`k-${r.vertical}-${r.horizontal}`,B),[F,I,E,f,A,r,x,B]),ge=s&&s.map((e,o)=>t.createElement(ye.FloatingActionButtonItem,{...e,key:o,index:o,id:`${N}-${o}`,disabled:f||e.disabled,focused:y===o,dataItem:e,item:Y,className:a.classNames(e.className,K.getTextDirectionClass(M||"ltr",r.horizontal)),onClick:fe,onDown:pe})),Q=!!((O||w)&&!v),V=(i.current?i.current.offsetWidth:0)/2-32/2;return t.createElement(a.ZIndexContext.Provider,{value:X},t.createElement(t.Fragment,null,t.createElement("button",{ref:i,id:j||re,role:"button",type:"button","aria-disabled":f,"aria-expanded":s?c:void 0,"aria-haspopup":!!s,"aria-label":`${v||""} floatingactionbutton`,"aria-owns":s?N:void 0,"aria-activedescendant":y>=0&&s?`${N}-${y}`:void 0,tabIndex:a.getTabIndex(ae,f),accessKey:ne,dir:M,disabled:f,className:be,style:ee,onClick:J,onMouseDown:de,onFocus:ce,onBlur:ue,onKeyDown:me,...se},O||w?t.createElement(a.IconWrap,{className:"k-fab-icon",name:O,icon:w}):$?t.createElement("span",{role:"presentation",className:$}):null,v&&t.createElement("span",{className:"k-fab-text"},v)),oe&&c&&t.createElement("div",{className:"k-overlay",style:{zIndex:X,...te}}),t.createElement(Ce.Popup,{ref:ie,anchor:i.current,show:c,animate:D.animate,popupClass:a.classNames("k-popup-transparent k-fab-popup",D.popupClass),anchorAlign:D.anchorAlign||K.getAnchorAlign(r,h),popupAlign:D.popupAlign||K.getPopupAlign(r,h),style:{boxShadow:"none"}},t.createElement("ul",{ref:le,role:"menu","aria-labelledby":j,id:N,className:a.classNames("k-fab-items",{"k-fab-items-bottom":r.vertical!=="bottom","k-fab-items-top":r.vertical==="bottom"}),style:{paddingLeft:Q?V:void 0,paddingRight:Q?V:void 0}},ge))))});z.propTypes={className:n.string,style:n.object,id:n.string,dir:n.string,tabIndex:n.number,accessKey:n.string,disabled:n.bool,icon:n.string,svgIcon:a.svgIconPropType,iconClass:n.string,text:n.string,alignOffset:n.shape({x:n.oneOfType([n.number,n.string]),y:n.oneOfType([n.number,n.string])}),align:n.shape({vertical:n.oneOf(["top","middle","bottom"]),horizontal:n.oneOf(["start","center","end"])}),positionMode:n.oneOf(["absolute","fixed"]),size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),themeColor:n.oneOf([null,"primary","secondary","tertiary","info","success","warning","error","dark","light","inverse"]),modal:n.bool,overlayStyle:n.object};const C={align:{vertical:"bottom",horizontal:"end"},size:"medium",rounded:"full",themeColor:"primary",positionMode:"fixed"};z.displayName="KendoFloatingActionButton";exports.FloatingActionButton=z;
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import o from "prop-types";
|
|
11
|
+
import { validatePackage as Ce, useZIndexContext as ye, useId as V, useDir as Ie, dispatchEvent as b, getActiveElement as ve, Keys as c, classNames as D, kendoThemeMaps as Ee, ZIndexContext as xe, getTabIndex as De, IconWrap as Ne, svgIconPropType as we } from "@progress/kendo-react-common";
|
|
12
|
+
import { FloatingActionButtonItem as Ae } from "./FloatingActionButtonItem.mjs";
|
|
13
|
+
import { packageMetadata as Fe } from "../package-metadata.mjs";
|
|
14
|
+
import { position as Oe, getTextDirectionClass as Re, getAnchorAlign as ze, getPopupAlign as Me } from "./utils.mjs";
|
|
15
|
+
import { Popup as Pe } from "@progress/kendo-react-popup";
|
|
16
|
+
const Te = 2, Be = 100, Y = t.forwardRef((T, ee) => {
|
|
17
|
+
Ce(Fe);
|
|
18
|
+
const {
|
|
19
|
+
align: u = h.align,
|
|
20
|
+
alignOffset: B,
|
|
21
|
+
className: $,
|
|
22
|
+
disabled: d,
|
|
23
|
+
icon: N,
|
|
24
|
+
svgIcon: w,
|
|
25
|
+
iconClass: K,
|
|
26
|
+
id: S,
|
|
27
|
+
items: n,
|
|
28
|
+
item: te,
|
|
29
|
+
text: C,
|
|
30
|
+
positionMode: A = h.positionMode,
|
|
31
|
+
size: y = h.size,
|
|
32
|
+
style: oe,
|
|
33
|
+
rounded: I = h.rounded,
|
|
34
|
+
themeColor: F = h.themeColor,
|
|
35
|
+
overlayStyle: ae,
|
|
36
|
+
tabIndex: ne,
|
|
37
|
+
accessKey: se,
|
|
38
|
+
popupSettings: v = {},
|
|
39
|
+
modal: le,
|
|
40
|
+
onClick: O,
|
|
41
|
+
onItemClick: W,
|
|
42
|
+
onFocus: R,
|
|
43
|
+
onBlur: Z,
|
|
44
|
+
onKeyDown: _,
|
|
45
|
+
onOpen: H,
|
|
46
|
+
onClose: j,
|
|
47
|
+
...re
|
|
48
|
+
} = T, L = ye(), X = L ? L + Te : Be, U = t.useRef(null), l = t.useRef(null), ie = t.useRef(null), ce = t.useRef(null), q = t.useCallback(
|
|
49
|
+
() => {
|
|
50
|
+
l.current && l.current.focus();
|
|
51
|
+
},
|
|
52
|
+
[]
|
|
53
|
+
), f = t.useCallback(
|
|
54
|
+
() => ({
|
|
55
|
+
element: l.current,
|
|
56
|
+
focus: q
|
|
57
|
+
}),
|
|
58
|
+
[q]
|
|
59
|
+
);
|
|
60
|
+
t.useImperativeHandle(U, f), t.useImperativeHandle(ee, () => U.current);
|
|
61
|
+
const [r, i] = t.useState(!1), [E, p] = t.useState(!1), [g, s] = t.useState(-1), ue = V() + "-button-id", z = Ie(l, T.dir), k = z === "rtl", x = V() + "-list-id";
|
|
62
|
+
t.useEffect(
|
|
63
|
+
() => {
|
|
64
|
+
Oe(l, u, B, k);
|
|
65
|
+
},
|
|
66
|
+
[l, u, B, k]
|
|
67
|
+
), t.useEffect(
|
|
68
|
+
() => {
|
|
69
|
+
E && l && l.current && l.current.focus();
|
|
70
|
+
},
|
|
71
|
+
[E, l]
|
|
72
|
+
);
|
|
73
|
+
const m = t.useCallback(
|
|
74
|
+
(e, a) => {
|
|
75
|
+
n && b(
|
|
76
|
+
a ? H : j,
|
|
77
|
+
e,
|
|
78
|
+
f(),
|
|
79
|
+
void 0
|
|
80
|
+
);
|
|
81
|
+
},
|
|
82
|
+
[H, j, n]
|
|
83
|
+
), G = t.useCallback(
|
|
84
|
+
(e) => {
|
|
85
|
+
!e.target || d || (!n && O ? b(
|
|
86
|
+
O,
|
|
87
|
+
e,
|
|
88
|
+
f(),
|
|
89
|
+
void 0
|
|
90
|
+
) : (i(!r), p(!0), s(r ? -1 : 0), m(e, !r)));
|
|
91
|
+
},
|
|
92
|
+
[
|
|
93
|
+
i,
|
|
94
|
+
p,
|
|
95
|
+
s,
|
|
96
|
+
O,
|
|
97
|
+
m,
|
|
98
|
+
r,
|
|
99
|
+
n,
|
|
100
|
+
d
|
|
101
|
+
]
|
|
102
|
+
), de = t.useCallback(
|
|
103
|
+
(e) => {
|
|
104
|
+
p(!0), s(r ? 0 : -1), R && b(
|
|
105
|
+
R,
|
|
106
|
+
e,
|
|
107
|
+
f(),
|
|
108
|
+
void 0
|
|
109
|
+
);
|
|
110
|
+
},
|
|
111
|
+
[R, p, s]
|
|
112
|
+
), fe = t.useCallback(
|
|
113
|
+
(e) => {
|
|
114
|
+
p(!1), i(!1), s(-1), b(
|
|
115
|
+
Z,
|
|
116
|
+
e,
|
|
117
|
+
f(),
|
|
118
|
+
void 0
|
|
119
|
+
), r && m(e, !1);
|
|
120
|
+
},
|
|
121
|
+
[Z, p, i, s, m]
|
|
122
|
+
), pe = t.useCallback(
|
|
123
|
+
(e) => {
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
},
|
|
126
|
+
[]
|
|
127
|
+
), M = t.useCallback(
|
|
128
|
+
(e, a) => {
|
|
129
|
+
n && (n[a].disabled || b(
|
|
130
|
+
W,
|
|
131
|
+
e,
|
|
132
|
+
f(),
|
|
133
|
+
{
|
|
134
|
+
itemProps: n[a],
|
|
135
|
+
itemIndex: a
|
|
136
|
+
}
|
|
137
|
+
));
|
|
138
|
+
},
|
|
139
|
+
[W]
|
|
140
|
+
), me = t.useCallback(
|
|
141
|
+
(e, a) => {
|
|
142
|
+
!e.target || !n || (s(a), i(!1), M(e, a), m(e, !1));
|
|
143
|
+
},
|
|
144
|
+
[s, i, M, m]
|
|
145
|
+
), be = t.useCallback(
|
|
146
|
+
(e) => {
|
|
147
|
+
ve(document) === l.current && e.preventDefault();
|
|
148
|
+
},
|
|
149
|
+
[l]
|
|
150
|
+
), ge = t.useCallback(
|
|
151
|
+
(e) => {
|
|
152
|
+
const a = g, P = n ? n.length : -1;
|
|
153
|
+
if (e.altKey) {
|
|
154
|
+
!r && e.keyCode === c.down && (e.preventDefault(), i(!0), s(0)), r && e.keyCode === c.up && (e.preventDefault(), i(!1), s(-1));
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
switch (e.keyCode) {
|
|
158
|
+
case c.enter:
|
|
159
|
+
case c.space:
|
|
160
|
+
a >= 0 && M(e, a), n || G(e), e.preventDefault(), i(!r), s(r ? -1 : 0);
|
|
161
|
+
break;
|
|
162
|
+
case c.esc:
|
|
163
|
+
e.preventDefault(), i(!1), s(-1);
|
|
164
|
+
break;
|
|
165
|
+
case c.home:
|
|
166
|
+
e.preventDefault(), s(0);
|
|
167
|
+
break;
|
|
168
|
+
case c.end:
|
|
169
|
+
e.preventDefault(), s(P - 1);
|
|
170
|
+
break;
|
|
171
|
+
case c.down:
|
|
172
|
+
case c.right:
|
|
173
|
+
e.preventDefault(), s(a + 1 >= P ? 0 : a + 1);
|
|
174
|
+
break;
|
|
175
|
+
case c.up:
|
|
176
|
+
case c.left:
|
|
177
|
+
e.preventDefault(), s(a - 1 < 0 ? P - 1 : a - 1);
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
b(
|
|
181
|
+
_,
|
|
182
|
+
e,
|
|
183
|
+
f(),
|
|
184
|
+
void 0
|
|
185
|
+
);
|
|
186
|
+
},
|
|
187
|
+
[_, g, s, k, i]
|
|
188
|
+
), ke = t.useMemo(
|
|
189
|
+
() => D(
|
|
190
|
+
"k-fab k-fab-solid",
|
|
191
|
+
{
|
|
192
|
+
"k-fab-sm": y === "small",
|
|
193
|
+
"k-fab-md": y === "medium",
|
|
194
|
+
"k-fab-lg": y === "large",
|
|
195
|
+
"k-disabled": d,
|
|
196
|
+
"k-pos-absolute": A === "absolute",
|
|
197
|
+
"k-pos-fixed": A === "fixed",
|
|
198
|
+
"k-focus": E,
|
|
199
|
+
[`k-rounded-${Ee.roundedMap[I] || I}`]: I,
|
|
200
|
+
[`k-fab-solid-${F}`]: F
|
|
201
|
+
},
|
|
202
|
+
`k-${u.vertical}-${u.horizontal}`,
|
|
203
|
+
$
|
|
204
|
+
),
|
|
205
|
+
[F, y, I, d, A, u, E, $]
|
|
206
|
+
), he = n && n.map((e, a) => /* @__PURE__ */ t.createElement(
|
|
207
|
+
Ae,
|
|
208
|
+
{
|
|
209
|
+
...e,
|
|
210
|
+
key: a,
|
|
211
|
+
index: a,
|
|
212
|
+
id: `${x}-${a}`,
|
|
213
|
+
disabled: d || e.disabled,
|
|
214
|
+
focused: g === a,
|
|
215
|
+
dataItem: e,
|
|
216
|
+
item: te,
|
|
217
|
+
className: D(
|
|
218
|
+
e.className,
|
|
219
|
+
Re(z || "ltr", u.horizontal)
|
|
220
|
+
),
|
|
221
|
+
onClick: me,
|
|
222
|
+
onDown: be
|
|
223
|
+
}
|
|
224
|
+
)), J = !!((N || w) && !C), Q = (l.current ? l.current.offsetWidth : 0) / 2 - 32 / 2;
|
|
225
|
+
return /* @__PURE__ */ t.createElement(xe.Provider, { value: X }, /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
226
|
+
"button",
|
|
227
|
+
{
|
|
228
|
+
ref: l,
|
|
229
|
+
id: S || ue,
|
|
230
|
+
role: "button",
|
|
231
|
+
type: "button",
|
|
232
|
+
"aria-disabled": d,
|
|
233
|
+
"aria-expanded": n ? r : void 0,
|
|
234
|
+
"aria-haspopup": !!n,
|
|
235
|
+
"aria-label": `${C || ""} floatingactionbutton`,
|
|
236
|
+
"aria-owns": n ? x : void 0,
|
|
237
|
+
"aria-activedescendant": g >= 0 && n ? `${x}-${g}` : void 0,
|
|
238
|
+
tabIndex: De(ne, d),
|
|
239
|
+
accessKey: se,
|
|
240
|
+
dir: z,
|
|
241
|
+
disabled: d,
|
|
242
|
+
className: ke,
|
|
243
|
+
style: oe,
|
|
244
|
+
onClick: G,
|
|
245
|
+
onMouseDown: pe,
|
|
246
|
+
onFocus: de,
|
|
247
|
+
onBlur: fe,
|
|
248
|
+
onKeyDown: ge,
|
|
249
|
+
...re
|
|
250
|
+
},
|
|
251
|
+
N || w ? /* @__PURE__ */ t.createElement(Ne, { className: "k-fab-icon", name: N, icon: w }) : K ? /* @__PURE__ */ t.createElement("span", { role: "presentation", className: K }) : null,
|
|
252
|
+
C && /* @__PURE__ */ t.createElement("span", { className: "k-fab-text" }, C)
|
|
253
|
+
), le && r && /* @__PURE__ */ t.createElement(
|
|
254
|
+
"div",
|
|
255
|
+
{
|
|
256
|
+
className: "k-overlay",
|
|
257
|
+
style: {
|
|
258
|
+
zIndex: X,
|
|
259
|
+
...ae
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
), /* @__PURE__ */ t.createElement(
|
|
263
|
+
Pe,
|
|
264
|
+
{
|
|
265
|
+
ref: ce,
|
|
266
|
+
anchor: l.current,
|
|
267
|
+
show: r,
|
|
268
|
+
animate: v.animate,
|
|
269
|
+
popupClass: D("k-popup-transparent k-fab-popup", v.popupClass),
|
|
270
|
+
anchorAlign: v.anchorAlign || ze(u, k),
|
|
271
|
+
popupAlign: v.popupAlign || Me(u, k),
|
|
272
|
+
style: { boxShadow: "none" }
|
|
273
|
+
},
|
|
274
|
+
/* @__PURE__ */ t.createElement(
|
|
275
|
+
"ul",
|
|
276
|
+
{
|
|
277
|
+
ref: ie,
|
|
278
|
+
role: "menu",
|
|
279
|
+
"aria-labelledby": S,
|
|
280
|
+
id: x,
|
|
281
|
+
className: D("k-fab-items", {
|
|
282
|
+
"k-fab-items-bottom": u.vertical !== "bottom",
|
|
283
|
+
"k-fab-items-top": u.vertical === "bottom"
|
|
284
|
+
}),
|
|
285
|
+
style: {
|
|
286
|
+
paddingLeft: J ? Q : void 0,
|
|
287
|
+
paddingRight: J ? Q : void 0
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
he
|
|
291
|
+
)
|
|
292
|
+
)));
|
|
293
|
+
});
|
|
294
|
+
Y.propTypes = {
|
|
295
|
+
className: o.string,
|
|
296
|
+
style: o.object,
|
|
297
|
+
id: o.string,
|
|
298
|
+
dir: o.string,
|
|
299
|
+
tabIndex: o.number,
|
|
300
|
+
accessKey: o.string,
|
|
301
|
+
disabled: o.bool,
|
|
302
|
+
icon: o.string,
|
|
303
|
+
svgIcon: we,
|
|
304
|
+
iconClass: o.string,
|
|
305
|
+
text: o.string,
|
|
306
|
+
alignOffset: o.shape({
|
|
307
|
+
x: o.oneOfType([o.number, o.string]),
|
|
308
|
+
y: o.oneOfType([o.number, o.string])
|
|
309
|
+
}),
|
|
310
|
+
align: o.shape({
|
|
311
|
+
vertical: o.oneOf(["top", "middle", "bottom"]),
|
|
312
|
+
horizontal: o.oneOf(["start", "center", "end"])
|
|
313
|
+
}),
|
|
314
|
+
positionMode: o.oneOf(["absolute", "fixed"]),
|
|
315
|
+
size: o.oneOf([null, "small", "medium", "large"]),
|
|
316
|
+
rounded: o.oneOf([null, "small", "medium", "large", "full"]),
|
|
317
|
+
themeColor: o.oneOf([
|
|
318
|
+
null,
|
|
319
|
+
"primary",
|
|
320
|
+
"secondary",
|
|
321
|
+
"tertiary",
|
|
322
|
+
"info",
|
|
323
|
+
"success",
|
|
324
|
+
"warning",
|
|
325
|
+
"error",
|
|
326
|
+
"dark",
|
|
327
|
+
"light",
|
|
328
|
+
"inverse"
|
|
329
|
+
]),
|
|
330
|
+
modal: o.bool,
|
|
331
|
+
overlayStyle: o.object
|
|
332
|
+
};
|
|
333
|
+
const h = {
|
|
334
|
+
align: { vertical: "bottom", horizontal: "end" },
|
|
335
|
+
size: "medium",
|
|
336
|
+
rounded: "full",
|
|
337
|
+
themeColor: "primary",
|
|
338
|
+
positionMode: "fixed"
|
|
339
|
+
};
|
|
340
|
+
Y.displayName = "KendoFloatingActionButton";
|
|
341
|
+
export {
|
|
342
|
+
Y as FloatingActionButton
|
|
343
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),t=require("prop-types"),i=require("@progress/kendo-react-common");function T(o){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const a in o)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(o,a);Object.defineProperty(c,a,n.get?n:{enumerable:!0,get:()=>o[a]})}}return c.default=o,Object.freeze(c)}const e=T(R),u=e.forwardRef((o,c)=>{const{className:a,disabled:n,text:r,icon:d,style:k,id:y,focused:b,tabIndex:x,index:s,dataItem:C,item:N,svgIcon:f,onDown:p,onClick:m,...v}=o,l=e.useRef(null),g=e.useCallback(()=>{l.current&&l.current.focus()},[]),P=e.useCallback(()=>({element:l.current,focus:g}),[g]);e.useImperativeHandle(c,P);const j=e.useCallback(O=>{m&&s!==void 0&&!n&&m(O,s)},[m,s]),E=e.useMemo(()=>i.classNames("k-fab-item",{"k-focus":b,"k-disabled":n},a),[a,n,b]),I=N;return e.createElement("li",{ref:l,id:y,className:E,style:k,role:"menuitem",tabIndex:i.getTabIndex(x,n),"aria-disabled":n,"aria-label":`${r||""} floatingactionbutton item`,onClick:j,onMouseDown:p,onPointerDown:p,...v},I?e.createElement(I,{itemIndex:s,item:C}):e.createElement(e.Fragment,null,r&&e.createElement("span",{className:"k-fab-item-text"},r),d||f?e.createElement(i.IconWrap,{className:"k-fab-item-icon",name:d,icon:f}):null))});u.propTypes={className:t.string,style:t.object,children:t.any,disabled:t.bool,focused:t.bool,index:t.number,icon:t.string,svgIcon:i.svgIconPropType,text:t.string,tabIndex:t.number,customProp:t.any};u.displayName="KendoFloatingActionButtonItem";exports.FloatingActionButtonItem=u;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import t from "prop-types";
|
|
11
|
+
import { classNames as R, getTabIndex as T, IconWrap as h, svgIconPropType as D } from "@progress/kendo-react-common";
|
|
12
|
+
const f = e.forwardRef((p, I) => {
|
|
13
|
+
const {
|
|
14
|
+
className: c,
|
|
15
|
+
disabled: n,
|
|
16
|
+
text: s,
|
|
17
|
+
icon: i,
|
|
18
|
+
style: g,
|
|
19
|
+
id: k,
|
|
20
|
+
focused: m,
|
|
21
|
+
tabIndex: x,
|
|
22
|
+
index: o,
|
|
23
|
+
dataItem: y,
|
|
24
|
+
item: C,
|
|
25
|
+
svgIcon: r,
|
|
26
|
+
onDown: u,
|
|
27
|
+
onClick: l,
|
|
28
|
+
...N
|
|
29
|
+
} = p, a = e.useRef(null), d = e.useCallback(
|
|
30
|
+
() => {
|
|
31
|
+
a.current && a.current.focus();
|
|
32
|
+
},
|
|
33
|
+
[]
|
|
34
|
+
), v = e.useCallback(
|
|
35
|
+
() => ({
|
|
36
|
+
element: a.current,
|
|
37
|
+
focus: d
|
|
38
|
+
}),
|
|
39
|
+
[d]
|
|
40
|
+
);
|
|
41
|
+
e.useImperativeHandle(I, v);
|
|
42
|
+
const E = e.useCallback(
|
|
43
|
+
(P) => {
|
|
44
|
+
l && o !== void 0 && !n && l(P, o);
|
|
45
|
+
},
|
|
46
|
+
[l, o]
|
|
47
|
+
), w = e.useMemo(
|
|
48
|
+
() => R(
|
|
49
|
+
"k-fab-item",
|
|
50
|
+
{
|
|
51
|
+
"k-focus": m,
|
|
52
|
+
"k-disabled": n
|
|
53
|
+
},
|
|
54
|
+
c
|
|
55
|
+
),
|
|
56
|
+
[c, n, m]
|
|
57
|
+
), b = C;
|
|
58
|
+
return /* @__PURE__ */ e.createElement(
|
|
59
|
+
"li",
|
|
60
|
+
{
|
|
61
|
+
ref: a,
|
|
62
|
+
id: k,
|
|
63
|
+
className: w,
|
|
64
|
+
style: g,
|
|
65
|
+
role: "menuitem",
|
|
66
|
+
tabIndex: T(x, n),
|
|
67
|
+
"aria-disabled": n,
|
|
68
|
+
"aria-label": `${s || ""} floatingactionbutton item`,
|
|
69
|
+
onClick: E,
|
|
70
|
+
onMouseDown: u,
|
|
71
|
+
onPointerDown: u,
|
|
72
|
+
...N
|
|
73
|
+
},
|
|
74
|
+
b ? /* @__PURE__ */ e.createElement(b, { itemIndex: o, item: y }) : /* @__PURE__ */ e.createElement(e.Fragment, null, s && /* @__PURE__ */ e.createElement("span", { className: "k-fab-item-text" }, s), i || r ? /* @__PURE__ */ e.createElement(h, { className: "k-fab-item-icon", name: i, icon: r }) : null)
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
f.propTypes = {
|
|
78
|
+
className: t.string,
|
|
79
|
+
style: t.object,
|
|
80
|
+
children: t.any,
|
|
81
|
+
disabled: t.bool,
|
|
82
|
+
focused: t.bool,
|
|
83
|
+
index: t.number,
|
|
84
|
+
icon: t.string,
|
|
85
|
+
svgIcon: D,
|
|
86
|
+
text: t.string,
|
|
87
|
+
tabIndex: t.number,
|
|
88
|
+
customProp: t.any
|
|
89
|
+
};
|
|
90
|
+
f.displayName = "KendoFloatingActionButtonItem";
|
|
91
|
+
export {
|
|
92
|
+
f as FloatingActionButtonItem
|
|
93
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s="16px",n=o=>typeof o=="number"?o+"px":o,h=(o,e)=>{const t={horizontal:e?"right":"left",vertical:"bottom"};return o.horizontal==="end"&&(t.horizontal=e?"left":"right"),t},p=(o,e)=>{const t={horizontal:e?"right":"left",vertical:"top"};return o.horizontal==="end"&&(t.horizontal=e?"left":"right"),t},y=(o,e)=>{const t=e==="end"?"end":"start";return{rtl:{end:"k-text-left",start:"k-text-right"},ltr:{start:"k-text-left",end:"k-text-right"}}[o][t]},x=(o,e,t,c)=>{const i=e.horizontal,r=e.vertical;if(o.current){const l=t&&t.x!==void 0?n(t.x):s,d=t&&t.x!==void 0?`calc(50% + ${n(t.x)})`:"50%",u=t&&t.y!==void 0?n(t.y):s,a=t&&t.y!==void 0?`calc(50% + ${n(t.y)})`:"50%";o.current.style.setProperty(b(e,c),i==="center"?d:l),o.current.style.setProperty(g(e),r==="middle"?a:u),c&&((r==="top"||r==="bottom")&&i==="start"&&o.current.style.setProperty("left","unset"),r==="middle"&&i==="end"&&o.current.style.setProperty("right","unset"),r==="middle"&&i==="start"&&o.current.style.setProperty("left","unset"))}},b=(o,e)=>{const{horizontal:t}=o;return{end:e?"left":"right",center:"left",start:e?"right":"left"}[t||"end"]},g=o=>({top:"top",middle:"top",bottom:"bottom"})[o.vertical||"bottom"];exports.DEFAULT_OFFSET=s;exports.getAnchorAlign=h;exports.getPopupAlign=p;exports.getTextDirectionClass=y;exports.position=x;exports.toStringValues=n;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
const s = "16px", i = (o) => typeof o == "number" ? o + "px" : o, y = (o, r) => {
|
|
10
|
+
const t = { horizontal: r ? "right" : "left", vertical: "bottom" };
|
|
11
|
+
return o.horizontal === "end" && (t.horizontal = r ? "left" : "right"), t;
|
|
12
|
+
}, x = (o, r) => {
|
|
13
|
+
const t = { horizontal: r ? "right" : "left", vertical: "top" };
|
|
14
|
+
return o.horizontal === "end" && (t.horizontal = r ? "left" : "right"), t;
|
|
15
|
+
}, b = (o, r) => {
|
|
16
|
+
const t = r === "end" ? "end" : "start";
|
|
17
|
+
return {
|
|
18
|
+
rtl: { end: "k-text-left", start: "k-text-right" },
|
|
19
|
+
ltr: { start: "k-text-left", end: "k-text-right" }
|
|
20
|
+
}[o][t];
|
|
21
|
+
}, m = (o, r, t, c) => {
|
|
22
|
+
const n = r.horizontal, e = r.vertical;
|
|
23
|
+
if (o.current) {
|
|
24
|
+
const l = t && t.x !== void 0 ? i(t.x) : s, d = t && t.x !== void 0 ? `calc(50% + ${i(t.x)})` : "50%", h = t && t.y !== void 0 ? i(t.y) : s, u = t && t.y !== void 0 ? `calc(50% + ${i(t.y)})` : "50%";
|
|
25
|
+
o.current.style.setProperty(a(r, c), n === "center" ? d : l), o.current.style.setProperty(p(r), e === "middle" ? u : h), c && ((e === "top" || e === "bottom") && n === "start" && o.current.style.setProperty("left", "unset"), e === "middle" && n === "end" && o.current.style.setProperty("right", "unset"), e === "middle" && n === "start" && o.current.style.setProperty("left", "unset"));
|
|
26
|
+
}
|
|
27
|
+
}, a = (o, r) => {
|
|
28
|
+
const { horizontal: t } = o;
|
|
29
|
+
return {
|
|
30
|
+
end: r ? "left" : "right",
|
|
31
|
+
center: "left",
|
|
32
|
+
start: r ? "right" : "left"
|
|
33
|
+
}[t || "end"];
|
|
34
|
+
}, p = (o) => ({
|
|
35
|
+
top: "top",
|
|
36
|
+
middle: "top",
|
|
37
|
+
bottom: "bottom"
|
|
38
|
+
})[o.vertical || "bottom"];
|
|
39
|
+
export {
|
|
40
|
+
s as DEFAULT_OFFSET,
|
|
41
|
+
y as getAnchorAlign,
|
|
42
|
+
x as getPopupAlign,
|
|
43
|
+
b as getTextDirectionClass,
|
|
44
|
+
m as position,
|
|
45
|
+
i as toStringValues
|
|
46
|
+
};
|