@94ai/nf-double-year 8.3.22 → 9.0.0

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.
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const commonUtils = require("@94ai/common-utils");
3
4
  const Vue = require("vue");
4
5
  const dateUtil = require("element-ui/src/utils/date-util");
5
6
  const vue2RuntimeHelpers = require("@94ai/vue2-runtime-helpers");
@@ -389,14 +390,14 @@ var popper$1 = { exports: {} };
389
390
  this._popper = popper2.jquery ? popper2[0] : popper2;
390
391
  }
391
392
  this._options = Object.assign({}, DEFAULTS, options);
392
- this._options.modifiers = this._options.modifiers.map((function(modifier) {
393
+ this._options.modifiers = this._options.modifiers.map(function(modifier) {
393
394
  if (this._options.modifiersIgnored.indexOf(modifier) !== -1)
394
395
  return;
395
396
  if (modifier === "applyStyle") {
396
397
  this._popper.setAttribute("x-placement", this._options.placement);
397
398
  }
398
399
  return this.modifiers[modifier] || modifier;
399
- }).bind(this));
400
+ }.bind(this));
400
401
  this.state.position = this._getPosition(this._popper, this._reference);
401
402
  setStyle(this._popper, {
402
403
  position: this.state.position,
@@ -609,11 +610,11 @@ var popper$1 = { exports: {} };
609
610
  if (ends !== void 0) {
610
611
  modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));
611
612
  }
612
- modifiersToRun.forEach((function(modifier) {
613
+ modifiersToRun.forEach(function(modifier) {
613
614
  if (isFunction(modifier)) {
614
615
  data = modifier.call(this, data);
615
616
  }
616
- }).bind(this));
617
+ }.bind(this));
617
618
  return data;
618
619
  };
619
620
  Popper2.prototype.isModifierRequired = function(requesting, requested) {
@@ -757,7 +758,7 @@ var popper$1 = { exports: {} };
757
758
  } else {
758
759
  flipOrder = this._options.flipBehavior;
759
760
  }
760
- flipOrder.forEach((function(step, index) {
761
+ flipOrder.forEach(function(step, index) {
761
762
  if (placement !== step || flipOrder.length === index + 1) {
762
763
  return;
763
764
  }
@@ -774,7 +775,7 @@ var popper$1 = { exports: {} };
774
775
  data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;
775
776
  data = this.runModifiers(data, this._options.modifiers, this._flip);
776
777
  }
777
- }).bind(this));
778
+ }.bind(this));
778
779
  return data;
779
780
  };
780
781
  Popper2.prototype.modifiers.offset = function(data) {
@@ -1421,7 +1422,7 @@ const validator = function(val) {
1421
1422
  return val === null || val === void 0 || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
1422
1423
  };
1423
1424
  const _sfc_main$3 = {
1424
- mixins: [Emitter, NewPopper],
1425
+ mixins: [commonUtils.LocaleMixin, Emitter, NewPopper],
1425
1426
  inject: {
1426
1427
  elForm: {
1427
1428
  default: ""
@@ -1441,11 +1442,11 @@ const _sfc_main$3 = {
1441
1442
  placeholder: String,
1442
1443
  startPlaceholder: {
1443
1444
  type: String,
1444
- default: "开始年份"
1445
+ default: void 0
1445
1446
  },
1446
1447
  endPlaceholder: {
1447
1448
  type: String,
1448
- default: "结束年份"
1449
+ default: void 0
1449
1450
  },
1450
1451
  prefixIcon: String,
1451
1452
  clearIcon: {
@@ -1539,6 +1540,13 @@ const _sfc_main$3 = {
1539
1540
  }
1540
1541
  },
1541
1542
  computed: {
1543
+ localeText() {
1544
+ var _a, _b;
1545
+ return {
1546
+ startPlaceholder: (_a = this.startPlaceholder) != null ? _a : this.t("nf.date.startYear"),
1547
+ endPlaceholder: (_b = this.endPlaceholder) != null ? _b : this.t("nf.date.endYear")
1548
+ };
1549
+ },
1542
1550
  ranged() {
1543
1551
  return this.type.indexOf("range") > -1;
1544
1552
  },
@@ -2035,7 +2043,7 @@ var _sfc_render$3 = function render() {
2035
2043
  staticClass: "el-range-input",
2036
2044
  attrs: {
2037
2045
  "autocomplete": "off",
2038
- "placeholder": _vm.startPlaceholder,
2046
+ "placeholder": _vm.localeText.startPlaceholder,
2039
2047
  "disabled": _vm.pickerDisabled,
2040
2048
  "readonly": !_vm.editable || _vm.readonly,
2041
2049
  "name": _vm.name && _vm.name[0]
@@ -2056,7 +2064,7 @@ var _sfc_render$3 = function render() {
2056
2064
  staticClass: "el-range-input",
2057
2065
  attrs: {
2058
2066
  "autocomplete": "off",
2059
- "placeholder": _vm.endPlaceholder,
2067
+ "placeholder": _vm.localeText.endPlaceholder,
2060
2068
  "disabled": _vm.pickerDisabled,
2061
2069
  "readonly": !_vm.editable || _vm.readonly,
2062
2070
  "name": _vm.name && _vm.name[1]
@@ -1,3 +1,4 @@
1
+ import { LocaleMixin } from "@94ai/common-utils";
1
2
  import Vue from "vue";
2
3
  import { isDateObject, getWeekNumber, formatDate, parseDate, isDate, getDayCountOfYear, range, nextDate, toDate, modifyWithTimeString } from "element-ui/src/utils/date-util";
3
4
  import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
@@ -387,14 +388,14 @@ var popper$1 = { exports: {} };
387
388
  this._popper = popper2.jquery ? popper2[0] : popper2;
388
389
  }
389
390
  this._options = Object.assign({}, DEFAULTS, options);
390
- this._options.modifiers = this._options.modifiers.map((function(modifier) {
391
+ this._options.modifiers = this._options.modifiers.map(function(modifier) {
391
392
  if (this._options.modifiersIgnored.indexOf(modifier) !== -1)
392
393
  return;
393
394
  if (modifier === "applyStyle") {
394
395
  this._popper.setAttribute("x-placement", this._options.placement);
395
396
  }
396
397
  return this.modifiers[modifier] || modifier;
397
- }).bind(this));
398
+ }.bind(this));
398
399
  this.state.position = this._getPosition(this._popper, this._reference);
399
400
  setStyle(this._popper, {
400
401
  position: this.state.position,
@@ -607,11 +608,11 @@ var popper$1 = { exports: {} };
607
608
  if (ends !== void 0) {
608
609
  modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));
609
610
  }
610
- modifiersToRun.forEach((function(modifier) {
611
+ modifiersToRun.forEach(function(modifier) {
611
612
  if (isFunction(modifier)) {
612
613
  data = modifier.call(this, data);
613
614
  }
614
- }).bind(this));
615
+ }.bind(this));
615
616
  return data;
616
617
  };
617
618
  Popper2.prototype.isModifierRequired = function(requesting, requested) {
@@ -755,7 +756,7 @@ var popper$1 = { exports: {} };
755
756
  } else {
756
757
  flipOrder = this._options.flipBehavior;
757
758
  }
758
- flipOrder.forEach((function(step, index) {
759
+ flipOrder.forEach(function(step, index) {
759
760
  if (placement !== step || flipOrder.length === index + 1) {
760
761
  return;
761
762
  }
@@ -772,7 +773,7 @@ var popper$1 = { exports: {} };
772
773
  data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;
773
774
  data = this.runModifiers(data, this._options.modifiers, this._flip);
774
775
  }
775
- }).bind(this));
776
+ }.bind(this));
776
777
  return data;
777
778
  };
778
779
  Popper2.prototype.modifiers.offset = function(data) {
@@ -1419,7 +1420,7 @@ const validator = function(val) {
1419
1420
  return val === null || val === void 0 || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
1420
1421
  };
1421
1422
  const _sfc_main$3 = {
1422
- mixins: [Emitter, NewPopper],
1423
+ mixins: [LocaleMixin, Emitter, NewPopper],
1423
1424
  inject: {
1424
1425
  elForm: {
1425
1426
  default: ""
@@ -1439,11 +1440,11 @@ const _sfc_main$3 = {
1439
1440
  placeholder: String,
1440
1441
  startPlaceholder: {
1441
1442
  type: String,
1442
- default: "开始年份"
1443
+ default: void 0
1443
1444
  },
1444
1445
  endPlaceholder: {
1445
1446
  type: String,
1446
- default: "结束年份"
1447
+ default: void 0
1447
1448
  },
1448
1449
  prefixIcon: String,
1449
1450
  clearIcon: {
@@ -1537,6 +1538,13 @@ const _sfc_main$3 = {
1537
1538
  }
1538
1539
  },
1539
1540
  computed: {
1541
+ localeText() {
1542
+ var _a, _b;
1543
+ return {
1544
+ startPlaceholder: (_a = this.startPlaceholder) != null ? _a : this.t("nf.date.startYear"),
1545
+ endPlaceholder: (_b = this.endPlaceholder) != null ? _b : this.t("nf.date.endYear")
1546
+ };
1547
+ },
1540
1548
  ranged() {
1541
1549
  return this.type.indexOf("range") > -1;
1542
1550
  },
@@ -2033,7 +2041,7 @@ var _sfc_render$3 = function render() {
2033
2041
  staticClass: "el-range-input",
2034
2042
  attrs: {
2035
2043
  "autocomplete": "off",
2036
- "placeholder": _vm.startPlaceholder,
2044
+ "placeholder": _vm.localeText.startPlaceholder,
2037
2045
  "disabled": _vm.pickerDisabled,
2038
2046
  "readonly": !_vm.editable || _vm.readonly,
2039
2047
  "name": _vm.name && _vm.name[0]
@@ -2054,7 +2062,7 @@ var _sfc_render$3 = function render() {
2054
2062
  staticClass: "el-range-input",
2055
2063
  attrs: {
2056
2064
  "autocomplete": "off",
2057
- "placeholder": _vm.endPlaceholder,
2065
+ "placeholder": _vm.localeText.endPlaceholder,
2058
2066
  "disabled": _vm.pickerDisabled,
2059
2067
  "readonly": !_vm.editable || _vm.readonly,
2060
2068
  "name": _vm.name && _vm.name[1]
@@ -1,171 +1,175 @@
1
- declare var _default: import("vue").DefineComponent<{
2
- type: {
3
- type: StringConstructor;
4
- default: string;
5
- };
6
- timeArrowControl: BooleanConstructor;
7
- }, {}, {}, {}, {}, import("vue").DefineComponent<{
8
- size: {
9
- type: StringConstructor;
10
- default: undefined;
11
- };
12
- format: StringConstructor;
13
- valueFormat: StringConstructor;
14
- readonly: BooleanConstructor;
15
- placeholder: StringConstructor;
16
- startPlaceholder: {
17
- type: StringConstructor;
18
- default: string;
19
- };
20
- endPlaceholder: {
21
- type: StringConstructor;
22
- default: string;
23
- };
24
- prefixIcon: StringConstructor;
25
- clearIcon: {
26
- type: StringConstructor;
27
- default: string;
28
- };
29
- name: {
30
- default: string;
31
- validator: (val: any) => boolean;
32
- };
33
- disabled: BooleanConstructor;
34
- clearable: {
35
- type: BooleanConstructor;
36
- default: boolean;
37
- };
38
- id: {
39
- default: string;
40
- validator: (val: any) => boolean;
41
- };
42
- popperClass: StringConstructor;
43
- editable: {
44
- type: BooleanConstructor;
45
- default: boolean;
46
- };
47
- align: {
48
- type: StringConstructor;
49
- default: string;
50
- };
51
- value: {};
52
- defaultValue: {};
53
- defaultTime: {};
54
- rangeSeparator: {
55
- type: StringConstructor;
56
- default: string;
57
- };
58
- pickerOptions: {};
59
- unlinkPanels: BooleanConstructor;
60
- validateEvent: {
61
- type: BooleanConstructor;
62
- default: boolean;
63
- };
64
- }, {}, {
65
- pickerVisible: boolean;
66
- showClose: boolean;
67
- userInput: null;
68
- valueOnOpen: null;
69
- unwatchPickerOptions: null;
70
- }, {
71
- ranged(): boolean;
72
- reference(): any;
73
- refInput(): never[];
74
- valueIsEmpty(): boolean;
75
- triggerClass(): any;
76
- selectionMode(): "week" | "month" | "year" | "dates" | "day";
77
- haveTrigger(): any;
78
- displayValue(): any;
79
- parsedValue(): any;
80
- _elFormItemSize(): any;
81
- pickerSize(): any;
82
- pickerDisabled(): any;
83
- firstInputId(): {
84
- id: any;
85
- };
86
- secondInputId(): {
87
- id: any;
88
- };
89
- }, {}, any, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
90
- size: {
91
- type: StringConstructor;
92
- default: undefined;
93
- };
94
- format: StringConstructor;
95
- valueFormat: StringConstructor;
96
- readonly: BooleanConstructor;
97
- placeholder: StringConstructor;
98
- startPlaceholder: {
99
- type: StringConstructor;
100
- default: string;
101
- };
102
- endPlaceholder: {
103
- type: StringConstructor;
104
- default: string;
105
- };
106
- prefixIcon: StringConstructor;
107
- clearIcon: {
108
- type: StringConstructor;
109
- default: string;
110
- };
111
- name: {
112
- default: string;
113
- validator: (val: any) => boolean;
114
- };
115
- disabled: BooleanConstructor;
116
- clearable: {
117
- type: BooleanConstructor;
118
- default: boolean;
119
- };
120
- id: {
121
- default: string;
122
- validator: (val: any) => boolean;
123
- };
124
- popperClass: StringConstructor;
125
- editable: {
126
- type: BooleanConstructor;
127
- default: boolean;
128
- };
129
- align: {
130
- type: StringConstructor;
131
- default: string;
132
- };
133
- value: {};
134
- defaultValue: {};
135
- defaultTime: {};
136
- rangeSeparator: {
137
- type: StringConstructor;
138
- default: string;
139
- };
140
- pickerOptions: {};
141
- unlinkPanels: BooleanConstructor;
142
- validateEvent: {
143
- type: BooleanConstructor;
144
- default: boolean;
145
- };
146
- }>>, {
147
- name: string;
148
- readonly: boolean;
149
- disabled: boolean;
150
- unlinkPanels: boolean;
151
- size: string;
152
- startPlaceholder: string;
153
- endPlaceholder: string;
154
- clearIcon: string;
155
- clearable: boolean;
156
- id: string;
157
- editable: boolean;
158
- align: string;
159
- rangeSeparator: string;
160
- validateEvent: boolean;
161
- }>, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
162
- type: {
163
- type: StringConstructor;
164
- default: string;
165
- };
166
- timeArrowControl: BooleanConstructor;
167
- }>>, {
168
- type: string;
169
- timeArrowControl: boolean;
170
- }>;
171
- export default _default;
1
+ declare var _default: import("vue").DefineComponent<{
2
+ type: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ timeArrowControl: BooleanConstructor;
7
+ }, {}, {}, {}, {}, import("vue").DefineComponent<{
8
+ size: {
9
+ type: StringConstructor;
10
+ default: undefined;
11
+ };
12
+ format: StringConstructor;
13
+ valueFormat: StringConstructor;
14
+ readonly: BooleanConstructor;
15
+ placeholder: StringConstructor;
16
+ startPlaceholder: {
17
+ type: StringConstructor;
18
+ default: undefined;
19
+ };
20
+ endPlaceholder: {
21
+ type: StringConstructor;
22
+ default: undefined;
23
+ };
24
+ prefixIcon: StringConstructor;
25
+ clearIcon: {
26
+ type: StringConstructor;
27
+ default: string;
28
+ };
29
+ name: {
30
+ default: string;
31
+ validator: (val: any) => boolean;
32
+ };
33
+ disabled: BooleanConstructor;
34
+ clearable: {
35
+ type: BooleanConstructor;
36
+ default: boolean;
37
+ };
38
+ id: {
39
+ default: string;
40
+ validator: (val: any) => boolean;
41
+ };
42
+ popperClass: StringConstructor;
43
+ editable: {
44
+ type: BooleanConstructor;
45
+ default: boolean;
46
+ };
47
+ align: {
48
+ type: StringConstructor;
49
+ default: string;
50
+ };
51
+ value: {};
52
+ defaultValue: {};
53
+ defaultTime: {};
54
+ rangeSeparator: {
55
+ type: StringConstructor;
56
+ default: string;
57
+ };
58
+ pickerOptions: {};
59
+ unlinkPanels: BooleanConstructor;
60
+ validateEvent: {
61
+ type: BooleanConstructor;
62
+ default: boolean;
63
+ };
64
+ }, {}, {
65
+ pickerVisible: boolean;
66
+ showClose: boolean;
67
+ userInput: null;
68
+ valueOnOpen: null;
69
+ unwatchPickerOptions: null;
70
+ }, {
71
+ localeText(): {
72
+ startPlaceholder: any;
73
+ endPlaceholder: any;
74
+ };
75
+ ranged(): boolean;
76
+ reference(): any;
77
+ refInput(): never[];
78
+ valueIsEmpty(): boolean;
79
+ triggerClass(): any;
80
+ selectionMode(): "year" | "month" | "week" | "dates" | "day";
81
+ haveTrigger(): any;
82
+ displayValue(): any;
83
+ parsedValue(): any;
84
+ _elFormItemSize(): any;
85
+ pickerSize(): any;
86
+ pickerDisabled(): any;
87
+ firstInputId(): {
88
+ id: any;
89
+ };
90
+ secondInputId(): {
91
+ id: any;
92
+ };
93
+ }, {}, any, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
94
+ size: {
95
+ type: StringConstructor;
96
+ default: undefined;
97
+ };
98
+ format: StringConstructor;
99
+ valueFormat: StringConstructor;
100
+ readonly: BooleanConstructor;
101
+ placeholder: StringConstructor;
102
+ startPlaceholder: {
103
+ type: StringConstructor;
104
+ default: undefined;
105
+ };
106
+ endPlaceholder: {
107
+ type: StringConstructor;
108
+ default: undefined;
109
+ };
110
+ prefixIcon: StringConstructor;
111
+ clearIcon: {
112
+ type: StringConstructor;
113
+ default: string;
114
+ };
115
+ name: {
116
+ default: string;
117
+ validator: (val: any) => boolean;
118
+ };
119
+ disabled: BooleanConstructor;
120
+ clearable: {
121
+ type: BooleanConstructor;
122
+ default: boolean;
123
+ };
124
+ id: {
125
+ default: string;
126
+ validator: (val: any) => boolean;
127
+ };
128
+ popperClass: StringConstructor;
129
+ editable: {
130
+ type: BooleanConstructor;
131
+ default: boolean;
132
+ };
133
+ align: {
134
+ type: StringConstructor;
135
+ default: string;
136
+ };
137
+ value: {};
138
+ defaultValue: {};
139
+ defaultTime: {};
140
+ rangeSeparator: {
141
+ type: StringConstructor;
142
+ default: string;
143
+ };
144
+ pickerOptions: {};
145
+ unlinkPanels: BooleanConstructor;
146
+ validateEvent: {
147
+ type: BooleanConstructor;
148
+ default: boolean;
149
+ };
150
+ }>>, {
151
+ name: string;
152
+ readonly: boolean;
153
+ disabled: boolean;
154
+ unlinkPanels: boolean;
155
+ size: string;
156
+ startPlaceholder: string;
157
+ endPlaceholder: string;
158
+ clearIcon: string;
159
+ clearable: boolean;
160
+ id: string;
161
+ editable: boolean;
162
+ align: string;
163
+ rangeSeparator: string;
164
+ validateEvent: boolean;
165
+ }>, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
166
+ type: {
167
+ type: StringConstructor;
168
+ default: string;
169
+ };
170
+ timeArrowControl: BooleanConstructor;
171
+ }>>, {
172
+ type: string;
173
+ timeArrowControl: boolean;
174
+ }>;
175
+ export default _default;