@lancom/shared 0.0.282 → 0.0.283

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.
@@ -133,7 +133,7 @@
133
133
  :suburb="suburb"
134
134
  :labelless="true"
135
135
  :required="true"
136
- placeholder="Suburb"
136
+ :placeholder="postcodeLabel"
137
137
  @select="handleSuburbChange">
138
138
  </postcode-select>
139
139
  <div class="form-col col-half">
@@ -281,19 +281,19 @@
281
281
  <validation-provider
282
282
  v-slot="{ errors }"
283
283
  tag="div"
284
- name="locality"
284
+ :name="localityLabel"
285
285
  class="form-col">
286
286
  <label
287
287
  for="locality"
288
288
  class="form-label">
289
- Locality
289
+ {{ localityLabel }}
290
290
  </label>
291
291
  <input
292
292
  id="locality"
293
293
  ref="locality"
294
294
  v-model="address.city"
295
295
  name="locality"
296
- placeholder="Locality"
296
+ :placeholder="localityLabel"
297
297
  type="text"
298
298
  class="form-field labelless"
299
299
  :class="{
@@ -309,19 +309,19 @@
309
309
  <validation-provider
310
310
  v-slot="{ errors }"
311
311
  tag="div"
312
- name="state"
312
+ :name="stateLabel"
313
313
  class="form-col">
314
314
  <label
315
315
  for="state"
316
316
  class="form-label">
317
- State
317
+ {{ stateLabel }}
318
318
  </label>
319
319
  <input
320
320
  id="state"
321
321
  ref="state"
322
322
  v-model="address.state"
323
323
  name="state"
324
- placeholder="State"
324
+ :placeholder="stateLabel"
325
325
  type="text"
326
326
  class="form-field labelless"
327
327
  :class="{
@@ -365,13 +365,22 @@ export default {
365
365
  }
366
366
  },
367
367
  computed: {
368
- ...mapGetters(['shop', 'country']),
368
+ ...mapGetters(['shop', 'country', 'MESSAGES']),
369
369
  ...mapGetters('cart', [
370
370
  'suburb'
371
371
  ]),
372
372
  ...mapGetters('auth', [
373
373
  'user'
374
- ])
374
+ ]),
375
+ postcodeLabel() {
376
+ return this.MESSAGES?.POSTCODES_LABEL || 'Suburb';
377
+ },
378
+ localityLabel() {
379
+ return this.MESSAGES?.LOCALITY || 'Locality';
380
+ },
381
+ stateLabel() {
382
+ return this.MESSAGES?.STATE || 'State';
383
+ }
375
384
  },
376
385
  created() {
377
386
  if (!this.address.suburb && !this.suburb && this.user?.suburb) {
@@ -55,13 +55,23 @@
55
55
  top: 40px;
56
56
  width: 220px;
57
57
  margin-top: 20px;
58
- margin-left: 10px;
58
+ margin-left: -55px;
59
59
  // transform: translateY(-50%);
60
60
  padding: 15px;
61
61
  box-shadow: 0px 4px 121px 0px rgba(145, 136, 188, 0.34);
62
62
  background-color: white;
63
63
  border-radius: 12px;
64
64
  }
65
+ &__backdrop {
66
+ top: 0;
67
+ right: 0;
68
+ bottom: 0;
69
+ left: 0;
70
+ position: absolute;
71
+ z-index: 100;
72
+ background: red;
73
+
74
+ }
65
75
  &__field {
66
76
  font-size: 18px;
67
77
  font-weight: 600;
@@ -72,6 +82,10 @@
72
82
  cursor: pointer;
73
83
  padding: 6px;
74
84
  align-items: center;
85
+ &--open,
86
+ &--open * {
87
+ pointer-events: none !important;
88
+ }
75
89
  > i {
76
90
  color: $purple;
77
91
  }
@@ -1,9 +1,10 @@
1
1
  <template>
2
2
  <div class="ClientSettings__wrapper">
3
3
  <div
4
- class="ClientSettings__field"
5
- @click="isOpen = !isOpen">
6
- <div class="lc_regular16 ClientSettings__value">
4
+ class="ClientSettings__field">
5
+ <div
6
+ class="lc_regular16 ClientSettings__value"
7
+ @click="isOpen = !isOpen">
7
8
  <span v-if="country">
8
9
  <img
9
10
  v-if="checkedCountry"
@@ -12,16 +13,11 @@
12
13
  v-else
13
14
  class="icon-globe"></i>
14
15
  </span>
15
- <!-- <span class="ClientSettings__value--divider"></span> -->
16
- <!-- <span v-if="currency">
17
- <i class="icon-message"></i>
18
- </span> -->
19
16
  <i class="icon-angle-down ClientSettings__caret"></i>
20
17
  </div>
21
18
  </div>
22
19
  <div
23
20
  v-if="isOpen"
24
- v-click-outside="close"
25
21
  class="ClientSettings__dropdown">
26
22
  <div>
27
23
  <div
@@ -112,9 +108,6 @@ export default {
112
108
  }
113
109
  },
114
110
  methods: {
115
- close() {
116
- this.isOpen = false;
117
- },
118
111
  toggleVisibleCountries() {
119
112
  this.visibleCountries = !this.visibleCountries;
120
113
  },
@@ -10,7 +10,7 @@
10
10
  v-if="labelless"
11
11
  class="form-label"
12
12
  @click="$refs.suburb.$el.focus()">
13
- {{ labelText }}
13
+ {{ displayLabelText }}
14
14
  </label>
15
15
  <multiselect
16
16
  ref="suburb"
@@ -62,7 +62,7 @@
62
62
  v-if="!labelless"
63
63
  class="form-label label-inner"
64
64
  @click="$refs.suburb.$el.focus()">
65
- {{ labelText }}
65
+ {{ displayLabelText }}
66
66
  </label>
67
67
  <slot></slot>
68
68
  <span
@@ -125,11 +125,14 @@ export default {
125
125
  suburbs: [],
126
126
  options: [],
127
127
  isLoading: false,
128
- handleSearchWithDebounce: debounce(this.handleSearch, 500)
128
+ handleSearchWithDebounce: debounce(this.handleSearch, 1000)
129
129
  };
130
130
  },
131
131
  computed: {
132
- ...mapGetters(['shop']),
132
+ ...mapGetters(['shop', 'MESSAGES']),
133
+ displayLabelText() {
134
+ return this.MESSAGES.POSTCODES_LABEL || this.labelText;
135
+ },
133
136
  model: {
134
137
  get() {
135
138
  return this.selected?._id ? this.selected : null;
@@ -148,11 +151,11 @@ export default {
148
151
  },
149
152
  methods: {
150
153
  async handleSearch(query) {
151
- if (query.length) {
154
+ if (query.trim().length > 2) {
152
155
  this.isLoading = true;
153
156
  const country = this.codeCountry || this.country;
154
157
  const countryName = country ? (country.isoCode === 'GB' ? 'England' : (country.name || country)) : 'Australia';
155
- this.suburbs = await api.fetchSuburbs({ query, country: countryName }, this.shop?._id);
158
+ this.suburbs = await api.fetchSuburbs({ query: query.trim(), country: countryName }, this.shop?._id);
156
159
  this.options = this.suburbs.map(this.createOptionFromSuburb);
157
160
  this.isLoading = false;
158
161
  } else {
@@ -47,7 +47,7 @@
47
47
  </div>
48
48
  </div>
49
49
  </div>
50
- <LazyHydrate on-interaction>
50
+ <LazyHydrate when-idle>
51
51
  <the-footer />
52
52
  </LazyHydrate>
53
53
  <modals-container />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.282",
3
+ "version": "0.0.283",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
package/store/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import api from '@lancom/shared/assets/js/api';
2
2
  import { saveStatePlugin, loadState } from '@lancom/shared/plugins/save-state';
3
+ import { MESSAGES, COUNTRIES_MESSAGES } from '@/messages';
3
4
  const cookieparser = process.server ? require('cookieparser') : undefined;
4
5
  const CLOSED_NOTIFICATION = 'lancom-closed-notification-1.0';
5
6
 
7
+
6
8
  export const state = () => ({
7
9
  country: null,
8
10
  currency: null,
@@ -38,7 +40,8 @@ export const getters = {
38
40
  taxName: ({ pricing }) => pricing?.taxName || 'GST',
39
41
  displayPricingWithTax: ({ pricing }) => !!pricing?.displayPricingWithTax,
40
42
  screenPrintsPrices: ({ pricing }) => pricing?.screenPrintsPrices || {},
41
- depositInfo: ({ depositInfo }) => depositInfo || {}
43
+ depositInfo: ({ depositInfo }) => depositInfo || {},
44
+ MESSAGES: ({ country }) => ({ ...MESSAGES, ...(COUNTRIES_MESSAGES[country?.isoCode] || {}) })
42
45
  };
43
46
 
44
47
  export const actions = {