iglooform 2.5.47 → 2.5.48

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.
@@ -81,7 +81,7 @@ var Confirmation = function Confirmation(_ref) {
81
81
  return;
82
82
  }
83
83
 
84
- onChange && onChange(!value);
84
+ onChange && onChange(!value || undefined);
85
85
  },
86
86
  style: {
87
87
  cursor: 'pointer',
package/es/types.d.ts CHANGED
@@ -35,7 +35,7 @@ export interface FormBasicConfig {
35
35
  export declare type FormItemAssert = {
36
36
  field: NamePath;
37
37
  value?: any;
38
- operation?: 'eq' | 'ne' | 'in' | 'ni' | 'lt' | 'le' | 'gt' | 'ge' | 'co' | 'nc' | 'filled' | 'unfilled';
38
+ operation?: 'eq' | 'ne' | 'in' | 'ni' | 'lt' | 'le' | 'gt' | 'ge' | 'co' | 'nc' | 'filled' | 'unfilled' | 'co-some' | 'co-every' | 'some-in' | 'every-in';
39
39
  };
40
40
  export declare type FormItemCopyValue = {
41
41
  assert: FormItemAssert;
@@ -99,6 +99,50 @@ export var testAssert = function testAssert(form, assert) {
99
99
  case 'eq':
100
100
  return v === value;
101
101
 
102
+ case 'co-every':
103
+ {
104
+ if (!Array.isArray(v) || !Array.isArray(value)) {
105
+ return false;
106
+ }
107
+
108
+ return value.every(function (i) {
109
+ return v.includes(i);
110
+ });
111
+ }
112
+
113
+ case 'co-some':
114
+ {
115
+ if (!Array.isArray(v) || !Array.isArray(value)) {
116
+ return false;
117
+ }
118
+
119
+ return value.some(function (i) {
120
+ return v.includes(i);
121
+ });
122
+ }
123
+
124
+ case 'every-in':
125
+ {
126
+ if (!Array.isArray(v) || !Array.isArray(value)) {
127
+ return false;
128
+ }
129
+
130
+ return v.every(function (i) {
131
+ return value.includes(i);
132
+ });
133
+ }
134
+
135
+ case 'some-in':
136
+ {
137
+ if (!Array.isArray(v) || !Array.isArray(value)) {
138
+ return false;
139
+ }
140
+
141
+ return v.some(function (i) {
142
+ return value.includes(i);
143
+ });
144
+ }
145
+
102
146
  default:
103
147
  if (value !== undefined) return v === value;
104
148
  return v !== undefined;
@@ -96,7 +96,7 @@ var Confirmation = function Confirmation(_ref) {
96
96
  return;
97
97
  }
98
98
 
99
- onChange && onChange(!value);
99
+ onChange && onChange(!value || undefined);
100
100
  },
101
101
  style: {
102
102
  cursor: 'pointer',
package/lib/types.d.ts CHANGED
@@ -35,7 +35,7 @@ export interface FormBasicConfig {
35
35
  export declare type FormItemAssert = {
36
36
  field: NamePath;
37
37
  value?: any;
38
- operation?: 'eq' | 'ne' | 'in' | 'ni' | 'lt' | 'le' | 'gt' | 'ge' | 'co' | 'nc' | 'filled' | 'unfilled';
38
+ operation?: 'eq' | 'ne' | 'in' | 'ni' | 'lt' | 'le' | 'gt' | 'ge' | 'co' | 'nc' | 'filled' | 'unfilled' | 'co-some' | 'co-every' | 'some-in' | 'every-in';
39
39
  };
40
40
  export declare type FormItemCopyValue = {
41
41
  assert: FormItemAssert;
@@ -116,6 +116,50 @@ var testAssert = function testAssert(form, assert) {
116
116
  case 'eq':
117
117
  return v === value;
118
118
 
119
+ case 'co-every':
120
+ {
121
+ if (!Array.isArray(v) || !Array.isArray(value)) {
122
+ return false;
123
+ }
124
+
125
+ return value.every(function (i) {
126
+ return v.includes(i);
127
+ });
128
+ }
129
+
130
+ case 'co-some':
131
+ {
132
+ if (!Array.isArray(v) || !Array.isArray(value)) {
133
+ return false;
134
+ }
135
+
136
+ return value.some(function (i) {
137
+ return v.includes(i);
138
+ });
139
+ }
140
+
141
+ case 'every-in':
142
+ {
143
+ if (!Array.isArray(v) || !Array.isArray(value)) {
144
+ return false;
145
+ }
146
+
147
+ return v.every(function (i) {
148
+ return value.includes(i);
149
+ });
150
+ }
151
+
152
+ case 'some-in':
153
+ {
154
+ if (!Array.isArray(v) || !Array.isArray(value)) {
155
+ return false;
156
+ }
157
+
158
+ return v.some(function (i) {
159
+ return value.includes(i);
160
+ });
161
+ }
162
+
119
163
  default:
120
164
  if (value !== undefined) return v === value;
121
165
  return v !== undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "2.5.47",
3
+ "version": "2.5.48",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",