@things-factory/biz-ui 4.3.38 → 4.3.40

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.
@@ -86,6 +86,12 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
86
86
  </div>
87
87
 
88
88
  <div class="button-container">
89
+ <mwc-button
90
+ @click=${this._cancel.bind(this)}
91
+ label="${`${i18next.t('button.cancel')}`}"
92
+ raised
93
+ ></mwc-button>
94
+
89
95
  <mwc-button
90
96
  @click=${this._selectBizplace.bind(this)}
91
97
  label="${`${i18next.t('button.confirm')}`}"
@@ -105,17 +111,12 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
105
111
  selectable: {
106
112
  multiple: false
107
113
  },
108
- appendable: false
114
+ appendable: false,
115
+ handlers: { dblclick: this._dblClickHandler.bind(this) }
109
116
  },
110
117
  columns: [
111
118
  { type: 'gutter', gutterName: 'sequence' },
112
119
  { type: 'gutter', gutterName: 'row-selector', multiple: false },
113
- {
114
- type: 'string',
115
- name: 'companyName',
116
- header: i18next.t('field.company'),
117
- width: 300
118
- },
119
120
  {
120
121
  type: 'string',
121
122
  name: 'accountNo',
@@ -124,21 +125,51 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
124
125
  },
125
126
  {
126
127
  type: 'string',
127
- name: 'name',
128
- header: i18next.t('field.name'),
128
+ name: 'companyName',
129
+ header: i18next.t('field.company'),
129
130
  width: 300
130
131
  },
131
132
  {
132
133
  type: 'string',
133
- name: 'email',
134
- header: i18next.t('field.email'),
135
- width: 150
134
+ name: 'name',
135
+ header: i18next.t('field.name'),
136
+ width: 300
136
137
  },
137
138
  {
138
139
  type: 'string',
139
140
  name: 'description',
140
141
  header: i18next.t('field.description'),
141
142
  width: 350
143
+ },
144
+ {
145
+ type: 'string',
146
+ name: 'fullAddress',
147
+ header: i18next.t('field.delivery_address'),
148
+ width: 350
149
+ },
150
+ {
151
+ type: 'string',
152
+ name: 'billingAddress',
153
+ header: i18next.t('field.billing_address'),
154
+ width: 350
155
+ },
156
+ {
157
+ type: 'string',
158
+ name: 'phone',
159
+ header: i18next.t('field.phone'),
160
+ width: 350
161
+ },
162
+ {
163
+ type: 'string',
164
+ name: 'fax',
165
+ header: i18next.t('field.fax'),
166
+ width: 350
167
+ },
168
+ {
169
+ type: 'string',
170
+ name: 'email',
171
+ header: i18next.t('field.email'),
172
+ width: 150
142
173
  }
143
174
  ]
144
175
  }
@@ -161,6 +192,12 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
161
192
  name: 'name',
162
193
  type: 'text',
163
194
  props: { searchOper: 'i_like' }
195
+ },
196
+ {
197
+ label: i18next.t('label.contact'),
198
+ name: 'phone',
199
+ type: 'text',
200
+ props: { searchOper: 'i_like' }
164
201
  }
165
202
  ]
166
203
  }
@@ -191,6 +228,14 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
191
228
  companyName
192
229
  email
193
230
  accountNo
231
+ phone
232
+ fax
233
+ address
234
+ address2
235
+ postCode
236
+ city
237
+ state
238
+ billingAddress
194
239
  }
195
240
  total
196
241
  }
@@ -201,7 +246,17 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
201
246
 
202
247
  return {
203
248
  total: response.data.contactPoints.total || 0,
204
- records: response.data.contactPoints.items || []
249
+ records:
250
+ response.data.contactPoints.items.map(res => {
251
+ return {
252
+ ...res,
253
+ fullAddress: res.address
254
+ ? `${res.address ? res.address : ''} ${res.address2 ? res.address : ''} ${
255
+ res.postCode ? res.postCode + ',' : ''
256
+ } ${res.city ? res.city + ',' : ''} ${res.state ? res.state + ',' : ''} Malaysia`
257
+ : ''
258
+ }
259
+ }) || []
205
260
  }
206
261
  }
207
262
 
@@ -216,6 +271,15 @@ class ContactPointsPopup extends localize(i18next)(LitElement) {
216
271
  )
217
272
  }
218
273
  }
274
+
275
+ _dblClickHandler(columns, data, column, record, rowIndex, target) {
276
+ this.dispatchEvent(new CustomEvent('selected', { detail: record }))
277
+ history.back()
278
+ }
279
+
280
+ _cancel(){
281
+ history.back()
282
+ }
219
283
  }
220
284
 
221
285
  window.customElements.define('contact-points-popup', ContactPointsPopup)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/biz-ui",
3
- "version": "4.3.38",
3
+ "version": "4.3.40",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -24,8 +24,8 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
25
25
  },
26
26
  "dependencies": {
27
- "@things-factory/biz-base": "^4.3.38",
28
- "@things-factory/code-base": "^4.3.38",
27
+ "@things-factory/biz-base": "^4.3.40",
28
+ "@things-factory/code-base": "^4.3.40",
29
29
  "@things-factory/form-ui": "^4.3.35",
30
30
  "@things-factory/grist-ui": "^4.3.35",
31
31
  "@things-factory/i18n-base": "^4.3.35",
@@ -33,5 +33,5 @@
33
33
  "@things-factory/layout-base": "^4.3.35",
34
34
  "@things-factory/shell": "^4.3.35"
35
35
  },
36
- "gitHead": "d0abc65661e7d6ddf1e89788e2775f90ead2393f"
36
+ "gitHead": "5ae9cd8d8abe747c4e8ac9e243468c1f6662481b"
37
37
  }