tor-univer-sheet 1.2.8 → 1.2.10

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,7 +1,7 @@
1
1
  import { CellValueType as Z } from "@univerjs/presets";
2
- import { CommandType as ve, FEventName as Se, FUniver as Te, ICommandService as Ce, IUniverInstanceService as Ne, Inject as Pe, Injector as ke, LocaleType as Ue, Plugin as Oe, Univer as Ie, UniverInstanceType as je, Workbook as He, createUniver as Re, defaultTheme as Be, greenTheme as Fe, merge as Ze, mergeLocales as Ve, touchDependencies as Ee } from "@univerjs/presets";
3
- import { BaselineOffset as $e, CommandService as Ae } from "@univerjs/core";
4
- import { SetRangeValuesCommand as qe } from "@univerjs/sheets";
2
+ import { CommandType as ve, FEventName as Se, FUniver as Te, ICommandService as Ce, IUniverInstanceService as Ne, Inject as Pe, Injector as ke, LocaleType as Ue, Plugin as Oe, Univer as Ie, UniverInstanceType as je, Workbook as He, createUniver as Re, defaultTheme as Be, greenTheme as Fe, merge as Ze, mergeLocales as Ve, touchDependencies as Ae } from "@univerjs/presets";
3
+ import { BaselineOffset as Ge, CommandService as We } from "@univerjs/core";
4
+ import { SetRangeValuesCommand as Le } 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 { UniverLicensePlugin as ot } from "@univerjs-pro/license";
@@ -18,19 +18,21 @@ import { UniverSheetsThreadCommentPreset as wt } from "@univerjs/preset-sheets-t
18
18
  import { UniverSheetsTablePreset as St } from "@univerjs/preset-sheets-table";
19
19
  import { UniverWatermarkPlugin as Ct } from "@univerjs/watermark";
20
20
  import { UniverSheetsCrosshairHighlightPlugin as Pt } from "@univerjs/sheets-crosshair-highlight";
21
- import { default as Ut } from "@univerjs/preset-sheets-core/locales/zh-CN";
22
- import { default as It } from "@univerjs/presets/preset-sheets-conditional-formatting/locales/zh-CN";
23
- import { default as Ht } from "@univerjs/presets/preset-sheets-core/locales/zh-CN";
24
- import { default as Bt } from "@univerjs/preset-sheets-drawing/locales/zh-CN";
25
- import { default as Zt } from "@univerjs/preset-sheets-filter/locales/zh-CN";
26
- import { default as Et } from "@univerjs/preset-sheets-hyper-link/locales/zh-CN";
27
- import { default as $t } from "@univerjs/preset-sheets-note/locales/zh-CN";
28
- import { default as Lt } from "@univerjs/presets/preset-sheets-filter/locales/zh-CN";
29
- import { default as Wt } from "@univerjs/preset-sheets-sort/locales/zh-CN";
30
- import { default as zt } from "@univerjs/preset-sheets-data-validation/locales/zh-CN";
31
- import { default as _t } from "@univerjs/preset-sheets-find-replace/locales/zh-CN";
32
- import { default as Xt } from "@univerjs/preset-sheets-thread-comment/locales/zh-CN";
33
- import { default as tr } from "@univerjs/preset-sheets-table/locales/zh-CN";
21
+ import { UniverSheetsAdvancedPreset as Ut } from "@univerjs/preset-sheets-advanced";
22
+ import { default as It } from "@univerjs/preset-sheets-advanced/locales/zh-CN";
23
+ import { default as Ht } from "@univerjs/preset-sheets-core/locales/zh-CN";
24
+ import { default as Bt } from "@univerjs/presets/preset-sheets-conditional-formatting/locales/zh-CN";
25
+ import { default as Zt } from "@univerjs/presets/preset-sheets-core/locales/zh-CN";
26
+ import { default as At } from "@univerjs/preset-sheets-drawing/locales/zh-CN";
27
+ import { default as Gt } from "@univerjs/preset-sheets-filter/locales/zh-CN";
28
+ import { default as $t } from "@univerjs/preset-sheets-hyper-link/locales/zh-CN";
29
+ import { default as qt } from "@univerjs/preset-sheets-note/locales/zh-CN";
30
+ import { default as zt } from "@univerjs/presets/preset-sheets-filter/locales/zh-CN";
31
+ import { default as _t } from "@univerjs/preset-sheets-sort/locales/zh-CN";
32
+ import { default as Xt } from "@univerjs/preset-sheets-data-validation/locales/zh-CN";
33
+ import { default as tr } from "@univerjs/preset-sheets-find-replace/locales/zh-CN";
34
+ import { default as or } from "@univerjs/preset-sheets-thread-comment/locales/zh-CN";
35
+ import { default as sr } from "@univerjs/preset-sheets-table/locales/zh-CN";
34
36
  import d from "dayjs";
35
37
  import z from "decimal.js";
36
38
  const de = (e, r) => {
@@ -62,7 +64,7 @@ function he(e) {
62
64
  appVersion: e?.appVersion || "1.0.0"
63
65
  };
64
66
  }
65
- 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);
67
+ 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 : L(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"), L = (e) => e && Array.isArray(e);
66
68
  class ae {
67
69
  value;
68
70
  constructor(r) {
@@ -143,7 +145,7 @@ async function ye(e, r) {
143
145
  if (!r) return Promise.reject("日期不能为空");
144
146
  switch (e) {
145
147
  case "year":
146
- if (q(r))
148
+ if (L(r))
147
149
  return Promise.resolve(r);
148
150
  const o = d(r);
149
151
  if (!o.isValid())
@@ -151,21 +153,21 @@ async function ye(e, r) {
151
153
  const t = o.year(), c = `${t}-01`, n = `${t}-12`;
152
154
  return Promise.resolve([c, n]);
153
155
  case "month":
154
- if (q(r))
156
+ if (L(r))
155
157
  return Promise.resolve(r);
156
158
  const y = d(r);
157
159
  if (!y.isValid())
158
160
  return Promise.reject("无效的日期格式");
159
- const v = y.startOf("month").format("YYYY-MM-DD"), a = y.endOf("month").format("YYYY-MM-DD");
160
- return Promise.resolve([v, a]);
161
+ const g = y.startOf("month").format("YYYY-MM-DD"), a = y.endOf("month").format("YYYY-MM-DD");
162
+ return Promise.resolve([g, a]);
161
163
  case "day":
162
- if (q(r))
164
+ if (L(r))
163
165
  return Promise.resolve(r);
164
166
  const h = d(r);
165
167
  if (!h.isValid())
166
168
  return Promise.reject("无效的日期格式");
167
- const Y = h.startOf("day").format("YYYY-MM-DD HH:mm:ss"), f = h.endOf("day").format("YYYY-MM-DD HH:mm:ss");
168
- return Promise.resolve([Y, f]);
169
+ const D = h.startOf("day").format("YYYY-MM-DD HH:mm:ss"), f = h.endOf("day").format("YYYY-MM-DD HH:mm:ss");
170
+ return Promise.resolve([D, f]);
169
171
  default:
170
172
  return Promise.reject("不支持的周期类型");
171
173
  }
@@ -173,7 +175,7 @@ async function ye(e, r) {
173
175
  function j(e, r, o) {
174
176
  return o ? d(r).diff(d(e), o) : 0;
175
177
  }
176
- function W(e, r, o) {
178
+ function q(e, r, o) {
177
179
  if (!o)
178
180
  throw new Error("日期类型不能为空");
179
181
  const t = {
@@ -185,15 +187,15 @@ function W(e, r, o) {
185
187
  return d(e).subtract(r, o).format(t);
186
188
  }
187
189
  function P(e, r, o, t) {
188
- const c = "YYYY-MM-DD HH:mm:ss", n = $(e, r, o, t), y = d(n);
190
+ const c = "YYYY-MM-DD HH:mm:ss", n = G(e, r, o, t), y = d(n);
189
191
  if (r === "month") {
190
192
  const a = y.month();
191
193
  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)];
192
194
  }
193
- const v = { year: "year", day: "day", hour: "hour" };
194
- return [y.startOf(v[r]).format(c), y.endOf(v[r]).format(c)];
195
+ const g = { year: "year", day: "day", hour: "hour" };
196
+ return [y.startOf(g[r]).format(c), y.endOf(g[r]).format(c)];
195
197
  }
196
- function $(e, r, o, t) {
198
+ function G(e, r, o, t) {
197
199
  const c = {
198
200
  year: "YYYY",
199
201
  month: "YYYY-MM",
@@ -202,7 +204,7 @@ function $(e, r, o, t) {
202
204
  }[r];
203
205
  return d(e, c).add(o * t, r).format(c);
204
206
  }
205
- function w(e, r, o) {
207
+ function v(e, r, o) {
206
208
  return e[r] || (e[r] = {}), e[r][o] || (e[r][o] = {}), e[r][o];
207
209
  }
208
210
  async function Ye(e) {
@@ -210,12 +212,12 @@ async function Ye(e) {
210
212
  throw new Error("cellData is required");
211
213
  const r = Object.entries(e).reduce((o, t) => {
212
214
  const [c, n] = t;
213
- for (const [y, v] of Object.entries(n)) {
214
- const { custom: a, v: h, t: Y, s: f } = v;
215
+ for (const [y, g] of Object.entries(n)) {
216
+ const { custom: a, v: h, t: D, s: f } = g;
215
217
  if (!a) continue;
216
- const { cellType: G } = a, l = !a.hasOwnProperty("writeBack") || V(a?.writeBack) ? !0 : a.writeBack;
217
- if (G === "indicator") {
218
- const U = w(o, c, y);
218
+ const { cellType: E } = a, l = !a.hasOwnProperty("writeBack") || V(a?.writeBack) ? !0 : a.writeBack;
219
+ if (E === "indicator") {
220
+ const U = v(o, c, y);
219
221
  U.custom = {
220
222
  ...a,
221
223
  required: V(a?.required) ? !1 : a?.required,
@@ -225,14 +227,14 @@ async function Ye(e) {
225
227
  useDefaultEndDate: V(a?.useDefaultEndDate) ? !1 : a?.useDefaultEndDate,
226
228
  copyType: V(a?.copyType) ? "" : a?.copyType,
227
229
  writeBack: l
228
- }, U.s = f, U.t = Y, U.v = h || "";
230
+ }, U.s = f, U.t = D, U.v = h || "";
229
231
  }
230
232
  }
231
233
  return o;
232
234
  }, {});
233
235
  return !r || V(r) ? Promise.reject(new Error("No data found")) : Promise.resolve(r);
234
236
  }
235
- function A(e, r) {
237
+ function W(e, r) {
236
238
  return e.replace(/\$\{([^}]+)\}/g, (o, t) => {
237
239
  try {
238
240
  const c = Object.keys(r), n = Object.values(r);
@@ -249,92 +251,92 @@ function le({
249
251
  initColNum: t,
250
252
  cellData: c
251
253
  }) {
252
- const { rangeData: n, currentDay: y, extraArgs: v } = r, a = v?.teamData || {}, { cycleType: h, timeIncrement: Y, forwardPush: f, forwardPushTimes: G, copyType: l, copyInterval: U, defaultShift: D, templateStr: k, useDefaultEndDate: J } = c.custom;
253
- let x = 0;
254
+ const { rangeData: n, currentDay: y, extraArgs: g } = r, a = g?.teamData || {}, { cycleType: h, timeIncrement: D, forwardPush: f, forwardPushTimes: E, copyType: l, copyInterval: U, defaultShift: Y, templateStr: k, useDefaultEndDate: J } = c.custom;
255
+ let M = 0;
254
256
  switch (h) {
255
257
  case "day": {
256
258
  let s = "";
257
- if (f && (s = W(
259
+ if (f && (s = q(
258
260
  n[0],
259
- G,
261
+ E,
260
262
  "day"
261
263
  /* day */
262
264
  )), !l) {
263
265
  let u = "";
264
266
  f ? u = s : u = n[0];
265
- const i = w(e, o, t);
266
- i.v = k ? A(k, { businessDate: u, dayjs: d }) : d(u).format("YYYY-MM-DD"), i.t = Z.STRING, i.s = "tor-time-cell-style";
267
+ const i = v(e, o, t);
268
+ i.v = k ? W(k, { businessDate: u, dayjs: d }) : d(u).format("YYYY-MM-DD"), i.t = Z.STRING, i.s = "tor-time-cell-style";
267
269
  break;
268
270
  }
269
- f ? x = j(
271
+ f ? M = j(
270
272
  s,
271
273
  n[0],
272
274
  "day"
273
275
  /* day */
274
- ) : (x = j(
276
+ ) : (M = j(
275
277
  n[0],
276
278
  n[1],
277
279
  "day"
278
280
  /* day */
279
- ), console.log("copyNum", x));
280
- for (let u = 0; u <= Math.abs(x === 0 ? 1 : x); u++) {
281
+ ), console.log("copyNum", M));
282
+ for (let u = 0; u <= Math.abs(M === 0 ? 1 : M); u++) {
281
283
  const i = u * (U + 1);
282
284
  let S = "";
283
- f ? S = $(s, "day", u, Y) : S = $(n[0], "day", u, Y);
284
- const p = l === "right" ? o : o + i, R = l === "right" ? t + i : t, F = w(e, p, R);
285
- F.v = k ? A(k, { businessDate: S, dayjs: d }) : d(S).format("YYYY-MM-DD"), F.t = Z.STRING, F.s = "tor-time-cell-style";
285
+ f ? S = G(s, "day", u, D) : S = G(n[0], "day", u, D);
286
+ const b = l === "right" ? o : o + i, R = l === "right" ? t + i : t, F = v(e, b, R);
287
+ F.v = k ? W(k, { businessDate: S, dayjs: d }) : d(S).format("YYYY-MM-DD"), F.t = Z.STRING, F.s = "tor-time-cell-style";
286
288
  }
287
289
  break;
288
290
  }
289
291
  case "month": {
290
292
  if (!l) {
291
- const [s, u] = P(n[1], "month", 0, 1), i = w(e, o, t);
293
+ const [s, u] = P(n[1], "month", 0, 1), i = v(e, o, t);
292
294
  i.v = d(u).format("YYYY-MM"), i.t = Z.STRING, i.s = "tor-time-cell-style";
293
295
  break;
294
296
  }
295
- x = j(
297
+ M = j(
296
298
  n[0],
297
299
  n[1],
298
300
  "month"
299
301
  /* month */
300
302
  );
301
- for (let s = 0; s <= Math.abs(x === 0 ? 1 : x); s++) {
302
- const u = s * (U + 1), i = l === "right" ? o : o + u, S = l === "right" ? t + u : t, p = w(e, i, S);
303
- p.v = $(n[0], "month", s, Y), p.t = Z.STRING, p.s = "tor-time-cell-style";
303
+ for (let s = 0; s <= Math.abs(M === 0 ? 1 : M); s++) {
304
+ const u = s * (U + 1), i = l === "right" ? o : o + u, S = l === "right" ? t + u : t, b = v(e, i, S);
305
+ b.v = G(n[0], "month", s, D), b.t = Z.STRING, b.s = "tor-time-cell-style";
304
306
  }
305
307
  break;
306
308
  }
307
309
  case "year": {
308
310
  let s = "";
309
- if (f && (s = W(
311
+ if (f && (s = q(
310
312
  n[0],
311
- G || 0,
313
+ E || 0,
312
314
  "year"
313
315
  /* year */
314
316
  )), !l) {
315
- const u = f ? s : n[0], [i, S] = P(u, "year", 0, 1), p = w(e, o, t), [, R] = P(n[1], "month", 0, 1);
316
- p.v = k ? A(k, {
317
+ const u = f ? s : n[0], [i, S] = P(u, "year", 0, 1), b = v(e, o, t), [, R] = P(n[1], "month", 0, 1);
318
+ b.v = k ? W(k, {
317
319
  startTime: i,
318
320
  endTime: S,
319
321
  rangeData: n,
320
322
  dayjs: d
321
- }) : u, p.t = Z.STRING, p.s = "tor-time-cell-style";
323
+ }) : u, b.t = Z.STRING, b.s = "tor-time-cell-style";
322
324
  break;
323
325
  }
324
- f ? x = j(
326
+ f ? M = j(
325
327
  s,
326
328
  n[0],
327
329
  "year"
328
330
  /* year */
329
- ) : x = j(
331
+ ) : M = j(
330
332
  n[0],
331
333
  n[1],
332
334
  "year"
333
335
  /* year */
334
336
  );
335
- for (let u = 0; u <= Math.abs(x === 0 ? 1 : x); u++) {
336
- const i = u * (U + 1), S = l === "right" ? o : o + i, p = l === "right" ? t + i : t, [R, F] = P(n[0], "year", u, Y), T = w(e, S, p), N = $(n[0], "year", u, Y);
337
- T.v = k ? A(k, {
337
+ for (let u = 0; u <= Math.abs(M === 0 ? 1 : M); u++) {
338
+ const i = u * (U + 1), S = l === "right" ? o : o + i, b = l === "right" ? t + i : t, [R, F] = P(n[0], "year", u, D), T = v(e, S, b), N = G(n[0], "year", u, D);
339
+ T.v = k ? W(k, {
338
340
  startTime: R,
339
341
  endTime: F,
340
342
  rangeData: n,
@@ -345,35 +347,35 @@ function le({
345
347
  }
346
348
  case "hour": {
347
349
  if (!l) {
348
- const s = w(e, o, t);
349
- if (s.t = Z.STRING, s.s = "tor-time-cell-style", D) {
350
+ const s = v(e, o, t);
351
+ if (s.t = Z.STRING, s.s = "tor-time-cell-style", Y) {
350
352
  s.v = d(n[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
351
353
  break;
352
354
  }
353
355
  s.v = d(y).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
354
356
  break;
355
357
  }
356
- x = j(
358
+ M = j(
357
359
  n[0],
358
360
  n[1],
359
361
  "hour"
360
362
  /* hour */
361
363
  );
362
- for (let s = 0; s <= Math.abs(x === 0 ? 1 : x); s++) {
363
- const u = s * (U + 1), i = l === "right" ? o : o + u, S = l === "right" ? t + u : t, p = w(e, i, S);
364
- if (p.t = Z.STRING, p.s = "tor-time-cell-style", D) {
364
+ for (let s = 0; s <= Math.abs(M === 0 ? 1 : M); s++) {
365
+ const u = s * (U + 1), i = l === "right" ? o : o + u, S = l === "right" ? t + u : t, b = v(e, i, S);
366
+ if (b.t = Z.STRING, b.s = "tor-time-cell-style", Y) {
365
367
  const R = d(n[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
366
- p.v = $(R, "hour", s, Y);
368
+ b.v = G(R, "hour", s, D);
367
369
  continue;
368
370
  }
369
- p.v = $(d(y).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), "hour", s, Y);
371
+ b.v = G(d(y).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), "hour", s, D);
370
372
  }
371
373
  break;
372
374
  }
373
375
  case "shift": {
374
376
  if (!l) {
375
- const s = w(e, o, t);
376
- s.t = Z.STRING, s.s = "tor-time-cell-style", s.v = k ? A(k, {
377
+ const s = v(e, o, t);
378
+ s.t = Z.STRING, s.s = "tor-time-cell-style", s.v = k ? W(k, {
377
379
  rangeData: n,
378
380
  dayjs: d
379
381
  }) : n[0];
@@ -382,8 +384,8 @@ function le({
382
384
  if (!a.length)
383
385
  throw new Error("没有获取到当班数据");
384
386
  for (let s = 0; s < a.length; s++) {
385
- const u = a[s], { startDatetime: i, endDatetime: S } = u, p = s * (U + 1), R = l === "right" ? o : I(o).add(p).toNumber(), F = l === "right" ? I(t).add(p).toNumber() : t, T = w(e, R, F);
386
- T.s = "tor-time-cell-style", T.v = k ? A(k, {
387
+ const u = a[s], { startDatetime: i, endDatetime: S } = u, b = s * (U + 1), R = l === "right" ? o : I(o).add(b).toNumber(), F = l === "right" ? I(t).add(b).toNumber() : t, T = v(e, R, F);
388
+ T.s = "tor-time-cell-style", T.v = k ? W(k, {
387
389
  team: u
388
390
  }) : i;
389
391
  }
@@ -397,68 +399,68 @@ async function ge(e, r) {
397
399
  const { extraArgs: o, rangeData: t } = r;
398
400
  if (!t.length)
399
401
  return Promise.reject("处理时间范围失败, rangeData不能为空");
400
- const c = o?.teamData || [], { periodicityTime: n } = r, y = r?.currentDay || d().format("YYYY-MM-DD"), v = (h, Y, f) => n ? f !== "MACH_CYCLE" ? [h, Y] : parseInt(n.split(":")[0], 10) < 12 ? [
402
+ const c = o?.teamData || [], { periodicityTime: n } = r, y = r?.currentDay || d().format("YYYY-MM-DD"), g = (h, D, f) => n ? f !== "MACH_CYCLE" ? [h, D] : parseInt(n.split(":")[0], 10) < 12 ? [
401
403
  d(h).format("YYYY-MM-DD") + " " + n,
402
- d(Y).add(1, "day").format("YYYY-MM-DD") + " " + n
404
+ d(D).add(1, "day").format("YYYY-MM-DD") + " " + n
403
405
  ] : [
404
406
  d(h).subtract(1, "day").format("YYYY-MM-DD") + " " + n,
405
- d(Y).format("YYYY-MM-DD") + " " + n
406
- ] : [h, Y], a = Object.entries(e).reduce((h, Y) => {
407
- const [f, G] = Y;
408
- for (const [l, U] of Object.entries(G)) {
409
- const { custom: D } = U;
410
- if (!D) continue;
407
+ d(D).format("YYYY-MM-DD") + " " + n
408
+ ] : [h, D], a = Object.entries(e).reduce((h, D) => {
409
+ const [f, E] = D;
410
+ for (const [l, U] of Object.entries(E)) {
411
+ const { custom: Y } = U;
412
+ if (!Y) continue;
411
413
  const {
412
414
  cellType: k,
413
415
  cycleType: J,
414
- timeIncrement: x,
416
+ timeIncrement: M,
415
417
  forwardPush: s,
416
418
  forwardPushTimes: u,
417
419
  copyType: i,
418
420
  copyInterval: S,
419
- defaultShift: p,
421
+ defaultShift: b,
420
422
  useDefaultStartDate: R,
421
423
  useDefaultEndDate: F
422
- } = D;
424
+ } = Y;
423
425
  if (k === "time") {
424
426
  le({ acc: h, params: r, initRowNum: Number(f), initColNum: Number(l), cellData: U });
425
427
  continue;
426
428
  }
427
429
  const T = {
428
430
  cycleType: J,
429
- indicatorName: D.indicatorName,
430
- indicatorCode: D.indicatorCode,
431
- indicatorId: D.indicatorId,
432
- indicatorDimensionName: D.indicatorDimensionName,
433
- indicatorDimensionConfig: D.indicatorDimensionConfig,
434
- required: ne(D?.required) ?? !1,
435
- cellType: D.cellType,
436
- defaultShift: D?.defaultShift || !1,
437
- writeBack: V(D?.writeBack) ? !0 : D.writeBack,
438
- dimensionJson: D?.dimensionJson || "",
439
- unit: D?.unit || "",
440
- innerSyncWay: D?.innerSyncWay || "",
441
- outSyncConfigId: D?.outSyncConfigId || "",
442
- innerSyncStatus: D?.innerSyncStatus || ""
431
+ indicatorName: Y.indicatorName,
432
+ indicatorCode: Y.indicatorCode,
433
+ indicatorId: Y.indicatorId,
434
+ indicatorDimensionName: Y.indicatorDimensionName,
435
+ indicatorDimensionConfig: Y.indicatorDimensionConfig,
436
+ required: ne(Y?.required) ?? !1,
437
+ cellType: Y.cellType,
438
+ defaultShift: Y?.defaultShift || !1,
439
+ writeBack: V(Y?.writeBack) ? !0 : Y.writeBack,
440
+ dimensionJson: Y?.dimensionJson || "",
441
+ unit: Y?.unit || "",
442
+ innerSyncWay: Y?.innerSyncWay || "",
443
+ outSyncConfigId: Y?.outSyncConfigId || "",
444
+ innerSyncStatus: Y?.innerSyncStatus || ""
443
445
  };
444
446
  let N = 0;
445
447
  switch (J) {
446
448
  case "day": {
447
449
  let m = "";
448
- if (s && (m = W(
450
+ if (s && (m = q(
449
451
  t[0],
450
452
  u || 0,
451
453
  "day"
452
454
  /* day */
453
455
  )), !i) {
454
- const g = s ? m : t[0], [M, b] = v(
455
- ...P(g, "day", 0, 1),
456
- D?.innerSyncWay
457
- ), C = w(h, f, l);
456
+ const p = s ? m : t[0], [w, x] = g(
457
+ ...P(p, "day", 0, 1),
458
+ Y?.innerSyncWay
459
+ ), C = v(h, f, l);
458
460
  C.s = "tor-indicator-cell-style", C.custom = {
459
461
  ...T,
460
- startTime: M,
461
- endTime: b
462
+ startTime: w,
463
+ endTime: x
462
464
  };
463
465
  break;
464
466
  }
@@ -473,12 +475,12 @@ async function ge(e, r) {
473
475
  "day"
474
476
  /* day */
475
477
  );
476
- for (let g = 0; g <= Math.abs(N === 0 ? 1 : N); g++) {
477
- const M = g * (S + 1), b = s ? m : t[0], [C, H] = v(
478
- ...P(b, "day", g, x),
479
- D?.innerSyncWay
480
- ), O = i === "right" ? f : I(f).add(M).toNumber(), B = i === "right" ? I(l).add(M).toNumber() : l, E = w(h, O, B);
481
- E.s = "tor-indicator-cell-style", E.custom = {
478
+ for (let p = 0; p <= Math.abs(N === 0 ? 1 : N); p++) {
479
+ const w = p * (S + 1), x = s ? m : t[0], [C, H] = g(
480
+ ...P(x, "day", p, M),
481
+ Y?.innerSyncWay
482
+ ), O = i === "right" ? f : I(f).add(w).toNumber(), B = i === "right" ? I(l).add(w).toNumber() : l, A = v(h, O, B);
483
+ A.s = "tor-indicator-cell-style", A.custom = {
482
484
  ...T,
483
485
  startTime: C,
484
486
  endTime: H
@@ -488,11 +490,14 @@ async function ge(e, r) {
488
490
  }
489
491
  case "month": {
490
492
  if (!i) {
491
- const [m, g] = P(t[1], "month", 0, 1), M = w(h, f, l);
492
- M.s = "tor-indicator-cell-style", M.custom = {
493
+ const [m, p] = g(
494
+ ...P(t[1], "month", 0, 1),
495
+ Y?.innerSyncWay
496
+ ), w = v(h, f, l);
497
+ w.s = "tor-indicator-cell-style", w.custom = {
493
498
  ...T,
494
499
  startTime: m,
495
- endTime: g
500
+ endTime: p
496
501
  };
497
502
  break;
498
503
  }
@@ -503,7 +508,10 @@ async function ge(e, r) {
503
508
  /* month */
504
509
  );
505
510
  for (let m = 0; m <= Math.abs(N === 0 ? 1 : N); m++) {
506
- const g = m * (S + 1), M = i === "right" ? f : I(f).add(g).toNumber(), b = i === "right" ? I(l).add(g).toNumber() : l, [C, H] = P(t[0], "month", m, x), O = w(h, M, b);
511
+ const p = m * (S + 1), w = i === "right" ? f : I(f).add(p).toNumber(), x = i === "right" ? I(l).add(p).toNumber() : l, [C, H] = g(
512
+ ...P(t[0], "month", m, M),
513
+ Y?.innerSyncWay
514
+ ), O = v(h, w, x);
507
515
  O.s = "tor-indicator-cell-style", O.custom = {
508
516
  ...T,
509
517
  startTime: C,
@@ -513,24 +521,27 @@ async function ge(e, r) {
513
521
  break;
514
522
  }
515
523
  case "year": {
516
- let m = "", g = "", M = "";
524
+ let m = "", p = "", w = "";
517
525
  if (s) {
518
- m = W(
526
+ m = q(
519
527
  t[0],
520
528
  u || 0,
521
529
  "year"
522
530
  /* year */
523
531
  );
524
- const b = d(t[1]).format("MM");
525
- g = d(`${m}-${b + 1}`).format("YYYY-MM"), M = d(`${m}-${b + 2}`).format("YYYY-MM");
532
+ const x = d(t[1]).format("MM");
533
+ p = d(`${m}-${x + 1}`).format("YYYY-MM"), w = d(`${m}-${x + 2}`).format("YYYY-MM");
526
534
  }
527
535
  if (!i) {
528
- const b = s ? m : t[0], [C, H] = P(b, "year", 0, 1), O = w(h, f, l);
536
+ const x = s ? m : t[0], [C, H] = g(
537
+ ...P(x, "year", 0, 1),
538
+ Y?.innerSyncWay
539
+ ), O = v(h, f, l);
529
540
  O.s = "tor-indicator-cell-style";
530
- const [, B] = P(g, "month", 0, 1), [E] = P(M, "month", 0, 1);
541
+ const [, B] = P(p, "month", 0, 1), [A] = P(w, "month", 0, 1);
531
542
  O.custom = {
532
543
  ...T,
533
- startTime: R ? E : C,
544
+ startTime: R ? A : C,
534
545
  endTime: F ? B : H
535
546
  };
536
547
  break;
@@ -546,23 +557,26 @@ async function ge(e, r) {
546
557
  "year"
547
558
  /* year */
548
559
  );
549
- for (let b = 0; b <= Math.abs(N === 0 ? 1 : N); b++) {
550
- const C = b * (S + 1), H = i === "right" ? f : I(f).add(C).toNumber(), O = i === "right" ? I(l).add(C).toNumber() : l, [B, E] = P(t[0], "year", b, x), L = w(h, H, O);
551
- L.s = "tor-indicator-cell-style", L.custom = {
560
+ for (let x = 0; x <= Math.abs(N === 0 ? 1 : N); x++) {
561
+ const C = x * (S + 1), H = i === "right" ? f : I(f).add(C).toNumber(), O = i === "right" ? I(l).add(C).toNumber() : l, [B, A] = g(
562
+ ...P(t[0], "year", x, M),
563
+ Y?.innerSyncWay
564
+ ), $ = v(h, H, O);
565
+ $.s = "tor-indicator-cell-style", $.custom = {
552
566
  ...T,
553
567
  startTime: B,
554
- endTime: E
568
+ endTime: A
555
569
  };
556
570
  }
557
571
  break;
558
572
  }
559
573
  case "hour": {
560
574
  if (!i) {
561
- const m = p ? t[0] : t[0] ?? y, [g, M] = P(m, "hour", 1, 1), b = w(h, f, l);
562
- b.s = "tor-indicator-cell-style", b.custom = {
575
+ const m = b ? t[0] : t[0] ?? y, [p, w] = P(m, "hour", 1, 1), x = v(h, f, l);
576
+ x.s = "tor-indicator-cell-style", x.custom = {
563
577
  ...T,
564
- startTime: g,
565
- endTime: M
578
+ startTime: p,
579
+ endTime: w
566
580
  };
567
581
  break;
568
582
  }
@@ -573,17 +587,17 @@ async function ge(e, r) {
573
587
  /* hour */
574
588
  );
575
589
  for (let m = 0; m <= Math.abs(N === 0 ? 1 : N); m++) {
576
- const g = m * (S + 1), M = i === "right" ? f : I(f).add(g).toNumber(), b = i === "right" ? I(l).add(g).toNumber() : l, C = w(h, M, b);
577
- if (C.s = "tor-indicator-cell-style", p) {
578
- const E = d(t[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), [L, _] = P(E, "hour", m, x);
590
+ const p = m * (S + 1), w = i === "right" ? f : I(f).add(p).toNumber(), x = i === "right" ? I(l).add(p).toNumber() : l, C = v(h, w, x);
591
+ if (C.s = "tor-indicator-cell-style", b) {
592
+ const A = d(t[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), [$, _] = P(A, "hour", m, M);
579
593
  C.custom = {
580
594
  ...T,
581
- startTime: L,
595
+ startTime: $,
582
596
  endTime: _
583
597
  };
584
598
  continue;
585
599
  }
586
- const H = d(y).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), [O, B] = P(H, "hour", m, x);
600
+ const H = d(y).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), [O, B] = P(H, "hour", m, M);
587
601
  C.custom = {
588
602
  ...T,
589
603
  startTime: O,
@@ -594,22 +608,22 @@ async function ge(e, r) {
594
608
  }
595
609
  case "shift": {
596
610
  if (!i) {
597
- const [m, g] = t, M = w(h, f, l);
598
- M.s = "tor-indicator-cell-style", M.custom = {
611
+ const [m, p] = t, w = v(h, f, l);
612
+ w.s = "tor-indicator-cell-style", w.custom = {
599
613
  ...T,
600
614
  startTime: m,
601
- endTime: g
615
+ endTime: p
602
616
  };
603
617
  break;
604
618
  }
605
619
  if (!c.length)
606
620
  throw new Error("没有获取到当班数据");
607
621
  for (let m = 0; m < c.length; m++) {
608
- const g = c[m], { startDatetime: M, endDatetime: b } = g, C = m * (S + 1), H = i === "right" ? f : I(f).add(C).toNumber(), O = i === "right" ? I(l).add(C).toNumber() : l, B = w(h, H, O);
622
+ const p = c[m], { startDatetime: w, endDatetime: x } = p, C = m * (S + 1), H = i === "right" ? f : I(f).add(C).toNumber(), O = i === "right" ? I(l).add(C).toNumber() : l, B = v(h, H, O);
609
623
  B.s = "tor-indicator-cell-style", B.custom = {
610
624
  ...T,
611
- startTime: M,
612
- endTime: b
625
+ startTime: w,
626
+ endTime: x
613
627
  };
614
628
  }
615
629
  break;
@@ -631,20 +645,20 @@ function pe(e, r) {
631
645
  for (const [t, c] of Object.entries(r)) {
632
646
  o[t] || (o[t] = {});
633
647
  for (const [n, y] of Object.entries(c)) {
634
- const v = y ?? {}, a = o[t]?.[n];
648
+ const g = y ?? {}, a = o[t]?.[n];
635
649
  if (a) {
636
650
  const h = {
637
651
  ...a,
638
- ...v,
652
+ ...g,
639
653
  custom: {
640
654
  ...a.custom,
641
- ...v.custom
655
+ ...g.custom
642
656
  },
643
- v: v.v || ""
657
+ v: g.v || ""
644
658
  };
645
659
  o[t][n] = h;
646
660
  } else
647
- o[t][n] = v;
661
+ o[t][n] = g;
648
662
  }
649
663
  }
650
664
  return o;
@@ -657,11 +671,11 @@ function be(e, r) {
657
671
  for (const n in c) {
658
672
  const y = c[n];
659
673
  if (y?.custom?.cellType === "indicator") {
660
- const v = Number(t), a = Number(n);
674
+ const g = Number(t), a = Number(n);
661
675
  if (r.some(
662
- (Y) => v >= Y.startRow && v <= Y.endRow && a >= Y.startColumn && a <= Y.endColumn
676
+ (D) => g >= D.startRow && g <= D.endRow && a >= D.startColumn && a <= D.endColumn
663
677
  ) && !r.some(
664
- (f) => v === f.startRow && a === f.startColumn
678
+ (f) => g === f.startRow && a === f.startColumn
665
679
  ))
666
680
  continue;
667
681
  }
@@ -672,8 +686,8 @@ function be(e, r) {
672
686
  }
673
687
  const xe = "./style.css";
674
688
  export {
675
- $e as BaselineOffset,
676
- Ae as CommandService,
689
+ Ge as BaselineOffset,
690
+ We as CommandService,
677
691
  ve as CommandType,
678
692
  Je as ComponentManager,
679
693
  ze as ContextMenuGroup,
@@ -691,19 +705,21 @@ export {
691
705
  ce as ModeEnum,
692
706
  Oe as Plugin,
693
707
  Xe as RibbonStartGroup,
694
- qe as SetRangeValuesCommand,
708
+ Le as SetRangeValuesCommand,
695
709
  Ie as Univer,
696
710
  je as UniverInstanceType,
697
711
  ot as UniverLicensePlugin,
698
- zt as UniverPresetSheetsDataValidationZhCN,
699
- Bt as UniverPresetSheetsDrawingZhCN,
700
- Lt as UniverPresetSheetsFilterZhCN,
701
- _t as UniverPresetSheetsFindReplaceZhCN,
702
- Et as UniverPresetSheetsHyperLinkZhCN,
703
- $t as UniverPresetSheetsNoteZhCN,
704
- Wt as UniverPresetSheetsSortZhCN,
705
- tr as UniverPresetSheetsTableZhCN,
706
- Xt as UniverPresetSheetsThreadCommentZhCN,
712
+ It as UniverPresetSheetsAdvancedZhCN,
713
+ Xt as UniverPresetSheetsDataValidationZhCN,
714
+ At as UniverPresetSheetsDrawingZhCN,
715
+ zt as UniverPresetSheetsFilterZhCN,
716
+ tr as UniverPresetSheetsFindReplaceZhCN,
717
+ $t as UniverPresetSheetsHyperLinkZhCN,
718
+ qt as UniverPresetSheetsNoteZhCN,
719
+ _t as UniverPresetSheetsSortZhCN,
720
+ sr as UniverPresetSheetsTableZhCN,
721
+ or as UniverPresetSheetsThreadCommentZhCN,
722
+ Ut as UniverSheetsAdvancedPreset,
707
723
  st as UniverSheetsConditionalFormattingPreset,
708
724
  it as UniverSheetsCorePreset,
709
725
  Pt as UniverSheetsCrosshairHighlightPlugin,
@@ -733,11 +749,11 @@ export {
733
749
  Ze as merge,
734
750
  pe as mergeCellData,
735
751
  Ve as mergeLocales,
736
- It as sheetsConditionalFormattingZhCN,
737
- Ht as sheetsCoreZhCN,
738
- Zt as sheetsFilterZhCN,
752
+ Bt as sheetsConditionalFormattingZhCN,
753
+ Zt as sheetsCoreZhCN,
754
+ Gt as sheetsFilterZhCN,
739
755
  xe as stylePath,
740
- Ee as touchDependencies,
756
+ Ae as touchDependencies,
741
757
  he as useData,
742
- Ut as zhCN
758
+ Ht as zhCN
743
759
  };
@@ -1 +1 @@
1
- (function(e,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("@univerjs/presets"),require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/ui"),require("@univerjs/ui-adapter-vue3"),require("@univerjs-pro/license"),require("@univerjs/preset-sheets-conditional-formatting"),require("@univerjs/presets/preset-sheets-core"),require("@univerjs/preset-sheets-data-validation"),require("@univerjs/preset-sheets-drawing"),require("@univerjs/preset-sheets-filter"),require("@univerjs/preset-sheets-hyper-link"),require("@univerjs/preset-sheets-note"),require("@univerjs/preset-sheets-sort"),require("@univerjs/preset-sheets-find-replace"),require("@univerjs/preset-sheets-thread-comment"),require("@univerjs/preset-sheets-table"),require("@univerjs/watermark"),require("@univerjs/sheets-crosshair-highlight"),require("@univerjs/preset-sheets-core/locales/zh-CN"),require("@univerjs/presets/preset-sheets-conditional-formatting/locales/zh-CN"),require("@univerjs/presets/preset-sheets-core/locales/zh-CN"),require("@univerjs/preset-sheets-drawing/locales/zh-CN"),require("@univerjs/preset-sheets-filter/locales/zh-CN"),require("@univerjs/preset-sheets-hyper-link/locales/zh-CN"),require("@univerjs/preset-sheets-note/locales/zh-CN"),require("@univerjs/presets/preset-sheets-filter/locales/zh-CN"),require("@univerjs/preset-sheets-sort/locales/zh-CN"),require("@univerjs/preset-sheets-data-validation/locales/zh-CN"),require("@univerjs/preset-sheets-find-replace/locales/zh-CN"),require("@univerjs/preset-sheets-thread-comment/locales/zh-CN"),require("@univerjs/preset-sheets-table/locales/zh-CN"),require("dayjs"),require("decimal.js")):typeof define=="function"&&define.amd?define(["exports","@univerjs/presets","@univerjs/core","@univerjs/sheets","@univerjs/ui","@univerjs/ui-adapter-vue3","@univerjs-pro/license","@univerjs/preset-sheets-conditional-formatting","@univerjs/presets/preset-sheets-core","@univerjs/preset-sheets-data-validation","@univerjs/preset-sheets-drawing","@univerjs/preset-sheets-filter","@univerjs/preset-sheets-hyper-link","@univerjs/preset-sheets-note","@univerjs/preset-sheets-sort","@univerjs/preset-sheets-find-replace","@univerjs/preset-sheets-thread-comment","@univerjs/preset-sheets-table","@univerjs/watermark","@univerjs/sheets-crosshair-highlight","@univerjs/preset-sheets-core/locales/zh-CN","@univerjs/presets/preset-sheets-conditional-formatting/locales/zh-CN","@univerjs/presets/preset-sheets-core/locales/zh-CN","@univerjs/preset-sheets-drawing/locales/zh-CN","@univerjs/preset-sheets-filter/locales/zh-CN","@univerjs/preset-sheets-hyper-link/locales/zh-CN","@univerjs/preset-sheets-note/locales/zh-CN","@univerjs/presets/preset-sheets-filter/locales/zh-CN","@univerjs/preset-sheets-sort/locales/zh-CN","@univerjs/preset-sheets-data-validation/locales/zh-CN","@univerjs/preset-sheets-find-replace/locales/zh-CN","@univerjs/preset-sheets-thread-comment/locales/zh-CN","@univerjs/preset-sheets-table/locales/zh-CN","dayjs","decimal.js"],d):(e=typeof globalThis<"u"?globalThis:e||self,d(e.TorUniverSheet={},e.presets,e.core,e.sheets,e.ui,e.uiAdapterVue3,e.license,e.presetSheetsConditionalFormatting,e.presetSheetsCore,e.presetSheetsDataValidation,e.presetSheetsDrawing,e.presetSheetsFilter,e.presetSheetsHyperLink,e.presetSheetsNote,e.presetSheetsSort,e.presetSheetsFindReplace,e.presetSheetsThreadComment,e.presetSheetsTable,e.watermark,e.sheetsCrosshairHighlight,e.zhCN$c,e.zhCN$9,e.zhCN$a,e.zhCN$1,e.zhCN$b,e.zhCN$4,e.zhCN$5,e.zhCN$2,e.zhCN$6,e.zhCN,e.zhCN$3,e.zhCN$8,e.zhCN$7,e.dayjs,e.Decimal))})(this,(function(e,d,X,ne,Z,se,ie,oe,ae,ue,ce,le,he,me,fe,de,ye,ve,ge,be,Ce,pe,Pe,Ye,De,je,Se,Ne,Me,we,Te,Oe,Ue,y,_){"use strict";const ke=(t,n)=>{for(const s of n)t[s]=null},x=()=>{if(typeof crypto=="object"){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();if(typeof crypto.getRandomValues=="function"&&typeof Uint8Array=="function"){const s=r=>{const c=Number(r);return(c^crypto.getRandomValues(new Uint8Array(1))[0]&15>>c/4).toString(16)};return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,s)}}let t=new Date().getTime(),n=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{let r=Math.random()*16;return t>0?(r=(t+r)%16|0,t=Math.floor(t/16)):(r=(n+r)%16|0,n=Math.floor(n/16)),(s==="x"?r:r&3|8).toString(16)})};function Ie(t){return{...t?.workbookData,id:t?.id||x(),name:t?.name||"未命名",appVersion:t?.appVersion||"1.0.0"}}const ze=Object.prototype.toString,ee=(t,n)=>ze.call(t)===`[object ${n}]`,qe=t=>typeof t<"u",He=t=>!qe(t),Re=t=>t!==null&&ee(t,"Object"),$=t=>t==null||typeof t>"u"?!0:W(t)||$e(t)?t.length===0:t instanceof Map||t instanceof Set?t.size===0:Re(t)?Object.keys(t).length===0:!1,Ve=t=>t===null,Fe=t=>He(t)||Ve(t),$e=t=>ee(t,"String"),W=t=>t&&Array.isArray(t);class Be{value;constructor(n){this.value=new _(n)}add(n){return this.value=this.value.add(n||0),this}subtract(n){return this.value=this.value.sub(n||0),this}multiply(n){return this.value=this.value.mul(n||0),this}divide(n){const s=new _(n);if(s.isZero())throw new Error("除数是0");return this.value=this.value.div(s),this}toFixed(n,s){return this.value=new _(this.value.toFixed(n,s)),this}valueOf(){return this.value}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}}function I(t=0){return new Be(t)}var te=(t=>(t.无="no",t.年="year",t.月="month",t.周="week",t.天="day",t.班组="shift",t.小时="hour",t.半小时="half_hour",t))(te||{}),re=(t=>(t.view="view",t.edit="edit",t))(re||{});async function Ee(t,n){if(!n)return Promise.reject("日期不能为空");switch(t){case"year":if(W(n))return Promise.resolve(n);const s=y(n);if(!s.isValid())return Promise.reject("无效的日期格式");const r=s.year(),c=`${r}-01`,i=`${r}-12`;return Promise.resolve([c,i]);case"month":if(W(n))return Promise.resolve(n);const g=y(n);if(!g.isValid())return Promise.reject("无效的日期格式");const N=g.startOf("month").format("YYYY-MM-DD"),a=g.endOf("month").format("YYYY-MM-DD");return Promise.resolve([N,a]);case"day":if(W(n))return Promise.resolve(n);const v=y(n);if(!v.isValid())return Promise.reject("无效的日期格式");const b=v.startOf("day").format("YYYY-MM-DD HH:mm:ss"),h=v.endOf("day").format("YYYY-MM-DD HH:mm:ss");return Promise.resolve([b,h]);default:return Promise.reject("不支持的周期类型")}}function H(t,n,s){return s?y(n).diff(y(t),s):0}function J(t,n,s){if(!s)throw new Error("日期类型不能为空");const r={year:"YYYY",month:"YYYY-MM",day:"YYYY-MM-DD",hour:"HH:mm:ss"}[s];return y(t).subtract(n,s).format(r)}function U(t,n,s,r){const c="YYYY-MM-DD HH:mm:ss",i=G(t,n,s,r),g=y(i);if(n==="month"){const a=g.month();return a===0?[g.startOf("month").format(c),g.date(25).endOf("day").format(c)]:a===11?[g.subtract(1,"month").date(26).startOf("day").format(c),g.endOf("month").format(c)]:[g.subtract(1,"month").date(26).startOf("day").format(c),g.date(25).endOf("day").format(c)]}const N={year:"year",day:"day",hour:"hour"};return[g.startOf(N[n]).format(c),g.endOf(N[n]).format(c)]}function G(t,n,s,r){const c={year:"YYYY",month:"YYYY-MM",day:"YYYY-MM-DD",hour:"YYYY-MM-DD HH:mm:ss"}[n];return y(t,c).add(s*r,n).format(c)}function D(t,n,s){return t[n]||(t[n]={}),t[n][s]||(t[n][s]={}),t[n][s]}async function Ge(t){if(!t)throw new Error("cellData is required");const n=Object.entries(t).reduce((s,r)=>{const[c,i]=r;for(const[g,N]of Object.entries(i)){const{custom:a,v,t:b,s:h}=N;if(!a)continue;const{cellType:L}=a,l=!a.hasOwnProperty("writeBack")||$(a?.writeBack)?!0:a.writeBack;if(L==="indicator"){const z=D(s,c,g);z.custom={...a,required:$(a?.required)?!1:a?.required,defaultShift:$(a?.defaultShift)?!1:a?.defaultShift,forwardPush:$(a?.forwardPush)?!1:a?.forwardPush,forwardPushTimes:$(a?.useDefaultEndDate)?0:a?.forwardPushTimes,useDefaultEndDate:$(a?.useDefaultEndDate)?!1:a?.useDefaultEndDate,copyType:$(a?.copyType)?"":a?.copyType,writeBack:l},z.s=h,z.t=b,z.v=v||""}}return s},{});return!n||$(n)?Promise.reject(new Error("No data found")):Promise.resolve(n)}function A(t,n){return t.replace(/\$\{([^}]+)\}/g,(s,r)=>{try{const c=Object.keys(n),i=Object.values(n);return new Function(...c,`return ${r};`)(...i)}catch(c){return console.error(`表达式执行失败: ${r}`,c),s}})}function Le({acc:t,params:n,initRowNum:s,initColNum:r,cellData:c}){const{rangeData:i,currentDay:g,extraArgs:N}=n,a=N?.teamData||{},{cycleType:v,timeIncrement:b,forwardPush:h,forwardPushTimes:L,copyType:l,copyInterval:z,defaultShift:p,templateStr:k,useDefaultEndDate:Q}=c.custom;let j=0;switch(v){case"day":{let o="";if(h&&(o=J(i[0],L,"day")),!l){let m="";h?m=o:m=i[0];const u=D(t,s,r);u.v=k?A(k,{businessDate:m,dayjs:y}):y(m).format("YYYY-MM-DD"),u.t=d.CellValueType.STRING,u.s="tor-time-cell-style";break}h?j=H(o,i[0],"day"):(j=H(i[0],i[1],"day"),console.log("copyNum",j));for(let m=0;m<=Math.abs(j===0?1:j);m++){const u=m*(z+1);let M="";h?M=G(o,"day",m,b):M=G(i[0],"day",m,b);const P=l==="right"?s:s+u,V=l==="right"?r+u:r,B=D(t,P,V);B.v=k?A(k,{businessDate:M,dayjs:y}):y(M).format("YYYY-MM-DD"),B.t=d.CellValueType.STRING,B.s="tor-time-cell-style"}break}case"month":{if(!l){const[o,m]=U(i[1],"month",0,1),u=D(t,s,r);u.v=y(m).format("YYYY-MM"),u.t=d.CellValueType.STRING,u.s="tor-time-cell-style";break}j=H(i[0],i[1],"month");for(let o=0;o<=Math.abs(j===0?1:j);o++){const m=o*(z+1),u=l==="right"?s:s+m,M=l==="right"?r+m:r,P=D(t,u,M);P.v=G(i[0],"month",o,b),P.t=d.CellValueType.STRING,P.s="tor-time-cell-style"}break}case"year":{let o="";if(h&&(o=J(i[0],L||0,"year")),!l){const m=h?o:i[0],[u,M]=U(m,"year",0,1),P=D(t,s,r),[,V]=U(i[1],"month",0,1);P.v=k?A(k,{startTime:u,endTime:M,rangeData:i,dayjs:y}):m,P.t=d.CellValueType.STRING,P.s="tor-time-cell-style";break}h?j=H(o,i[0],"year"):j=H(i[0],i[1],"year");for(let m=0;m<=Math.abs(j===0?1:j);m++){const u=m*(z+1),M=l==="right"?s:s+u,P=l==="right"?r+u:r,[V,B]=U(i[0],"year",m,b),w=D(t,M,P),O=G(i[0],"year",m,b);w.v=k?A(k,{startTime:V,endTime:B,rangeData:i,dayjs:y}):O,w.t=d.CellValueType.STRING,w.s="tor-time-cell-style"}break}case"hour":{if(!l){const o=D(t,s,r);if(o.t=d.CellValueType.STRING,o.s="tor-time-cell-style",p){o.v=y(i[0]).add(1,"hour").format("YYYY-MM-DD HH:mm:ss");break}o.v=y(g).add(1,"hour").format("YYYY-MM-DD HH:mm:ss");break}j=H(i[0],i[1],"hour");for(let o=0;o<=Math.abs(j===0?1:j);o++){const m=o*(z+1),u=l==="right"?s:s+m,M=l==="right"?r+m:r,P=D(t,u,M);if(P.t=d.CellValueType.STRING,P.s="tor-time-cell-style",p){const V=y(i[0]).add(1,"hour").format("YYYY-MM-DD HH:mm:ss");P.v=G(V,"hour",o,b);continue}P.v=G(y(g).add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),"hour",o,b)}break}case"shift":{if(!l){const o=D(t,s,r);o.t=d.CellValueType.STRING,o.s="tor-time-cell-style",o.v=k?A(k,{rangeData:i,dayjs:y}):i[0];break}if(!a.length)throw new Error("没有获取到当班数据");for(let o=0;o<a.length;o++){const m=a[o],{startDatetime:u,endDatetime:M}=m,P=o*(z+1),V=l==="right"?s:I(s).add(P).toNumber(),B=l==="right"?I(r).add(P).toNumber():r,w=D(t,V,B);w.s="tor-time-cell-style",w.v=k?A(k,{team:m}):u}break}}}async function Ze(t,n){if(!t)return Promise.reject("没有可用的单元格数据");const{extraArgs:s,rangeData:r}=n;if(!r.length)return Promise.reject("处理时间范围失败, rangeData不能为空");const c=s?.teamData||[],{periodicityTime:i}=n,g=n?.currentDay||y().format("YYYY-MM-DD"),N=(v,b,h)=>i?h!=="MACH_CYCLE"?[v,b]:parseInt(i.split(":")[0],10)<12?[y(v).format("YYYY-MM-DD")+" "+i,y(b).add(1,"day").format("YYYY-MM-DD")+" "+i]:[y(v).subtract(1,"day").format("YYYY-MM-DD")+" "+i,y(b).format("YYYY-MM-DD")+" "+i]:[v,b],a=Object.entries(t).reduce((v,b)=>{const[h,L]=b;for(const[l,z]of Object.entries(L)){const{custom:p}=z;if(!p)continue;const{cellType:k,cycleType:Q,timeIncrement:j,forwardPush:o,forwardPushTimes:m,copyType:u,copyInterval:M,defaultShift:P,useDefaultStartDate:V,useDefaultEndDate:B}=p;if(k==="time"){Le({acc:v,params:n,initRowNum:Number(h),initColNum:Number(l),cellData:z});continue}const w={cycleType:Q,indicatorName:p.indicatorName,indicatorCode:p.indicatorCode,indicatorId:p.indicatorId,indicatorDimensionName:p.indicatorDimensionName,indicatorDimensionConfig:p.indicatorDimensionConfig,required:Fe(p?.required)??!1,cellType:p.cellType,defaultShift:p?.defaultShift||!1,writeBack:$(p?.writeBack)?!0:p.writeBack,dimensionJson:p?.dimensionJson||"",unit:p?.unit||"",innerSyncWay:p?.innerSyncWay||"",outSyncConfigId:p?.outSyncConfigId||"",innerSyncStatus:p?.innerSyncStatus||""};let O=0;switch(Q){case"day":{let f="";if(o&&(f=J(r[0],m||0,"day")),!u){const C=o?f:r[0],[S,Y]=N(...U(C,"day",0,1),p?.innerSyncWay),T=D(v,h,l);T.s="tor-indicator-cell-style",T.custom={...w,startTime:S,endTime:Y};break}o?O=H(f,r[0],"day"):O=H(r[0],r[1],"day");for(let C=0;C<=Math.abs(O===0?1:O);C++){const S=C*(M+1),Y=o?f:r[0],[T,R]=N(...U(Y,"day",C,j),p?.innerSyncWay),q=u==="right"?h:I(h).add(S).toNumber(),F=u==="right"?I(l).add(S).toNumber():l,E=D(v,q,F);E.s="tor-indicator-cell-style",E.custom={...w,startTime:T,endTime:R}}break}case"month":{if(!u){const[f,C]=U(r[1],"month",0,1),S=D(v,h,l);S.s="tor-indicator-cell-style",S.custom={...w,startTime:f,endTime:C};break}O=H(r[0],r[1],"month");for(let f=0;f<=Math.abs(O===0?1:O);f++){const C=f*(M+1),S=u==="right"?h:I(h).add(C).toNumber(),Y=u==="right"?I(l).add(C).toNumber():l,[T,R]=U(r[0],"month",f,j),q=D(v,S,Y);q.s="tor-indicator-cell-style",q.custom={...w,startTime:T,endTime:R}}break}case"year":{let f="",C="",S="";if(o){f=J(r[0],m||0,"year");const Y=y(r[1]).format("MM");C=y(`${f}-${Y+1}`).format("YYYY-MM"),S=y(`${f}-${Y+2}`).format("YYYY-MM")}if(!u){const Y=o?f:r[0],[T,R]=U(Y,"year",0,1),q=D(v,h,l);q.s="tor-indicator-cell-style";const[,F]=U(C,"month",0,1),[E]=U(S,"month",0,1);q.custom={...w,startTime:V?E:T,endTime:B?F:R};break}o?O=H(f,r[0],"year"):O=H(r[0],r[1],"year");for(let Y=0;Y<=Math.abs(O===0?1:O);Y++){const T=Y*(M+1),R=u==="right"?h:I(h).add(T).toNumber(),q=u==="right"?I(l).add(T).toNumber():l,[F,E]=U(r[0],"year",Y,j),K=D(v,R,q);K.s="tor-indicator-cell-style",K.custom={...w,startTime:F,endTime:E}}break}case"hour":{if(!u){const f=P?r[0]:r[0]??g,[C,S]=U(f,"hour",1,1),Y=D(v,h,l);Y.s="tor-indicator-cell-style",Y.custom={...w,startTime:C,endTime:S};break}O=H(r[0],r[1],"hour");for(let f=0;f<=Math.abs(O===0?1:O);f++){const C=f*(M+1),S=u==="right"?h:I(h).add(C).toNumber(),Y=u==="right"?I(l).add(C).toNumber():l,T=D(v,S,Y);if(T.s="tor-indicator-cell-style",P){const E=y(r[0]).add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),[K,_e]=U(E,"hour",f,j);T.custom={...w,startTime:K,endTime:_e};continue}const R=y(g).add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),[q,F]=U(R,"hour",f,j);T.custom={...w,startTime:q,endTime:F}}break}case"shift":{if(!u){const[f,C]=r,S=D(v,h,l);S.s="tor-indicator-cell-style",S.custom={...w,startTime:f,endTime:C};break}if(!c.length)throw new Error("没有获取到当班数据");for(let f=0;f<c.length;f++){const C=c[f],{startDatetime:S,endDatetime:Y}=C,T=f*(M+1),R=u==="right"?h:I(h).add(T).toNumber(),q=u==="right"?I(l).add(T).toNumber():l,F=D(v,R,q);F.s="tor-indicator-cell-style",F.custom={...w,startTime:S,endTime:Y}}break}}}return v},{});return Promise.resolve(a)}function Ae(t){return Object.entries(t).reduce((s,[r,c])=>{const i=Math.max(...Object.keys(c).map(Number));return i>s?s=Number(i):s=Number(s)||0,s},0)}function We(t,n){const s=JSON.parse(JSON.stringify(t||{}));for(const[r,c]of Object.entries(n)){s[r]||(s[r]={});for(const[i,g]of Object.entries(c)){const N=g??{},a=s[r]?.[i];if(a){const v={...a,...N,custom:{...a.custom,...N.custom},v:N.v||""};s[r][i]=v}else s[r][i]=N}}return s}function Je(t,n){if(!n?.length||!t)return t;const s={};for(const r in t){const c=t[r];for(const i in c){const g=c[i];if(g?.custom?.cellType==="indicator"){const N=Number(r),a=Number(i);if(n.some(b=>N>=b.startRow&&N<=b.endRow&&a>=b.startColumn&&a<=b.endColumn)&&!n.some(h=>N===h.startRow&&a===h.startColumn))continue}s[r]||(s[r]={}),s[r][i]=g}}return s}const Ke="./style.css";Object.defineProperty(e,"CommandType",{enumerable:!0,get:()=>d.CommandType}),Object.defineProperty(e,"FEventName",{enumerable:!0,get:()=>d.FEventName}),Object.defineProperty(e,"FUniver",{enumerable:!0,get:()=>d.FUniver}),Object.defineProperty(e,"ICommandService",{enumerable:!0,get:()=>d.ICommandService}),Object.defineProperty(e,"IUniverInstanceService",{enumerable:!0,get:()=>d.IUniverInstanceService}),Object.defineProperty(e,"Inject",{enumerable:!0,get:()=>d.Inject}),Object.defineProperty(e,"Injector",{enumerable:!0,get:()=>d.Injector}),Object.defineProperty(e,"LocaleType",{enumerable:!0,get:()=>d.LocaleType}),Object.defineProperty(e,"Plugin",{enumerable:!0,get:()=>d.Plugin}),Object.defineProperty(e,"Univer",{enumerable:!0,get:()=>d.Univer}),Object.defineProperty(e,"UniverInstanceType",{enumerable:!0,get:()=>d.UniverInstanceType}),Object.defineProperty(e,"Workbook",{enumerable:!0,get:()=>d.Workbook}),Object.defineProperty(e,"createUniver",{enumerable:!0,get:()=>d.createUniver}),Object.defineProperty(e,"defaultTheme",{enumerable:!0,get:()=>d.defaultTheme}),Object.defineProperty(e,"greenTheme",{enumerable:!0,get:()=>d.greenTheme}),Object.defineProperty(e,"merge",{enumerable:!0,get:()=>d.merge}),Object.defineProperty(e,"mergeLocales",{enumerable:!0,get:()=>d.mergeLocales}),Object.defineProperty(e,"touchDependencies",{enumerable:!0,get:()=>d.touchDependencies}),Object.defineProperty(e,"BaselineOffset",{enumerable:!0,get:()=>X.BaselineOffset}),Object.defineProperty(e,"CommandService",{enumerable:!0,get:()=>X.CommandService}),Object.defineProperty(e,"SetRangeValuesCommand",{enumerable:!0,get:()=>ne.SetRangeValuesCommand}),Object.defineProperty(e,"ComponentManager",{enumerable:!0,get:()=>Z.ComponentManager}),Object.defineProperty(e,"ContextMenuGroup",{enumerable:!0,get:()=>Z.ContextMenuGroup}),Object.defineProperty(e,"ContextMenuPosition",{enumerable:!0,get:()=>Z.ContextMenuPosition}),Object.defineProperty(e,"IMenuManagerService",{enumerable:!0,get:()=>Z.IMenuManagerService}),Object.defineProperty(e,"MenuItemType",{enumerable:!0,get:()=>Z.MenuItemType}),Object.defineProperty(e,"RibbonStartGroup",{enumerable:!0,get:()=>Z.RibbonStartGroup}),Object.defineProperty(e,"UniverVue3AdapterPlugin",{enumerable:!0,get:()=>se.UniverVue3AdapterPlugin}),Object.defineProperty(e,"UniverLicensePlugin",{enumerable:!0,get:()=>ie.UniverLicensePlugin}),Object.defineProperty(e,"UniverSheetsConditionalFormattingPreset",{enumerable:!0,get:()=>oe.UniverSheetsConditionalFormattingPreset}),Object.defineProperty(e,"UniverSheetsCorePreset",{enumerable:!0,get:()=>ae.UniverSheetsCorePreset}),Object.defineProperty(e,"UniverSheetsDataValidationPreset",{enumerable:!0,get:()=>ue.UniverSheetsDataValidationPreset}),Object.defineProperty(e,"UniverSheetsDrawingPreset",{enumerable:!0,get:()=>ce.UniverSheetsDrawingPreset}),Object.defineProperty(e,"UniverSheetsFilterPreset",{enumerable:!0,get:()=>le.UniverSheetsFilterPreset}),Object.defineProperty(e,"UniverSheetsHyperLinkPreset",{enumerable:!0,get:()=>he.UniverSheetsHyperLinkPreset}),Object.defineProperty(e,"UniverSheetsNotePreset",{enumerable:!0,get:()=>me.UniverSheetsNotePreset}),Object.defineProperty(e,"UniverSheetsSortPreset",{enumerable:!0,get:()=>fe.UniverSheetsSortPreset}),Object.defineProperty(e,"UniverSheetsFindReplacePreset",{enumerable:!0,get:()=>de.UniverSheetsFindReplacePreset}),Object.defineProperty(e,"UniverSheetsThreadCommentPreset",{enumerable:!0,get:()=>ye.UniverSheetsThreadCommentPreset}),Object.defineProperty(e,"UniverSheetsTablePreset",{enumerable:!0,get:()=>ve.UniverSheetsTablePreset}),Object.defineProperty(e,"UniverWatermarkPlugin",{enumerable:!0,get:()=>ge.UniverWatermarkPlugin}),Object.defineProperty(e,"UniverSheetsCrosshairHighlightPlugin",{enumerable:!0,get:()=>be.UniverSheetsCrosshairHighlightPlugin}),e.zhCN=Ce,e.sheetsConditionalFormattingZhCN=pe,e.sheetsCoreZhCN=Pe,e.UniverPresetSheetsDrawingZhCN=Ye,e.sheetsFilterZhCN=De,e.UniverPresetSheetsHyperLinkZhCN=je,e.UniverPresetSheetsNoteZhCN=Se,e.UniverPresetSheetsFilterZhCN=Ne,e.UniverPresetSheetsSortZhCN=Me,e.UniverPresetSheetsDataValidationZhCN=we,e.UniverPresetSheetsFindReplaceZhCN=Te,e.UniverPresetSheetsThreadCommentZhCN=Oe,e.UniverPresetSheetsTableZhCN=Ue,e.CycleTypeEnum=te,e.ModeEnum=re,e.decimal=I,e.filterIndicatorsCell=Ge,e.filterMergedIndicatorCells=Je,e.generateIndicatorsCells=Ze,e.generateUUID=x,e.getNumColumns=Ae,e.handleClearInput=ke,e.initDateRange=Ee,e.mergeCellData=We,e.stylePath=Ke,e.useData=Ie,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(e,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("@univerjs/presets"),require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/ui"),require("@univerjs/ui-adapter-vue3"),require("@univerjs-pro/license"),require("@univerjs/preset-sheets-conditional-formatting"),require("@univerjs/presets/preset-sheets-core"),require("@univerjs/preset-sheets-data-validation"),require("@univerjs/preset-sheets-drawing"),require("@univerjs/preset-sheets-filter"),require("@univerjs/preset-sheets-hyper-link"),require("@univerjs/preset-sheets-note"),require("@univerjs/preset-sheets-sort"),require("@univerjs/preset-sheets-find-replace"),require("@univerjs/preset-sheets-thread-comment"),require("@univerjs/preset-sheets-table"),require("@univerjs/watermark"),require("@univerjs/sheets-crosshair-highlight"),require("@univerjs/preset-sheets-advanced"),require("@univerjs/preset-sheets-advanced/locales/zh-CN"),require("@univerjs/preset-sheets-core/locales/zh-CN"),require("@univerjs/presets/preset-sheets-conditional-formatting/locales/zh-CN"),require("@univerjs/presets/preset-sheets-core/locales/zh-CN"),require("@univerjs/preset-sheets-drawing/locales/zh-CN"),require("@univerjs/preset-sheets-filter/locales/zh-CN"),require("@univerjs/preset-sheets-hyper-link/locales/zh-CN"),require("@univerjs/preset-sheets-note/locales/zh-CN"),require("@univerjs/presets/preset-sheets-filter/locales/zh-CN"),require("@univerjs/preset-sheets-sort/locales/zh-CN"),require("@univerjs/preset-sheets-data-validation/locales/zh-CN"),require("@univerjs/preset-sheets-find-replace/locales/zh-CN"),require("@univerjs/preset-sheets-thread-comment/locales/zh-CN"),require("@univerjs/preset-sheets-table/locales/zh-CN"),require("dayjs"),require("decimal.js")):typeof define=="function"&&define.amd?define(["exports","@univerjs/presets","@univerjs/core","@univerjs/sheets","@univerjs/ui","@univerjs/ui-adapter-vue3","@univerjs-pro/license","@univerjs/preset-sheets-conditional-formatting","@univerjs/presets/preset-sheets-core","@univerjs/preset-sheets-data-validation","@univerjs/preset-sheets-drawing","@univerjs/preset-sheets-filter","@univerjs/preset-sheets-hyper-link","@univerjs/preset-sheets-note","@univerjs/preset-sheets-sort","@univerjs/preset-sheets-find-replace","@univerjs/preset-sheets-thread-comment","@univerjs/preset-sheets-table","@univerjs/watermark","@univerjs/sheets-crosshair-highlight","@univerjs/preset-sheets-advanced","@univerjs/preset-sheets-advanced/locales/zh-CN","@univerjs/preset-sheets-core/locales/zh-CN","@univerjs/presets/preset-sheets-conditional-formatting/locales/zh-CN","@univerjs/presets/preset-sheets-core/locales/zh-CN","@univerjs/preset-sheets-drawing/locales/zh-CN","@univerjs/preset-sheets-filter/locales/zh-CN","@univerjs/preset-sheets-hyper-link/locales/zh-CN","@univerjs/preset-sheets-note/locales/zh-CN","@univerjs/presets/preset-sheets-filter/locales/zh-CN","@univerjs/preset-sheets-sort/locales/zh-CN","@univerjs/preset-sheets-data-validation/locales/zh-CN","@univerjs/preset-sheets-find-replace/locales/zh-CN","@univerjs/preset-sheets-thread-comment/locales/zh-CN","@univerjs/preset-sheets-table/locales/zh-CN","dayjs","decimal.js"],d):(e=typeof globalThis<"u"?globalThis:e||self,d(e.TorUniverSheet={},e.presets,e.core,e.sheets,e.ui,e.uiAdapterVue3,e.license,e.presetSheetsConditionalFormatting,e.presetSheetsCore,e.presetSheetsDataValidation,e.presetSheetsDrawing,e.presetSheetsFilter,e.presetSheetsHyperLink,e.presetSheetsNote,e.presetSheetsSort,e.presetSheetsFindReplace,e.presetSheetsThreadComment,e.presetSheetsTable,e.watermark,e.sheetsCrosshairHighlight,e.presetSheetsAdvanced,e.zhCN,e.zhCN$d,e.zhCN$a,e.zhCN$b,e.zhCN$2,e.zhCN$c,e.zhCN$5,e.zhCN$6,e.zhCN$3,e.zhCN$7,e.zhCN$1,e.zhCN$4,e.zhCN$9,e.zhCN$8,e.dayjs,e.Decimal))})(this,(function(e,d,X,ne,G,se,ie,oe,ae,ue,ce,le,he,me,fe,de,ye,ve,be,ge,Ce,pe,Pe,je,Ye,De,Se,Ne,Me,we,Te,Oe,Ue,ke,Ie,y,_){"use strict";const ze=(t,n)=>{for(const s of n)t[s]=null},x=()=>{if(typeof crypto=="object"){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();if(typeof crypto.getRandomValues=="function"&&typeof Uint8Array=="function"){const s=r=>{const c=Number(r);return(c^crypto.getRandomValues(new Uint8Array(1))[0]&15>>c/4).toString(16)};return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,s)}}let t=new Date().getTime(),n=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{let r=Math.random()*16;return t>0?(r=(t+r)%16|0,t=Math.floor(t/16)):(r=(n+r)%16|0,n=Math.floor(n/16)),(s==="x"?r:r&3|8).toString(16)})};function qe(t){return{...t?.workbookData,id:t?.id||x(),name:t?.name||"未命名",appVersion:t?.appVersion||"1.0.0"}}const He=Object.prototype.toString,ee=(t,n)=>He.call(t)===`[object ${n}]`,Re=t=>typeof t<"u",Ve=t=>!Re(t),$e=t=>t!==null&&ee(t,"Object"),F=t=>t==null||typeof t>"u"?!0:W(t)||Ae(t)?t.length===0:t instanceof Map||t instanceof Set?t.size===0:$e(t)?Object.keys(t).length===0:!1,Fe=t=>t===null,Be=t=>Ve(t)||Fe(t),Ae=t=>ee(t,"String"),W=t=>t&&Array.isArray(t);class Ee{value;constructor(n){this.value=new _(n)}add(n){return this.value=this.value.add(n||0),this}subtract(n){return this.value=this.value.sub(n||0),this}multiply(n){return this.value=this.value.mul(n||0),this}divide(n){const s=new _(n);if(s.isZero())throw new Error("除数是0");return this.value=this.value.div(s),this}toFixed(n,s){return this.value=new _(this.value.toFixed(n,s)),this}valueOf(){return this.value}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}}function I(t=0){return new Ee(t)}var te=(t=>(t.无="no",t.年="year",t.月="month",t.周="week",t.天="day",t.班组="shift",t.小时="hour",t.半小时="half_hour",t))(te||{}),re=(t=>(t.view="view",t.edit="edit",t))(re||{});async function Ze(t,n){if(!n)return Promise.reject("日期不能为空");switch(t){case"year":if(W(n))return Promise.resolve(n);const s=y(n);if(!s.isValid())return Promise.reject("无效的日期格式");const r=s.year(),c=`${r}-01`,i=`${r}-12`;return Promise.resolve([c,i]);case"month":if(W(n))return Promise.resolve(n);const b=y(n);if(!b.isValid())return Promise.reject("无效的日期格式");const C=b.startOf("month").format("YYYY-MM-DD"),a=b.endOf("month").format("YYYY-MM-DD");return Promise.resolve([C,a]);case"day":if(W(n))return Promise.resolve(n);const v=y(n);if(!v.isValid())return Promise.reject("无效的日期格式");const p=v.startOf("day").format("YYYY-MM-DD HH:mm:ss"),h=v.endOf("day").format("YYYY-MM-DD HH:mm:ss");return Promise.resolve([p,h]);default:return Promise.reject("不支持的周期类型")}}function H(t,n,s){return s?y(n).diff(y(t),s):0}function J(t,n,s){if(!s)throw new Error("日期类型不能为空");const r={year:"YYYY",month:"YYYY-MM",day:"YYYY-MM-DD",hour:"HH:mm:ss"}[s];return y(t).subtract(n,s).format(r)}function U(t,n,s,r){const c="YYYY-MM-DD HH:mm:ss",i=E(t,n,s,r),b=y(i);if(n==="month"){const a=b.month();return a===0?[b.startOf("month").format(c),b.date(25).endOf("day").format(c)]:a===11?[b.subtract(1,"month").date(26).startOf("day").format(c),b.endOf("month").format(c)]:[b.subtract(1,"month").date(26).startOf("day").format(c),b.date(25).endOf("day").format(c)]}const C={year:"year",day:"day",hour:"hour"};return[b.startOf(C[n]).format(c),b.endOf(C[n]).format(c)]}function E(t,n,s,r){const c={year:"YYYY",month:"YYYY-MM",day:"YYYY-MM-DD",hour:"YYYY-MM-DD HH:mm:ss"}[n];return y(t,c).add(s*r,n).format(c)}function D(t,n,s){return t[n]||(t[n]={}),t[n][s]||(t[n][s]={}),t[n][s]}async function Ge(t){if(!t)throw new Error("cellData is required");const n=Object.entries(t).reduce((s,r)=>{const[c,i]=r;for(const[b,C]of Object.entries(i)){const{custom:a,v,t:p,s:h}=C;if(!a)continue;const{cellType:Z}=a,l=!a.hasOwnProperty("writeBack")||F(a?.writeBack)?!0:a.writeBack;if(Z==="indicator"){const z=D(s,c,b);z.custom={...a,required:F(a?.required)?!1:a?.required,defaultShift:F(a?.defaultShift)?!1:a?.defaultShift,forwardPush:F(a?.forwardPush)?!1:a?.forwardPush,forwardPushTimes:F(a?.useDefaultEndDate)?0:a?.forwardPushTimes,useDefaultEndDate:F(a?.useDefaultEndDate)?!1:a?.useDefaultEndDate,copyType:F(a?.copyType)?"":a?.copyType,writeBack:l},z.s=h,z.t=p,z.v=v||""}}return s},{});return!n||F(n)?Promise.reject(new Error("No data found")):Promise.resolve(n)}function L(t,n){return t.replace(/\$\{([^}]+)\}/g,(s,r)=>{try{const c=Object.keys(n),i=Object.values(n);return new Function(...c,`return ${r};`)(...i)}catch(c){return console.error(`表达式执行失败: ${r}`,c),s}})}function Le({acc:t,params:n,initRowNum:s,initColNum:r,cellData:c}){const{rangeData:i,currentDay:b,extraArgs:C}=n,a=C?.teamData||{},{cycleType:v,timeIncrement:p,forwardPush:h,forwardPushTimes:Z,copyType:l,copyInterval:z,defaultShift:g,templateStr:k,useDefaultEndDate:Q}=c.custom;let S=0;switch(v){case"day":{let o="";if(h&&(o=J(i[0],Z,"day")),!l){let m="";h?m=o:m=i[0];const u=D(t,s,r);u.v=k?L(k,{businessDate:m,dayjs:y}):y(m).format("YYYY-MM-DD"),u.t=d.CellValueType.STRING,u.s="tor-time-cell-style";break}h?S=H(o,i[0],"day"):(S=H(i[0],i[1],"day"),console.log("copyNum",S));for(let m=0;m<=Math.abs(S===0?1:S);m++){const u=m*(z+1);let M="";h?M=E(o,"day",m,p):M=E(i[0],"day",m,p);const j=l==="right"?s:s+u,V=l==="right"?r+u:r,B=D(t,j,V);B.v=k?L(k,{businessDate:M,dayjs:y}):y(M).format("YYYY-MM-DD"),B.t=d.CellValueType.STRING,B.s="tor-time-cell-style"}break}case"month":{if(!l){const[o,m]=U(i[1],"month",0,1),u=D(t,s,r);u.v=y(m).format("YYYY-MM"),u.t=d.CellValueType.STRING,u.s="tor-time-cell-style";break}S=H(i[0],i[1],"month");for(let o=0;o<=Math.abs(S===0?1:S);o++){const m=o*(z+1),u=l==="right"?s:s+m,M=l==="right"?r+m:r,j=D(t,u,M);j.v=E(i[0],"month",o,p),j.t=d.CellValueType.STRING,j.s="tor-time-cell-style"}break}case"year":{let o="";if(h&&(o=J(i[0],Z||0,"year")),!l){const m=h?o:i[0],[u,M]=U(m,"year",0,1),j=D(t,s,r),[,V]=U(i[1],"month",0,1);j.v=k?L(k,{startTime:u,endTime:M,rangeData:i,dayjs:y}):m,j.t=d.CellValueType.STRING,j.s="tor-time-cell-style";break}h?S=H(o,i[0],"year"):S=H(i[0],i[1],"year");for(let m=0;m<=Math.abs(S===0?1:S);m++){const u=m*(z+1),M=l==="right"?s:s+u,j=l==="right"?r+u:r,[V,B]=U(i[0],"year",m,p),w=D(t,M,j),O=E(i[0],"year",m,p);w.v=k?L(k,{startTime:V,endTime:B,rangeData:i,dayjs:y}):O,w.t=d.CellValueType.STRING,w.s="tor-time-cell-style"}break}case"hour":{if(!l){const o=D(t,s,r);if(o.t=d.CellValueType.STRING,o.s="tor-time-cell-style",g){o.v=y(i[0]).add(1,"hour").format("YYYY-MM-DD HH:mm:ss");break}o.v=y(b).add(1,"hour").format("YYYY-MM-DD HH:mm:ss");break}S=H(i[0],i[1],"hour");for(let o=0;o<=Math.abs(S===0?1:S);o++){const m=o*(z+1),u=l==="right"?s:s+m,M=l==="right"?r+m:r,j=D(t,u,M);if(j.t=d.CellValueType.STRING,j.s="tor-time-cell-style",g){const V=y(i[0]).add(1,"hour").format("YYYY-MM-DD HH:mm:ss");j.v=E(V,"hour",o,p);continue}j.v=E(y(b).add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),"hour",o,p)}break}case"shift":{if(!l){const o=D(t,s,r);o.t=d.CellValueType.STRING,o.s="tor-time-cell-style",o.v=k?L(k,{rangeData:i,dayjs:y}):i[0];break}if(!a.length)throw new Error("没有获取到当班数据");for(let o=0;o<a.length;o++){const m=a[o],{startDatetime:u,endDatetime:M}=m,j=o*(z+1),V=l==="right"?s:I(s).add(j).toNumber(),B=l==="right"?I(r).add(j).toNumber():r,w=D(t,V,B);w.s="tor-time-cell-style",w.v=k?L(k,{team:m}):u}break}}}async function We(t,n){if(!t)return Promise.reject("没有可用的单元格数据");const{extraArgs:s,rangeData:r}=n;if(!r.length)return Promise.reject("处理时间范围失败, rangeData不能为空");const c=s?.teamData||[],{periodicityTime:i}=n,b=n?.currentDay||y().format("YYYY-MM-DD"),C=(v,p,h)=>i?h!=="MACH_CYCLE"?[v,p]:parseInt(i.split(":")[0],10)<12?[y(v).format("YYYY-MM-DD")+" "+i,y(p).add(1,"day").format("YYYY-MM-DD")+" "+i]:[y(v).subtract(1,"day").format("YYYY-MM-DD")+" "+i,y(p).format("YYYY-MM-DD")+" "+i]:[v,p],a=Object.entries(t).reduce((v,p)=>{const[h,Z]=p;for(const[l,z]of Object.entries(Z)){const{custom:g}=z;if(!g)continue;const{cellType:k,cycleType:Q,timeIncrement:S,forwardPush:o,forwardPushTimes:m,copyType:u,copyInterval:M,defaultShift:j,useDefaultStartDate:V,useDefaultEndDate:B}=g;if(k==="time"){Le({acc:v,params:n,initRowNum:Number(h),initColNum:Number(l),cellData:z});continue}const w={cycleType:Q,indicatorName:g.indicatorName,indicatorCode:g.indicatorCode,indicatorId:g.indicatorId,indicatorDimensionName:g.indicatorDimensionName,indicatorDimensionConfig:g.indicatorDimensionConfig,required:Be(g?.required)??!1,cellType:g.cellType,defaultShift:g?.defaultShift||!1,writeBack:F(g?.writeBack)?!0:g.writeBack,dimensionJson:g?.dimensionJson||"",unit:g?.unit||"",innerSyncWay:g?.innerSyncWay||"",outSyncConfigId:g?.outSyncConfigId||"",innerSyncStatus:g?.innerSyncStatus||""};let O=0;switch(Q){case"day":{let f="";if(o&&(f=J(r[0],m||0,"day")),!u){const P=o?f:r[0],[N,Y]=C(...U(P,"day",0,1),g?.innerSyncWay),T=D(v,h,l);T.s="tor-indicator-cell-style",T.custom={...w,startTime:N,endTime:Y};break}o?O=H(f,r[0],"day"):O=H(r[0],r[1],"day");for(let P=0;P<=Math.abs(O===0?1:O);P++){const N=P*(M+1),Y=o?f:r[0],[T,R]=C(...U(Y,"day",P,S),g?.innerSyncWay),q=u==="right"?h:I(h).add(N).toNumber(),$=u==="right"?I(l).add(N).toNumber():l,A=D(v,q,$);A.s="tor-indicator-cell-style",A.custom={...w,startTime:T,endTime:R}}break}case"month":{if(!u){const[f,P]=C(...U(r[1],"month",0,1),g?.innerSyncWay),N=D(v,h,l);N.s="tor-indicator-cell-style",N.custom={...w,startTime:f,endTime:P};break}O=H(r[0],r[1],"month");for(let f=0;f<=Math.abs(O===0?1:O);f++){const P=f*(M+1),N=u==="right"?h:I(h).add(P).toNumber(),Y=u==="right"?I(l).add(P).toNumber():l,[T,R]=C(...U(r[0],"month",f,S),g?.innerSyncWay),q=D(v,N,Y);q.s="tor-indicator-cell-style",q.custom={...w,startTime:T,endTime:R}}break}case"year":{let f="",P="",N="";if(o){f=J(r[0],m||0,"year");const Y=y(r[1]).format("MM");P=y(`${f}-${Y+1}`).format("YYYY-MM"),N=y(`${f}-${Y+2}`).format("YYYY-MM")}if(!u){const Y=o?f:r[0],[T,R]=C(...U(Y,"year",0,1),g?.innerSyncWay),q=D(v,h,l);q.s="tor-indicator-cell-style";const[,$]=U(P,"month",0,1),[A]=U(N,"month",0,1);q.custom={...w,startTime:V?A:T,endTime:B?$:R};break}o?O=H(f,r[0],"year"):O=H(r[0],r[1],"year");for(let Y=0;Y<=Math.abs(O===0?1:O);Y++){const T=Y*(M+1),R=u==="right"?h:I(h).add(T).toNumber(),q=u==="right"?I(l).add(T).toNumber():l,[$,A]=C(...U(r[0],"year",Y,S),g?.innerSyncWay),K=D(v,R,q);K.s="tor-indicator-cell-style",K.custom={...w,startTime:$,endTime:A}}break}case"hour":{if(!u){const f=j?r[0]:r[0]??b,[P,N]=U(f,"hour",1,1),Y=D(v,h,l);Y.s="tor-indicator-cell-style",Y.custom={...w,startTime:P,endTime:N};break}O=H(r[0],r[1],"hour");for(let f=0;f<=Math.abs(O===0?1:O);f++){const P=f*(M+1),N=u==="right"?h:I(h).add(P).toNumber(),Y=u==="right"?I(l).add(P).toNumber():l,T=D(v,N,Y);if(T.s="tor-indicator-cell-style",j){const A=y(r[0]).add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),[K,Xe]=U(A,"hour",f,S);T.custom={...w,startTime:K,endTime:Xe};continue}const R=y(b).add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),[q,$]=U(R,"hour",f,S);T.custom={...w,startTime:q,endTime:$}}break}case"shift":{if(!u){const[f,P]=r,N=D(v,h,l);N.s="tor-indicator-cell-style",N.custom={...w,startTime:f,endTime:P};break}if(!c.length)throw new Error("没有获取到当班数据");for(let f=0;f<c.length;f++){const P=c[f],{startDatetime:N,endDatetime:Y}=P,T=f*(M+1),R=u==="right"?h:I(h).add(T).toNumber(),q=u==="right"?I(l).add(T).toNumber():l,$=D(v,R,q);$.s="tor-indicator-cell-style",$.custom={...w,startTime:N,endTime:Y}}break}}}return v},{});return Promise.resolve(a)}function Je(t){return Object.entries(t).reduce((s,[r,c])=>{const i=Math.max(...Object.keys(c).map(Number));return i>s?s=Number(i):s=Number(s)||0,s},0)}function Ke(t,n){const s=JSON.parse(JSON.stringify(t||{}));for(const[r,c]of Object.entries(n)){s[r]||(s[r]={});for(const[i,b]of Object.entries(c)){const C=b??{},a=s[r]?.[i];if(a){const v={...a,...C,custom:{...a.custom,...C.custom},v:C.v||""};s[r][i]=v}else s[r][i]=C}}return s}function _e(t,n){if(!n?.length||!t)return t;const s={};for(const r in t){const c=t[r];for(const i in c){const b=c[i];if(b?.custom?.cellType==="indicator"){const C=Number(r),a=Number(i);if(n.some(p=>C>=p.startRow&&C<=p.endRow&&a>=p.startColumn&&a<=p.endColumn)&&!n.some(h=>C===h.startRow&&a===h.startColumn))continue}s[r]||(s[r]={}),s[r][i]=b}}return s}const Qe="./style.css";Object.defineProperty(e,"CommandType",{enumerable:!0,get:()=>d.CommandType}),Object.defineProperty(e,"FEventName",{enumerable:!0,get:()=>d.FEventName}),Object.defineProperty(e,"FUniver",{enumerable:!0,get:()=>d.FUniver}),Object.defineProperty(e,"ICommandService",{enumerable:!0,get:()=>d.ICommandService}),Object.defineProperty(e,"IUniverInstanceService",{enumerable:!0,get:()=>d.IUniverInstanceService}),Object.defineProperty(e,"Inject",{enumerable:!0,get:()=>d.Inject}),Object.defineProperty(e,"Injector",{enumerable:!0,get:()=>d.Injector}),Object.defineProperty(e,"LocaleType",{enumerable:!0,get:()=>d.LocaleType}),Object.defineProperty(e,"Plugin",{enumerable:!0,get:()=>d.Plugin}),Object.defineProperty(e,"Univer",{enumerable:!0,get:()=>d.Univer}),Object.defineProperty(e,"UniverInstanceType",{enumerable:!0,get:()=>d.UniverInstanceType}),Object.defineProperty(e,"Workbook",{enumerable:!0,get:()=>d.Workbook}),Object.defineProperty(e,"createUniver",{enumerable:!0,get:()=>d.createUniver}),Object.defineProperty(e,"defaultTheme",{enumerable:!0,get:()=>d.defaultTheme}),Object.defineProperty(e,"greenTheme",{enumerable:!0,get:()=>d.greenTheme}),Object.defineProperty(e,"merge",{enumerable:!0,get:()=>d.merge}),Object.defineProperty(e,"mergeLocales",{enumerable:!0,get:()=>d.mergeLocales}),Object.defineProperty(e,"touchDependencies",{enumerable:!0,get:()=>d.touchDependencies}),Object.defineProperty(e,"BaselineOffset",{enumerable:!0,get:()=>X.BaselineOffset}),Object.defineProperty(e,"CommandService",{enumerable:!0,get:()=>X.CommandService}),Object.defineProperty(e,"SetRangeValuesCommand",{enumerable:!0,get:()=>ne.SetRangeValuesCommand}),Object.defineProperty(e,"ComponentManager",{enumerable:!0,get:()=>G.ComponentManager}),Object.defineProperty(e,"ContextMenuGroup",{enumerable:!0,get:()=>G.ContextMenuGroup}),Object.defineProperty(e,"ContextMenuPosition",{enumerable:!0,get:()=>G.ContextMenuPosition}),Object.defineProperty(e,"IMenuManagerService",{enumerable:!0,get:()=>G.IMenuManagerService}),Object.defineProperty(e,"MenuItemType",{enumerable:!0,get:()=>G.MenuItemType}),Object.defineProperty(e,"RibbonStartGroup",{enumerable:!0,get:()=>G.RibbonStartGroup}),Object.defineProperty(e,"UniverVue3AdapterPlugin",{enumerable:!0,get:()=>se.UniverVue3AdapterPlugin}),Object.defineProperty(e,"UniverLicensePlugin",{enumerable:!0,get:()=>ie.UniverLicensePlugin}),Object.defineProperty(e,"UniverSheetsConditionalFormattingPreset",{enumerable:!0,get:()=>oe.UniverSheetsConditionalFormattingPreset}),Object.defineProperty(e,"UniverSheetsCorePreset",{enumerable:!0,get:()=>ae.UniverSheetsCorePreset}),Object.defineProperty(e,"UniverSheetsDataValidationPreset",{enumerable:!0,get:()=>ue.UniverSheetsDataValidationPreset}),Object.defineProperty(e,"UniverSheetsDrawingPreset",{enumerable:!0,get:()=>ce.UniverSheetsDrawingPreset}),Object.defineProperty(e,"UniverSheetsFilterPreset",{enumerable:!0,get:()=>le.UniverSheetsFilterPreset}),Object.defineProperty(e,"UniverSheetsHyperLinkPreset",{enumerable:!0,get:()=>he.UniverSheetsHyperLinkPreset}),Object.defineProperty(e,"UniverSheetsNotePreset",{enumerable:!0,get:()=>me.UniverSheetsNotePreset}),Object.defineProperty(e,"UniverSheetsSortPreset",{enumerable:!0,get:()=>fe.UniverSheetsSortPreset}),Object.defineProperty(e,"UniverSheetsFindReplacePreset",{enumerable:!0,get:()=>de.UniverSheetsFindReplacePreset}),Object.defineProperty(e,"UniverSheetsThreadCommentPreset",{enumerable:!0,get:()=>ye.UniverSheetsThreadCommentPreset}),Object.defineProperty(e,"UniverSheetsTablePreset",{enumerable:!0,get:()=>ve.UniverSheetsTablePreset}),Object.defineProperty(e,"UniverWatermarkPlugin",{enumerable:!0,get:()=>be.UniverWatermarkPlugin}),Object.defineProperty(e,"UniverSheetsCrosshairHighlightPlugin",{enumerable:!0,get:()=>ge.UniverSheetsCrosshairHighlightPlugin}),Object.defineProperty(e,"UniverSheetsAdvancedPreset",{enumerable:!0,get:()=>Ce.UniverSheetsAdvancedPreset}),e.UniverPresetSheetsAdvancedZhCN=pe,e.zhCN=Pe,e.sheetsConditionalFormattingZhCN=je,e.sheetsCoreZhCN=Ye,e.UniverPresetSheetsDrawingZhCN=De,e.sheetsFilterZhCN=Se,e.UniverPresetSheetsHyperLinkZhCN=Ne,e.UniverPresetSheetsNoteZhCN=Me,e.UniverPresetSheetsFilterZhCN=we,e.UniverPresetSheetsSortZhCN=Te,e.UniverPresetSheetsDataValidationZhCN=Oe,e.UniverPresetSheetsFindReplaceZhCN=Ue,e.UniverPresetSheetsThreadCommentZhCN=ke,e.UniverPresetSheetsTableZhCN=Ie,e.CycleTypeEnum=te,e.ModeEnum=re,e.decimal=I,e.filterIndicatorsCell=Ge,e.filterMergedIndicatorCells=_e,e.generateIndicatorsCells=We,e.generateUUID=x,e.getNumColumns=Je,e.handleClearInput=ze,e.initDateRange=Ze,e.mergeCellData=Ke,e.stylePath=Qe,e.useData=qe,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
@@ -41,6 +41,7 @@ import { touchDependencies } from '@univerjs/presets';
41
41
  import { Univer } from '@univerjs/presets';
42
42
  import { UniverInstanceType } from '@univerjs/presets';
43
43
  import { UniverLicensePlugin } from '@univerjs-pro/license';
44
+ import { default as UniverPresetSheetsAdvancedZhCN } from '@univerjs/preset-sheets-advanced/locales/zh-CN';
44
45
  import { default as UniverPresetSheetsDataValidationZhCN } from '@univerjs/preset-sheets-data-validation/locales/zh-CN';
45
46
  import { default as UniverPresetSheetsDrawingZhCN } from '@univerjs/preset-sheets-drawing/locales/zh-CN';
46
47
  import { default as UniverPresetSheetsFilterZhCN } from '@univerjs/presets/preset-sheets-filter/locales/zh-CN';
@@ -50,6 +51,7 @@ import { default as UniverPresetSheetsNoteZhCN } from '@univerjs/preset-sheets-n
50
51
  import { default as UniverPresetSheetsSortZhCN } from '@univerjs/preset-sheets-sort/locales/zh-CN';
51
52
  import { default as UniverPresetSheetsTableZhCN } from '@univerjs/preset-sheets-table/locales/zh-CN';
52
53
  import { default as UniverPresetSheetsThreadCommentZhCN } from '@univerjs/preset-sheets-thread-comment/locales/zh-CN';
54
+ import { UniverSheetsAdvancedPreset } from '@univerjs/preset-sheets-advanced';
53
55
  import { UniverSheetsConditionalFormattingPreset } from '@univerjs/preset-sheets-conditional-formatting';
54
56
  import { UniverSheetsCorePreset } from '@univerjs/presets/preset-sheets-core';
55
57
  import { UniverSheetsCrosshairHighlightPlugin } from '@univerjs/sheets-crosshair-highlight';
@@ -274,6 +276,8 @@ export { UniverInstanceType }
274
276
 
275
277
  export { UniverLicensePlugin }
276
278
 
279
+ export { UniverPresetSheetsAdvancedZhCN }
280
+
277
281
  export { UniverPresetSheetsDataValidationZhCN }
278
282
 
279
283
  export { UniverPresetSheetsDrawingZhCN }
@@ -292,6 +296,8 @@ export { UniverPresetSheetsTableZhCN }
292
296
 
293
297
  export { UniverPresetSheetsThreadCommentZhCN }
294
298
 
299
+ export { UniverSheetsAdvancedPreset }
300
+
295
301
  export { UniverSheetsConditionalFormattingPreset }
296
302
 
297
303
  export { UniverSheetsCorePreset }
@@ -99,3 +99,6 @@
99
99
  .hover\:univer-ring-primary-600:hover {
100
100
  --univer-tw-ring-color: var(--univer-primary-600);
101
101
  }
102
+
103
+ /* === node_modules/@univerjs/preset-sheets-advanced/lib/index.css === */
104
+ .univer-fixed{position:fixed}.univer-bottom-12{bottom:3rem}.univer-right-3{right:.75rem}.univer-m-0{margin:0}.univer-ml-1\.5{margin-left:.375rem}.univer-h-1\.5{height:.375rem}.univer-max-h-72{max-height:18rem}.univer-w-\[324px\]{width:324px}.univer-w-\[372px\]{width:372px}.univer-w-\[calc\(100\%-48px\)\]{width:calc(100% - 48px)}.univer-select-none{user-select:none}.univer-list-none{list-style-type:none}.univer-border-0{border-width:0}.univer-py-0{padding-top:0;padding-bottom:0}.univer-pl-1\.5{padding-left:.375rem}.univer-pl-2{padding-left:.5rem}.univer-pr-2{padding-right:.5rem}.univer-pr-4{padding-right:1rem}.univer-pt-5{padding-top:1.25rem}.univer-text-blue-500{color:var(--univer-blue-500)}.univer-text-green-500{color:var(--univer-green-500)}.univer-no-underline{text-decoration-line:none}.univer-outline-none{outline-offset:2px;outline:2px solid #0000}.univer-transition-\[width\]{transition-property:width;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-duration-150{transition-duration:.15s}.univer-duration-500{transition-duration:.5s}.hover\:univer-bg-primary-50:hover{background-color:var(--univer-primary-50)}.dark\:hover\:\!univer-bg-gray-600:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)!important}.univer-mx-1\.5{margin-left:.375rem;margin-right:.375rem}.univer-mt-0{margin-top:0}.univer-h-40{height:10rem}.univer-h-\[140px\]{height:140px}.univer-h-\[161px\]{height:161px}.univer-h-\[300px\]{height:300px}.univer-h-\[calc\(100\%-16px\)\]{height:calc(100% - 16px)}.univer-min-h-\[150px\]{min-height:150px}.univer-min-h-\[200px\]{min-height:200px}.univer-w-24{width:6rem}.univer-w-36{width:9rem}.univer-w-4{width:1rem}.univer-w-\[140px\]{width:140px}.univer-w-\[14px\]{width:14px}.univer-min-w-0{min-width:0}.univer-max-w-\[200px\]{max-width:200px}.univer-max-w-\[66px\]{max-width:66px}.univer-flex-shrink{flex-shrink:1}.univer-self-stretch{align-self:stretch}.univer-overflow-x-hidden{overflow-x:hidden}.univer-rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.univer-rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.univer-border-none{border-style:none}.univer-border-primary-600{border-color:var(--univer-primary-600)}.univer-border-transparent{border-color:#0000}.univer-py-\[5px\]{padding-top:5px;padding-bottom:5px}.univer-pl-\[22px\]{padding-left:22px}.univer-text-justify{text-align:justify}.univer-align-top{vertical-align:top}.univer-capitalize{text-transform:capitalize}.univer-text-\[rgb\(var\(--hyacinth-500\)\)\]{color:rgb(var(--hyacinth-500))}.univer-text-gray-400{color:var(--univer-gray-400)}.univer-text-red-400{color:var(--univer-red-400)}.univer-opacity-0{opacity:0}.univer-opacity-100{opacity:1}.univer-transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-transition-opacity{transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-group:hover .group-hover\:univer-opacity-100{opacity:1}.dark\:\!univer-text-gray-500:where(.univer-dark,.univer-dark *){color:var(--univer-gray-500)!important}.dark\:\!univer-text-gray-600:where(.univer-dark,.univer-dark *){color:var(--univer-gray-600)!important}.univer-inset-0{top:0;bottom:0;left:0;right:0}.univer-bottom-4{bottom:1rem}.univer-right-4{right:1rem}.univer-z-\[1000\]{z-index:1000}.univer-z-\[1010\]{z-index:1010}.univer-mx-2{margin-left:.5rem;margin-right:.5rem}.univer-my-0{margin-top:0;margin-bottom:0}.univer-my-1{margin-top:.25rem;margin-bottom:.25rem}.univer-my-5{margin-top:1.25rem;margin-bottom:1.25rem}.univer-mt-7{margin-top:1.75rem}.univer-size-3{width:.75rem;height:.75rem}.univer-size-8{width:2rem;height:2rem}.univer-h-16{height:4rem}.univer-h-\[200px\]{height:200px}.univer-w-\[312px\]{width:312px}.univer-min-w-36{min-width:9rem}.univer-min-w-\[200px\]{min-width:200px}.univer-flex-none{flex:none}.univer-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.univer-space-y-2>:not([hidden])~:not([hidden]){--univer-tw-space-y-reverse: 0;margin-top:calc(.5rem * (1 - var(--univer-tw-space-y-reverse)));margin-top:.5rem;margin-top:calc(.5rem * calc(1 - var(--univer-tw-space-y-reverse)));margin-bottom:0;margin-bottom:calc(.5rem * var(--univer-tw-space-y-reverse))}.univer-overflow-y-auto{overflow-y:auto}.univer-border-t{border-top-width:1px}.univer-px-2\.5{padding-left:.625rem;padding-right:.625rem}.univer-px-6{padding-left:1.5rem;padding-right:1.5rem}.univer-py-2{padding-top:.5rem;padding-bottom:.5rem}.univer-py-7{padding-top:1.75rem;padding-bottom:1.75rem}.univer-text-lg{font-size:1.125rem;line-height:1.75rem}.univer-shadow-lg{--univer-tw-shadow: 0px 4px 6px 0px #1e284d0d, 0px 10px 15px -3px #1e284d1a;--univer-tw-shadow-colored: 0px 4px 6px 0px var(--univer-tw-shadow-color), 0px 10px 15px -3px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--univer-tw-ring-offset-shadow, 0 0 #0000),var(--univer-tw-ring-shadow, 0 0 #0000),var(--univer-tw-shadow)}.first\:univer-mr-2:first-child{margin-right:.5rem}.hover\:univer-rounded:hover{border-radius:.25rem}.hover\:univer-bg-gray-300:hover{background-color:var(--univer-gray-300)}.hover\:dark\:\!univer-bg-gray-700:where(.univer-dark,.univer-dark *):hover{background-color:var(--univer-gray-700)!important}.univer-right-2{right:.5rem}.univer-top-2{top:.5rem}.univer-ml-1{margin-left:.25rem}.univer-mt-1\.5{margin-top:.375rem}.univer-mt-2\.5{margin-top:.625rem}.univer-mt-4{margin-top:1rem}.univer-mt-5{margin-top:1.25rem}.univer-inline-flex{display:inline-flex}.univer-size-6{width:1.5rem;height:1.5rem}.univer-h-\[26px\]{height:26px}.univer-w-\[--radix-popper-anchor-width\]{width:var(--radix-popper-anchor-width)}.univer-w-\[136px\]{width:136px}.univer-w-\[208px\]{width:208px}.univer-w-\[290px\]{width:290px}.univer-w-fit{width:fit-content}.\!univer-min-w-0{min-width:0!important}.univer-flex-grow{flex-grow:1}.univer-grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.univer-flex-row{flex-direction:row}.univer-gap-2\.5{gap:.625rem}.univer-justify-self-end{justify-self:end}.univer-rounded-xl{border-radius:.75rem}.univer-p-1\.5{padding:.375rem}.univer-p-2{padding:.5rem}.univer-px-1{padding-left:.25rem;padding-right:.25rem}.univer-px-1\.5{padding-left:.375rem;padding-right:.375rem}.univer-py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.univer-pb-3{padding-bottom:.75rem}.univer-text-2xl{font-size:1.5rem;line-height:2rem}.univer-text-base{font-size:1rem;line-height:1.5rem}.univer-leading-4{line-height:1rem}.univer-leading-5{line-height:1.25rem}.univer-leading-6{line-height:1.5rem}.univer-shadow{--univer-tw-shadow: 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--univer-tw-shadow-colored: 0 1px 3px 0 var(--univer-tw-shadow-color), 0 1px 2px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--univer-tw-ring-offset-shadow, 0 0 #0000),var(--univer-tw-ring-shadow, 0 0 #0000),var(--univer-tw-shadow)}.univer-duration-200{transition-duration:.2s}.placeholder\:univer-text-gray-400::placeholder{color:var(--univer-gray-400)}.focus\:univer-border-primary-500:focus{border-color:var(--univer-primary-500)}.focus\:univer-outline-none:focus{outline-offset:2px;outline:2px solid #0000}.focus\:univer-ring-2:focus{--univer-tw-ring-offset-shadow: var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow: var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow, 0 0 #0000)}.focus\:univer-ring-primary-50:focus{--univer-tw-ring-color: var(--univer-primary-50)}.dark\:\!univer-border-gray-700:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-700)!important}.dark\:\!univer-shadow-none:where(.univer-dark,.univer-dark *){--univer-tw-shadow: 0 0 #0000 !important;--univer-tw-shadow-colored: 0 0 #0000 !important;box-shadow:0 0 #0000,0 0 #0000,0 0 #0000!important;box-shadow:var(--univer-tw-ring-offset-shadow, 0 0 #0000),var(--univer-tw-ring-shadow, 0 0 #0000),var(--univer-tw-shadow)!important}.univer-bottom-0{bottom:0}.univer-mx-0{margin-left:0;margin-right:0}.univer-my-2{margin-top:.5rem;margin-bottom:.5rem}.univer-my-4{margin-top:1rem;margin-bottom:1rem}.univer-mb-3{margin-bottom:.75rem}.univer-mb-4{margin-bottom:1rem}.univer-mb-5{margin-bottom:1.25rem}.univer-ml-2{margin-left:.5rem}.univer-ml-3{margin-left:.75rem}.univer-mr-0\.5{margin-right:.125rem}.univer-mr-2{margin-right:.5rem}.univer-mt-0\.5{margin-top:.125rem}.univer-mt-3{margin-top:.75rem}.univer-box-content{box-sizing:content-box}.univer-size-4{width:1rem;height:1rem}.univer-size-5{width:1.25rem;height:1.25rem}.univer-h-0\.5{height:.125rem}.univer-h-10{height:2.5rem}.univer-h-4{height:1rem}.univer-h-5{height:1.25rem}.univer-h-6{height:1.5rem}.univer-h-7{height:1.75rem}.univer-h-8{height:2rem}.univer-h-full{height:100%}.univer-w-14{width:3.5rem}.univer-w-6{width:1.5rem}.univer-w-\[45\%\]{width:45%}.univer-max-w-\[290px\]{max-width:290px}.univer-cursor-not-allowed{cursor:not-allowed}.univer-justify-end{justify-content:flex-end}.univer-justify-around{justify-content:space-around}.univer-gap-5{gap:1.25rem}.univer-truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.univer-rounded-sm{border-radius:.125rem}.\!univer-bg-gray-50{background-color:var(--univer-gray-50)!important}.\!univer-bg-gray-700{background-color:var(--univer-gray-700)!important}.univer-bg-blue-200{background-color:var(--univer-blue-200)}.univer-bg-gray-50{background-color:var(--univer-gray-50)}.univer-p-0{padding:0}.univer-p-0\.5{padding:.125rem}.univer-p-4{padding:1rem}.univer-px-0{padding-left:0;padding-right:0}.univer-py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.univer-pb-4{padding-bottom:1rem}.univer-pl-4{padding-left:1rem}.univer-pr-1{padding-right:.25rem}.univer-pt-2\.5{padding-top:.625rem}.univer-leading-7{line-height:1.75rem}.univer-leading-8{line-height:2rem}.univer-leading-tight{line-height:1.25}.univer-text-gray-200{color:var(--univer-gray-200)}.univer-text-gray-800{color:var(--univer-gray-800)}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-red-500{color:var(--univer-red-500)}.univer-text-white{color:var(--univer-white)}.univer-duration-300{transition-duration:.3s}.univer-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-scrollbar-corner-primary-600{--scrollbar-corner: var(--univer-primary-600) !important}.dark\:\!univer-bg-gray-700:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.dark\:\!univer-bg-gray-900:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)!important}.dark\:\!univer-text-gray-100:where(.univer-dark,.univer-dark *){color:var(--univer-gray-100)!important}.dark\:\!univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}.univer-pointer-events-none{pointer-events:none}.univer-absolute{position:absolute}.univer-relative{position:relative}.univer-bottom-full{bottom:100%}.univer-left-0{left:0}.univer-z-\[100\]{z-index:100}.univer-mx-auto{margin-left:auto;margin-right:auto}.univer-mb-1{margin-bottom:.25rem}.univer-mb-2{margin-bottom:.5rem}.univer-mr-5{margin-right:1.25rem}.univer-mt-2{margin-top:.5rem}.univer-box-border{box-sizing:border-box}.univer-block{display:block}.univer-inline-block{display:inline-block}.univer-flex{display:flex}.univer-grid{display:grid}.univer-hidden{display:none}.univer-aspect-square{aspect-ratio:1}.univer-size-full{width:100%;height:100%}.univer-h-1{height:.25rem}.univer-h-\[100px\]{height:100px}.univer-max-h-\[75vh\]{max-height:75vh}.univer-w-1\/2{width:50%}.univer-w-20{width:5rem}.univer-w-28{width:7rem}.univer-w-\[100px\]{width:100px}.univer-w-\[320px\]{width:320px}.univer-w-full{width:100%}.univer-flex-1{flex:1}.univer-shrink-0{flex-shrink:0}.univer-rotate-180{--univer-tw-rotate: 180deg;transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(180deg) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-cursor-default{cursor:default}.univer-cursor-pointer{cursor:pointer}.univer-appearance-none{-webkit-appearance:none;appearance:none}.univer-grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.univer-flex-col{flex-direction:column}.univer-items-center{align-items:center}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-gap-1{gap:.25rem}.univer-gap-1\.5{gap:.375rem}.univer-gap-2{gap:.5rem}.univer-gap-3{gap:.75rem}.univer-gap-4{gap:1rem}.univer-overflow-auto{overflow:auto}.univer-overflow-hidden{overflow:hidden}.univer-overflow-visible{overflow:visible}.univer-rounded{border-radius:.25rem}.univer-rounded-full{border-radius:9999px}.univer-rounded-lg{border-radius:.5rem}.univer-rounded-md{border-radius:.375rem}.univer-border{border-width:1px}.univer-border-b{border-bottom-width:1px}.univer-border-l-2{border-left-width:2px}.univer-border-solid{border-style:solid}.univer-border-gray-200{border-color:var(--univer-gray-200)}.univer-border-l-gray-200{border-left-color:var(--univer-gray-200)}.univer-bg-gray-100{background-color:var(--univer-gray-100)}.univer-bg-gray-200{background-color:var(--univer-gray-200)}.univer-bg-primary-600{background-color:var(--univer-primary-600)}.univer-bg-transparent{background-color:#0000}.univer-bg-white{background-color:var(--univer-white)}.univer-object-cover{-o-object-fit:cover;object-fit:cover}.univer-p-1{padding:.25rem}.univer-p-3{padding:.75rem}.univer-px-2{padding-left:.5rem;padding-right:.5rem}.univer-px-3{padding-left:.75rem;padding-right:.75rem}.univer-px-4{padding-left:1rem;padding-right:1rem}.univer-py-1{padding-top:.25rem;padding-bottom:.25rem}.univer-py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.univer-py-4{padding-top:1rem;padding-bottom:1rem}.univer-pb-2{padding-bottom:.5rem}.univer-pb-2\.5{padding-bottom:.625rem}.univer-pl-3{padding-left:.75rem}.univer-pt-2{padding-top:.5rem}.univer-text-center{text-align:center}.univer-text-sm{font-size:.875rem;line-height:1.25rem}.univer-text-xl{font-size:1.25rem;line-height:1.75rem}.univer-text-xs{font-size:.75rem;line-height:1rem}.univer-font-medium{font-weight:500}.univer-font-semibold{font-weight:600}.univer-text-gray-500{color:var(--univer-gray-500)}.univer-text-gray-600{color:var(--univer-gray-600)}.univer-text-gray-700{color:var(--univer-gray-700)}.univer-text-primary-600{color:var(--univer-primary-600)}.univer-shadow-md{--univer-tw-shadow: 0px 1px 6px -2px #1e284d14, 0px 2px 6px -1px #1e284d1a;--univer-tw-shadow-colored: 0px 1px 6px -2px var(--univer-tw-shadow-color), 0px 2px 6px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 6px -2px #1e284d14,0 2px 6px -1px #1e284d1a;box-shadow:var(--univer-tw-ring-offset-shadow, 0 0 #0000),var(--univer-tw-ring-shadow, 0 0 #0000),var(--univer-tw-shadow)}.univer-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-group:hover .group-hover\:univer-block{display:block}.hover\:univer-border-primary-600:hover{border-color:var(--univer-primary-600)}.hover\:univer-bg-gray-100:hover{background-color:var(--univer-gray-100)}.hover\:univer-bg-gray-200:hover{background-color:var(--univer-gray-200)}.disabled\:univer-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:univer-opacity-50:disabled{opacity:.5}.dark\:\!univer-border-gray-600:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)!important}.dark\:\!univer-border-l-gray-600:where(.univer-dark,.univer-dark *){border-left-color:var(--univer-gray-600)!important}.dark\:\!univer-bg-gray-600:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)!important}.dark\:\!univer-bg-gray-800:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-800)!important}.dark\:\!univer-text-gray-200:where(.univer-dark,.univer-dark *){color:var(--univer-gray-200)!important}.dark\:hover\:\!univer-bg-gray-700:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.\[\&\:\:-webkit-slider-thumb\]\:univer-size-3\.5::-webkit-slider-thumb{width:.875rem;height:.875rem}.\[\&\:\:-webkit-slider-thumb\]\:univer-appearance-none::-webkit-slider-thumb{-webkit-appearance:none;appearance:none}.\[\&\:\:-webkit-slider-thumb\]\:univer-rounded-full::-webkit-slider-thumb{border-radius:9999px}.\[\&\:\:-webkit-slider-thumb\]\:univer-bg-primary-600::-webkit-slider-thumb{background-color:var(--univer-primary-600)}.\[\&\:\:-webkit-slider-thumb\]\:univer-shadow-sm::-webkit-slider-thumb{--univer-tw-shadow: 0px 1px 2px 0px #1e284d14;--univer-tw-shadow-colored: 0px 1px 2px 0px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 2px #1e284d14;box-shadow:var(--univer-tw-ring-offset-shadow, 0 0 #0000),var(--univer-tw-ring-shadow, 0 0 #0000),var(--univer-tw-shadow)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tor-univer-sheet",
3
- "version": "1.2.8",
3
+ "version": "1.2.10",
4
4
  "style": "./dist/style.css",
5
5
  "description": "基于 Univer 的 Vue3 电子表格组件",
6
6
  "author": "tortormore",
@@ -45,6 +45,7 @@
45
45
  "@univerjs/preset-sheets-core": "^0.25.1",
46
46
  "@univerjs/preset-sheets-data-validation": "^0.25.1",
47
47
  "@univerjs/preset-sheets-drawing": "^0.25.1",
48
+ "@univerjs/preset-sheets-advanced": "^0.25.1",
48
49
  "@univerjs/preset-sheets-filter": "^0.25.1",
49
50
  "@univerjs/preset-sheets-find-replace": "^0.25.1",
50
51
  "@univerjs/preset-sheets-hyper-link": "^0.25.1",