iglooform 3.7.2 → 3.7.4
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/.dumi/tmp/core/defineApp.ts +1 -1
- package/.dumi/tmp/core/helmet.ts +1 -1
- package/.dumi/tmp/core/history.ts +1 -1
- package/.dumi/tmp/core/historyIntelli.ts +1 -1
- package/.dumi/tmp/core/plugin.ts +2 -2
- package/.dumi/tmp/core/polyfill.ts +197 -197
- package/.dumi/tmp/core/route.tsx +33 -33
- package/.dumi/tmp/dumi/exports.ts +1 -1
- package/.dumi/tmp/dumi/locales/runtime.tsx +2 -2
- package/.dumi/tmp/dumi/meta/index.ts +33 -33
- package/.dumi/tmp/dumi/meta/runtime.ts +1 -1
- package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +3 -3
- package/.dumi/tmp/dumi/theme/builtins/API.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Badge.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Container.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Table.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Tree.ts +1 -1
- package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +1 -1
- package/.dumi/tmp/dumi/theme/loading.tsx +1 -1
- package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Content.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/ContentFooter.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Features.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Footer.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Header.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Hero.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Logo.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Navbar.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/NotFound.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +2 -2
- package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Toc.ts +1 -1
- package/.dumi/tmp/exports.ts +5 -5
- package/.dumi/tmp/testBrowser.tsx +3 -3
- package/.dumi/tmp/umi.ts +4 -4
- package/.idea/codeStyles/Project.xml +80 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/iglooformv3.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/es/checkbox/index.js +4 -1
- package/es/date-picker/index.d.ts +13 -0
- package/es/date-picker/index.js +7 -2
- package/es/filter/index.js +2 -1
- package/es/form/element/index.d.ts +12 -0
- package/es/form/element/index.js +1 -1
- package/es/free-form/addable-section/index.js +34 -0
- package/es/select/select.d.ts +19 -0
- package/lib/checkbox/index.js +4 -1
- package/lib/date-picker/index.d.ts +13 -0
- package/lib/date-picker/index.js +6 -1
- package/lib/filter/index.js +2 -1
- package/lib/form/element/index.d.ts +12 -0
- package/lib/form/element/index.js +1 -1
- package/lib/free-form/addable-section/index.js +34 -0
- package/lib/select/select.d.ts +19 -0
- package/package.json +1 -1
- package/es/checkbox/index.d.ts +0 -24
- package/es/utils/option-utils.d.ts +0 -29
- package/lib/checkbox/index.d.ts +0 -24
- package/lib/utils/option-utils.d.ts +0 -29
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
+
<code_scheme name="Project" version="173">
|
|
3
|
+
<HTMLCodeStyleSettings>
|
|
4
|
+
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
+
</HTMLCodeStyleSettings>
|
|
6
|
+
<JSCodeStyleSettings version="0">
|
|
7
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
8
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
9
|
+
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
10
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
+
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
12
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
+
</JSCodeStyleSettings>
|
|
15
|
+
<JetCodeStyleSettings>
|
|
16
|
+
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
|
17
|
+
</JetCodeStyleSettings>
|
|
18
|
+
<TypeScriptCodeStyleSettings version="0">
|
|
19
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
20
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
21
|
+
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
22
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
23
|
+
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
24
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
25
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
26
|
+
</TypeScriptCodeStyleSettings>
|
|
27
|
+
<VueCodeStyleSettings>
|
|
28
|
+
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
29
|
+
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
30
|
+
</VueCodeStyleSettings>
|
|
31
|
+
<codeStyleSettings language="HTML">
|
|
32
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
33
|
+
<indentOptions>
|
|
34
|
+
<option name="INDENT_SIZE" value="2" />
|
|
35
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
36
|
+
<option name="TAB_SIZE" value="2" />
|
|
37
|
+
</indentOptions>
|
|
38
|
+
</codeStyleSettings>
|
|
39
|
+
<codeStyleSettings language="JAVA">
|
|
40
|
+
<indentOptions>
|
|
41
|
+
<option name="INDENT_SIZE" value="2" />
|
|
42
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
43
|
+
<option name="TAB_SIZE" value="2" />
|
|
44
|
+
</indentOptions>
|
|
45
|
+
</codeStyleSettings>
|
|
46
|
+
<codeStyleSettings language="JavaScript">
|
|
47
|
+
<option name="SPACE_BEFORE_METHOD_PARENTHESES" value="true" />
|
|
48
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
49
|
+
<indentOptions>
|
|
50
|
+
<option name="INDENT_SIZE" value="2" />
|
|
51
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
52
|
+
<option name="TAB_SIZE" value="2" />
|
|
53
|
+
</indentOptions>
|
|
54
|
+
</codeStyleSettings>
|
|
55
|
+
<codeStyleSettings language="TypeScript">
|
|
56
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
57
|
+
<indentOptions>
|
|
58
|
+
<option name="INDENT_SIZE" value="2" />
|
|
59
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
60
|
+
<option name="TAB_SIZE" value="2" />
|
|
61
|
+
</indentOptions>
|
|
62
|
+
</codeStyleSettings>
|
|
63
|
+
<codeStyleSettings language="Vue">
|
|
64
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
65
|
+
<indentOptions>
|
|
66
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
67
|
+
</indentOptions>
|
|
68
|
+
</codeStyleSettings>
|
|
69
|
+
<codeStyleSettings language="XML">
|
|
70
|
+
<indentOptions>
|
|
71
|
+
<option name="INDENT_SIZE" value="2" />
|
|
72
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
73
|
+
<option name="TAB_SIZE" value="2" />
|
|
74
|
+
</indentOptions>
|
|
75
|
+
</codeStyleSettings>
|
|
76
|
+
<codeStyleSettings language="kotlin">
|
|
77
|
+
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
|
78
|
+
</codeStyleSettings>
|
|
79
|
+
</code_scheme>
|
|
80
|
+
</component>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
</content>
|
|
9
|
+
<orderEntry type="inheritedJdk" />
|
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
+
</component>
|
|
12
|
+
</module>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/iglooformv3.iml" filepath="$PROJECT_DIR$/.idea/iglooformv3.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
package/.idea/vcs.xml
ADDED
package/es/checkbox/index.js
CHANGED
|
@@ -56,7 +56,10 @@ IglooCheckbox.formItemPropsHandler = function (config) {
|
|
|
56
56
|
getValueFromEvent: function getValueFromEvent(e) {
|
|
57
57
|
return e.target.checked;
|
|
58
58
|
},
|
|
59
|
-
valuePropName: 'checked'
|
|
59
|
+
valuePropName: 'checked',
|
|
60
|
+
previewFormater: function previewFormater(value) {
|
|
61
|
+
return value === null || value === void 0 ? void 0 : value.toString();
|
|
62
|
+
}
|
|
60
63
|
};
|
|
61
64
|
};
|
|
62
65
|
export default IglooCheckbox;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DatePickerProps, RangePickerProps, MonthPickerProps, WeekPickerProps } from 'antd/es/date-picker';
|
|
2
|
+
import { FC, IglooComponentProps } from '../types';
|
|
3
|
+
import { Dayjs } from 'dayjs';
|
|
4
|
+
import './style';
|
|
5
|
+
export { default as IglooBuddhistDatePicker } from './buddhist';
|
|
6
|
+
type Props = Omit<DatePickerProps, 'value'> & IglooComponentProps & {
|
|
7
|
+
value?: Dayjs | null | 0;
|
|
8
|
+
};
|
|
9
|
+
declare const IglooDatePicker: FC<Props>;
|
|
10
|
+
export default IglooDatePicker;
|
|
11
|
+
export declare const IglooRangePicker: FC<RangePickerProps & IglooComponentProps>;
|
|
12
|
+
export declare const IglooWeekPicker: FC<WeekPickerProps & IglooComponentProps>;
|
|
13
|
+
export declare const IglooMonthPicker: FC<MonthPickerProps & IglooComponentProps>;
|
package/es/date-picker/index.js
CHANGED
|
@@ -16,7 +16,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
16
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
17
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
18
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
|
-
import { useState } from 'react';
|
|
19
|
+
import { useMemo, useState } from 'react';
|
|
20
20
|
import { DatePicker } from 'antd';
|
|
21
21
|
import omit from 'omit.js';
|
|
22
22
|
import moment from 'dayjs';
|
|
@@ -83,6 +83,7 @@ IglooDatePicker.formItemPropsHandler = function (_ref2) {
|
|
|
83
83
|
};
|
|
84
84
|
export default IglooDatePicker;
|
|
85
85
|
export var IglooRangePicker = function IglooRangePicker(_ref3) {
|
|
86
|
+
var _value$0$valueOf, _value$, _value$$valueOf, _value$1$valueOf, _value$2, _value$2$valueOf;
|
|
86
87
|
var value = _ref3.value,
|
|
87
88
|
format = _ref3.format,
|
|
88
89
|
_ref3$suffixIcon = _ref3.suffixIcon,
|
|
@@ -98,8 +99,12 @@ export var IglooRangePicker = function IglooRangePicker(_ref3) {
|
|
|
98
99
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
99
100
|
focusStaus = _useState4[0],
|
|
100
101
|
setFocus = _useState4[1];
|
|
102
|
+
var memoizedValue = useMemo(function () {
|
|
103
|
+
if (!value) return value;
|
|
104
|
+
return [moment(value[0]), moment(value[1])];
|
|
105
|
+
}, [(_value$0$valueOf = value === null || value === void 0 ? void 0 : (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : (_value$$valueOf = _value$.valueOf) === null || _value$$valueOf === void 0 ? void 0 : _value$$valueOf.call(_value$)) !== null && _value$0$valueOf !== void 0 ? _value$0$valueOf : value === null || value === void 0 ? void 0 : value[0], (_value$1$valueOf = value === null || value === void 0 ? void 0 : (_value$2 = value[1]) === null || _value$2 === void 0 ? void 0 : (_value$2$valueOf = _value$2.valueOf) === null || _value$2$valueOf === void 0 ? void 0 : _value$2$valueOf.call(_value$2)) !== null && _value$1$valueOf !== void 0 ? _value$1$valueOf : value === null || value === void 0 ? void 0 : value[1]]);
|
|
101
106
|
return /*#__PURE__*/_jsx(RangePicker, _objectSpread(_objectSpread({}, omit(props, formMethods)), {}, {
|
|
102
|
-
value:
|
|
107
|
+
value: memoizedValue,
|
|
103
108
|
format: format || dateFormater,
|
|
104
109
|
inputReadOnly: true,
|
|
105
110
|
suffixIcon: suffixIcon,
|
package/es/filter/index.js
CHANGED
|
@@ -966,10 +966,11 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
966
966
|
overlayClassName: "igloo-form-filter-drop-down-container",
|
|
967
967
|
open: dropVisible,
|
|
968
968
|
onOpenChange: function onOpenChange(visible, info) {
|
|
969
|
-
info.source !== 'menu' && setDropVisible(visible);
|
|
970
969
|
if (visible) {
|
|
971
970
|
typeof beforeOpenFilter === 'function' && beforeOpenFilter(_objectSpread({}, confirmed));
|
|
972
971
|
}
|
|
972
|
+
if ((info === null || info === void 0 ? void 0 : info.source) === 'menu') return;
|
|
973
|
+
setDropVisible(visible);
|
|
973
974
|
setTimeout(function () {
|
|
974
975
|
if (dropVisible) {
|
|
975
976
|
setTimeRangeType(confirmedTimeRange);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FormItemConfig, FormItemName } from '../../types';
|
|
3
|
+
import './style';
|
|
4
|
+
interface ElementProps {
|
|
5
|
+
config: FormItemConfig;
|
|
6
|
+
parentName?: FormItemName;
|
|
7
|
+
preview?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
setShowStepButton?: (showButton: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const Element: FC<ElementProps>;
|
|
12
|
+
export default Element;
|
package/es/form/element/index.js
CHANGED
|
@@ -191,6 +191,23 @@ var AddableSection = function AddableSection(props) {
|
|
|
191
191
|
return calcAddableSectionAssertField(namePath, path, index, children);
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
+
if (_child.copyValue) {
|
|
195
|
+
_child.copyValue = _objectSpread(_objectSpread({}, _child.copyValue), {}, {
|
|
196
|
+
assert: _objectSpread(_objectSpread({}, _child.copyValue.assert), {}, {
|
|
197
|
+
field: calcAddableSectionAssertField(namePath, _child.copyValue.assert.field, index, children)
|
|
198
|
+
}),
|
|
199
|
+
copyFrom: calcAddableSectionAssertField(namePath, _child.copyValue.copyFrom, index, children)
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
if (Array.isArray(_child.selectValue)) {
|
|
203
|
+
_child.selectValue = _child.selectValue.map(function (sv) {
|
|
204
|
+
return _objectSpread(_objectSpread({}, sv), {}, {
|
|
205
|
+
assert: _objectSpread(_objectSpread({}, sv.assert), {}, {
|
|
206
|
+
field: calcAddableSectionAssertField(namePath, sv.assert.field, index, children)
|
|
207
|
+
})
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
}
|
|
194
211
|
if (['Igloo_Free_Form_Item', 'Igloo_Free_Form_Section', 'Igloo_Free_Form_AddableSection'].includes(c === null || c === void 0 ? void 0 : (_c$type = c.type) === null || _c$type === void 0 ? void 0 : _c$type.displayName)) {
|
|
195
212
|
return /*#__PURE__*/cloneElement(c, _objectSpread(_objectSpread({
|
|
196
213
|
key: _index
|
|
@@ -236,6 +253,23 @@ var AddableSection = function AddableSection(props) {
|
|
|
236
253
|
return calcAddableSectionAssertField(namePath, path, index, [children]);
|
|
237
254
|
});
|
|
238
255
|
}
|
|
256
|
+
if (_child.copyValue) {
|
|
257
|
+
_child.copyValue = _objectSpread(_objectSpread({}, _child.copyValue), {}, {
|
|
258
|
+
assert: _objectSpread(_objectSpread({}, _child.copyValue.assert), {}, {
|
|
259
|
+
field: calcAddableSectionAssertField(namePath, _child.copyValue.assert.field, index, [children])
|
|
260
|
+
}),
|
|
261
|
+
copyFrom: calcAddableSectionAssertField(namePath, _child.copyValue.copyFrom, index, [children])
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
if (Array.isArray(_child.selectValue)) {
|
|
265
|
+
_child.selectValue = _child.selectValue.map(function (sv) {
|
|
266
|
+
return _objectSpread(_objectSpread({}, sv), {}, {
|
|
267
|
+
assert: _objectSpread(_objectSpread({}, sv.assert), {}, {
|
|
268
|
+
field: calcAddableSectionAssertField(namePath, sv.assert.field, index, [children])
|
|
269
|
+
})
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
}
|
|
239
273
|
return /*#__PURE__*/cloneElement(children, _objectSpread(_objectSpread({}, _child), {}, {
|
|
240
274
|
// @ts-ignore
|
|
241
275
|
parentName: parentName,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Select } from 'antd';
|
|
2
|
+
import { SelectProps as AntdSelectProps, SelectValue, DefaultOptionType } from 'antd/es/select';
|
|
3
|
+
import { FC, IglooComponentProps } from '../types';
|
|
4
|
+
import './style';
|
|
5
|
+
type FilterOption = (inputValue: string, option?: DefaultOptionType) => boolean;
|
|
6
|
+
interface SelectProps extends Omit<AntdSelectProps<SelectValue>, 'showSearch'> {
|
|
7
|
+
showSearch?: boolean | {
|
|
8
|
+
filterOption: FilterOption;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
type Props = SelectProps & IglooComponentProps;
|
|
12
|
+
type OptionType = typeof Select.Option;
|
|
13
|
+
type OptGroupType = typeof Select.OptGroup;
|
|
14
|
+
interface IglooSelectType extends FC<Props> {
|
|
15
|
+
Option: OptionType;
|
|
16
|
+
OptGroup: OptGroupType;
|
|
17
|
+
}
|
|
18
|
+
declare const IglooSelect: IglooSelectType;
|
|
19
|
+
export default IglooSelect;
|
package/lib/checkbox/index.js
CHANGED
|
@@ -61,7 +61,10 @@ IglooCheckbox.formItemPropsHandler = function (config) {
|
|
|
61
61
|
getValueFromEvent: function getValueFromEvent(e) {
|
|
62
62
|
return e.target.checked;
|
|
63
63
|
},
|
|
64
|
-
valuePropName: 'checked'
|
|
64
|
+
valuePropName: 'checked',
|
|
65
|
+
previewFormater: function previewFormater(value) {
|
|
66
|
+
return value === null || value === void 0 ? void 0 : value.toString();
|
|
67
|
+
}
|
|
65
68
|
};
|
|
66
69
|
};
|
|
67
70
|
var _default = IglooCheckbox;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DatePickerProps, RangePickerProps, MonthPickerProps, WeekPickerProps } from 'antd/es/date-picker';
|
|
2
|
+
import { FC, IglooComponentProps } from '../types';
|
|
3
|
+
import { Dayjs } from 'dayjs';
|
|
4
|
+
import './style';
|
|
5
|
+
export { default as IglooBuddhistDatePicker } from './buddhist';
|
|
6
|
+
type Props = Omit<DatePickerProps, 'value'> & IglooComponentProps & {
|
|
7
|
+
value?: Dayjs | null | 0;
|
|
8
|
+
};
|
|
9
|
+
declare const IglooDatePicker: FC<Props>;
|
|
10
|
+
export default IglooDatePicker;
|
|
11
|
+
export declare const IglooRangePicker: FC<RangePickerProps & IglooComponentProps>;
|
|
12
|
+
export declare const IglooWeekPicker: FC<WeekPickerProps & IglooComponentProps>;
|
|
13
|
+
export declare const IglooMonthPicker: FC<MonthPickerProps & IglooComponentProps>;
|
package/lib/date-picker/index.js
CHANGED
|
@@ -97,6 +97,7 @@ IglooDatePicker.formItemPropsHandler = function (_ref2) {
|
|
|
97
97
|
var _default = IglooDatePicker;
|
|
98
98
|
exports.default = _default;
|
|
99
99
|
var IglooRangePicker = function IglooRangePicker(_ref3) {
|
|
100
|
+
var _value$0$valueOf, _value$, _value$$valueOf, _value$1$valueOf, _value$2, _value$2$valueOf;
|
|
100
101
|
var value = _ref3.value,
|
|
101
102
|
format = _ref3.format,
|
|
102
103
|
_ref3$suffixIcon = _ref3.suffixIcon,
|
|
@@ -112,8 +113,12 @@ var IglooRangePicker = function IglooRangePicker(_ref3) {
|
|
|
112
113
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
113
114
|
focusStaus = _useState4[0],
|
|
114
115
|
setFocus = _useState4[1];
|
|
116
|
+
var memoizedValue = (0, _react.useMemo)(function () {
|
|
117
|
+
if (!value) return value;
|
|
118
|
+
return [(0, _dayjs.default)(value[0]), (0, _dayjs.default)(value[1])];
|
|
119
|
+
}, [(_value$0$valueOf = value === null || value === void 0 ? void 0 : (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : (_value$$valueOf = _value$.valueOf) === null || _value$$valueOf === void 0 ? void 0 : _value$$valueOf.call(_value$)) !== null && _value$0$valueOf !== void 0 ? _value$0$valueOf : value === null || value === void 0 ? void 0 : value[0], (_value$1$valueOf = value === null || value === void 0 ? void 0 : (_value$2 = value[1]) === null || _value$2 === void 0 ? void 0 : (_value$2$valueOf = _value$2.valueOf) === null || _value$2$valueOf === void 0 ? void 0 : _value$2$valueOf.call(_value$2)) !== null && _value$1$valueOf !== void 0 ? _value$1$valueOf : value === null || value === void 0 ? void 0 : value[1]]);
|
|
115
120
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RangePicker, _objectSpread(_objectSpread({}, (0, _omit.default)(props, _formMethods.default)), {}, {
|
|
116
|
-
value:
|
|
121
|
+
value: memoizedValue,
|
|
117
122
|
format: format || dateFormater,
|
|
118
123
|
inputReadOnly: true,
|
|
119
124
|
suffixIcon: suffixIcon,
|
package/lib/filter/index.js
CHANGED
|
@@ -972,10 +972,11 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
972
972
|
overlayClassName: "igloo-form-filter-drop-down-container",
|
|
973
973
|
open: dropVisible,
|
|
974
974
|
onOpenChange: function onOpenChange(visible, info) {
|
|
975
|
-
info.source !== 'menu' && setDropVisible(visible);
|
|
976
975
|
if (visible) {
|
|
977
976
|
typeof beforeOpenFilter === 'function' && beforeOpenFilter(_objectSpread({}, confirmed));
|
|
978
977
|
}
|
|
978
|
+
if ((info === null || info === void 0 ? void 0 : info.source) === 'menu') return;
|
|
979
|
+
setDropVisible(visible);
|
|
979
980
|
setTimeout(function () {
|
|
980
981
|
if (dropVisible) {
|
|
981
982
|
setTimeRangeType(confirmedTimeRange);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FormItemConfig, FormItemName } from '../../types';
|
|
3
|
+
import './style';
|
|
4
|
+
interface ElementProps {
|
|
5
|
+
config: FormItemConfig;
|
|
6
|
+
parentName?: FormItemName;
|
|
7
|
+
preview?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
setShowStepButton?: (showButton: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const Element: FC<ElementProps>;
|
|
12
|
+
export default Element;
|
|
@@ -198,6 +198,23 @@ var AddableSection = function AddableSection(props) {
|
|
|
198
198
|
return (0, _formUtils.calcAddableSectionAssertField)(namePath, path, index, children);
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
|
+
if (_child.copyValue) {
|
|
202
|
+
_child.copyValue = _objectSpread(_objectSpread({}, _child.copyValue), {}, {
|
|
203
|
+
assert: _objectSpread(_objectSpread({}, _child.copyValue.assert), {}, {
|
|
204
|
+
field: (0, _formUtils.calcAddableSectionAssertField)(namePath, _child.copyValue.assert.field, index, children)
|
|
205
|
+
}),
|
|
206
|
+
copyFrom: (0, _formUtils.calcAddableSectionAssertField)(namePath, _child.copyValue.copyFrom, index, children)
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (Array.isArray(_child.selectValue)) {
|
|
210
|
+
_child.selectValue = _child.selectValue.map(function (sv) {
|
|
211
|
+
return _objectSpread(_objectSpread({}, sv), {}, {
|
|
212
|
+
assert: _objectSpread(_objectSpread({}, sv.assert), {}, {
|
|
213
|
+
field: (0, _formUtils.calcAddableSectionAssertField)(namePath, sv.assert.field, index, children)
|
|
214
|
+
})
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
}
|
|
201
218
|
if (['Igloo_Free_Form_Item', 'Igloo_Free_Form_Section', 'Igloo_Free_Form_AddableSection'].includes(c === null || c === void 0 ? void 0 : (_c$type = c.type) === null || _c$type === void 0 ? void 0 : _c$type.displayName)) {
|
|
202
219
|
return /*#__PURE__*/(0, _react.cloneElement)(c, _objectSpread(_objectSpread({
|
|
203
220
|
key: _index
|
|
@@ -243,6 +260,23 @@ var AddableSection = function AddableSection(props) {
|
|
|
243
260
|
return (0, _formUtils.calcAddableSectionAssertField)(namePath, path, index, [children]);
|
|
244
261
|
});
|
|
245
262
|
}
|
|
263
|
+
if (_child.copyValue) {
|
|
264
|
+
_child.copyValue = _objectSpread(_objectSpread({}, _child.copyValue), {}, {
|
|
265
|
+
assert: _objectSpread(_objectSpread({}, _child.copyValue.assert), {}, {
|
|
266
|
+
field: (0, _formUtils.calcAddableSectionAssertField)(namePath, _child.copyValue.assert.field, index, [children])
|
|
267
|
+
}),
|
|
268
|
+
copyFrom: (0, _formUtils.calcAddableSectionAssertField)(namePath, _child.copyValue.copyFrom, index, [children])
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
if (Array.isArray(_child.selectValue)) {
|
|
272
|
+
_child.selectValue = _child.selectValue.map(function (sv) {
|
|
273
|
+
return _objectSpread(_objectSpread({}, sv), {}, {
|
|
274
|
+
assert: _objectSpread(_objectSpread({}, sv.assert), {}, {
|
|
275
|
+
field: (0, _formUtils.calcAddableSectionAssertField)(namePath, sv.assert.field, index, [children])
|
|
276
|
+
})
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
}
|
|
246
280
|
return /*#__PURE__*/(0, _react.cloneElement)(children, _objectSpread(_objectSpread({}, _child), {}, {
|
|
247
281
|
// @ts-ignore
|
|
248
282
|
parentName: parentName,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Select } from 'antd';
|
|
2
|
+
import { SelectProps as AntdSelectProps, SelectValue, DefaultOptionType } from 'antd/es/select';
|
|
3
|
+
import { FC, IglooComponentProps } from '../types';
|
|
4
|
+
import './style';
|
|
5
|
+
type FilterOption = (inputValue: string, option?: DefaultOptionType) => boolean;
|
|
6
|
+
interface SelectProps extends Omit<AntdSelectProps<SelectValue>, 'showSearch'> {
|
|
7
|
+
showSearch?: boolean | {
|
|
8
|
+
filterOption: FilterOption;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
type Props = SelectProps & IglooComponentProps;
|
|
12
|
+
type OptionType = typeof Select.Option;
|
|
13
|
+
type OptGroupType = typeof Select.OptGroup;
|
|
14
|
+
interface IglooSelectType extends FC<Props> {
|
|
15
|
+
Option: OptionType;
|
|
16
|
+
OptGroup: OptGroupType;
|
|
17
|
+
}
|
|
18
|
+
declare const IglooSelect: IglooSelectType;
|
|
19
|
+
export default IglooSelect;
|
package/package.json
CHANGED
package/es/checkbox/index.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CheckboxProps, CheckboxGroupProps } from 'antd/es/checkbox';
|
|
3
|
-
import { FC, IglooComponentProps } from '../types';
|
|
4
|
-
import { ComponentProps } from '../utils/option-utils';
|
|
5
|
-
import { DefaultOptionType } from 'rc-select/lib/Select';
|
|
6
|
-
import './style';
|
|
7
|
-
interface Props extends IglooComponentProps, CheckboxProps {
|
|
8
|
-
}
|
|
9
|
-
export interface Option extends DefaultOptionType {
|
|
10
|
-
extraInfo?: {
|
|
11
|
-
content: any;
|
|
12
|
-
shownTrigger: 'unchecked' | 'checked' | 'all';
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export interface IProps extends IglooComponentProps, Omit<CheckboxGroupProps, 'options'>, ComponentProps {
|
|
16
|
-
className?: string;
|
|
17
|
-
radioType?: string;
|
|
18
|
-
options: Option[];
|
|
19
|
-
preview?: boolean;
|
|
20
|
-
mutuallyExclusions?: Record<string, string[]>;
|
|
21
|
-
}
|
|
22
|
-
declare const IglooCheckbox: FC<Props>;
|
|
23
|
-
export default IglooCheckbox;
|
|
24
|
-
export declare const CheckboxGroup: FC<import("react").PropsWithChildren<import("../utils/option-utils").HOCProps & IProps>>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { FC, IglooComponentProps } from '../types';
|
|
3
|
-
import { FormInstance } from 'antd/es/form';
|
|
4
|
-
import { NamePath } from 'antd/es/form/interface';
|
|
5
|
-
import { SelectProps, SelectValue } from 'antd/es/select';
|
|
6
|
-
export declare const compareOptions: (newOptions: any[], oldOptions?: any[]) => boolean;
|
|
7
|
-
export declare const compareSelected: (newValue: any | any[], oldValue: any | any[]) => boolean;
|
|
8
|
-
type Options = SelectProps<SelectValue>['options'];
|
|
9
|
-
export interface HOCProps extends IglooComponentProps {
|
|
10
|
-
options?: Options;
|
|
11
|
-
onSearch?: any;
|
|
12
|
-
getOptions?: (form: FormInstance) => any[];
|
|
13
|
-
optionGroups?: {
|
|
14
|
-
parentKey: string;
|
|
15
|
-
options: Options;
|
|
16
|
-
}[];
|
|
17
|
-
datasourceFilters?: string[];
|
|
18
|
-
datasourceKey?: string;
|
|
19
|
-
datasourceApi?: string;
|
|
20
|
-
dependField?: NamePath;
|
|
21
|
-
passCompareOptions?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface ComponentProps extends IglooComponentProps {
|
|
24
|
-
options?: Options;
|
|
25
|
-
clearWhenOptionsUpdated?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export declare function optionsHOC<T>(Component: FC<T>): FC<PropsWithChildren<HOCProps & T>>;
|
|
28
|
-
export declare function previewSelectedOptions(options: Options, value: any): any;
|
|
29
|
-
export {};
|
package/lib/checkbox/index.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CheckboxProps, CheckboxGroupProps } from 'antd/es/checkbox';
|
|
3
|
-
import { FC, IglooComponentProps } from '../types';
|
|
4
|
-
import { ComponentProps } from '../utils/option-utils';
|
|
5
|
-
import { DefaultOptionType } from 'rc-select/lib/Select';
|
|
6
|
-
import './style';
|
|
7
|
-
interface Props extends IglooComponentProps, CheckboxProps {
|
|
8
|
-
}
|
|
9
|
-
export interface Option extends DefaultOptionType {
|
|
10
|
-
extraInfo?: {
|
|
11
|
-
content: any;
|
|
12
|
-
shownTrigger: 'unchecked' | 'checked' | 'all';
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export interface IProps extends IglooComponentProps, Omit<CheckboxGroupProps, 'options'>, ComponentProps {
|
|
16
|
-
className?: string;
|
|
17
|
-
radioType?: string;
|
|
18
|
-
options: Option[];
|
|
19
|
-
preview?: boolean;
|
|
20
|
-
mutuallyExclusions?: Record<string, string[]>;
|
|
21
|
-
}
|
|
22
|
-
declare const IglooCheckbox: FC<Props>;
|
|
23
|
-
export default IglooCheckbox;
|
|
24
|
-
export declare const CheckboxGroup: FC<import("react").PropsWithChildren<import("../utils/option-utils").HOCProps & IProps>>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { FC, IglooComponentProps } from '../types';
|
|
3
|
-
import { FormInstance } from 'antd/es/form';
|
|
4
|
-
import { NamePath } from 'antd/es/form/interface';
|
|
5
|
-
import { SelectProps, SelectValue } from 'antd/es/select';
|
|
6
|
-
export declare const compareOptions: (newOptions: any[], oldOptions?: any[]) => boolean;
|
|
7
|
-
export declare const compareSelected: (newValue: any | any[], oldValue: any | any[]) => boolean;
|
|
8
|
-
type Options = SelectProps<SelectValue>['options'];
|
|
9
|
-
export interface HOCProps extends IglooComponentProps {
|
|
10
|
-
options?: Options;
|
|
11
|
-
onSearch?: any;
|
|
12
|
-
getOptions?: (form: FormInstance) => any[];
|
|
13
|
-
optionGroups?: {
|
|
14
|
-
parentKey: string;
|
|
15
|
-
options: Options;
|
|
16
|
-
}[];
|
|
17
|
-
datasourceFilters?: string[];
|
|
18
|
-
datasourceKey?: string;
|
|
19
|
-
datasourceApi?: string;
|
|
20
|
-
dependField?: NamePath;
|
|
21
|
-
passCompareOptions?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface ComponentProps extends IglooComponentProps {
|
|
24
|
-
options?: Options;
|
|
25
|
-
clearWhenOptionsUpdated?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export declare function optionsHOC<T>(Component: FC<T>): FC<PropsWithChildren<HOCProps & T>>;
|
|
28
|
-
export declare function previewSelectedOptions(options: Options, value: any): any;
|
|
29
|
-
export {};
|