@things-factory/operato-mms 4.3.544 → 4.3.551

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.
@@ -90,7 +90,12 @@ class OrderInitPopup extends localize(i18next)(LitElement) {
90
90
  marketplaceOrderItems.map(item => {
91
91
  const marketplaceOrderShippingItems = item.marketplaceOrderShippingItems
92
92
  marketplaceOrderShippingItems.map(itm => {
93
- const marketplaceOrderShipping = itm.marketplaceOrderShipping
93
+ const marketplaceOrderShipping = {
94
+ ...itm.marketplaceOrderShipping,
95
+ address1: this.maskString(itm.marketplaceOrderShipping.address1),
96
+ attentionTo: this.maskString(itm.marketplaceOrderShipping.attentionTo),
97
+ phone1: this.maskString(itm.marketplaceOrderShipping.phone1)
98
+ }
94
99
 
95
100
  if (marketplaceOrderShipping) {
96
101
  marketplaceOrderShippings.push(marketplaceOrderShipping)
@@ -102,6 +107,16 @@ class OrderInitPopup extends localize(i18next)(LitElement) {
102
107
  return marketplaceOrderShippings.find(a => a.id === id)
103
108
  })
104
109
  }
110
+
111
+ maskString(str, visibleStart = 1, visibleEnd = 1) {
112
+ if (str.length <= visibleStart + visibleEnd) {
113
+ return str
114
+ }
115
+ const regex = new RegExp(`^(.{${visibleStart}})(.+)(.{${visibleEnd}})$`)
116
+ return str.replace(regex, (match, start, middle, end) => {
117
+ return start + '*'.repeat(middle.length) + end
118
+ })
119
+ }
105
120
  }
106
121
 
107
122
  window.customElements.define('order-init-popup', OrderInitPopup)
@@ -190,6 +190,11 @@ class OrderByStore extends localize(i18next)(PageView) {
190
190
  type: 'date',
191
191
  props: {
192
192
  searchOper: 'eq',
193
+ min: (() => {
194
+ let date = new Date()
195
+ date.setMonth(date.getMonth() - 3)
196
+ return date.toISOString().split('T')[0]
197
+ })(),
193
198
  max: new Date().toISOString().split('T')[0]
194
199
  },
195
200
  value: (() => {
@@ -205,7 +210,16 @@ class OrderByStore extends localize(i18next)(PageView) {
205
210
  type: 'date',
206
211
  props: {
207
212
  searchOper: 'eq',
208
- max: new Date().toISOString().split('T')[0]
213
+ min: (() => {
214
+ let date = new Date()
215
+ date.setMonth(date.getMonth() - 3)
216
+ return date.toISOString().split('T')[0]
217
+ })(),
218
+ max: (() => {
219
+ var max = new Date()
220
+ max.setMonth(max.getMonth())
221
+ return max.toISOString().split('T')[0]
222
+ })()
209
223
  },
210
224
  value: new Date().toISOString().split('T')[0]
211
225
  },
@@ -520,7 +534,7 @@ class OrderByStore extends localize(i18next)(PageView) {
520
534
  }
521
535
 
522
536
  get _toDateInput() {
523
- return this._searchForm.shadowRoot.querySelector('input[name=toDate]')
537
+ return this.searchForm.shadowRoot.querySelector('input[name=toDate]')
524
538
  }
525
539
 
526
540
  async fetchStore(id) {
@@ -1136,7 +1150,7 @@ class OrderByStore extends localize(i18next)(PageView) {
1136
1150
  _modifyDateRange(e) {
1137
1151
  try {
1138
1152
  const fromDate = e.currentTarget.value
1139
-
1153
+ let a = this?._toDateInput?.value
1140
1154
  if (this?._toDateInput?.value < fromDate) this._toDateInput.value = fromDate
1141
1155
 
1142
1156
  let min = new Date(fromDate)
@@ -1149,6 +1163,30 @@ class OrderByStore extends localize(i18next)(PageView) {
1149
1163
  } catch (e) {}
1150
1164
  }
1151
1165
 
1166
+ // _modifyDateRange(e) {
1167
+ // const fromDate = e.currentTarget.value
1168
+
1169
+ // if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
1170
+
1171
+ // let min = new Date(fromDate)
1172
+ // let max = new Date(fromDate)
1173
+ // max.setMonth(max.getMonth() + 1)
1174
+
1175
+ // let today = new Date()
1176
+ // today.setHours(0, 0, 0, 0)
1177
+ // if (!Number.isNaN(new Date(min).getTime())) {
1178
+ // min = min.toISOString().split('T')[0]
1179
+ // max = max.toISOString().split('T')[0]
1180
+ // } else {
1181
+ // return
1182
+ // }
1183
+
1184
+ // if (this._toDateInput.value > max) this._toDateInput.value = max
1185
+
1186
+ // this._toDateInput.min = min
1187
+ // this._toDateInput.max = max
1188
+ // }
1189
+
1152
1190
  _showToast({ type, message }) {
1153
1191
  document.dispatchEvent(
1154
1192
  new CustomEvent('notify', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-mms",
3
- "version": "4.3.544",
3
+ "version": "4.3.551",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -100,11 +100,11 @@
100
100
  "@things-factory/scene-visualizer": "^4.3.534",
101
101
  "@things-factory/setting-ui": "^4.3.535",
102
102
  "@things-factory/system-ui": "^4.3.535",
103
- "@things-factory/warehouse-base": "^4.3.544"
103
+ "@things-factory/warehouse-base": "^4.3.551"
104
104
  },
105
105
  "devDependencies": {
106
106
  "@things-factory/builder": "^4.3.534",
107
107
  "@types/node-fetch": "^2.5.7"
108
108
  },
109
- "gitHead": "d9ba6fd47325e8b698b33e2ea133f8596ba55719"
109
+ "gitHead": "0c07b711097eae74c8d75c938c9d9580d2fdf4ab"
110
110
  }