@orangesix/react 1.1.1 → 1.3.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.
Files changed (109) hide show
  1. package/api/index.cjs.js +1 -1
  2. package/api/index.cjs.js.map +1 -1
  3. package/api/index.d.ts +144 -3
  4. package/api/index.esm.js +1 -1
  5. package/api/index.esm.js.map +1 -1
  6. package/autocomplete/index.cjs.js +1 -1
  7. package/autocomplete/index.cjs.js.map +1 -1
  8. package/autocomplete/index.d.ts +29 -2
  9. package/autocomplete/index.esm.js +1 -1
  10. package/autocomplete/index.esm.js.map +1 -1
  11. package/button/_button.scss +56 -0
  12. package/button/index.cjs.js +2 -0
  13. package/button/index.cjs.js.map +1 -0
  14. package/button/index.d.ts +109 -0
  15. package/button/index.esm.js +2 -0
  16. package/button/index.esm.js.map +1 -0
  17. package/button/package.json +5 -0
  18. package/editor/index.cjs.js +1 -1
  19. package/editor/index.cjs.js.map +1 -1
  20. package/editor/index.d.ts +22 -1
  21. package/editor/index.esm.js +1 -1
  22. package/editor/index.esm.js.map +1 -1
  23. package/input/index.cjs.js +2 -0
  24. package/input/index.cjs.js.map +1 -0
  25. package/input/index.d.ts +253 -0
  26. package/input/index.esm.js +2 -0
  27. package/input/index.esm.js.map +1 -0
  28. package/input/package.json +5 -0
  29. package/inputfilter/index.cjs.js +1 -1
  30. package/inputfilter/index.cjs.js.map +1 -1
  31. package/inputfilter/index.d.ts +22 -1
  32. package/inputfilter/index.esm.js +1 -1
  33. package/inputfilter/index.esm.js.map +1 -1
  34. package/loading/_loading.scss +10 -0
  35. package/loading/index.cjs.js +2 -0
  36. package/loading/index.cjs.js.map +1 -0
  37. package/loading/index.d.ts +172 -0
  38. package/loading/index.esm.js +2 -0
  39. package/loading/index.esm.js.map +1 -0
  40. package/loading/package.json +5 -0
  41. package/message/index.cjs.js +2 -0
  42. package/message/index.cjs.js.map +1 -0
  43. package/message/index.d.ts +108 -0
  44. package/message/index.esm.js +2 -0
  45. package/message/index.esm.js.map +1 -0
  46. package/message/package.json +5 -0
  47. package/modal/index.cjs.js +2 -0
  48. package/modal/index.cjs.js.map +1 -0
  49. package/modal/index.d.ts +73 -0
  50. package/modal/index.esm.js +2 -0
  51. package/modal/index.esm.js.map +1 -0
  52. package/modal/package.json +5 -0
  53. package/package.json +23 -19
  54. package/picklist/index.cjs.js +2 -0
  55. package/picklist/index.cjs.js.map +1 -0
  56. package/picklist/index.d.ts +74 -0
  57. package/picklist/index.esm.js +2 -0
  58. package/picklist/index.esm.js.map +1 -0
  59. package/picklist/package.json +5 -0
  60. package/radio/index.cjs.js +2 -0
  61. package/radio/index.cjs.js.map +1 -0
  62. package/radio/index.d.ts +231 -0
  63. package/radio/index.esm.js +2 -0
  64. package/radio/index.esm.js.map +1 -0
  65. package/radio/package.json +5 -0
  66. package/select/index.cjs.js +2 -0
  67. package/select/index.cjs.js.map +1 -0
  68. package/select/index.d.ts +239 -0
  69. package/select/index.esm.js +2 -0
  70. package/select/index.esm.js.map +1 -0
  71. package/select/package.json +5 -0
  72. package/style/index.d.ts +1 -1
  73. package/style/scss/_variables.scss +4 -0
  74. package/style/scss/bootstrap.scss +1 -0
  75. package/style/scss/components/button/_button.scss +494 -494
  76. package/style/scss/components/data/_datatable.scss +1 -0
  77. package/style/scss/components/data/_picklist.scss +61 -61
  78. package/style/scss/components/input/_iconfield.scss +5 -4
  79. package/style/scss/components/input/_inputswitch.scss +80 -70
  80. package/style/scss/core/_mixins.scss +195 -195
  81. package/style/scss/core/_reset.scss +75 -74
  82. package/switch/index.cjs.js +2 -0
  83. package/switch/index.cjs.js.map +1 -0
  84. package/switch/index.d.ts +212 -0
  85. package/switch/index.esm.js +2 -0
  86. package/switch/index.esm.js.map +1 -0
  87. package/switch/package.json +5 -0
  88. package/table/index.cjs.js +1 -1
  89. package/table/index.cjs.js.map +1 -1
  90. package/table/index.d.ts +51 -4
  91. package/table/index.esm.js +1 -1
  92. package/table/index.esm.js.map +1 -1
  93. package/tablepivot/index.d.ts +2 -1
  94. package/tabview/index.cjs.js +1 -1
  95. package/tabview/index.cjs.js.map +1 -1
  96. package/tabview/index.d.ts +29 -2
  97. package/tabview/index.esm.js +1 -1
  98. package/tabview/index.esm.js.map +1 -1
  99. package/textarea/index.cjs.js +2 -0
  100. package/textarea/index.cjs.js.map +1 -0
  101. package/textarea/index.d.ts +208 -0
  102. package/textarea/index.esm.js +2 -0
  103. package/textarea/index.esm.js.map +1 -0
  104. package/textarea/package.json +5 -0
  105. package/utils/index.cjs.js +1 -1
  106. package/utils/index.cjs.js.map +1 -1
  107. package/utils/index.d.ts +10 -2
  108. package/utils/index.esm.js +1 -1
  109. package/utils/index.esm.js.map +1 -1
@@ -1,243 +1,243 @@
1
1
  @mixin icon-override($icon) {
2
- &:before {
3
- content: $icon;
4
- }
2
+ &:before {
3
+ content: $icon;
4
+ }
5
5
  }
6
6
 
7
7
  @mixin focused() {
8
- outline: $focusOutline;
9
- outline-offset: $focusOutlineOffset;
10
- box-shadow: $focusShadow;
8
+ outline: $focusOutline;
9
+ outline-offset: $focusOutlineOffset;
10
+ box-shadow: $focusShadow;
11
11
  }
12
12
 
13
13
  @mixin focused-inset() {
14
- outline: $focusOutline;
15
- outline-offset: $focusOutlineOffset;
16
- box-shadow: inset $focusShadow;
14
+ outline: $focusOutline;
15
+ outline-offset: $focusOutlineOffset;
16
+ box-shadow: inset $focusShadow;
17
17
  }
18
18
 
19
19
  @mixin focused-input() {
20
- @include focused();
21
- border-color: $inputFocusBorderColor;
20
+ @include focused();
21
+ border-color: $inputFocusBorderColor;
22
22
  }
23
23
 
24
24
  @mixin focused-listitem() {
25
- outline: $focusOutline;
26
- outline-offset: $focusOutlineOffset;
27
- box-shadow: $inputListItemFocusShadow;
25
+ outline: $focusOutline;
26
+ outline-offset: $focusOutlineOffset;
27
+ box-shadow: $inputListItemFocusShadow;
28
28
  }
29
29
 
30
30
  @mixin invalid-input() {
31
- border-color: $inputErrorBorderColor;
31
+ border-color: $inputErrorBorderColor;
32
32
  }
33
33
 
34
34
  @mixin menuitem-link {
35
- > .p-menuitem-content {
36
- color: $menuitemTextColor;
37
- transition: $listItemTransition;
38
- border-radius: $menuitemBorderRadius;
39
-
40
- .p-menuitem-link {
41
- color: $menuitemTextColor;
42
- padding: $menuitemPadding;
43
- user-select: none;
44
-
45
- .p-menuitem-text {
46
- color: $menuitemTextColor;
47
- }
48
-
49
- .p-menuitem-icon {
50
- color: $menuitemIconColor;
51
- margin-right: $inlineSpacing;
52
- }
53
-
54
- .p-submenu-icon {
55
- color: $menuitemIconColor;
56
- }
57
- }
58
- }
59
-
60
- &.p-highlight {
61
- > .p-menuitem-content {
62
- color: $menuitemTextActiveColor;
63
- background: $menuitemActiveBg;
64
-
65
- .p-menuitem-link {
66
- .p-menuitem-text {
67
- color: $menuitemTextActiveColor;
68
- }
69
-
70
- .p-menuitem-icon,
71
- .p-submenu-icon {
72
- color: $menuitemIconActiveColor;
73
- }
74
- }
75
- }
76
-
77
- &.p-focus {
78
- > .p-menuitem-content {
79
- background: $menuitemActiveFocusBg;
80
- }
81
- }
82
- }
83
-
84
- &:not(.p-highlight):not(.p-disabled) {
85
- &.p-focus {
86
- > .p-menuitem-content {
87
- color: $menuitemTextFocusColor;
88
- background: $menuitemFocusBg;
89
-
90
- .p-menuitem-link {
91
- .p-menuitem-text {
92
- color: $menuitemTextFocusColor;
93
- }
94
-
95
- .p-menuitem-icon,
96
- .p-submenu-icon {
97
- color: $menuitemIconFocusColor;
98
- }
99
- }
100
- }
101
- }
102
-
103
- > .p-menuitem-content {
104
- &:hover {
105
- color: $menuitemTextHoverColor;
106
- background: $menuitemHoverBg;
107
-
108
- .p-menuitem-link {
109
- .p-menuitem-text {
110
- color: $menuitemTextHoverColor;
111
- }
112
-
113
- .p-menuitem-icon,
114
- .p-submenu-icon {
115
- color: $menuitemIconHoverColor;
116
- }
117
- }
118
- }
119
- }
120
- }
35
+ > .p-menuitem-content {
36
+ color: $menuitemTextColor;
37
+ transition: $listItemTransition;
38
+ border-radius: $menuitemBorderRadius;
39
+
40
+ .p-menuitem-link {
41
+ color: $menuitemTextColor;
42
+ padding: $menuitemPadding;
43
+ user-select: none;
44
+
45
+ .p-menuitem-text {
46
+ color: $menuitemTextColor;
47
+ }
48
+
49
+ .p-menuitem-icon {
50
+ color: $menuitemIconColor;
51
+ margin-right: $inlineSpacing;
52
+ }
53
+
54
+ .p-submenu-icon {
55
+ color: $menuitemIconColor;
56
+ }
57
+ }
58
+ }
59
+
60
+ &.p-highlight {
61
+ > .p-menuitem-content {
62
+ color: $menuitemTextActiveColor;
63
+ background: $menuitemActiveBg;
64
+
65
+ .p-menuitem-link {
66
+ .p-menuitem-text {
67
+ color: $menuitemTextActiveColor;
68
+ }
69
+
70
+ .p-menuitem-icon,
71
+ .p-submenu-icon {
72
+ color: $menuitemIconActiveColor;
73
+ }
74
+ }
75
+ }
76
+
77
+ &.p-focus {
78
+ > .p-menuitem-content {
79
+ background: $menuitemActiveFocusBg;
80
+ }
81
+ }
82
+ }
83
+
84
+ &:not(.p-highlight):not(.p-disabled) {
85
+ &.p-focus {
86
+ > .p-menuitem-content {
87
+ color: $menuitemTextFocusColor;
88
+ background: $menuitemFocusBg;
89
+
90
+ .p-menuitem-link {
91
+ .p-menuitem-text {
92
+ color: $menuitemTextFocusColor;
93
+ }
94
+
95
+ .p-menuitem-icon,
96
+ .p-submenu-icon {
97
+ color: $menuitemIconFocusColor;
98
+ }
99
+ }
100
+ }
101
+ }
102
+
103
+ > .p-menuitem-content {
104
+ &:hover {
105
+ color: $menuitemTextHoverColor;
106
+ background: $menuitemHoverBg;
107
+
108
+ .p-menuitem-link {
109
+ .p-menuitem-text {
110
+ color: $menuitemTextHoverColor;
111
+ }
112
+
113
+ .p-menuitem-icon,
114
+ .p-submenu-icon {
115
+ color: $menuitemIconHoverColor;
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
121
121
  }
122
122
 
123
123
  @mixin horizontal-rootmenuitem-link {
124
- > .p-menuitem-content {
125
- color: $horizontalMenuRootMenuitemTextColor;
126
- transition: $listItemTransition;
127
- border-radius: $horizontalMenuRootMenuitemBorderRadius;
128
-
129
- .p-menuitem-link {
130
- padding: $horizontalMenuRootMenuitemPadding;
131
- user-select: none;
132
-
133
- .p-menuitem-text {
134
- color: $horizontalMenuRootMenuitemTextColor;
135
- }
136
-
137
- .p-menuitem-icon {
138
- color: $horizontalMenuRootMenuitemIconColor;
139
- margin-right: $inlineSpacing;
140
- }
141
-
142
- .p-submenu-icon {
143
- color: $horizontalMenuRootMenuitemIconColor;
144
- margin-left: $inlineSpacing;
145
- }
146
- }
147
- }
148
-
149
- &:not(.p-highlight):not(.p-disabled) {
150
- > .p-menuitem-content {
151
- &:hover {
152
- color: $horizontalMenuRootMenuitemTextHoverColor;
153
- background: $horizontalMenuRootMenuitemHoverBg;
154
-
155
- .p-menuitem-link {
156
- .p-menuitem-text {
157
- color: $horizontalMenuRootMenuitemTextHoverColor;
158
- }
159
-
160
- .p-menuitem-icon,
161
- .p-submenu-icon {
162
- color: $horizontalMenuRootMenuitemIconHoverColor;
163
- }
164
- }
165
- }
166
- }
167
- }
124
+ > .p-menuitem-content {
125
+ color: $horizontalMenuRootMenuitemTextColor;
126
+ transition: $listItemTransition;
127
+ border-radius: $horizontalMenuRootMenuitemBorderRadius;
128
+
129
+ .p-menuitem-link {
130
+ padding: $horizontalMenuRootMenuitemPadding;
131
+ user-select: none;
132
+
133
+ .p-menuitem-text {
134
+ color: $horizontalMenuRootMenuitemTextColor;
135
+ }
136
+
137
+ .p-menuitem-icon {
138
+ color: $horizontalMenuRootMenuitemIconColor;
139
+ margin-right: $inlineSpacing;
140
+ }
141
+
142
+ .p-submenu-icon {
143
+ color: $horizontalMenuRootMenuitemIconColor;
144
+ margin-left: $inlineSpacing;
145
+ }
146
+ }
147
+ }
148
+
149
+ &:not(.p-highlight):not(.p-disabled) {
150
+ > .p-menuitem-content {
151
+ &:hover {
152
+ color: $horizontalMenuRootMenuitemTextHoverColor;
153
+ background: $horizontalMenuRootMenuitemHoverBg;
154
+
155
+ .p-menuitem-link {
156
+ .p-menuitem-text {
157
+ color: $horizontalMenuRootMenuitemTextHoverColor;
158
+ }
159
+
160
+ .p-menuitem-icon,
161
+ .p-submenu-icon {
162
+ color: $horizontalMenuRootMenuitemIconHoverColor;
163
+ }
164
+ }
165
+ }
166
+ }
167
+ }
168
168
  }
169
169
 
170
170
  @mixin placeholder {
171
- ::-webkit-input-placeholder {
172
- @content;
173
- }
174
- :-moz-placeholder {
175
- @content;
176
- }
177
- ::-moz-placeholder {
178
- @content;
179
- }
180
- :-ms-input-placeholder {
181
- @content;
182
- }
171
+ ::-webkit-input-placeholder {
172
+ @content;
173
+ }
174
+ :-moz-placeholder {
175
+ @content;
176
+ }
177
+ ::-moz-placeholder {
178
+ @content;
179
+ }
180
+ :-ms-input-placeholder {
181
+ @content;
182
+ }
183
183
  }
184
184
 
185
185
  @mixin scaledPadding($val, $scale) {
186
- padding: nth($val, 1) * $scale nth($val, 2) * $scale;
186
+ padding: nth($val, 1) * $scale nth($val, 2) * $scale;
187
187
  }
188
188
 
189
189
  @mixin scaledFontSize($val, $scale) {
190
- font-size: $val * $scale;
190
+ font-size: #{$val * $scale} !important;
191
191
  }
192
192
 
193
193
  @mixin nested-submenu-indents($val, $index, $length) {
194
- ul {
195
- li {
196
- a {
197
- padding-left: $val * ($index + 1);
198
- }
194
+ ul {
195
+ li {
196
+ a {
197
+ padding-left: $val * ($index + 1);
198
+ }
199
199
 
200
- @if $index < $length {
201
- @include nested-submenu-indents($val, $index + 2, $length);
202
- }
203
- }
204
- }
200
+ @if $index < $length {
201
+ @include nested-submenu-indents($val, $index + 2, $length);
202
+ }
203
+ }
204
+ }
205
205
  }
206
206
 
207
207
  @mixin action-icon($enabled: true) {
208
- width: $actionIconWidth;
209
- height: $actionIconHeight;
210
- color: $actionIconColor;
211
- border: $actionIconBorder;
212
- background: $actionIconBg;
213
- border-radius: $actionIconBorderRadius;
214
- transition: $actionIconTransition;
215
-
216
- @if $enabled {
217
- &:enabled:hover {
218
- @include action-icon-hover();
219
- }
220
- } @else {
221
- &:hover {
222
- @include action-icon-hover();
223
- }
224
- }
225
-
226
- &:focus-visible {
227
- @include focused();
228
- }
208
+ width: $actionIconWidth;
209
+ height: $actionIconHeight;
210
+ color: $actionIconColor;
211
+ border: $actionIconBorder;
212
+ background: $actionIconBg;
213
+ border-radius: $actionIconBorderRadius;
214
+ transition: $actionIconTransition;
215
+
216
+ @if $enabled {
217
+ &:enabled:hover {
218
+ @include action-icon-hover();
219
+ }
220
+ } @else {
221
+ &:hover {
222
+ @include action-icon-hover();
223
+ }
224
+ }
225
+
226
+ &:focus-visible {
227
+ @include focused();
228
+ }
229
229
  }
230
230
 
231
231
  @mixin action-icon-hover() {
232
- color: $actionIconHoverColor;
233
- border-color: $actionIconHoverBorderColor;
234
- background: $actionIconHoverBg;
232
+ color: $actionIconHoverColor;
233
+ border-color: $actionIconHoverBorderColor;
234
+ background: $actionIconHoverBg;
235
235
  }
236
236
 
237
237
  @function tint($color, $percentage) {
238
- @return mix(#fff, $color, $percentage);
238
+ @return mix(#fff, $color, $percentage);
239
239
  }
240
240
 
241
241
  @function shade($color, $percentage) {
242
- @return mix(#000, $color, $percentage);
242
+ @return mix(#000, $color, $percentage);
243
243
  }
@@ -1,75 +1,76 @@
1
- * {
2
- box-sizing: border-box;
3
- }
4
-
5
- .p-component {
6
- font-family: var(--font-family);
7
- font-feature-settings: var(--font-feature-settings, normal);
8
- font-size: $fontSize;
9
- font-weight: $fontWeight;
10
- }
11
-
12
- .p-component-overlay {
13
- background-color: $maskBg;
14
- transition-duration: $transitionDuration;
15
- }
16
-
17
- .p-disabled, .p-component:disabled {
18
- opacity: $disabledOpacity;
19
- }
20
-
21
- .p-error {
22
- color: $errorColor;
23
- }
24
-
25
- .p-text-secondary {
26
- color: $textSecondaryColor;
27
- }
28
-
29
- .pi {
30
- font-size: $primeIconFontSize;
31
- }
32
-
33
- .p-icon {
34
- width: $primeIconFontSize;
35
- height: $primeIconFontSize;
36
- }
37
-
38
- .p-link {
39
- font-family: var(--font-family);
40
- font-feature-settings: var(--font-feature-settings, normal);
41
- font-size: $fontSize;
42
- border-radius: $borderRadius;
43
-
44
- &:focus-visible {
45
- @include focused();
46
- }
47
- }
48
-
49
- .p-component-overlay-enter {
50
- animation: p-component-overlay-enter-animation 150ms forwards;
51
- }
52
-
53
- .p-component-overlay-leave {
54
- animation: p-component-overlay-leave-animation 150ms forwards;
55
- }
56
-
57
- .p-component-overlay {
58
- @keyframes p-component-overlay-enter-animation {
59
- from {
60
- background-color: transparent;
61
- }
62
- to {
63
- background-color: var(--maskbg);
64
- }
65
- }
66
-
67
- @keyframes p-component-overlay-leave-animation {
68
- from {
69
- background-color: var(--maskbg);
70
- }
71
- to {
72
- background-color: transparent;
73
- }
74
- }
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ .p-component {
6
+ font-family: var(--font-family);
7
+ font-feature-settings: var(--font-feature-settings, normal);
8
+ font-size: $fontSize;
9
+ font-weight: $fontWeight;
10
+ }
11
+
12
+ .p-component-overlay {
13
+ background-color: $maskBg;
14
+ transition-duration: $transitionDuration;
15
+ }
16
+
17
+ .p-disabled, .p-component:disabled {
18
+ opacity: $disabledOpacity;
19
+ background-color: $disabledBackground !important;
20
+ }
21
+
22
+ .p-error {
23
+ color: $errorColor;
24
+ }
25
+
26
+ .p-text-secondary {
27
+ color: $textSecondaryColor;
28
+ }
29
+
30
+ .pi {
31
+ font-size: $primeIconFontSize;
32
+ }
33
+
34
+ .p-icon {
35
+ width: $primeIconFontSize;
36
+ height: $primeIconFontSize;
37
+ }
38
+
39
+ .p-link {
40
+ font-family: var(--font-family);
41
+ font-feature-settings: var(--font-feature-settings, normal);
42
+ font-size: $fontSize;
43
+ border-radius: $borderRadius;
44
+
45
+ &:focus-visible {
46
+ @include focused();
47
+ }
48
+ }
49
+
50
+ .p-component-overlay-enter {
51
+ animation: p-component-overlay-enter-animation 150ms forwards;
52
+ }
53
+
54
+ .p-component-overlay-leave {
55
+ animation: p-component-overlay-leave-animation 150ms forwards;
56
+ }
57
+
58
+ .p-component-overlay {
59
+ @keyframes p-component-overlay-enter-animation {
60
+ from {
61
+ background-color: transparent;
62
+ }
63
+ to {
64
+ background-color: var(--maskbg);
65
+ }
66
+ }
67
+
68
+ @keyframes p-component-overlay-leave-animation {
69
+ from {
70
+ background-color: var(--maskbg);
71
+ }
72
+ to {
73
+ background-color: transparent;
74
+ }
75
+ }
75
76
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react"),t=require("primereact/utils"),r=require("primereact/inputswitch");function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=a(e);const s=({children:r,...a})=>{const n={size:`box-size-${a.size??"100"}`,direction:`box-direction-${a.direction??"row"}`,justify:void 0===a.justify?"":Array.isArray(a.justify)?a.justify?.join(" "):a.justify,align:void 0===a.align?"":Array.isArray(a.align)?a.align?.join(" "):a.align},s={className:t.classNames(["box",a.className??"",n.size,n.direction,n.justify,n.align]),style:a.css,id:a.id};return e.createElement("div",{...s},r)},l=({iconPrefix:t="bi bi-",...r})=>r.label&&e.createElement("p",{className:"form-label"},r.icon&&e.createElement("i",{className:t+r.icon+" me-1"}),r.label,r.required&&e.createElement("span",{className:"text-danger"},"*")),i=({errors:t,name:r,...a})=>a.mode&&"Controlled"!==a.mode?e.createElement("div",{className:t[r??""]?"invalid-feedback is-invalid":"","data-name":r??"",id:"j_feedback",style:{display:t[r??""]?"block":"none"}},t[r??""]?t[r??""].message:""):e.createElement("div",{"data-name":r,id:"j_feedback"});var o=e=>null==e;var c=e=>!o(e)&&!Array.isArray(e)&&(e=>"object"==typeof e)(e)&&!(e=>e instanceof Date)(e),u=e=>c(e)&&e.target?"checkbox"===e.target.type?e.target.checked:e.target.value:e,d="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function f(e){let t;const r=Array.isArray(e),a="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(d&&(e instanceof Blob||a)||!r&&!c(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return c(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=f(e[r]));else t=e}return t}var m=e=>Array.isArray(e)?e.filter(Boolean):[],b=e=>void 0===e,g=(e,t,r)=>{if(!t||!c(e))return r;const a=m(t.split(/[,[\].]+?/)).reduce(((e,t)=>o(e)?e:e[t]),e);return b(a)||a===e?b(e[t])?r:e[t]:a},y=e=>"boolean"==typeof e,p=(e,t,r)=>{let a=-1;const n=(e=>/^\w*$/.test(e))(t)?[t]:m(t.replace(/["|']|\]/g,"").split(/\.|\[/));const s=n.length,l=s-1;for(;++a<s;){const t=n[a];let s=r;if(a!==l){const r=e[t];s=c(r)||Array.isArray(r)?r:isNaN(+n[a+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=s,e=e[t]}};const v="blur",_="change",h="all",E=e.createContext(null),V=()=>e.useContext(E);const w="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;function x(t){const r=V(),{control:a=r.control,disabled:n,name:s,exact:l}=t||{},[i,o]=e.useState(a._formState),c=e.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return w((()=>a._subscribe({name:s,formState:c.current,exact:l,callback:e=>{!n&&o({...a._formState,...e})}})),[s,n,l]),e.useEffect((()=>{c.current.isValid&&a._setValid(!0)}),[a]),e.useMemo((()=>((e,t,r,a=!0)=>{const n={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(n,s,{get:()=>{const n=s;return t._proxyFormState[n]!==h&&(t._proxyFormState[n]=!a||h),r&&(r[n]=!0),e[n]}});return n})(i,a,c.current,!1)),[i,a])}function j(t){const r=V(),{control:a=r.control,name:n,defaultValue:s,disabled:l,exact:i}=t||{},o=e.useRef(s),[c,u]=e.useState(a._getWatch(n,o.current));return w((()=>a._subscribe({name:n,formState:{values:!0},exact:i,callback:e=>!l&&u(((e,t,r,a,n)=>"string"==typeof e?g(r,e,n):Array.isArray(e)?e.map((e=>g(r,e))):r)(n,a._names,e.values||a._formValues,0,o.current))})),[n,a,l,i]),e.useEffect((()=>a._removeUnmounted())),c}const C=t=>t.render(function(t){const r=V(),{name:a,disabled:n,control:s=r.control,shouldUnregister:l}=t,i=((e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)))(s._names.array,a),o=j({control:s,name:a,defaultValue:g(s._formValues,a,g(s._defaultValues,a,t.defaultValue)),exact:!0}),c=x({control:s,name:a,exact:!0}),d=e.useRef(t),m=e.useRef(s.register(a,{...t.rules,value:o,...y(t.disabled)?{disabled:t.disabled}:{}})),h=e.useMemo((()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!g(c.errors,a)},isDirty:{enumerable:!0,get:()=>!!g(c.dirtyFields,a)},isTouched:{enumerable:!0,get:()=>!!g(c.touchedFields,a)},isValidating:{enumerable:!0,get:()=>!!g(c.validatingFields,a)},error:{enumerable:!0,get:()=>g(c.errors,a)}})),[c,a]),E=e.useCallback((e=>m.current.onChange({target:{value:u(e),name:a},type:_})),[a]),w=e.useCallback((()=>m.current.onBlur({target:{value:g(s._formValues,a),name:a},type:v})),[a,s._formValues]),C=e.useCallback((e=>{const t=g(s._fields,a);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}),[s._fields,a]),S=e.useMemo((()=>({name:a,value:o,...y(n)||c.disabled?{disabled:c.disabled||n}:{},onChange:E,onBlur:w,ref:C})),[a,n,c.disabled,E,w,C,o]);return e.useEffect((()=>{const e=s._options.shouldUnregister||l;s.register(a,{...d.current.rules,...y(d.current.disabled)?{disabled:d.current.disabled}:{}});const t=(e,t)=>{const r=g(s._fields,e);r&&r._f&&(r._f.mount=t)};if(t(a,!0),e){const e=f(g(s._options.defaultValues,a));p(s._defaultValues,a,e),b(g(s._formValues,a))&&p(s._formValues,a,e)}return!i&&s.register(a),()=>{(i?e&&!s._state.action:e)?s.unregister(a):t(a,!1)}}),[a,s,i,l]),e.useEffect((()=>{s._setDisabledField({disabled:n,name:a})}),[n,a,s]),e.useMemo((()=>({field:S,formState:c,fieldState:h})),[S,c,h])}(t));function S({...t}){return e.createElement(C,{render:({field:a,formState:{errors:n}})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"w-100 d-flex"},e.createElement(r.InputSwitch,{checked:a.value,disabled:t.disabled,falseValue:t.valueFalse??!1,id:t.id,name:a.name,trueValue:t.valueTrue??!0,onChange:e=>a.onChange(e)}),t.legend&&e.createElement("p",{className:"ms-2 p-inputswitch-legend"},t.legend)),e.createElement(i,{...t,errors:n})),control:t.control,name:t.name})}function F({...t}){return e.createElement(e.Fragment,null,e.createElement("div",{className:"w-100 d-flex"},e.createElement(r.InputSwitch,{checked:t.value,disabled:t.disabled,falseValue:t.valueFalse??!1,id:t.id,name:t.name,trueValue:t.valueTrue??!0,onChange:e=>{t.onChange&&t.onChange(e.target.value)}}),t.legend&&e.createElement("p",{className:"ms-2 p-inputswitch-legend"},t.legend)),e.createElement(i,{...t}))}exports.Switch=function(t){let r=t;return e.createElement(s,{className:t.className,css:t.css,size:t.size??"100"},e.createElement(l,{...t}),t.mode&&"Controlled"!==t.mode?e.createElement(S,{...r}):e.createElement(F,{...r}))};
2
+ //# sourceMappingURL=index.cjs.js.map