@antscorp/antsomi-ui 1.3.5-beta.909 → 1.3.5-beta.910

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,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { PayloadInfo } from '@antscorp/antsomi-ui/es/types';
2
3
  export type TDisplayFormat = 'number' | 'percentage' | 'currency' | 'datetime';
3
4
  type DisplayFormatProps = {
@@ -145,7 +145,7 @@ export function MatchesAny(props) {
145
145
  *
146
146
  */
147
147
  const onRemoveItem = (item) => {
148
- let isMaxItemsError = false;
148
+ // let isMaxItemsError = false;
149
149
  setState(prev => {
150
150
  const newSelectedItems = prev.selectedItems?.filter(selectedItem => {
151
151
  if (item.children) {
@@ -156,23 +156,22 @@ export function MatchesAny(props) {
156
156
  return selectedItem.key !== item.key;
157
157
  });
158
158
  const newSelectedTreeData = getSelectedTreeData(items || [], newSelectedItems || [], selectedTreeData || []);
159
- isMaxItemsError =
160
- (maxSelectedItem && newSelectedItems && newSelectedItems.length > maxSelectedItem) || false;
159
+ // isMaxItemsError =
160
+ // (maxSelectedItem && newSelectedItems && newSelectedItems.length > maxSelectedItem) || false;
161
161
  return {
162
162
  ...prev,
163
163
  selectedItems: newSelectedItems,
164
164
  selectedTreeData: newSelectedTreeData,
165
165
  };
166
166
  });
167
- setMaxItemsError(isMaxItemsError);
167
+ // setMaxItemsError(isMaxItemsError);
168
168
  };
169
169
  const onRemoveAll = () => {
170
170
  setState(prev => ({ ...prev, selectedItems: [], selectedTreeData: [] }));
171
171
  };
172
172
  const onClickApply = () => {
173
173
  const isOverMaxSelected = maxSelectedItem && selectedItems && selectedItems.length > maxSelectedItem;
174
- const isSomeTextTooLong = selectedItems &&
175
- selectedItems.some(item => item.title?.toString().length > maxLengthEachItem);
174
+ const isSomeTextTooLong = selectedItems && selectedItems.some(item => item.key?.toString().length > maxLengthEachItem);
176
175
  if (isOverMaxSelected) {
177
176
  setMaxItemsError(true);
178
177
  }
@@ -185,7 +184,7 @@ export function MatchesAny(props) {
185
184
  };
186
185
  const handleClickRemoveInvalid = () => {
187
186
  selectedItems?.forEach(item => {
188
- if (item.title?.toString().length > maxLengthEachItem) {
187
+ if (item.key?.toString().length > maxLengthEachItem) {
189
188
  onRemoveItem(item);
190
189
  }
191
190
  });
@@ -206,8 +205,8 @@ export function MatchesAny(props) {
206
205
  ? extraValue.render(item)
207
206
  : extraValue.render
208
207
  : item[extraValue.key] }) }, `${extraValue.key}`))) }))] }), _jsxs(Flex, { align: "center", gap: 10, children: [mode === 'select' && renderItemError(item), mode === 'select' &&
209
- item.title?.toString().length &&
210
- item.title?.toString().length > maxLengthEachItem && _jsx(ErrorIcon, { size: 16 }), isExtendValue && (_jsx(Icon, { type: "icon-ants-empty-flag", size: 20, color: globalToken?.colorPrimary })), _jsx(ActionButton, { className: "select-button", align: "center", justify: "center", onClick: () => {
208
+ item.key?.toString().length &&
209
+ item.key?.toString().length > maxLengthEachItem && _jsx(ErrorIcon, { size: 16 }), isExtendValue && (_jsx(Icon, { type: "icon-ants-empty-flag", size: 20, color: globalToken?.colorPrimary })), _jsx(ActionButton, { className: "select-button", align: "center", justify: "center", onClick: () => {
211
210
  // Call onSelectItem function if provided
212
211
  if (onSelectItem) {
213
212
  onSelectItem(item);
@@ -3,4 +3,5 @@
3
3
  * Asynchronously loads the component for TemplateListing
4
4
  *
5
5
  */
6
+ /// <reference types="react" />
6
7
  export declare const TemplateListing: (props: import("./types").TemplateListingProps<{}>) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.909",
3
+ "version": "1.3.5-beta.910",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",