tor-univer-sheet 1.2.5 → 1.2.7

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.
@@ -1,27 +1,40 @@
1
- import { CellValueType as A } from "@univerjs/presets";
2
- import { CommandType as ve, FEventName as Te, FUniver as Se, ICommandService as Ce, IUniverInstanceService as Ne, Inject as Pe, Injector as ke, LocaleType as Oe, Plugin as Ie, Univer as je, UniverInstanceType as He, Workbook as Ue, createUniver as Re, defaultTheme as Be, greenTheme as Ve, merge as Ae, mergeLocales as Ee, touchDependencies as Fe } from "@univerjs/presets";
3
- import { BaselineOffset as Ze, CommandService as $e } from "@univerjs/core";
1
+ import { CellValueType as F } from "@univerjs/presets";
2
+ import { CommandType as we, FEventName as Se, FUniver as Ce, ICommandService as Te, IUniverInstanceService as Ne, Inject as Pe, Injector as Ue, LocaleType as ke, Plugin as Oe, Univer as Ie, UniverInstanceType as je, Workbook as He, createUniver as Re, defaultTheme as Be, greenTheme as Ze, merge as Fe, mergeLocales as Ve, touchDependencies as Ae } from "@univerjs/presets";
3
+ import { BaselineOffset as Ge, CommandService as $e } from "@univerjs/core";
4
4
  import { SetRangeValuesCommand as qe } from "@univerjs/sheets";
5
5
  import { ComponentManager as Je, ContextMenuGroup as ze, ContextMenuPosition as Ke, IMenuManagerService as _e, MenuItemType as Qe, RibbonStartGroup as Xe } from "@univerjs/ui";
6
6
  import { UniverVue3AdapterPlugin as tt } from "@univerjs/ui-adapter-vue3";
7
7
  import { UniverSheetsAdvancedPreset as ot } from "@univerjs/preset-sheets-advanced";
8
- import { UniverSheetsConditionalFormattingPreset as st } from "@univerjs/presets/preset-sheets-conditional-formatting";
8
+ import { UniverSheetsConditionalFormattingPreset as st } from "@univerjs/preset-sheets-conditional-formatting";
9
9
  import { UniverSheetsCorePreset as it } from "@univerjs/presets/preset-sheets-core";
10
- import { UniverSheetsDataValidationPreset as ut } from "@univerjs/presets/preset-sheets-data-validation";
11
- import { UniverSheetsDrawingPreset as ft } from "@univerjs/presets/preset-sheets-drawing";
12
- import { UniverSheetsFilterPreset as dt } from "@univerjs/presets/preset-sheets-filter";
13
- import { UniverSheetsHyperLinkPreset as yt } from "@univerjs/presets/preset-sheets-hyper-link";
14
- import { UniverSheetsNotePreset as Dt } from "@univerjs/preset-sheets-note";
15
- import { default as bt } from "@univerjs/preset-sheets-core/locales/zh-CN";
16
- import { default as Mt } from "@univerjs/preset-sheets-advanced/locales/zh-CN";
17
- import { default as xt } from "@univerjs/presets/preset-sheets-conditional-formatting/locales/zh-CN";
18
- import { default as Tt } from "@univerjs/presets/preset-sheets-core/locales/zh-CN";
19
- import { default as Ct } from "@univerjs/presets/preset-sheets-data-validation/locales/zh-CN";
20
- import { default as Pt } from "@univerjs/preset-sheets-drawing/locales/zh-CN";
21
- import { default as Ot } from "@univerjs/presets/preset-sheets-drawing/locales/zh-CN";
22
- import { default as jt } from "@univerjs/presets/preset-sheets-filter/locales/zh-CN";
23
- import { default as Ut } from "@univerjs/presets/preset-sheets-hyper-link/locales/zh-CN";
24
- import { default as Bt } from "@univerjs/preset-sheets-note/locales/zh-CN";
10
+ import { UniverSheetsDataValidationPreset as lt } from "@univerjs/preset-sheets-data-validation";
11
+ import { UniverSheetsDrawingPreset as ut } from "@univerjs/preset-sheets-drawing";
12
+ import { UniverSheetsFilterPreset as dt } from "@univerjs/preset-sheets-filter";
13
+ import { UniverSheetsHyperLinkPreset as yt } from "@univerjs/preset-sheets-hyper-link";
14
+ import { UniverSheetsNotePreset as gt } from "@univerjs/preset-sheets-note";
15
+ import { UniverSheetsSortPreset as pt } from "@univerjs/preset-sheets-sort";
16
+ import { UniverSheetsFindReplacePreset as xt } from "@univerjs/preset-sheets-find-replace";
17
+ import { UniverSheetsThreadCommentPreset as vt } from "@univerjs/preset-sheets-thread-comment";
18
+ import { UniverSheetsTablePreset as St } from "@univerjs/preset-sheets-table";
19
+ import { UniverSheetsCollaborationPreset as Tt } from "@univerjs/preset-sheets-collaboration";
20
+ import { UniverWatermarkPlugin as Pt } from "@univerjs/watermark";
21
+ import { UniverSheetsCrosshairHighlightPlugin as kt } from "@univerjs/sheets-crosshair-highlight";
22
+ import { UniverLiveSharePlugin as It } from "@univerjs-pro/live-share";
23
+ import { default as Ht } from "@univerjs/preset-sheets-core/locales/zh-CN";
24
+ import { default as Bt } from "@univerjs/preset-sheets-advanced/locales/zh-CN";
25
+ import { default as Ft } from "@univerjs/presets/preset-sheets-conditional-formatting/locales/zh-CN";
26
+ import { default as At } from "@univerjs/presets/preset-sheets-core/locales/zh-CN";
27
+ import { default as Gt } from "@univerjs/preset-sheets-drawing/locales/zh-CN";
28
+ import { default as Lt } from "@univerjs/preset-sheets-filter/locales/zh-CN";
29
+ import { default as Wt } from "@univerjs/preset-sheets-hyper-link/locales/zh-CN";
30
+ import { default as zt } from "@univerjs/preset-sheets-note/locales/zh-CN";
31
+ import { default as _t } from "@univerjs/presets/preset-sheets-filter/locales/zh-CN";
32
+ import { default as Xt } from "@univerjs/preset-sheets-sort/locales/zh-CN";
33
+ import { default as tr } from "@univerjs/preset-sheets-data-validation/locales/zh-CN";
34
+ import { default as or } from "@univerjs/preset-sheets-find-replace/locales/zh-CN";
35
+ import { default as sr } from "@univerjs/preset-sheets-thread-comment/locales/zh-CN";
36
+ import { default as ir } from "@univerjs/preset-sheets-table/locales/zh-CN";
37
+ import { default as lr } from "@univerjs/preset-sheets-collaboration/locales/zh-CN";
25
38
  import d from "dayjs";
26
39
  import z from "decimal.js";
27
40
  const de = (e, r) => {
@@ -53,7 +66,7 @@ function he(e) {
53
66
  appVersion: e?.appVersion || "1.0.0"
54
67
  };
55
68
  }
56
- const X = Object.prototype.toString, K = (e, r) => X.call(e) === `[object ${r}]`, ee = (e) => typeof e < "u", te = (e) => !ee(e), re = (e) => e !== null && K(e, "Object"), E = (e) => e == null || typeof e > "u" ? !0 : q(e) || se(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : re(e) ? Object.keys(e).length === 0 : !1, oe = (e) => e === null, ne = (e) => te(e) || oe(e), se = (e) => K(e, "String"), q = (e) => e && Array.isArray(e);
69
+ const X = Object.prototype.toString, K = (e, r) => X.call(e) === `[object ${r}]`, ee = (e) => typeof e < "u", te = (e) => !ee(e), re = (e) => e !== null && K(e, "Object"), V = (e) => e == null || typeof e > "u" ? !0 : q(e) || se(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : re(e) ? Object.keys(e).length === 0 : !1, oe = (e) => e === null, ne = (e) => te(e) || oe(e), se = (e) => K(e, "String"), q = (e) => e && Array.isArray(e);
57
70
  class ae {
58
71
  value;
59
72
  constructor(r) {
@@ -126,7 +139,7 @@ class ae {
126
139
  return this.value.toNumber();
127
140
  }
128
141
  }
129
- function j(e = 0) {
142
+ function I(e = 0) {
130
143
  return new ae(e);
131
144
  }
132
145
  var ie = /* @__PURE__ */ ((e) => (e.无 = "no", e.年 = "year", e.月 = "month", e.周 = "week", e.天 = "day", e.班组 = "shift", e.小时 = "hour", e.半小时 = "half_hour", e))(ie || {}), ce = /* @__PURE__ */ ((e) => (e.view = "view", e.edit = "edit", e))(ce || {});
@@ -144,24 +157,24 @@ async function ye(e, r) {
144
157
  case "month":
145
158
  if (q(r))
146
159
  return Promise.resolve(r);
147
- const h = d(r);
148
- if (!h.isValid())
160
+ const y = d(r);
161
+ if (!y.isValid())
149
162
  return Promise.reject("无效的日期格式");
150
- const v = h.startOf("month").format("YYYY-MM-DD"), a = h.endOf("month").format("YYYY-MM-DD");
151
- return Promise.resolve([v, a]);
163
+ const w = y.startOf("month").format("YYYY-MM-DD"), a = y.endOf("month").format("YYYY-MM-DD");
164
+ return Promise.resolve([w, a]);
152
165
  case "day":
153
166
  if (q(r))
154
167
  return Promise.resolve(r);
155
- const y = d(r);
156
- if (!y.isValid())
168
+ const h = d(r);
169
+ if (!h.isValid())
157
170
  return Promise.reject("无效的日期格式");
158
- const Y = y.startOf("day").format("YYYY-MM-DD HH:mm:ss"), l = y.endOf("day").format("YYYY-MM-DD HH:mm:ss");
159
- return Promise.resolve([Y, l]);
171
+ const Y = h.startOf("day").format("YYYY-MM-DD HH:mm:ss"), f = h.endOf("day").format("YYYY-MM-DD HH:mm:ss");
172
+ return Promise.resolve([Y, f]);
160
173
  default:
161
174
  return Promise.reject("不支持的周期类型");
162
175
  }
163
176
  }
164
- function H(e, r, o) {
177
+ function j(e, r, o) {
165
178
  return o ? d(r).diff(d(e), o) : 0;
166
179
  }
167
180
  function W(e, r, o) {
@@ -176,15 +189,15 @@ function W(e, r, o) {
176
189
  return d(e).subtract(r, o).format(t);
177
190
  }
178
191
  function P(e, r, o, t) {
179
- const c = "YYYY-MM-DD HH:mm:ss", n = Z(e, r, o, t), h = d(n);
192
+ const c = "YYYY-MM-DD HH:mm:ss", n = G(e, r, o, t), y = d(n);
180
193
  if (r === "month") {
181
- const a = h.month();
182
- return a === 0 ? [h.startOf("month").format(c), h.date(25).endOf("day").format(c)] : a === 11 ? [h.subtract(1, "month").date(26).startOf("day").format(c), h.endOf("month").format(c)] : [h.subtract(1, "month").date(26).startOf("day").format(c), h.date(25).endOf("day").format(c)];
194
+ const a = y.month();
195
+ return a === 0 ? [y.startOf("month").format(c), y.date(25).endOf("day").format(c)] : a === 11 ? [y.subtract(1, "month").date(26).startOf("day").format(c), y.endOf("month").format(c)] : [y.subtract(1, "month").date(26).startOf("day").format(c), y.date(25).endOf("day").format(c)];
183
196
  }
184
- const v = { year: "year", day: "day", hour: "hour" };
185
- return [h.startOf(v[r]).format(c), h.endOf(v[r]).format(c)];
197
+ const w = { year: "year", day: "day", hour: "hour" };
198
+ return [y.startOf(w[r]).format(c), y.endOf(w[r]).format(c)];
186
199
  }
187
- function Z(e, r, o, t) {
200
+ function G(e, r, o, t) {
188
201
  const c = {
189
202
  year: "YYYY",
190
203
  month: "YYYY-MM",
@@ -193,7 +206,7 @@ function Z(e, r, o, t) {
193
206
  }[r];
194
207
  return d(e, c).add(o * t, r).format(c);
195
208
  }
196
- function x(e, r, o) {
209
+ function v(e, r, o) {
197
210
  return e[r] || (e[r] = {}), e[r][o] || (e[r][o] = {}), e[r][o];
198
211
  }
199
212
  async function Ye(e) {
@@ -201,27 +214,27 @@ async function Ye(e) {
201
214
  throw new Error("cellData is required");
202
215
  const r = Object.entries(e).reduce((o, t) => {
203
216
  const [c, n] = t;
204
- for (const [h, v] of Object.entries(n)) {
205
- const { custom: a, v: y, t: Y, s: l } = v;
217
+ for (const [y, w] of Object.entries(n)) {
218
+ const { custom: a, v: h, t: Y, s: f } = w;
206
219
  if (!a) continue;
207
- const { cellType: G } = a, u = !a.hasOwnProperty("writeBack") || E(a?.writeBack) ? !0 : a.writeBack;
208
- if (G === "indicator") {
209
- const O = x(o, c, h);
210
- O.custom = {
220
+ const { cellType: E } = a, l = !a.hasOwnProperty("writeBack") || V(a?.writeBack) ? !0 : a.writeBack;
221
+ if (E === "indicator") {
222
+ const k = v(o, c, y);
223
+ k.custom = {
211
224
  ...a,
212
- required: E(a?.required) ? !1 : a?.required,
213
- defaultShift: E(a?.defaultShift) ? !1 : a?.defaultShift,
214
- forwardPush: E(a?.forwardPush) ? !1 : a?.forwardPush,
215
- forwardPushTimes: E(a?.useDefaultEndDate) ? 0 : a?.forwardPushTimes,
216
- useDefaultEndDate: E(a?.useDefaultEndDate) ? !1 : a?.useDefaultEndDate,
217
- copyType: E(a?.copyType) ? "" : a?.copyType,
218
- writeBack: u
219
- }, O.s = l, O.t = Y, O.v = y || "";
225
+ required: V(a?.required) ? !1 : a?.required,
226
+ defaultShift: V(a?.defaultShift) ? !1 : a?.defaultShift,
227
+ forwardPush: V(a?.forwardPush) ? !1 : a?.forwardPush,
228
+ forwardPushTimes: V(a?.useDefaultEndDate) ? 0 : a?.forwardPushTimes,
229
+ useDefaultEndDate: V(a?.useDefaultEndDate) ? !1 : a?.useDefaultEndDate,
230
+ copyType: V(a?.copyType) ? "" : a?.copyType,
231
+ writeBack: l
232
+ }, k.s = f, k.t = Y, k.v = h || "";
220
233
  }
221
234
  }
222
235
  return o;
223
236
  }, {});
224
- return !r || E(r) ? Promise.reject(new Error("No data found")) : Promise.resolve(r);
237
+ return !r || V(r) ? Promise.reject(new Error("No data found")) : Promise.resolve(r);
225
238
  }
226
239
  function $(e, r) {
227
240
  return e.replace(/\$\{([^}]+)\}/g, (o, t) => {
@@ -233,138 +246,138 @@ function $(e, r) {
233
246
  }
234
247
  });
235
248
  }
236
- function ue({
249
+ function le({
237
250
  acc: e,
238
251
  params: r,
239
252
  initRowNum: o,
240
253
  initColNum: t,
241
254
  cellData: c
242
255
  }) {
243
- const { rangeData: n, currentDay: h, extraArgs: v } = r, a = v?.teamData || {}, { cycleType: y, timeIncrement: Y, forwardPush: l, forwardPushTimes: G, copyType: u, copyInterval: O, defaultShift: g, templateStr: k, useDefaultEndDate: J } = c.custom;
244
- let M = 0;
245
- switch (y) {
256
+ const { rangeData: n, currentDay: y, extraArgs: w } = r, a = w?.teamData || {}, { cycleType: h, timeIncrement: Y, forwardPush: f, forwardPushTimes: E, copyType: l, copyInterval: k, defaultShift: D, templateStr: U, useDefaultEndDate: J } = c.custom;
257
+ let x = 0;
258
+ switch (h) {
246
259
  case "day": {
247
260
  let s = "";
248
- if (l && (s = W(
261
+ if (f && (s = W(
249
262
  n[0],
250
- G,
263
+ E,
251
264
  "day"
252
265
  /* day */
253
- )), !u) {
254
- let f = "";
255
- l ? f = s : f = n[0];
256
- const i = x(e, o, t);
257
- i.v = k ? $(k, { businessDate: f, dayjs: d }) : d(f).format("YYYY-MM-DD"), i.t = A.STRING, i.s = "tor-time-cell-style";
266
+ )), !l) {
267
+ let u = "";
268
+ f ? u = s : u = n[0];
269
+ const i = v(e, o, t);
270
+ i.v = U ? $(U, { businessDate: u, dayjs: d }) : d(u).format("YYYY-MM-DD"), i.t = F.STRING, i.s = "tor-time-cell-style";
258
271
  break;
259
272
  }
260
- l ? M = H(
273
+ f ? x = j(
261
274
  s,
262
275
  n[0],
263
276
  "day"
264
277
  /* day */
265
- ) : (M = H(
278
+ ) : (x = j(
266
279
  n[0],
267
280
  n[1],
268
281
  "day"
269
282
  /* day */
270
- ), console.log("copyNum", M));
271
- for (let f = 0; f <= Math.abs(M === 0 ? 1 : M); f++) {
272
- const i = f * (O + 1);
273
- let T = "";
274
- l ? T = Z(s, "day", f, Y) : T = Z(n[0], "day", f, Y);
275
- const b = u === "right" ? o : o + i, R = u === "right" ? t + i : t, V = x(e, b, R);
276
- V.v = k ? $(k, { businessDate: T, dayjs: d }) : d(T).format("YYYY-MM-DD"), V.t = A.STRING, V.s = "tor-time-cell-style";
283
+ ), console.log("copyNum", x));
284
+ for (let u = 0; u <= Math.abs(x === 0 ? 1 : x); u++) {
285
+ const i = u * (k + 1);
286
+ let S = "";
287
+ f ? S = G(s, "day", u, Y) : S = G(n[0], "day", u, Y);
288
+ const p = l === "right" ? o : o + i, R = l === "right" ? t + i : t, Z = v(e, p, R);
289
+ Z.v = U ? $(U, { businessDate: S, dayjs: d }) : d(S).format("YYYY-MM-DD"), Z.t = F.STRING, Z.s = "tor-time-cell-style";
277
290
  }
278
291
  break;
279
292
  }
280
293
  case "month": {
281
- if (!u) {
282
- const [s, f] = P(n[1], "month", 0, 1), i = x(e, o, t);
283
- i.v = d(f).format("YYYY-MM"), i.t = A.STRING, i.s = "tor-time-cell-style";
294
+ if (!l) {
295
+ const [s, u] = P(n[1], "month", 0, 1), i = v(e, o, t);
296
+ i.v = d(u).format("YYYY-MM"), i.t = F.STRING, i.s = "tor-time-cell-style";
284
297
  break;
285
298
  }
286
- M = H(
299
+ x = j(
287
300
  n[0],
288
301
  n[1],
289
302
  "month"
290
303
  /* month */
291
304
  );
292
- for (let s = 0; s <= Math.abs(M === 0 ? 1 : M); s++) {
293
- const f = s * (O + 1), i = u === "right" ? o : o + f, T = u === "right" ? t + f : t, b = x(e, i, T);
294
- b.v = Z(n[0], "month", s, Y), b.t = A.STRING, b.s = "tor-time-cell-style";
305
+ for (let s = 0; s <= Math.abs(x === 0 ? 1 : x); s++) {
306
+ const u = s * (k + 1), i = l === "right" ? o : o + u, S = l === "right" ? t + u : t, p = v(e, i, S);
307
+ p.v = G(n[0], "month", s, Y), p.t = F.STRING, p.s = "tor-time-cell-style";
295
308
  }
296
309
  break;
297
310
  }
298
311
  case "year": {
299
312
  let s = "";
300
- if (l && (s = W(
313
+ if (f && (s = W(
301
314
  n[0],
302
- G || 0,
315
+ E || 0,
303
316
  "year"
304
317
  /* year */
305
- )), !u) {
306
- const f = l ? s : n[0], [i, T] = P(f, "year", 0, 1), b = x(e, o, t), [, R] = P(n[1], "month", 0, 1);
307
- b.v = k ? $(k, {
318
+ )), !l) {
319
+ const u = f ? s : n[0], [i, S] = P(u, "year", 0, 1), p = v(e, o, t), [, R] = P(n[1], "month", 0, 1);
320
+ p.v = U ? $(U, {
308
321
  startTime: i,
309
- endTime: T,
322
+ endTime: S,
310
323
  rangeData: n,
311
324
  dayjs: d
312
- }) : f, b.t = A.STRING, b.s = "tor-time-cell-style";
325
+ }) : u, p.t = F.STRING, p.s = "tor-time-cell-style";
313
326
  break;
314
327
  }
315
- l ? M = H(
328
+ f ? x = j(
316
329
  s,
317
330
  n[0],
318
331
  "year"
319
332
  /* year */
320
- ) : M = H(
333
+ ) : x = j(
321
334
  n[0],
322
335
  n[1],
323
336
  "year"
324
337
  /* year */
325
338
  );
326
- for (let f = 0; f <= Math.abs(M === 0 ? 1 : M); f++) {
327
- const i = f * (O + 1), T = u === "right" ? o : o + i, b = u === "right" ? t + i : t, [R, V] = P(n[0], "year", f, Y), S = x(e, T, b), N = Z(n[0], "year", f, Y);
328
- S.v = k ? $(k, {
339
+ for (let u = 0; u <= Math.abs(x === 0 ? 1 : x); u++) {
340
+ const i = u * (k + 1), S = l === "right" ? o : o + i, p = l === "right" ? t + i : t, [R, Z] = P(n[0], "year", u, Y), C = v(e, S, p), N = G(n[0], "year", u, Y);
341
+ C.v = U ? $(U, {
329
342
  startTime: R,
330
- endTime: V,
343
+ endTime: Z,
331
344
  rangeData: n,
332
345
  dayjs: d
333
- }) : N, S.t = A.STRING, S.s = "tor-time-cell-style";
346
+ }) : N, C.t = F.STRING, C.s = "tor-time-cell-style";
334
347
  }
335
348
  break;
336
349
  }
337
350
  case "hour": {
338
- if (!u) {
339
- const s = x(e, o, t);
340
- if (s.t = A.STRING, s.s = "tor-time-cell-style", g) {
351
+ if (!l) {
352
+ const s = v(e, o, t);
353
+ if (s.t = F.STRING, s.s = "tor-time-cell-style", D) {
341
354
  s.v = d(n[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
342
355
  break;
343
356
  }
344
- s.v = d(h).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
357
+ s.v = d(y).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
345
358
  break;
346
359
  }
347
- M = H(
360
+ x = j(
348
361
  n[0],
349
362
  n[1],
350
363
  "hour"
351
364
  /* hour */
352
365
  );
353
- for (let s = 0; s <= Math.abs(M === 0 ? 1 : M); s++) {
354
- const f = s * (O + 1), i = u === "right" ? o : o + f, T = u === "right" ? t + f : t, b = x(e, i, T);
355
- if (b.t = A.STRING, b.s = "tor-time-cell-style", g) {
366
+ for (let s = 0; s <= Math.abs(x === 0 ? 1 : x); s++) {
367
+ const u = s * (k + 1), i = l === "right" ? o : o + u, S = l === "right" ? t + u : t, p = v(e, i, S);
368
+ if (p.t = F.STRING, p.s = "tor-time-cell-style", D) {
356
369
  const R = d(n[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
357
- b.v = Z(R, "hour", s, Y);
370
+ p.v = G(R, "hour", s, Y);
358
371
  continue;
359
372
  }
360
- b.v = Z(d(h).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), "hour", s, Y);
373
+ p.v = G(d(y).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), "hour", s, Y);
361
374
  }
362
375
  break;
363
376
  }
364
377
  case "shift": {
365
- if (!u) {
366
- const s = x(e, o, t);
367
- s.t = A.STRING, s.s = "tor-time-cell-style", s.v = k ? $(k, {
378
+ if (!l) {
379
+ const s = v(e, o, t);
380
+ s.t = F.STRING, s.s = "tor-time-cell-style", s.v = U ? $(U, {
368
381
  rangeData: n,
369
382
  dayjs: d
370
383
  }) : n[0];
@@ -373,64 +386,64 @@ function ue({
373
386
  if (!a.length)
374
387
  throw new Error("没有获取到当班数据");
375
388
  for (let s = 0; s < a.length; s++) {
376
- const f = a[s], { startDatetime: i, endDatetime: T } = f, b = s * (O + 1), R = u === "right" ? o : j(o).add(b).toNumber(), V = u === "right" ? j(t).add(b).toNumber() : t, S = x(e, R, V);
377
- S.s = "tor-time-cell-style", S.v = k ? $(k, {
378
- team: f
389
+ const u = a[s], { startDatetime: i, endDatetime: S } = u, p = s * (k + 1), R = l === "right" ? o : I(o).add(p).toNumber(), Z = l === "right" ? I(t).add(p).toNumber() : t, C = v(e, R, Z);
390
+ C.s = "tor-time-cell-style", C.v = U ? $(U, {
391
+ team: u
379
392
  }) : i;
380
393
  }
381
394
  break;
382
395
  }
383
396
  }
384
397
  }
385
- async function De(e, r) {
398
+ async function ge(e, r) {
386
399
  if (!e)
387
400
  return Promise.reject("没有可用的单元格数据");
388
401
  const { extraArgs: o, rangeData: t } = r;
389
402
  if (!t.length)
390
403
  return Promise.reject("处理时间范围失败, rangeData不能为空");
391
- const c = o?.teamData || [], { periodicityTime: n } = r, h = r?.currentDay || d().format("YYYY-MM-DD"), v = (y, Y, l) => n ? l !== "MACH_CYCLE" ? [y, Y] : parseInt(n.split(":")[0], 10) < 12 ? [
392
- d(y).format("YYYY-MM-DD") + " " + n,
404
+ const c = o?.teamData || [], { periodicityTime: n } = r, y = r?.currentDay || d().format("YYYY-MM-DD"), w = (h, Y, f) => n ? f !== "MACH_CYCLE" ? [h, Y] : parseInt(n.split(":")[0], 10) < 12 ? [
405
+ d(h).format("YYYY-MM-DD") + " " + n,
393
406
  d(Y).add(1, "day").format("YYYY-MM-DD") + " " + n
394
407
  ] : [
395
- d(y).subtract(1, "day").format("YYYY-MM-DD") + " " + n,
408
+ d(h).subtract(1, "day").format("YYYY-MM-DD") + " " + n,
396
409
  d(Y).format("YYYY-MM-DD") + " " + n
397
- ] : [y, Y], a = Object.entries(e).reduce((y, Y) => {
398
- const [l, G] = Y;
399
- for (const [u, O] of Object.entries(G)) {
400
- const { custom: g } = O;
401
- if (!g) continue;
410
+ ] : [h, Y], a = Object.entries(e).reduce((h, Y) => {
411
+ const [f, E] = Y;
412
+ for (const [l, k] of Object.entries(E)) {
413
+ const { custom: D } = k;
414
+ if (!D) continue;
402
415
  const {
403
- cellType: k,
416
+ cellType: U,
404
417
  cycleType: J,
405
- timeIncrement: M,
418
+ timeIncrement: x,
406
419
  forwardPush: s,
407
- forwardPushTimes: f,
420
+ forwardPushTimes: u,
408
421
  copyType: i,
409
- copyInterval: T,
410
- defaultShift: b,
422
+ copyInterval: S,
423
+ defaultShift: p,
411
424
  useDefaultStartDate: R,
412
- useDefaultEndDate: V
413
- } = g;
414
- if (k === "time") {
415
- ue({ acc: y, params: r, initRowNum: Number(l), initColNum: Number(u), cellData: O });
425
+ useDefaultEndDate: Z
426
+ } = D;
427
+ if (U === "time") {
428
+ le({ acc: h, params: r, initRowNum: Number(f), initColNum: Number(l), cellData: k });
416
429
  continue;
417
430
  }
418
- const S = {
431
+ const C = {
419
432
  cycleType: J,
420
- indicatorName: g.indicatorName,
421
- indicatorCode: g.indicatorCode,
422
- indicatorId: g.indicatorId,
423
- indicatorDimensionName: g.indicatorDimensionName,
424
- indicatorDimensionConfig: g.indicatorDimensionConfig,
425
- required: ne(g?.required) ?? !1,
426
- cellType: g.cellType,
427
- defaultShift: g?.defaultShift || !1,
428
- writeBack: E(g?.writeBack) ? !0 : g.writeBack,
429
- dimensionJson: g?.dimensionJson || "",
430
- unit: g?.unit || "",
431
- innerSyncWay: g?.innerSyncWay || "",
432
- outSyncConfigId: g?.outSyncConfigId || "",
433
- innerSyncStatus: g?.innerSyncStatus || ""
433
+ indicatorName: D.indicatorName,
434
+ indicatorCode: D.indicatorCode,
435
+ indicatorId: D.indicatorId,
436
+ indicatorDimensionName: D.indicatorDimensionName,
437
+ indicatorDimensionConfig: D.indicatorDimensionConfig,
438
+ required: ne(D?.required) ?? !1,
439
+ cellType: D.cellType,
440
+ defaultShift: D?.defaultShift || !1,
441
+ writeBack: V(D?.writeBack) ? !0 : D.writeBack,
442
+ dimensionJson: D?.dimensionJson || "",
443
+ unit: D?.unit || "",
444
+ innerSyncWay: D?.innerSyncWay || "",
445
+ outSyncConfigId: D?.outSyncConfigId || "",
446
+ innerSyncStatus: D?.innerSyncStatus || ""
434
447
  };
435
448
  let N = 0;
436
449
  switch (J) {
@@ -438,146 +451,146 @@ async function De(e, r) {
438
451
  let m = "";
439
452
  if (s && (m = W(
440
453
  t[0],
441
- f || 0,
454
+ u || 0,
442
455
  "day"
443
456
  /* day */
444
457
  )), !i) {
445
- const D = s ? m : t[0], [w, p] = v(
446
- ...P(D, "day", 0, 1),
447
- g?.innerSyncWay
448
- ), C = x(y, l, u);
449
- C.s = "tor-indicator-cell-style", C.custom = {
450
- ...S,
451
- startTime: w,
452
- endTime: p
458
+ const g = s ? m : t[0], [M, b] = w(
459
+ ...P(g, "day", 0, 1),
460
+ D?.innerSyncWay
461
+ ), T = v(h, f, l);
462
+ T.s = "tor-indicator-cell-style", T.custom = {
463
+ ...C,
464
+ startTime: M,
465
+ endTime: b
453
466
  };
454
467
  break;
455
468
  }
456
- s ? N = H(
469
+ s ? N = j(
457
470
  m,
458
471
  t[0],
459
472
  "day"
460
473
  /* day */
461
- ) : N = H(
474
+ ) : N = j(
462
475
  t[0],
463
476
  t[1],
464
477
  "day"
465
478
  /* day */
466
479
  );
467
- for (let D = 0; D <= Math.abs(N === 0 ? 1 : N); D++) {
468
- const w = D * (T + 1), p = s ? m : t[0], [C, U] = v(
469
- ...P(p, "day", D, M),
470
- g?.innerSyncWay
471
- ), I = i === "right" ? l : j(l).add(w).toNumber(), B = i === "right" ? j(u).add(w).toNumber() : u, F = x(y, I, B);
472
- F.s = "tor-indicator-cell-style", F.custom = {
473
- ...S,
474
- startTime: C,
475
- endTime: U
480
+ for (let g = 0; g <= Math.abs(N === 0 ? 1 : N); g++) {
481
+ const M = g * (S + 1), b = s ? m : t[0], [T, H] = w(
482
+ ...P(b, "day", g, x),
483
+ D?.innerSyncWay
484
+ ), O = i === "right" ? f : I(f).add(M).toNumber(), B = i === "right" ? I(l).add(M).toNumber() : l, A = v(h, O, B);
485
+ A.s = "tor-indicator-cell-style", A.custom = {
486
+ ...C,
487
+ startTime: T,
488
+ endTime: H
476
489
  };
477
490
  }
478
491
  break;
479
492
  }
480
493
  case "month": {
481
494
  if (!i) {
482
- const [m, D] = P(t[1], "month", 0, 1), w = x(y, l, u);
483
- w.s = "tor-indicator-cell-style", w.custom = {
484
- ...S,
495
+ const [m, g] = P(t[1], "month", 0, 1), M = v(h, f, l);
496
+ M.s = "tor-indicator-cell-style", M.custom = {
497
+ ...C,
485
498
  startTime: m,
486
- endTime: D
499
+ endTime: g
487
500
  };
488
501
  break;
489
502
  }
490
- N = H(
503
+ N = j(
491
504
  t[0],
492
505
  t[1],
493
506
  "month"
494
507
  /* month */
495
508
  );
496
509
  for (let m = 0; m <= Math.abs(N === 0 ? 1 : N); m++) {
497
- const D = m * (T + 1), w = i === "right" ? l : j(l).add(D).toNumber(), p = i === "right" ? j(u).add(D).toNumber() : u, [C, U] = P(t[0], "month", m, M), I = x(y, w, p);
498
- I.s = "tor-indicator-cell-style", I.custom = {
499
- ...S,
500
- startTime: C,
501
- endTime: U
510
+ const g = m * (S + 1), M = i === "right" ? f : I(f).add(g).toNumber(), b = i === "right" ? I(l).add(g).toNumber() : l, [T, H] = P(t[0], "month", m, x), O = v(h, M, b);
511
+ O.s = "tor-indicator-cell-style", O.custom = {
512
+ ...C,
513
+ startTime: T,
514
+ endTime: H
502
515
  };
503
516
  }
504
517
  break;
505
518
  }
506
519
  case "year": {
507
- let m = "", D = "", w = "";
520
+ let m = "", g = "", M = "";
508
521
  if (s) {
509
522
  m = W(
510
523
  t[0],
511
- f || 0,
524
+ u || 0,
512
525
  "year"
513
526
  /* year */
514
527
  );
515
- const p = d(t[1]).format("MM");
516
- D = d(`${m}-${p + 1}`).format("YYYY-MM"), w = d(`${m}-${p + 2}`).format("YYYY-MM");
528
+ const b = d(t[1]).format("MM");
529
+ g = d(`${m}-${b + 1}`).format("YYYY-MM"), M = d(`${m}-${b + 2}`).format("YYYY-MM");
517
530
  }
518
531
  if (!i) {
519
- const p = s ? m : t[0], [C, U] = P(p, "year", 0, 1), I = x(y, l, u);
520
- I.s = "tor-indicator-cell-style";
521
- const [, B] = P(D, "month", 0, 1), [F] = P(w, "month", 0, 1);
522
- I.custom = {
523
- ...S,
524
- startTime: R ? F : C,
525
- endTime: V ? B : U
532
+ const b = s ? m : t[0], [T, H] = P(b, "year", 0, 1), O = v(h, f, l);
533
+ O.s = "tor-indicator-cell-style";
534
+ const [, B] = P(g, "month", 0, 1), [A] = P(M, "month", 0, 1);
535
+ O.custom = {
536
+ ...C,
537
+ startTime: R ? A : T,
538
+ endTime: Z ? B : H
526
539
  };
527
540
  break;
528
541
  }
529
- s ? N = H(
542
+ s ? N = j(
530
543
  m,
531
544
  t[0],
532
545
  "year"
533
546
  /* year */
534
- ) : N = H(
547
+ ) : N = j(
535
548
  t[0],
536
549
  t[1],
537
550
  "year"
538
551
  /* year */
539
552
  );
540
- for (let p = 0; p <= Math.abs(N === 0 ? 1 : N); p++) {
541
- const C = p * (T + 1), U = i === "right" ? l : j(l).add(C).toNumber(), I = i === "right" ? j(u).add(C).toNumber() : u, [B, F] = P(t[0], "year", p, M), L = x(y, U, I);
553
+ for (let b = 0; b <= Math.abs(N === 0 ? 1 : N); b++) {
554
+ const T = b * (S + 1), H = i === "right" ? f : I(f).add(T).toNumber(), O = i === "right" ? I(l).add(T).toNumber() : l, [B, A] = P(t[0], "year", b, x), L = v(h, H, O);
542
555
  L.s = "tor-indicator-cell-style", L.custom = {
543
- ...S,
556
+ ...C,
544
557
  startTime: B,
545
- endTime: F
558
+ endTime: A
546
559
  };
547
560
  }
548
561
  break;
549
562
  }
550
563
  case "hour": {
551
564
  if (!i) {
552
- const m = b ? t[0] : t[0] ?? h, [D, w] = P(m, "hour", 1, 1), p = x(y, l, u);
553
- p.s = "tor-indicator-cell-style", p.custom = {
554
- ...S,
555
- startTime: D,
556
- endTime: w
565
+ const m = p ? t[0] : t[0] ?? y, [g, M] = P(m, "hour", 1, 1), b = v(h, f, l);
566
+ b.s = "tor-indicator-cell-style", b.custom = {
567
+ ...C,
568
+ startTime: g,
569
+ endTime: M
557
570
  };
558
571
  break;
559
572
  }
560
- N = H(
573
+ N = j(
561
574
  t[0],
562
575
  t[1],
563
576
  "hour"
564
577
  /* hour */
565
578
  );
566
579
  for (let m = 0; m <= Math.abs(N === 0 ? 1 : N); m++) {
567
- const D = m * (T + 1), w = i === "right" ? l : j(l).add(D).toNumber(), p = i === "right" ? j(u).add(D).toNumber() : u, C = x(y, w, p);
568
- if (C.s = "tor-indicator-cell-style", b) {
569
- const F = d(t[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), [L, _] = P(F, "hour", m, M);
570
- C.custom = {
571
- ...S,
580
+ const g = m * (S + 1), M = i === "right" ? f : I(f).add(g).toNumber(), b = i === "right" ? I(l).add(g).toNumber() : l, T = v(h, M, b);
581
+ if (T.s = "tor-indicator-cell-style", p) {
582
+ const A = d(t[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), [L, _] = P(A, "hour", m, x);
583
+ T.custom = {
584
+ ...C,
572
585
  startTime: L,
573
586
  endTime: _
574
587
  };
575
588
  continue;
576
589
  }
577
- const U = d(h).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), [I, B] = P(U, "hour", m, M);
578
- C.custom = {
579
- ...S,
580
- startTime: I,
590
+ const H = d(y).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), [O, B] = P(H, "hour", m, x);
591
+ T.custom = {
592
+ ...C,
593
+ startTime: O,
581
594
  endTime: B
582
595
  };
583
596
  }
@@ -585,137 +598,154 @@ async function De(e, r) {
585
598
  }
586
599
  case "shift": {
587
600
  if (!i) {
588
- const [m, D] = t, w = x(y, l, u);
589
- w.s = "tor-indicator-cell-style", w.custom = {
590
- ...S,
601
+ const [m, g] = t, M = v(h, f, l);
602
+ M.s = "tor-indicator-cell-style", M.custom = {
603
+ ...C,
591
604
  startTime: m,
592
- endTime: D
605
+ endTime: g
593
606
  };
594
607
  break;
595
608
  }
596
609
  if (!c.length)
597
610
  throw new Error("没有获取到当班数据");
598
611
  for (let m = 0; m < c.length; m++) {
599
- const D = c[m], { startDatetime: w, endDatetime: p } = D, C = m * (T + 1), U = i === "right" ? l : j(l).add(C).toNumber(), I = i === "right" ? j(u).add(C).toNumber() : u, B = x(y, U, I);
612
+ const g = c[m], { startDatetime: M, endDatetime: b } = g, T = m * (S + 1), H = i === "right" ? f : I(f).add(T).toNumber(), O = i === "right" ? I(l).add(T).toNumber() : l, B = v(h, H, O);
600
613
  B.s = "tor-indicator-cell-style", B.custom = {
601
- ...S,
602
- startTime: w,
603
- endTime: p
614
+ ...C,
615
+ startTime: M,
616
+ endTime: b
604
617
  };
605
618
  }
606
619
  break;
607
620
  }
608
621
  }
609
622
  }
610
- return y;
623
+ return h;
611
624
  }, {});
612
625
  return Promise.resolve(a);
613
626
  }
614
- function ge(e) {
627
+ function De(e) {
615
628
  return Object.entries(e).reduce((o, [t, c]) => {
616
629
  const n = Math.max(...Object.keys(c).map(Number));
617
630
  return n > o ? o = Number(n) : o = Number(o) || 0, o;
618
631
  }, 0);
619
632
  }
620
- function be(e, r) {
633
+ function pe(e, r) {
621
634
  const o = JSON.parse(JSON.stringify(e || {}));
622
635
  for (const [t, c] of Object.entries(r)) {
623
636
  o[t] || (o[t] = {});
624
- for (const [n, h] of Object.entries(c)) {
625
- const v = h, a = o[t]?.[n];
626
- a ? o[t][n] = {
627
- ...a,
628
- ...v,
629
- custom: {
630
- ...a.custom,
631
- ...v.custom
632
- },
633
- v: v.v || ""
634
- } : o[t][n] = v;
637
+ for (const [n, y] of Object.entries(c)) {
638
+ const w = y ?? {}, a = o[t]?.[n];
639
+ if (a) {
640
+ const h = {
641
+ ...a,
642
+ ...w,
643
+ custom: {
644
+ ...a.custom,
645
+ ...w.custom
646
+ },
647
+ v: w.v || ""
648
+ };
649
+ o[t][n] = h;
650
+ } else
651
+ o[t][n] = w;
635
652
  }
636
653
  }
637
654
  return o;
638
655
  }
639
- function pe(e, r) {
656
+ function be(e, r) {
640
657
  if (!r?.length || !e) return e;
641
658
  const o = {};
642
659
  for (const t in e) {
643
660
  const c = e[t];
644
661
  for (const n in c) {
645
- const h = c[n];
646
- if (h?.custom?.cellType === "indicator") {
647
- const v = Number(t), a = Number(n);
662
+ const y = c[n];
663
+ if (y?.custom?.cellType === "indicator") {
664
+ const w = Number(t), a = Number(n);
648
665
  if (r.some(
649
- (Y) => v >= Y.startRow && v <= Y.endRow && a >= Y.startColumn && a <= Y.endColumn
666
+ (Y) => w >= Y.startRow && w <= Y.endRow && a >= Y.startColumn && a <= Y.endColumn
650
667
  ) && !r.some(
651
- (l) => v === l.startRow && a === l.startColumn
668
+ (f) => w === f.startRow && a === f.startColumn
652
669
  ))
653
670
  continue;
654
671
  }
655
- o[t] || (o[t] = {}), o[t][n] = h;
672
+ o[t] || (o[t] = {}), o[t][n] = y;
656
673
  }
657
674
  }
658
675
  return o;
659
676
  }
660
- const Me = "./style.css";
677
+ const xe = "./style.css";
661
678
  export {
662
- Ze as BaselineOffset,
679
+ Ge as BaselineOffset,
663
680
  $e as CommandService,
664
- ve as CommandType,
681
+ we as CommandType,
665
682
  Je as ComponentManager,
666
683
  ze as ContextMenuGroup,
667
684
  Ke as ContextMenuPosition,
668
685
  ie as CycleTypeEnum,
669
- Te as FEventName,
670
- Se as FUniver,
671
- Ce as ICommandService,
686
+ Se as FEventName,
687
+ Ce as FUniver,
688
+ Te as ICommandService,
672
689
  _e as IMenuManagerService,
673
690
  Ne as IUniverInstanceService,
674
691
  Pe as Inject,
675
- ke as Injector,
676
- Oe as LocaleType,
692
+ Ue as Injector,
693
+ ke as LocaleType,
677
694
  Qe as MenuItemType,
678
695
  ce as ModeEnum,
679
- Ie as Plugin,
696
+ Oe as Plugin,
680
697
  Xe as RibbonStartGroup,
681
698
  qe as SetRangeValuesCommand,
682
- je as Univer,
683
- He as UniverInstanceType,
684
- Mt as UniverPresetSheetsAdvancedZhCN,
685
- Pt as UniverPresetSheetsDrawingZhCN,
686
- Bt as UniverPresetSheetsNoteZhCN,
699
+ Ie as Univer,
700
+ je as UniverInstanceType,
701
+ It as UniverLiveSharePlugin,
702
+ Bt as UniverPresetSheetsAdvancedZhCN,
703
+ lr as UniverPresetSheetsCollaborationZhCN,
704
+ tr as UniverPresetSheetsDataValidationZhCN,
705
+ Gt as UniverPresetSheetsDrawingZhCN,
706
+ _t as UniverPresetSheetsFilterZhCN,
707
+ or as UniverPresetSheetsFindReplaceZhCN,
708
+ Wt as UniverPresetSheetsHyperLinkZhCN,
709
+ zt as UniverPresetSheetsNoteZhCN,
710
+ Xt as UniverPresetSheetsSortZhCN,
711
+ ir as UniverPresetSheetsTableZhCN,
712
+ sr as UniverPresetSheetsThreadCommentZhCN,
687
713
  ot as UniverSheetsAdvancedPreset,
714
+ Tt as UniverSheetsCollaborationPreset,
688
715
  st as UniverSheetsConditionalFormattingPreset,
689
716
  it as UniverSheetsCorePreset,
690
- ut as UniverSheetsDataValidationPreset,
691
- ft as UniverSheetsDrawingPreset,
717
+ kt as UniverSheetsCrosshairHighlightPlugin,
718
+ lt as UniverSheetsDataValidationPreset,
719
+ ut as UniverSheetsDrawingPreset,
692
720
  dt as UniverSheetsFilterPreset,
721
+ xt as UniverSheetsFindReplacePreset,
693
722
  yt as UniverSheetsHyperLinkPreset,
694
- Dt as UniverSheetsNotePreset,
723
+ gt as UniverSheetsNotePreset,
724
+ pt as UniverSheetsSortPreset,
725
+ St as UniverSheetsTablePreset,
726
+ vt as UniverSheetsThreadCommentPreset,
695
727
  tt as UniverVue3AdapterPlugin,
696
- Ue as Workbook,
728
+ Pt as UniverWatermarkPlugin,
729
+ He as Workbook,
697
730
  Re as createUniver,
698
- j as decimal,
731
+ I as decimal,
699
732
  Be as defaultTheme,
700
733
  Ye as filterIndicatorsCell,
701
- pe as filterMergedIndicatorCells,
702
- De as generateIndicatorsCells,
734
+ be as filterMergedIndicatorCells,
735
+ ge as generateIndicatorsCells,
703
736
  Q as generateUUID,
704
- ge as getNumColumns,
705
- Ve as greenTheme,
737
+ De as getNumColumns,
738
+ Ze as greenTheme,
706
739
  de as handleClearInput,
707
740
  ye as initDateRange,
708
- Ae as merge,
709
- be as mergeCellData,
710
- Ee as mergeLocales,
711
- xt as sheetsConditionalFormattingZhCN,
712
- Tt as sheetsCoreZhCN,
713
- Ct as sheetsDataValidationZhCN,
714
- Ot as sheetsDrawingZhCN,
715
- jt as sheetsFilterZhCN,
716
- Ut as sheetsHyperLinkZhCN,
717
- Me as stylePath,
718
- Fe as touchDependencies,
741
+ Fe as merge,
742
+ pe as mergeCellData,
743
+ Ve as mergeLocales,
744
+ Ft as sheetsConditionalFormattingZhCN,
745
+ At as sheetsCoreZhCN,
746
+ Lt as sheetsFilterZhCN,
747
+ xe as stylePath,
748
+ Ae as touchDependencies,
719
749
  he as useData,
720
- bt as zhCN
750
+ Ht as zhCN
721
751
  };