sas-ui 0.8.204 → 0.8.206
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/sas-alert_26.cjs.entry.js +13 -34
- package/dist/cjs/sas-date-field.cjs.entry.js +1 -6
- package/dist/cjs/sas-menu-bar.cjs.entry.js +11 -7
- package/dist/collection/components/sas-date-field/sas-date-field.js +2 -7
- package/dist/collection/components/sas-form-input-template/sas-form-input-template.css +3 -8
- package/dist/collection/components/sas-form-input-template/sas-form-input-template.js +13 -34
- package/dist/collection/components/sas-menu-bar/sas-menu-bar.js +12 -8
- package/dist/custom-elements/index.js +25 -47
- package/dist/esm/sas-alert_26.entry.js +13 -34
- package/dist/esm/sas-date-field.entry.js +1 -6
- package/dist/esm/sas-menu-bar.entry.js +11 -7
- package/dist/sas-ui/p-23f18100.entry.js +1 -0
- package/dist/sas-ui/{p-d1359a35.entry.js → p-615dcb12.entry.js} +1 -1
- package/dist/sas-ui/p-79bca924.entry.js +1 -0
- package/dist/sas-ui/sas-ui.esm.js +1 -1
- package/dist/types/components/sas-menu-bar/sas-menu-bar.d.ts +2 -1
- package/package.json +1 -1
- package/dist/sas-ui/p-2e12716f.entry.js +0 -1
- package/dist/sas-ui/p-3f91b3b2.entry.js +0 -1
|
@@ -1499,7 +1499,7 @@ let SasForm = class {
|
|
|
1499
1499
|
};
|
|
1500
1500
|
SasForm.style = sasFormCss;
|
|
1501
1501
|
|
|
1502
|
-
const sasFormInputTemplateCss = ":host{display:block;position:relative;height:100%}:host .container{overflow-y:auto;position:absolute;min-width:var(--form-input-template-container-min-width, 100%);max-width:var(--form-input-template-container-max-width, none);background-color:white;height:0;z-index:-15;pointer-events:none}:host .top{transform:translateY(-100%);top:0}:host .right{right:0}:host
|
|
1502
|
+
const sasFormInputTemplateCss = ":host{display:block;position:relative;height:100%}:host .hide{display:none}:host .container{overflow-y:auto;position:absolute;min-width:var(--form-input-template-container-min-width, 100%);max-width:var(--form-input-template-container-max-width, none);background-color:white;height:0;z-index:-15;pointer-events:none}:host .top{transform:translateY(-100%);top:0}:host .right{right:0}:host(:focus){outline:none}:host(:focus-within)>.container{padding:10px 0;height:auto;overflow:visible;z-index:15;pointer-events:initial;box-shadow:0px 5px 10px #0000001A;border:1px solid #D0D9DE;border-radius:5px}:host(:not([label=\"\"])) .top{transform:translateY(-100%);top:0}:host(:not([label=\"\"])[outside]:not([outside=false])) .top{transform:translateY(calc(-100% + 30px));top:0}:host:after{content:attr(data-message);position:absolute;top:calc(100% + 5px);right:10px;color:var(--li-2);font-size:12px;text-align:right}";
|
|
1503
1503
|
|
|
1504
1504
|
let SasFormInputTemplate = class {
|
|
1505
1505
|
constructor(hostRef) {
|
|
@@ -1584,36 +1584,28 @@ let SasFormInputTemplate = class {
|
|
|
1584
1584
|
*/
|
|
1585
1585
|
this.minimumPixelsRightOfComponentRequired = 0;
|
|
1586
1586
|
this.handleInputClick = (event) => {
|
|
1587
|
-
console.log("handleInputClick");
|
|
1588
1587
|
event.stopPropagation();
|
|
1589
1588
|
if (!this.disabled) {
|
|
1590
1589
|
const container = this.el.shadowRoot.querySelector('.container');
|
|
1591
1590
|
const height = container.getBoundingClientRect().height;
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
// this.show = true;
|
|
1599
|
-
// }
|
|
1600
|
-
this.show = true;
|
|
1601
|
-
console.log(`handleInputClick: show: ${this.show}`);
|
|
1591
|
+
if (height > 0) {
|
|
1592
|
+
this.show = false;
|
|
1593
|
+
}
|
|
1594
|
+
else {
|
|
1595
|
+
this.show = true;
|
|
1596
|
+
}
|
|
1602
1597
|
this.inputContainerClick.emit();
|
|
1603
1598
|
}
|
|
1604
1599
|
};
|
|
1605
1600
|
this.handleContainerClick = (event) => {
|
|
1606
|
-
console.log("handleContainerClick");
|
|
1607
1601
|
event.stopPropagation();
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
// }
|
|
1602
|
+
if (this.clickClose) {
|
|
1603
|
+
setTimeout(() => {
|
|
1604
|
+
this.show = false;
|
|
1605
|
+
}, 100);
|
|
1606
|
+
}
|
|
1614
1607
|
};
|
|
1615
1608
|
this.updateContainerPosition = () => {
|
|
1616
|
-
console.log("updateContainerPosition");
|
|
1617
1609
|
this.updateVerticalContainerPosition();
|
|
1618
1610
|
this.updateContainerHorizontalPosition();
|
|
1619
1611
|
};
|
|
@@ -1624,8 +1616,6 @@ let SasFormInputTemplate = class {
|
|
|
1624
1616
|
else {
|
|
1625
1617
|
const top = this.el.getBoundingClientRect().top;
|
|
1626
1618
|
const clientHeight = document.documentElement.clientHeight;
|
|
1627
|
-
console.log(`updateVerticalContainerPosition: top: ${top}`);
|
|
1628
|
-
console.log(`updateVerticalContainerPosition: clientHeight: ${clientHeight}`);
|
|
1629
1619
|
if (clientHeight < top * 2 && top > this.minimumPixelsAboveComponentRequired) {
|
|
1630
1620
|
this.containerVerticalPosition = 'top';
|
|
1631
1621
|
}
|
|
@@ -1633,7 +1623,6 @@ let SasFormInputTemplate = class {
|
|
|
1633
1623
|
this.containerVerticalPosition = 'bottom';
|
|
1634
1624
|
}
|
|
1635
1625
|
}
|
|
1636
|
-
console.log(`updateVerticalContainerPosition: containerVerticalPosition: ${this.containerVerticalPosition}`);
|
|
1637
1626
|
};
|
|
1638
1627
|
this.updateContainerHorizontalPosition = () => {
|
|
1639
1628
|
if (Boolean(this.positionH)) {
|
|
@@ -1642,8 +1631,6 @@ let SasFormInputTemplate = class {
|
|
|
1642
1631
|
else {
|
|
1643
1632
|
const left = this.el.getBoundingClientRect().left;
|
|
1644
1633
|
const clientWidth = document.documentElement.clientWidth;
|
|
1645
|
-
console.log(`updateContainerHorizontalPosition: left: ${left}`);
|
|
1646
|
-
console.log(`updateContainerHorizontalPosition: clientWidth: ${clientWidth}`);
|
|
1647
1634
|
if (clientWidth - this.minimumPixelsRightOfComponentRequired > left) {
|
|
1648
1635
|
this.containerHorizontalPosition = 'left';
|
|
1649
1636
|
}
|
|
@@ -1651,7 +1638,6 @@ let SasFormInputTemplate = class {
|
|
|
1651
1638
|
this.containerHorizontalPosition = 'right';
|
|
1652
1639
|
}
|
|
1653
1640
|
}
|
|
1654
|
-
console.log(`updateContainerHorizontalPosition: containerHorizontalPosition: ${this.containerHorizontalPosition}`);
|
|
1655
1641
|
};
|
|
1656
1642
|
}
|
|
1657
1643
|
showHandler(newValue) {
|
|
@@ -1668,22 +1654,15 @@ let SasFormInputTemplate = class {
|
|
|
1668
1654
|
this.el.focus();
|
|
1669
1655
|
}
|
|
1670
1656
|
showContainer() {
|
|
1671
|
-
console.log("showContainer");
|
|
1672
1657
|
const element = this.el.shadowRoot.querySelector('.container');
|
|
1673
|
-
console.log("showContainer: element");
|
|
1674
|
-
console.log(element);
|
|
1675
1658
|
element.classList.remove('hide');
|
|
1676
1659
|
}
|
|
1677
1660
|
hideContainer() {
|
|
1678
|
-
console.log("hideContainer");
|
|
1679
1661
|
const element = this.el.shadowRoot.querySelector('.container');
|
|
1680
|
-
console.log("hideContainer: element");
|
|
1681
|
-
console.log(element);
|
|
1682
1662
|
element.classList.add('hide');
|
|
1683
1663
|
}
|
|
1684
1664
|
render() {
|
|
1685
|
-
|
|
1686
|
-
return (index.h(index.Host, { tabindex: 0, "data-message": "" }, index.h("sas-input", { label: this.label, outside: this.outside, required: this.required, type: this.type, placeholder: this.placeholder, "icon-right": this.iconRight, value: this.value, min: this.min, max: this.max, readonly: this.readonly, disabled: this.disabled, clear: this.clear, onKeyDown: global.keydownEvent, tabindex: 0,
|
|
1665
|
+
return (index.h(index.Host, { onFocus: this.updateContainerPosition, tabindex: 0, "data-message": "" }, index.h("sas-input", { label: this.label, outside: this.outside, required: this.required, type: this.type, placeholder: this.placeholder, "icon-right": this.iconRight, value: this.value, min: this.min, max: this.max, readonly: this.readonly, disabled: this.disabled, clear: this.clear, onKeyDown: global.keydownEvent, tabindex: 0,
|
|
1687
1666
|
// mouseDown event is faster than focus event, click event is slower than focus event
|
|
1688
1667
|
onMouseDown: this.handleInputClick }, index.h("slot", { name: "input" })), index.h("div", { class: `container hide ${this.containerVerticalPosition} ${this.containerHorizontalPosition}`, onMouseDown: this.handleContainerClick }, index.h("slot", { name: "container" }))));
|
|
1689
1668
|
}
|
|
@@ -152,10 +152,8 @@ let SasDateField = class {
|
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
this.handleButtonClick = (event) => {
|
|
155
|
-
console.log("handleButtonClick: start");
|
|
156
155
|
event.stopPropagation();
|
|
157
156
|
if (!event.target.disabled) {
|
|
158
|
-
console.log("handleButtonClick: inside if statement - start");
|
|
159
157
|
this.localDate.setDate(Number(event.target.text));
|
|
160
158
|
this.localDate.setHours(0, 0, 0, 0);
|
|
161
159
|
this.value = this.localDate.toISOString();
|
|
@@ -163,10 +161,8 @@ let SasDateField = class {
|
|
|
163
161
|
this.datefieldupdate.emit(this.value);
|
|
164
162
|
// usage 1: close date table after click if button is not disabled
|
|
165
163
|
// usage 2: when used inside dropdown, keep focus so dropdown container will not close
|
|
166
|
-
this.el.focus(
|
|
167
|
-
console.log("handleButtonClick: inside if statement - end");
|
|
164
|
+
this.el.focus();
|
|
168
165
|
}
|
|
169
|
-
console.log("handleButtonClick: end");
|
|
170
166
|
};
|
|
171
167
|
}
|
|
172
168
|
// handle value set by js
|
|
@@ -432,7 +428,6 @@ let SasDateField = class {
|
|
|
432
428
|
return '';
|
|
433
429
|
}
|
|
434
430
|
render() {
|
|
435
|
-
console.log("sas-date-field: render()");
|
|
436
431
|
return (index.h(index.Host, { tabindex: "0" }, index.h("sas-form-input-template", { label: this.label, outside: this.outside, required: this.required, value: this.getLocalDateString(this.value), iconRight: this.icon, type: "date", disabled: this.disabled, clear: this.clear, "data-message": this.message, position: this.position, "position-h": this.positionH, minimumPixelsAboveComponentRequired: 400, minimumPixelsRightOfComponentRequired: 300 }, index.h("div", { slot: "container", class: "container", tabindex: -1 }, index.h("div", { class: "title", tabindex: 0 }, index.h("sas-icon", { class: `prev-year-icon ${this.checkIsDateLimit(this.min) ? 'disabled' : ''}`, tabindex: 0, icon: "far fa-angle-double-left", onClick: this.goToPrevYear, onKeyDown: global.keydownEvent }), index.h("sas-icon", { class: `prev-month-icon ${this.checkIsDateLimit(this.min) ? 'disabled' : ''}`, tabindex: 0, icon: "far fa-angle-left", onClick: this.goToPrevMonth, onKeyDown: global.keydownEvent }), index.h("span", { class: "title-content" }, this.getTitleText()), index.h("sas-icon", { class: `next-month-icon ${this.checkIsDateLimit(this.max) ? 'disabled' : ''}`, tabindex: 0, icon: "far fa-angle-right", onClick: this.goToNextMonth, onKeyDown: global.keydownEvent }), index.h("sas-icon", { class: `next-year-icon ${this.checkIsDateLimit(this.max) ? 'disabled' : ''}`, tabindex: 0, icon: "far fa-angle-double-right", onClick: this.goToNextYear, onKeyDown: global.keydownEvent })), index.h("sas-table", { class: "date-table", headers: this.titles, items: this.generateDateContent(), tabindex: 0 })))));
|
|
437
432
|
}
|
|
438
433
|
get el() { return index.getElement(this); }
|
|
@@ -937,6 +937,8 @@ let SasMenuBar = class {
|
|
|
937
937
|
constructor(hostRef) {
|
|
938
938
|
index$1.registerInstance(this, hostRef);
|
|
939
939
|
this.moreFilterButtonWidth = 190;
|
|
940
|
+
// Prevents resize when input in filter slots cause scroll bar being added to the page
|
|
941
|
+
this.preventUpdateLayoutCallDueToRecentInputInteraction = false;
|
|
940
942
|
/**
|
|
941
943
|
* Sticky
|
|
942
944
|
*/
|
|
@@ -1013,10 +1015,10 @@ let SasMenuBar = class {
|
|
|
1013
1015
|
}
|
|
1014
1016
|
componentDidLoad() {
|
|
1015
1017
|
const resizeObserver = new index((entries) => {
|
|
1016
|
-
entries.forEach((
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1018
|
+
entries.forEach(() => {
|
|
1019
|
+
if (this.preventUpdateLayoutCallDueToRecentInputInteraction === false) {
|
|
1020
|
+
this.updateLayout();
|
|
1021
|
+
}
|
|
1020
1022
|
});
|
|
1021
1023
|
});
|
|
1022
1024
|
const filterContainer = this.el.shadowRoot.querySelector('.filter');
|
|
@@ -1042,9 +1044,11 @@ let SasMenuBar = class {
|
|
|
1042
1044
|
this.updateBadgeNumber();
|
|
1043
1045
|
}
|
|
1044
1046
|
}
|
|
1045
|
-
inputinputContainerClickEventInternalHandler(
|
|
1046
|
-
|
|
1047
|
-
|
|
1047
|
+
inputinputContainerClickEventInternalHandler() {
|
|
1048
|
+
this.preventUpdateLayoutCallDueToRecentInputInteraction = true;
|
|
1049
|
+
setTimeout(() => {
|
|
1050
|
+
this.preventUpdateLayoutCallDueToRecentInputInteraction = false;
|
|
1051
|
+
}, 10);
|
|
1048
1052
|
}
|
|
1049
1053
|
updateLayout() {
|
|
1050
1054
|
let shouldKeepFocus = false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, Host, h, Prop, Element, State, Event, Watch, Listen, Method, } from '@stencil/core';
|
|
2
2
|
import { keydownEvent } from '../../global/global';
|
|
3
3
|
export class SasDateField {
|
|
4
4
|
constructor() {
|
|
@@ -141,10 +141,8 @@ export class SasDateField {
|
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
143
|
this.handleButtonClick = (event) => {
|
|
144
|
-
console.log("handleButtonClick: start");
|
|
145
144
|
event.stopPropagation();
|
|
146
145
|
if (!event.target.disabled) {
|
|
147
|
-
console.log("handleButtonClick: inside if statement - start");
|
|
148
146
|
this.localDate.setDate(Number(event.target.text));
|
|
149
147
|
this.localDate.setHours(0, 0, 0, 0);
|
|
150
148
|
this.value = this.localDate.toISOString();
|
|
@@ -152,10 +150,8 @@ export class SasDateField {
|
|
|
152
150
|
this.datefieldupdate.emit(this.value);
|
|
153
151
|
// usage 1: close date table after click if button is not disabled
|
|
154
152
|
// usage 2: when used inside dropdown, keep focus so dropdown container will not close
|
|
155
|
-
this.el.focus(
|
|
156
|
-
console.log("handleButtonClick: inside if statement - end");
|
|
153
|
+
this.el.focus();
|
|
157
154
|
}
|
|
158
|
-
console.log("handleButtonClick: end");
|
|
159
155
|
};
|
|
160
156
|
}
|
|
161
157
|
// handle value set by js
|
|
@@ -421,7 +417,6 @@ export class SasDateField {
|
|
|
421
417
|
return '';
|
|
422
418
|
}
|
|
423
419
|
render() {
|
|
424
|
-
console.log("sas-date-field: render()");
|
|
425
420
|
return (h(Host, { tabindex: "0" },
|
|
426
421
|
h("sas-form-input-template", { label: this.label, outside: this.outside, required: this.required, value: this.getLocalDateString(this.value), iconRight: this.icon, type: "date", disabled: this.disabled, clear: this.clear, "data-message": this.message, position: this.position, "position-h": this.positionH, minimumPixelsAboveComponentRequired: 400, minimumPixelsRightOfComponentRequired: 300 },
|
|
427
422
|
h("div", { slot: "container", class: "container", tabindex: -1 },
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
position: relative;
|
|
8
8
|
height: 100%;
|
|
9
9
|
}
|
|
10
|
+
:host .hide {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
10
13
|
:host .container {
|
|
11
14
|
overflow-y: auto;
|
|
12
15
|
position: absolute;
|
|
@@ -24,14 +27,6 @@
|
|
|
24
27
|
:host .right {
|
|
25
28
|
right: 0;
|
|
26
29
|
}
|
|
27
|
-
:host .bottom {
|
|
28
|
-
border: 5px solid red;
|
|
29
|
-
top: 0;
|
|
30
|
-
}
|
|
31
|
-
:host .left {
|
|
32
|
-
border: 5px solid red;
|
|
33
|
-
left: 0;
|
|
34
|
-
}
|
|
35
30
|
|
|
36
31
|
:host(:focus) {
|
|
37
32
|
outline: none;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, Host, h, Prop, Element, Watch, Event, Listen, } from '@stencil/core';
|
|
2
2
|
import { keydownEvent } from '../../global/global';
|
|
3
3
|
export class SasFormInputTemplate {
|
|
4
4
|
constructor() {
|
|
@@ -81,36 +81,28 @@ export class SasFormInputTemplate {
|
|
|
81
81
|
*/
|
|
82
82
|
this.minimumPixelsRightOfComponentRequired = 0;
|
|
83
83
|
this.handleInputClick = (event) => {
|
|
84
|
-
console.log("handleInputClick");
|
|
85
84
|
event.stopPropagation();
|
|
86
85
|
if (!this.disabled) {
|
|
87
86
|
const container = this.el.shadowRoot.querySelector('.container');
|
|
88
87
|
const height = container.getBoundingClientRect().height;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
// this.show = true;
|
|
96
|
-
// }
|
|
97
|
-
this.show = true;
|
|
98
|
-
console.log(`handleInputClick: show: ${this.show}`);
|
|
88
|
+
if (height > 0) {
|
|
89
|
+
this.show = false;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
this.show = true;
|
|
93
|
+
}
|
|
99
94
|
this.inputContainerClick.emit();
|
|
100
95
|
}
|
|
101
96
|
};
|
|
102
97
|
this.handleContainerClick = (event) => {
|
|
103
|
-
console.log("handleContainerClick");
|
|
104
98
|
event.stopPropagation();
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
// }
|
|
99
|
+
if (this.clickClose) {
|
|
100
|
+
setTimeout(() => {
|
|
101
|
+
this.show = false;
|
|
102
|
+
}, 100);
|
|
103
|
+
}
|
|
111
104
|
};
|
|
112
105
|
this.updateContainerPosition = () => {
|
|
113
|
-
console.log("updateContainerPosition");
|
|
114
106
|
this.updateVerticalContainerPosition();
|
|
115
107
|
this.updateContainerHorizontalPosition();
|
|
116
108
|
};
|
|
@@ -121,8 +113,6 @@ export class SasFormInputTemplate {
|
|
|
121
113
|
else {
|
|
122
114
|
const top = this.el.getBoundingClientRect().top;
|
|
123
115
|
const clientHeight = document.documentElement.clientHeight;
|
|
124
|
-
console.log(`updateVerticalContainerPosition: top: ${top}`);
|
|
125
|
-
console.log(`updateVerticalContainerPosition: clientHeight: ${clientHeight}`);
|
|
126
116
|
if (clientHeight < top * 2 && top > this.minimumPixelsAboveComponentRequired) {
|
|
127
117
|
this.containerVerticalPosition = 'top';
|
|
128
118
|
}
|
|
@@ -130,7 +120,6 @@ export class SasFormInputTemplate {
|
|
|
130
120
|
this.containerVerticalPosition = 'bottom';
|
|
131
121
|
}
|
|
132
122
|
}
|
|
133
|
-
console.log(`updateVerticalContainerPosition: containerVerticalPosition: ${this.containerVerticalPosition}`);
|
|
134
123
|
};
|
|
135
124
|
this.updateContainerHorizontalPosition = () => {
|
|
136
125
|
if (Boolean(this.positionH)) {
|
|
@@ -139,8 +128,6 @@ export class SasFormInputTemplate {
|
|
|
139
128
|
else {
|
|
140
129
|
const left = this.el.getBoundingClientRect().left;
|
|
141
130
|
const clientWidth = document.documentElement.clientWidth;
|
|
142
|
-
console.log(`updateContainerHorizontalPosition: left: ${left}`);
|
|
143
|
-
console.log(`updateContainerHorizontalPosition: clientWidth: ${clientWidth}`);
|
|
144
131
|
if (clientWidth - this.minimumPixelsRightOfComponentRequired > left) {
|
|
145
132
|
this.containerHorizontalPosition = 'left';
|
|
146
133
|
}
|
|
@@ -148,7 +135,6 @@ export class SasFormInputTemplate {
|
|
|
148
135
|
this.containerHorizontalPosition = 'right';
|
|
149
136
|
}
|
|
150
137
|
}
|
|
151
|
-
console.log(`updateContainerHorizontalPosition: containerHorizontalPosition: ${this.containerHorizontalPosition}`);
|
|
152
138
|
};
|
|
153
139
|
}
|
|
154
140
|
showHandler(newValue) {
|
|
@@ -165,22 +151,15 @@ export class SasFormInputTemplate {
|
|
|
165
151
|
this.el.focus();
|
|
166
152
|
}
|
|
167
153
|
showContainer() {
|
|
168
|
-
console.log("showContainer");
|
|
169
154
|
const element = this.el.shadowRoot.querySelector('.container');
|
|
170
|
-
console.log("showContainer: element");
|
|
171
|
-
console.log(element);
|
|
172
155
|
element.classList.remove('hide');
|
|
173
156
|
}
|
|
174
157
|
hideContainer() {
|
|
175
|
-
console.log("hideContainer");
|
|
176
158
|
const element = this.el.shadowRoot.querySelector('.container');
|
|
177
|
-
console.log("hideContainer: element");
|
|
178
|
-
console.log(element);
|
|
179
159
|
element.classList.add('hide');
|
|
180
160
|
}
|
|
181
161
|
render() {
|
|
182
|
-
|
|
183
|
-
return (h(Host, { tabindex: 0, "data-message": "" },
|
|
162
|
+
return (h(Host, { onFocus: this.updateContainerPosition, tabindex: 0, "data-message": "" },
|
|
184
163
|
h("sas-input", { label: this.label, outside: this.outside, required: this.required, type: this.type, placeholder: this.placeholder, "icon-right": this.iconRight, value: this.value, min: this.min, max: this.max, readonly: this.readonly, disabled: this.disabled, clear: this.clear, onKeyDown: keydownEvent, tabindex: 0,
|
|
185
164
|
// mouseDown event is faster than focus event, click event is slower than focus event
|
|
186
165
|
onMouseDown: this.handleInputClick },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, Host, h, Prop, Element, Listen, } from '@stencil/core';
|
|
2
2
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
3
3
|
/**
|
|
4
4
|
* @slot bulk-action - used for bulk action content
|
|
@@ -9,6 +9,8 @@ import ResizeObserver from 'resize-observer-polyfill';
|
|
|
9
9
|
export class SasMenuBar {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.moreFilterButtonWidth = 190;
|
|
12
|
+
// Prevents resize when input in filter slots cause scroll bar being added to the page
|
|
13
|
+
this.preventUpdateLayoutCallDueToRecentInputInteraction = false;
|
|
12
14
|
/**
|
|
13
15
|
* Sticky
|
|
14
16
|
*/
|
|
@@ -85,10 +87,10 @@ export class SasMenuBar {
|
|
|
85
87
|
}
|
|
86
88
|
componentDidLoad() {
|
|
87
89
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
88
|
-
entries.forEach((
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
entries.forEach(() => {
|
|
91
|
+
if (this.preventUpdateLayoutCallDueToRecentInputInteraction === false) {
|
|
92
|
+
this.updateLayout();
|
|
93
|
+
}
|
|
92
94
|
});
|
|
93
95
|
});
|
|
94
96
|
const filterContainer = this.el.shadowRoot.querySelector('.filter');
|
|
@@ -114,9 +116,11 @@ export class SasMenuBar {
|
|
|
114
116
|
this.updateBadgeNumber();
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
|
-
inputinputContainerClickEventInternalHandler(
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
inputinputContainerClickEventInternalHandler() {
|
|
120
|
+
this.preventUpdateLayoutCallDueToRecentInputInteraction = true;
|
|
121
|
+
setTimeout(() => {
|
|
122
|
+
this.preventUpdateLayoutCallDueToRecentInputInteraction = false;
|
|
123
|
+
}, 10);
|
|
120
124
|
}
|
|
121
125
|
updateLayout() {
|
|
122
126
|
let shouldKeepFocus = false;
|
|
@@ -6291,10 +6291,8 @@ let SasDateField$1 = class extends H {
|
|
|
6291
6291
|
}
|
|
6292
6292
|
};
|
|
6293
6293
|
this.handleButtonClick = (event) => {
|
|
6294
|
-
console.log("handleButtonClick: start");
|
|
6295
6294
|
event.stopPropagation();
|
|
6296
6295
|
if (!event.target.disabled) {
|
|
6297
|
-
console.log("handleButtonClick: inside if statement - start");
|
|
6298
6296
|
this.localDate.setDate(Number(event.target.text));
|
|
6299
6297
|
this.localDate.setHours(0, 0, 0, 0);
|
|
6300
6298
|
this.value = this.localDate.toISOString();
|
|
@@ -6302,10 +6300,8 @@ let SasDateField$1 = class extends H {
|
|
|
6302
6300
|
this.datefieldupdate.emit(this.value);
|
|
6303
6301
|
// usage 1: close date table after click if button is not disabled
|
|
6304
6302
|
// usage 2: when used inside dropdown, keep focus so dropdown container will not close
|
|
6305
|
-
this.el.focus(
|
|
6306
|
-
console.log("handleButtonClick: inside if statement - end");
|
|
6303
|
+
this.el.focus();
|
|
6307
6304
|
}
|
|
6308
|
-
console.log("handleButtonClick: end");
|
|
6309
6305
|
};
|
|
6310
6306
|
}
|
|
6311
6307
|
// handle value set by js
|
|
@@ -6571,7 +6567,6 @@ let SasDateField$1 = class extends H {
|
|
|
6571
6567
|
return '';
|
|
6572
6568
|
}
|
|
6573
6569
|
render() {
|
|
6574
|
-
console.log("sas-date-field: render()");
|
|
6575
6570
|
return (h(Host, { tabindex: "0" }, h("sas-form-input-template", { label: this.label, outside: this.outside, required: this.required, value: this.getLocalDateString(this.value), iconRight: this.icon, type: "date", disabled: this.disabled, clear: this.clear, "data-message": this.message, position: this.position, "position-h": this.positionH, minimumPixelsAboveComponentRequired: 400, minimumPixelsRightOfComponentRequired: 300 }, h("div", { slot: "container", class: "container", tabindex: -1 }, h("div", { class: "title", tabindex: 0 }, h("sas-icon", { class: `prev-year-icon ${this.checkIsDateLimit(this.min) ? 'disabled' : ''}`, tabindex: 0, icon: "far fa-angle-double-left", onClick: this.goToPrevYear, onKeyDown: keydownEvent }), h("sas-icon", { class: `prev-month-icon ${this.checkIsDateLimit(this.min) ? 'disabled' : ''}`, tabindex: 0, icon: "far fa-angle-left", onClick: this.goToPrevMonth, onKeyDown: keydownEvent }), h("span", { class: "title-content" }, this.getTitleText()), h("sas-icon", { class: `next-month-icon ${this.checkIsDateLimit(this.max) ? 'disabled' : ''}`, tabindex: 0, icon: "far fa-angle-right", onClick: this.goToNextMonth, onKeyDown: keydownEvent }), h("sas-icon", { class: `next-year-icon ${this.checkIsDateLimit(this.max) ? 'disabled' : ''}`, tabindex: 0, icon: "far fa-angle-double-right", onClick: this.goToNextYear, onKeyDown: keydownEvent })), h("sas-table", { class: "date-table", headers: this.titles, items: this.generateDateContent(), tabindex: 0 })))));
|
|
6576
6571
|
}
|
|
6577
6572
|
get el() { return this; }
|
|
@@ -7280,7 +7275,7 @@ let SasForm$1 = class extends H {
|
|
|
7280
7275
|
static get style() { return sasFormCss; }
|
|
7281
7276
|
};
|
|
7282
7277
|
|
|
7283
|
-
const sasFormInputTemplateCss = ":host{display:block;position:relative;height:100%}:host .container{overflow-y:auto;position:absolute;min-width:var(--form-input-template-container-min-width, 100%);max-width:var(--form-input-template-container-max-width, none);background-color:white;height:0;z-index:-15;pointer-events:none}:host .top{transform:translateY(-100%);top:0}:host .right{right:0}:host
|
|
7278
|
+
const sasFormInputTemplateCss = ":host{display:block;position:relative;height:100%}:host .hide{display:none}:host .container{overflow-y:auto;position:absolute;min-width:var(--form-input-template-container-min-width, 100%);max-width:var(--form-input-template-container-max-width, none);background-color:white;height:0;z-index:-15;pointer-events:none}:host .top{transform:translateY(-100%);top:0}:host .right{right:0}:host(:focus){outline:none}:host(:focus-within)>.container{padding:10px 0;height:auto;overflow:visible;z-index:15;pointer-events:initial;box-shadow:0px 5px 10px #0000001A;border:1px solid #D0D9DE;border-radius:5px}:host(:not([label=\"\"])) .top{transform:translateY(-100%);top:0}:host(:not([label=\"\"])[outside]:not([outside=false])) .top{transform:translateY(calc(-100% + 30px));top:0}:host:after{content:attr(data-message);position:absolute;top:calc(100% + 5px);right:10px;color:var(--li-2);font-size:12px;text-align:right}";
|
|
7284
7279
|
|
|
7285
7280
|
let SasFormInputTemplate$1 = class extends H {
|
|
7286
7281
|
constructor() {
|
|
@@ -7367,36 +7362,28 @@ let SasFormInputTemplate$1 = class extends H {
|
|
|
7367
7362
|
*/
|
|
7368
7363
|
this.minimumPixelsRightOfComponentRequired = 0;
|
|
7369
7364
|
this.handleInputClick = (event) => {
|
|
7370
|
-
console.log("handleInputClick");
|
|
7371
7365
|
event.stopPropagation();
|
|
7372
7366
|
if (!this.disabled) {
|
|
7373
7367
|
const container = this.el.shadowRoot.querySelector('.container');
|
|
7374
7368
|
const height = container.getBoundingClientRect().height;
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
// this.show = true;
|
|
7382
|
-
// }
|
|
7383
|
-
this.show = true;
|
|
7384
|
-
console.log(`handleInputClick: show: ${this.show}`);
|
|
7369
|
+
if (height > 0) {
|
|
7370
|
+
this.show = false;
|
|
7371
|
+
}
|
|
7372
|
+
else {
|
|
7373
|
+
this.show = true;
|
|
7374
|
+
}
|
|
7385
7375
|
this.inputContainerClick.emit();
|
|
7386
7376
|
}
|
|
7387
7377
|
};
|
|
7388
7378
|
this.handleContainerClick = (event) => {
|
|
7389
|
-
console.log("handleContainerClick");
|
|
7390
7379
|
event.stopPropagation();
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
// }
|
|
7380
|
+
if (this.clickClose) {
|
|
7381
|
+
setTimeout(() => {
|
|
7382
|
+
this.show = false;
|
|
7383
|
+
}, 100);
|
|
7384
|
+
}
|
|
7397
7385
|
};
|
|
7398
7386
|
this.updateContainerPosition = () => {
|
|
7399
|
-
console.log("updateContainerPosition");
|
|
7400
7387
|
this.updateVerticalContainerPosition();
|
|
7401
7388
|
this.updateContainerHorizontalPosition();
|
|
7402
7389
|
};
|
|
@@ -7407,8 +7394,6 @@ let SasFormInputTemplate$1 = class extends H {
|
|
|
7407
7394
|
else {
|
|
7408
7395
|
const top = this.el.getBoundingClientRect().top;
|
|
7409
7396
|
const clientHeight = document.documentElement.clientHeight;
|
|
7410
|
-
console.log(`updateVerticalContainerPosition: top: ${top}`);
|
|
7411
|
-
console.log(`updateVerticalContainerPosition: clientHeight: ${clientHeight}`);
|
|
7412
7397
|
if (clientHeight < top * 2 && top > this.minimumPixelsAboveComponentRequired) {
|
|
7413
7398
|
this.containerVerticalPosition = 'top';
|
|
7414
7399
|
}
|
|
@@ -7416,7 +7401,6 @@ let SasFormInputTemplate$1 = class extends H {
|
|
|
7416
7401
|
this.containerVerticalPosition = 'bottom';
|
|
7417
7402
|
}
|
|
7418
7403
|
}
|
|
7419
|
-
console.log(`updateVerticalContainerPosition: containerVerticalPosition: ${this.containerVerticalPosition}`);
|
|
7420
7404
|
};
|
|
7421
7405
|
this.updateContainerHorizontalPosition = () => {
|
|
7422
7406
|
if (Boolean(this.positionH)) {
|
|
@@ -7425,8 +7409,6 @@ let SasFormInputTemplate$1 = class extends H {
|
|
|
7425
7409
|
else {
|
|
7426
7410
|
const left = this.el.getBoundingClientRect().left;
|
|
7427
7411
|
const clientWidth = document.documentElement.clientWidth;
|
|
7428
|
-
console.log(`updateContainerHorizontalPosition: left: ${left}`);
|
|
7429
|
-
console.log(`updateContainerHorizontalPosition: clientWidth: ${clientWidth}`);
|
|
7430
7412
|
if (clientWidth - this.minimumPixelsRightOfComponentRequired > left) {
|
|
7431
7413
|
this.containerHorizontalPosition = 'left';
|
|
7432
7414
|
}
|
|
@@ -7434,7 +7416,6 @@ let SasFormInputTemplate$1 = class extends H {
|
|
|
7434
7416
|
this.containerHorizontalPosition = 'right';
|
|
7435
7417
|
}
|
|
7436
7418
|
}
|
|
7437
|
-
console.log(`updateContainerHorizontalPosition: containerHorizontalPosition: ${this.containerHorizontalPosition}`);
|
|
7438
7419
|
};
|
|
7439
7420
|
}
|
|
7440
7421
|
showHandler(newValue) {
|
|
@@ -7451,22 +7432,15 @@ let SasFormInputTemplate$1 = class extends H {
|
|
|
7451
7432
|
this.el.focus();
|
|
7452
7433
|
}
|
|
7453
7434
|
showContainer() {
|
|
7454
|
-
console.log("showContainer");
|
|
7455
7435
|
const element = this.el.shadowRoot.querySelector('.container');
|
|
7456
|
-
console.log("showContainer: element");
|
|
7457
|
-
console.log(element);
|
|
7458
7436
|
element.classList.remove('hide');
|
|
7459
7437
|
}
|
|
7460
7438
|
hideContainer() {
|
|
7461
|
-
console.log("hideContainer");
|
|
7462
7439
|
const element = this.el.shadowRoot.querySelector('.container');
|
|
7463
|
-
console.log("hideContainer: element");
|
|
7464
|
-
console.log(element);
|
|
7465
7440
|
element.classList.add('hide');
|
|
7466
7441
|
}
|
|
7467
7442
|
render() {
|
|
7468
|
-
|
|
7469
|
-
return (h(Host, { tabindex: 0, "data-message": "" }, h("sas-input", { label: this.label, outside: this.outside, required: this.required, type: this.type, placeholder: this.placeholder, "icon-right": this.iconRight, value: this.value, min: this.min, max: this.max, readonly: this.readonly, disabled: this.disabled, clear: this.clear, onKeyDown: keydownEvent, tabindex: 0,
|
|
7443
|
+
return (h(Host, { onFocus: this.updateContainerPosition, tabindex: 0, "data-message": "" }, h("sas-input", { label: this.label, outside: this.outside, required: this.required, type: this.type, placeholder: this.placeholder, "icon-right": this.iconRight, value: this.value, min: this.min, max: this.max, readonly: this.readonly, disabled: this.disabled, clear: this.clear, onKeyDown: keydownEvent, tabindex: 0,
|
|
7470
7444
|
// mouseDown event is faster than focus event, click event is slower than focus event
|
|
7471
7445
|
onMouseDown: this.handleInputClick }, h("slot", { name: "input" })), h("div", { class: `container hide ${this.containerVerticalPosition} ${this.containerHorizontalPosition}`, onMouseDown: this.handleContainerClick }, h("slot", { name: "container" }))));
|
|
7472
7446
|
}
|
|
@@ -11046,6 +11020,8 @@ let SasMenuBar$1 = class extends H {
|
|
|
11046
11020
|
this.__registerHost();
|
|
11047
11021
|
this.__attachShadow();
|
|
11048
11022
|
this.moreFilterButtonWidth = 190;
|
|
11023
|
+
// Prevents resize when input in filter slots cause scroll bar being added to the page
|
|
11024
|
+
this.preventUpdateLayoutCallDueToRecentInputInteraction = false;
|
|
11049
11025
|
/**
|
|
11050
11026
|
* Sticky
|
|
11051
11027
|
*/
|
|
@@ -11122,10 +11098,10 @@ let SasMenuBar$1 = class extends H {
|
|
|
11122
11098
|
}
|
|
11123
11099
|
componentDidLoad() {
|
|
11124
11100
|
const resizeObserver = new index((entries) => {
|
|
11125
|
-
entries.forEach((
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11101
|
+
entries.forEach(() => {
|
|
11102
|
+
if (this.preventUpdateLayoutCallDueToRecentInputInteraction === false) {
|
|
11103
|
+
this.updateLayout();
|
|
11104
|
+
}
|
|
11129
11105
|
});
|
|
11130
11106
|
});
|
|
11131
11107
|
const filterContainer = this.el.shadowRoot.querySelector('.filter');
|
|
@@ -11151,9 +11127,11 @@ let SasMenuBar$1 = class extends H {
|
|
|
11151
11127
|
this.updateBadgeNumber();
|
|
11152
11128
|
}
|
|
11153
11129
|
}
|
|
11154
|
-
inputinputContainerClickEventInternalHandler(
|
|
11155
|
-
|
|
11156
|
-
|
|
11130
|
+
inputinputContainerClickEventInternalHandler() {
|
|
11131
|
+
this.preventUpdateLayoutCallDueToRecentInputInteraction = true;
|
|
11132
|
+
setTimeout(() => {
|
|
11133
|
+
this.preventUpdateLayoutCallDueToRecentInputInteraction = false;
|
|
11134
|
+
}, 10);
|
|
11157
11135
|
}
|
|
11158
11136
|
updateLayout() {
|
|
11159
11137
|
let shouldKeepFocus = false;
|