@dovetail-v2/refine 0.1.15-alpha.2 → 0.1.15

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,4 +1,4 @@
1
- import { j as jsxRuntimeExports } from "./index-8560b9d7.js";
1
+ import { j as jsxRuntimeExports } from "./index-9c0a49f4.js";
2
2
  import * as monaco from "monaco-editor";
3
3
  import { useRef, useEffect } from "react";
4
4
  import "i18next";
@@ -1548,7 +1548,7 @@ const change_form_mode_alert = "从编辑 YAML 切回表单编辑,将无法保
1548
1548
  const pvc_storage_required = "请填写分配量。";
1549
1549
  const pvc_storage_min = "请输入正整数。";
1550
1550
  const pvc_storage_reduce_limit = "输入值不得小于当前数值。";
1551
- const pvc_storage_max_limit = "分配量不能超过 64TiB。";
1551
+ const pvc_storage_max_limit = "分配量不能超过 64 TiB。";
1552
1552
  const key_empty_text = "请填写键。";
1553
1553
  const format_error = "格式错误。";
1554
1554
  const taint_effect_empty_text = "请选择效果。";
@@ -12189,8 +12189,7 @@ function KeyValueSecret(props) {
12189
12189
  });
12190
12190
  }
12191
12191
  function validateLabelKey(key2) {
12192
- const labelPrefixRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.]*[a-zA-Z0-9]$)/;
12193
- const labelNameRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
12192
+ const labelRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
12194
12193
  let prefix, name2;
12195
12194
  const splitResult = key2.split("/");
12196
12195
  if (splitResult.length === 1) {
@@ -12202,10 +12201,10 @@ function validateLabelKey(key2) {
12202
12201
  if (prefix === "") {
12203
12202
  return { isValid: false, errorMessage: "EMPTY_PREFIX" };
12204
12203
  }
12205
- if (prefix && !labelPrefixRegex.test(prefix)) {
12204
+ if (prefix && !labelRegex.test(prefix)) {
12206
12205
  return { isValid: false, errorMessage: "INVALID_PREFIX" };
12207
12206
  }
12208
- if (!labelNameRegex.test(name2)) {
12207
+ if (!labelRegex.test(name2)) {
12209
12208
  return { isValid: false, errorMessage: "INVALID_NAME" };
12210
12209
  }
12211
12210
  if (prefix && prefix.length > 253) {
@@ -12217,7 +12216,7 @@ function validateLabelKey(key2) {
12217
12216
  return { isValid: true };
12218
12217
  }
12219
12218
  function validateLabelValue(value2) {
12220
- const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
12219
+ const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
12221
12220
  if (value2 === "") {
12222
12221
  return { isValid: true };
12223
12222
  }
@@ -12231,31 +12230,37 @@ function validateLabelValue(value2) {
12231
12230
  }
12232
12231
  const LabelFormatPopover_105yfzn = "";
12233
12232
  const PodLabelFormatRulePopoverStyle = "p5jt6nm";
12234
- const LabelFormatPopover = () => {
12233
+ const LabelFormatPopover = ({
12234
+ noValueValidation
12235
+ }) => {
12235
12236
  const {
12236
12237
  t: t2
12237
12238
  } = useTranslation();
12239
+ const data2 = [{
12240
+ object: t2("dovetail.key"),
12241
+ contains: t2("dovetail.suffix"),
12242
+ optional: t2("dovetail.no"),
12243
+ rule: [t2("dovetail.suffix_format_rule_1"), t2("dovetail.suffix_format_rule_2"), t2("dovetail.suffix_format_rule_3")]
12244
+ }, {
12245
+ object: t2("dovetail.key"),
12246
+ contains: t2("dovetail.name"),
12247
+ optional: t2("dovetail.yes"),
12248
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12249
+ }];
12250
+ if (!noValueValidation) {
12251
+ data2.push({
12252
+ object: t2("dovetail.value"),
12253
+ contains: t2("dovetail.name"),
12254
+ optional: t2("dovetail.no"),
12255
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12256
+ });
12257
+ }
12238
12258
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Popover, {
12239
12259
  overlayClassName: PodLabelFormatRulePopoverStyle,
12240
12260
  placement: "bottomRight",
12241
12261
  content: /* @__PURE__ */ jsxRuntimeExports.jsx(AntdTable, {
12242
12262
  bordered: true,
12243
- dataSource: [{
12244
- object: t2("dovetail.key"),
12245
- contains: t2("dovetail.suffix"),
12246
- optional: t2("dovetail.no"),
12247
- rule: [t2("dovetail.suffix_format_rule_1"), t2("dovetail.suffix_format_rule_2"), t2("dovetail.suffix_format_rule_3")]
12248
- }, {
12249
- object: t2("dovetail.key"),
12250
- contains: t2("dovetail.name"),
12251
- optional: t2("dovetail.yes"),
12252
- rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12253
- }, {
12254
- object: t2("dovetail.value"),
12255
- contains: t2("dovetail.name"),
12256
- optional: t2("dovetail.no"),
12257
- rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12258
- }],
12263
+ dataSource: data2,
12259
12264
  columns: [{
12260
12265
  key: "object",
12261
12266
  title: t2("dovetail.object"),
@@ -12307,7 +12312,8 @@ function _KeyValueTableFormForm(props, ref) {
12307
12312
  defaultValue,
12308
12313
  onSubmit,
12309
12314
  extraColumns,
12310
- addButtonText
12315
+ addButtonText,
12316
+ noValueValidation
12311
12317
  } = props;
12312
12318
  const {
12313
12319
  t: t2
@@ -12377,6 +12383,8 @@ function _KeyValueTableFormForm(props, ref) {
12377
12383
  validator: ({
12378
12384
  value: value22
12379
12385
  }) => {
12386
+ if (noValueValidation)
12387
+ return;
12380
12388
  const {
12381
12389
  isValid
12382
12390
  } = validateLabelValue(value22 || "");
@@ -12395,7 +12403,9 @@ function _KeyValueTableFormForm(props, ref) {
12395
12403
  row: {
12396
12404
  deletable: true
12397
12405
  }
12398
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {})]
12406
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {
12407
+ noValueValidation
12408
+ })]
12399
12409
  });
12400
12410
  }
12401
12411
  const KeyValueTableFormForm = React__default.forwardRef(_KeyValueTableFormForm);
@@ -13383,8 +13393,8 @@ const SCReclaimPolicyField = (i18n2) => {
13383
13393
  };
13384
13394
  const IsSCAllowVolumeExpansionField = (i18n2) => {
13385
13395
  return {
13386
- key: "​​allowVolumeExpansion",
13387
- path: ["allowVolumeExpansion"],
13396
+ key: "allowVolumeExpansion",
13397
+ path: ["allowVolumeExpansion"],
13388
13398
  title: i18n2.t("dovetail.allow_expand"),
13389
13399
  renderContent(val) {
13390
13400
  return val ? i18n2.t("dovetail.support") : i18n2.t("dovetail.not_support");
@@ -38398,7 +38408,7 @@ const Separator = () => {
38398
38408
  });
38399
38409
  };
38400
38410
  const MonacoYamlEditor = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
38401
- const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-8f26322f.js"));
38411
+ const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-93fa7132.js"));
38402
38412
  const YamlEditorComponent = forwardRef(
38403
38413
  function YamlEditorComponent2(props, ref) {
38404
38414
  const {
@@ -39607,7 +39617,8 @@ const EditAnnotationForm = React__default.forwardRef(function EditAnnotationForm
39607
39617
  ref,
39608
39618
  defaultValue,
39609
39619
  onSubmit,
39610
- addButtonText: t2("dovetail.add_annotation")
39620
+ addButtonText: t2("dovetail.add_annotation"),
39621
+ noValueValidation: true
39611
39622
  }
39612
39623
  );
39613
39624
  });
@@ -40630,9 +40641,9 @@ const SCReclaimPolicyColumnRenderer = (i18n2) => {
40630
40641
  };
40631
40642
  const SCAllowExpandColumnRenderer = (i18n2) => {
40632
40643
  return {
40633
- key: "​​allowVolumeExpansion",
40644
+ key: "allowVolumeExpansion",
40634
40645
  display: true,
40635
- dataIndex: ["​​allowVolumeExpansion"],
40646
+ dataIndex: ["allowVolumeExpansion"],
40636
40647
  title: i18n2.t("dovetail.allow_expand"),
40637
40648
  width: 120,
40638
40649
  sortable: true,
package/dist/refine.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bN, cC, A, aW, aY, aF, ca, bk, a1, co, cc, aQ, T, C, i, cG, aI, bp, ac, cI, ai, ap, cR, ax, cd, cb, cU, aM, bw, w, aD, bD, cT, cD, bG, D, b1, as, bJ, ar, at, a0, c9, c8, cS, bi, aU, ad, bQ, cF, cH, cm, aG, aj, s, q, cJ, I, bt, aT, t, M, be, bg, ce, cL, aL, bs, aq, ay, az, a8, aA, aX, aE, bE, bH, a9, d2, cn, cx, bM, N, a2, e, aV, a6, bP, by, bx, cK, b$, cZ, g, cY, aJ, bq, cg, L, ba, bb, bo, H, bc, J, bd, B, b5, cA, z, b4, G, b8, E, b6, F, b7, K, c0, b9, cz, aa, d0, c$, P, bm, v, ae, ah, b_, bj, cP, cO, a$, bu, c6, c5, p, aK, bl, x, bv, b0, d1, y, cq, cE, bK, bR, bS, d4, aH, R, ag, an, am, bL, ak, cQ, c2, al, cB, c7, bh, bA, au, h, Q, O, bf, ct, cw, cs, cr, cu, cv, cp, ch, ck, cl, cj, ci, cf, cy, bT, aN, br, aB, m, bW, l, aZ, cX, o, bX, a_, n, aS, bn, k, cW, aP, aR, c4, bC, bB, c3, aO, S, bF, cV, c_, b2, b3, bz, bI, c1, bY, bZ, ab, $, cN, af, W, cM, ao, aw, av, f, aC, bU, U, a3, d, d7, d6, d9, d3, a7, da, d5, d8, a5, a4, r, a, c, X, V, Y, Z, u, bO, _, bV, b } from "./index-8560b9d7.js";
1
+ import { bN, cC, A, aW, aY, aF, ca, bk, a1, co, cc, aQ, T, C, i, cG, aI, bp, ac, cI, ai, ap, cR, ax, cd, cb, cU, aM, bw, w, aD, bD, cT, cD, bG, D, b1, as, bJ, ar, at, a0, c9, c8, cS, bi, aU, ad, bQ, cF, cH, cm, aG, aj, s, q, cJ, I, bt, aT, t, M, be, bg, ce, cL, aL, bs, aq, ay, az, a8, aA, aX, aE, bE, bH, a9, d2, cn, cx, bM, N, a2, e, aV, a6, bP, by, bx, cK, b$, cZ, g, cY, aJ, bq, cg, L, ba, bb, bo, H, bc, J, bd, B, b5, cA, z, b4, G, b8, E, b6, F, b7, K, c0, b9, cz, aa, d0, c$, P, bm, v, ae, ah, b_, bj, cP, cO, a$, bu, c6, c5, p, aK, bl, x, bv, b0, d1, y, cq, cE, bK, bR, bS, d4, aH, R, ag, an, am, bL, ak, cQ, c2, al, cB, c7, bh, bA, au, h, Q, O, bf, ct, cw, cs, cr, cu, cv, cp, ch, ck, cl, cj, ci, cf, cy, bT, aN, br, aB, m, bW, l, aZ, cX, o, bX, a_, n, aS, bn, k, cW, aP, aR, c4, bC, bB, c3, aO, S, bF, cV, c_, b2, b3, bz, bI, c1, bY, bZ, ab, $, cN, af, W, cM, ao, aw, av, f, aC, bU, U, a3, d, d7, d6, d9, d3, a7, da, d5, d8, a5, a4, r, a, c, X, V, Y, Z, u, bO, _, bV, b } from "./index-9c0a49f4.js";
2
2
  import "@cloudtower/eagle";
3
3
  import "@refinedev/core";
4
4
  import "react";
@@ -1554,7 +1554,7 @@ var __publicField = (obj, key, value) => {
1554
1554
  const pvc_storage_required = "请填写分配量。";
1555
1555
  const pvc_storage_min = "请输入正整数。";
1556
1556
  const pvc_storage_reduce_limit = "输入值不得小于当前数值。";
1557
- const pvc_storage_max_limit = "分配量不能超过 64TiB。";
1557
+ const pvc_storage_max_limit = "分配量不能超过 64 TiB。";
1558
1558
  const key_empty_text = "请填写键。";
1559
1559
  const format_error = "格式错误。";
1560
1560
  const taint_effect_empty_text = "请选择效果。";
@@ -12195,8 +12195,7 @@ var __publicField = (obj, key, value) => {
12195
12195
  });
12196
12196
  }
12197
12197
  function validateLabelKey(key2) {
12198
- const labelPrefixRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.]*[a-zA-Z0-9]$)/;
12199
- const labelNameRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
12198
+ const labelRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
12200
12199
  let prefix, name2;
12201
12200
  const splitResult = key2.split("/");
12202
12201
  if (splitResult.length === 1) {
@@ -12208,10 +12207,10 @@ var __publicField = (obj, key, value) => {
12208
12207
  if (prefix === "") {
12209
12208
  return { isValid: false, errorMessage: "EMPTY_PREFIX" };
12210
12209
  }
12211
- if (prefix && !labelPrefixRegex.test(prefix)) {
12210
+ if (prefix && !labelRegex.test(prefix)) {
12212
12211
  return { isValid: false, errorMessage: "INVALID_PREFIX" };
12213
12212
  }
12214
- if (!labelNameRegex.test(name2)) {
12213
+ if (!labelRegex.test(name2)) {
12215
12214
  return { isValid: false, errorMessage: "INVALID_NAME" };
12216
12215
  }
12217
12216
  if (prefix && prefix.length > 253) {
@@ -12223,7 +12222,7 @@ var __publicField = (obj, key, value) => {
12223
12222
  return { isValid: true };
12224
12223
  }
12225
12224
  function validateLabelValue(value2) {
12226
- const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
12225
+ const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
12227
12226
  if (value2 === "") {
12228
12227
  return { isValid: true };
12229
12228
  }
@@ -12237,31 +12236,37 @@ var __publicField = (obj, key, value) => {
12237
12236
  }
12238
12237
  const LabelFormatPopover_105yfzn = "";
12239
12238
  const PodLabelFormatRulePopoverStyle = "p5jt6nm";
12240
- const LabelFormatPopover = () => {
12239
+ const LabelFormatPopover = ({
12240
+ noValueValidation
12241
+ }) => {
12241
12242
  const {
12242
12243
  t: t2
12243
12244
  } = useTranslation();
12245
+ const data2 = [{
12246
+ object: t2("dovetail.key"),
12247
+ contains: t2("dovetail.suffix"),
12248
+ optional: t2("dovetail.no"),
12249
+ rule: [t2("dovetail.suffix_format_rule_1"), t2("dovetail.suffix_format_rule_2"), t2("dovetail.suffix_format_rule_3")]
12250
+ }, {
12251
+ object: t2("dovetail.key"),
12252
+ contains: t2("dovetail.name"),
12253
+ optional: t2("dovetail.yes"),
12254
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12255
+ }];
12256
+ if (!noValueValidation) {
12257
+ data2.push({
12258
+ object: t2("dovetail.value"),
12259
+ contains: t2("dovetail.name"),
12260
+ optional: t2("dovetail.no"),
12261
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12262
+ });
12263
+ }
12244
12264
  return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Popover, {
12245
12265
  overlayClassName: PodLabelFormatRulePopoverStyle,
12246
12266
  placement: "bottomRight",
12247
12267
  content: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.AntdTable, {
12248
12268
  bordered: true,
12249
- dataSource: [{
12250
- object: t2("dovetail.key"),
12251
- contains: t2("dovetail.suffix"),
12252
- optional: t2("dovetail.no"),
12253
- rule: [t2("dovetail.suffix_format_rule_1"), t2("dovetail.suffix_format_rule_2"), t2("dovetail.suffix_format_rule_3")]
12254
- }, {
12255
- object: t2("dovetail.key"),
12256
- contains: t2("dovetail.name"),
12257
- optional: t2("dovetail.yes"),
12258
- rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12259
- }, {
12260
- object: t2("dovetail.value"),
12261
- contains: t2("dovetail.name"),
12262
- optional: t2("dovetail.no"),
12263
- rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12264
- }],
12269
+ dataSource: data2,
12265
12270
  columns: [{
12266
12271
  key: "object",
12267
12272
  title: t2("dovetail.object"),
@@ -12313,7 +12318,8 @@ var __publicField = (obj, key, value) => {
12313
12318
  defaultValue,
12314
12319
  onSubmit,
12315
12320
  extraColumns,
12316
- addButtonText
12321
+ addButtonText,
12322
+ noValueValidation
12317
12323
  } = props;
12318
12324
  const {
12319
12325
  t: t2
@@ -12383,6 +12389,8 @@ var __publicField = (obj, key, value) => {
12383
12389
  validator: ({
12384
12390
  value: value22
12385
12391
  }) => {
12392
+ if (noValueValidation)
12393
+ return;
12386
12394
  const {
12387
12395
  isValid
12388
12396
  } = validateLabelValue(value22 || "");
@@ -12401,7 +12409,9 @@ var __publicField = (obj, key, value) => {
12401
12409
  row: {
12402
12410
  deletable: true
12403
12411
  }
12404
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {})]
12412
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {
12413
+ noValueValidation
12414
+ })]
12405
12415
  });
12406
12416
  }
12407
12417
  const KeyValueTableFormForm = React.forwardRef(_KeyValueTableFormForm);
@@ -13389,8 +13399,8 @@ var __publicField = (obj, key, value) => {
13389
13399
  };
13390
13400
  const IsSCAllowVolumeExpansionField = (i18n2) => {
13391
13401
  return {
13392
- key: "​​allowVolumeExpansion",
13393
- path: ["allowVolumeExpansion"],
13402
+ key: "allowVolumeExpansion",
13403
+ path: ["allowVolumeExpansion"],
13394
13404
  title: i18n2.t("dovetail.allow_expand"),
13395
13405
  renderContent(val) {
13396
13406
  return val ? i18n2.t("dovetail.support") : i18n2.t("dovetail.not_support");
@@ -39613,7 +39623,8 @@ WARNING: This link could potentially be dangerous`)) {
39613
39623
  ref,
39614
39624
  defaultValue,
39615
39625
  onSubmit,
39616
- addButtonText: t2("dovetail.add_annotation")
39626
+ addButtonText: t2("dovetail.add_annotation"),
39627
+ noValueValidation: true
39617
39628
  }
39618
39629
  );
39619
39630
  });
@@ -40636,9 +40647,9 @@ WARNING: This link could potentially be dangerous`)) {
40636
40647
  };
40637
40648
  const SCAllowExpandColumnRenderer = (i18n2) => {
40638
40649
  return {
40639
- key: "​​allowVolumeExpansion",
40650
+ key: "allowVolumeExpansion",
40640
40651
  display: true,
40641
- dataIndex: ["​​allowVolumeExpansion"],
40652
+ dataIndex: ["allowVolumeExpansion"],
40642
40653
  title: i18n2.t("dovetail.allow_expand"),
40643
40654
  width: 120,
40644
40655
  sortable: true,
@@ -10,6 +10,7 @@ interface KeyValueTableFormFormProps<T extends KeyValuePair> {
10
10
  onSubmit: (value: T[]) => Promise<unknown> | undefined;
11
11
  extraColumns?: TableFormColumn[];
12
12
  addButtonText?: string;
13
+ noValueValidation?: boolean;
13
14
  }
14
15
  export declare const KeyValueTableFormForm: React.ForwardRefExoticComponent<KeyValueTableFormFormProps<KeyValuePair> & React.RefAttributes<EditFieldFormHandler>>;
15
16
  export {};
@@ -1,3 +1,5 @@
1
1
  import React from 'react';
2
2
  export declare const PodLabelFormatRulePopoverStyle: import("@linaria/core").LinariaClassName;
3
- export declare const LabelFormatPopover: React.FC;
3
+ export declare const LabelFormatPopover: React.FC<{
4
+ noValueValidation?: boolean;
5
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.1.15-alpha.2",
3
+ "version": "0.1.15",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",