Преглед изворни кода

Feature: SelectBox completed.

lfabl пре 1 месец
родитељ
комит
96ce425e50
2 измењених фајлова са 20 додато и 11 уклоњено
  1. 8 3
      src/components/selectBox/index.tsx
  2. 12 8
      src/variants/locales/default.json

+ 8 - 3
src/components/selectBox/index.tsx

@@ -23,7 +23,8 @@ import stylesheet, {
 } from "./stylesheet";
 import {
     NCoreUIKitLocalize,
-    NCoreUIKitTheme
+    NCoreUIKitTheme,
+    NCoreUIKitToast
 } from "../../core/hooks";
 import {
     type INCoreUIKitIconProps,
@@ -420,7 +421,9 @@ function SelectBox<T>({
                 const _minChoice = minChoice === undefined ? 0 : minChoice;
 
                 if(_minChoice > 0) {
-                    // TODO: make toast;
+                    NCoreUIKitToast.open({
+                        title: localize("minimum-a-item-selection-required")
+                    });
                 } else {
                     isProcessPerm = true;
                 }
@@ -442,7 +445,9 @@ function SelectBox<T>({
                 if(_selectedItems.length < maxChoice || maxChoice === -1) {
                     isProcessPerm = true;
                 } else {
-                    // TODO: make toast;
+                    NCoreUIKitToast.open({
+                        title: localize("maximum-selection-limit-has-been-reached")
+                    });
                 }
             } else {
                 _selectedItems = [];

+ 12 - 8
src/variants/locales/default.json

@@ -3,11 +3,13 @@
         "locale": "tr-TR",
         "isRTL": false,
         "translations": {
-            "selected-options-with-count": "{{0}} items selected",
-            "select-an-option": "Select an option",
-            "select-all": "Select All",
+            "maximum-selection-limit-has-been-reached": "Maksimum seçim limitine ulaşıldı.",
+            "minimum-a-item-selection-required": "Minimum 1 öğe seçimi gereklidir.",
+            "selected-options-with-count": "{{0}} seçim yapıldı",
+            "select-an-option": "Seçim yapın",
+            "clean-all": "Tümünü Temizle",
+            "select-all": "Tümünü Seç",
             "is-optional": "Opsiyonel",
-            "clean-all": "Clean All",
             "cancel": "İptal",
             "search": "Ara",
             "ok": "Tamam"
@@ -17,11 +19,13 @@
         "locale": "en-US",
         "isRTL": false,
         "translations": {
-            "selected-options-with-count": "{{0}} seçim yapıldı",
-            "select-an-option": "Seçim yapın",
-            "clean-all": "Tümünü Temizle",
-            "select-all": "Tümünü Seç",
+            "maximum-selection-limit-has-been-reached": "Maximum selection limit has been reached.",
+            "minimum-a-item-selection-required": "Minimum 1 item selection required.",
+            "selected-options-with-count": "{{0}} items selected",
+            "select-an-option": "Select an option",
+            "select-all": "Select All",
             "is-optional": "Optional",
+            "clean-all": "Clean All",
             "cancel": "Cancel",
             "search": "Search",
             "ok": "Okey"