@univerjs/sheets-conditional-formatting-ui 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +111 -115
- package/lib/cjs/locale/ar-SA.js +159 -0
- package/lib/cjs/locale/ca-ES.js +4 -3
- package/lib/cjs/locale/de-DE.js +159 -0
- package/lib/cjs/locale/en-US.js +4 -3
- package/lib/cjs/locale/es-ES.js +4 -3
- package/lib/cjs/locale/fa-IR.js +4 -3
- package/lib/cjs/locale/fr-FR.js +4 -3
- package/lib/cjs/locale/id-ID.js +159 -0
- package/lib/cjs/locale/it-IT.js +159 -0
- package/lib/cjs/locale/ja-JP.js +4 -3
- package/lib/cjs/locale/ko-KR.js +4 -3
- package/lib/cjs/locale/pl-PL.js +159 -0
- package/lib/cjs/locale/pt-BR.js +159 -0
- package/lib/cjs/locale/ru-RU.js +4 -3
- package/lib/cjs/locale/sk-SK.js +4 -3
- package/lib/cjs/locale/vi-VN.js +4 -3
- package/lib/cjs/locale/zh-CN.js +4 -3
- package/lib/cjs/locale/zh-HK.js +159 -0
- package/lib/cjs/locale/zh-TW.js +4 -3
- package/lib/es/index.js +111 -115
- package/lib/es/locale/ar-SA.js +158 -0
- package/lib/es/locale/ca-ES.js +4 -3
- package/lib/es/locale/de-DE.js +158 -0
- package/lib/es/locale/en-US.js +4 -3
- package/lib/es/locale/es-ES.js +4 -3
- package/lib/es/locale/fa-IR.js +4 -3
- package/lib/es/locale/fr-FR.js +4 -3
- package/lib/es/locale/id-ID.js +158 -0
- package/lib/es/locale/it-IT.js +158 -0
- package/lib/es/locale/ja-JP.js +4 -3
- package/lib/es/locale/ko-KR.js +4 -3
- package/lib/es/locale/pl-PL.js +158 -0
- package/lib/es/locale/pt-BR.js +158 -0
- package/lib/es/locale/ru-RU.js +4 -3
- package/lib/es/locale/sk-SK.js +4 -3
- package/lib/es/locale/vi-VN.js +4 -3
- package/lib/es/locale/zh-CN.js +4 -3
- package/lib/es/locale/zh-HK.js +158 -0
- package/lib/es/locale/zh-TW.js +4 -3
- package/lib/index.js +111 -115
- package/lib/locale/ar-SA.js +158 -0
- package/lib/locale/ca-ES.js +4 -3
- package/lib/locale/de-DE.js +158 -0
- package/lib/locale/en-US.js +4 -3
- package/lib/locale/es-ES.js +4 -3
- package/lib/locale/fa-IR.js +4 -3
- package/lib/locale/fr-FR.js +4 -3
- package/lib/locale/id-ID.js +158 -0
- package/lib/locale/it-IT.js +158 -0
- package/lib/locale/ja-JP.js +4 -3
- package/lib/locale/ko-KR.js +4 -3
- package/lib/locale/pl-PL.js +158 -0
- package/lib/locale/pt-BR.js +158 -0
- package/lib/locale/ru-RU.js +4 -3
- package/lib/locale/sk-SK.js +4 -3
- package/lib/locale/vi-VN.js +4 -3
- package/lib/locale/zh-CN.js +4 -3
- package/lib/locale/zh-HK.js +158 -0
- package/lib/locale/zh-TW.js +4 -3
- package/lib/types/locale/ar-SA.d.ts +18 -0
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +130 -127
- package/lib/types/locale/id-ID.d.ts +18 -0
- package/lib/types/locale/it-IT.d.ts +18 -0
- package/lib/types/locale/pl-PL.d.ts +18 -0
- package/lib/types/locale/pt-BR.d.ts +18 -0
- package/lib/types/locale/zh-HK.d.ts +18 -0
- package/lib/umd/index.js +3 -3
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -0
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -0
- package/lib/umd/locale/it-IT.js +1 -0
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +14 -14
package/lib/cjs/index.js
CHANGED
|
@@ -468,7 +468,7 @@ const previewClassName = (0, _univerjs_design.clsx)("univer-mt-5 univer-px-1 uni
|
|
|
468
468
|
//#endregion
|
|
469
469
|
//#region src/components/panel/rule-edit/ColorScale.tsx
|
|
470
470
|
const createOptionItem$2 = (text, localeService) => ({
|
|
471
|
-
label: localeService.t(`
|
|
471
|
+
label: localeService.t(`sheets-conditional-formatting-ui.valueType.${text}`),
|
|
472
472
|
value: text
|
|
473
473
|
});
|
|
474
474
|
const TextInput$1 = (props) => {
|
|
@@ -661,7 +661,7 @@ const ColorScaleStyleEditor = (props) => {
|
|
|
661
661
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
662
662
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
663
663
|
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
664
|
-
children: localeService.t("
|
|
664
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.styleRule")
|
|
665
665
|
}),
|
|
666
666
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
667
667
|
className: previewClassName,
|
|
@@ -679,7 +679,7 @@ const ColorScaleStyleEditor = (props) => {
|
|
|
679
679
|
}),
|
|
680
680
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
681
681
|
className: "univer-mt-3 univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200",
|
|
682
|
-
children: localeService.t("
|
|
682
|
+
children: localeService.t("sheets-conditional-formatting-ui.valueType.min")
|
|
683
683
|
}),
|
|
684
684
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
685
685
|
className: "univer-mt-3 univer-flex univer-h-8 univer-items-center",
|
|
@@ -747,7 +747,7 @@ const ColorScaleStyleEditor = (props) => {
|
|
|
747
747
|
}),
|
|
748
748
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
749
749
|
className: "univer-mt-3 univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200",
|
|
750
|
-
children: localeService.t("
|
|
750
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.medianValue")
|
|
751
751
|
}),
|
|
752
752
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
753
753
|
className: "univer-mt-3 univer-flex univer-h-8 univer-items-center",
|
|
@@ -815,7 +815,7 @@ const ColorScaleStyleEditor = (props) => {
|
|
|
815
815
|
}),
|
|
816
816
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
817
817
|
className: "univer-mt-3 univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200",
|
|
818
|
-
children: localeService.t("
|
|
818
|
+
children: localeService.t("sheets-conditional-formatting-ui.valueType.max")
|
|
819
819
|
}),
|
|
820
820
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
821
821
|
className: "univer-mt-3 univer-flex univer-h-8 univer-items-center",
|
|
@@ -887,7 +887,7 @@ const ColorScaleStyleEditor = (props) => {
|
|
|
887
887
|
//#endregion
|
|
888
888
|
//#region src/components/panel/rule-edit/DataBar.tsx
|
|
889
889
|
const createOptionItem$1 = (text, localeService) => ({
|
|
890
|
-
label: localeService.t(`
|
|
890
|
+
label: localeService.t(`sheets-conditional-formatting-ui.valueType.${text}`),
|
|
891
891
|
value: text
|
|
892
892
|
});
|
|
893
893
|
const InputText = (props) => {
|
|
@@ -1081,7 +1081,7 @@ const DataBarStyleEditor = (props) => {
|
|
|
1081
1081
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
1082
1082
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1083
1083
|
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1084
|
-
children: localeService.t("
|
|
1084
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.styleRule")
|
|
1085
1085
|
}),
|
|
1086
1086
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1087
1087
|
className: previewClassName,
|
|
@@ -1098,7 +1098,7 @@ const DataBarStyleEditor = (props) => {
|
|
|
1098
1098
|
}),
|
|
1099
1099
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1100
1100
|
className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1101
|
-
children: localeService.t("
|
|
1101
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.fillType")
|
|
1102
1102
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1103
1103
|
className: "univer-ml-1 univer-mt-3 univer-flex univer-items-center",
|
|
1104
1104
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_univerjs_design.RadioGroup, {
|
|
@@ -1120,13 +1120,13 @@ const DataBarStyleEditor = (props) => {
|
|
|
1120
1120
|
value: "0",
|
|
1121
1121
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1122
1122
|
className: "univer-text-xs",
|
|
1123
|
-
children: localeService.t("
|
|
1123
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.pureColor")
|
|
1124
1124
|
})
|
|
1125
1125
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Radio, {
|
|
1126
1126
|
value: "1",
|
|
1127
1127
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1128
1128
|
className: "univer-text-xs",
|
|
1129
|
-
children: localeService.t("
|
|
1129
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.gradient")
|
|
1130
1130
|
})
|
|
1131
1131
|
})]
|
|
1132
1132
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1146,19 +1146,19 @@ const DataBarStyleEditor = (props) => {
|
|
|
1146
1146
|
isShowValue: !v
|
|
1147
1147
|
});
|
|
1148
1148
|
}
|
|
1149
|
-
}), localeService.t("
|
|
1149
|
+
}), localeService.t("sheets-conditional-formatting-ui.panel.onlyShowDataBar")]
|
|
1150
1150
|
})]
|
|
1151
1151
|
})] }),
|
|
1152
1152
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1153
1153
|
className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1154
|
-
children: localeService.t("
|
|
1154
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.colorSet")
|
|
1155
1155
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1156
1156
|
className: "univer-ml-1 univer-mt-3 univer-flex univer-items-center",
|
|
1157
1157
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1158
1158
|
className: "univer-flex univer-items-center",
|
|
1159
1159
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1160
1160
|
className: "univer-text-xs",
|
|
1161
|
-
children: localeService.t("
|
|
1161
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.native")
|
|
1162
1162
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ColorPicker, {
|
|
1163
1163
|
color: nativeColor,
|
|
1164
1164
|
onChange: handleNativeColorChange
|
|
@@ -1167,7 +1167,7 @@ const DataBarStyleEditor = (props) => {
|
|
|
1167
1167
|
className: "univer-ml-3 univer-flex univer-items-center",
|
|
1168
1168
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1169
1169
|
className: "univer-text-xs",
|
|
1170
|
-
children: localeService.t("
|
|
1170
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.positive")
|
|
1171
1171
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ColorPicker, {
|
|
1172
1172
|
color: positiveColor,
|
|
1173
1173
|
onChange: handlePositiveColorChange
|
|
@@ -1177,7 +1177,7 @@ const DataBarStyleEditor = (props) => {
|
|
|
1177
1177
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
1178
1178
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1179
1179
|
className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1180
|
-
children: localeService.t("
|
|
1180
|
+
children: localeService.t("sheets-conditional-formatting-ui.valueType.min")
|
|
1181
1181
|
}),
|
|
1182
1182
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1183
1183
|
className: "univer-mt-3 univer-flex univer-items-center",
|
|
@@ -1223,7 +1223,7 @@ const DataBarStyleEditor = (props) => {
|
|
|
1223
1223
|
}),
|
|
1224
1224
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1225
1225
|
className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1226
|
-
children: localeService.t("
|
|
1226
|
+
children: localeService.t("sheets-conditional-formatting-ui.valueType.max")
|
|
1227
1227
|
}),
|
|
1228
1228
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1229
1229
|
className: "univer-mt-3 univer-flex univer-items-center",
|
|
@@ -1280,23 +1280,19 @@ const getBooleanFromNumber = (v) => v !== _univerjs_core.BooleanNumber.FALSE;
|
|
|
1280
1280
|
const ConditionalStyleEditor = (props) => {
|
|
1281
1281
|
const { style, onChange, className } = props;
|
|
1282
1282
|
const [isBold, setIsBold] = (0, react.useState)(() => {
|
|
1283
|
-
|
|
1284
|
-
if (!(style === null || style === void 0 ? void 0 : style.bl)) return defaultV;
|
|
1283
|
+
if (!(style === null || style === void 0 ? void 0 : style.bl)) return;
|
|
1285
1284
|
return style.bl;
|
|
1286
1285
|
});
|
|
1287
1286
|
const [isItalic, setIsItalic] = (0, react.useState)(() => {
|
|
1288
|
-
|
|
1289
|
-
if (!(style === null || style === void 0 ? void 0 : style.it)) return defaultV;
|
|
1287
|
+
if (!(style === null || style === void 0 ? void 0 : style.it)) return;
|
|
1290
1288
|
return style.it;
|
|
1291
1289
|
});
|
|
1292
1290
|
const [isUnderline, setIsUnderline] = (0, react.useState)(() => {
|
|
1293
|
-
|
|
1294
|
-
if (!(style === null || style === void 0 ? void 0 : style.ul)) return defaultV;
|
|
1291
|
+
if (!(style === null || style === void 0 ? void 0 : style.ul)) return;
|
|
1295
1292
|
return style.ul.s;
|
|
1296
1293
|
});
|
|
1297
1294
|
const [isStrikethrough, setIsStrikethrough] = (0, react.useState)(() => {
|
|
1298
|
-
|
|
1299
|
-
if (!(style === null || style === void 0 ? void 0 : style.st)) return defaultV;
|
|
1295
|
+
if (!(style === null || style === void 0 ? void 0 : style.st)) return;
|
|
1300
1296
|
return style.st.s;
|
|
1301
1297
|
});
|
|
1302
1298
|
const [fontColor, setFontColor] = (0, react.useState)(() => {
|
|
@@ -1407,7 +1403,7 @@ const FormulaStyleEditor = (props) => {
|
|
|
1407
1403
|
(0, react.useEffect)(() => {
|
|
1408
1404
|
return interceptorManager.intercept(interceptorManager.getInterceptPoints().beforeSubmit, { handler: (v, _c, next) => {
|
|
1409
1405
|
if (formulaError || formula.length === 1 || !formula.startsWith("=")) {
|
|
1410
|
-
setFormulaError(localeService.t("
|
|
1406
|
+
setFormulaError(localeService.t("sheets-conditional-formatting-ui.errorMessage.formulaError"));
|
|
1411
1407
|
return false;
|
|
1412
1408
|
}
|
|
1413
1409
|
return next(v);
|
|
@@ -1425,7 +1421,7 @@ const FormulaStyleEditor = (props) => {
|
|
|
1425
1421
|
children: [
|
|
1426
1422
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1427
1423
|
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1428
|
-
children: localeService.t("
|
|
1424
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.styleRule")
|
|
1429
1425
|
}),
|
|
1430
1426
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1431
1427
|
className: "univer-mt-3",
|
|
@@ -1448,7 +1444,7 @@ const FormulaStyleEditor = (props) => {
|
|
|
1448
1444
|
});
|
|
1449
1445
|
},
|
|
1450
1446
|
onVerify: (result, formula) => {
|
|
1451
|
-
if (!result || formula.length === 1) setFormulaError(localeService.t("
|
|
1447
|
+
if (!result || formula.length === 1) setFormulaError(localeService.t("sheets-conditional-formatting-ui.errorMessage.formulaError"));
|
|
1452
1448
|
else setFormulaError(void 0);
|
|
1453
1449
|
}
|
|
1454
1450
|
})
|
|
@@ -1490,10 +1486,10 @@ const WrapperError = (props) => {
|
|
|
1490
1486
|
//#endregion
|
|
1491
1487
|
//#region src/components/panel/rule-edit/HighlightCell.tsx
|
|
1492
1488
|
const createOptionItem = (text, localeService) => ({
|
|
1493
|
-
label: localeService.t(`
|
|
1489
|
+
label: localeService.t(`sheets-conditional-formatting-ui.operator.${text}`),
|
|
1494
1490
|
value: text
|
|
1495
1491
|
});
|
|
1496
|
-
|
|
1492
|
+
function HighlightCellInput(props) {
|
|
1497
1493
|
const { type, operator, onChange, value, interceptorManager } = props;
|
|
1498
1494
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
1499
1495
|
const [inputNumberValue, setInputNumberValue] = (0, react.useState)(() => typeof value === "number" ? value : 0);
|
|
@@ -1541,7 +1537,7 @@ const HighlightCellInput = (props) => {
|
|
|
1541
1537
|
_univerjs_sheets_conditional_formatting.CFTextOperator.equal
|
|
1542
1538
|
].includes(operator)) {
|
|
1543
1539
|
if (!inputTextValue) {
|
|
1544
|
-
setTextError(localeService.t("
|
|
1540
|
+
setTextError(localeService.t("sheets-conditional-formatting-ui.errorMessage.notBlank"));
|
|
1545
1541
|
return false;
|
|
1546
1542
|
}
|
|
1547
1543
|
return next(v);
|
|
@@ -1650,7 +1646,7 @@ const HighlightCellInput = (props) => {
|
|
|
1650
1646
|
}
|
|
1651
1647
|
}
|
|
1652
1648
|
return null;
|
|
1653
|
-
}
|
|
1649
|
+
}
|
|
1654
1650
|
const getOperatorOptions = (type, localeService) => {
|
|
1655
1651
|
switch (type) {
|
|
1656
1652
|
case _univerjs_sheets_conditional_formatting.CFSubRuleType.text: return [
|
|
@@ -1702,23 +1698,23 @@ const HighlightCellStyleEditor = (props) => {
|
|
|
1702
1698
|
const typeOptions = [
|
|
1703
1699
|
{
|
|
1704
1700
|
value: _univerjs_sheets_conditional_formatting.CFSubRuleType.text,
|
|
1705
|
-
label: localeService.t("
|
|
1701
|
+
label: localeService.t("sheets-conditional-formatting-ui.subRuleType.text")
|
|
1706
1702
|
},
|
|
1707
1703
|
{
|
|
1708
1704
|
value: _univerjs_sheets_conditional_formatting.CFSubRuleType.number,
|
|
1709
|
-
label: localeService.t("
|
|
1705
|
+
label: localeService.t("sheets-conditional-formatting-ui.subRuleType.number")
|
|
1710
1706
|
},
|
|
1711
1707
|
{
|
|
1712
1708
|
value: _univerjs_sheets_conditional_formatting.CFSubRuleType.timePeriod,
|
|
1713
|
-
label: localeService.t("
|
|
1709
|
+
label: localeService.t("sheets-conditional-formatting-ui.subRuleType.timePeriod")
|
|
1714
1710
|
},
|
|
1715
1711
|
{
|
|
1716
1712
|
value: _univerjs_sheets_conditional_formatting.CFSubRuleType.duplicateValues,
|
|
1717
|
-
label: localeService.t("
|
|
1713
|
+
label: localeService.t("sheets-conditional-formatting-ui.subRuleType.duplicateValues")
|
|
1718
1714
|
},
|
|
1719
1715
|
{
|
|
1720
1716
|
value: _univerjs_sheets_conditional_formatting.CFSubRuleType.uniqueValues,
|
|
1721
|
-
label: localeService.t("
|
|
1717
|
+
label: localeService.t("sheets-conditional-formatting-ui.subRuleType.uniqueValues")
|
|
1722
1718
|
}
|
|
1723
1719
|
];
|
|
1724
1720
|
const operatorOptions = (0, react.useMemo)(() => getOperatorOptions(subType, localeService), [subType]);
|
|
@@ -1833,7 +1829,7 @@ const HighlightCellStyleEditor = (props) => {
|
|
|
1833
1829
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
1834
1830
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1835
1831
|
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1836
|
-
children: localeService.t("
|
|
1832
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.styleRule")
|
|
1837
1833
|
}),
|
|
1838
1834
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1839
1835
|
className: "univer-flex univer-justify-between univer-gap-4",
|
|
@@ -2009,27 +2005,27 @@ const IconSetRuleEdit = (props) => {
|
|
|
2009
2005
|
const { onChange, configList, errorMap = {} } = props;
|
|
2010
2006
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
2011
2007
|
const options = [{
|
|
2012
|
-
label: localeService.t(`
|
|
2008
|
+
label: localeService.t(`sheets-conditional-formatting-ui.symbol.${_univerjs_sheets_conditional_formatting.CFNumberOperator.greaterThan}`),
|
|
2013
2009
|
value: _univerjs_sheets_conditional_formatting.CFNumberOperator.greaterThan
|
|
2014
2010
|
}, {
|
|
2015
|
-
label: localeService.t(`
|
|
2011
|
+
label: localeService.t(`sheets-conditional-formatting-ui.symbol.${_univerjs_sheets_conditional_formatting.CFNumberOperator.greaterThanOrEqual}`),
|
|
2016
2012
|
value: _univerjs_sheets_conditional_formatting.CFNumberOperator.greaterThanOrEqual
|
|
2017
2013
|
}];
|
|
2018
2014
|
const valueTypeOptions = [
|
|
2019
2015
|
{
|
|
2020
|
-
label: localeService.t(`
|
|
2016
|
+
label: localeService.t(`sheets-conditional-formatting-ui.valueType.${_univerjs_sheets_conditional_formatting.CFValueType.num}`),
|
|
2021
2017
|
value: _univerjs_sheets_conditional_formatting.CFValueType.num
|
|
2022
2018
|
},
|
|
2023
2019
|
{
|
|
2024
|
-
label: localeService.t(`
|
|
2020
|
+
label: localeService.t(`sheets-conditional-formatting-ui.valueType.${_univerjs_sheets_conditional_formatting.CFValueType.percent}`),
|
|
2025
2021
|
value: _univerjs_sheets_conditional_formatting.CFValueType.percent
|
|
2026
2022
|
},
|
|
2027
2023
|
{
|
|
2028
|
-
label: localeService.t(`
|
|
2024
|
+
label: localeService.t(`sheets-conditional-formatting-ui.valueType.${_univerjs_sheets_conditional_formatting.CFValueType.percentile}`),
|
|
2029
2025
|
value: _univerjs_sheets_conditional_formatting.CFValueType.percentile
|
|
2030
2026
|
},
|
|
2031
2027
|
{
|
|
2032
|
-
label: localeService.t(`
|
|
2028
|
+
label: localeService.t(`sheets-conditional-formatting-ui.valueType.${_univerjs_sheets_conditional_formatting.CFValueType.formula}`),
|
|
2033
2029
|
value: _univerjs_sheets_conditional_formatting.CFValueType.formula
|
|
2034
2030
|
}
|
|
2035
2031
|
];
|
|
@@ -2060,7 +2056,7 @@ const IconSetRuleEdit = (props) => {
|
|
|
2060
2056
|
const isEnd = index === configList.length - 1;
|
|
2061
2057
|
const isFirst = index === 0;
|
|
2062
2058
|
const preItem = configList[index - 1];
|
|
2063
|
-
const lessThanText = (preItem === null || preItem === void 0 ? void 0 : preItem.value.type) === _univerjs_sheets_conditional_formatting.CFValueType.formula ? localeService.t("
|
|
2059
|
+
const lessThanText = (preItem === null || preItem === void 0 ? void 0 : preItem.value.type) === _univerjs_sheets_conditional_formatting.CFValueType.formula ? localeService.t("sheets-conditional-formatting-ui.valueType.formula") : preItem === null || preItem === void 0 ? void 0 : preItem.value.value;
|
|
2064
2060
|
const handleIconClick = (iconType, iconId) => {
|
|
2065
2061
|
const value = {
|
|
2066
2062
|
...item,
|
|
@@ -2076,16 +2072,16 @@ const IconSetRuleEdit = (props) => {
|
|
|
2076
2072
|
className: "univer-mt-3 univer-flex univer-items-center univer-justify-between univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2077
2073
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2078
2074
|
className: "univer-w-[45%]",
|
|
2079
|
-
children: [localeService.t("
|
|
2075
|
+
children: [localeService.t("sheets-conditional-formatting-ui.iconSet.icon"), index + 1]
|
|
2080
2076
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2081
2077
|
className: "univer-w-[45%]",
|
|
2082
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [!isFirst && !isEnd && localeService.t("
|
|
2078
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [!isFirst && !isEnd && localeService.t("sheets-conditional-formatting-ui.iconSet.rule"), !isFirst && !isEnd && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2083
2079
|
className: "univer-font-medium univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2084
2080
|
children: [
|
|
2085
|
-
localeService.t("
|
|
2086
|
-
localeService.t(`
|
|
2081
|
+
localeService.t("sheets-conditional-formatting-ui.iconSet.when"),
|
|
2082
|
+
localeService.t(`sheets-conditional-formatting-ui.symbol.${(0, _univerjs_sheets_conditional_formatting.getOppositeOperator)(preItem.operator)}`),
|
|
2087
2083
|
lessThanText,
|
|
2088
|
-
isEnd ? "" : ` ${localeService.t("
|
|
2084
|
+
isEnd ? "" : ` ${localeService.t("sheets-conditional-formatting-ui.iconSet.and")} `
|
|
2089
2085
|
]
|
|
2090
2086
|
})] })
|
|
2091
2087
|
})]
|
|
@@ -2120,20 +2116,20 @@ const IconSetRuleEdit = (props) => {
|
|
|
2120
2116
|
}
|
|
2121
2117
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2122
2118
|
className: "univer-mt-0 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2123
|
-
children: [localeService.t("
|
|
2119
|
+
children: [localeService.t("sheets-conditional-formatting-ui.iconSet.rule"), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2124
2120
|
className: "univer-font-medium",
|
|
2125
2121
|
children: [
|
|
2126
|
-
localeService.t("
|
|
2127
|
-
localeService.t(`
|
|
2122
|
+
localeService.t("sheets-conditional-formatting-ui.iconSet.when"),
|
|
2123
|
+
localeService.t(`sheets-conditional-formatting-ui.symbol.${(0, _univerjs_sheets_conditional_formatting.getOppositeOperator)(preItem.operator)}`),
|
|
2128
2124
|
lessThanText,
|
|
2129
|
-
isEnd ? "" : ` ${localeService.t("
|
|
2125
|
+
isEnd ? "" : ` ${localeService.t("sheets-conditional-formatting-ui.iconSet.and")} `
|
|
2130
2126
|
]
|
|
2131
2127
|
})]
|
|
2132
2128
|
})]
|
|
2133
2129
|
}),
|
|
2134
2130
|
!isEnd ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2135
2131
|
className: "univer-mt-3 univer-grid univer-grid-cols-2 univer-gap-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2136
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: localeService.t("
|
|
2132
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: localeService.t("sheets-conditional-formatting-ui.iconSet.type") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: localeService.t("sheets-conditional-formatting-ui.iconSet.value") })]
|
|
2137
2133
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2138
2134
|
className: "univer-mt-3 univer-grid univer-grid-cols-2 univer-gap-4",
|
|
2139
2135
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Select, {
|
|
@@ -2233,7 +2229,7 @@ const IconSet = (props) => {
|
|
|
2233
2229
|
if (!(0, _univerjs_sheets_conditional_formatting.compareWithNumber)({
|
|
2234
2230
|
operator: preOperator,
|
|
2235
2231
|
value: preItem.value.value
|
|
2236
|
-
}, item.value.value)) result[index] = `${localeService.t(`
|
|
2232
|
+
}, item.value.value)) result[index] = `${localeService.t(`sheets-conditional-formatting-ui.form.${preOperator}`, String(preItem.value.value))} `;
|
|
2237
2233
|
});
|
|
2238
2234
|
return result;
|
|
2239
2235
|
}
|
|
@@ -2297,7 +2293,7 @@ const IconSet = (props) => {
|
|
|
2297
2293
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
2298
2294
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2299
2295
|
className: "univer-mt-4 univer-text-sm univer-text-gray-600",
|
|
2300
|
-
children: localeService.t("
|
|
2296
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.styleRule")
|
|
2301
2297
|
}),
|
|
2302
2298
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2303
2299
|
className: "univer-mt-3",
|
|
@@ -2322,7 +2318,7 @@ const IconSet = (props) => {
|
|
|
2322
2318
|
className: "univer-mt-3 univer-flex univer-items-center univer-text-xs",
|
|
2323
2319
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2324
2320
|
className: "univer-flex univer-items-center univer-text-xs",
|
|
2325
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Checkbox, { onChange: reverseIcon }), localeService.t("
|
|
2321
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Checkbox, { onChange: reverseIcon }), localeService.t("sheets-conditional-formatting-ui.iconSet.reverseIconOrder")]
|
|
2326
2322
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2327
2323
|
className: "univer-ml-6 univer-flex univer-items-center univer-text-xs",
|
|
2328
2324
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Checkbox, {
|
|
@@ -2330,7 +2326,7 @@ const IconSet = (props) => {
|
|
|
2330
2326
|
onChange: (v) => {
|
|
2331
2327
|
setIsShowValue(!v);
|
|
2332
2328
|
}
|
|
2333
|
-
}), localeService.t("
|
|
2329
|
+
}), localeService.t("sheets-conditional-formatting-ui.iconSet.onlyShowIcon")]
|
|
2334
2330
|
})]
|
|
2335
2331
|
}),
|
|
2336
2332
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSetRuleEdit, {
|
|
@@ -2350,19 +2346,19 @@ const RankStyleEditor = (props) => {
|
|
|
2350
2346
|
const rule = ((_props$rule = props.rule) === null || _props$rule === void 0 ? void 0 : _props$rule.type) === _univerjs_sheets_conditional_formatting.CFRuleType.highlightCell ? props.rule : void 0;
|
|
2351
2347
|
const options = [
|
|
2352
2348
|
{
|
|
2353
|
-
label: localeService.t("
|
|
2349
|
+
label: localeService.t("sheets-conditional-formatting-ui.panel.isNotBottom"),
|
|
2354
2350
|
value: "isNotBottom"
|
|
2355
2351
|
},
|
|
2356
2352
|
{
|
|
2357
|
-
label: localeService.t("
|
|
2353
|
+
label: localeService.t("sheets-conditional-formatting-ui.panel.isBottom"),
|
|
2358
2354
|
value: "isBottom"
|
|
2359
2355
|
},
|
|
2360
2356
|
{
|
|
2361
|
-
label: localeService.t("
|
|
2357
|
+
label: localeService.t("sheets-conditional-formatting-ui.panel.greaterThanAverage"),
|
|
2362
2358
|
value: "greaterThanAverage"
|
|
2363
2359
|
},
|
|
2364
2360
|
{
|
|
2365
|
-
label: localeService.t("
|
|
2361
|
+
label: localeService.t("sheets-conditional-formatting-ui.panel.lessThanAverage"),
|
|
2366
2362
|
value: "lessThanAverage"
|
|
2367
2363
|
}
|
|
2368
2364
|
];
|
|
@@ -2458,7 +2454,7 @@ const RankStyleEditor = (props) => {
|
|
|
2458
2454
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
2459
2455
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2460
2456
|
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2461
|
-
children: localeService.t("
|
|
2457
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.styleRule")
|
|
2462
2458
|
}),
|
|
2463
2459
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Select, {
|
|
2464
2460
|
className: "univer-mt-3 univer-w-full",
|
|
@@ -2503,7 +2499,7 @@ const RankStyleEditor = (props) => {
|
|
|
2503
2499
|
style
|
|
2504
2500
|
});
|
|
2505
2501
|
}
|
|
2506
|
-
}), localeService.t("
|
|
2502
|
+
}), localeService.t("sheets-conditional-formatting-ui.valueType.percent")]
|
|
2507
2503
|
})]
|
|
2508
2504
|
}),
|
|
2509
2505
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -2570,27 +2566,27 @@ const RuleEdit = (props) => {
|
|
|
2570
2566
|
}, [props.rule]);
|
|
2571
2567
|
const options = [
|
|
2572
2568
|
{
|
|
2573
|
-
label: localeService.t("
|
|
2569
|
+
label: localeService.t("sheets-conditional-formatting-ui.ruleType.highlightCell"),
|
|
2574
2570
|
value: "1"
|
|
2575
2571
|
},
|
|
2576
2572
|
{
|
|
2577
|
-
label: localeService.t("
|
|
2573
|
+
label: localeService.t("sheets-conditional-formatting-ui.panel.rankAndAverage"),
|
|
2578
2574
|
value: "2"
|
|
2579
2575
|
},
|
|
2580
2576
|
{
|
|
2581
|
-
label: localeService.t("
|
|
2577
|
+
label: localeService.t("sheets-conditional-formatting-ui.ruleType.dataBar"),
|
|
2582
2578
|
value: "3"
|
|
2583
2579
|
},
|
|
2584
2580
|
{
|
|
2585
|
-
label: localeService.t("
|
|
2581
|
+
label: localeService.t("sheets-conditional-formatting-ui.ruleType.colorScale"),
|
|
2586
2582
|
value: "4"
|
|
2587
2583
|
},
|
|
2588
2584
|
{
|
|
2589
|
-
label: localeService.t("
|
|
2585
|
+
label: localeService.t("sheets-conditional-formatting-ui.ruleType.formula"),
|
|
2590
2586
|
value: "5"
|
|
2591
2587
|
},
|
|
2592
2588
|
{
|
|
2593
|
-
label: localeService.t("
|
|
2589
|
+
label: localeService.t("sheets-conditional-formatting-ui.ruleType.iconSet"),
|
|
2594
2590
|
value: "6"
|
|
2595
2591
|
}
|
|
2596
2592
|
];
|
|
@@ -2701,14 +2697,14 @@ const RuleEdit = (props) => {
|
|
|
2701
2697
|
props.onCancel();
|
|
2702
2698
|
};
|
|
2703
2699
|
const handleVerify = (v, rangeText) => {
|
|
2704
|
-
if (v) if (rangeText.length < 1) setErrorText(localeService.t("
|
|
2700
|
+
if (v) if (rangeText.length < 1) setErrorText(localeService.t("sheets-conditional-formatting-ui.errorMessage.rangeError"));
|
|
2705
2701
|
else setErrorText(void 0);
|
|
2706
|
-
else setErrorText(localeService.t("
|
|
2702
|
+
else setErrorText(localeService.t("sheets-conditional-formatting-ui.errorMessage.rangeError"));
|
|
2707
2703
|
};
|
|
2708
2704
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
2709
2705
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2710
2706
|
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2711
|
-
children: localeService.t("
|
|
2707
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.range")
|
|
2712
2708
|
}),
|
|
2713
2709
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2714
2710
|
className: "univer-mt-4",
|
|
@@ -2725,7 +2721,7 @@ const RuleEdit = (props) => {
|
|
|
2725
2721
|
}),
|
|
2726
2722
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2727
2723
|
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2728
|
-
children: localeService.t("
|
|
2724
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.styleType")
|
|
2729
2725
|
}),
|
|
2730
2726
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Select, {
|
|
2731
2727
|
className: "univer-mt-4 univer-w-full",
|
|
@@ -2742,19 +2738,19 @@ const RuleEdit = (props) => {
|
|
|
2742
2738
|
className: "univer-mt-4 univer-flex univer-justify-end",
|
|
2743
2739
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
|
|
2744
2740
|
onClick: handleCancel,
|
|
2745
|
-
children: localeService.t("
|
|
2741
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.cancel")
|
|
2746
2742
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
|
|
2747
2743
|
className: "univer-ml-3",
|
|
2748
2744
|
variant: "primary",
|
|
2749
2745
|
onClick: handleSubmit,
|
|
2750
|
-
children: localeService.t("
|
|
2746
|
+
children: localeService.t("sheets-conditional-formatting-ui.panel.submit")
|
|
2751
2747
|
})]
|
|
2752
2748
|
})
|
|
2753
2749
|
] });
|
|
2754
2750
|
};
|
|
2755
2751
|
|
|
2756
2752
|
//#endregion
|
|
2757
|
-
//#region \0@oxc-project+runtime@0.
|
|
2753
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
|
|
2758
2754
|
function _typeof(o) {
|
|
2759
2755
|
"@babel/helpers - typeof";
|
|
2760
2756
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -2765,7 +2761,7 @@ function _typeof(o) {
|
|
|
2765
2761
|
}
|
|
2766
2762
|
|
|
2767
2763
|
//#endregion
|
|
2768
|
-
//#region \0@oxc-project+runtime@0.
|
|
2764
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
|
|
2769
2765
|
function toPrimitive(t, r) {
|
|
2770
2766
|
if ("object" != _typeof(t) || !t) return t;
|
|
2771
2767
|
var e = t[Symbol.toPrimitive];
|
|
@@ -2778,14 +2774,14 @@ function toPrimitive(t, r) {
|
|
|
2778
2774
|
}
|
|
2779
2775
|
|
|
2780
2776
|
//#endregion
|
|
2781
|
-
//#region \0@oxc-project+runtime@0.
|
|
2777
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
|
|
2782
2778
|
function toPropertyKey(t) {
|
|
2783
2779
|
var i = toPrimitive(t, "string");
|
|
2784
2780
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
2785
2781
|
}
|
|
2786
2782
|
|
|
2787
2783
|
//#endregion
|
|
2788
|
-
//#region \0@oxc-project+runtime@0.
|
|
2784
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
|
|
2789
2785
|
function _defineProperty(e, r, t) {
|
|
2790
2786
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
2791
2787
|
value: t,
|
|
@@ -2796,7 +2792,7 @@ function _defineProperty(e, r, t) {
|
|
|
2796
2792
|
}
|
|
2797
2793
|
|
|
2798
2794
|
//#endregion
|
|
2799
|
-
//#region \0@oxc-project+runtime@0.
|
|
2795
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateParam.js
|
|
2800
2796
|
function __decorateParam(paramIndex, decorator) {
|
|
2801
2797
|
return function(target, key) {
|
|
2802
2798
|
decorator(target, key, paramIndex);
|
|
@@ -2804,7 +2800,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
2804
2800
|
}
|
|
2805
2801
|
|
|
2806
2802
|
//#endregion
|
|
2807
|
-
//#region \0@oxc-project+runtime@0.
|
|
2803
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
|
|
2808
2804
|
function __decorate(decorators, target, key, desc) {
|
|
2809
2805
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2810
2806
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2868,33 +2864,33 @@ ConditionalFormattingI18nController = __decorate([__decorateParam(0, (0, _univer
|
|
|
2868
2864
|
const getRuleDescribe = (rule, localeService) => {
|
|
2869
2865
|
const ruleConfig = rule.rule;
|
|
2870
2866
|
switch (ruleConfig.type) {
|
|
2871
|
-
case _univerjs_sheets_conditional_formatting.CFRuleType.colorScale: return localeService.t("
|
|
2872
|
-
case _univerjs_sheets_conditional_formatting.CFRuleType.dataBar: return localeService.t("
|
|
2873
|
-
case _univerjs_sheets_conditional_formatting.CFRuleType.iconSet: return localeService.t("
|
|
2867
|
+
case _univerjs_sheets_conditional_formatting.CFRuleType.colorScale: return localeService.t("sheets-conditional-formatting-ui.ruleType.colorScale");
|
|
2868
|
+
case _univerjs_sheets_conditional_formatting.CFRuleType.dataBar: return localeService.t("sheets-conditional-formatting-ui.ruleType.dataBar");
|
|
2869
|
+
case _univerjs_sheets_conditional_formatting.CFRuleType.iconSet: return localeService.t("sheets-conditional-formatting-ui.ruleType.iconSet");
|
|
2874
2870
|
case _univerjs_sheets_conditional_formatting.CFRuleType.highlightCell: switch (ruleConfig.subType) {
|
|
2875
2871
|
case _univerjs_sheets_conditional_formatting.CFSubRuleType.average: {
|
|
2876
2872
|
const operator = ruleConfig.operator;
|
|
2877
|
-
return localeService.t(`
|
|
2873
|
+
return localeService.t(`sheets-conditional-formatting-ui.preview.describe.${operator}`, localeService.t("sheets-conditional-formatting-ui.subRuleType.average"));
|
|
2878
2874
|
}
|
|
2879
|
-
case _univerjs_sheets_conditional_formatting.CFSubRuleType.duplicateValues: return localeService.t("
|
|
2880
|
-
case _univerjs_sheets_conditional_formatting.CFSubRuleType.uniqueValues: return localeService.t("
|
|
2875
|
+
case _univerjs_sheets_conditional_formatting.CFSubRuleType.duplicateValues: return localeService.t("sheets-conditional-formatting-ui.subRuleType.duplicateValues");
|
|
2876
|
+
case _univerjs_sheets_conditional_formatting.CFSubRuleType.uniqueValues: return localeService.t("sheets-conditional-formatting-ui.subRuleType.uniqueValues");
|
|
2881
2877
|
case _univerjs_sheets_conditional_formatting.CFSubRuleType.number: {
|
|
2882
2878
|
const operator = ruleConfig.operator;
|
|
2883
|
-
return localeService.t(`
|
|
2879
|
+
return localeService.t(`sheets-conditional-formatting-ui.preview.describe.${operator}`, ...Array.isArray(ruleConfig.value) ? ruleConfig.value.map((e) => String(e)) : [String(ruleConfig.value || "")]);
|
|
2884
2880
|
}
|
|
2885
2881
|
case _univerjs_sheets_conditional_formatting.CFSubRuleType.text: {
|
|
2886
2882
|
const operator = ruleConfig.operator;
|
|
2887
|
-
return localeService.t(`
|
|
2883
|
+
return localeService.t(`sheets-conditional-formatting-ui.preview.describe.${operator}`, ruleConfig.value || "");
|
|
2888
2884
|
}
|
|
2889
2885
|
case _univerjs_sheets_conditional_formatting.CFSubRuleType.timePeriod: {
|
|
2890
2886
|
const operator = ruleConfig.operator;
|
|
2891
|
-
return localeService.t(`
|
|
2887
|
+
return localeService.t(`sheets-conditional-formatting-ui.preview.describe.${operator}`);
|
|
2892
2888
|
}
|
|
2893
|
-
case _univerjs_sheets_conditional_formatting.CFSubRuleType.rank: if (ruleConfig.isPercent) if (ruleConfig.isBottom) return localeService.t("
|
|
2894
|
-
else return localeService.t("
|
|
2895
|
-
else if (ruleConfig.isBottom) return localeService.t("
|
|
2896
|
-
else return localeService.t("
|
|
2897
|
-
case _univerjs_sheets_conditional_formatting.CFSubRuleType.formula: return localeService.t("
|
|
2889
|
+
case _univerjs_sheets_conditional_formatting.CFSubRuleType.rank: if (ruleConfig.isPercent) if (ruleConfig.isBottom) return localeService.t("sheets-conditional-formatting-ui.preview.describe.bottomNPercent", String(ruleConfig.value));
|
|
2890
|
+
else return localeService.t("sheets-conditional-formatting-ui.preview.describe.topNPercent", String(ruleConfig.value));
|
|
2891
|
+
else if (ruleConfig.isBottom) return localeService.t("sheets-conditional-formatting-ui.preview.describe.bottomN", String(ruleConfig.value));
|
|
2892
|
+
else return localeService.t("sheets-conditional-formatting-ui.preview.describe.topN", String(ruleConfig.value));
|
|
2893
|
+
case _univerjs_sheets_conditional_formatting.CFSubRuleType.formula: return localeService.t("sheets-conditional-formatting-ui.ruleType.formula");
|
|
2898
2894
|
}
|
|
2899
2895
|
}
|
|
2900
2896
|
};
|
|
@@ -2917,10 +2913,10 @@ const RuleList = (props) => {
|
|
|
2917
2913
|
const [fetchRuleListId, setFetchRuleListId] = (0, react.useState)(0);
|
|
2918
2914
|
const [draggingId, setDraggingId] = (0, react.useState)("");
|
|
2919
2915
|
const selectOption = [{
|
|
2920
|
-
label: localeService.t("
|
|
2916
|
+
label: localeService.t("sheets-conditional-formatting-ui.panel.workSheet"),
|
|
2921
2917
|
value: "2"
|
|
2922
2918
|
}, {
|
|
2923
|
-
label: localeService.t("
|
|
2919
|
+
label: localeService.t("sheets-conditional-formatting-ui.panel.selectedRange"),
|
|
2924
2920
|
value: "1"
|
|
2925
2921
|
}];
|
|
2926
2922
|
const getRuleList = () => {
|
|
@@ -3061,7 +3057,7 @@ const RuleList = (props) => {
|
|
|
3061
3057
|
className: "\n univer-mb-2 univer-flex univer-items-center univer-justify-between univer-gap-2 univer-text-sm\n ",
|
|
3062
3058
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3063
3059
|
className: "univer-flex univer-items-center univer-gap-2",
|
|
3064
|
-
children: conditionalFormattingI18nController.tWithReactNode("
|
|
3060
|
+
children: conditionalFormattingI18nController.tWithReactNode("sheets-conditional-formatting-ui.panel.managerRuleSelect", /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Select, {
|
|
3065
3061
|
className: "univer-w-36",
|
|
3066
3062
|
options: selectOption,
|
|
3067
3063
|
value: selectValue,
|
|
@@ -3072,7 +3068,7 @@ const RuleList = (props) => {
|
|
|
3072
3068
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3073
3069
|
className: "univer-flex univer-justify-end univer-space-x-2",
|
|
3074
3070
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
|
|
3075
|
-
title: localeService.t("
|
|
3071
|
+
title: localeService.t("sheets-conditional-formatting-ui.panel.createRule"),
|
|
3076
3072
|
placement: "bottom",
|
|
3077
3073
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
3078
3074
|
className: "univer-size-5 univer-cursor-pointer",
|
|
@@ -3080,7 +3076,7 @@ const RuleList = (props) => {
|
|
|
3080
3076
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.IncreaseIcon, {})
|
|
3081
3077
|
})
|
|
3082
3078
|
}), ruleList.length && isHasAllRuleEditPermission ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
|
|
3083
|
-
title: localeService.t("
|
|
3079
|
+
title: localeService.t("sheets-conditional-formatting-ui.panel.clear"),
|
|
3084
3080
|
placement: "bottom",
|
|
3085
3081
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
3086
3082
|
className: "univer-size-5 univer-cursor-pointer",
|
|
@@ -3195,7 +3191,7 @@ let ConditionalFormattingPanelController = class ConditionalFormattingPanelContr
|
|
|
3195
3191
|
openPanel(rule) {
|
|
3196
3192
|
const props = {
|
|
3197
3193
|
id: CF_PANEL_KEY,
|
|
3198
|
-
header: { title: this._localeService.t("
|
|
3194
|
+
header: { title: this._localeService.t("sheets-conditional-formatting-ui.title") },
|
|
3199
3195
|
children: {
|
|
3200
3196
|
label: CF_PANEL_KEY,
|
|
3201
3197
|
rule,
|
|
@@ -3423,7 +3419,7 @@ function generateClearCfMutations(injector, allRules, ranges, unitId, subUnitId)
|
|
|
3423
3419
|
//#endregion
|
|
3424
3420
|
//#region package.json
|
|
3425
3421
|
var name = "@univerjs/sheets-conditional-formatting-ui";
|
|
3426
|
-
var version = "0.
|
|
3422
|
+
var version = "0.25.0";
|
|
3427
3423
|
|
|
3428
3424
|
//#endregion
|
|
3429
3425
|
//#region src/config/config.ts
|
|
@@ -3868,7 +3864,7 @@ let ConditionalFormattingPermissionController = class ConditionalFormattingPermi
|
|
|
3868
3864
|
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
3869
3865
|
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint],
|
|
3870
3866
|
worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetCellStylePermission]
|
|
3871
|
-
}, ranges, unitId, subUnitId)) this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"));
|
|
3867
|
+
}, ranges, unitId, subUnitId)) this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("sheets-conditional-formatting-ui.permission.dialog.setStyleErr"));
|
|
3872
3868
|
}
|
|
3873
3869
|
}));
|
|
3874
3870
|
}
|
|
@@ -4565,63 +4561,63 @@ const commandList = [
|
|
|
4565
4561
|
const commonSelections = [
|
|
4566
4562
|
{
|
|
4567
4563
|
label: {
|
|
4568
|
-
name: "
|
|
4564
|
+
name: "sheets-conditional-formatting-ui.ruleType.highlightCell",
|
|
4569
4565
|
selectable: false
|
|
4570
4566
|
},
|
|
4571
4567
|
value: 3
|
|
4572
4568
|
},
|
|
4573
4569
|
{
|
|
4574
4570
|
label: {
|
|
4575
|
-
name: "
|
|
4571
|
+
name: "sheets-conditional-formatting-ui.panel.rankAndAverage",
|
|
4576
4572
|
selectable: false
|
|
4577
4573
|
},
|
|
4578
4574
|
value: 4
|
|
4579
4575
|
},
|
|
4580
4576
|
{
|
|
4581
4577
|
label: {
|
|
4582
|
-
name: "
|
|
4578
|
+
name: "sheets-conditional-formatting-ui.ruleType.formula",
|
|
4583
4579
|
selectable: false
|
|
4584
4580
|
},
|
|
4585
4581
|
value: 5
|
|
4586
4582
|
},
|
|
4587
4583
|
{
|
|
4588
4584
|
label: {
|
|
4589
|
-
name: "
|
|
4585
|
+
name: "sheets-conditional-formatting-ui.ruleType.colorScale",
|
|
4590
4586
|
selectable: false
|
|
4591
4587
|
},
|
|
4592
4588
|
value: 6
|
|
4593
4589
|
},
|
|
4594
4590
|
{
|
|
4595
4591
|
label: {
|
|
4596
|
-
name: "
|
|
4592
|
+
name: "sheets-conditional-formatting-ui.ruleType.dataBar",
|
|
4597
4593
|
selectable: false
|
|
4598
4594
|
},
|
|
4599
4595
|
value: 7
|
|
4600
4596
|
},
|
|
4601
4597
|
{
|
|
4602
4598
|
label: {
|
|
4603
|
-
name: "
|
|
4599
|
+
name: "sheets-conditional-formatting-ui.ruleType.iconSet",
|
|
4604
4600
|
selectable: false
|
|
4605
4601
|
},
|
|
4606
4602
|
value: 8
|
|
4607
4603
|
},
|
|
4608
4604
|
{
|
|
4609
4605
|
label: {
|
|
4610
|
-
name: "
|
|
4606
|
+
name: "sheets-conditional-formatting-ui.menu.manageConditionalFormatting",
|
|
4611
4607
|
selectable: false
|
|
4612
4608
|
},
|
|
4613
4609
|
value: 2
|
|
4614
4610
|
},
|
|
4615
4611
|
{
|
|
4616
4612
|
label: {
|
|
4617
|
-
name: "
|
|
4613
|
+
name: "sheets-conditional-formatting-ui.menu.createConditionalFormatting",
|
|
4618
4614
|
selectable: false
|
|
4619
4615
|
},
|
|
4620
4616
|
value: 1
|
|
4621
4617
|
},
|
|
4622
4618
|
{
|
|
4623
4619
|
label: {
|
|
4624
|
-
name: "
|
|
4620
|
+
name: "sheets-conditional-formatting-ui.menu.clearRangeRules",
|
|
4625
4621
|
selectable: false
|
|
4626
4622
|
},
|
|
4627
4623
|
value: 9,
|
|
@@ -4629,7 +4625,7 @@ const commonSelections = [
|
|
|
4629
4625
|
},
|
|
4630
4626
|
{
|
|
4631
4627
|
label: {
|
|
4632
|
-
name: "
|
|
4628
|
+
name: "sheets-conditional-formatting-ui.menu.clearWorkSheetRules",
|
|
4633
4629
|
selectable: false
|
|
4634
4630
|
},
|
|
4635
4631
|
value: 10
|
|
@@ -4704,7 +4700,7 @@ const FactoryManageConditionalFormattingRule = (accessor) => {
|
|
|
4704
4700
|
id: OpenConditionalFormattingOperator.id,
|
|
4705
4701
|
type: _univerjs_ui.MenuItemType.SELECTOR,
|
|
4706
4702
|
icon: "ConditionsDoubleIcon",
|
|
4707
|
-
tooltip: "
|
|
4703
|
+
tooltip: "sheets-conditional-formatting-ui.title",
|
|
4708
4704
|
selections: selections$,
|
|
4709
4705
|
hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET),
|
|
4710
4706
|
disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
|