@progress/kendo-vue-buttons 3.5.0 → 3.5.1-dev.202208150613

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.
Files changed (135) hide show
  1. package/dist/cdn/js/kendo-vue-buttons.js +1 -1
  2. package/dist/es/Button.js +1 -1
  3. package/dist/es/ButtonGroupInterface.js +1 -0
  4. package/dist/es/ButtonInterface.js +1 -0
  5. package/dist/es/Chip/Chip.js +1 -1
  6. package/dist/es/Chip/ChipList.js +1 -1
  7. package/dist/es/Chip/selection-reducer.js +8 -12
  8. package/dist/es/FloatingActionButton/FloatingActionButton.js +8 -8
  9. package/dist/es/FloatingActionButton/FloatingActionButtonItem.js +3 -3
  10. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonHandle.js +1 -0
  11. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.js +1 -0
  12. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonProps.js +1 -0
  13. package/dist/es/FloatingActionButton/models/align-offset.js +1 -0
  14. package/dist/es/FloatingActionButton/models/align.js +1 -0
  15. package/dist/es/FloatingActionButton/models/events.js +1 -0
  16. package/dist/es/FloatingActionButton/models/position-mode.js +1 -0
  17. package/dist/es/FloatingActionButton/models/shape.js +1 -0
  18. package/dist/es/FloatingActionButton/models/size.js +1 -0
  19. package/dist/es/FloatingActionButton/models/theme-color.js +1 -0
  20. package/dist/es/FloatingActionButton/utils.js +2 -2
  21. package/dist/es/ListButton/ButtonItem.js +1 -1
  22. package/dist/es/ListButton/DropDownButton.js +8 -8
  23. package/dist/es/ListButton/SplitButton.js +8 -8
  24. package/dist/es/ListButton/models/ButtonItemInterface.js +1 -0
  25. package/dist/es/ListButton/models/ListButtonProps.js +1 -0
  26. package/dist/es/ListButton/models/PopupSettings.js +1 -0
  27. package/dist/es/ListButton/models/events.js +1 -0
  28. package/dist/es/buttonLook.js +1 -0
  29. package/dist/es/models/index.js +1 -0
  30. package/dist/es/package-metadata.js +1 -1
  31. package/dist/es/util.d.ts +3 -3
  32. package/dist/esm/Button.d.ts +123 -0
  33. package/dist/esm/Button.js +280 -0
  34. package/dist/esm/ButtonGroup.d.ts +49 -0
  35. package/dist/esm/ButtonGroup.js +106 -0
  36. package/dist/esm/ButtonGroupInterface.d.ts +30 -0
  37. package/dist/esm/ButtonGroupInterface.js +2 -0
  38. package/dist/esm/ButtonInterface.d.ts +56 -0
  39. package/dist/esm/ButtonInterface.js +2 -0
  40. package/dist/esm/ButtonWrap.d.ts +19 -0
  41. package/dist/esm/ButtonWrap.js +33 -0
  42. package/dist/esm/Chip/Chip.d.ts +199 -0
  43. package/dist/esm/Chip/Chip.js +339 -0
  44. package/dist/esm/Chip/ChipList.d.ts +174 -0
  45. package/dist/esm/Chip/ChipList.js +263 -0
  46. package/dist/esm/Chip/data-reducer.d.ts +21 -0
  47. package/dist/esm/Chip/data-reducer.js +34 -0
  48. package/dist/esm/Chip/focus-reducer.d.ts +24 -0
  49. package/dist/esm/Chip/focus-reducer.js +38 -0
  50. package/dist/esm/Chip/selection-reducer.d.ts +29 -0
  51. package/dist/esm/Chip/selection-reducer.js +102 -0
  52. package/dist/esm/FloatingActionButton/FloatingActionButton.d.ts +49 -0
  53. package/dist/esm/FloatingActionButton/FloatingActionButton.js +494 -0
  54. package/dist/esm/FloatingActionButton/FloatingActionButtonItem.d.ts +118 -0
  55. package/dist/esm/FloatingActionButton/FloatingActionButtonItem.js +121 -0
  56. package/dist/esm/FloatingActionButton/interfaces/FloatingActionButtonHandle.d.ts +13 -0
  57. package/dist/esm/FloatingActionButton/interfaces/FloatingActionButtonHandle.js +1 -0
  58. package/dist/esm/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.d.ts +24 -0
  59. package/dist/esm/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.js +1 -0
  60. package/dist/esm/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +243 -0
  61. package/dist/esm/FloatingActionButton/interfaces/FloatingActionButtonProps.js +1 -0
  62. package/dist/esm/FloatingActionButton/models/align-offset.d.ts +20 -0
  63. package/dist/esm/FloatingActionButton/models/align-offset.js +1 -0
  64. package/dist/esm/FloatingActionButton/models/align.d.ts +27 -0
  65. package/dist/esm/FloatingActionButton/models/align.js +1 -0
  66. package/dist/esm/FloatingActionButton/models/events.d.ts +18 -0
  67. package/dist/esm/FloatingActionButton/models/events.js +2 -0
  68. package/dist/esm/FloatingActionButton/models/position-mode.d.ts +9 -0
  69. package/dist/esm/FloatingActionButton/models/position-mode.js +1 -0
  70. package/dist/esm/FloatingActionButton/models/shape.d.ts +13 -0
  71. package/dist/esm/FloatingActionButton/models/shape.js +1 -0
  72. package/dist/esm/FloatingActionButton/models/size.d.ts +10 -0
  73. package/dist/esm/FloatingActionButton/models/size.js +1 -0
  74. package/dist/esm/FloatingActionButton/models/theme-color.d.ts +17 -0
  75. package/dist/esm/FloatingActionButton/models/theme-color.js +1 -0
  76. package/dist/esm/FloatingActionButton/utils.d.ts +27 -0
  77. package/dist/esm/FloatingActionButton/utils.js +93 -0
  78. package/dist/esm/ListButton/ButtonItem.d.ts +58 -0
  79. package/dist/esm/ListButton/ButtonItem.js +138 -0
  80. package/dist/esm/ListButton/DropDownButton.d.ts +66 -0
  81. package/dist/esm/ListButton/DropDownButton.js +453 -0
  82. package/dist/esm/ListButton/SplitButton.d.ts +67 -0
  83. package/dist/esm/ListButton/SplitButton.js +515 -0
  84. package/dist/esm/ListButton/models/ButtonItemInterface.d.ts +29 -0
  85. package/dist/esm/ListButton/models/ButtonItemInterface.js +2 -0
  86. package/dist/esm/ListButton/models/ListButtonProps.d.ts +328 -0
  87. package/dist/esm/ListButton/models/ListButtonProps.js +2 -0
  88. package/dist/esm/ListButton/models/PopupSettings.d.ts +24 -0
  89. package/dist/esm/ListButton/models/PopupSettings.js +1 -0
  90. package/dist/esm/ListButton/models/events.d.ts +48 -0
  91. package/dist/esm/ListButton/models/events.js +1 -0
  92. package/dist/esm/ListButton/utils/navigation.d.ts +5 -0
  93. package/dist/esm/ListButton/utils/navigation.js +24 -0
  94. package/dist/esm/ListButton/utils/popup.d.ts +9 -0
  95. package/dist/esm/ListButton/utils/popup.js +20 -0
  96. package/dist/esm/additionalTypes.ts +21 -0
  97. package/dist/esm/buttonLook.d.ts +13 -0
  98. package/dist/esm/buttonLook.js +1 -0
  99. package/dist/esm/main.d.ts +30 -0
  100. package/dist/esm/main.js +15 -0
  101. package/dist/esm/models/index.d.ts +87 -0
  102. package/dist/esm/models/index.js +1 -0
  103. package/dist/esm/package-metadata.d.ts +5 -0
  104. package/dist/esm/package-metadata.js +11 -0
  105. package/dist/esm/package.json +3 -0
  106. package/dist/esm/toolbar/Toolbar.d.ts +112 -0
  107. package/dist/esm/toolbar/Toolbar.js +208 -0
  108. package/dist/esm/toolbar/tools/ToolbarItem.d.ts +64 -0
  109. package/dist/esm/toolbar/tools/ToolbarItem.js +58 -0
  110. package/dist/esm/toolbar/tools/ToolbarSeparator.d.ts +36 -0
  111. package/dist/esm/toolbar/tools/ToolbarSeparator.js +56 -0
  112. package/dist/esm/toolbar/tools/ToolbarSpacer.d.ts +36 -0
  113. package/dist/esm/toolbar/tools/ToolbarSpacer.js +53 -0
  114. package/dist/esm/util.d.ts +31 -0
  115. package/dist/esm/util.js +40 -0
  116. package/dist/npm/Button.js +5 -5
  117. package/dist/npm/ButtonGroup.js +4 -4
  118. package/dist/npm/ButtonWrap.js +1 -1
  119. package/dist/npm/Chip/Chip.js +10 -10
  120. package/dist/npm/Chip/ChipList.js +8 -8
  121. package/dist/npm/Chip/data-reducer.js +4 -2
  122. package/dist/npm/Chip/focus-reducer.js +4 -2
  123. package/dist/npm/Chip/selection-reducer.js +12 -14
  124. package/dist/npm/FloatingActionButton/FloatingActionButton.js +31 -31
  125. package/dist/npm/FloatingActionButton/FloatingActionButtonItem.js +8 -8
  126. package/dist/npm/FloatingActionButton/utils.js +14 -9
  127. package/dist/npm/ListButton/ButtonItem.js +1 -1
  128. package/dist/npm/ListButton/DropDownButton.js +19 -19
  129. package/dist/npm/ListButton/SplitButton.js +19 -19
  130. package/dist/npm/main.js +6 -2
  131. package/dist/npm/package-metadata.js +1 -1
  132. package/dist/npm/toolbar/Toolbar.js +2 -2
  133. package/dist/npm/toolbar/tools/ToolbarItem.js +1 -1
  134. package/dist/npm/util.d.ts +3 -3
  135. package/package.json +11 -5
@@ -0,0 +1,263 @@
1
+ var __assign = this && this.__assign || function () {
2
+ __assign = Object.assign || function (t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+
6
+ for (var p in s) {
7
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
+ }
9
+ }
10
+
11
+ return t;
12
+ };
13
+
14
+ return __assign.apply(this, arguments);
15
+ }; // @ts-ignore
16
+
17
+
18
+ import * as Vue from 'vue';
19
+ var allVue = Vue;
20
+ var gh = allVue.h;
21
+ var isV3 = allVue.version && allVue.version[0] === '3';
22
+ var ref = allVue.ref;
23
+ import { getTabIndex, classNames, getListeners, templateRendering, getTemplate, validatePackage, kendoThemeMaps, setRef } from '@progress/kendo-vue-common';
24
+ import { selectionReducer } from './selection-reducer.js';
25
+ import { focusReducer } from './focus-reducer.js';
26
+ import { dataReducer } from './data-reducer.js';
27
+ import { Chip } from './Chip.js';
28
+ import { packageMetadata } from '../package-metadata.js';
29
+ /**
30
+ * @hidden
31
+ */
32
+
33
+ var ChipListVue2 = {
34
+ name: 'KendoVueChipList',
35
+ props: {
36
+ id: String,
37
+ tabIndex: Number,
38
+ dataItems: Array,
39
+ defaultDataItems: {
40
+ type: Array,
41
+ default: function _default() {
42
+ return [];
43
+ }
44
+ },
45
+ value: [Object, Array, String, Number],
46
+ defaultValue: {
47
+ type: [Object, Array, String, Number],
48
+ default: function _default() {
49
+ return null;
50
+ }
51
+ },
52
+ size: {
53
+ type: String,
54
+ default: 'medium'
55
+ },
56
+ rounded: {
57
+ type: String,
58
+ default: 'medium'
59
+ },
60
+ fillMode: {
61
+ type: String,
62
+ default: 'solid',
63
+ validator: function validator(value) {
64
+ return [null, 'flat', 'outline', 'solid'].includes(value);
65
+ }
66
+ },
67
+ selection: {
68
+ type: String,
69
+ default: function _default() {
70
+ return 'none';
71
+ }
72
+ },
73
+ textField: {
74
+ type: String,
75
+ default: function _default() {
76
+ return 'text';
77
+ }
78
+ },
79
+ valueField: {
80
+ type: String,
81
+ default: function _default() {
82
+ return 'value';
83
+ }
84
+ },
85
+ disabled: {
86
+ type: Boolean,
87
+ default: false
88
+ },
89
+ dir: {
90
+ type: String,
91
+ default: function _default() {
92
+ return 'ltr';
93
+ }
94
+ },
95
+ chip: [String, Function, Object],
96
+ ariaLabelledBy: String,
97
+ ariaDescribedBy: String
98
+ },
99
+ provide: function provide() {
100
+ return {
101
+ kendoSelection: this.currentValue,
102
+ kendoFocused: this.currentFocused,
103
+ kendoDataItems: this.computedDataItems,
104
+ handleDispatchDataItems: this.handleDispatchDataItems,
105
+ handleDispatchSelection: this.handleDispatchSelection,
106
+ handleDispatchFocus: this.handleDispatchFocus
107
+ };
108
+ },
109
+ created: function created() {
110
+ validatePackage(packageMetadata);
111
+ this.currentDataItems = this.$props.dataItems || this.$props.defaultDataItems;
112
+ this.currentValue.value = this.$props.value || this.$props.defaultValue;
113
+ },
114
+ data: function data() {
115
+ return {
116
+ currentDataItems: [],
117
+ currentDir: 'ltr',
118
+ isRtl: false,
119
+ currentFocused: {
120
+ value: false
121
+ },
122
+ currentValue: {
123
+ value: null
124
+ }
125
+ };
126
+ },
127
+ mounted: function mounted() {
128
+ this.chipList = this.v3 ? this.chipListRef : this.$refs.chipList;
129
+ this.currentDir = this.$props.dir !== undefined ? this.$props.dir : this.$el && getComputedStyle(this.$el).direction === 'rtl' || false;
130
+ this.isRtl = this.currentDir === 'rtl';
131
+ },
132
+ computed: {
133
+ computedDataItems: function computedDataItems() {
134
+ return this.$props.dataItems || this.currentDataItems;
135
+ },
136
+ computedValue: function computedValue() {
137
+ return this.$props.value || this.currentValue.value;
138
+ },
139
+ items: function items() {
140
+ return this.computedDataItems.reduce(this.itemsReducer, []);
141
+ }
142
+ },
143
+ methods: {
144
+ handleDispatchSelection: function handleDispatchSelection(action) {
145
+ var newState = selectionReducer(this.computedValue, __assign(__assign({}, action), {
146
+ selection: this.$props.selection,
147
+ state: this.computedValue
148
+ }));
149
+ this.handleChange(newState, action.event);
150
+ this.currentValue.value = newState;
151
+ },
152
+ handleDispatchFocus: function handleDispatchFocus(action) {
153
+ var newState = focusReducer(action.payload, __assign(__assign({}, action), {
154
+ items: this.items
155
+ }));
156
+ this.currentFocused.value = newState;
157
+ },
158
+ handleDispatchDataItems: function handleDispatchDataItems(action) {
159
+ var newState = dataReducer(this.computedDataItems, __assign(__assign({}, action), {
160
+ state: this.computedDataItems,
161
+ valueField: this.$props.valueField
162
+ }));
163
+ this.handleDataChange(newState, action.event);
164
+ this.currentDataItems = newState;
165
+ },
166
+ handleChange: function handleChange(newValue, event) {
167
+ if (this.$el) {
168
+ this.$emit('change', {
169
+ value: newValue,
170
+ target: this.$el,
171
+ event: event
172
+ });
173
+ }
174
+ },
175
+ handleDataChange: function handleDataChange(newData, event) {
176
+ if (this.$el) {
177
+ this.$emit('datachange', {
178
+ value: newData,
179
+ target: this.$el,
180
+ event: event
181
+ });
182
+ }
183
+ },
184
+ itemsReducer: function itemsReducer(acc, current) {
185
+ acc.push(current[this.$props.valueField || this.$props.valueField]);
186
+ return acc;
187
+ }
188
+ },
189
+ // @ts-ignore
190
+ setup: !isV3 ? undefined : function () {
191
+ var v3 = !!isV3;
192
+ var chipListRef = ref(null);
193
+ return {
194
+ v3: v3,
195
+ chipListRef: chipListRef
196
+ };
197
+ },
198
+ render: function render(createElement) {
199
+ var _a;
200
+
201
+ var h = gh || createElement;
202
+ var size = this.$props.size;
203
+ return h("div", {
204
+ ref: setRef(this, 'chipList'),
205
+ role: 'listbox',
206
+ attrs: this.v3 ? undefined : {
207
+ role: 'listbox',
208
+ id: this.$props.id,
209
+ dir: this.currentDir,
210
+ tabindex: getTabIndex(this.$props.tabIndex, this.$props.disabled, undefined),
211
+ "aria-labelledby": this.$props.ariaLabelledBy,
212
+ "aria-describedby": this.$props.ariaDescribedBy
213
+ },
214
+ id: this.$props.id,
215
+ dir: this.currentDir,
216
+ style: this.$props.style,
217
+ tabindex: getTabIndex(this.$props.tabIndex, this.$props.disabled, undefined),
218
+ "class": classNames('k-chip-list', (_a = {}, _a["k-chip-list-".concat(kendoThemeMaps.sizeMap[size] || size)] = size, _a['k-rtl'] = this.currentDir === 'rtl', _a['k-selection-single'] = this.$props.selection === 'single', _a['k-selection-multiple'] = this.$props.selection === 'multiple', _a['k-disabled'] = this.$props.disabled, _a)),
219
+ "aria-labelledby": this.$props.ariaLabelledBy,
220
+ "aria-describedby": this.$props.ariaDescribedBy
221
+ }, [this.computedDataItems.map(function (item) {
222
+ var chipTemplate = templateRendering.call(this, this.$props.chip, getListeners.call(this));
223
+ var chipDefaultRendering = // @ts-ignore function children
224
+ h(Chip, {
225
+ role: 'option',
226
+ attrs: this.v3 ? undefined : {
227
+ role: 'option',
228
+ dataItem: item,
229
+ text: item[this.$props.textField],
230
+ value: item[this.$props.valueField],
231
+ size: this.$props.size,
232
+ rounded: this.$props.rounded,
233
+ fillMode: this.$props.fillMode
234
+ },
235
+ dataItem: item,
236
+ key: item[this.$props.valueField],
237
+ text: item[this.$props.textField],
238
+ value: item[this.$props.valueField],
239
+ size: this.$props.size,
240
+ rounded: this.$props.rounded,
241
+ fillMode: this.$props.fillMode
242
+ });
243
+ return getTemplate.call(this, {
244
+ h: h,
245
+ template: chipTemplate,
246
+ defaultRendering: chipDefaultRendering,
247
+ additionalProps: {
248
+ dataItem: item,
249
+ key: item[this.$props.valueField],
250
+ text: item[this.$props.textField],
251
+ value: item[this.$props.valueField],
252
+ size: this.$props.size
253
+ }
254
+ });
255
+ }, this)]);
256
+ }
257
+ };
258
+ /**
259
+ * @hidden
260
+ */
261
+
262
+ var ChipList = ChipListVue2;
263
+ export { ChipList, ChipListVue2 };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export declare enum DATA_ACTION {
5
+ remove = "remove",
6
+ add = "add",
7
+ reorder = "reorder"
8
+ }
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare type DataAction = {
13
+ type: DATA_ACTION;
14
+ payload?: any;
15
+ valueField: string;
16
+ event?: any;
17
+ };
18
+ /**
19
+ * @hidden
20
+ */
21
+ export declare const dataReducer: (state: any, action: DataAction) => any;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export var DATA_ACTION;
5
+
6
+ (function (DATA_ACTION) {
7
+ DATA_ACTION["remove"] = "remove";
8
+ DATA_ACTION["add"] = "add";
9
+ DATA_ACTION["reorder"] = "reorder";
10
+ })(DATA_ACTION || (DATA_ACTION = {}));
11
+ /**
12
+ * @hidden
13
+ */
14
+
15
+
16
+ export var dataReducer = function dataReducer(state, action) {
17
+ switch (action.type) {
18
+ case DATA_ACTION.add:
19
+ // TODO v2
20
+ break;
21
+
22
+ case DATA_ACTION.remove:
23
+ return state.filter(function (i) {
24
+ return i[action.valueField] !== action.payload;
25
+ });
26
+
27
+ case DATA_ACTION.reorder:
28
+ // TODO v2
29
+ break;
30
+
31
+ default:
32
+ return state;
33
+ }
34
+ };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export declare enum FOCUS_ACTION {
5
+ next = "next",
6
+ prev = "prev",
7
+ current = "current",
8
+ reset = "reset"
9
+ }
10
+ /**
11
+ * @hidden
12
+ */
13
+ export declare type FocusAction = {
14
+ type: FOCUS_ACTION;
15
+ payload: string;
16
+ items: string[];
17
+ target?: any;
18
+ event?: any;
19
+ state?: any;
20
+ };
21
+ /**
22
+ * @hidden
23
+ */
24
+ export declare const focusReducer: (state: any, action: FocusAction) => any;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export var FOCUS_ACTION;
5
+
6
+ (function (FOCUS_ACTION) {
7
+ FOCUS_ACTION["next"] = "next";
8
+ FOCUS_ACTION["prev"] = "prev";
9
+ FOCUS_ACTION["current"] = "current";
10
+ FOCUS_ACTION["reset"] = "reset";
11
+ })(FOCUS_ACTION || (FOCUS_ACTION = {}));
12
+ /**
13
+ * @hidden
14
+ */
15
+
16
+
17
+ export var focusReducer = function focusReducer(state, action) {
18
+ var currentIndex = action.items.findIndex(function (i) {
19
+ return i === state;
20
+ });
21
+
22
+ switch (action.type) {
23
+ case FOCUS_ACTION.next:
24
+ return currentIndex === action.items.length - 1 ? state : action.items[currentIndex + 1];
25
+
26
+ case FOCUS_ACTION.prev:
27
+ return currentIndex === 0 ? state : action.items[currentIndex - 1];
28
+
29
+ case FOCUS_ACTION.current:
30
+ return action.payload;
31
+
32
+ case FOCUS_ACTION.reset:
33
+ return null;
34
+
35
+ default:
36
+ return state;
37
+ }
38
+ };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export declare enum SELECTION_TYPE {
5
+ single = "single",
6
+ multiple = "multiple",
7
+ none = "none"
8
+ }
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare enum SELECTION_ACTION {
13
+ toggle = "toggle",
14
+ remove = "remove"
15
+ }
16
+ /**
17
+ * @hidden
18
+ */
19
+ export declare type SelectionAction = {
20
+ type?: SELECTION_ACTION;
21
+ selection: SELECTION_TYPE;
22
+ payload?: string;
23
+ event?: any;
24
+ state?: any;
25
+ };
26
+ /**
27
+ * @hidden
28
+ */
29
+ export declare const selectionReducer: (state: any, action: SelectionAction) => any;
@@ -0,0 +1,102 @@
1
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
9
+ };
10
+ /**
11
+ * @hidden
12
+ */
13
+
14
+
15
+ export var SELECTION_TYPE;
16
+
17
+ (function (SELECTION_TYPE) {
18
+ SELECTION_TYPE["single"] = "single";
19
+ SELECTION_TYPE["multiple"] = "multiple";
20
+ SELECTION_TYPE["none"] = "none";
21
+ })(SELECTION_TYPE || (SELECTION_TYPE = {}));
22
+ /**
23
+ * @hidden
24
+ */
25
+
26
+
27
+ export var SELECTION_ACTION;
28
+
29
+ (function (SELECTION_ACTION) {
30
+ SELECTION_ACTION["toggle"] = "toggle";
31
+ SELECTION_ACTION["remove"] = "remove";
32
+ })(SELECTION_ACTION || (SELECTION_ACTION = {}));
33
+ /**
34
+ * @hidden
35
+ */
36
+
37
+
38
+ export var selectionReducer = function selectionReducer(state, action) {
39
+ switch (action.selection) {
40
+ case SELECTION_TYPE.single:
41
+ switch (action.type) {
42
+ case SELECTION_ACTION.toggle:
43
+ {
44
+ if (!Array.isArray(state) || state === null) {
45
+ return action.payload === state ? null : action.payload;
46
+ }
47
+
48
+ throw new Error('State cannot be an array in single selection');
49
+ }
50
+
51
+ case SELECTION_ACTION.remove:
52
+ {
53
+ return action.payload === state ? null : state;
54
+ }
55
+
56
+ default:
57
+ return state;
58
+ }
59
+
60
+ case SELECTION_TYPE.multiple:
61
+ switch (action.type) {
62
+ case SELECTION_ACTION.toggle:
63
+ {
64
+ if (Array.isArray(state)) {
65
+ return state.some(function (i) {
66
+ return i === action.payload;
67
+ }) ? state.filter(function (i) {
68
+ return i !== action.payload;
69
+ }) : __spreadArray(__spreadArray([], state, true), [action.payload], false);
70
+ }
71
+
72
+ if (state === null) {
73
+ return [action.payload];
74
+ }
75
+
76
+ throw new Error('State cannot be non-array in multiple selection');
77
+ }
78
+
79
+ case SELECTION_ACTION.remove:
80
+ {
81
+ if (Array.isArray(state)) {
82
+ return state.some(function (i) {
83
+ return i === action.payload;
84
+ }) ? state.filter(function (i) {
85
+ return i !== action.payload;
86
+ }) : __spreadArray(__spreadArray([], state, true), [action.payload], false);
87
+ }
88
+
89
+ return state;
90
+ }
91
+
92
+ default:
93
+ return state;
94
+ }
95
+
96
+ case SELECTION_TYPE.none:
97
+ return null;
98
+
99
+ default:
100
+ return state;
101
+ }
102
+ };
@@ -0,0 +1,49 @@
1
+ import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
2
+ declare type DefaultData<V> = object | ((this: V) => {});
3
+ declare type DefaultMethods<V> = {
4
+ [key: string]: (this: V, ...args: any[]) => any;
5
+ };
6
+ import { FloatingActionButtonProps } from './interfaces/FloatingActionButtonProps';
7
+ /**
8
+ * @hidden
9
+ */
10
+ export interface FloatingActionButtonMethods {
11
+ [key: string]: any;
12
+ }
13
+ /**
14
+ * @hidden
15
+ */
16
+ export interface FloatingActionButtonState {
17
+ v3: boolean;
18
+ target: any;
19
+ currentRtl: boolean;
20
+ }
21
+ /**
22
+ * @hidden
23
+ */
24
+ export interface FloatingActionButtonData {
25
+ currentOpened: boolean;
26
+ currentFocused: boolean;
27
+ focusedIndex: number;
28
+ }
29
+ /**
30
+ * @hidden
31
+ */
32
+ export interface FloatingActionButtonComputed {
33
+ [key: string]: any;
34
+ computedOpened: boolean;
35
+ }
36
+ /**
37
+ * @hidden
38
+ */
39
+ export interface FloatingActionButtonAll extends FloatingActionButtonMethods, FloatingActionButtonState, FloatingActionButtonData, FloatingActionButtonComputed, Vue2type {
40
+ }
41
+ /**
42
+ * @hidden
43
+ */
44
+ declare let FloatingActionButtonVue2: ComponentOptions<Vue2type, DefaultData<FloatingActionButtonData>, DefaultMethods<FloatingActionButtonAll>, FloatingActionButtonComputed, RecordPropsDefinition<FloatingActionButtonProps>>;
45
+ /**
46
+ * @hidden
47
+ */
48
+ declare const FloatingActionButton: DefineComponent<FloatingActionButtonProps, any, FloatingActionButtonData, FloatingActionButtonComputed, FloatingActionButtonMethods, {}, {}, {}, string, FloatingActionButtonProps, FloatingActionButtonProps, {}>;
49
+ export { FloatingActionButton, FloatingActionButtonVue2 };