bromcom-ui 2.3.62 → 2.3.66
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.
|
@@ -346,10 +346,17 @@ const BcmDatetimePicker = class {
|
|
|
346
346
|
if (disabledDatesData.min && disabledDatesData.min instanceof Date) {
|
|
347
347
|
this.disabledDatesList.min = new Date(disabledDatesData.min.toDateString());
|
|
348
348
|
}
|
|
349
|
+
else {
|
|
350
|
+
delete this.disabledDatesList.min;
|
|
351
|
+
}
|
|
349
352
|
if (disabledDatesData.max && disabledDatesData.max instanceof Date) {
|
|
350
353
|
this.disabledDatesList.max = new Date(disabledDatesData.max.toDateString());
|
|
351
354
|
}
|
|
352
|
-
|
|
355
|
+
else {
|
|
356
|
+
delete this.disabledDatesList.max;
|
|
357
|
+
}
|
|
358
|
+
const value = this.inputElement.value;
|
|
359
|
+
value && this.setDataFromText(value);
|
|
353
360
|
}
|
|
354
361
|
/**
|
|
355
362
|
*
|
|
@@ -682,7 +689,9 @@ const BcmDatetimePicker = class {
|
|
|
682
689
|
this.renderDate = this.date;
|
|
683
690
|
this.valueText = this.getValueText();
|
|
684
691
|
this.setValue();
|
|
685
|
-
|
|
692
|
+
const splitText = this.valueText.split('/');
|
|
693
|
+
const newValue = this.valueText ? this.changeFormat(new Date(splitText[1] + "/" + splitText[0] + "/" + splitText[2])) : '';
|
|
694
|
+
this.inputElement.value = newValue;
|
|
686
695
|
}
|
|
687
696
|
}
|
|
688
697
|
setDataFromText(text, updateData = false, openPicker = true) {
|
|
@@ -763,7 +772,9 @@ const BcmDatetimePicker = class {
|
|
|
763
772
|
this.setValue(true);
|
|
764
773
|
}
|
|
765
774
|
}
|
|
766
|
-
|
|
775
|
+
const splitText = text.split('/');
|
|
776
|
+
const newValue = text ? this.changeFormat(new Date(splitText[1] + "/" + splitText[0] + "/" + splitText[2])) : '';
|
|
777
|
+
this.inputElement.value = newValue;
|
|
767
778
|
}
|
|
768
779
|
}
|
|
769
780
|
/**
|
|
@@ -1142,33 +1153,25 @@ const BcmDatetimePicker = class {
|
|
|
1142
1153
|
async setDisabled(disabled) {
|
|
1143
1154
|
this.disabled = disabled;
|
|
1144
1155
|
}
|
|
1145
|
-
changeFormat(date) {
|
|
1156
|
+
changeFormat(date, reverseDay = false) {
|
|
1146
1157
|
if (!date)
|
|
1147
1158
|
return;
|
|
1148
1159
|
const pad = (n) => n < 10 ? `0${n}` : n;
|
|
1149
|
-
const day = new Date(date).getDate();
|
|
1150
|
-
const month = new Date(date).getMonth() + 1;
|
|
1160
|
+
const day = pad(new Date(date).getDate());
|
|
1161
|
+
const month = pad(new Date(date).getMonth() + 1);
|
|
1151
1162
|
const year = new Date(date).getFullYear();
|
|
1152
|
-
const hours = new Date(date).getHours();
|
|
1153
|
-
const minutes = new Date(date).getMinutes();
|
|
1163
|
+
const hours = pad(new Date(date).getHours());
|
|
1164
|
+
const minutes = pad(new Date(date).getMinutes());
|
|
1154
1165
|
if (this.type == "range" || this.type == "date") {
|
|
1155
|
-
return `${day}/${month}/${year}`;
|
|
1166
|
+
return reverseDay ? `${month}/${day}/${year}` : `${day}/${month}/${year}`;
|
|
1156
1167
|
}
|
|
1157
|
-
return `${day}/${month}/${year} ${
|
|
1168
|
+
return reverseDay ? `${month}/${day}/${year} ${hours}:${minutes}` : `${day}/${month}/${year} ${hours}:${minutes}`;
|
|
1158
1169
|
}
|
|
1159
1170
|
/**
|
|
1160
1171
|
* @desc
|
|
1161
1172
|
* @param dateOrTime
|
|
1162
1173
|
*/
|
|
1163
1174
|
async set(dateOrTime) {
|
|
1164
|
-
this.lastDate = dateOrTime;
|
|
1165
|
-
// contains -
|
|
1166
|
-
// const split = dateOrTime.toString().split('-')
|
|
1167
|
-
// var date: any = DateTimeHelper.convertTimeStampToDate(new Date(split[0]).getTime()).toString()
|
|
1168
|
-
// if (split.length > 1) {
|
|
1169
|
-
// var date2 = DateTimeHelper.convertTimeStampToDate(new Date(split[1]).getTime())
|
|
1170
|
-
// date = date + "-" + date2
|
|
1171
|
-
// }
|
|
1172
1175
|
const split = dateOrTime.toString().split('-');
|
|
1173
1176
|
var date = this.changeFormat(DateTimeHelper.convertTimeStampToDate(new Date(split[0]).getTime()));
|
|
1174
1177
|
if (split.length > 1) {
|
|
@@ -1176,16 +1179,6 @@ const BcmDatetimePicker = class {
|
|
|
1176
1179
|
date = date + "-" + date2;
|
|
1177
1180
|
}
|
|
1178
1181
|
this.setDataFromText(date, true, false);
|
|
1179
|
-
// dateOrTime = DateTimeHelper.convertTimeStampToDate(new Date(dateOrTime).getTime())
|
|
1180
|
-
// const isString: boolean = typeof dateOrTime === 'string'
|
|
1181
|
-
// if ( isString ) {
|
|
1182
|
-
// // this.setDataFromText(dateOrTime as string, true, false)
|
|
1183
|
-
// } else if( dateOrTime instanceof Date){
|
|
1184
|
-
// this.setDataFromText(this.formatDate(new Date(dateOrTime), 'dd/mm/yyyy hh:mi') as string, true, false)
|
|
1185
|
-
// }
|
|
1186
|
-
// else{
|
|
1187
|
-
// this.setClear()
|
|
1188
|
-
// }
|
|
1189
1182
|
}
|
|
1190
1183
|
async setClear() {
|
|
1191
1184
|
await this.handleInputClear();
|
|
@@ -1233,7 +1226,9 @@ const BcmDatetimePicker = class {
|
|
|
1233
1226
|
const toggleClasses = classnames('toggle', {
|
|
1234
1227
|
disabled: this.disabled
|
|
1235
1228
|
});
|
|
1236
|
-
return (h(Host, { class: hostClasses, "bcm-internal-id": this.inputId }, h("bcm-input", { ref: el => (this.inputElement = el), placeholder: 'Select ' + (this.type === Types.datetime ? 'date and time' : '') + (this.type === Types.date ? 'date' : '') + (this.type === Types.time ? 'time' : ''), value: this.valueText, required: this.required, fullWidth: this.fullWidth, disabled: this.disabled, name: this.name, id: this.inputId, label: this.label, clearable: true, disableWatchValue: true, "on-bcm-focus": () => this.handleInputFocus(), "on-bcm-clear": () => this.handleInputClear(), "on-bcm-change": (e) => this.handleInputChange(e),
|
|
1229
|
+
return (h(Host, { class: hostClasses, "bcm-internal-id": this.inputId }, h("bcm-input", { ref: el => (this.inputElement = el), placeholder: 'Select ' + (this.type === Types.datetime ? 'date and time' : '') + (this.type === Types.date ? 'date' : '') + (this.type === Types.time ? 'time' : ''), value: this.valueText, required: this.required, fullWidth: this.fullWidth, disabled: this.disabled, name: this.name, id: this.inputId, label: this.label, clearable: true, disableWatchValue: true, "on-bcm-focus": () => this.handleInputFocus(), "on-bcm-clear": () => this.handleInputClear(), "on-bcm-change": (e) => this.handleInputChange(e),
|
|
1230
|
+
// on-bcm-input={(e: CustomEvent) => this.handleInputInput(e.detail)}
|
|
1231
|
+
noCaption: this.noCaption, caption: this.caption, captionType: this.captionType }, this.error && (h("bcm-tooltip", { slot: "suffix", placement: "top", message: this.errorText }, h("bcm-icon", {
|
|
1237
1232
|
// slot="suffix"
|
|
1238
1233
|
// title={this.errorText}
|
|
1239
1234
|
icon: "exclamation-circle", color: "red-6", size: 16
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
1
|
+
import { EventEmitter, ComponentInterface } from '../../../stencil-public-runtime';
|
|
2
2
|
import { ElementDragger, DragDirections } from '../../../utils/element-dragger';
|
|
3
3
|
import { Months, Type } from './types';
|
|
4
|
-
export declare class BcmDatetimePicker {
|
|
4
|
+
export declare class BcmDatetimePicker implements ComponentInterface {
|
|
5
5
|
private id;
|
|
6
6
|
private inputId;
|
|
7
7
|
private emptyState;
|
|
@@ -25,7 +25,6 @@ export declare class BcmDatetimePicker {
|
|
|
25
25
|
private minutesDragger;
|
|
26
26
|
private dataIsValid;
|
|
27
27
|
private optionViewportStyleAlignment;
|
|
28
|
-
private lastDate;
|
|
29
28
|
el: HTMLElement;
|
|
30
29
|
/**
|
|
31
30
|
* Component Properties
|
|
@@ -399,7 +398,7 @@ export declare class BcmDatetimePicker {
|
|
|
399
398
|
* @param disabled
|
|
400
399
|
*/
|
|
401
400
|
setDisabled(disabled: boolean): Promise<void>;
|
|
402
|
-
changeFormat(date: Date): string;
|
|
401
|
+
changeFormat(date: Date, reverseDay?: boolean): string;
|
|
403
402
|
/**
|
|
404
403
|
* @desc
|
|
405
404
|
* @param dateOrTime
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare class NumberHelper {
|
|
2
|
-
static isNumber: (str: string) => boolean;
|
|
3
|
-
static convertToNumber: (str: string) => number;
|
|
4
|
-
static replaceNumber: (str: string) => string;
|
|
5
|
-
static replaceFloat: (str: string) => string;
|
|
6
|
-
static toFixed: (num: number, fixed: number) => string;
|
|
7
|
-
static parseFloatFixed: (str: string, fixed: number) => string;
|
|
8
|
-
static getDecimalLength: (str: string) => number;
|
|
9
|
-
}
|