@idds/js 1.0.65 → 1.0.67
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/index.js +218 -244
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -906,287 +906,261 @@ function initDrawer(rootSelector = `.${PREFIX2}-drawer`) {
|
|
|
906
906
|
|
|
907
907
|
// src/js/components/stateful/basic-dropdown.js
|
|
908
908
|
var PREFIX3 = "ina";
|
|
909
|
-
|
|
910
|
-
const
|
|
911
|
-
|
|
912
|
-
if (
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
} else {
|
|
938
|
-
panel.style.display = "none";
|
|
939
|
-
}
|
|
940
|
-
if (rootSelector.includes("basic")) {
|
|
941
|
-
const btn = trigger.querySelector(
|
|
942
|
-
`.${PREFIX3}-basic-dropdown__trigger-button`
|
|
943
|
-
);
|
|
944
|
-
if (btn)
|
|
945
|
-
btn.classList.remove(
|
|
946
|
-
`${PREFIX3}-basic-dropdown__trigger-button--open`
|
|
947
|
-
);
|
|
948
|
-
} else {
|
|
949
|
-
trigger.classList.remove(`${PREFIX3}-action-dropdown__trigger--open`);
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
};
|
|
953
|
-
if (!activeClass) {
|
|
954
|
-
panel.style.display = "none";
|
|
909
|
+
function closeAllDropdowns(except = null) {
|
|
910
|
+
const openDropdowns = document.querySelectorAll(`[aria-expanded="true"]`);
|
|
911
|
+
openDropdowns.forEach((trigger) => {
|
|
912
|
+
if (trigger === except) return;
|
|
913
|
+
if (trigger.closest(`.${PREFIX3}-basic-dropdown`) || trigger.closest(`.${PREFIX3}-action-dropdown`)) {
|
|
914
|
+
toggleDropdown(trigger, false);
|
|
915
|
+
}
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
function toggleDropdown(trigger, forceState) {
|
|
919
|
+
const root = trigger.closest(`.${PREFIX3}-basic-dropdown`) || trigger.closest(`.${PREFIX3}-action-dropdown`);
|
|
920
|
+
if (!root) return;
|
|
921
|
+
const isBasic = root.classList.contains(`${PREFIX3}-basic-dropdown`);
|
|
922
|
+
const panel = root.querySelector(
|
|
923
|
+
isBasic ? `.${PREFIX3}-basic-dropdown__panel` : `.${PREFIX3}-action-dropdown__menu`
|
|
924
|
+
);
|
|
925
|
+
if (!panel) return;
|
|
926
|
+
const currentState = trigger.getAttribute("aria-expanded") === "true";
|
|
927
|
+
const newState = forceState !== void 0 ? forceState : !currentState;
|
|
928
|
+
trigger.setAttribute("aria-expanded", newState);
|
|
929
|
+
if (isBasic) {
|
|
930
|
+
const btn = trigger.querySelector(
|
|
931
|
+
`.${PREFIX3}-basic-dropdown__trigger-button`
|
|
932
|
+
);
|
|
933
|
+
if (newState) {
|
|
934
|
+
if (btn)
|
|
935
|
+
btn.classList.add(`${PREFIX3}-basic-dropdown__trigger-button--open`);
|
|
936
|
+
panel.style.removeProperty("display");
|
|
955
937
|
} else {
|
|
956
|
-
|
|
938
|
+
if (btn)
|
|
939
|
+
btn.classList.remove(`${PREFIX3}-basic-dropdown__trigger-button--open`);
|
|
940
|
+
panel.style.display = "none";
|
|
941
|
+
}
|
|
942
|
+
} else {
|
|
943
|
+
const visibleClass = `${PREFIX3}-action-dropdown__menu--visible`;
|
|
944
|
+
const triggerOpenClass = `${PREFIX3}-action-dropdown__trigger--open`;
|
|
945
|
+
if (newState) {
|
|
946
|
+
trigger.classList.add(triggerOpenClass);
|
|
947
|
+
panel.classList.add(visibleClass);
|
|
957
948
|
panel.style.removeProperty("display");
|
|
949
|
+
} else {
|
|
950
|
+
trigger.classList.remove(triggerOpenClass);
|
|
951
|
+
panel.classList.remove(visibleClass);
|
|
958
952
|
}
|
|
959
|
-
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
function initBasicDropdown() {
|
|
956
|
+
if (window.__inaBasicDropdownInitialized) return;
|
|
957
|
+
document.addEventListener("click", (e) => {
|
|
958
|
+
const target = e.target;
|
|
959
|
+
const trigger = target.closest(`.${PREFIX3}-basic-dropdown__trigger`) || target.closest(`.${PREFIX3}-action-dropdown__trigger`);
|
|
960
|
+
if (trigger) {
|
|
961
|
+
if (trigger.tagName === "BUTTON") e.preventDefault();
|
|
962
|
+
const root = trigger.closest(`.${PREFIX3}-basic-dropdown`) || trigger.closest(`.${PREFIX3}-action-dropdown`);
|
|
963
|
+
if (trigger.disabled || trigger.classList.contains(
|
|
964
|
+
`${PREFIX3}-action-dropdown__trigger--disabled`
|
|
965
|
+
))
|
|
966
|
+
return;
|
|
967
|
+
closeAllDropdowns(trigger);
|
|
968
|
+
toggleDropdown(trigger);
|
|
960
969
|
e.stopPropagation();
|
|
961
|
-
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
const item = target.closest(`.${PREFIX3}-action-dropdown__item`);
|
|
973
|
+
if (item) {
|
|
974
|
+
if (!item.disabled && !item.classList.contains(`${PREFIX3}-action-dropdown__item--disabled`)) {
|
|
975
|
+
const root = item.closest(`.${PREFIX3}-action-dropdown`);
|
|
976
|
+
const trigger2 = root?.querySelector(
|
|
977
|
+
`.${PREFIX3}-action-dropdown__trigger`
|
|
978
|
+
);
|
|
979
|
+
if (trigger2) toggleDropdown(trigger2, false);
|
|
971
980
|
}
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
if (item && !item.disabled) {
|
|
977
|
-
toggle(false);
|
|
978
|
-
}
|
|
979
|
-
});
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
if (target.closest(`.${PREFIX3}-basic-dropdown__panel`) || target.closest(`.${PREFIX3}-action-dropdown__menu`)) {
|
|
984
|
+
return;
|
|
980
985
|
}
|
|
981
|
-
|
|
986
|
+
closeAllDropdowns();
|
|
982
987
|
});
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
);
|
|
988
|
+
document.addEventListener("keydown", (e) => {
|
|
989
|
+
if (e.key === "Escape") {
|
|
990
|
+
closeAllDropdowns();
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
window.__inaBasicDropdownInitialized = true;
|
|
990
994
|
}
|
|
991
995
|
function initActionDropdown() {
|
|
992
|
-
|
|
993
|
-
`.${PREFIX3}-action-dropdown`,
|
|
994
|
-
`.${PREFIX3}-action-dropdown__trigger`,
|
|
995
|
-
`.${PREFIX3}-action-dropdown__menu`,
|
|
996
|
-
`${PREFIX3}-action-dropdown__menu--visible`
|
|
997
|
-
);
|
|
996
|
+
initBasicDropdown();
|
|
998
997
|
}
|
|
999
998
|
|
|
1000
999
|
// src/js/components/stateful/select-dropdown.js
|
|
1001
1000
|
var PREFIX4 = "ina";
|
|
1002
|
-
function
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
);
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
)
|
|
1017
|
-
|
|
1018
|
-
let isOpen = false;
|
|
1019
|
-
let selectedValues = [];
|
|
1020
|
-
const options = panel.querySelectorAll(
|
|
1021
|
-
`.${PREFIX4}-select-dropdown__option`
|
|
1022
|
-
);
|
|
1023
|
-
options.forEach((opt) => {
|
|
1024
|
-
if (opt.classList.contains(
|
|
1025
|
-
`${PREFIX4}-select-dropdown__option--selected-single`
|
|
1026
|
-
) || opt.classList.contains(
|
|
1027
|
-
`${PREFIX4}-select-dropdown__option--selected-multiple`
|
|
1028
|
-
)) {
|
|
1029
|
-
const val = getOptionValue(opt);
|
|
1030
|
-
if (val) selectedValues.push(val);
|
|
1031
|
-
}
|
|
1032
|
-
});
|
|
1033
|
-
const toggle = (force) => {
|
|
1034
|
-
const shouldOpen = force !== void 0 ? force : !isOpen;
|
|
1035
|
-
if (shouldOpen === isOpen) return;
|
|
1036
|
-
isOpen = shouldOpen;
|
|
1037
|
-
trigger.setAttribute("aria-expanded", isOpen);
|
|
1038
|
-
if (isOpen) {
|
|
1001
|
+
function getDropdownState(root) {
|
|
1002
|
+
return {
|
|
1003
|
+
isOpen: root.getAttribute("data-state") === "open",
|
|
1004
|
+
values: JSON.parse(root.getAttribute("data-values") || "[]"),
|
|
1005
|
+
isMultiple: root.getAttribute("data-multiple") === "true",
|
|
1006
|
+
isSearchable: root.getAttribute("data-searchable") !== "false"
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
function setDropdownState(root, newState) {
|
|
1010
|
+
if (newState.isOpen !== void 0) {
|
|
1011
|
+
root.setAttribute("data-state", newState.isOpen ? "open" : "closed");
|
|
1012
|
+
const trigger = root.querySelector(`.${PREFIX4}-select-dropdown__trigger`);
|
|
1013
|
+
if (trigger) trigger.setAttribute("aria-expanded", newState.isOpen);
|
|
1014
|
+
const panel = root.querySelector(`.${PREFIX4}-select-dropdown__panel`);
|
|
1015
|
+
if (panel) {
|
|
1016
|
+
if (newState.isOpen) {
|
|
1039
1017
|
panel.style.removeProperty("display");
|
|
1040
|
-
if (input) input.focus();
|
|
1041
1018
|
} else {
|
|
1042
1019
|
panel.style.display = "none";
|
|
1043
1020
|
}
|
|
1044
|
-
};
|
|
1045
|
-
panel.style.display = "none";
|
|
1046
|
-
function getOptionValue(option) {
|
|
1047
|
-
return option.getAttribute("data-value");
|
|
1048
1021
|
}
|
|
1049
|
-
|
|
1050
|
-
|
|
1022
|
+
}
|
|
1023
|
+
if (newState.values !== void 0) {
|
|
1024
|
+
root.setAttribute("data-values", JSON.stringify(newState.values));
|
|
1025
|
+
updateTriggerUI(root, newState.values, newState.isMultiple);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
function closeAllSelectDropdowns(exceptRoot = null) {
|
|
1029
|
+
document.querySelectorAll(`.${PREFIX4}-select-dropdown[data-state="open"]`).forEach((root) => {
|
|
1030
|
+
if (root !== exceptRoot) {
|
|
1031
|
+
setDropdownState(root, { isOpen: false });
|
|
1032
|
+
}
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
function updateTriggerUI(root, values, isMultiple) {
|
|
1036
|
+
const trigger = root.querySelector(`.${PREFIX4}-select-dropdown__trigger`);
|
|
1037
|
+
const input = trigger.querySelector("input");
|
|
1038
|
+
const textSpan = trigger.querySelector(
|
|
1039
|
+
`.${PREFIX4}-select-dropdown__trigger-text`
|
|
1040
|
+
);
|
|
1041
|
+
const placeholder = input ? input.getAttribute("placeholder") : textSpan ? textSpan.getAttribute("data-placeholder") : "Select...";
|
|
1042
|
+
const options = root.querySelectorAll(`.${PREFIX4}-select-dropdown__option`);
|
|
1043
|
+
const getLabel = (val) => {
|
|
1044
|
+
const opt = Array.from(options).find(
|
|
1045
|
+
(o) => o.getAttribute("data-value") === val
|
|
1046
|
+
);
|
|
1047
|
+
return opt ? opt.textContent.trim() : val;
|
|
1048
|
+
};
|
|
1049
|
+
let label = "";
|
|
1050
|
+
if (values.length === 0) {
|
|
1051
|
+
} else if (isMultiple) {
|
|
1052
|
+
label = values.length > 3 ? `${values.length} data terpilih` : values.map(getLabel).join(", ");
|
|
1053
|
+
} else {
|
|
1054
|
+
label = getLabel(values[0]);
|
|
1055
|
+
}
|
|
1056
|
+
if (input) {
|
|
1057
|
+
input.value = !isMultiple && values.length > 0 && root.getAttribute("data-state") !== "open" ? label : "";
|
|
1058
|
+
if (values.length > 0) {
|
|
1059
|
+
input.placeholder = label;
|
|
1060
|
+
} else {
|
|
1061
|
+
input.placeholder = "Select...";
|
|
1051
1062
|
}
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1063
|
+
} else if (textSpan) {
|
|
1064
|
+
textSpan.textContent = values.length > 0 ? label : placeholder;
|
|
1065
|
+
textSpan.classList.toggle(
|
|
1066
|
+
`${PREFIX4}-select-dropdown__trigger-text--placeholder`,
|
|
1067
|
+
values.length === 0
|
|
1068
|
+
);
|
|
1069
|
+
}
|
|
1070
|
+
options.forEach((opt) => {
|
|
1071
|
+
const val = opt.getAttribute("data-value");
|
|
1072
|
+
const isSelected = values.includes(val);
|
|
1073
|
+
if (isMultiple) {
|
|
1074
|
+
opt.classList.toggle(
|
|
1075
|
+
`${PREFIX4}-select-dropdown__option--selected-multiple`,
|
|
1076
|
+
isSelected
|
|
1055
1077
|
);
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
const val = selectedValues[0];
|
|
1085
|
-
let label = "";
|
|
1086
|
-
if (val) {
|
|
1087
|
-
const opt = Array.from(options).find(
|
|
1088
|
-
(o) => getOptionValue(o) === val
|
|
1089
|
-
);
|
|
1090
|
-
label = opt ? getOptionLabel(opt) : val;
|
|
1091
|
-
} else {
|
|
1092
|
-
label = input ? input.getAttribute("placeholder") : triggerText ? triggerText.getAttribute("data-placeholder") : "Select...";
|
|
1078
|
+
const cb = opt.querySelector(
|
|
1079
|
+
`.${PREFIX4}-select-dropdown__option-checkbox`
|
|
1080
|
+
);
|
|
1081
|
+
if (cb)
|
|
1082
|
+
cb.classList.toggle(
|
|
1083
|
+
`${PREFIX4}-select-dropdown__option-checkbox--checked`,
|
|
1084
|
+
isSelected
|
|
1085
|
+
);
|
|
1086
|
+
} else {
|
|
1087
|
+
opt.classList.toggle(
|
|
1088
|
+
`${PREFIX4}-select-dropdown__option--selected-single`,
|
|
1089
|
+
isSelected
|
|
1090
|
+
);
|
|
1091
|
+
}
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
function initSelectDropdown() {
|
|
1095
|
+
if (window.__inaSelectDropdownInitialized) return;
|
|
1096
|
+
document.addEventListener("click", (e) => {
|
|
1097
|
+
const target = e.target;
|
|
1098
|
+
const trigger = target.closest(`.${PREFIX4}-select-dropdown__trigger`);
|
|
1099
|
+
const option = target.closest(`.${PREFIX4}-select-dropdown__option`);
|
|
1100
|
+
const root = target.closest(`.${PREFIX4}-select-dropdown`);
|
|
1101
|
+
if (trigger) {
|
|
1102
|
+
if (root) {
|
|
1103
|
+
const state = getDropdownState(root);
|
|
1104
|
+
if (target.tagName === "INPUT" && state.isOpen) {
|
|
1105
|
+
return;
|
|
1093
1106
|
}
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
`${PREFIX4}-select-dropdown__trigger-text--placeholder`,
|
|
1100
|
-
!val
|
|
1101
|
-
);
|
|
1107
|
+
closeAllSelectDropdowns(root);
|
|
1108
|
+
setDropdownState(root, { isOpen: !state.isOpen });
|
|
1109
|
+
if (!state.isOpen) {
|
|
1110
|
+
const input = trigger.querySelector("input");
|
|
1111
|
+
if (input) input.focus();
|
|
1102
1112
|
}
|
|
1103
1113
|
}
|
|
1114
|
+
return;
|
|
1104
1115
|
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
const val =
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
if (
|
|
1111
|
-
|
|
1112
|
-
option.classList.remove(
|
|
1113
|
-
`${PREFIX4}-select-dropdown__option--selected-multiple`
|
|
1114
|
-
);
|
|
1115
|
-
const checkbox = option.querySelector(
|
|
1116
|
-
`.${PREFIX4}-select-dropdown__option-checkbox`
|
|
1117
|
-
);
|
|
1118
|
-
if (checkbox)
|
|
1119
|
-
checkbox.classList.remove(
|
|
1120
|
-
`${PREFIX4}-select-dropdown__option-checkbox--checked`
|
|
1121
|
-
);
|
|
1116
|
+
if (option && root) {
|
|
1117
|
+
const state = getDropdownState(root);
|
|
1118
|
+
const val = option.getAttribute("data-value");
|
|
1119
|
+
let newValues = [...state.values];
|
|
1120
|
+
if (state.isMultiple) {
|
|
1121
|
+
if (newValues.includes(val)) {
|
|
1122
|
+
newValues = newValues.filter((v) => v !== val);
|
|
1122
1123
|
} else {
|
|
1123
|
-
|
|
1124
|
-
option.classList.add(
|
|
1125
|
-
`${PREFIX4}-select-dropdown__option--selected-multiple`
|
|
1126
|
-
);
|
|
1127
|
-
const checkbox = option.querySelector(
|
|
1128
|
-
`.${PREFIX4}-select-dropdown__option-checkbox`
|
|
1129
|
-
);
|
|
1130
|
-
if (checkbox)
|
|
1131
|
-
checkbox.classList.add(
|
|
1132
|
-
`${PREFIX4}-select-dropdown__option-checkbox--checked`
|
|
1133
|
-
);
|
|
1124
|
+
newValues.push(val);
|
|
1134
1125
|
}
|
|
1126
|
+
setDropdownState(root, { values: newValues });
|
|
1135
1127
|
} else {
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
o.classList.remove(
|
|
1139
|
-
`${PREFIX4}-select-dropdown__option--selected-single`
|
|
1140
|
-
);
|
|
1141
|
-
});
|
|
1142
|
-
option.classList.add(
|
|
1143
|
-
`${PREFIX4}-select-dropdown__option--selected-single`
|
|
1144
|
-
);
|
|
1145
|
-
toggle(false);
|
|
1128
|
+
newValues = [val];
|
|
1129
|
+
setDropdownState(root, { values: newValues, isOpen: false });
|
|
1146
1130
|
}
|
|
1147
|
-
|
|
1148
|
-
dropdown.dispatchEvent(
|
|
1131
|
+
root.dispatchEvent(
|
|
1149
1132
|
new CustomEvent("change", {
|
|
1150
|
-
detail: {
|
|
1133
|
+
detail: {
|
|
1134
|
+
value: state.isMultiple ? newValues : newValues[0]
|
|
1135
|
+
}
|
|
1151
1136
|
})
|
|
1152
1137
|
);
|
|
1138
|
+
e.stopPropagation();
|
|
1139
|
+
return;
|
|
1153
1140
|
}
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
input.addEventListener("input", (e) => {
|
|
1141
|
+
if (!root) {
|
|
1142
|
+
closeAllSelectDropdowns();
|
|
1143
|
+
}
|
|
1144
|
+
});
|
|
1145
|
+
document.addEventListener("input", (e) => {
|
|
1146
|
+
if (e.target.matches(`.${PREFIX4}-select-dropdown__trigger-input`)) {
|
|
1147
|
+
const root = e.target.closest(`.${PREFIX4}-select-dropdown`);
|
|
1148
|
+
if (root) {
|
|
1163
1149
|
const term = e.target.value.toLowerCase();
|
|
1164
|
-
|
|
1150
|
+
const options = root.querySelectorAll(
|
|
1151
|
+
`.${PREFIX4}-select-dropdown__option`
|
|
1152
|
+
);
|
|
1153
|
+
if (root.getAttribute("data-state") !== "open") {
|
|
1154
|
+
setDropdownState(root, { isOpen: true });
|
|
1155
|
+
}
|
|
1165
1156
|
options.forEach((opt) => {
|
|
1166
|
-
const
|
|
1167
|
-
|
|
1168
|
-
opt.style.display = match ? "" : "none";
|
|
1157
|
+
const text = opt.textContent.trim().toLowerCase();
|
|
1158
|
+
opt.style.display = text.includes(term) ? "" : "none";
|
|
1169
1159
|
});
|
|
1170
|
-
}
|
|
1171
|
-
}
|
|
1172
|
-
options.forEach((opt) => {
|
|
1173
|
-
opt.addEventListener("click", (e) => {
|
|
1174
|
-
e.stopPropagation();
|
|
1175
|
-
selectOption(opt);
|
|
1176
|
-
});
|
|
1177
|
-
});
|
|
1178
|
-
document.addEventListener("click", (e) => {
|
|
1179
|
-
if (!dropdown.contains(e.target)) toggle(false);
|
|
1180
|
-
});
|
|
1181
|
-
if (optionsContainer) {
|
|
1182
|
-
optionsContainer.addEventListener("scroll", () => {
|
|
1183
|
-
if (optionsContainer.scrollTop + optionsContainer.clientHeight >= optionsContainer.scrollHeight - 20) {
|
|
1184
|
-
dropdown.dispatchEvent(new CustomEvent("scroll-end"));
|
|
1185
|
-
}
|
|
1186
|
-
});
|
|
1160
|
+
}
|
|
1187
1161
|
}
|
|
1188
|
-
dropdown.__inaSelectDropdownInitialized = true;
|
|
1189
1162
|
});
|
|
1163
|
+
window.__inaSelectDropdownInitialized = true;
|
|
1190
1164
|
}
|
|
1191
1165
|
|
|
1192
1166
|
// src/js/components/stateful/file-upload.js
|