@dovetail-v2/refine 0.0.46-alpha.0 → 0.0.46-alpha.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/dist/style.css CHANGED
@@ -12,19 +12,9 @@
12
12
  .b1vtjd4k.ant-btn.ant-btn-link{display:block;}
13
13
  .luro4rx.ant-btn.ant-btn-link{line-height:18px;height:18px;}
14
14
  .t13a6vox{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;max-width:100%;gap:8px 8px;}
15
- .t12ikbmp.ant-tag{overflow:hidden;text-overflow:ellipsis;color:#1D326C;}.t12ikbmp.ant-tag.outside-tag{background-color:rgba(211,218,235,0.60);}.t12ikbmp.ant-tag .inside-tag{background-color:rgba(192,203,224,0.60);}
15
+ .t12ikbmp.ant-tag{overflow:hidden;text-overflow:ellipsis;color:#1D326C;}.t12ikbmp.ant-tag.outside-tag{border:1px solid #A3B4CC;background-color:#E4E9F2;}.t12ikbmp.ant-tag .inside-tag{background-color:#CCD4E3;}
16
16
  .s8qkbck.ant-tag{padding:3px 16px;height:24px;}.s8qkbck.no-background{background-color:transparent !important;padding:0;}
17
17
  .t19ustft{display:inline-block;line-height:18px;height:18px;border-bottom:1px dashed rgba(107,128,167,0.6);}
18
- .sj0ggy.ant-select .ant-select-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;overflow:hidden;gap:4px;}.sj0ggy.ant-select .ant-select-selector > span{max-width:calc(100% - 76px);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}.sj0ggy.ant-select .ant-select-selection-search{display:none;}.sj0ggy.ant-select .zoom-leave{opacity:0;position:absolute;}
19
- .d1eo8uqs{border-radius:6px;}
20
- .s64gojc.s64gojc.ant-input-affix-wrapper{border:unset;border-bottom:1px solid rgba(211,218,235,.6);border-radius:unset;box-shadow:unset;outline:unset;padding:5px 18px;}.s64gojc.s64gojc.ant-input-affix-wrapper:hover,.s64gojc.s64gojc.ant-input-affix-wrapper:focus{box-shadow:unset;outline:unset;}
21
- .s16fqgtu .ant-select-item-group{border-bottom:1px solid rgba(211,218,235,0.6);min-height:0;padding:0;overflow:hidden;margin:6px 0;}
22
- .tgaujbg{max-width:100%;margin-right:0 !important;}
23
- .c1vbd54v{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;margin-right:0;}
24
-
25
- .lqrghwd{margin-right:8px;}
26
- .api7z1z{border-radius:4px;margin:6px;margin-bottom:0;padding:4px 8px 4px 12px;}
27
- .o38b23x.ant-select-item{margin:0 6px;border-radius:4px;padding:4px 8px 4px 12px;}.o38b23x.ant-select-item:not(:last-of-type){margin-bottom:3px;}.o38b23x.ant-select-item:last-of-type{margin-bottom:6px;}
28
18
  .t1v3ienx{padding:12px 24px;}
29
19
  .tgejfwe{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;width:100%;}
30
20
  .tq6dc79{color:#00122E;}
@@ -32,7 +22,7 @@
32
22
  .w16agr8o.ant-space{width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}
33
23
  .i1u1f5zp{white-space:pre-line;}
34
24
  .c8jy7dc{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:8px 10px;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:8px;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;border-radius:4px;background:rgba(237,241,250,0.6);}.c8jy7dc:not(:last-of-type){margin-bottom:8px;}
35
- .k2sddxl{color:rgba(44,56,82,0.6);width:calc(30% - 4px);margin-right:8px;word-break:break-all;}
25
+ .k2sddxl{color:rgba(44,56,82,0.75);width:calc(30% - 4px);margin-right:8px;word-break:break-all;}
36
26
  .v16vicsr{word-break:break-all;white-space:pre-wrap;width:calc(70% - 4px);}
37
27
  .w14056kz{width:100%;}
38
28
  .hisq2gt{width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.hisq2gt.expanded{margin-bottom:8px;}
@@ -1516,11 +1506,23 @@
1516
1506
  .e1cjl2b8{border-radius:8px;border:1px solid rgba(211,218,235,0.60);}.e1cjl2b8 .monaco-editor,.e1cjl2b8 .monaco-scrollable-element,.e1cjl2b8 .overflow-guard > .margin{border-radius:8px;}
1517
1507
  .w1akirqw{height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
1518
1508
  .t30srnq{line-height:32px !important;}
1509
+ .sj0ggy.ant-select{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;min-width:276px;max-width:100%;}.sj0ggy.ant-select .ant-select-selector{display:block;overflow:hidden;padding-right:32px;white-space:nowrap;}.sj0ggy.ant-select .ant-select-selector > span:nth-child(-n + 8):not(.ant-select-selection-search){display:inline-block;max-width:var(--tag-max-width);margin-right:4px;}.sj0ggy.ant-select .ant-select-selection-search{display:none;}.sj0ggy.ant-select .zoom-leave{opacity:0;position:absolute;}
1510
+ .d1eo8uqs{border-radius:6px;}
1511
+ .s64gojc.s64gojc.ant-input-affix-wrapper{border:unset;border-bottom:1px solid rgba(211,218,235,.6);border-radius:unset;box-shadow:unset;outline:unset;padding:5px 18px;}.s64gojc.s64gojc.ant-input-affix-wrapper:hover,.s64gojc.s64gojc.ant-input-affix-wrapper:focus{box-shadow:unset;outline:unset;}
1512
+ .s16fqgtu .ant-select-item-group{border-bottom:1px solid rgba(211,218,235,0.6);min-height:0;padding:0;overflow:hidden;margin:6px 0;}
1513
+ .tgaujbg{max-width:100%;margin-right:0 !important;}
1514
+ .c1vbd54v{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;margin-right:0 !important;}
1515
+
1516
+ .lqrghwd{margin-right:8px;}
1517
+ .api7z1z{border-radius:4px;margin:6px;margin-bottom:0;padding:4px 8px 4px 12px;}
1518
+ .o38b23x.ant-select-item{margin:0 6px;border-radius:4px;padding:4px 8px 4px 12px;}.o38b23x.ant-select-item:not(:last-of-type){margin-bottom:3px;}.o38b23x.ant-select-item:last-of-type{margin-bottom:6px;}
1519
1519
  .laykzsq{width:100%;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
1520
1520
  .l1ng0psc{padding:12px 24px;-webkit-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-height:0;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
1521
1521
  .tj6zpn4{-webkit-flex:1;-ms-flex:1;flex:1;min-height:0;}.tj6zpn4.table-wrapper{height:auto;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;min-height:0;}
1522
1522
  .n1rqcyjn.ant-select{margin-bottom:12px;}
1523
- .c154n7ie{-webkit-flex-basis:58%;-ms-flex-preferred-size:58%;flex-basis:58%;width:100%;}
1523
+ .c154n7ie{width:100%;}
1524
+ .c1c9j4da{color:rgba(44,56,82,0.6);}
1525
+ .cjxv8cf{-webkit-flex-basis:58%;-ms-flex-preferred-size:58%;flex-basis:58%;width:100%;}
1524
1526
  .s1bsn3us{width:1px;height:16px;border-radius:1px;background:rgba(172,186,211,0.6);}
1525
1527
 
1526
1528
  .e1guqlj2{-webkit-flex:1;-ms-flex:1;flex:1;height:100%;margin-bottom:16px;}
@@ -6,7 +6,7 @@ type Props<Model extends ResourceModel> = {
6
6
  config?: ResourceConfig<Model>;
7
7
  formResult: UseFormReturnType;
8
8
  errorMsg?: string;
9
- action: 'create' | 'edit';
9
+ resourceId?: string;
10
10
  };
11
11
  export declare const RefineFormContent: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>(props: Props<Model>) => JSX.Element;
12
12
  export {};
@@ -7,6 +7,8 @@ export type RefineFormField = {
7
7
  path: string[];
8
8
  key: string;
9
9
  label: string;
10
+ placeholder?: string;
11
+ helperText?: string;
10
12
  type?: 'number';
11
13
  validators?: RefineFormValidator[];
12
14
  disabledWhenEdit?: boolean;
@@ -18,7 +18,7 @@ export declare const AgeColumnRenderer: <Model extends ResourceModel<import("k8s
18
18
  }) => Column<Model>;
19
19
  export declare const NodeNameColumnRenderer: <Model extends PodModel>(i18n: I18nType, options?: Partial<Column<Model>> | undefined) => Column<Model>;
20
20
  export declare const RestartCountColumnRenderer: <Model extends PodModel>(i18n: I18nType) => Column<Model>;
21
- export declare const CompletionsCountColumnRenderer: <Model extends JobModel | CronJobModel>(i18n: I18nType) => Column<Model>;
21
+ export declare const CompletionsCountColumnRenderer: <Model extends JobModel>(i18n: I18nType) => Column<Model>;
22
22
  export declare const DurationColumnRenderer: <Model extends JobModel | CronJobModel>(i18n: I18nType) => Column<Model>;
23
23
  export declare const ServiceTypeColumnRenderer: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>(i18n: I18nType) => Column<Model>;
24
24
  export declare function ServiceInClusterAccessTitle(): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { CrudFilters } from '@refinedev/core';
2
+ declare function useNamespaceFilter(): {
3
+ permanent: CrudFilters;
4
+ };
5
+ export default useNamespaceFilter;
@@ -1,15 +1,17 @@
1
1
  /// <reference types="react" />
2
+ import { CrudSorting } from '@refinedev/core';
2
3
  import { Column, SorterOrder } from 'src/components/Table';
3
4
  type UseTableDataProps<Data extends {
4
5
  id: string;
5
6
  }> = {
6
7
  pageSize?: number;
8
+ defaultSorters?: CrudSorting;
7
9
  data: Data[];
8
10
  columns: Column<Data>[];
9
11
  };
10
12
  declare function useTableData<Data extends {
11
13
  id: string;
12
- }>({ data, columns, pageSize }: UseTableDataProps<Data>): {
14
+ }>({ data, columns, pageSize, defaultSorters }: UseTableDataProps<Data>): {
13
15
  data: Data[];
14
16
  currentPage: number;
15
17
  onPageChange: import("react").Dispatch<import("react").SetStateAction<number>>;
@@ -4,7 +4,7 @@ import { Unstructured } from 'k8s-api-provider';
4
4
  import { YamlFormProps } from '../components';
5
5
  import { RefineFormField } from '../components/Form';
6
6
  import { ShowConfig } from '../components/ShowContent';
7
- import { Column } from '../components/Table';
7
+ import { Column, TableProps } from '../components/Table';
8
8
  import { ResourceModel } from '../models';
9
9
  export declare enum RESOURCE_GROUP {
10
10
  WORKLOAD = "WORKLOAD",
@@ -39,9 +39,14 @@ export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
39
39
  Dropdown?: React.FC<{
40
40
  record: Model;
41
41
  }>;
42
+ tableProps?: Partial<TableProps<Model>>;
42
43
  isCustom?: boolean;
43
44
  formConfig?: {
44
- fields?: RefineFormField[];
45
+ fields?: (props: {
46
+ record?: Model;
47
+ records: Model[];
48
+ action: 'create' | 'edit';
49
+ }) => RefineFormField[];
45
50
  renderForm?: (props: YamlFormProps) => React.ReactNode;
46
51
  formType?: FormType;
47
52
  transformInitValues?: (values: Unstructured) => Unstructured;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.0.46-alpha.0",
3
+ "version": "0.0.46-alpha.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -21,7 +21,7 @@
21
21
  "dayjs": "^1.11.10",
22
22
  "i18next": "^23.2.3",
23
23
  "js-yaml": "^4.1.0",
24
- "k8s-api-provider": "0.0.20",
24
+ "k8s-api-provider": "0.0.21-alpha.0",
25
25
  "ky": "^0.33.3",
26
26
  "lodash-es": "^4.17.21",
27
27
  "mitt": "^3.0.1",