@capillarytech/blaze-ui 6.5.0 → 6.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CapAdvancedIcon/types.d.ts +1 -0
  2. package/CapAdvancedIcon/types.d.ts.map +1 -1
  3. package/CapDnDGraph/index.js +2 -2
  4. package/CapDndGraphSidebar/SideBarIcon.d.ts +3 -23
  5. package/CapDndGraphSidebar/SideBarIcon.d.ts.map +1 -1
  6. package/CapDndGraphSidebar/SideBarIcon.js +21 -39
  7. package/CapDndGraphSidebar/SidebarNodesRendered.d.ts +3 -9
  8. package/CapDndGraphSidebar/SidebarNodesRendered.d.ts.map +1 -1
  9. package/CapDndGraphSidebar/SidebarNodesRendered.js +13 -4
  10. package/CapDndGraphSidebar/index.d.ts +4 -20
  11. package/CapDndGraphSidebar/index.d.ts.map +1 -1
  12. package/CapDndGraphSidebar/index.js +31 -33
  13. package/CapDndGraphSidebar/styles.css +19 -6
  14. package/CapDndGraphSidebar/styles.module.scss.js +15 -0
  15. package/CapDndGraphSidebar/styles.scss +68 -51
  16. package/CapDndGraphSidebar/types.d.ts +106 -0
  17. package/CapDndGraphSidebar/types.d.ts.map +1 -0
  18. package/CapDragAndDrop/index.d.ts +3 -19
  19. package/CapDragAndDrop/index.d.ts.map +1 -1
  20. package/CapDragAndDrop/index.js +24 -29
  21. package/CapDragAndDrop/messages.d.ts +25 -0
  22. package/CapDragAndDrop/messages.d.ts.map +1 -0
  23. package/CapDragAndDrop/messages.js +28 -0
  24. package/CapDragAndDrop/styles.css +17 -15
  25. package/CapDragAndDrop/styles.module.scss.js +21 -0
  26. package/CapDragAndDrop/styles.scss +18 -16
  27. package/CapDragAndDrop/types.d.ts +17 -0
  28. package/CapDragAndDrop/types.d.ts.map +1 -0
  29. package/CapDragAndDrop/types.js +1 -0
  30. package/CapIcon/index.js +12 -12
  31. package/CapIcon/styles.css +17 -21
  32. package/CapIcon/styles.module.scss.js +3 -4
  33. package/CapIcon/styles.scss +10 -15
  34. package/CapMediaPreview/ImageRenderer.d.ts +2 -15
  35. package/CapMediaPreview/ImageRenderer.d.ts.map +1 -1
  36. package/CapMediaPreview/ImageRenderer.js +3 -11
  37. package/CapMediaPreview/MediaRenderer.d.ts +2 -1
  38. package/CapMediaPreview/MediaRenderer.d.ts.map +1 -1
  39. package/CapMediaPreview/MediaRenderer.js +17 -15
  40. package/CapMediaPreview/VideoPlayer.d.ts +2 -1
  41. package/CapMediaPreview/VideoPlayer.d.ts.map +1 -1
  42. package/CapMediaPreview/VideoPlayer.js +16 -15
  43. package/CapMediaPreview/index.d.ts +4 -51
  44. package/CapMediaPreview/index.d.ts.map +1 -1
  45. package/CapMediaPreview/index.js +86 -69
  46. package/CapMediaPreview/styles.css +31 -21
  47. package/CapMediaPreview/styles.module.scss.js +24 -0
  48. package/CapMediaPreview/styles.scss +38 -27
  49. package/CapMediaPreview/types.d.ts +48 -0
  50. package/CapMediaPreview/types.d.ts.map +1 -0
  51. package/CapMediaPreview/types.js +1 -0
  52. package/CapPopoverTree/index.d.ts +40 -3
  53. package/CapPopoverTree/index.d.ts.map +1 -1
  54. package/CapPopoverTree/index.js +82 -72
  55. package/CapPopoverTree/style.d.ts +1 -5
  56. package/CapPopoverTree/style.d.ts.map +1 -1
  57. package/CapPopoverTree/styles.css +18 -119
  58. package/CapPopoverTree/styles.scss +31 -179
  59. package/CapSelectFilter/types.d.ts +1 -1
  60. package/CapSelectFilter/types.d.ts.map +1 -1
  61. package/CapTimeline/CapTimelineCard.d.ts +4 -27
  62. package/CapTimeline/CapTimelineCard.d.ts.map +1 -1
  63. package/CapTimeline/CapTimelineCard.js +40 -157
  64. package/CapTimeline/CapTimelinePanesWrapper.d.ts +4 -25
  65. package/CapTimeline/CapTimelinePanesWrapper.d.ts.map +1 -1
  66. package/CapTimeline/CapTimelinePanesWrapper.js +24 -20
  67. package/CapTimeline/index.d.ts +2 -17
  68. package/CapTimeline/index.d.ts.map +1 -1
  69. package/CapTimeline/index.js +62 -23
  70. package/CapTimeline/messages.d.ts +21 -0
  71. package/CapTimeline/messages.d.ts.map +1 -0
  72. package/CapTimeline/messages.js +24 -0
  73. package/CapTimeline/styles.css +40 -40
  74. package/CapTimeline/styles.module.scss.js +30 -0
  75. package/CapTimeline/styles.scss +76 -57
  76. package/CapTimeline/tests/CapTimeline.mockData.d.ts +14 -0
  77. package/CapTimeline/tests/CapTimeline.mockData.d.ts.map +1 -0
  78. package/CapTimeline/types.d.ts +60 -0
  79. package/CapTimeline/types.d.ts.map +1 -0
  80. package/CapTimeline/types.js +1 -0
  81. package/index.d.ts +8 -0
  82. package/index.d.ts.map +1 -1
  83. package/index.js +179 -171
  84. package/package.json +2 -2
  85. package/utils/getCapThemeConfig.d.ts +1 -1
  86. package/utils/getCapThemeConfig.d.ts.map +1 -1
  87. package/utils/getCapThemeConfig.js +9 -1
  88. package/CapPopoverTree/styles.module.scss.js +0 -26
  89. package/CapPopoverTree/tests/CapPopoverTree.mockData.d.ts +0 -22
  90. package/CapPopoverTree/tests/CapPopoverTree.mockData.d.ts.map +0 -1
  91. package/CapPopoverTree/types.d.ts +0 -62
  92. package/CapPopoverTree/types.d.ts.map +0 -1
  93. package/CapVirtualSelect/actions.d.ts +0 -16
  94. package/CapVirtualSelect/actions.d.ts.map +0 -1
  95. package/CapVirtualSelect/actions.js +0 -21
  96. package/CapVirtualSelect/constants.d.ts +0 -13
  97. package/CapVirtualSelect/constants.d.ts.map +0 -1
  98. package/CapVirtualSelect/constants.js +0 -26
  99. package/CapVirtualSelect/index.d.ts +0 -169
  100. package/CapVirtualSelect/index.d.ts.map +0 -1
  101. package/CapVirtualSelect/index.js +0 -409
  102. package/CapVirtualSelect/messages.d.ts +0 -9
  103. package/CapVirtualSelect/messages.d.ts.map +0 -1
  104. package/CapVirtualSelect/messages.js +0 -12
  105. package/CapVirtualSelect/reducer.d.ts +0 -4
  106. package/CapVirtualSelect/reducer.d.ts.map +0 -1
  107. package/CapVirtualSelect/reducer.js +0 -63
  108. package/CapVirtualSelect/saga.d.ts +0 -40
  109. package/CapVirtualSelect/saga.d.ts.map +0 -1
  110. package/CapVirtualSelect/saga.js +0 -91
  111. package/CapVirtualSelect/selectors.d.ts +0 -28
  112. package/CapVirtualSelect/selectors.d.ts.map +0 -1
  113. package/CapVirtualSelect/selectors.js +0 -30
  114. package/CapVirtualSelect/styles.css +0 -110
  115. package/CapVirtualSelect/styles.scss +0 -106
  116. package/CapVirtualSelect/tests/mockData.d.ts +0 -7
  117. package/CapVirtualSelect/tests/mockData.d.ts.map +0 -1
  118. package/CapVirtualSelect/utils.d.ts +0 -2
  119. package/CapVirtualSelect/utils.d.ts.map +0 -1
  120. package/CapVirtualSelect/utils.js +0 -12
  121. /package/{CapPopoverTree → CapDndGraphSidebar}/types.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapPopoverTree/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,mBACf,SAAQ,IAAI,CACR,SAAS,EACT,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAC3E,EACD,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,GAAG,QAAQ,CAAC;IAC5D,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAChE,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,kCAAkC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4CAA4C;IAC5C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uBAAuB;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qCAAqC;IACrC,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC3C,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC5C,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC7C,8CAA8C;IAC9C,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
@@ -1,16 +0,0 @@
1
- export declare const getPaginatedOptions: (listingApiConfig: any, queryParams: any, transformOptions: any) => {
2
- type: string;
3
- listingApiConfig: any;
4
- queryParams: any;
5
- transformOptions: any;
6
- };
7
- export declare const getOptionById: (id: any, getByIdApiConfig: any, queryParams: any) => {
8
- type: string;
9
- id: any;
10
- getByIdApiConfig: any;
11
- queryParams: any;
12
- };
13
- export declare const clearDataOnUnmount: () => {
14
- type: string;
15
- };
16
- //# sourceMappingURL=actions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../components/CapVirtualSelect/actions.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,GAAI,qBAAgB,EAAE,gBAAW,EAAE,qBAAgB;;;;;CAKjF,CAAC;AAGH,eAAO,MAAM,aAAa,GAAI,OAAE,EAAE,qBAAgB,EAAE,gBAAW;;;;;CAK7D,CAAC;AAGH,eAAO,MAAM,kBAAkB;;CAE7B,CAAC"}
@@ -1,21 +0,0 @@
1
- import { CLEAR_DATA_ON_UNMOUNT, GET_OPTION_BY_ID_REQUEST, GET_PAGINATED_OPTIONS_REQUEST } from "./constants.js";
2
- const getPaginatedOptions = (listingApiConfig, queryParams, transformOptions) => ({
3
- type: GET_PAGINATED_OPTIONS_REQUEST,
4
- listingApiConfig,
5
- queryParams,
6
- transformOptions
7
- });
8
- const getOptionById = (id, getByIdApiConfig, queryParams) => ({
9
- type: GET_OPTION_BY_ID_REQUEST,
10
- id,
11
- getByIdApiConfig,
12
- queryParams
13
- });
14
- const clearDataOnUnmount = () => ({
15
- type: CLEAR_DATA_ON_UNMOUNT
16
- });
17
- export {
18
- clearDataOnUnmount,
19
- getOptionById,
20
- getPaginatedOptions
21
- };
@@ -1,13 +0,0 @@
1
- export declare const GET_PAGINATED_OPTIONS_REQUEST = "CapVirtualSelect/GET_PAGINATED_OPTIONS_REQUEST";
2
- export declare const GET_PAGINATED_OPTIONS_SUCCESS = "CapVirtualSelect/GET_PAGINATED_OPTIONS_SUCCESS";
3
- export declare const GET_PAGINATED_OPTIONS_FAILURE = "CapVirtualSelect/GET_PAGINATED_OPTIONS_FAILURE";
4
- export declare const GET_OPTION_BY_ID_REQUEST = "CapVirtualSelect/GET_OPTION_BY_ID_REQUEST";
5
- export declare const GET_OPTION_BY_ID_SUCCESS = "CapVirtualSelect/GET_OPTION_BY_ID_SUCCESS";
6
- export declare const GET_OPTION_BY_ID_FAILURE = "CapVirtualSelect/GET_OPTION_BY_ID_FAILURE";
7
- export declare const CLEAR_DATA_ON_UNMOUNT = "CapVirtualSelect/CLEAR_DATA_ON_UNMOUNT";
8
- export declare const REQUEST = "REQUEST";
9
- export declare const SUCCESS = "SUCCESS";
10
- export declare const FAILURE = "FAILURE";
11
- export declare const dataTestIdPrefix = "cap-virtual-select";
12
- export declare const defaultNamespace = "capVirtualSelect";
13
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../components/CapVirtualSelect/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,mDAAmD,CAAC;AAC9F,eAAO,MAAM,6BAA6B,mDAAmD,CAAC;AAC9F,eAAO,MAAM,6BAA6B,mDAAmD,CAAC;AAE9F,eAAO,MAAM,wBAAwB,8CAA8C,CAAC;AACpF,eAAO,MAAM,wBAAwB,8CAA8C,CAAC;AACpF,eAAO,MAAM,wBAAwB,8CAA8C,CAAC;AAEpF,eAAO,MAAM,qBAAqB,2CAA2C,CAAC;AAE9E,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,OAAO,YAAY,CAAC;AAEjC,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AACrD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC"}
@@ -1,26 +0,0 @@
1
- const GET_PAGINATED_OPTIONS_REQUEST = "CapVirtualSelect/GET_PAGINATED_OPTIONS_REQUEST";
2
- const GET_PAGINATED_OPTIONS_SUCCESS = "CapVirtualSelect/GET_PAGINATED_OPTIONS_SUCCESS";
3
- const GET_PAGINATED_OPTIONS_FAILURE = "CapVirtualSelect/GET_PAGINATED_OPTIONS_FAILURE";
4
- const GET_OPTION_BY_ID_REQUEST = "CapVirtualSelect/GET_OPTION_BY_ID_REQUEST";
5
- const GET_OPTION_BY_ID_SUCCESS = "CapVirtualSelect/GET_OPTION_BY_ID_SUCCESS";
6
- const GET_OPTION_BY_ID_FAILURE = "CapVirtualSelect/GET_OPTION_BY_ID_FAILURE";
7
- const CLEAR_DATA_ON_UNMOUNT = "CapVirtualSelect/CLEAR_DATA_ON_UNMOUNT";
8
- const REQUEST = "REQUEST";
9
- const SUCCESS = "SUCCESS";
10
- const FAILURE = "FAILURE";
11
- const dataTestIdPrefix = "cap-virtual-select";
12
- const defaultNamespace = "capVirtualSelect";
13
- export {
14
- CLEAR_DATA_ON_UNMOUNT,
15
- FAILURE,
16
- GET_OPTION_BY_ID_FAILURE,
17
- GET_OPTION_BY_ID_REQUEST,
18
- GET_OPTION_BY_ID_SUCCESS,
19
- GET_PAGINATED_OPTIONS_FAILURE,
20
- GET_PAGINATED_OPTIONS_REQUEST,
21
- GET_PAGINATED_OPTIONS_SUCCESS,
22
- REQUEST,
23
- SUCCESS,
24
- dataTestIdPrefix,
25
- defaultNamespace
26
- };
@@ -1,169 +0,0 @@
1
- /**
2
- *
3
- * CapVirtualSelect
4
- *
5
- */
6
- import PropTypes from 'prop-types';
7
- import React from 'react';
8
- import './styles.scss';
9
- export declare function CapVirtualSelect({ intl: { formatMessage: _formatMessage }, namespace: _namespace, listingApiConfig, getByIdApiConfig, selectedOption, isSearchable, searchDebounceTime, disabled, selectedOptionPlaceholderLabel, searchPlaceholderLabel, loadingOptionsPlaceholder, EmptyPlaceholder, EmptySearchPlaceholder, width, height, buttonProps, searchbarProps, virtuosoProps, onOptionClick, renderOptionRow, renderSelectedOptionRow, transformOptions, actions, paginatedOptions: { getPaginatedOptionsStatus, getPaginatedOptions, getUnTransformedPaginatedOptions, getPaginatedOptionsTotalCount, }, optionById: { getOptionByIdStatus, getOptionById }, }: {
10
- intl: {
11
- formatMessage: any;
12
- };
13
- namespace: any;
14
- listingApiConfig: any;
15
- getByIdApiConfig: any;
16
- selectedOption: any;
17
- isSearchable: any;
18
- searchDebounceTime: any;
19
- disabled: any;
20
- selectedOptionPlaceholderLabel: any;
21
- searchPlaceholderLabel: any;
22
- loadingOptionsPlaceholder: any;
23
- EmptyPlaceholder: any;
24
- EmptySearchPlaceholder: any;
25
- width: any;
26
- height: any;
27
- buttonProps: any;
28
- searchbarProps: any;
29
- virtuosoProps: any;
30
- onOptionClick: any;
31
- renderOptionRow: any;
32
- renderSelectedOptionRow: any;
33
- transformOptions: any;
34
- actions: any;
35
- paginatedOptions: {
36
- getPaginatedOptionsStatus: any;
37
- getPaginatedOptions: any;
38
- getUnTransformedPaginatedOptions: any;
39
- getPaginatedOptionsTotalCount: any;
40
- };
41
- optionById: {
42
- getOptionByIdStatus: any;
43
- getOptionById: any;
44
- };
45
- }): import("react/jsx-runtime").JSX.Element;
46
- export declare namespace CapVirtualSelect {
47
- var propTypes: {
48
- intl: any;
49
- namespace: PropTypes.Requireable<string>;
50
- listingApiConfig: PropTypes.Requireable<{
51
- [x: string]: PropTypes.InferProps<{
52
- method: PropTypes.Requireable<(...args: any[]) => any>;
53
- rpmLimit: PropTypes.Requireable<number>;
54
- payloadPath: PropTypes.Requireable<{
55
- [x: string]: PropTypes.InferProps<{
56
- successStatus: PropTypes.Requireable<string>;
57
- success: PropTypes.Requireable<string>;
58
- error: PropTypes.Requireable<string>;
59
- label: PropTypes.Requireable<string>;
60
- value: PropTypes.Requireable<string>;
61
- totalCount: PropTypes.Requireable<string>;
62
- }>;
63
- }>;
64
- apiParamsMapper: PropTypes.Requireable<{
65
- [x: string]: PropTypes.InferProps<PropTypes.ValidationMap<any>>;
66
- }>;
67
- }>;
68
- }>;
69
- getByIdApiConfig: PropTypes.Requireable<{
70
- [x: string]: PropTypes.InferProps<{
71
- method: PropTypes.Requireable<(...args: any[]) => any>;
72
- rpmLimit: PropTypes.Requireable<number>;
73
- payloadPath: PropTypes.Requireable<{
74
- [x: string]: PropTypes.InferProps<{
75
- successStatus: PropTypes.Requireable<string>;
76
- success: PropTypes.Requireable<string>;
77
- error: PropTypes.Requireable<string>;
78
- value: PropTypes.Requireable<string>;
79
- }>;
80
- }>;
81
- apiParamsMapper: PropTypes.Requireable<{
82
- [x: string]: PropTypes.InferProps<PropTypes.ValidationMap<any>>;
83
- }>;
84
- }>;
85
- }>;
86
- selectedOption: PropTypes.Requireable<NonNullable<string | number | boolean>>;
87
- isSearchable: PropTypes.Requireable<boolean>;
88
- searchDebounceTime: PropTypes.Requireable<number>;
89
- disabled: PropTypes.Requireable<boolean>;
90
- selectedOptionPlaceholderLabel: PropTypes.Requireable<string>;
91
- searchPlaceholderLabel: PropTypes.Requireable<string>;
92
- loadingOptionsPlaceholder: PropTypes.Requireable<string>;
93
- width: PropTypes.Requireable<number>;
94
- height: PropTypes.Requireable<number>;
95
- buttonProps: PropTypes.Requireable<object>;
96
- searchbarProps: PropTypes.Requireable<object>;
97
- virtuosoProps: PropTypes.Requireable<object>;
98
- transformOptions: PropTypes.Requireable<(...args: any[]) => any>;
99
- renderOptionRow: PropTypes.Requireable<(...args: any[]) => any>;
100
- renderSelectedOptionRow: PropTypes.Requireable<(...args: any[]) => any>;
101
- onOptionClick: PropTypes.Requireable<(...args: any[]) => any>;
102
- EmptyPlaceholder: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.ReactNodeLike>>;
103
- EmptySearchPlaceholder: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.ReactNodeLike>>;
104
- };
105
- var defaultProps: {
106
- intl: any;
107
- namespace: string;
108
- listingApiConfig: {
109
- method: () => Promise<any[]>;
110
- rpmLimit: number;
111
- payloadPath: {
112
- successStatus: string;
113
- success: string;
114
- error: string;
115
- label: string;
116
- value: string;
117
- totalCount: string;
118
- };
119
- apiParamsMapper: {
120
- page: {
121
- key: string;
122
- value: number;
123
- };
124
- limit: {
125
- key: string;
126
- value: number;
127
- };
128
- search: {
129
- key: string;
130
- value: string;
131
- };
132
- };
133
- };
134
- getByIdApiConfig: {
135
- method: () => Promise<any>;
136
- rpmLimit: number;
137
- payloadPath: {
138
- successStatus: string;
139
- success: string;
140
- error: string;
141
- value: string;
142
- };
143
- apiParamsMapper: {};
144
- };
145
- selectedOption: any;
146
- isSearchable: boolean;
147
- searchDebounceTime: number;
148
- disabled: boolean;
149
- selectedOptionPlaceholderLabel: string;
150
- searchPlaceholderLabel: string;
151
- loadingOptionsPlaceholder: string;
152
- width: number;
153
- height: number;
154
- buttonProps: {};
155
- searchbarProps: {};
156
- virtuosoProps: {};
157
- transformOptions: (options: any) => any;
158
- onOptionClick: (option: any) => any;
159
- renderOptionRow: (option: any) => import("react/jsx-runtime").JSX.Element;
160
- renderSelectedOptionRow: (selectedOption: any, selectedOptionValue: any) => import("react/jsx-runtime").JSX.Element;
161
- EmptyPlaceholder: () => import("react/jsx-runtime").JSX.Element;
162
- EmptySearchPlaceholder: () => import("react/jsx-runtime").JSX.Element;
163
- };
164
- }
165
- export declare const CapVirtualSelectInjected: (namespace?: string) => import("react-redux").ConnectedComponent<React.ComponentType<Omit<any, "intl">>, {
166
- [x: string]: any;
167
- }>;
168
- export default CapVirtualSelectInjected;
169
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapVirtualSelect/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,KAAmD,MAAM,OAAO,CAAC;AAiBxE,OAAO,eAAe,CAAC;AAmBvB,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EAAE,EAAE,aAAa,EAAE,cAAc,EAAE,EACvC,SAAS,EAAE,UAAU,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,8BAA8B,EAC9B,sBAAsB,EACtB,yBAAyB,EACzB,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,EACL,MAAM,EACN,WAAW,EACX,cAAc,EACd,aAAa,EACb,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,OAAO,EACP,gBAAgB,EAAE,EAChB,yBAAyB,EACzB,mBAAmB,EACnB,gCAAgC,EAChC,6BAA6B,GAC9B,EACD,UAAU,EAAE,EAAE,mBAAmB,EAAE,aAAa,EAAE,GACnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA,2CAsNA;yBArPe,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgXhC,eAAO,MAAM,wBAAwB,GAAI,kBAA4B;;EA4BpE,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -1,409 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import classNames from "classnames";
3
- import debounce from "lodash/debounce";
4
- import get from "lodash/get";
5
- import PropTypes from "prop-types";
6
- import { useState, useRef, useCallback, useEffect } from "react";
7
- import { intlShape, FormattedMessage, injectIntl } from "react-intl";
8
- import { connect } from "react-redux";
9
- import { Virtuoso } from "react-virtuoso";
10
- import { compose, bindActionCreators } from "redux";
11
- import { createStructuredSelector } from "reselect";
12
- import CapIcon from "../CapIcon/index.js";
13
- import CapSearch from "../CapInput/Search.js";
14
- import CapRow from "../CapRow/index.js";
15
- import CapSpin from "../CapSpin/index.js";
16
- import clearDataOnUnmount from "../ClearDataOnUnmountHoc/index.js";
17
- import * as CapVirtualSelect_actions from "./actions.js";
18
- import { defaultNamespace, dataTestIdPrefix, SUCCESS, FAILURE, REQUEST } from "./constants.js";
19
- import messages from "./messages.js";
20
- import { makeSelectGetOptionById, makeSelectGetPaginatedOptions } from "./selectors.js";
21
- import './styles.css';/* empty css */
22
- import { convertApiParamsMapperToObject } from "./utils.js";
23
- const classPrefix = "cap-virtual-select";
24
- const NoOptionsFound = () => {
25
- return /* @__PURE__ */ jsxs(
26
- CapRow,
27
- {
28
- className: classNames(`${classPrefix}-no-options`),
29
- "data-testid": `${dataTestIdPrefix}-no-options`,
30
- children: [
31
- /* @__PURE__ */ jsx(CapIcon, { className: classNames(`${classPrefix}-no-options-image`), type: "alert" }),
32
- /* @__PURE__ */ jsx(CapRow, { className: classNames(`${classPrefix}-no-options-text`), children: /* @__PURE__ */ jsx(FormattedMessage, { ...messages.noOptionsFound }) })
33
- ]
34
- }
35
- );
36
- };
37
- function CapVirtualSelect({
38
- intl: { formatMessage: _formatMessage },
39
- namespace: _namespace,
40
- listingApiConfig,
41
- getByIdApiConfig,
42
- selectedOption,
43
- isSearchable,
44
- searchDebounceTime,
45
- disabled,
46
- selectedOptionPlaceholderLabel,
47
- searchPlaceholderLabel,
48
- loadingOptionsPlaceholder,
49
- EmptyPlaceholder,
50
- EmptySearchPlaceholder,
51
- width,
52
- height,
53
- buttonProps,
54
- searchbarProps,
55
- virtuosoProps,
56
- onOptionClick,
57
- renderOptionRow,
58
- renderSelectedOptionRow,
59
- transformOptions,
60
- actions: actions2,
61
- paginatedOptions: {
62
- getPaginatedOptionsStatus,
63
- getPaginatedOptions,
64
- getUnTransformedPaginatedOptions,
65
- getPaginatedOptionsTotalCount
66
- },
67
- optionById: { getOptionByIdStatus, getOptionById }
68
- }) {
69
- var _a, _b, _c, _d, _e, _f, _g, _h;
70
- const [isDropdownVisible, setIsDropdownListVisible] = useState(false);
71
- const [listingApiQueryParams, setListingApiQueryParams] = useState(
72
- () => convertApiParamsMapperToObject(listingApiConfig == null ? void 0 : listingApiConfig.apiParamsMapper)
73
- );
74
- const [defaultSelectedOption, _setDefaultSelectedOption] = useState(() => selectedOption);
75
- const [selectedOptionNode, setSelectedOptionNode] = useState({});
76
- const [searchValue, setSearchValue] = useState("");
77
- const [basePageIndex, setBasePageIndex] = useState(
78
- () => {
79
- var _a2, _b2;
80
- return (_b2 = (_a2 = listingApiConfig == null ? void 0 : listingApiConfig.apiParamsMapper) == null ? void 0 : _a2.page) == null ? void 0 : _b2.value;
81
- }
82
- );
83
- const dropdownRef = useRef(null);
84
- const searchKey = (_b = (_a = listingApiConfig == null ? void 0 : listingApiConfig.apiParamsMapper) == null ? void 0 : _a.search) == null ? void 0 : _b.key;
85
- const pageKey = (_d = (_c = listingApiConfig == null ? void 0 : listingApiConfig.apiParamsMapper) == null ? void 0 : _c.page) == null ? void 0 : _d.key;
86
- const pageValue = (_f = (_e = listingApiConfig == null ? void 0 : listingApiConfig.apiParamsMapper) == null ? void 0 : _e.page) == null ? void 0 : _f.value;
87
- const areOptionsLoading = getPaginatedOptionsStatus === REQUEST || getOptionByIdStatus === REQUEST;
88
- const handleOptionChange = (selectedOptionNodeValue) => {
89
- setSelectedOptionNode(selectedOptionNodeValue);
90
- onOptionClick(selectedOptionNodeValue);
91
- setIsDropdownListVisible(false);
92
- };
93
- const handleDebouncedSearch = useCallback(
94
- debounce((value) => {
95
- setListingApiQueryParams((prevState) => ({
96
- ...prevState,
97
- [searchKey]: value,
98
- [pageKey]: pageValue
99
- }));
100
- }, searchDebounceTime),
101
- []
102
- );
103
- const handleSearchChange = (value) => {
104
- setSearchValue(value);
105
- if (searchValue) {
106
- handleDebouncedSearch(value);
107
- }
108
- };
109
- const handleLoadMoreOptions = () => {
110
- const loadedUnTransformedPaginatedOptionsLength = (getUnTransformedPaginatedOptions == null ? void 0 : getUnTransformedPaginatedOptions.length) || 0;
111
- const loadedPaginatedOptionsLength = defaultSelectedOption && !searchValue ? loadedUnTransformedPaginatedOptionsLength + 1 : loadedUnTransformedPaginatedOptionsLength;
112
- const areAllOptionsLoaded = loadedPaginatedOptionsLength === getPaginatedOptionsTotalCount;
113
- if (areOptionsLoading || areAllOptionsLoaded || getPaginatedOptionsStatus === FAILURE) return;
114
- setListingApiQueryParams((prevState) => ({
115
- ...prevState,
116
- [pageKey]: prevState[pageKey] + 1
117
- }));
118
- };
119
- const renderVisibleOptionNodes = (index, visibleNode) => {
120
- var _a2, _b2;
121
- const selectedOptionValue = get(selectedOptionNode, (_a2 = listingApiConfig == null ? void 0 : listingApiConfig.payloadPath) == null ? void 0 : _a2.value, "");
122
- const currentSelectedOptionValue = get(visibleNode, (_b2 = listingApiConfig == null ? void 0 : listingApiConfig.payloadPath) == null ? void 0 : _b2.value, "");
123
- return /* @__PURE__ */ jsx(
124
- CapRow,
125
- {
126
- onClick: (event) => {
127
- event.stopPropagation();
128
- handleOptionChange(visibleNode);
129
- },
130
- className: classNames(
131
- selectedOptionValue === currentSelectedOptionValue ? `${classPrefix}-selected-option-row` : `${classPrefix}-option-row`
132
- ),
133
- "data-testid": `${dataTestIdPrefix}-option-row`,
134
- children: renderOptionRow(visibleNode)
135
- },
136
- index
137
- );
138
- };
139
- useEffect(() => {
140
- if (selectedOption) {
141
- const getByIdApiQueryParams = convertApiParamsMapperToObject(
142
- getByIdApiConfig == null ? void 0 : getByIdApiConfig.apiParamsMapper
143
- );
144
- actions2.getOptionById(selectedOption, getByIdApiConfig, getByIdApiQueryParams);
145
- }
146
- setBasePageIndex(convertApiParamsMapperToObject(listingApiConfig == null ? void 0 : listingApiConfig.apiParamsMapper)[pageKey]);
147
- }, []);
148
- useEffect(() => {
149
- if ([SUCCESS, FAILURE].includes(getOptionByIdStatus)) {
150
- setSelectedOptionNode(getOptionById);
151
- }
152
- }, [getOptionByIdStatus]);
153
- useEffect(() => {
154
- if (areOptionsLoading || listingApiQueryParams[pageKey] > (listingApiConfig == null ? void 0 : listingApiConfig.rpmLimit)) return;
155
- if (!defaultSelectedOption || defaultSelectedOption && [SUCCESS, FAILURE].includes(getOptionByIdStatus)) {
156
- actions2.getPaginatedOptions(listingApiConfig, listingApiQueryParams, transformOptions);
157
- }
158
- }, [listingApiQueryParams[pageKey], listingApiQueryParams[searchKey], getOptionByIdStatus]);
159
- useEffect(() => {
160
- const handleClickOutside = (event) => {
161
- var _a2;
162
- if (!((_a2 = dropdownRef.current) == null ? void 0 : _a2.contains(event.target))) {
163
- setIsDropdownListVisible(false);
164
- }
165
- };
166
- document.addEventListener("mousedown", handleClickOutside);
167
- return () => {
168
- document.removeEventListener("mousedown", handleClickOutside);
169
- };
170
- }, []);
171
- return /* @__PURE__ */ jsxs(
172
- "div",
173
- {
174
- ref: dropdownRef,
175
- className: classNames(`${classPrefix}-container`),
176
- style: { width },
177
- "data-testid": `${dataTestIdPrefix}-container`,
178
- children: [
179
- /* @__PURE__ */ jsxs(
180
- "button",
181
- {
182
- className: classNames(`${classPrefix}-button`, {
183
- [`${classPrefix}-button-disabled`]: disabled || areOptionsLoading
184
- }),
185
- "data-testid": `${dataTestIdPrefix}-button`,
186
- onClick: () => setIsDropdownListVisible(true),
187
- disabled: disabled || areOptionsLoading,
188
- ...buttonProps,
189
- children: [
190
- /* @__PURE__ */ jsx(CapRow, { className: classNames(`${classPrefix}-button-label`), children: areOptionsLoading && !(listingApiQueryParams[pageKey] > basePageIndex) ? /* @__PURE__ */ jsx(CapRow, { children: loadingOptionsPlaceholder }) : /* @__PURE__ */ jsx(
191
- CapRow,
192
- {
193
- className: classNames({
194
- [`${classPrefix}-button-defined-label`]: get(
195
- selectedOptionNode,
196
- (_g = listingApiConfig == null ? void 0 : listingApiConfig.payloadPath) == null ? void 0 : _g.label,
197
- selectedOptionPlaceholderLabel
198
- ) !== selectedOptionPlaceholderLabel
199
- }),
200
- children: renderSelectedOptionRow(
201
- selectedOptionNode,
202
- get(
203
- selectedOptionNode,
204
- (_h = listingApiConfig == null ? void 0 : listingApiConfig.payloadPath) == null ? void 0 : _h.label,
205
- selectedOptionPlaceholderLabel
206
- )
207
- )
208
- }
209
- ) }),
210
- /* @__PURE__ */ jsx(CapIcon, { type: "chevron-down", className: classNames(`${classPrefix}-button-arrow`) })
211
- ]
212
- }
213
- ),
214
- isDropdownVisible && /* @__PURE__ */ jsxs(
215
- CapRow,
216
- {
217
- className: classNames(`${classPrefix}-dropdown`),
218
- style: { width },
219
- "data-testid": `${dataTestIdPrefix}-dropdown`,
220
- children: [
221
- isSearchable && /* @__PURE__ */ jsx(
222
- CapSearch,
223
- {
224
- className: classNames(`${classPrefix}-search-bar`),
225
- "data-testid": `${dataTestIdPrefix}-search-bar`,
226
- value: searchValue,
227
- onChange: (event) => handleSearchChange(event.target.value),
228
- placeholder: searchPlaceholderLabel,
229
- allowClear: false,
230
- ...searchbarProps
231
- }
232
- ),
233
- /* @__PURE__ */ jsx(
234
- CapSpin,
235
- {
236
- className: classNames(`${classPrefix}-options-list-spinner`),
237
- size: "small",
238
- spinning: areOptionsLoading,
239
- children: /* @__PURE__ */ jsx(
240
- Virtuoso,
241
- {
242
- style: { width, height: isSearchable ? height : height + 64 },
243
- className: classNames(`${classPrefix}-options-list`),
244
- "data-testid": `${dataTestIdPrefix}-options-list`,
245
- totalCount: getPaginatedOptions == null ? void 0 : getPaginatedOptions.length,
246
- data: getPaginatedOptions,
247
- endReached: handleLoadMoreOptions,
248
- itemContent: renderVisibleOptionNodes,
249
- components: {
250
- EmptyPlaceholder: searchValue ? EmptySearchPlaceholder : EmptyPlaceholder
251
- },
252
- ...virtuosoProps
253
- }
254
- )
255
- }
256
- )
257
- ]
258
- }
259
- )
260
- ]
261
- }
262
- );
263
- }
264
- CapVirtualSelect.propTypes = {
265
- intl: intlShape.isRequired,
266
- namespace: PropTypes.string,
267
- listingApiConfig: PropTypes.objectOf(
268
- PropTypes.shape({
269
- method: PropTypes.func,
270
- rpmLimit: PropTypes.number,
271
- payloadPath: PropTypes.objectOf(
272
- PropTypes.shape({
273
- successStatus: PropTypes.string,
274
- success: PropTypes.string,
275
- error: PropTypes.string,
276
- label: PropTypes.string,
277
- value: PropTypes.string,
278
- totalCount: PropTypes.string
279
- })
280
- ),
281
- apiParamsMapper: PropTypes.objectOf(
282
- PropTypes.shape({
283
- page: { key: PropTypes.string, value: PropTypes.any },
284
- limit: { key: PropTypes.string, value: PropTypes.any },
285
- search: { key: PropTypes.string, value: PropTypes.any }
286
- })
287
- )
288
- })
289
- ),
290
- getByIdApiConfig: PropTypes.objectOf(
291
- PropTypes.shape({
292
- method: PropTypes.func,
293
- rpmLimit: PropTypes.number,
294
- payloadPath: PropTypes.objectOf(
295
- PropTypes.shape({
296
- successStatus: PropTypes.string,
297
- success: PropTypes.string,
298
- error: PropTypes.string,
299
- value: PropTypes.string
300
- })
301
- ),
302
- apiParamsMapper: PropTypes.objectOf(
303
- PropTypes.shape({
304
- page: { key: PropTypes.string, value: PropTypes.any },
305
- limit: { key: PropTypes.string, value: PropTypes.any },
306
- search: { key: PropTypes.string, value: PropTypes.any }
307
- })
308
- )
309
- })
310
- ),
311
- selectedOption: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
312
- isSearchable: PropTypes.bool,
313
- searchDebounceTime: PropTypes.number,
314
- disabled: PropTypes.bool,
315
- selectedOptionPlaceholderLabel: PropTypes.string,
316
- searchPlaceholderLabel: PropTypes.string,
317
- loadingOptionsPlaceholder: PropTypes.string,
318
- width: PropTypes.number,
319
- height: PropTypes.number,
320
- buttonProps: PropTypes.object,
321
- searchbarProps: PropTypes.object,
322
- virtuosoProps: PropTypes.object,
323
- transformOptions: PropTypes.func,
324
- renderOptionRow: PropTypes.func,
325
- renderSelectedOptionRow: PropTypes.func,
326
- onOptionClick: PropTypes.func,
327
- EmptyPlaceholder: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
328
- EmptySearchPlaceholder: PropTypes.oneOfType([PropTypes.func, PropTypes.node])
329
- };
330
- CapVirtualSelect.defaultProps = {
331
- intl: intlShape.isRequired,
332
- namespace: defaultNamespace,
333
- listingApiConfig: {
334
- method: () => Promise.resolve([]),
335
- rpmLimit: 20,
336
- payloadPath: {
337
- successStatus: "success",
338
- success: "data",
339
- error: "error",
340
- label: "name",
341
- value: "id",
342
- totalCount: "totalCount"
343
- },
344
- apiParamsMapper: {
345
- page: { key: "page", value: 0 },
346
- limit: { key: "limit", value: 10 },
347
- search: { key: "search", value: "" }
348
- }
349
- },
350
- getByIdApiConfig: {
351
- method: () => Promise.resolve(null),
352
- rpmLimit: 20,
353
- payloadPath: {
354
- successStatus: "success",
355
- success: "data",
356
- error: "error",
357
- value: "id"
358
- },
359
- apiParamsMapper: {}
360
- },
361
- selectedOption: null,
362
- isSearchable: false,
363
- searchDebounceTime: 1500,
364
- disabled: false,
365
- selectedOptionPlaceholderLabel: "Select an option",
366
- searchPlaceholderLabel: "Search",
367
- loadingOptionsPlaceholder: "Loading options...",
368
- width: 250,
369
- height: 188,
370
- buttonProps: {},
371
- searchbarProps: {},
372
- virtuosoProps: {},
373
- transformOptions: (options) => options,
374
- onOptionClick: (option) => option,
375
- renderOptionRow: (option) => /* @__PURE__ */ jsx("div", { children: (option == null ? void 0 : option.name) || "N/A" }),
376
- renderSelectedOptionRow: (selectedOption, selectedOptionValue) => /* @__PURE__ */ jsx("div", { children: selectedOptionValue }),
377
- EmptyPlaceholder: NoOptionsFound,
378
- EmptySearchPlaceholder: NoOptionsFound
379
- };
380
- const CapVirtualSelectInjected = (namespace = defaultNamespace) => {
381
- const mapStateToProps = createStructuredSelector({
382
- paginatedOptions: makeSelectGetPaginatedOptions(),
383
- optionById: makeSelectGetOptionById()
384
- });
385
- function mapDispatchToProps(dispatch) {
386
- const updatedActions = {
387
- ...CapVirtualSelect_actions
388
- };
389
- const allActions = Object.keys(updatedActions);
390
- allActions.forEach((actionName) => {
391
- const actionCreator = updatedActions[actionName];
392
- updatedActions[actionName] = (...args) => {
393
- const actionReturnValue = actionCreator(...args);
394
- actionReturnValue.namespace = namespace;
395
- return actionReturnValue;
396
- };
397
- });
398
- return {
399
- actions: bindActionCreators(updatedActions, dispatch)
400
- };
401
- }
402
- const withConnect = connect(mapStateToProps, mapDispatchToProps);
403
- return compose(withConnect)(injectIntl(clearDataOnUnmount(CapVirtualSelect)));
404
- };
405
- export {
406
- CapVirtualSelect,
407
- CapVirtualSelectInjected,
408
- CapVirtualSelectInjected as default
409
- };