@pisell/materials 1.0.309 → 2.2.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.
@@ -81,10 +81,7 @@ export declare const setTableSettingToLocalStorage: ({ tableId, tableSettingObj,
81
81
  }>;
82
82
  currentViewMode: ModeType;
83
83
  currentSettingHash: string;
84
- }) => {
85
- key: string;
86
- value: Record<string, any>;
87
- } | undefined;
84
+ }) => void;
88
85
  export declare const clearTableSettingToLocalStorage: (tableId?: string) => void;
89
86
  /**
90
87
  * 从本地存储中获取表格设置, 全部配置
@@ -115,16 +112,7 @@ export declare const setFormValuesToLocalStorage: ({ tableId, allValues, keys, c
115
112
  keys?: string[] | undefined;
116
113
  currentViewMode: ModeType;
117
114
  currentSettingHash: string;
118
- }) => {
119
- key: string;
120
- value: Record<string, any>;
121
- } | undefined;
122
- /**
123
- * 获取表格键值
124
- * @param tableId 表格ID
125
- * @returns 返回格式化后的表格键值
126
- */
127
- export declare const getTableKey: (tableId: string) => string;
115
+ }) => void;
128
116
  /**
129
117
  * 合并筛选设置
130
118
  * @param list 列表数据
@@ -271,10 +271,6 @@ export var setTableSettingToLocalStorage = function setTableSettingToLocalStorag
271
271
  currentSettingHash: currentSettingHash
272
272
  }, currentViewMode, _objectSpread(_objectSpread({}, newData[currentViewMode] || {}), itemSetting)));
273
273
  localStorage.setItem(getTableKey(tableId), JSON.stringify(newData));
274
- return {
275
- key: getTableKey(tableId),
276
- value: newData
277
- };
278
274
  };
279
275
  export var clearTableSettingToLocalStorage = function clearTableSettingToLocalStorage(tableId) {
280
276
  if (!tableId) return;
@@ -331,7 +327,7 @@ export var setFormValuesToLocalStorage = function setFormValuesToLocalStorage(_r
331
327
  keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) {
332
328
  obj[key] = allValues === null || allValues === void 0 ? void 0 : allValues[key];
333
329
  });
334
- return setTableSettingToLocalStorage({
330
+ setTableSettingToLocalStorage({
335
331
  tableId: tableId,
336
332
  tableSettingObj: obj,
337
333
  currentViewMode: currentViewMode,
@@ -344,7 +340,7 @@ export var setFormValuesToLocalStorage = function setFormValuesToLocalStorage(_r
344
340
  * @param tableId 表格ID
345
341
  * @returns 返回格式化后的表格键值
346
342
  */
347
- export var getTableKey = function getTableKey(tableId) {
343
+ var getTableKey = function getTableKey(tableId) {
348
344
  return "".concat(tableKeyPrefix, "-").concat(tableId);
349
345
  };
350
346
 
@@ -6,9 +6,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
7
  import { useMemo } from "react";
8
8
  import { getSettingKeyArrByMode, getTableSettingByCurrentViewMode, getTableSettingFromLocalStorage, mergeColumnSetting, mergeFilterSetting, setFormValuesToLocalStorage } from "../Table/utils";
9
- import useEngineContext from "../../../hooks/useEngineContext";
10
9
  var useTableSetting = function useTableSetting(params) {
11
- var _context$appHelper;
12
10
  var tableId = params.tableId,
13
11
  filter = params.filter,
14
12
  columnSetting = params.columnSetting,
@@ -19,10 +17,6 @@ var useTableSetting = function useTableSetting(params) {
19
17
  propsColumns = params.columns,
20
18
  gallery = params.gallery,
21
19
  currentSettingHash = params.currentSettingHash;
22
- var context = useEngineContext();
23
- var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
24
- isTerminal = _ref.isTerminal,
25
- interaction = _ref.interaction;
26
20
  var columnsMap = useMemo(function () {
27
21
  return new Map(propsColumns.map(function (item) {
28
22
  return [item.key, item];
@@ -43,10 +37,10 @@ var useTableSetting = function useTableSetting(params) {
43
37
  }
44
38
  return propsColumns;
45
39
  }, [propsColumns, currentViewMode, gallery, columnsMap]);
46
- var _ref2 = filter || {},
47
- list = _ref2.list,
48
- quickFilterMaxLength = _ref2.quickFilterMaxLength,
49
- sortButtonShow = _ref2.sortButtonShow;
40
+ var _ref = filter || {},
41
+ list = _ref.list,
42
+ quickFilterMaxLength = _ref.quickFilterMaxLength,
43
+ sortButtonShow = _ref.sortButtonShow;
50
44
  var defaultGalleryCoverSetting = useMemo(function () {
51
45
  var _gallery$cover, _columns$find;
52
46
  return {
@@ -162,29 +156,14 @@ var useTableSetting = function useTableSetting(params) {
162
156
  * @param values
163
157
  */
164
158
  var setTableSetting = function setTableSetting(values) {
165
- var result = setFormValuesToLocalStorage({
159
+ setFormValuesToLocalStorage({
166
160
  tableId: tableId,
167
161
  allValues: values,
168
162
  keys: localStorageSettingKeyArr,
169
163
  currentViewMode: currentViewMode,
170
164
  currentSettingHash: currentSettingHash
171
165
  });
172
- /*
173
- if (isTerminal?.() && result) {
174
- interaction?.utils?.postMessageToApp?.({
175
- module: "global",
176
- key: "local_storage",
177
- data: {
178
- type: "set",
179
- value: {
180
- [result.key]: result.value
181
- },
182
- },
183
- })
184
- }
185
- */
186
166
  };
187
-
188
167
  var tableSetting = useMemo(function () {
189
168
  return _objectSpread(_objectSpread({}, tableLocalSetting), defaultTableSetting);
190
169
  }, [tableLocalSetting, defaultTableSetting]);
package/es/index.d.ts CHANGED
@@ -72,7 +72,6 @@ export { default as List } from "./components/list";
72
72
  export { default as Sort } from "./components/sort";
73
73
  export { default as InputNumberRange } from "./components/input-number-range";
74
74
  export { default as LowCodePage } from "./components/lowCodePage";
75
- export { default as PickerView } from "./components/picker-view";
76
75
  export { default as Segmented } from "./components/segmented";
77
76
  export { default as VirtualKeyboard } from "./components/virtual-keyboard";
78
77
  export { default as VirtualKeyboardTime } from "./components/virtual-keyboard/Time";
package/es/index.js CHANGED
@@ -92,7 +92,6 @@ export { default as List } from "./components/list";
92
92
  export { default as Sort } from "./components/sort";
93
93
  export { default as InputNumberRange } from "./components/input-number-range";
94
94
  export { default as LowCodePage } from "./components/lowCodePage";
95
- export { default as PickerView } from "./components/picker-view";
96
95
  export { default as Segmented } from "./components/segmented";
97
96
  export { default as VirtualKeyboard } from "./components/virtual-keyboard";
98
97
  export { default as VirtualKeyboardTime } from "./components/virtual-keyboard/Time";
@@ -81,10 +81,7 @@ export declare const setTableSettingToLocalStorage: ({ tableId, tableSettingObj,
81
81
  }>;
82
82
  currentViewMode: ModeType;
83
83
  currentSettingHash: string;
84
- }) => {
85
- key: string;
86
- value: Record<string, any>;
87
- } | undefined;
84
+ }) => void;
88
85
  export declare const clearTableSettingToLocalStorage: (tableId?: string) => void;
89
86
  /**
90
87
  * 从本地存储中获取表格设置, 全部配置
@@ -115,16 +112,7 @@ export declare const setFormValuesToLocalStorage: ({ tableId, allValues, keys, c
115
112
  keys?: string[] | undefined;
116
113
  currentViewMode: ModeType;
117
114
  currentSettingHash: string;
118
- }) => {
119
- key: string;
120
- value: Record<string, any>;
121
- } | undefined;
122
- /**
123
- * 获取表格键值
124
- * @param tableId 表格ID
125
- * @returns 返回格式化后的表格键值
126
- */
127
- export declare const getTableKey: (tableId: string) => string;
115
+ }) => void;
128
116
  /**
129
117
  * 合并筛选设置
130
118
  * @param list 列表数据
@@ -36,7 +36,6 @@ __export(utils_exports, {
36
36
  getHash: () => getHash,
37
37
  getIdByRowKey: () => getIdByRowKey,
38
38
  getSettingKeyArrByMode: () => getSettingKeyArrByMode,
39
- getTableKey: () => getTableKey,
40
39
  getTableSettingByCurrentViewMode: () => getTableSettingByCurrentViewMode,
41
40
  getTableSettingFromLocalStorage: () => getTableSettingFromLocalStorage,
42
41
  groupDataSource: () => groupDataSource,
@@ -271,10 +270,6 @@ var setTableSettingToLocalStorage = ({
271
270
  }
272
271
  };
273
272
  localStorage.setItem(getTableKey(tableId), JSON.stringify(newData));
274
- return {
275
- key: getTableKey(tableId),
276
- value: newData
277
- };
278
273
  };
279
274
  var clearTableSettingToLocalStorage = (tableId) => {
280
275
  if (!tableId)
@@ -311,7 +306,7 @@ var setFormValuesToLocalStorage = ({
311
306
  keys == null ? void 0 : keys.forEach((key) => {
312
307
  obj[key] = allValues == null ? void 0 : allValues[key];
313
308
  });
314
- return setTableSettingToLocalStorage({
309
+ setTableSettingToLocalStorage({
315
310
  tableId,
316
311
  tableSettingObj: obj,
317
312
  currentViewMode,
@@ -465,7 +460,6 @@ var stringify = (obj) => {
465
460
  getHash,
466
461
  getIdByRowKey,
467
462
  getSettingKeyArrByMode,
468
- getTableKey,
469
463
  getTableSettingByCurrentViewMode,
470
464
  getTableSettingFromLocalStorage,
471
465
  groupDataSource,
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
 
29
19
  // src/components/table/hooks/useTableSetting.ts
@@ -34,9 +24,7 @@ __export(useTableSetting_exports, {
34
24
  module.exports = __toCommonJS(useTableSetting_exports);
35
25
  var import_react = require("react");
36
26
  var import_utils = require("../Table/utils");
37
- var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
38
27
  var useTableSetting = (params) => {
39
- var _a;
40
28
  const {
41
29
  tableId,
42
30
  filter,
@@ -49,29 +37,27 @@ var useTableSetting = (params) => {
49
37
  gallery,
50
38
  currentSettingHash
51
39
  } = params;
52
- const context = (0, import_useEngineContext.default)();
53
- const { isTerminal, interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
54
40
  const columnsMap = (0, import_react.useMemo)(() => {
55
41
  return new Map(propsColumns.map((item) => [item.key, item]));
56
42
  }, [propsColumns]);
57
43
  const columns = (0, import_react.useMemo)(() => {
58
- var _a2;
44
+ var _a;
59
45
  if (currentViewMode === "grid") {
60
46
  return propsColumns;
61
47
  } else if (currentViewMode === "gallery") {
62
- return (((_a2 = gallery == null ? void 0 : gallery.content) == null ? void 0 : _a2.fields) || []).filter((item) => item.show).map((item) => columnsMap.get(item.columnKey)).filter(Boolean);
48
+ return (((_a = gallery == null ? void 0 : gallery.content) == null ? void 0 : _a.fields) || []).filter((item) => item.show).map((item) => columnsMap.get(item.columnKey)).filter(Boolean);
63
49
  }
64
50
  return propsColumns;
65
51
  }, [propsColumns, currentViewMode, gallery, columnsMap]);
66
52
  const { list, quickFilterMaxLength, sortButtonShow } = filter || {};
67
53
  const defaultGalleryCoverSetting = (0, import_react.useMemo)(() => {
68
- var _a2, _b;
54
+ var _a, _b;
69
55
  return {
70
- coverObjectFit: (_a2 = gallery == null ? void 0 : gallery.cover) == null ? void 0 : _a2.objectFit,
56
+ coverObjectFit: (_a = gallery == null ? void 0 : gallery.cover) == null ? void 0 : _a.objectFit,
71
57
  coverField: (_b = columns.find(
72
58
  (column) => {
73
- var _a3, _b2;
74
- return column.key === ((_b2 = (_a3 = gallery == null ? void 0 : gallery.cover) == null ? void 0 : _a3.fields) == null ? void 0 : _b2[0]);
59
+ var _a2, _b2;
60
+ return column.key === ((_b2 = (_a2 = gallery == null ? void 0 : gallery.cover) == null ? void 0 : _a2.fields) == null ? void 0 : _b2[0]);
75
61
  }
76
62
  )) == null ? void 0 : _b.dataIndex,
77
63
  compactMode: "default",
@@ -115,7 +101,7 @@ var useTableSetting = (params) => {
115
101
  );
116
102
  const mergedSetting = { ...allSetting, ...currentViewModeSetting };
117
103
  localStorageSettingKeyArr.forEach((item) => {
118
- var _a2, _b, _c, _d;
104
+ var _a, _b, _c, _d;
119
105
  if (item === "view_mode") {
120
106
  setting[item] = view.multiple ? (mergedSetting == null ? void 0 : mergedSetting[item]) || view.defaultViewMode : view.defaultViewMode;
121
107
  } else if (item === "filter_setting") {
@@ -136,7 +122,7 @@ var useTableSetting = (params) => {
136
122
  setting[item] = {
137
123
  ...mergedSetting == null ? void 0 : mergedSetting[item],
138
124
  // 本地没有默认封面效果时取配置中的
139
- coverObjectFit: ((_a2 = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _a2.coverObjectFit) || defaultGalleryCoverSetting.coverObjectFit,
125
+ coverObjectFit: ((_a = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _a.coverObjectFit) || defaultGalleryCoverSetting.coverObjectFit,
140
126
  coverField: ((_b = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _b.coverField) || defaultGalleryCoverSetting.coverField,
141
127
  compactMode: ((_c = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _c.compactMode) || defaultGalleryCoverSetting.compactMode,
142
128
  isShowLabel: ((_d = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _d.isShowLabel) ?? defaultGalleryCoverSetting.isShowLabel
@@ -199,7 +185,7 @@ var useTableSetting = (params) => {
199
185
  sortButtonShow
200
186
  ]);
201
187
  const setTableSetting = (values) => {
202
- const result = (0, import_utils.setFormValuesToLocalStorage)({
188
+ (0, import_utils.setFormValuesToLocalStorage)({
203
189
  tableId,
204
190
  allValues: values,
205
191
  keys: localStorageSettingKeyArr,
package/lib/index.d.ts CHANGED
@@ -72,7 +72,6 @@ export { default as List } from "./components/list";
72
72
  export { default as Sort } from "./components/sort";
73
73
  export { default as InputNumberRange } from "./components/input-number-range";
74
74
  export { default as LowCodePage } from "./components/lowCodePage";
75
- export { default as PickerView } from "./components/picker-view";
76
75
  export { default as Segmented } from "./components/segmented";
77
76
  export { default as VirtualKeyboard } from "./components/virtual-keyboard";
78
77
  export { default as VirtualKeyboardTime } from "./components/virtual-keyboard/Time";
package/lib/index.js CHANGED
@@ -71,7 +71,6 @@ __export(src_exports, {
71
71
  Modal: () => import_modal.default,
72
72
  Page: () => import_page.default,
73
73
  Pagination: () => import_antd22.Pagination,
74
- PickerView: () => import_picker_view.default,
75
74
  Popconfirm: () => import_antd23.Popconfirm,
76
75
  Popover: () => import_antd24.Popover,
77
76
  Progress: () => import_antd25.Progress,
@@ -186,7 +185,6 @@ var import_list = __toESM(require("./components/list"));
186
185
  var import_sort = __toESM(require("./components/sort"));
187
186
  var import_input_number_range = __toESM(require("./components/input-number-range"));
188
187
  var import_lowCodePage = __toESM(require("./components/lowCodePage"));
189
- var import_picker_view = __toESM(require("./components/picker-view"));
190
188
  var import_segmented = __toESM(require("./components/segmented"));
191
189
  var import_virtual_keyboard = __toESM(require("./components/virtual-keyboard"));
192
190
  var import_Time = __toESM(require("./components/virtual-keyboard/Time"));
@@ -237,7 +235,6 @@ var import_batch_editor = __toESM(require("./components/batch-editor"));
237
235
  Modal,
238
236
  Page,
239
237
  Pagination,
240
- PickerView,
241
238
  Popconfirm,
242
239
  Popover,
243
240
  Progress,
@@ -15,12 +15,12 @@ export const itemsExtraProps = {
15
15
  });
16
16
  return result;
17
17
  });
18
- console.log(map,'map');
19
18
  return map.length === 0 ? fieldValue : map;
20
19
  },
21
20
  setValue(target, value) {
22
21
  const { node } = target;
23
22
  const map = {};
23
+
24
24
  if (!Array.isArray(value)) {
25
25
  value = [];
26
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.309",
3
+ "version": "2.2.2",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -58,13 +58,12 @@
58
58
  "@dnd-kit/utilities": "^3.2.1",
59
59
  "ahooks": "^3.7.6",
60
60
  "react-infinite-scroll-component": "^6.1.0",
61
- "antd-mobile": "^5.34.0",
62
61
  "react-window": "^1.8.10",
63
62
  "react-virtualized-auto-sizer": "^1.0.20",
64
63
  "crypto-js": "^4.2.0",
65
- "@pisell/icon": "0.0.8",
66
- "@pisell/date-picker": "1.0.75",
67
- "@pisell/utils": "1.0.27"
64
+ "@pisell/utils": "1.0.25",
65
+ "@pisell/date-picker": "1.0.74",
66
+ "@pisell/icon": "0.0.8"
68
67
  },
69
68
  "peerDependencies": {
70
69
  "react": "^18.0.0",
@@ -1,2 +0,0 @@
1
- import PickerView from 'antd-mobile/es/components/picker-view';
2
- export default PickerView;
@@ -1,2 +0,0 @@
1
- import PickerView from 'antd-mobile/es/components/picker-view';
2
- export default PickerView;
@@ -1,2 +0,0 @@
1
- import PickerView from 'antd-mobile/es/components/picker-view';
2
- export default PickerView;
@@ -1,36 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/picker-view/index.tsx
30
- var picker_view_exports = {};
31
- __export(picker_view_exports, {
32
- default: () => picker_view_default
33
- });
34
- module.exports = __toCommonJS(picker_view_exports);
35
- var import_picker_view = __toESM(require("antd-mobile/es/components/picker-view"));
36
- var picker_view_default = import_picker_view.default;
@@ -1,206 +0,0 @@
1
- import { uuid } from '../_utils/utils';
2
-
3
- import snippets from './snippets';
4
-
5
- export default {
6
- snippets,
7
- componentName: 'PickerView',
8
- title: '选择器视图',
9
- category: '表单',
10
- docUrl: "",
11
- screenshot: "",
12
- devMode: "proCode",
13
- npm: {
14
- package: "@pisell/materials",
15
- version: "1.0.1",
16
- exportName: "PickerView",
17
- main: "src/index.tsx",
18
- destructuring: true,
19
- subName: "",
20
- },
21
- props: [
22
- {
23
- name: 'defaultValue',
24
- title: { label: '默认值', tip: '默认选中值' },
25
- propType: {
26
- type: 'oneOfType',
27
- value: [
28
- { type: 'arrayOf', value: 'string' },
29
- { type: 'arrayOf', value: 'number' },
30
- ],
31
- },
32
- },
33
- {
34
- name: 'value',
35
- title: { label: '当前值', tip: '当前值' },
36
- propType: {
37
- type: 'oneOfType',
38
- value: [
39
- { type: 'arrayOf', value: 'string' },
40
- { type: 'arrayOf', value: 'number' },
41
- ],
42
- },
43
- },
44
- {
45
- name: 'columns',
46
- title: { label: '可选项', tip: '可选项' },
47
- propType: {
48
- type: 'arrayOf',
49
- value: {
50
- type: 'shape',
51
- value: [
52
- {
53
- name: 'label',
54
- propType: 'string',
55
- description: '选项名',
56
- defaultValue: '选项名',
57
- },
58
- {
59
- name: 'value',
60
- propType: ['string', 'number'],
61
- description: '选项值',
62
- defaultValue: '选项值',
63
- },
64
- ],
65
- },
66
- },
67
- setter: {
68
- componentName: 'ArraySetter',
69
- props: {
70
- itemSetter: {
71
- componentName: 'ObjectSetter',
72
- props: {
73
- itemSetter: {
74
- componentName: 'StringSetter',
75
- }
76
- },
77
- initialValue: () => {
78
- return [
79
- {
80
- label: '选项名',
81
- value: uuid(),
82
- },
83
- {
84
- label: '选项名1',
85
- value: uuid(),
86
- },
87
- {
88
- label: '选项名2',
89
- value: uuid(),
90
- },
91
- {
92
- label: '选项名3',
93
- value: uuid(),
94
- },
95
- {
96
- label: '选项名4',
97
- value: uuid(),
98
- },
99
- {
100
- label: '选项名5',
101
- value: uuid(),
102
- }
103
- ]
104
- },
105
- },
106
- },
107
- },
108
- },
109
- {
110
- name: 'className',
111
- title: { label: '选择器类名', tip: '选择器类名' },
112
- propType: 'string',
113
- setter: 'StringSetter'
114
- },
115
- {
116
- name: 'mouseWheel',
117
- title: { label: '鼠标滚轮选择', tip: '是否允许通过鼠标滚轮进行选择' },
118
- propType: 'bool',
119
- defaultValue: false,
120
- setter: 'BoolSetter'
121
- },
122
- {
123
- name: 'onChange',
124
- title: {
125
- label: '选中回调函数',
126
- tip: '选中 option,或 input 的 value 变化时,调用此函数',
127
- },
128
- propType: 'func',
129
- },
130
- {
131
- name: 'loading',
132
- title: { label: '加载中', tip: '加载中状态' },
133
- propType: 'bool',
134
- defaultValue: false,
135
- setter: 'BoolSetter'
136
- },
137
- {
138
- name: 'renderLabel',
139
- title: { label: '自定义渲染', tip: '自定义渲染每列展示的内容' },
140
- propType: 'func',
141
- },
142
- {
143
- name: 'loadingContent',
144
- title: { label: '加载状态内容', tip: '加载状态下展示的内容' },
145
- propType: 'func',
146
- },
147
- ],
148
- configure: {
149
- supports: {
150
- style: true,
151
- events: [
152
- {
153
- name: 'onBlur',
154
- template: "onBlur(${extParams}){\n// 失去焦点时回调\nconsole.log('onBlur');}",
155
- },
156
- {
157
- name: 'onChange',
158
- template:
159
- "onChange(value,option,${extParams}){\n// 选中 option,或 input 的 value 变化时,调用此函数\nconsole.log('onChange',value,option);}",
160
- },
161
- {
162
- name: 'onDeselect',
163
- template:
164
- "onDeselect(value,${extParams}){\n// 取消选中时调用\nconsole.log('onDeselect',value);}",
165
- },
166
- {
167
- name: 'onFocus',
168
- template: "onFocus(${extParams}){\n// 获得焦点时回调\nconsole.log('onFocus');}",
169
- },
170
- {
171
- name: 'onInputKeyDown',
172
- template:
173
- "onInputKeyDown(${extParams}){\n// 按键按下时回调\nconsole.log('onInputKeyDown');}",
174
- },
175
- {
176
- name: 'onMouseEnter',
177
- template: "onMouseEnter(${extParams}){\n// 鼠标移入时回调\nconsole.log('onMouseEnter');}",
178
- },
179
- {
180
- name: 'onMouseLeave',
181
- template: "onMouseLeave(${extParams}){\n// 鼠标移出时回调\nconsole.log('onMouseLeave');}",
182
- },
183
- {
184
- name: 'onPopupScroll',
185
- template:
186
- "onPopupScroll(${extParams}){\n// 下拉列表滚动时的回调\nconsole.log('onPopupScroll');}",
187
- },
188
- {
189
- name: 'onSearch',
190
- template:
191
- "onSearch(value,${extParams}){\n// 文本框值变化时回调\nconsole.log('onSearch',value);}",
192
- },
193
- {
194
- name: 'onSelect',
195
- template:
196
- "onSelect(value,option,${extParams}){\n// 被选中时调用\nconsole.log('onSelect',value,option);}",
197
- },
198
- {
199
- name: 'onDropdownVisibleChange',
200
- template:
201
- "onDropdownVisibleChange(open,${extParams}){\n// 展开下拉菜单的回调\nconsole.log('onDropdownVisibleChange',open);}",
202
- },
203
- ],
204
- },
205
- },
206
- };
@@ -1,24 +0,0 @@
1
- export default [
2
- {
3
- title: '选择器视图',
4
- screenshot: '',
5
- schema: {
6
- componentName: 'PickerView',
7
- props: {
8
- columns: [
9
- [
10
- { label: '周一', value: 'Mon' },
11
- { label: '周二', value: 'Tues' },
12
- { label: '周三', value: 'Wed' },
13
- { label: '周四', value: 'Thur' },
14
- { label: '周五', value: 'Fri' },
15
- ],
16
- [
17
- { label: '上午', value: 'am' },
18
- { label: '下午', value: 'pm' },
19
- ],
20
- ]
21
- },
22
- },
23
- },
24
- ];