@fileverse-dev/fortune-core 1.3.4-date-format-2 → 1.3.4-date-format-3

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.
@@ -12,7 +12,6 @@ var __assign = this && this.__assign || function () {
12
12
  import _ from "lodash";
13
13
  import { locale } from "./locale";
14
14
  import { getQKBorder, saveHyperlink } from "./modules";
15
- import { genarate } from "./modules/format";
16
15
  import { getSheetIndex } from "./utils";
17
16
  import { setRowHeight, setColumnWidth } from "./api";
18
17
  export var DEFAULT_FONT_SIZE = 12;
@@ -127,8 +126,7 @@ function brToNewline(str) {
127
126
  return str.replace(/<br\s*\/?>/gi, "\n");
128
127
  }
129
128
  var buildCellFromTd = function buildCellFromTd(td, classStyles, ctx) {
130
- var _a;
131
- var _b, _c, _d, _e;
129
+ var _a, _b, _c, _d;
132
130
  var cell = {};
133
131
  var rawText = (td.innerText || td.innerHTML || "").trim();
134
132
  var isLineBreak = rawText.includes("<br />");
@@ -146,22 +144,24 @@ var buildCellFromTd = function buildCellFromTd(td, classStyles, ctx) {
146
144
  })
147
145
  });
148
146
  } else {
149
- var mask = genarate(rawText);
150
- _a = mask || [], cell.m = _a[0], cell.ct = _a[1], cell.v = _a[2];
147
+ cell.v = rawText;
148
+ cell.m = rawText;
149
+ cell.ct = {
150
+ fa: "General",
151
+ t: "g"
152
+ };
151
153
  if (HEX_REGEX.test(rawText)) {
152
154
  cell.ct = {
153
155
  fa: "@",
154
156
  t: "s"
155
157
  };
156
- cell.m = rawText;
157
- cell.v = rawText;
158
158
  }
159
159
  }
160
- if (((_b = td.style) === null || _b === void 0 ? void 0 : _b.alignItems) === "center") {
160
+ if (((_a = td.style) === null || _a === void 0 ? void 0 : _a.alignItems) === "center") {
161
161
  cell.vt = 0;
162
- } else if (((_c = td.style) === null || _c === void 0 ? void 0 : _c.alignItems) === "flex-end") {
162
+ } else if (((_b = td.style) === null || _b === void 0 ? void 0 : _b.alignItems) === "flex-end") {
163
163
  cell.vt = 2;
164
- } else if (((_d = td.style) === null || _d === void 0 ? void 0 : _d.alignItems) === "flex-start") {
164
+ } else if (((_c = td.style) === null || _c === void 0 ? void 0 : _c.alignItems) === "flex-start") {
165
165
  cell.vt = 1;
166
166
  }
167
167
  var styleBlock = typeof classStyles[".".concat(td.className)] === "string" ? classStyles[".".concat(td.className)] : "";
@@ -188,7 +188,7 @@ var buildCellFromTd = function buildCellFromTd(td, classStyles, ctx) {
188
188
  } else {
189
189
  cell.ht = 1;
190
190
  }
191
- if (((_e = td === null || td === void 0 ? void 0 : td.style) === null || _e === void 0 ? void 0 : _e["overflow-wrap"]) === "anywhere") {
191
+ if (((_d = td === null || td === void 0 ? void 0 : td.style) === null || _d === void 0 ? void 0 : _d["overflow-wrap"]) === "anywhere") {
192
192
  cell.tb = "2";
193
193
  } else {
194
194
  cell.tb = "2";
@@ -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
- var mask = (0, _format.genarate)(rawText);
158
- _a = mask || [], cell.m = _a[0], cell.ct = _a[1], cell.v = _a[2];
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 (((_b = td.style) === null || _b === void 0 ? void 0 : _b.alignItems) === "center") {
168
+ if (((_a = td.style) === null || _a === void 0 ? void 0 : _a.alignItems) === "center") {
169
169
  cell.vt = 0;
170
- } else if (((_c = td.style) === null || _c === void 0 ? void 0 : _c.alignItems) === "flex-end") {
170
+ } else if (((_b = td.style) === null || _b === void 0 ? void 0 : _b.alignItems) === "flex-end") {
171
171
  cell.vt = 2;
172
- } else if (((_d = td.style) === null || _d === void 0 ? void 0 : _d.alignItems) === "flex-start") {
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 (((_e = td === null || td === void 0 ? void 0 : td.style) === null || _e === void 0 ? void 0 : _e["overflow-wrap"]) === "anywhere") {
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.3.4-date-format-2",
3
+ "version": "1.3.4-date-format-3",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",