@tesouro/embedded-components-react 0.7.59 → 0.7.60
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 +2 -3
- package/dist/index.css +0 -15
- package/dist/lib/monite-sdk.d.ts +2 -163
- package/dist/lib/monite-sdk.js +41 -47
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +45 -52
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index100.js +174 -53
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index101.js +55 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index102.js +2 -153
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index103.js +3 -1224
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index104.js +1 -176
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index105.js +2 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index106.js +8 -15
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index107.js +55 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index108.js +36 -50
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index109.js +73 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index110.js +41 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index111.js +14 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index112.js +13 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index113.js +69 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index114.js +168 -52
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index115.js +6 -41
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index116.js +2 -74
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index117.js +65 -37
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index118.js +1 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index119.js +77 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index120.js +1 -71
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index121.js +33 -170
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index122.js +0 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index123.js +57 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index124.js +39 -64
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index126.js +562 -72
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index128.js +1 -35
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index129.js +159 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index13.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index130.js +0 -57
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index131.js +23 -40
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index133.js +10 -567
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index134.js +12 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index135.js +12 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index136.js +16 -158
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index137.js +21 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index138.js +26 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index140.js +24 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index141.js +17 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index142.js +69 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index143.js +25 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index144.js +6 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index145.js +40 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index146.js +51 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index147.js +58 -22
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index148.js +1 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index149.js +28 -68
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index150.js +40 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index151.js +77 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index152.js +4 -43
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index153.js +2 -51
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index154.js +48 -58
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index155.js +81 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index156.js +111 -29
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index157.js +5 -41
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index158.js +10 -78
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index159.js +12 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index160.js +20 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index161.js +73 -48
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index162.js +1 -81
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index163.js +124 -108
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index164.js +1 -7
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index165.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index166.js +54 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index167.js +5 -20
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index168.js +15 -73
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index170.js +62 -127
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index171.js +122 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index172.js +22 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index173.js +6 -54
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index174.js +31 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index175.js +7 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index176.js +58 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index177.js +73 -62
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index178.js +22 -116
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index179.js +1 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index180.js +59 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index181.js +19 -35
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index182.js +20 -7
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index183.js +181 -53
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index184.js +1 -75
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index185.js +30 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index186.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index187.js +0 -60
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index188.js +35 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index189.js +1 -22
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index190.js +16 -183
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index191.js +20 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index192.js +5 -29
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index193.js +18 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index194.js +24 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index195.js +20 -35
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index196.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index197.js +6 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index198.js +11 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index199.js +17 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index200.js +9 -18
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index201.js +22 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index202.js +11 -20
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index203.js +8 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index204.js +24 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index205.js +13 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index206.js +81 -18
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index207.js +16 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index208.js +98 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index209.js +42 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index210.js +27 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index211.js +1 -27
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index212.js +104 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index213.js +37 -81
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index214.js +171 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index215.js +11 -99
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index216.js +4 -46
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index217.js +67 -27
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index218.js +27 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index219.js +203 -97
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index220.js +87 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index221.js +20 -171
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index222.js +1 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index223.js +19 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index224.js +157 -67
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index225.js +100 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index226.js +43 -209
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index227.js +4 -92
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index228.js +22 -20
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index229.js +77 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index230.js +17 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index231.js +18 -156
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index232.js +5 -101
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index233.js +9 -43
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index234.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index235.js +130 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index236.js +5 -74
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index237.js +5 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index238.js +5 -22
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index239.js +219 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index240.js +31 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index241.js +12 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index242.js +34 -131
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index243.js +19 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index244.js +73 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index245.js +184 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index246.js +14 -220
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index247.js +203 -31
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index248.js +99 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index249.js +64 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index250.js +54 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index251.js +91 -73
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index252.js +33 -174
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index253.js +77 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index254.js +80 -199
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index255.js +12 -100
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index256.js +21 -61
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index257.js +16 -56
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index258.js +5 -94
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index259.js +22 -41
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index260.js +1 -79
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index261.js +22 -87
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index262.js +30 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index263.js +2 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index264.js +23 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index265.js +18 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index266.js +31 -22
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index267.js +31 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index268.js +2 -22
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index29.js +0 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index41.js +23 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index42.js +6 -15
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index43.js +4 -42
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index44.js +2 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index45.js +31 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index46.js +7 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index47.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index48.js +10 -35
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index49.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index50.js +7 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index51.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index52.js +6 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index53.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index54.js +1 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index55.js +21 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index56.js +30 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index57.js +10 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index58.js +72 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index59.js +50 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index60.js +1 -32
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index61.js +19 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index62.js +46 -69
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index63.js +14 -50
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index65.js +45 -18
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index66.js +63 -46
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index67.js +34 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index68.js +38 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index69.js +24 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index70.js +12 -46
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index71.js +12 -35
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index72.js +50 -60
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index73.js +10 -36
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index74.js +23 -39
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index75.js +71 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index76.js +79 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index77.js +1 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index78.js +8 -54
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index79.js +29 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index80.js +2 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index81.js +16 -71
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index82.js +3 -80
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index83.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index84.js +56 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index85.js +10 -27
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index86.js +37 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index87.js +1 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index88.js +104 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index89.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index90.js +53 -55
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index91.js +1 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index92.js +50 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index94.js +49 -100
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index96.js +14 -54
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index97.js +17 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index98.js +150 -52
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index99.js +1224 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index269.js +0 -32
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index270.js +0 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index271.js +0 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index272.js +0 -18
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index273.js +0 -33
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index274.js +0 -31
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index275.js +0 -2
|
@@ -1,79 +1,569 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMoniteContext as e } from "./index36.js";
|
|
2
|
+
import { useCurrencies as t } from "./index62.js";
|
|
3
|
+
import "./index73.js";
|
|
4
|
+
import { useDialog as n } from "./index117.js";
|
|
5
|
+
import { NAMED_VALUES as r, OPERATOR_OPERATIONS as i } from "./index74.js";
|
|
6
|
+
import { useApprovalPolicyTrigger as ee } from "./index75.js";
|
|
7
|
+
import { ConditionsTable as te } from "./index76.js";
|
|
8
|
+
import "./index77.js";
|
|
9
|
+
import { useApprovalPolicyScript as ne } from "./index84.js";
|
|
10
|
+
import { RulesTable as re } from "./index88.js";
|
|
11
|
+
import "./index89.js";
|
|
12
|
+
import { AutocompleteUsers as a } from "./index90.js";
|
|
13
|
+
import "./index91.js";
|
|
14
|
+
import { AutocompleteRoles as ie } from "./index92.js";
|
|
15
|
+
import "./index93.js";
|
|
16
|
+
import { AutocompleteUser as ae } from "./index94.js";
|
|
17
|
+
import "./index95.js";
|
|
18
|
+
import { getCounterpartName as oe } from "./index97.js";
|
|
19
|
+
import { CurrencyEnumSchema as o } from "./index98.js";
|
|
20
|
+
import { MoniteCurrency as se } from "./index109.js";
|
|
21
|
+
import "./index116.js";
|
|
22
|
+
import "./index118.js";
|
|
23
|
+
import { DialogFooter as ce } from "./index119.js";
|
|
24
|
+
import "./index120.js";
|
|
25
|
+
import { DialogHeader as le } from "./index123.js";
|
|
26
|
+
import { RHFTextField as s } from "./index124.js";
|
|
2
27
|
import "./index125.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
28
|
+
import { useEffect as c, useId as ue, useState as l } from "react";
|
|
29
|
+
import { z as u } from "zod";
|
|
30
|
+
import { Fragment as d, jsx as f, jsxs as p } from "@emotion/react/jsx-runtime";
|
|
31
|
+
import { toast as m } from "react-hot-toast";
|
|
32
|
+
import { Box as de, DialogContent as fe, Grid as h, MenuItem as g, Stack as pe, Typography as _ } from "@mui/material";
|
|
33
|
+
import { Trans as me, useLingui as he } from "@lingui/react";
|
|
34
|
+
import { FormProvider as ge, useForm as _e } from "react-hook-form";
|
|
35
|
+
import { zodResolver as ve } from "@hookform/resolvers/zod";
|
|
6
36
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index126.js
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
37
|
+
var ye = (e) => u.object({
|
|
38
|
+
name: u.string().min(1, e._("Policy name is required")),
|
|
39
|
+
description: u.string().optional(),
|
|
40
|
+
object_type: u.string(),
|
|
41
|
+
triggerType: u.union([
|
|
42
|
+
u.literal("was_created_by_user_id"),
|
|
43
|
+
u.literal("counterpart_id"),
|
|
44
|
+
u.literal("amount"),
|
|
45
|
+
u.literal("currency")
|
|
46
|
+
]).nullish(),
|
|
47
|
+
triggers: u.object({
|
|
48
|
+
was_created_by_user_id: u.array(u.any()).optional(),
|
|
49
|
+
counterpart_id: u.array(u.any()).optional(),
|
|
50
|
+
amount: u.object({
|
|
51
|
+
currency: o,
|
|
52
|
+
value: u.array(u.any())
|
|
53
|
+
}).optional()
|
|
54
|
+
}),
|
|
55
|
+
amountOperator: u.union([
|
|
56
|
+
u.literal("range"),
|
|
57
|
+
u.literal("in"),
|
|
58
|
+
u.literal("=="),
|
|
59
|
+
u.literal("<"),
|
|
60
|
+
u.literal("<="),
|
|
61
|
+
u.literal(">"),
|
|
62
|
+
u.literal(">=")
|
|
63
|
+
]).optional(),
|
|
64
|
+
amountValue: u.number().positive(e._("Amount must be a positive number")).optional(),
|
|
65
|
+
amountRangeLeftValue: u.number().positive(e._("Amount must be a positive number")).optional(),
|
|
66
|
+
amountRangeRightValue: u.number().positive(e._("Amount must be a positive number")).optional(),
|
|
67
|
+
amountCurrency: o.optional(),
|
|
68
|
+
scriptType: u.union([
|
|
69
|
+
u.literal("single_user"),
|
|
70
|
+
u.literal("users_from_list"),
|
|
71
|
+
u.literal("roles_from_list"),
|
|
72
|
+
u.literal("approval_chain")
|
|
73
|
+
]).nullish(),
|
|
74
|
+
rules: u.object({
|
|
75
|
+
single_user: u.any().optional(),
|
|
76
|
+
users_from_list: u.array(u.any()).optional(),
|
|
77
|
+
roles_from_list: u.array(u.any()).optional(),
|
|
78
|
+
approval_chain: u.array(u.any()).optional()
|
|
79
|
+
}),
|
|
80
|
+
usersFromListCount: u.number().min(1, e._("Minimum number of approvals required must be at least 1")).optional(),
|
|
81
|
+
rolesFromListCount: u.number().min(1, e._("Minimum number of approvals required must be at least 1")).optional()
|
|
82
|
+
}).superRefine((t, n) => {
|
|
83
|
+
let r = t.rules?.users_from_list;
|
|
84
|
+
r && r.length > 0 && t.usersFromListCount !== void 0 && t.usersFromListCount > r.length && n.addIssue({
|
|
85
|
+
code: u.ZodIssueCode.custom,
|
|
86
|
+
message: e._("Cannot exceed the number of selected users ({selectedUsersLength})", { selectedUsersLength: r.length }),
|
|
87
|
+
path: ["usersFromListCount"]
|
|
88
|
+
});
|
|
89
|
+
}), be = (e) => ({
|
|
90
|
+
name: e.name,
|
|
91
|
+
description: e.description,
|
|
92
|
+
trigger: { all: [
|
|
93
|
+
"{event_name == 'submitted_for_approval'}",
|
|
94
|
+
...e.triggers.was_created_by_user_id?.length && e.triggers.was_created_by_user_id?.length > 0 ? [{
|
|
95
|
+
operator: i.IN,
|
|
96
|
+
left_operand: { name: `invoice.${r.WAS_CREATED_BY_USER_ID}` },
|
|
97
|
+
right_operand: e.triggers.was_created_by_user_id.map((e) => e.id)
|
|
98
|
+
}] : [],
|
|
99
|
+
...e.triggers.counterpart_id?.length && e.triggers.counterpart_id?.length > 0 ? [{
|
|
100
|
+
operator: i.IN,
|
|
101
|
+
left_operand: { name: `invoice.${r.COUNTERPART_ID}` },
|
|
102
|
+
right_operand: e.triggers.counterpart_id.map((e) => e.id)
|
|
103
|
+
}] : [],
|
|
104
|
+
...e.triggers.amount?.value?.length && e.triggers.amount?.value?.length > 0 ? [...e.triggers.amount.value.map((e) => ({
|
|
105
|
+
operator: e[0],
|
|
106
|
+
left_operand: { name: `invoice.${r.AMOUNT}` },
|
|
107
|
+
right_operand: typeof e[1] == "number" ? e[1] : parseInt(e[1])
|
|
108
|
+
})), {
|
|
109
|
+
operator: i.EQUALS,
|
|
110
|
+
left_operand: { name: `invoice.${r.CURRENCY}` },
|
|
111
|
+
right_operand: e.triggers.amount.currency
|
|
112
|
+
}] : []
|
|
113
|
+
] },
|
|
114
|
+
script: [{
|
|
115
|
+
if: {
|
|
116
|
+
run_concurrently: !1,
|
|
117
|
+
all: [
|
|
118
|
+
...e.rules.single_user ? [{
|
|
119
|
+
call: "ApprovalRequests.request_approval_by_users",
|
|
120
|
+
params: {
|
|
121
|
+
user_ids: [e.rules.single_user.id],
|
|
122
|
+
required_approval_count: 1
|
|
123
|
+
}
|
|
124
|
+
}] : [],
|
|
125
|
+
...e.rules.users_from_list && e.rules.users_from_list?.length > 0 ? [{
|
|
126
|
+
call: "ApprovalRequests.request_approval_by_users",
|
|
127
|
+
params: {
|
|
128
|
+
user_ids: e.rules.users_from_list.map((e) => e.id) || [],
|
|
129
|
+
required_approval_count: e.usersFromListCount ? typeof e.usersFromListCount == "number" ? e.usersFromListCount : parseInt(e.usersFromListCount) : 0
|
|
130
|
+
}
|
|
131
|
+
}] : [],
|
|
132
|
+
...e.rules.roles_from_list && e.rules.roles_from_list?.length > 0 ? [{
|
|
133
|
+
call: "ApprovalRequests.request_approval_by_roles",
|
|
134
|
+
params: {
|
|
135
|
+
role_ids: e.rules.roles_from_list.map((e) => e.id) || [],
|
|
136
|
+
required_approval_count: e.rolesFromListCount ? typeof e.rolesFromListCount == "number" ? e.rolesFromListCount : parseInt(e.rolesFromListCount) : 0
|
|
137
|
+
}
|
|
138
|
+
}] : [],
|
|
139
|
+
...e.rules.approval_chain && e.rules.approval_chain?.length > 0 ? [{
|
|
140
|
+
run_concurrently: !1,
|
|
141
|
+
all: [...e.rules.approval_chain.map((e) => ({
|
|
142
|
+
call: "ApprovalRequests.request_approval_by_users",
|
|
143
|
+
params: {
|
|
144
|
+
user_ids: [e.id],
|
|
145
|
+
required_approval_count: 1
|
|
146
|
+
}
|
|
147
|
+
})) || []]
|
|
148
|
+
}] : []
|
|
149
|
+
]
|
|
14
150
|
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
151
|
+
then: ["{Payables.approve(invoice.id)}"],
|
|
152
|
+
else: ["{Payables.reject(invoice.id)}"]
|
|
153
|
+
}]
|
|
154
|
+
}), v = ({ approvalPolicy: r, setIsEdit: i, onCreated: o, onUpdated: u }) => {
|
|
155
|
+
let { i18n: v } = he(), xe = n(), { api: y, queryClient: b } = e(), { formatFromMinorUnits: x, formatToMinorUnits: S } = t(), C = !!r, w = `Monite-Form-approvalPolicyBuilder-${ue()}`, { triggers: T, getTriggerName: E } = ee({ approvalPolicy: r }), { rules: D } = ne({ approvalPolicy: r }), [O, k] = l(!1), [A, j] = l(!1), [M, N] = l(null), [P, F] = l(null), [I, L] = l(null), { data: Se } = y.finops.getApprovalPolicies.useQuery({ query: { object_type: "payable" } }, { enabled: !C }), { data: R } = y.finops.getEntityUsers.useQuery({ query: { id__in: Array.isArray(T?.was_created_by_user_id) ? T.was_created_by_user_id : [] } }, { enabled: !!T?.was_created_by_user_id?.length }), { data: z } = y.finops.getCounterparts.useQuery({ query: { id__in: Array.isArray(T?.counterpart_id) ? T.counterpart_id : [] } }, { enabled: !!T?.counterpart_id?.length }), { data: B } = y.finops.getEntityUsersId.useQuery({ path: { entity_user_id: D?.single_user?.userId ?? "" } }, { enabled: !!D?.single_user?.userId }), { data: V } = y.finops.getEntityUsers.useQuery({ query: { id__in: Array.isArray(D?.users_from_list?.userIds) ? D.users_from_list.userIds : [] } }, { enabled: !!D?.users_from_list?.userIds?.length }), { data: H } = y.finops.getRoles.useQuery({ query: { id__in: Array.isArray(D?.roles_from_list?.roleIds) ? D.roles_from_list.roleIds : [] } }, { enabled: !!D?.roles_from_list?.roleIds?.length }), { data: U } = y.finops.getEntityUsers.useQuery({ query: { id__in: Array.isArray(D?.approval_chain?.chainUserIds) ? D.approval_chain.chainUserIds : [] } }, { enabled: !!D?.approval_chain?.chainUserIds?.length }), Ce = y.finops.postApprovalPolicies.useMutation({}, {
|
|
156
|
+
onSuccess: async (e) => {
|
|
157
|
+
await Promise.all([y.finops.getApprovalPolicies.invalidateQueries(b), y.finops.getApprovalPoliciesId.invalidateQueries({ parameters: { path: { approval_policy_id: e.id } } }, b)]), m.success(v._("Approval policy created"));
|
|
158
|
+
},
|
|
159
|
+
onError: async () => {
|
|
160
|
+
m.error(v._("Error creating approval policy"));
|
|
161
|
+
}
|
|
162
|
+
}), we = y.finops.patchApprovalPoliciesId.useMutation(void 0, {
|
|
163
|
+
onSuccess: async (e) => {
|
|
164
|
+
await Promise.all([y.finops.getApprovalPolicies.invalidateQueries(b), y.finops.getApprovalPoliciesId.invalidateQueries({ parameters: { path: { approval_policy_id: e.id } } }, b)]), m.success(v._("Approval policy updated"));
|
|
165
|
+
},
|
|
166
|
+
onError: async () => {
|
|
167
|
+
m.error(v._("Error updating approval policy"));
|
|
168
|
+
}
|
|
169
|
+
}), Te = async (e) => {
|
|
170
|
+
let t = Se?.data?.map((e) => e.priority ?? 0) ?? [];
|
|
171
|
+
e.priority = Math.max(0, ...t) + 1;
|
|
172
|
+
let n = await Ce.mutateAsync(e);
|
|
173
|
+
if (n) return i(!1), o?.(n.id), n;
|
|
174
|
+
}, Ee = async (e, t) => {
|
|
175
|
+
let n = await we.mutateAsync({
|
|
176
|
+
path: { approval_policy_id: e },
|
|
177
|
+
body: t
|
|
178
|
+
});
|
|
179
|
+
return n && (i(!1), u?.(e)), n;
|
|
180
|
+
}, De = _e({
|
|
181
|
+
resolver: ve(ye(v)),
|
|
182
|
+
mode: "onChange",
|
|
183
|
+
defaultValues: {
|
|
184
|
+
name: r?.name || "",
|
|
185
|
+
description: r?.description || "",
|
|
186
|
+
scriptType: void 0,
|
|
187
|
+
triggerType: void 0,
|
|
188
|
+
triggers: {},
|
|
189
|
+
rules: {},
|
|
190
|
+
object_type: r?.object_type || "payable",
|
|
191
|
+
amountOperator: void 0,
|
|
192
|
+
amountValue: void 0,
|
|
193
|
+
amountCurrency: "USD",
|
|
194
|
+
amountRangeLeftValue: void 0,
|
|
195
|
+
amountRangeRightValue: void 0,
|
|
196
|
+
usersFromListCount: 1,
|
|
197
|
+
rolesFromListCount: 1
|
|
198
|
+
}
|
|
199
|
+
}), { control: W, handleSubmit: Oe, setValue: G, getValues: K, watch: ke } = De, [Ae, q, J, Y, X, Z, Q, je, $, Me, Ne] = ke([
|
|
200
|
+
"triggers",
|
|
201
|
+
"rules",
|
|
202
|
+
"amountOperator",
|
|
203
|
+
"amountValue",
|
|
204
|
+
"amountRangeLeftValue",
|
|
205
|
+
"amountRangeRightValue",
|
|
206
|
+
"amountCurrency",
|
|
207
|
+
"triggerType",
|
|
208
|
+
"scriptType",
|
|
209
|
+
"usersFromListCount",
|
|
210
|
+
"rolesFromListCount"
|
|
211
|
+
]);
|
|
212
|
+
c(() => {
|
|
213
|
+
C && (R?.data && R?.data.length > 0 && G("triggers.was_created_by_user_id", R?.data), (z?.data?.length ?? 0) > 0 && G("triggers.counterpart_id", z?.data.map((e) => ({
|
|
214
|
+
id: e.id,
|
|
215
|
+
label: oe(e)
|
|
216
|
+
}))), T.amount && T.amount?.value?.length > 0 && (G("triggers.amount", T.amount), T.amount.value.length === 2 ? (G("amountOperator", "range"), G("amountRangeLeftValue", x(typeof T.amount.value[0][1] == "number" ? T.amount.value[0][1] : parseInt(T.amount.value[0][1]), T.amount.currency) || 0), G("amountRangeRightValue", x(typeof T.amount.value[1][1] == "number" ? T.amount.value[1][1] : parseInt(T.amount.value[1][1]), T.amount.currency) || 0), G("amountCurrency", T.amount.currency)) : (G("amountOperator", T.amount.value[0][0]), G("amountValue", x(typeof T.amount.value[0][1] == "number" ? T.amount.value[0][1] : parseInt(T.amount.value[0][1]), T.amount.currency) || 0), G("amountCurrency", T.amount.currency))), B && G("rules.single_user", B), V?.data && V?.data.length > 0 && (G("rules.users_from_list", V?.data), G("usersFromListCount", D?.users_from_list?.count)), H?.data && H?.data.length > 0 && (G("rules.roles_from_list", H?.data), G("rolesFromListCount", D?.roles_from_list?.count)), U?.data && U?.data.length > 0 && G("rules.approval_chain", U?.data));
|
|
217
|
+
}, [
|
|
218
|
+
R?.data,
|
|
219
|
+
z?.data,
|
|
220
|
+
B,
|
|
221
|
+
V?.data,
|
|
222
|
+
H?.data,
|
|
223
|
+
U?.data,
|
|
224
|
+
C,
|
|
225
|
+
G
|
|
226
|
+
]), c(() => {
|
|
227
|
+
M && G("triggerType", M);
|
|
228
|
+
}, [G, M]), c(() => {
|
|
229
|
+
I && G("scriptType", I);
|
|
230
|
+
}, [G, I]), c(() => {
|
|
231
|
+
J && (J === "range" && X && Z ? G("triggers.amount", {
|
|
232
|
+
currency: Q ?? "USD",
|
|
233
|
+
value: [[">=", S(typeof X == "number" ? X : parseInt(X), Q ?? "USD") || 0], ["<=", S(typeof Z == "number" ? Z : parseInt(Z), Q ?? "USD") || 0]]
|
|
234
|
+
}) : Y && G("triggers.amount", {
|
|
235
|
+
currency: Q ?? "USD",
|
|
236
|
+
value: [[J, S(typeof Y == "number" ? Y : parseInt(Y), Q ?? "USD") || 0]]
|
|
237
|
+
}));
|
|
238
|
+
}, [
|
|
239
|
+
S,
|
|
240
|
+
J,
|
|
241
|
+
X,
|
|
242
|
+
Z,
|
|
243
|
+
Y,
|
|
244
|
+
Q,
|
|
245
|
+
G
|
|
246
|
+
]);
|
|
247
|
+
let Pe = () => {
|
|
248
|
+
!O && M === "was_created_by_user_id" && G("triggers.was_created_by_user_id", P?.triggers?.was_created_by_user_id || []), !O && M === "counterpart_id" && G("triggers.counterpart_id", P?.triggers?.counterpart_id || []), !O && M === "amount" && (G("triggers.amount", P?.triggers?.amount || void 0), G("amountOperator", P?.amountOperator || void 0), G("amountValue", P?.amountValue || void 0), G("amountRangeLeftValue", P?.amountRangeLeftValue || void 0), G("amountRangeRightValue", P?.amountRangeRightValue || void 0), G("amountCurrency", P?.amountCurrency || void 0)), O && P?.triggers && G("triggers", P?.triggers), !A && I === "single_user" && G("rules.single_user", P?.rules?.single_user || void 0), !A && I === "users_from_list" && (G("rules.users_from_list", P?.rules?.users_from_list || void 0), G("usersFromListCount", P?.usersFromListCount || 1)), !A && I === "roles_from_list" && (G("rules.roles_from_list", P?.rules?.roles_from_list || void 0), G("rolesFromListCount", P?.rolesFromListCount || 1)), !A && I === "approval_chain" && G("rules.approval_chain", P?.rules?.approval_chain || void 0), A && P?.rules && G("rules", P?.rules), N(null), L(null), k(!1), j(!1), F(null), G("triggerType", null), G("scriptType", null);
|
|
249
|
+
}, Fe = !!M || !!I || O || A;
|
|
250
|
+
return /* @__PURE__ */ p(d, { children: [
|
|
251
|
+
/* @__PURE__ */ f(le, {
|
|
252
|
+
secondaryLevel: C || Fe,
|
|
253
|
+
title: M ? v._("Edit Condition") : O ? v._("Add Condition") : I ? v._("Edit Rule") : A ? v._("Add Rule") : C ? v._("Edit Approval Policy") : v._("Create Approval Policy"),
|
|
254
|
+
previousLevelTitle: (() => {
|
|
255
|
+
if (Fe) return C ? v._("Edit Approval Policy") : v._("Create Approval Policy");
|
|
256
|
+
})(),
|
|
257
|
+
closeSecondaryLevelDialog: Pe
|
|
258
|
+
}),
|
|
259
|
+
/* @__PURE__ */ f(fe, { children: /* @__PURE__ */ f(ge, {
|
|
260
|
+
...De,
|
|
261
|
+
children: /* @__PURE__ */ f("form", {
|
|
262
|
+
id: w,
|
|
263
|
+
noValidate: !0,
|
|
264
|
+
onSubmit: Oe((e) => {
|
|
265
|
+
let t = be(e);
|
|
266
|
+
if (C) {
|
|
267
|
+
Ee(r.id, t);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
Te({
|
|
271
|
+
...t,
|
|
272
|
+
object_type: e.object_type
|
|
273
|
+
});
|
|
57
274
|
}),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
275
|
+
children: /* @__PURE__ */ p(pe, {
|
|
276
|
+
gap: 3,
|
|
277
|
+
children: [
|
|
278
|
+
(M || O) && /* @__PURE__ */ p(s, {
|
|
279
|
+
label: v._("Condition type"),
|
|
280
|
+
name: "triggerType",
|
|
281
|
+
control: W,
|
|
282
|
+
fullWidth: !0,
|
|
283
|
+
required: !0,
|
|
284
|
+
select: !0,
|
|
285
|
+
value: M || void 0,
|
|
286
|
+
disabled: !!M,
|
|
287
|
+
children: [
|
|
288
|
+
(!P?.triggers?.amount || M === "amount") && /* @__PURE__ */ f(g, {
|
|
289
|
+
value: "amount",
|
|
290
|
+
children: E("amount")
|
|
291
|
+
}),
|
|
292
|
+
(!P?.triggers?.counterpart_id || M === "counterpart_id") && /* @__PURE__ */ f(g, {
|
|
293
|
+
value: "counterpart_id",
|
|
294
|
+
children: E("counterpart_id")
|
|
295
|
+
}),
|
|
296
|
+
(!P?.triggers?.was_created_by_user_id || M === "was_created_by_user_id") && /* @__PURE__ */ f(g, {
|
|
297
|
+
value: "was_created_by_user_id",
|
|
298
|
+
children: E("was_created_by_user_id")
|
|
299
|
+
})
|
|
300
|
+
]
|
|
301
|
+
}),
|
|
302
|
+
(I || A) && /* @__PURE__ */ p(s, {
|
|
303
|
+
label: v._("Approval flow"),
|
|
304
|
+
name: "scriptType",
|
|
305
|
+
control: W,
|
|
306
|
+
fullWidth: !0,
|
|
307
|
+
required: !0,
|
|
308
|
+
select: !0,
|
|
309
|
+
value: I,
|
|
310
|
+
disabled: !!I,
|
|
311
|
+
children: [
|
|
312
|
+
(!P?.rules?.single_user || I === "single_user") && /* @__PURE__ */ f(g, {
|
|
313
|
+
value: "single_user",
|
|
314
|
+
children: v._("Single user")
|
|
315
|
+
}),
|
|
316
|
+
(!P?.rules?.users_from_list || I === "users_from_list") && /* @__PURE__ */ f(g, {
|
|
317
|
+
value: "users_from_list",
|
|
318
|
+
children: v._("Users from the list - Any")
|
|
319
|
+
}),
|
|
320
|
+
I === "roles_from_list" && /* @__PURE__ */ f(g, {
|
|
321
|
+
value: "roles_from_list",
|
|
322
|
+
children: v._("Any user that has user role")
|
|
323
|
+
}),
|
|
324
|
+
(!P?.rules?.approval_chain || I === "approval_chain") && /* @__PURE__ */ f(g, {
|
|
325
|
+
value: "approval_chain",
|
|
326
|
+
children: v._("Users from list - One by one")
|
|
327
|
+
})
|
|
328
|
+
]
|
|
329
|
+
}),
|
|
330
|
+
(M === "was_created_by_user_id" || O && je === "was_created_by_user_id") && /* @__PURE__ */ f(a, {
|
|
331
|
+
control: W,
|
|
332
|
+
name: "triggers.was_created_by_user_id",
|
|
333
|
+
label: v._("Users")
|
|
334
|
+
}),
|
|
335
|
+
(M === "amount" || O && je === "amount") && /* @__PURE__ */ p(h, {
|
|
336
|
+
container: !0,
|
|
337
|
+
spacing: 2,
|
|
338
|
+
children: [
|
|
339
|
+
/* @__PURE__ */ f(h, {
|
|
340
|
+
item: !0,
|
|
341
|
+
xs: 4,
|
|
342
|
+
children: /* @__PURE__ */ p(s, {
|
|
343
|
+
label: v._("If amount is"),
|
|
344
|
+
name: "amountOperator",
|
|
345
|
+
control: W,
|
|
346
|
+
select: !0,
|
|
347
|
+
fullWidth: !0,
|
|
348
|
+
children: [
|
|
349
|
+
/* @__PURE__ */ f(g, {
|
|
350
|
+
value: ">",
|
|
351
|
+
children: v._("Greater than")
|
|
352
|
+
}),
|
|
353
|
+
/* @__PURE__ */ f(g, {
|
|
354
|
+
value: "<",
|
|
355
|
+
children: v._("Less than")
|
|
356
|
+
}),
|
|
357
|
+
/* @__PURE__ */ f(g, {
|
|
358
|
+
value: ">=",
|
|
359
|
+
children: v._("Greater than or equal to")
|
|
360
|
+
}),
|
|
361
|
+
/* @__PURE__ */ f(g, {
|
|
362
|
+
value: "<=",
|
|
363
|
+
children: v._("Less than or equal to")
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ f(g, {
|
|
366
|
+
value: "==",
|
|
367
|
+
children: v._("Equal to")
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ f(g, {
|
|
370
|
+
value: "range",
|
|
371
|
+
children: v._("In range")
|
|
372
|
+
})
|
|
373
|
+
]
|
|
374
|
+
})
|
|
375
|
+
}),
|
|
376
|
+
J === "range" ? /* @__PURE__ */ p(h, {
|
|
377
|
+
item: !0,
|
|
378
|
+
container: !0,
|
|
379
|
+
spacing: 2,
|
|
380
|
+
children: [/* @__PURE__ */ f(h, {
|
|
381
|
+
item: !0,
|
|
382
|
+
xs: 6,
|
|
383
|
+
children: /* @__PURE__ */ f(s, {
|
|
384
|
+
label: v._("From (including)"),
|
|
385
|
+
name: "amountRangeLeftValue",
|
|
386
|
+
control: W,
|
|
387
|
+
type: "number",
|
|
388
|
+
fullWidth: !0
|
|
389
|
+
})
|
|
390
|
+
}), /* @__PURE__ */ f(h, {
|
|
391
|
+
item: !0,
|
|
392
|
+
xs: 6,
|
|
393
|
+
children: /* @__PURE__ */ f(s, {
|
|
394
|
+
label: v._("To (including)"),
|
|
395
|
+
name: "amountRangeRightValue",
|
|
396
|
+
control: W,
|
|
397
|
+
type: "number",
|
|
398
|
+
fullWidth: !0
|
|
399
|
+
})
|
|
400
|
+
})]
|
|
401
|
+
}) : /* @__PURE__ */ f(h, {
|
|
402
|
+
item: !0,
|
|
403
|
+
xs: 4,
|
|
404
|
+
children: /* @__PURE__ */ f(s, {
|
|
405
|
+
label: v._("Amount"),
|
|
406
|
+
name: "amountValue",
|
|
407
|
+
control: W,
|
|
408
|
+
type: "number",
|
|
409
|
+
fullWidth: !0
|
|
410
|
+
})
|
|
411
|
+
}),
|
|
412
|
+
/* @__PURE__ */ f(h, {
|
|
413
|
+
item: !0,
|
|
414
|
+
xs: 4,
|
|
415
|
+
children: /* @__PURE__ */ f(se, {
|
|
416
|
+
name: "amountCurrency",
|
|
417
|
+
control: W,
|
|
418
|
+
showCodeOnly: !0
|
|
419
|
+
})
|
|
420
|
+
})
|
|
421
|
+
]
|
|
422
|
+
}),
|
|
423
|
+
(I === "single_user" || A && $ === "single_user") && /* @__PURE__ */ f(d, { children: /* @__PURE__ */ f(ae, {
|
|
424
|
+
control: W,
|
|
425
|
+
name: "rules.single_user",
|
|
426
|
+
label: v._("User allowed to approve")
|
|
427
|
+
}) }),
|
|
428
|
+
(I === "users_from_list" || A && $ === "users_from_list") && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(a, {
|
|
429
|
+
control: W,
|
|
430
|
+
name: "rules.users_from_list",
|
|
431
|
+
label: v._("Users allowed to approve")
|
|
432
|
+
}), /* @__PURE__ */ f(s, {
|
|
433
|
+
control: W,
|
|
434
|
+
label: v._("Minimum number of approvals required"),
|
|
435
|
+
name: "usersFromListCount",
|
|
436
|
+
type: "number",
|
|
437
|
+
required: !0,
|
|
438
|
+
inputProps: {
|
|
439
|
+
min: 1,
|
|
440
|
+
max: q?.users_from_list?.length || void 0
|
|
441
|
+
}
|
|
442
|
+
})] }),
|
|
443
|
+
(I === "roles_from_list" || A && $ === "roles_from_list") && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(ie, {
|
|
444
|
+
control: W,
|
|
445
|
+
name: "rules.roles_from_list",
|
|
446
|
+
label: v._("Any user that has user role")
|
|
447
|
+
}), /* @__PURE__ */ f(s, {
|
|
448
|
+
control: W,
|
|
449
|
+
label: v._("Minimum number of approvals required"),
|
|
450
|
+
name: "rolesFromListCount",
|
|
451
|
+
type: "number",
|
|
452
|
+
required: !0,
|
|
453
|
+
inputProps: { min: 1 }
|
|
454
|
+
})] }),
|
|
455
|
+
(I === "approval_chain" || A && $ === "approval_chain") && /* @__PURE__ */ f(a, {
|
|
456
|
+
control: W,
|
|
457
|
+
name: "rules.approval_chain",
|
|
458
|
+
label: v._("Users allowed to approve")
|
|
459
|
+
}),
|
|
460
|
+
!M && !I && !O && !A && /* @__PURE__ */ p(d, { children: [
|
|
461
|
+
/* @__PURE__ */ f(s, {
|
|
462
|
+
label: v._("Policy Name"),
|
|
463
|
+
name: "name",
|
|
464
|
+
control: W,
|
|
465
|
+
fullWidth: !0,
|
|
466
|
+
required: !0
|
|
467
|
+
}),
|
|
468
|
+
/* @__PURE__ */ f(s, {
|
|
469
|
+
label: v._("Description"),
|
|
470
|
+
name: "description",
|
|
471
|
+
control: W,
|
|
472
|
+
fullWidth: !0,
|
|
473
|
+
multiline: !0,
|
|
474
|
+
rows: 4
|
|
475
|
+
}),
|
|
476
|
+
/* @__PURE__ */ p(de, { children: [
|
|
477
|
+
/* @__PURE__ */ f(_, {
|
|
478
|
+
variant: "h5",
|
|
479
|
+
mt: 4,
|
|
480
|
+
mb: 1,
|
|
481
|
+
children: v._("Conditions")
|
|
482
|
+
}),
|
|
483
|
+
/* @__PURE__ */ f(_, {
|
|
484
|
+
variant: "body1",
|
|
485
|
+
mb: 1,
|
|
486
|
+
children: /* @__PURE__ */ f(me, {
|
|
487
|
+
id: "INKhSX",
|
|
488
|
+
components: { 0: /* @__PURE__ */ f("strong", {}) }
|
|
489
|
+
})
|
|
490
|
+
}),
|
|
491
|
+
/* @__PURE__ */ f(te, {
|
|
492
|
+
triggers: Ae,
|
|
493
|
+
onAddTrigger: () => {
|
|
494
|
+
k(!0), F({
|
|
495
|
+
triggers: { ...K("triggers") },
|
|
496
|
+
amountOperator: K("amountOperator"),
|
|
497
|
+
amountValue: K("amountValue"),
|
|
498
|
+
amountRangeLeftValue: K("amountRangeLeftValue"),
|
|
499
|
+
amountRangeRightValue: K("amountRangeRightValue"),
|
|
500
|
+
amountCurrency: K("amountCurrency")
|
|
501
|
+
});
|
|
502
|
+
},
|
|
503
|
+
onEditTrigger: (e) => {
|
|
504
|
+
N(e), F({
|
|
505
|
+
triggers: { ...K("triggers") },
|
|
506
|
+
amountOperator: K("amountOperator"),
|
|
507
|
+
amountValue: K("amountValue"),
|
|
508
|
+
amountRangeLeftValue: K("amountRangeLeftValue"),
|
|
509
|
+
amountRangeRightValue: K("amountRangeRightValue"),
|
|
510
|
+
amountCurrency: K("amountCurrency")
|
|
511
|
+
});
|
|
512
|
+
},
|
|
513
|
+
onDeleteTrigger: (e) => {
|
|
514
|
+
let t = { ...Ae };
|
|
515
|
+
delete t[e], G("triggers", t), G("amountOperator", void 0), G("amountValue", void 0), G("amountRangeLeftValue", void 0), G("amountRangeRightValue", void 0), G("amountCurrency", void 0);
|
|
516
|
+
}
|
|
517
|
+
}),
|
|
518
|
+
/* @__PURE__ */ f(_, {
|
|
519
|
+
variant: "h5",
|
|
520
|
+
mt: 4,
|
|
521
|
+
mb: 1,
|
|
522
|
+
children: v._("Approval flow")
|
|
523
|
+
}),
|
|
524
|
+
/* @__PURE__ */ f(re, {
|
|
525
|
+
rules: q,
|
|
526
|
+
usersFromListCount: Me,
|
|
527
|
+
rolesFromListCount: Ne,
|
|
528
|
+
onAddRule: () => {
|
|
529
|
+
j(!0), F({
|
|
530
|
+
rules: { ...K("rules") },
|
|
531
|
+
usersFromListCount: K("usersFromListCount"),
|
|
532
|
+
rolesFromListCount: K("rolesFromListCount")
|
|
533
|
+
});
|
|
534
|
+
},
|
|
535
|
+
onEditRule: (e) => {
|
|
536
|
+
L(e), F({
|
|
537
|
+
rules: { ...K("rules") },
|
|
538
|
+
usersFromListCount: K("usersFromListCount"),
|
|
539
|
+
rolesFromListCount: K("rolesFromListCount")
|
|
540
|
+
});
|
|
541
|
+
},
|
|
542
|
+
onDeleteRule: (e) => {
|
|
543
|
+
let t = { ...q };
|
|
544
|
+
delete t[e], G("rules", t), G("usersFromListCount", void 0), G("rolesFromListCount", void 0);
|
|
545
|
+
}
|
|
546
|
+
})
|
|
547
|
+
] })
|
|
548
|
+
] })
|
|
549
|
+
]
|
|
73
550
|
})
|
|
74
|
-
|
|
75
|
-
})
|
|
76
|
-
|
|
551
|
+
})
|
|
552
|
+
}) }),
|
|
553
|
+
/* @__PURE__ */ f(ce, {
|
|
554
|
+
primaryButton: M || I || O || A ? {
|
|
555
|
+
label: M ? v._("Update") : v._("Add"),
|
|
556
|
+
onClick: (e) => {
|
|
557
|
+
e?.preventDefault(), N(null), L(null), k(!1), j(!1), G("triggerType", null), G("scriptType", null);
|
|
558
|
+
}
|
|
559
|
+
} : {
|
|
560
|
+
label: v._("Save"),
|
|
561
|
+
formId: w,
|
|
562
|
+
isLoading: we.isPending || Ce.isPending
|
|
563
|
+
},
|
|
564
|
+
cancelButton: { onClick: M || I || O || A ? Pe : C ? () => i(!1) : xe?.onClose }
|
|
565
|
+
})
|
|
566
|
+
] });
|
|
77
567
|
};
|
|
78
568
|
//#endregion
|
|
79
|
-
export {
|
|
569
|
+
export { v as ApprovalPolicyForm };
|