ish-ui 1.0.19 → 1.0.21

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 (215) hide show
  1. package/dist/actions/FieldProcessing.d.ts +10 -0
  2. package/dist/actions/FieldProcessing.js +17 -0
  3. package/dist/actions/index.d.ts +1 -0
  4. package/dist/actions/index.js +8 -0
  5. package/dist/appBar/AppBarHelpMenu.d.ts +3 -0
  6. package/dist/appBar/AppBarHelpMenu.js +77 -0
  7. package/dist/appBar/index.d.ts +2 -0
  8. package/dist/appBar/index.js +9 -0
  9. package/dist/buttons/AddButton.d.ts +14 -0
  10. package/dist/buttons/AddButton.js +9 -0
  11. package/dist/buttons/TimetableButton.d.ts +3 -0
  12. package/dist/buttons/TimetableButton.js +12 -0
  13. package/dist/buttons/index.d.ts +4 -0
  14. package/dist/buttons/index.js +11 -0
  15. package/dist/colorPicker/ColorPicker.d.ts +4 -0
  16. package/dist/colorPicker/ColorPicker.js +138 -0
  17. package/dist/colorPicker/index.d.ts +2 -0
  18. package/dist/colorPicker/index.js +9 -0
  19. package/dist/dialog/BrowserWarning.d.ts +3 -0
  20. package/dist/dialog/BrowserWarning.js +16 -0
  21. package/dist/dialog/confirm/ConfirmBase.d.ts +7 -0
  22. package/dist/dialog/confirm/ConfirmBase.js +29 -0
  23. package/dist/dialog/index.d.ts +5 -0
  24. package/dist/dialog/index.js +12 -0
  25. package/dist/dialog/message/Message.d.ts +3 -0
  26. package/dist/dialog/message/Message.js +91 -0
  27. package/dist/documents/DocumentIconsChooser.d.ts +3 -0
  28. package/dist/documents/DocumentIconsChooser.js +51 -0
  29. package/dist/documents/index.d.ts +3 -0
  30. package/dist/documents/index.js +10 -0
  31. package/dist/documents/utils/index.d.ts +7 -0
  32. package/dist/documents/utils/index.js +61 -0
  33. package/dist/dynamicSizeList/DynamicSizeList.d.ts +17 -0
  34. package/dist/dynamicSizeList/DynamicSizeList.js +167 -0
  35. package/dist/dynamicSizeList/index.d.ts +2 -0
  36. package/dist/dynamicSizeList/index.js +9 -0
  37. package/dist/fieldMessage/ErrorMessage.d.ts +8 -0
  38. package/dist/fieldMessage/ErrorMessage.js +14 -0
  39. package/dist/fieldMessage/WarningMessage.d.ts +8 -0
  40. package/dist/fieldMessage/WarningMessage.js +14 -0
  41. package/dist/fieldMessage/index.d.ts +6 -0
  42. package/dist/fieldMessage/index.js +13 -0
  43. package/dist/fieldMessage/styles.d.ts +3 -0
  44. package/dist/fieldMessage/styles.js +18 -0
  45. package/dist/fileUploader/FileUploaderDialog.d.ts +15 -0
  46. package/dist/fileUploader/FileUploaderDialog.js +99 -0
  47. package/dist/fileUploader/index.d.ts +2 -0
  48. package/dist/fileUploader/index.js +9 -0
  49. package/dist/formFields/CheckboxField.d.ts +7 -0
  50. package/dist/formFields/CheckboxField.js +67 -0
  51. package/dist/formFields/CodeEditorField.d.ts +6 -0
  52. package/dist/formFields/CodeEditorField.js +69 -0
  53. package/dist/formFields/ColoredCheckBox.d.ts +3 -0
  54. package/dist/formFields/ColoredCheckBox.js +41 -0
  55. package/dist/formFields/DateTimeField.d.ts +2 -0
  56. package/dist/formFields/DateTimeField.js +27 -0
  57. package/dist/formFields/EditInPlaceDateTimeField.d.ts +10 -0
  58. package/dist/formFields/EditInPlaceDateTimeField.js +188 -0
  59. package/dist/formFields/EditInPlaceDurationField.d.ts +4 -0
  60. package/dist/formFields/EditInPlaceDurationField.js +63 -0
  61. package/dist/formFields/EditInPlaceField.d.ts +10 -0
  62. package/dist/formFields/EditInPlaceField.js +58 -0
  63. package/dist/formFields/EditInPlaceFieldBase.d.ts +28 -0
  64. package/dist/formFields/EditInPlaceFieldBase.js +123 -0
  65. package/dist/formFields/EditInPlaceFileField.d.ts +7 -0
  66. package/dist/formFields/EditInPlaceFileField.js +60 -0
  67. package/dist/formFields/EditInPlaceMoneyField.d.ts +9 -0
  68. package/dist/formFields/EditInPlaceMoneyField.js +37 -0
  69. package/dist/formFields/EditInPlacePhoneField.d.ts +4 -0
  70. package/dist/formFields/EditInPlacePhoneField.js +69 -0
  71. package/dist/formFields/EditInPlaceSearchSelect.d.ts +4 -0
  72. package/dist/formFields/EditInPlaceSearchSelect.js +321 -0
  73. package/dist/formFields/FieldAdornments.d.ts +13 -0
  74. package/dist/formFields/FieldAdornments.js +27 -0
  75. package/dist/formFields/FilePreview.d.ts +17 -0
  76. package/dist/formFields/FilePreview.js +77 -0
  77. package/dist/formFields/FormRadioButtons.d.ts +3 -0
  78. package/dist/formFields/FormRadioButtons.js +27 -0
  79. package/dist/formFields/SelectCustomComponents.d.ts +5 -0
  80. package/dist/formFields/SelectCustomComponents.js +182 -0
  81. package/dist/formFields/Switch.d.ts +7 -0
  82. package/dist/formFields/Switch.js +116 -0
  83. package/dist/formFields/TextField.d.ts +6 -0
  84. package/dist/formFields/TextField.js +42 -0
  85. package/dist/formFields/UneditableBase.d.ts +17 -0
  86. package/dist/formFields/UneditableBase.js +48 -0
  87. package/dist/formFields/index.d.ts +31 -0
  88. package/dist/formFields/index.js +38 -0
  89. package/dist/index.d.ts +18 -0
  90. package/dist/index.js +25 -0
  91. package/dist/layout/InfoPill.d.ts +7 -0
  92. package/dist/layout/InfoPill.js +26 -0
  93. package/dist/layout/index.d.ts +4 -0
  94. package/dist/layout/index.js +11 -0
  95. package/dist/layout/resizable/ResizableWrapper.d.ts +14 -0
  96. package/dist/layout/resizable/ResizableWrapper.js +42 -0
  97. package/dist/markdownEditor/HtmlEditor.d.ts +15 -0
  98. package/dist/markdownEditor/HtmlEditor.js +18 -0
  99. package/dist/markdownEditor/WysiwygEditor.d.ts +8 -0
  100. package/dist/markdownEditor/WysiwygEditor.js +98 -0
  101. package/dist/markdownEditor/index.d.ts +5 -0
  102. package/dist/markdownEditor/index.js +12 -0
  103. package/dist/markdownEditor/utils/index.d.ts +9 -0
  104. package/dist/markdownEditor/utils/index.js +38 -0
  105. package/dist/model/AppBar.d.ts +11 -0
  106. package/dist/model/AppBar.js +8 -0
  107. package/dist/model/CommomObjects.d.ts +5 -0
  108. package/dist/model/CommomObjects.js +1 -0
  109. package/dist/model/CommonFunctions.d.ts +8 -0
  110. package/dist/model/CommonFunctions.js +5 -0
  111. package/dist/model/Confirm.d.ts +16 -0
  112. package/dist/model/Confirm.js +8 -0
  113. package/dist/model/Fields.d.ts +258 -0
  114. package/dist/model/Fields.js +8 -0
  115. package/dist/model/NestedEntity.d.ts +9 -0
  116. package/dist/model/NestedEntity.js +5 -0
  117. package/dist/model/Theme.d.ts +34 -0
  118. package/dist/model/Theme.js +18 -0
  119. package/dist/model/index.d.ts +7 -0
  120. package/dist/model/index.js +14 -0
  121. package/dist/styles/GlobalStylesProvider.d.ts +3 -0
  122. package/dist/styles/GlobalStylesProvider.js +417 -0
  123. package/dist/styles/StylesProviderCustom.d.ts +3 -0
  124. package/dist/styles/StylesProviderCustom.js +6 -0
  125. package/dist/styles/animateStyles.d.ts +3 -0
  126. package/dist/styles/animateStyles.js +33 -0
  127. package/dist/styles/bootstrap.d.ts +491 -0
  128. package/dist/styles/bootstrap.js +496 -0
  129. package/dist/styles/hooks.d.ts +6 -0
  130. package/dist/styles/hooks.js +38 -0
  131. package/dist/styles/index.d.ts +11 -0
  132. package/dist/styles/index.js +18 -0
  133. package/dist/styles/makeStyles.d.ts +3 -0
  134. package/dist/styles/makeStyles.js +9 -0
  135. package/dist/styles/mixins/common.d.ts +8 -0
  136. package/dist/styles/mixins/common.js +32 -0
  137. package/dist/styles/mixins/keyframes.d.ts +3 -0
  138. package/dist/styles/mixins/keyframes.js +9 -0
  139. package/dist/styles/mixins/prefixer.d.ts +1 -0
  140. package/dist/styles/mixins/prefixer.js +23 -0
  141. package/dist/tagsInput/AddTagMenu.d.ts +12 -0
  142. package/dist/tagsInput/AddTagMenu.js +36 -0
  143. package/dist/tagsInput/AddTagMenuItem.d.ts +11 -0
  144. package/dist/tagsInput/AddTagMenuItem.js +29 -0
  145. package/dist/tagsInput/TagInputList.d.ts +4 -0
  146. package/dist/tagsInput/TagInputList.js +273 -0
  147. package/dist/tagsInput/index.d.ts +6 -0
  148. package/dist/tagsInput/index.js +6 -0
  149. package/dist/themes/appTheme.d.ts +4 -0
  150. package/dist/themes/appTheme.js +322 -0
  151. package/dist/themes/index.d.ts +2 -0
  152. package/dist/themes/index.js +9 -0
  153. package/dist/themes/ishTheme.d.ts +8 -0
  154. package/dist/themes/ishTheme.js +351 -0
  155. package/dist/timetable/datePeriodFilter/DayPeriodIcons.d.ts +8 -0
  156. package/dist/timetable/datePeriodFilter/DayPeriodIcons.js +27 -0
  157. package/dist/timetable/datePeriodFilter/index.d.ts +1 -0
  158. package/dist/timetable/datePeriodFilter/index.js +8 -0
  159. package/dist/timetable/index.d.ts +2 -0
  160. package/dist/timetable/index.js +9 -0
  161. package/dist/timetable/miniCalendar/CalendarDay.d.ts +15 -0
  162. package/dist/timetable/miniCalendar/CalendarDay.js +64 -0
  163. package/dist/timetable/miniCalendar/CalendarHeader.d.ts +10 -0
  164. package/dist/timetable/miniCalendar/CalendarHeader.js +22 -0
  165. package/dist/timetable/miniCalendar/CalendarWeekPanel.d.ts +8 -0
  166. package/dist/timetable/miniCalendar/CalendarWeekPanel.js +18 -0
  167. package/dist/timetable/miniCalendar/WeekDay.d.ts +10 -0
  168. package/dist/timetable/miniCalendar/WeekDay.js +25 -0
  169. package/dist/timetable/miniCalendar/index.d.ts +8 -0
  170. package/dist/timetable/miniCalendar/index.js +15 -0
  171. package/dist/utils/DOM/Links.d.ts +1 -0
  172. package/dist/utils/DOM/Links.js +12 -0
  173. package/dist/utils/DOM/getCaretCoordinates.d.ts +6 -0
  174. package/dist/utils/DOM/getCaretCoordinates.js +109 -0
  175. package/dist/utils/DOM/getOS.d.ts +2 -0
  176. package/dist/utils/DOM/getOS.js +32 -0
  177. package/dist/utils/DOM/index.d.ts +5 -0
  178. package/dist/utils/DOM/index.js +32 -0
  179. package/dist/utils/dates/datesNormalizing.d.ts +1 -0
  180. package/dist/utils/dates/datesNormalizing.js +3 -0
  181. package/dist/utils/dates/format.d.ts +24 -0
  182. package/dist/utils/dates/format.js +28 -0
  183. package/dist/utils/dates/formatRelative.d.ts +1 -0
  184. package/dist/utils/dates/formatRelative.js +14 -0
  185. package/dist/utils/dates/formatString.d.ts +2 -0
  186. package/dist/utils/dates/formatString.js +195 -0
  187. package/dist/utils/dates/formatTimezone.d.ts +2 -0
  188. package/dist/utils/dates/formatTimezone.js +35 -0
  189. package/dist/utils/dates/index.d.ts +6 -0
  190. package/dist/utils/dates/index.js +13 -0
  191. package/dist/utils/dates/timetable.d.ts +5 -0
  192. package/dist/utils/dates/timetable.js +38 -0
  193. package/dist/utils/events/index.d.ts +2 -0
  194. package/dist/utils/events/index.js +6 -0
  195. package/dist/utils/fields/index.d.ts +1 -0
  196. package/dist/utils/fields/index.js +20 -0
  197. package/dist/utils/formatting/PhoneMasks.d.ts +304 -0
  198. package/dist/utils/formatting/PhoneMasks.js +318 -0
  199. package/dist/utils/formatting/index.d.ts +2 -0
  200. package/dist/utils/formatting/index.js +10 -0
  201. package/dist/utils/hooks/index.d.ts +1 -0
  202. package/dist/utils/hooks/index.js +15 -0
  203. package/dist/utils/index.d.ts +9 -0
  204. package/dist/utils/index.js +16 -0
  205. package/dist/utils/numbers/decimalCalculation.d.ts +4 -0
  206. package/dist/utils/numbers/decimalCalculation.js +21 -0
  207. package/dist/utils/numbers/index.d.ts +2 -0
  208. package/dist/utils/numbers/index.js +9 -0
  209. package/dist/utils/numbers/numbersNormalizing.d.ts +10 -0
  210. package/dist/utils/numbers/numbersNormalizing.js +44 -0
  211. package/dist/utils/stubs/index.d.ts +3 -0
  212. package/dist/utils/stubs/index.js +10 -0
  213. package/dist/utils/tags/index.d.ts +3 -0
  214. package/dist/utils/tags/index.js +42 -0
  215. package/package.json +1 -1
@@ -0,0 +1,318 @@
1
+ /*
2
+ * Copyright ish group pty ltd 2023.
3
+ *
4
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
5
+ *
6
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
+ */
8
+ export const phoneMasks = {
9
+ 'AC': '+247-####',
10
+ 'AD': '+376-###-###',
11
+ 'AE': '+971-5#-###-####',
12
+ 'AE1': '+971-#-###-####',
13
+ 'AF': '+93-##-###-####',
14
+ 'AG': '+1 (268) ###-####',
15
+ 'AI': '+1 (264) ###-####',
16
+ 'AL': '+355 (###) ###-###',
17
+ 'AM': '+374-##-###-###',
18
+ 'AN': '+599-###-####',
19
+ 'AN1': '+599-###-####',
20
+ 'AN2': '+599-9###-####',
21
+ 'AO': '+244 (###) ###-###',
22
+ 'AQ': '+672-1##-###',
23
+ 'AR': '+54 (###) ###-####',
24
+ 'AS': '+1 (684) ###-####',
25
+ 'AT': '+43 (###) ###-####',
26
+ 'AU': '+61 4## ### ###',
27
+ 'AU1': '+61 # #### ####',
28
+ 'AU2': '(02) #### ####',
29
+ 'AU3': '(03) #### ####',
30
+ 'AU4': '04## ### ###',
31
+ 'AU5': '(07) #### ####',
32
+ 'AU6': '(08) #### ####',
33
+ 'AW': '+297-###-####',
34
+ 'AZ': '+994-##-###-##-##',
35
+ 'BA': '+387-##-#####',
36
+ 'BA1': '+387-##-####',
37
+ 'BB': '+1 (246) ###-####',
38
+ 'BD': '+880-##-###-###',
39
+ 'BE': '+32 (###) ###-###',
40
+ 'BF': '+226-##-##-####',
41
+ 'BG': '+359 (###) ###-###',
42
+ 'BH': '+973-####-####',
43
+ 'BI': '+257-##-##-####',
44
+ 'BJ': '+229-##-##-####',
45
+ 'BM': '+1 (441) ###-####',
46
+ 'BN': '+673-###-####',
47
+ 'BO': '+591-#-###-####',
48
+ 'BR': '+55 (##) ####-####',
49
+ 'BR1': '+55 (##) 7###-####',
50
+ 'BR2': '+55 (##) 9####-####',
51
+ 'BS': '+1 (242) ###-####',
52
+ 'BT': '+975-17-###-###',
53
+ 'BT1': '+975-#-###-###',
54
+ 'BW': '+267-##-###-###',
55
+ 'BY': '+375 (##) ###-##-##',
56
+ 'BZ': '+501-###-####',
57
+ 'CA': '+1 (###) ###-####',
58
+ 'CD': '+243 (###) ###-###',
59
+ 'CF': '+236-##-##-####',
60
+ 'CG': '+242-##-###-####',
61
+ 'CH': '+41-##-###-####',
62
+ 'CI': '+225-##-###-###',
63
+ 'CK': '+682-##-###',
64
+ 'CL': '+56-#-####-####',
65
+ 'CM': '+237-####-####',
66
+ 'CN': '+86 (###) ####-####',
67
+ 'CN1': '+86 (###) ####-###',
68
+ 'CN2': '+86-##-#####-#####',
69
+ 'CO': '+57 (###) ###-####',
70
+ 'CR': '+506-####-####',
71
+ 'CU': '+53-#-###-####',
72
+ 'CV': '+238 (###) ##-##',
73
+ 'CW': '+599-###-####',
74
+ 'CY': '+357-##-###-###',
75
+ 'CZ': '+420 (###) ###-###',
76
+ 'DE': '+49 (####) ###-####',
77
+ 'DE1': '+49 (###) ###-####',
78
+ 'DE2': '+49 (###) ##-####',
79
+ 'DE3': '+49 (###) ##-###',
80
+ 'DE4': '+49 (###) ##-##',
81
+ 'DE5': '+49-###-###',
82
+ 'DJ': '+253-##-##-##-##',
83
+ 'DK': '+45-##-##-##-##',
84
+ 'DM': '+1 (767) ###-####',
85
+ 'DO': '+1 (809) ###-####',
86
+ 'DO1': '+1 (829) ###-####',
87
+ 'DO2': '+1 (849) ###-####',
88
+ 'DZ': '+213-##-###-####',
89
+ 'EC': '+593-##-###-####',
90
+ 'EC1': '+593-#-###-####',
91
+ 'EE': '+372-####-####',
92
+ 'EE1': '+372-###-####',
93
+ 'EG': '+20 (###) ###-####',
94
+ 'ER': '+291-#-###-###',
95
+ 'ES': '+34 (###) ###-###',
96
+ 'ET': '+251-##-###-####',
97
+ 'FI': '+358 (###) ###-##-##',
98
+ 'FJ': '+679-##-#####',
99
+ 'FK': '+500-#####',
100
+ 'FM': '+691-###-####',
101
+ 'FO': '+298-###-###',
102
+ 'FR': '+262-#####-####',
103
+ 'FR1': '+33 (###) ###-###',
104
+ 'FR2': '+508-##-####',
105
+ 'FR3': '+590 (###) ###-###',
106
+ 'GA': '+241-#-##-##-##',
107
+ 'GD': '+1 (473) ###-####',
108
+ 'GE': '+995 (###) ###-###',
109
+ 'GF': '+594-#####-####',
110
+ 'GH': '+233 (###) ###-###',
111
+ 'GI': '+350-###-#####',
112
+ 'GL': '+299-##-##-##',
113
+ 'GM': '+220 (###) ##-##',
114
+ 'GN': '+224-##-###-###',
115
+ 'GQ': '+240-##-###-####',
116
+ 'GR': '+30 (###) ###-####',
117
+ 'GT': '+502-#-###-####',
118
+ 'GU': '+1 (671) ###-####',
119
+ 'GW': '+245-#-######',
120
+ 'GY': '+592-###-####',
121
+ 'HK': '+852-####-####',
122
+ 'HN': '+504-####-####',
123
+ 'HR': '+385-##-###-###',
124
+ 'HT': '+509-##-##-####',
125
+ 'HU': '+36 (###) ###-###',
126
+ 'ID': '+62 (8##) ###-####',
127
+ 'ID1': '+62-##-###-##',
128
+ 'ID2': '+62-##-###-###',
129
+ 'ID3': '+62-##-###-####',
130
+ 'ID4': '+62 (8##) ###-###',
131
+ 'ID5': '+62 (8##) ###-##-###',
132
+ 'IE': '+353 (###) ###-###',
133
+ 'IL': '+972-5#-###-####',
134
+ 'IL1': '+972-#-###-####',
135
+ 'IN': '+91 (####) ###-###',
136
+ 'IO': '+246-###-####',
137
+ 'IQ': '+964 (###) ###-####',
138
+ 'IR': '+98 (###) ###-####',
139
+ 'IS': '+354-###-####',
140
+ 'IT': '+39 (###) ####-###',
141
+ 'JM': '+1 (876) ###-####',
142
+ 'JO': '+962-#-####-####',
143
+ 'JP': '+81-##-####-####',
144
+ 'JP1': '+81 (###) ###-###',
145
+ 'KE': '+254-###-######',
146
+ 'KG': '+996 (###) ###-###',
147
+ 'KH': '+855-##-###-###',
148
+ 'KI': '+686-##-###',
149
+ 'KM': '+269-##-#####',
150
+ 'KN': '+1 (869) ###-####',
151
+ 'KP': '+850-191-###-####',
152
+ 'KP1': '+850-##-###-###',
153
+ 'KP2': '+850-###-####-###',
154
+ 'KP3': '+850-###-###',
155
+ 'KP4': '+850-####-####',
156
+ 'KP5': '+850-####-#############',
157
+ 'KR': '+82-##-###-####',
158
+ 'KW': '+965-####-####',
159
+ 'KY': '+1 (345) ###-####',
160
+ 'KZ': '+7 (6##) ###-##-##',
161
+ 'KZ1': '+7 (7##) ###-##-##',
162
+ 'LA': '+856 (20##) ###-###',
163
+ 'LA1': '+856-##-###-###',
164
+ 'LB': '+961-##-###-###',
165
+ 'LB1': '+961-#-###-###',
166
+ 'LC': '+1 (758) ###-####',
167
+ 'LI': '+423 (###) ###-####',
168
+ 'LK': '+94-##-###-####',
169
+ 'LR': '+231-##-###-###',
170
+ 'LS': '+266-#-###-####',
171
+ 'LT': '+370 (###) ##-###',
172
+ 'LU': '+352 (###) ###-###',
173
+ 'LV': '+371-##-###-###',
174
+ 'LY': '+218-##-###-###',
175
+ 'LY1': '+218-21-###-####',
176
+ 'MA': '+212-##-####-###',
177
+ 'MC': '+377 (###) ###-###',
178
+ 'MC1': '+377-##-###-###',
179
+ 'MD': '+373-####-####',
180
+ 'ME': '+382-##-###-###',
181
+ 'MG': '+261-##-##-#####',
182
+ 'MH': '+692-###-####',
183
+ 'MK': '+389-##-###-###',
184
+ 'ML': '+223-##-##-####',
185
+ 'MM': '+95-##-###-###',
186
+ 'MM1': '+95-#-###-###',
187
+ 'MN': '+976-##-##-####',
188
+ 'MO': '+853-####-####',
189
+ 'MP': '+1 (670) ###-####',
190
+ 'MQ': '+596 (###) ##-##-##',
191
+ 'MR': '+222-##-##-####',
192
+ 'MS': '+1 (664) ###-####',
193
+ 'MT': '+356-####-####',
194
+ 'MU': '+230-###-####',
195
+ 'MV': '+960-###-####',
196
+ 'MW': '+265-1-###-###',
197
+ 'MW1': '+265-#-####-####',
198
+ 'MX': '+52 (###) ###-####',
199
+ 'MX1': '+52-##-##-####',
200
+ 'MY': '+60-##-###-####',
201
+ 'MY1': '+60 (###) ###-###',
202
+ 'MY2': '+60-##-###-###',
203
+ 'MY3': '+60-#-###-###',
204
+ 'MZ': '+258-##-###-###',
205
+ 'NA': '+264-##-###-####',
206
+ 'NC': '+687-##-####',
207
+ 'NE': '+227-##-##-####',
208
+ 'NF': '+672-3##-###',
209
+ 'NG': '+234 (###) ###-####',
210
+ 'NG1': '+234-##-###-###',
211
+ 'NG2': '+234-##-###-##',
212
+ 'NG3': '+234 (###) ###-####',
213
+ 'NI': '+505-####-####',
214
+ 'NL': '+31-##-###-####',
215
+ 'NO': '+47 (###) ##-###',
216
+ 'NP': '+977-##-###-###',
217
+ 'NR': '+674-###-####',
218
+ 'NU': '+683-####',
219
+ 'NZ': '+64 (###) ###-###',
220
+ 'NZ1': '+64-##-###-###',
221
+ 'NZ2': '+64 (###) ###-####',
222
+ 'OM': '+968-##-###-###',
223
+ 'PA': '+507-###-####',
224
+ 'PE': '+51 (###) ###-###',
225
+ 'PF': '+689-##-##-##',
226
+ 'PG': '+675 (###) ##-###',
227
+ 'PH': '+63 (###) ###-####',
228
+ 'PK': '+92 (###) ###-####',
229
+ 'PL': '+48 (###) ###-###',
230
+ 'PS': '+970-##-###-####',
231
+ 'PT': '+351-##-###-####',
232
+ 'PW': '+680-###-####',
233
+ 'PY': '+595 (###) ###-###',
234
+ 'QA': '+974-####-####',
235
+ 'RE': '+262-#####-####',
236
+ 'RO': '+40-##-###-####',
237
+ 'RS': '+381-##-###-####',
238
+ 'RU': '+7 (###) ###-##-##',
239
+ 'RW': '+250 (###) ###-###',
240
+ 'SA': '+966-5-####-####',
241
+ 'SA1': '+966-#-###-####',
242
+ 'SB': '+677-###-####',
243
+ 'SB1': '+677-#####',
244
+ 'SC': '+248-#-###-###',
245
+ 'SD': '+249-##-###-####',
246
+ 'SE': '+46-##-###-####',
247
+ 'SG': '+65-####-####',
248
+ 'SH': '+290-####',
249
+ 'SH1': '+290-####',
250
+ 'SI': '+386-##-###-###',
251
+ 'SK': '+421 (###) ###-###',
252
+ 'SL': '+232-##-######',
253
+ 'SM': '+378-####-######',
254
+ 'SN': '+221-##-###-####',
255
+ 'SO': '+252-##-###-###',
256
+ 'SO1': '+252-#-###-###',
257
+ 'SO2': '+252-#-###-###',
258
+ 'SR': '+597-###-####',
259
+ 'SR1': '+597-###-###',
260
+ 'SS': '+211-##-###-####',
261
+ 'ST': '+239-##-#####',
262
+ 'SV': '+503-##-##-####',
263
+ 'SX': '+1 (721) ###-####',
264
+ 'SY': '+963-##-####-###',
265
+ 'SZ': '+268-##-##-####',
266
+ 'TC': '+1 (649) ###-####',
267
+ 'TD': '+235-##-##-##-##',
268
+ 'TG': '+228-##-###-###',
269
+ 'TH': '+66-##-###-####',
270
+ 'TH1': '+66-##-###-###',
271
+ 'TJ': '+992-##-###-####',
272
+ 'TK': '+690-####',
273
+ 'TL': '+670-###-####',
274
+ 'TL1': '+670-77#-#####',
275
+ 'TL2': '+670-78#-#####',
276
+ 'TM': '+993-#-###-####',
277
+ 'TN': '+216-##-###-###',
278
+ 'TO': '+676-#####',
279
+ 'TR': '+90 (###) ###-####',
280
+ 'TT': '+1 (868) ###-####',
281
+ 'TV': '+688-90####',
282
+ 'TV1': '+688-2####',
283
+ 'TW': '+886-#-####-####',
284
+ 'TW1': '+886-####-####',
285
+ 'TZ': '+255-##-###-####',
286
+ 'UA': '+380 (##) ###-##-##',
287
+ 'UG': '+256 (###) ###-###',
288
+ 'UK': '+44-##-####-####',
289
+ 'US': '+1 (###) ###-####',
290
+ 'UY': '+598-#-###-##-##',
291
+ 'UZ': '+998-##-###-####',
292
+ 'VA': '+39-6-698-#####',
293
+ 'VC': '+1 (784) ###-####',
294
+ 'VE': '+58 (###) ###-####',
295
+ 'VG': '+1 (284) ###-####',
296
+ 'VI': '+1 (340) ###-####',
297
+ 'VN': '+84-##-####-###',
298
+ 'VN1': '+84 (###) ####-###',
299
+ 'VU': '+678-##-#####',
300
+ 'VU1': '+678-#####',
301
+ 'WF': '+681-##-####',
302
+ 'WS': '+685-##-####',
303
+ 'YE': '+967-###-###-###',
304
+ 'YE1': '+967-#-###-###',
305
+ 'YE2': '+967-##-###-###',
306
+ 'ZA': '+27-##-###-####',
307
+ 'ZM': '+260-##-###-####',
308
+ 'ZW': '+263-#-######',
309
+ 'DEFAULT': '#### #### ###########'
310
+ };
311
+ export const getPhoneMask = (value) => {
312
+ const maskKey = Object.keys(phoneMasks).find(key => {
313
+ var _a, _b;
314
+ const mask = phoneMasks[key];
315
+ return value.startsWith((_a = mask === null || mask === void 0 ? void 0 : mask.match(/\d/g)) === null || _a === void 0 ? void 0 : _a.join('')) && value.length === ((_b = mask === null || mask === void 0 ? void 0 : mask.match(/\d|#/g)) === null || _b === void 0 ? void 0 : _b.length);
316
+ });
317
+ return phoneMasks[maskKey] ? phoneMasks[maskKey].replace(/\d/g, '#') : value.length === 8 ? phoneMasks['DEFAULT'] : null;
318
+ };
@@ -0,0 +1,2 @@
1
+ export declare const getHighlightedPartLabel: (label: string, highlighted: string, options?: any) => any;
2
+ export * from './PhoneMasks';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import parse from 'autosuggest-highlight/parse';
3
+ import match from 'autosuggest-highlight/match';
4
+ export const getHighlightedPartLabel = (label, highlighted, options) => {
5
+ const matches = match(label, highlighted, { insideWords: true });
6
+ const parts = parse(label, matches);
7
+ const result = parts.map((part, index) => (React.createElement("span", { key: index }, part.highlight ? React.createElement("strong", null, part.text) : part.text)));
8
+ return options ? (React.createElement("div", Object.assign({}, options || {}), result)) : result;
9
+ };
10
+ export * from './PhoneMasks';
@@ -0,0 +1 @@
1
+ export declare const usePrevious: <T = any>(value: any, initial?: any) => T;
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Copyright ish group pty ltd 2023.
3
+ *
4
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
5
+ *
6
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
+ */
8
+ import { useEffect, useRef } from 'react';
9
+ export const usePrevious = (value, initial) => {
10
+ const ref = useRef(initial);
11
+ useEffect(() => {
12
+ ref.current = value;
13
+ }, [value]);
14
+ return ref.current;
15
+ };
@@ -0,0 +1,9 @@
1
+ export * from './tags';
2
+ export * from './formatting';
3
+ export * from './stubs';
4
+ export * from './DOM';
5
+ export * from './numbers';
6
+ export * from './dates';
7
+ export * from './fields';
8
+ export * from './hooks';
9
+ export * from './events';
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Copyright ish group pty ltd 2023.
3
+ *
4
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
5
+ *
6
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
+ */
8
+ export * from './tags';
9
+ export * from './formatting';
10
+ export * from './stubs';
11
+ export * from './DOM';
12
+ export * from './numbers';
13
+ export * from './dates';
14
+ export * from './fields';
15
+ export * from './hooks';
16
+ export * from './events';
@@ -0,0 +1,4 @@
1
+ export declare const decimalMul: (...args: any[]) => number;
2
+ export declare const decimalPlus: (...args: any[]) => number;
3
+ export declare const decimalMinus: (...args: any[]) => number;
4
+ export declare const decimalDivide: (a: number, b: number) => number;
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright ish group pty ltd. All rights reserved. https://www.ish.com.au
3
+ * No copying or use of this code is allowed without permission in writing from ish.
4
+ */
5
+ import { Decimal } from 'decimal.js-light';
6
+ export const decimalMul = (...args) => args
7
+ .reduce((p, c) => p.mul(c || 0), new Decimal(1))
8
+ .toDecimalPlaces(2)
9
+ .toNumber();
10
+ export const decimalPlus = (...args) => args
11
+ .reduce((p, c) => p.plus(c || 0), new Decimal(0))
12
+ .toDecimalPlaces(2)
13
+ .toNumber();
14
+ export const decimalMinus = (...args) => args
15
+ .reduce((p, c) => new Decimal(p).minus(c))
16
+ .toDecimalPlaces(2)
17
+ .toNumber();
18
+ export const decimalDivide = (a, b) => new Decimal(a)
19
+ .div(b)
20
+ .toDecimalPlaces(2)
21
+ .toNumber();
@@ -0,0 +1,2 @@
1
+ export * from './decimalCalculation';
2
+ export * from './numbersNormalizing';
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Copyright ish group pty ltd 2023.
3
+ *
4
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
5
+ *
6
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
+ */
8
+ export * from './decimalCalculation';
9
+ export * from './numbersNormalizing';
@@ -0,0 +1,10 @@
1
+ export declare const normalizeNumber: (v: any) => any;
2
+ export declare const normalizeNumberToZero: (v: any) => number;
3
+ export declare const normalizeNumberToPositive: (v: any) => any;
4
+ export declare const formatCurrency: (v: any, cs: string) => string;
5
+ export declare const idsToString: (items: any[]) => string;
6
+ export declare const formatPercent: (val: any) => string;
7
+ export declare const formatFieldPercent: (val: any) => number;
8
+ export declare const parseFieldPercent: (val: any) => number;
9
+ export declare const preventNegativeOrLogEnter: (ev: any) => void;
10
+ export declare const preventDecimalEnter: (ev: any) => void;
@@ -0,0 +1,44 @@
1
+ import Decimal from 'decimal.js-light';
2
+ const currencyFormatter = new Intl.NumberFormat('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
3
+ export const normalizeNumber = v => (typeof v === 'number' ? v : typeof v === 'string' && v ? parseFloat(v) : v);
4
+ export const normalizeNumberToZero = v => (typeof v === 'number' ? v : typeof v === 'string' && v ? parseFloat(v) : 0);
5
+ export const normalizeNumberToPositive = v => {
6
+ const parsed = normalizeNumber(v);
7
+ return parsed < 0 ? Math.abs(parsed) : parsed;
8
+ };
9
+ export const formatCurrency = (v, cs) => {
10
+ const formatted = currencyFormatter.format(v);
11
+ let value = `${cs}0.00`;
12
+ if (formatted !== 'NaN') {
13
+ const formattedValue = parseFloat(v);
14
+ if (formattedValue < 0)
15
+ value = `-${cs}${currencyFormatter.format(-formattedValue)}`;
16
+ else
17
+ value = `${cs}${currencyFormatter.format(formattedValue)}`;
18
+ }
19
+ return value;
20
+ };
21
+ export const idsToString = (items) => items
22
+ .filter(item => item.id)
23
+ .map(item => item.id)
24
+ .map(id => (Number(id) < 0 ? `'${id}'` : id))
25
+ .toString();
26
+ export const formatPercent = val => {
27
+ const result = Number(val);
28
+ if (isNaN(result)) {
29
+ return '';
30
+ }
31
+ return `${new Decimal(result * 100).toDecimalPlaces(2).toString()}%`;
32
+ };
33
+ export const formatFieldPercent = val => val && Math.round(+val * 10000) / 100;
34
+ export const parseFieldPercent = val => val ? Math.round(+val * 100) / 10000 : 0;
35
+ export const preventNegativeOrLogEnter = ev => {
36
+ if (ev.key === '-' || ev.key === 'e') {
37
+ ev.preventDefault();
38
+ }
39
+ };
40
+ export const preventDecimalEnter = ev => {
41
+ if (ev.key === '.') {
42
+ ev.preventDefault();
43
+ }
44
+ };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const stubFunction: () => any;
3
+ export declare const stubComponent: () => React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ /*
2
+ * Copyright ish group pty ltd 2023.
3
+ *
4
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
5
+ *
6
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
+ */
8
+ import React from 'react';
9
+ export const stubFunction = () => undefined;
10
+ export const stubComponent = () => React.createElement("div", { className: "invisible" });
@@ -0,0 +1,3 @@
1
+ import { MenuTag, TagLike } from '../../model';
2
+ export declare const getAllMenuTags: (tags: MenuTag<TagLike>[], res?: MenuTag<TagLike>[], path?: string) => MenuTag<TagLike>[];
3
+ export declare const getMenuTags: (allTags: TagLike[], addedTags: TagLike[], prefix?: string, queryPrefix?: string, entity?: string, path?: string, parent?: MenuTag<TagLike>) => MenuTag<TagLike>[];
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Copyright ish group pty ltd 2023.
3
+ *
4
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
5
+ *
6
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
+ */
8
+ export const getAllMenuTags = (tags, res, path = '') => {
9
+ const result = res || [];
10
+ for (let i = 0; i < tags.length; i++) {
11
+ const tag = tags[i];
12
+ tag.path = path;
13
+ result.push(tag);
14
+ if (tag.children.length) {
15
+ getAllMenuTags(tags[i].children, result, `${path ? `${path} / ` : ''}${(tag.tagBody && tag.tagBody.name) || ''}`);
16
+ }
17
+ }
18
+ return result;
19
+ };
20
+ export const getMenuTags = (allTags, addedTags, prefix, queryPrefix, entity, path, parent) => allTags.map(t => {
21
+ const active = addedTags.find(i => i.id === t.id);
22
+ const tag = {
23
+ active: Boolean(active),
24
+ tagBody: t,
25
+ parent,
26
+ children: []
27
+ };
28
+ tag.children = t.childTags.length ? getMenuTags(t.childTags, addedTags, prefix, queryPrefix, entity, path, tag) : [];
29
+ if (prefix) {
30
+ tag.prefix = prefix;
31
+ }
32
+ if (queryPrefix) {
33
+ tag.queryPrefix = queryPrefix;
34
+ }
35
+ if (entity) {
36
+ tag.entity = entity;
37
+ }
38
+ if (path) {
39
+ tag.path = path;
40
+ }
41
+ return tag;
42
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ish-ui",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "UI elements for onCourse and other ish apps",
5
5
  "main": "main.ts",
6
6
  "devDependencies": {