@vitrosoftware/common-ui-ts 1.1.41 → 1.1.43
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/css/std/controls/date-picker/date-picker.css +1 -1
- package/css/std/controls/input/input.css +4 -0
- package/css/std/controls/lookup-picker/lookup-picker.css +4 -0
- package/css/std/controls/message-input/message-input.css +1 -0
- package/css/std/controls/time-picker/time-picker.css +1 -1
- package/dist/controls/ImagePicker/ImagePicker.d.ts +3 -3
- package/dist/index.css +13 -2
- package/dist/index.js +21 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { DropdownItem } from '../DropdownButton/DropdownItem';
|
|
3
3
|
interface ImagePickerProps {
|
|
4
|
-
inputFileRef: MutableRefObject<HTMLInputElement | null>;
|
|
5
4
|
label: string;
|
|
5
|
+
name?: string;
|
|
6
6
|
itemList?: DropdownItem[];
|
|
7
7
|
defaultUrl?: string;
|
|
8
8
|
classNameRoot?: string;
|
|
@@ -10,7 +10,7 @@ interface ImagePickerProps {
|
|
|
10
10
|
classNameDefaultIcon?: string;
|
|
11
11
|
imgUrlUpload?: string;
|
|
12
12
|
imgUrlDelete?: string;
|
|
13
|
-
|
|
13
|
+
onChange: (file: File | null, name?: string) => void;
|
|
14
14
|
}
|
|
15
15
|
export declare const ImagePicker: (props: ImagePickerProps) => JSX.Element;
|
|
16
16
|
export {};
|
package/dist/index.css
CHANGED
|
@@ -1852,6 +1852,10 @@
|
|
|
1852
1852
|
color: #4A556C;
|
|
1853
1853
|
}
|
|
1854
1854
|
|
|
1855
|
+
._input_vitro-read-only_3f-cBbK ._input_vitro-label_2XBESiY {
|
|
1856
|
+
color: #8E98A3;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1855
1859
|
._input_vitro-error_1T3dLzB input,
|
|
1856
1860
|
._input_vitro-error_1T3dLzB textarea {
|
|
1857
1861
|
border-color: #D13438;
|
|
@@ -2444,7 +2448,7 @@
|
|
|
2444
2448
|
}
|
|
2445
2449
|
|
|
2446
2450
|
._date-picker_vitro-read-only_2NZoMN5 ._date-picker_vitro-label_2jh9qxb {
|
|
2447
|
-
color: #
|
|
2451
|
+
color: #8E98A3;
|
|
2448
2452
|
}
|
|
2449
2453
|
|
|
2450
2454
|
._date-picker_vitro-read-only_2NZoMN5 .k-picker-wrap .k-select {
|
|
@@ -2786,7 +2790,7 @@
|
|
|
2786
2790
|
}
|
|
2787
2791
|
|
|
2788
2792
|
._time-picker_vitro-read-only_NlE18Zm ._time-picker_vitro-label_2b97aCy {
|
|
2789
|
-
color: #
|
|
2793
|
+
color: #8E98A3;
|
|
2790
2794
|
}
|
|
2791
2795
|
|
|
2792
2796
|
._time-picker_vitro-read-only_NlE18Zm .k-picker-wrap .k-select {
|
|
@@ -3181,6 +3185,10 @@
|
|
|
3181
3185
|
user-select: none;
|
|
3182
3186
|
}
|
|
3183
3187
|
|
|
3188
|
+
._lookup-picker_vitro-read-only_32NOdGB ._lookup-picker_vitro-label_2QoJkUz {
|
|
3189
|
+
color: #8E98A3;
|
|
3190
|
+
}
|
|
3191
|
+
|
|
3184
3192
|
._lookup-picker_vitro-read-only_32NOdGB input::-moz-selection {
|
|
3185
3193
|
background: white;
|
|
3186
3194
|
color: #4A556C;
|
|
@@ -4544,6 +4552,9 @@ ul > li:last-child > ul > li:last-child ._sidebar-item_vitro-active_7p5iOhY {
|
|
|
4544
4552
|
pointer-events: none;
|
|
4545
4553
|
text-overflow: ellipsis;
|
|
4546
4554
|
overflow: hidden;
|
|
4555
|
+
-webkit-user-select: none;
|
|
4556
|
+
-moz-user-select: none;
|
|
4557
|
+
user-select: none;
|
|
4547
4558
|
}
|
|
4548
4559
|
|
|
4549
4560
|
._message-input_vitro-button-add-file_1qdtHHq {
|
package/dist/index.js
CHANGED
|
@@ -61706,6 +61706,7 @@ var LookupPicker = function LookupPicker(props) {
|
|
|
61706
61706
|
};
|
|
61707
61707
|
var onChange = function onChange(e) {
|
|
61708
61708
|
setState(styles$q['vitro-focus']);
|
|
61709
|
+
setValueListVisible(true);
|
|
61709
61710
|
setInputValue(e.target.value);
|
|
61710
61711
|
};
|
|
61711
61712
|
var onKeyDown = function onKeyDown(e) {
|
|
@@ -64144,12 +64145,12 @@ var MessageInput = function MessageInput(props) {
|
|
|
64144
64145
|
var onEnter = function onEnter() {
|
|
64145
64146
|
props.onSubmit(getValue());
|
|
64146
64147
|
resetValue();
|
|
64147
|
-
setIsShowPlaceholder(true);
|
|
64148
64148
|
};
|
|
64149
64149
|
var onKeyDown = function onKeyDown(e) {
|
|
64150
64150
|
if (e.keyCode === 13 && !e.shiftKey) {
|
|
64151
64151
|
e.preventDefault();
|
|
64152
64152
|
onEnter();
|
|
64153
|
+
setIsShowPlaceholder(false);
|
|
64153
64154
|
}
|
|
64154
64155
|
};
|
|
64155
64156
|
var onChange = function onChange(e) {
|
|
@@ -64165,18 +64166,21 @@ var MessageInput = function MessageInput(props) {
|
|
|
64165
64166
|
var value = getValue();
|
|
64166
64167
|
if (!value) {
|
|
64167
64168
|
resetValue();
|
|
64168
|
-
setIsShowPlaceholder(true);
|
|
64169
64169
|
}
|
|
64170
64170
|
};
|
|
64171
64171
|
var getValue = function getValue() {
|
|
64172
|
+
if (isShowPlaceholder) {
|
|
64173
|
+
return CTRL.EMPTY;
|
|
64174
|
+
}
|
|
64172
64175
|
if (inputRef.current) {
|
|
64173
64176
|
return inputRef.current.innerText.replace(NEW_LINE, CTRL.EMPTY);
|
|
64174
64177
|
}
|
|
64175
64178
|
return CTRL.EMPTY;
|
|
64176
64179
|
};
|
|
64177
64180
|
var resetValue = function resetValue() {
|
|
64178
|
-
if (inputRef.current) {
|
|
64181
|
+
if (inputRef.current && !isShowPlaceholder) {
|
|
64179
64182
|
inputRef.current.innerText = CTRL.EMPTY;
|
|
64183
|
+
setIsShowPlaceholder(true);
|
|
64180
64184
|
}
|
|
64181
64185
|
};
|
|
64182
64186
|
return React__default.createElement("div", {
|
|
@@ -64220,7 +64224,8 @@ var LOCALE$7;
|
|
|
64220
64224
|
|
|
64221
64225
|
var ImagePicker = function ImagePicker(props) {
|
|
64222
64226
|
var localeService = inversifyReact.useInjection(SERVICE.LOCALE);
|
|
64223
|
-
var
|
|
64227
|
+
var inputFileRef = React.useRef(null);
|
|
64228
|
+
var renderPreview = function renderPreview() {
|
|
64224
64229
|
if (props.defaultUrl) {
|
|
64225
64230
|
return React__default.createElement("div", {
|
|
64226
64231
|
className: props.classNameDefaultIcon ? props.classNameDefaultIcon : styles$J['vitro-image-picker-icon-wrapper']
|
|
@@ -64236,12 +64241,16 @@ var ImagePicker = function ImagePicker(props) {
|
|
|
64236
64241
|
}));
|
|
64237
64242
|
}
|
|
64238
64243
|
};
|
|
64244
|
+
var onChange = function onChange(e) {
|
|
64245
|
+
var _e$target$files$, _e$target$files;
|
|
64246
|
+
props.onChange((_e$target$files$ = e === null || e === void 0 ? void 0 : (_e$target$files = e.target.files) === null || _e$target$files === void 0 ? void 0 : _e$target$files[0]) != null ? _e$target$files$ : null, props.name);
|
|
64247
|
+
};
|
|
64239
64248
|
var defaultItemList = React.useMemo(function () {
|
|
64240
64249
|
var _props$itemList;
|
|
64241
64250
|
var result = [{
|
|
64242
64251
|
onClick: function onClick() {
|
|
64243
|
-
var
|
|
64244
|
-
return
|
|
64252
|
+
var _inputFileRef$current;
|
|
64253
|
+
return inputFileRef === null || inputFileRef === void 0 ? void 0 : (_inputFileRef$current = inputFileRef.current) === null || _inputFileRef$current === void 0 ? void 0 : _inputFileRef$current.click();
|
|
64245
64254
|
},
|
|
64246
64255
|
text: localeService.create(LOCALE$7.ACTION_UPLOAD),
|
|
64247
64256
|
value: ACTION$1.UPLOAD,
|
|
@@ -64253,7 +64262,9 @@ var ImagePicker = function ImagePicker(props) {
|
|
|
64253
64262
|
}];
|
|
64254
64263
|
if (props.defaultUrl) {
|
|
64255
64264
|
result.push({
|
|
64256
|
-
onClick:
|
|
64265
|
+
onClick: function onClick() {
|
|
64266
|
+
return onChange(null);
|
|
64267
|
+
},
|
|
64257
64268
|
text: localeService.create(LOCALE$7.ACTION_DELETE),
|
|
64258
64269
|
value: ACTION$1.DELETE,
|
|
64259
64270
|
key: ACTION$1.DELETE,
|
|
@@ -64277,9 +64288,10 @@ var ImagePicker = function ImagePicker(props) {
|
|
|
64277
64288
|
}), React__default.createElement("input", {
|
|
64278
64289
|
type: 'file',
|
|
64279
64290
|
className: styles$J['vitro-image-picker-input'],
|
|
64280
|
-
ref:
|
|
64291
|
+
ref: inputFileRef,
|
|
64292
|
+
onChange: onChange,
|
|
64281
64293
|
accept: "image/*"
|
|
64282
|
-
}),
|
|
64294
|
+
}), renderPreview()));
|
|
64283
64295
|
};
|
|
64284
64296
|
|
|
64285
64297
|
var styles$K = {"vitro-criterion-container":"_criterion_vitro-criterion-container_2cYcSkL","vitro-block":"_criterion_vitro-block_3E9-RXM","vitro-control":"_criterion_vitro-control_2JLaybj","vitro-label":"_criterion_vitro-label_3F6a8dj","vitro-operator-select-container":"_criterion_vitro-operator-select-container_3OkjzXG","vitro-operator-select":"_criterion_vitro-operator-select_1guNlk9","vitro-operator-list":"_criterion_vitro-operator-list_3A2VZsd","vitro-button-cancel":"_criterion_vitro-button-cancel_2C2G0sL","vitro-focus":"_criterion_vitro-focus_3FNLsoN","vitro-error":"_criterion_vitro-error_3pvFrlW","vitro-condition-select":"_criterion_vitro-condition-select_1hTBBg-","vitro-icon":"_criterion_vitro-icon_1DmS0jh","vitro-condition-list":"_criterion_vitro-condition-list_10UIxJI"};
|