@farm-investimentos/front-mfe-components-vue3 1.4.0 → 1.4.1
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/front-mfe-components.common.js +408 -413
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +1 -1
- package/dist/front-mfe-components.umd.js +408 -413
- package/dist/front-mfe-components.umd.js.map +1 -1
- package/dist/front-mfe-components.umd.min.js +1 -1
- package/dist/front-mfe-components.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Tooltip/Tooltip.scss +0 -21
- package/src/components/Tooltip/Tooltip.stories.js +38 -38
- package/src/components/Tooltip/Tooltip.vue +7 -12
- package/src/components/Tooltip/docs/Tooltip.md +50 -24
- package/src/components/Tooltip/types.ts +3 -11
- package/src/main.ts +2 -0
|
@@ -2754,7 +2754,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
2754
2754
|
TextArea: function() { return /* reexport */ TextArea_TextArea; },
|
|
2755
2755
|
TextFieldV2: function() { return /* reexport */ TextFieldV2_TextFieldV2; },
|
|
2756
2756
|
ToggleButton: function() { return /* reexport */ ToggleButton_ToggleButton; },
|
|
2757
|
-
Tooltip: function() { return /* reexport */
|
|
2757
|
+
Tooltip: function() { return /* reexport */ components_Tooltip; },
|
|
2758
2758
|
Typography: function() { return /* reexport */ Typography_Typography; },
|
|
2759
2759
|
ValueCaption: function() { return /* reexport */ ValueCaption_ValueCaption; }
|
|
2760
2760
|
});
|
|
@@ -6908,6 +6908,353 @@ const TableContextMenu_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(T
|
|
|
6908
6908
|
;// CONCATENATED MODULE: ./src/components/TableContextMenu/index.ts
|
|
6909
6909
|
|
|
6910
6910
|
/* harmony default export */ var components_TableContextMenu = (TableContextMenu);
|
|
6911
|
+
;// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??clonedRuleSet-89.use[0]!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-89.use[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[1]!./src/components/Tooltip/Tooltip.vue?vue&type=script&setup=true&lang=ts
|
|
6912
|
+
|
|
6913
|
+
|
|
6914
|
+
|
|
6915
|
+
|
|
6916
|
+
const Tooltipvue_type_script_setup_true_lang_ts_withScopeId = n => (_pushScopeId("data-v-46d8db88"), n = n(), _popScopeId(), n);
|
|
6917
|
+
const Tooltipvue_type_script_setup_true_lang_ts_hoisted_1 = {
|
|
6918
|
+
key: 0,
|
|
6919
|
+
class: "tooltip-header"
|
|
6920
|
+
};
|
|
6921
|
+
const Tooltipvue_type_script_setup_true_lang_ts_hoisted_2 = {
|
|
6922
|
+
key: 0,
|
|
6923
|
+
class: "tooltip-title"
|
|
6924
|
+
};
|
|
6925
|
+
const Tooltipvue_type_script_setup_true_lang_ts_hoisted_3 = {
|
|
6926
|
+
class: "tooltip-content"
|
|
6927
|
+
};
|
|
6928
|
+
|
|
6929
|
+
const ARROW_OFFSET = 18;
|
|
6930
|
+
const Z_INDEX_OFFSET = 1000;
|
|
6931
|
+
const DEFAULT_Z_INDEX = 10001;
|
|
6932
|
+
/* harmony default export */ var Tooltipvue_type_script_setup_true_lang_ts = (/*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
|
|
6933
|
+
...{
|
|
6934
|
+
name: 'farm-tooltip'
|
|
6935
|
+
},
|
|
6936
|
+
__name: 'Tooltip',
|
|
6937
|
+
props: {
|
|
6938
|
+
modelValue: {
|
|
6939
|
+
type: Boolean,
|
|
6940
|
+
default: undefined
|
|
6941
|
+
},
|
|
6942
|
+
trigger: {
|
|
6943
|
+
default: 'hover'
|
|
6944
|
+
},
|
|
6945
|
+
placement: {
|
|
6946
|
+
default: 'top-center'
|
|
6947
|
+
},
|
|
6948
|
+
offset: {
|
|
6949
|
+
default: 8
|
|
6950
|
+
},
|
|
6951
|
+
variant: {
|
|
6952
|
+
default: 'dark'
|
|
6953
|
+
},
|
|
6954
|
+
size: {
|
|
6955
|
+
default: 'md'
|
|
6956
|
+
},
|
|
6957
|
+
maxWidth: {
|
|
6958
|
+
default: undefined
|
|
6959
|
+
},
|
|
6960
|
+
delay: {
|
|
6961
|
+
default: () => [100, 50]
|
|
6962
|
+
},
|
|
6963
|
+
disabled: {
|
|
6964
|
+
type: Boolean,
|
|
6965
|
+
default: false
|
|
6966
|
+
},
|
|
6967
|
+
fluid: {
|
|
6968
|
+
type: Boolean,
|
|
6969
|
+
default: false
|
|
6970
|
+
}
|
|
6971
|
+
},
|
|
6972
|
+
emits: ["update:modelValue", "show", "hide"],
|
|
6973
|
+
setup(__props, {
|
|
6974
|
+
emit: __emit
|
|
6975
|
+
}) {
|
|
6976
|
+
const props = __props;
|
|
6977
|
+
const emit = __emit;
|
|
6978
|
+
const slots = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.useSlots)();
|
|
6979
|
+
const containerRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(null);
|
|
6980
|
+
const activatorRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(null);
|
|
6981
|
+
const tooltipRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(null);
|
|
6982
|
+
const scrollableElementsRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(null);
|
|
6983
|
+
let modalCache = null;
|
|
6984
|
+
const isVisible = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(false);
|
|
6985
|
+
const isControlled = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => props.modelValue !== undefined);
|
|
6986
|
+
const hasTitle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => !!slots.title);
|
|
6987
|
+
const showCloseButton = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => isControlled.value && hasTitle.value);
|
|
6988
|
+
const normalizedMaxWidth = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
6989
|
+
if (props.fluid) {
|
|
6990
|
+
return '300px';
|
|
6991
|
+
}
|
|
6992
|
+
return props.maxWidth;
|
|
6993
|
+
});
|
|
6994
|
+
const tooltipClasses = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => ({
|
|
6995
|
+
'tooltip-popup': true,
|
|
6996
|
+
'tooltip-popup--visible': isVisible.value,
|
|
6997
|
+
[`tooltip-popup--${props.variant}`]: true,
|
|
6998
|
+
[`tooltip-popup--${props.size}`]: true,
|
|
6999
|
+
'tooltip-popup--has-title': hasTitle.value,
|
|
7000
|
+
[`tooltip-popup--${props.placement}`]: true
|
|
7001
|
+
}));
|
|
7002
|
+
const tooltipStyles = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
7003
|
+
const styles = {
|
|
7004
|
+
position: 'fixed',
|
|
7005
|
+
zIndex: String(getTooltipZIndex())
|
|
7006
|
+
};
|
|
7007
|
+
if (normalizedMaxWidth.value) {
|
|
7008
|
+
styles.maxWidth = typeof normalizedMaxWidth.value === 'number' ? `${normalizedMaxWidth.value}px` : normalizedMaxWidth.value;
|
|
7009
|
+
styles.width = 'auto';
|
|
7010
|
+
}
|
|
7011
|
+
return styles;
|
|
7012
|
+
});
|
|
7013
|
+
const arrowStyles = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
7014
|
+
const [verticalPos] = props.placement.split('-');
|
|
7015
|
+
const arrowColor = props.variant === 'light' ? '#ffffff' : '#333333';
|
|
7016
|
+
const styles = {
|
|
7017
|
+
position: 'absolute',
|
|
7018
|
+
width: '0',
|
|
7019
|
+
height: '0',
|
|
7020
|
+
borderStyle: 'solid',
|
|
7021
|
+
zIndex: 'inherit'
|
|
7022
|
+
};
|
|
7023
|
+
if (verticalPos === 'top') {
|
|
7024
|
+
styles.bottom = '-6px';
|
|
7025
|
+
styles.borderWidth = '6px 6px 0 6px';
|
|
7026
|
+
styles.borderColor = `${arrowColor} transparent transparent transparent`;
|
|
7027
|
+
} else {
|
|
7028
|
+
styles.top = '-6px';
|
|
7029
|
+
styles.borderWidth = '0 6px 6px 6px';
|
|
7030
|
+
styles.borderColor = `transparent transparent ${arrowColor} transparent`;
|
|
7031
|
+
}
|
|
7032
|
+
styles.left = '50%';
|
|
7033
|
+
styles.transform = 'translateX(-50%)';
|
|
7034
|
+
return styles;
|
|
7035
|
+
});
|
|
7036
|
+
const getTooltipZIndex = () => {
|
|
7037
|
+
const now = Date.now();
|
|
7038
|
+
let modals;
|
|
7039
|
+
if (modalCache && now - modalCache.timestamp < 500) {
|
|
7040
|
+
modals = modalCache.modals;
|
|
7041
|
+
} else {
|
|
7042
|
+
modals = Array.from(document.querySelectorAll('.farm-modal'));
|
|
7043
|
+
modalCache = {
|
|
7044
|
+
modals,
|
|
7045
|
+
timestamp: now
|
|
7046
|
+
};
|
|
7047
|
+
}
|
|
7048
|
+
let maxModalZIndex = 0;
|
|
7049
|
+
modals.forEach(modal => {
|
|
7050
|
+
const htmlModal = modal;
|
|
7051
|
+
let zIndex = parseInt(htmlModal.style.zIndex, 10);
|
|
7052
|
+
if (Number.isNaN(zIndex)) {
|
|
7053
|
+
const computedZIndex = window.getComputedStyle(htmlModal).zIndex;
|
|
7054
|
+
if (computedZIndex === 'auto') {
|
|
7055
|
+
zIndex = 0;
|
|
7056
|
+
} else {
|
|
7057
|
+
zIndex = parseInt(computedZIndex, 10) || 0;
|
|
7058
|
+
}
|
|
7059
|
+
}
|
|
7060
|
+
if (zIndex > maxModalZIndex) {
|
|
7061
|
+
maxModalZIndex = zIndex;
|
|
7062
|
+
}
|
|
7063
|
+
});
|
|
7064
|
+
return maxModalZIndex > 0 ? maxModalZIndex + Z_INDEX_OFFSET : DEFAULT_Z_INDEX;
|
|
7065
|
+
};
|
|
7066
|
+
const calculateTooltipPosition = (activatorRect, tooltipRect, placement, offset = 8) => {
|
|
7067
|
+
const [verticalPos, horizontalAlign] = placement.split('-');
|
|
7068
|
+
let left = 0;
|
|
7069
|
+
let top = 0;
|
|
7070
|
+
if (verticalPos === 'top') {
|
|
7071
|
+
top = activatorRect.top - tooltipRect.height - offset;
|
|
7072
|
+
} else {
|
|
7073
|
+
top = activatorRect.bottom + offset;
|
|
7074
|
+
}
|
|
7075
|
+
switch (horizontalAlign) {
|
|
7076
|
+
case 'left':
|
|
7077
|
+
left = activatorRect.left + activatorRect.width / 2 - ARROW_OFFSET;
|
|
7078
|
+
break;
|
|
7079
|
+
case 'right':
|
|
7080
|
+
left = activatorRect.left + activatorRect.width / 2 - (tooltipRect.width - ARROW_OFFSET);
|
|
7081
|
+
break;
|
|
7082
|
+
case 'center':
|
|
7083
|
+
default:
|
|
7084
|
+
left = activatorRect.left + activatorRect.width / 2 - tooltipRect.width / 2;
|
|
7085
|
+
break;
|
|
7086
|
+
}
|
|
7087
|
+
if (left < offset) left = offset;
|
|
7088
|
+
if (left + tooltipRect.width > window.innerWidth - offset) {
|
|
7089
|
+
left = window.innerWidth - tooltipRect.width - offset;
|
|
7090
|
+
}
|
|
7091
|
+
return {
|
|
7092
|
+
left,
|
|
7093
|
+
top
|
|
7094
|
+
};
|
|
7095
|
+
};
|
|
7096
|
+
const moveToBody = element => {
|
|
7097
|
+
if (element.parentNode !== document.body) {
|
|
7098
|
+
document.body.appendChild(element);
|
|
7099
|
+
}
|
|
7100
|
+
};
|
|
7101
|
+
const moveToContainer = (element, container) => {
|
|
7102
|
+
if (element.parentNode === document.body) {
|
|
7103
|
+
container.appendChild(element);
|
|
7104
|
+
}
|
|
7105
|
+
};
|
|
7106
|
+
const show = () => {
|
|
7107
|
+
if (props.disabled || isControlled.value) return;
|
|
7108
|
+
isVisible.value = true;
|
|
7109
|
+
emit('show');
|
|
7110
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
7111
|
+
if (tooltipRef.value && activatorRef.value) {
|
|
7112
|
+
moveToBody(tooltipRef.value);
|
|
7113
|
+
updatePosition();
|
|
7114
|
+
addScrollListener();
|
|
7115
|
+
}
|
|
7116
|
+
});
|
|
7117
|
+
};
|
|
7118
|
+
const hide = () => {
|
|
7119
|
+
if (props.disabled || isControlled.value) return;
|
|
7120
|
+
isVisible.value = false;
|
|
7121
|
+
emit('hide');
|
|
7122
|
+
removeScrollListener();
|
|
7123
|
+
};
|
|
7124
|
+
const close = () => {
|
|
7125
|
+
if (isControlled.value) {
|
|
7126
|
+
emit('update:modelValue', false);
|
|
7127
|
+
} else {
|
|
7128
|
+
hide();
|
|
7129
|
+
}
|
|
7130
|
+
};
|
|
7131
|
+
const updatePosition = () => {
|
|
7132
|
+
if (!activatorRef.value || !tooltipRef.value) return;
|
|
7133
|
+
const activatorRect = activatorRef.value.getBoundingClientRect();
|
|
7134
|
+
const tooltipRect = tooltipRef.value.getBoundingClientRect();
|
|
7135
|
+
const isActivatorVisible = activatorRect.top < window.innerHeight && activatorRect.bottom > 0 && activatorRect.left < window.innerWidth && activatorRect.right > 0;
|
|
7136
|
+
if (!isActivatorVisible && isVisible.value && !isControlled.value) {
|
|
7137
|
+
hide();
|
|
7138
|
+
return;
|
|
7139
|
+
}
|
|
7140
|
+
const position = calculateTooltipPosition(activatorRect, tooltipRect, props.placement, props.offset);
|
|
7141
|
+
tooltipRef.value.style.left = `${position.left}px`;
|
|
7142
|
+
tooltipRef.value.style.top = `${position.top}px`;
|
|
7143
|
+
updateArrowPosition(activatorRect, position);
|
|
7144
|
+
};
|
|
7145
|
+
const updateArrowPosition = (activatorRect, tooltipPosition) => {
|
|
7146
|
+
if (!tooltipRef.value) return;
|
|
7147
|
+
const arrow = tooltipRef.value.querySelector('.tooltip-arrow');
|
|
7148
|
+
if (!arrow) return;
|
|
7149
|
+
const activatorCenterX = activatorRect.left + activatorRect.width / 2;
|
|
7150
|
+
const arrowX = activatorCenterX - tooltipPosition.left;
|
|
7151
|
+
const tooltipWidth = tooltipRef.value.offsetWidth;
|
|
7152
|
+
const minArrowX = 12;
|
|
7153
|
+
const maxArrowX = tooltipWidth - 12;
|
|
7154
|
+
const clampedArrowX = Math.max(minArrowX, Math.min(maxArrowX, arrowX));
|
|
7155
|
+
arrow.style.left = `${clampedArrowX}px`;
|
|
7156
|
+
arrow.style.transform = 'translateX(-50%)';
|
|
7157
|
+
};
|
|
7158
|
+
const getScrollableElements = () => {
|
|
7159
|
+
if (!scrollableElementsRef.value) {
|
|
7160
|
+
const nodeList = document.querySelectorAll('.farm-modal, .modal-content, [style*="overflow-y: auto"], [style*="overflow-y: scroll"]');
|
|
7161
|
+
scrollableElementsRef.value = Array.from(nodeList);
|
|
7162
|
+
}
|
|
7163
|
+
return scrollableElementsRef.value;
|
|
7164
|
+
};
|
|
7165
|
+
const addScrollListener = () => {
|
|
7166
|
+
window.addEventListener('scroll', updatePosition, {
|
|
7167
|
+
passive: true
|
|
7168
|
+
});
|
|
7169
|
+
const scrollableElements = getScrollableElements();
|
|
7170
|
+
scrollableElements.forEach(element => {
|
|
7171
|
+
element.addEventListener('scroll', updatePosition, {
|
|
7172
|
+
passive: true
|
|
7173
|
+
});
|
|
7174
|
+
});
|
|
7175
|
+
};
|
|
7176
|
+
const removeScrollListener = () => {
|
|
7177
|
+
window.removeEventListener('scroll', updatePosition);
|
|
7178
|
+
const scrollableElements = getScrollableElements();
|
|
7179
|
+
scrollableElements.forEach(element => {
|
|
7180
|
+
element.removeEventListener('scroll', updatePosition);
|
|
7181
|
+
});
|
|
7182
|
+
};
|
|
7183
|
+
if (isControlled.value) {
|
|
7184
|
+
isVisible.value = props.modelValue || false;
|
|
7185
|
+
}
|
|
7186
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, newValue => {
|
|
7187
|
+
if (isControlled.value) {
|
|
7188
|
+
isVisible.value = newValue || false;
|
|
7189
|
+
if (isVisible.value) {
|
|
7190
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
7191
|
+
if (tooltipRef.value) {
|
|
7192
|
+
moveToBody(tooltipRef.value);
|
|
7193
|
+
updatePosition();
|
|
7194
|
+
addScrollListener();
|
|
7195
|
+
}
|
|
7196
|
+
});
|
|
7197
|
+
} else {
|
|
7198
|
+
removeScrollListener();
|
|
7199
|
+
}
|
|
7200
|
+
}
|
|
7201
|
+
});
|
|
7202
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
|
|
7203
|
+
if (tooltipRef.value && containerRef.value) {
|
|
7204
|
+
moveToContainer(tooltipRef.value, containerRef.value);
|
|
7205
|
+
}
|
|
7206
|
+
removeScrollListener();
|
|
7207
|
+
});
|
|
7208
|
+
return (_ctx, _cache) => {
|
|
7209
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", {
|
|
7210
|
+
class: "tooltip-container",
|
|
7211
|
+
ref_key: "containerRef",
|
|
7212
|
+
ref: containerRef
|
|
7213
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
7214
|
+
ref_key: "activatorRef",
|
|
7215
|
+
ref: activatorRef,
|
|
7216
|
+
class: "tooltip-activator",
|
|
7217
|
+
onMouseover: show,
|
|
7218
|
+
onMouseout: hide,
|
|
7219
|
+
onMouseleave: hide
|
|
7220
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderSlot)(_ctx.$slots, "activator")], 544), isVisible.value ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", {
|
|
7221
|
+
key: 0,
|
|
7222
|
+
ref_key: "tooltipRef",
|
|
7223
|
+
ref: tooltipRef,
|
|
7224
|
+
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeClass)(tooltipClasses.value),
|
|
7225
|
+
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)(tooltipStyles.value)
|
|
7226
|
+
}, [hasTitle.value || showCloseButton.value ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", Tooltipvue_type_script_setup_true_lang_ts_hoisted_1, [hasTitle.value ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", Tooltipvue_type_script_setup_true_lang_ts_hoisted_2, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderSlot)(_ctx.$slots, "title")])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)("", true), showCloseButton.value ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("span", {
|
|
7227
|
+
key: 1,
|
|
7228
|
+
class: "tooltip-close",
|
|
7229
|
+
onClick: close
|
|
7230
|
+
}, "×")) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)("", true)])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)("", true), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", Tooltipvue_type_script_setup_true_lang_ts_hoisted_3, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderSlot)(_ctx.$slots, "default")]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
7231
|
+
class: "tooltip-arrow",
|
|
7232
|
+
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)(arrowStyles.value)
|
|
7233
|
+
}, null, 4)], 6)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)("", true)], 512);
|
|
7234
|
+
};
|
|
7235
|
+
}
|
|
7236
|
+
}));
|
|
7237
|
+
;// CONCATENATED MODULE: ./src/components/Tooltip/Tooltip.vue?vue&type=script&setup=true&lang=ts
|
|
7238
|
+
|
|
7239
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-69.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-69.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-69.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-69.use[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[1]!./src/components/Tooltip/Tooltip.vue?vue&type=style&index=0&id=46d8db88&lang=scss&scoped=true
|
|
7240
|
+
// extracted by mini-css-extract-plugin
|
|
7241
|
+
|
|
7242
|
+
;// CONCATENATED MODULE: ./src/components/Tooltip/Tooltip.vue?vue&type=style&index=0&id=46d8db88&lang=scss&scoped=true
|
|
7243
|
+
|
|
7244
|
+
;// CONCATENATED MODULE: ./src/components/Tooltip/Tooltip.vue
|
|
7245
|
+
|
|
7246
|
+
|
|
7247
|
+
|
|
7248
|
+
;
|
|
7249
|
+
|
|
7250
|
+
|
|
7251
|
+
const Tooltip_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(Tooltipvue_type_script_setup_true_lang_ts, [['__scopeId',"data-v-46d8db88"]])
|
|
7252
|
+
|
|
7253
|
+
/* harmony default export */ var Tooltip = (Tooltip_exports_);
|
|
7254
|
+
;// CONCATENATED MODULE: ./src/components/Tooltip/index.ts
|
|
7255
|
+
|
|
7256
|
+
|
|
7257
|
+
/* harmony default export */ var components_Tooltip = (Tooltip);
|
|
6911
7258
|
;// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??clonedRuleSet-89.use[0]!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-89.use[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[1]!./src/components/AlertBox/AlertBox.vue?vue&type=script&lang=ts&setup=true
|
|
6912
7259
|
|
|
6913
7260
|
|
|
@@ -12853,438 +13200,85 @@ function InputDecimalFormattervue_type_template_id_98371fda_scoped_true_ts_true_
|
|
|
12853
13200
|
innerValue.value = props.modelValue;
|
|
12854
13201
|
validate(innerValue.value);
|
|
12855
13202
|
});
|
|
12856
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => innerValue.value, () => {
|
|
12857
|
-
emit('update:modelValue', innerValue.value);
|
|
12858
|
-
validate(innerValue.value);
|
|
12859
|
-
});
|
|
12860
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.rules, (newVal, oldVal) => {
|
|
12861
|
-
if (composition_deepEqual(newVal, oldVal)) return;
|
|
12862
|
-
fieldValidator = validateFormFieldBuilder(rules.value);
|
|
12863
|
-
validate = validateFormMethodBuilder(errorBucket, valid, fieldValidator);
|
|
12864
|
-
validate(innerValue.value);
|
|
12865
|
-
});
|
|
12866
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeMount)(() => {
|
|
12867
|
-
validate(innerValue.value);
|
|
12868
|
-
});
|
|
12869
|
-
let validate = validateFormMethodBuilder(errorBucket, valid, fieldValidator);
|
|
12870
|
-
const onKeyUp = event => {
|
|
12871
|
-
isTouched.value = true;
|
|
12872
|
-
emit('keyup', event);
|
|
12873
|
-
setTimeout(() => {
|
|
12874
|
-
emit('change', innerValue.value);
|
|
12875
|
-
}, 100);
|
|
12876
|
-
};
|
|
12877
|
-
const onBlur = event => {
|
|
12878
|
-
isBlured.value = true;
|
|
12879
|
-
emit('blur', event);
|
|
12880
|
-
};
|
|
12881
|
-
const onFocus = focus => {
|
|
12882
|
-
isFocus.value = focus;
|
|
12883
|
-
};
|
|
12884
|
-
const reset = () => {
|
|
12885
|
-
innerValue.value = '';
|
|
12886
|
-
isTouched.value = true;
|
|
12887
|
-
emit('update:modelValue', innerValue.value);
|
|
12888
|
-
};
|
|
12889
|
-
const makePristine = () => {
|
|
12890
|
-
isTouched.value = false;
|
|
12891
|
-
isBlured.value = false;
|
|
12892
|
-
};
|
|
12893
|
-
return {
|
|
12894
|
-
innerValue,
|
|
12895
|
-
errorBucket,
|
|
12896
|
-
valid,
|
|
12897
|
-
validatable,
|
|
12898
|
-
hasError,
|
|
12899
|
-
customId,
|
|
12900
|
-
isTouched,
|
|
12901
|
-
isBlured,
|
|
12902
|
-
isFocus,
|
|
12903
|
-
showErrorText,
|
|
12904
|
-
validate,
|
|
12905
|
-
onKeyUp,
|
|
12906
|
-
onBlur,
|
|
12907
|
-
onFocus,
|
|
12908
|
-
reset,
|
|
12909
|
-
makePristine
|
|
12910
|
-
};
|
|
12911
|
-
}
|
|
12912
|
-
});
|
|
12913
|
-
;// CONCATENATED MODULE: ./src/components/InputDecimalFormatter/InputDecimalFormatter.vue?vue&type=script&lang=ts
|
|
12914
|
-
|
|
12915
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-69.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-69.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-69.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-69.use[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[1]!./src/components/InputDecimalFormatter/InputDecimalFormatter.vue?vue&type=style&index=0&id=98371fda&lang=scss&scoped=true
|
|
12916
|
-
// extracted by mini-css-extract-plugin
|
|
12917
|
-
|
|
12918
|
-
;// CONCATENATED MODULE: ./src/components/InputDecimalFormatter/InputDecimalFormatter.vue?vue&type=style&index=0&id=98371fda&lang=scss&scoped=true
|
|
12919
|
-
|
|
12920
|
-
;// CONCATENATED MODULE: ./src/components/InputDecimalFormatter/InputDecimalFormatter.vue
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
|
|
12925
|
-
;
|
|
12926
|
-
|
|
12927
|
-
|
|
12928
|
-
const InputDecimalFormatter_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(InputDecimalFormattervue_type_script_lang_ts, [['render',InputDecimalFormattervue_type_template_id_98371fda_scoped_true_ts_true_render],['__scopeId',"data-v-98371fda"]])
|
|
12929
|
-
|
|
12930
|
-
/* harmony default export */ var InputDecimalFormatter_InputDecimalFormatter = (InputDecimalFormatter_exports_);
|
|
12931
|
-
;// CONCATENATED MODULE: ./src/components/InputDecimalFormatter/index.ts
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
/* harmony default export */ var components_InputDecimalFormatter = ((/* unused pure expression or super */ null && (InputDecimalFormatter)));
|
|
12935
|
-
;// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??clonedRuleSet-89.use[0]!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-89.use[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[1]!./src/components/Tooltip/Tooltip.vue?vue&type=script&setup=true&lang=ts
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
const Tooltipvue_type_script_setup_true_lang_ts_withScopeId = n => (_pushScopeId("data-v-0953d2f7"), n = n(), _popScopeId(), n);
|
|
12941
|
-
const Tooltipvue_type_script_setup_true_lang_ts_hoisted_1 = {
|
|
12942
|
-
key: 0,
|
|
12943
|
-
class: "tooltip-header"
|
|
12944
|
-
};
|
|
12945
|
-
const Tooltipvue_type_script_setup_true_lang_ts_hoisted_2 = {
|
|
12946
|
-
key: 0,
|
|
12947
|
-
class: "tooltip-title"
|
|
12948
|
-
};
|
|
12949
|
-
const Tooltipvue_type_script_setup_true_lang_ts_hoisted_3 = {
|
|
12950
|
-
class: "tooltip-content"
|
|
12951
|
-
};
|
|
12952
|
-
|
|
12953
|
-
const ARROW_OFFSET = 18;
|
|
12954
|
-
const Z_INDEX_OFFSET = 1000;
|
|
12955
|
-
const DEFAULT_Z_INDEX = 10001;
|
|
12956
|
-
/* harmony default export */ var Tooltipvue_type_script_setup_true_lang_ts = (/*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
|
|
12957
|
-
__name: 'Tooltip',
|
|
12958
|
-
props: {
|
|
12959
|
-
modelValue: {
|
|
12960
|
-
type: Boolean,
|
|
12961
|
-
default: undefined
|
|
12962
|
-
},
|
|
12963
|
-
trigger: {
|
|
12964
|
-
default: 'hover'
|
|
12965
|
-
},
|
|
12966
|
-
placement: {
|
|
12967
|
-
default: 'top-center'
|
|
12968
|
-
},
|
|
12969
|
-
offset: {
|
|
12970
|
-
default: 8
|
|
12971
|
-
},
|
|
12972
|
-
variant: {
|
|
12973
|
-
default: 'dark'
|
|
12974
|
-
},
|
|
12975
|
-
size: {
|
|
12976
|
-
default: 'md'
|
|
12977
|
-
},
|
|
12978
|
-
maxWidth: {
|
|
12979
|
-
default: undefined
|
|
12980
|
-
},
|
|
12981
|
-
delay: {
|
|
12982
|
-
default: () => [100, 50]
|
|
12983
|
-
},
|
|
12984
|
-
disabled: {
|
|
12985
|
-
type: Boolean,
|
|
12986
|
-
default: false
|
|
12987
|
-
},
|
|
12988
|
-
fluid: {
|
|
12989
|
-
type: Boolean,
|
|
12990
|
-
default: false
|
|
12991
|
-
},
|
|
12992
|
-
position: {
|
|
12993
|
-
default: undefined
|
|
12994
|
-
}
|
|
12995
|
-
},
|
|
12996
|
-
emits: ["update:modelValue", "show", "hide"],
|
|
12997
|
-
setup(__props, {
|
|
12998
|
-
emit: __emit
|
|
12999
|
-
}) {
|
|
13000
|
-
const props = __props;
|
|
13001
|
-
const emit = __emit;
|
|
13002
|
-
const slots = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.useSlots)();
|
|
13003
|
-
const containerRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(null);
|
|
13004
|
-
const activatorRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(null);
|
|
13005
|
-
const tooltipRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(null);
|
|
13006
|
-
const scrollableElementsRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(null);
|
|
13007
|
-
let modalCache = null;
|
|
13008
|
-
const isVisible = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(false);
|
|
13009
|
-
const isControlled = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => props.modelValue !== undefined);
|
|
13010
|
-
const hasTitle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => !!slots.title);
|
|
13011
|
-
const showCloseButton = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => isControlled.value && hasTitle.value);
|
|
13012
|
-
const normalizedPlacement = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
13013
|
-
if (props.position) {
|
|
13014
|
-
return props.position;
|
|
13015
|
-
}
|
|
13016
|
-
return props.placement;
|
|
13017
|
-
});
|
|
13018
|
-
const normalizedMaxWidth = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
13019
|
-
if (props.fluid) {
|
|
13020
|
-
return '300px';
|
|
13021
|
-
}
|
|
13022
|
-
return props.maxWidth;
|
|
13023
|
-
});
|
|
13024
|
-
const tooltipClasses = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => ({
|
|
13025
|
-
'tooltip-popup': true,
|
|
13026
|
-
'tooltip-popup--visible': isVisible.value,
|
|
13027
|
-
[`tooltip-popup--${props.variant}`]: true,
|
|
13028
|
-
[`tooltip-popup--${props.size}`]: true,
|
|
13029
|
-
'tooltip-popup--has-title': hasTitle.value,
|
|
13030
|
-
[`tooltip-popup--${normalizedPlacement.value}`]: true
|
|
13031
|
-
}));
|
|
13032
|
-
const tooltipStyles = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
13033
|
-
const styles = {
|
|
13034
|
-
position: 'fixed',
|
|
13035
|
-
zIndex: String(getTooltipZIndex())
|
|
13036
|
-
};
|
|
13037
|
-
if (normalizedMaxWidth.value) {
|
|
13038
|
-
styles.maxWidth = typeof normalizedMaxWidth.value === 'number' ? `${normalizedMaxWidth.value}px` : normalizedMaxWidth.value;
|
|
13039
|
-
styles.width = 'auto';
|
|
13040
|
-
}
|
|
13041
|
-
return styles;
|
|
13042
|
-
});
|
|
13043
|
-
const arrowStyles = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
13044
|
-
const [verticalPos] = normalizedPlacement.value.split('-');
|
|
13045
|
-
const arrowColor = props.variant === 'light' ? '#ffffff' : '#333333';
|
|
13046
|
-
const styles = {
|
|
13047
|
-
position: 'absolute',
|
|
13048
|
-
width: '0',
|
|
13049
|
-
height: '0',
|
|
13050
|
-
borderStyle: 'solid',
|
|
13051
|
-
zIndex: 'inherit'
|
|
13052
|
-
};
|
|
13053
|
-
if (verticalPos === 'top') {
|
|
13054
|
-
styles.bottom = '-6px';
|
|
13055
|
-
styles.borderWidth = '6px 6px 0 6px';
|
|
13056
|
-
styles.borderColor = `${arrowColor} transparent transparent transparent`;
|
|
13057
|
-
} else {
|
|
13058
|
-
styles.top = '-6px';
|
|
13059
|
-
styles.borderWidth = '0 6px 6px 6px';
|
|
13060
|
-
styles.borderColor = `transparent transparent ${arrowColor} transparent`;
|
|
13061
|
-
}
|
|
13062
|
-
styles.left = '50%';
|
|
13063
|
-
styles.transform = 'translateX(-50%)';
|
|
13064
|
-
return styles;
|
|
13065
|
-
});
|
|
13066
|
-
const getTooltipZIndex = () => {
|
|
13067
|
-
const now = Date.now();
|
|
13068
|
-
let modals;
|
|
13069
|
-
if (modalCache && now - modalCache.timestamp < 500) {
|
|
13070
|
-
modals = modalCache.modals;
|
|
13071
|
-
} else {
|
|
13072
|
-
modals = Array.from(document.querySelectorAll('.farm-modal'));
|
|
13073
|
-
modalCache = {
|
|
13074
|
-
modals,
|
|
13075
|
-
timestamp: now
|
|
13076
|
-
};
|
|
13077
|
-
}
|
|
13078
|
-
let maxModalZIndex = 0;
|
|
13079
|
-
modals.forEach(modal => {
|
|
13080
|
-
const htmlModal = modal;
|
|
13081
|
-
let zIndex = parseInt(htmlModal.style.zIndex, 10);
|
|
13082
|
-
if (Number.isNaN(zIndex)) {
|
|
13083
|
-
const computedZIndex = window.getComputedStyle(htmlModal).zIndex;
|
|
13084
|
-
if (computedZIndex === 'auto') {
|
|
13085
|
-
zIndex = 0;
|
|
13086
|
-
} else {
|
|
13087
|
-
zIndex = parseInt(computedZIndex, 10) || 0;
|
|
13088
|
-
}
|
|
13089
|
-
}
|
|
13090
|
-
if (zIndex > maxModalZIndex) {
|
|
13091
|
-
maxModalZIndex = zIndex;
|
|
13092
|
-
}
|
|
13093
|
-
});
|
|
13094
|
-
return maxModalZIndex > 0 ? maxModalZIndex + Z_INDEX_OFFSET : DEFAULT_Z_INDEX;
|
|
13095
|
-
};
|
|
13096
|
-
const calculateTooltipPosition = (activatorRect, tooltipRect, placement, offset = 8) => {
|
|
13097
|
-
const [verticalPos, horizontalAlign] = placement.split('-');
|
|
13098
|
-
let left = 0;
|
|
13099
|
-
let top = 0;
|
|
13100
|
-
if (verticalPos === 'top') {
|
|
13101
|
-
top = activatorRect.top - tooltipRect.height - offset;
|
|
13102
|
-
} else {
|
|
13103
|
-
top = activatorRect.bottom + offset;
|
|
13104
|
-
}
|
|
13105
|
-
switch (horizontalAlign) {
|
|
13106
|
-
case 'left':
|
|
13107
|
-
left = activatorRect.left + activatorRect.width / 2 - ARROW_OFFSET;
|
|
13108
|
-
break;
|
|
13109
|
-
case 'right':
|
|
13110
|
-
left = activatorRect.left + activatorRect.width / 2 - (tooltipRect.width - ARROW_OFFSET);
|
|
13111
|
-
break;
|
|
13112
|
-
case 'center':
|
|
13113
|
-
default:
|
|
13114
|
-
left = activatorRect.left + activatorRect.width / 2 - tooltipRect.width / 2;
|
|
13115
|
-
break;
|
|
13116
|
-
}
|
|
13117
|
-
if (left < offset) left = offset;
|
|
13118
|
-
if (left + tooltipRect.width > window.innerWidth - offset) {
|
|
13119
|
-
left = window.innerWidth - tooltipRect.width - offset;
|
|
13120
|
-
}
|
|
13121
|
-
return {
|
|
13122
|
-
left,
|
|
13123
|
-
top
|
|
13124
|
-
};
|
|
13125
|
-
};
|
|
13126
|
-
const moveToBody = element => {
|
|
13127
|
-
if (element.parentNode !== document.body) {
|
|
13128
|
-
document.body.appendChild(element);
|
|
13129
|
-
}
|
|
13130
|
-
};
|
|
13131
|
-
const moveToContainer = (element, container) => {
|
|
13132
|
-
if (element.parentNode === document.body) {
|
|
13133
|
-
container.appendChild(element);
|
|
13134
|
-
}
|
|
13135
|
-
};
|
|
13136
|
-
const show = () => {
|
|
13137
|
-
if (props.disabled || isControlled.value) return;
|
|
13138
|
-
isVisible.value = true;
|
|
13139
|
-
emit('show');
|
|
13140
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
13141
|
-
if (tooltipRef.value && activatorRef.value) {
|
|
13142
|
-
moveToBody(tooltipRef.value);
|
|
13143
|
-
updatePosition();
|
|
13144
|
-
addScrollListener();
|
|
13145
|
-
}
|
|
13146
|
-
});
|
|
13147
|
-
};
|
|
13148
|
-
const hide = () => {
|
|
13149
|
-
if (props.disabled || isControlled.value) return;
|
|
13150
|
-
isVisible.value = false;
|
|
13151
|
-
emit('hide');
|
|
13152
|
-
removeScrollListener();
|
|
13153
|
-
};
|
|
13154
|
-
const close = () => {
|
|
13155
|
-
if (isControlled.value) {
|
|
13156
|
-
emit('update:modelValue', false);
|
|
13157
|
-
} else {
|
|
13158
|
-
hide();
|
|
13159
|
-
}
|
|
13160
|
-
};
|
|
13161
|
-
const updatePosition = () => {
|
|
13162
|
-
if (!activatorRef.value || !tooltipRef.value) return;
|
|
13163
|
-
const activatorRect = activatorRef.value.getBoundingClientRect();
|
|
13164
|
-
const tooltipRect = tooltipRef.value.getBoundingClientRect();
|
|
13165
|
-
const isActivatorVisible = activatorRect.top < window.innerHeight && activatorRect.bottom > 0 && activatorRect.left < window.innerWidth && activatorRect.right > 0;
|
|
13166
|
-
if (!isActivatorVisible && isVisible.value && !isControlled.value) {
|
|
13167
|
-
hide();
|
|
13168
|
-
return;
|
|
13169
|
-
}
|
|
13170
|
-
const position = calculateTooltipPosition(activatorRect, tooltipRect, normalizedPlacement.value, props.offset);
|
|
13171
|
-
tooltipRef.value.style.left = `${position.left}px`;
|
|
13172
|
-
tooltipRef.value.style.top = `${position.top}px`;
|
|
13173
|
-
updateArrowPosition(activatorRect, position);
|
|
13203
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => innerValue.value, () => {
|
|
13204
|
+
emit('update:modelValue', innerValue.value);
|
|
13205
|
+
validate(innerValue.value);
|
|
13206
|
+
});
|
|
13207
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.rules, (newVal, oldVal) => {
|
|
13208
|
+
if (composition_deepEqual(newVal, oldVal)) return;
|
|
13209
|
+
fieldValidator = validateFormFieldBuilder(rules.value);
|
|
13210
|
+
validate = validateFormMethodBuilder(errorBucket, valid, fieldValidator);
|
|
13211
|
+
validate(innerValue.value);
|
|
13212
|
+
});
|
|
13213
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeMount)(() => {
|
|
13214
|
+
validate(innerValue.value);
|
|
13215
|
+
});
|
|
13216
|
+
let validate = validateFormMethodBuilder(errorBucket, valid, fieldValidator);
|
|
13217
|
+
const onKeyUp = event => {
|
|
13218
|
+
isTouched.value = true;
|
|
13219
|
+
emit('keyup', event);
|
|
13220
|
+
setTimeout(() => {
|
|
13221
|
+
emit('change', innerValue.value);
|
|
13222
|
+
}, 100);
|
|
13174
13223
|
};
|
|
13175
|
-
const
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
if (!arrow) return;
|
|
13179
|
-
const activatorCenterX = activatorRect.left + activatorRect.width / 2;
|
|
13180
|
-
const arrowX = activatorCenterX - tooltipPosition.left;
|
|
13181
|
-
const tooltipWidth = tooltipRef.value.offsetWidth;
|
|
13182
|
-
const minArrowX = 12;
|
|
13183
|
-
const maxArrowX = tooltipWidth - 12;
|
|
13184
|
-
const clampedArrowX = Math.max(minArrowX, Math.min(maxArrowX, arrowX));
|
|
13185
|
-
arrow.style.left = `${clampedArrowX}px`;
|
|
13186
|
-
arrow.style.transform = 'translateX(-50%)';
|
|
13224
|
+
const onBlur = event => {
|
|
13225
|
+
isBlured.value = true;
|
|
13226
|
+
emit('blur', event);
|
|
13187
13227
|
};
|
|
13188
|
-
const
|
|
13189
|
-
|
|
13190
|
-
const nodeList = document.querySelectorAll('.farm-modal, .modal-content, [style*="overflow-y: auto"], [style*="overflow-y: scroll"]');
|
|
13191
|
-
scrollableElementsRef.value = Array.from(nodeList);
|
|
13192
|
-
}
|
|
13193
|
-
return scrollableElementsRef.value;
|
|
13228
|
+
const onFocus = focus => {
|
|
13229
|
+
isFocus.value = focus;
|
|
13194
13230
|
};
|
|
13195
|
-
const
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
const scrollableElements = getScrollableElements();
|
|
13200
|
-
scrollableElements.forEach(element => {
|
|
13201
|
-
element.addEventListener('scroll', updatePosition, {
|
|
13202
|
-
passive: true
|
|
13203
|
-
});
|
|
13204
|
-
});
|
|
13231
|
+
const reset = () => {
|
|
13232
|
+
innerValue.value = '';
|
|
13233
|
+
isTouched.value = true;
|
|
13234
|
+
emit('update:modelValue', innerValue.value);
|
|
13205
13235
|
};
|
|
13206
|
-
const
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
scrollableElements.forEach(element => {
|
|
13210
|
-
element.removeEventListener('scroll', updatePosition);
|
|
13211
|
-
});
|
|
13236
|
+
const makePristine = () => {
|
|
13237
|
+
isTouched.value = false;
|
|
13238
|
+
isBlured.value = false;
|
|
13212
13239
|
};
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
}
|
|
13231
|
-
});
|
|
13232
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
|
|
13233
|
-
if (tooltipRef.value && containerRef.value) {
|
|
13234
|
-
moveToContainer(tooltipRef.value, containerRef.value);
|
|
13235
|
-
}
|
|
13236
|
-
removeScrollListener();
|
|
13237
|
-
});
|
|
13238
|
-
return (_ctx, _cache) => {
|
|
13239
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", {
|
|
13240
|
-
class: "tooltip-container",
|
|
13241
|
-
ref_key: "containerRef",
|
|
13242
|
-
ref: containerRef
|
|
13243
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
13244
|
-
ref_key: "activatorRef",
|
|
13245
|
-
ref: activatorRef,
|
|
13246
|
-
class: "tooltip-activator",
|
|
13247
|
-
onMouseover: show,
|
|
13248
|
-
onMouseout: hide,
|
|
13249
|
-
onMouseleave: hide
|
|
13250
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderSlot)(_ctx.$slots, "activator")], 544), isVisible.value ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", {
|
|
13251
|
-
key: 0,
|
|
13252
|
-
ref_key: "tooltipRef",
|
|
13253
|
-
ref: tooltipRef,
|
|
13254
|
-
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeClass)(tooltipClasses.value),
|
|
13255
|
-
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)(tooltipStyles.value)
|
|
13256
|
-
}, [hasTitle.value || showCloseButton.value ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", Tooltipvue_type_script_setup_true_lang_ts_hoisted_1, [hasTitle.value ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", Tooltipvue_type_script_setup_true_lang_ts_hoisted_2, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderSlot)(_ctx.$slots, "title")])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)("", true), showCloseButton.value ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("span", {
|
|
13257
|
-
key: 1,
|
|
13258
|
-
class: "tooltip-close",
|
|
13259
|
-
onClick: close
|
|
13260
|
-
}, "×")) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)("", true)])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)("", true), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", Tooltipvue_type_script_setup_true_lang_ts_hoisted_3, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderSlot)(_ctx.$slots, "default")]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
13261
|
-
class: "tooltip-arrow",
|
|
13262
|
-
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)(arrowStyles.value)
|
|
13263
|
-
}, null, 4)], 6)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)("", true)], 512);
|
|
13240
|
+
return {
|
|
13241
|
+
innerValue,
|
|
13242
|
+
errorBucket,
|
|
13243
|
+
valid,
|
|
13244
|
+
validatable,
|
|
13245
|
+
hasError,
|
|
13246
|
+
customId,
|
|
13247
|
+
isTouched,
|
|
13248
|
+
isBlured,
|
|
13249
|
+
isFocus,
|
|
13250
|
+
showErrorText,
|
|
13251
|
+
validate,
|
|
13252
|
+
onKeyUp,
|
|
13253
|
+
onBlur,
|
|
13254
|
+
onFocus,
|
|
13255
|
+
reset,
|
|
13256
|
+
makePristine
|
|
13264
13257
|
};
|
|
13265
13258
|
}
|
|
13266
|
-
})
|
|
13267
|
-
;// CONCATENATED MODULE: ./src/components/
|
|
13259
|
+
});
|
|
13260
|
+
;// CONCATENATED MODULE: ./src/components/InputDecimalFormatter/InputDecimalFormatter.vue?vue&type=script&lang=ts
|
|
13268
13261
|
|
|
13269
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-69.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-69.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-69.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-69.use[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[1]!./src/components/
|
|
13262
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-69.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-69.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-69.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-69.use[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[1]!./src/components/InputDecimalFormatter/InputDecimalFormatter.vue?vue&type=style&index=0&id=98371fda&lang=scss&scoped=true
|
|
13270
13263
|
// extracted by mini-css-extract-plugin
|
|
13271
13264
|
|
|
13272
|
-
;// CONCATENATED MODULE: ./src/components/
|
|
13265
|
+
;// CONCATENATED MODULE: ./src/components/InputDecimalFormatter/InputDecimalFormatter.vue?vue&type=style&index=0&id=98371fda&lang=scss&scoped=true
|
|
13266
|
+
|
|
13267
|
+
;// CONCATENATED MODULE: ./src/components/InputDecimalFormatter/InputDecimalFormatter.vue
|
|
13273
13268
|
|
|
13274
|
-
;// CONCATENATED MODULE: ./src/components/Tooltip/Tooltip.vue
|
|
13275
13269
|
|
|
13276
13270
|
|
|
13277
13271
|
|
|
13278
13272
|
;
|
|
13279
13273
|
|
|
13280
13274
|
|
|
13281
|
-
const
|
|
13275
|
+
const InputDecimalFormatter_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(InputDecimalFormattervue_type_script_lang_ts, [['render',InputDecimalFormattervue_type_template_id_98371fda_scoped_true_ts_true_render],['__scopeId',"data-v-98371fda"]])
|
|
13282
13276
|
|
|
13283
|
-
/* harmony default export */ var
|
|
13284
|
-
;// CONCATENATED MODULE: ./src/components/
|
|
13277
|
+
/* harmony default export */ var InputDecimalFormatter_InputDecimalFormatter = (InputDecimalFormatter_exports_);
|
|
13278
|
+
;// CONCATENATED MODULE: ./src/components/InputDecimalFormatter/index.ts
|
|
13285
13279
|
|
|
13286
13280
|
|
|
13287
|
-
/* harmony default export */ var
|
|
13281
|
+
/* harmony default export */ var components_InputDecimalFormatter = ((/* unused pure expression or super */ null && (InputDecimalFormatter)));
|
|
13288
13282
|
;// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??clonedRuleSet-89.use[0]!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-89.use[3]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[5]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[1]!./src/components/Typography/Typography.vue?vue&type=template&id=bb5a0afc&scoped=true&ts=true
|
|
13289
13283
|
|
|
13290
13284
|
function Typographyvue_type_template_id_bb5a0afc_scoped_true_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -14550,6 +14544,7 @@ const Line_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(Linevue_type_
|
|
|
14550
14544
|
|
|
14551
14545
|
|
|
14552
14546
|
|
|
14547
|
+
|
|
14553
14548
|
|
|
14554
14549
|
|
|
14555
14550
|
;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js
|