@things-factory/product-ui 4.2.0 → 4.3.0-alpha.1

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.
@@ -2,7 +2,7 @@ import '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
3
 
4
4
  import gql from 'graphql-tag'
5
- import { css, html, LitElement } from 'lit-element'
5
+ import { css, html, LitElement } from 'lit'
6
6
 
7
7
  import { i18next, localize } from '@things-factory/i18n-base'
8
8
  import { client, gqlContext } from '@things-factory/shell'
@@ -2,7 +2,7 @@ import '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
3
 
4
4
  import gql from 'graphql-tag'
5
- import { css, html, LitElement } from 'lit-element'
5
+ import { css, html, LitElement } from 'lit'
6
6
 
7
7
  import { i18next, localize } from '@things-factory/i18n-base'
8
8
  import { client, CustomAlert, gqlContext } from '@things-factory/shell'
@@ -3,7 +3,7 @@ import '@things-factory/form-ui'
3
3
  import '@things-factory/grist-ui'
4
4
 
5
5
  import gql from 'graphql-tag'
6
- import { css, html } from 'lit-element'
6
+ import { css, html } from 'lit'
7
7
 
8
8
  import { getCodeByName } from '@things-factory/code-base'
9
9
  import { i18next, localize } from '@things-factory/i18n-base'
@@ -2,7 +2,7 @@ import '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
3
 
4
4
  import gql from 'graphql-tag'
5
- import { css, html, LitElement } from 'lit-element'
5
+ import { css, html, LitElement } from 'lit'
6
6
 
7
7
  import { i18next, localize } from '@things-factory/i18n-base'
8
8
  import { client, CustomAlert, gqlContext } from '@things-factory/shell'
@@ -337,7 +337,7 @@ class ProductCombinationSettingsPopup extends localize(i18next)(LitElement) {
337
337
  let patches = this.productCombinationSettingGrist.dirtyData.records.map(record => {
338
338
  const qty = record.qty
339
339
  if (!qty || qty <= 0 || !Number.isSafeInteger(qty)) {
340
- throw new Error(i18next.t('text.invalid_qty_for_item_number_x', { state: {x: record.__seq__} }))
340
+ throw new Error(i18next.t('text.invalid_qty_for_item_number_x', { state: { x: record.__seq__ } }))
341
341
  }
342
342
  return {
343
343
  // only existing product combination will have id
@@ -3,7 +3,7 @@ import '@things-factory/grist-ui'
3
3
  import './product-combination-settings-popup'
4
4
 
5
5
  import gql from 'graphql-tag'
6
- import { css, html, LitElement } from 'lit-element'
6
+ import { css, html, LitElement } from 'lit'
7
7
 
8
8
  import { i18next, localize } from '@things-factory/i18n-base'
9
9
  import { client, CustomAlert, gqlContext } from '@things-factory/shell'
@@ -3,7 +3,10 @@ import '@things-factory/grist-ui'
3
3
  import './product-combinations-popup'
4
4
 
5
5
  import gql from 'graphql-tag'
6
- import { css, html, LitElement } from 'lit-element'
6
+ import { css, html, LitElement } from 'lit'
7
+ import isEmpty from 'lodash-es/isEmpty'
8
+ import isNaN from 'lodash-es/isNaN'
9
+ import isNumber from 'lodash-es/isNumber'
7
10
 
8
11
  import { getCodeByName } from '@things-factory/code-base'
9
12
  import { i18next, localize } from '@things-factory/i18n-base'
@@ -12,8 +15,6 @@ import { client, CustomAlert, gqlContext } from '@things-factory/shell'
12
15
  import { ScrollbarStyles } from '@things-factory/styles'
13
16
  import { isMobileDevice } from '@things-factory/utils'
14
17
 
15
- const _ = require('lodash')
16
-
17
18
  export class ProductDetailsPopup extends localize(i18next)(LitElement) {
18
19
  static get styles() {
19
20
  return [
@@ -568,20 +569,20 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
568
569
  let data = this.dataGrist._data.records.map(itm => {
569
570
  itm.error = false
570
571
 
571
- if (_.isEmpty(itm.gtin) || '') {
572
+ if (isEmpty(itm.gtin) || '') {
572
573
  itm.error = true
573
574
  if (!errors.find(err => err.type == 'gtin')) errors.push({ type: 'gtin', value: 'GTIN is required' })
574
575
  }
575
- if (_.isEmpty(itm.packingType) || '') {
576
+ if (isEmpty(itm.packingType) || '') {
576
577
  itm.error = true
577
578
  if (!errors.find(err => err.type == 'packingType'))
578
579
  errors.push({ type: 'packingType', value: 'Packing type is required' })
579
580
  }
580
- if (_.isEmpty(itm.uom) || '') {
581
+ if (isEmpty(itm.uom) || '') {
581
582
  itm.error = true
582
583
  if (!errors.find(err => err.type == 'uom')) errors.push({ type: 'uom', value: 'UOM is required' })
583
584
  }
584
- if (!_.isNumber(itm.uomValue) || _.isNaN(itm.uomValue) || '') {
585
+ if (!isNumber(itm.uomValue) || isNaN(itm.uomValue) || '') {
585
586
  itm.error = true
586
587
  if (!errors.find(err => err.type == 'uomValue'))
587
588
  errors.push({ type: 'uomValue', value: 'UOM Value is required' })
@@ -639,7 +640,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
639
640
  ...this.dataGrist._data,
640
641
  records: this._updateRowOption(
641
642
  this.dataGrist._data.records.map((record, idx) => {
642
- if (!_.isEmpty(record.childProductDetail) && record.childProductDetail == before) {
643
+ if (!isEmpty(record.childProductDetail) && record.childProductDetail == before) {
643
644
  record.childProductDetail = after
644
645
  }
645
646
  return record
@@ -649,7 +650,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
649
650
 
650
651
  break
651
652
  case 'uomValue':
652
- if (_.isNaN(after)) {
653
+ if (isNaN(after)) {
653
654
  updatedRecords.records[row].uomValue = 1
654
655
  }
655
656
  break
@@ -704,7 +705,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
704
705
  value: ''
705
706
  },
706
707
  ...data
707
- .filter(child => child.gtin != itm.gtin && !_.isEmpty(child.gtin))
708
+ .filter(child => child.gtin != itm.gtin && !isEmpty(child.gtin))
708
709
  .map(x => {
709
710
  const rowOption = {
710
711
  display: x.gtin,
@@ -2,32 +2,17 @@ import '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
3
  import './product-details-popup'
4
4
 
5
- import gql from 'graphql-tag'
6
- import {
7
- css,
8
- html
9
- } from 'lit-element'
5
+ import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
6
+ import { CustomAlert, PageView, client, gqlContext } from '@things-factory/shell'
7
+ import { css, html } from 'lit'
8
+ import { i18next, localize } from '@things-factory/i18n-base'
10
9
 
10
+ import { PICKING_STRATEGIES } from './constants/picking-strategy'
11
11
  import { getCodeByName } from '@things-factory/code-base'
12
- import {
13
- i18next,
14
- localize
15
- } from '@things-factory/i18n-base'
12
+ import gql from 'graphql-tag'
13
+ import { isMobileDevice } from '@things-factory/utils'
16
14
  import { openImportPopUp } from '@things-factory/import-ui'
17
15
  import { openPopup } from '@things-factory/layout-base'
18
- import {
19
- client,
20
- CustomAlert,
21
- gqlContext,
22
- PageView
23
- } from '@things-factory/shell'
24
- import {
25
- CommonButtonStyles,
26
- ScrollbarStyles
27
- } from '@things-factory/styles'
28
- import { isMobileDevice } from '@things-factory/utils'
29
-
30
- import { PICKING_STRATEGIES } from './constants/picking-strategy'
31
16
 
32
17
  class ProductList extends localize(i18next)(PageView) {
33
18
  static get properties() {
@@ -6,7 +6,7 @@ import { client, CustomAlert, gqlContext } from '@things-factory/shell'
6
6
  import { ScrollbarStyles } from '@things-factory/styles'
7
7
  import { isMobileDevice } from '@things-factory/utils'
8
8
  import gql from 'graphql-tag'
9
- import { css, html, LitElement } from 'lit-element'
9
+ import { css, html, LitElement } from 'lit'
10
10
 
11
11
  export class ProductSetLinkPopup extends localize(i18next)(LitElement) {
12
12
  static get styles() {
@@ -8,7 +8,7 @@ import { client, CustomAlert, gqlContext, PageView } from '@things-factory/shell
8
8
  import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
9
9
  import { isMobileDevice } from '@things-factory/utils'
10
10
  import gql from 'graphql-tag'
11
- import { css, html } from 'lit-element'
11
+ import { css, html } from 'lit'
12
12
  import './product-set-link-popup'
13
13
 
14
14
  class ProductSetList extends localize(i18next)(PageView) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/product-ui",
3
- "version": "4.2.0",
3
+ "version": "4.3.0-alpha.1",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -24,13 +24,13 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
25
25
  },
26
26
  "dependencies": {
27
- "@things-factory/form-ui": "^4.1.40",
28
- "@things-factory/grist-ui": "^4.1.40",
29
- "@things-factory/i18n-base": "^4.1.40",
30
- "@things-factory/import-ui": "^4.1.40",
31
- "@things-factory/layout-base": "^4.1.40",
32
- "@things-factory/product-base": "^4.2.0",
33
- "@things-factory/shell": "^4.1.40"
27
+ "@things-factory/form-ui": "^4.3.0-alpha.1",
28
+ "@things-factory/grist-ui": "^4.3.0-alpha.1",
29
+ "@things-factory/i18n-base": "^4.3.0-alpha.1",
30
+ "@things-factory/import-ui": "^4.3.0-alpha.1",
31
+ "@things-factory/layout-base": "^4.3.0-alpha.1",
32
+ "@things-factory/product-base": "^4.3.0-alpha.1",
33
+ "@things-factory/shell": "^4.3.0-alpha.1"
34
34
  },
35
- "gitHead": "ea20ff47ca0caa48313ae9d7c527e866f7eb1571"
35
+ "gitHead": "f0cd9687bd124099c3aaa4f669f5445d48bfeb5e"
36
36
  }