@tailor-cms/ce-table-edit 2.0.0 → 2.0.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/dist/index.cjs +66 -51
- package/dist/index.css +7 -10
- package/dist/index.js +67 -52
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3498,6 +3498,39 @@ function isString(value) {
|
|
|
3498
3498
|
return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
|
|
3499
3499
|
}
|
|
3500
3500
|
//#endregion
|
|
3501
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js
|
|
3502
|
+
/**
|
|
3503
|
+
* Performs a deep comparison between two values to determine if they are
|
|
3504
|
+
* equivalent.
|
|
3505
|
+
*
|
|
3506
|
+
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
|
3507
|
+
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
|
3508
|
+
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
3509
|
+
* by their own, not inherited, enumerable properties. Functions and DOM
|
|
3510
|
+
* nodes are compared by strict equality, i.e. `===`.
|
|
3511
|
+
*
|
|
3512
|
+
* @static
|
|
3513
|
+
* @memberOf _
|
|
3514
|
+
* @since 0.1.0
|
|
3515
|
+
* @category Lang
|
|
3516
|
+
* @param {*} value The value to compare.
|
|
3517
|
+
* @param {*} other The other value to compare.
|
|
3518
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
3519
|
+
* @example
|
|
3520
|
+
*
|
|
3521
|
+
* var object = { 'a': 1 };
|
|
3522
|
+
* var other = { 'a': 1 };
|
|
3523
|
+
*
|
|
3524
|
+
* _.isEqual(object, other);
|
|
3525
|
+
* // => true
|
|
3526
|
+
*
|
|
3527
|
+
* object === other;
|
|
3528
|
+
* // => false
|
|
3529
|
+
*/
|
|
3530
|
+
function isEqual(value, other) {
|
|
3531
|
+
return baseIsEqual(value, other);
|
|
3532
|
+
}
|
|
3533
|
+
//#endregion
|
|
3501
3534
|
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSortBy.js
|
|
3502
3535
|
/**
|
|
3503
3536
|
* The base implementation of `_.sortBy` which uses `comparer` to define the
|
|
@@ -4059,11 +4092,10 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
|
4059
4092
|
};
|
|
4060
4093
|
//#endregion
|
|
4061
4094
|
//#region src/components/TableCell.vue
|
|
4062
|
-
var TableCell_default = /* @__PURE__ */ _plugin_vue_export_helper_default(TableCell_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
4095
|
+
var TableCell_default = /* @__PURE__ */ _plugin_vue_export_helper_default(TableCell_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-d04f0fd5"]]);
|
|
4063
4096
|
//#endregion
|
|
4064
4097
|
//#region src/components/Edit.vue?vue&type=script&setup=true&lang.ts
|
|
4065
|
-
var _hoisted_1 = { class: "
|
|
4066
|
-
var _hoisted_2 = { class: "body" };
|
|
4098
|
+
var _hoisted_1 = { class: "tce-table" };
|
|
4067
4099
|
var MIN_ROWS = 1;
|
|
4068
4100
|
var MIN_COLUMNS = 1;
|
|
4069
4101
|
//#endregion
|
|
@@ -4181,57 +4213,40 @@ var Edit_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
4181
4213
|
elementData.embeds[element.id] = element;
|
|
4182
4214
|
emit("save", elementData);
|
|
4183
4215
|
};
|
|
4216
|
+
(0, vue.watch)(() => props.element.data, (data) => {
|
|
4217
|
+
if (isEqual(data, elementData)) return;
|
|
4218
|
+
Object.assign(elementData, cloneDeep(data));
|
|
4219
|
+
});
|
|
4184
4220
|
return (_ctx, _cache) => {
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
cell: embeds.value[cell.id],
|
|
4212
|
-
"is-readonly": __props.isReadonly,
|
|
4213
|
-
table: __props.element,
|
|
4214
|
-
"onCol:add": ($event) => addColumn(cell.id, $event),
|
|
4215
|
-
"onCol:remove": ($event) => removeColumn(cell.id),
|
|
4216
|
-
"onRow:add": ($event) => addRow(cell.id, $event),
|
|
4217
|
-
"onRow:remove": ($event) => removeRow(cell.id),
|
|
4218
|
-
onSave: saveCell
|
|
4219
|
-
}, null, 8, [
|
|
4220
|
-
"cell",
|
|
4221
|
-
"is-readonly",
|
|
4222
|
-
"table",
|
|
4223
|
-
"onCol:add",
|
|
4224
|
-
"onCol:remove",
|
|
4225
|
-
"onRow:add",
|
|
4226
|
-
"onRow:remove"
|
|
4227
|
-
]);
|
|
4228
|
-
}), 128))]);
|
|
4229
|
-
}), 128))], 2)])]),
|
|
4230
|
-
_: 1
|
|
4231
|
-
});
|
|
4221
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([{ readonly: __props.isReadonly }, "table"]) }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(table.value, (row) => {
|
|
4222
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
4223
|
+
key: row.id,
|
|
4224
|
+
class: "table-row"
|
|
4225
|
+
}, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(cells(row), (cell) => {
|
|
4226
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)(TableCell_default, {
|
|
4227
|
+
key: cell.id,
|
|
4228
|
+
cell: embeds.value[cell.id],
|
|
4229
|
+
"is-readonly": __props.isReadonly,
|
|
4230
|
+
table: __props.element,
|
|
4231
|
+
"onCol:add": ($event) => addColumn(cell.id, $event),
|
|
4232
|
+
"onCol:remove": ($event) => removeColumn(cell.id),
|
|
4233
|
+
"onRow:add": ($event) => addRow(cell.id, $event),
|
|
4234
|
+
"onRow:remove": ($event) => removeRow(cell.id),
|
|
4235
|
+
onSave: saveCell
|
|
4236
|
+
}, null, 8, [
|
|
4237
|
+
"cell",
|
|
4238
|
+
"is-readonly",
|
|
4239
|
+
"table",
|
|
4240
|
+
"onCol:add",
|
|
4241
|
+
"onCol:remove",
|
|
4242
|
+
"onRow:add",
|
|
4243
|
+
"onRow:remove"
|
|
4244
|
+
]);
|
|
4245
|
+
}), 128))]);
|
|
4246
|
+
}), 128))], 2)]);
|
|
4232
4247
|
};
|
|
4233
4248
|
}
|
|
4234
|
-
}), [["__scopeId", "data-v-
|
|
4249
|
+
}), [["__scopeId", "data-v-2c198b5d"]]);
|
|
4235
4250
|
//#endregion
|
|
4236
4251
|
//#region src/index.ts
|
|
4237
4252
|
var manifest = {
|
package/dist/index.css
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
.table-cell[data-v-
|
|
1
|
+
.table-cell[data-v-d04f0fd5] {
|
|
2
2
|
display: table-cell;
|
|
3
3
|
border: 1px solid black;
|
|
4
|
-
width:
|
|
5
|
-
max-width:
|
|
4
|
+
width: 24rem;
|
|
5
|
+
max-width: 24rem;
|
|
6
6
|
height: 100%;
|
|
7
7
|
vertical-align: top;
|
|
8
|
-
}.tce-
|
|
8
|
+
}.tce-table[data-v-2c198b5d] {
|
|
9
9
|
text-align: left;
|
|
10
|
-
margin: 1rem 0;
|
|
11
|
-
}
|
|
12
|
-
.body[data-v-8f7ed988] {
|
|
13
10
|
overflow-y: auto;
|
|
14
11
|
}
|
|
15
|
-
.table[data-v-
|
|
12
|
+
.table[data-v-2c198b5d] {
|
|
16
13
|
display: table;
|
|
17
14
|
border-collapse: collapse;
|
|
18
15
|
}
|
|
19
|
-
.table .table-row[data-v-
|
|
16
|
+
.table .table-row[data-v-2c198b5d] {
|
|
20
17
|
display: table-row;
|
|
21
18
|
}
|
|
22
|
-
.readonly[data-v-
|
|
19
|
+
.readonly[data-v-2c198b5d] {
|
|
23
20
|
pointer-events: none;
|
|
24
21
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, reactive, renderList, resolveComponent, resolveDirective,
|
|
1
|
+
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, reactive, renderList, resolveComponent, resolveDirective, watch, withCtx, withDirectives } from "vue";
|
|
2
2
|
import './index.css';//#region ../manifest/dist/chunk-CfYAbeIz.mjs
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -3494,6 +3494,39 @@ function isString(value) {
|
|
|
3494
3494
|
return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
|
|
3495
3495
|
}
|
|
3496
3496
|
//#endregion
|
|
3497
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js
|
|
3498
|
+
/**
|
|
3499
|
+
* Performs a deep comparison between two values to determine if they are
|
|
3500
|
+
* equivalent.
|
|
3501
|
+
*
|
|
3502
|
+
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
|
3503
|
+
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
|
3504
|
+
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
3505
|
+
* by their own, not inherited, enumerable properties. Functions and DOM
|
|
3506
|
+
* nodes are compared by strict equality, i.e. `===`.
|
|
3507
|
+
*
|
|
3508
|
+
* @static
|
|
3509
|
+
* @memberOf _
|
|
3510
|
+
* @since 0.1.0
|
|
3511
|
+
* @category Lang
|
|
3512
|
+
* @param {*} value The value to compare.
|
|
3513
|
+
* @param {*} other The other value to compare.
|
|
3514
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
3515
|
+
* @example
|
|
3516
|
+
*
|
|
3517
|
+
* var object = { 'a': 1 };
|
|
3518
|
+
* var other = { 'a': 1 };
|
|
3519
|
+
*
|
|
3520
|
+
* _.isEqual(object, other);
|
|
3521
|
+
* // => true
|
|
3522
|
+
*
|
|
3523
|
+
* object === other;
|
|
3524
|
+
* // => false
|
|
3525
|
+
*/
|
|
3526
|
+
function isEqual(value, other) {
|
|
3527
|
+
return baseIsEqual(value, other);
|
|
3528
|
+
}
|
|
3529
|
+
//#endregion
|
|
3497
3530
|
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSortBy.js
|
|
3498
3531
|
/**
|
|
3499
3532
|
* The base implementation of `_.sortBy` which uses `comparer` to define the
|
|
@@ -4055,11 +4088,10 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
|
4055
4088
|
};
|
|
4056
4089
|
//#endregion
|
|
4057
4090
|
//#region src/components/TableCell.vue
|
|
4058
|
-
var TableCell_default = /* @__PURE__ */ _plugin_vue_export_helper_default(TableCell_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
4091
|
+
var TableCell_default = /* @__PURE__ */ _plugin_vue_export_helper_default(TableCell_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-d04f0fd5"]]);
|
|
4059
4092
|
//#endregion
|
|
4060
4093
|
//#region src/components/Edit.vue?vue&type=script&setup=true&lang.ts
|
|
4061
|
-
var _hoisted_1 = { class: "
|
|
4062
|
-
var _hoisted_2 = { class: "body" };
|
|
4094
|
+
var _hoisted_1 = { class: "tce-table" };
|
|
4063
4095
|
var MIN_ROWS = 1;
|
|
4064
4096
|
var MIN_COLUMNS = 1;
|
|
4065
4097
|
//#endregion
|
|
@@ -4177,57 +4209,40 @@ var Edit_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
4177
4209
|
elementData.embeds[element.id] = element;
|
|
4178
4210
|
emit("save", elementData);
|
|
4179
4211
|
};
|
|
4212
|
+
watch(() => props.element.data, (data) => {
|
|
4213
|
+
if (isEqual(data, elementData)) return;
|
|
4214
|
+
Object.assign(elementData, cloneDeep(data));
|
|
4215
|
+
});
|
|
4180
4216
|
return (_ctx, _cache) => {
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
cell: embeds.value[cell.id],
|
|
4208
|
-
"is-readonly": __props.isReadonly,
|
|
4209
|
-
table: __props.element,
|
|
4210
|
-
"onCol:add": ($event) => addColumn(cell.id, $event),
|
|
4211
|
-
"onCol:remove": ($event) => removeColumn(cell.id),
|
|
4212
|
-
"onRow:add": ($event) => addRow(cell.id, $event),
|
|
4213
|
-
"onRow:remove": ($event) => removeRow(cell.id),
|
|
4214
|
-
onSave: saveCell
|
|
4215
|
-
}, null, 8, [
|
|
4216
|
-
"cell",
|
|
4217
|
-
"is-readonly",
|
|
4218
|
-
"table",
|
|
4219
|
-
"onCol:add",
|
|
4220
|
-
"onCol:remove",
|
|
4221
|
-
"onRow:add",
|
|
4222
|
-
"onRow:remove"
|
|
4223
|
-
]);
|
|
4224
|
-
}), 128))]);
|
|
4225
|
-
}), 128))], 2)])]),
|
|
4226
|
-
_: 1
|
|
4227
|
-
});
|
|
4217
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", { class: normalizeClass([{ readonly: __props.isReadonly }, "table"]) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(table.value, (row) => {
|
|
4218
|
+
return openBlock(), createElementBlock("div", {
|
|
4219
|
+
key: row.id,
|
|
4220
|
+
class: "table-row"
|
|
4221
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(cells(row), (cell) => {
|
|
4222
|
+
return openBlock(), createBlock(TableCell_default, {
|
|
4223
|
+
key: cell.id,
|
|
4224
|
+
cell: embeds.value[cell.id],
|
|
4225
|
+
"is-readonly": __props.isReadonly,
|
|
4226
|
+
table: __props.element,
|
|
4227
|
+
"onCol:add": ($event) => addColumn(cell.id, $event),
|
|
4228
|
+
"onCol:remove": ($event) => removeColumn(cell.id),
|
|
4229
|
+
"onRow:add": ($event) => addRow(cell.id, $event),
|
|
4230
|
+
"onRow:remove": ($event) => removeRow(cell.id),
|
|
4231
|
+
onSave: saveCell
|
|
4232
|
+
}, null, 8, [
|
|
4233
|
+
"cell",
|
|
4234
|
+
"is-readonly",
|
|
4235
|
+
"table",
|
|
4236
|
+
"onCol:add",
|
|
4237
|
+
"onCol:remove",
|
|
4238
|
+
"onRow:add",
|
|
4239
|
+
"onRow:remove"
|
|
4240
|
+
]);
|
|
4241
|
+
}), 128))]);
|
|
4242
|
+
}), 128))], 2)]);
|
|
4228
4243
|
};
|
|
4229
4244
|
}
|
|
4230
|
-
}), [["__scopeId", "data-v-
|
|
4245
|
+
}), [["__scopeId", "data-v-2c198b5d"]]);
|
|
4231
4246
|
//#endregion
|
|
4232
4247
|
//#region src/index.ts
|
|
4233
4248
|
var manifest = {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Tailor CMS table authoring component",
|
|
4
4
|
"author": "Studion <info@gostudion.com> (https://github.com/tailor-cms)",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "2.0.
|
|
6
|
+
"version": "2.0.1",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"import": "./dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
28
28
|
"vue-tsc": "^3.2.7",
|
|
29
29
|
"vuetify": "^4.0.6",
|
|
30
|
-
"@tailor-cms/ce-table-manifest": "2.0.
|
|
30
|
+
"@tailor-cms/ce-table-manifest": "2.0.1"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@tailor-cms/cek-common": "2.0.1",
|