@emuanalytics/flow-rdf-ui 0.0.25 → 0.0.26
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/custom-elements.json +1020 -878
- package/dist/index.cjs +567 -376
- package/dist/index.d.cts +74 -25
- package/dist/index.d.mts +74 -25
- package/dist/index.d.ts +74 -25
- package/dist/index.mjs +517 -323
- package/dist/vscode.html-custom-data.json +67 -357
- package/package.json +4 -2
package/dist/index.cjs
CHANGED
|
@@ -9,27 +9,21 @@ const staticHtml_js = require('lit/static-html.js');
|
|
|
9
9
|
const dom = require('@floating-ui/dom');
|
|
10
10
|
const composedOffsetPosition = require('composed-offset-position');
|
|
11
11
|
const animations = require('@shoelace-style/animations');
|
|
12
|
-
const
|
|
13
|
-
const utc = require('dayjs/plugin/utc');
|
|
14
|
-
const timezone = require('dayjs/plugin/timezone');
|
|
15
|
-
const localeData = require('dayjs/plugin/localeData');
|
|
16
|
-
const AdvancedFormat = require('dayjs/plugin/advancedFormat');
|
|
17
|
-
const QuarterOfYear = require('dayjs/plugin/quarterOfYear');
|
|
18
|
-
const LocalizedFormat = require('dayjs/plugin/localizedFormat');
|
|
19
|
-
const CustomParseFormat = require('dayjs/plugin/customParseFormat');
|
|
20
|
-
const isoWeek = require('dayjs/plugin/isoWeek');
|
|
12
|
+
const luxon = require('luxon');
|
|
21
13
|
const map_js = require('lit/directives/map.js');
|
|
22
14
|
const range_js = require('lit/directives/range.js');
|
|
23
15
|
const chart_js = require('chart.js');
|
|
24
16
|
const ref_js = require('lit/directives/ref.js');
|
|
25
17
|
const chartjsChartMatrix = require('chartjs-chart-matrix');
|
|
26
18
|
const AnnotationPlugin = require('chartjs-plugin-annotation');
|
|
19
|
+
const helpers = require('chart.js/helpers');
|
|
27
20
|
const d3Scale = require('d3-scale');
|
|
28
21
|
const live_js = require('lit/directives/live.js');
|
|
29
22
|
const tinycolor = require('@ctrl/tinycolor');
|
|
30
23
|
const styleMap_js = require('lit/directives/style-map.js');
|
|
31
24
|
const d3Format$1 = require('d3-format');
|
|
32
25
|
const overlayscrollbars = require('overlayscrollbars');
|
|
26
|
+
const unsafeHtml_js = require('lit/directives/unsafe-html.js');
|
|
33
27
|
const when_js = require('lit/directives/when.js');
|
|
34
28
|
const choose_js = require('lit/directives/choose.js');
|
|
35
29
|
|
|
@@ -48,15 +42,6 @@ function _interopNamespaceCompat(e) {
|
|
|
48
42
|
}
|
|
49
43
|
|
|
50
44
|
const animations__namespace = /*#__PURE__*/_interopNamespaceCompat(animations);
|
|
51
|
-
const dayjs__default = /*#__PURE__*/_interopDefaultCompat(dayjs);
|
|
52
|
-
const utc__default = /*#__PURE__*/_interopDefaultCompat(utc);
|
|
53
|
-
const timezone__default = /*#__PURE__*/_interopDefaultCompat(timezone);
|
|
54
|
-
const localeData__default = /*#__PURE__*/_interopDefaultCompat(localeData);
|
|
55
|
-
const AdvancedFormat__default = /*#__PURE__*/_interopDefaultCompat(AdvancedFormat);
|
|
56
|
-
const QuarterOfYear__default = /*#__PURE__*/_interopDefaultCompat(QuarterOfYear);
|
|
57
|
-
const LocalizedFormat__default = /*#__PURE__*/_interopDefaultCompat(LocalizedFormat);
|
|
58
|
-
const CustomParseFormat__default = /*#__PURE__*/_interopDefaultCompat(CustomParseFormat);
|
|
59
|
-
const isoWeek__default = /*#__PURE__*/_interopDefaultCompat(isoWeek);
|
|
60
45
|
const AnnotationPlugin__default = /*#__PURE__*/_interopDefaultCompat(AnnotationPlugin);
|
|
61
46
|
|
|
62
47
|
function animateTo(el, keyframes, options) {
|
|
@@ -677,10 +662,8 @@ __decorateClass$$([
|
|
|
677
662
|
let FlowIcon = _FlowIcon;
|
|
678
663
|
|
|
679
664
|
const styles$Z = lit.css`
|
|
680
|
-
${componentStyles}
|
|
681
|
-
|
|
682
665
|
:host {
|
|
683
|
-
--arrow-color: var(--
|
|
666
|
+
--arrow-color: var(--sl-color-neutral-1000);
|
|
684
667
|
--arrow-size: 6px;
|
|
685
668
|
|
|
686
669
|
/*
|
|
@@ -716,6 +699,26 @@ const styles$Z = lit.css`
|
|
|
716
699
|
background: var(--arrow-color);
|
|
717
700
|
z-index: -1;
|
|
718
701
|
}
|
|
702
|
+
|
|
703
|
+
/* Hover bridge */
|
|
704
|
+
.popup-hover-bridge:not(.popup-hover-bridge--visible) {
|
|
705
|
+
display: none;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
.popup-hover-bridge {
|
|
709
|
+
position: fixed;
|
|
710
|
+
z-index: calc(var(--sl-z-index-dropdown) - 1);
|
|
711
|
+
top: 0;
|
|
712
|
+
right: 0;
|
|
713
|
+
bottom: 0;
|
|
714
|
+
left: 0;
|
|
715
|
+
clip-path: polygon(
|
|
716
|
+
var(--hover-bridge-top-left-x, 0) var(--hover-bridge-top-left-y, 0),
|
|
717
|
+
var(--hover-bridge-top-right-x, 0) var(--hover-bridge-top-right-y, 0),
|
|
718
|
+
var(--hover-bridge-bottom-right-x, 0) var(--hover-bridge-bottom-right-y, 0),
|
|
719
|
+
var(--hover-bridge-bottom-left-x, 0) var(--hover-bridge-bottom-left-y, 0)
|
|
720
|
+
);
|
|
721
|
+
}
|
|
719
722
|
`;
|
|
720
723
|
|
|
721
724
|
var __defProp$_ = Object.defineProperty;
|
|
@@ -729,7 +732,10 @@ var __decorateClass$_ = (decorators, target, key, kind) => {
|
|
|
729
732
|
__defProp$_(target, key, result);
|
|
730
733
|
return result;
|
|
731
734
|
};
|
|
732
|
-
|
|
735
|
+
function isVirtualElement(e) {
|
|
736
|
+
return e !== null && typeof e === "object" && "getBoundingClientRect" in e && ("contextElement" in e ? e instanceof Element : true);
|
|
737
|
+
}
|
|
738
|
+
class SlPopup extends FlowRdfElement {
|
|
733
739
|
constructor() {
|
|
734
740
|
super(...arguments);
|
|
735
741
|
this.active = false;
|
|
@@ -747,6 +753,71 @@ exports.FlowPopup = class FlowPopup extends FlowRdfElement {
|
|
|
747
753
|
this.shift = false;
|
|
748
754
|
this.shiftPadding = 0;
|
|
749
755
|
this.autoSizePadding = 0;
|
|
756
|
+
this.hoverBridge = false;
|
|
757
|
+
this.updateHoverBridge = () => {
|
|
758
|
+
if (this.hoverBridge && this.anchorEl) {
|
|
759
|
+
const anchorRect = this.anchorEl.getBoundingClientRect();
|
|
760
|
+
const popupRect = this.popup.getBoundingClientRect();
|
|
761
|
+
const isVertical = this.placement.includes("top") || this.placement.includes("bottom");
|
|
762
|
+
let topLeftX = 0;
|
|
763
|
+
let topLeftY = 0;
|
|
764
|
+
let topRightX = 0;
|
|
765
|
+
let topRightY = 0;
|
|
766
|
+
let bottomLeftX = 0;
|
|
767
|
+
let bottomLeftY = 0;
|
|
768
|
+
let bottomRightX = 0;
|
|
769
|
+
let bottomRightY = 0;
|
|
770
|
+
if (isVertical) {
|
|
771
|
+
if (anchorRect.top < popupRect.top) {
|
|
772
|
+
topLeftX = anchorRect.left;
|
|
773
|
+
topLeftY = anchorRect.bottom;
|
|
774
|
+
topRightX = anchorRect.right;
|
|
775
|
+
topRightY = anchorRect.bottom;
|
|
776
|
+
bottomLeftX = popupRect.left;
|
|
777
|
+
bottomLeftY = popupRect.top;
|
|
778
|
+
bottomRightX = popupRect.right;
|
|
779
|
+
bottomRightY = popupRect.top;
|
|
780
|
+
} else {
|
|
781
|
+
topLeftX = popupRect.left;
|
|
782
|
+
topLeftY = popupRect.bottom;
|
|
783
|
+
topRightX = popupRect.right;
|
|
784
|
+
topRightY = popupRect.bottom;
|
|
785
|
+
bottomLeftX = anchorRect.left;
|
|
786
|
+
bottomLeftY = anchorRect.top;
|
|
787
|
+
bottomRightX = anchorRect.right;
|
|
788
|
+
bottomRightY = anchorRect.top;
|
|
789
|
+
}
|
|
790
|
+
} else {
|
|
791
|
+
if (anchorRect.left < popupRect.left) {
|
|
792
|
+
topLeftX = anchorRect.right;
|
|
793
|
+
topLeftY = anchorRect.top;
|
|
794
|
+
topRightX = popupRect.left;
|
|
795
|
+
topRightY = popupRect.top;
|
|
796
|
+
bottomLeftX = anchorRect.right;
|
|
797
|
+
bottomLeftY = anchorRect.bottom;
|
|
798
|
+
bottomRightX = popupRect.left;
|
|
799
|
+
bottomRightY = popupRect.bottom;
|
|
800
|
+
} else {
|
|
801
|
+
topLeftX = popupRect.right;
|
|
802
|
+
topLeftY = popupRect.top;
|
|
803
|
+
topRightX = anchorRect.left;
|
|
804
|
+
topRightY = anchorRect.top;
|
|
805
|
+
bottomLeftX = popupRect.right;
|
|
806
|
+
bottomLeftY = popupRect.bottom;
|
|
807
|
+
bottomRightX = anchorRect.left;
|
|
808
|
+
bottomRightY = anchorRect.bottom;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
this.style.setProperty("--hover-bridge-top-left-x", `${topLeftX}px`);
|
|
812
|
+
this.style.setProperty("--hover-bridge-top-left-y", `${topLeftY}px`);
|
|
813
|
+
this.style.setProperty("--hover-bridge-top-right-x", `${topRightX}px`);
|
|
814
|
+
this.style.setProperty("--hover-bridge-top-right-y", `${topRightY}px`);
|
|
815
|
+
this.style.setProperty("--hover-bridge-bottom-left-x", `${bottomLeftX}px`);
|
|
816
|
+
this.style.setProperty("--hover-bridge-bottom-left-y", `${bottomLeftY}px`);
|
|
817
|
+
this.style.setProperty("--hover-bridge-bottom-right-x", `${bottomRightX}px`);
|
|
818
|
+
this.style.setProperty("--hover-bridge-bottom-right-y", `${bottomRightY}px`);
|
|
819
|
+
}
|
|
820
|
+
};
|
|
750
821
|
}
|
|
751
822
|
async connectedCallback() {
|
|
752
823
|
super.connectedCallback();
|
|
@@ -754,6 +825,7 @@ exports.FlowPopup = class FlowPopup extends FlowRdfElement {
|
|
|
754
825
|
this.start();
|
|
755
826
|
}
|
|
756
827
|
disconnectedCallback() {
|
|
828
|
+
super.disconnectedCallback();
|
|
757
829
|
this.stop();
|
|
758
830
|
}
|
|
759
831
|
async updated(changedProps) {
|
|
@@ -778,7 +850,7 @@ exports.FlowPopup = class FlowPopup extends FlowRdfElement {
|
|
|
778
850
|
if (this.anchor && typeof this.anchor === "string") {
|
|
779
851
|
const root = this.getRootNode();
|
|
780
852
|
this.anchorEl = root.getElementById(this.anchor);
|
|
781
|
-
} else if (this.anchor instanceof Element) {
|
|
853
|
+
} else if (this.anchor instanceof Element || isVirtualElement(this.anchor)) {
|
|
782
854
|
this.anchorEl = this.anchor;
|
|
783
855
|
} else {
|
|
784
856
|
this.anchorEl = this.querySelector('[slot="anchor"]');
|
|
@@ -786,12 +858,9 @@ exports.FlowPopup = class FlowPopup extends FlowRdfElement {
|
|
|
786
858
|
if (this.anchorEl instanceof HTMLSlotElement) {
|
|
787
859
|
this.anchorEl = this.anchorEl.assignedElements({ flatten: true })[0];
|
|
788
860
|
}
|
|
789
|
-
if (
|
|
790
|
-
|
|
791
|
-
"Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute."
|
|
792
|
-
);
|
|
861
|
+
if (this.anchorEl) {
|
|
862
|
+
this.start();
|
|
793
863
|
}
|
|
794
|
-
this.start();
|
|
795
864
|
}
|
|
796
865
|
start() {
|
|
797
866
|
if (!this.anchorEl) {
|
|
@@ -899,7 +968,7 @@ exports.FlowPopup = class FlowPopup extends FlowRdfElement {
|
|
|
899
968
|
getOffsetParent
|
|
900
969
|
}
|
|
901
970
|
}).then(({ x, y, middlewareData, placement }) => {
|
|
902
|
-
const isRtl =
|
|
971
|
+
const isRtl = this.matches(":dir(rtl)");
|
|
903
972
|
const staticSide = { top: "bottom", right: "left", bottom: "top", left: "right" }[placement.split("-")[0]];
|
|
904
973
|
this.setAttribute("data-current-placement", placement);
|
|
905
974
|
Object.assign(this.popup.style, {
|
|
@@ -939,12 +1008,21 @@ exports.FlowPopup = class FlowPopup extends FlowRdfElement {
|
|
|
939
1008
|
});
|
|
940
1009
|
}
|
|
941
1010
|
});
|
|
1011
|
+
requestAnimationFrame(() => this.updateHoverBridge());
|
|
942
1012
|
this.emit("flow-ui-reposition");
|
|
943
1013
|
}
|
|
944
1014
|
render() {
|
|
945
1015
|
return lit.html`
|
|
946
1016
|
<slot name="anchor" @slotchange=${this.handleAnchorChange}></slot>
|
|
947
1017
|
|
|
1018
|
+
<span
|
|
1019
|
+
part="hover-bridge"
|
|
1020
|
+
class=${classMap_js.classMap({
|
|
1021
|
+
"popup-hover-bridge": true,
|
|
1022
|
+
"popup-hover-bridge--visible": this.hoverBridge && this.active
|
|
1023
|
+
})}
|
|
1024
|
+
></span>
|
|
1025
|
+
|
|
948
1026
|
<div
|
|
949
1027
|
part="popup"
|
|
950
1028
|
class=${classMap_js.classMap({
|
|
@@ -955,48 +1033,50 @@ exports.FlowPopup = class FlowPopup extends FlowRdfElement {
|
|
|
955
1033
|
})}
|
|
956
1034
|
>
|
|
957
1035
|
<slot></slot>
|
|
958
|
-
${this.arrow ? lit.html
|
|
1036
|
+
${this.arrow ? lit.html`
|
|
1037
|
+
<div part="arrow" class="popup__arrow" role="presentation"></div>
|
|
1038
|
+
` : ""}
|
|
959
1039
|
</div>
|
|
960
1040
|
`;
|
|
961
1041
|
}
|
|
962
|
-
}
|
|
963
|
-
|
|
1042
|
+
}
|
|
1043
|
+
SlPopup.styles = [componentStyles, styles$Z];
|
|
964
1044
|
__decorateClass$_([
|
|
965
1045
|
decorators_js.query(".popup")
|
|
966
|
-
],
|
|
1046
|
+
], SlPopup.prototype, "popup", 2);
|
|
967
1047
|
__decorateClass$_([
|
|
968
1048
|
decorators_js.query(".popup__arrow")
|
|
969
|
-
],
|
|
1049
|
+
], SlPopup.prototype, "arrowEl", 2);
|
|
970
1050
|
__decorateClass$_([
|
|
971
1051
|
decorators_js.property()
|
|
972
|
-
],
|
|
1052
|
+
], SlPopup.prototype, "anchor", 2);
|
|
973
1053
|
__decorateClass$_([
|
|
974
1054
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
975
|
-
],
|
|
1055
|
+
], SlPopup.prototype, "active", 2);
|
|
976
1056
|
__decorateClass$_([
|
|
977
1057
|
decorators_js.property({ reflect: true })
|
|
978
|
-
],
|
|
1058
|
+
], SlPopup.prototype, "placement", 2);
|
|
979
1059
|
__decorateClass$_([
|
|
980
1060
|
decorators_js.property({ reflect: true })
|
|
981
|
-
],
|
|
1061
|
+
], SlPopup.prototype, "strategy", 2);
|
|
982
1062
|
__decorateClass$_([
|
|
983
1063
|
decorators_js.property({ type: Number })
|
|
984
|
-
],
|
|
1064
|
+
], SlPopup.prototype, "distance", 2);
|
|
985
1065
|
__decorateClass$_([
|
|
986
1066
|
decorators_js.property({ type: Number })
|
|
987
|
-
],
|
|
1067
|
+
], SlPopup.prototype, "skidding", 2);
|
|
988
1068
|
__decorateClass$_([
|
|
989
1069
|
decorators_js.property({ type: Boolean })
|
|
990
|
-
],
|
|
1070
|
+
], SlPopup.prototype, "arrow", 2);
|
|
991
1071
|
__decorateClass$_([
|
|
992
1072
|
decorators_js.property({ attribute: "arrow-placement" })
|
|
993
|
-
],
|
|
1073
|
+
], SlPopup.prototype, "arrowPlacement", 2);
|
|
994
1074
|
__decorateClass$_([
|
|
995
1075
|
decorators_js.property({ attribute: "arrow-padding", type: Number })
|
|
996
|
-
],
|
|
1076
|
+
], SlPopup.prototype, "arrowPadding", 2);
|
|
997
1077
|
__decorateClass$_([
|
|
998
1078
|
decorators_js.property({ type: Boolean })
|
|
999
|
-
],
|
|
1079
|
+
], SlPopup.prototype, "flip", 2);
|
|
1000
1080
|
__decorateClass$_([
|
|
1001
1081
|
decorators_js.property({
|
|
1002
1082
|
attribute: "flip-fallback-placements",
|
|
@@ -1009,40 +1089,42 @@ __decorateClass$_([
|
|
|
1009
1089
|
}
|
|
1010
1090
|
}
|
|
1011
1091
|
})
|
|
1012
|
-
],
|
|
1092
|
+
], SlPopup.prototype, "flipFallbackPlacements", 2);
|
|
1013
1093
|
__decorateClass$_([
|
|
1014
1094
|
decorators_js.property({ attribute: "flip-fallback-strategy" })
|
|
1015
|
-
],
|
|
1095
|
+
], SlPopup.prototype, "flipFallbackStrategy", 2);
|
|
1016
1096
|
__decorateClass$_([
|
|
1017
1097
|
decorators_js.property({ type: Object })
|
|
1018
|
-
],
|
|
1098
|
+
], SlPopup.prototype, "flipBoundary", 2);
|
|
1019
1099
|
__decorateClass$_([
|
|
1020
1100
|
decorators_js.property({ attribute: "flip-padding", type: Number })
|
|
1021
|
-
],
|
|
1101
|
+
], SlPopup.prototype, "flipPadding", 2);
|
|
1022
1102
|
__decorateClass$_([
|
|
1023
1103
|
decorators_js.property({ type: Boolean })
|
|
1024
|
-
],
|
|
1104
|
+
], SlPopup.prototype, "shift", 2);
|
|
1025
1105
|
__decorateClass$_([
|
|
1026
1106
|
decorators_js.property({ type: Object })
|
|
1027
|
-
],
|
|
1107
|
+
], SlPopup.prototype, "shiftBoundary", 2);
|
|
1028
1108
|
__decorateClass$_([
|
|
1029
1109
|
decorators_js.property({ attribute: "shift-padding", type: Number })
|
|
1030
|
-
],
|
|
1110
|
+
], SlPopup.prototype, "shiftPadding", 2);
|
|
1031
1111
|
__decorateClass$_([
|
|
1032
1112
|
decorators_js.property({ attribute: "auto-size" })
|
|
1033
|
-
],
|
|
1113
|
+
], SlPopup.prototype, "autoSize", 2);
|
|
1034
1114
|
__decorateClass$_([
|
|
1035
1115
|
decorators_js.property()
|
|
1036
|
-
],
|
|
1116
|
+
], SlPopup.prototype, "sync", 2);
|
|
1037
1117
|
__decorateClass$_([
|
|
1038
1118
|
decorators_js.property({ type: Object })
|
|
1039
|
-
],
|
|
1119
|
+
], SlPopup.prototype, "autoSizeBoundary", 2);
|
|
1040
1120
|
__decorateClass$_([
|
|
1041
1121
|
decorators_js.property({ attribute: "auto-size-padding", type: Number })
|
|
1042
|
-
],
|
|
1043
|
-
|
|
1044
|
-
decorators_js.
|
|
1045
|
-
],
|
|
1122
|
+
], SlPopup.prototype, "autoSizePadding", 2);
|
|
1123
|
+
__decorateClass$_([
|
|
1124
|
+
decorators_js.property({ attribute: "hover-bridge", type: Boolean })
|
|
1125
|
+
], SlPopup.prototype, "hoverBridge", 2);
|
|
1126
|
+
|
|
1127
|
+
SlPopup.define("flow-ui-popup");
|
|
1046
1128
|
|
|
1047
1129
|
const styles$Y = lit.css`
|
|
1048
1130
|
${componentStyles}
|
|
@@ -4073,15 +4155,6 @@ exports.FlowButton = __decorateClass$P([
|
|
|
4073
4155
|
decorators_js.customElement("flow-ui-button")
|
|
4074
4156
|
], exports.FlowButton);
|
|
4075
4157
|
|
|
4076
|
-
dayjs__default.extend(utc__default);
|
|
4077
|
-
dayjs__default.extend(timezone__default);
|
|
4078
|
-
dayjs__default.extend(localeData__default);
|
|
4079
|
-
dayjs__default.extend(AdvancedFormat__default);
|
|
4080
|
-
dayjs__default.extend(QuarterOfYear__default);
|
|
4081
|
-
dayjs__default.extend(LocalizedFormat__default);
|
|
4082
|
-
dayjs__default.extend(CustomParseFormat__default);
|
|
4083
|
-
dayjs__default.extend(isoWeek__default);
|
|
4084
|
-
|
|
4085
4158
|
const isUndefined = (val) => typeof val === "undefined";
|
|
4086
4159
|
const isNull = (val) => val === null;
|
|
4087
4160
|
const isNil = (val) => isUndefined(val) || isNull(val);
|
|
@@ -4241,12 +4314,10 @@ var __decorateClass$O = (decorators, target, key, kind) => {
|
|
|
4241
4314
|
__defProp$O(target, key, result);
|
|
4242
4315
|
return result;
|
|
4243
4316
|
};
|
|
4244
|
-
dayjs__default.locale("en");
|
|
4245
4317
|
class FlowCalendar extends FlowRdfElement {
|
|
4246
4318
|
constructor() {
|
|
4247
4319
|
super(...arguments);
|
|
4248
4320
|
this.displayMode = "date";
|
|
4249
|
-
this.timezone = "";
|
|
4250
4321
|
this.size = "medium";
|
|
4251
4322
|
}
|
|
4252
4323
|
connectedCallback() {
|
|
@@ -4257,7 +4328,7 @@ class FlowCalendar extends FlowRdfElement {
|
|
|
4257
4328
|
super.disconnectedCallback();
|
|
4258
4329
|
}
|
|
4259
4330
|
handleValueChange() {
|
|
4260
|
-
this._selectedDate = this.makeDate(this.value)?.millisecond
|
|
4331
|
+
this._selectedDate = this.makeDate(this.value)?.set({ millisecond: 0 });
|
|
4261
4332
|
if (this._selectedDate) {
|
|
4262
4333
|
if (this.displayMode === "date") {
|
|
4263
4334
|
this._selectedDate = this._selectedDate.startOf("day");
|
|
@@ -4267,44 +4338,65 @@ class FlowCalendar extends FlowRdfElement {
|
|
|
4267
4338
|
this._displayDate = this.makeDate().startOf("month");
|
|
4268
4339
|
}
|
|
4269
4340
|
}
|
|
4341
|
+
handleTimezoneChange() {
|
|
4342
|
+
this.handleValueChange();
|
|
4343
|
+
this.updateValue();
|
|
4344
|
+
}
|
|
4270
4345
|
dateClicked(val) {
|
|
4271
4346
|
const date = this.makeDate(val);
|
|
4272
|
-
if (
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
this._selectedDate
|
|
4277
|
-
}
|
|
4278
|
-
|
|
4347
|
+
if (this._selectedDate) {
|
|
4348
|
+
this._selectedDate = date.set({
|
|
4349
|
+
hour: this._selectedDate.hour,
|
|
4350
|
+
minute: this._selectedDate.minute,
|
|
4351
|
+
second: this._selectedDate.second
|
|
4352
|
+
});
|
|
4353
|
+
} else {
|
|
4354
|
+
this._selectedDate = date;
|
|
4279
4355
|
}
|
|
4356
|
+
this.updateValue();
|
|
4280
4357
|
}
|
|
4281
|
-
stepDisplayDate(
|
|
4282
|
-
this._displayDate = this._displayDate.
|
|
4358
|
+
stepDisplayDate(duration) {
|
|
4359
|
+
this._displayDate = this._displayDate.plus(duration);
|
|
4283
4360
|
}
|
|
4361
|
+
/**
|
|
4362
|
+
* Generate a list of years for the year select dropdown
|
|
4363
|
+
*/
|
|
4284
4364
|
yearOptionsForDate(date) {
|
|
4285
4365
|
const years = [];
|
|
4286
|
-
for (let y = date.year
|
|
4366
|
+
for (let y = date.year + 1; y >= date.year - 6; y--) {
|
|
4287
4367
|
years.push(y);
|
|
4288
4368
|
}
|
|
4289
4369
|
return years;
|
|
4290
4370
|
}
|
|
4291
4371
|
makeDate(d) {
|
|
4292
4372
|
try {
|
|
4293
|
-
|
|
4294
|
-
|
|
4373
|
+
let date;
|
|
4374
|
+
const zone = isStringFull(this.timezone) ? this.timezone : void 0;
|
|
4375
|
+
const locale = isStringFull(this.locale) ? this.locale : void 0;
|
|
4376
|
+
if (isStringFull(d)) {
|
|
4377
|
+
date = luxon.DateTime.fromISO(d, { zone, locale });
|
|
4378
|
+
} else {
|
|
4379
|
+
date = luxon.DateTime.local({ zone, locale });
|
|
4380
|
+
}
|
|
4381
|
+
return date.isValid ? date : void 0;
|
|
4295
4382
|
} catch (e) {
|
|
4383
|
+
console.error(`Invalid date in makeDate: ${d} (${this.timezone})`);
|
|
4296
4384
|
return void 0;
|
|
4297
4385
|
}
|
|
4298
4386
|
}
|
|
4299
4387
|
updateValue(emitEvents = true) {
|
|
4300
|
-
|
|
4388
|
+
const iso = this._selectedDate?.toISO();
|
|
4389
|
+
this.value = isDefined(iso) ? iso : "";
|
|
4301
4390
|
if (emitEvents) {
|
|
4302
4391
|
this.emit("flow-ui-change");
|
|
4303
4392
|
}
|
|
4304
4393
|
}
|
|
4305
4394
|
handleHeaderSelectChange(ev) {
|
|
4306
4395
|
ev.stopPropagation();
|
|
4307
|
-
this._displayDate = this.makeDate().
|
|
4396
|
+
this._displayDate = this.makeDate().set({
|
|
4397
|
+
year: +this._yearSelect.value,
|
|
4398
|
+
month: +this._monthSelect.value
|
|
4399
|
+
}).startOf("month");
|
|
4308
4400
|
}
|
|
4309
4401
|
handleTimeChange(ev) {
|
|
4310
4402
|
ev.stopPropagation();
|
|
@@ -4313,34 +4405,36 @@ class FlowCalendar extends FlowRdfElement {
|
|
|
4313
4405
|
}
|
|
4314
4406
|
const target = ev.target;
|
|
4315
4407
|
const unit = target.getAttribute("name");
|
|
4316
|
-
this._selectedDate = this._selectedDate.set(unit
|
|
4408
|
+
this._selectedDate = this._selectedDate.set({ [unit]: +target.value });
|
|
4317
4409
|
this.updateValue();
|
|
4318
4410
|
}
|
|
4319
4411
|
calendarHeaderTemplate() {
|
|
4412
|
+
const locale = isStringFull(this.locale) ? this.locale : void 0;
|
|
4413
|
+
const monthsShort = luxon.Info.months("short", { locale });
|
|
4320
4414
|
return lit.html`
|
|
4321
4415
|
<div class="calendar__header">
|
|
4322
4416
|
<flow-ui-icon-button
|
|
4323
4417
|
name="chevron-left"
|
|
4324
4418
|
library="system"
|
|
4325
|
-
@click=${() => this.stepDisplayDate(-1
|
|
4419
|
+
@click=${() => this.stepDisplayDate({ month: -1 })}
|
|
4326
4420
|
></flow-ui-icon-button>
|
|
4327
4421
|
<flow-ui-select
|
|
4328
4422
|
class="calendar__month-select calendar__header-select"
|
|
4329
|
-
value=${this._displayDate.month
|
|
4423
|
+
value=${this._displayDate.month}
|
|
4330
4424
|
@flow-ui-change=${this.handleHeaderSelectChange}
|
|
4331
4425
|
>
|
|
4332
|
-
${
|
|
4426
|
+
${monthsShort.map(
|
|
4333
4427
|
(month, index) => lit.html`
|
|
4334
|
-
<flow-ui-option value=${index}>${month}</flow-ui-option>
|
|
4428
|
+
<flow-ui-option value=${index + 1}>${month}</flow-ui-option>
|
|
4335
4429
|
`
|
|
4336
4430
|
)}
|
|
4337
4431
|
</flow-ui-select>
|
|
4338
4432
|
<flow-ui-select
|
|
4339
4433
|
class="calendar__year-select calendar__header-select"
|
|
4340
|
-
value=${this._displayDate.year
|
|
4434
|
+
value=${this._displayDate.year}
|
|
4341
4435
|
@flow-ui-change=${this.handleHeaderSelectChange}
|
|
4342
4436
|
>
|
|
4343
|
-
${this.yearOptionsForDate(
|
|
4437
|
+
${this.yearOptionsForDate(luxon.DateTime.now()).map(
|
|
4344
4438
|
(year) => lit.html`
|
|
4345
4439
|
<flow-ui-option value=${year}>${year}</flow-ui-option>
|
|
4346
4440
|
`
|
|
@@ -4349,13 +4443,14 @@ class FlowCalendar extends FlowRdfElement {
|
|
|
4349
4443
|
<flow-ui-icon-button
|
|
4350
4444
|
name="chevron-right"
|
|
4351
4445
|
library="system"
|
|
4352
|
-
@click=${() => this.stepDisplayDate(1
|
|
4446
|
+
@click=${() => this.stepDisplayDate({ month: 1 })}
|
|
4353
4447
|
></flow-ui-icon-button>
|
|
4354
4448
|
</div>
|
|
4355
4449
|
`;
|
|
4356
4450
|
}
|
|
4357
4451
|
dayOfWeekGridTemplate() {
|
|
4358
|
-
const
|
|
4452
|
+
const locale = isStringFull(this.locale) ? this.locale : void 0;
|
|
4453
|
+
const days = luxon.Info.weekdays("narrow", { locale });
|
|
4359
4454
|
return lit.html`
|
|
4360
4455
|
${days.map(
|
|
4361
4456
|
(day) => lit.html`
|
|
@@ -4370,34 +4465,34 @@ class FlowCalendar extends FlowRdfElement {
|
|
|
4370
4465
|
const endOfMonth = this._displayDate.endOf("month");
|
|
4371
4466
|
const calendarStart = startOfMonth.startOf("week");
|
|
4372
4467
|
const calendarEnd = endOfMonth.endOf("week");
|
|
4373
|
-
const daysInMonth = this._displayDate.daysInMonth
|
|
4468
|
+
const daysInMonth = this._displayDate.daysInMonth;
|
|
4374
4469
|
const days = [];
|
|
4375
|
-
for (let date = calendarStart; date
|
|
4470
|
+
for (let date = calendarStart; date < startOfMonth; date = date.plus({ day: 1 })) {
|
|
4376
4471
|
days.push({
|
|
4377
|
-
day: date.
|
|
4378
|
-
date: date.
|
|
4472
|
+
day: date.toFormat("d"),
|
|
4473
|
+
date: date.toISO(),
|
|
4379
4474
|
isFiller: true,
|
|
4380
|
-
today: date
|
|
4381
|
-
selected: !!this._selectedDate && date.
|
|
4475
|
+
today: date === today,
|
|
4476
|
+
selected: !!this._selectedDate && date.startOf("day").equals(this._selectedDate.startOf("day"))
|
|
4382
4477
|
});
|
|
4383
4478
|
}
|
|
4384
4479
|
for (let day = 1; day <= daysInMonth; day++) {
|
|
4385
|
-
const date = startOfMonth.
|
|
4480
|
+
const date = startOfMonth.plus({ days: day - 1 }).startOf("day");
|
|
4386
4481
|
days.push({
|
|
4387
|
-
day,
|
|
4388
|
-
date: date.
|
|
4482
|
+
day: date.toFormat("d"),
|
|
4483
|
+
date: date.toISO(),
|
|
4389
4484
|
isFiller: false,
|
|
4390
|
-
today: date.
|
|
4391
|
-
selected: !!this._selectedDate && date.
|
|
4485
|
+
today: date.startOf("day").equals(today.startOf("day")),
|
|
4486
|
+
selected: !!this._selectedDate && date.startOf("day").equals(this._selectedDate.startOf("day"))
|
|
4392
4487
|
});
|
|
4393
4488
|
}
|
|
4394
|
-
for (let date = endOfMonth.
|
|
4489
|
+
for (let date = endOfMonth.plus({ day: 1 }).startOf("day"); date < calendarEnd; date = date.plus({ day: 1 })) {
|
|
4395
4490
|
days.push({
|
|
4396
|
-
day: date.
|
|
4397
|
-
date: date.
|
|
4491
|
+
day: date.toFormat("d"),
|
|
4492
|
+
date: date.toISO(),
|
|
4398
4493
|
isFiller: true,
|
|
4399
|
-
today: date.
|
|
4400
|
-
selected: !!this._selectedDate && date.
|
|
4494
|
+
today: date.startOf("day").equals(today.startOf("day")),
|
|
4495
|
+
selected: !!this._selectedDate && date.startOf("day").equals(this._selectedDate.startOf("day"))
|
|
4401
4496
|
});
|
|
4402
4497
|
}
|
|
4403
4498
|
return lit.html`
|
|
@@ -4429,7 +4524,7 @@ class FlowCalendar extends FlowRdfElement {
|
|
|
4429
4524
|
max="23"
|
|
4430
4525
|
format="02"
|
|
4431
4526
|
class="calendar__time-input"
|
|
4432
|
-
value=${this._selectedDate ? this._selectedDate.hour
|
|
4527
|
+
value=${this._selectedDate ? this._selectedDate.hour : 0}
|
|
4433
4528
|
@flow-ui-change=${this.handleTimeChange}
|
|
4434
4529
|
></flow-ui-number-stepper>
|
|
4435
4530
|
<span class="calendar__time-separator">:</span>
|
|
@@ -4440,7 +4535,7 @@ class FlowCalendar extends FlowRdfElement {
|
|
|
4440
4535
|
max="59"
|
|
4441
4536
|
format="02"
|
|
4442
4537
|
class="calendar__time-input"
|
|
4443
|
-
value=${this._selectedDate ? this._selectedDate.minute
|
|
4538
|
+
value=${this._selectedDate ? this._selectedDate.minute : 0}
|
|
4444
4539
|
@flow-ui-change=${this.handleTimeChange}
|
|
4445
4540
|
></flow-ui-number-stepper>
|
|
4446
4541
|
<span class="calendar__time-separator">:</span>
|
|
@@ -4451,7 +4546,7 @@ class FlowCalendar extends FlowRdfElement {
|
|
|
4451
4546
|
max="59"
|
|
4452
4547
|
format="02"
|
|
4453
4548
|
class="calendar__time-input"
|
|
4454
|
-
value=${this._selectedDate ? this._selectedDate.second
|
|
4549
|
+
value=${this._selectedDate ? this._selectedDate.second : 0}
|
|
4455
4550
|
@flow-ui-change=${this.handleTimeChange}
|
|
4456
4551
|
></flow-ui-number-stepper>
|
|
4457
4552
|
</div>
|
|
@@ -4493,7 +4588,7 @@ __decorateClass$O([
|
|
|
4493
4588
|
decorators_js.state()
|
|
4494
4589
|
], FlowCalendar.prototype, "_selectedDate", 2);
|
|
4495
4590
|
__decorateClass$O([
|
|
4496
|
-
decorators_js.property()
|
|
4591
|
+
decorators_js.property({ reflect: true })
|
|
4497
4592
|
], FlowCalendar.prototype, "value", 2);
|
|
4498
4593
|
__decorateClass$O([
|
|
4499
4594
|
decorators_js.property({ attribute: "display-mode" })
|
|
@@ -4501,12 +4596,18 @@ __decorateClass$O([
|
|
|
4501
4596
|
__decorateClass$O([
|
|
4502
4597
|
decorators_js.property()
|
|
4503
4598
|
], FlowCalendar.prototype, "timezone", 2);
|
|
4599
|
+
__decorateClass$O([
|
|
4600
|
+
decorators_js.property()
|
|
4601
|
+
], FlowCalendar.prototype, "locale", 2);
|
|
4504
4602
|
__decorateClass$O([
|
|
4505
4603
|
decorators_js.property()
|
|
4506
4604
|
], FlowCalendar.prototype, "size", 2);
|
|
4507
4605
|
__decorateClass$O([
|
|
4508
|
-
watch(
|
|
4606
|
+
watch("value")
|
|
4509
4607
|
], FlowCalendar.prototype, "handleValueChange", 1);
|
|
4608
|
+
__decorateClass$O([
|
|
4609
|
+
watch(["timezone"])
|
|
4610
|
+
], FlowCalendar.prototype, "handleTimezoneChange", 1);
|
|
4510
4611
|
|
|
4511
4612
|
FlowCalendar.define("flow-ui-calendar");
|
|
4512
4613
|
|
|
@@ -5515,62 +5616,73 @@ const styles$K = lit.css`
|
|
|
5515
5616
|
`;
|
|
5516
5617
|
|
|
5517
5618
|
const FORMATS = {
|
|
5518
|
-
datetime:
|
|
5519
|
-
millisecond: "
|
|
5520
|
-
second:
|
|
5521
|
-
minute:
|
|
5522
|
-
hour: "
|
|
5523
|
-
day: "
|
|
5524
|
-
week: "
|
|
5525
|
-
month: "
|
|
5526
|
-
quarter: "
|
|
5527
|
-
year: "
|
|
5619
|
+
datetime: luxon.DateTime.DATETIME_MED_WITH_SECONDS,
|
|
5620
|
+
millisecond: "h:mm:ss.SSS a",
|
|
5621
|
+
second: luxon.DateTime.TIME_WITH_SECONDS,
|
|
5622
|
+
minute: luxon.DateTime.TIME_SIMPLE,
|
|
5623
|
+
hour: { hour: "numeric" },
|
|
5624
|
+
day: { day: "numeric", month: "short" },
|
|
5625
|
+
week: "DD",
|
|
5626
|
+
month: { month: "short", year: "numeric" },
|
|
5627
|
+
quarter: "'Q'q - yyyy",
|
|
5628
|
+
year: { year: "numeric" }
|
|
5528
5629
|
};
|
|
5529
|
-
function
|
|
5530
|
-
|
|
5531
|
-
options = format;
|
|
5532
|
-
format = void 0;
|
|
5533
|
-
}
|
|
5534
|
-
if (options.utc) {
|
|
5535
|
-
return dayjs__default.utc(value, format);
|
|
5536
|
-
}
|
|
5537
|
-
return dayjs__default(value, format);
|
|
5630
|
+
function create(time, options) {
|
|
5631
|
+
return luxon.DateTime.fromMillis(time, options);
|
|
5538
5632
|
}
|
|
5539
5633
|
chart_js._adapters._date.override({
|
|
5540
|
-
// _id: '
|
|
5634
|
+
// _id: 'luxon', // DEBUG
|
|
5635
|
+
init(chartOptions) {
|
|
5636
|
+
if (!this.options.locale) {
|
|
5637
|
+
this.options.locale = chartOptions.locale;
|
|
5638
|
+
}
|
|
5639
|
+
},
|
|
5541
5640
|
formats: function() {
|
|
5542
5641
|
return FORMATS;
|
|
5543
5642
|
},
|
|
5544
5643
|
parse: function(value, format) {
|
|
5545
|
-
const
|
|
5546
|
-
|
|
5644
|
+
const options = this.options;
|
|
5645
|
+
const type = typeof value;
|
|
5646
|
+
if (value === null || type === "undefined") {
|
|
5547
5647
|
return null;
|
|
5548
5648
|
}
|
|
5549
|
-
if (
|
|
5550
|
-
|
|
5551
|
-
} else if (
|
|
5552
|
-
|
|
5649
|
+
if (typeof value === "number") {
|
|
5650
|
+
value = create(value);
|
|
5651
|
+
} else if (typeof value === "string") {
|
|
5652
|
+
if (typeof format === "string") {
|
|
5653
|
+
value = luxon.DateTime.fromFormat(value, format, options);
|
|
5654
|
+
} else {
|
|
5655
|
+
value = luxon.DateTime.fromISO(value, options);
|
|
5656
|
+
}
|
|
5657
|
+
} else if (value instanceof Date) {
|
|
5658
|
+
value = luxon.DateTime.fromJSDate(value, options);
|
|
5659
|
+
} else if (typeof value === "object" && !(value instanceof luxon.DateTime)) {
|
|
5660
|
+
value = luxon.DateTime.fromObject(value, options);
|
|
5553
5661
|
}
|
|
5554
|
-
return null;
|
|
5662
|
+
return value instanceof luxon.DateTime && value.isValid ? value.valueOf() : null;
|
|
5555
5663
|
},
|
|
5556
5664
|
format: function(time, format) {
|
|
5557
|
-
|
|
5665
|
+
const datetime = create(time, this.options);
|
|
5666
|
+
return typeof format === "string" ? datetime.toFormat(format) : datetime.toLocaleString(format);
|
|
5558
5667
|
},
|
|
5559
5668
|
add: function(time, amount, unit) {
|
|
5560
|
-
|
|
5669
|
+
const args = {};
|
|
5670
|
+
args[unit] = amount;
|
|
5671
|
+
return create(time).plus(args).valueOf();
|
|
5561
5672
|
},
|
|
5562
5673
|
diff: function(max, min, unit) {
|
|
5563
|
-
return
|
|
5674
|
+
return create(max).diff(create(min)).as(unit).valueOf();
|
|
5564
5675
|
},
|
|
5565
5676
|
startOf: function(time, unit, weekday) {
|
|
5566
|
-
if (unit === "isoWeek") {
|
|
5567
|
-
|
|
5568
|
-
|
|
5677
|
+
if (unit === "isoWeek" && helpers.isNumber(weekday)) {
|
|
5678
|
+
weekday = Math.trunc(Math.min(Math.max(0, weekday), 6));
|
|
5679
|
+
const dateTime = create(time);
|
|
5680
|
+
return dateTime.minus({ days: (dateTime.weekday - weekday + 7) % 7 }).startOf("day").valueOf();
|
|
5569
5681
|
}
|
|
5570
|
-
return
|
|
5682
|
+
return unit ? create(time).startOf(unit).valueOf() : time;
|
|
5571
5683
|
},
|
|
5572
5684
|
endOf: function(time, unit) {
|
|
5573
|
-
return
|
|
5685
|
+
return create(time).endOf(unit).valueOf();
|
|
5574
5686
|
}
|
|
5575
5687
|
});
|
|
5576
5688
|
|
|
@@ -8969,7 +9081,7 @@ var __decorateClass$D = (decorators, target, key, kind) => {
|
|
|
8969
9081
|
__defProp$D(target, key, result);
|
|
8970
9082
|
return result;
|
|
8971
9083
|
};
|
|
8972
|
-
|
|
9084
|
+
class FlowTag extends FlowRdfElement {
|
|
8973
9085
|
constructor() {
|
|
8974
9086
|
super(...arguments);
|
|
8975
9087
|
this.localize = new LocalizeController(this);
|
|
@@ -9020,23 +9132,23 @@ exports.FlowTag = class FlowTag extends FlowRdfElement {
|
|
|
9020
9132
|
</span>
|
|
9021
9133
|
`;
|
|
9022
9134
|
}
|
|
9023
|
-
}
|
|
9024
|
-
|
|
9135
|
+
}
|
|
9136
|
+
FlowTag.styles = styles$E;
|
|
9137
|
+
FlowTag.dependencies = { "flow-icon-button": FlowIconButton };
|
|
9025
9138
|
__decorateClass$D([
|
|
9026
9139
|
decorators_js.property({ reflect: true })
|
|
9027
|
-
],
|
|
9140
|
+
], FlowTag.prototype, "variant", 2);
|
|
9028
9141
|
__decorateClass$D([
|
|
9029
9142
|
decorators_js.property({ reflect: true })
|
|
9030
|
-
],
|
|
9143
|
+
], FlowTag.prototype, "size", 2);
|
|
9031
9144
|
__decorateClass$D([
|
|
9032
9145
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
9033
|
-
],
|
|
9146
|
+
], FlowTag.prototype, "pill", 2);
|
|
9034
9147
|
__decorateClass$D([
|
|
9035
9148
|
decorators_js.property({ type: Boolean })
|
|
9036
|
-
],
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
], exports.FlowTag);
|
|
9149
|
+
], FlowTag.prototype, "removable", 2);
|
|
9150
|
+
|
|
9151
|
+
FlowTag.define("flow-ui-tag");
|
|
9040
9152
|
|
|
9041
9153
|
const styles$D = lit.css`
|
|
9042
9154
|
${componentStyles}
|
|
@@ -9322,8 +9434,7 @@ class FlowDatetimePicker extends FlowRdfElement {
|
|
|
9322
9434
|
this.name = "";
|
|
9323
9435
|
this.value = "";
|
|
9324
9436
|
this.displayMode = "datetime";
|
|
9325
|
-
this.format = "
|
|
9326
|
-
this.timezone = "";
|
|
9437
|
+
this.format = "FFF";
|
|
9327
9438
|
this.defaultValue = "";
|
|
9328
9439
|
this.size = "medium";
|
|
9329
9440
|
this.placeholder = "";
|
|
@@ -9367,7 +9478,9 @@ class FlowDatetimePicker extends FlowRdfElement {
|
|
|
9367
9478
|
updateDisplayLabel() {
|
|
9368
9479
|
try {
|
|
9369
9480
|
if (isStringFull(this.value)) {
|
|
9370
|
-
|
|
9481
|
+
const zone = isStringFull(this.timezone) ? this.timezone : void 0;
|
|
9482
|
+
const locale = isStringFull(this.locale) ? this.locale : void 0;
|
|
9483
|
+
this.displayLabel = luxon.DateTime.fromISO(this.value, { zone, locale }).toFormat(this.format);
|
|
9371
9484
|
} else {
|
|
9372
9485
|
this.displayLabel = "";
|
|
9373
9486
|
}
|
|
@@ -9671,7 +9784,8 @@ class FlowDatetimePicker extends FlowRdfElement {
|
|
|
9671
9784
|
value=${this.value}
|
|
9672
9785
|
display-mode=${this.displayMode}
|
|
9673
9786
|
size=${this.size}
|
|
9674
|
-
timezone=${this.timezone}
|
|
9787
|
+
timezone=${ifDefined_js.ifDefined(this.timezone)}
|
|
9788
|
+
locale=${ifDefined_js.ifDefined(this.locale)}
|
|
9675
9789
|
@flow-ui-change=${this.handleCalendarChange}
|
|
9676
9790
|
></flow-ui-calendar>
|
|
9677
9791
|
` : lit.nothing}
|
|
@@ -9718,7 +9832,7 @@ __decorateClass$C([
|
|
|
9718
9832
|
decorators_js.property()
|
|
9719
9833
|
], FlowDatetimePicker.prototype, "name", 2);
|
|
9720
9834
|
__decorateClass$C([
|
|
9721
|
-
decorators_js.property()
|
|
9835
|
+
decorators_js.property({ reflect: true })
|
|
9722
9836
|
], FlowDatetimePicker.prototype, "value", 2);
|
|
9723
9837
|
__decorateClass$C([
|
|
9724
9838
|
decorators_js.property({ attribute: "display-mode" })
|
|
@@ -9729,6 +9843,9 @@ __decorateClass$C([
|
|
|
9729
9843
|
__decorateClass$C([
|
|
9730
9844
|
decorators_js.property()
|
|
9731
9845
|
], FlowDatetimePicker.prototype, "timezone", 2);
|
|
9846
|
+
__decorateClass$C([
|
|
9847
|
+
decorators_js.property()
|
|
9848
|
+
], FlowDatetimePicker.prototype, "locale", 2);
|
|
9732
9849
|
__decorateClass$C([
|
|
9733
9850
|
defaultValue()
|
|
9734
9851
|
], FlowDatetimePicker.prototype, "defaultValue", 2);
|
|
@@ -9772,7 +9889,7 @@ __decorateClass$C([
|
|
|
9772
9889
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
9773
9890
|
], FlowDatetimePicker.prototype, "required", 2);
|
|
9774
9891
|
__decorateClass$C([
|
|
9775
|
-
watch(["value", "format", "timezone"])
|
|
9892
|
+
watch(["value", "format", "timezone", "locale"])
|
|
9776
9893
|
], FlowDatetimePicker.prototype, "updateDisplayLabel", 1);
|
|
9777
9894
|
__decorateClass$C([
|
|
9778
9895
|
watch("disabled", { waitUntilFirstUpdate: true })
|
|
@@ -12174,7 +12291,7 @@ var __decorateClass$r = (decorators, target, key, kind) => {
|
|
|
12174
12291
|
__defProp$r(target, key, result);
|
|
12175
12292
|
return result;
|
|
12176
12293
|
};
|
|
12177
|
-
|
|
12294
|
+
class FlowOption extends FlowRdfElement {
|
|
12178
12295
|
constructor() {
|
|
12179
12296
|
super(...arguments);
|
|
12180
12297
|
// @ts-expect-error - Controller is currently unused
|
|
@@ -12224,7 +12341,19 @@ exports.FlowOption = class FlowOption extends FlowRdfElement {
|
|
|
12224
12341
|
}
|
|
12225
12342
|
/** Returns a plain text label based on the option's content. */
|
|
12226
12343
|
getTextLabel() {
|
|
12227
|
-
|
|
12344
|
+
const nodes = this.childNodes;
|
|
12345
|
+
let label = "";
|
|
12346
|
+
[...nodes].forEach((node) => {
|
|
12347
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
12348
|
+
if (!node.hasAttribute("slot")) {
|
|
12349
|
+
label += node.textContent;
|
|
12350
|
+
}
|
|
12351
|
+
}
|
|
12352
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
12353
|
+
label += node.textContent;
|
|
12354
|
+
}
|
|
12355
|
+
});
|
|
12356
|
+
return label.trim();
|
|
12228
12357
|
}
|
|
12229
12358
|
render() {
|
|
12230
12359
|
return lit.html`
|
|
@@ -12253,38 +12382,38 @@ exports.FlowOption = class FlowOption extends FlowRdfElement {
|
|
|
12253
12382
|
</div>
|
|
12254
12383
|
`;
|
|
12255
12384
|
}
|
|
12256
|
-
}
|
|
12257
|
-
|
|
12385
|
+
}
|
|
12386
|
+
FlowOption.styles = styles$s;
|
|
12387
|
+
FlowOption.dependencies = { "flow-ui-icon": FlowIcon };
|
|
12258
12388
|
__decorateClass$r([
|
|
12259
12389
|
decorators_js.query(".option__label")
|
|
12260
|
-
],
|
|
12390
|
+
], FlowOption.prototype, "defaultSlot", 2);
|
|
12261
12391
|
__decorateClass$r([
|
|
12262
12392
|
decorators_js.state()
|
|
12263
|
-
],
|
|
12393
|
+
], FlowOption.prototype, "current", 2);
|
|
12264
12394
|
__decorateClass$r([
|
|
12265
12395
|
decorators_js.state()
|
|
12266
|
-
],
|
|
12396
|
+
], FlowOption.prototype, "selected", 2);
|
|
12267
12397
|
__decorateClass$r([
|
|
12268
12398
|
decorators_js.state()
|
|
12269
|
-
],
|
|
12399
|
+
], FlowOption.prototype, "hasHover", 2);
|
|
12270
12400
|
__decorateClass$r([
|
|
12271
12401
|
decorators_js.property({ reflect: true })
|
|
12272
|
-
],
|
|
12402
|
+
], FlowOption.prototype, "value", 2);
|
|
12273
12403
|
__decorateClass$r([
|
|
12274
12404
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
12275
|
-
],
|
|
12405
|
+
], FlowOption.prototype, "disabled", 2);
|
|
12276
12406
|
__decorateClass$r([
|
|
12277
12407
|
watch("disabled")
|
|
12278
|
-
],
|
|
12408
|
+
], FlowOption.prototype, "handleDisabledChange", 1);
|
|
12279
12409
|
__decorateClass$r([
|
|
12280
12410
|
watch("selected")
|
|
12281
|
-
],
|
|
12411
|
+
], FlowOption.prototype, "handleSelectedChange", 1);
|
|
12282
12412
|
__decorateClass$r([
|
|
12283
12413
|
watch("value")
|
|
12284
|
-
],
|
|
12285
|
-
|
|
12286
|
-
|
|
12287
|
-
], exports.FlowOption);
|
|
12414
|
+
], FlowOption.prototype, "handleValueChange", 1);
|
|
12415
|
+
|
|
12416
|
+
FlowOption.define("flow-ui-option");
|
|
12288
12417
|
|
|
12289
12418
|
const styles$r = lit.css`
|
|
12290
12419
|
${componentStyles}
|
|
@@ -14904,9 +15033,6 @@ __decorateClass$i([
|
|
|
14904
15033
|
FlowScrollView.define("flow-ui-scroll-view");
|
|
14905
15034
|
|
|
14906
15035
|
const styles$i = lit.css`
|
|
14907
|
-
${componentStyles}
|
|
14908
|
-
${formControlStyles}
|
|
14909
|
-
|
|
14910
15036
|
:host {
|
|
14911
15037
|
display: block;
|
|
14912
15038
|
}
|
|
@@ -14947,8 +15073,11 @@ const styles$i = lit.css`
|
|
|
14947
15073
|
vertical-align: middle;
|
|
14948
15074
|
overflow: hidden;
|
|
14949
15075
|
cursor: pointer;
|
|
14950
|
-
transition:
|
|
14951
|
-
var(--flow-ui-transition-fast)
|
|
15076
|
+
transition:
|
|
15077
|
+
var(--flow-ui-transition-fast) color,
|
|
15078
|
+
var(--flow-ui-transition-fast) border,
|
|
15079
|
+
var(--flow-ui-transition-fast) box-shadow,
|
|
15080
|
+
var(--flow-ui-transition-fast) background-color;
|
|
14952
15081
|
}
|
|
14953
15082
|
|
|
14954
15083
|
.select__display-input {
|
|
@@ -14965,6 +15094,10 @@ const styles$i = lit.css`
|
|
|
14965
15094
|
-webkit-appearance: none;
|
|
14966
15095
|
}
|
|
14967
15096
|
|
|
15097
|
+
.select__display-input::placeholder {
|
|
15098
|
+
color: var(--flow-ui-input-placeholder-color);
|
|
15099
|
+
}
|
|
15100
|
+
|
|
14968
15101
|
.select:not(.select--disabled):hover .select__display-input {
|
|
14969
15102
|
color: var(--flow-ui-input-color-hover);
|
|
14970
15103
|
}
|
|
@@ -15155,6 +15288,14 @@ const styles$i = lit.css`
|
|
|
15155
15288
|
color: var(--flow-ui-input-placeholder-color);
|
|
15156
15289
|
}
|
|
15157
15290
|
|
|
15291
|
+
/* Suffix */
|
|
15292
|
+
.select__suffix {
|
|
15293
|
+
flex: 0;
|
|
15294
|
+
display: inline-flex;
|
|
15295
|
+
align-items: center;
|
|
15296
|
+
color: var(--flow-ui-input-placeholder-color);
|
|
15297
|
+
}
|
|
15298
|
+
|
|
15158
15299
|
/* Clear button */
|
|
15159
15300
|
.select__clear {
|
|
15160
15301
|
display: inline-flex;
|
|
@@ -15217,10 +15358,11 @@ const styles$i = lit.css`
|
|
|
15217
15358
|
}
|
|
15218
15359
|
|
|
15219
15360
|
.select__listbox ::slotted(small) {
|
|
15361
|
+
display: block;
|
|
15220
15362
|
font-size: var(--flow-ui-font-size-small);
|
|
15221
15363
|
font-weight: var(--flow-ui-font-weight-semibold);
|
|
15222
15364
|
color: var(--flow-ui-color-neutral-500);
|
|
15223
|
-
padding-block: var(--flow-ui-spacing-
|
|
15365
|
+
padding-block: var(--flow-ui-spacing-2x-small);
|
|
15224
15366
|
padding-inline: var(--flow-ui-spacing-x-large);
|
|
15225
15367
|
}
|
|
15226
15368
|
`;
|
|
@@ -15236,7 +15378,7 @@ var __decorateClass$h = (decorators, target, key, kind) => {
|
|
|
15236
15378
|
__defProp$h(target, key, result);
|
|
15237
15379
|
return result;
|
|
15238
15380
|
};
|
|
15239
|
-
|
|
15381
|
+
class FlowSelect extends FlowRdfElement {
|
|
15240
15382
|
constructor() {
|
|
15241
15383
|
super(...arguments);
|
|
15242
15384
|
this.formControlController = new FormControlController(this, {
|
|
@@ -15245,7 +15387,6 @@ exports.FlowSelect = class FlowSelect extends FlowRdfElement {
|
|
|
15245
15387
|
this.hasSlotController = new HasSlotController(this, "help-text", "label");
|
|
15246
15388
|
this.localize = new LocalizeController(this);
|
|
15247
15389
|
this.typeToSelectString = "";
|
|
15248
|
-
this.pendingValue = null;
|
|
15249
15390
|
this.hasFocus = false;
|
|
15250
15391
|
this.displayLabel = "";
|
|
15251
15392
|
this.selectedOptions = [];
|
|
@@ -15267,6 +15408,129 @@ exports.FlowSelect = class FlowSelect extends FlowRdfElement {
|
|
|
15267
15408
|
this.helpText = "";
|
|
15268
15409
|
this.form = "";
|
|
15269
15410
|
this.required = false;
|
|
15411
|
+
this.getTag = (option) => {
|
|
15412
|
+
return lit.html`
|
|
15413
|
+
<flow-ui-tag
|
|
15414
|
+
part="tag"
|
|
15415
|
+
exportparts="
|
|
15416
|
+
base:tag__base,
|
|
15417
|
+
content:tag__content,
|
|
15418
|
+
remove-button:tag__remove-button,
|
|
15419
|
+
remove-button__base:tag__remove-button__base
|
|
15420
|
+
"
|
|
15421
|
+
?pill=${this.pill}
|
|
15422
|
+
size=${this.size}
|
|
15423
|
+
removable
|
|
15424
|
+
@flow-ui-remove=${(event) => this.handleTagRemove(event, option)}
|
|
15425
|
+
>
|
|
15426
|
+
${option.getTextLabel()}
|
|
15427
|
+
</flow-ui-tag>
|
|
15428
|
+
`;
|
|
15429
|
+
};
|
|
15430
|
+
this.handleDocumentFocusIn = (event) => {
|
|
15431
|
+
const path = event.composedPath();
|
|
15432
|
+
if (this && !path.includes(this)) {
|
|
15433
|
+
this.hide();
|
|
15434
|
+
}
|
|
15435
|
+
};
|
|
15436
|
+
this.handleDocumentKeyDown = (event) => {
|
|
15437
|
+
const target = event.target;
|
|
15438
|
+
const isClearButton = target.closest(".select__clear") !== null;
|
|
15439
|
+
const isIconButton = target.closest("flow-ui-icon-button") !== null;
|
|
15440
|
+
if (isClearButton || isIconButton) {
|
|
15441
|
+
return;
|
|
15442
|
+
}
|
|
15443
|
+
if (event.key === "Escape" && this.open && !this.closeWatcher) {
|
|
15444
|
+
event.preventDefault();
|
|
15445
|
+
event.stopPropagation();
|
|
15446
|
+
this.hide();
|
|
15447
|
+
this.displayInput.focus({ preventScroll: true });
|
|
15448
|
+
}
|
|
15449
|
+
if (event.key === "Enter" || event.key === " " && this.typeToSelectString === "") {
|
|
15450
|
+
event.preventDefault();
|
|
15451
|
+
event.stopImmediatePropagation();
|
|
15452
|
+
if (!this.open) {
|
|
15453
|
+
this.show();
|
|
15454
|
+
return;
|
|
15455
|
+
}
|
|
15456
|
+
if (this.currentOption && !this.currentOption.disabled) {
|
|
15457
|
+
if (this.multiple) {
|
|
15458
|
+
this.toggleOptionSelection(this.currentOption);
|
|
15459
|
+
} else {
|
|
15460
|
+
this.setSelectedOptions(this.currentOption);
|
|
15461
|
+
}
|
|
15462
|
+
this.updateComplete.then(() => {
|
|
15463
|
+
this.emit("flow-ui-input");
|
|
15464
|
+
this.emit("flow-ui-change");
|
|
15465
|
+
});
|
|
15466
|
+
if (!this.multiple) {
|
|
15467
|
+
this.hide();
|
|
15468
|
+
this.displayInput.focus({ preventScroll: true });
|
|
15469
|
+
}
|
|
15470
|
+
}
|
|
15471
|
+
return;
|
|
15472
|
+
}
|
|
15473
|
+
if (["ArrowUp", "ArrowDown", "Home", "End"].includes(event.key)) {
|
|
15474
|
+
const allOptions = this.getAllOptions();
|
|
15475
|
+
const currentIndex = allOptions.indexOf(this.currentOption);
|
|
15476
|
+
let newIndex = Math.max(0, currentIndex);
|
|
15477
|
+
event.preventDefault();
|
|
15478
|
+
if (!this.open) {
|
|
15479
|
+
this.show();
|
|
15480
|
+
if (this.currentOption) {
|
|
15481
|
+
return;
|
|
15482
|
+
}
|
|
15483
|
+
}
|
|
15484
|
+
if (event.key === "ArrowDown") {
|
|
15485
|
+
newIndex = currentIndex + 1;
|
|
15486
|
+
if (newIndex > allOptions.length - 1)
|
|
15487
|
+
newIndex = 0;
|
|
15488
|
+
} else if (event.key === "ArrowUp") {
|
|
15489
|
+
newIndex = currentIndex - 1;
|
|
15490
|
+
if (newIndex < 0)
|
|
15491
|
+
newIndex = allOptions.length - 1;
|
|
15492
|
+
} else if (event.key === "Home") {
|
|
15493
|
+
newIndex = 0;
|
|
15494
|
+
} else if (event.key === "End") {
|
|
15495
|
+
newIndex = allOptions.length - 1;
|
|
15496
|
+
}
|
|
15497
|
+
this.setCurrentOption(allOptions[newIndex]);
|
|
15498
|
+
}
|
|
15499
|
+
if (event.key.length === 1 || event.key === "Backspace") {
|
|
15500
|
+
const allOptions = this.getAllOptions();
|
|
15501
|
+
if (event.metaKey || event.ctrlKey || event.altKey) {
|
|
15502
|
+
return;
|
|
15503
|
+
}
|
|
15504
|
+
if (!this.open) {
|
|
15505
|
+
if (event.key === "Backspace") {
|
|
15506
|
+
return;
|
|
15507
|
+
}
|
|
15508
|
+
this.show();
|
|
15509
|
+
}
|
|
15510
|
+
event.stopPropagation();
|
|
15511
|
+
event.preventDefault();
|
|
15512
|
+
clearTimeout(this.typeToSelectTimeout);
|
|
15513
|
+
this.typeToSelectTimeout = window.setTimeout(() => this.typeToSelectString = "", 1e3);
|
|
15514
|
+
if (event.key === "Backspace") {
|
|
15515
|
+
this.typeToSelectString = this.typeToSelectString.slice(0, -1);
|
|
15516
|
+
} else {
|
|
15517
|
+
this.typeToSelectString += event.key.toLowerCase();
|
|
15518
|
+
}
|
|
15519
|
+
for (const option of allOptions) {
|
|
15520
|
+
const label = option.getTextLabel().toLowerCase();
|
|
15521
|
+
if (label.startsWith(this.typeToSelectString)) {
|
|
15522
|
+
this.setCurrentOption(option);
|
|
15523
|
+
break;
|
|
15524
|
+
}
|
|
15525
|
+
}
|
|
15526
|
+
}
|
|
15527
|
+
};
|
|
15528
|
+
this.handleDocumentMouseDown = (event) => {
|
|
15529
|
+
const path = event.composedPath();
|
|
15530
|
+
if (this && !path.includes(this)) {
|
|
15531
|
+
this.hide();
|
|
15532
|
+
}
|
|
15533
|
+
};
|
|
15270
15534
|
}
|
|
15271
15535
|
/** Gets the validity state object */
|
|
15272
15536
|
get validity() {
|
|
@@ -15278,20 +15542,49 @@ exports.FlowSelect = class FlowSelect extends FlowRdfElement {
|
|
|
15278
15542
|
}
|
|
15279
15543
|
connectedCallback() {
|
|
15280
15544
|
super.connectedCallback();
|
|
15281
|
-
this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this);
|
|
15282
|
-
this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);
|
|
15283
|
-
this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
|
|
15284
15545
|
this.open = false;
|
|
15546
|
+
this.mutationObserver = new MutationObserver(() => {
|
|
15547
|
+
this.updateComplete.then(() => {
|
|
15548
|
+
this.selectionChanged();
|
|
15549
|
+
});
|
|
15550
|
+
});
|
|
15551
|
+
this.mutationObserver.observe(this, {
|
|
15552
|
+
attributes: true,
|
|
15553
|
+
attributeFilter: ["value"],
|
|
15554
|
+
characterData: true,
|
|
15555
|
+
subtree: true
|
|
15556
|
+
});
|
|
15557
|
+
}
|
|
15558
|
+
disconnectedCallback() {
|
|
15559
|
+
super.disconnectedCallback();
|
|
15560
|
+
this.mutationObserver?.disconnect();
|
|
15285
15561
|
}
|
|
15286
15562
|
addOpenListeners() {
|
|
15287
15563
|
document.addEventListener("focusin", this.handleDocumentFocusIn);
|
|
15288
15564
|
document.addEventListener("keydown", this.handleDocumentKeyDown);
|
|
15289
15565
|
document.addEventListener("mousedown", this.handleDocumentMouseDown);
|
|
15566
|
+
if (this.getRootNode() !== document) {
|
|
15567
|
+
this.getRootNode().addEventListener("focusin", this.handleDocumentFocusIn);
|
|
15568
|
+
}
|
|
15569
|
+
if ("CloseWatcher" in window) {
|
|
15570
|
+
this.closeWatcher?.destroy();
|
|
15571
|
+
this.closeWatcher = new CloseWatcher();
|
|
15572
|
+
this.closeWatcher.onclose = () => {
|
|
15573
|
+
if (this.open) {
|
|
15574
|
+
this.hide();
|
|
15575
|
+
this.displayInput.focus({ preventScroll: true });
|
|
15576
|
+
}
|
|
15577
|
+
};
|
|
15578
|
+
}
|
|
15290
15579
|
}
|
|
15291
15580
|
removeOpenListeners() {
|
|
15292
15581
|
document.removeEventListener("focusin", this.handleDocumentFocusIn);
|
|
15293
15582
|
document.removeEventListener("keydown", this.handleDocumentKeyDown);
|
|
15294
15583
|
document.removeEventListener("mousedown", this.handleDocumentMouseDown);
|
|
15584
|
+
if (this.getRootNode() !== document) {
|
|
15585
|
+
this.getRootNode().removeEventListener("focusin", this.handleDocumentFocusIn);
|
|
15586
|
+
}
|
|
15587
|
+
this.closeWatcher?.destroy();
|
|
15295
15588
|
}
|
|
15296
15589
|
handleFocus() {
|
|
15297
15590
|
this.hasFocus = true;
|
|
@@ -15302,110 +15595,6 @@ exports.FlowSelect = class FlowSelect extends FlowRdfElement {
|
|
|
15302
15595
|
this.hasFocus = false;
|
|
15303
15596
|
this.emit("flow-ui-blur");
|
|
15304
15597
|
}
|
|
15305
|
-
handleDocumentFocusIn(event) {
|
|
15306
|
-
const path = event.composedPath();
|
|
15307
|
-
if (this && !path.includes(this)) {
|
|
15308
|
-
this.hide();
|
|
15309
|
-
}
|
|
15310
|
-
}
|
|
15311
|
-
handleDocumentKeyDown(event) {
|
|
15312
|
-
const target = event.target;
|
|
15313
|
-
const isClearButton = target.closest(".select__clear") !== null;
|
|
15314
|
-
const isIconButton = target.closest("flow-ui-icon-button") !== null;
|
|
15315
|
-
if (isClearButton || isIconButton) {
|
|
15316
|
-
return;
|
|
15317
|
-
}
|
|
15318
|
-
if (event.key === "Escape" && this.open) {
|
|
15319
|
-
event.preventDefault();
|
|
15320
|
-
event.stopPropagation();
|
|
15321
|
-
this.hide();
|
|
15322
|
-
this.displayInput.focus({ preventScroll: true });
|
|
15323
|
-
}
|
|
15324
|
-
if (event.key === "Enter" || event.key === " " && this.typeToSelectString === "") {
|
|
15325
|
-
event.preventDefault();
|
|
15326
|
-
event.stopImmediatePropagation();
|
|
15327
|
-
if (!this.open) {
|
|
15328
|
-
this.show();
|
|
15329
|
-
return;
|
|
15330
|
-
}
|
|
15331
|
-
if (this.currentOption && !this.currentOption.disabled) {
|
|
15332
|
-
if (this.multiple) {
|
|
15333
|
-
this.toggleOptionSelection(this.currentOption);
|
|
15334
|
-
} else {
|
|
15335
|
-
this.setSelectedOptions(this.currentOption);
|
|
15336
|
-
}
|
|
15337
|
-
this.updateComplete.then(() => {
|
|
15338
|
-
this.emit("flow-ui-input");
|
|
15339
|
-
this.emit("flow-ui-change");
|
|
15340
|
-
});
|
|
15341
|
-
if (!this.multiple) {
|
|
15342
|
-
this.hide();
|
|
15343
|
-
this.displayInput.focus({ preventScroll: true });
|
|
15344
|
-
}
|
|
15345
|
-
}
|
|
15346
|
-
return;
|
|
15347
|
-
}
|
|
15348
|
-
if (["ArrowUp", "ArrowDown", "Home", "End"].includes(event.key)) {
|
|
15349
|
-
const allOptions = this.getAllOptions();
|
|
15350
|
-
const currentIndex = allOptions.indexOf(this.currentOption);
|
|
15351
|
-
let newIndex = Math.max(0, currentIndex);
|
|
15352
|
-
event.preventDefault();
|
|
15353
|
-
if (!this.open) {
|
|
15354
|
-
this.show();
|
|
15355
|
-
if (this.currentOption) {
|
|
15356
|
-
return;
|
|
15357
|
-
}
|
|
15358
|
-
}
|
|
15359
|
-
if (event.key === "ArrowDown") {
|
|
15360
|
-
newIndex = currentIndex + 1;
|
|
15361
|
-
if (newIndex > allOptions.length - 1)
|
|
15362
|
-
newIndex = 0;
|
|
15363
|
-
} else if (event.key === "ArrowUp") {
|
|
15364
|
-
newIndex = currentIndex - 1;
|
|
15365
|
-
if (newIndex < 0)
|
|
15366
|
-
newIndex = allOptions.length - 1;
|
|
15367
|
-
} else if (event.key === "Home") {
|
|
15368
|
-
newIndex = 0;
|
|
15369
|
-
} else if (event.key === "End") {
|
|
15370
|
-
newIndex = allOptions.length - 1;
|
|
15371
|
-
}
|
|
15372
|
-
this.setCurrentOption(allOptions[newIndex]);
|
|
15373
|
-
}
|
|
15374
|
-
if (event.key.length === 1 || event.key === "Backspace") {
|
|
15375
|
-
const allOptions = this.getAllOptions();
|
|
15376
|
-
if (event.metaKey || event.ctrlKey || event.altKey) {
|
|
15377
|
-
return;
|
|
15378
|
-
}
|
|
15379
|
-
if (!this.open) {
|
|
15380
|
-
if (event.key === "Backspace") {
|
|
15381
|
-
return;
|
|
15382
|
-
}
|
|
15383
|
-
this.show();
|
|
15384
|
-
}
|
|
15385
|
-
event.stopPropagation();
|
|
15386
|
-
event.preventDefault();
|
|
15387
|
-
clearTimeout(this.typeToSelectTimeout);
|
|
15388
|
-
this.typeToSelectTimeout = window.setTimeout(() => this.typeToSelectString = "", 1e3);
|
|
15389
|
-
if (event.key === "Backspace") {
|
|
15390
|
-
this.typeToSelectString = this.typeToSelectString.slice(0, -1);
|
|
15391
|
-
} else {
|
|
15392
|
-
this.typeToSelectString += event.key.toLowerCase();
|
|
15393
|
-
}
|
|
15394
|
-
for (const option of allOptions) {
|
|
15395
|
-
const label = option.getTextLabel().toLowerCase();
|
|
15396
|
-
if (label.startsWith(this.typeToSelectString)) {
|
|
15397
|
-
this.setCurrentOption(option);
|
|
15398
|
-
break;
|
|
15399
|
-
}
|
|
15400
|
-
}
|
|
15401
|
-
}
|
|
15402
|
-
}
|
|
15403
|
-
handleDocumentMouseDown(event) {
|
|
15404
|
-
const path = event.composedPath();
|
|
15405
|
-
if (this && !path.includes(this)) {
|
|
15406
|
-
this.hide();
|
|
15407
|
-
}
|
|
15408
|
-
}
|
|
15409
15598
|
handleLabelClick() {
|
|
15410
15599
|
this.displayInput.focus();
|
|
15411
15600
|
}
|
|
@@ -15420,6 +15609,9 @@ exports.FlowSelect = class FlowSelect extends FlowRdfElement {
|
|
|
15420
15609
|
this.open = !this.open;
|
|
15421
15610
|
}
|
|
15422
15611
|
handleComboboxKeyDown(event) {
|
|
15612
|
+
if (event.key === "Tab") {
|
|
15613
|
+
return;
|
|
15614
|
+
}
|
|
15423
15615
|
event.stopPropagation();
|
|
15424
15616
|
this.handleDocumentKeyDown(event);
|
|
15425
15617
|
}
|
|
@@ -15464,13 +15656,7 @@ exports.FlowSelect = class FlowSelect extends FlowRdfElement {
|
|
|
15464
15656
|
}
|
|
15465
15657
|
handleDefaultSlotChange() {
|
|
15466
15658
|
const allOptions = this.getAllOptions();
|
|
15467
|
-
|
|
15468
|
-
if (allOptions.length && this.pendingValue) {
|
|
15469
|
-
value = this.pendingValue;
|
|
15470
|
-
this.pendingValue = null;
|
|
15471
|
-
} else {
|
|
15472
|
-
value = Array.isArray(this.value) ? this.value : [this.value];
|
|
15473
|
-
}
|
|
15659
|
+
const value = Array.isArray(this.value) ? this.value : [this.value];
|
|
15474
15660
|
const values = [];
|
|
15475
15661
|
if (customElements.get("flow-ui-option")) {
|
|
15476
15662
|
allOptions.forEach((option) => values.push(option.value));
|
|
@@ -15550,6 +15736,23 @@ exports.FlowSelect = class FlowSelect extends FlowRdfElement {
|
|
|
15550
15736
|
this.formControlController.updateValidity();
|
|
15551
15737
|
});
|
|
15552
15738
|
}
|
|
15739
|
+
get tags() {
|
|
15740
|
+
return this.selectedOptions.map((option, index) => {
|
|
15741
|
+
if (index < this.maxOptionsVisible || this.maxOptionsVisible <= 0) {
|
|
15742
|
+
const tag = this.getTag(option, index);
|
|
15743
|
+
return lit.html`
|
|
15744
|
+
<div @flow-ui-remove=${(e) => this.handleTagRemove(e, option)}>
|
|
15745
|
+
${typeof tag === "string" ? unsafeHtml_js.unsafeHTML(tag) : tag}
|
|
15746
|
+
</div>
|
|
15747
|
+
`;
|
|
15748
|
+
} else if (index === this.maxOptionsVisible) {
|
|
15749
|
+
return lit.html`
|
|
15750
|
+
<flow-ui-tag size=${this.size}>+${this.selectedOptions.length - index}</flow-ui-tag>
|
|
15751
|
+
`;
|
|
15752
|
+
}
|
|
15753
|
+
return lit.html``;
|
|
15754
|
+
});
|
|
15755
|
+
}
|
|
15553
15756
|
handleInvalid(event) {
|
|
15554
15757
|
this.formControlController.setValidity(false);
|
|
15555
15758
|
this.formControlController.emitInvalidEvent(event);
|
|
@@ -15563,9 +15766,6 @@ exports.FlowSelect = class FlowSelect extends FlowRdfElement {
|
|
|
15563
15766
|
handleValueChange() {
|
|
15564
15767
|
const allOptions = this.getAllOptions();
|
|
15565
15768
|
const value = Array.isArray(this.value) ? this.value : [this.value];
|
|
15566
|
-
if (allOptions.length === 0) {
|
|
15567
|
-
this.pendingValue = value;
|
|
15568
|
-
}
|
|
15569
15769
|
this.setSelectedOptions(allOptions.filter((el) => value.includes(el.value)));
|
|
15570
15770
|
}
|
|
15571
15771
|
async handleOpenChange() {
|
|
@@ -15727,35 +15927,7 @@ exports.FlowSelect = class FlowSelect extends FlowRdfElement {
|
|
|
15727
15927
|
/>
|
|
15728
15928
|
|
|
15729
15929
|
${this.multiple ? lit.html`
|
|
15730
|
-
<div part="tags" class="select__tags">
|
|
15731
|
-
${this.selectedOptions.map((option, index) => {
|
|
15732
|
-
if (index < this.maxOptionsVisible || this.maxOptionsVisible <= 0) {
|
|
15733
|
-
return lit.html`
|
|
15734
|
-
<flow-ui-tag
|
|
15735
|
-
part="tag"
|
|
15736
|
-
exportparts="
|
|
15737
|
-
base:tag__base,
|
|
15738
|
-
content:tag__content,
|
|
15739
|
-
remove-button:tag__remove-button,
|
|
15740
|
-
remove-button__base:tag__remove-button__base
|
|
15741
|
-
"
|
|
15742
|
-
?pill=${this.pill}
|
|
15743
|
-
size=${this.size}
|
|
15744
|
-
removable
|
|
15745
|
-
@flow-ui-remove=${(event) => this.handleTagRemove(event, option)}
|
|
15746
|
-
>
|
|
15747
|
-
${option.getTextLabel()}
|
|
15748
|
-
</flow-ui-tag>
|
|
15749
|
-
`;
|
|
15750
|
-
} else if (index === this.maxOptionsVisible) {
|
|
15751
|
-
return lit.html`
|
|
15752
|
-
<flow-ui-tag size=${this.size}>+${this.selectedOptions.length - index}</flow-ui-tag>
|
|
15753
|
-
`;
|
|
15754
|
-
} else {
|
|
15755
|
-
return null;
|
|
15756
|
-
}
|
|
15757
|
-
})}
|
|
15758
|
-
</div>
|
|
15930
|
+
<div part="tags" class="select__tags">${this.tags}</div>
|
|
15759
15931
|
` : ""}
|
|
15760
15932
|
|
|
15761
15933
|
<input
|
|
@@ -15786,6 +15958,8 @@ exports.FlowSelect = class FlowSelect extends FlowRdfElement {
|
|
|
15786
15958
|
</button>
|
|
15787
15959
|
` : ""}
|
|
15788
15960
|
|
|
15961
|
+
<slot name="suffix" part="suffix" class="select__suffix"></slot>
|
|
15962
|
+
|
|
15789
15963
|
<slot name="expand-icon" part="expand-icon" class="select__expand-icon">
|
|
15790
15964
|
<flow-ui-icon library="system" name="chevron-down"></flow-ui-icon>
|
|
15791
15965
|
</slot>
|
|
@@ -15808,50 +15982,54 @@ exports.FlowSelect = class FlowSelect extends FlowRdfElement {
|
|
|
15808
15982
|
</flow-ui-popup>
|
|
15809
15983
|
</div>
|
|
15810
15984
|
|
|
15811
|
-
<
|
|
15812
|
-
name="help-text"
|
|
15985
|
+
<div
|
|
15813
15986
|
part="form-control-help-text"
|
|
15814
15987
|
id="help-text"
|
|
15815
15988
|
class="form-control__help-text"
|
|
15816
15989
|
aria-hidden=${hasHelpText ? "false" : "true"}
|
|
15817
15990
|
>
|
|
15818
|
-
|
|
15819
|
-
</
|
|
15991
|
+
<slot name="help-text">${this.helpText}</slot>
|
|
15992
|
+
</div>
|
|
15820
15993
|
</div>
|
|
15821
15994
|
`;
|
|
15822
15995
|
}
|
|
15996
|
+
}
|
|
15997
|
+
FlowSelect.styles = [componentStyles, formControlStyles, styles$i];
|
|
15998
|
+
FlowSelect.dependencies = {
|
|
15999
|
+
"flow-icon": FlowIcon,
|
|
16000
|
+
"flow-popup": SlPopup,
|
|
16001
|
+
"flow-tag": FlowTag
|
|
15823
16002
|
};
|
|
15824
|
-
exports.FlowSelect.styles = styles$i;
|
|
15825
16003
|
__decorateClass$h([
|
|
15826
16004
|
decorators_js.query(".select")
|
|
15827
|
-
],
|
|
16005
|
+
], FlowSelect.prototype, "popup", 2);
|
|
15828
16006
|
__decorateClass$h([
|
|
15829
16007
|
decorators_js.query(".select__combobox")
|
|
15830
|
-
],
|
|
16008
|
+
], FlowSelect.prototype, "combobox", 2);
|
|
15831
16009
|
__decorateClass$h([
|
|
15832
16010
|
decorators_js.query(".select__display-input")
|
|
15833
|
-
],
|
|
16011
|
+
], FlowSelect.prototype, "displayInput", 2);
|
|
15834
16012
|
__decorateClass$h([
|
|
15835
16013
|
decorators_js.query(".select__value-input")
|
|
15836
|
-
],
|
|
16014
|
+
], FlowSelect.prototype, "valueInput", 2);
|
|
15837
16015
|
__decorateClass$h([
|
|
15838
16016
|
decorators_js.query(".select__listbox")
|
|
15839
|
-
],
|
|
16017
|
+
], FlowSelect.prototype, "listbox", 2);
|
|
15840
16018
|
__decorateClass$h([
|
|
15841
16019
|
decorators_js.state()
|
|
15842
|
-
],
|
|
16020
|
+
], FlowSelect.prototype, "hasFocus", 2);
|
|
15843
16021
|
__decorateClass$h([
|
|
15844
16022
|
decorators_js.state()
|
|
15845
|
-
],
|
|
16023
|
+
], FlowSelect.prototype, "displayLabel", 2);
|
|
15846
16024
|
__decorateClass$h([
|
|
15847
16025
|
decorators_js.state()
|
|
15848
|
-
],
|
|
16026
|
+
], FlowSelect.prototype, "currentOption", 2);
|
|
15849
16027
|
__decorateClass$h([
|
|
15850
16028
|
decorators_js.state()
|
|
15851
|
-
],
|
|
16029
|
+
], FlowSelect.prototype, "selectedOptions", 2);
|
|
15852
16030
|
__decorateClass$h([
|
|
15853
16031
|
decorators_js.property()
|
|
15854
|
-
],
|
|
16032
|
+
], FlowSelect.prototype, "name", 2);
|
|
15855
16033
|
__decorateClass$h([
|
|
15856
16034
|
decorators_js.property({
|
|
15857
16035
|
converter: {
|
|
@@ -15859,67 +16037,67 @@ __decorateClass$h([
|
|
|
15859
16037
|
toAttribute: (value) => value.join(" ")
|
|
15860
16038
|
}
|
|
15861
16039
|
})
|
|
15862
|
-
],
|
|
16040
|
+
], FlowSelect.prototype, "value", 2);
|
|
15863
16041
|
__decorateClass$h([
|
|
15864
16042
|
defaultValue()
|
|
15865
|
-
],
|
|
16043
|
+
], FlowSelect.prototype, "defaultValue", 2);
|
|
15866
16044
|
__decorateClass$h([
|
|
15867
16045
|
decorators_js.property({ reflect: true })
|
|
15868
|
-
],
|
|
16046
|
+
], FlowSelect.prototype, "size", 2);
|
|
15869
16047
|
__decorateClass$h([
|
|
15870
16048
|
decorators_js.property()
|
|
15871
|
-
],
|
|
16049
|
+
], FlowSelect.prototype, "placeholder", 2);
|
|
15872
16050
|
__decorateClass$h([
|
|
15873
16051
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
15874
|
-
],
|
|
16052
|
+
], FlowSelect.prototype, "multiple", 2);
|
|
15875
16053
|
__decorateClass$h([
|
|
15876
16054
|
decorators_js.property({ attribute: "max-options-visible", type: Number })
|
|
15877
|
-
],
|
|
16055
|
+
], FlowSelect.prototype, "maxOptionsVisible", 2);
|
|
15878
16056
|
__decorateClass$h([
|
|
15879
16057
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
15880
|
-
],
|
|
16058
|
+
], FlowSelect.prototype, "disabled", 2);
|
|
15881
16059
|
__decorateClass$h([
|
|
15882
16060
|
decorators_js.property({ type: Boolean })
|
|
15883
|
-
],
|
|
16061
|
+
], FlowSelect.prototype, "clearable", 2);
|
|
15884
16062
|
__decorateClass$h([
|
|
15885
16063
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
15886
|
-
],
|
|
16064
|
+
], FlowSelect.prototype, "open", 2);
|
|
15887
16065
|
__decorateClass$h([
|
|
15888
16066
|
decorators_js.property({ type: Boolean })
|
|
15889
|
-
],
|
|
16067
|
+
], FlowSelect.prototype, "hoist", 2);
|
|
15890
16068
|
__decorateClass$h([
|
|
15891
16069
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
15892
|
-
],
|
|
16070
|
+
], FlowSelect.prototype, "filled", 2);
|
|
15893
16071
|
__decorateClass$h([
|
|
15894
16072
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
15895
|
-
],
|
|
16073
|
+
], FlowSelect.prototype, "pill", 2);
|
|
15896
16074
|
__decorateClass$h([
|
|
15897
16075
|
decorators_js.property()
|
|
15898
|
-
],
|
|
16076
|
+
], FlowSelect.prototype, "label", 2);
|
|
15899
16077
|
__decorateClass$h([
|
|
15900
16078
|
decorators_js.property({ reflect: true })
|
|
15901
|
-
],
|
|
16079
|
+
], FlowSelect.prototype, "placement", 2);
|
|
15902
16080
|
__decorateClass$h([
|
|
15903
16081
|
decorators_js.property({ attribute: "help-text" })
|
|
15904
|
-
],
|
|
16082
|
+
], FlowSelect.prototype, "helpText", 2);
|
|
15905
16083
|
__decorateClass$h([
|
|
15906
16084
|
decorators_js.property({ reflect: true })
|
|
15907
|
-
],
|
|
16085
|
+
], FlowSelect.prototype, "form", 2);
|
|
15908
16086
|
__decorateClass$h([
|
|
15909
16087
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
15910
|
-
],
|
|
16088
|
+
], FlowSelect.prototype, "required", 2);
|
|
16089
|
+
__decorateClass$h([
|
|
16090
|
+
decorators_js.property()
|
|
16091
|
+
], FlowSelect.prototype, "getTag", 2);
|
|
15911
16092
|
__decorateClass$h([
|
|
15912
16093
|
watch("disabled", { waitUntilFirstUpdate: true })
|
|
15913
|
-
],
|
|
16094
|
+
], FlowSelect.prototype, "handleDisabledChange", 1);
|
|
15914
16095
|
__decorateClass$h([
|
|
15915
16096
|
watch("value", { waitUntilFirstUpdate: true })
|
|
15916
|
-
],
|
|
16097
|
+
], FlowSelect.prototype, "handleValueChange", 1);
|
|
15917
16098
|
__decorateClass$h([
|
|
15918
16099
|
watch("open", { waitUntilFirstUpdate: true })
|
|
15919
|
-
],
|
|
15920
|
-
exports.FlowSelect = __decorateClass$h([
|
|
15921
|
-
decorators_js.customElement("flow-ui-select")
|
|
15922
|
-
], exports.FlowSelect);
|
|
16100
|
+
], FlowSelect.prototype, "handleOpenChange", 1);
|
|
15923
16101
|
setDefaultAnimation("select.show", {
|
|
15924
16102
|
keyframes: [
|
|
15925
16103
|
{ opacity: 0, scale: 0.9 },
|
|
@@ -15935,6 +16113,8 @@ setDefaultAnimation("select.hide", {
|
|
|
15935
16113
|
options: { duration: 100, easing: "ease" }
|
|
15936
16114
|
});
|
|
15937
16115
|
|
|
16116
|
+
FlowSelect.define("flow-ui-select");
|
|
16117
|
+
|
|
15938
16118
|
const styles$h = lit.css`
|
|
15939
16119
|
${componentStyles}
|
|
15940
16120
|
|
|
@@ -19202,7 +19382,6 @@ const styles$6 = lit.css`
|
|
|
19202
19382
|
}
|
|
19203
19383
|
`;
|
|
19204
19384
|
|
|
19205
|
-
dayjs__default.locale("en");
|
|
19206
19385
|
class FlowTimer extends FlowRdfElement {
|
|
19207
19386
|
connectedCallback() {
|
|
19208
19387
|
super.connectedCallback();
|
|
@@ -21578,6 +21757,13 @@ function getBasePath(subpath = "") {
|
|
|
21578
21757
|
return basePath.replace(/\/$/, "") + (subpath ? `/${subpath.replace(/^\//, "")}` : ``);
|
|
21579
21758
|
}
|
|
21580
21759
|
|
|
21760
|
+
function setDefaultLocale(locale) {
|
|
21761
|
+
luxon.Settings.defaultLocale = locale;
|
|
21762
|
+
}
|
|
21763
|
+
function setDefaultTimeZone(timeZone) {
|
|
21764
|
+
luxon.Settings.defaultZone = timeZone;
|
|
21765
|
+
}
|
|
21766
|
+
|
|
21581
21767
|
const translation = {
|
|
21582
21768
|
$code: "en",
|
|
21583
21769
|
$name: "English",
|
|
@@ -21611,7 +21797,7 @@ const translation = {
|
|
|
21611
21797
|
};
|
|
21612
21798
|
localize.registerTranslation(translation);
|
|
21613
21799
|
|
|
21614
|
-
const version = "0.0.
|
|
21800
|
+
const version = "0.0.26";
|
|
21615
21801
|
|
|
21616
21802
|
const CONSOLE_HIGHLIGHT_STYLE = `
|
|
21617
21803
|
padding: 2px 4px;
|
|
@@ -21624,7 +21810,6 @@ function announce() {
|
|
|
21624
21810
|
|
|
21625
21811
|
announce();
|
|
21626
21812
|
|
|
21627
|
-
exports.dayjs = dayjs__default;
|
|
21628
21813
|
exports.ChartJs = chart_js.Chart;
|
|
21629
21814
|
exports.FlowCalendar = FlowCalendar;
|
|
21630
21815
|
exports.FlowChart = FlowChart;
|
|
@@ -21634,15 +21819,19 @@ exports.FlowGauge = FlowGauge;
|
|
|
21634
21819
|
exports.FlowIcon = FlowIcon;
|
|
21635
21820
|
exports.FlowIconButton = FlowIconButton;
|
|
21636
21821
|
exports.FlowNumberStepper = FlowNumberStepper;
|
|
21822
|
+
exports.FlowOption = FlowOption;
|
|
21637
21823
|
exports.FlowPanel = FlowSplitViewPanel;
|
|
21638
21824
|
exports.FlowPanelHeader = FlowPanelHeader;
|
|
21825
|
+
exports.FlowPopup = SlPopup;
|
|
21639
21826
|
exports.FlowScrollView = FlowScrollView;
|
|
21827
|
+
exports.FlowSelect = FlowSelect;
|
|
21640
21828
|
exports.FlowSplitView = FlowSplitView;
|
|
21641
21829
|
exports.FlowSplitViewDivider = FlowPanelDivider;
|
|
21642
21830
|
exports.FlowSplitViewPane = FlowSplitViewPane;
|
|
21643
21831
|
exports.FlowSplitViewToggleButton = FlowSplitViewToggleButton;
|
|
21644
21832
|
exports.FlowStepper = FlowStepper;
|
|
21645
21833
|
exports.FlowStepperPanel = FlowStepperPanel;
|
|
21834
|
+
exports.FlowTag = FlowTag;
|
|
21646
21835
|
exports.FlowTimer = FlowTimer;
|
|
21647
21836
|
exports.FlowToolButton = FlowToolButton;
|
|
21648
21837
|
exports.FlowToolButtonGroup = FlowToolButtonGroup;
|
|
@@ -21656,4 +21845,6 @@ exports.initializeChartJs = initializeChartJs;
|
|
|
21656
21845
|
exports.registerChartComponent = registerChartComponent;
|
|
21657
21846
|
exports.registerIconLibrary = registerIconLibrary;
|
|
21658
21847
|
exports.setBasePath = setBasePath;
|
|
21848
|
+
exports.setDefaultLocale = setDefaultLocale;
|
|
21849
|
+
exports.setDefaultTimeZone = setDefaultTimeZone;
|
|
21659
21850
|
exports.unregisterIconLibrary = unregisterIconLibrary;
|