@progress/kendo-react-editor 14.5.0-develop.8 → 15.0.0-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/Editor.js +1 -1
- package/Editor.mjs +94 -78
- package/EditorMcpWrapper.d.ts +17 -0
- package/EditorMcpWrapper.js +8 -0
- package/EditorMcpWrapper.mjs +18 -0
- package/EditorProps.d.ts +17 -0
- package/README.md +4 -4
- package/config/toolsSettings.js +1 -1
- package/config/toolsSettings.mjs +2 -2
- package/dist/cdn/js/kendo-react-editor.js +1 -1
- package/index.d.mts +5 -3
- package/index.d.ts +5 -3
- package/index.js +1 -1
- package/index.mjs +138 -136
- package/messages/index.d.ts +4 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +202 -198
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +18 -13
- package/tools/align.js +1 -1
- package/tools/align.mjs +19 -18
- package/tools/indent.js +1 -1
- package/tools/indent.mjs +18 -17
- package/tools/index.js +1 -1
- package/tools/index.mjs +78 -78
- package/tools/inlineFormat.js +1 -1
- package/tools/inlineFormat.mjs +23 -22
- package/tools/outdent.js +1 -1
- package/tools/outdent.mjs +23 -22
- package/tools/proseMirrorTool.js +1 -1
- package/tools/proseMirrorTool.mjs +19 -18
- package/tools/table-wizard/tableCellProperties.js +1 -1
- package/tools/table-wizard/tableCellProperties.mjs +6 -6
package/tools/outdent.mjs
CHANGED
|
@@ -5,44 +5,45 @@
|
|
|
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 f from "react";
|
|
9
9
|
import { Button as N } from "@progress/kendo-react-buttons";
|
|
10
|
-
import { isIndented as O, canOutdentAsListItem as
|
|
11
|
-
import { onDownPreventDefault as
|
|
10
|
+
import { isIndented as O, canOutdentAsListItem as h, liftListItem as I, indentBlocks as y } from "@progress/kendo-editor-common";
|
|
11
|
+
import { onDownPreventDefault as S } from "./utils.mjs";
|
|
12
12
|
import { registerForLocalization as k, provideLocalizationService as z } from "@progress/kendo-react-intl";
|
|
13
|
-
import { messages as
|
|
13
|
+
import { messages as v } from "../messages/index.mjs";
|
|
14
14
|
import { classNames as w } from "@progress/kendo-react-common";
|
|
15
|
-
var
|
|
16
|
-
((
|
|
17
|
-
|
|
18
|
-
const
|
|
15
|
+
var L;
|
|
16
|
+
((T) => {
|
|
17
|
+
T.createOutdentTool = (t) => {
|
|
18
|
+
const i = class extends f.Component {
|
|
19
19
|
render() {
|
|
20
|
-
const { view: o, render:
|
|
20
|
+
const { view: o, render: r, ...a } = this.props, e = o && o.state, c = a.dir, l = !!e && O(e, t.actions, c), d = e && e.schema.nodes[t.listsTypes.listItem], m = !!e && h(e, { nodes: t.actions, listsTypes: t.listsTypes }), b = l || m, p = z(this), s = t.messages.title, n = !b, u = /* @__PURE__ */ f.createElement(
|
|
21
21
|
N,
|
|
22
22
|
{
|
|
23
|
-
onClick:
|
|
24
|
-
o &&
|
|
23
|
+
onClick: n ? void 0 : () => {
|
|
24
|
+
o && m && d ? I(d)(o.state, o.dispatch) : o && l && y(
|
|
25
25
|
t.actions,
|
|
26
26
|
t.commandName,
|
|
27
|
-
|
|
27
|
+
c
|
|
28
28
|
)(o.state, o.dispatch);
|
|
29
29
|
},
|
|
30
|
-
"aria-disabled":
|
|
31
|
-
title:
|
|
32
|
-
|
|
30
|
+
"aria-disabled": n ? !0 : void 0,
|
|
31
|
+
title: p.toLanguageString(s, v[s]),
|
|
32
|
+
"aria-label": p.toLanguageString(s, v[s]),
|
|
33
|
+
...S,
|
|
33
34
|
...t.props,
|
|
34
|
-
...
|
|
35
|
-
className: w(
|
|
36
|
-
"k-disabled":
|
|
35
|
+
...a,
|
|
36
|
+
className: w(a.className, t.props.className, {
|
|
37
|
+
"k-disabled": n
|
|
37
38
|
})
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
|
-
return
|
|
41
|
+
return r ? r.call(void 0, u, { view: o }) : u;
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
|
-
return k(
|
|
44
|
+
return k(i), i;
|
|
44
45
|
};
|
|
45
|
-
})(
|
|
46
|
+
})(L || (L = {}));
|
|
46
47
|
export {
|
|
47
|
-
|
|
48
|
+
L as OutdentToolNS
|
|
48
49
|
};
|
package/tools/proseMirrorTool.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 f=require("react"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),v=require("@progress/kendo-react-buttons"),P=require("./utils.js"),m=require("@progress/kendo-react-intl"),p=require("../messages/index.js"),N=require("@progress/kendo-react-common");function S(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const b=S(f),k=(e,o)=>{const t=class extends b.Component{render(){const{view:r,render:c,...i}=this.props,l=m.provideLocalizationService(this),a=e.messages.title,u=r&&r.state,s=u?!o(u):!1,d=b.createElement(v.Button,{onClick:s?void 0:()=>r&&o(r.state,g=>r.dispatch(g.setMeta("commandName",e.commandName))),"aria-disabled":s?!0:void 0,...P.onDownPreventDefault,title:l.toLanguageString(a,p.messages[a]),"aria-label":l.toLanguageString(a,p.messages[a]),...e.props,...i,className:N.classNames(i.className,e.props.className,{"k-disabled":s})});return c?c.call(void 0,d,{view:r}):d}};return m.registerForLocalization(t),t};exports.createProseMirrorTool=k;
|
|
@@ -5,35 +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
|
|
8
|
+
import * as p from "react";
|
|
9
9
|
import { Button as f } from "@progress/kendo-react-buttons";
|
|
10
|
-
import { onDownPreventDefault as
|
|
11
|
-
import { registerForLocalization as
|
|
12
|
-
import { messages as
|
|
13
|
-
import { classNames as
|
|
14
|
-
const
|
|
15
|
-
const
|
|
10
|
+
import { onDownPreventDefault as v } from "./utils.mjs";
|
|
11
|
+
import { registerForLocalization as b, provideLocalizationService as g } from "@progress/kendo-react-intl";
|
|
12
|
+
import { messages as d } from "../messages/index.mjs";
|
|
13
|
+
import { classNames as N } from "@progress/kendo-react-common";
|
|
14
|
+
const T = (e, a) => {
|
|
15
|
+
const s = class extends p.Component {
|
|
16
16
|
render() {
|
|
17
|
-
const { view: o, render:
|
|
17
|
+
const { view: o, render: i, ...n } = this.props, l = g(this), t = e.messages.title, c = o && o.state, r = c ? !a(c) : !1, m = /* @__PURE__ */ p.createElement(
|
|
18
18
|
f,
|
|
19
19
|
{
|
|
20
|
-
onClick:
|
|
20
|
+
onClick: r ? void 0 : () => o && a(
|
|
21
21
|
o.state,
|
|
22
|
-
(
|
|
22
|
+
(u) => o.dispatch(u.setMeta("commandName", e.commandName))
|
|
23
23
|
),
|
|
24
|
-
"aria-disabled":
|
|
25
|
-
...
|
|
26
|
-
title:
|
|
24
|
+
"aria-disabled": r ? !0 : void 0,
|
|
25
|
+
...v,
|
|
26
|
+
title: l.toLanguageString(t, d[t]),
|
|
27
|
+
"aria-label": l.toLanguageString(t, d[t]),
|
|
27
28
|
...e.props,
|
|
28
|
-
...
|
|
29
|
-
className:
|
|
29
|
+
...n,
|
|
30
|
+
className: N(n.className, e.props.className, { "k-disabled": r })
|
|
30
31
|
}
|
|
31
32
|
);
|
|
32
|
-
return
|
|
33
|
+
return i ? i.call(void 0, m, { view: o }) : m;
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
|
-
return
|
|
36
|
+
return b(s), s;
|
|
36
37
|
};
|
|
37
38
|
export {
|
|
38
|
-
|
|
39
|
+
T as createProseMirrorTool
|
|
39
40
|
};
|
|
@@ -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 ke=require("react"),x=require("@progress/kendo-react-buttons"),c=require("@progress/kendo-react-inputs"),g=require("@progress/kendo-react-dropdowns"),X=require("@progress/kendo-react-dialogs"),o=require("@progress/kendo-svg-icons"),n=require("../utils.js"),ee=require("@progress/kendo-react-common"),te=require("@progress/kendo-react-intl"),t=require("../../messages/index.js"),le=require("./cellPropsUtils.js");function ye(r){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const a in r)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(l,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}return l.default=r,Object.freeze(l)}const e=ye(ke),be=r=>{const{view:l,...a}=r,[i,p]=e.useState(!1),f=te.useLocalization(),b=!!(l&&n.parentNode(l.state.selection.$from,m=>m.type.spec.tableRole==="table")),k=e.useCallback(()=>{p(!0)},[]),u=e.useCallback(()=>{p(!1),l==null||l.focus()},[l]),y=e.useCallback(m=>{if(l&&m){const d=le.applyCellsData(l.state,m);d.docChanged&&l.dispatch(d)}u()},[l,u]);return e.createElement(e.Fragment,null,e.createElement(x.Button,{type:"button",title:f.toLanguageString(t.keys.cellProperties,t.messages[t.keys.cellProperties]),icon:"table-cell-properties",svgIcon:o.tableCellPropertiesIcon,onClick:k,disabled:!b,...n.onDownPreventDefault,...a}),i&&l&&e.createElement(ve,{view:l,onCancel:u,onSave:y}))},Y=[{textKey:t.keys.cellPropertiesLeftTop,text:t.messages[t.keys.cellPropertiesLeftTop],icon:"table-align-top-left",svgIcon:o.tableAlignTopLeftIcon,value:{x:"left",y:"top"}},{textKey:t.keys.cellPropertiesCenterTop,text:t.messages[t.keys.cellPropertiesCenterTop],icon:"table-align-top-center",svgIcon:o.tableAlignTopCenterIcon,value:{x:"center",y:"top"}},{textKey:t.keys.cellPropertiesRightTop,text:t.messages[t.keys.cellPropertiesRightTop],icon:"table-align-top-right",svgIcon:o.tableAlignTopRightIcon,value:{x:"right",y:"top"}},{textKey:t.keys.cellPropertiesLeftMiddle,text:t.messages[t.keys.cellPropertiesLeftMiddle],icon:"table-align-middle-left",svgIcon:o.tableAlignMiddleLeftIcon,value:{x:"left",y:"middle"}},{textKey:t.keys.cellPropertiesCenterMiddle,text:t.messages[t.keys.cellPropertiesCenterMiddle],icon:"table-align-middle-center",svgIcon:o.tableAlignMiddleCenterIcon,value:{x:"center",y:"middle"}},{textKey:t.keys.cellPropertiesRightMiddle,text:t.messages[t.keys.cellPropertiesRightMiddle],icon:"table-align-middle-right",svgIcon:o.tableAlignMiddleRightIcon,value:{x:"right",y:"middle"}},{textKey:t.keys.cellPropertiesLeftBottom,text:t.messages[t.keys.cellPropertiesLeftBottom],icon:"table-align-bottom-left",svgIcon:o.tableAlignBottomLeftIcon,value:{x:"left",y:"bottom"}},{textKey:t.keys.cellPropertiesCenterBottom,text:t.messages[t.keys.cellPropertiesCenterBottom],icon:"table-align-bottom-center",svgIcon:o.tableAlignBottomCenterIcon,value:{x:"center",y:"bottom"}},{textKey:t.keys.cellPropertiesRightBottom,text:t.messages[t.keys.cellPropertiesRightBottom],icon:"table-align-bottom-right",svgIcon:o.tableAlignBottomRightIcon,value:{x:"right",y:"bottom"}},{textKey:t.keys.cellPropertiesNoAlignment,text:t.messages[t.keys.cellPropertiesNoAlignment],icon:"align-remove",svgIcon:o.tableAlignRemoveIcon,value:{x:"",y:""}}],Z=[{textKey:t.keys.cellPropertiesWrap,text:t.messages[t.keys.cellPropertiesWrap],value:"",icon:"text-wrap",svgIcon:o.textWrapIcon},{textKey:t.keys.cellPropertiesFitToCell,text:t.messages[t.keys.cellPropertiesFitToCell],value:"nowrap",icon:"parameter-string",svgIcon:o.parameterStringIcon}],P=(r,l)=>l?e.createElement(e.Fragment,null,e.createElement(c.InputPrefix,null,e.createElement(ee.IconWrap,{icon:l.svgIcon,name:l.icon})),r):r,E=(r,l)=>{const a=e.createElement(e.Fragment,null,e.createElement(c.InputPrefix,null,e.createElement(ee.IconWrap,{icon:l.dataItem.svgIcon,name:l.dataItem.icon})),r.props.children);return e.cloneElement(r,r.props,a)},ve=r=>{const l=e.useMemo(()=>le.cellsDefaultData(r.view.state),[r.view]),a=te.useLocalization(),i=e.useRef(null),p=l.applyToAll,f=e.useRef(null),b=l.cellWidth,k=e.useRef(null);l.widthUnit&&!n.units.includes(l.widthUnit)&&n.units.push(l.widthUnit);const u=l.widthUnit||"",y=e.useRef(null),m=l.cellHeight,d=e.useRef(null);l.heightUnit&&!n.units.includes(l.heightUnit)&&n.units.push(l.heightUnit);const ae=l.heightUnit||"",C=e.useRef(null),re=Y.find(s=>s.value.x!==void 0&&l.alignment&&s.value.x===l.alignment.x&&s.value.y===l.alignment.y)||null,N=e.useRef(null),se=Z.find(s=>s.value===l.textControl),S=e.useRef(null),ne=l.backgroundColor,v=e.useRef(null),oe=l.cellPadding,h=e.useRef(null),ce=l.borderWidth,I=e.useRef(null),ie=l.borderColor,w=e.useRef(null),me=n.borderStyles.find(s=>s.value===l.borderStyle),R=e.useRef(null),ue=l.id,L=e.useRef(null),de=l.className,ge=e.useCallback(()=>{var D,T,A,B,W,K,U,V,M,q,z,F,H,O,j,_,$,G,J,Q;const s={applyToAll:!!((T=(D=i.current)==null?void 0:D.element)!=null&&T.checked),cellWidth:((A=f.current)==null?void 0:A.value)||null,widthUnit:((B=k.current)==null?void 0:B.value)||"",cellHeight:((W=y.current)==null?void 0:W.value)||null,heightUnit:((K=d.current)==null?void 0:K.value)||"",alignment:(V=(U=C.current)==null?void 0:U.value)==null?void 0:V.value,textControl:(q=(M=N.current)==null?void 0:M.value)==null?void 0:q.value,backgroundColor:(z=S.current)==null?void 0:z.value,cellPadding:typeof((F=v.current)==null?void 0:F.value)=="number"?(H=v.current)==null?void 0:H.value:null,borderWidth:typeof((O=h.current)==null?void 0:O.value)=="number"?(j=h.current)==null?void 0:j.value:null,borderColor:(_=I.current)==null?void 0:_.value,borderStyle:((G=($=w.current)==null?void 0:$.value)==null?void 0:G.value)||null,id:String(((J=R.current)==null?void 0:J.value)||""),className:String(((Q=L.current)==null?void 0:Q.value)||"")};r.onSave.call(void 0,s)},[r.onSave]),pe=e.createElement("div",{className:"k-form k-form-md"},e.createElement("fieldset",{className:"k-form-fieldset"},e.createElement("div",{className:"k-form-layout k-d-grid k-grid-cols-4 k-gap-x-4"},e.createElement("div",{className:"k-form-field k-col-span-full"},e.createElement("div",{className:"k-form-field-wrap"},e.createElement("span",{className:"k-checkbox-wrap"},e.createElement(c.Checkbox,{ref:i,defaultChecked:p})),e.createElement("label",{className:"k-checkbox-label"},a.toLanguageString(t.keys.cellPropertiesApplyToAllCells,t.messages[t.keys.cellPropertiesApplyToAllCells])))),e.createElement("div",{className:"k-form-field k-col-span-1"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesWidth,t.messages[t.keys.cellPropertiesWidth])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.NumericTextBox,{ref:f,defaultValue:b,min:0,placeholder:a.toLanguageString(t.keys.sizeAuto,t.messages[t.keys.sizeAuto])}),e.createElement("div",{className:"k-form-hint"},a.toLanguageString(t.keys.cellPropertiesApplyToColumn,t.messages[t.keys.cellPropertiesApplyToColumn])))),e.createElement("div",{className:"k-form-field k-col-span-1"},e.createElement("label",{className:"k-label k-form-label"}," "),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(g.AutoComplete,{ref:k,defaultValue:u,data:n.units,popupSettings:n.popupSettings}))),e.createElement("div",{className:"k-form-field k-col-span-1"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesHeight,t.messages[t.keys.cellPropertiesHeight])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.NumericTextBox,{ref:y,defaultValue:m,min:0,placeholder:a.toLanguageString(t.keys.sizeAuto,t.messages[t.keys.sizeAuto])}),e.createElement("div",{className:"k-form-hint"},a.toLanguageString(t.keys.cellPropertiesApplyToRow,t.messages[t.keys.cellPropertiesApplyToRow])))),e.createElement("div",{className:"k-form-field k-col-span-1"},e.createElement("label",{className:"k-label k-form-label"}," "),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(g.AutoComplete,{ref:d,defaultValue:ae,data:n.units,popupSettings:n.popupSettings}))),e.createElement("div",{className:"k-form-field k-col-span-2"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesAlignment,t.messages[t.keys.cellPropertiesAlignment])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(g.DropDownList,{ref:C,defaultValue:re,data:Y.map(s=>({...s,text:a.toLanguageString(s.textKey,s.text)})),textField:"text",dataItemKey:"text",popupSettings:n.popupSettings,valueRender:P,itemRender:E}))),e.createElement("div",{className:"k-form-field k-col-span-2"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesTextControl,t.messages[t.keys.cellPropertiesTextControl])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(g.DropDownList,{ref:N,defaultValue:se,data:Z.map(s=>({...s,text:a.toLanguageString(s.textKey,s.text)})),textField:"text",dataItemKey:"value",popupSettings:n.popupSettings,valueRender:P,itemRender:E}))),e.createElement("div",{className:"k-form-field k-col-span-2"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesCellPadding,t.messages[t.keys.cellPropertiesCellPadding])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.NumericTextBox,{ref:v,defaultValue:oe,min:0}))),e.createElement("div",{className:"k-form-field k-col-span-2"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesBackground,t.messages[t.keys.cellPropertiesBackground])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.ColorPicker,{ref:S,defaultValue:ne}))),e.createElement("div",{className:"k-form-field k-col-span-1"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesBorderWidth,t.messages[t.keys.cellPropertiesBorderWidth])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.NumericTextBox,{ref:h,defaultValue:ce,min:0}))),e.createElement("div",{className:"k-form-field k-col-span-1"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesBorderColor,t.messages[t.keys.cellPropertiesBorderColor])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.ColorPicker,{ref:I,defaultValue:ie}))),e.createElement("div",{className:"k-form-field k-col-span-2"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesBorderStyle,t.messages[t.keys.cellPropertiesBorderStyle])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(g.DropDownList,{ref:w,defaultValue:me,popupSettings:n.popupSettings,data:n.borderStyles,textField:"text",dataItemKey:"value"}))),e.createElement("div",{className:"k-form-field k-col-span-full"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesId,t.messages[t.keys.cellPropertiesId])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.TextBox,{ref:R,defaultValue:ue}))),e.createElement("div",{className:"k-form-field k-col-span-full"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesCssClass,t.messages[t.keys.cellPropertiesCssClass])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.TextBox,{ref:L,defaultValue:de})))))),fe=[e.createElement(x.Button,{onClick:r.onCancel,key:"cancel"},a.toLanguageString(t.keys.cellPropertiesCancel,t.messages[t.keys.cellPropertiesCancel])),e.createElement(x.Button,{themeColor:"primary",key:"save",onClick:ge},a.toLanguageString(t.keys.cellPropertiesSave,t.messages[t.keys.cellPropertiesSave]))];return e.createElement(X.Window,{className:"k-editor-window k-editor-table-wizard-window",title:a.toLanguageString(t.keys.cellProperties,t.messages[t.keys.cellProperties]),onClose:r.onCancel,key:"dialog",style:{userSelect:"none"},width:408,height:587,modal:!0,minimizeButton:()=>null,maximizeButton:()=>null,resizable:!1},pe,e.createElement(X.WindowActionsBar,{layout:"end"},...fe))};exports.TableCellProperties=be;exports.itemRenderWithIcon=E;exports.valueRenderWithIcon=P;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ke=require("react"),x=require("@progress/kendo-react-buttons"),c=require("@progress/kendo-react-inputs"),g=require("@progress/kendo-react-dropdowns"),X=require("@progress/kendo-react-dialogs"),n=require("@progress/kendo-svg-icons"),o=require("../utils.js"),ee=require("@progress/kendo-react-common"),te=require("@progress/kendo-react-intl"),t=require("../../messages/index.js"),le=require("./cellPropsUtils.js");function ye(r){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const a in r)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(l,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}return l.default=r,Object.freeze(l)}const e=ye(ke),be=r=>{const{view:l,...a}=r,[i,p]=e.useState(!1),f=te.useLocalization(),b=!!(l&&o.parentNode(l.state.selection.$from,m=>m.type.spec.tableRole==="table")),k=e.useCallback(()=>{p(!0)},[]),u=e.useCallback(()=>{p(!1),l==null||l.focus()},[l]),y=e.useCallback(m=>{if(l&&m){const d=le.applyCellsData(l.state,m);d.docChanged&&l.dispatch(d)}u()},[l,u]);return e.createElement(e.Fragment,null,e.createElement(x.Button,{type:"button",title:f.toLanguageString(t.keys.cellProperties,t.messages[t.keys.cellProperties]),icon:"table-cell-properties",svgIcon:n.tableCellPropertiesIcon,onClick:k,disabled:!b,...o.onDownPreventDefault,...a}),i&&l&&e.createElement(ve,{view:l,onCancel:u,onSave:y}))},Y=[{textKey:t.keys.cellPropertiesLeftTop,text:t.messages[t.keys.cellPropertiesLeftTop],icon:"table-align-top-left",svgIcon:n.tableAlignTopLeftIcon,value:{x:"left",y:"top"}},{textKey:t.keys.cellPropertiesCenterTop,text:t.messages[t.keys.cellPropertiesCenterTop],icon:"table-align-top-center",svgIcon:n.tableAlignTopCenterIcon,value:{x:"center",y:"top"}},{textKey:t.keys.cellPropertiesRightTop,text:t.messages[t.keys.cellPropertiesRightTop],icon:"table-align-top-right",svgIcon:n.tableAlignTopRightIcon,value:{x:"right",y:"top"}},{textKey:t.keys.cellPropertiesLeftMiddle,text:t.messages[t.keys.cellPropertiesLeftMiddle],icon:"table-align-middle-left",svgIcon:n.tableAlignMiddleLeftIcon,value:{x:"left",y:"middle"}},{textKey:t.keys.cellPropertiesCenterMiddle,text:t.messages[t.keys.cellPropertiesCenterMiddle],icon:"table-align-middle-center",svgIcon:n.tableAlignMiddleCenterIcon,value:{x:"center",y:"middle"}},{textKey:t.keys.cellPropertiesRightMiddle,text:t.messages[t.keys.cellPropertiesRightMiddle],icon:"table-align-middle-right",svgIcon:n.tableAlignMiddleRightIcon,value:{x:"right",y:"middle"}},{textKey:t.keys.cellPropertiesLeftBottom,text:t.messages[t.keys.cellPropertiesLeftBottom],icon:"table-align-bottom-left",svgIcon:n.tableAlignBottomLeftIcon,value:{x:"left",y:"bottom"}},{textKey:t.keys.cellPropertiesCenterBottom,text:t.messages[t.keys.cellPropertiesCenterBottom],icon:"table-align-bottom-center",svgIcon:n.tableAlignBottomCenterIcon,value:{x:"center",y:"bottom"}},{textKey:t.keys.cellPropertiesRightBottom,text:t.messages[t.keys.cellPropertiesRightBottom],icon:"table-align-bottom-right",svgIcon:n.tableAlignBottomRightIcon,value:{x:"right",y:"bottom"}},{textKey:t.keys.cellPropertiesNoAlignment,text:t.messages[t.keys.cellPropertiesNoAlignment],icon:"align-remove",svgIcon:n.tableAlignRemoveIcon,value:{x:"",y:""}}],Z=[{textKey:t.keys.cellPropertiesWrap,text:t.messages[t.keys.cellPropertiesWrap],value:"",icon:"text-wrap-arrow",svgIcon:n.textWrapArrowIcon},{textKey:t.keys.cellPropertiesFitToCell,text:t.messages[t.keys.cellPropertiesFitToCell],value:"nowrap",icon:"parameter-string",svgIcon:n.parameterStringIcon}],P=(r,l)=>l?e.createElement(e.Fragment,null,e.createElement(c.InputPrefix,null,e.createElement(ee.IconWrap,{icon:l.svgIcon,name:l.icon})),r):r,E=(r,l)=>{const a=e.createElement(e.Fragment,null,e.createElement(c.InputPrefix,null,e.createElement(ee.IconWrap,{icon:l.dataItem.svgIcon,name:l.dataItem.icon})),r.props.children);return e.cloneElement(r,r.props,a)},ve=r=>{const l=e.useMemo(()=>le.cellsDefaultData(r.view.state),[r.view]),a=te.useLocalization(),i=e.useRef(null),p=l.applyToAll,f=e.useRef(null),b=l.cellWidth,k=e.useRef(null);l.widthUnit&&!o.units.includes(l.widthUnit)&&o.units.push(l.widthUnit);const u=l.widthUnit||"",y=e.useRef(null),m=l.cellHeight,d=e.useRef(null);l.heightUnit&&!o.units.includes(l.heightUnit)&&o.units.push(l.heightUnit);const ae=l.heightUnit||"",C=e.useRef(null),re=Y.find(s=>s.value.x!==void 0&&l.alignment&&s.value.x===l.alignment.x&&s.value.y===l.alignment.y)||null,N=e.useRef(null),se=Z.find(s=>s.value===l.textControl),S=e.useRef(null),oe=l.backgroundColor,v=e.useRef(null),ne=l.cellPadding,h=e.useRef(null),ce=l.borderWidth,I=e.useRef(null),ie=l.borderColor,w=e.useRef(null),me=o.borderStyles.find(s=>s.value===l.borderStyle),R=e.useRef(null),ue=l.id,L=e.useRef(null),de=l.className,ge=e.useCallback(()=>{var D,T,A,B,W,K,U,V,M,q,z,F,H,O,j,_,$,G,J,Q;const s={applyToAll:!!((T=(D=i.current)==null?void 0:D.element)!=null&&T.checked),cellWidth:((A=f.current)==null?void 0:A.value)||null,widthUnit:((B=k.current)==null?void 0:B.value)||"",cellHeight:((W=y.current)==null?void 0:W.value)||null,heightUnit:((K=d.current)==null?void 0:K.value)||"",alignment:(V=(U=C.current)==null?void 0:U.value)==null?void 0:V.value,textControl:(q=(M=N.current)==null?void 0:M.value)==null?void 0:q.value,backgroundColor:(z=S.current)==null?void 0:z.value,cellPadding:typeof((F=v.current)==null?void 0:F.value)=="number"?(H=v.current)==null?void 0:H.value:null,borderWidth:typeof((O=h.current)==null?void 0:O.value)=="number"?(j=h.current)==null?void 0:j.value:null,borderColor:(_=I.current)==null?void 0:_.value,borderStyle:((G=($=w.current)==null?void 0:$.value)==null?void 0:G.value)||null,id:String(((J=R.current)==null?void 0:J.value)||""),className:String(((Q=L.current)==null?void 0:Q.value)||"")};r.onSave.call(void 0,s)},[r.onSave]),pe=e.createElement("div",{className:"k-form k-form-md"},e.createElement("fieldset",{className:"k-form-fieldset"},e.createElement("div",{className:"k-form-layout k-d-grid k-grid-cols-4 k-gap-x-4"},e.createElement("div",{className:"k-form-field k-col-span-full"},e.createElement("div",{className:"k-form-field-wrap"},e.createElement("span",{className:"k-checkbox-wrap"},e.createElement(c.Checkbox,{ref:i,defaultChecked:p})),e.createElement("label",{className:"k-checkbox-label"},a.toLanguageString(t.keys.cellPropertiesApplyToAllCells,t.messages[t.keys.cellPropertiesApplyToAllCells])))),e.createElement("div",{className:"k-form-field k-col-span-1"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesWidth,t.messages[t.keys.cellPropertiesWidth])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.NumericTextBox,{ref:f,defaultValue:b,min:0,placeholder:a.toLanguageString(t.keys.sizeAuto,t.messages[t.keys.sizeAuto])}),e.createElement("div",{className:"k-form-hint"},a.toLanguageString(t.keys.cellPropertiesApplyToColumn,t.messages[t.keys.cellPropertiesApplyToColumn])))),e.createElement("div",{className:"k-form-field k-col-span-1"},e.createElement("label",{className:"k-label k-form-label"}," "),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(g.AutoComplete,{ref:k,defaultValue:u,data:o.units,popupSettings:o.popupSettings}))),e.createElement("div",{className:"k-form-field k-col-span-1"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesHeight,t.messages[t.keys.cellPropertiesHeight])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.NumericTextBox,{ref:y,defaultValue:m,min:0,placeholder:a.toLanguageString(t.keys.sizeAuto,t.messages[t.keys.sizeAuto])}),e.createElement("div",{className:"k-form-hint"},a.toLanguageString(t.keys.cellPropertiesApplyToRow,t.messages[t.keys.cellPropertiesApplyToRow])))),e.createElement("div",{className:"k-form-field k-col-span-1"},e.createElement("label",{className:"k-label k-form-label"}," "),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(g.AutoComplete,{ref:d,defaultValue:ae,data:o.units,popupSettings:o.popupSettings}))),e.createElement("div",{className:"k-form-field k-col-span-2"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesAlignment,t.messages[t.keys.cellPropertiesAlignment])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(g.DropDownList,{ref:C,defaultValue:re,data:Y.map(s=>({...s,text:a.toLanguageString(s.textKey,s.text)})),textField:"text",dataItemKey:"text",popupSettings:o.popupSettings,valueRender:P,itemRender:E}))),e.createElement("div",{className:"k-form-field k-col-span-2"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesTextControl,t.messages[t.keys.cellPropertiesTextControl])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(g.DropDownList,{ref:N,defaultValue:se,data:Z.map(s=>({...s,text:a.toLanguageString(s.textKey,s.text)})),textField:"text",dataItemKey:"value",popupSettings:o.popupSettings,valueRender:P,itemRender:E}))),e.createElement("div",{className:"k-form-field k-col-span-2"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesCellPadding,t.messages[t.keys.cellPropertiesCellPadding])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.NumericTextBox,{ref:v,defaultValue:ne,min:0}))),e.createElement("div",{className:"k-form-field k-col-span-2"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesBackground,t.messages[t.keys.cellPropertiesBackground])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.ColorPicker,{ref:S,defaultValue:oe}))),e.createElement("div",{className:"k-form-field k-col-span-1"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesBorderWidth,t.messages[t.keys.cellPropertiesBorderWidth])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.NumericTextBox,{ref:h,defaultValue:ce,min:0}))),e.createElement("div",{className:"k-form-field k-col-span-1"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesBorderColor,t.messages[t.keys.cellPropertiesBorderColor])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.ColorPicker,{ref:I,defaultValue:ie}))),e.createElement("div",{className:"k-form-field k-col-span-2"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesBorderStyle,t.messages[t.keys.cellPropertiesBorderStyle])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(g.DropDownList,{ref:w,defaultValue:me,popupSettings:o.popupSettings,data:o.borderStyles,textField:"text",dataItemKey:"value"}))),e.createElement("div",{className:"k-form-field k-col-span-full"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesId,t.messages[t.keys.cellPropertiesId])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.TextBox,{ref:R,defaultValue:ue}))),e.createElement("div",{className:"k-form-field k-col-span-full"},e.createElement("label",{className:"k-label k-form-label"},a.toLanguageString(t.keys.cellPropertiesCssClass,t.messages[t.keys.cellPropertiesCssClass])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(c.TextBox,{ref:L,defaultValue:de})))))),fe=[e.createElement(x.Button,{onClick:r.onCancel,key:"cancel"},a.toLanguageString(t.keys.cellPropertiesCancel,t.messages[t.keys.cellPropertiesCancel])),e.createElement(x.Button,{themeColor:"primary",key:"save",onClick:ge},a.toLanguageString(t.keys.cellPropertiesSave,t.messages[t.keys.cellPropertiesSave]))];return e.createElement(X.Window,{className:"k-editor-window k-editor-table-wizard-window",title:a.toLanguageString(t.keys.cellProperties,t.messages[t.keys.cellProperties]),onClose:r.onCancel,key:"dialog",style:{userSelect:"none"},width:408,height:587,modal:!0,minimizeButton:()=>null,maximizeButton:()=>null,resizable:!1},pe,e.createElement(X.WindowActionsBar,{layout:"end"},...fe))};exports.TableCellProperties=be;exports.itemRenderWithIcon=E;exports.valueRenderWithIcon=P;
|
|
@@ -10,7 +10,7 @@ import { Button as x } from "@progress/kendo-react-buttons";
|
|
|
10
10
|
import { Checkbox as Ee, NumericTextBox as k, ColorPicker as X, TextBox as Y, InputPrefix as re } from "@progress/kendo-react-inputs";
|
|
11
11
|
import { AutoComplete as Z, DropDownList as P } from "@progress/kendo-react-dropdowns";
|
|
12
12
|
import { Window as Pe, WindowActionsBar as xe } from "@progress/kendo-react-dialogs";
|
|
13
|
-
import { tableCellPropertiesIcon as Ce, tableAlignTopLeftIcon as ye, tableAlignTopCenterIcon as Ne, tableAlignTopRightIcon as Se, tableAlignMiddleLeftIcon as we, tableAlignMiddleCenterIcon as Ie, tableAlignMiddleRightIcon as Re, tableAlignBottomLeftIcon as
|
|
13
|
+
import { tableCellPropertiesIcon as Ce, tableAlignTopLeftIcon as ye, tableAlignTopCenterIcon as Ne, tableAlignTopRightIcon as Se, tableAlignMiddleLeftIcon as we, tableAlignMiddleCenterIcon as Ie, tableAlignMiddleRightIcon as Re, tableAlignBottomLeftIcon as Ae, tableAlignBottomCenterIcon as Le, tableAlignBottomRightIcon as Te, tableAlignRemoveIcon as De, textWrapArrowIcon as Be, parameterStringIcon as We } from "@progress/kendo-svg-icons";
|
|
14
14
|
import { parentNode as Ke, onDownPreventDefault as Ue, units as i, borderStyles as _, popupSettings as d } from "../utils.mjs";
|
|
15
15
|
import { IconWrap as oe } from "@progress/kendo-react-common";
|
|
16
16
|
import { useLocalization as ne } from "@progress/kendo-react-intl";
|
|
@@ -91,14 +91,14 @@ const Ye = (n) => {
|
|
|
91
91
|
textKey: l.cellPropertiesLeftBottom,
|
|
92
92
|
text: a[l.cellPropertiesLeftBottom],
|
|
93
93
|
icon: "table-align-bottom-left",
|
|
94
|
-
svgIcon:
|
|
94
|
+
svgIcon: Ae,
|
|
95
95
|
value: { x: "left", y: "bottom" }
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
textKey: l.cellPropertiesCenterBottom,
|
|
99
99
|
text: a[l.cellPropertiesCenterBottom],
|
|
100
100
|
icon: "table-align-bottom-center",
|
|
101
|
-
svgIcon:
|
|
101
|
+
svgIcon: Le,
|
|
102
102
|
value: { x: "center", y: "bottom" }
|
|
103
103
|
},
|
|
104
104
|
{
|
|
@@ -120,7 +120,7 @@ const Ye = (n) => {
|
|
|
120
120
|
textKey: l.cellPropertiesWrap,
|
|
121
121
|
text: a[l.cellPropertiesWrap],
|
|
122
122
|
value: "",
|
|
123
|
-
icon: "text-wrap",
|
|
123
|
+
icon: "text-wrap-arrow",
|
|
124
124
|
svgIcon: Be
|
|
125
125
|
},
|
|
126
126
|
{
|
|
@@ -141,9 +141,9 @@ const Ye = (n) => {
|
|
|
141
141
|
const ce = t.heightUnit || "", C = e.useRef(null), ie = ee.find(
|
|
142
142
|
(o) => o.value.x !== void 0 && t.alignment && o.value.x === t.alignment.x && o.value.y === t.alignment.y
|
|
143
143
|
) || null, y = e.useRef(null), se = le.find((o) => o.value === t.textControl), N = e.useRef(null), me = t.backgroundColor, h = e.useRef(null), de = t.cellPadding, E = e.useRef(null), ue = t.borderWidth, S = e.useRef(null), fe = t.borderColor, w = e.useRef(null), ge = _.find((o) => o.value === t.borderStyle), I = e.useRef(null), pe = t.id, R = e.useRef(null), be = t.className, ke = e.useCallback(() => {
|
|
144
|
-
var
|
|
144
|
+
var A, L, T, D, B, W, K, U, V, M, z, F, H, $, j, q, G, J, O, Q;
|
|
145
145
|
const o = {
|
|
146
|
-
applyToAll: !!((
|
|
146
|
+
applyToAll: !!((L = (A = u.current) == null ? void 0 : A.element) != null && L.checked),
|
|
147
147
|
cellWidth: ((T = g.current) == null ? void 0 : T.value) || null,
|
|
148
148
|
widthUnit: ((D = p.current) == null ? void 0 : D.value) || "",
|
|
149
149
|
cellHeight: ((B = b.current) == null ? void 0 : B.value) || null,
|