@geotab/zenith 3.17.1-beta.2 → 3.17.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/README.md +8 -7
- package/dist/checkboxListWithAction/checkboxListWithAction.d.ts +7 -0
- package/dist/checkboxListWithAction/checkboxListWithAction.js +57 -44
- package/dist/datePickerCommon/hooks/useDateRangeRaw/useDateRangeRawCore.d.ts +7 -1
- package/dist/datePickerCommon/hooks/useDateRangeRaw/useDateRangeRawCore.js +5 -5
- package/dist/dateRangeRawNew/hooks/useDateRangeNewParts.d.ts +7 -1
- package/dist/dateRangeRawNew/hooks/useDateRangeNewParts.js +24 -15
- package/dist/dateRangeRawNew/hooks/useDateRangeRawNew.js +2 -2
- package/dist/dateRangeRawNew/hooks/useRangeEntry.js +31 -4
- package/dist/dropdownRaw/dropdownHelper.d.ts +4 -0
- package/dist/dropdownRaw/dropdownHelper.js +11 -3
- package/dist/dropdownRaw/types.d.ts +6 -0
- package/dist/index.css +104 -2
- package/dist/mobileSheet/mobileSheet.js +1 -0
- package/dist/selectList/selectListItem.d.ts +7 -1
- package/dist/selectList/selectListItem.js +24 -7
- package/dist/utils/localization/translations/ar-001.json +2 -1
- package/dist/utils/localization/translations/bg-BG.json +2 -1
- package/dist/utils/localization/translations/cs.json +2 -1
- package/dist/utils/localization/translations/da-DK.json +2 -1
- package/dist/utils/localization/translations/de.json +2 -1
- package/dist/utils/localization/translations/el-GR.json +2 -1
- package/dist/utils/localization/translations/en.json +2 -1
- package/dist/utils/localization/translations/es.json +2 -1
- package/dist/utils/localization/translations/et-EE.json +2 -1
- package/dist/utils/localization/translations/fi-FI.json +2 -1
- package/dist/utils/localization/translations/fr-FR.json +2 -1
- package/dist/utils/localization/translations/fr.json +2 -1
- package/dist/utils/localization/translations/hu-HU.json +2 -1
- package/dist/utils/localization/translations/id.json +2 -1
- package/dist/utils/localization/translations/it.json +2 -1
- package/dist/utils/localization/translations/ja.json +2 -1
- package/dist/utils/localization/translations/ka-GE.json +2 -1
- package/dist/utils/localization/translations/ko-KR.json +2 -1
- package/dist/utils/localization/translations/lt-LT.json +2 -1
- package/dist/utils/localization/translations/lv-LV.json +2 -1
- package/dist/utils/localization/translations/ms.json +2 -1
- package/dist/utils/localization/translations/nb-NO.json +2 -1
- package/dist/utils/localization/translations/nl.json +2 -1
- package/dist/utils/localization/translations/pl.json +2 -1
- package/dist/utils/localization/translations/pt-BR.json +2 -1
- package/dist/utils/localization/translations/pt-PT.json +2 -1
- package/dist/utils/localization/translations/ro-RO.json +2 -1
- package/dist/utils/localization/translations/sk-SK.json +2 -1
- package/dist/utils/localization/translations/sv.json +2 -1
- package/dist/utils/localization/translations/th.json +2 -1
- package/dist/utils/localization/translations/tr.json +2 -1
- package/dist/utils/localization/translations/zh-Hans.json +2 -1
- package/dist/utils/localization/translations/zh-TW.json +2 -1
- package/esm/checkboxListWithAction/checkboxListWithAction.d.ts +7 -0
- package/esm/checkboxListWithAction/checkboxListWithAction.js +52 -44
- package/esm/datePickerCommon/hooks/useDateRangeRaw/useDateRangeRawCore.d.ts +7 -1
- package/esm/datePickerCommon/hooks/useDateRangeRaw/useDateRangeRawCore.js +5 -5
- package/esm/dateRangeRawNew/hooks/useDateRangeNewParts.d.ts +7 -1
- package/esm/dateRangeRawNew/hooks/useDateRangeNewParts.js +24 -15
- package/esm/dateRangeRawNew/hooks/useDateRangeRawNew.js +2 -2
- package/esm/dateRangeRawNew/hooks/useRangeEntry.js +31 -4
- package/esm/dropdownRaw/dropdownHelper.d.ts +4 -0
- package/esm/dropdownRaw/dropdownHelper.js +11 -3
- package/esm/dropdownRaw/types.d.ts +6 -0
- package/esm/mobileSheet/mobileSheet.js +1 -0
- package/esm/selectList/selectListItem.d.ts +7 -1
- package/esm/selectList/selectListItem.js +22 -8
- package/esm/utils/localization/translations/ar-001.json +2 -1
- package/esm/utils/localization/translations/bg-BG.json +2 -1
- package/esm/utils/localization/translations/cs.json +2 -1
- package/esm/utils/localization/translations/da-DK.json +2 -1
- package/esm/utils/localization/translations/de.json +2 -1
- package/esm/utils/localization/translations/el-GR.json +2 -1
- package/esm/utils/localization/translations/en.json +2 -1
- package/esm/utils/localization/translations/es.json +2 -1
- package/esm/utils/localization/translations/et-EE.json +2 -1
- package/esm/utils/localization/translations/fi-FI.json +2 -1
- package/esm/utils/localization/translations/fr-FR.json +2 -1
- package/esm/utils/localization/translations/fr.json +2 -1
- package/esm/utils/localization/translations/hu-HU.json +2 -1
- package/esm/utils/localization/translations/id.json +2 -1
- package/esm/utils/localization/translations/it.json +2 -1
- package/esm/utils/localization/translations/ja.json +2 -1
- package/esm/utils/localization/translations/ka-GE.json +2 -1
- package/esm/utils/localization/translations/ko-KR.json +2 -1
- package/esm/utils/localization/translations/lt-LT.json +2 -1
- package/esm/utils/localization/translations/lv-LV.json +2 -1
- package/esm/utils/localization/translations/ms.json +2 -1
- package/esm/utils/localization/translations/nb-NO.json +2 -1
- package/esm/utils/localization/translations/nl.json +2 -1
- package/esm/utils/localization/translations/pl.json +2 -1
- package/esm/utils/localization/translations/pt-BR.json +2 -1
- package/esm/utils/localization/translations/pt-PT.json +2 -1
- package/esm/utils/localization/translations/ro-RO.json +2 -1
- package/esm/utils/localization/translations/sk-SK.json +2 -1
- package/esm/utils/localization/translations/sv.json +2 -1
- package/esm/utils/localization/translations/th.json +2 -1
- package/esm/utils/localization/translations/tr.json +2 -1
- package/esm/utils/localization/translations/zh-Hans.json +2 -1
- package/esm/utils/localization/translations/zh-TW.json +2 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { injectString } from "../utils/localization/translationsDictionary";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { Fragment, useCallback, useEffect, useId, useRef, useState } from "react";
|
|
4
|
+
import React from "react";
|
|
4
5
|
import { Checkbox } from "../checkbox/checkbox";
|
|
5
6
|
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
6
7
|
import { IconChevronRight } from "../icons/iconChevronRight";
|
|
@@ -107,39 +108,39 @@ injectString("ka-GE", "Toggle {groupName} filter", "{groupName} \u10E4\u10D8\u10
|
|
|
107
108
|
injectString("el-GR", "Toggle {groupName} filter", "\u0395\u03BD\u03B1\u03BB\u03BB\u03B1\u03B3\u03AE \u03C6\u03AF\u03BB\u03C4\u03C1\u03BF\u03C5 {groupName}");
|
|
108
109
|
injectString("et-EE", "Toggle {groupName} filter", "L\xFClita {groupName} filter");
|
|
109
110
|
injectString("bg-BG", "Toggle {groupName} filter", "\u041F\u0440\u0435\u0432\u043A\u043B\u044E\u0447\u0432\u0430\u043D\u0435 \u043D\u0430 \u0444\u0438\u043B\u0442\u044A\u0440\u0430 \u0437\u0430 {groupName}");
|
|
110
|
-
injectString("cs", "
|
|
111
|
-
injectString("da-DK", "
|
|
112
|
-
injectString("de", "
|
|
113
|
-
injectString("en", "
|
|
114
|
-
injectString("es", "
|
|
115
|
-
injectString("fi-FI", "
|
|
116
|
-
injectString("fr", "
|
|
117
|
-
injectString("fr-FR", "
|
|
118
|
-
injectString("hu-HU", "
|
|
119
|
-
injectString("id", "
|
|
120
|
-
injectString("it", "
|
|
121
|
-
injectString("ja", "
|
|
122
|
-
injectString("ko-KR", "
|
|
123
|
-
injectString("ms", "
|
|
124
|
-
injectString("nb-NO", "
|
|
125
|
-
injectString("nl", "
|
|
126
|
-
injectString("pl", "
|
|
127
|
-
injectString("pt-BR", "
|
|
128
|
-
injectString("pt-PT", "
|
|
129
|
-
injectString("sk-SK", "
|
|
130
|
-
injectString("sv", "
|
|
131
|
-
injectString("th", "
|
|
132
|
-
injectString("tr", "
|
|
133
|
-
injectString("zh-Hans", "
|
|
134
|
-
injectString("zh-TW", "
|
|
135
|
-
injectString("ro-RO", "
|
|
136
|
-
injectString("ar-001", "
|
|
137
|
-
injectString("lt-LT", "
|
|
138
|
-
injectString("lv-LV", "
|
|
139
|
-
injectString("ka-GE", "
|
|
140
|
-
injectString("el-GR", "
|
|
141
|
-
injectString("et-EE", "
|
|
142
|
-
injectString("bg-BG", "
|
|
111
|
+
injectString("cs", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Tento polo\u017Eka m\xE1 dal\u0161\xED akce. Stiskn\u011Bte prav\xFD \u0161ipku, abyste roz\u0161\xED\u0159ili. Stiskn\u011Bte \u0161ipku doleva, abyste se vr\xE1tili zp\u011Bt.");
|
|
112
|
+
injectString("da-DK", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Dette element har yderligere handlinger. Tryk p\xE5 h\xF8jre piletast for at udvide. Tryk p\xE5 venstre piletast for at g\xE5 tilbage.");
|
|
113
|
+
injectString("de", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Dieses Element enth\xE4lt zus\xE4tzliche Aktionen. Dr\xFCcken Sie die rechte Pfeiltaste, um zu erweitern. Dr\xFCcken Sie die linke Pfeiltaste, um zur\xFCckzugehen.");
|
|
114
|
+
injectString("en", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.");
|
|
115
|
+
injectString("es", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Este elemento tiene acciones adicionales. Presione la tecla de flecha derecha para expandir. Presione la tecla de flecha izquierda para regresar.");
|
|
116
|
+
injectString("fi-FI", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "T\xE4ll\xE4 kohteella on lis\xE4toimintoja. Paina oikeaa nuolin\xE4pp\xE4int\xE4 laajentaaksesi. Paina vasenta nuolin\xE4pp\xE4int\xE4 palataksesi takaisin.");
|
|
117
|
+
injectString("fr", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Cet \xE9l\xE9ment comporte des actions suppl\xE9mentaires. Appuyez sur la touche fl\xE9ch\xE9e de droite pour d\xE9velopper. Appuyez sur la touche fl\xE9ch\xE9e de gauche pour revenir en arri\xE8re.");
|
|
118
|
+
injectString("fr-FR", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Cet \xE9l\xE9ment dispose d\u2019actions suppl\xE9mentaires. Appuyez sur la fl\xE8che vers la droite pour agrandir. Appuyez sur la fl\xE8che gauche pour revenir en arri\xE8re.");
|
|
119
|
+
injectString("hu-HU", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Ez a t\xE9tel tov\xE1bbi m\u0171veleteket tartalmaz. Nyomja meg a jobb ny\xEDl kulcsot a kib\u0151v\xEDt\xE9shez. Nyomja le a balos ny\xEDl kulcsot, hogy visszal\xE9pjen.");
|
|
120
|
+
injectString("id", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Item ini memiliki tindakan tambahan. Tekan tombol panah kanan untuk meluaskan. Tekan tombol panah kiri untuk kembali.");
|
|
121
|
+
injectString("it", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Questo elemento presenta azioni ulteriori. Premere il tasto freccia destra per espandere. Premere il tasto freccia sinistra per tornare indietro.");
|
|
122
|
+
injectString("ja", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "\u3053\u306E\u9805\u76EE\u306B\u306F\u8FFD\u52A0\u306E\u30A2\u30AF\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u3059\u3002\u53F3\u77E2\u5370\u30AD\u30FC\u3092\u62BC\u3059\u3068\u5C55\u958B\u3055\u308C\u307E\u3059\u3002\u5DE6\u77E2\u5370\u30AD\u30FC\u3092\u62BC\u3059\u3068\u3001\u623B\u308A\u307E\u3059\u3002");
|
|
123
|
+
injectString("ko-KR", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "\uC774 \uD56D\uBAA9\uC5D0\uB294 \uCD94\uAC00 \uC791\uC5C5\uC774 \uC788\uC2B5\uB2C8\uB2E4. \uC624\uB978\uCABD \uD654\uC0B4\uD45C \uD0A4\uB97C \uB20C\uB7EC \uD655\uC7A5\uD558\uC2ED\uC2DC\uC624. \uC67C\uCABD \uD654\uC0B4\uD45C \uD0A4\uB97C \uB20C\uB7EC \uB4A4\uB85C \uC774\uB3D9\uD558\uC2ED\uC2DC\uC624.");
|
|
124
|
+
injectString("ms", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Item ini mempunyai tindakan tambahan. Tekan kekunci anak panah kanan untuk mengembangkan. Tekan kekunci anak panah kiri untuk kembali.");
|
|
125
|
+
injectString("nb-NO", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Dette elementet har flere handlinger. Trykk p\xE5 h\xF8yre piltast for \xE5 utvide. Trykk p\xE5 venstre piltast for \xE5 g\xE5 tilbake.");
|
|
126
|
+
injectString("nl", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Dit item heeft extra acties. Druk op de pijltoets naar rechts om uit te vouwen. Druk op de pijltoets naar links om terug te gaan.");
|
|
127
|
+
injectString("pl", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Ten element ma dodatkowe dzia\u0142ania. Naci\u015Bnij strza\u0142k\u0119 w prawo, aby rozwin\u0105\u0107. Naci\u015Bnij strza\u0142k\u0119 w lewo, aby wr\xF3ci\u0107.");
|
|
128
|
+
injectString("pt-BR", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Este item possui a\xE7\xF5es adicionais. Pressione a tecla de seta para a direita para expandir. Pressione a tecla de seta para a esquerda para voltar.");
|
|
129
|
+
injectString("pt-PT", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Este item tem a\xE7\xF5es adicionais. Prima a tecla de seta para a direita para expandir. Prima a tecla de seta para a esquerda para voltar atr\xE1s.");
|
|
130
|
+
injectString("sk-SK", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "T\xE1to polo\u017Eka m\xE1 \u010Fal\u0161ie akcie. Stla\u010Den\xEDm kl\xE1vesu so \u0161\xEDpkou doprava rozbal\xEDte. Stla\u010Den\xEDm kl\xE1vesu so \u0161\xEDpkou do\u013Eava sa vr\xE1tite sp\xE4\u0165.");
|
|
131
|
+
injectString("sv", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Denna artikel har ytterligare \xE5tg\xE4rder. Tryck p\xE5 h\xF6gerpiltangenten f\xF6r att expandera. Tryck p\xE5 v\xE4nsterpiltangent f\xF6r att g\xE5 tillbaka.");
|
|
132
|
+
injectString("th", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E19\u0E35\u0E49\u0E21\u0E35\u0E01\u0E32\u0E23\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21 \u0E01\u0E14\u0E1B\u0E38\u0E48\u0E21\u0E25\u0E39\u0E01\u0E28\u0E23\u0E02\u0E27\u0E32\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E02\u0E22\u0E32\u0E22 \u0E01\u0E14\u0E1B\u0E38\u0E48\u0E21\u0E25\u0E39\u0E01\u0E28\u0E23\u0E0B\u0E49\u0E32\u0E22\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E22\u0E49\u0E2D\u0E19\u0E01\u0E25\u0E31\u0E1A");
|
|
133
|
+
injectString("tr", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Bu \xF6\u011Fenin ek eylemleri var. Geni\u015Fletmek i\xE7in sa\u011F ok tu\u015Funa bas\u0131n. Geri d\xF6nmek i\xE7in sol ok tu\u015Funa bas\u0131n.");
|
|
134
|
+
injectString("zh-Hans", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "\u6B64\u9879\u76EE\u6709\u9644\u52A0\u64CD\u4F5C\u3002\u6309\u53F3\u7BAD\u5934\u952E\u5C55\u5F00\u3002\u6309\u5DE6\u7BAD\u5934\u952E\u8FD4\u56DE\u3002");
|
|
135
|
+
injectString("zh-TW", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "\u6B64\u9805\u76EE\u6709\u5176\u4ED6\u52D5\u4F5C\u3002\u6309\u4E0B\u5411\u53F3\u7BAD\u982D\u9375\u4EE5\u5C55\u958B\u3002\u6309\u4E0B\u5411\u5DE6\u7BAD\u982D\u9375\u4EE5\u8FD4\u56DE\u3002");
|
|
136
|
+
injectString("ro-RO", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Acest element are ac\u021Biuni suplimentare. Ap\u0103sa\u021Bi tasta s\u0103geat\u0103 dreapta pentru a extinde. Ap\u0103sa\u021Bi tasta s\u0103geat\u0103 st\xE2nga pentru a reveni.");
|
|
137
|
+
injectString("ar-001", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "\u064A\u062D\u062A\u0648\u064A \u0647\u0630\u0627 \u0627\u0644\u0639\u0646\u0635\u0631 \u0639\u0644\u0649 \u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629. \u0627\u0636\u063A\u0637 \u0639\u0644\u0649 \u0645\u0641\u062A\u0627\u062D \u0627\u0644\u0633\u0647\u0645 \u0627\u0644\u0623\u064A\u0645\u0646 \u0644\u0644\u062A\u0648\u0633\u064A\u0639. \u0627\u0636\u063A\u0637 \u0639\u0644\u0649 \u0645\u0641\u062A\u0627\u062D \u0627\u0644\u0633\u0647\u0645 \u0627\u0644\u0623\u064A\u0633\u0631 \u0644\u0644\u0631\u062C\u0648\u0639.");
|
|
138
|
+
injectString("lt-LT", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "\u0160is elementas turi papildom\u0173 veiksm\u0173. Paspauskite de\u0161iniosios rodykl\u0117s klavi\u0161\u0105, kad i\u0161skleistum\u0117te. Paspauskite kairiosios rodykl\u0117s klavi\u0161\u0105, kad gr\u012F\u017Etum\u0117te.");
|
|
139
|
+
injectString("lv-LV", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "\u0160im vienumam ir papildu darb\u012Bbas. Nospiediet labo bulttausti\u0146u, lai izv\u0113rstu. Nospiediet kreiso bulttausti\u0146u, lai atgrieztos.");
|
|
140
|
+
injectString("ka-GE", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "\u10D0\u10DB \u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10E1 \u10D0\u10E5\u10D5\u10E1 \u10D3\u10D0\u10DB\u10D0\u10E2\u10D4\u10D1\u10D8\u10D7\u10D8 \u10DB\u10DD\u10E5\u10DB\u10D4\u10D3\u10D4\u10D1\u10D4\u10D1\u10D8. \u10D2\u10D0\u10E1\u10D0\u10E8\u10DA\u10D4\u10DA\u10D0\u10D3 \u10D3\u10D0\u10D0\u10ED\u10D8\u10E0\u10D4\u10D7 \u10DB\u10D0\u10E0\u10EF\u10D5\u10D4\u10DC\u10D0 \u10D8\u10E1\u10E0\u10D8\u10E1 \u10E6\u10D8\u10DA\u10D0\u10D9\u10E1. \u10E3\u10D9\u10D0\u10DC \u10D3\u10D0\u10E1\u10D0\u10D1\u10E0\u10E3\u10DC\u10D4\u10D1\u10DA\u10D0\u10D3 \u10D3\u10D0\u10D0\u10ED\u10D8\u10E0\u10D4\u10D7 \u10DB\u10D0\u10E0\u10EA\u10EE\u10D4\u10DC\u10D0 \u10D8\u10E1\u10E0\u10D8\u10E1 \u10E6\u10D8\u10DA\u10D0\u10D9\u10E1.");
|
|
141
|
+
injectString("el-GR", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "\u0391\u03C5\u03C4\u03CC \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF \u03AD\u03C7\u03B5\u03B9 \u03C0\u03C1\u03CC\u03C3\u03B8\u03B5\u03C4\u03B5\u03C2 \u03B5\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B5\u03C2. \u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03C4\u03BF \u03C0\u03BB\u03AE\u03BA\u03C4\u03C1\u03BF \u03B4\u03B5\u03BE\u03B9\u03BF\u03CD \u03B2\u03AD\u03BB\u03BF\u03C5\u03C2 \u03B3\u03B9\u03B1 \u03B1\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7. \u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03C4\u03BF \u03C0\u03BB\u03AE\u03BA\u03C4\u03C1\u03BF \u03B1\u03C1\u03B9\u03C3\u03C4\u03B5\u03C1\u03BF\u03CD \u03B2\u03AD\u03BB\u03BF\u03C5\u03C2 \u03B3\u03B9\u03B1 \u03B5\u03C0\u03B9\u03C3\u03C4\u03C1\u03BF\u03C6\u03AE.");
|
|
142
|
+
injectString("et-EE", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "Sellel \xFCksusel on lisatoimingud. Vajutage laiendamiseks paremat nooleklahvi. Vajutage tagasi liikumiseks vasakut nooleklahvi.");
|
|
143
|
+
injectString("bg-BG", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.", "\u0422\u043E\u0437\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0438\u043C\u0430 \u0434\u043E\u043F\u044A\u043B\u043D\u0438\u0442\u0435\u043B\u043D\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F. \u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u043A\u043B\u0430\u0432\u0438\u0448\u0430 \u0441\u044A\u0441 \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u043D\u0430\u0434\u044F\u0441\u043D\u043E, \u0437\u0430 \u0434\u0430 \u0440\u0430\u0437\u0433\u044A\u043D\u0435\u0442\u0435. \u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u043A\u043B\u0430\u0432\u0438\u0448\u0430 \u0441\u044A\u0441 \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u043D\u0430\u043B\u044F\u0432\u043E, \u0437\u0430 \u0434\u0430 \u0441\u0435 \u0432\u044A\u0440\u043D\u0435\u0442\u0435 \u043D\u0430\u0437\u0430\u0434.");
|
|
143
144
|
export const CheckboxListWithAction = ({
|
|
144
145
|
label,
|
|
145
146
|
options,
|
|
@@ -171,10 +172,7 @@ export const CheckboxListWithAction = ({
|
|
|
171
172
|
});
|
|
172
173
|
};
|
|
173
174
|
const handleClick = e => {
|
|
174
|
-
|
|
175
|
-
const evtTarget = e.target;
|
|
176
|
-
const elId = evtTarget.getAttribute("data-btn") || ((_a = evtTarget.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute("data-btn")) || "";
|
|
177
|
-
onClick(elId);
|
|
175
|
+
onClick(e.currentTarget.dataset.btn || "");
|
|
178
176
|
setFocusedElementType("checkbox");
|
|
179
177
|
};
|
|
180
178
|
const getFocusableElements = useCallback(() => {
|
|
@@ -375,14 +373,24 @@ export const CheckboxListWithAction = ({
|
|
|
375
373
|
"data-btn": option.property
|
|
376
374
|
} : {};
|
|
377
375
|
const childEl = _jsxs(_Fragment, {
|
|
378
|
-
children: [
|
|
376
|
+
children: [option.icon && React.createElement(option.icon, {
|
|
377
|
+
className: "zen-checkbox-list-with-action__item-icon",
|
|
378
|
+
size: "large"
|
|
379
|
+
}), _jsxs("div", Object.assign({
|
|
379
380
|
className: "zen-checkbox-list-with-action__label-text zen-ellipsis"
|
|
380
381
|
}, otherArgs, {
|
|
381
|
-
children: [
|
|
382
|
-
className: "zen-
|
|
382
|
+
children: [_jsxs("div", Object.assign({
|
|
383
|
+
className: "zen-checkbox-list-with-action__label-primary-row"
|
|
383
384
|
}, otherArgs, {
|
|
384
|
-
children:
|
|
385
|
-
|
|
385
|
+
children: [_jsx("span", Object.assign({
|
|
386
|
+
className: "zen-ellipsis"
|
|
387
|
+
}, otherArgs, {
|
|
388
|
+
children: lbl
|
|
389
|
+
})), getLabelCountSelectedChild(option.countSelectedChild, otherArgs)]
|
|
390
|
+
})), option.metaData && _jsx("span", {
|
|
391
|
+
className: "zen-checkbox-list-with-action__item-meta",
|
|
392
|
+
children: option.metaData
|
|
393
|
+
})]
|
|
386
394
|
})), _jsxs("div", Object.assign({
|
|
387
395
|
className: "zen-checkbox-list-with-action__label-info"
|
|
388
396
|
}, otherArgs, {
|
|
@@ -464,8 +472,8 @@ export const CheckboxListWithAction = ({
|
|
|
464
472
|
id: navigationInstructionsId,
|
|
465
473
|
className: "zen-checkbox-list-with-action__sr-only",
|
|
466
474
|
"aria-hidden": "true",
|
|
467
|
-
children: translate("
|
|
475
|
+
children: translate("This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.")
|
|
468
476
|
})]
|
|
469
477
|
});
|
|
470
478
|
};
|
|
471
|
-
export const TRANSLATIONS = ["View {groupName} children", "Toggle {groupName} filter", "Number of selected child groups - {count}"];
|
|
479
|
+
export const TRANSLATIONS = ["View {groupName} children", "Toggle {groupName} filter", "Number of selected child groups - {count}", "This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back."];
|
|
@@ -60,7 +60,13 @@ export declare const useDateRangeRawCore: (props: TWithDefaultOptions<TDateRange
|
|
|
60
60
|
datesValidation: (val: any) => boolean;
|
|
61
61
|
isDatesValid: import("react").RefObject<boolean>;
|
|
62
62
|
previousStepOption: import("react").RefObject<string>;
|
|
63
|
-
handleDateRangeSelection: (newVal: string
|
|
63
|
+
handleDateRangeSelection: (newVal: string, transformRange?: (range: {
|
|
64
|
+
from: Date;
|
|
65
|
+
to: Date;
|
|
66
|
+
}) => {
|
|
67
|
+
from: Date;
|
|
68
|
+
to: Date;
|
|
69
|
+
}) => void;
|
|
64
70
|
handleApplyClick: () => void;
|
|
65
71
|
handleCancelClick: () => void;
|
|
66
72
|
handleClearClick: () => void;
|
|
@@ -211,12 +211,12 @@ export const useDateRangeRawCore = (props, behavior) => {
|
|
|
211
211
|
}, [isOpen, isStaleCustomDraft, prevSelection]);
|
|
212
212
|
const handleDateRangeSelection = useCallback(
|
|
213
213
|
// eslint-disable-next-line complexity
|
|
214
|
-
newVal => {
|
|
215
|
-
var _a, _b;
|
|
214
|
+
(newVal, transformRange) => {
|
|
215
|
+
var _a, _b, _c;
|
|
216
216
|
const selection = options.find(option => option.id === newVal);
|
|
217
217
|
newVal === CUSTOM_CALENDAR_ID && setShowMobileCalendar(true);
|
|
218
218
|
if (selection && newVal !== CUSTOM_CALENDAR_ID && selection.getRange) {
|
|
219
|
-
const range = selection.getRange();
|
|
219
|
+
const range = (_a = transformRange === null || transformRange === void 0 ? void 0 : transformRange(selection.getRange())) !== null && _a !== void 0 ? _a : selection.getRange();
|
|
220
220
|
const normalizedDates = normalizeDates(range.from.toISOString(), range.to.toISOString(), disableFutureDates, disablePastDates, disableDatesBefore, disableDatesAfter);
|
|
221
221
|
const newRange = newVal === CUSTOM_CALENDAR_ID ? {
|
|
222
222
|
from: new Date(normalizedDates.from),
|
|
@@ -234,8 +234,8 @@ export const useDateRangeRawCore = (props, behavior) => {
|
|
|
234
234
|
}, newRange)));
|
|
235
235
|
previousStepOption.current = "";
|
|
236
236
|
} else {
|
|
237
|
-
const startDateForNormalize = ((
|
|
238
|
-
const endDateForNormalize = ((
|
|
237
|
+
const startDateForNormalize = ((_b = selection === null || selection === void 0 ? void 0 : selection.getRange) === null || _b === void 0 ? void 0 : _b.call(selection)) && (selectedRange === null || selectedRange === void 0 ? void 0 : selectedRange.label) !== newVal ? selection.getRange().from : value === null || value === void 0 ? void 0 : value.from;
|
|
238
|
+
const endDateForNormalize = ((_c = selection === null || selection === void 0 ? void 0 : selection.getRange) === null || _c === void 0 ? void 0 : _c.call(selection)) && (selectedRange === null || selectedRange === void 0 ? void 0 : selectedRange.label) !== newVal ? selection.getRange().to : value === null || value === void 0 ? void 0 : value.to;
|
|
239
239
|
if (!datesValidation(startDateForNormalize === undefined && endDateForNormalize === undefined ? undefined : {
|
|
240
240
|
from: startDateForNormalize,
|
|
241
241
|
to: endDateForNormalize
|
|
@@ -12,7 +12,13 @@ interface IUseDateRangeNewParts {
|
|
|
12
12
|
setShowMobileCalendar: (isVisible: boolean) => void;
|
|
13
13
|
/** What was last applied; closing without Apply goes back to it. */
|
|
14
14
|
prevSelection: IDateRangeValue | undefined;
|
|
15
|
-
selectOption: (optionId: string
|
|
15
|
+
selectOption: (optionId: string, transformRange?: (range: {
|
|
16
|
+
from: Date;
|
|
17
|
+
to: Date;
|
|
18
|
+
}) => {
|
|
19
|
+
from: Date;
|
|
20
|
+
to: Date;
|
|
21
|
+
}) => void;
|
|
16
22
|
segmentedTriggerRef: RefObject<HTMLElement | null>;
|
|
17
23
|
hasApplyButton: boolean;
|
|
18
24
|
defaultValue?: IDateRangeValue;
|
|
@@ -65,28 +65,37 @@ export const useDateRangeNewParts = ({ isOpen, setIsOpen, isMobile, customDate,
|
|
|
65
65
|
const { rebaseToDay } = rangeEntry;
|
|
66
66
|
const handleOptionSelect = useCallback((optionId) => {
|
|
67
67
|
const before = customDate;
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
if (!timeSelect || optionId === CUSTOM_CALENDAR_ID || !before.from || !before.to) {
|
|
69
|
+
selectOption(optionId);
|
|
70
70
|
return;
|
|
71
|
+
}
|
|
71
72
|
const { from: timeFrom, to: timeTo } = before;
|
|
72
73
|
const keepTime = (range) => ({
|
|
73
|
-
from:
|
|
74
|
-
to:
|
|
74
|
+
from: new Date(rebaseToDay(range.from.toISOString(), timeFrom, false)),
|
|
75
|
+
to: new Date(rebaseToDay(range.to.toISOString(), timeTo, true))
|
|
75
76
|
});
|
|
76
77
|
// Kept times that leave no range (13:00 to 13:00 on a single-day preset, or an end before the start) would make a
|
|
77
78
|
// range a form cannot take, so the preset keeps its own whole day then.
|
|
78
|
-
const isEmpty = (range) => isEndBeforeStart(range.from, range.to) ||
|
|
79
|
-
|
|
80
|
-
const kept = keepTime(
|
|
81
|
-
return isEmpty(kept) ?
|
|
79
|
+
const isEmpty = (range) => isEndBeforeStart(range.from.toISOString(), range.to.toISOString()) || range.from.getTime() === range.to.getTime();
|
|
80
|
+
selectOption(optionId, range => {
|
|
81
|
+
const kept = keepTime(range);
|
|
82
|
+
return isEmpty(kept) ? range : kept;
|
|
82
83
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
if (hasApplyButton) {
|
|
85
|
+
setCustomDate(current => {
|
|
86
|
+
if (!current.from || !current.to)
|
|
87
|
+
return current;
|
|
88
|
+
const kept = keepTime({ from: new Date(current.from), to: new Date(current.to) });
|
|
89
|
+
return isEmpty(kept) ? current : { from: kept.from.toISOString(), to: kept.to.toISOString() };
|
|
90
|
+
});
|
|
91
|
+
setSelectedRange(current => {
|
|
92
|
+
if (!current)
|
|
93
|
+
return current;
|
|
94
|
+
const kept = keepTime(current);
|
|
95
|
+
return isEmpty(kept) ? current : Object.assign(Object.assign({}, current), { from: kept.from, to: kept.to });
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}, [customDate, hasApplyButton, rebaseToDay, selectOption, setCustomDate, setSelectedRange, timeSelect]);
|
|
90
99
|
// The new picker only compares the dates: the pills are not a selection of their own, any draft is a custom range.
|
|
91
100
|
const isDraftUnchanged = useMemo(() => customDate.from === (isDateValid(value === null || value === void 0 ? void 0 : value.from) ? value.from.toISOString() : undefined) &&
|
|
92
101
|
customDate.to === (isDateValid(value === null || value === void 0 ? void 0 : value.to) ? value.to.toISOString() : undefined), [customDate.from, customDate.to, value === null || value === void 0 ? void 0 : value.from, value === null || value === void 0 ? void 0 : value.to]);
|
|
@@ -297,12 +297,12 @@ export const useDateRangeRawNew = props => {
|
|
|
297
297
|
// Opened with no value, the draft starts on the default, or on today; Clear puts it back there rather than to nothing.
|
|
298
298
|
const handleClear = useCallback(() => {
|
|
299
299
|
handleClearClick();
|
|
300
|
-
if (!hasApplyButton || defaultValue
|
|
300
|
+
if (!hasApplyButton || defaultValue) return;
|
|
301
301
|
const fallback = getFallbackRange();
|
|
302
302
|
if (!fallback) return;
|
|
303
303
|
setSelectedRange(fallback.labeled);
|
|
304
304
|
setCustomDate(fallback.draft);
|
|
305
|
-
}, [defaultValue, getFallbackRange, handleClearClick, hasApplyButton, setCustomDate, setSelectedRange
|
|
305
|
+
}, [defaultValue, getFallbackRange, handleClearClick, hasApplyButton, setCustomDate, setSelectedRange]);
|
|
306
306
|
// The chip's X has no popup to press Apply in. With an Apply button the core only resets the draft, so the X reports the reset itself:
|
|
307
307
|
// the default, or nothing when the value may be unset. Without one the core already does. The footer's Clear stays staged.
|
|
308
308
|
const {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useCallback, useMemo } from "react";
|
|
2
|
+
import { getValidDatesForEnd, getValidDatesForStart, isDifferentPeriod } from "../../calendar/dateUtils";
|
|
2
3
|
import { CUSTOM_CALENDAR_ID } from "../../datePickerCommon/utils/customCalendarId";
|
|
3
4
|
import { toEditableFormat } from "../../datePickerNew/components/dateSegmentInput/utils/toEditableFormat";
|
|
4
5
|
import { toEditableTimeFormat } from "../../datePickerNew/components/dateSegmentInput/utils/toEditableTimeFormat";
|
|
@@ -59,13 +60,39 @@ export const useRangeEntry = ({ customDate, setCustomDate, setSelectedRange, isO
|
|
|
59
60
|
}, [customDate, lockEndDate, lockStartDate, markCustom, raiseAdjustment, rebaseToDay, setCustomDate, toLocalDateTime, toReverseOffsetDateTime]);
|
|
60
61
|
// A range edited by hand, dates typed or a time picked, is put in order and a locked end is kept; the banner says when an end moved.
|
|
61
62
|
const commitEdited = useCallback((next) => {
|
|
63
|
+
var _a, _b;
|
|
62
64
|
const { range: ordered, adjusted } = resolveRangeOrder(customDate, pinLockedEnds(next, lockStartDate, lockEndDate), rebaseToDay);
|
|
63
65
|
const locked = applyRangeLocks(customDate, ordered, lockStartDate, lockEndDate);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
const start = locked.from ? new Date(locked.from) : undefined;
|
|
67
|
+
const end = locked.to ? new Date(locked.to) : undefined;
|
|
68
|
+
const crossesDisabledPeriod = start &&
|
|
69
|
+
end &&
|
|
70
|
+
isDifferentPeriod(toReverseOffsetDateTime(start), toReverseOffsetDateTime(end), disableFutureDates, disablePastDates, disableDatesBefore, disableDatesAfter);
|
|
71
|
+
const startChanged = locked.from !== customDate.from;
|
|
72
|
+
const validRange = crossesDisabledPeriod
|
|
73
|
+
? startChanged && !lockStartDate
|
|
74
|
+
? getValidDatesForEnd(toReverseOffsetDateTime, end, start, disableFutureDates, disablePastDates, disableDatesBefore, disableDatesAfter)
|
|
75
|
+
: getValidDatesForStart(toReverseOffsetDateTime, start, end, disableFutureDates, disablePastDates, disableDatesBefore, disableDatesAfter)
|
|
76
|
+
: undefined;
|
|
77
|
+
const committed = validRange ? { from: (_a = validRange.start) === null || _a === void 0 ? void 0 : _a.toISOString(), to: (_b = validRange.end) === null || _b === void 0 ? void 0 : _b.toISOString() } : locked;
|
|
78
|
+
setCustomDate(committed);
|
|
79
|
+
markCustom(committed);
|
|
66
80
|
// The banner says an end moved, so it is raised only for an edit that was kept.
|
|
67
|
-
raiseAdjustment(
|
|
68
|
-
}, [
|
|
81
|
+
raiseAdjustment(committed === customDate ? undefined : adjusted, committed);
|
|
82
|
+
}, [
|
|
83
|
+
customDate,
|
|
84
|
+
disableDatesAfter,
|
|
85
|
+
disableDatesBefore,
|
|
86
|
+
disableFutureDates,
|
|
87
|
+
disablePastDates,
|
|
88
|
+
lockEndDate,
|
|
89
|
+
lockStartDate,
|
|
90
|
+
markCustom,
|
|
91
|
+
raiseAdjustment,
|
|
92
|
+
rebaseToDay,
|
|
93
|
+
setCustomDate,
|
|
94
|
+
toReverseOffsetDateTime
|
|
95
|
+
]);
|
|
69
96
|
// A time picked for one end (mobile). Unlike picking a day, the typed time replaces the end's own.
|
|
70
97
|
const handleTimeSelect = useCallback((field, timeText) => {
|
|
71
98
|
const current = customDate[field];
|
|
@@ -38,6 +38,8 @@ export declare const applySortSelectedToTop: (items: IDropdownRawItem[], selecte
|
|
|
38
38
|
export declare const createSingleListOptions: (stateObj: IDropdownState, translate: (s: string) => string, listItem: IDropdownRawItem[]) => {
|
|
39
39
|
destructive: boolean | undefined;
|
|
40
40
|
divider?: boolean | undefined;
|
|
41
|
+
metaData?: string | undefined;
|
|
42
|
+
icon?: import("react").FC<import("..").IIcon> | undefined;
|
|
41
43
|
id: string;
|
|
42
44
|
children: string;
|
|
43
45
|
title: string;
|
|
@@ -47,6 +49,8 @@ export declare const createSingleListOptions: (stateObj: IDropdownState, transla
|
|
|
47
49
|
export declare const createListDataOptions: (stateObj: IDropdownState, translate: (s: string) => string, listItem: IDropdownRawItem[], isMultiselect: boolean, isAllSelected?: boolean) => ICheckboxListWithActionOption[] | {
|
|
48
50
|
destructive: boolean | undefined;
|
|
49
51
|
divider?: boolean | undefined;
|
|
52
|
+
metaData?: string | undefined;
|
|
53
|
+
icon?: import("react").FC<import("..").IIcon> | undefined;
|
|
50
54
|
id: string;
|
|
51
55
|
children: string;
|
|
52
56
|
title: string;
|
|
@@ -76,7 +76,7 @@ export function prepareComboOptionsForList(actionListData, translate, options, g
|
|
|
76
76
|
const selectedIds = new Set(getSelectedFn());
|
|
77
77
|
const preparedOptions = options && options.length ? options.map(option => {
|
|
78
78
|
const selectedChild = getSelectedChildFn(option.id);
|
|
79
|
-
return Object.assign(Object.assign({
|
|
79
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({
|
|
80
80
|
label: getGroupDescription(option, translate),
|
|
81
81
|
property: option.id,
|
|
82
82
|
checked: isAllSelected ? true : selectedIds.has(option.id),
|
|
@@ -86,6 +86,10 @@ export function prepareComboOptionsForList(actionListData, translate, options, g
|
|
|
86
86
|
blocked: isFlatList ? option.disabled || false : false
|
|
87
87
|
}, getTitle ? {
|
|
88
88
|
title: getTitle(option.id)
|
|
89
|
+
} : {}), option.icon ? {
|
|
90
|
+
icon: option.icon
|
|
91
|
+
} : {}), option.metaData ? {
|
|
92
|
+
metaData: option.metaData
|
|
89
93
|
} : {}), option.divider ? {
|
|
90
94
|
divider: true
|
|
91
95
|
} : {});
|
|
@@ -165,14 +169,18 @@ export const applySortSelectedToTop = (items, selectedIds, {
|
|
|
165
169
|
export const createSingleListOptions = (stateObj, translate, listItem) => {
|
|
166
170
|
const preparedOptions = listItem && listItem.length ? listItem.map(option => {
|
|
167
171
|
const description = getGroupDescription(stateObj.groupsMap[option.id] || option, translate);
|
|
168
|
-
return Object.assign(Object.assign({
|
|
172
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({
|
|
169
173
|
id: option.id,
|
|
170
174
|
children: description,
|
|
171
175
|
// Long names are truncated by `zen-ellipsis`, so expose the full text on hover
|
|
172
176
|
title: description,
|
|
173
177
|
disabled: option.disabled,
|
|
174
178
|
multiLevel: Object.keys(stateObj.groupsMap).length === 0 ? false : option.children && option.children.length > 0 && stateObj.groupsMap[option.id] !== undefined
|
|
175
|
-
}, option.
|
|
179
|
+
}, option.icon ? {
|
|
180
|
+
icon: option.icon
|
|
181
|
+
} : {}), option.metaData ? {
|
|
182
|
+
metaData: option.metaData
|
|
183
|
+
} : {}), option.divider ? {
|
|
176
184
|
divider: true
|
|
177
185
|
} : {}), {
|
|
178
186
|
destructive: option.destructive
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
1
2
|
import { TAlignment } from "../absolute/absolute";
|
|
2
3
|
import { IChipsParent } from "../chip/chip";
|
|
3
4
|
import { IEntityWithId } from "../commonHelpers/entity";
|
|
@@ -5,6 +6,7 @@ import { Exclusive } from "../commonHelpers/types/exclusive";
|
|
|
5
6
|
import { IReactFormItemController } from "../commonHelpers/zenComponent";
|
|
6
7
|
import { TFilterButton } from "../filterButton/filterButton";
|
|
7
8
|
import { IColor } from "../groupsFilterRaw/groupsFilterInterfaces";
|
|
9
|
+
import { IIcon } from "../icons/icon";
|
|
8
10
|
export interface ISelectionItemRaw {
|
|
9
11
|
id: string;
|
|
10
12
|
name?: string;
|
|
@@ -15,6 +17,10 @@ export interface IDropdownRawItem extends IEntityWithId {
|
|
|
15
17
|
children?: IEntityWithId[];
|
|
16
18
|
color?: IColor;
|
|
17
19
|
disabled?: boolean;
|
|
20
|
+
/** Leading 16×16 icon component rendered before the label. */
|
|
21
|
+
icon?: FC<IIcon>;
|
|
22
|
+
/** Secondary text rendered on a second line below the primary label. */
|
|
23
|
+
metaData?: string;
|
|
18
24
|
/** When true, renders a 1px separator line below this item. Purely visual — does not affect selection or keyboard navigation. */
|
|
19
25
|
divider?: boolean;
|
|
20
26
|
/**
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
1
2
|
import { CheckboxState } from "../checkbox/checkboxState";
|
|
2
3
|
import "./selectList.less";
|
|
3
4
|
import { IZenIdComponentProps } from "../commonHelpers/zenComponent";
|
|
5
|
+
import { IIcon } from "../icons/icon";
|
|
4
6
|
export interface ISelectListItem extends IZenIdComponentProps {
|
|
5
7
|
state?: CheckboxState;
|
|
6
8
|
disabled?: boolean;
|
|
@@ -10,6 +12,10 @@ export interface ISelectListItem extends IZenIdComponentProps {
|
|
|
10
12
|
onClick?: (id: string) => void;
|
|
11
13
|
onFocusItem?: (id: string) => void;
|
|
12
14
|
multiLevel?: boolean;
|
|
15
|
+
/** Leading 16×16 icon rendered before the item content. */
|
|
16
|
+
icon?: FC<IIcon>;
|
|
17
|
+
/** Secondary text rendered on a second line below the primary content. */
|
|
18
|
+
metaData?: string;
|
|
13
19
|
/** When true, renders a 1px separator line below this item. */
|
|
14
20
|
divider?: boolean;
|
|
15
21
|
title?: string;
|
|
@@ -20,4 +26,4 @@ export interface ISelectListItem extends IZenIdComponentProps {
|
|
|
20
26
|
*/
|
|
21
27
|
destructive?: boolean;
|
|
22
28
|
}
|
|
23
|
-
export declare const SelectListItem: ({ id, disabled, state, showCheckbox, focused, onChange, onClick, onFocusItem, multiLevel, divider, title, destructive, className, children }: ISelectListItem) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const SelectListItem: ({ id, disabled, state, showCheckbox, focused, onChange, onClick, onFocusItem, multiLevel, divider, title, destructive, className, children, icon, metaData }: ISelectListItem) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { CheckboxState } from "../checkbox/checkboxState";
|
|
3
4
|
import { CheckboxNonInteractive } from "../checkboxNonInteractive/checkboxNonInteractive";
|
|
4
5
|
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
@@ -23,6 +24,16 @@ const getTabIndex = (showCheckbox, focused, disabled) => {
|
|
|
23
24
|
return -1;
|
|
24
25
|
return focused ? 0 : -1;
|
|
25
26
|
};
|
|
27
|
+
const ItemInnerContent = ({ icon, showCheckbox, children, metaData, multiLevel, isRich, state, disabled, chevronIcon }) => {
|
|
28
|
+
const control = showCheckbox ? (_jsx(CheckboxNonInteractive, { className: "zen-select-item__control-view", checked: state === CheckboxState.On, indeterminate: state === CheckboxState.Indeterminate, disabled: disabled, children: children })) : (children);
|
|
29
|
+
const chevron = multiLevel && !showCheckbox ? React.createElement(chevronIcon, { size: "large" }) : null;
|
|
30
|
+
if (!isRich) {
|
|
31
|
+
// Plain items keep the original markup so existing consumers (inline multi-node children,
|
|
32
|
+
// highlighted text, ellipsis on the wrapper) render exactly as before.
|
|
33
|
+
return (_jsxs(_Fragment, { children: [control, chevron] }));
|
|
34
|
+
}
|
|
35
|
+
return (_jsxs(_Fragment, { children: [icon && React.createElement(icon, { className: "zen-dropdown-list__item-icon", size: "large" }), _jsxs("div", { className: "zen-select-item__text-col", children: [_jsx("div", { className: "zen-select-item__label zen-ellipsis", children: control }), metaData && _jsx("span", { className: "zen-dropdown-list__item-meta", children: metaData })] }), chevron] }));
|
|
36
|
+
};
|
|
26
37
|
const getItemClassName = (showCheckbox, focused, destructive, driveClassName, className, divider) => classNames([
|
|
27
38
|
"zen-select-item",
|
|
28
39
|
showCheckbox ? "zen-select-item--with-checkbox" : "",
|
|
@@ -32,9 +43,17 @@ const getItemClassName = (showCheckbox, focused, destructive, driveClassName, cl
|
|
|
32
43
|
className,
|
|
33
44
|
divider ? "zen-select-item--divider" : ""
|
|
34
45
|
]);
|
|
35
|
-
|
|
46
|
+
const getWrapperClassName = (multiLevel, isRich) => classNames([
|
|
47
|
+
"zen-select-list__item-content",
|
|
48
|
+
"zen-select-item__wrapper",
|
|
49
|
+
"zen-ellipsis",
|
|
50
|
+
multiLevel ? "zen-select-item__wrapper--with-arrow" : "",
|
|
51
|
+
isRich ? "zen-select-item__wrapper--rich" : ""
|
|
52
|
+
]);
|
|
53
|
+
export const SelectListItem = ({ id, disabled = false, state = CheckboxState.Off, showCheckbox = false, focused = false, onChange, onClick, onFocusItem, multiLevel, divider, title, destructive, className = "", children, icon, metaData }) => {
|
|
36
54
|
const driveClassName = useDriveClassName("zen-select-item");
|
|
37
55
|
const ChevronIcon = useDirectionalIcon(IconChevronRight, IconChevronLeft);
|
|
56
|
+
const isRich = !!icon || !!metaData;
|
|
38
57
|
const onClickFunc = () => {
|
|
39
58
|
if (disabled) {
|
|
40
59
|
return;
|
|
@@ -45,10 +64,5 @@ export const SelectListItem = ({ id, disabled = false, state = CheckboxState.Off
|
|
|
45
64
|
}
|
|
46
65
|
onChange && onChange(id, newState);
|
|
47
66
|
};
|
|
48
|
-
return (_jsx("li", { "data-id": id, className: getItemClassName(showCheckbox, focused, destructive, driveClassName, className, divider), role: showCheckbox ? "menuitemcheckbox" : "option", "aria-selected": showCheckbox ? undefined : state === CheckboxState.On, "aria-checked": getAriaChecked(showCheckbox, state), "aria-disabled": disabled, tabIndex: getTabIndex(showCheckbox, focused, disabled), onFocus: !showCheckbox && !disabled && onFocusItem ? () => onFocusItem(id) : undefined, onClick: onClickFunc, id: id, children:
|
|
49
|
-
"zen-select-list__item-content",
|
|
50
|
-
"zen-select-item__wrapper",
|
|
51
|
-
"zen-ellipsis",
|
|
52
|
-
multiLevel ? "zen-select-item__wrapper--with-arrow" : ""
|
|
53
|
-
]), title: title || undefined, children: [showCheckbox ? (_jsx(CheckboxNonInteractive, { className: "zen-select-item__control-view", checked: state === CheckboxState.On, indeterminate: state === CheckboxState.Indeterminate, disabled: disabled, children: children })) : (children), multiLevel && !showCheckbox ? _jsx(ChevronIcon, { size: "large" }) : null] }) }));
|
|
67
|
+
return (_jsx("li", { "data-id": id, className: getItemClassName(showCheckbox, focused, destructive, driveClassName, className, divider), role: showCheckbox ? "menuitemcheckbox" : "option", "aria-selected": showCheckbox ? undefined : state === CheckboxState.On, "aria-checked": getAriaChecked(showCheckbox, state), "aria-disabled": disabled, tabIndex: getTabIndex(showCheckbox, focused, disabled), onFocus: !showCheckbox && !disabled && onFocusItem ? () => onFocusItem(id) : undefined, onClick: onClickFunc, id: id, children: _jsx("div", { className: getWrapperClassName(multiLevel, isRich), title: title || undefined, children: _jsx(ItemInnerContent, { icon: icon, showCheckbox: showCheckbox, metaData: metaData, multiLevel: multiLevel, isRich: isRich, state: state, disabled: disabled, chevronIcon: ChevronIcon, children: children }) }) }));
|
|
54
68
|
};
|
|
@@ -356,5 +356,6 @@
|
|
|
356
356
|
"Largest:": ":الأكبر",
|
|
357
357
|
"Smallest:": ":الأصغر",
|
|
358
358
|
"Rest: {COUNT} other slices account for {PCT}%.": "المتبقي: {COUNT} شريحة أخرى تمثّل {PCT}٪.",
|
|
359
|
-
"Details, {COUNT} items:": "التفاصيل، {COUNT} عناصر:"
|
|
359
|
+
"Details, {COUNT} items:": "التفاصيل، {COUNT} عناصر:",
|
|
360
|
+
"This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.": "يحتوي هذا العنصر على إجراءات إضافية. اضغط على مفتاح السهم الأيمن للتوسيع. اضغط على مفتاح السهم الأيسر للرجوع."
|
|
360
361
|
}
|
|
@@ -355,5 +355,6 @@
|
|
|
355
355
|
"Largest:": "Най-голям:",
|
|
356
356
|
"Smallest:": "Най-малък:",
|
|
357
357
|
"Rest: {COUNT} other slices account for {PCT}%.": "Останалите: {COUNT} сегмента представляват {PCT}%.",
|
|
358
|
-
"Details, {COUNT} items:": "Подробности, {COUNT} елемента:"
|
|
358
|
+
"Details, {COUNT} items:": "Подробности, {COUNT} елемента:",
|
|
359
|
+
"This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.": "Този елемент има допълнителни действия. Натиснете клавиша със стрелка надясно, за да разгънете. Натиснете клавиша със стрелка наляво, за да се върнете назад."
|
|
359
360
|
}
|
|
@@ -347,5 +347,6 @@
|
|
|
347
347
|
"Customize view": "Přizpůsobit zobrazení",
|
|
348
348
|
"Select menu": "Vybrat nabídku",
|
|
349
349
|
"Increase value": "Zvýšit hodnotu",
|
|
350
|
-
"Decrease value": "Snížit hodnotu"
|
|
350
|
+
"Decrease value": "Snížit hodnotu",
|
|
351
|
+
"This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.": "Tento položka má další akce. Stiskněte pravý šipku, abyste rozšířili. Stiskněte šipku doleva, abyste se vrátili zpět."
|
|
351
352
|
}
|
|
@@ -355,5 +355,6 @@
|
|
|
355
355
|
"Largest:": "Størst:",
|
|
356
356
|
"Smallest:": "Mindst:",
|
|
357
357
|
"Rest: {COUNT} other slices account for {PCT}%.": "Resten: {COUNT} andre udsnit udgør {PCT}%.",
|
|
358
|
-
"Details, {COUNT} items:": "Detaljer, {COUNT} elementer:"
|
|
358
|
+
"Details, {COUNT} items:": "Detaljer, {COUNT} elementer:",
|
|
359
|
+
"This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.": "Dette element har yderligere handlinger. Tryk på højre piletast for at udvide. Tryk på venstre piletast for at gå tilbage."
|
|
359
360
|
}
|
|
@@ -347,5 +347,6 @@
|
|
|
347
347
|
"Customize view": "Ansicht anpassen",
|
|
348
348
|
"Select menu": "Menü auswählen",
|
|
349
349
|
"Increase value": "Wert erhöhen",
|
|
350
|
-
"Decrease value": "Wert verringern"
|
|
350
|
+
"Decrease value": "Wert verringern",
|
|
351
|
+
"This item has additional actions. Press the right arrow key to expand. Press the left arrow key to go back.": "Dieses Element enthält zusätzliche Aktionen. Drücken Sie die rechte Pfeiltaste, um zu erweitern. Drücken Sie die linke Pfeiltaste, um zurückzugehen."
|
|
351
352
|
}
|