@fileverse-dev/fortune-core 1.3.5 → 1.3.6
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/es/api/sheet.js +41 -6
- package/es/canvas.js +1 -1
- package/es/events/keyboard.js +3 -3
- package/es/events/mouse.js +1 -1
- package/es/events/paste.js +34 -18
- package/es/modules/cell.js +8 -6
- package/es/modules/cursor.d.ts +1 -0
- package/es/modules/cursor.js +35 -0
- package/es/modules/format.js +29 -38
- package/es/modules/hyperlink.d.ts +2 -2
- package/es/modules/hyperlink.js +6 -2
- package/es/modules/selection.js +29 -7
- package/es/modules/ssf.js +1 -1
- package/es/modules/toolbar.js +34 -13
- package/es/modules/validation.d.ts +10 -0
- package/es/modules/validation.js +283 -20
- package/es/paste-table-helpers.js +11 -11
- package/lib/api/sheet.js +41 -6
- package/lib/canvas.js +1 -1
- package/lib/events/keyboard.js +3 -3
- package/lib/events/mouse.js +1 -1
- package/lib/events/paste.js +32 -16
- package/lib/modules/cell.js +8 -6
- package/lib/modules/cursor.d.ts +1 -0
- package/lib/modules/cursor.js +36 -0
- package/lib/modules/format.js +28 -37
- package/lib/modules/hyperlink.d.ts +2 -2
- package/lib/modules/hyperlink.js +6 -2
- package/lib/modules/selection.js +29 -7
- package/lib/modules/ssf.js +1 -1
- package/lib/modules/toolbar.js +33 -12
- package/lib/modules/validation.d.ts +10 -0
- package/lib/modules/validation.js +284 -20
- package/lib/paste-table-helpers.js +11 -11
- package/package.json +1 -1
|
@@ -8,7 +8,6 @@ exports.handlePastedTable = handlePastedTable;
|
|
|
8
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
9
|
var _locale = require("./locale");
|
|
10
10
|
var _modules = require("./modules");
|
|
11
|
-
var _format = require("./modules/format");
|
|
12
11
|
var _utils = require("./utils");
|
|
13
12
|
var _api = require("./api");
|
|
14
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -135,8 +134,7 @@ function brToNewline(str) {
|
|
|
135
134
|
return str.replace(/<br\s*\/?>/gi, "\n");
|
|
136
135
|
}
|
|
137
136
|
var buildCellFromTd = function buildCellFromTd(td, classStyles, ctx) {
|
|
138
|
-
var _a;
|
|
139
|
-
var _b, _c, _d, _e;
|
|
137
|
+
var _a, _b, _c, _d;
|
|
140
138
|
var cell = {};
|
|
141
139
|
var rawText = (td.innerText || td.innerHTML || "").trim();
|
|
142
140
|
var isLineBreak = rawText.includes("<br />");
|
|
@@ -154,22 +152,24 @@ var buildCellFromTd = function buildCellFromTd(td, classStyles, ctx) {
|
|
|
154
152
|
})
|
|
155
153
|
});
|
|
156
154
|
} else {
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
cell.v = rawText;
|
|
156
|
+
cell.m = rawText;
|
|
157
|
+
cell.ct = {
|
|
158
|
+
fa: "General",
|
|
159
|
+
t: "g"
|
|
160
|
+
};
|
|
159
161
|
if (HEX_REGEX.test(rawText)) {
|
|
160
162
|
cell.ct = {
|
|
161
163
|
fa: "@",
|
|
162
164
|
t: "s"
|
|
163
165
|
};
|
|
164
|
-
cell.m = rawText;
|
|
165
|
-
cell.v = rawText;
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
if (((
|
|
168
|
+
if (((_a = td.style) === null || _a === void 0 ? void 0 : _a.alignItems) === "center") {
|
|
169
169
|
cell.vt = 0;
|
|
170
|
-
} else if (((
|
|
170
|
+
} else if (((_b = td.style) === null || _b === void 0 ? void 0 : _b.alignItems) === "flex-end") {
|
|
171
171
|
cell.vt = 2;
|
|
172
|
-
} else if (((
|
|
172
|
+
} else if (((_c = td.style) === null || _c === void 0 ? void 0 : _c.alignItems) === "flex-start") {
|
|
173
173
|
cell.vt = 1;
|
|
174
174
|
}
|
|
175
175
|
var styleBlock = typeof classStyles[".".concat(td.className)] === "string" ? classStyles[".".concat(td.className)] : "";
|
|
@@ -196,7 +196,7 @@ var buildCellFromTd = function buildCellFromTd(td, classStyles, ctx) {
|
|
|
196
196
|
} else {
|
|
197
197
|
cell.ht = 1;
|
|
198
198
|
}
|
|
199
|
-
if (((
|
|
199
|
+
if (((_d = td === null || td === void 0 ? void 0 : td.style) === null || _d === void 0 ? void 0 : _d["overflow-wrap"]) === "anywhere") {
|
|
200
200
|
cell.tb = "2";
|
|
201
201
|
} else {
|
|
202
202
|
cell.tb = "2";
|