q2-tecton-elements 1.13.0-alpha.0 → 1.13.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/click-elsewhere.cjs.entry.js +5 -7
- package/dist/cjs/{icons-4595ee47.js → icons-08ffe5c9.js} +394 -384
- package/dist/cjs/{index-c2e53804.js → index-7febb200.js} +112 -65
- package/dist/cjs/{index-a55d3c34.js → index-dd823ee6.js} +27 -14
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/q2-avatar.cjs.entry.js +2 -2
- package/dist/cjs/q2-badge.cjs.entry.js +43 -0
- package/dist/cjs/q2-btn_2.cjs.entry.js +13 -13
- package/dist/cjs/q2-calendar.cjs.entry.js +53 -59
- package/dist/cjs/q2-card.cjs.entry.js +127 -0
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +5 -5
- package/dist/cjs/q2-carousel.cjs.entry.js +318 -106
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +6 -3
- package/dist/cjs/q2-checkbox.cjs.entry.js +18 -10
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +7 -7
- package/dist/cjs/q2-dropdown.cjs.entry.js +8 -17
- package/dist/cjs/q2-editable-field.cjs.entry.js +5 -8
- package/dist/cjs/q2-icon.cjs.entry.js +3 -3
- package/dist/cjs/q2-input.cjs.entry.js +439 -437
- package/dist/cjs/q2-loading-element.cjs.entry.js +3 -3
- package/dist/cjs/q2-loc.cjs.entry.js +2 -2
- package/dist/cjs/q2-message.cjs.entry.js +5 -5
- package/dist/cjs/q2-optgroup.cjs.entry.js +3 -3
- package/dist/cjs/q2-option-list.cjs.entry.js +359 -0
- package/dist/cjs/q2-option.cjs.entry.js +3 -11
- package/dist/cjs/q2-pagination.cjs.entry.js +116 -0
- package/dist/cjs/q2-pill.cjs.entry.js +137 -0
- package/dist/cjs/q2-radio-group.cjs.entry.js +43 -18
- package/dist/cjs/q2-radio.cjs.entry.js +21 -4
- package/dist/cjs/q2-section.cjs.entry.js +5 -7
- package/dist/cjs/q2-select.cjs.entry.js +23 -26
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +42 -4
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +278 -0
- package/dist/cjs/q2-stepper.cjs.entry.js +10 -12
- package/dist/cjs/q2-tab-container.cjs.entry.js +12 -8
- package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +94 -0
- package/dist/cjs/q2-tecton-elements.cjs.js +3 -3
- package/dist/cjs/q2-textarea.cjs.entry.js +8 -8
- package/dist/cjs/{shapes-086c0365.js → shapes-305746b5.js} +9 -16
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -5
- package/dist/collection/collection-manifest.json +10 -3
- package/dist/collection/components/click-elsewhere/index.js +4 -6
- package/dist/collection/components/q2-badge/index.js +148 -0
- package/dist/collection/components/q2-badge/styles.css +134 -0
- package/dist/collection/components/q2-btn/index.js +14 -14
- package/dist/collection/components/q2-btn/styles.css +1 -1
- package/dist/collection/components/q2-calendar/helpers.js +22 -20
- package/dist/collection/components/q2-calendar/index.js +44 -37
- package/dist/collection/components/q2-calendar/validation.js +4 -2
- package/dist/collection/components/q2-card/index.js +347 -0
- package/dist/collection/components/q2-card/styles.css +177 -0
- package/dist/collection/components/q2-carousel/index.js +11 -16
- package/dist/collection/components/q2-carousel/styles.css +3 -3
- package/dist/collection/components/q2-carousel-pane/index.js +2 -2
- package/dist/collection/components/q2-carousel-pane/styles.css +8 -3
- package/dist/collection/components/q2-checkbox/index.js +37 -12
- package/dist/collection/components/q2-checkbox-group/index.js +22 -1
- package/dist/collection/components/q2-dropdown/index.js +6 -15
- package/dist/collection/components/q2-dropdown-item/index.js +5 -5
- package/dist/collection/components/q2-editable-field/index.js +3 -6
- package/dist/collection/components/q2-icon/icons.js +393 -383
- package/dist/collection/components/q2-input/formatting/credit-card.js +15 -13
- package/dist/collection/components/q2-input/formatting/currency.js +162 -162
- package/dist/collection/components/q2-input/formatting/date.js +1 -1
- package/dist/collection/components/q2-input/formatting/generic.js +7 -8
- package/dist/collection/components/q2-input/formatting/number.js +6 -9
- package/dist/collection/components/q2-input/formatting/numeric.js +5 -5
- package/dist/collection/components/q2-input/formatting/phone.js +215 -215
- package/dist/collection/components/q2-input/formatting/postal.js +1 -1
- package/dist/collection/components/q2-input/index.js +81 -25
- package/dist/collection/components/q2-input/styles.css +19 -14
- package/dist/collection/components/q2-loading/index.js +4 -4
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +1 -1
- package/dist/collection/components/q2-loading/skeleton/shapes.js +8 -15
- package/dist/collection/components/q2-message/index.js +3 -3
- package/dist/collection/components/q2-optgroup/index.js +1 -1
- package/dist/collection/components/q2-option/index.js +19 -25
- package/dist/collection/components/q2-option/styles.css +5 -0
- package/dist/collection/components/q2-option-list/index.js +648 -0
- package/dist/collection/components/q2-option-list/styles.css +128 -0
- package/dist/collection/components/q2-pagination/index.js +275 -0
- package/dist/collection/components/q2-pagination/styles.css +120 -0
- package/dist/collection/components/q2-pill/index.js +324 -0
- package/dist/collection/components/q2-pill/styles.css +229 -0
- package/dist/collection/components/q2-radio/index.js +38 -1
- package/dist/collection/components/q2-radio-group/index.js +66 -24
- package/dist/collection/components/q2-section/index.js +5 -7
- package/dist/collection/components/q2-select/index.js +40 -25
- package/dist/collection/components/q2-stepper/index.js +8 -10
- package/dist/collection/components/q2-stepper/styles.css +5 -5
- package/dist/collection/components/q2-stepper-pane/index.js +133 -5
- package/dist/collection/components/q2-stepper-vertical/index.js +346 -0
- package/dist/collection/components/q2-stepper-vertical/styles.css +273 -0
- package/dist/collection/components/q2-tab-container/index.js +11 -7
- package/dist/collection/components/q2-tag/index.js +200 -0
- package/dist/collection/components/q2-tag/styles.css +141 -0
- package/dist/collection/components/q2-textarea/index.js +6 -6
- package/dist/collection/components/tecton-tab-pane/index.js +3 -10
- package/dist/collection/utils/index.js +25 -13
- package/dist/esm/click-elsewhere.entry.js +5 -7
- package/dist/esm/{icons-3ee662ea.js → icons-b1e11526.js} +394 -384
- package/dist/esm/{index-ec6660af.js → index-0ff8de52.js} +27 -15
- package/dist/esm/{index-be8376c0.js → index-dbfb3ecc.js} +112 -65
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/q2-avatar.entry.js +2 -2
- package/dist/esm/q2-badge.entry.js +39 -0
- package/dist/esm/q2-btn_2.entry.js +13 -13
- package/dist/esm/q2-calendar.entry.js +53 -59
- package/dist/esm/q2-card.entry.js +123 -0
- package/dist/esm/q2-carousel-pane.entry.js +5 -5
- package/dist/esm/q2-carousel.entry.js +318 -106
- package/dist/esm/q2-checkbox-group.entry.js +6 -3
- package/dist/esm/q2-checkbox.entry.js +18 -10
- package/dist/esm/q2-dropdown-item.entry.js +7 -7
- package/dist/esm/q2-dropdown.entry.js +8 -17
- package/dist/esm/q2-editable-field.entry.js +5 -8
- package/dist/esm/q2-icon.entry.js +3 -3
- package/dist/esm/q2-input.entry.js +439 -437
- package/dist/esm/q2-loading-element.entry.js +3 -3
- package/dist/esm/q2-loc.entry.js +2 -2
- package/dist/esm/q2-message.entry.js +5 -5
- package/dist/esm/q2-optgroup.entry.js +3 -3
- package/dist/esm/q2-option-list.entry.js +355 -0
- package/dist/esm/q2-option.entry.js +3 -11
- package/dist/esm/q2-pagination.entry.js +112 -0
- package/dist/esm/q2-pill.entry.js +133 -0
- package/dist/esm/q2-radio-group.entry.js +43 -18
- package/dist/esm/q2-radio.entry.js +21 -4
- package/dist/esm/q2-section.entry.js +5 -7
- package/dist/esm/q2-select.entry.js +23 -26
- package/dist/esm/q2-stepper-pane.entry.js +42 -4
- package/dist/esm/q2-stepper-vertical.entry.js +274 -0
- package/dist/esm/q2-stepper.entry.js +10 -12
- package/dist/esm/q2-tab-container.entry.js +12 -8
- package/dist/esm/q2-tab-pane.entry.js +1 -1
- package/dist/esm/q2-tag.entry.js +90 -0
- package/dist/esm/q2-tecton-elements.js +3 -3
- package/dist/esm/q2-textarea.entry.js +8 -8
- package/dist/esm/{shapes-81c11dfe.js → shapes-cff4e1f0.js} +9 -16
- package/dist/esm/tecton-tab-pane.entry.js +2 -5
- package/dist/loader/index.d.ts +0 -1
- package/dist/q2-tecton-elements/{p-75e87cca.entry.js → p-00e8f782.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-0900bec1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-10264ecb.entry.js +1 -0
- package/dist/q2-tecton-elements/p-123cdfb9.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-fbf7c5e6.entry.js → p-1305ec5f.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-148391d6.entry.js +1 -0
- package/dist/q2-tecton-elements/p-1dfaee64.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-32ad664c.entry.js → p-221abbf6.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c90a6016.js → p-255b2b4c.js} +1 -1
- package/dist/q2-tecton-elements/p-27736b6b.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2846ab94.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2bc1de01.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-8ea2c4f7.entry.js → p-2c15414c.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-2caa89fd.js +1 -0
- package/dist/q2-tecton-elements/p-327cca41.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3a420dbf.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3abcb09d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3fe98e3e.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-bb2e110a.entry.js → p-430a979b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7e6fc65d.entry.js → p-45eb7739.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-750bcd33.entry.js → p-49b2abc4.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9b50c3c3.entry.js → p-4ab30466.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-50e218c7.entry.js +1 -0
- package/dist/q2-tecton-elements/p-5bbf2bfe.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-ac859fcc.entry.js → p-6fec9235.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-824aebd9.js +1 -0
- package/dist/q2-tecton-elements/p-a4ae89cc.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-50967020.entry.js → p-a5562aaa.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ae4fed23.entry.js +1 -0
- package/dist/q2-tecton-elements/p-b2302cd3.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c20cbb2d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ca7a3380.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-a6f8d09a.entry.js → p-d33e152c.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9024859f.entry.js → p-d5218cd6.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-d52b435e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-dd02cf8d.js +1 -0
- package/dist/q2-tecton-elements/{p-07a5d703.entry.js → p-e0e7ae8b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7e030e92.entry.js → p-ede12fc1.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-df182f61.entry.js → p-fdfbe75b.entry.js} +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/elements/q2-tag-test.js +151 -0
- package/dist/test/helpers.js +20 -9
- package/dist/types/components/q2-badge/index.d.ts +13 -0
- package/dist/types/components/q2-btn/index.d.ts +3 -3
- package/dist/types/components/q2-calendar/helpers.d.ts +1 -0
- package/dist/types/components/q2-calendar/index.d.ts +2 -1
- package/dist/types/components/q2-calendar/validation.d.ts +1 -1
- package/dist/types/components/q2-card/index.d.ts +35 -0
- package/dist/types/components/q2-checkbox/index.d.ts +3 -1
- package/dist/types/components/q2-checkbox-group/index.d.ts +1 -0
- package/dist/types/components/q2-dropdown/index.d.ts +1 -1
- package/dist/types/components/q2-editable-field/index.d.ts +1 -1
- package/dist/types/components/q2-input/formatting/credit-card.d.ts +1 -3
- package/dist/types/components/q2-input/index.d.ts +5 -2
- package/dist/types/components/q2-option/index.d.ts +2 -3
- package/dist/types/components/q2-option-list/index.d.ts +62 -0
- package/dist/types/components/q2-pagination/index.d.ts +30 -0
- package/dist/types/components/q2-pill/index.d.ts +39 -0
- package/dist/types/components/q2-radio/index.d.ts +4 -1
- package/dist/types/components/q2-radio-group/index.d.ts +5 -1
- package/dist/types/components/q2-select/index.d.ts +2 -1
- package/dist/types/components/q2-stepper/index.d.ts +1 -1
- package/dist/types/components/q2-stepper-pane/index.d.ts +16 -1
- package/dist/types/components/q2-stepper-vertical/index.d.ts +52 -0
- package/dist/types/components/q2-tab-container/index.d.ts +1 -1
- package/dist/types/components/q2-tag/index.d.ts +28 -0
- package/dist/types/components/tecton-tab-pane/index.d.ts +2 -2
- package/dist/types/components.d.ts +235 -11
- package/dist/types/global.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/util.d.ts +2 -10
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/elements/q2-tag-test.d.ts +1 -0
- package/dist/types/workspace/workspace/{_production_release_1.11.0-alpha → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +6 -3
- package/package.json +13 -13
- package/dist/q2-tecton-elements/p-06fff43d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-080839ed.js +0 -1
- package/dist/q2-tecton-elements/p-29a37091.entry.js +0 -1
- package/dist/q2-tecton-elements/p-37aba2a4.js +0 -1
- package/dist/q2-tecton-elements/p-4cd00f1a.js +0 -1
- package/dist/q2-tecton-elements/p-6702eb4d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-768e3a5d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-843b1ee9.entry.js +0 -1
- package/dist/q2-tecton-elements/p-943c7745.entry.js +0 -1
- package/dist/q2-tecton-elements/p-95a73559.entry.js +0 -1
- package/dist/q2-tecton-elements/p-9a977ee6.entry.js +0 -1
- package/dist/q2-tecton-elements/p-b281c349.entry.js +0 -1
- package/dist/q2-tecton-elements/p-c5e55b9f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-ccbe9158.entry.js +0 -1
- package/dist/q2-tecton-elements/p-db6f90ac.entry.js +0 -1
- package/dist/q2-tecton-elements/p-fa6eea5c.entry.js +0 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index$1 = require('./index-
|
|
6
|
-
const index = require('./index-
|
|
5
|
+
const index$1 = require('./index-7febb200.js');
|
|
6
|
+
const index = require('./index-dd823ee6.js');
|
|
7
7
|
|
|
8
8
|
function toInteger(dirtyNumber) {
|
|
9
9
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
@@ -2768,7 +2768,7 @@ function formatDateShort(value) {
|
|
|
2768
2768
|
month: '2-digit',
|
|
2769
2769
|
day: '2-digit',
|
|
2770
2770
|
year: 'numeric',
|
|
2771
|
-
timeZone: 'UTC'
|
|
2771
|
+
timeZone: 'UTC',
|
|
2772
2772
|
}).format(new Date(isoDate));
|
|
2773
2773
|
}
|
|
2774
2774
|
function formatDateLong(value) {
|
|
@@ -2778,7 +2778,7 @@ function formatDateLong(value) {
|
|
|
2778
2778
|
return new Intl.DateTimeFormat('default', {
|
|
2779
2779
|
month: 'short',
|
|
2780
2780
|
day: 'numeric',
|
|
2781
|
-
year: 'numeric'
|
|
2781
|
+
year: 'numeric',
|
|
2782
2782
|
}).format(date);
|
|
2783
2783
|
}
|
|
2784
2784
|
function convertMomentFormat(stringFormat) {
|
|
@@ -2798,7 +2798,7 @@ function stringToDate(date) {
|
|
|
2798
2798
|
return undefined;
|
|
2799
2799
|
}
|
|
2800
2800
|
let result;
|
|
2801
|
-
|
|
2801
|
+
const dateParts = date.split(/[\/\-]/).map(part => part.padStart(2, '0'));
|
|
2802
2802
|
const isIsoString = isString && date.length >= 24 && date[10] === 'T';
|
|
2803
2803
|
const isCompleteDate = dateParts.length === 3;
|
|
2804
2804
|
const isPartialDate = dateParts.length < 3;
|
|
@@ -2853,7 +2853,7 @@ function setupMonthYear(value = new Date()) {
|
|
|
2853
2853
|
const monthIndex = Number(value.toISOString().split('-')[1]) - 1;
|
|
2854
2854
|
return {
|
|
2855
2855
|
monthIndex,
|
|
2856
|
-
selectedYear: value.getFullYear()
|
|
2856
|
+
selectedYear: value.getFullYear(),
|
|
2857
2857
|
};
|
|
2858
2858
|
}
|
|
2859
2859
|
function validateInput(input = '', validDays = [], validDates = [], // white list
|
|
@@ -2897,14 +2897,10 @@ startDate, endDate, formatString = 'mm/dd/yyyy', assume) {
|
|
|
2897
2897
|
if (input.length >= 5 && !isAvailable) {
|
|
2898
2898
|
isValid$1 = false;
|
|
2899
2899
|
messageType = 'error';
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
message = index.loc('tecton.element.calendar.hint.notAvailableDate', [
|
|
2905
|
-
formatDateLong(inputDate)
|
|
2906
|
-
]);
|
|
2907
|
-
}
|
|
2900
|
+
const isInvalid = !monthName || !date || !year;
|
|
2901
|
+
message = isInvalid
|
|
2902
|
+
? `${index.loc('tecton.element.calendar.hint.invalidDate')}: ${formatString}`
|
|
2903
|
+
: index.loc('tecton.element.calendar.hint.notAvailableDate', [formatDateLong(inputDate)]);
|
|
2908
2904
|
}
|
|
2909
2905
|
}
|
|
2910
2906
|
else {
|
|
@@ -2918,19 +2914,19 @@ startDate, endDate, formatString = 'mm/dd/yyyy', assume) {
|
|
|
2918
2914
|
message,
|
|
2919
2915
|
inputDate,
|
|
2920
2916
|
isAvailable,
|
|
2921
|
-
calendarPosition
|
|
2917
|
+
calendarPosition,
|
|
2922
2918
|
};
|
|
2923
2919
|
}
|
|
2924
2920
|
function buildInputDate(input, assume) {
|
|
2925
2921
|
const now = new Date();
|
|
2926
|
-
|
|
2922
|
+
const [month, day, year] = input.split('/');
|
|
2927
2923
|
if (input.length === 10) {
|
|
2928
2924
|
return new Date(input);
|
|
2929
2925
|
}
|
|
2930
2926
|
else if (month && day && Number(day) > 0) {
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
return new Date(`${month}/${
|
|
2927
|
+
const twoDigitDay = Number(day) < 10 ? `0${Number(day)}` : day;
|
|
2928
|
+
const fourDigitYear = !year || year.length < 4 ? assumeYear(month, day, assume) : year;
|
|
2929
|
+
return new Date(`${month}/${twoDigitDay}/${fourDigitYear}`);
|
|
2934
2930
|
}
|
|
2935
2931
|
else if (month && day && Number(day) === 0) {
|
|
2936
2932
|
return new Date(''); // invalid date: 09/0/2021
|
|
@@ -2967,6 +2963,12 @@ function handleMissingZeros(input) {
|
|
|
2967
2963
|
}
|
|
2968
2964
|
return input;
|
|
2969
2965
|
}
|
|
2966
|
+
function reorderDateString(input) {
|
|
2967
|
+
const dateParts = (input || '').split('-');
|
|
2968
|
+
if (dateParts.length !== 3)
|
|
2969
|
+
return '';
|
|
2970
|
+
return `${dateParts[1]}/${dateParts[2]}/${dateParts[0]}`;
|
|
2971
|
+
}
|
|
2970
2972
|
function firstDayOfWeekInMonth(month, year) {
|
|
2971
2973
|
return new Date(year, month, 1, 1, 1, 1, 1).getDay();
|
|
2972
2974
|
}
|
|
@@ -2978,7 +2980,7 @@ function getDays() {
|
|
|
2978
2980
|
index.loc('tecton.element.calendar.days.short.Wednesday'),
|
|
2979
2981
|
index.loc('tecton.element.calendar.days.short.Thursday'),
|
|
2980
2982
|
index.loc('tecton.element.calendar.days.short.Friday'),
|
|
2981
|
-
index.loc('tecton.element.calendar.days.short.Saturday')
|
|
2983
|
+
index.loc('tecton.element.calendar.days.short.Saturday'),
|
|
2982
2984
|
];
|
|
2983
2985
|
}
|
|
2984
2986
|
function getDaysOfWeek() {
|
|
@@ -2989,7 +2991,7 @@ function getDaysOfWeek() {
|
|
|
2989
2991
|
index.loc('tecton.element.calendar.days.Wednesday'),
|
|
2990
2992
|
index.loc('tecton.element.calendar.days.Thursday'),
|
|
2991
2993
|
index.loc('tecton.element.calendar.days.Friday'),
|
|
2992
|
-
index.loc('tecton.element.calendar.days.Saturday')
|
|
2994
|
+
index.loc('tecton.element.calendar.days.Saturday'),
|
|
2993
2995
|
];
|
|
2994
2996
|
}
|
|
2995
2997
|
function getMonths() {
|
|
@@ -3005,7 +3007,7 @@ function getMonths() {
|
|
|
3005
3007
|
index.loc('tecton.element.calendar.months.September'),
|
|
3006
3008
|
index.loc('tecton.element.calendar.months.October'),
|
|
3007
3009
|
index.loc('tecton.element.calendar.months.November'),
|
|
3008
|
-
index.loc('tecton.element.calendar.months.December')
|
|
3010
|
+
index.loc('tecton.element.calendar.months.December'),
|
|
3009
3011
|
];
|
|
3010
3012
|
}
|
|
3011
3013
|
|
|
@@ -3017,6 +3019,7 @@ function generateDatesFromMonthYear(month, year) {
|
|
|
3017
3019
|
}, []);
|
|
3018
3020
|
}
|
|
3019
3021
|
function getValidDaysOfWeek(checksum = 127) {
|
|
3022
|
+
/* tslint:disable:no-bitwise */
|
|
3020
3023
|
const sunValid = checksum & 1;
|
|
3021
3024
|
const monValid = checksum & 2;
|
|
3022
3025
|
const tuesValid = checksum & 4;
|
|
@@ -3024,6 +3027,7 @@ function getValidDaysOfWeek(checksum = 127) {
|
|
|
3024
3027
|
const thursValid = checksum & 16;
|
|
3025
3028
|
const friValid = checksum & 32;
|
|
3026
3029
|
const satValid = checksum & 64;
|
|
3030
|
+
/* tslint:enable:no-bitwise */
|
|
3027
3031
|
const ret = [];
|
|
3028
3032
|
if (checksum <= 0)
|
|
3029
3033
|
return ret;
|
|
@@ -3091,7 +3095,7 @@ function getDayState(dayInMonth, dateValidators, currentDate) {
|
|
|
3091
3095
|
const isEndDate = isSameDay(dayInMonth, dateValidators === null || dateValidators === void 0 ? void 0 : dateValidators.endDate);
|
|
3092
3096
|
return { isSelected, isToday, isStartDate, isEndDate };
|
|
3093
3097
|
}
|
|
3094
|
-
function generateClassesForCalDay({ isInvalid, isSelected, isEndDate, isStartDate, isToday, isIncompleteDate }) {
|
|
3098
|
+
function generateClassesForCalDay({ isInvalid, isSelected, isEndDate, isStartDate, isToday, isIncompleteDate, }) {
|
|
3095
3099
|
const classes = [];
|
|
3096
3100
|
if (!isInvalid)
|
|
3097
3101
|
classes.push('is-valid');
|
|
@@ -3125,7 +3129,7 @@ const emptyDate = {
|
|
|
3125
3129
|
isSelected: false,
|
|
3126
3130
|
isStartDate: false,
|
|
3127
3131
|
isEndDate: false,
|
|
3128
|
-
classList: ''
|
|
3132
|
+
classList: '',
|
|
3129
3133
|
};
|
|
3130
3134
|
function addEmptyDates(from, to) {
|
|
3131
3135
|
if (from === 7)
|
|
@@ -3162,7 +3166,7 @@ const Q2Calendar = class {
|
|
|
3162
3166
|
}
|
|
3163
3167
|
};
|
|
3164
3168
|
this.openCalendar = () => {
|
|
3165
|
-
if (!this.dropdownOpen) {
|
|
3169
|
+
if (!this.readonly && !this.dropdownOpen) {
|
|
3166
3170
|
this.selectedMonthYear = setupMonthYear(this.dateValue);
|
|
3167
3171
|
this.dateList = this.buildDateList(this.selectedMonthYear);
|
|
3168
3172
|
this.dropdownOpen = true;
|
|
@@ -3171,6 +3175,8 @@ const Q2Calendar = class {
|
|
|
3171
3175
|
}
|
|
3172
3176
|
};
|
|
3173
3177
|
this.toggleCalendar = () => {
|
|
3178
|
+
if (this.readonly)
|
|
3179
|
+
return;
|
|
3174
3180
|
this.dropdownOpen = !this.dropdownOpen;
|
|
3175
3181
|
this.scheduledAfterRender.push(this.resizeIframe);
|
|
3176
3182
|
if (this.dropdownOpen) {
|
|
@@ -3298,7 +3304,7 @@ const Q2Calendar = class {
|
|
|
3298
3304
|
const newYear = removeTimezoneOffset(new Date(year, monthIndex));
|
|
3299
3305
|
this.selectedMonthYear = {
|
|
3300
3306
|
monthIndex: newYear.getMonth(),
|
|
3301
|
-
selectedYear: newYear.getFullYear()
|
|
3307
|
+
selectedYear: newYear.getFullYear(),
|
|
3302
3308
|
};
|
|
3303
3309
|
this.dateList = this.buildDateList(this.selectedMonthYear);
|
|
3304
3310
|
this.scheduledAfterRender.push(() => this.checkActiveCellForBlankness());
|
|
@@ -3386,13 +3392,14 @@ const Q2Calendar = class {
|
|
|
3386
3392
|
};
|
|
3387
3393
|
}
|
|
3388
3394
|
resizeIframe() {
|
|
3389
|
-
return
|
|
3390
|
-
window.TectonElements.resizeIframe &&
|
|
3391
|
-
window.TectonElements.resizeIframe());
|
|
3395
|
+
return window.TectonElements && window.TectonElements.resizeIframe && window.TectonElements.resizeIframe();
|
|
3392
3396
|
}
|
|
3393
3397
|
connectedCallback() {
|
|
3394
3398
|
this.selectedMonthYear = setupMonthYear(this.dateValue);
|
|
3395
3399
|
this.dateList = this.buildDateList(this.selectedMonthYear);
|
|
3400
|
+
if (this.value && this.isTypeable && !this.typedValue) {
|
|
3401
|
+
this.typedValue = reorderDateString(this.value);
|
|
3402
|
+
}
|
|
3396
3403
|
this.validateDate();
|
|
3397
3404
|
}
|
|
3398
3405
|
componentWillLoad() {
|
|
@@ -3420,9 +3427,7 @@ const Q2Calendar = class {
|
|
|
3420
3427
|
}
|
|
3421
3428
|
get localizedErrors() {
|
|
3422
3429
|
return ((Array.isArray(this.errors) &&
|
|
3423
|
-
this.errors
|
|
3424
|
-
.filter((error) => error)
|
|
3425
|
-
.map((error) => error && index.loc(error))) ||
|
|
3430
|
+
this.errors.filter((error) => error).map((error) => error && index.loc(error))) ||
|
|
3426
3431
|
[]);
|
|
3427
3432
|
}
|
|
3428
3433
|
get formattedValue() {
|
|
@@ -3437,7 +3442,7 @@ const Q2Calendar = class {
|
|
|
3437
3442
|
year: 'numeric',
|
|
3438
3443
|
month: '2-digit',
|
|
3439
3444
|
day: '2-digit',
|
|
3440
|
-
timeZone: 'UTC'
|
|
3445
|
+
timeZone: 'UTC',
|
|
3441
3446
|
}).format(dateValue);
|
|
3442
3447
|
}
|
|
3443
3448
|
get computedPlaceholder() {
|
|
@@ -3459,9 +3464,7 @@ const Q2Calendar = class {
|
|
|
3459
3464
|
if (isMoment)
|
|
3460
3465
|
return value.toDate();
|
|
3461
3466
|
// stringified moment value assigned in html template e.g.) handlebar
|
|
3462
|
-
const isMomentString = typeof value === 'string' &&
|
|
3463
|
-
value.split(' ').length === 6 &&
|
|
3464
|
-
/GMT-\d{4}/g.test(value);
|
|
3467
|
+
const isMomentString = typeof value === 'string' && value.split(' ').length === 6 && /GMT-\d{4}/g.test(value);
|
|
3465
3468
|
if (isMomentString) {
|
|
3466
3469
|
value = formatDateISO(value);
|
|
3467
3470
|
}
|
|
@@ -3472,7 +3475,7 @@ const Q2Calendar = class {
|
|
|
3472
3475
|
return {
|
|
3473
3476
|
startDate: stringToDate(this.startDate),
|
|
3474
3477
|
endDate: stringToDate(this.endDate),
|
|
3475
|
-
cutOffTime: stringToDate(this.cutoffTime)
|
|
3478
|
+
cutOffTime: stringToDate(this.cutoffTime),
|
|
3476
3479
|
};
|
|
3477
3480
|
}
|
|
3478
3481
|
get isTypeable() {
|
|
@@ -3489,8 +3492,7 @@ const Q2Calendar = class {
|
|
|
3489
3492
|
}
|
|
3490
3493
|
defaultErrorHandler(event) {
|
|
3491
3494
|
if (event.target === this.hostElement && !this.hostElement.onerror) {
|
|
3492
|
-
if (Array.isArray(this.errors) &&
|
|
3493
|
-
this.errors.includes('tecton.element.calendar.invalidDate')) {
|
|
3495
|
+
if (Array.isArray(this.errors) && this.errors.includes('tecton.element.calendar.invalidDate')) {
|
|
3494
3496
|
return;
|
|
3495
3497
|
}
|
|
3496
3498
|
this.errors = (this.errors || []).concat(['tecton.element.calendar.invalidDate']);
|
|
@@ -3504,8 +3506,7 @@ const Q2Calendar = class {
|
|
|
3504
3506
|
this.onsuccess(event);
|
|
3505
3507
|
}
|
|
3506
3508
|
else {
|
|
3507
|
-
if (Array.isArray(this.errors) &&
|
|
3508
|
-
this.errors.includes('tecton.element.calendar.invalidDate')) {
|
|
3509
|
+
if (Array.isArray(this.errors) && this.errors.includes('tecton.element.calendar.invalidDate')) {
|
|
3509
3510
|
this.errors = this.errors.filter(x => x !== 'tecton.element.calendar.invalidDate');
|
|
3510
3511
|
}
|
|
3511
3512
|
}
|
|
@@ -3528,9 +3529,7 @@ const Q2Calendar = class {
|
|
|
3528
3529
|
this.typedValue = newValueAsString;
|
|
3529
3530
|
}
|
|
3530
3531
|
else {
|
|
3531
|
-
const dateValue = isMoment
|
|
3532
|
-
? newValue.toDate()
|
|
3533
|
-
: stringToDate(newValue);
|
|
3532
|
+
const dateValue = isMoment ? newValue.toDate() : stringToDate(newValue);
|
|
3534
3533
|
this.inputField.value = formatDateShort(dateValue);
|
|
3535
3534
|
this.selectedMonthYear = setupMonthYear(dateValue);
|
|
3536
3535
|
this.dateList = this.buildDateList(this.selectedMonthYear);
|
|
@@ -3587,22 +3586,21 @@ const Q2Calendar = class {
|
|
|
3587
3586
|
else {
|
|
3588
3587
|
calculationDateList = this.buildDateList({
|
|
3589
3588
|
monthIndex: month,
|
|
3590
|
-
selectedYear: year
|
|
3589
|
+
selectedYear: year,
|
|
3591
3590
|
});
|
|
3592
3591
|
}
|
|
3593
3592
|
const dateValueDayOfMonth = (_c = dateValue === null || dateValue === void 0 ? void 0 : dateValue.getDate()) !== null && _c !== void 0 ? _c : undefined;
|
|
3594
3593
|
const isDateValueInvalid = dateValueDayOfMonth
|
|
3595
|
-
? !calculationDateList.find(({ integer }) => integer === dateValueDayOfMonth)
|
|
3596
|
-
.isValid
|
|
3594
|
+
? !calculationDateList.find(({ integer }) => integer === dateValueDayOfMonth).isValid
|
|
3597
3595
|
: true;
|
|
3598
3596
|
if (isDateValueInvalid) {
|
|
3599
3597
|
this.error.emit({
|
|
3600
3598
|
errors: [
|
|
3601
3599
|
{
|
|
3602
3600
|
message: `Value passed is invalid: The date ${this.value} is not valid`,
|
|
3603
|
-
errorCode: 'generalInvalid'
|
|
3604
|
-
}
|
|
3605
|
-
]
|
|
3601
|
+
errorCode: 'generalInvalid',
|
|
3602
|
+
},
|
|
3603
|
+
],
|
|
3606
3604
|
});
|
|
3607
3605
|
}
|
|
3608
3606
|
else {
|
|
@@ -3611,7 +3609,7 @@ const Q2Calendar = class {
|
|
|
3611
3609
|
}
|
|
3612
3610
|
}
|
|
3613
3611
|
catch (error) {
|
|
3614
|
-
console.
|
|
3612
|
+
console.warn('Invalid moment value ', this.dateValue);
|
|
3615
3613
|
}
|
|
3616
3614
|
}
|
|
3617
3615
|
focusInput() {
|
|
@@ -3620,16 +3618,12 @@ const Q2Calendar = class {
|
|
|
3620
3618
|
}
|
|
3621
3619
|
checkActiveCellForBlankness() {
|
|
3622
3620
|
const activeElement = this.hostElement.shadowRoot.activeElement;
|
|
3623
|
-
if (!activeElement ||
|
|
3624
|
-
activeElement.tagName !== 'TD' ||
|
|
3625
|
-
!activeElement.hasAttribute('aria-hidden'))
|
|
3621
|
+
if (!activeElement || activeElement.tagName !== 'TD' || !activeElement.hasAttribute('aria-hidden'))
|
|
3626
3622
|
return;
|
|
3627
3623
|
const { calendarBody } = this;
|
|
3628
3624
|
const calendarCells = Array.from(calendarBody.querySelectorAll('td'));
|
|
3629
3625
|
const indexOfCell = Array.from(calendarCells).indexOf(activeElement);
|
|
3630
|
-
const dayToFocus = indexOfCell < 15
|
|
3631
|
-
? 1
|
|
3632
|
-
: calendarCells.filter(cell => !cell.hasAttribute('aria-hidden')).length;
|
|
3626
|
+
const dayToFocus = indexOfCell < 15 ? 1 : calendarCells.filter(cell => !cell.hasAttribute('aria-hidden')).length;
|
|
3633
3627
|
this.focusDay(this.generateDateFromDay(dayToFocus));
|
|
3634
3628
|
}
|
|
3635
3629
|
generateDateFromDay(day) {
|
|
@@ -3665,11 +3659,11 @@ const Q2Calendar = class {
|
|
|
3665
3659
|
this.setHints({
|
|
3666
3660
|
isValid: true,
|
|
3667
3661
|
message: `${index.loc('tecton.element.calendar.hint.selection')}: ${formatDateLong(inputDate)}`,
|
|
3668
|
-
messageType: 'success'
|
|
3662
|
+
messageType: 'success',
|
|
3669
3663
|
});
|
|
3670
3664
|
}
|
|
3671
3665
|
calendarField() {
|
|
3672
|
-
return (index$1.h("q2-input", { ref: el => (this.inputField = el), class: "calendar-input-field", value: this.formattedValue, label: index.loc(this.label), hideLabel: this.hideLabel, disabled: !!this.disabled, placeholder: this.computedPlaceholder, optional: !!this.optional, ariaExpanded: this.dropdownOpen
|
|
3666
|
+
return (index$1.h("q2-input", { ref: el => (this.inputField = el), class: "calendar-input-field", value: this.formattedValue, label: index.loc(this.label), hideLabel: this.hideLabel, disabled: !!this.disabled, readonly: !!this.readonly, placeholder: this.computedPlaceholder, optional: !!this.optional, ariaExpanded: `${!!this.dropdownOpen}`, errors: (this.localizedErrors.length > 0 && this.localizedErrors) ||
|
|
3673
3667
|
(this.invalid && ['tecton.element.calendar.invalid']) ||
|
|
3674
3668
|
[], onClick: this.onInputClick, onChange: this.onInputChange, onInput: this.onInputInput, onKeyDown: this.onInputKeydown, onKeyUp: this.onInputKeyup, onBlur: this.onInputBlur, "icon-right": "calendar", "format-modifier": this.isTypeable ? this.formatModifier : '', pseudo: !this.isTypeable, type: "date", "hide-messages": true, "test-id": "inputAndCalendarToggle" }));
|
|
3675
3669
|
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-7febb200.js');
|
|
6
|
+
const index$1 = require('./index-dd823ee6.js');
|
|
7
|
+
|
|
8
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block}button,a{--comp-border-radius:var(--tct-card-border-radius, var(--t-card-border-radius, var(--app-border-radius-1, 3px)));--comp-border-width:var(--tct-card-border-width, var(--t-card-border-width, 0px));position:relative;width:100%;text-align:start;cursor:pointer;height:100%;display:grid;gap:var(--tct-card-gap, var(--t-card-gap, var(--app-scale-3x, 15px)));margin:0;border:none;background:var(--tct-card-background, var(--t-card-background, var(--t-base, #ffffff)));padding:var(--tct-card-padding, var(--t-card-padding, var(--app-scale-4x, 20px)));color:var(--tct-card-color, var(--t-card-color, var(--t-text, #4d4d4d)));text-decoration:none;border-width:var(--comp-border-width);border-color:var(--tct-card-border-color, var(--t-card-border-color, transparent));border-style:solid;border-radius:var(--comp-border-radius);transition:box-shadow var(--tct-tween-1, var(--app-tween-1, 0.2s ease));box-shadow:var(--tct-card-box-shadow, var(--t-card-box-shadow, var(--app-shadow-2, 0 3px 6px rgba(0, 0, 0, 0.3))));--comp-avatar-size:var(--tct-card-avatar-size, var(--t-card-avatar-size, 44px));--comp-chevron-size:0}@media (hover: hover){button:hover,button:active,button:focus,a:hover,a:active,a:focus{color:var(--tct-card-color, var(--t-card-color, var(--t-text, #4d4d4d)))}button:hover,a:hover{box-shadow:var(--tct-card-hover-box-shadow, var(--t-card-hover-box-shadow, var(--app-shadow-3, 0 4px 12px rgba(0, 0, 0, 0.3))))}button:active,a:active{box-shadow:var(--tct-card-active-box-shadow, var(--t-card-active-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))))}}button.is-small,a.is-small{--comp-avatar-size:var(--tct-card-avatar-size, var(--t-card-avatar-size, 26px))}button.is-touch,a.is-touch{--comp-chevron-size:var(--tct-card-chevron-size, var(--t-card-chevron-size, 26px));grid-template-columns:1fr var(--comp-chevron-size)}button.has-avatar,a.has-avatar{grid-template-columns:var(--comp-avatar-size) 1fr;--tct-avatar-width:var(--comp-avatar-size);--tct-avatar-height:var(--comp-avatar-size);--tct-icon-size:var(--comp-avatar-size)}button.has-avatar.is-touch,a.has-avatar.is-touch{grid-template-columns:var(--comp-avatar-size) 1fr var(--comp-chevron-size)}.container{overflow:hidden;display:grid;gap:var(--tct-card-container-gap, var(--t-card-container-gap, var(--app-scale-1x, 5px)));align-content:start}h3,p{margin:0;padding:0;line-height:var(--tct-card-font-height, var(--t-card-font-height, 20px))}h3{font-weight:var(--tct-card-font-weight, var(--t-card-font-weight, 600));font-size:var(--tct-card-font-size, var(--t-card-font-size, 17px));text-overflow:ellipsis;overflow:hidden;white-space:nowrap}p{text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.bar{--comp-bar-border-radius:calc(var(--comp-border-radius) - var(--comp-border-width));border-radius:var(--comp-bar-border-radius) 0 0 var(--comp-bar-border-radius);position:absolute;inset:0 auto auto 0;width:var(--tct-card-bar-width, var(--t-card-bar-width, var(--app-scale-2x, 10px)));background:var(--comp-bar-color);height:100%}.touch-indicator{align-self:center;--tct-icon-size:var(--comp-chevron-size)}";
|
|
9
|
+
|
|
10
|
+
const SUPPORTED_THEME_COLORS = [
|
|
11
|
+
'primary',
|
|
12
|
+
'secondary',
|
|
13
|
+
'tertiary',
|
|
14
|
+
'accent-1',
|
|
15
|
+
'accent-2',
|
|
16
|
+
'accent-3',
|
|
17
|
+
'accent-4',
|
|
18
|
+
'accent-5',
|
|
19
|
+
'accent-6',
|
|
20
|
+
'accent-7',
|
|
21
|
+
'accent-8',
|
|
22
|
+
'accent-9',
|
|
23
|
+
'accent-10',
|
|
24
|
+
'accent-11',
|
|
25
|
+
'accent-12',
|
|
26
|
+
];
|
|
27
|
+
const STOPLIGHT_COLORS = ['info', 'success', 'warning', 'alert'];
|
|
28
|
+
const Q2Card = class {
|
|
29
|
+
constructor(hostRef) {
|
|
30
|
+
index.registerInstance(this, hostRef);
|
|
31
|
+
this.click = index.createEvent(this, "click", 7);
|
|
32
|
+
this.isTouch = index$1.isTouchDevice();
|
|
33
|
+
this.isAutoTouch = false;
|
|
34
|
+
this.isAutoSmall = false;
|
|
35
|
+
this.handleClick = (event) => {
|
|
36
|
+
if (this.url)
|
|
37
|
+
return true;
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
event.stopPropagation();
|
|
40
|
+
this.click.emit();
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
componentWillLoad() {
|
|
44
|
+
this.checkBar();
|
|
45
|
+
}
|
|
46
|
+
componentDidLoad() {
|
|
47
|
+
const { hostElement, clickableElement } = this;
|
|
48
|
+
hostElement.click = () => clickableElement.click();
|
|
49
|
+
index$1.overrideFocus(this.hostElement);
|
|
50
|
+
this.resizeObserver = new ResizeObserver(() => this.determineAutoSmall());
|
|
51
|
+
this.resizeObserver.observe(this.hostElement);
|
|
52
|
+
}
|
|
53
|
+
willDestroyElement() {
|
|
54
|
+
this.resizeObserver = null;
|
|
55
|
+
}
|
|
56
|
+
onHostElementFocus(event) {
|
|
57
|
+
if (!index$1.isEventFromElement(event, this.hostElement))
|
|
58
|
+
return;
|
|
59
|
+
this.clickableElement.focus();
|
|
60
|
+
}
|
|
61
|
+
checkBar() {
|
|
62
|
+
const { bar } = this;
|
|
63
|
+
if (!bar)
|
|
64
|
+
return;
|
|
65
|
+
if (SUPPORTED_THEME_COLORS.includes(bar)) {
|
|
66
|
+
this.barColor = `var(--t-${bar})`;
|
|
67
|
+
}
|
|
68
|
+
else if (STOPLIGHT_COLORS.includes(bar)) {
|
|
69
|
+
this.barColor = `var(--const-stoplight-${bar})`;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.barColor = bar;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
determineAutoTouch() {
|
|
76
|
+
if (this.hostElement.hasAttribute('is-touch'))
|
|
77
|
+
return;
|
|
78
|
+
this.isAutoTouch = index$1.isTouchDevice();
|
|
79
|
+
}
|
|
80
|
+
determineAutoSmall() {
|
|
81
|
+
var _a, _b;
|
|
82
|
+
if (this.hostElement.hasAttribute('is-small'))
|
|
83
|
+
return;
|
|
84
|
+
const { containerElement, avatarElement } = this;
|
|
85
|
+
const avatarWidth = (_a = avatarElement === null || avatarElement === void 0 ? void 0 : avatarElement.offsetWidth) !== null && _a !== void 0 ? _a : 0;
|
|
86
|
+
const containerWidth = (_b = containerElement === null || containerElement === void 0 ? void 0 : containerElement.offsetWidth) !== null && _b !== void 0 ? _b : 0;
|
|
87
|
+
const totalWidth = avatarWidth + containerWidth;
|
|
88
|
+
this.isAutoSmall = totalWidth < 350;
|
|
89
|
+
}
|
|
90
|
+
generateAvatar() {
|
|
91
|
+
const { avatarName, avatarInitials, avatarSrc, avatarIcon } = this;
|
|
92
|
+
if (avatarIcon) {
|
|
93
|
+
return (index.h("q2-icon", { type: avatarIcon, ref: e => (this.avatarElement = e), "test-id": "avatar" }));
|
|
94
|
+
}
|
|
95
|
+
else if (avatarName || avatarInitials || avatarSrc) {
|
|
96
|
+
return (index.h("q2-avatar", { name: avatarName, initials: avatarInitials, src: avatarSrc, ref: e => (this.avatarElement = e), "test-id": "avatar" }));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
generateContent() {
|
|
100
|
+
return (index.h(index.Fragment, null, this.bar && (index.h("div", { class: "bar", "test-id": "bar", style: { '--comp-bar-color': this.barColor } })), this.generateAvatar(), index.h("div", { class: "container", "test-id": "contentContainer", ref: e => (this.containerElement = e) }, this.title && index.h("h3", { "test-id": "title" }, this.title), this.description && index.h("p", { "test-id": "description" }, this.description)), this.isTouch && (index.h("q2-icon", { "test-id": "touchIndicator", type: "chevron-right", class: "touch-indicator" }))));
|
|
101
|
+
}
|
|
102
|
+
generateContainerClasses() {
|
|
103
|
+
const { isSmall, isAutoSmall, avatarName, avatarInitials, avatarSrc, avatarIcon, isTouch, isAutoTouch } = this;
|
|
104
|
+
const result = [];
|
|
105
|
+
const showSmall = isSmall || isAutoSmall;
|
|
106
|
+
const showTouch = isTouch || isAutoTouch;
|
|
107
|
+
const hasAvatar = avatarName || avatarInitials || avatarSrc || avatarIcon;
|
|
108
|
+
if (showSmall)
|
|
109
|
+
result.push('is-small');
|
|
110
|
+
if (showTouch)
|
|
111
|
+
result.push('is-touch');
|
|
112
|
+
if (hasAvatar)
|
|
113
|
+
result.push('has-avatar');
|
|
114
|
+
return result.join(' ');
|
|
115
|
+
}
|
|
116
|
+
render() {
|
|
117
|
+
const { url } = this;
|
|
118
|
+
return !!url ? (index.h("a", { ref: e => (this.clickableElement = e), href: this.url, class: this.generateContainerClasses(), target: this.target, rel: "noopener noreferrer", "test-id": "clickableElement", onClick: this.handleClick }, this.generateContent())) : (index.h("button", { ref: e => (this.clickableElement = e), class: this.generateContainerClasses(), "test-id": "clickableElement", type: "button", onClick: this.handleClick }, this.generateContent()));
|
|
119
|
+
}
|
|
120
|
+
get hostElement() { return index.getElement(this); }
|
|
121
|
+
static get watchers() { return {
|
|
122
|
+
"bar": ["checkBar"]
|
|
123
|
+
}; }
|
|
124
|
+
};
|
|
125
|
+
Q2Card.style = stylesCss;
|
|
126
|
+
|
|
127
|
+
exports.q2_card = Q2Card;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const index$1 = require('./index-
|
|
5
|
+
const index = require('./index-7febb200.js');
|
|
6
|
+
const index$1 = require('./index-dd823ee6.js');
|
|
7
7
|
|
|
8
|
-
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}q2-carousel .swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;transition:all 0.2s}q2-carousel-pane.q2-carousel-pane{cursor:grab}q2-carousel-pane.q2-carousel-pane:not([is-active-pane]) *{cursor:pointer}q2-carousel-pane.q2-carousel-pane:focus{box-shadow:none}q2-carousel-pane.q2-carousel-pane:focus .q2-carousel-pane-main-content{outline:none;box-shadow:var(--tct-global-focus, var(--const-global-focus, 0 0 0 2px #33b4ff))}q2-carousel-pane.q2-carousel-pane .q2-carousel-pane-main-content{box-shadow:0px 2px 8px 0px var(--t-top-a1, rgba(0, 0, 0, 0.25));background-color:var(--tct-carousel-background-color, var(--t-carousel-background-color, var(--tct-white, var(--app-white, #ffffff))));border:var(--tct-carousel-pane-border-width, var(--t-carousel-pane-border-width,
|
|
8
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}q2-carousel .swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;transition:all 0.2s}q2-carousel-pane.q2-carousel-pane{--comp-carousel-pane-tween:var(--tct-tween-1, var(--app-tween-1, 0.2s ease));cursor:grab}q2-carousel-pane.q2-carousel-pane:not([is-active-pane]) *{cursor:pointer}q2-carousel-pane.q2-carousel-pane:focus{box-shadow:none}q2-carousel-pane.q2-carousel-pane:focus .q2-carousel-pane-main-content{outline:none;box-shadow:var(--tct-global-focus, var(--const-global-focus, 0 0 0 2px #33b4ff))}q2-carousel-pane.q2-carousel-pane .q2-carousel-pane-main-content{box-shadow:var(--app-shadow-2, 0px 2px 8px 0px var(--t-top-a1, rgba(0, 0, 0, 0.25)));transition:var(--comp-carousel-pane-tween);background-color:var(--tct-carousel-background-color, var(--t-carousel-background-color, var(--tct-white, var(--app-white, #ffffff))));border:var(--tct-carousel-pane-border-width, var(--t-carousel-pane-border-width, 0px)) solid var(--tct-carousel-pane-border-color, var(--t-carousel-pane-border-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc))))));border-radius:var(--tct-carousel-pane-border-radius, var(--t-carousel-pane-border-radius, 8px));padding:var(--tct-carousel-pane-padding, var(--t-carousel-pane-padding, 0.5rem 0.5rem 0.5rem 0.5rem));height:var(--tct-carousel-pane-height, var(--t-carousel-pane-height, 10em))}q2-carousel-pane.q2-carousel-pane .q2-carousel-pane-main-content:hover{box-shadow:var(--app-shadow-3, 0px 2px 8px 0px var(--t-top-a1, rgba(0, 0, 0, 0.25)))}";
|
|
9
9
|
|
|
10
10
|
const Q2Carousel = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -20,7 +20,7 @@ const Q2Carousel = class {
|
|
|
20
20
|
event.preventDefault();
|
|
21
21
|
this.clickCarouselPane.emit({
|
|
22
22
|
paneIndex: this.index,
|
|
23
|
-
pane: this.hostElement
|
|
23
|
+
pane: this.hostElement,
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
}
|
|
@@ -61,7 +61,7 @@ const Q2Carousel = class {
|
|
|
61
61
|
? index$1.loc(label)
|
|
62
62
|
: index$1.loc('tecton.element.carousel.itemDescription', [
|
|
63
63
|
(this.currentPaneIndex + 1).toString(),
|
|
64
|
-
(this.siblingCount || 0).toString()
|
|
64
|
+
(this.siblingCount || 0).toString(),
|
|
65
65
|
]), onClick: this.paneClicked }, index.h("article", { class: "q2-carousel-pane-main-content" }, index.h("slot", null))));
|
|
66
66
|
}
|
|
67
67
|
get hostElement() { return index.getElement(this); }
|