@weitutech/by-components 1.1.213 → 1.1.215
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/lib/by-components.common.js +143 -52
- package/lib/by-components.css +1 -1
- package/lib/by-components.umd.js +118 -27
- package/lib/by-components.umd.min.js +10 -10
- package/lib/index.css +1 -1
- package/package.json +1 -1
|
@@ -26680,7 +26680,7 @@ module.exports = function (key) {
|
|
|
26680
26680
|
|
|
26681
26681
|
var aSet = __webpack_require__(7080);
|
|
26682
26682
|
var SetHelpers = __webpack_require__(4402);
|
|
26683
|
-
var clone = __webpack_require__(
|
|
26683
|
+
var clone = __webpack_require__(9286);
|
|
26684
26684
|
var size = __webpack_require__(5170);
|
|
26685
26685
|
var getSetRecord = __webpack_require__(3789);
|
|
26686
26686
|
var iterateSet = __webpack_require__(8469);
|
|
@@ -27201,7 +27201,7 @@ $({ target: 'Iterator', proto: true, real: true, forced: someWithoutClosingOnEar
|
|
|
27201
27201
|
|
|
27202
27202
|
var aSet = __webpack_require__(7080);
|
|
27203
27203
|
var SetHelpers = __webpack_require__(4402);
|
|
27204
|
-
var clone = __webpack_require__(
|
|
27204
|
+
var clone = __webpack_require__(9286);
|
|
27205
27205
|
var getSetRecord = __webpack_require__(3789);
|
|
27206
27206
|
var iterateSimple = __webpack_require__(507);
|
|
27207
27207
|
|
|
@@ -29473,7 +29473,7 @@ module.exports = function (it) {
|
|
|
29473
29473
|
|
|
29474
29474
|
var aSet = __webpack_require__(7080);
|
|
29475
29475
|
var add = (__webpack_require__(4402).add);
|
|
29476
|
-
var clone = __webpack_require__(
|
|
29476
|
+
var clone = __webpack_require__(9286);
|
|
29477
29477
|
var getSetRecord = __webpack_require__(3789);
|
|
29478
29478
|
var iterateSimple = __webpack_require__(507);
|
|
29479
29479
|
|
|
@@ -43489,28 +43489,6 @@ var global = module.exports = typeof window != 'undefined' && window.Math == Mat
|
|
|
43489
43489
|
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
|
|
43490
43490
|
|
|
43491
43491
|
|
|
43492
|
-
/***/ }),
|
|
43493
|
-
|
|
43494
|
-
/***/ 6905:
|
|
43495
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
43496
|
-
|
|
43497
|
-
"use strict";
|
|
43498
|
-
|
|
43499
|
-
var SetHelpers = __webpack_require__(4402);
|
|
43500
|
-
var iterate = __webpack_require__(8469);
|
|
43501
|
-
|
|
43502
|
-
var Set = SetHelpers.Set;
|
|
43503
|
-
var add = SetHelpers.add;
|
|
43504
|
-
|
|
43505
|
-
module.exports = function (set) {
|
|
43506
|
-
var result = new Set();
|
|
43507
|
-
iterate(set, function (it) {
|
|
43508
|
-
add(result, it);
|
|
43509
|
-
});
|
|
43510
|
-
return result;
|
|
43511
|
-
};
|
|
43512
|
-
|
|
43513
|
-
|
|
43514
43492
|
/***/ }),
|
|
43515
43493
|
|
|
43516
43494
|
/***/ 6935:
|
|
@@ -65863,6 +65841,28 @@ module.exports = function (it) {
|
|
|
65863
65841
|
return pl;
|
|
65864
65842
|
});
|
|
65865
65843
|
|
|
65844
|
+
/***/ }),
|
|
65845
|
+
|
|
65846
|
+
/***/ 9286:
|
|
65847
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
65848
|
+
|
|
65849
|
+
"use strict";
|
|
65850
|
+
|
|
65851
|
+
var SetHelpers = __webpack_require__(4402);
|
|
65852
|
+
var iterate = __webpack_require__(8469);
|
|
65853
|
+
|
|
65854
|
+
var Set = SetHelpers.Set;
|
|
65855
|
+
var add = SetHelpers.add;
|
|
65856
|
+
|
|
65857
|
+
module.exports = function (set) {
|
|
65858
|
+
var result = new Set();
|
|
65859
|
+
iterate(set, function (it) {
|
|
65860
|
+
add(result, it);
|
|
65861
|
+
});
|
|
65862
|
+
return result;
|
|
65863
|
+
};
|
|
65864
|
+
|
|
65865
|
+
|
|
65866
65866
|
/***/ }),
|
|
65867
65867
|
|
|
65868
65868
|
/***/ 9294:
|
|
@@ -78756,8 +78756,8 @@ var pair_number_input_component = normalizeComponent(
|
|
|
78756
78756
|
)
|
|
78757
78757
|
|
|
78758
78758
|
/* harmony default export */ var pair_number_input = (pair_number_input_component.exports);
|
|
78759
|
-
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/form/comps/custom-date-picker.vue?vue&type=template&id=
|
|
78760
|
-
var
|
|
78759
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/form/comps/custom-date-picker.vue?vue&type=template&id=1db670fe
|
|
78760
|
+
var custom_date_pickervue_type_template_id_1db670fe_render = function render() {
|
|
78761
78761
|
var _vm = this,
|
|
78762
78762
|
_c = _vm._self._c;
|
|
78763
78763
|
return _c('div', {
|
|
@@ -78790,8 +78790,18 @@ var custom_date_pickervue_type_template_id_6ccfc0f6_render = function render() {
|
|
|
78790
78790
|
}
|
|
78791
78791
|
}
|
|
78792
78792
|
}, [_vm._v(" " + _vm._s(item.label) + " ")]);
|
|
78793
|
-
}), 0)] : _c('
|
|
78793
|
+
}), 0)] : _c('div', {
|
|
78794
|
+
ref: "panelInputWrap",
|
|
78795
|
+
staticClass: "b-picker__panel-input-wrap",
|
|
78796
|
+
class: {
|
|
78797
|
+
'is-clearable': _vm.dateOptions.clearable !== false
|
|
78798
|
+
}
|
|
78799
|
+
}, [_c('el-date-picker', _vm._b({
|
|
78794
78800
|
ref: "panelDatePicker",
|
|
78801
|
+
class: {
|
|
78802
|
+
'has-shortcut-tag': !!_vm.activeShortcutLabel,
|
|
78803
|
+
'has-shortcut-tag--vertical': !!_vm.activeShortcutLabel && _vm.shortcutTagVertical
|
|
78804
|
+
},
|
|
78795
78805
|
attrs: {
|
|
78796
78806
|
"value": _vm.value,
|
|
78797
78807
|
"popper-class": _vm.panelPopperClass
|
|
@@ -78799,10 +78809,28 @@ var custom_date_pickervue_type_template_id_6ccfc0f6_render = function render() {
|
|
|
78799
78809
|
on: {
|
|
78800
78810
|
"input": _vm.handleChange,
|
|
78801
78811
|
"focus": _vm.handlePanelOpen
|
|
78812
|
+
},
|
|
78813
|
+
nativeOn: {
|
|
78814
|
+
"click": function ($event) {
|
|
78815
|
+
return _vm.handlePanelOpen.apply(null, arguments);
|
|
78816
|
+
}
|
|
78817
|
+
}
|
|
78818
|
+
}, 'el-date-picker', _vm.panelDateOptions, false)), _vm.activeShortcutLabel ? _c('span', {
|
|
78819
|
+
staticClass: "b-picker__shortcut-tag",
|
|
78820
|
+
class: {
|
|
78821
|
+
'is-vertical': _vm.shortcutTagVertical
|
|
78822
|
+
},
|
|
78823
|
+
attrs: {
|
|
78824
|
+
"title": _vm.activeShortcutLabel
|
|
78802
78825
|
}
|
|
78803
|
-
},
|
|
78826
|
+
}, [_vm.shortcutTagVertical ? _vm._l(_vm.activeShortcutChars, function (char, index) {
|
|
78827
|
+
return _c('i', {
|
|
78828
|
+
key: index,
|
|
78829
|
+
staticClass: "b-picker__shortcut-tag-char"
|
|
78830
|
+
}, [_vm._v(" " + _vm._s(char) + " ")]);
|
|
78831
|
+
}) : [_vm._v(_vm._s(_vm.activeShortcutLabel))]], 2) : _vm._e()], 1)], 2);
|
|
78804
78832
|
};
|
|
78805
|
-
var
|
|
78833
|
+
var custom_date_pickervue_type_template_id_1db670fe_staticRenderFns = [];
|
|
78806
78834
|
|
|
78807
78835
|
// EXTERNAL MODULE: ./node_modules/moment/moment.js
|
|
78808
78836
|
var moment = __webpack_require__(9412);
|
|
@@ -78853,7 +78881,15 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
|
|
|
78853
78881
|
},
|
|
78854
78882
|
data() {
|
|
78855
78883
|
return {
|
|
78856
|
-
|
|
78884
|
+
active: '',
|
|
78885
|
+
panelHighlightTimer: null,
|
|
78886
|
+
shortcutTagVertical: false,
|
|
78887
|
+
shortcutTagResizeObserver: null
|
|
78888
|
+
};
|
|
78889
|
+
},
|
|
78890
|
+
computed: {
|
|
78891
|
+
shortcuts() {
|
|
78892
|
+
return [{
|
|
78857
78893
|
label: '上月',
|
|
78858
78894
|
start_time: moment_default()().subtract(1, 'months').startOf('month').format('YYYY-MM-DD'),
|
|
78859
78895
|
end_time: moment_default()().subtract(1, 'months').endOf('month').format('YYYY-MM-DD'),
|
|
@@ -78878,11 +78914,8 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
|
|
|
78878
78914
|
start_time: moment_default()().startOf('month').format('YYYY-MM-DD'),
|
|
78879
78915
|
end_time: moment_default()().endOf('month').format('YYYY-MM-DD'),
|
|
78880
78916
|
key: 'month'
|
|
78881
|
-
}]
|
|
78882
|
-
|
|
78883
|
-
};
|
|
78884
|
-
},
|
|
78885
|
-
computed: {
|
|
78917
|
+
}];
|
|
78918
|
+
},
|
|
78886
78919
|
dateOptions() {
|
|
78887
78920
|
return {
|
|
78888
78921
|
startPlaceholder: '开始时间',
|
|
@@ -78919,12 +78952,21 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
|
|
|
78919
78952
|
},
|
|
78920
78953
|
panelPopperClass() {
|
|
78921
78954
|
return `by-custom-date-picker-panel by-custom-date-picker-panel--${this._uid}`;
|
|
78955
|
+
},
|
|
78956
|
+
activeShortcutLabel() {
|
|
78957
|
+
if (!this.active) return '';
|
|
78958
|
+
const item = this.shortcuts.find(shortcut => shortcut.key === this.active);
|
|
78959
|
+
return item ? item.label : '';
|
|
78960
|
+
},
|
|
78961
|
+
activeShortcutChars() {
|
|
78962
|
+
return this.activeShortcutLabel.split('');
|
|
78922
78963
|
}
|
|
78923
78964
|
},
|
|
78924
78965
|
watch: {
|
|
78925
78966
|
active() {
|
|
78926
78967
|
if (this.shortcutLayout === 'panel') {
|
|
78927
78968
|
this.schedulePanelShortcutHighlight();
|
|
78969
|
+
this.updateShortcutTagLayout();
|
|
78928
78970
|
}
|
|
78929
78971
|
},
|
|
78930
78972
|
value: {
|
|
@@ -78934,9 +78976,18 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
|
|
|
78934
78976
|
immediate: true
|
|
78935
78977
|
}
|
|
78936
78978
|
},
|
|
78979
|
+
mounted() {
|
|
78980
|
+
if (this.shortcutLayout === 'panel') {
|
|
78981
|
+
this.initShortcutTagLayout();
|
|
78982
|
+
}
|
|
78983
|
+
},
|
|
78984
|
+
beforeDestroy() {
|
|
78985
|
+
this.clearPanelHighlightTimer();
|
|
78986
|
+
this.destroyShortcutTagObserver();
|
|
78987
|
+
},
|
|
78937
78988
|
methods: {
|
|
78938
78989
|
syncActiveFromValue(newValue) {
|
|
78939
|
-
if (newValue && newValue.length) {
|
|
78990
|
+
if (Array.isArray(newValue) && newValue.length) {
|
|
78940
78991
|
const start = moment_default()(newValue[0]).format('YYYY-MM-DD');
|
|
78941
78992
|
const end = moment_default()(newValue[1]).format('YYYY-MM-DD');
|
|
78942
78993
|
let matchedKey = '';
|
|
@@ -78993,55 +79044,95 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
|
|
|
78993
79044
|
this.syncActiveFromValue(this.value);
|
|
78994
79045
|
this.schedulePanelShortcutHighlight();
|
|
78995
79046
|
},
|
|
79047
|
+
clearPanelHighlightTimer() {
|
|
79048
|
+
if (this.panelHighlightTimer) {
|
|
79049
|
+
clearTimeout(this.panelHighlightTimer);
|
|
79050
|
+
this.panelHighlightTimer = null;
|
|
79051
|
+
}
|
|
79052
|
+
},
|
|
78996
79053
|
getPanelElement() {
|
|
78997
79054
|
const datePicker = this.$refs.panelDatePicker;
|
|
78998
|
-
if (!datePicker
|
|
78999
|
-
|
|
79055
|
+
if (!datePicker) return null;
|
|
79056
|
+
if (datePicker.picker && datePicker.picker.$el) {
|
|
79057
|
+
return datePicker.picker.$el;
|
|
79058
|
+
}
|
|
79059
|
+
if (datePicker.$el) {
|
|
79060
|
+
const panelInRoot = datePicker.$el.querySelector('.by-custom-date-picker-panel');
|
|
79061
|
+
if (panelInRoot) return panelInRoot;
|
|
79062
|
+
}
|
|
79063
|
+
return document.querySelector(`.by-custom-date-picker-panel--${this._uid}`);
|
|
79000
79064
|
},
|
|
79001
79065
|
schedulePanelShortcutHighlight(retry = 0) {
|
|
79066
|
+
this.clearPanelHighlightTimer();
|
|
79002
79067
|
this.$nextTick(() => {
|
|
79003
79068
|
const updated = this.updatePanelShortcutHighlight();
|
|
79004
|
-
if (!updated && retry <
|
|
79005
|
-
setTimeout(() => {
|
|
79069
|
+
if (!updated && retry < 15) {
|
|
79070
|
+
this.panelHighlightTimer = setTimeout(() => {
|
|
79006
79071
|
this.schedulePanelShortcutHighlight(retry + 1);
|
|
79007
79072
|
}, 50);
|
|
79008
79073
|
}
|
|
79009
79074
|
});
|
|
79010
79075
|
},
|
|
79011
79076
|
updatePanelShortcutHighlight() {
|
|
79012
|
-
const panel = this.getPanelElement()
|
|
79077
|
+
const panel = this.getPanelElement();
|
|
79013
79078
|
if (!panel) return false;
|
|
79014
79079
|
const shortcutEls = panel.querySelectorAll('.el-picker-panel__shortcut');
|
|
79015
79080
|
if (!shortcutEls.length) return false;
|
|
79016
79081
|
shortcutEls.forEach(el => {
|
|
79017
79082
|
const label = (el.textContent || '').trim();
|
|
79018
79083
|
const item = this.shortcuts.find(shortcut => shortcut.label === label);
|
|
79019
|
-
|
|
79084
|
+
const isActive = !!(item && item.key === this.active);
|
|
79085
|
+
el.classList.toggle('active', isActive);
|
|
79086
|
+
el.classList.toggle('is-active', isActive);
|
|
79020
79087
|
});
|
|
79021
79088
|
return true;
|
|
79089
|
+
},
|
|
79090
|
+
initShortcutTagLayout() {
|
|
79091
|
+
this.destroyShortcutTagObserver();
|
|
79092
|
+
this.$nextTick(() => {
|
|
79093
|
+
const wrap = this.$refs.panelInputWrap;
|
|
79094
|
+
if (!wrap) return;
|
|
79095
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
79096
|
+
this.shortcutTagResizeObserver = new ResizeObserver(() => {
|
|
79097
|
+
this.updateShortcutTagLayout();
|
|
79098
|
+
});
|
|
79099
|
+
this.shortcutTagResizeObserver.observe(wrap);
|
|
79100
|
+
}
|
|
79101
|
+
this.updateShortcutTagLayout();
|
|
79102
|
+
});
|
|
79103
|
+
},
|
|
79104
|
+
updateShortcutTagLayout() {
|
|
79105
|
+
const wrap = this.$refs.panelInputWrap;
|
|
79106
|
+
if (!wrap || !this.activeShortcutLabel) {
|
|
79107
|
+
this.shortcutTagVertical = false;
|
|
79108
|
+
return;
|
|
79109
|
+
}
|
|
79110
|
+
|
|
79111
|
+
// 宽度较窄时改为纵向展示,避免挤压日期区域(阈值越小越不易触发纵向)
|
|
79112
|
+
this.shortcutTagVertical = wrap.clientWidth < 250;
|
|
79113
|
+
},
|
|
79114
|
+
destroyShortcutTagObserver() {
|
|
79115
|
+
if (this.shortcutTagResizeObserver) {
|
|
79116
|
+
this.shortcutTagResizeObserver.disconnect();
|
|
79117
|
+
this.shortcutTagResizeObserver = null;
|
|
79118
|
+
}
|
|
79022
79119
|
}
|
|
79023
79120
|
}
|
|
79024
79121
|
});
|
|
79025
79122
|
;// ./src/components/form/comps/custom-date-picker.vue?vue&type=script&lang=js
|
|
79026
79123
|
/* harmony default export */ var comps_custom_date_pickervue_type_script_lang_js = (custom_date_pickervue_type_script_lang_js);
|
|
79027
|
-
;// ./node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/@vue/cli-service/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/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/form/comps/custom-date-picker.vue?vue&type=style&index=0&id=6ccfc0f6&prod&lang=scss
|
|
79028
|
-
// extracted by mini-css-extract-plugin
|
|
79029
|
-
|
|
79030
|
-
;// ./src/components/form/comps/custom-date-picker.vue?vue&type=style&index=0&id=6ccfc0f6&prod&lang=scss
|
|
79031
|
-
|
|
79032
79124
|
;// ./src/components/form/comps/custom-date-picker.vue
|
|
79033
79125
|
|
|
79034
79126
|
|
|
79035
79127
|
|
|
79036
|
-
;
|
|
79037
79128
|
|
|
79038
79129
|
|
|
79039
79130
|
/* normalize component */
|
|
79040
|
-
|
|
79131
|
+
;
|
|
79041
79132
|
var custom_date_picker_component = normalizeComponent(
|
|
79042
79133
|
comps_custom_date_pickervue_type_script_lang_js,
|
|
79043
|
-
|
|
79044
|
-
|
|
79134
|
+
custom_date_pickervue_type_template_id_1db670fe_render,
|
|
79135
|
+
custom_date_pickervue_type_template_id_1db670fe_staticRenderFns,
|
|
79045
79136
|
false,
|
|
79046
79137
|
null,
|
|
79047
79138
|
null,
|
package/lib/by-components.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.b-form .header[data-v-1fc1d18e]{margin-bottom:20px}.b-form .footer[data-v-1fc1d18e]{margin-top:20px}
|
package/lib/by-components.umd.js
CHANGED
|
@@ -78766,8 +78766,8 @@ var pair_number_input_component = normalizeComponent(
|
|
|
78766
78766
|
)
|
|
78767
78767
|
|
|
78768
78768
|
/* harmony default export */ var pair_number_input = (pair_number_input_component.exports);
|
|
78769
|
-
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/form/comps/custom-date-picker.vue?vue&type=template&id=
|
|
78770
|
-
var
|
|
78769
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/form/comps/custom-date-picker.vue?vue&type=template&id=1db670fe
|
|
78770
|
+
var custom_date_pickervue_type_template_id_1db670fe_render = function render() {
|
|
78771
78771
|
var _vm = this,
|
|
78772
78772
|
_c = _vm._self._c;
|
|
78773
78773
|
return _c('div', {
|
|
@@ -78800,8 +78800,18 @@ var custom_date_pickervue_type_template_id_6ccfc0f6_render = function render() {
|
|
|
78800
78800
|
}
|
|
78801
78801
|
}
|
|
78802
78802
|
}, [_vm._v(" " + _vm._s(item.label) + " ")]);
|
|
78803
|
-
}), 0)] : _c('
|
|
78803
|
+
}), 0)] : _c('div', {
|
|
78804
|
+
ref: "panelInputWrap",
|
|
78805
|
+
staticClass: "b-picker__panel-input-wrap",
|
|
78806
|
+
class: {
|
|
78807
|
+
'is-clearable': _vm.dateOptions.clearable !== false
|
|
78808
|
+
}
|
|
78809
|
+
}, [_c('el-date-picker', _vm._b({
|
|
78804
78810
|
ref: "panelDatePicker",
|
|
78811
|
+
class: {
|
|
78812
|
+
'has-shortcut-tag': !!_vm.activeShortcutLabel,
|
|
78813
|
+
'has-shortcut-tag--vertical': !!_vm.activeShortcutLabel && _vm.shortcutTagVertical
|
|
78814
|
+
},
|
|
78805
78815
|
attrs: {
|
|
78806
78816
|
"value": _vm.value,
|
|
78807
78817
|
"popper-class": _vm.panelPopperClass
|
|
@@ -78809,10 +78819,28 @@ var custom_date_pickervue_type_template_id_6ccfc0f6_render = function render() {
|
|
|
78809
78819
|
on: {
|
|
78810
78820
|
"input": _vm.handleChange,
|
|
78811
78821
|
"focus": _vm.handlePanelOpen
|
|
78822
|
+
},
|
|
78823
|
+
nativeOn: {
|
|
78824
|
+
"click": function ($event) {
|
|
78825
|
+
return _vm.handlePanelOpen.apply(null, arguments);
|
|
78826
|
+
}
|
|
78812
78827
|
}
|
|
78813
|
-
}, 'el-date-picker', _vm.panelDateOptions, false))
|
|
78828
|
+
}, 'el-date-picker', _vm.panelDateOptions, false)), _vm.activeShortcutLabel ? _c('span', {
|
|
78829
|
+
staticClass: "b-picker__shortcut-tag",
|
|
78830
|
+
class: {
|
|
78831
|
+
'is-vertical': _vm.shortcutTagVertical
|
|
78832
|
+
},
|
|
78833
|
+
attrs: {
|
|
78834
|
+
"title": _vm.activeShortcutLabel
|
|
78835
|
+
}
|
|
78836
|
+
}, [_vm.shortcutTagVertical ? _vm._l(_vm.activeShortcutChars, function (char, index) {
|
|
78837
|
+
return _c('i', {
|
|
78838
|
+
key: index,
|
|
78839
|
+
staticClass: "b-picker__shortcut-tag-char"
|
|
78840
|
+
}, [_vm._v(" " + _vm._s(char) + " ")]);
|
|
78841
|
+
}) : [_vm._v(_vm._s(_vm.activeShortcutLabel))]], 2) : _vm._e()], 1)], 2);
|
|
78814
78842
|
};
|
|
78815
|
-
var
|
|
78843
|
+
var custom_date_pickervue_type_template_id_1db670fe_staticRenderFns = [];
|
|
78816
78844
|
|
|
78817
78845
|
// EXTERNAL MODULE: ./node_modules/moment/moment.js
|
|
78818
78846
|
var moment = __webpack_require__(9618);
|
|
@@ -78863,7 +78891,15 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
|
|
|
78863
78891
|
},
|
|
78864
78892
|
data() {
|
|
78865
78893
|
return {
|
|
78866
|
-
|
|
78894
|
+
active: '',
|
|
78895
|
+
panelHighlightTimer: null,
|
|
78896
|
+
shortcutTagVertical: false,
|
|
78897
|
+
shortcutTagResizeObserver: null
|
|
78898
|
+
};
|
|
78899
|
+
},
|
|
78900
|
+
computed: {
|
|
78901
|
+
shortcuts() {
|
|
78902
|
+
return [{
|
|
78867
78903
|
label: '上月',
|
|
78868
78904
|
start_time: moment_default()().subtract(1, 'months').startOf('month').format('YYYY-MM-DD'),
|
|
78869
78905
|
end_time: moment_default()().subtract(1, 'months').endOf('month').format('YYYY-MM-DD'),
|
|
@@ -78888,11 +78924,8 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
|
|
|
78888
78924
|
start_time: moment_default()().startOf('month').format('YYYY-MM-DD'),
|
|
78889
78925
|
end_time: moment_default()().endOf('month').format('YYYY-MM-DD'),
|
|
78890
78926
|
key: 'month'
|
|
78891
|
-
}]
|
|
78892
|
-
|
|
78893
|
-
};
|
|
78894
|
-
},
|
|
78895
|
-
computed: {
|
|
78927
|
+
}];
|
|
78928
|
+
},
|
|
78896
78929
|
dateOptions() {
|
|
78897
78930
|
return {
|
|
78898
78931
|
startPlaceholder: '开始时间',
|
|
@@ -78929,12 +78962,21 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
|
|
|
78929
78962
|
},
|
|
78930
78963
|
panelPopperClass() {
|
|
78931
78964
|
return `by-custom-date-picker-panel by-custom-date-picker-panel--${this._uid}`;
|
|
78965
|
+
},
|
|
78966
|
+
activeShortcutLabel() {
|
|
78967
|
+
if (!this.active) return '';
|
|
78968
|
+
const item = this.shortcuts.find(shortcut => shortcut.key === this.active);
|
|
78969
|
+
return item ? item.label : '';
|
|
78970
|
+
},
|
|
78971
|
+
activeShortcutChars() {
|
|
78972
|
+
return this.activeShortcutLabel.split('');
|
|
78932
78973
|
}
|
|
78933
78974
|
},
|
|
78934
78975
|
watch: {
|
|
78935
78976
|
active() {
|
|
78936
78977
|
if (this.shortcutLayout === 'panel') {
|
|
78937
78978
|
this.schedulePanelShortcutHighlight();
|
|
78979
|
+
this.updateShortcutTagLayout();
|
|
78938
78980
|
}
|
|
78939
78981
|
},
|
|
78940
78982
|
value: {
|
|
@@ -78944,9 +78986,18 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
|
|
|
78944
78986
|
immediate: true
|
|
78945
78987
|
}
|
|
78946
78988
|
},
|
|
78989
|
+
mounted() {
|
|
78990
|
+
if (this.shortcutLayout === 'panel') {
|
|
78991
|
+
this.initShortcutTagLayout();
|
|
78992
|
+
}
|
|
78993
|
+
},
|
|
78994
|
+
beforeDestroy() {
|
|
78995
|
+
this.clearPanelHighlightTimer();
|
|
78996
|
+
this.destroyShortcutTagObserver();
|
|
78997
|
+
},
|
|
78947
78998
|
methods: {
|
|
78948
78999
|
syncActiveFromValue(newValue) {
|
|
78949
|
-
if (newValue && newValue.length) {
|
|
79000
|
+
if (Array.isArray(newValue) && newValue.length) {
|
|
78950
79001
|
const start = moment_default()(newValue[0]).format('YYYY-MM-DD');
|
|
78951
79002
|
const end = moment_default()(newValue[1]).format('YYYY-MM-DD');
|
|
78952
79003
|
let matchedKey = '';
|
|
@@ -79003,55 +79054,95 @@ var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
|
|
|
79003
79054
|
this.syncActiveFromValue(this.value);
|
|
79004
79055
|
this.schedulePanelShortcutHighlight();
|
|
79005
79056
|
},
|
|
79057
|
+
clearPanelHighlightTimer() {
|
|
79058
|
+
if (this.panelHighlightTimer) {
|
|
79059
|
+
clearTimeout(this.panelHighlightTimer);
|
|
79060
|
+
this.panelHighlightTimer = null;
|
|
79061
|
+
}
|
|
79062
|
+
},
|
|
79006
79063
|
getPanelElement() {
|
|
79007
79064
|
const datePicker = this.$refs.panelDatePicker;
|
|
79008
|
-
if (!datePicker
|
|
79009
|
-
|
|
79065
|
+
if (!datePicker) return null;
|
|
79066
|
+
if (datePicker.picker && datePicker.picker.$el) {
|
|
79067
|
+
return datePicker.picker.$el;
|
|
79068
|
+
}
|
|
79069
|
+
if (datePicker.$el) {
|
|
79070
|
+
const panelInRoot = datePicker.$el.querySelector('.by-custom-date-picker-panel');
|
|
79071
|
+
if (panelInRoot) return panelInRoot;
|
|
79072
|
+
}
|
|
79073
|
+
return document.querySelector(`.by-custom-date-picker-panel--${this._uid}`);
|
|
79010
79074
|
},
|
|
79011
79075
|
schedulePanelShortcutHighlight(retry = 0) {
|
|
79076
|
+
this.clearPanelHighlightTimer();
|
|
79012
79077
|
this.$nextTick(() => {
|
|
79013
79078
|
const updated = this.updatePanelShortcutHighlight();
|
|
79014
|
-
if (!updated && retry <
|
|
79015
|
-
setTimeout(() => {
|
|
79079
|
+
if (!updated && retry < 15) {
|
|
79080
|
+
this.panelHighlightTimer = setTimeout(() => {
|
|
79016
79081
|
this.schedulePanelShortcutHighlight(retry + 1);
|
|
79017
79082
|
}, 50);
|
|
79018
79083
|
}
|
|
79019
79084
|
});
|
|
79020
79085
|
},
|
|
79021
79086
|
updatePanelShortcutHighlight() {
|
|
79022
|
-
const panel = this.getPanelElement()
|
|
79087
|
+
const panel = this.getPanelElement();
|
|
79023
79088
|
if (!panel) return false;
|
|
79024
79089
|
const shortcutEls = panel.querySelectorAll('.el-picker-panel__shortcut');
|
|
79025
79090
|
if (!shortcutEls.length) return false;
|
|
79026
79091
|
shortcutEls.forEach(el => {
|
|
79027
79092
|
const label = (el.textContent || '').trim();
|
|
79028
79093
|
const item = this.shortcuts.find(shortcut => shortcut.label === label);
|
|
79029
|
-
|
|
79094
|
+
const isActive = !!(item && item.key === this.active);
|
|
79095
|
+
el.classList.toggle('active', isActive);
|
|
79096
|
+
el.classList.toggle('is-active', isActive);
|
|
79030
79097
|
});
|
|
79031
79098
|
return true;
|
|
79099
|
+
},
|
|
79100
|
+
initShortcutTagLayout() {
|
|
79101
|
+
this.destroyShortcutTagObserver();
|
|
79102
|
+
this.$nextTick(() => {
|
|
79103
|
+
const wrap = this.$refs.panelInputWrap;
|
|
79104
|
+
if (!wrap) return;
|
|
79105
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
79106
|
+
this.shortcutTagResizeObserver = new ResizeObserver(() => {
|
|
79107
|
+
this.updateShortcutTagLayout();
|
|
79108
|
+
});
|
|
79109
|
+
this.shortcutTagResizeObserver.observe(wrap);
|
|
79110
|
+
}
|
|
79111
|
+
this.updateShortcutTagLayout();
|
|
79112
|
+
});
|
|
79113
|
+
},
|
|
79114
|
+
updateShortcutTagLayout() {
|
|
79115
|
+
const wrap = this.$refs.panelInputWrap;
|
|
79116
|
+
if (!wrap || !this.activeShortcutLabel) {
|
|
79117
|
+
this.shortcutTagVertical = false;
|
|
79118
|
+
return;
|
|
79119
|
+
}
|
|
79120
|
+
|
|
79121
|
+
// 宽度较窄时改为纵向展示,避免挤压日期区域(阈值越小越不易触发纵向)
|
|
79122
|
+
this.shortcutTagVertical = wrap.clientWidth < 250;
|
|
79123
|
+
},
|
|
79124
|
+
destroyShortcutTagObserver() {
|
|
79125
|
+
if (this.shortcutTagResizeObserver) {
|
|
79126
|
+
this.shortcutTagResizeObserver.disconnect();
|
|
79127
|
+
this.shortcutTagResizeObserver = null;
|
|
79128
|
+
}
|
|
79032
79129
|
}
|
|
79033
79130
|
}
|
|
79034
79131
|
});
|
|
79035
79132
|
;// ./src/components/form/comps/custom-date-picker.vue?vue&type=script&lang=js
|
|
79036
79133
|
/* harmony default export */ var comps_custom_date_pickervue_type_script_lang_js = (custom_date_pickervue_type_script_lang_js);
|
|
79037
|
-
;// ./node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-64.use[0]!./node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/@vue/cli-service/node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/form/comps/custom-date-picker.vue?vue&type=style&index=0&id=6ccfc0f6&prod&lang=scss
|
|
79038
|
-
// extracted by mini-css-extract-plugin
|
|
79039
|
-
|
|
79040
|
-
;// ./src/components/form/comps/custom-date-picker.vue?vue&type=style&index=0&id=6ccfc0f6&prod&lang=scss
|
|
79041
|
-
|
|
79042
79134
|
;// ./src/components/form/comps/custom-date-picker.vue
|
|
79043
79135
|
|
|
79044
79136
|
|
|
79045
79137
|
|
|
79046
|
-
;
|
|
79047
79138
|
|
|
79048
79139
|
|
|
79049
79140
|
/* normalize component */
|
|
79050
|
-
|
|
79141
|
+
;
|
|
79051
79142
|
var custom_date_picker_component = normalizeComponent(
|
|
79052
79143
|
comps_custom_date_pickervue_type_script_lang_js,
|
|
79053
|
-
|
|
79054
|
-
|
|
79144
|
+
custom_date_pickervue_type_template_id_1db670fe_render,
|
|
79145
|
+
custom_date_pickervue_type_template_id_1db670fe_staticRenderFns,
|
|
79055
79146
|
false,
|
|
79056
79147
|
null,
|
|
79057
79148
|
null,
|