dtable-ui-component 5.0.9-beta.1 → 5.0.9-beta.2
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/lib/AutoNumberFormatter/index.js +5 -3
- package/lib/ButtonFormatter/index.js +9 -5
- package/lib/CTimeFormatter/index.js +5 -3
- package/lib/CheckboxEditor/index.js +15 -12
- package/lib/CheckboxFormatter/index.js +7 -5
- package/lib/CollaboratorEditor/index.js +46 -37
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +60 -47
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +37 -31
- package/lib/CollaboratorFormatter/index.js +8 -7
- package/lib/CollaboratorItem/index.js +21 -16
- package/lib/CollapsibleSettingLayout/index.js +17 -12
- package/lib/CreatorFormatter/index.js +8 -7
- package/lib/DTableCommonAddTool/index.js +10 -7
- package/lib/DTableCustomizeCollaboratorSelect/index.js +38 -32
- package/lib/DTableCustomizeSelect/index.js +51 -44
- package/lib/DTableFiltersPopover/index.js +46 -41
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +67 -51
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +64 -49
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +38 -32
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +42 -34
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +35 -31
- package/lib/DTableFiltersPopover/widgets/filter-item.js +92 -76
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +19 -17
- package/lib/DTableFiltersPopover/widgets/rate-item.js +12 -9
- package/lib/DTablePopover/index.js +9 -6
- package/lib/DTableRadio/index.js +20 -17
- package/lib/DTableSearchInput/index.js +22 -18
- package/lib/DTableSelect/dtable-select-label.js +12 -7
- package/lib/DTableSelect/index.js +2 -1
- package/lib/DTableSelect/utils.js +26 -13
- package/lib/DTableSwitch/index.js +20 -16
- package/lib/DateEditor/index.js +46 -36
- package/lib/DateEditor/mb-date-editor-popover/index.js +80 -63
- package/lib/DateEditor/pc-date-editor-popover.js +25 -22
- package/lib/DateFormatter/index.js +5 -3
- package/lib/Department-editor/department-multiple-select/index.js +49 -42
- package/lib/Department-editor/department-single-select.js +70 -54
- package/lib/Department-editor/index.js +18 -14
- package/lib/Department-editor/selected-departments/index.js +54 -44
- package/lib/DepartmentSelectFilter/index.js +8 -1
- package/lib/DepartmentSingleSelectFormatter/index.js +13 -9
- package/lib/DigitalSignFormatter/index.js +21 -17
- package/lib/DurationFormatter/index.js +7 -5
- package/lib/EditEditorButton/index.js +5 -3
- package/lib/EmailFormatter/index.js +5 -3
- package/lib/FieldDisplaySetting/field-item.js +25 -19
- package/lib/FieldDisplaySetting/index.js +47 -38
- package/lib/FileEditor/index.js +10 -7
- package/lib/FileFormatter/index.js +18 -15
- package/lib/FileItemFormatter/index.js +2 -1
- package/lib/FileUploader/index.js +2 -1
- package/lib/FormulaFormatter/index.js +21 -14
- package/lib/GeolocationFormatter/index.js +8 -6
- package/lib/HtmlLongTextFormatter/index.js +2 -1
- package/lib/ImageFormatter/images-lazy-load.js +7 -6
- package/lib/ImageFormatter/index.js +35 -29
- package/lib/ImagePreviewerLightbox/index.js +12 -8
- package/lib/LastModifierFormatter/index.js +8 -7
- package/lib/LinkEditor/index.js +38 -32
- package/lib/LinkEditor/link-editor-option.js +25 -20
- package/lib/LinkEditor/mb-link-editor-popover/index.js +53 -41
- package/lib/LinkEditor/pc-link-editor-popover/index.js +41 -33
- package/lib/LinkFormatter/index.js +13 -10
- package/lib/Loading/index.js +2 -1
- package/lib/LongTextFormatter/index.js +3 -2
- package/lib/MBEditorHeader/index.js +19 -14
- package/lib/MTimeFormatter/index.js +5 -3
- package/lib/MultipleSelectEditor/index.js +43 -37
- package/lib/MultipleSelectFormatter/index.js +8 -7
- package/lib/NotificationPopover/index.js +43 -32
- package/lib/NumberEditor/index.js +24 -20
- package/lib/NumberFormatter/index.js +5 -3
- package/lib/RateFormatter/index.js +7 -6
- package/lib/RoleStatusEditor/index.js +35 -30
- package/lib/RowExpandEmailFormatter/index.js +11 -8
- package/lib/RowExpandFileFormatter/index.js +14 -13
- package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +43 -36
- package/lib/RowExpandFormatter/index.js +129 -112
- package/lib/RowExpandFormulaFormatter/index.js +37 -29
- package/lib/RowExpandImageFormatter/index.js +29 -26
- package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +47 -39
- package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +2 -1
- package/lib/RowExpandLinkFormatter/index.js +70 -67
- package/lib/RowExpandRateFormatter/index.js +7 -6
- package/lib/RowExpandUrlFormatter/index.js +11 -8
- package/lib/SelectItem/index.js +5 -3
- package/lib/SelectOptionGroup/index.js +38 -31
- package/lib/SelectOptionGroup/option.js +5 -3
- package/lib/SimpleLongTextFormatter/index.js +39 -30
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +11 -8
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -2
- package/lib/SingleSelectEditor/index.js +42 -34
- package/lib/SingleSelectFormatter/index.js +6 -4
- package/lib/TextEditor/index.js +2 -1
- package/lib/TextFormatter/index.js +5 -3
- package/lib/UrlFormatter/index.js +5 -3
- package/lib/common/delete-tip.js +27 -19
- package/lib/formatterConfig/base-formatter-config.js +23 -22
- package/lib/formatterConfig/index.js +3 -2
- package/lib/select-editor/mb-select-editor-popover/index.js +84 -64
- package/lib/select-editor/pc-select-editor-popover/index.js +50 -39
- package/lib/select-editor/select-editor-option.js +24 -19
- package/lib/toaster/alert.js +25 -16
- package/lib/toaster/toast.js +28 -24
- package/lib/toaster/toastManager.js +16 -13
- package/lib/toaster/toaster.js +2 -1
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.Option = exports.MenuSelectStyle = exports.MenuList = exports.DropdownIndicator = exports.ClearIndicator = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactSelect = require("react-select");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
11
12
|
option: (provided, state) => {
|
|
12
13
|
const {
|
|
@@ -37,12 +38,15 @@ const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
|
37
38
|
indicatorSeparator: () => {}
|
|
38
39
|
};
|
|
39
40
|
const DropdownIndicator = props => {
|
|
40
|
-
return _reactSelect.components.DropdownIndicator && /*#__PURE__*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
return _reactSelect.components.DropdownIndicator && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.DropdownIndicator, {
|
|
42
|
+
...props,
|
|
43
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
44
|
+
className: "dtable-font dtable-icon-drop-down",
|
|
45
|
+
style: {
|
|
46
|
+
fontSize: '12px'
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
});
|
|
46
50
|
};
|
|
47
51
|
exports.DropdownIndicator = DropdownIndicator;
|
|
48
52
|
const ClearIndicator = _ref => {
|
|
@@ -58,17 +62,26 @@ const ClearIndicator = _ref => {
|
|
|
58
62
|
...innerProps,
|
|
59
63
|
onMouseDown
|
|
60
64
|
};
|
|
61
|
-
return /*#__PURE__*/
|
|
65
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.ClearIndicator, {
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
62
68
|
};
|
|
63
69
|
exports.ClearIndicator = ClearIndicator;
|
|
64
|
-
const MenuList = props => /*#__PURE__*/
|
|
70
|
+
const MenuList = props => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
65
71
|
onClick: e => e.nativeEvent.stopImmediatePropagation(),
|
|
66
|
-
onMouseDown: e => e.nativeEvent.stopImmediatePropagation()
|
|
67
|
-
|
|
72
|
+
onMouseDown: e => e.nativeEvent.stopImmediatePropagation(),
|
|
73
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.MenuList, {
|
|
74
|
+
...props,
|
|
75
|
+
children: props.children
|
|
76
|
+
})
|
|
77
|
+
});
|
|
68
78
|
exports.MenuList = MenuList;
|
|
69
79
|
const Option = props => {
|
|
70
|
-
return /*#__PURE__*/
|
|
71
|
-
style: props.data.style
|
|
72
|
-
|
|
80
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
81
|
+
style: props.data.style,
|
|
82
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.Option, {
|
|
83
|
+
...props
|
|
84
|
+
})
|
|
85
|
+
});
|
|
73
86
|
};
|
|
74
87
|
exports.Option = Option;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
function DtableSwitch(props) {
|
|
10
11
|
const {
|
|
11
12
|
onChange,
|
|
@@ -14,21 +15,24 @@ function DtableSwitch(props) {
|
|
|
14
15
|
disabled,
|
|
15
16
|
switchClassName
|
|
16
17
|
} = props;
|
|
17
|
-
return /*#__PURE__*/
|
|
18
|
-
className: "dtable-switch position-relative ".concat(switchClassName || '')
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
19
|
+
className: "dtable-switch position-relative ".concat(switchClassName || ''),
|
|
20
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
21
|
+
className: "custom-switch",
|
|
22
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
23
|
+
className: "custom-switch-input",
|
|
24
|
+
type: "checkbox",
|
|
25
|
+
checked: checked,
|
|
26
|
+
onChange: onChange,
|
|
27
|
+
name: "custom-switch-checkbox",
|
|
28
|
+
disabled: disabled
|
|
29
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
30
|
+
className: "custom-switch-description text-truncate",
|
|
31
|
+
children: placeholder
|
|
32
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
33
|
+
className: "custom-switch-indicator"
|
|
34
|
+
})]
|
|
35
|
+
})
|
|
36
|
+
});
|
|
33
37
|
}
|
|
34
38
|
var _default = exports.default = DtableSwitch;
|
package/lib/DateEditor/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var _mbDateEditorPopover = _interopRequireDefault(require("./mb-date-editor-popo
|
|
|
15
15
|
require("dayjs/locale/zh-cn");
|
|
16
16
|
require("dayjs/locale/en-gb");
|
|
17
17
|
require("./index.css");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
19
|
class DateEditor extends _react.default.Component {
|
|
19
20
|
constructor(props) {
|
|
20
21
|
super(props);
|
|
@@ -85,13 +86,15 @@ class DateEditor extends _react.default.Component {
|
|
|
85
86
|
}
|
|
86
87
|
render() {
|
|
87
88
|
if (!this.state.isDateInit) {
|
|
88
|
-
return /*#__PURE__*/
|
|
89
|
-
className: "cell-editor date-editor"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
90
|
+
className: "cell-editor date-editor",
|
|
91
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
92
|
+
className: "date-editor-container",
|
|
93
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
94
|
+
className: "control-form"
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
});
|
|
95
98
|
}
|
|
96
99
|
let {
|
|
97
100
|
lang,
|
|
@@ -104,35 +107,42 @@ class DateEditor extends _react.default.Component {
|
|
|
104
107
|
dateFormat,
|
|
105
108
|
showHourAndMinute
|
|
106
109
|
} = this.state;
|
|
107
|
-
return /*#__PURE__*/
|
|
108
|
-
className: "cell-editor dtable-ui-date-editor"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
110
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
111
|
+
className: "cell-editor dtable-ui-date-editor",
|
|
112
|
+
children: [!isPopoverShow && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
113
|
+
className: "dtable-ui-date-editor-container",
|
|
114
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
115
|
+
className: "form-control",
|
|
116
|
+
onClick: this.onDateEditorToggle,
|
|
117
|
+
children: (0, _dtableUtils.getDateDisplayString)(newValue, dateFormat)
|
|
118
|
+
})
|
|
119
|
+
}), isPopoverShow && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
120
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
121
|
+
query: '(min-width: 768px)',
|
|
122
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcDateEditorPopover.default, {
|
|
123
|
+
className: className,
|
|
124
|
+
lang: lang,
|
|
125
|
+
value: newValue,
|
|
126
|
+
dateFormat: dateFormat,
|
|
127
|
+
showHourAndMinute: showHourAndMinute,
|
|
128
|
+
onValueChanged: this.onValueChanged
|
|
129
|
+
})
|
|
130
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
131
|
+
query: '(max-width: 767.8px)',
|
|
132
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbDateEditorPopover.default, {
|
|
133
|
+
className: className,
|
|
134
|
+
isReadOnly: this.props.isReadOnly,
|
|
135
|
+
lang: lang,
|
|
136
|
+
value: newValue,
|
|
137
|
+
dateFormat: dateFormat,
|
|
138
|
+
showHourAndMinute: showHourAndMinute,
|
|
139
|
+
column: column,
|
|
140
|
+
onValueChanged: this.onValueChanged,
|
|
141
|
+
onClosePopover: this.onClosePopover
|
|
142
|
+
})
|
|
143
|
+
})]
|
|
144
|
+
})]
|
|
145
|
+
});
|
|
136
146
|
}
|
|
137
147
|
}
|
|
138
148
|
DateEditor.defaultProps = {
|
|
@@ -17,6 +17,7 @@ var _editorUtils = require("../../utils/editor-utils");
|
|
|
17
17
|
var _MBEditorHeader = _interopRequireDefault(require("../../MBEditorHeader"));
|
|
18
18
|
require("@seafile/seafile-calendar/assets/index.css");
|
|
19
19
|
require("./index.css");
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
21
|
class DateEditorPopover extends _react.default.PureComponent {
|
|
21
22
|
constructor(props) {
|
|
22
23
|
super(props);
|
|
@@ -97,7 +98,7 @@ class DateEditorPopover extends _react.default.PureComponent {
|
|
|
97
98
|
className
|
|
98
99
|
} = this.props;
|
|
99
100
|
let defaultValue = (0, _dayjs.default)().clone();
|
|
100
|
-
return /*#__PURE__*/
|
|
101
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_seafileCalendar.default, {
|
|
101
102
|
className: (0, _classnames.default)('dtable-rc-calendar', className),
|
|
102
103
|
locale: (0, _editorUtils.initDateEditorLanguage)(lang),
|
|
103
104
|
format: dateFormat,
|
|
@@ -121,7 +122,7 @@ class DateEditorPopover extends _react.default.PureComponent {
|
|
|
121
122
|
datePickerValue
|
|
122
123
|
} = this.state;
|
|
123
124
|
let calendar = this.getCalender();
|
|
124
|
-
return /*#__PURE__*/
|
|
125
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(SeaDatePicker, {
|
|
125
126
|
open: true,
|
|
126
127
|
style: {
|
|
127
128
|
width: '100%'
|
|
@@ -129,27 +130,29 @@ class DateEditorPopover extends _react.default.PureComponent {
|
|
|
129
130
|
calendar: calendar,
|
|
130
131
|
value: datePickerValue,
|
|
131
132
|
getCalendarContainer: this.getCalendarContainer,
|
|
132
|
-
onChange: this.onChange
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
133
|
+
onChange: this.onChange,
|
|
134
|
+
children: _ref => {
|
|
135
|
+
let {
|
|
136
|
+
value
|
|
137
|
+
} = _ref;
|
|
138
|
+
value = value && value.format(dateFormat);
|
|
139
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
140
|
+
tabIndex: "0",
|
|
141
|
+
onFocus: this.onReadOnlyFocus,
|
|
142
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
143
|
+
placeholder: (0, _lang.getLocale)('Please_select'),
|
|
144
|
+
readOnly: true,
|
|
145
|
+
tabIndex: "-1",
|
|
146
|
+
className: "form-control",
|
|
147
|
+
value: value || ''
|
|
148
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
149
|
+
ref: this.calendarContainerRef,
|
|
150
|
+
style: {
|
|
151
|
+
height: '22rem'
|
|
152
|
+
}
|
|
153
|
+
})]
|
|
154
|
+
});
|
|
155
|
+
}
|
|
153
156
|
});
|
|
154
157
|
};
|
|
155
158
|
this.state = {
|
|
@@ -177,48 +180,62 @@ class DateEditorPopover extends _react.default.PureComponent {
|
|
|
177
180
|
const {
|
|
178
181
|
datePickerValue
|
|
179
182
|
} = this.state;
|
|
180
|
-
return /*#__PURE__*/
|
|
183
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
181
184
|
ref: this.setEditorPopover,
|
|
182
185
|
className: "dtable-ui-mb-editor-popover mb-date-editor-popover",
|
|
183
|
-
onClick: this.onContainerClick
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
186
|
+
onClick: this.onContainerClick,
|
|
187
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MBEditorHeader.default, {
|
|
188
|
+
title: column.name,
|
|
189
|
+
leftContent: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
190
|
+
className: "dtable-font dtable-icon-return"
|
|
191
|
+
}),
|
|
192
|
+
rightContent: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
193
|
+
children: (0, _lang.getLocale)('Done')
|
|
194
|
+
}),
|
|
195
|
+
onLeftClick: this.props.onClosePopover,
|
|
196
|
+
onRightClick: this.props.onClosePopover
|
|
197
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
198
|
+
className: "dtable-ui-mb-editor-body dtable-ui-mb-date-editor-body",
|
|
199
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
200
|
+
className: "mb-date-editor-input",
|
|
201
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
202
|
+
className: "date-input",
|
|
203
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_datePicker.default, {
|
|
204
|
+
mode: "date",
|
|
205
|
+
locale: (0, _editorUtils.initDateEditorLanguage)(lang),
|
|
206
|
+
value: this.state.value,
|
|
207
|
+
onChange: this.handleDateChange,
|
|
208
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
209
|
+
className: "date-input-day",
|
|
210
|
+
children: datePickerValue && datePickerValue.format(leftFormat)
|
|
211
|
+
})
|
|
212
|
+
})
|
|
213
|
+
}), showHourAndMinute && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
214
|
+
className: "date-input",
|
|
215
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_datePicker.default, {
|
|
216
|
+
mode: "time",
|
|
217
|
+
locale: (0, _editorUtils.initDateEditorLanguage)(lang),
|
|
218
|
+
value: this.state.value,
|
|
219
|
+
onChange: this.handleTimeChange,
|
|
220
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
221
|
+
className: "date-input-day",
|
|
222
|
+
children: datePickerValue && datePickerValue.format(rightFormat)
|
|
223
|
+
})
|
|
224
|
+
})
|
|
225
|
+
})]
|
|
226
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
227
|
+
className: "dtable-ui mb-date-editor-picker",
|
|
228
|
+
children: this.renderDataPicker()
|
|
229
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
230
|
+
className: "mb-date-editor-clear",
|
|
231
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
232
|
+
onClick: this.deleteDate,
|
|
233
|
+
className: "clear-date",
|
|
234
|
+
children: (0, _lang.getLocale)('Clear')
|
|
235
|
+
})
|
|
236
|
+
})]
|
|
237
|
+
})]
|
|
238
|
+
});
|
|
222
239
|
}
|
|
223
240
|
}
|
|
224
241
|
var _default = exports.default = DateEditorPopover;
|
|
@@ -13,6 +13,7 @@ var _seafileCalendar = _interopRequireDefault(require("@seafile/seafile-calendar
|
|
|
13
13
|
var _editorUtils = require("../utils/editor-utils");
|
|
14
14
|
require("@seafile/seafile-calendar/assets/index.css");
|
|
15
15
|
var _lang = require("../lang");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
class PCDateEditorPopover extends _react.default.Component {
|
|
17
18
|
constructor(props) {
|
|
18
19
|
super(props);
|
|
@@ -59,7 +60,7 @@ class PCDateEditorPopover extends _react.default.Component {
|
|
|
59
60
|
className
|
|
60
61
|
} = this.props;
|
|
61
62
|
let defaultValue = (0, _dayjs.default)().clone();
|
|
62
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_seafileCalendar.default, {
|
|
63
64
|
className: (0, _classnames.default)('dtable-rc-calendar', className),
|
|
64
65
|
locale: (0, _editorUtils.initDateEditorLanguage)(lang),
|
|
65
66
|
style: {
|
|
@@ -89,7 +90,7 @@ class PCDateEditorPopover extends _react.default.Component {
|
|
|
89
90
|
datePickerValue
|
|
90
91
|
} = this.state;
|
|
91
92
|
const calendar = this.getCalender();
|
|
92
|
-
return /*#__PURE__*/
|
|
93
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Picker.default, {
|
|
93
94
|
open: open,
|
|
94
95
|
value: datePickerValue,
|
|
95
96
|
animation: "slide-up",
|
|
@@ -99,26 +100,28 @@ class PCDateEditorPopover extends _react.default.Component {
|
|
|
99
100
|
calendar: calendar,
|
|
100
101
|
getCalendarContainer: this.getCalendarContainer,
|
|
101
102
|
onChange: this.onChange,
|
|
102
|
-
onOpenChange: this.onOpenChange
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
103
|
+
onOpenChange: this.onOpenChange,
|
|
104
|
+
children: _ref => {
|
|
105
|
+
let {
|
|
106
|
+
value
|
|
107
|
+
} = _ref;
|
|
108
|
+
value = value && value.format(dateFormat);
|
|
109
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
110
|
+
className: "dtable-ui-date-editor-container",
|
|
111
|
+
tabIndex: "0",
|
|
112
|
+
onFocus: this.onFocusDatePicker,
|
|
113
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
114
|
+
readOnly: true,
|
|
115
|
+
tabIndex: "-1",
|
|
116
|
+
className: "form-control",
|
|
117
|
+
placeholder: (0, _lang.getLocale)('Please_select'),
|
|
118
|
+
value: value || '',
|
|
119
|
+
onMouseDown: this.handleMouseDown
|
|
120
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
121
|
+
ref: this.calendarContainerRef
|
|
122
|
+
})]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
122
125
|
});
|
|
123
126
|
}
|
|
124
127
|
}
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _dtableUtils = require("dtable-utils");
|
|
11
11
|
require("./index.css");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
class DateFormatter extends _react.default.Component {
|
|
13
14
|
render() {
|
|
14
15
|
let {
|
|
@@ -20,9 +21,10 @@ class DateFormatter extends _react.default.Component {
|
|
|
20
21
|
if (date !== '') {
|
|
21
22
|
date = (0, _dtableUtils.getDateDisplayString)(date, format);
|
|
22
23
|
}
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
-
className: classname
|
|
25
|
-
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
25
|
+
className: classname,
|
|
26
|
+
children: date
|
|
27
|
+
});
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
DateFormatter.defaultProps = {
|
|
@@ -11,6 +11,7 @@ var _utils = require("../utils");
|
|
|
11
11
|
var _selectedDepartments = _interopRequireDefault(require("../selected-departments"));
|
|
12
12
|
var _lang = require("../../lang");
|
|
13
13
|
require("./index.css");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
function DepartmentMultipleSelect(props) {
|
|
15
16
|
const {
|
|
16
17
|
value,
|
|
@@ -89,25 +90,27 @@ function DepartmentMultipleSelect(props) {
|
|
|
89
90
|
paddingLeft: hasChild ? '' : '16px'
|
|
90
91
|
};
|
|
91
92
|
const inputChecked = value.includes(id);
|
|
92
|
-
return /*#__PURE__*/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
93
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
94
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
95
|
+
className: "dropdown-item d-flex align-items-center",
|
|
96
|
+
onClick: event => onSelectDepartment(event, id),
|
|
97
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
98
|
+
type: "checkbox",
|
|
99
|
+
className: "vam department-select-input",
|
|
100
|
+
checked: inputChecked,
|
|
101
|
+
style: inputStyle,
|
|
102
|
+
onChange: () => {}
|
|
103
|
+
}), hasChild && !searchVal && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
104
|
+
className: "dtable-font expand dtable-icon-".concat(isExpanded ? 'drop-down' : 'right-slide', " pr-1"),
|
|
105
|
+
onClick: event => onExpand(event, id, isExpanded)
|
|
106
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
107
|
+
style: searchVal ? {} : nameStyle,
|
|
108
|
+
title: name,
|
|
109
|
+
className: "text-truncate",
|
|
110
|
+
children: name
|
|
111
|
+
})]
|
|
112
|
+
}), isExpanded && hasChild && renderSubDepartments(id, subDepartments, newLevel)]
|
|
113
|
+
}, id);
|
|
111
114
|
}
|
|
112
115
|
function renderSearchedDepartments() {
|
|
113
116
|
return validDepartmentsRef.current.map(department => {
|
|
@@ -119,32 +122,36 @@ function DepartmentMultipleSelect(props) {
|
|
|
119
122
|
const subDepartments = departments.filter(department => department.parent_id !== -1);
|
|
120
123
|
const topDepartment = departments.find(department => department.parent_id === -1);
|
|
121
124
|
if (!topDepartment) return null;
|
|
122
|
-
return /*#__PURE__*/
|
|
125
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
123
126
|
ref: departmentContainerRef,
|
|
124
127
|
onClick: onStopPropagation,
|
|
125
128
|
onMouseDown: onStopPropagation,
|
|
126
|
-
className: "dropdown-menu show departments-container dtable-ui ".concat(classNamePrefix)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
129
|
+
className: "dropdown-menu show departments-container dtable-ui ".concat(classNamePrefix),
|
|
130
|
+
children: [isShowSelectedDepartments && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
131
|
+
className: "selected-departments dtable-ui",
|
|
132
|
+
onClick: onClick,
|
|
133
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_selectedDepartments.default, {
|
|
134
|
+
value: value,
|
|
135
|
+
removeDepartment: onCommit,
|
|
136
|
+
isShowRemoveIcon: true,
|
|
137
|
+
departments: departments
|
|
138
|
+
})
|
|
139
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
140
|
+
className: "search-departments",
|
|
141
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
142
|
+
className: "form-control",
|
|
143
|
+
type: "text",
|
|
144
|
+
autoFocus: true,
|
|
145
|
+
placeholder: (0, _lang.getLocale)('Search_department'),
|
|
146
|
+
value: searchVal,
|
|
147
|
+
onChange: onChangeSearch,
|
|
148
|
+
onClick: onClick
|
|
149
|
+
})
|
|
150
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
151
|
+
className: "department-item-container",
|
|
152
|
+
children: [!searchVal && renderUserDepartmentOptions && renderUserDepartmentOptions(), validDepartmentsRef.current.length > 0 && searchVal && renderSearchedDepartments(), !searchVal && renderDepartment(topDepartment, subDepartments, level)]
|
|
153
|
+
})]
|
|
154
|
+
});
|
|
148
155
|
}
|
|
149
156
|
return renderDepartments();
|
|
150
157
|
}
|