@fileverse-dev/fortune-react 1.3.7-dateImport-1 → 1.3.7-dateImport-2

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.
@@ -650,7 +650,7 @@ var Toolbar = function Toolbar(_a) {
650
650
  }
651
651
  }, [cell, refs.globalCache]);
652
652
  var getToolbarItem = useCallback(function (name, i) {
653
- var _a, _b, _c, _d, _e, _f, _g;
653
+ var _a, _b, _c, _d, _e, _f;
654
654
  var tooltip = toolbar[name];
655
655
  if (name === "|") {
656
656
  return /*#__PURE__*/React.createElement(Divider, {
@@ -715,13 +715,15 @@ var Toolbar = function Toolbar(_a) {
715
715
  return v.value === (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa);
716
716
  });
717
717
  if ((curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) != null) {
718
- if (format != null) {
719
- currentFmt_1 = format.text;
720
- } else if (((_a = curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === null || _a === void 0 ? void 0 : _a.includes("#,##0")) || (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === "0" || (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === "0.00") {
718
+ var hasTime = /[hH]:/.test(curr_2.fa);
719
+ if (curr_2.t === "d") {
720
+ currentFmt_1 = hasTime ? "Date time" : "Date";
721
+ } else if (curr_2.t === "n" || curr_2.fa.includes("#,##0") || curr_2.fa === "0" || curr_2.fa === "0.00") {
721
722
  currentFmt_1 = "Number";
722
723
  } else if (is_date(curr_2.fa)) {
723
- var hasTime = curr_2.fa.includes("h") || curr_2.fa.includes("H") || curr_2.fa.includes("m") || curr_2.fa.includes("s");
724
724
  currentFmt_1 = hasTime ? "Date time" : "Date";
725
+ } else if (format != null) {
726
+ currentFmt_1 = format.text;
725
727
  } else {
726
728
  currentFmt_1 = defaultFormat[defaultFormat.length - 1].text;
727
729
  }
@@ -876,9 +878,9 @@ var Toolbar = function Toolbar(_a) {
876
878
  value: 2
877
879
  }];
878
880
  return /*#__PURE__*/React.createElement(Combo, {
879
- iconId: ((_b = _.find(items_1, function (item) {
881
+ iconId: ((_a = _.find(items_1, function (item) {
880
882
  return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.ht);
881
- })) === null || _b === void 0 ? void 0 : _b.title) || "align-left",
883
+ })) === null || _a === void 0 ? void 0 : _a.title) || "align-left",
882
884
  key: name,
883
885
  tooltip: toolbar.horizontalAlign,
884
886
  showArrow: false
@@ -928,9 +930,9 @@ var Toolbar = function Toolbar(_a) {
928
930
  value: 2
929
931
  }];
930
932
  return /*#__PURE__*/React.createElement(Combo, {
931
- iconId: ((_c = _.find(items_2, function (item) {
933
+ iconId: ((_b = _.find(items_2, function (item) {
932
934
  return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
933
- })) === null || _c === void 0 ? void 0 : _c.title) || "align-top",
935
+ })) === null || _b === void 0 ? void 0 : _b.title) || "align-top",
934
936
  key: name,
935
937
  tooltip: toolbar.verticalAlign,
936
938
  showArrow: false
@@ -1171,7 +1173,7 @@ var Toolbar = function Toolbar(_a) {
1171
1173
  });
1172
1174
  }
1173
1175
  if (name === "comment") {
1174
- var last = (_d = context.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d[context.luckysheet_select_save.length - 1];
1176
+ var last = (_c = context.luckysheet_select_save) === null || _c === void 0 ? void 0 : _c[context.luckysheet_select_save.length - 1];
1175
1177
  var row_index_1 = last === null || last === void 0 ? void 0 : last.row_focus;
1176
1178
  var col_index_1 = last === null || last === void 0 ? void 0 : last.column_focus;
1177
1179
  if (!last) {
@@ -1186,7 +1188,7 @@ var Toolbar = function Toolbar(_a) {
1186
1188
  }
1187
1189
  }
1188
1190
  var itemData_1;
1189
- if (((_f = (_e = flowdata === null || flowdata === void 0 ? void 0 : flowdata[row_index_1]) === null || _e === void 0 ? void 0 : _e[col_index_1]) === null || _f === void 0 ? void 0 : _f.ps) != null) {
1191
+ if (((_e = (_d = flowdata === null || flowdata === void 0 ? void 0 : flowdata[row_index_1]) === null || _d === void 0 ? void 0 : _d[col_index_1]) === null || _e === void 0 ? void 0 : _e.ps) != null) {
1190
1192
  itemData_1 = [{
1191
1193
  key: "edit",
1192
1194
  text: comment.edit,
@@ -1699,7 +1701,7 @@ var Toolbar = function Toolbar(_a) {
1699
1701
  iconId: name,
1700
1702
  tooltip: tooltip,
1701
1703
  key: name,
1702
- selected: (_g = toolbarItemSelectedFunc(name)) === null || _g === void 0 ? void 0 : _g(cell),
1704
+ selected: (_f = toolbarItemSelectedFunc(name)) === null || _f === void 0 ? void 0 : _f(cell),
1703
1705
  onClick: function onClick() {
1704
1706
  return setContext(function (draftCtx) {
1705
1707
  var _a;
@@ -659,7 +659,7 @@ var Toolbar = function Toolbar(_a) {
659
659
  }
660
660
  }, [cell, refs.globalCache]);
661
661
  var getToolbarItem = (0, _react.useCallback)(function (name, i) {
662
- var _a, _b, _c, _d, _e, _f, _g;
662
+ var _a, _b, _c, _d, _e, _f;
663
663
  var tooltip = toolbar[name];
664
664
  if (name === "|") {
665
665
  return /*#__PURE__*/_react.default.createElement(_Divider.default, {
@@ -724,13 +724,15 @@ var Toolbar = function Toolbar(_a) {
724
724
  return v.value === (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa);
725
725
  });
726
726
  if ((curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) != null) {
727
- if (format != null) {
728
- currentFmt_1 = format.text;
729
- } else if (((_a = curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === null || _a === void 0 ? void 0 : _a.includes("#,##0")) || (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === "0" || (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === "0.00") {
727
+ var hasTime = /[hH]:/.test(curr_2.fa);
728
+ if (curr_2.t === "d") {
729
+ currentFmt_1 = hasTime ? "Date time" : "Date";
730
+ } else if (curr_2.t === "n" || curr_2.fa.includes("#,##0") || curr_2.fa === "0" || curr_2.fa === "0.00") {
730
731
  currentFmt_1 = "Number";
731
732
  } else if ((0, _fortuneCore.is_date)(curr_2.fa)) {
732
- var hasTime = curr_2.fa.includes("h") || curr_2.fa.includes("H") || curr_2.fa.includes("m") || curr_2.fa.includes("s");
733
733
  currentFmt_1 = hasTime ? "Date time" : "Date";
734
+ } else if (format != null) {
735
+ currentFmt_1 = format.text;
734
736
  } else {
735
737
  currentFmt_1 = defaultFormat[defaultFormat.length - 1].text;
736
738
  }
@@ -885,9 +887,9 @@ var Toolbar = function Toolbar(_a) {
885
887
  value: 2
886
888
  }];
887
889
  return /*#__PURE__*/_react.default.createElement(_Combo.default, {
888
- iconId: ((_b = _lodash.default.find(items_1, function (item) {
890
+ iconId: ((_a = _lodash.default.find(items_1, function (item) {
889
891
  return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.ht);
890
- })) === null || _b === void 0 ? void 0 : _b.title) || "align-left",
892
+ })) === null || _a === void 0 ? void 0 : _a.title) || "align-left",
891
893
  key: name,
892
894
  tooltip: toolbar.horizontalAlign,
893
895
  showArrow: false
@@ -937,9 +939,9 @@ var Toolbar = function Toolbar(_a) {
937
939
  value: 2
938
940
  }];
939
941
  return /*#__PURE__*/_react.default.createElement(_Combo.default, {
940
- iconId: ((_c = _lodash.default.find(items_2, function (item) {
942
+ iconId: ((_b = _lodash.default.find(items_2, function (item) {
941
943
  return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
942
- })) === null || _c === void 0 ? void 0 : _c.title) || "align-top",
944
+ })) === null || _b === void 0 ? void 0 : _b.title) || "align-top",
943
945
  key: name,
944
946
  tooltip: toolbar.verticalAlign,
945
947
  showArrow: false
@@ -1180,7 +1182,7 @@ var Toolbar = function Toolbar(_a) {
1180
1182
  });
1181
1183
  }
1182
1184
  if (name === "comment") {
1183
- var last = (_d = context.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d[context.luckysheet_select_save.length - 1];
1185
+ var last = (_c = context.luckysheet_select_save) === null || _c === void 0 ? void 0 : _c[context.luckysheet_select_save.length - 1];
1184
1186
  var row_index_1 = last === null || last === void 0 ? void 0 : last.row_focus;
1185
1187
  var col_index_1 = last === null || last === void 0 ? void 0 : last.column_focus;
1186
1188
  if (!last) {
@@ -1195,7 +1197,7 @@ var Toolbar = function Toolbar(_a) {
1195
1197
  }
1196
1198
  }
1197
1199
  var itemData_1;
1198
- if (((_f = (_e = flowdata === null || flowdata === void 0 ? void 0 : flowdata[row_index_1]) === null || _e === void 0 ? void 0 : _e[col_index_1]) === null || _f === void 0 ? void 0 : _f.ps) != null) {
1200
+ if (((_e = (_d = flowdata === null || flowdata === void 0 ? void 0 : flowdata[row_index_1]) === null || _d === void 0 ? void 0 : _d[col_index_1]) === null || _e === void 0 ? void 0 : _e.ps) != null) {
1199
1201
  itemData_1 = [{
1200
1202
  key: "edit",
1201
1203
  text: comment.edit,
@@ -1708,7 +1710,7 @@ var Toolbar = function Toolbar(_a) {
1708
1710
  iconId: name,
1709
1711
  tooltip: tooltip,
1710
1712
  key: name,
1711
- selected: (_g = (0, _fortuneCore.toolbarItemSelectedFunc)(name)) === null || _g === void 0 ? void 0 : _g(cell),
1713
+ selected: (_f = (0, _fortuneCore.toolbarItemSelectedFunc)(name)) === null || _f === void 0 ? void 0 : _f(cell),
1712
1714
  onClick: function onClick() {
1713
1715
  return setContext(function (draftCtx) {
1714
1716
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.3.7-dateImport-1",
3
+ "version": "1.3.7-dateImport-2",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "module": "es/index.js",
@@ -16,7 +16,7 @@
16
16
  "tsc": "tsc"
17
17
  },
18
18
  "dependencies": {
19
- "@fileverse-dev/fortune-core": "1.3.7-dateImport-1",
19
+ "@fileverse-dev/fortune-core": "1.3.7-dateImport-2",
20
20
  "@fileverse/ui": "5.0.0",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",