@progress/kendo-vue-buttons 8.4.0-develop.3 → 8.4.0-develop.5
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.d.ts +8 -9
- package/Chip/Chip.d.ts +0 -6
- package/Chip/Chip.js +1 -1
- package/Chip/Chip.mjs +63 -68
- package/FloatingActionButton/FloatingActionButton.d.ts +3 -5
- package/FloatingActionButton/FloatingActionButton.js +1 -1
- package/FloatingActionButton/FloatingActionButton.mjs +45 -41
- package/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +2 -8
- package/FloatingActionButton/models/theme-color.d.ts +3 -9
- package/ListButton/ButtonItem.d.ts +0 -6
- package/ListButton/ButtonItem.js +1 -1
- package/ListButton/ButtonItem.mjs +9 -14
- package/ListButton/DropDownButton.d.ts +8 -5
- package/ListButton/DropDownButton.js +1 -1
- package/ListButton/DropDownButton.mjs +105 -101
- package/ListButton/SplitButton.d.ts +4 -4
- package/ListButton/SplitButton.js +1 -1
- package/ListButton/SplitButton.mjs +47 -49
- package/ListButton/models/ListButtonProps.d.ts +8 -8
- package/SegmentedControl/SegmentedControl.d.ts +2 -2
- package/SegmentedControl/interfaces/SegmentedControlTypes.d.ts +1 -0
- package/SmartPasteButton/SmartPasteButton.d.ts +6 -6
- package/SpeechToText/SpeechToTextButton.d.ts +4 -4
- package/SpeechToText/SpeechToTextButton.js +1 -1
- package/SpeechToText/SpeechToTextButton.mjs +16 -16
- package/dist/cdn/js/kendo-vue-buttons.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +11 -6
- package/toolbar/Toolbar.d.ts +2 -2
- package/toolbar/Toolbar.js +1 -1
- package/toolbar/Toolbar.mjs +2 -2
- package/ListButton/messages/index.d.ts +0 -17
package/Button.d.ts
CHANGED
|
@@ -19,14 +19,14 @@ export interface ButtonProps extends ButtonInterface {
|
|
|
19
19
|
* Configures the `size` of the Button.
|
|
20
20
|
*
|
|
21
21
|
* The available options are:
|
|
22
|
-
* -
|
|
22
|
+
* - xs
|
|
23
23
|
* - small
|
|
24
24
|
* - medium
|
|
25
25
|
* - large
|
|
26
26
|
*
|
|
27
27
|
* @default `undefined`
|
|
28
28
|
*/
|
|
29
|
-
size?: '
|
|
29
|
+
size?: 'xs' | 'small' | 'medium' | 'large';
|
|
30
30
|
/**
|
|
31
31
|
* Configures the `roundness` of the Button.
|
|
32
32
|
*
|
|
@@ -64,13 +64,12 @@ export interface ButtonProps extends ButtonInterface {
|
|
|
64
64
|
* - info
|
|
65
65
|
* - success
|
|
66
66
|
* - warning
|
|
67
|
-
* -
|
|
68
|
-
* - light
|
|
67
|
+
* - error
|
|
69
68
|
* - inverse
|
|
70
69
|
*
|
|
71
70
|
* @default `undefined`
|
|
72
71
|
*/
|
|
73
|
-
themeColor?: 'base' | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | '
|
|
72
|
+
themeColor?: 'base' | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | 'error' | 'inverse';
|
|
74
73
|
/**
|
|
75
74
|
* Sets the `tabIndex` property of the Button.
|
|
76
75
|
*/
|
|
@@ -165,10 +164,10 @@ declare const Button: import('vue').DefineComponent<import('vue').ExtractPropTyp
|
|
|
165
164
|
type: PropType<boolean>;
|
|
166
165
|
default: any;
|
|
167
166
|
};
|
|
168
|
-
size: PropType<"small" | "medium" | "
|
|
167
|
+
size: PropType<"small" | "medium" | "xs" | "large">;
|
|
169
168
|
rounded: PropType<"small" | "medium" | "large" | "full" | "none">;
|
|
170
169
|
fillMode: PropType<"flat" | "link" | "solid" | "outline">;
|
|
171
|
-
themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "
|
|
170
|
+
themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error" | "inverse">;
|
|
172
171
|
tabIndex: PropType<number>;
|
|
173
172
|
accessKey: PropType<string>;
|
|
174
173
|
id: PropType<string>;
|
|
@@ -243,10 +242,10 @@ declare const Button: import('vue').DefineComponent<import('vue').ExtractPropTyp
|
|
|
243
242
|
type: PropType<boolean>;
|
|
244
243
|
default: any;
|
|
245
244
|
};
|
|
246
|
-
size: PropType<"small" | "medium" | "
|
|
245
|
+
size: PropType<"small" | "medium" | "xs" | "large">;
|
|
247
246
|
rounded: PropType<"small" | "medium" | "large" | "full" | "none">;
|
|
248
247
|
fillMode: PropType<"flat" | "link" | "solid" | "outline">;
|
|
249
|
-
themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "
|
|
248
|
+
themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error" | "inverse">;
|
|
250
249
|
tabIndex: PropType<number>;
|
|
251
250
|
accessKey: PropType<string>;
|
|
252
251
|
id: PropType<string>;
|
package/Chip/Chip.d.ts
CHANGED
|
@@ -171,10 +171,6 @@ export interface ChipProps {
|
|
|
171
171
|
* For example these elements could contain error or hint message.
|
|
172
172
|
*/
|
|
173
173
|
ariaDescribedBy?: string;
|
|
174
|
-
/**
|
|
175
|
-
* Identifies the accessible name for the Chip component.
|
|
176
|
-
*/
|
|
177
|
-
ariaLabel?: string;
|
|
178
174
|
/**
|
|
179
175
|
* @hidden
|
|
180
176
|
*/
|
|
@@ -256,7 +252,6 @@ declare const Chip: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
256
252
|
default: string;
|
|
257
253
|
};
|
|
258
254
|
tabIndex: PropType<number>;
|
|
259
|
-
ariaLabel: PropType<string>;
|
|
260
255
|
onMousedown: PropType<(event: any) => void>;
|
|
261
256
|
}>, {
|
|
262
257
|
chipRef: import('vue').Ref<any, any>;
|
|
@@ -335,7 +330,6 @@ declare const Chip: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
335
330
|
default: string;
|
|
336
331
|
};
|
|
337
332
|
tabIndex: PropType<number>;
|
|
338
|
-
ariaLabel: PropType<string>;
|
|
339
333
|
onMousedown: PropType<(event: any) => void>;
|
|
340
334
|
}>> & Readonly<{
|
|
341
335
|
onClick?: (event: ChipMouseEvent) => any;
|
package/Chip/Chip.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 a=require("vue"),t=require("@progress/kendo-vue-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),t=require("@progress/kendo-vue-common"),p=require("@progress/kendo-svg-icons"),i=require("./focus-reducer.js"),y=require("./data-reducer.js"),n=require("./selection-reducer.js"),$=require("../package-metadata.js"),S=a.defineComponent({name:"KendoVueChip",props:{id:String,text:String,avatar:{type:[String,Function,Object],default:function(){}},value:[String,Object],dir:{type:String,default:function(){return"ltr"}},removable:{type:Boolean,default:!1},removeIcon:{type:String,default:function(){return"x-circle"}},removeSvgIcon:{type:Object,default:function(){return p.xCircleIcon}},disabled:{type:Boolean,default:!1},icon:String,svgIcon:Object,selectedIcon:{type:String,default:function(){return"check"}},selectedSvgIcon:{type:Object,default:function(){return p.checkIcon}},size:String,rounded:String,fillMode:{type:String,validator:function(e){return["flat","outline","solid"].includes(e)}},themeColor:{type:String,validator:function(e){return["base","error","info","success","warning"].includes(e)}},dataItem:Object,selected:Boolean,ariaDescribedBy:String,role:{type:String,default:"button"},tabIndex:Number,onMousedown:Function},emits:{click:e=>!0,keydown:e=>!0,blur:e=>!0,focus:e=>!0,remove:e=>!0},inject:{kendoSelection:{default:{value:null}},kendoFocused:{default:{value:null}},kendoDataItems:{default:null},handleDispatchDataItems:{default:t.noop},handleDispatchSelection:{default:t.noop},handleDispatchFocus:{default:t.noop}},created(){this.currentDir=void 0,t.validatePackage($.packageMetadata)},mounted(){this.chip=t.getRef(this,"chip"),this.currentDir=this.$props.dir!==void 0?this.$props.dir==="rtl":this.$el&&getComputedStyle(this.$el).direction==="rtl"||!1},updated(){this.kendoFocused.value===this.$props.value&&this.$el&&this.$el.focus()},computed:{currentSelected(){return this.$props.selected||(Array.isArray(this.kendoSelection.value)?this.kendoSelection.value.some(e=>e===this.$props.value):this.kendoSelection.value===this.$props.value)},chipLabelClass(){return{"k-chip-label":!0}}},methods:{computedFocused(){return this.kendoFocused.value===this.$props.value},handleMouseDown(e){this.$emit("mousedown",e)},handleClick(e){this.handleDispatchSelection&&this.handleDispatchSelection({type:n.SELECTION_ACTION.toggle,payload:this.$props.value,event:e}),this.$emit("click",{target:this.target,event:e})},handleRemove(e){e.stopPropagation(),this.$props.removable&&(this.handleDispatchFocus&&(this.handleDispatchDataItems({type:y.DATA_ACTION.remove,payload:this.$props.value,event:e}),this.handleDispatchFocus({type:i.FOCUS_ACTION.reset,payload:this.$props.value,event:e}),this.handleDispatchSelection({type:n.SELECTION_ACTION.remove,payload:this.$props.value,event:e})),this.$emit("remove",{target:this.target,event:e}))},handleKeyDown(e){switch(e.keyCode){case t.Keys.left:this.handleDispatchFocus&&this.handleDispatchFocus({type:i.FOCUS_ACTION.prev,payload:this.$props.value,event:e});break;case t.Keys.right:this.handleDispatchFocus&&this.handleDispatchFocus({type:i.FOCUS_ACTION.next,payload:this.$props.value,event:e});break;case t.Keys.enter:this.handleDispatchFocus&&this.handleDispatchSelection({type:n.SELECTION_ACTION.toggle,payload:this.$props.value,event:e});break;case t.Keys.delete:this.handleRemove(e);break}this.$emit("keydown",{target:this.target,event:e})},handleFocus(e){this.handleDispatchFocus&&this.handleDispatchFocus({payload:this.$props.value,type:i.FOCUS_ACTION.current,event:e}),this.$emit("focus",{target:this.target,event:e})},handleBlur(e){this.$emit("blur",{target:this.target,event:e})}},setup(){return{chipRef:a.ref(null)}},render(){const{size:e,rounded:o,themeColor:r,fillMode:l,avatar:s,icon:c,svgIcon:d,selectedIcon:h,selectedSvgIcon:u,removeIcon:m,removeSvgIcon:v}=this.$props,f=t.templateRendering.call(this,s,t.getListeners.call(this)),g=s?a.createVNode("div",{class:`k-chip-avatar k-avatar k-rounded-${s.rounded||"medium"} k-avatar-${t.kendoThemeMaps.sizeMap[e]||e} k-avatar-solid k-avatar-solid-primary`,style:s.style},[a.createVNode("span",{class:"k-avatar-image"},[a.createVNode("img",{src:s.imageUrl,alt:s.imageAlt},null)])]):null,k=t.getTemplate.call(this,{h:a.h,template:f});return a.createVNode("div",{role:this.$props.role,id:this.$props.value,ref:t.setRef(this,"chip"),dir:this.currentDir,tabindex:t.getTabIndex(this.$props.tabIndex,this.$props.disabled,void 0),class:t.classNames("k-chip",{"k-rtl":this.currentDir==="rtl","k-disabled":this.$props.disabled,"k-selected":this.currentSelected,"k-focus":this.computedFocused(),[`k-chip-${t.kendoThemeMaps.sizeMap[e]||e}`]:e,[`k-rounded-${t.kendoThemeMaps.roundedMap[o]||o}`]:o,[`k-chip-${r}`]:r,[`k-chip-${l}`]:l}),"aria-pressed":this.$props.role==="button"?this.currentSelected:void 0,"aria-selected":this.$props.role==="option"?this.currentSelected:void 0,"aria-disabled":this.$props.disabled,"aria-describedby":this.$props.ariaDescribedBy,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleClick,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown},[this.currentSelected&&(h||u)&&a.createVNode(t.Icon,{name:t.getIconName(h),icon:u,size:"small"},null),(c||d)&&a.createVNode(t.Icon,{name:t.getIconName(c),icon:d,size:"small"},null),s?s.imageUrl?g:k:null,a.createVNode("span",{class:"k-chip-content"},[this.$props.text&&a.createVNode("span",{"aria-label":this.$props.text,class:this.chipLabelClass},[this.$props.text])]),this.$props.removable&&a.createVNode("span",{class:"k-chip-actions"},[a.createVNode("span",{class:"k-chip-action k-chip-remove-action"},[a.createVNode(t.Icon,{name:t.getIconName(m),icon:v,size:"small",onClick:this.handleRemove},null)])])])}});exports.Chip=S;
|
package/Chip/Chip.mjs
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { noop as
|
|
10
|
-
import { checkIcon as
|
|
11
|
-
import { FOCUS_ACTION as
|
|
12
|
-
import { DATA_ACTION as
|
|
13
|
-
import { SELECTION_ACTION as
|
|
14
|
-
import { packageMetadata as
|
|
15
|
-
const
|
|
8
|
+
import { defineComponent as S, createVNode as t, h as D, ref as I } from "vue";
|
|
9
|
+
import { noop as o, templateRendering as F, getListeners as C, kendoThemeMaps as n, getTemplate as w, classNames as x, getTabIndex as M, setRef as O, Icon as l, getIconName as c, Keys as a, getRef as R, validatePackage as T } from "@progress/kendo-vue-common";
|
|
10
|
+
import { checkIcon as A, xCircleIcon as B } from "@progress/kendo-svg-icons";
|
|
11
|
+
import { FOCUS_ACTION as s } from "./focus-reducer.mjs";
|
|
12
|
+
import { DATA_ACTION as N } from "./data-reducer.mjs";
|
|
13
|
+
import { SELECTION_ACTION as d } from "./selection-reducer.mjs";
|
|
14
|
+
import { packageMetadata as j } from "../package-metadata.mjs";
|
|
15
|
+
const V = /* @__PURE__ */ S({
|
|
16
16
|
name: "KendoVueChip",
|
|
17
17
|
props: {
|
|
18
18
|
id: String,
|
|
@@ -42,7 +42,7 @@ const q = /* @__PURE__ */ D({
|
|
|
42
42
|
removeSvgIcon: {
|
|
43
43
|
type: Object,
|
|
44
44
|
default: function() {
|
|
45
|
-
return
|
|
45
|
+
return B;
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
disabled: {
|
|
@@ -60,7 +60,7 @@ const q = /* @__PURE__ */ D({
|
|
|
60
60
|
selectedSvgIcon: {
|
|
61
61
|
type: Object,
|
|
62
62
|
default: function() {
|
|
63
|
-
return
|
|
63
|
+
return A;
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
size: String,
|
|
@@ -85,7 +85,6 @@ const q = /* @__PURE__ */ D({
|
|
|
85
85
|
default: "button"
|
|
86
86
|
},
|
|
87
87
|
tabIndex: Number,
|
|
88
|
-
ariaLabel: String,
|
|
89
88
|
onMousedown: Function
|
|
90
89
|
},
|
|
91
90
|
emits: {
|
|
@@ -110,20 +109,20 @@ const q = /* @__PURE__ */ D({
|
|
|
110
109
|
default: null
|
|
111
110
|
},
|
|
112
111
|
handleDispatchDataItems: {
|
|
113
|
-
default:
|
|
112
|
+
default: o
|
|
114
113
|
},
|
|
115
114
|
handleDispatchSelection: {
|
|
116
|
-
default:
|
|
115
|
+
default: o
|
|
117
116
|
},
|
|
118
117
|
handleDispatchFocus: {
|
|
119
|
-
default:
|
|
118
|
+
default: o
|
|
120
119
|
}
|
|
121
120
|
},
|
|
122
121
|
created() {
|
|
123
|
-
this.currentDir = void 0,
|
|
122
|
+
this.currentDir = void 0, T(j);
|
|
124
123
|
},
|
|
125
124
|
mounted() {
|
|
126
|
-
this.chip =
|
|
125
|
+
this.chip = R(this, "chip"), this.currentDir = this.$props.dir !== void 0 ? this.$props.dir === "rtl" : this.$el && getComputedStyle(this.$el).direction === "rtl" || !1;
|
|
127
126
|
},
|
|
128
127
|
updated() {
|
|
129
128
|
this.kendoFocused.value === this.$props.value && this.$el && this.$el.focus();
|
|
@@ -147,7 +146,7 @@ const q = /* @__PURE__ */ D({
|
|
|
147
146
|
},
|
|
148
147
|
handleClick(e) {
|
|
149
148
|
this.handleDispatchSelection && this.handleDispatchSelection({
|
|
150
|
-
type:
|
|
149
|
+
type: d.toggle,
|
|
151
150
|
payload: this.$props.value,
|
|
152
151
|
event: e
|
|
153
152
|
}), this.$emit("click", {
|
|
@@ -157,15 +156,15 @@ const q = /* @__PURE__ */ D({
|
|
|
157
156
|
},
|
|
158
157
|
handleRemove(e) {
|
|
159
158
|
e.stopPropagation(), this.$props.removable && (this.handleDispatchFocus && (this.handleDispatchDataItems({
|
|
160
|
-
type:
|
|
159
|
+
type: N.remove,
|
|
161
160
|
payload: this.$props.value,
|
|
162
161
|
event: e
|
|
163
162
|
}), this.handleDispatchFocus({
|
|
164
|
-
type:
|
|
163
|
+
type: s.reset,
|
|
165
164
|
payload: this.$props.value,
|
|
166
165
|
event: e
|
|
167
166
|
}), this.handleDispatchSelection({
|
|
168
|
-
type:
|
|
167
|
+
type: d.remove,
|
|
169
168
|
payload: this.$props.value,
|
|
170
169
|
event: e
|
|
171
170
|
})), this.$emit("remove", {
|
|
@@ -175,28 +174,28 @@ const q = /* @__PURE__ */ D({
|
|
|
175
174
|
},
|
|
176
175
|
handleKeyDown(e) {
|
|
177
176
|
switch (e.keyCode) {
|
|
178
|
-
case
|
|
177
|
+
case a.left:
|
|
179
178
|
this.handleDispatchFocus && this.handleDispatchFocus({
|
|
180
|
-
type:
|
|
179
|
+
type: s.prev,
|
|
181
180
|
payload: this.$props.value,
|
|
182
181
|
event: e
|
|
183
182
|
});
|
|
184
183
|
break;
|
|
185
|
-
case
|
|
184
|
+
case a.right:
|
|
186
185
|
this.handleDispatchFocus && this.handleDispatchFocus({
|
|
187
|
-
type:
|
|
186
|
+
type: s.next,
|
|
188
187
|
payload: this.$props.value,
|
|
189
188
|
event: e
|
|
190
189
|
});
|
|
191
190
|
break;
|
|
192
|
-
case
|
|
191
|
+
case a.enter:
|
|
193
192
|
this.handleDispatchFocus && this.handleDispatchSelection({
|
|
194
|
-
type:
|
|
193
|
+
type: d.toggle,
|
|
195
194
|
payload: this.$props.value,
|
|
196
195
|
event: e
|
|
197
196
|
});
|
|
198
197
|
break;
|
|
199
|
-
case
|
|
198
|
+
case a.delete:
|
|
200
199
|
this.handleRemove(e);
|
|
201
200
|
break;
|
|
202
201
|
}
|
|
@@ -208,7 +207,7 @@ const q = /* @__PURE__ */ D({
|
|
|
208
207
|
handleFocus(e) {
|
|
209
208
|
this.handleDispatchFocus && this.handleDispatchFocus({
|
|
210
209
|
payload: this.$props.value,
|
|
211
|
-
type:
|
|
210
|
+
type: s.current,
|
|
212
211
|
event: e
|
|
213
212
|
}), this.$emit("focus", {
|
|
214
213
|
target: this.target,
|
|
@@ -224,88 +223,84 @@ const q = /* @__PURE__ */ D({
|
|
|
224
223
|
},
|
|
225
224
|
setup() {
|
|
226
225
|
return {
|
|
227
|
-
chipRef:
|
|
226
|
+
chipRef: I(null)
|
|
228
227
|
};
|
|
229
228
|
},
|
|
230
229
|
render() {
|
|
231
230
|
const {
|
|
232
231
|
size: e,
|
|
233
|
-
rounded:
|
|
234
|
-
themeColor:
|
|
235
|
-
fillMode:
|
|
236
|
-
look: a,
|
|
232
|
+
rounded: r,
|
|
233
|
+
themeColor: h,
|
|
234
|
+
fillMode: p,
|
|
237
235
|
avatar: i,
|
|
238
|
-
icon:
|
|
239
|
-
svgIcon:
|
|
240
|
-
selectedIcon:
|
|
241
|
-
selectedSvgIcon:
|
|
242
|
-
removeIcon:
|
|
243
|
-
removeSvgIcon:
|
|
244
|
-
} = this.$props,
|
|
245
|
-
class: `k-chip-avatar k-avatar k-rounded-${i.rounded || "medium"} k-avatar-${
|
|
236
|
+
icon: u,
|
|
237
|
+
svgIcon: m,
|
|
238
|
+
selectedIcon: f,
|
|
239
|
+
selectedSvgIcon: v,
|
|
240
|
+
removeIcon: g,
|
|
241
|
+
removeSvgIcon: k
|
|
242
|
+
} = this.$props, $ = F.call(this, i, C.call(this)), y = i ? t("div", {
|
|
243
|
+
class: `k-chip-avatar k-avatar k-rounded-${i.rounded || "medium"} k-avatar-${n.sizeMap[e] || e} k-avatar-solid k-avatar-solid-primary`,
|
|
246
244
|
style: i.style
|
|
247
245
|
}, [t("span", {
|
|
248
246
|
class: "k-avatar-image"
|
|
249
247
|
}, [t("img", {
|
|
250
248
|
src: i.imageUrl,
|
|
251
249
|
alt: i.imageAlt
|
|
252
|
-
}, null)])]) : null,
|
|
253
|
-
h:
|
|
254
|
-
template:
|
|
250
|
+
}, null)])]) : null, b = w.call(this, {
|
|
251
|
+
h: D,
|
|
252
|
+
template: $
|
|
255
253
|
});
|
|
256
254
|
return t("div", {
|
|
257
255
|
role: this.$props.role,
|
|
258
256
|
id: this.$props.value,
|
|
259
|
-
ref:
|
|
257
|
+
ref: O(this, "chip"),
|
|
260
258
|
dir: this.currentDir,
|
|
261
|
-
tabindex:
|
|
262
|
-
class:
|
|
259
|
+
tabindex: M(this.$props.tabIndex, this.$props.disabled, void 0),
|
|
260
|
+
class: x("k-chip", {
|
|
263
261
|
"k-rtl": this.currentDir === "rtl",
|
|
264
262
|
"k-disabled": this.$props.disabled,
|
|
265
263
|
"k-selected": this.currentSelected,
|
|
266
264
|
"k-focus": this.computedFocused(),
|
|
267
|
-
[`k-chip-${
|
|
268
|
-
[`k-rounded-${
|
|
269
|
-
[`k-chip-${
|
|
270
|
-
[`k-chip-${
|
|
271
|
-
"k-chip-outline": a === "outline" || a === "outlined",
|
|
272
|
-
"k-chip-solid": a === "solid" || a === "filled" || n === "solid"
|
|
265
|
+
[`k-chip-${n.sizeMap[e] || e}`]: e,
|
|
266
|
+
[`k-rounded-${n.roundedMap[r] || r}`]: r,
|
|
267
|
+
[`k-chip-${h}`]: h,
|
|
268
|
+
[`k-chip-${p}`]: p
|
|
273
269
|
}),
|
|
274
270
|
"aria-pressed": this.$props.role === "button" ? this.currentSelected : void 0,
|
|
275
271
|
"aria-selected": this.$props.role === "option" ? this.currentSelected : void 0,
|
|
276
|
-
"aria-disabled": this.$props.disabled
|
|
277
|
-
"aria-label": this.$props.ariaLabel,
|
|
272
|
+
"aria-disabled": this.$props.disabled,
|
|
278
273
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
279
274
|
onFocus: this.handleFocus,
|
|
280
275
|
onBlur: this.handleBlur,
|
|
281
276
|
onClick: this.handleClick,
|
|
282
277
|
onKeydown: this.handleKeyDown,
|
|
283
278
|
onMousedown: this.handleMouseDown
|
|
284
|
-
}, [this.currentSelected && (
|
|
285
|
-
name:
|
|
286
|
-
icon:
|
|
279
|
+
}, [this.currentSelected && (f || v) && t(l, {
|
|
280
|
+
name: c(f),
|
|
281
|
+
icon: v,
|
|
287
282
|
size: "small"
|
|
288
|
-
}, null), (
|
|
289
|
-
name:
|
|
290
|
-
icon:
|
|
291
|
-
size: "small"
|
|
292
|
-
|
|
293
|
-
}, null), i ? i.imageUrl ? b : S : null, t("span", {
|
|
283
|
+
}, null), (u || m) && t(l, {
|
|
284
|
+
name: c(u),
|
|
285
|
+
icon: m,
|
|
286
|
+
size: "small"
|
|
287
|
+
}, null), i ? i.imageUrl ? y : b : null, t("span", {
|
|
294
288
|
class: "k-chip-content"
|
|
295
289
|
}, [this.$props.text && t("span", {
|
|
290
|
+
"aria-label": this.$props.text,
|
|
296
291
|
class: this.chipLabelClass
|
|
297
292
|
}, [this.$props.text])]), this.$props.removable && t("span", {
|
|
298
293
|
class: "k-chip-actions"
|
|
299
294
|
}, [t("span", {
|
|
300
295
|
class: "k-chip-action k-chip-remove-action"
|
|
301
|
-
}, [t(
|
|
302
|
-
name:
|
|
303
|
-
icon:
|
|
296
|
+
}, [t(l, {
|
|
297
|
+
name: c(g),
|
|
298
|
+
icon: k,
|
|
304
299
|
size: "small",
|
|
305
300
|
onClick: this.handleRemove
|
|
306
301
|
}, null)])])]);
|
|
307
302
|
}
|
|
308
303
|
});
|
|
309
304
|
export {
|
|
310
|
-
|
|
305
|
+
V as Chip
|
|
311
306
|
};
|
|
@@ -40,7 +40,7 @@ declare const FloatingActionButton: import('vue').DefineComponent<import('vue').
|
|
|
40
40
|
};
|
|
41
41
|
positionMode: {
|
|
42
42
|
type: PropType<FloatingActionButtonPositionMode>;
|
|
43
|
-
default:
|
|
43
|
+
default: () => FloatingActionButtonPositionMode;
|
|
44
44
|
};
|
|
45
45
|
popupSettings: {
|
|
46
46
|
type: PropType<import('..').FloatingActionButtonPopupSettings>;
|
|
@@ -68,11 +68,9 @@ declare const FloatingActionButton: import('vue').DefineComponent<import('vue').
|
|
|
68
68
|
'k-fab': boolean;
|
|
69
69
|
'k-disabled': any;
|
|
70
70
|
'k-focus': any;
|
|
71
|
-
'k-pos-absolute': boolean;
|
|
72
|
-
'k-pos-fixed': boolean;
|
|
73
71
|
};
|
|
74
72
|
computedOpened(): any;
|
|
75
|
-
rootClassNames():
|
|
73
|
+
rootClassNames(): string;
|
|
76
74
|
}, {
|
|
77
75
|
dispatchPopupEvent(dispatchedEvent: any, isOpen?: boolean): void;
|
|
78
76
|
handleClick(event: any): void;
|
|
@@ -120,7 +118,7 @@ declare const FloatingActionButton: import('vue').DefineComponent<import('vue').
|
|
|
120
118
|
};
|
|
121
119
|
positionMode: {
|
|
122
120
|
type: PropType<FloatingActionButtonPositionMode>;
|
|
123
|
-
default:
|
|
121
|
+
default: () => FloatingActionButtonPositionMode;
|
|
124
122
|
};
|
|
125
123
|
popupSettings: {
|
|
126
124
|
type: PropType<import('..').FloatingActionButtonPopupSettings>;
|
|
@@ -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 n=require("vue"),s=require("@progress/kendo-vue-common"),I=require("./FloatingActionButtonItem.js"),y=require("../package-metadata.js"),d=require("./utils.js"),x=require("@progress/kendo-vue-popup"),v=n.defineComponent({name:"KendoVueFloatingActionButton",props:{id:String,dir:String,tabIndex:Number,accessKey:String,disabled:{type:Boolean,default:!1},icon:String,svgIcon:Object,iconClass:String,items:[Object,Array],item:[String,Function,Object],text:String,alignOffset:Object,opened:{type:Boolean,default:void 0},align:{type:Object,default:function(){return{vertical:"bottom",horizontal:"end"}}},positionMode:{type:String,default:function(){return"fixed"}},popupSettings:{type:Object,default:function(){return{}}},rounded:String,fillMode:{type:String,validator:function(e){return["flat","link","outline","solid"].includes(e)}},size:String,themeColor:String},emits:{click:e=>!0,mousedown:e=>!0,mouseup:e=>!0,open:e=>!0,close:e=>!0,itemclick:e=>!0,focus:e=>!0,blur:e=>!0,keydown:e=>!0},data(){return{currentOpened:!1,currentFocused:!1,focusedIndex:-1,currentDir:"ltr",isRtl:!1}},created(){s.validatePackage(y.packageMetadata),this.element=void 0,this._anchor=s.guid(),this.listId=s.guid(),this.buttonId=s.guid()},mounted(){this.element=this.kendoAnchorRef,this.list=s.getRef(this,"list"),this.popup=s.getRef(this,"popup"),this.currentDir=this.$props.dir!==void 0?this.$props.dir:this.$el&&getComputedStyle(this.$el).direction==="rtl"||!1,this.isRtl=this.currentDir==="rtl",this.opened!==void 0&&d.position(this.$el,this.$props.align,this.$props.alignOffset,this.isRtl)},updated(){d.position(this.$el,this.$props.align,this.$props.alignOffset,this.isRtl),this.currentFocused&&this.element&&this.element.focus()},computed:{buttonClassNames(){const{size:e,themeColor:t,fillMode:o,rounded:i}=this.$props;return{"k-fab":!0,[`k-fab-${s.kendoThemeMaps.sizeMap[e]||e}`]:e,[`k-rounded-${s.kendoThemeMaps.roundedMap[i]||i}`]:i,[`k-fab-${o}`]:o,[`k-fab-${t}`]:t,"k-disabled":this.$props.disabled,"k-focus":this.currentFocused,[`k-${this.$props.align.vertical}-${this.$props.align.horizontal}`]:!0}},computedOpened(){return this.$props.opened===void 0?this.currentOpened:this.$props.opened},rootClassNames(){return s.classNames({"k-pos-absolute":this.$props.positionMode==="absolute","k-pos-fixed":this.$props.positionMode==="fixed"})}},methods:{dispatchPopupEvent(e,t){this.$props.items&&this.$emit(t?"open":"close",{event:e,isOpened:!t})},handleClick(e){if(!(!e.target||this.$props.disabled))if(!this.$props.items)this.$emit("click",e,void 0);else{const t=!this.computedOpened;this.currentOpened=t,this.currentFocused=!0,this.focusedIndex=t?0:-1,this.dispatchPopupEvent(e,t)}},handleFocus(e){this.currentFocused=!0,this.focusedIndex=this.computedOpened?0:-1,this.$emit("focus",{event:e})},handleBlur(e){const t=this.computedOpened;this.currentFocused=!1,this.currentOpened=!1,this.focusedIndex=-1,this.$emit("blur",{event:e}),t&&this.dispatchPopupEvent(e,!1)},handleMouseDown(e){e.preventDefault(),this.$emit("mousedown",e)},handleMouseUp(e){this.$emit("mouseup",e)},dispatchItemClickEvent(e,t){this.$props.items&&(this.$props.items[t].disabled||this.$emit("itemclick",e,{itemProps:this.$props.items[t],itemIndex:t}))},handleItemClick(e,t){!e.target||!this.$props.items||(this.focusedIndex=t,this.currentOpened=!1,this.dispatchItemClickEvent(e,t),this.dispatchPopupEvent(e,!1))},handleItemDown(e){s.canUseDOM&&document.activeElement===this.element&&e.preventDefault()},handleKeyDown(e){const t=this.focusedIndex,o=this.$props.items?this.$props.items.length-1:-1,i=this.$props.align.vertical==="bottom";switch(e.keyCode){case s.Keys.enter:case s.Keys.space:t>=0&&this.dispatchItemClickEvent(e,t),e.preventDefault(),this.currentOpened=!this.currentOpened,this.focusedIndex=this.currentOpened?-1:0;break;case s.Keys.esc:e.preventDefault(),this.currentOpened=!1,this.focusedIndex=-1;break;case s.Keys.home:e.preventDefault(),this.focusedIndex=0;break;case s.Keys.end:e.preventDefault(),this.focusedIndex=o;break;case s.Keys.down:case s.Keys.right:e.preventDefault(),t<o&&!i&&(this.focusedIndex=t+1),t>0&&i&&(this.focusedIndex=t-1);break;case s.Keys.up:case s.Keys.left:e.preventDefault(),t>0&&!i&&(this.focusedIndex=t-1),t<o&&i&&(this.focusedIndex=t+1);break}this.$emit("keydown",e,void 0)}},setup(){const e=n.ref(null),t=n.ref(null);return{chipRef:e,kendoAnchorRef:t}},render(){const{align:e,disabled:t,icon:o,svgIcon:i,iconClass:p,id:h,items:r,text:u,tabIndex:b,accessKey:g,popupSettings:c}=this.$props,k=s.templateRendering.call(this,this.$props.item,s.getListeners.call(this)),$=function(){return r&&r.map(function(a,l){return n.createVNode(I.FloatingActionButtonItem,{key:l,index:l,id:`${this.listId}-${l}`,disabled:t||a.disabled,focused:this.focusedIndex===l,dataItem:a,item:k,class:s.classNames(a.className,d.getTextDirectionClass(this.currentDir||"ltr",e.horizontal)),onClick:this.handleItemClick,onDown:this.handleItemDown},null)},this)},f=o&&!u,m=(this.element?this.element.offsetWidth:0)/2-32/2;return n.createVNode("div",{class:this.rootClassNames},[n.createVNode("button",{ref:a=>{this.kendoAnchorRef=a},id:h||this.buttonId,role:r?"menubutton":"button",type:"button","aria-disabled":t,"aria-expanded":r?this.computedOpened:void 0,"aria-haspopup":r,"aria-label":`${u||""} floatingactionbutton`,"aria-owns":r?this.listId:void 0,"aria-activedescendant":this.focusedIndex>=0&&r?`${this.listId}-${this.focusedIndex}`:void 0,tabindex:s.getTabIndex(b,t),accesskey:g,dir:this.currentDir,disabled:t,class:this.buttonClassNames,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseup:this.handleMouseUp,onFocusin:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown},[o||i?n.createVNode(s.Icon,{name:o,icon:i,class:"k-fab-icon"},null):p?n.createVNode(s.Icon,{class:p},null):null,u&&n.createVNode("span",{class:"k-fab-text"},[u])]),n.createVNode(x.Popup,{ref:s.setRef(this,"popup"),show:this.computedOpened,anchor:this._anchor,animate:c.animate,popupClass:s.classNames("k-popup-transparent k-fab-popup",c.popupClass),anchorAlign:c.anchorAlign||d.getAnchorAlign(e,this.isRtl),popupAlign:c.popupAlign||d.getPopupAlign(e,this.isRtl),style:{boxShadow:"none"}},{default:()=>[n.createVNode("ul",{ref:s.setRef(this,"list"),role:"menu","aria-labelledby":h,id:this.listId,class:s.classNames("k-fab-items",{"k-fab-items-bottom":e.vertical!=="bottom","k-fab-items-top":e.vertical==="bottom"}),style:{paddingLeft:f?m+"px":void 0,paddingRight:f?m+"px":void 0}},[$.call(this)])]})])}});exports.FloatingActionButton=v;
|