@univerjs/sheets-conditional-formatting 0.22.0 → 0.22.1

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/facade.js CHANGED
@@ -94,7 +94,7 @@ var ConditionalFormatRuleBaseBuilder = class ConditionalFormatRuleBaseBuilder {
94
94
  {
95
95
  operator: _univerjs_sheets_conditional_formatting.CFNumberOperator.greaterThanOrEqual,
96
96
  value: { type: _univerjs_sheets_conditional_formatting.CFValueType.min },
97
- iconType: _univerjs_sheets_conditional_formatting.EMPTY_ICON_TYPE,
97
+ iconType: _univerjs_sheets_conditional_formatting.IIconSetType.empty,
98
98
  iconId: ""
99
99
  },
100
100
  {
@@ -103,13 +103,13 @@ var ConditionalFormatRuleBaseBuilder = class ConditionalFormatRuleBaseBuilder {
103
103
  type: _univerjs_sheets_conditional_formatting.CFValueType.percentile,
104
104
  value: .5
105
105
  },
106
- iconType: _univerjs_sheets_conditional_formatting.EMPTY_ICON_TYPE,
106
+ iconType: _univerjs_sheets_conditional_formatting.IIconSetType.empty,
107
107
  iconId: ""
108
108
  },
109
109
  {
110
110
  operator: _univerjs_sheets_conditional_formatting.CFNumberOperator.lessThanOrEqual,
111
111
  value: { type: _univerjs_sheets_conditional_formatting.CFValueType.max },
112
- iconType: _univerjs_sheets_conditional_formatting.EMPTY_ICON_TYPE,
112
+ iconType: _univerjs_sheets_conditional_formatting.IIconSetType.empty,
113
113
  iconId: ""
114
114
  }
115
115
  ]
@@ -1176,9 +1176,33 @@ var ConditionalFormatIconSetRuleBuilder = class ConditionalFormatIconSetRuleBuil
1176
1176
  * const builder = fWorksheet.newConditionalFormattingRule()
1177
1177
  * .setIconSet({
1178
1178
  * iconConfigs: [
1179
- * { iconType: '3Arrows', iconId: '0', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 20 } },
1180
- * { iconType: '3Arrows', iconId: '1', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 10 } },
1181
- * { iconType: '3Arrows', iconId: '2', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual, value: { type: 'num', value: 10 } }
1179
+ * {
1180
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1181
+ * iconId: '0',
1182
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1183
+ * value: {
1184
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1185
+ * value: 20
1186
+ * }
1187
+ * },
1188
+ * {
1189
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1190
+ * iconId: '1',
1191
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1192
+ * value: {
1193
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1194
+ * value: 10
1195
+ * }
1196
+ * },
1197
+ * {
1198
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1199
+ * iconId: '2',
1200
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1201
+ * value: {
1202
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1203
+ * value: 10
1204
+ * }
1205
+ * }
1182
1206
  * ],
1183
1207
  * isShowValue: true,
1184
1208
  * })
@@ -1217,9 +1241,33 @@ var ConditionalFormatIconSetRuleBuilder = class ConditionalFormatIconSetRuleBuil
1217
1241
  * console.log(builder.getIconMap()); // icons key-value map
1218
1242
  * const rule = builder.setIconSet({
1219
1243
  * iconConfigs: [
1220
- * { iconType: '3Arrows', iconId: '0', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 20 } },
1221
- * { iconType: '3Arrows', iconId: '1', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 10 } },
1222
- * { iconType: '3Arrows', iconId: '2', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual, value: { type: 'num', value: 10 } }
1244
+ * {
1245
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1246
+ * iconId: '0',
1247
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1248
+ * value: {
1249
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1250
+ * value: 20
1251
+ * }
1252
+ * },
1253
+ * {
1254
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1255
+ * iconId: '1',
1256
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1257
+ * value: {
1258
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1259
+ * value: 10
1260
+ * }
1261
+ * },
1262
+ * {
1263
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1264
+ * iconId: '2',
1265
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1266
+ * value: {
1267
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1268
+ * value: 10
1269
+ * }
1270
+ * }
1223
1271
  * ],
1224
1272
  * isShowValue: true,
1225
1273
  * })
@@ -1386,9 +1434,33 @@ var FConditionalFormattingBuilder = class {
1386
1434
  * console.log(builder.getIconMap()); // icons key-value map
1387
1435
  * const rule = builder.setIconSet({
1388
1436
  * iconConfigs: [
1389
- * { iconType: '3Arrows', iconId: '0', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 20 } },
1390
- * { iconType: '3Arrows', iconId: '1', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 10 } },
1391
- * { iconType: '3Arrows', iconId: '2', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual, value: { type: 'num', value: 10 } }
1437
+ * {
1438
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1439
+ * iconId: '0',
1440
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1441
+ * value: {
1442
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1443
+ * value: 20
1444
+ * }
1445
+ * },
1446
+ * {
1447
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1448
+ * iconId: '1',
1449
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1450
+ * value: {
1451
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1452
+ * value: 10
1453
+ * }
1454
+ * },
1455
+ * {
1456
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1457
+ * iconId: '2',
1458
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1459
+ * value: {
1460
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1461
+ * value: 10
1462
+ * }
1463
+ * }
1392
1464
  * ],
1393
1465
  * isShowValue: true,
1394
1466
  * })
@@ -2140,6 +2212,12 @@ var FSheetsConditionalFormattingEnumMixin = class extends _univerjs_core_facade.
2140
2212
  get ConditionFormatTimePeriodOperatorEnum() {
2141
2213
  return _univerjs_sheets_conditional_formatting.CFTimePeriodOperator;
2142
2214
  }
2215
+ get ConditionFormatIconSetTypeEnum() {
2216
+ return _univerjs_sheets_conditional_formatting.IIconSetType;
2217
+ }
2218
+ get ConditionFormatValueTypeEnum() {
2219
+ return _univerjs_sheets_conditional_formatting.CFValueType;
2220
+ }
2143
2221
  };
2144
2222
  _univerjs_core_facade.FEnum.extend(FSheetsConditionalFormattingEnumMixin);
2145
2223
 
package/lib/cjs/index.js CHANGED
@@ -2225,6 +2225,31 @@ const ICON_MAP = {
2225
2225
  * See the License for the specific language governing permissions and
2226
2226
  * limitations under the License.
2227
2227
  */
2228
+ let IIconSetType = /* @__PURE__ */ function(IIconSetType) {
2229
+ IIconSetType["threeArrows"] = "3Arrows";
2230
+ IIconSetType["threeArrowsGray"] = "3ArrowsGray";
2231
+ IIconSetType["fourArrows"] = "4Arrows";
2232
+ IIconSetType["fourArrowsGray"] = "4ArrowsGray";
2233
+ IIconSetType["fiveArrows"] = "5Arrows";
2234
+ IIconSetType["fiveArrowsGray"] = "5ArrowsGray";
2235
+ IIconSetType["threeTriangles"] = "3Triangles";
2236
+ IIconSetType["threeTrafficLights1"] = "3TrafficLights1";
2237
+ IIconSetType["threeSigns"] = "3Signs";
2238
+ IIconSetType["threeTrafficLights2"] = "3TrafficLights2";
2239
+ IIconSetType["fourRedToBlack"] = "4RedToBlack";
2240
+ IIconSetType["fourTrafficLights"] = "4TrafficLights";
2241
+ IIconSetType["threeSymbols"] = "3Symbols";
2242
+ IIconSetType["threeSymbols2"] = "3Symbols2";
2243
+ IIconSetType["threeFlags"] = "3Flags";
2244
+ IIconSetType["fourRating"] = "4Rating";
2245
+ IIconSetType["fiveRating"] = "5Rating";
2246
+ IIconSetType["fiveQuarters"] = "5Quarters";
2247
+ IIconSetType["fiveFelling"] = "_5Felling";
2248
+ IIconSetType["fiveBoxes"] = "5Boxes";
2249
+ IIconSetType["threeStars"] = "3Stars";
2250
+ IIconSetType["empty"] = "EMPTY_ICON_TYPE";
2251
+ return IIconSetType;
2252
+ }({});
2228
2253
  const iconGroup = [
2229
2254
  {
2230
2255
  title: "sheet.cf.iconSet.direction",
@@ -2441,12 +2466,11 @@ for (const key in iconMap) {
2441
2466
  const v = iconMap[key];
2442
2467
  Object.freeze(v);
2443
2468
  }
2444
- const EMPTY_ICON_TYPE = "EMPTY_ICON_TYPE";
2445
2469
 
2446
2470
  //#endregion
2447
2471
  //#region package.json
2448
2472
  var name = "@univerjs/sheets-conditional-formatting";
2449
- var version = "0.22.0";
2473
+ var version = "0.22.1";
2450
2474
 
2451
2475
  //#endregion
2452
2476
  //#region src/config/config.ts
@@ -2971,7 +2995,7 @@ exports.DataBar = DataBar;
2971
2995
  exports.DeleteCfCommand = DeleteCfCommand;
2972
2996
  exports.DeleteConditionalRuleMutation = DeleteConditionalRuleMutation;
2973
2997
  exports.DeleteConditionalRuleMutationUndoFactory = DeleteConditionalRuleMutationUndoFactory;
2974
- exports.EMPTY_ICON_TYPE = EMPTY_ICON_TYPE;
2998
+ exports.IIconSetType = IIconSetType;
2975
2999
  exports.IconUKey = IconUKey;
2976
3000
  exports.MoveCfCommand = MoveCfCommand;
2977
3001
  exports.MoveConditionalRuleMutation = MoveConditionalRuleMutation;
package/lib/es/facade.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BooleanNumber, ColorKit, Rectangle, Tools } from "@univerjs/core";
2
- import { AddCfCommand, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType, ClearRangeCfCommand, ClearWorksheetCfCommand, ConditionalFormattingRuleModel, DeleteCfCommand, EMPTY_ICON_TYPE, MoveCfCommand, SetCfCommand, createCfId, iconMap } from "@univerjs/sheets-conditional-formatting";
2
+ import { AddCfCommand, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType, ClearRangeCfCommand, ClearWorksheetCfCommand, ConditionalFormattingRuleModel, DeleteCfCommand, IIconSetType, MoveCfCommand, SetCfCommand, createCfId, iconMap } from "@univerjs/sheets-conditional-formatting";
3
3
  import { FRange, FWorksheet } from "@univerjs/sheets/facade";
4
4
  import { FEnum } from "@univerjs/core/facade";
5
5
 
@@ -93,7 +93,7 @@ var ConditionalFormatRuleBaseBuilder = class ConditionalFormatRuleBaseBuilder {
93
93
  {
94
94
  operator: CFNumberOperator.greaterThanOrEqual,
95
95
  value: { type: CFValueType.min },
96
- iconType: EMPTY_ICON_TYPE,
96
+ iconType: IIconSetType.empty,
97
97
  iconId: ""
98
98
  },
99
99
  {
@@ -102,13 +102,13 @@ var ConditionalFormatRuleBaseBuilder = class ConditionalFormatRuleBaseBuilder {
102
102
  type: CFValueType.percentile,
103
103
  value: .5
104
104
  },
105
- iconType: EMPTY_ICON_TYPE,
105
+ iconType: IIconSetType.empty,
106
106
  iconId: ""
107
107
  },
108
108
  {
109
109
  operator: CFNumberOperator.lessThanOrEqual,
110
110
  value: { type: CFValueType.max },
111
- iconType: EMPTY_ICON_TYPE,
111
+ iconType: IIconSetType.empty,
112
112
  iconId: ""
113
113
  }
114
114
  ]
@@ -1175,9 +1175,33 @@ var ConditionalFormatIconSetRuleBuilder = class ConditionalFormatIconSetRuleBuil
1175
1175
  * const builder = fWorksheet.newConditionalFormattingRule()
1176
1176
  * .setIconSet({
1177
1177
  * iconConfigs: [
1178
- * { iconType: '3Arrows', iconId: '0', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 20 } },
1179
- * { iconType: '3Arrows', iconId: '1', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 10 } },
1180
- * { iconType: '3Arrows', iconId: '2', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual, value: { type: 'num', value: 10 } }
1178
+ * {
1179
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1180
+ * iconId: '0',
1181
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1182
+ * value: {
1183
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1184
+ * value: 20
1185
+ * }
1186
+ * },
1187
+ * {
1188
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1189
+ * iconId: '1',
1190
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1191
+ * value: {
1192
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1193
+ * value: 10
1194
+ * }
1195
+ * },
1196
+ * {
1197
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1198
+ * iconId: '2',
1199
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1200
+ * value: {
1201
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1202
+ * value: 10
1203
+ * }
1204
+ * }
1181
1205
  * ],
1182
1206
  * isShowValue: true,
1183
1207
  * })
@@ -1216,9 +1240,33 @@ var ConditionalFormatIconSetRuleBuilder = class ConditionalFormatIconSetRuleBuil
1216
1240
  * console.log(builder.getIconMap()); // icons key-value map
1217
1241
  * const rule = builder.setIconSet({
1218
1242
  * iconConfigs: [
1219
- * { iconType: '3Arrows', iconId: '0', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 20 } },
1220
- * { iconType: '3Arrows', iconId: '1', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 10 } },
1221
- * { iconType: '3Arrows', iconId: '2', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual, value: { type: 'num', value: 10 } }
1243
+ * {
1244
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1245
+ * iconId: '0',
1246
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1247
+ * value: {
1248
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1249
+ * value: 20
1250
+ * }
1251
+ * },
1252
+ * {
1253
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1254
+ * iconId: '1',
1255
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1256
+ * value: {
1257
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1258
+ * value: 10
1259
+ * }
1260
+ * },
1261
+ * {
1262
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1263
+ * iconId: '2',
1264
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1265
+ * value: {
1266
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1267
+ * value: 10
1268
+ * }
1269
+ * }
1222
1270
  * ],
1223
1271
  * isShowValue: true,
1224
1272
  * })
@@ -1385,9 +1433,33 @@ var FConditionalFormattingBuilder = class {
1385
1433
  * console.log(builder.getIconMap()); // icons key-value map
1386
1434
  * const rule = builder.setIconSet({
1387
1435
  * iconConfigs: [
1388
- * { iconType: '3Arrows', iconId: '0', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 20 } },
1389
- * { iconType: '3Arrows', iconId: '1', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 10 } },
1390
- * { iconType: '3Arrows', iconId: '2', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual, value: { type: 'num', value: 10 } }
1436
+ * {
1437
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1438
+ * iconId: '0',
1439
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1440
+ * value: {
1441
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1442
+ * value: 20
1443
+ * }
1444
+ * },
1445
+ * {
1446
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1447
+ * iconId: '1',
1448
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1449
+ * value: {
1450
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1451
+ * value: 10
1452
+ * }
1453
+ * },
1454
+ * {
1455
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1456
+ * iconId: '2',
1457
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1458
+ * value: {
1459
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1460
+ * value: 10
1461
+ * }
1462
+ * }
1391
1463
  * ],
1392
1464
  * isShowValue: true,
1393
1465
  * })
@@ -2139,6 +2211,12 @@ var FSheetsConditionalFormattingEnumMixin = class extends FEnum {
2139
2211
  get ConditionFormatTimePeriodOperatorEnum() {
2140
2212
  return CFTimePeriodOperator;
2141
2213
  }
2214
+ get ConditionFormatIconSetTypeEnum() {
2215
+ return IIconSetType;
2216
+ }
2217
+ get ConditionFormatValueTypeEnum() {
2218
+ return CFValueType;
2219
+ }
2142
2220
  };
2143
2221
  FEnum.extend(FSheetsConditionalFormattingEnumMixin);
2144
2222
 
package/lib/es/index.js CHANGED
@@ -2224,6 +2224,31 @@ const ICON_MAP = {
2224
2224
  * See the License for the specific language governing permissions and
2225
2225
  * limitations under the License.
2226
2226
  */
2227
+ let IIconSetType = /* @__PURE__ */ function(IIconSetType) {
2228
+ IIconSetType["threeArrows"] = "3Arrows";
2229
+ IIconSetType["threeArrowsGray"] = "3ArrowsGray";
2230
+ IIconSetType["fourArrows"] = "4Arrows";
2231
+ IIconSetType["fourArrowsGray"] = "4ArrowsGray";
2232
+ IIconSetType["fiveArrows"] = "5Arrows";
2233
+ IIconSetType["fiveArrowsGray"] = "5ArrowsGray";
2234
+ IIconSetType["threeTriangles"] = "3Triangles";
2235
+ IIconSetType["threeTrafficLights1"] = "3TrafficLights1";
2236
+ IIconSetType["threeSigns"] = "3Signs";
2237
+ IIconSetType["threeTrafficLights2"] = "3TrafficLights2";
2238
+ IIconSetType["fourRedToBlack"] = "4RedToBlack";
2239
+ IIconSetType["fourTrafficLights"] = "4TrafficLights";
2240
+ IIconSetType["threeSymbols"] = "3Symbols";
2241
+ IIconSetType["threeSymbols2"] = "3Symbols2";
2242
+ IIconSetType["threeFlags"] = "3Flags";
2243
+ IIconSetType["fourRating"] = "4Rating";
2244
+ IIconSetType["fiveRating"] = "5Rating";
2245
+ IIconSetType["fiveQuarters"] = "5Quarters";
2246
+ IIconSetType["fiveFelling"] = "_5Felling";
2247
+ IIconSetType["fiveBoxes"] = "5Boxes";
2248
+ IIconSetType["threeStars"] = "3Stars";
2249
+ IIconSetType["empty"] = "EMPTY_ICON_TYPE";
2250
+ return IIconSetType;
2251
+ }({});
2227
2252
  const iconGroup = [
2228
2253
  {
2229
2254
  title: "sheet.cf.iconSet.direction",
@@ -2440,12 +2465,11 @@ for (const key in iconMap) {
2440
2465
  const v = iconMap[key];
2441
2466
  Object.freeze(v);
2442
2467
  }
2443
- const EMPTY_ICON_TYPE = "EMPTY_ICON_TYPE";
2444
2468
 
2445
2469
  //#endregion
2446
2470
  //#region package.json
2447
2471
  var name = "@univerjs/sheets-conditional-formatting";
2448
- var version = "0.22.0";
2472
+ var version = "0.22.1";
2449
2473
 
2450
2474
  //#endregion
2451
2475
  //#region src/config/config.ts
@@ -2930,4 +2954,4 @@ function removeUndefinedAttr(obj) {
2930
2954
  }
2931
2955
 
2932
2956
  //#endregion
2933
- export { AddCfCommand, AddConditionalRuleMutation, AddConditionalRuleMutationUndoFactory, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType, CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH, ClearRangeCfCommand, ClearWorksheetCfCommand, ConditionalFormattingFormulaService, ConditionalFormattingIcon, ConditionalFormattingRuleModel, ConditionalFormattingService, ConditionalFormattingViewModel, DEFAULT_BG_COLOR, DEFAULT_FONT_COLOR, DEFAULT_PADDING, DEFAULT_WIDTH, DataBar, DeleteCfCommand, DeleteConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, EMPTY_ICON_TYPE, IconUKey, MoveCfCommand, MoveConditionalRuleMutation, MoveConditionalRuleMutationUndoFactory, SHEET_CONDITIONAL_FORMATTING_PLUGIN, SetCfCommand, SetConditionalRuleMutation, UniverSheetsConditionalFormattingPlugin, anchorUndoFactory, compareWithNumber, createCfId, createDefaultRule, createDefaultValue, createDefaultValueByValueType, dataBarUKey, defaultDataBarNativeColor, defaultDataBarPositiveColor, defaultPlaceholderColor, filterRange, findIndexByAnchor, getCacheStyleMatrix, getCellValue, getColorScaleFromValue, getMaxInFormulaResult, getOppositeOperator, getValueByType, iconGroup, iconMap, isAnchorEqual, isFloatsEqual, isNullable, isRangesEqual, moveByAnchor, removeUndefinedAttr, serialTimeToTimestamp, setConditionalRuleMutationUndoFactory, toYMD_1900, transformSupportSymmetryAnchor };
2957
+ export { AddCfCommand, AddConditionalRuleMutation, AddConditionalRuleMutationUndoFactory, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType, CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH, ClearRangeCfCommand, ClearWorksheetCfCommand, ConditionalFormattingFormulaService, ConditionalFormattingIcon, ConditionalFormattingRuleModel, ConditionalFormattingService, ConditionalFormattingViewModel, DEFAULT_BG_COLOR, DEFAULT_FONT_COLOR, DEFAULT_PADDING, DEFAULT_WIDTH, DataBar, DeleteCfCommand, DeleteConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, IIconSetType, IconUKey, MoveCfCommand, MoveConditionalRuleMutation, MoveConditionalRuleMutationUndoFactory, SHEET_CONDITIONAL_FORMATTING_PLUGIN, SetCfCommand, SetConditionalRuleMutation, UniverSheetsConditionalFormattingPlugin, anchorUndoFactory, compareWithNumber, createCfId, createDefaultRule, createDefaultValue, createDefaultValueByValueType, dataBarUKey, defaultDataBarNativeColor, defaultDataBarPositiveColor, defaultPlaceholderColor, filterRange, findIndexByAnchor, getCacheStyleMatrix, getCellValue, getColorScaleFromValue, getMaxInFormulaResult, getOppositeOperator, getValueByType, iconGroup, iconMap, isAnchorEqual, isFloatsEqual, isNullable, isRangesEqual, moveByAnchor, removeUndefinedAttr, serialTimeToTimestamp, setConditionalRuleMutationUndoFactory, toYMD_1900, transformSupportSymmetryAnchor };
package/lib/facade.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BooleanNumber, ColorKit, Rectangle, Tools } from "@univerjs/core";
2
- import { AddCfCommand, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType, ClearRangeCfCommand, ClearWorksheetCfCommand, ConditionalFormattingRuleModel, DeleteCfCommand, EMPTY_ICON_TYPE, MoveCfCommand, SetCfCommand, createCfId, iconMap } from "@univerjs/sheets-conditional-formatting";
2
+ import { AddCfCommand, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType, ClearRangeCfCommand, ClearWorksheetCfCommand, ConditionalFormattingRuleModel, DeleteCfCommand, IIconSetType, MoveCfCommand, SetCfCommand, createCfId, iconMap } from "@univerjs/sheets-conditional-formatting";
3
3
  import { FRange, FWorksheet } from "@univerjs/sheets/facade";
4
4
  import { FEnum } from "@univerjs/core/facade";
5
5
 
@@ -93,7 +93,7 @@ var ConditionalFormatRuleBaseBuilder = class ConditionalFormatRuleBaseBuilder {
93
93
  {
94
94
  operator: CFNumberOperator.greaterThanOrEqual,
95
95
  value: { type: CFValueType.min },
96
- iconType: EMPTY_ICON_TYPE,
96
+ iconType: IIconSetType.empty,
97
97
  iconId: ""
98
98
  },
99
99
  {
@@ -102,13 +102,13 @@ var ConditionalFormatRuleBaseBuilder = class ConditionalFormatRuleBaseBuilder {
102
102
  type: CFValueType.percentile,
103
103
  value: .5
104
104
  },
105
- iconType: EMPTY_ICON_TYPE,
105
+ iconType: IIconSetType.empty,
106
106
  iconId: ""
107
107
  },
108
108
  {
109
109
  operator: CFNumberOperator.lessThanOrEqual,
110
110
  value: { type: CFValueType.max },
111
- iconType: EMPTY_ICON_TYPE,
111
+ iconType: IIconSetType.empty,
112
112
  iconId: ""
113
113
  }
114
114
  ]
@@ -1175,9 +1175,33 @@ var ConditionalFormatIconSetRuleBuilder = class ConditionalFormatIconSetRuleBuil
1175
1175
  * const builder = fWorksheet.newConditionalFormattingRule()
1176
1176
  * .setIconSet({
1177
1177
  * iconConfigs: [
1178
- * { iconType: '3Arrows', iconId: '0', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 20 } },
1179
- * { iconType: '3Arrows', iconId: '1', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 10 } },
1180
- * { iconType: '3Arrows', iconId: '2', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual, value: { type: 'num', value: 10 } }
1178
+ * {
1179
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1180
+ * iconId: '0',
1181
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1182
+ * value: {
1183
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1184
+ * value: 20
1185
+ * }
1186
+ * },
1187
+ * {
1188
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1189
+ * iconId: '1',
1190
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1191
+ * value: {
1192
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1193
+ * value: 10
1194
+ * }
1195
+ * },
1196
+ * {
1197
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1198
+ * iconId: '2',
1199
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1200
+ * value: {
1201
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1202
+ * value: 10
1203
+ * }
1204
+ * }
1181
1205
  * ],
1182
1206
  * isShowValue: true,
1183
1207
  * })
@@ -1216,9 +1240,33 @@ var ConditionalFormatIconSetRuleBuilder = class ConditionalFormatIconSetRuleBuil
1216
1240
  * console.log(builder.getIconMap()); // icons key-value map
1217
1241
  * const rule = builder.setIconSet({
1218
1242
  * iconConfigs: [
1219
- * { iconType: '3Arrows', iconId: '0', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 20 } },
1220
- * { iconType: '3Arrows', iconId: '1', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 10 } },
1221
- * { iconType: '3Arrows', iconId: '2', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual, value: { type: 'num', value: 10 } }
1243
+ * {
1244
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1245
+ * iconId: '0',
1246
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1247
+ * value: {
1248
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1249
+ * value: 20
1250
+ * }
1251
+ * },
1252
+ * {
1253
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1254
+ * iconId: '1',
1255
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1256
+ * value: {
1257
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1258
+ * value: 10
1259
+ * }
1260
+ * },
1261
+ * {
1262
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1263
+ * iconId: '2',
1264
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1265
+ * value: {
1266
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1267
+ * value: 10
1268
+ * }
1269
+ * }
1222
1270
  * ],
1223
1271
  * isShowValue: true,
1224
1272
  * })
@@ -1385,9 +1433,33 @@ var FConditionalFormattingBuilder = class {
1385
1433
  * console.log(builder.getIconMap()); // icons key-value map
1386
1434
  * const rule = builder.setIconSet({
1387
1435
  * iconConfigs: [
1388
- * { iconType: '3Arrows', iconId: '0', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 20 } },
1389
- * { iconType: '3Arrows', iconId: '1', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan, value: { type: 'num', value: 10 } },
1390
- * { iconType: '3Arrows', iconId: '2', operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual, value: { type: 'num', value: 10 } }
1436
+ * {
1437
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1438
+ * iconId: '0',
1439
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1440
+ * value: {
1441
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1442
+ * value: 20
1443
+ * }
1444
+ * },
1445
+ * {
1446
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1447
+ * iconId: '1',
1448
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1449
+ * value: {
1450
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1451
+ * value: 10
1452
+ * }
1453
+ * },
1454
+ * {
1455
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1456
+ * iconId: '2',
1457
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1458
+ * value: {
1459
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1460
+ * value: 10
1461
+ * }
1462
+ * }
1391
1463
  * ],
1392
1464
  * isShowValue: true,
1393
1465
  * })
@@ -2139,6 +2211,12 @@ var FSheetsConditionalFormattingEnumMixin = class extends FEnum {
2139
2211
  get ConditionFormatTimePeriodOperatorEnum() {
2140
2212
  return CFTimePeriodOperator;
2141
2213
  }
2214
+ get ConditionFormatIconSetTypeEnum() {
2215
+ return IIconSetType;
2216
+ }
2217
+ get ConditionFormatValueTypeEnum() {
2218
+ return CFValueType;
2219
+ }
2142
2220
  };
2143
2221
  FEnum.extend(FSheetsConditionalFormattingEnumMixin);
2144
2222
 
package/lib/index.js CHANGED
@@ -2224,6 +2224,31 @@ const ICON_MAP = {
2224
2224
  * See the License for the specific language governing permissions and
2225
2225
  * limitations under the License.
2226
2226
  */
2227
+ let IIconSetType = /* @__PURE__ */ function(IIconSetType) {
2228
+ IIconSetType["threeArrows"] = "3Arrows";
2229
+ IIconSetType["threeArrowsGray"] = "3ArrowsGray";
2230
+ IIconSetType["fourArrows"] = "4Arrows";
2231
+ IIconSetType["fourArrowsGray"] = "4ArrowsGray";
2232
+ IIconSetType["fiveArrows"] = "5Arrows";
2233
+ IIconSetType["fiveArrowsGray"] = "5ArrowsGray";
2234
+ IIconSetType["threeTriangles"] = "3Triangles";
2235
+ IIconSetType["threeTrafficLights1"] = "3TrafficLights1";
2236
+ IIconSetType["threeSigns"] = "3Signs";
2237
+ IIconSetType["threeTrafficLights2"] = "3TrafficLights2";
2238
+ IIconSetType["fourRedToBlack"] = "4RedToBlack";
2239
+ IIconSetType["fourTrafficLights"] = "4TrafficLights";
2240
+ IIconSetType["threeSymbols"] = "3Symbols";
2241
+ IIconSetType["threeSymbols2"] = "3Symbols2";
2242
+ IIconSetType["threeFlags"] = "3Flags";
2243
+ IIconSetType["fourRating"] = "4Rating";
2244
+ IIconSetType["fiveRating"] = "5Rating";
2245
+ IIconSetType["fiveQuarters"] = "5Quarters";
2246
+ IIconSetType["fiveFelling"] = "_5Felling";
2247
+ IIconSetType["fiveBoxes"] = "5Boxes";
2248
+ IIconSetType["threeStars"] = "3Stars";
2249
+ IIconSetType["empty"] = "EMPTY_ICON_TYPE";
2250
+ return IIconSetType;
2251
+ }({});
2227
2252
  const iconGroup = [
2228
2253
  {
2229
2254
  title: "sheet.cf.iconSet.direction",
@@ -2440,12 +2465,11 @@ for (const key in iconMap) {
2440
2465
  const v = iconMap[key];
2441
2466
  Object.freeze(v);
2442
2467
  }
2443
- const EMPTY_ICON_TYPE = "EMPTY_ICON_TYPE";
2444
2468
 
2445
2469
  //#endregion
2446
2470
  //#region package.json
2447
2471
  var name = "@univerjs/sheets-conditional-formatting";
2448
- var version = "0.22.0";
2472
+ var version = "0.22.1";
2449
2473
 
2450
2474
  //#endregion
2451
2475
  //#region src/config/config.ts
@@ -2930,4 +2954,4 @@ function removeUndefinedAttr(obj) {
2930
2954
  }
2931
2955
 
2932
2956
  //#endregion
2933
- export { AddCfCommand, AddConditionalRuleMutation, AddConditionalRuleMutationUndoFactory, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType, CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH, ClearRangeCfCommand, ClearWorksheetCfCommand, ConditionalFormattingFormulaService, ConditionalFormattingIcon, ConditionalFormattingRuleModel, ConditionalFormattingService, ConditionalFormattingViewModel, DEFAULT_BG_COLOR, DEFAULT_FONT_COLOR, DEFAULT_PADDING, DEFAULT_WIDTH, DataBar, DeleteCfCommand, DeleteConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, EMPTY_ICON_TYPE, IconUKey, MoveCfCommand, MoveConditionalRuleMutation, MoveConditionalRuleMutationUndoFactory, SHEET_CONDITIONAL_FORMATTING_PLUGIN, SetCfCommand, SetConditionalRuleMutation, UniverSheetsConditionalFormattingPlugin, anchorUndoFactory, compareWithNumber, createCfId, createDefaultRule, createDefaultValue, createDefaultValueByValueType, dataBarUKey, defaultDataBarNativeColor, defaultDataBarPositiveColor, defaultPlaceholderColor, filterRange, findIndexByAnchor, getCacheStyleMatrix, getCellValue, getColorScaleFromValue, getMaxInFormulaResult, getOppositeOperator, getValueByType, iconGroup, iconMap, isAnchorEqual, isFloatsEqual, isNullable, isRangesEqual, moveByAnchor, removeUndefinedAttr, serialTimeToTimestamp, setConditionalRuleMutationUndoFactory, toYMD_1900, transformSupportSymmetryAnchor };
2957
+ export { AddCfCommand, AddConditionalRuleMutation, AddConditionalRuleMutationUndoFactory, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType, CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH, ClearRangeCfCommand, ClearWorksheetCfCommand, ConditionalFormattingFormulaService, ConditionalFormattingIcon, ConditionalFormattingRuleModel, ConditionalFormattingService, ConditionalFormattingViewModel, DEFAULT_BG_COLOR, DEFAULT_FONT_COLOR, DEFAULT_PADDING, DEFAULT_WIDTH, DataBar, DeleteCfCommand, DeleteConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, IIconSetType, IconUKey, MoveCfCommand, MoveConditionalRuleMutation, MoveConditionalRuleMutationUndoFactory, SHEET_CONDITIONAL_FORMATTING_PLUGIN, SetCfCommand, SetConditionalRuleMutation, UniverSheetsConditionalFormattingPlugin, anchorUndoFactory, compareWithNumber, createCfId, createDefaultRule, createDefaultValue, createDefaultValueByValueType, dataBarUKey, defaultDataBarNativeColor, defaultDataBarPositiveColor, defaultPlaceholderColor, filterRange, findIndexByAnchor, getCacheStyleMatrix, getCellValue, getColorScaleFromValue, getMaxInFormulaResult, getOppositeOperator, getValueByType, iconGroup, iconMap, isAnchorEqual, isFloatsEqual, isNullable, isRangesEqual, moveByAnchor, removeUndefinedAttr, serialTimeToTimestamp, setConditionalRuleMutationUndoFactory, toYMD_1900, transformSupportSymmetryAnchor };