@antscorp/antsomi-ui 1.3.5-beta.863 → 1.3.5-beta.864

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,3 @@
1
- /// <reference types="react" />
2
1
  import type { PayloadInfo } from '@antscorp/antsomi-ui/es/types';
3
2
  export type TDisplayFormat = 'number' | 'percentage' | 'currency' | 'datetime';
4
3
  type DisplayFormatProps = {
@@ -423,6 +423,9 @@ const TagifyInput = forwardRef((props, ref) => {
423
423
  const { tagify } = event.detail;
424
424
  const inputValue = tagify.getInputValue();
425
425
  const convertedValue = convertInputStringToOriginal(inputValue);
426
+ if (convertedValue === '') {
427
+ setIsLineBreak(false);
428
+ }
426
429
  onOutputData(convertedValue);
427
430
  }
428
431
  }, [onOutputData]);
@@ -605,19 +608,40 @@ const TagifyInput = forwardRef((props, ref) => {
605
608
  if (readonly)
606
609
  return;
607
610
  const { classList } = DOM?.scope;
608
- const { lastChild } = DOM?.input;
609
611
  const { classNames } = settings;
610
- const isValidLastBRTag = lastChild && lastChild.nodeName === 'BR';
611
- if (!classList.contains(classNames.focus) && isValidLastBRTag) {
612
- const range = document.createRange();
613
- const selection = window.getSelection();
614
- // Move the range to the end of the input's content
615
- range.setStartBefore(lastChild);
616
- range.collapse(true);
617
- // Remove any existing selection and add the new range
618
- selection?.removeAllRanges();
619
- selection?.addRange(range);
620
- tagifyRef.current.DOM.input.focus();
612
+ if (!classList.contains(classNames.focus) && DOM?.input) {
613
+ try {
614
+ const { lastChild } = DOM?.input;
615
+ const isValidLastBRTag = lastChild && lastChild.nodeName === 'BR';
616
+ const hasEmptyCls = classList.contains(classNames.empty);
617
+ const isEmptyChildNodes = DOM?.input.childNodes.length === 0;
618
+ const isEmptyInputData = _.isNull(lastChild) && hasEmptyCls && isEmptyChildNodes;
619
+ // Create a new range
620
+ const range = document.createRange();
621
+ const selection = window.getSelection();
622
+ // Move the selection to before of the last BR
623
+ if (isValidLastBRTag) {
624
+ // Move the range to the end of the input's content
625
+ range.setStartBefore(lastChild);
626
+ range.collapse(true);
627
+ // Remove any existing selection and add the new range
628
+ selection?.removeAllRanges();
629
+ selection?.addRange(range);
630
+ DOM.input.focus();
631
+ }
632
+ else if (isEmptyInputData) {
633
+ // Move the range to the end of the input's content
634
+ range.selectNodeContents(DOM.input);
635
+ range.collapse(false);
636
+ selection?.removeAllRanges();
637
+ selection?.addRange(range);
638
+ DOM.input.focus();
639
+ }
640
+ }
641
+ catch (error) {
642
+ // eslint-disable-next-line no-console
643
+ console.error(error);
644
+ }
621
645
  }
622
646
  }
623
647
  }, []);
@@ -17,6 +17,7 @@ export const WrapperPlaceHolder = styled.div `
17
17
  `};
18
18
  `;
19
19
  export const TagifyWrapper = styled.div `
20
+ cursor: text;
20
21
  background: ${globalToken?.bw0};
21
22
  border-bottom: 1px solid ${({ $status }) => getBackgroundInputStatus($status)};
22
23
  min-height: ${MIN_H_WRAPPER}px;
@@ -3,5 +3,4 @@
3
3
  * Asynchronously loads the component for TemplateListing
4
4
  *
5
5
  */
6
- /// <reference types="react" />
7
6
  export declare const TemplateListing: (props: import("./types").TemplateListingProps<{}>) => JSX.Element;
@@ -2693,6 +2693,8 @@
2693
2693
  "_TITLE_IP_RESTRICTION_SPECIFIC_ACCOUNTS": "Specific accounts",
2694
2694
  "_ERROR_IP_RESTRICTION_ADD_ACCOUNT": "Please select at least one account, or select all accounts instead",
2695
2695
  "_ERROR_IP_RESTRICTION_DUPLICATE_IP": "IP addresses in the sequence should not be duplicated",
2696
+ "_ERROR_IP_RESTRICTION_IP_EXIST": "This address already exists",
2697
+ "_ERROR_IP_RESTRICTION_INVALID_IP": "Please enter a valid IP address or IP range",
2696
2698
  "_USER_GUIDE_IP_RESTRICTION_GUIDE_1": "What occurs when an account is restricted to a specific IP address?",
2697
2699
  "_USER_GUIDE_IP_RESTRICTION_GUIDE_2": "This account accesses the CDP only via a specific IP address. If you create an IP address and apply it to all accounts on the portal, access will be restricted for all accounts, including any new ones created in the future.",
2698
2700
  "_USER_GUIDE_IP_RESTRICTION_GUIDE_3": "Add accounts you want to restrict from the popup",
@@ -2695,6 +2695,8 @@ export declare const translationsJson: {
2695
2695
  _TITLE_IP_RESTRICTION_SPECIFIC_ACCOUNTS: string;
2696
2696
  _ERROR_IP_RESTRICTION_ADD_ACCOUNT: string;
2697
2697
  _ERROR_IP_RESTRICTION_DUPLICATE_IP: string;
2698
+ _ERROR_IP_RESTRICTION_IP_EXIST: string;
2699
+ _ERROR_IP_RESTRICTION_INVALID_IP: string;
2698
2700
  _USER_GUIDE_IP_RESTRICTION_GUIDE_1: string;
2699
2701
  _USER_GUIDE_IP_RESTRICTION_GUIDE_2: string;
2700
2702
  _USER_GUIDE_IP_RESTRICTION_GUIDE_3: string;
@@ -6086,6 +6088,8 @@ export declare const translationsJson: {
6086
6088
  _TITLE_IP_RESTRICTION_SPECIFIC_ACCOUNTS: string;
6087
6089
  _ERROR_IP_RESTRICTION_ADD_ACCOUNT: string;
6088
6090
  _ERROR_IP_RESTRICTION_DUPLICATE_IP: string;
6091
+ _ERROR_IP_RESTRICTION_IP_EXIST: string;
6092
+ _ERROR_IP_RESTRICTION_INVALID_IP: string;
6089
6093
  _USER_GUIDE_IP_RESTRICTION_GUIDE_1: string;
6090
6094
  _USER_GUIDE_IP_RESTRICTION_GUIDE_2: string;
6091
6095
  _USER_GUIDE_IP_RESTRICTION_GUIDE_3: string;
@@ -9013,6 +9017,8 @@ export declare const translationsJson: {
9013
9017
  _TITLE_IP_RESTRICTION_SPECIFIC_ACCOUNTS: string;
9014
9018
  _ERROR_IP_RESTRICTION_ADD_ACCOUNT: string;
9015
9019
  _ERROR_IP_RESTRICTION_DUPLICATE_IP: string;
9020
+ _ERROR_IP_RESTRICTION_IP_EXIST: string;
9021
+ _ERROR_IP_RESTRICTION_INVALID_IP: string;
9016
9022
  _USER_GUIDE_IP_RESTRICTION_GUIDE_1: string;
9017
9023
  _USER_GUIDE_IP_RESTRICTION_GUIDE_2: string;
9018
9024
  _USER_GUIDE_IP_RESTRICTION_GUIDE_3: string;
@@ -94,7 +94,7 @@
94
94
  "_ACT_QUICK_TEST": "クイックテスト",
95
95
  "_ACT_REFINE_ATTRIBUTE": "属性で絞り込む",
96
96
  "_ACT_REMOVE": "取り除く",
97
- "_ACT_REMOVE_ALL": "すべて削除する",
97
+ "_ACT_REMOVE_ALL": "すべて削除",
98
98
  "_ACT_REPLACE": "交換する",
99
99
  "_ACT_REPORTS": "レポート",
100
100
  "_ACT_RESET": "リセット",
@@ -2679,6 +2679,8 @@
2679
2679
  "_TITLE_IP_RESTRICTION_SPECIFIC_ACCOUNTS": "特定のアカウント",
2680
2680
  "_ERROR_IP_RESTRICTION_ADD_ACCOUNT": "少なくとも 1 つのアカウントを選択するか、代わりにすべてのアカウントを選択してください",
2681
2681
  "_ERROR_IP_RESTRICTION_DUPLICATE_IP": "シーケンス内の IP アドレスは重複してはなりません",
2682
+ "_ERROR_IP_RESTRICTION_IP_EXIST": "このアドレスはすでに存在します",
2683
+ "_ERROR_IP_RESTRICTION_INVALID_IP": "有効な IP アドレスまたは IP 範囲を入力してください",
2682
2684
  "_USER_GUIDE_IP_RESTRICTION_GUIDE_1": "アカウントが特定の IP アドレスに制限されている場合はどうなりますか?",
2683
2685
  "_USER_GUIDE_IP_RESTRICTION_GUIDE_2": "このアカウントは、特定の IP アドレスを介してのみ CDP にアクセスします。 IP アドレスを作成し、それをポータル上のすべてのアカウントに適用すると、今後作成される新しいアカウントも含め、すべてのアカウントのアクセスが制限されます。",
2684
2686
  "_USER_GUIDE_IP_RESTRICTION_GUIDE_3": "制限したいアカウントをポップアップから追加します",
@@ -2693,6 +2693,8 @@
2693
2693
  "_TITLE_IP_RESTRICTION_SPECIFIC_ACCOUNTS": "Tài khoản cụ thể",
2694
2694
  "_ERROR_IP_RESTRICTION_ADD_ACCOUNT": "Vui lòng chọn ít nhất một tài khoản hoặc chọn tất cả tài khoản để thay thế",
2695
2695
  "_ERROR_IP_RESTRICTION_DUPLICATE_IP": "Địa chỉ IP trong dãy không được trùng nhau",
2696
+ "_ERROR_IP_RESTRICTION_IP_EXIST": "Địa chỉ đã tồn tại",
2697
+ "_ERROR_IP_RESTRICTION_INVALID_IP": "Vui lòng nhập địa chỉ IP hoặc khoảng IP hợp lệ",
2696
2698
  "_USER_GUIDE_IP_RESTRICTION_GUIDE_1": "Điều gì xảy ra khi một tài khoản bị giới hạn ở một địa chỉ IP cụ thể?",
2697
2699
  "_USER_GUIDE_IP_RESTRICTION_GUIDE_2": "Tài khoản này chỉ truy cập CDP qua một địa chỉ IP cụ thể. Nếu bạn tạo một địa chỉ IP và áp dụng cho tất cả các tài khoản, quyền truy cập sẽ bị hạn chế đối với tất cả các tài khoản, bao gồm cả những tài khoản mới được tạo trong tương lai.",
2698
2700
  "_USER_GUIDE_IP_RESTRICTION_GUIDE_3": "Thêm tài khoản bạn muốn hạn chế từ cửa sổ bật lên",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.863",
3
+ "version": "1.3.5-beta.864",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",