@progress/kendo-vue-layout 3.7.3-dev.202211021251 → 3.7.3-dev.202211021441

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.
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+
3
+ var __assign = undefined && undefined.__assign || function () {
4
+ __assign = Object.assign || function (t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) {
8
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
9
+ }
10
+ }
11
+ return t;
12
+ };
13
+ return __assign.apply(this, arguments);
14
+ };
15
+ Object.defineProperty(exports, "__esModule", {
16
+ value: true
17
+ });
18
+ exports.TileLayoutVue2 = exports.TileLayout = void 0;
19
+ // @ts-ignore
20
+ var Vue = require("vue");
21
+ var allVue = Vue;
22
+ var gh = allVue.h;
23
+ var isV3 = allVue.version && allVue.version[0] === '3';
24
+ var kendo_vue_common_1 = require("@progress/kendo-vue-common");
25
+ var package_metadata_1 = require("../package-metadata");
26
+ var Tile_1 = require("./Tile");
27
+ /**
28
+ * @hidden
29
+ */
30
+ var AUTO_FLOW_CLASSES = {
31
+ 'column': 'k-grid-flow-col',
32
+ 'row': 'k-grid-flow-row',
33
+ 'column dense': 'k-grid-flow-col-dense',
34
+ 'row dense': 'k-grid-flow-row-dense',
35
+ 'unset': 'k-grid-flow-unset'
36
+ };
37
+ /**
38
+ * @hidden
39
+ */
40
+ var TileLayoutVue2 = {
41
+ name: 'KendoTileLayout',
42
+ props: {
43
+ id: String,
44
+ dir: String,
45
+ gap: Object,
46
+ columns: Number,
47
+ columnWidth: [Number, String],
48
+ rowHeight: [Number, String],
49
+ dataItemKey: String,
50
+ items: Array,
51
+ positions: Array,
52
+ autoFlow: {
53
+ type: String,
54
+ default: 'column',
55
+ validator: function validator(value) {
56
+ return ['column', 'row', 'column dense', 'row dense', 'unset'].includes(value);
57
+ }
58
+ }
59
+ // onReposition: PropTypes.func,
60
+ // ignoreDrag: PropTypes.func
61
+ },
62
+
63
+ created: function created() {
64
+ (0, kendo_vue_common_1.validatePackage)(package_metadata_1.packageMetadata);
65
+ },
66
+ computed: {
67
+ positions: function positions() {
68
+ return (this.$props.items || []).map(function (p, i) {
69
+ return Object.assign({
70
+ order: i,
71
+ rowSpan: 1,
72
+ colSpan: 1
73
+ }, p.defaultPosition);
74
+ });
75
+ }
76
+ },
77
+ // /**
78
+ // * @hidden
79
+ // */
80
+ // static getDerivedStateFromProps(props: TileLayoutProps, state: TileLayoutState) {
81
+ // if (props.positions) {
82
+ // // The component is in controlled mode.
83
+ // return {
84
+ // positions: props.positions.map((p, i) => (Object.assign({ order: i, rowSpan: 1, colSpan: 1 }, p)))
85
+ // };
86
+ // }
87
+ // if (props.items && (!state.positions || (props.items.length !== state.positions.length))) {
88
+ // // The component is in uncontrolled mode.
89
+ // return {
90
+ // positions: props.items.map((p, i) => (Object.assign(
91
+ // { order: i, rowSpan: 1, colSpan: 1 }, p.defaultPosition)))
92
+ // };
93
+ // }
94
+ // return null;
95
+ // }
96
+ // /**
97
+ // * @hidden
98
+ // */
99
+ // update = (index: number, dOrder: number, dCol: number, dRowSpan = 0, dColSpan = 0) => {
100
+ // if (dOrder === 0 && dCol === 0 && !dColSpan && !dRowSpan) {
101
+ // return;
102
+ // }
103
+ // let shouldUpdate = false;
104
+ // const positions: Array<TileStrictPosition> = this.state.positions.map(p => Object.assign({}, p));
105
+ // // reordering:
106
+ // const current = positions[index];
107
+ // const other = positions.find(item => (item.order === current.order + dOrder));
108
+ // if (other && other !== current) {
109
+ // current.order += dOrder;
110
+ // other.order += -dOrder;
111
+ // shouldUpdate = true;
112
+ // }
113
+ // const proposedCol = current.col + dCol;
114
+ // if (dCol !== 0 && proposedCol >= 1 && proposedCol + current.colSpan <= (this.$props.columns || 3) + 1) {
115
+ // current.col = proposedCol;
116
+ // shouldUpdate = true;
117
+ // }
118
+ // // resizing:
119
+ // const proposedColSpan = current.colSpan + dColSpan;
120
+ // if (dColSpan && proposedColSpan >= 1 && proposedColSpan + current.col <= (this.$props.columns || 3) + 1) {
121
+ // current.colSpan = proposedColSpan;
122
+ // shouldUpdate = true;
123
+ // }
124
+ // const proposedRowSpan = current.rowSpan + dRowSpan;
125
+ // if (dRowSpan && proposedRowSpan >= 1) {
126
+ // current.rowSpan = proposedRowSpan;
127
+ // shouldUpdate = true;
128
+ // }
129
+ // if (shouldUpdate) {
130
+ // this.setState({ positions: positions });
131
+ // dispatchEvent(this.$props.onReposition, {} as any, this, { value: positions });
132
+ // }
133
+ // };
134
+ // @ts-ignore
135
+ setup: !isV3 ? undefined : function () {
136
+ var v3 = !!isV3;
137
+ return {
138
+ v3: v3
139
+ };
140
+ },
141
+ render: function render(createElement) {
142
+ var h = gh || createElement;
143
+ var _a = this.$props,
144
+ className = _a.className,
145
+ _b = _a.columns,
146
+ columns = _b === void 0 ? 3 : _b,
147
+ _c = _a.columnWidth,
148
+ columnWidth = _c === void 0 ? '1fr' : _c,
149
+ gap = _a.gap,
150
+ _d = _a.rowHeight,
151
+ rowHeight = _d === void 0 ? '1fr' : _d,
152
+ style = _a.style,
153
+ _e = _a.autoFlow,
154
+ autoFlow = _e === void 0 ? 'column' : _e,
155
+ _f = _a.items,
156
+ items = _f === void 0 ? [] : _f;
157
+ var gapValue = gap ? "".concat(typeof gap.rows === 'number' ? gap.rows + 'px' : gap.rows) + ' ' + "".concat(typeof gap.columns === 'number' ? gap.columns + 'px' : gap.columns) : 16;
158
+ var tileLayoutStyles = __assign({
159
+ gridTemplateColumns: "repeat(".concat(columns, ", minmax(0px, ").concat(typeof columnWidth === 'number' ? columnWidth + 'px' : columnWidth, "))"),
160
+ gridAutoRows: "minmax(0px, ".concat(typeof rowHeight === 'number' ? rowHeight + 'px' : rowHeight, ")"),
161
+ gap: gapValue,
162
+ padding: gapValue
163
+ }, style);
164
+ return h("div", {
165
+ dir: this.$props.dir,
166
+ attrs: this.v3 ? undefined : {
167
+ dir: this.$props.dir,
168
+ id: this.$props.id
169
+ },
170
+ "class": (0, kendo_vue_common_1.classNames)('k-tilelayout', AUTO_FLOW_CLASSES[autoFlow], className),
171
+ style: tileLayoutStyles,
172
+ id: this.$props.id
173
+ }, [items.map(function (tile, index) {
174
+ return (
175
+ // @ts-ignore function children
176
+ h(Tile_1.Tile, {
177
+ key: this.$props.dataItemKey ? (0, kendo_vue_common_1.getter)(this.$props.dataItemKey)(tile) : index,
178
+ update: this.update,
179
+ attrs: this.v3 ? undefined : {
180
+ update: this.update,
181
+ defaultPosition: this.state.positions[index],
182
+ index: index,
183
+ resizable: tile.resizable,
184
+ reorderable: tile.reorderable,
185
+ hintClassName: tile.hintClassName,
186
+ hintStyle: tile.hintStyle,
187
+ ignoreDrag: this.$props.ignoreDrag
188
+ },
189
+ defaultPosition: this.state.positions[index],
190
+ index: index,
191
+ resizable: tile.resizable,
192
+ reorderable: tile.reorderable,
193
+ style: tile.style,
194
+ "class": tile.className,
195
+ hintClassName: tile.hintClassName,
196
+ hintStyle: tile.hintStyle,
197
+ ignoreDrag: this.$props.ignoreDrag
198
+ }, this.v3 ? function () {
199
+ return [tile.item ? tile.item : [h("div", {
200
+ "class": "k-tilelayout-item-header k-card-header"
201
+ }, [tile.header ? tile.header : h("h5", {
202
+ "class": 'k-card-title'
203
+ }, [tile.header])]), h("div", {
204
+ "class": 'k-tilelayout-item-body k-card-body'
205
+ }, [tile.body])]];
206
+ } : [tile.item ? tile.item : [h("div", {
207
+ "class": "k-tilelayout-item-header k-card-header"
208
+ }, [tile.header ? tile.header : h("h5", {
209
+ "class": 'k-card-title'
210
+ }, [tile.header])]), h("div", {
211
+ "class": 'k-tilelayout-item-body k-card-body'
212
+ }, [tile.body])]])
213
+ );
214
+ }, this)]);
215
+ },
216
+ methods: {
217
+ focus: function focus() {
218
+ if (this.$el) {
219
+ this.$el.focus();
220
+ }
221
+ }
222
+ }
223
+ };
224
+ exports.TileLayoutVue2 = TileLayoutVue2;
225
+ /**
226
+ * @hidden
227
+ */
228
+ var TileLayout = TileLayoutVue2;
229
+ exports.TileLayout = TileLayout;
@@ -39,7 +39,7 @@ export interface TileLayoutItem {
39
39
  * ([see example]({% slug tiles_tilelayout %}#toc-resizing)).
40
40
  * If `resizable` is not specified, the resizing of the TileLayoutItem will be enabled for both directions.
41
41
  */
42
- resizable?: TileResizeMode;
42
+ resizable?: TileResizeMode | string | boolean;
43
43
  /**
44
44
  * Specifies if the user is allowed to reorder the TileLayoutItem by dragging and dropping it
45
45
  * ([see example]({% slug tiles_tilelayout %}#toc-reordering)).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-vue-layout",
3
3
  "description": "Kendo UI for Vue Layouts package",
4
- "version": "3.7.3-dev.202211021251",
4
+ "version": "3.7.3-dev.202211021441",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/telerik/kendo-vue.git"
@@ -43,22 +43,22 @@
43
43
  "vue": "^2.6.12 || ^3.0.2"
44
44
  },
45
45
  "dependencies": {
46
- "@progress/kendo-vue-animation": "3.7.3-dev.202211021251",
47
- "@progress/kendo-vue-common": "3.7.3-dev.202211021251",
48
- "@progress/kendo-vue-popup": "3.7.3-dev.202211021251"
46
+ "@progress/kendo-vue-animation": "3.7.3-dev.202211021441",
47
+ "@progress/kendo-vue-common": "3.7.3-dev.202211021441",
48
+ "@progress/kendo-vue-popup": "3.7.3-dev.202211021441"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@progress/kendo-data-query": "^1.5.0",
52
52
  "@progress/kendo-date-math": "^1.5.1",
53
53
  "@progress/kendo-drawing": "^1.8.0",
54
54
  "@progress/kendo-licensing": "^1.0.1",
55
- "@progress/kendo-vue-buttons": "3.7.3-dev.202211021251",
56
- "@progress/kendo-vue-dateinputs": "3.7.3-dev.202211021251",
57
- "@progress/kendo-vue-dropdowns": "3.7.3-dev.202211021251",
58
- "@progress/kendo-vue-indicators": "3.7.3-dev.202211021251",
59
- "@progress/kendo-vue-inputs": "3.7.3-dev.202211021251",
60
- "@progress/kendo-vue-intl": "3.7.3-dev.202211021251",
61
- "@progress/kendo-vue-progressbars": "3.7.3-dev.202211021251"
55
+ "@progress/kendo-vue-buttons": "3.7.3-dev.202211021441",
56
+ "@progress/kendo-vue-dateinputs": "3.7.3-dev.202211021441",
57
+ "@progress/kendo-vue-dropdowns": "3.7.3-dev.202211021441",
58
+ "@progress/kendo-vue-indicators": "3.7.3-dev.202211021441",
59
+ "@progress/kendo-vue-inputs": "3.7.3-dev.202211021441",
60
+ "@progress/kendo-vue-intl": "3.7.3-dev.202211021441",
61
+ "@progress/kendo-vue-progressbars": "3.7.3-dev.202211021441"
62
62
  },
63
63
  "@progress": {
64
64
  "friendlyName": "Layouts",