@nocobase/plugin-snapshot-field 0.9.0-alpha.1 → 0.9.0-alpha.2

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.
@@ -5,28 +5,26 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useSnapshotInterface = void 0;
7
7
 
8
- function _lodash() {
9
- const data = require("lodash");
8
+ function _client() {
9
+ const data = require("@nocobase/client");
10
10
 
11
- _lodash = function _lodash() {
11
+ _client = function _client() {
12
12
  return data;
13
13
  };
14
14
 
15
15
  return data;
16
16
  }
17
17
 
18
- function _client() {
19
- const data = require("@nocobase/client");
18
+ function _lodash() {
19
+ const data = require("lodash");
20
20
 
21
- _client = function _client() {
21
+ _lodash = function _lodash() {
22
22
  return data;
23
23
  };
24
24
 
25
25
  return data;
26
26
  }
27
27
 
28
- var _locale = require("./locale");
29
-
30
28
  function _react() {
31
29
  const data = require("react");
32
30
 
@@ -37,6 +35,8 @@ function _react() {
37
35
  return data;
38
36
  }
39
37
 
38
+ var _locale = require("./locale");
39
+
40
40
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
41
41
 
42
42
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -127,7 +127,7 @@ const useSnapshotInterface = () => {
127
127
  properties: _objectSpread(_objectSpread({}, defaultProps), {}, {
128
128
  target: {
129
129
  type: 'string',
130
- title: t('Related collection'),
130
+ title: t('Target collection'),
131
131
  required: true,
132
132
  'x-reactions': ['{{useAsyncDataSource(loadCollections)}}'],
133
133
  'x-decorator': 'FormItem',
@@ -5,6 +5,6 @@ declare const _default: {
5
5
  'Add block': string;
6
6
  'Allow linking to multiple records': string;
7
7
  'Snapshot to description': string;
8
- 'Related collection': string;
8
+ 'Target collection': string;
9
9
  };
10
10
  export default _default;
@@ -11,6 +11,6 @@ var _default = {
11
11
  'Add block': 'Add block',
12
12
  'Allow linking to multiple records': 'Allow linking to multiple records',
13
13
  'Snapshot to description': 'It is used to create a snapshot of the table, save the current data of the pointed table, and save it only when the record to which it belongs is created, and will not be updated later.',
14
- 'Related collection': 'Related collection'
14
+ 'Target collection': 'Target collection'
15
15
  };
16
16
  exports.default = _default;
@@ -27,31 +27,14 @@ function _reactI18next() {
27
27
  return data;
28
28
  }
29
29
 
30
- var _enUS = _interopRequireDefault(require("./en-US"));
30
+ const NAMESPACE = 'snapshot-field'; // i18n.addResources('zh-CN', NAMESPACE, zhCN);
31
+ // i18n.addResources('en-US', NAMESPACE, enUS);
32
+ // i18n.addResources('ja-JP', NAMESPACE, jaJP);
33
+ // i18n.addResources('ru-RU', NAMESPACE, ruRU);
34
+ // i18n.addResources('tr-TR', NAMESPACE, trTR);
31
35
 
32
- var _jaJP = _interopRequireDefault(require("./ja-JP"));
33
-
34
- var _ruRU = _interopRequireDefault(require("./ru-RU"));
35
-
36
- var _trTR = _interopRequireDefault(require("./tr-TR"));
37
-
38
- var _zhCN = _interopRequireDefault(require("./zh-CN"));
39
-
40
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
-
42
- const NAMESPACE = 'snapshot-field';
43
36
  exports.NAMESPACE = NAMESPACE;
44
37
 
45
- _client().i18n.addResources('zh-CN', NAMESPACE, _zhCN.default);
46
-
47
- _client().i18n.addResources('en-US', NAMESPACE, _enUS.default);
48
-
49
- _client().i18n.addResources('ja-JP', NAMESPACE, _jaJP.default);
50
-
51
- _client().i18n.addResources('ru-RU', NAMESPACE, _ruRU.default);
52
-
53
- _client().i18n.addResources('tr-TR', NAMESPACE, _trTR.default);
54
-
55
38
  function lang(key) {
56
39
  return _client().i18n.t(key, {
57
40
  ns: NAMESPACE
@@ -5,6 +5,6 @@ declare const _default: {
5
5
  'Snapshot to description': string;
6
6
  'View record': string;
7
7
  'Allow linking to multiple records': string;
8
- 'Related collection': string;
8
+ 'Target collection': string;
9
9
  };
10
10
  export default _default;
@@ -11,6 +11,6 @@ var _default = {
11
11
  'Snapshot to description': '用于创建表的快照,保存指向的表的当前数据,仅在其所属的记录创建时保存,后续不再更新。',
12
12
  'View record': '查看数据',
13
13
  'Allow linking to multiple records': '允许关联多条记录',
14
- 'Related collection': '关系表'
14
+ 'Target collection': '关系表'
15
15
  };
16
16
  exports.default = _default;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-snapshot-field",
3
- "version": "0.9.0-alpha.1",
3
+ "version": "0.9.0-alpha.2",
4
4
  "description": "",
5
5
  "license": "AGPL-3.0",
6
6
  "main": "./lib/index.js",
7
7
  "types": "./lib/index.d.ts",
8
8
  "devDependencies": {
9
- "@nocobase/server": "0.9.0-alpha.1",
10
- "@nocobase/test": "0.9.0-alpha.1"
9
+ "@nocobase/server": "0.9.0-alpha.2",
10
+ "@nocobase/test": "0.9.0-alpha.2"
11
11
  },
12
- "gitHead": "d84c2a47c42c2ffec4fbf317d53268952fbd58d7"
12
+ "gitHead": "b8f76ad38e60e677c5bb4aab0a4cdb28d98a0f49"
13
13
  }
@@ -1,9 +1,8 @@
1
1
  import { ISchema } from '@formily/react';
2
- import { IField } from '@nocobase/client';
2
+ import { IField, interfacesProperties } from '@nocobase/client';
3
3
  import { cloneDeep } from 'lodash';
4
- import { interfacesProperties } from '@nocobase/client';
5
- import { useSnapshotTranslation } from './locale';
6
4
  import { useMemo } from 'react';
5
+ import { useSnapshotTranslation } from './locale';
7
6
 
8
7
  const { defaultProps, recordPickerSelector } = interfacesProperties;
9
8
 
@@ -82,7 +81,7 @@ export const useSnapshotInterface = () => {
82
81
  ...defaultProps,
83
82
  target: {
84
83
  type: 'string',
85
- title: t('Related collection'),
84
+ title: t('Target collection'),
86
85
  required: true,
87
86
  'x-reactions': ['{{useAsyncDataSource(loadCollections)}}'],
88
87
  'x-decorator': 'FormItem',
@@ -6,5 +6,5 @@ export default {
6
6
  'Allow linking to multiple records': 'Allow linking to multiple records',
7
7
  'Snapshot to description':
8
8
  'It is used to create a snapshot of the table, save the current data of the pointed table, and save it only when the record to which it belongs is created, and will not be updated later.',
9
- 'Related collection': 'Related collection',
9
+ 'Target collection': 'Target collection',
10
10
  };
@@ -1,19 +1,14 @@
1
1
  import { i18n } from '@nocobase/client';
2
2
  import { useTranslation } from 'react-i18next';
3
3
 
4
- import enUS from './en-US';
5
- import jaJP from './ja-JP';
6
- import ruRU from './ru-RU';
7
- import trTR from './tr-TR';
8
- import zhCN from './zh-CN';
9
4
 
10
5
  export const NAMESPACE = 'snapshot-field';
11
6
 
12
- i18n.addResources('zh-CN', NAMESPACE, zhCN);
13
- i18n.addResources('en-US', NAMESPACE, enUS);
14
- i18n.addResources('ja-JP', NAMESPACE, jaJP);
15
- i18n.addResources('ru-RU', NAMESPACE, ruRU);
16
- i18n.addResources('tr-TR', NAMESPACE, trTR);
7
+ // i18n.addResources('zh-CN', NAMESPACE, zhCN);
8
+ // i18n.addResources('en-US', NAMESPACE, enUS);
9
+ // i18n.addResources('ja-JP', NAMESPACE, jaJP);
10
+ // i18n.addResources('ru-RU', NAMESPACE, ruRU);
11
+ // i18n.addResources('tr-TR', NAMESPACE, trTR);
17
12
 
18
13
  export function lang(key: string) {
19
14
  return i18n.t(key, { ns: NAMESPACE });
@@ -5,5 +5,5 @@ export default {
5
5
  'Snapshot to description': '用于创建表的快照,保存指向的表的当前数据,仅在其所属的记录创建时保存,后续不再更新。',
6
6
  'View record': '查看数据',
7
7
  'Allow linking to multiple records': '允许关联多条记录',
8
- 'Related collection': '关系表',
8
+ 'Target collection': '关系表',
9
9
  };