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