iglooform 2.4.7 → 2.4.11
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/es/admin-upload/float.js +25 -35
- package/es/admin-upload/index.d.ts +2 -0
- package/es/admin-upload/index.js +43 -36
- package/es/admin-upload/job-list.js +85 -115
- package/es/admin-upload/modal.js +19 -26
- package/es/alert-message/index.js +11 -9
- package/es/amount/index.js +10 -5
- package/es/back-top/index.js +14 -10
- package/es/button/index.js +23 -28
- package/es/button/style/index.less +23 -19
- package/es/card-detail/card-group.js +16 -22
- package/es/card-detail/card-item.js +16 -21
- package/es/card-detail/card-page.js +11 -15
- package/es/card-detail/card.js +24 -24
- package/es/card-detail/style/index.less +13 -0
- package/es/card-detail/utils.js +6 -7
- package/es/checkbox/index.js +23 -22
- package/es/claim-list/index.js +53 -70
- package/es/confirmation/index.js +7 -9
- package/es/date-picker/buddhist.js +3 -3
- package/es/date-picker/index.js +10 -4
- package/es/declaration/index.js +16 -13
- package/es/detail-panel/index.js +67 -83
- package/es/documents/index.js +6 -8
- package/es/example/index.js +9 -11
- package/es/filter/checkBox.js +33 -45
- package/es/filter/customize.js +3 -4
- package/es/filter/index.d.ts +1 -0
- package/es/filter/index.js +88 -112
- package/es/filter/radioBox.js +23 -31
- package/es/filter/rangePicker.js +43 -59
- package/es/form/addable-section/index.d.ts +19 -0
- package/es/form/addable-section/index.js +211 -0
- package/es/form/addable-section/style/index.d.ts +1 -0
- package/es/form/addable-section/style/index.js +1 -0
- package/es/form/addable-section/style/index.less +22 -0
- package/es/form/divider/index.js +7 -1
- package/es/form/element/index.js +58 -47
- package/es/form/element/style/index.less +9 -0
- package/es/form/index.js +16 -17
- package/es/form/login/index.js +15 -20
- package/es/form/page/index.js +18 -24
- package/es/form/page/style/index.less +1 -1
- package/es/form/pages/index.js +23 -32
- package/es/form/pages/style/index.less +3 -1
- package/es/form/render/index.js +1 -1
- package/es/form/section/index.js +14 -17
- package/es/form/step/index.js +31 -42
- package/es/form/steps/index.js +8 -11
- package/es/{form/context.d.ts → form-context.d.ts} +1 -0
- package/es/{form/context.js → form-context.js} +0 -0
- package/es/free-form/addable-section/index.d.ts +18 -0
- package/es/free-form/addable-section/index.js +286 -0
- package/es/free-form/addable-section/style/index.d.ts +1 -0
- package/es/free-form/addable-section/style/index.js +1 -0
- package/es/free-form/addable-section/style/index.less +22 -0
- package/es/free-form/element/index.js +43 -41
- package/es/free-form/element/style/index.less +12 -2
- package/es/free-form/index.d.ts +5 -1
- package/es/free-form/index.js +17 -17
- package/es/free-form/page/index.js +36 -46
- package/es/free-form/page/style/index.less +3 -1
- package/es/free-form/pages/index.js +8 -10
- package/es/free-form/section/index.js +20 -22
- package/es/free-form/section/style/index.less +4 -0
- package/es/free-form/step/index.js +37 -47
- package/es/free-form/steps/index.js +8 -10
- package/es/global-message/index.js +1 -1
- package/es/home-menu/index.js +52 -71
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/input/amount.js +10 -5
- package/es/input/credit-card.js +7 -1
- package/es/input/email.js +8 -1
- package/es/input/expiry-date.js +14 -18
- package/es/input/input-date.js +12 -16
- package/es/input/input-number.js +9 -2
- package/es/input/input.js +9 -2
- package/es/input/otp.js +17 -15
- package/es/input/password.js +12 -6
- package/es/input/phone-number.js +6 -8
- package/es/input/style/index.less +9 -1
- package/es/input/text-area.js +14 -10
- package/es/layout/defaultFooter.js +60 -82
- package/es/layout/defaultHeader.js +11 -15
- package/es/layout/footer.js +108 -148
- package/es/layout/header.js +51 -60
- package/es/layout/index.js +16 -12
- package/es/locale/en-US/messages.json +2 -0
- package/es/locale/id-ID/messages.json +2 -0
- package/es/locale/locale-provider.js +8 -10
- package/es/locale/th-TH/messages.json +2 -0
- package/es/locale/vi-VN/messages.json +2 -0
- package/es/locale/zh-CN/messages.json +2 -0
- package/es/login-page/index.js +30 -42
- package/es/media/index.js +20 -27
- package/es/media/media.js +9 -12
- package/es/media/preview.js +8 -10
- package/es/mobile-insurer-detail/index.js +74 -91
- package/es/mobile-insurer-list/index.js +34 -38
- package/es/modal/index.d.ts +4 -3
- package/es/modal/index.js +25 -27
- package/es/modal/style/index.less +24 -5
- package/es/platform/platform-card/index.js +9 -12
- package/es/platform/switch-platform/index.js +24 -32
- package/es/policy-list/index.js +11 -14
- package/es/policy-list/policy-card.js +119 -153
- package/es/radio/index.js +33 -35
- package/es/select/attached-select.js +31 -34
- package/es/select/select.js +12 -8
- package/es/select/style/index.less +1 -1
- package/es/select/time-select.js +12 -16
- package/es/status-box/index.js +8 -10
- package/es/table/index.js +72 -96
- package/es/tabs/index.js +7 -1
- package/es/types.d.ts +4 -2
- package/es/typography/index.js +6 -8
- package/es/upload/index.d.ts +2 -1
- package/es/upload/index.js +169 -143
- package/es/upload-photo/index.d.ts +2 -1
- package/es/upload-photo/index.js +170 -142
- package/es/upload-photo/media.js +3 -4
- package/es/upload-preview/index.js +9 -12
- package/es/upload-preview/media.js +12 -16
- package/es/upload-preview/style/index.less +2 -2
- package/es/utils/form-utils.js +49 -36
- package/lib/admin-upload/float.js +25 -35
- package/lib/admin-upload/index.d.ts +2 -0
- package/lib/admin-upload/index.js +43 -36
- package/lib/admin-upload/job-list.js +85 -115
- package/lib/admin-upload/modal.js +19 -26
- package/lib/alert-message/index.js +11 -9
- package/lib/amount/index.js +10 -5
- package/lib/back-top/index.js +14 -10
- package/lib/button/index.js +24 -29
- package/lib/button/style/index.less +23 -19
- package/lib/card-detail/card-group.js +16 -22
- package/lib/card-detail/card-item.js +16 -21
- package/lib/card-detail/card-page.js +11 -15
- package/lib/card-detail/card.js +24 -24
- package/lib/card-detail/index.js +6 -6
- package/lib/card-detail/style/index.less +13 -0
- package/lib/card-detail/utils.js +7 -8
- package/lib/checkbox/index.js +24 -23
- package/lib/claim-list/index.js +53 -70
- package/lib/confirmation/index.js +7 -9
- package/lib/date-picker/buddhist.js +3 -3
- package/lib/date-picker/index.js +11 -5
- package/lib/declaration/index.js +16 -13
- package/lib/detail-panel/index.js +67 -83
- package/lib/documents/index.js +6 -8
- package/lib/example/index.js +10 -12
- package/lib/filter/checkBox.js +33 -45
- package/lib/filter/customize.js +3 -4
- package/lib/filter/index.d.ts +1 -0
- package/lib/filter/index.js +88 -112
- package/lib/filter/radioBox.js +23 -31
- package/lib/filter/rangePicker.js +43 -59
- package/lib/form/addable-section/index.d.ts +19 -0
- package/lib/form/addable-section/index.js +232 -0
- package/lib/form/addable-section/style/index.d.ts +1 -0
- package/lib/form/addable-section/style/index.js +3 -0
- package/lib/form/addable-section/style/index.less +22 -0
- package/lib/form/divider/index.js +7 -1
- package/lib/form/element/index.js +60 -48
- package/lib/form/element/style/index.less +9 -0
- package/lib/form/elements.js +1 -1
- package/lib/form/index.js +16 -17
- package/lib/form/login/index.js +16 -21
- package/lib/form/page/index.js +19 -25
- package/lib/form/page/style/index.less +1 -1
- package/lib/form/pages/index.js +24 -33
- package/lib/form/pages/style/index.less +3 -1
- package/lib/form/render/index.js +2 -2
- package/lib/form/section/index.js +15 -18
- package/lib/form/step/index.js +32 -43
- package/lib/form/steps/index.js +9 -12
- package/lib/{form/context.d.ts → form-context.d.ts} +1 -0
- package/lib/{form/context.js → form-context.js} +0 -0
- package/lib/free-form/addable-section/index.d.ts +18 -0
- package/lib/free-form/addable-section/index.js +306 -0
- package/lib/free-form/addable-section/style/index.d.ts +1 -0
- package/lib/free-form/addable-section/style/index.js +3 -0
- package/lib/free-form/addable-section/style/index.less +22 -0
- package/lib/free-form/element/index.js +44 -42
- package/lib/free-form/element/style/index.less +12 -2
- package/lib/free-form/index.d.ts +5 -1
- package/lib/free-form/index.js +17 -17
- package/lib/free-form/page/index.js +37 -47
- package/lib/free-form/page/style/index.less +3 -1
- package/lib/free-form/pages/index.js +8 -10
- package/lib/free-form/section/index.js +21 -23
- package/lib/free-form/section/style/index.less +4 -0
- package/lib/free-form/step/index.js +38 -48
- package/lib/free-form/steps/index.js +9 -11
- package/lib/global-message/index.js +1 -1
- package/lib/home-menu/index.js +52 -71
- package/lib/index.d.ts +1 -0
- package/lib/index.js +141 -132
- package/lib/input/amount.js +10 -5
- package/lib/input/credit-card.js +7 -1
- package/lib/input/email.js +7 -1
- package/lib/input/expiry-date.js +14 -18
- package/lib/input/index.js +18 -18
- package/lib/input/input-date.js +12 -16
- package/lib/input/input-number.js +8 -2
- package/lib/input/input.js +8 -2
- package/lib/input/otp.js +17 -15
- package/lib/input/password.js +11 -6
- package/lib/input/phone-number.js +6 -8
- package/lib/input/style/index.less +9 -1
- package/lib/input/text-area.js +14 -10
- package/lib/layout/defaultFooter.js +60 -82
- package/lib/layout/defaultHeader.js +11 -15
- package/lib/layout/footer.js +108 -148
- package/lib/layout/header.js +51 -60
- package/lib/layout/index.js +15 -12
- package/lib/locale/en-US/messages.json +2 -0
- package/lib/locale/format-message.js +1 -1
- package/lib/locale/id-ID/messages.json +2 -0
- package/lib/locale/index.js +4 -4
- package/lib/locale/locale-provider.js +9 -11
- package/lib/locale/th-TH/messages.json +2 -0
- package/lib/locale/vi-VN/messages.json +2 -0
- package/lib/locale/zh-CN/messages.json +2 -0
- package/lib/login-page/index.js +30 -42
- package/lib/media/index.js +20 -27
- package/lib/media/media.js +9 -12
- package/lib/media/preview.js +8 -10
- package/lib/mobile-insurer-detail/index.js +74 -91
- package/lib/mobile-insurer-list/index.js +34 -38
- package/lib/modal/index.d.ts +4 -3
- package/lib/modal/index.js +25 -27
- package/lib/modal/style/index.less +24 -5
- package/lib/platform/platform-card/index.js +9 -12
- package/lib/platform/switch-platform/index.js +24 -32
- package/lib/policy-list/index.js +11 -14
- package/lib/policy-list/policy-card.js +119 -153
- package/lib/radio/index.js +33 -35
- package/lib/select/attached-select.js +32 -35
- package/lib/select/select.js +13 -9
- package/lib/select/style/index.less +1 -1
- package/lib/select/time-select.js +12 -16
- package/lib/status-box/index.js +8 -10
- package/lib/table/index.js +72 -96
- package/lib/tabs/index.js +8 -2
- package/lib/types.d.ts +4 -2
- package/lib/typography/index.js +6 -8
- package/lib/upload/index.d.ts +2 -1
- package/lib/upload/index.js +170 -143
- package/lib/upload-photo/index.d.ts +2 -1
- package/lib/upload-photo/index.js +171 -142
- package/lib/upload-photo/media.js +3 -4
- package/lib/upload-preview/index.js +9 -12
- package/lib/upload-preview/media.js +12 -16
- package/lib/upload-preview/style/index.less +2 -2
- package/lib/utils/form-utils.js +49 -37
- package/package.json +1 -1
- package/es/free-form/context.d.ts +0 -19
- package/es/free-form/context.js +0 -7
- package/lib/free-form/context.d.ts +0 -19
- package/lib/free-form/context.js +0 -19
package/lib/example/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -31,9 +31,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
31
31
|
|
|
32
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
33
|
|
|
34
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
34
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
35
35
|
|
|
36
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
36
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
37
37
|
|
|
38
38
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
39
39
|
|
|
@@ -100,9 +100,8 @@ var Excample = function Excample(_ref) {
|
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
return (0, _jsxRuntime.jsxs)(_locale.LocaleProvider,
|
|
104
|
-
currentLang: currentLang
|
|
105
|
-
}, {
|
|
103
|
+
return (0, _jsxRuntime.jsxs)(_locale.LocaleProvider, {
|
|
104
|
+
currentLang: currentLang,
|
|
106
105
|
children: [(0, _jsxRuntime.jsx)(_button.default, {
|
|
107
106
|
onClick: function onClick() {
|
|
108
107
|
setKey(key + 1);
|
|
@@ -124,17 +123,16 @@ var Excample = function Excample(_ref) {
|
|
|
124
123
|
onChange: function onChange(e) {
|
|
125
124
|
return setLang(e);
|
|
126
125
|
}
|
|
127
|
-
}, void 0), (
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}, key), result && (0, _jsxRuntime.jsx)(_reactJsonView.default, {
|
|
126
|
+
}, void 0), /*#__PURE__*/_react.default.cloneElement(children, _objectSpread(_objectSpread({}, rest), {}, {
|
|
127
|
+
onSubmit: handleSubmit,
|
|
128
|
+
key: key
|
|
129
|
+
})), result && (0, _jsxRuntime.jsx)(_reactJsonView.default, {
|
|
132
130
|
src: result,
|
|
133
131
|
displayDataTypes: false,
|
|
134
132
|
name: false,
|
|
135
133
|
displayObjectSize: false
|
|
136
134
|
}, void 0)]
|
|
137
|
-
}
|
|
135
|
+
}, void 0);
|
|
138
136
|
};
|
|
139
137
|
|
|
140
138
|
var _default = Excample;
|
package/lib/filter/checkBox.js
CHANGED
|
@@ -92,17 +92,14 @@ var CratetCheckBoxFilter = function CratetCheckBoxFilter(props) {
|
|
|
92
92
|
setAllChoose(false);
|
|
93
93
|
}
|
|
94
94
|
}, [chooseed.length, allCanChoose]);
|
|
95
|
-
return (0, _jsxRuntime.jsxs)("div",
|
|
96
|
-
className: "igloo-form-filter-drop-down-container-content-group"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
children: [(0, _jsxRuntime.jsx)(_typography.default, Object.assign({
|
|
102
|
-
level: "h4"
|
|
103
|
-
}, {
|
|
95
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
96
|
+
className: "igloo-form-filter-drop-down-container-content-group",
|
|
97
|
+
children: [(0, _jsxRuntime.jsxs)("div", {
|
|
98
|
+
className: "igloo-form-filter-drop-down-container-content-group-title",
|
|
99
|
+
children: [(0, _jsxRuntime.jsx)(_typography.default, {
|
|
100
|
+
level: "h4",
|
|
104
101
|
children: title
|
|
105
|
-
}
|
|
102
|
+
}, void 0), allChoose ? (0, _jsxRuntime.jsx)("span", {
|
|
106
103
|
className: "igloo-form-filter-drop-down-container-content-group-title-action",
|
|
107
104
|
onClick: function onClick() {
|
|
108
105
|
valueConfirm({
|
|
@@ -110,16 +107,14 @@ var CratetCheckBoxFilter = function CratetCheckBoxFilter(props) {
|
|
|
110
107
|
value: []
|
|
111
108
|
});
|
|
112
109
|
setAllChoose(false);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
level: "h4"
|
|
117
|
-
}, {
|
|
110
|
+
},
|
|
111
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
112
|
+
level: "h4",
|
|
118
113
|
children: formatMessage({
|
|
119
114
|
id: 'Unselect All'
|
|
120
115
|
})
|
|
121
|
-
}
|
|
122
|
-
}
|
|
116
|
+
}, void 0)
|
|
117
|
+
}, void 0) : (0, _jsxRuntime.jsx)("span", {
|
|
123
118
|
className: "igloo-form-filter-drop-down-container-content-group-title-action",
|
|
124
119
|
onClick: function onClick() {
|
|
125
120
|
valueConfirm({
|
|
@@ -127,17 +122,15 @@ var CratetCheckBoxFilter = function CratetCheckBoxFilter(props) {
|
|
|
127
122
|
value: allCanChoose
|
|
128
123
|
});
|
|
129
124
|
setAllChoose(true);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
level: "h4"
|
|
134
|
-
}, {
|
|
125
|
+
},
|
|
126
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
127
|
+
level: "h4",
|
|
135
128
|
children: formatMessage({
|
|
136
129
|
id: 'Select All'
|
|
137
130
|
})
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
131
|
+
}, void 0)
|
|
132
|
+
}, void 0)]
|
|
133
|
+
}, void 0), (0, _jsxRuntime.jsx)(_checkbox.default.Group, {
|
|
141
134
|
value: handleFilterDisable(chooseed, disabled),
|
|
142
135
|
style: {
|
|
143
136
|
width: '100%'
|
|
@@ -147,34 +140,29 @@ var CratetCheckBoxFilter = function CratetCheckBoxFilter(props) {
|
|
|
147
140
|
type: optionKey,
|
|
148
141
|
value: e
|
|
149
142
|
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
gutter: [24, 16]
|
|
154
|
-
}, {
|
|
143
|
+
},
|
|
144
|
+
children: (0, _jsxRuntime.jsx)(_row.default, {
|
|
145
|
+
gutter: [24, 16],
|
|
155
146
|
children: configList.map(function (item) {
|
|
156
|
-
return (0, _jsxRuntime.jsx)(_col.default,
|
|
157
|
-
span: item.span || 8
|
|
158
|
-
|
|
159
|
-
children: (0, _jsxRuntime.jsx)(_checkbox.default, Object.assign({
|
|
147
|
+
return (0, _jsxRuntime.jsx)(_col.default, {
|
|
148
|
+
span: item.span || 8,
|
|
149
|
+
children: (0, _jsxRuntime.jsx)(_checkbox.default, {
|
|
160
150
|
value: item.value,
|
|
161
|
-
disabled: disabled === null || disabled === void 0 ? void 0 : disabled.includes(item.value)
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
level: "body1"
|
|
165
|
-
}, {
|
|
151
|
+
disabled: disabled === null || disabled === void 0 ? void 0 : disabled.includes(item.value),
|
|
152
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
153
|
+
level: "body1",
|
|
166
154
|
children: item.label
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
155
|
+
}, void 0)
|
|
156
|
+
}, void 0)
|
|
157
|
+
}, item.value);
|
|
170
158
|
})
|
|
171
|
-
}
|
|
172
|
-
}
|
|
159
|
+
}, void 0)
|
|
160
|
+
}, String(timeKey.valueOf())), (0, _jsxRuntime.jsx)(_divider.default, {
|
|
173
161
|
style: {
|
|
174
162
|
margin: '16px 0px'
|
|
175
163
|
}
|
|
176
164
|
}, void 0)]
|
|
177
|
-
}
|
|
165
|
+
}, optionKey);
|
|
178
166
|
};
|
|
179
167
|
|
|
180
168
|
var _default = CratetCheckBoxFilter;
|
package/lib/filter/customize.js
CHANGED
|
@@ -18,15 +18,14 @@ var CustomizeFilter = function CustomizeFilter(props) {
|
|
|
18
18
|
value = props.value,
|
|
19
19
|
onChange = props.onChange,
|
|
20
20
|
render = props.render;
|
|
21
|
-
return (0, _jsxRuntime.jsxs)("div",
|
|
22
|
-
className: "igloo-form-filter-drop-down-container-content-group"
|
|
23
|
-
}, {
|
|
21
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
22
|
+
className: "igloo-form-filter-drop-down-container-content-group",
|
|
24
23
|
children: [render(value, onChange), (0, _jsxRuntime.jsx)(_divider.default, {
|
|
25
24
|
style: {
|
|
26
25
|
margin: '16px 0px'
|
|
27
26
|
}
|
|
28
27
|
}, void 0)]
|
|
29
|
-
}
|
|
28
|
+
}, optionKey);
|
|
30
29
|
};
|
|
31
30
|
|
|
32
31
|
var _default = CustomizeFilter;
|
package/lib/filter/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export interface IFilterProps {
|
|
|
43
43
|
deleteAllTagsType?: 'closeAllCanDelete' | 'restFilters';
|
|
44
44
|
searchInputDefault?: string | number;
|
|
45
45
|
searchWithFilter?: boolean;
|
|
46
|
+
inputOnly?: boolean;
|
|
46
47
|
}
|
|
47
48
|
declare const FilterComponent: (props: IFilterProps) => JSX.Element;
|
|
48
49
|
export default FilterComponent;
|
package/lib/filter/index.js
CHANGED
|
@@ -79,13 +79,13 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
79
79
|
|
|
80
80
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
81
81
|
|
|
82
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
82
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
83
83
|
|
|
84
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
84
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
85
85
|
|
|
86
86
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
87
87
|
|
|
88
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
88
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
89
89
|
|
|
90
90
|
var defaultFormat = 'DD / MM / YYYY';
|
|
91
91
|
|
|
@@ -388,7 +388,8 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
388
388
|
_props$searchWithFilt = props.searchWithFilter,
|
|
389
389
|
searchWithFilter = _props$searchWithFilt === void 0 ? false : _props$searchWithFilt,
|
|
390
390
|
searchInputDefault = props.searchInputDefault,
|
|
391
|
-
initValue = props.initValue
|
|
391
|
+
initValue = props.initValue,
|
|
392
|
+
inputOnly = props.inputOnly;
|
|
392
393
|
var filterTitle = props.filterTitle,
|
|
393
394
|
_props$filterItems = props.filterItems,
|
|
394
395
|
filterItems = _props$filterItems === void 0 ? [] : _props$filterItems; // id controller
|
|
@@ -543,11 +544,14 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
543
544
|
}, [JSON.stringify(filterItems)]); // 设置tag框 高度改变动效
|
|
544
545
|
|
|
545
546
|
(0, _react.useLayoutEffect)(function () {
|
|
546
|
-
setTimeout(function () {
|
|
547
|
+
var timer = setTimeout(function () {
|
|
547
548
|
var _heightRef$current;
|
|
548
549
|
|
|
549
550
|
setOpenTagHeight((_heightRef$current = heightRef.current) === null || _heightRef$current === void 0 ? void 0 : _heightRef$current.offsetHeight);
|
|
550
551
|
}, 0);
|
|
552
|
+
return function () {
|
|
553
|
+
return clearTimeout(timer);
|
|
554
|
+
};
|
|
551
555
|
}, [inputExtend, JSON.stringify(confirmed)]); // 针对删除了所有可删除的filter tags情况,自动聚焦到seatch Input
|
|
552
556
|
|
|
553
557
|
(0, _react.useLayoutEffect)(function () {
|
|
@@ -637,20 +641,18 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
637
641
|
}, [inputExtend]);
|
|
638
642
|
var menu = (0, _jsxRuntime.jsx)(_menu.default, {
|
|
639
643
|
children: (0, _jsxRuntime.jsxs)(_menu.default.Item, {
|
|
640
|
-
children: [(0, _jsxRuntime.jsxs)("div",
|
|
641
|
-
className: "igloo-form-filter-drop-down-container-content"
|
|
642
|
-
}, {
|
|
644
|
+
children: [(0, _jsxRuntime.jsxs)("div", {
|
|
645
|
+
className: "igloo-form-filter-drop-down-container-content",
|
|
643
646
|
children: [(0, _jsxRuntime.jsxs)(_space.default, {
|
|
644
647
|
children: [(0, _jsxRuntime.jsx)(_iglooicon.FilterOutlined, {
|
|
645
648
|
style: {
|
|
646
649
|
fontSize: '24px',
|
|
647
650
|
color: '#666666'
|
|
648
651
|
}
|
|
649
|
-
}, void 0), (0, _jsxRuntime.jsx)(_typography.default,
|
|
650
|
-
level: "h4"
|
|
651
|
-
}, {
|
|
652
|
+
}, void 0), (0, _jsxRuntime.jsx)(_typography.default, {
|
|
653
|
+
level: "h4",
|
|
652
654
|
children: filterTitle
|
|
653
|
-
}
|
|
655
|
+
}, void 0)]
|
|
654
656
|
}, void 0), (0, _jsxRuntime.jsx)(_divider.default, {
|
|
655
657
|
style: {
|
|
656
658
|
margin: '16px 0px'
|
|
@@ -729,13 +731,12 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
729
731
|
}, key);
|
|
730
732
|
}
|
|
731
733
|
})]
|
|
732
|
-
}
|
|
734
|
+
}, void 0), (0, _jsxRuntime.jsxs)("div", {
|
|
733
735
|
className: "igloo-form-filter-drop-down-footer",
|
|
734
736
|
onClick: function onClick(e) {
|
|
735
737
|
return e.stopPropagation();
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
children: [(0, _jsxRuntime.jsx)("span", Object.assign({
|
|
738
|
+
},
|
|
739
|
+
children: [(0, _jsxRuntime.jsx)("span", {
|
|
739
740
|
onClick: function onClick() {
|
|
740
741
|
setTimeout(function () {
|
|
741
742
|
setTimeRangeType(-1);
|
|
@@ -744,19 +745,16 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
744
745
|
value: _objectSpread({}, defaultOptions)
|
|
745
746
|
});
|
|
746
747
|
}, 10);
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
level: "h4"
|
|
751
|
-
}, {
|
|
748
|
+
},
|
|
749
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
750
|
+
level: "h4",
|
|
752
751
|
children: formatMessage({
|
|
753
752
|
id: 'Reset All Filters'
|
|
754
753
|
})
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
size: 16
|
|
758
|
-
|
|
759
|
-
children: [(0, _jsxRuntime.jsx)("span", Object.assign({
|
|
754
|
+
}, void 0)
|
|
755
|
+
}, void 0), (0, _jsxRuntime.jsxs)(_space.default, {
|
|
756
|
+
size: 16,
|
|
757
|
+
children: [(0, _jsxRuntime.jsx)("span", {
|
|
760
758
|
onClick: function onClick() {
|
|
761
759
|
setDropVisible(false);
|
|
762
760
|
dispatchOptionsChange({
|
|
@@ -764,16 +762,14 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
764
762
|
value: confirmed
|
|
765
763
|
});
|
|
766
764
|
setTimeRangeType(confirmedTimeRange);
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
level: "h4"
|
|
771
|
-
}, {
|
|
765
|
+
},
|
|
766
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
767
|
+
level: "h4",
|
|
772
768
|
children: formatMessage({
|
|
773
769
|
id: 'Cancel'
|
|
774
770
|
})
|
|
775
|
-
}
|
|
776
|
-
}
|
|
771
|
+
}, void 0)
|
|
772
|
+
}, void 0), (0, _jsxRuntime.jsx)(_button.default, {
|
|
777
773
|
onClick: function onClick() {
|
|
778
774
|
setDropVisible(false);
|
|
779
775
|
setShowSearchInputDefault(false);
|
|
@@ -791,26 +787,23 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
791
787
|
} else {
|
|
792
788
|
setHighLightFilter(false);
|
|
793
789
|
}
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
children: (0, _jsxRuntime.jsx)(_typography.default, Object.assign({
|
|
790
|
+
},
|
|
791
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
797
792
|
level: "h4",
|
|
798
793
|
style: {
|
|
799
794
|
padding: '0px 35px'
|
|
800
|
-
}
|
|
801
|
-
}, {
|
|
795
|
+
},
|
|
802
796
|
children: formatMessage({
|
|
803
797
|
id: 'Apply'
|
|
804
798
|
})
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
}
|
|
799
|
+
}, void 0)
|
|
800
|
+
}, void 0)]
|
|
801
|
+
}, void 0)]
|
|
802
|
+
}, void 0)]
|
|
809
803
|
}, 1)
|
|
810
804
|
}, void 0);
|
|
811
|
-
return (0, _jsxRuntime.jsxs)("div",
|
|
812
|
-
className: "".concat(showIdSelect ? 'igloo-form-filter-with-select' : 'igloo-form-filter')
|
|
813
|
-
}, {
|
|
805
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
806
|
+
className: "".concat(showIdSelect ? 'igloo-form-filter-with-select' : 'igloo-form-filter'),
|
|
814
807
|
children: [(0, _jsxRuntime.jsx)(_input.default, {
|
|
815
808
|
ref: invisibleRef,
|
|
816
809
|
style: {
|
|
@@ -819,7 +812,7 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
819
812
|
padding: '0px',
|
|
820
813
|
border: '0px'
|
|
821
814
|
}
|
|
822
|
-
}, void 0), showIdSelect && idKeyTypes.length !== 0 && (0, _jsxRuntime.jsx)(_select.default,
|
|
815
|
+
}, void 0), showIdSelect && idKeyTypes.length !== 0 && (0, _jsxRuntime.jsx)(_select.default, {
|
|
823
816
|
className: "igloo-form-filter-id-select",
|
|
824
817
|
onChange: function onChange(e) {
|
|
825
818
|
return setIdName(String(e));
|
|
@@ -829,23 +822,19 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
829
822
|
style: {
|
|
830
823
|
fontSize: 24
|
|
831
824
|
}
|
|
832
|
-
}, void 0)
|
|
833
|
-
}, {
|
|
825
|
+
}, void 0),
|
|
834
826
|
children: idKeyTypes.map(function (item) {
|
|
835
|
-
return (0, _jsxRuntime.jsx)(Option,
|
|
836
|
-
value: item.value
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
level: "body1"
|
|
840
|
-
}, {
|
|
827
|
+
return (0, _jsxRuntime.jsx)(Option, {
|
|
828
|
+
value: item.value,
|
|
829
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
830
|
+
level: "body1",
|
|
841
831
|
children: item.label
|
|
842
|
-
}
|
|
843
|
-
}
|
|
832
|
+
}, void 0)
|
|
833
|
+
}, item.value);
|
|
844
834
|
})
|
|
845
|
-
}
|
|
846
|
-
className: "igloo-filter-tag-position-reference"
|
|
847
|
-
|
|
848
|
-
children: [(0, _jsxRuntime.jsxs)("div", Object.assign({
|
|
835
|
+
}, void 0), (hightLightFilterButton || showDefaultOptions || stillHaveTagsToDelete) && !noFilters && !showSearchInputDefault && !showSearchInputWhenHasTag ? (0, _jsxRuntime.jsxs)("div", {
|
|
836
|
+
className: "igloo-filter-tag-position-reference",
|
|
837
|
+
children: [(0, _jsxRuntime.jsxs)("div", {
|
|
849
838
|
ref: heightRef,
|
|
850
839
|
className: (0, _classnames.default)({
|
|
851
840
|
'tag-defalut-container-hide-status': inputExtend,
|
|
@@ -859,26 +848,22 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
859
848
|
if (onlyHaveCanNotDeleteTags) {
|
|
860
849
|
setShowSearchInputWhenHasTag(true);
|
|
861
850
|
}
|
|
862
|
-
}
|
|
863
|
-
}, {
|
|
851
|
+
},
|
|
864
852
|
children: [(0, _jsxRuntime.jsx)(_iglooicon.SearchOutlined, {
|
|
865
853
|
className: 'search-icon'
|
|
866
|
-
}, void 0), (0, _jsxRuntime.jsxs)(_space.default,
|
|
854
|
+
}, void 0), (0, _jsxRuntime.jsxs)(_space.default, {
|
|
867
855
|
size: [12, 8],
|
|
868
856
|
className: "tag-container",
|
|
869
857
|
style: {
|
|
870
858
|
flex: '1'
|
|
871
|
-
}
|
|
872
|
-
}, {
|
|
859
|
+
},
|
|
873
860
|
children: [_toConsumableArray(inputExtend ? choosedTags : maxTagsWhenClosed).map(function (item, index) {
|
|
874
|
-
return (0, _jsxRuntime.jsxs)("div",
|
|
875
|
-
className: "tag-card"
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
level: "body3"
|
|
879
|
-
}, {
|
|
861
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
862
|
+
className: "tag-card",
|
|
863
|
+
children: [(0, _jsxRuntime.jsx)(_typography.default, {
|
|
864
|
+
level: "body3",
|
|
880
865
|
children: item.label
|
|
881
|
-
}
|
|
866
|
+
}, void 0), !item.canNotDelete && (0, _jsxRuntime.jsx)(_iglooicon.CrossOutlined, {
|
|
882
867
|
className: "delete-icon",
|
|
883
868
|
onClick: function onClick(e) {
|
|
884
869
|
e.stopPropagation();
|
|
@@ -911,11 +896,11 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
911
896
|
deleteSomeOne(confirmed, item, [statusCallBack, handleFilter]);
|
|
912
897
|
}
|
|
913
898
|
}, void 0)]
|
|
914
|
-
}
|
|
899
|
+
}, index);
|
|
915
900
|
}), !oneLineCanShow && !inputExtend && (0, _jsxRuntime.jsx)("span", {
|
|
916
901
|
children: "..."
|
|
917
902
|
}, void 0)]
|
|
918
|
-
}
|
|
903
|
+
}, void 0), !onlyHaveCanNotDeleteTags && (0, _jsxRuntime.jsx)(_iglooicon.CrossOutlined, {
|
|
919
904
|
className: "delete-all-icon",
|
|
920
905
|
onClick: function onClick(e) {
|
|
921
906
|
e.stopPropagation();
|
|
@@ -943,7 +928,7 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
943
928
|
}
|
|
944
929
|
}
|
|
945
930
|
}, void 0)]
|
|
946
|
-
}
|
|
931
|
+
}, void 0), (0, _jsxRuntime.jsxs)("div", {
|
|
947
932
|
ref: openStatusTagRef,
|
|
948
933
|
className: (0, _classnames.default)('tag-extend-container-hide-status', {
|
|
949
934
|
'igloo-form-filter-has-select-tag-container': showIdSelect,
|
|
@@ -959,26 +944,22 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
959
944
|
if (onlyHaveCanNotDeleteTags) {
|
|
960
945
|
setShowSearchInputWhenHasTag(true);
|
|
961
946
|
}
|
|
962
|
-
}
|
|
963
|
-
}, {
|
|
947
|
+
},
|
|
964
948
|
children: [(0, _jsxRuntime.jsx)(_iglooicon.SearchOutlined, {
|
|
965
949
|
className: 'search-icon'
|
|
966
|
-
}, void 0), (0, _jsxRuntime.jsx)(_space.default,
|
|
950
|
+
}, void 0), (0, _jsxRuntime.jsx)(_space.default, {
|
|
967
951
|
size: [12, 8],
|
|
968
952
|
className: "tag-container",
|
|
969
953
|
style: {
|
|
970
954
|
flex: '1'
|
|
971
|
-
}
|
|
972
|
-
}, {
|
|
955
|
+
},
|
|
973
956
|
children: _toConsumableArray(inputExtend ? choosedTags : maxTagsWhenClosed).map(function (item, index) {
|
|
974
|
-
return (0, _jsxRuntime.jsxs)("div",
|
|
975
|
-
className: "tag-card"
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
level: "body3"
|
|
979
|
-
}, {
|
|
957
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
958
|
+
className: "tag-card",
|
|
959
|
+
children: [(0, _jsxRuntime.jsx)(_typography.default, {
|
|
960
|
+
level: "body3",
|
|
980
961
|
children: item.label
|
|
981
|
-
}
|
|
962
|
+
}, void 0), !item.canNotDelete && (0, _jsxRuntime.jsx)(_iglooicon.CrossOutlined, {
|
|
982
963
|
className: "delete-icon",
|
|
983
964
|
onClick: function onClick(e) {
|
|
984
965
|
e.stopPropagation();
|
|
@@ -1011,9 +992,9 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1011
992
|
deleteSomeOne(confirmed, item, [statusCallBack, handleFilter]);
|
|
1012
993
|
}
|
|
1013
994
|
}, void 0)]
|
|
1014
|
-
}
|
|
995
|
+
}, index);
|
|
1015
996
|
})
|
|
1016
|
-
}
|
|
997
|
+
}, void 0), !onlyHaveCanNotDeleteTags && (0, _jsxRuntime.jsx)(_iglooicon.CrossOutlined, {
|
|
1017
998
|
className: "delete-all-icon",
|
|
1018
999
|
onClick: function onClick() {
|
|
1019
1000
|
setTimeRangeType(-1);
|
|
@@ -1040,8 +1021,8 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1040
1021
|
}
|
|
1041
1022
|
}
|
|
1042
1023
|
}, void 0)]
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1024
|
+
}, void 0)]
|
|
1025
|
+
}, void 0) : (0, _jsxRuntime.jsx)(_input.default, {
|
|
1045
1026
|
ref: searchInput,
|
|
1046
1027
|
value: searchInputValue,
|
|
1047
1028
|
onChange: function onChange(e) {
|
|
@@ -1082,7 +1063,7 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1082
1063
|
onFilter(value);
|
|
1083
1064
|
typeof parentFilterCallBack === 'function' && parentFilterCallBack(value);
|
|
1084
1065
|
}
|
|
1085
|
-
}, void 0), (0, _jsxRuntime.jsx)(_dropdown.default,
|
|
1066
|
+
}, void 0), !inputOnly && (0, _jsxRuntime.jsx)(_dropdown.default, {
|
|
1086
1067
|
getPopupContainer: function getPopupContainer() {
|
|
1087
1068
|
return dropDownContainerRef.current;
|
|
1088
1069
|
},
|
|
@@ -1106,12 +1087,10 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1106
1087
|
}
|
|
1107
1088
|
}, 0);
|
|
1108
1089
|
},
|
|
1109
|
-
trigger: ['click']
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
}, {
|
|
1114
|
-
children: (0, _jsxRuntime.jsx)(_button.default, Object.assign({
|
|
1090
|
+
trigger: ['click'],
|
|
1091
|
+
children: (0, _jsxRuntime.jsx)("div", {
|
|
1092
|
+
className: "igloo-form-filter-button-container",
|
|
1093
|
+
children: (0, _jsxRuntime.jsx)(_button.default, {
|
|
1115
1094
|
className: (0, _classnames.default)('igloo-form-filter-filter-button', {
|
|
1116
1095
|
'igloo-form-filter-filter-button-active': dropVisible,
|
|
1117
1096
|
'igloo-form-filter-filter-button-high-light': hightLightFilterButton
|
|
@@ -1123,26 +1102,23 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1123
1102
|
}, void 0),
|
|
1124
1103
|
onClick: function onClick() {
|
|
1125
1104
|
setDropVisible(true);
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
children: (0, _jsxRuntime.jsx)(_typography.default, Object.assign({
|
|
1132
|
-
level: "body1"
|
|
1133
|
-
}, {
|
|
1105
|
+
},
|
|
1106
|
+
children: (0, _jsxRuntime.jsx)("span", {
|
|
1107
|
+
className: "filter-text",
|
|
1108
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
1109
|
+
level: "body1",
|
|
1134
1110
|
children: formatMessage({
|
|
1135
1111
|
id: 'Filter'
|
|
1136
1112
|
})
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1113
|
+
}, void 0)
|
|
1114
|
+
}, void 0)
|
|
1115
|
+
}, void 0)
|
|
1116
|
+
}, void 0)
|
|
1117
|
+
}, void 0), (0, _jsxRuntime.jsx)("div", {
|
|
1142
1118
|
className: "igloo-form-filter-drop-down",
|
|
1143
1119
|
ref: dropDownContainerRef
|
|
1144
1120
|
}, void 0)]
|
|
1145
|
-
}
|
|
1121
|
+
}, void 0);
|
|
1146
1122
|
};
|
|
1147
1123
|
|
|
1148
1124
|
var _default = FilterComponent;
|