@descope/web-components-ui 1.114.0 → 1.116.0
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/dist/cjs/index.cjs.js +103 -65
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +103 -65
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/7092.js +1 -1
- package/dist/umd/7092.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
- package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
- package/dist/umd/descope-date-field-index-js.js +1 -1
- package/dist/umd/descope-date-field-index-js.js.map +1 -1
- package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -1
- package/dist/umd/descope-multi-select-combo-box-index-js.js.map +1 -1
- package/package.json +4 -4
- package/src/components/descope-date-field/DateFieldClass.js +47 -25
- package/src/components/descope-date-field/descope-calendar/CalendarClass.js +26 -26
- package/src/components/descope-date-field/descope-calendar/helpers.js +8 -8
- package/src/components/descope-date-field/helpers.js +14 -7
- package/src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js +8 -4
@@ -1,19 +1,19 @@
|
|
1
1
|
import { formats } from './formats';
|
2
2
|
|
3
|
-
export const
|
3
|
+
export const isValidEpoch = (val) => !Number.isNaN(Number(val));
|
4
4
|
|
5
5
|
export const isNumber = (val) => !!String(val || '').trim() && !Number.isNaN(Number(val));
|
6
6
|
|
7
|
-
export const
|
8
|
-
const date = newDate(
|
7
|
+
export const getPartsFromEpoch = (epoch) => {
|
8
|
+
const date = newDate(epoch);
|
9
9
|
const year = date.getFullYear();
|
10
10
|
const month = date.getMonth() + 1;
|
11
11
|
const day = date.getDate();
|
12
12
|
return [year, month, day];
|
13
13
|
};
|
14
14
|
|
15
|
-
export const
|
16
|
-
const [year, month, day] =
|
15
|
+
export const formatEpoch = (epoch, format) => {
|
16
|
+
const [year, month, day] = getPartsFromEpoch(epoch);
|
17
17
|
|
18
18
|
const parts = {
|
19
19
|
DD: String(day).padStart(2, '0'),
|
@@ -36,8 +36,8 @@ export const newDate = (date) => {
|
|
36
36
|
};
|
37
37
|
|
38
38
|
export const getCurrentTime = () => newDate().getTime();
|
39
|
-
export const getFullYear = (
|
40
|
-
export const getMonth = (
|
39
|
+
export const getFullYear = (epoch) => newDate(epoch).getFullYear().toString();
|
40
|
+
export const getMonth = (epoch) => (newDate(epoch).getMonth() + 1).toString();
|
41
41
|
export const getCurrentDay = () => newDate().getDate();
|
42
42
|
export const getCurrentYear = () => newDate().getFullYear().toString();
|
43
43
|
|
@@ -55,3 +55,10 @@ export const parseDateString = (val, format) => {
|
|
55
55
|
if (!trimmed) return null;
|
56
56
|
return formats[format].getDate(trimmed);
|
57
57
|
};
|
58
|
+
|
59
|
+
export const dateToEpoch = (date, isUtc) => {
|
60
|
+
if (isUtc) {
|
61
|
+
return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())).getTime();
|
62
|
+
}
|
63
|
+
return date.getTime();
|
64
|
+
};
|
@@ -314,10 +314,6 @@ const multiSelectComboBoxMixin = (superclass) =>
|
|
314
314
|
|
315
315
|
this.setGetValidity();
|
316
316
|
|
317
|
-
this.setComboBoxDescriptor();
|
318
|
-
|
319
|
-
this.#overrideOverlaySettings();
|
320
|
-
|
321
317
|
this.#handleCustomValues();
|
322
318
|
|
323
319
|
this.renderItems();
|
@@ -330,6 +326,14 @@ const multiSelectComboBoxMixin = (superclass) =>
|
|
330
326
|
// tries to override it, causing us to lose the user set placeholder.
|
331
327
|
forwardAttrs(this, this.baseElement, { includeAttrs: ['placeholder'] });
|
332
328
|
|
329
|
+
// This is a workaround for a problem we have in Console App, where in ScreenBuilder - the inputElement is not ready when trying to
|
330
|
+
// set the component's descriptor and override the overlay settings.
|
331
|
+
// THIS IS A PROBLEM WITH THE CONSOLE APP THAT NEEDS TO BE RESOLVED. Until then, we use this workaround.
|
332
|
+
setTimeout(() => {
|
333
|
+
this.setComboBoxDescriptor();
|
334
|
+
this.#overrideOverlaySettings();
|
335
|
+
});
|
336
|
+
|
333
337
|
this.setDefaultValues();
|
334
338
|
|
335
339
|
this.baseElement.addEventListener('selected-items-changed', () => {
|