@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.123 → 0.0.1-alpha.125

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,8 +1,8 @@
1
1
  import o, { useRef, useContext, useDebugValue, createElement, useState, useLayoutEffect, useEffect, Fragment, createContext, useMemo, isValidElement, cloneElement, useCallback, useInsertionEffect, useSyncExternalStore, memo, Suspense } from 'react';
2
2
  import { Input, Tree, Modal, Alert, theme, Select, Tag, Breadcrumb, Spin, Menu, Tooltip, Space, Button, Flex, Typography, Card, Row, Col, Tabs, Form, Popover, notification, Table, Slider, InputNumber, Switch, Dropdown, Result, Progress, Checkbox } from 'antd';
3
- import { LoadingOutlined, ExclamationCircleFilled, CloseCircleFilled, CheckCircleFilled, CaretDownOutlined, CaretRightOutlined, InfoCircleOutlined, EyeOutlined, EyeInvisibleOutlined, SearchOutlined, EditOutlined, DeleteOutlined, CheckOutlined, CloseOutlined, BugOutlined, PlusOutlined, EllipsisOutlined } from '@ant-design/icons';
3
+ import { LoadingOutlined, ExclamationCircleFilled, CloseCircleFilled, CheckCircleFilled, CaretDownOutlined, CaretRightOutlined, InfoCircleOutlined, EyeOutlined, EyeInvisibleOutlined, SearchOutlined, EditOutlined, DeleteOutlined, CheckOutlined, CloseOutlined, BugOutlined, PlusOutlined, EllipsisOutlined, ClearOutlined } from '@ant-design/icons';
4
4
  import { useQuery, useQueries, useQueryClient } from '@tanstack/react-query';
5
- import { Link, useLocation, useNavigate } from 'react-router-dom';
5
+ import { Link, useLocation, useNavigate, useSearchParams } from 'react-router-dom';
6
6
 
7
7
  function getDefaultExportFromCjs$1 (x) {
8
8
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -8431,6 +8431,17 @@ const ResumeCircleIcon = () => {
8431
8431
  ) });
8432
8432
  };
8433
8433
 
8434
+ const LookingGlassIcon = ({ width, height }) => {
8435
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: width ?? 36, height: height ?? 37, viewBox: "0 0 36 37", fill: "none", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
8436
+ "path",
8437
+ {
8438
+ d: "M35.7507 33.7958L24.1569 22.202C25.9561 19.8761 26.9293 17.0324 26.9293 14.0413C26.9293 10.4609 25.5319 7.10379 23.0052 4.57254C20.4784 2.04129 17.1123 0.648438 13.5364 0.648438C9.96052 0.648438 6.59445 2.04576 4.06766 4.57254C1.53641 7.09933 0.143555 10.4609 0.143555 14.0413C0.143555 17.6172 1.54088 20.9833 4.06766 23.51C6.59445 26.0413 9.95605 27.4342 13.5364 27.4342C16.5275 27.4342 19.3668 26.4609 21.6927 24.6663L33.2864 36.2556C33.3204 36.2896 33.3608 36.3166 33.4052 36.335C33.4496 36.3534 33.4972 36.3629 33.5453 36.3629C33.5934 36.3629 33.6411 36.3534 33.6855 36.335C33.7299 36.3166 33.7703 36.2896 33.8043 36.2556L35.7507 34.3136C35.7847 34.2796 35.8117 34.2393 35.8301 34.1948C35.8485 34.1504 35.858 34.1028 35.858 34.0547C35.858 34.0066 35.8485 33.959 35.8301 33.9146C35.8117 33.8701 35.7847 33.8298 35.7507 33.7958ZM20.6078 21.1127C18.715 23.0011 16.2061 24.0413 13.5364 24.0413C10.8668 24.0413 8.35784 23.0011 6.46498 21.1127C4.57659 19.2199 3.53641 16.7109 3.53641 14.0413C3.53641 11.3717 4.57659 8.85826 6.46498 6.96987C8.35784 5.08147 10.8668 4.04129 13.5364 4.04129C16.2061 4.04129 18.7194 5.07701 20.6078 6.96987C22.4962 8.86272 23.5364 11.3717 23.5364 14.0413C23.5364 16.7109 22.4962 19.2243 20.6078 21.1127Z",
8439
+ fill: "currentColor",
8440
+ fillOpacity: "0.88"
8441
+ }
8442
+ ) });
8443
+ };
8444
+
8434
8445
  const ContentContainer = st$1.div`
8435
8446
  border: 1px solid ${({ $borderColor }) => $borderColor};
8436
8447
  border-radius: 6px;
@@ -34894,7 +34905,7 @@ const LabelsToSearchParams = ({ data, children }) => {
34894
34905
  }
34895
34906
  const labels = Object.entries(labelsRaw).map(([key, value]) => `${key}=${value}`).join(",");
34896
34907
  const labelsEncoded = encodeURIComponent(labels);
34897
- const hrefPrepared = `${linkPrefixPrepared}?${labelsEncoded}`;
34908
+ const hrefPrepared = `${linkPrefixPrepared}${labelsEncoded}`;
34898
34909
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography.Link, { href: hrefPrepared, ...linkProps, children: [
34899
34910
  labels,
34900
34911
  children
@@ -36881,9 +36892,9 @@ const fnv1a32 = (str) => {
36881
36892
  const pickInRange = (u32, min, max) => min + u32 % (max - min + 1);
36882
36893
  const hslFromString = (value, theme) => {
36883
36894
  const hash = fnv1a32(value);
36884
- const hue = hash % 360;
36885
- const [sMin, sMax] = theme === "light" ? [5, 10] : [5, 15];
36886
- const [lMin, lMax] = theme === "light" ? [88, 94] : [18, 25];
36895
+ const hue = hash % 345;
36896
+ const [sMin, sMax] = theme === "light" ? [90, 100] : [78, 80];
36897
+ const [lMin, lMax] = theme === "light" ? [78, 80] : [35, 40];
36887
36898
  const s = pickInRange(hash >>> 8, sMin, sMax);
36888
36899
  const l = pickInRange(hash >>> 16, lMin, lMax);
36889
36900
  return `hsl(${hue}, ${s}%, ${l}%)`;
@@ -49710,7 +49721,6 @@ const SelectTag = st$1(Tag)`
49710
49721
  align-items: center;
49711
49722
  white-space: normal;
49712
49723
  line-height: 1.1;
49713
- max-width: 240px;
49714
49724
  `;
49715
49725
  const SelectTagSpan = st$1.span`
49716
49726
  display: inline-flex;
@@ -49725,6 +49735,7 @@ const MaxTagPlacheolderLength = st$1.span`
49725
49735
  padding-left: 4px;
49726
49736
  border: 1px solid ${({ $colorBorder }) => $colorBorder};
49727
49737
  border-radius: 20px;
49738
+ margin-right: 8px;
49728
49739
  `;
49729
49740
  const OptionLabelKind = st$1.div`
49730
49741
  font-size: 14px;
@@ -49741,14 +49752,16 @@ const OptionLabelVersion = st$1.div`
49741
49752
  const BackgroundContainer = st$1.div`
49742
49753
  width: 100%;
49743
49754
  gap: 8px;
49744
- border: 1px solid ${({ $colorBorder }) => $colorBorder};
49755
+ border: 1px solid
49756
+ ${({ $visibleBackground, $colorBorder }) => $visibleBackground && $colorBorder ? $colorBorder : "transparent"};
49745
49757
  border-radius: 6px;
49746
- background: ${({ $colorBgLayout }) => $colorBgLayout};
49758
+ background: ${({ $visibleBackground, $colorBgLayout }) => $visibleBackground && $colorBgLayout ? $colorBgLayout : "initial"};
49747
49759
  padding: 8px;
49748
49760
  `;
49749
49761
  const FormContainer = st$1.div`
49750
49762
  display: grid;
49751
- grid-template-columns: 3fr 9fr;
49763
+ /* grid-template-columns: 3fr 9fr; */
49764
+ grid-template-columns: 3fr 130px 9fr;
49752
49765
  gap: 8px;
49753
49766
  `;
49754
49767
  const ResetedFormItem = st$1(Form.Item)`
@@ -49757,41 +49770,38 @@ const ResetedFormItem = st$1(Form.Item)`
49757
49770
  const HideableContainer = st$1.div`
49758
49771
  display: ${({ $isHidden }) => $isHidden ? "none" : "initial"};
49759
49772
  `;
49760
- const CompoundItem = st$1.div`
49773
+ const BottomTagsContainer = st$1.div`
49761
49774
  display: grid;
49762
- grid-template-columns: 130px 1fr;
49775
+ grid-template-columns: 1fr 50px;
49776
+ gap: 8px;
49777
+ margin-top: 8px;
49763
49778
  `;
49764
- const LeftSideSelect = st$1(Select)`
49765
- /* stylelint-disable declaration-no-important */
49766
-
49767
- .ant-select-selector {
49768
- border-top-right-radius: 0 !important;
49769
- border-bottom-right-radius: 0 !important;
49770
- border-right-width: 0 !important;
49771
- height: 32px !important;
49772
- }
49779
+ const OptionsFlex = st$1.div`
49780
+ display: flex;
49781
+ flex-flow: column;
49782
+ gap: 8px;
49773
49783
  `;
49774
- const RightSideInput = st$1(Input)`
49775
- &&&.ant-input-outlined {
49776
- border-top-left-radius: 0 !important;
49777
- border-bottom-left-radius: 0 !important;
49778
- border-left-width: 0 !important;
49779
- height: 32px !important;
49780
- }
49784
+ const BottomTagsRow = st$1.div`
49785
+ display: grid;
49786
+ grid-template-columns: 45px 1fr;
49787
+ gap: 4px;
49781
49788
  `;
49782
- const RightSideSelect = st$1(Select)`
49783
- .ant-select-selector {
49784
- border-top-left-radius: 0 !important;
49785
- border-bottom-left-radius: 0 !important;
49786
- border-left-width: 0 !important;
49787
- height: 32px !important;
49788
- }
49789
+ const BottomTagsRowText = st$1.div`
49790
+ color: ${({ $colorDescription }) => $colorDescription};
49791
+ font-size: 12px;
49792
+ font-style: italic;
49793
+ font-weight: 400;
49794
+ line-height: 14px; /* 116.667% */
49795
+ display: flex;
49796
+ justify-content: flex-end;
49797
+ align-items: flex-start;
49798
+ height: 100%;
49799
+ padding-top: 5px;
49789
49800
  `;
49790
49801
  const BottomTagsHolder = st$1.div`
49791
49802
  display: flex;
49792
49803
  gap: 4px;
49793
49804
  flex-wrap: wrap;
49794
- margin-top: 8px;
49795
49805
  `;
49796
49806
  const CustomTag = st$1(Tag)`
49797
49807
  font-size: 14px;
@@ -49801,13 +49811,14 @@ const CustomTag = st$1(Tag)`
49801
49811
  const Abbr = st$1.span`
49802
49812
  background-color: ${({ $bgColor }) => $bgColor};
49803
49813
  border-radius: 13px;
49804
- padding: 2px 5px;
49814
+ padding: 1px 5px;
49815
+ font-size: 13px;
49805
49816
  height: min-content;
49817
+ margin-right: 4px;
49806
49818
  `;
49807
49819
  const ClearButtonHolder = st$1.div`
49808
49820
  display: flex;
49809
49821
  justify-content: flex-end;
49810
- margin-top: 8px;
49811
49822
  `;
49812
49823
  const Styled = {
49813
49824
  SelectTag,
@@ -49820,10 +49831,14 @@ const Styled = {
49820
49831
  FormContainer,
49821
49832
  ResetedFormItem,
49822
49833
  HideableContainer,
49823
- CompoundItem,
49824
- LeftSideSelect,
49825
- RightSideInput,
49826
- RightSideSelect,
49834
+ // CompoundItem,
49835
+ // LeftSideSelect,
49836
+ // RightSideInput,
49837
+ // RightSideSelect,
49838
+ BottomTagsContainer,
49839
+ OptionsFlex,
49840
+ BottomTagsRow,
49841
+ BottomTagsRowText,
49827
49842
  BottomTagsHolder,
49828
49843
  CustomTag,
49829
49844
  Abbr,
@@ -49832,26 +49847,17 @@ const Styled = {
49832
49847
 
49833
49848
  const Search = ({ theme: theme$1, form, constants, kindsWithVersion }) => {
49834
49849
  const { token } = theme.useToken();
49850
+ const [sp, setSearchParams] = useSearchParams();
49835
49851
  const { FIELD_NAME, FIELD_NAME_STRING, FIELD_NAME_LABELS, FIELD_NAME_FIELDS, TYPE_SELECTOR } = constants;
49836
49852
  const watchedKinds = Form.useWatch(FIELD_NAME, form);
49837
49853
  const watchedName = Form.useWatch(FIELD_NAME_STRING, form);
49838
49854
  const watchedLabels = Form.useWatch(FIELD_NAME_LABELS, form);
49839
49855
  const watchedFields = Form.useWatch(FIELD_NAME_FIELDS, form);
49840
49856
  const watchedTypedSelector = Form.useWatch(TYPE_SELECTOR, form);
49841
- const options = kindsWithVersion?.map(({ kind, group, version }) => {
49857
+ const options = kindsWithVersion.filter(({ version }) => version.verbs && version.verbs.includes("list")).map(({ kind, group, version }) => {
49842
49858
  const abbr = getUppercase(kind);
49843
- const bgColor = kind && kind.length ? hslFromString(abbr, theme$1) : "";
49859
+ const bgColor = kind && kind.length ? hslFromString(kind, theme$1) : "";
49844
49860
  return {
49845
- // kindWithVersion?.map(({ kind, notUnique, group, version }) => ({
49846
- // label: notUnique ? (
49847
- // <div>
49848
- // {kind}
49849
- // <br />
49850
- // {version.groupVersion}
49851
- // </div>
49852
- // ) : (
49853
- // kind
49854
- // ),
49855
49861
  label: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 8, align: "center", children: [
49856
49862
  bgColor.length && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.Abbr, { $bgColor: bgColor, children: abbr }),
49857
49863
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 2, vertical: true, children: [
@@ -49880,7 +49886,7 @@ const Search = ({ theme: theme$1, form, constants, kindsWithVersion }) => {
49880
49886
  /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.MaxTagPlacheolderLength, { $colorBorder: token.colorBorder, children: watchedKinds?.length ? watchedKinds.length : "0" })
49881
49887
  ] });
49882
49888
  const maxTagTagRender = ({ label }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.MaxTagPlacheolder, { children: label });
49883
- const getKindByGvr = kindByGvr(kindsWithVersion || []);
49889
+ const getKindByGvr = kindByGvr(kindsWithVersion);
49884
49890
  const removeKind = (value) => {
49885
49891
  const cur = form.getFieldValue(FIELD_NAME) || [];
49886
49892
  form.setFieldsValue({ [FIELD_NAME]: cur.filter((v) => v !== value) });
@@ -49904,197 +49910,214 @@ const Search = ({ theme: theme$1, form, constants, kindsWithVersion }) => {
49904
49910
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: option.label })
49905
49911
  ] });
49906
49912
  };
49907
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.BackgroundContainer, { $colorBorder: token.colorBorder, $colorBgLayout: token.colorBgLayout, children: [
49908
- /* @__PURE__ */ jsxRuntimeExports.jsx(Form, { form, layout: "vertical", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.FormContainer, { children: [
49909
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.ResetedFormItem, { name: FIELD_NAME, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49910
- Select,
49911
- {
49912
- mode: "multiple",
49913
- placeholder: "Select",
49914
- options,
49915
- filterOption: (input, option) => (option?.value || "").toString().toLowerCase().includes(input.toLowerCase()),
49916
- allowClear: true,
49917
- showSearch: true,
49918
- maxTagCount: 0,
49919
- maxTagPlaceholder,
49920
- tagRender: maxTagTagRender,
49921
- menuItemSelectedIcon: null,
49922
- optionRender: kindOptionRender
49923
- }
49924
- ) }),
49925
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.CompoundItem, { children: [
49926
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.ResetedFormItem, { name: TYPE_SELECTOR, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49927
- Styled.LeftSideSelect,
49928
- {
49929
- placeholder: "Select",
49930
- options: [
49931
- { label: "Name", value: "name" },
49932
- { label: "Labels", value: "labels" },
49933
- { label: "Fields", value: "fields" }
49934
- ],
49935
- defaultValue: "name",
49936
- filterOption: filterSelectOptions,
49937
- showSearch: true
49938
- }
49939
- ) }),
49940
- /* @__PURE__ */ jsxRuntimeExports.jsx(
49941
- Styled.HideableContainer,
49942
- {
49943
- $isHidden: watchedTypedSelector === "labels" || watchedTypedSelector === "fields",
49944
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.ResetedFormItem, { name: FIELD_NAME_STRING, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.RightSideInput, { allowClear: true, placeholder: "Name", disabled: !watchedKinds || !watchedKinds.length }) })
49945
- }
49946
- ),
49947
- /* @__PURE__ */ jsxRuntimeExports.jsx(
49948
- Styled.HideableContainer,
49949
- {
49950
- $isHidden: watchedTypedSelector === "name" || watchedTypedSelector === "fields" || watchedTypedSelector === void 0,
49951
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49952
- Styled.ResetedFormItem,
49953
- {
49954
- name: FIELD_NAME_LABELS,
49955
- validateTrigger: "onBlur",
49956
- rules: [
49957
- () => ({
49958
- validator(_, value) {
49959
- if (Array.isArray(value) && value.every((str) => typeof str === "string" && str.includes("=") && !str.startsWith("="))) {
49960
- return Promise.resolve();
49913
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
49914
+ Styled.BackgroundContainer,
49915
+ {
49916
+ $colorBorder: token.colorBorder,
49917
+ $colorBgLayout: token.colorBgLayout,
49918
+ $visibleBackground: Boolean(
49919
+ watchedKinds && watchedKinds.length || watchedName && watchedName.length || watchedLabels && watchedLabels.length || watchedFields && watchedFields.length
49920
+ ),
49921
+ children: [
49922
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Form, { form, layout: "vertical", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.FormContainer, { children: [
49923
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.ResetedFormItem, { name: FIELD_NAME, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49924
+ Select,
49925
+ {
49926
+ mode: "multiple",
49927
+ placeholder: "Select kinds",
49928
+ options,
49929
+ filterOption: (input, option) => (option?.value || "").toString().toLowerCase().includes(input.toLowerCase()),
49930
+ allowClear: true,
49931
+ showSearch: true,
49932
+ maxTagCount: 0,
49933
+ maxTagPlaceholder,
49934
+ tagRender: maxTagTagRender,
49935
+ menuItemSelectedIcon: null,
49936
+ optionRender: kindOptionRender
49937
+ }
49938
+ ) }),
49939
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.ResetedFormItem, { name: TYPE_SELECTOR, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49940
+ Select,
49941
+ {
49942
+ placeholder: "Select",
49943
+ options: [
49944
+ { label: "Name", value: "name" },
49945
+ { label: "Labels", value: "labels" },
49946
+ { label: "Fields", value: "fields" }
49947
+ ],
49948
+ defaultValue: "name",
49949
+ filterOption: filterSelectOptions,
49950
+ showSearch: true
49951
+ }
49952
+ ) }),
49953
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.HideableContainer, { $isHidden: watchedTypedSelector === "labels" || watchedTypedSelector === "fields", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.ResetedFormItem, { name: FIELD_NAME_STRING, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { allowClear: true, placeholder: "Name", disabled: !watchedKinds || !watchedKinds.length }) }) }),
49954
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
49955
+ Styled.HideableContainer,
49956
+ {
49957
+ $isHidden: watchedTypedSelector === "name" || watchedTypedSelector === "fields" || watchedTypedSelector === void 0,
49958
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49959
+ Styled.ResetedFormItem,
49960
+ {
49961
+ name: FIELD_NAME_LABELS,
49962
+ validateTrigger: "onBlur",
49963
+ rules: [
49964
+ () => ({
49965
+ validator(_, value) {
49966
+ if (Array.isArray(value) && value.every((str) => typeof str === "string" && str.includes("=") && !str.startsWith("="))) {
49967
+ return Promise.resolve();
49968
+ }
49969
+ return Promise.reject(new Error("Please enter key=value style"));
49961
49970
  }
49962
- return Promise.reject(new Error("Please enter key=value style"));
49971
+ })
49972
+ ],
49973
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49974
+ Select,
49975
+ {
49976
+ mode: "tags",
49977
+ allowClear: true,
49978
+ placeholder: "Key=Value",
49979
+ tokenSeparators: [",", " ", " "],
49980
+ suffixIcon: null,
49981
+ filterOption: filterSelectOptions,
49982
+ tagRender,
49983
+ maxTagCount: "responsive",
49984
+ disabled: !watchedKinds || !watchedKinds.length
49963
49985
  }
49964
- })
49965
- ],
49966
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49967
- Styled.RightSideSelect,
49968
- {
49969
- mode: "tags",
49970
- allowClear: true,
49971
- placeholder: "Key=Value",
49972
- tokenSeparators: [",", " ", " "],
49973
- suffixIcon: null,
49974
- filterOption: filterSelectOptions,
49975
- tagRender,
49976
- disabled: !watchedKinds || !watchedKinds.length
49977
- }
49978
- )
49979
- }
49980
- )
49981
- }
49982
- ),
49983
- /* @__PURE__ */ jsxRuntimeExports.jsx(
49984
- Styled.HideableContainer,
49985
- {
49986
- $isHidden: watchedTypedSelector === "name" || watchedTypedSelector === "labels" || watchedTypedSelector === void 0,
49987
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49988
- Styled.ResetedFormItem,
49989
- {
49990
- name: FIELD_NAME_FIELDS,
49991
- validateTrigger: "onBlur",
49992
- rules: [
49993
- () => ({
49994
- validator(_, value) {
49995
- if (Array.isArray(value) && value.every((str) => typeof str === "string" && str.includes("=") && !str.startsWith("="))) {
49996
- return Promise.resolve();
49986
+ )
49987
+ }
49988
+ )
49989
+ }
49990
+ ),
49991
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
49992
+ Styled.HideableContainer,
49993
+ {
49994
+ $isHidden: watchedTypedSelector === "name" || watchedTypedSelector === "labels" || watchedTypedSelector === void 0,
49995
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49996
+ Styled.ResetedFormItem,
49997
+ {
49998
+ name: FIELD_NAME_FIELDS,
49999
+ validateTrigger: "onBlur",
50000
+ rules: [
50001
+ () => ({
50002
+ validator(_, value) {
50003
+ if (Array.isArray(value) && value.every((str) => typeof str === "string" && str.includes("=") && !str.startsWith("="))) {
50004
+ return Promise.resolve();
50005
+ }
50006
+ return Promise.reject(new Error("Please enter key=value style"));
49997
50007
  }
49998
- return Promise.reject(new Error("Please enter key=value style"));
50008
+ })
50009
+ ],
50010
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
50011
+ Select,
50012
+ {
50013
+ mode: "tags",
50014
+ allowClear: true,
50015
+ placeholder: "Key=Value",
50016
+ tokenSeparators: [",", " ", " "],
50017
+ suffixIcon: null,
50018
+ filterOption: filterSelectOptions,
50019
+ tagRender,
50020
+ maxTagCount: "responsive",
50021
+ disabled: !watchedKinds || !watchedKinds.length
49999
50022
  }
50000
- })
50001
- ],
50002
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
50003
- Styled.RightSideSelect,
50023
+ )
50024
+ }
50025
+ )
50026
+ }
50027
+ )
50028
+ ] }) }),
50029
+ watchedKinds && watchedKinds.length || watchedName && watchedName.length || watchedLabels && watchedLabels.length || watchedFields && watchedFields.length ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.BottomTagsContainer, { children: [
50030
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.OptionsFlex, { children: [
50031
+ watchedKinds && watchedKinds.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.BottomTagsRow, { children: [
50032
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.BottomTagsRowText, { $colorDescription: token.colorTextDescription, children: "Kinds:" }),
50033
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.BottomTagsHolder, { children: watchedKinds.map((fullKindName) => {
50034
+ const kind = getKindByGvr(fullKindName);
50035
+ const abbr = getUppercase(kind && kind.length ? kind : "Loading");
50036
+ const bgColor = kind && kind.length ? hslFromString(kind, theme$1) : "";
50037
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
50038
+ Styled.CustomTag,
50004
50039
  {
50005
- mode: "tags",
50006
- allowClear: true,
50007
- placeholder: "Key=Value",
50008
- tokenSeparators: [",", " ", " "],
50009
- suffixIcon: null,
50010
- filterOption: filterSelectOptions,
50011
- tagRender,
50012
- disabled: !watchedKinds || !watchedKinds.length
50013
- }
50014
- )
50015
- }
50016
- )
50017
- }
50018
- )
50019
- ] })
50020
- ] }) }),
50021
- watchedKinds && watchedKinds.length || watchedName && watchedName.length || watchedLabels && watchedLabels.length || watchedFields && watchedFields.length ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
50022
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.BottomTagsHolder, { children: [
50023
- watchedKinds && watchedKinds.map((fullKindName) => {
50024
- const kind = getKindByGvr(fullKindName);
50025
- const abbr = getUppercase(kind && kind.length ? kind : "Loading");
50026
- const bgColor = kind && kind.length ? hslFromString(abbr, theme$1) : "";
50027
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
50028
- Styled.CustomTag,
50040
+ onClose: (e) => {
50041
+ e.preventDefault();
50042
+ removeKind(fullKindName);
50043
+ },
50044
+ closable: true,
50045
+ children: [
50046
+ kind && kind.length && bgColor.length && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.Abbr, { $bgColor: bgColor, children: abbr }),
50047
+ kind
50048
+ ]
50049
+ },
50050
+ fullKindName
50051
+ );
50052
+ }) })
50053
+ ] }),
50054
+ watchedName && watchedName.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.BottomTagsRow, { children: [
50055
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.BottomTagsRowText, { $colorDescription: token.colorTextDescription, children: "Name:" }),
50056
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.BottomTagsHolder, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
50057
+ Styled.CustomTag,
50058
+ {
50059
+ onClose: (e) => {
50060
+ e.preventDefault();
50061
+ clearName();
50062
+ },
50063
+ closable: true,
50064
+ children: watchedName
50065
+ }
50066
+ ) })
50067
+ ] }),
50068
+ watchedLabels && watchedLabels.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.BottomTagsRow, { children: [
50069
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.BottomTagsRowText, { $colorDescription: token.colorTextDescription, children: "Labels:" }),
50070
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.BottomTagsHolder, { children: watchedLabels.map((label) => /* @__PURE__ */ jsxRuntimeExports.jsx(
50071
+ Styled.CustomTag,
50072
+ {
50073
+ onClose: (e) => {
50074
+ e.preventDefault();
50075
+ removeLabel(label);
50076
+ },
50077
+ closable: true,
50078
+ children: label
50079
+ },
50080
+ label
50081
+ )) })
50082
+ ] }),
50083
+ watchedFields && watchedFields.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.BottomTagsRow, { children: [
50084
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.BottomTagsRowText, { $colorDescription: token.colorTextDescription, children: "Fields:" }),
50085
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.BottomTagsHolder, { children: watchedFields.map((field) => /* @__PURE__ */ jsxRuntimeExports.jsx(
50086
+ Styled.CustomTag,
50087
+ {
50088
+ onClose: (e) => {
50089
+ e.preventDefault();
50090
+ removeField(field);
50091
+ },
50092
+ closable: true,
50093
+ children: field
50094
+ },
50095
+ field
50096
+ )) })
50097
+ ] })
50098
+ ] }),
50099
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.ClearButtonHolder, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
50100
+ Button,
50029
50101
  {
50030
- onClose: (e) => {
50031
- e.preventDefault();
50032
- removeKind(fullKindName);
50102
+ type: "primary",
50103
+ onClick: () => {
50104
+ setSearchParams(new URLSearchParams());
50105
+ form.setFieldsValue({
50106
+ [FIELD_NAME]: [],
50107
+ [FIELD_NAME_STRING]: "",
50108
+ [FIELD_NAME_LABELS]: [],
50109
+ [FIELD_NAME_FIELDS]: [],
50110
+ [TYPE_SELECTOR]: "name"
50111
+ // reset selector to default
50112
+ });
50033
50113
  },
50034
- closable: true,
50035
- children: [
50036
- kind && kind.length && bgColor.length && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.Abbr, { $bgColor: bgColor, children: abbr }),
50037
- kind
50038
- ]
50039
- },
50040
- fullKindName
50041
- );
50042
- }),
50043
- watchedName && /* @__PURE__ */ jsxRuntimeExports.jsx(
50044
- Styled.CustomTag,
50045
- {
50046
- onClose: (e) => {
50047
- e.preventDefault();
50048
- clearName();
50049
- },
50050
- closable: true,
50051
- children: watchedName
50052
- }
50053
- ),
50054
- watchedLabels && watchedLabels.map((label) => /* @__PURE__ */ jsxRuntimeExports.jsx(
50055
- Styled.CustomTag,
50056
- {
50057
- onClose: (e) => {
50058
- e.preventDefault();
50059
- removeLabel(label);
50060
- },
50061
- closable: true,
50062
- children: label
50063
- },
50064
- label
50065
- )),
50066
- watchedFields && watchedFields.map((field) => /* @__PURE__ */ jsxRuntimeExports.jsx(
50067
- Styled.CustomTag,
50068
- {
50069
- onClose: (e) => {
50070
- e.preventDefault();
50071
- removeField(field);
50072
- },
50073
- closable: true,
50074
- children: field
50075
- },
50076
- field
50077
- ))
50078
- ] }),
50079
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.ClearButtonHolder, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
50080
- Button,
50081
- {
50082
- type: "primary",
50083
- onClick: () => {
50084
- form.setFieldsValue({
50085
- [FIELD_NAME]: [],
50086
- [FIELD_NAME_STRING]: "",
50087
- [FIELD_NAME_LABELS]: [],
50088
- [FIELD_NAME_FIELDS]: [],
50089
- [TYPE_SELECTOR]: "name"
50090
- // reset selector to default
50091
- });
50092
- },
50093
- children: "Clear"
50094
- }
50095
- ) })
50096
- ] }) : void 0
50097
- ] });
50114
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ClearOutlined, {})
50115
+ }
50116
+ ) })
50117
+ ] }) : void 0
50118
+ ]
50119
+ }
50120
+ );
50098
50121
  };
50099
50122
 
50100
50123
  const isLeafNode = (value) => {
@@ -50243,6 +50266,14 @@ const getSortedKinds = (index) => {
50243
50266
  );
50244
50267
  };
50245
50268
 
50269
+ const namespacedByGvr = (entries) => (gvr) => {
50270
+ const [group = "", v = "", resource = ""] = gvr.split("~", 3);
50271
+ const norm = (s) => s.trim();
50272
+ const kinds = entries.filter((e) => norm(e.group) === norm(group) && e.version.version === v && e.version.resource === resource).map((e) => e.version.namespaced);
50273
+ const uniq = Array.from(new Set(kinds));
50274
+ return uniq.length === 1 ? uniq[0] : void 0;
50275
+ };
50276
+
50246
50277
  const getClusterList = async () => {
50247
50278
  return axios.get("/clusterlist");
50248
50279
  };
@@ -50669,5 +50700,5 @@ const useCrdData = ({
50669
50700
  });
50670
50701
  };
50671
50702
 
50672
- export { BackToDefaultIcon, BlackholeForm, BlackholeFormDataProvider, ContentCard$1 as ContentCard, CursorDefaultDiv, CursorPointerTag, CustomSelect$4 as CustomSelect, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EditIcon, EnrichedTable, EnrichedTableProvider, FlexGrow, LockedIcon, ManageableBreadcrumbs, ManageableBreadcrumbsWithDataProvider, ManageableSidebar, ManageableSidebarWithDataProvider, MarketPlace, MarketplaceCard, MinusIcon, NodeTerminal, PauseCircleIcon, PlusIcon, PodLogs, PodLogsMonaco, PodTerminal, ProjectInfoCard, ResumeCircleIcon, Search, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UncontrolledSelect, UnlockedIcon, UpIcon, YamlEditorSingleton, checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped, checkPermission, createContextFactory, createNewEntry, deepMerge, deleteEntry, feedbackIcons, filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, filterSelectOptions, floorToDecimal, getAllPathsFromObj, getApiResourceSingle, getApiResourceTypes, getApiResourceTypesByApiGroup, getApiResources, getBuiltinResourceSingle, getBuiltinResourceTypes, getBuiltinResources, getBuiltinTreeData, getClusterList, getCrdData, getCrdResourceSingle, getCrdResources, getDirectUnknownResource, getEnrichedColumns, getEnrichedColumnsWithControls, getGroupsByCategory, getKinds, getObjectFormItemsDraft, getPrefixSubarrays, getSortedKinds, getStringByName, getSwagger, getUppercase, groupsToTreeData, hslFromString, isFlatObject, kindByGvr, normalizeValuesForQuotasToNumber, parseQuotaValue, parseQuotaValueCpu, parseQuotaValueMemoryAndStorage, prepareDataForManageableBreadcrumbs, prepareDataForManageableSidebar, prepareTemplate, prepareUrlsToFetchForDynamicRenderer, updateEntry, useApiResourceSingle, useApiResourceTypesByGroup, useApiResources, useApisResourceTypes, useBuiltinResourceSingle, useBuiltinResourceTypes, useBuiltinResources, useClusterList, useCrdData, useCrdResourceSingle, useCrdResources, useDirectUnknownResource, usePermissions };
50703
+ export { BackToDefaultIcon, BlackholeForm, BlackholeFormDataProvider, ContentCard$1 as ContentCard, CursorDefaultDiv, CursorPointerTag, CustomSelect$4 as CustomSelect, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EditIcon, EnrichedTable, EnrichedTableProvider, FlexGrow, LockedIcon, LookingGlassIcon, ManageableBreadcrumbs, ManageableBreadcrumbsWithDataProvider, ManageableSidebar, ManageableSidebarWithDataProvider, MarketPlace, MarketplaceCard, MinusIcon, NodeTerminal, PauseCircleIcon, PlusIcon, PodLogs, PodLogsMonaco, PodTerminal, ProjectInfoCard, ResumeCircleIcon, Search, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UncontrolledSelect, UnlockedIcon, UpIcon, YamlEditorSingleton, checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped, checkPermission, createContextFactory, createNewEntry, deepMerge, deleteEntry, feedbackIcons, filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, filterSelectOptions, floorToDecimal, getAllPathsFromObj, getApiResourceSingle, getApiResourceTypes, getApiResourceTypesByApiGroup, getApiResources, getBuiltinResourceSingle, getBuiltinResourceTypes, getBuiltinResources, getBuiltinTreeData, getClusterList, getCrdData, getCrdResourceSingle, getCrdResources, getDirectUnknownResource, getEnrichedColumns, getEnrichedColumnsWithControls, getGroupsByCategory, getKinds, getObjectFormItemsDraft, getPrefixSubarrays, getSortedKinds, getStringByName, getSwagger, getUppercase, groupsToTreeData, hslFromString, isFlatObject, kindByGvr, namespacedByGvr, normalizeValuesForQuotasToNumber, parseQuotaValue, parseQuotaValueCpu, parseQuotaValueMemoryAndStorage, prepareDataForManageableBreadcrumbs, prepareDataForManageableSidebar, prepareTemplate, prepareUrlsToFetchForDynamicRenderer, updateEntry, useApiResourceSingle, useApiResourceTypesByGroup, useApiResources, useApisResourceTypes, useBuiltinResourceSingle, useBuiltinResourceTypes, useBuiltinResources, useClusterList, useCrdData, useCrdResourceSingle, useCrdResources, useDirectUnknownResource, usePermissions };
50673
50704
  //# sourceMappingURL=openapi-k8s-toolkit.es.js.map