@plasmicpkgs/antd5 0.0.28 → 0.0.30
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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/antd.esm.js +1179 -1050
- package/dist/antd.esm.js.map +1 -1
- package/dist/index.js +1177 -1048
- package/dist/react-utils.d.ts +21 -0
- package/dist/registerDropdown.d.ts +3 -0
- package/dist/registerForm.d.ts +1 -1
- package/dist/registerMenu.d.ts +10 -0
- package/dist/registerSelect.d.ts +2 -0
- package/package.json +3 -3
- package/skinny/react-utils.d.ts +21 -0
- package/skinny/registerButton.js +4 -0
- package/skinny/registerButton.js.map +1 -1
- package/skinny/registerConfigProvider.js +2 -1
- package/skinny/registerConfigProvider.js.map +1 -1
- package/skinny/registerDropdown.d.ts +3 -0
- package/skinny/registerDropdown.js.map +1 -1
- package/skinny/registerForm.d.ts +1 -1
- package/skinny/registerForm.js +352 -49
- package/skinny/registerForm.js.map +1 -1
- package/skinny/registerMenu.d.ts +10 -0
- package/skinny/registerMenu.js +26 -23
- package/skinny/registerMenu.js.map +1 -1
- package/skinny/registerSelect.d.ts +2 -0
- package/skinny/registerSelect.js +101 -11
- package/skinny/registerSelect.js.map +1 -1
- package/dist/registerTable.d.ts +0 -26
- package/skinny/registerTable.d.ts +0 -26
package/dist/index.js
CHANGED
|
@@ -20,14 +20,14 @@ var Form = require('antd/lib/form');
|
|
|
20
20
|
var FormItem = require('antd/lib/form/FormItem');
|
|
21
21
|
var FormList = require('antd/lib/form/FormList');
|
|
22
22
|
var equal = require('fast-deep-equal');
|
|
23
|
+
var classNames = require('classnames');
|
|
24
|
+
var Input = require('antd/lib/input');
|
|
25
|
+
var InputNumber = require('antd/lib/input-number');
|
|
23
26
|
var Modal = require('antd/lib/modal');
|
|
24
27
|
var Radio = require('antd/lib/radio');
|
|
25
28
|
var RadioGroup = require('antd/lib/radio/group');
|
|
26
29
|
require('antd/lib/radio/radioButton');
|
|
27
30
|
var Select = require('antd/lib/select');
|
|
28
|
-
var Table = require('antd/lib/table');
|
|
29
|
-
var Input = require('antd/lib/input');
|
|
30
|
-
var InputNumber = require('antd/lib/input-number');
|
|
31
31
|
|
|
32
32
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
33
33
|
|
|
@@ -49,13 +49,13 @@ var Form__default = /*#__PURE__*/_interopDefault(Form);
|
|
|
49
49
|
var FormItem__default = /*#__PURE__*/_interopDefault(FormItem);
|
|
50
50
|
var FormList__default = /*#__PURE__*/_interopDefault(FormList);
|
|
51
51
|
var equal__default = /*#__PURE__*/_interopDefault(equal);
|
|
52
|
+
var classNames__default = /*#__PURE__*/_interopDefault(classNames);
|
|
53
|
+
var Input__default = /*#__PURE__*/_interopDefault(Input);
|
|
54
|
+
var InputNumber__default = /*#__PURE__*/_interopDefault(InputNumber);
|
|
52
55
|
var Modal__default = /*#__PURE__*/_interopDefault(Modal);
|
|
53
56
|
var Radio__default = /*#__PURE__*/_interopDefault(Radio);
|
|
54
57
|
var RadioGroup__default = /*#__PURE__*/_interopDefault(RadioGroup);
|
|
55
58
|
var Select__default = /*#__PURE__*/_interopDefault(Select);
|
|
56
|
-
var Table__default = /*#__PURE__*/_interopDefault(Table);
|
|
57
|
-
var Input__default = /*#__PURE__*/_interopDefault(Input);
|
|
58
|
-
var InputNumber__default = /*#__PURE__*/_interopDefault(InputNumber);
|
|
59
59
|
|
|
60
60
|
function makeRegisterGlobalContext(component, meta) {
|
|
61
61
|
return function(loader) {
|
|
@@ -90,15 +90,6 @@ function traverseReactEltTree(children, callback) {
|
|
|
90
90
|
};
|
|
91
91
|
rec(children);
|
|
92
92
|
}
|
|
93
|
-
function asArray(x) {
|
|
94
|
-
if (Array.isArray(x)) {
|
|
95
|
-
return x;
|
|
96
|
-
} else if (x == null) {
|
|
97
|
-
return [];
|
|
98
|
-
} else {
|
|
99
|
-
return [x];
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
93
|
function omit(obj, ...keys) {
|
|
103
94
|
if (Object.keys(obj).length === 0) {
|
|
104
95
|
return obj;
|
|
@@ -179,6 +170,10 @@ function registerButton(loader) {
|
|
|
179
170
|
icon: {
|
|
180
171
|
type: "slot",
|
|
181
172
|
hidePlaceholder: true
|
|
173
|
+
},
|
|
174
|
+
onClick: {
|
|
175
|
+
type: "eventHandler",
|
|
176
|
+
argTypes: []
|
|
182
177
|
}
|
|
183
178
|
},
|
|
184
179
|
importPath: "@plasmicpkgs/antd5/skinny/registerButton",
|
|
@@ -499,7 +494,8 @@ function registerTokens(loader) {
|
|
|
499
494
|
const colorIndex = name.indexOf("color");
|
|
500
495
|
const humanName = makeNiceName(colorIndex >= 0 ? name.substring(name.indexOf("color") + "color".length) : name);
|
|
501
496
|
return {
|
|
502
|
-
name
|
|
497
|
+
name,
|
|
498
|
+
displayName: `System: ${humanName}`,
|
|
503
499
|
value: `var(--antd-${name})`,
|
|
504
500
|
type: "color"
|
|
505
501
|
};
|
|
@@ -929,8 +925,6 @@ function registerDropdown(loader) {
|
|
|
929
925
|
}
|
|
930
926
|
|
|
931
927
|
var __defProp$5 = Object.defineProperty;
|
|
932
|
-
var __defProps$4 = Object.defineProperties;
|
|
933
|
-
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
934
928
|
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
935
929
|
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
936
930
|
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
@@ -946,19 +940,115 @@ var __spreadValues$5 = (a, b) => {
|
|
|
946
940
|
}
|
|
947
941
|
return a;
|
|
948
942
|
};
|
|
943
|
+
const isBrowser = typeof window !== "undefined";
|
|
944
|
+
const NONE = Symbol("NONE");
|
|
945
|
+
isBrowser ? React__default.default.useLayoutEffect : React__default.default.useEffect;
|
|
946
|
+
function mergeProps(props, ...restProps) {
|
|
947
|
+
if (restProps.every((rest) => Object.keys(rest).length === 0)) {
|
|
948
|
+
return props;
|
|
949
|
+
}
|
|
950
|
+
const result = __spreadValues$5({}, props);
|
|
951
|
+
for (const rest of restProps) {
|
|
952
|
+
for (const key of Object.keys(rest)) {
|
|
953
|
+
result[key] = mergePropVals(key, result[key], rest[key]);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
return result;
|
|
957
|
+
}
|
|
958
|
+
function updateRef(ref, value) {
|
|
959
|
+
if (!ref) {
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
if (typeof ref === "function") {
|
|
963
|
+
ref(value);
|
|
964
|
+
} else {
|
|
965
|
+
if (!Object.isFrozen(ref)) {
|
|
966
|
+
ref.current = value;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
function mergeRefs(...refs) {
|
|
971
|
+
return (value) => {
|
|
972
|
+
for (const ref of refs) {
|
|
973
|
+
updateRef(ref, value);
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
function mergePropVals(name, val1, val2) {
|
|
978
|
+
if (val1 === NONE || val2 === NONE) {
|
|
979
|
+
return null;
|
|
980
|
+
} else if (val1 == null) {
|
|
981
|
+
return val2;
|
|
982
|
+
} else if (val2 == null) {
|
|
983
|
+
return val1;
|
|
984
|
+
} else if (name === "className") {
|
|
985
|
+
return classNames__default.default(val1, val2);
|
|
986
|
+
} else if (name === "style") {
|
|
987
|
+
return __spreadValues$5(__spreadValues$5({}, val1), val2);
|
|
988
|
+
} else if (name === "ref") {
|
|
989
|
+
return mergeRefs(val1, val2);
|
|
990
|
+
} else if (typeof val1 !== typeof val2) {
|
|
991
|
+
return val2;
|
|
992
|
+
} else if (name.startsWith("on") && typeof val1 === "function") {
|
|
993
|
+
return (...args) => {
|
|
994
|
+
let res;
|
|
995
|
+
if (typeof val1 === "function") {
|
|
996
|
+
res = val1(...args);
|
|
997
|
+
}
|
|
998
|
+
if (typeof val2 === "function") {
|
|
999
|
+
res = val2(...args);
|
|
1000
|
+
}
|
|
1001
|
+
return res;
|
|
1002
|
+
};
|
|
1003
|
+
} else {
|
|
1004
|
+
return val2;
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
var __defProp$4 = Object.defineProperty;
|
|
1009
|
+
var __defProps$4 = Object.defineProperties;
|
|
1010
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
1011
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
1012
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
1013
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
1014
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1015
|
+
var __spreadValues$4 = (a, b) => {
|
|
1016
|
+
for (var prop in b || (b = {}))
|
|
1017
|
+
if (__hasOwnProp$4.call(b, prop))
|
|
1018
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
1019
|
+
if (__getOwnPropSymbols$4)
|
|
1020
|
+
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
1021
|
+
if (__propIsEnum$4.call(b, prop))
|
|
1022
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
1023
|
+
}
|
|
1024
|
+
return a;
|
|
1025
|
+
};
|
|
949
1026
|
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
1027
|
+
var __objRest$3 = (source, exclude) => {
|
|
1028
|
+
var target = {};
|
|
1029
|
+
for (var prop in source)
|
|
1030
|
+
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1031
|
+
target[prop] = source[prop];
|
|
1032
|
+
if (source != null && __getOwnPropSymbols$4)
|
|
1033
|
+
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
1034
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
1035
|
+
target[prop] = source[prop];
|
|
1036
|
+
}
|
|
1037
|
+
return target;
|
|
1038
|
+
};
|
|
950
1039
|
const PathContext = React__default.default.createContext({ relativePath: [], fullPath: [] });
|
|
951
1040
|
const InternalFormInstanceContext = React__default.default.createContext(void 0);
|
|
952
1041
|
const Internal = (props) => {
|
|
1042
|
+
var _a, _b;
|
|
953
1043
|
const [form] = Form__default.default.useForm();
|
|
954
1044
|
const values = form.getFieldsValue(true);
|
|
955
1045
|
const lastValue = React__default.default.useRef(values);
|
|
956
1046
|
const childrenNode = typeof props.children === "function" ? props.children(values, form) : props.children;
|
|
957
1047
|
const fireOnValuesChange = () => {
|
|
958
|
-
var
|
|
1048
|
+
var _a2;
|
|
959
1049
|
const values2 = form.getFieldsValue(true);
|
|
960
1050
|
if (!equal__default.default(values2, lastValue.current)) {
|
|
961
|
-
(
|
|
1051
|
+
(_a2 = props.extendedOnValuesChange) == null ? void 0 : _a2.call(props, values2);
|
|
962
1052
|
lastValue.current = values2;
|
|
963
1053
|
}
|
|
964
1054
|
};
|
|
@@ -968,20 +1058,23 @@ const Internal = (props) => {
|
|
|
968
1058
|
return /* @__PURE__ */ React__default.default.createElement(InternalFormInstanceContext.Provider, {
|
|
969
1059
|
value: {
|
|
970
1060
|
fireOnValuesChange,
|
|
971
|
-
forceRemount: () => props.setRemountKey((k) => k + 1)
|
|
1061
|
+
forceRemount: () => props.setRemountKey((k) => k + 1),
|
|
1062
|
+
formProps: props
|
|
972
1063
|
}
|
|
973
|
-
}, /* @__PURE__ */ React__default.default.createElement(Form__default.default, __spreadProps$4(__spreadValues$
|
|
1064
|
+
}, /* @__PURE__ */ React__default.default.createElement(Form__default.default, __spreadProps$4(__spreadValues$4({}, props), {
|
|
974
1065
|
onValuesChange: (...args) => {
|
|
975
|
-
var
|
|
976
|
-
(
|
|
977
|
-
(
|
|
1066
|
+
var _a2, _b2;
|
|
1067
|
+
(_a2 = props.onValuesChange) == null ? void 0 : _a2.call(props, ...args);
|
|
1068
|
+
(_b2 = props.extendedOnValuesChange) == null ? void 0 : _b2.call(props, args[1]);
|
|
978
1069
|
},
|
|
979
|
-
form
|
|
1070
|
+
form,
|
|
1071
|
+
labelCol: ((_a = props.labelCol) == null ? void 0 : _a.horizontalOnly) && props.layout !== "horizontal" ? void 0 : props.labelCol,
|
|
1072
|
+
wrapperCol: ((_b = props.wrapperCol) == null ? void 0 : _b.horizontalOnly) && props.layout !== "horizontal" ? void 0 : props.wrapperCol
|
|
980
1073
|
}), childrenNode));
|
|
981
1074
|
};
|
|
982
1075
|
function FormWrapper(props) {
|
|
983
1076
|
const [remountKey, setRemountKey] = React__default.default.useState(0);
|
|
984
|
-
return /* @__PURE__ */ React__default.default.createElement(Internal, __spreadProps$4(__spreadValues$
|
|
1077
|
+
return /* @__PURE__ */ React__default.default.createElement(Internal, __spreadProps$4(__spreadValues$4({
|
|
985
1078
|
key: remountKey
|
|
986
1079
|
}, props), {
|
|
987
1080
|
setRemountKey
|
|
@@ -990,7 +1083,7 @@ function FormWrapper(props) {
|
|
|
990
1083
|
const COMMON_ACTIONS = [
|
|
991
1084
|
{
|
|
992
1085
|
type: "button-action",
|
|
993
|
-
label: "Append new Form
|
|
1086
|
+
label: "Append new Form Item",
|
|
994
1087
|
onClick: ({ studioOps }) => {
|
|
995
1088
|
studioOps.appendToSlot({
|
|
996
1089
|
type: "component",
|
|
@@ -1000,7 +1093,7 @@ const COMMON_ACTIONS = [
|
|
|
1000
1093
|
},
|
|
1001
1094
|
{
|
|
1002
1095
|
type: "button-action",
|
|
1003
|
-
label: "Append new Form
|
|
1096
|
+
label: "Append new Form Group",
|
|
1004
1097
|
onClick: ({ studioOps }) => {
|
|
1005
1098
|
studioOps.appendToSlot({
|
|
1006
1099
|
type: "component",
|
|
@@ -1010,7 +1103,7 @@ const COMMON_ACTIONS = [
|
|
|
1010
1103
|
},
|
|
1011
1104
|
{
|
|
1012
1105
|
type: "button-action",
|
|
1013
|
-
label: "Append new Form
|
|
1106
|
+
label: "Append new Form List",
|
|
1014
1107
|
onClick: ({ studioOps }) => {
|
|
1015
1108
|
studioOps.appendToSlot({
|
|
1016
1109
|
type: "component",
|
|
@@ -1020,6 +1113,33 @@ const COMMON_ACTIONS = [
|
|
|
1020
1113
|
}
|
|
1021
1114
|
];
|
|
1022
1115
|
function registerForm(loader) {
|
|
1116
|
+
const colProp = (displayName, defaultValue) => ({
|
|
1117
|
+
type: "object",
|
|
1118
|
+
displayName,
|
|
1119
|
+
advanced: true,
|
|
1120
|
+
fields: {
|
|
1121
|
+
span: {
|
|
1122
|
+
type: "number",
|
|
1123
|
+
displayName: "Grid columns",
|
|
1124
|
+
description: "The number of grid columns to span (24 columns available)",
|
|
1125
|
+
min: 1,
|
|
1126
|
+
max: 24
|
|
1127
|
+
},
|
|
1128
|
+
offset: {
|
|
1129
|
+
type: "number",
|
|
1130
|
+
displayName: "Offset columns",
|
|
1131
|
+
description: "Number of grid columns to skip from the left",
|
|
1132
|
+
min: 0,
|
|
1133
|
+
max: 23
|
|
1134
|
+
},
|
|
1135
|
+
horizontalOnly: {
|
|
1136
|
+
type: "boolean",
|
|
1137
|
+
displayName: "Horizontal only",
|
|
1138
|
+
description: "Only apply to horizontal layout"
|
|
1139
|
+
}
|
|
1140
|
+
},
|
|
1141
|
+
defaultValue
|
|
1142
|
+
});
|
|
1023
1143
|
registerComponentHelper(loader, FormWrapper, {
|
|
1024
1144
|
name: "plasmic-antd5-form",
|
|
1025
1145
|
displayName: "Form",
|
|
@@ -1029,11 +1149,33 @@ function registerForm(loader) {
|
|
|
1029
1149
|
defaultValue: [
|
|
1030
1150
|
{
|
|
1031
1151
|
type: "component",
|
|
1032
|
-
name: "plasmic-antd5-form-item"
|
|
1152
|
+
name: "plasmic-antd5-form-item",
|
|
1153
|
+
props: {
|
|
1154
|
+
label: {
|
|
1155
|
+
type: "text",
|
|
1156
|
+
value: "Name"
|
|
1157
|
+
},
|
|
1158
|
+
name: "name",
|
|
1159
|
+
children: {
|
|
1160
|
+
type: "component",
|
|
1161
|
+
name: "plasmic-antd5-input"
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1033
1164
|
},
|
|
1034
1165
|
{
|
|
1035
1166
|
type: "component",
|
|
1036
|
-
name: "plasmic-antd5-form-item"
|
|
1167
|
+
name: "plasmic-antd5-form-item",
|
|
1168
|
+
props: {
|
|
1169
|
+
label: {
|
|
1170
|
+
type: "text",
|
|
1171
|
+
value: "Message"
|
|
1172
|
+
},
|
|
1173
|
+
name: "message",
|
|
1174
|
+
children: {
|
|
1175
|
+
type: "component",
|
|
1176
|
+
name: "plasmic-antd5-textarea"
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1037
1179
|
},
|
|
1038
1180
|
{
|
|
1039
1181
|
type: "default-component",
|
|
@@ -1055,21 +1197,51 @@ function registerForm(loader) {
|
|
|
1055
1197
|
layout: {
|
|
1056
1198
|
type: "choice",
|
|
1057
1199
|
options: ["horizontal", "vertical", "inline"],
|
|
1058
|
-
defaultValue: "
|
|
1200
|
+
defaultValue: "vertical"
|
|
1201
|
+
},
|
|
1202
|
+
labelAlign: {
|
|
1203
|
+
type: "choice",
|
|
1204
|
+
options: ["left", "right"],
|
|
1205
|
+
defaultValueHint: "right",
|
|
1206
|
+
advanced: true
|
|
1059
1207
|
},
|
|
1208
|
+
labelCol: colProp("Label layout", {
|
|
1209
|
+
span: 8,
|
|
1210
|
+
horizontalOnly: true
|
|
1211
|
+
}),
|
|
1212
|
+
wrapperCol: colProp("Field layout", {
|
|
1213
|
+
span: 16,
|
|
1214
|
+
horizontalOnly: true
|
|
1215
|
+
}),
|
|
1060
1216
|
colon: {
|
|
1061
1217
|
type: "boolean",
|
|
1062
|
-
description: `
|
|
1063
|
-
|
|
1218
|
+
description: `Show a colon after the label by default (only for horizontal layout)`,
|
|
1219
|
+
defaultValueHint: true,
|
|
1064
1220
|
advanced: true
|
|
1065
1221
|
},
|
|
1066
1222
|
requiredMark: {
|
|
1067
|
-
displayName: "
|
|
1068
|
-
type: "
|
|
1069
|
-
|
|
1223
|
+
displayName: "Required/optional mark",
|
|
1224
|
+
type: "choice",
|
|
1225
|
+
options: [
|
|
1226
|
+
{
|
|
1227
|
+
value: "optional",
|
|
1228
|
+
label: "Indicate optional fields"
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
value: true,
|
|
1232
|
+
label: "Indicate required fields with asterisk"
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
value: false,
|
|
1236
|
+
label: "Show no indicators"
|
|
1237
|
+
}
|
|
1238
|
+
],
|
|
1239
|
+
advanced: true,
|
|
1240
|
+
defaultValueHint: true
|
|
1070
1241
|
},
|
|
1071
1242
|
extendedOnValuesChange: {
|
|
1072
1243
|
type: "eventHandler",
|
|
1244
|
+
displayName: "On values change",
|
|
1073
1245
|
argTypes: [
|
|
1074
1246
|
{
|
|
1075
1247
|
name: "changedValues",
|
|
@@ -1083,6 +1255,7 @@ function registerForm(loader) {
|
|
|
1083
1255
|
},
|
|
1084
1256
|
onFinish: {
|
|
1085
1257
|
type: "eventHandler",
|
|
1258
|
+
displayName: "On submit",
|
|
1086
1259
|
argTypes: [
|
|
1087
1260
|
{
|
|
1088
1261
|
name: "values",
|
|
@@ -1092,6 +1265,7 @@ function registerForm(loader) {
|
|
|
1092
1265
|
},
|
|
1093
1266
|
onFinishFailed: {
|
|
1094
1267
|
type: "eventHandler",
|
|
1268
|
+
displayName: "On invalid submit",
|
|
1095
1269
|
argTypes: [
|
|
1096
1270
|
{
|
|
1097
1271
|
name: "data",
|
|
@@ -1101,9 +1275,9 @@ function registerForm(loader) {
|
|
|
1101
1275
|
},
|
|
1102
1276
|
validateTrigger: {
|
|
1103
1277
|
type: "choice",
|
|
1104
|
-
options: ["onSubmit", "onChange"],
|
|
1278
|
+
options: ["onSubmit", "onChange", "onBlur"],
|
|
1105
1279
|
multiSelect: true,
|
|
1106
|
-
|
|
1280
|
+
defaultValueHint: ["onChange"],
|
|
1107
1281
|
advanced: true
|
|
1108
1282
|
}
|
|
1109
1283
|
},
|
|
@@ -1171,40 +1345,68 @@ const useFormItemFullName = (name) => {
|
|
|
1171
1345
|
const pathCtx = React__default.default.useContext(PathContext);
|
|
1172
1346
|
return typeof name === "object" ? [...pathCtx.fullPath, ...name] : typeof name === "string" ? [...pathCtx.fullPath, name] : void 0;
|
|
1173
1347
|
};
|
|
1348
|
+
function useFormInstanceMaybe() {
|
|
1349
|
+
return Form__default.default.useFormInstance();
|
|
1350
|
+
}
|
|
1174
1351
|
function FormItemWrapper(props) {
|
|
1175
|
-
var _a;
|
|
1352
|
+
var _a, _b;
|
|
1176
1353
|
const relativeFormItemName = useFormItemRelativeName(props.name);
|
|
1177
1354
|
const fullFormItemName = useFormItemFullName(props.name);
|
|
1178
1355
|
const rules = props.rules ? plasmicRulesToAntdRules(props.rules) : void 0;
|
|
1179
1356
|
const inCanvas = !!host.usePlasmicCanvasContext();
|
|
1180
1357
|
if (inCanvas) {
|
|
1181
|
-
const form =
|
|
1358
|
+
const form = useFormInstanceMaybe();
|
|
1182
1359
|
const prevPropValues = React__default.default.useRef({
|
|
1183
1360
|
initialValue: props.initialValue,
|
|
1184
1361
|
name: props.name
|
|
1185
1362
|
});
|
|
1186
|
-
const
|
|
1363
|
+
const internalFormCtx = React__default.default.useContext(InternalFormInstanceContext);
|
|
1364
|
+
const { fireOnValuesChange, forceRemount } = internalFormCtx != null ? internalFormCtx : {};
|
|
1365
|
+
(_a = props.setControlContextData) == null ? void 0 : _a.call(props, {
|
|
1366
|
+
internalFormCtx
|
|
1367
|
+
});
|
|
1187
1368
|
React__default.default.useEffect(() => {
|
|
1188
1369
|
if (prevPropValues.current.name !== props.name) {
|
|
1189
1370
|
forceRemount == null ? void 0 : forceRemount();
|
|
1190
1371
|
}
|
|
1191
|
-
if (!fullFormItemName || form.getFieldValue(fullFormItemName) !== prevPropValues.current.initialValue) {
|
|
1372
|
+
if (!fullFormItemName || (form == null ? void 0 : form.getFieldValue(fullFormItemName)) !== prevPropValues.current.initialValue) {
|
|
1192
1373
|
return;
|
|
1193
1374
|
}
|
|
1194
|
-
form.setFieldValue(fullFormItemName, props.initialValue);
|
|
1375
|
+
form == null ? void 0 : form.setFieldValue(fullFormItemName, props.initialValue);
|
|
1195
1376
|
prevPropValues.current.initialValue = props.initialValue;
|
|
1196
1377
|
fireOnValuesChange == null ? void 0 : fireOnValuesChange();
|
|
1197
|
-
}, [props.initialValue, fullFormItemName]);
|
|
1378
|
+
}, [form, props.initialValue, fullFormItemName]);
|
|
1198
1379
|
}
|
|
1199
|
-
return /* @__PURE__ */ React__default.default.createElement(FormItem__default.default, __spreadProps$4(__spreadValues$
|
|
1380
|
+
return /* @__PURE__ */ React__default.default.createElement(FormItem__default.default, __spreadValues$4(__spreadProps$4(__spreadValues$4({}, omit(props, "rules")), {
|
|
1381
|
+
label: props.noLabel ? void 0 : props.label,
|
|
1200
1382
|
name: relativeFormItemName,
|
|
1201
1383
|
rules
|
|
1202
|
-
}))
|
|
1384
|
+
}), props.helpTextMode === "extra" ? { extra: props.help } : props.helpTextMode === "help" ? { help: (_b = props.help) != null ? _b : "" } : {}), props.customizeProps ? /* @__PURE__ */ React__default.default.createElement(FormItemForwarder, {
|
|
1385
|
+
formItemProps: props
|
|
1386
|
+
}) : props.children);
|
|
1387
|
+
}
|
|
1388
|
+
function FormItemForwarder(_a) {
|
|
1389
|
+
var _b = _a, { formItemProps } = _b, props = __objRest$3(_b, ["formItemProps"]);
|
|
1390
|
+
var _a2;
|
|
1391
|
+
const status = Form__default.default.Item.useStatus();
|
|
1392
|
+
const internalFormCtx = React__default.default.useContext(InternalFormInstanceContext);
|
|
1393
|
+
const data = {
|
|
1394
|
+
status: status.status
|
|
1395
|
+
};
|
|
1396
|
+
(_a2 = props.setControlContextData) == null ? void 0 : _a2.call(props, {
|
|
1397
|
+
internalFormCtx,
|
|
1398
|
+
status
|
|
1399
|
+
});
|
|
1400
|
+
return React__default.default.Children.map(formItemProps.children, (child, i) => {
|
|
1401
|
+
var _a3;
|
|
1402
|
+
const baseProps = __spreadValues$4(__spreadValues$4({}, (_a3 = child.props) != null ? _a3 : {}), props);
|
|
1403
|
+
return i === 0 && React.isValidElement(child) ? React.cloneElement(child, mergeProps(baseProps, formItemProps.customizeProps(data, baseProps))) : child;
|
|
1404
|
+
});
|
|
1203
1405
|
}
|
|
1204
1406
|
function registerFormItem(loader) {
|
|
1205
1407
|
registerComponentHelper(loader, FormItemWrapper, {
|
|
1206
1408
|
name: "plasmic-antd5-form-item",
|
|
1207
|
-
displayName: "Form
|
|
1409
|
+
displayName: "Form Item",
|
|
1208
1410
|
parentComponentName: "plasmic-antd5-form",
|
|
1209
1411
|
props: {
|
|
1210
1412
|
label: {
|
|
@@ -1231,12 +1433,18 @@ function registerFormItem(loader) {
|
|
|
1231
1433
|
type: "boolean"
|
|
1232
1434
|
},
|
|
1233
1435
|
rules: {
|
|
1234
|
-
type: "formValidationRules"
|
|
1235
|
-
|
|
1436
|
+
type: "formValidationRules"
|
|
1437
|
+
},
|
|
1438
|
+
noLabel: {
|
|
1439
|
+
type: "boolean",
|
|
1440
|
+
advanced: true
|
|
1236
1441
|
},
|
|
1237
1442
|
colon: {
|
|
1238
1443
|
type: "boolean",
|
|
1239
|
-
|
|
1444
|
+
defaultValueHint: (_ps, ctx) => {
|
|
1445
|
+
var _a, _b;
|
|
1446
|
+
return (_b = (_a = ctx == null ? void 0 : ctx.internalFormCtx) == null ? void 0 : _a.formProps.colon) != null ? _b : true;
|
|
1447
|
+
},
|
|
1240
1448
|
advanced: true
|
|
1241
1449
|
},
|
|
1242
1450
|
labelAlign: {
|
|
@@ -1247,6 +1455,66 @@ function registerFormItem(loader) {
|
|
|
1247
1455
|
hidden: {
|
|
1248
1456
|
type: "boolean",
|
|
1249
1457
|
advanced: true
|
|
1458
|
+
},
|
|
1459
|
+
validateTrigger: {
|
|
1460
|
+
type: "choice",
|
|
1461
|
+
options: ["onSubmit", "onChange", "onBlur"],
|
|
1462
|
+
multiSelect: true,
|
|
1463
|
+
advanced: true
|
|
1464
|
+
},
|
|
1465
|
+
shouldUpdate: {
|
|
1466
|
+
type: "boolean",
|
|
1467
|
+
advanced: true,
|
|
1468
|
+
displayName: "Always re-render",
|
|
1469
|
+
description: "Form items normally only re-render when the corresponding form value changes, for performance. This forces it to always re-render."
|
|
1470
|
+
},
|
|
1471
|
+
helpTextMode: {
|
|
1472
|
+
type: "choice",
|
|
1473
|
+
displayName: "Help text",
|
|
1474
|
+
options: [
|
|
1475
|
+
{
|
|
1476
|
+
value: "errors",
|
|
1477
|
+
label: "Validation errors"
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
value: "extra",
|
|
1481
|
+
label: "Custom help text and validation errors"
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
value: "help",
|
|
1485
|
+
label: "Custom help text, no validation errors"
|
|
1486
|
+
}
|
|
1487
|
+
],
|
|
1488
|
+
defaultValueHint: "Show validation errors",
|
|
1489
|
+
description: "What to show in the help text. Edit help text by editing the 'help' slot in the outline."
|
|
1490
|
+
},
|
|
1491
|
+
help: {
|
|
1492
|
+
type: "slot",
|
|
1493
|
+
hidden: (ps) => {
|
|
1494
|
+
var _a;
|
|
1495
|
+
return !["extra", "help"].includes((_a = ps.helpTextMode) != null ? _a : "");
|
|
1496
|
+
},
|
|
1497
|
+
hidePlaceholder: true
|
|
1498
|
+
},
|
|
1499
|
+
customizeProps: {
|
|
1500
|
+
type: "function",
|
|
1501
|
+
description: "Customize the props passed into the wrapped field component. Takes the current status ('success', 'warning', 'error', or 'validating').)",
|
|
1502
|
+
argNames: ["fieldData"],
|
|
1503
|
+
argValues: (_ps, ctx) => {
|
|
1504
|
+
var _a;
|
|
1505
|
+
return [
|
|
1506
|
+
{
|
|
1507
|
+
status: (_a = ctx == null ? void 0 : ctx.status) == null ? void 0 : _a.status
|
|
1508
|
+
}
|
|
1509
|
+
];
|
|
1510
|
+
},
|
|
1511
|
+
advanced: true
|
|
1512
|
+
},
|
|
1513
|
+
noStyle: {
|
|
1514
|
+
type: "boolean",
|
|
1515
|
+
displayName: "Field only",
|
|
1516
|
+
description: "Don't render anything but the wrapped field component - so no label, help text, validation error, etc.",
|
|
1517
|
+
advanced: true
|
|
1250
1518
|
}
|
|
1251
1519
|
},
|
|
1252
1520
|
importPath: "@plasmicpkgs/antd5/skinny/registerForm",
|
|
@@ -1265,7 +1533,7 @@ function FormGroup(props) {
|
|
|
1265
1533
|
function registerFormGroup(loader) {
|
|
1266
1534
|
registerComponentHelper(loader, FormGroup, {
|
|
1267
1535
|
name: "plasmic-antd5-form-group",
|
|
1268
|
-
displayName: "Form
|
|
1536
|
+
displayName: "Form Group",
|
|
1269
1537
|
parentComponentName: "plasmic-antd5-form",
|
|
1270
1538
|
actions: COMMON_ACTIONS,
|
|
1271
1539
|
props: {
|
|
@@ -1307,7 +1575,7 @@ const FormListWrapper = React__default.default.forwardRef(function FormListWrapp
|
|
|
1307
1575
|
}), [operationsRef]);
|
|
1308
1576
|
const inCanvas = !!host.usePlasmicCanvasContext();
|
|
1309
1577
|
if (inCanvas) {
|
|
1310
|
-
const form =
|
|
1578
|
+
const form = useFormInstanceMaybe();
|
|
1311
1579
|
const prevPropValues = React__default.default.useRef({
|
|
1312
1580
|
initialValue: props.initialValue,
|
|
1313
1581
|
name: props.name
|
|
@@ -1318,13 +1586,13 @@ const FormListWrapper = React__default.default.forwardRef(function FormListWrapp
|
|
|
1318
1586
|
forceRemount == null ? void 0 : forceRemount();
|
|
1319
1587
|
}
|
|
1320
1588
|
if (fullFormItemName) {
|
|
1321
|
-
form.setFieldValue(fullFormItemName, props.initialValue);
|
|
1589
|
+
form == null ? void 0 : form.setFieldValue(fullFormItemName, props.initialValue);
|
|
1322
1590
|
prevPropValues.current.initialValue = props.initialValue;
|
|
1323
1591
|
fireOnValuesChange == null ? void 0 : fireOnValuesChange();
|
|
1324
1592
|
}
|
|
1325
1593
|
}, [props.initialValue, fullFormItemName]);
|
|
1326
1594
|
}
|
|
1327
|
-
return /* @__PURE__ */ React__default.default.createElement(FormList__default.default, __spreadProps$4(__spreadValues$
|
|
1595
|
+
return /* @__PURE__ */ React__default.default.createElement(FormList__default.default, __spreadProps$4(__spreadValues$4({}, props), {
|
|
1328
1596
|
name: relativeFormItemName != null ? relativeFormItemName : []
|
|
1329
1597
|
}), (...args) => {
|
|
1330
1598
|
operationsRef.current = args;
|
|
@@ -1346,33 +1614,63 @@ function registerFormList(loader) {
|
|
|
1346
1614
|
registerComponentHelper(loader, FormListWrapper, {
|
|
1347
1615
|
name: "plasmic-antd5-form-list",
|
|
1348
1616
|
parentComponentName: "plasmic-antd5-form",
|
|
1349
|
-
displayName: "Form
|
|
1617
|
+
displayName: "Form List",
|
|
1350
1618
|
actions: COMMON_ACTIONS,
|
|
1351
1619
|
props: {
|
|
1352
1620
|
children: {
|
|
1353
1621
|
type: "slot",
|
|
1354
1622
|
defaultValue: [
|
|
1355
1623
|
{
|
|
1356
|
-
type: "
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1624
|
+
type: "hbox",
|
|
1625
|
+
children: [
|
|
1626
|
+
{
|
|
1627
|
+
type: "component",
|
|
1628
|
+
name: "plasmic-antd5-form-item",
|
|
1629
|
+
props: {
|
|
1630
|
+
name: "firstName",
|
|
1631
|
+
label: {
|
|
1632
|
+
type: "text",
|
|
1633
|
+
value: "First name"
|
|
1634
|
+
},
|
|
1635
|
+
children: {
|
|
1636
|
+
type: "component",
|
|
1637
|
+
name: "plasmic-antd5-input"
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
type: "component",
|
|
1643
|
+
name: "plasmic-antd5-form-item",
|
|
1644
|
+
props: {
|
|
1645
|
+
name: "lastName",
|
|
1646
|
+
label: {
|
|
1647
|
+
type: "text",
|
|
1648
|
+
value: "Last name"
|
|
1649
|
+
},
|
|
1650
|
+
children: {
|
|
1651
|
+
type: "component",
|
|
1652
|
+
name: "plasmic-antd5-input"
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
]
|
|
1361
1657
|
}
|
|
1362
1658
|
]
|
|
1363
1659
|
},
|
|
1364
1660
|
name: {
|
|
1365
1661
|
type: "string",
|
|
1366
|
-
defaultValue: "
|
|
1662
|
+
defaultValue: "guests"
|
|
1367
1663
|
},
|
|
1368
1664
|
initialValue: {
|
|
1369
|
-
type: "
|
|
1665
|
+
type: "array",
|
|
1370
1666
|
defaultValue: [
|
|
1371
1667
|
{
|
|
1372
|
-
|
|
1668
|
+
firstName: "Jane",
|
|
1669
|
+
lastName: "Doe"
|
|
1373
1670
|
},
|
|
1374
1671
|
{
|
|
1375
|
-
|
|
1672
|
+
firstName: "John",
|
|
1673
|
+
lastName: "Smith"
|
|
1376
1674
|
}
|
|
1377
1675
|
]
|
|
1378
1676
|
}
|
|
@@ -1424,518 +1722,447 @@ function registerFormList(loader) {
|
|
|
1424
1722
|
});
|
|
1425
1723
|
}
|
|
1426
1724
|
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
description: "Which action can trigger submenu open/close",
|
|
1456
|
-
defaultValueHint: "hover",
|
|
1457
|
-
advanced: true
|
|
1458
|
-
},
|
|
1459
|
-
children: {
|
|
1460
|
-
type: "slot",
|
|
1461
|
-
allowedComponents: [
|
|
1462
|
-
"plasmic-antd5-menu-item",
|
|
1463
|
-
"plasmic-antd5-menu-divider",
|
|
1464
|
-
"plasmic-antd5-submenu",
|
|
1465
|
-
"plasmic-antd5-menu-group"
|
|
1466
|
-
],
|
|
1467
|
-
defaultValue: [
|
|
1468
|
-
{
|
|
1469
|
-
type: "component",
|
|
1470
|
-
name: "plasmic-antd5-menu-item"
|
|
1471
|
-
},
|
|
1472
|
-
{
|
|
1473
|
-
type: "component",
|
|
1474
|
-
name: "plasmic-antd5-menu-item"
|
|
1475
|
-
}
|
|
1476
|
-
]
|
|
1477
|
-
},
|
|
1478
|
-
onSelect: {
|
|
1479
|
-
type: "eventHandler",
|
|
1480
|
-
argTypes: [{ name: "key", type: "string" }]
|
|
1725
|
+
var __defProp$3 = Object.defineProperty;
|
|
1726
|
+
var __defProps$3 = Object.defineProperties;
|
|
1727
|
+
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
1728
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
1729
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
1730
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
1731
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1732
|
+
var __spreadValues$3 = (a, b) => {
|
|
1733
|
+
for (var prop in b || (b = {}))
|
|
1734
|
+
if (__hasOwnProp$3.call(b, prop))
|
|
1735
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
1736
|
+
if (__getOwnPropSymbols$3)
|
|
1737
|
+
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
1738
|
+
if (__propIsEnum$3.call(b, prop))
|
|
1739
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
1740
|
+
}
|
|
1741
|
+
return a;
|
|
1742
|
+
};
|
|
1743
|
+
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
1744
|
+
const AntdInput = Input__default.default;
|
|
1745
|
+
const AntdTextArea = Input__default.default.TextArea;
|
|
1746
|
+
const AntdPassword = Input__default.default.Password;
|
|
1747
|
+
const AntdInputNumber = InputNumber__default.default;
|
|
1748
|
+
const inputHelpers = {
|
|
1749
|
+
states: {
|
|
1750
|
+
value: {
|
|
1751
|
+
onChangeArgsToValue: (e) => {
|
|
1752
|
+
return e.target.value;
|
|
1481
1753
|
}
|
|
1482
|
-
}
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
};
|
|
1757
|
+
const COMMON_HELPERS_CONFIG = {
|
|
1758
|
+
helpers: inputHelpers,
|
|
1759
|
+
importName: "inputHelpers",
|
|
1760
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerInput"
|
|
1761
|
+
};
|
|
1762
|
+
const COMMON_STATES = {
|
|
1763
|
+
value: {
|
|
1764
|
+
type: "writable",
|
|
1765
|
+
valueProp: "value",
|
|
1766
|
+
variableType: "text",
|
|
1767
|
+
onChangeProp: "onChange"
|
|
1768
|
+
}
|
|
1769
|
+
};
|
|
1770
|
+
const COMMON_DECORATOR_PROPS = {
|
|
1771
|
+
prefix: {
|
|
1772
|
+
type: "slot",
|
|
1773
|
+
hidePlaceholder: true
|
|
1774
|
+
},
|
|
1775
|
+
suffix: {
|
|
1776
|
+
type: "slot",
|
|
1777
|
+
hidePlaceholder: true
|
|
1778
|
+
},
|
|
1779
|
+
addonAfter: {
|
|
1780
|
+
type: "slot",
|
|
1781
|
+
hidePlaceholder: true
|
|
1782
|
+
},
|
|
1783
|
+
addonBefore: {
|
|
1784
|
+
type: "slot",
|
|
1785
|
+
hidePlaceholder: true
|
|
1786
|
+
}
|
|
1787
|
+
};
|
|
1788
|
+
const COMMON_ADVANCED_PROPS = {
|
|
1789
|
+
maxLength: {
|
|
1790
|
+
type: "number",
|
|
1791
|
+
advanced: true
|
|
1792
|
+
},
|
|
1793
|
+
bordered: {
|
|
1794
|
+
type: "boolean",
|
|
1795
|
+
advanced: true,
|
|
1796
|
+
defaultValueHint: true
|
|
1797
|
+
},
|
|
1798
|
+
allowClear: {
|
|
1799
|
+
type: "boolean",
|
|
1800
|
+
advanced: true
|
|
1801
|
+
},
|
|
1802
|
+
autoFocus: {
|
|
1803
|
+
type: "boolean",
|
|
1804
|
+
advanced: true
|
|
1805
|
+
},
|
|
1806
|
+
readOnly: {
|
|
1807
|
+
type: "boolean",
|
|
1808
|
+
advanced: true
|
|
1809
|
+
}
|
|
1810
|
+
};
|
|
1811
|
+
const COMMON_EVENT_HANDLERS = {
|
|
1812
|
+
onChange: {
|
|
1813
|
+
type: "eventHandler",
|
|
1814
|
+
argTypes: [
|
|
1815
|
+
{
|
|
1816
|
+
name: "event",
|
|
1817
|
+
type: "object"
|
|
1818
|
+
}
|
|
1819
|
+
]
|
|
1820
|
+
},
|
|
1821
|
+
onPressEnter: {
|
|
1822
|
+
type: "eventHandler",
|
|
1823
|
+
argTypes: [
|
|
1824
|
+
{
|
|
1825
|
+
name: "event",
|
|
1826
|
+
type: "object"
|
|
1827
|
+
}
|
|
1828
|
+
]
|
|
1829
|
+
}
|
|
1830
|
+
};
|
|
1831
|
+
function registerInput(loader) {
|
|
1832
|
+
registerComponentHelper(loader, AntdInput, {
|
|
1833
|
+
name: "plasmic-antd5-input",
|
|
1834
|
+
displayName: "Input",
|
|
1835
|
+
props: __spreadValues$3(__spreadValues$3(__spreadValues$3({
|
|
1836
|
+
value: {
|
|
1837
|
+
type: "string"
|
|
1499
1838
|
},
|
|
1500
|
-
|
|
1501
|
-
type: "string"
|
|
1502
|
-
description: "Unique ID of the menu item",
|
|
1503
|
-
defaultValue: "menuItemKey"
|
|
1839
|
+
placholder: {
|
|
1840
|
+
type: "string"
|
|
1504
1841
|
},
|
|
1505
|
-
|
|
1506
|
-
type: "
|
|
1507
|
-
|
|
1842
|
+
size: {
|
|
1843
|
+
type: "choice",
|
|
1844
|
+
options: ["large", "middle", "small"]
|
|
1508
1845
|
},
|
|
1509
|
-
|
|
1510
|
-
type: "
|
|
1511
|
-
defaultValue: [
|
|
1512
|
-
{
|
|
1513
|
-
type: "text",
|
|
1514
|
-
value: "Option"
|
|
1515
|
-
}
|
|
1516
|
-
]
|
|
1846
|
+
disabled: {
|
|
1847
|
+
type: "boolean"
|
|
1517
1848
|
}
|
|
1518
|
-
},
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1849
|
+
}, COMMON_ADVANCED_PROPS), COMMON_DECORATOR_PROPS), COMMON_EVENT_HANDLERS),
|
|
1850
|
+
states: __spreadValues$3({}, COMMON_STATES),
|
|
1851
|
+
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
1852
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
1853
|
+
importName: "AntdInput"
|
|
1522
1854
|
});
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
value: "Group"
|
|
1533
|
-
}
|
|
1534
|
-
]
|
|
1855
|
+
}
|
|
1856
|
+
function registerTextArea(loader) {
|
|
1857
|
+
registerComponentHelper(loader, AntdTextArea, {
|
|
1858
|
+
name: "plasmic-antd5-textarea",
|
|
1859
|
+
parentComponentName: "plasmic-antd5-input",
|
|
1860
|
+
displayName: "Text Area",
|
|
1861
|
+
props: __spreadValues$3({
|
|
1862
|
+
value: {
|
|
1863
|
+
type: "string"
|
|
1535
1864
|
},
|
|
1536
|
-
|
|
1537
|
-
type: "
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1865
|
+
placholder: {
|
|
1866
|
+
type: "string"
|
|
1867
|
+
},
|
|
1868
|
+
disabled: {
|
|
1869
|
+
type: "boolean"
|
|
1870
|
+
},
|
|
1871
|
+
maxLength: {
|
|
1872
|
+
type: "number",
|
|
1873
|
+
advanced: true
|
|
1874
|
+
},
|
|
1875
|
+
bordered: {
|
|
1876
|
+
type: "boolean",
|
|
1877
|
+
advanced: true,
|
|
1878
|
+
defaultValueHint: true
|
|
1550
1879
|
}
|
|
1551
|
-
},
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1880
|
+
}, COMMON_EVENT_HANDLERS),
|
|
1881
|
+
states: __spreadValues$3({}, COMMON_STATES),
|
|
1882
|
+
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
1883
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
1884
|
+
importName: "AntdTextArea"
|
|
1555
1885
|
});
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1886
|
+
}
|
|
1887
|
+
function registerPasswordInput(loader) {
|
|
1888
|
+
registerComponentHelper(loader, AntdPassword, {
|
|
1889
|
+
name: "plasmic-antd5-input-password",
|
|
1890
|
+
parentComponentName: "plasmic-antd5-input",
|
|
1891
|
+
displayName: "Password Input",
|
|
1892
|
+
props: __spreadValues$3({
|
|
1893
|
+
value: {
|
|
1894
|
+
type: "string"
|
|
1895
|
+
},
|
|
1896
|
+
placholder: {
|
|
1897
|
+
type: "string"
|
|
1898
|
+
},
|
|
1899
|
+
disabled: {
|
|
1900
|
+
type: "boolean"
|
|
1901
|
+
},
|
|
1902
|
+
maxLength: {
|
|
1903
|
+
type: "number",
|
|
1904
|
+
advanced: true
|
|
1905
|
+
},
|
|
1906
|
+
bordered: {
|
|
1561
1907
|
type: "boolean",
|
|
1562
|
-
|
|
1563
|
-
defaultValueHint:
|
|
1908
|
+
advanced: true,
|
|
1909
|
+
defaultValueHint: true
|
|
1564
1910
|
}
|
|
1565
|
-
},
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1911
|
+
}, COMMON_EVENT_HANDLERS),
|
|
1912
|
+
states: __spreadValues$3({}, COMMON_STATES),
|
|
1913
|
+
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
1914
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
1915
|
+
importName: "AntdPassword"
|
|
1569
1916
|
});
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1917
|
+
}
|
|
1918
|
+
function registerNumberInput(loader) {
|
|
1919
|
+
registerComponentHelper(loader, AntdInputNumber, {
|
|
1920
|
+
name: "plasmic-antd5-input-number",
|
|
1921
|
+
parentComponentName: "plasmic-antd5-input",
|
|
1922
|
+
displayName: "Number Input",
|
|
1923
|
+
props: __spreadProps$3(__spreadValues$3(__spreadValues$3(__spreadValues$3({
|
|
1924
|
+
value: {
|
|
1925
|
+
type: "number"
|
|
1926
|
+
},
|
|
1927
|
+
placholder: {
|
|
1928
|
+
type: "string"
|
|
1929
|
+
},
|
|
1574
1930
|
disabled: {
|
|
1575
|
-
type: "boolean"
|
|
1576
|
-
description: "Whether sub-menu is disabled",
|
|
1577
|
-
defaultValueHint: false
|
|
1931
|
+
type: "boolean"
|
|
1578
1932
|
},
|
|
1579
|
-
|
|
1580
|
-
type: "
|
|
1581
|
-
description: "Unique ID of the sub-menu",
|
|
1582
|
-
advanced: true
|
|
1933
|
+
max: {
|
|
1934
|
+
type: "number"
|
|
1583
1935
|
},
|
|
1584
|
-
|
|
1585
|
-
type: "
|
|
1586
|
-
|
|
1936
|
+
min: {
|
|
1937
|
+
type: "number"
|
|
1938
|
+
},
|
|
1939
|
+
step: {
|
|
1940
|
+
type: "number",
|
|
1941
|
+
helpText: "Increment or decrement step"
|
|
1942
|
+
},
|
|
1943
|
+
controls: {
|
|
1944
|
+
type: "boolean",
|
|
1945
|
+
displayName: "Show add/minus controls?",
|
|
1946
|
+
advanced: true
|
|
1947
|
+
}
|
|
1948
|
+
}, COMMON_DECORATOR_PROPS), COMMON_ADVANCED_PROPS), COMMON_EVENT_HANDLERS), {
|
|
1949
|
+
onChange: {
|
|
1950
|
+
type: "eventHandler",
|
|
1951
|
+
argTypes: [
|
|
1587
1952
|
{
|
|
1588
|
-
|
|
1589
|
-
|
|
1953
|
+
name: "value",
|
|
1954
|
+
type: "number"
|
|
1590
1955
|
}
|
|
1591
1956
|
]
|
|
1592
|
-
},
|
|
1593
|
-
children: {
|
|
1594
|
-
type: "slot",
|
|
1595
|
-
allowedComponents: [
|
|
1596
|
-
"plasmic-antd5-menu-item",
|
|
1597
|
-
"plasmic-antd5-menu-divider",
|
|
1598
|
-
"plasmic-antd5-menu-item-group",
|
|
1599
|
-
"plasmic-antd5-submenu"
|
|
1600
|
-
],
|
|
1601
|
-
defaultValue: [1, 2].map((i) => ({
|
|
1602
|
-
type: "component",
|
|
1603
|
-
name: "plasmic-antd5-menu-item",
|
|
1604
|
-
props: {
|
|
1605
|
-
key: `subMenuItemKey${i}`,
|
|
1606
|
-
children: [
|
|
1607
|
-
{
|
|
1608
|
-
type: "text",
|
|
1609
|
-
value: `Sub-menu item ${i}`
|
|
1610
|
-
}
|
|
1611
|
-
]
|
|
1612
|
-
}
|
|
1613
|
-
}))
|
|
1614
1957
|
}
|
|
1615
|
-
},
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1958
|
+
}),
|
|
1959
|
+
states: __spreadValues$3({}, COMMON_STATES),
|
|
1960
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
1961
|
+
importName: "AntdInputNumber"
|
|
1619
1962
|
});
|
|
1620
1963
|
}
|
|
1621
1964
|
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
}
|
|
1638
|
-
return a;
|
|
1639
|
-
};
|
|
1640
|
-
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
1641
|
-
var __objRest$3 = (source, exclude) => {
|
|
1642
|
-
var target = {};
|
|
1643
|
-
for (var prop in source)
|
|
1644
|
-
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1645
|
-
target[prop] = source[prop];
|
|
1646
|
-
if (source != null && __getOwnPropSymbols$4)
|
|
1647
|
-
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
1648
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
1649
|
-
target[prop] = source[prop];
|
|
1650
|
-
}
|
|
1651
|
-
return target;
|
|
1652
|
-
};
|
|
1653
|
-
function AntdModal(props) {
|
|
1654
|
-
const _a = props, { onOpenChange, onOk, onCancel, open, footer } = _a, rest = __objRest$3(_a, ["onOpenChange", "onOk", "onCancel", "open", "footer"]);
|
|
1655
|
-
const memoOnOk = React__default.default.useMemo(() => {
|
|
1656
|
-
if (onOpenChange || onOk) {
|
|
1657
|
-
return (e) => {
|
|
1658
|
-
onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1659
|
-
onOk == null ? void 0 : onOk(e);
|
|
1660
|
-
};
|
|
1661
|
-
} else {
|
|
1662
|
-
return void 0;
|
|
1663
|
-
}
|
|
1664
|
-
}, [onOpenChange, onOk]);
|
|
1665
|
-
const memoOnCancel = React__default.default.useMemo(() => {
|
|
1666
|
-
if (onOpenChange || onCancel) {
|
|
1667
|
-
return (e) => {
|
|
1668
|
-
onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1669
|
-
onCancel == null ? void 0 : onCancel(e);
|
|
1670
|
-
};
|
|
1671
|
-
} else {
|
|
1672
|
-
return void 0;
|
|
1673
|
-
}
|
|
1674
|
-
}, [onOpenChange, onCancel]);
|
|
1675
|
-
return /* @__PURE__ */ React__default.default.createElement(Modal__default.default, __spreadProps$3(__spreadValues$4({}, rest), {
|
|
1676
|
-
onOk: memoOnOk,
|
|
1677
|
-
onCancel: memoOnCancel,
|
|
1678
|
-
open,
|
|
1679
|
-
footer: footer != null ? footer : void 0
|
|
1680
|
-
}));
|
|
1681
|
-
}
|
|
1682
|
-
function registerModal(loader) {
|
|
1683
|
-
registerComponentHelper(loader, AntdModal, {
|
|
1684
|
-
name: "plasmic-antd5-modal",
|
|
1685
|
-
displayName: "Modal",
|
|
1965
|
+
const AntdMenu = Menu__default.default;
|
|
1966
|
+
const AntdMenuDivider = Menu__default.default.Divider;
|
|
1967
|
+
const AntdMenuItem = Menu__default.default.Item;
|
|
1968
|
+
const AntdMenuItemGroup = Menu__default.default.ItemGroup;
|
|
1969
|
+
const AntdSubMenu = Menu__default.default.SubMenu;
|
|
1970
|
+
const allowedMenuComponents = [
|
|
1971
|
+
"plasmic-antd5-menu-item",
|
|
1972
|
+
"plasmic-antd5-menu-divider",
|
|
1973
|
+
"plasmic-antd5-submenu",
|
|
1974
|
+
"plasmic-antd5-menu-item-group"
|
|
1975
|
+
];
|
|
1976
|
+
function registerMenu(loader) {
|
|
1977
|
+
registerComponentHelper(loader, AntdMenu, {
|
|
1978
|
+
name: "plasmic-antd5-menu",
|
|
1979
|
+
displayName: "Menu",
|
|
1686
1980
|
props: {
|
|
1687
|
-
|
|
1688
|
-
type: "boolean"
|
|
1689
|
-
},
|
|
1690
|
-
children: {
|
|
1691
|
-
type: "slot",
|
|
1692
|
-
defaultValue: {
|
|
1693
|
-
type: "vbox",
|
|
1694
|
-
children: ["Modal content"]
|
|
1695
|
-
}
|
|
1696
|
-
},
|
|
1697
|
-
title: {
|
|
1698
|
-
type: "slot",
|
|
1699
|
-
defaultValue: "Modal title"
|
|
1700
|
-
},
|
|
1701
|
-
footer: {
|
|
1702
|
-
type: "slot",
|
|
1703
|
-
hidePlaceholder: true
|
|
1704
|
-
},
|
|
1705
|
-
closeIcon: {
|
|
1981
|
+
expandIcon: {
|
|
1706
1982
|
type: "slot",
|
|
1707
1983
|
hidePlaceholder: true
|
|
1708
1984
|
},
|
|
1709
|
-
|
|
1710
|
-
type: "
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
type: "eventHandler",
|
|
1715
|
-
argTypes: []
|
|
1716
|
-
},
|
|
1717
|
-
okText: {
|
|
1718
|
-
type: "string",
|
|
1719
|
-
hidden: (ps) => !!ps.footer,
|
|
1720
|
-
advanced: true
|
|
1721
|
-
},
|
|
1722
|
-
cancelText: {
|
|
1723
|
-
type: "string",
|
|
1724
|
-
hidden: (ps) => !!ps.footer,
|
|
1725
|
-
advanced: true
|
|
1726
|
-
},
|
|
1727
|
-
onOpenChange: {
|
|
1728
|
-
type: "eventHandler",
|
|
1729
|
-
argTypes: [{ name: "open", type: "boolean" }]
|
|
1985
|
+
mode: {
|
|
1986
|
+
type: "choice",
|
|
1987
|
+
options: ["horizontal", "vertical", "inline"],
|
|
1988
|
+
description: "Type of menu",
|
|
1989
|
+
defaultValueHint: "vertical"
|
|
1730
1990
|
},
|
|
1731
|
-
|
|
1732
|
-
type: "
|
|
1733
|
-
|
|
1991
|
+
multiple: {
|
|
1992
|
+
type: "boolean",
|
|
1993
|
+
description: "Allows selection of multiple items",
|
|
1994
|
+
defaultValueHint: false
|
|
1734
1995
|
},
|
|
1735
|
-
|
|
1736
|
-
type: "
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
{
|
|
1741
|
-
selector: ":modal .ant-modal .ant-modal-content",
|
|
1742
|
-
label: "Base"
|
|
1743
|
-
}
|
|
1744
|
-
],
|
|
1996
|
+
triggerSubMenuAction: {
|
|
1997
|
+
type: "choice",
|
|
1998
|
+
options: ["hover", "click"],
|
|
1999
|
+
description: "Which action can trigger submenu open/close",
|
|
2000
|
+
defaultValueHint: "hover",
|
|
1745
2001
|
advanced: true
|
|
1746
2002
|
},
|
|
1747
|
-
|
|
1748
|
-
type: "
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
selectors: [
|
|
2003
|
+
children: {
|
|
2004
|
+
type: "slot",
|
|
2005
|
+
allowedComponents: allowedMenuComponents,
|
|
2006
|
+
defaultValue: [
|
|
1752
2007
|
{
|
|
1753
|
-
|
|
1754
|
-
|
|
2008
|
+
type: "component",
|
|
2009
|
+
name: "plasmic-antd5-menu-item",
|
|
2010
|
+
props: {
|
|
2011
|
+
key: "menuItemKey1"
|
|
2012
|
+
}
|
|
2013
|
+
},
|
|
2014
|
+
{
|
|
2015
|
+
type: "component",
|
|
2016
|
+
name: "plasmic-antd5-menu-item",
|
|
2017
|
+
props: {
|
|
2018
|
+
key: "menuItemKey2"
|
|
2019
|
+
}
|
|
1755
2020
|
}
|
|
1756
|
-
]
|
|
1757
|
-
advanced: true
|
|
2021
|
+
]
|
|
1758
2022
|
},
|
|
1759
|
-
|
|
1760
|
-
type: "
|
|
1761
|
-
|
|
1762
|
-
},
|
|
1763
|
-
states: {
|
|
1764
|
-
open: {
|
|
1765
|
-
type: "writable",
|
|
1766
|
-
valueProp: "open",
|
|
1767
|
-
onChangeProp: "onOpenChange",
|
|
1768
|
-
variableType: "boolean"
|
|
2023
|
+
onSelect: {
|
|
2024
|
+
type: "eventHandler",
|
|
2025
|
+
argTypes: [{ name: "key", type: "string" }]
|
|
1769
2026
|
}
|
|
1770
2027
|
},
|
|
1771
|
-
importPath: "@plasmicpkgs/antd5/skinny/
|
|
1772
|
-
importName: "
|
|
2028
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
2029
|
+
importName: "AntdMenu"
|
|
1773
2030
|
});
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
var __defProps$2 = Object.defineProperties;
|
|
1778
|
-
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
1779
|
-
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
1780
|
-
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
1781
|
-
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
1782
|
-
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1783
|
-
var __spreadValues$3 = (a, b) => {
|
|
1784
|
-
for (var prop in b || (b = {}))
|
|
1785
|
-
if (__hasOwnProp$3.call(b, prop))
|
|
1786
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
1787
|
-
if (__getOwnPropSymbols$3)
|
|
1788
|
-
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
1789
|
-
if (__propIsEnum$3.call(b, prop))
|
|
1790
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
1791
|
-
}
|
|
1792
|
-
return a;
|
|
1793
|
-
};
|
|
1794
|
-
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
1795
|
-
var __objRest$2 = (source, exclude) => {
|
|
1796
|
-
var target = {};
|
|
1797
|
-
for (var prop in source)
|
|
1798
|
-
if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1799
|
-
target[prop] = source[prop];
|
|
1800
|
-
if (source != null && __getOwnPropSymbols$3)
|
|
1801
|
-
for (var prop of __getOwnPropSymbols$3(source)) {
|
|
1802
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
|
|
1803
|
-
target[prop] = source[prop];
|
|
1804
|
-
}
|
|
1805
|
-
return target;
|
|
1806
|
-
};
|
|
1807
|
-
const AntdRadio = Radio__default.default;
|
|
1808
|
-
function AntdRadioGroup(props) {
|
|
1809
|
-
const _a = props, { onChange } = _a, rest = __objRest$2(_a, ["onChange"]);
|
|
1810
|
-
const wrappedOnChange = React__default.default.useMemo(() => {
|
|
1811
|
-
if (onChange) {
|
|
1812
|
-
return (event) => onChange(event.target.value);
|
|
1813
|
-
} else {
|
|
1814
|
-
return void 0;
|
|
1815
|
-
}
|
|
1816
|
-
}, [onChange]);
|
|
1817
|
-
return /* @__PURE__ */ React__default.default.createElement(RadioGroup__default.default, __spreadProps$2(__spreadValues$3({}, rest), {
|
|
1818
|
-
onChange: wrappedOnChange
|
|
1819
|
-
}));
|
|
1820
|
-
}
|
|
1821
|
-
function registerRadio(loader) {
|
|
1822
|
-
registerComponentHelper(loader, AntdRadio, {
|
|
1823
|
-
name: "plasmic-antd5-radio",
|
|
1824
|
-
displayName: "Radio",
|
|
2031
|
+
registerComponentHelper(loader, AntdMenuItem, {
|
|
2032
|
+
name: "plasmic-antd5-menu-item",
|
|
2033
|
+
displayName: "Menu Item",
|
|
1825
2034
|
props: {
|
|
1826
|
-
|
|
1827
|
-
type: "
|
|
1828
|
-
description: "
|
|
2035
|
+
danger: {
|
|
2036
|
+
type: "boolean",
|
|
2037
|
+
description: "Display the danger style",
|
|
2038
|
+
defaultValueHint: false
|
|
1829
2039
|
},
|
|
1830
2040
|
disabled: {
|
|
1831
2041
|
type: "boolean",
|
|
2042
|
+
description: "Whether disabled select",
|
|
1832
2043
|
defaultValueHint: false
|
|
1833
2044
|
},
|
|
1834
|
-
|
|
1835
|
-
type: "
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
2045
|
+
key: {
|
|
2046
|
+
type: "string",
|
|
2047
|
+
displayName: "Unique key",
|
|
2048
|
+
description: "Unique ID of the menu item. Used to determine which item is selected.",
|
|
2049
|
+
defaultValue: "menuItemKey"
|
|
2050
|
+
},
|
|
2051
|
+
title: {
|
|
2052
|
+
type: "string",
|
|
2053
|
+
description: "Set display title for collapsed item"
|
|
1839
2054
|
},
|
|
1840
2055
|
children: {
|
|
1841
2056
|
type: "slot",
|
|
1842
2057
|
defaultValue: [
|
|
1843
2058
|
{
|
|
1844
2059
|
type: "text",
|
|
1845
|
-
value: "
|
|
2060
|
+
value: "Menu item"
|
|
1846
2061
|
}
|
|
1847
2062
|
]
|
|
2063
|
+
},
|
|
2064
|
+
onClick: {
|
|
2065
|
+
type: "eventHandler",
|
|
2066
|
+
argTypes: []
|
|
1848
2067
|
}
|
|
1849
2068
|
},
|
|
1850
|
-
importPath: "@plasmicpkgs/antd5/skinny/
|
|
1851
|
-
importName: "
|
|
1852
|
-
parentComponentName: "plasmic-antd5-
|
|
2069
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
2070
|
+
importName: "AntdMenuItem",
|
|
2071
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1853
2072
|
});
|
|
1854
|
-
registerComponentHelper(loader,
|
|
1855
|
-
name: "plasmic-antd5-
|
|
1856
|
-
displayName: "
|
|
2073
|
+
registerComponentHelper(loader, AntdMenuItemGroup, {
|
|
2074
|
+
name: "plasmic-antd5-menu-item-group",
|
|
2075
|
+
displayName: "Item Group",
|
|
1857
2076
|
props: {
|
|
1858
|
-
|
|
1859
|
-
type: "
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
autoFocus: {
|
|
1867
|
-
type: "boolean",
|
|
1868
|
-
description: "If focused when first shown",
|
|
1869
|
-
defaultValueHint: false,
|
|
1870
|
-
advanced: true
|
|
2077
|
+
title: {
|
|
2078
|
+
type: "slot",
|
|
2079
|
+
defaultValue: [
|
|
2080
|
+
{
|
|
2081
|
+
type: "text",
|
|
2082
|
+
value: "Group"
|
|
2083
|
+
}
|
|
2084
|
+
]
|
|
1871
2085
|
},
|
|
1872
2086
|
children: {
|
|
1873
2087
|
type: "slot",
|
|
2088
|
+
allowedComponents: allowedMenuComponents,
|
|
1874
2089
|
defaultValue: [
|
|
1875
2090
|
{
|
|
1876
|
-
type: "
|
|
1877
|
-
|
|
2091
|
+
type: "component",
|
|
2092
|
+
name: "plasmic-antd5-menu-item"
|
|
1878
2093
|
}
|
|
1879
2094
|
]
|
|
1880
2095
|
}
|
|
1881
2096
|
},
|
|
1882
|
-
importPath: "@plasmicpkgs/antd5/skinny/
|
|
1883
|
-
importName: "
|
|
1884
|
-
parentComponentName: "plasmic-antd5-
|
|
2097
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
2098
|
+
importName: "AntdMenuItemGroup",
|
|
2099
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1885
2100
|
});
|
|
1886
|
-
registerComponentHelper(loader,
|
|
1887
|
-
name: "plasmic-antd5-
|
|
1888
|
-
displayName: "
|
|
2101
|
+
registerComponentHelper(loader, AntdMenuDivider, {
|
|
2102
|
+
name: "plasmic-antd5-menu-divider",
|
|
2103
|
+
displayName: "Menu Divider",
|
|
2104
|
+
props: {
|
|
2105
|
+
dashed: {
|
|
2106
|
+
type: "boolean",
|
|
2107
|
+
description: "Whether line is dashed",
|
|
2108
|
+
defaultValueHint: false
|
|
2109
|
+
}
|
|
2110
|
+
},
|
|
2111
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
2112
|
+
importName: "AntdMenuDivider",
|
|
2113
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
2114
|
+
});
|
|
2115
|
+
registerComponentHelper(loader, AntdSubMenu, {
|
|
2116
|
+
name: "plasmic-antd5-submenu",
|
|
2117
|
+
displayName: "Sub Menu",
|
|
1889
2118
|
props: {
|
|
1890
|
-
value: {
|
|
1891
|
-
type: "choice",
|
|
1892
|
-
editOnly: true,
|
|
1893
|
-
uncontrolledProp: "defaultValue",
|
|
1894
|
-
description: "Default selected value",
|
|
1895
|
-
options: (ps) => {
|
|
1896
|
-
const options = /* @__PURE__ */ new Set();
|
|
1897
|
-
traverseReactEltTree(ps.children, (elt) => {
|
|
1898
|
-
var _a;
|
|
1899
|
-
if (typeof ((_a = elt == null ? void 0 : elt.props) == null ? void 0 : _a.value) === "string") {
|
|
1900
|
-
options.add(elt.props.value);
|
|
1901
|
-
}
|
|
1902
|
-
});
|
|
1903
|
-
return Array.from(options.keys());
|
|
1904
|
-
}
|
|
1905
|
-
},
|
|
1906
2119
|
disabled: {
|
|
1907
2120
|
type: "boolean",
|
|
1908
|
-
description: "
|
|
2121
|
+
description: "Whether sub-menu is disabled",
|
|
1909
2122
|
defaultValueHint: false
|
|
1910
2123
|
},
|
|
1911
|
-
|
|
2124
|
+
key: {
|
|
2125
|
+
type: "string",
|
|
2126
|
+
displayName: "Unique key",
|
|
2127
|
+
description: "Unique ID of the sub-menu. Used to determine which item is selected.",
|
|
2128
|
+
advanced: true
|
|
2129
|
+
},
|
|
2130
|
+
title: {
|
|
1912
2131
|
type: "slot",
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
2132
|
+
defaultValue: [
|
|
2133
|
+
{
|
|
2134
|
+
type: "text",
|
|
2135
|
+
value: "Sub-menu"
|
|
2136
|
+
}
|
|
1916
2137
|
]
|
|
1917
2138
|
},
|
|
1918
|
-
|
|
1919
|
-
type: "
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2139
|
+
children: {
|
|
2140
|
+
type: "slot",
|
|
2141
|
+
allowedComponents: allowedMenuComponents,
|
|
2142
|
+
defaultValue: [1, 2].map((i) => ({
|
|
2143
|
+
type: "component",
|
|
2144
|
+
name: "plasmic-antd5-menu-item",
|
|
2145
|
+
props: {
|
|
2146
|
+
key: `subMenuItemKey${i}`,
|
|
2147
|
+
children: [
|
|
2148
|
+
{
|
|
2149
|
+
type: "text",
|
|
2150
|
+
value: `Sub-menu item ${i}`
|
|
2151
|
+
}
|
|
2152
|
+
]
|
|
2153
|
+
}
|
|
2154
|
+
}))
|
|
1929
2155
|
}
|
|
1930
2156
|
},
|
|
1931
|
-
importPath: "@
|
|
1932
|
-
importName: "
|
|
2157
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
2158
|
+
importName: "AntdSubMenu",
|
|
2159
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1933
2160
|
});
|
|
1934
2161
|
}
|
|
1935
2162
|
|
|
1936
2163
|
var __defProp$2 = Object.defineProperty;
|
|
1937
|
-
var __defProps$
|
|
1938
|
-
var __getOwnPropDescs$
|
|
2164
|
+
var __defProps$2 = Object.defineProperties;
|
|
2165
|
+
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
1939
2166
|
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
1940
2167
|
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
1941
2168
|
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
@@ -1951,8 +2178,8 @@ var __spreadValues$2 = (a, b) => {
|
|
|
1951
2178
|
}
|
|
1952
2179
|
return a;
|
|
1953
2180
|
};
|
|
1954
|
-
var __spreadProps$
|
|
1955
|
-
var __objRest$
|
|
2181
|
+
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
2182
|
+
var __objRest$2 = (source, exclude) => {
|
|
1956
2183
|
var target = {};
|
|
1957
2184
|
for (var prop in source)
|
|
1958
2185
|
if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -1962,166 +2189,109 @@ var __objRest$1 = (source, exclude) => {
|
|
|
1962
2189
|
if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
|
|
1963
2190
|
target[prop] = source[prop];
|
|
1964
2191
|
}
|
|
1965
|
-
return target;
|
|
1966
|
-
};
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
2192
|
+
return target;
|
|
2193
|
+
};
|
|
2194
|
+
function AntdModal(props) {
|
|
2195
|
+
const _a = props, { onOpenChange, onOk, onCancel, open, footer } = _a, rest = __objRest$2(_a, ["onOpenChange", "onOk", "onCancel", "open", "footer"]);
|
|
2196
|
+
const memoOnOk = React__default.default.useMemo(() => {
|
|
2197
|
+
if (onOpenChange || onOk) {
|
|
2198
|
+
return (e) => {
|
|
2199
|
+
onOpenChange == null ? void 0 : onOpenChange(false);
|
|
2200
|
+
onOk == null ? void 0 : onOk(e);
|
|
2201
|
+
};
|
|
2202
|
+
} else {
|
|
2203
|
+
return void 0;
|
|
2204
|
+
}
|
|
2205
|
+
}, [onOpenChange, onOk]);
|
|
2206
|
+
const memoOnCancel = React__default.default.useMemo(() => {
|
|
2207
|
+
if (onOpenChange || onCancel) {
|
|
2208
|
+
return (e) => {
|
|
2209
|
+
onOpenChange == null ? void 0 : onOpenChange(false);
|
|
2210
|
+
onCancel == null ? void 0 : onCancel(e);
|
|
2211
|
+
};
|
|
2212
|
+
} else {
|
|
2213
|
+
return void 0;
|
|
2214
|
+
}
|
|
2215
|
+
}, [onOpenChange, onCancel]);
|
|
2216
|
+
return /* @__PURE__ */ React__default.default.createElement(Modal__default.default, __spreadProps$2(__spreadValues$2({}, rest), {
|
|
2217
|
+
onOk: memoOnOk,
|
|
2218
|
+
onCancel: memoOnCancel,
|
|
2219
|
+
open,
|
|
2220
|
+
footer: footer != null ? footer : void 0
|
|
2221
|
+
}));
|
|
1986
2222
|
}
|
|
1987
|
-
function
|
|
1988
|
-
registerComponentHelper(loader,
|
|
1989
|
-
name: "plasmic-antd5-
|
|
1990
|
-
displayName: "
|
|
2223
|
+
function registerModal(loader) {
|
|
2224
|
+
registerComponentHelper(loader, AntdModal, {
|
|
2225
|
+
name: "plasmic-antd5-modal",
|
|
2226
|
+
displayName: "Modal",
|
|
1991
2227
|
props: {
|
|
2228
|
+
open: {
|
|
2229
|
+
type: "boolean"
|
|
2230
|
+
},
|
|
1992
2231
|
children: {
|
|
1993
2232
|
type: "slot",
|
|
1994
|
-
|
|
2233
|
+
defaultValue: {
|
|
2234
|
+
type: "vbox",
|
|
2235
|
+
children: ["Modal content"]
|
|
2236
|
+
}
|
|
1995
2237
|
},
|
|
1996
|
-
|
|
2238
|
+
title: {
|
|
1997
2239
|
type: "slot",
|
|
1998
|
-
defaultValue: "
|
|
2240
|
+
defaultValue: "Modal title"
|
|
1999
2241
|
},
|
|
2000
|
-
|
|
2242
|
+
footer: {
|
|
2001
2243
|
type: "slot",
|
|
2002
2244
|
hidePlaceholder: true
|
|
2003
2245
|
},
|
|
2004
|
-
|
|
2005
|
-
type: "
|
|
2006
|
-
|
|
2007
|
-
uncontrolledProp: "defaultOpen"
|
|
2008
|
-
},
|
|
2009
|
-
value: {
|
|
2010
|
-
type: "choice",
|
|
2011
|
-
displayName: "Selected value",
|
|
2012
|
-
editOnly: true,
|
|
2013
|
-
uncontrolledProp: "defaultValue",
|
|
2014
|
-
description: "Initial selected option",
|
|
2015
|
-
multiSelect: (ps) => ps.mode === "multiple",
|
|
2016
|
-
options: (ps) => {
|
|
2017
|
-
const options = /* @__PURE__ */ new Set();
|
|
2018
|
-
traverseReactEltTree(ps.children, (elt) => {
|
|
2019
|
-
var _a;
|
|
2020
|
-
if ((elt == null ? void 0 : elt.type) === Select__default.default.Option && typeof ((_a = elt == null ? void 0 : elt.props) == null ? void 0 : _a.value) === "string") {
|
|
2021
|
-
options.add(elt.props.value);
|
|
2022
|
-
}
|
|
2023
|
-
});
|
|
2024
|
-
return Array.from(options.keys());
|
|
2025
|
-
}
|
|
2026
|
-
},
|
|
2027
|
-
mode: {
|
|
2028
|
-
type: "choice",
|
|
2029
|
-
options: ["single", "multiple"],
|
|
2030
|
-
defaultValueHint: "single"
|
|
2031
|
-
},
|
|
2032
|
-
size: {
|
|
2033
|
-
type: "choice",
|
|
2034
|
-
options: ["small", "middle", "large"]
|
|
2246
|
+
closeIcon: {
|
|
2247
|
+
type: "slot",
|
|
2248
|
+
hidePlaceholder: true
|
|
2035
2249
|
},
|
|
2036
|
-
|
|
2037
|
-
type: "
|
|
2038
|
-
|
|
2250
|
+
onOk: {
|
|
2251
|
+
type: "eventHandler",
|
|
2252
|
+
argTypes: []
|
|
2039
2253
|
},
|
|
2040
|
-
|
|
2041
|
-
type: "
|
|
2042
|
-
|
|
2043
|
-
advanced: true
|
|
2254
|
+
onCancel: {
|
|
2255
|
+
type: "eventHandler",
|
|
2256
|
+
argTypes: []
|
|
2044
2257
|
},
|
|
2045
|
-
|
|
2046
|
-
type: "
|
|
2047
|
-
|
|
2258
|
+
okText: {
|
|
2259
|
+
type: "string",
|
|
2260
|
+
hidden: (ps) => !!ps.footer,
|
|
2048
2261
|
advanced: true
|
|
2049
2262
|
},
|
|
2050
|
-
|
|
2051
|
-
type: "
|
|
2052
|
-
|
|
2053
|
-
},
|
|
2054
|
-
autoFocus: {
|
|
2055
|
-
type: "boolean",
|
|
2056
|
-
displayName: "Focus automatically",
|
|
2057
|
-
defaultValueHint: false,
|
|
2263
|
+
cancelText: {
|
|
2264
|
+
type: "string",
|
|
2265
|
+
hidden: (ps) => !!ps.footer,
|
|
2058
2266
|
advanced: true
|
|
2059
2267
|
},
|
|
2060
|
-
|
|
2268
|
+
onOpenChange: {
|
|
2061
2269
|
type: "eventHandler",
|
|
2062
|
-
argTypes: [
|
|
2063
|
-
{ name: "value", type: "string" },
|
|
2064
|
-
{ name: "option", type: "object" }
|
|
2065
|
-
]
|
|
2066
|
-
},
|
|
2067
|
-
dropdownMatchSelectWidth: {
|
|
2068
|
-
type: "boolean",
|
|
2069
|
-
displayName: "Should dropdown match trigger button width?",
|
|
2070
|
-
defaultValueHint: true,
|
|
2071
|
-
advanced: true
|
|
2072
|
-
},
|
|
2073
|
-
triggerClassName: {
|
|
2074
|
-
type: "class",
|
|
2075
|
-
displayName: "Trigger styles",
|
|
2076
|
-
noSelf: true,
|
|
2077
|
-
selectors: [
|
|
2078
|
-
{
|
|
2079
|
-
selector: ":component .ant-select-selector.ant-select-selector",
|
|
2080
|
-
label: "Base"
|
|
2081
|
-
},
|
|
2082
|
-
{
|
|
2083
|
-
selector: ":component .ant-select-selector:hover",
|
|
2084
|
-
label: "Hovered"
|
|
2085
|
-
}
|
|
2086
|
-
],
|
|
2087
|
-
advanced: true
|
|
2270
|
+
argTypes: [{ name: "open", type: "boolean" }]
|
|
2088
2271
|
},
|
|
2089
|
-
|
|
2272
|
+
modalScopeClassName: {
|
|
2090
2273
|
type: "styleScopeClass",
|
|
2091
|
-
scopeName: "
|
|
2092
|
-
},
|
|
2093
|
-
popupClassName: {
|
|
2094
|
-
type: "class",
|
|
2095
|
-
displayName: "Popup styles",
|
|
2096
|
-
selectors: [],
|
|
2097
|
-
advanced: true
|
|
2274
|
+
scopeName: "modal"
|
|
2098
2275
|
},
|
|
2099
|
-
|
|
2276
|
+
modalClassName: {
|
|
2100
2277
|
type: "class",
|
|
2101
|
-
displayName: "
|
|
2278
|
+
displayName: "Modal content styles",
|
|
2102
2279
|
noSelf: true,
|
|
2103
2280
|
selectors: [
|
|
2104
2281
|
{
|
|
2105
|
-
selector: ":
|
|
2282
|
+
selector: ":modal .ant-modal .ant-modal-content",
|
|
2106
2283
|
label: "Base"
|
|
2107
|
-
},
|
|
2108
|
-
{
|
|
2109
|
-
selector: ":popup.ant-select-dropdown .ant-select-item-option-active",
|
|
2110
|
-
label: "Focused"
|
|
2111
|
-
},
|
|
2112
|
-
{
|
|
2113
|
-
selector: ":popup.ant-select-dropdown .ant-select-item-option-selected",
|
|
2114
|
-
label: "Selected"
|
|
2115
2284
|
}
|
|
2116
2285
|
],
|
|
2117
2286
|
advanced: true
|
|
2118
2287
|
},
|
|
2119
|
-
|
|
2288
|
+
closeButtonClassName: {
|
|
2120
2289
|
type: "class",
|
|
2121
|
-
displayName: "
|
|
2290
|
+
displayName: "Close button styles",
|
|
2291
|
+
noSelf: true,
|
|
2122
2292
|
selectors: [
|
|
2123
2293
|
{
|
|
2124
|
-
selector: ":
|
|
2294
|
+
selector: ":modal .ant-modal .ant-modal-close",
|
|
2125
2295
|
label: "Base"
|
|
2126
2296
|
}
|
|
2127
2297
|
],
|
|
@@ -2129,43 +2299,24 @@ function registerSelect(loader) {
|
|
|
2129
2299
|
},
|
|
2130
2300
|
defaultStylesClassName: {
|
|
2131
2301
|
type: "themeResetClass"
|
|
2132
|
-
},
|
|
2133
|
-
tagRender: {
|
|
2134
|
-
type: "slot",
|
|
2135
|
-
renderPropParams: ["tagProps"],
|
|
2136
|
-
hidePlaceholder: true
|
|
2137
2302
|
}
|
|
2138
2303
|
},
|
|
2139
2304
|
states: {
|
|
2140
|
-
|
|
2305
|
+
open: {
|
|
2141
2306
|
type: "writable",
|
|
2142
|
-
valueProp: "
|
|
2143
|
-
onChangeProp: "
|
|
2144
|
-
variableType: "
|
|
2145
|
-
}
|
|
2146
|
-
},
|
|
2147
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerSelect",
|
|
2148
|
-
importName: "AntdSelect"
|
|
2149
|
-
});
|
|
2150
|
-
registerComponentHelper(loader, AntdOption, {
|
|
2151
|
-
name: "plasmic-antd5-option",
|
|
2152
|
-
displayName: "Option",
|
|
2153
|
-
parentComponentName: "plasmic-antd5-select",
|
|
2154
|
-
props: {
|
|
2155
|
-
children: {
|
|
2156
|
-
type: "slot",
|
|
2157
|
-
defaultValue: "Option"
|
|
2158
|
-
},
|
|
2159
|
-
value: {
|
|
2160
|
-
type: "string"
|
|
2307
|
+
valueProp: "open",
|
|
2308
|
+
onChangeProp: "onOpenChange",
|
|
2309
|
+
variableType: "boolean"
|
|
2161
2310
|
}
|
|
2162
2311
|
},
|
|
2163
|
-
importPath: "@plasmicpkgs/antd5/skinny/
|
|
2164
|
-
importName: "
|
|
2312
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerModal",
|
|
2313
|
+
importName: "AntdModal"
|
|
2165
2314
|
});
|
|
2166
2315
|
}
|
|
2167
2316
|
|
|
2168
2317
|
var __defProp$1 = Object.defineProperty;
|
|
2318
|
+
var __defProps$1 = Object.defineProperties;
|
|
2319
|
+
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
2169
2320
|
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
2170
2321
|
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
2171
2322
|
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
@@ -2181,7 +2332,8 @@ var __spreadValues$1 = (a, b) => {
|
|
|
2181
2332
|
}
|
|
2182
2333
|
return a;
|
|
2183
2334
|
};
|
|
2184
|
-
var
|
|
2335
|
+
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
2336
|
+
var __objRest$1 = (source, exclude) => {
|
|
2185
2337
|
var target = {};
|
|
2186
2338
|
for (var prop in source)
|
|
2187
2339
|
if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -2193,237 +2345,133 @@ var __objRest = (source, exclude) => {
|
|
|
2193
2345
|
}
|
|
2194
2346
|
return target;
|
|
2195
2347
|
};
|
|
2196
|
-
const
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
selectedRowKeys,
|
|
2205
|
-
defaultSelectedRowKeys
|
|
2206
|
-
} = _a, rest = __objRest(_a, [
|
|
2207
|
-
"data",
|
|
2208
|
-
"onSelectedRowKeysChange",
|
|
2209
|
-
"onSelectedRowsChange",
|
|
2210
|
-
"isSelectable",
|
|
2211
|
-
"rowKey",
|
|
2212
|
-
"setControlContextData",
|
|
2213
|
-
"selectedRowKeys",
|
|
2214
|
-
"defaultSelectedRowKeys"
|
|
2215
|
-
]);
|
|
2216
|
-
setControlContextData == null ? void 0 : setControlContextData(data);
|
|
2217
|
-
const isControlled = !!selectedRowKeys;
|
|
2218
|
-
const [
|
|
2219
|
-
uncontrolledSelectedRowKeys,
|
|
2220
|
-
setUncontrolledSelectedRowKeys
|
|
2221
|
-
] = React__default.default.useState(defaultSelectedRowKeys != null ? defaultSelectedRowKeys : []);
|
|
2222
|
-
const selection = isSelectable && rowKey ? {
|
|
2223
|
-
onChange: (rowKeys, rows) => {
|
|
2224
|
-
onSelectedRowsChange == null ? void 0 : onSelectedRowsChange(rows);
|
|
2225
|
-
onSelectedRowKeysChange == null ? void 0 : onSelectedRowKeysChange(rowKeys);
|
|
2226
|
-
},
|
|
2227
|
-
type: isSelectable === "single" ? "radio" : "checkbox",
|
|
2228
|
-
selectedRowKeys: isControlled ? asArray(selectedRowKeys) : uncontrolledSelectedRowKeys
|
|
2229
|
-
} : void 0;
|
|
2230
|
-
React__default.default.useImperativeHandle(ref, () => ({
|
|
2231
|
-
selectRowByIndex(index) {
|
|
2232
|
-
if (data.data && rowKey) {
|
|
2233
|
-
const row = data.data[index];
|
|
2234
|
-
const rows = row ? [row] : [];
|
|
2235
|
-
this._setSelectedRows(rows);
|
|
2236
|
-
}
|
|
2237
|
-
},
|
|
2238
|
-
selectRowsByIndexes(indexes) {
|
|
2239
|
-
if (data.data && rowKey) {
|
|
2240
|
-
const rows = indexes.map((x) => data.data[x]).filter((x) => !!x);
|
|
2241
|
-
this._setSelectedRows(rows);
|
|
2242
|
-
}
|
|
2243
|
-
},
|
|
2244
|
-
selectRowByKey(key) {
|
|
2245
|
-
if (data.data && rowKey) {
|
|
2246
|
-
const rows = data.data.filter((r) => r[rowKey] === key);
|
|
2247
|
-
this._setSelectedRows(rows);
|
|
2248
|
-
}
|
|
2249
|
-
},
|
|
2250
|
-
selectRowsByKeys(keys) {
|
|
2251
|
-
if (data.data && rowKey) {
|
|
2252
|
-
const rows = data.data.filter((r) => keys.includes(r[rowKey]));
|
|
2253
|
-
this._setSelectedRows(rows);
|
|
2254
|
-
}
|
|
2255
|
-
},
|
|
2256
|
-
clearSelection() {
|
|
2257
|
-
this._setSelectedRows([]);
|
|
2258
|
-
},
|
|
2259
|
-
_setSelectedRows(rows) {
|
|
2260
|
-
onSelectedRowsChange == null ? void 0 : onSelectedRowsChange(rows);
|
|
2261
|
-
if (rowKey) {
|
|
2262
|
-
onSelectedRowKeysChange == null ? void 0 : onSelectedRowKeysChange(rows.map((r) => r[rowKey]));
|
|
2263
|
-
}
|
|
2264
|
-
if (!isControlled) {
|
|
2265
|
-
setUncontrolledSelectedRowKeys(rows.map((r) => r[rowKey]));
|
|
2266
|
-
}
|
|
2348
|
+
const AntdRadio = Radio__default.default;
|
|
2349
|
+
function AntdRadioGroup(props) {
|
|
2350
|
+
const _a = props, { onChange } = _a, rest = __objRest$1(_a, ["onChange"]);
|
|
2351
|
+
const wrappedOnChange = React__default.default.useMemo(() => {
|
|
2352
|
+
if (onChange) {
|
|
2353
|
+
return (event) => onChange(event.target.value);
|
|
2354
|
+
} else {
|
|
2355
|
+
return void 0;
|
|
2267
2356
|
}
|
|
2268
|
-
}
|
|
2269
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
const AntdColumn = Table__default.default.Column;
|
|
2278
|
-
function registerTable(loader) {
|
|
2279
|
-
registerComponentHelper(loader, AntdTable, {
|
|
2280
|
-
name: "plasmic-antd5-table",
|
|
2281
|
-
displayName: "Table",
|
|
2357
|
+
}, [onChange]);
|
|
2358
|
+
return /* @__PURE__ */ React__default.default.createElement(RadioGroup__default.default, __spreadProps$1(__spreadValues$1({}, rest), {
|
|
2359
|
+
onChange: wrappedOnChange
|
|
2360
|
+
}));
|
|
2361
|
+
}
|
|
2362
|
+
function registerRadio(loader) {
|
|
2363
|
+
registerComponentHelper(loader, AntdRadio, {
|
|
2364
|
+
name: "plasmic-antd5-radio",
|
|
2365
|
+
displayName: "Radio",
|
|
2282
2366
|
props: {
|
|
2283
|
-
|
|
2284
|
-
type: "
|
|
2285
|
-
|
|
2286
|
-
},
|
|
2287
|
-
children: {
|
|
2288
|
-
type: "slot",
|
|
2289
|
-
allowedComponents: [
|
|
2290
|
-
"plasmic-antd5-table-column",
|
|
2291
|
-
"plasmic-antd5-table-column-group"
|
|
2292
|
-
]
|
|
2367
|
+
value: {
|
|
2368
|
+
type: "string",
|
|
2369
|
+
description: "The radio option value"
|
|
2293
2370
|
},
|
|
2294
|
-
|
|
2371
|
+
disabled: {
|
|
2372
|
+
type: "boolean",
|
|
2373
|
+
defaultValueHint: false
|
|
2374
|
+
},
|
|
2375
|
+
autoFocus: {
|
|
2295
2376
|
type: "boolean",
|
|
2377
|
+
description: "If focused when first shown",
|
|
2296
2378
|
defaultValueHint: false,
|
|
2297
2379
|
advanced: true
|
|
2298
2380
|
},
|
|
2299
|
-
|
|
2300
|
-
type: "
|
|
2301
|
-
|
|
2302
|
-
displayName: "Select rows?"
|
|
2303
|
-
},
|
|
2304
|
-
rowKey: {
|
|
2305
|
-
type: "choice",
|
|
2306
|
-
options: (ps, ctx) => {
|
|
2307
|
-
if (ctx.schema) {
|
|
2308
|
-
return ctx.schema.fields.map((f) => ({
|
|
2309
|
-
value: f.id,
|
|
2310
|
-
label: f.label || f.id
|
|
2311
|
-
}));
|
|
2312
|
-
}
|
|
2313
|
-
return [];
|
|
2314
|
-
},
|
|
2315
|
-
hidden: (ps) => !ps.isSelectable
|
|
2316
|
-
},
|
|
2317
|
-
selectedRowKeys: {
|
|
2318
|
-
type: "choice",
|
|
2319
|
-
multiSelect: (ps) => ps.isSelectable === "multiple",
|
|
2320
|
-
options: (ps, ctx) => {
|
|
2321
|
-
const key = ps.rowKey;
|
|
2322
|
-
if (key && ctx.data) {
|
|
2323
|
-
return ctx.data.map((r) => r[key]);
|
|
2324
|
-
}
|
|
2325
|
-
return [];
|
|
2326
|
-
},
|
|
2327
|
-
hidden: (ps) => !ps.rowKey
|
|
2328
|
-
},
|
|
2329
|
-
onSelectedRowKeysChange: {
|
|
2330
|
-
type: "eventHandler",
|
|
2331
|
-
argTypes: [{ name: "keys", type: "object" }],
|
|
2332
|
-
hidden: (ps) => !ps.isSelectable
|
|
2333
|
-
},
|
|
2334
|
-
onSelectedRowsChange: {
|
|
2335
|
-
type: "eventHandler",
|
|
2336
|
-
argTypes: [{ name: "rows", type: "object" }],
|
|
2337
|
-
hidden: (ps) => !ps.isSelectable
|
|
2338
|
-
}
|
|
2339
|
-
},
|
|
2340
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerTable",
|
|
2341
|
-
importName: "AntdTable",
|
|
2342
|
-
states: {
|
|
2343
|
-
selectedRowKeys: {
|
|
2344
|
-
type: "writable",
|
|
2345
|
-
valueProp: "selectedRowKeys",
|
|
2346
|
-
onChangeProp: "onSelectedRowKeysChange",
|
|
2347
|
-
variableType: "array"
|
|
2348
|
-
}
|
|
2349
|
-
},
|
|
2350
|
-
unstable__refActions: {
|
|
2351
|
-
selectRowByIndex: {
|
|
2352
|
-
displayName: "Select row by index",
|
|
2353
|
-
parameters: [
|
|
2354
|
-
{
|
|
2355
|
-
name: "index",
|
|
2356
|
-
displayName: "Index",
|
|
2357
|
-
type: "number"
|
|
2358
|
-
}
|
|
2359
|
-
]
|
|
2360
|
-
},
|
|
2361
|
-
selectRowByKey: {
|
|
2362
|
-
displayName: "Select row by key",
|
|
2363
|
-
parameters: [
|
|
2381
|
+
children: {
|
|
2382
|
+
type: "slot",
|
|
2383
|
+
defaultValue: [
|
|
2364
2384
|
{
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
type: "string"
|
|
2385
|
+
type: "text",
|
|
2386
|
+
value: "Radio"
|
|
2368
2387
|
}
|
|
2369
2388
|
]
|
|
2370
2389
|
}
|
|
2371
|
-
}
|
|
2390
|
+
},
|
|
2391
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerRadio",
|
|
2392
|
+
importName: "AntdRadio",
|
|
2393
|
+
parentComponentName: "plasmic-antd5-radio-group"
|
|
2372
2394
|
});
|
|
2373
|
-
registerComponentHelper(loader,
|
|
2374
|
-
name: "plasmic-antd5-
|
|
2375
|
-
displayName: "
|
|
2376
|
-
parentComponentName: "plasmic-antd5-table",
|
|
2395
|
+
registerComponentHelper(loader, AntdRadio, {
|
|
2396
|
+
name: "plasmic-antd5-radio-button",
|
|
2397
|
+
displayName: "Radio Button",
|
|
2377
2398
|
props: {
|
|
2378
|
-
|
|
2379
|
-
type: "slot",
|
|
2380
|
-
defaultValue: "Column Name"
|
|
2381
|
-
},
|
|
2382
|
-
dataIndex: {
|
|
2399
|
+
value: {
|
|
2383
2400
|
type: "string",
|
|
2384
|
-
|
|
2385
|
-
},
|
|
2386
|
-
render: {
|
|
2387
|
-
type: "slot",
|
|
2388
|
-
renderPropParams: ["cell", "row", "index"],
|
|
2389
|
-
hidePlaceholder: true,
|
|
2390
|
-
displayName: "Custom render"
|
|
2401
|
+
description: "The radio option value"
|
|
2391
2402
|
},
|
|
2392
|
-
|
|
2393
|
-
type: "
|
|
2394
|
-
|
|
2395
|
-
defaultValueHint: "left"
|
|
2403
|
+
disabled: {
|
|
2404
|
+
type: "boolean",
|
|
2405
|
+
defaultValueHint: false
|
|
2396
2406
|
},
|
|
2397
|
-
|
|
2398
|
-
type: "
|
|
2399
|
-
|
|
2407
|
+
autoFocus: {
|
|
2408
|
+
type: "boolean",
|
|
2409
|
+
description: "If focused when first shown",
|
|
2410
|
+
defaultValueHint: false,
|
|
2400
2411
|
advanced: true
|
|
2401
2412
|
},
|
|
2402
|
-
|
|
2403
|
-
type: "
|
|
2404
|
-
|
|
2413
|
+
children: {
|
|
2414
|
+
type: "slot",
|
|
2415
|
+
defaultValue: [
|
|
2416
|
+
{
|
|
2417
|
+
type: "text",
|
|
2418
|
+
value: "Radio"
|
|
2419
|
+
}
|
|
2420
|
+
]
|
|
2405
2421
|
}
|
|
2406
2422
|
},
|
|
2407
|
-
importPath: "@plasmicpkgs/antd5/skinny/
|
|
2408
|
-
importName: "
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2423
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerRadio",
|
|
2424
|
+
importName: "AntdRadioButton",
|
|
2425
|
+
parentComponentName: "plasmic-antd5-radio-group"
|
|
2426
|
+
});
|
|
2427
|
+
registerComponentHelper(loader, AntdRadioGroup, {
|
|
2428
|
+
name: "plasmic-antd5-radio-group",
|
|
2429
|
+
displayName: "Radio Group",
|
|
2414
2430
|
props: {
|
|
2415
|
-
|
|
2416
|
-
type: "
|
|
2417
|
-
|
|
2431
|
+
value: {
|
|
2432
|
+
type: "choice",
|
|
2433
|
+
editOnly: true,
|
|
2434
|
+
uncontrolledProp: "defaultValue",
|
|
2435
|
+
description: "Default selected value",
|
|
2436
|
+
options: (ps) => {
|
|
2437
|
+
const options = /* @__PURE__ */ new Set();
|
|
2438
|
+
traverseReactEltTree(ps.children, (elt) => {
|
|
2439
|
+
var _a;
|
|
2440
|
+
if (typeof ((_a = elt == null ? void 0 : elt.props) == null ? void 0 : _a.value) === "string") {
|
|
2441
|
+
options.add(elt.props.value);
|
|
2442
|
+
}
|
|
2443
|
+
});
|
|
2444
|
+
return Array.from(options.keys());
|
|
2445
|
+
}
|
|
2446
|
+
},
|
|
2447
|
+
disabled: {
|
|
2448
|
+
type: "boolean",
|
|
2449
|
+
description: "Disables all radios",
|
|
2450
|
+
defaultValueHint: false
|
|
2418
2451
|
},
|
|
2419
2452
|
children: {
|
|
2420
2453
|
type: "slot",
|
|
2421
|
-
allowedComponents: [
|
|
2454
|
+
allowedComponents: [
|
|
2455
|
+
"plasmic-antd5-radio",
|
|
2456
|
+
"plasmic-antd5-radio-button"
|
|
2457
|
+
]
|
|
2458
|
+
},
|
|
2459
|
+
onChange: {
|
|
2460
|
+
type: "eventHandler",
|
|
2461
|
+
argTypes: [{ name: "value", type: "string" }]
|
|
2462
|
+
}
|
|
2463
|
+
},
|
|
2464
|
+
states: {
|
|
2465
|
+
value: {
|
|
2466
|
+
type: "writable",
|
|
2467
|
+
valueProp: "value",
|
|
2468
|
+
onChangeProp: "onChange",
|
|
2469
|
+
variableType: "text"
|
|
2422
2470
|
}
|
|
2423
2471
|
},
|
|
2424
|
-
importPath: "@
|
|
2425
|
-
importName: "
|
|
2426
|
-
}
|
|
2472
|
+
importPath: "@plasmicapp/antd5/skinny/registerRadio",
|
|
2473
|
+
importName: "AntdRadioGroup"
|
|
2474
|
+
});
|
|
2427
2475
|
}
|
|
2428
2476
|
|
|
2429
2477
|
var __defProp = Object.defineProperty;
|
|
@@ -2445,224 +2493,306 @@ var __spreadValues = (a, b) => {
|
|
|
2445
2493
|
return a;
|
|
2446
2494
|
};
|
|
2447
2495
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
}
|
|
2496
|
+
var __objRest = (source, exclude) => {
|
|
2497
|
+
var target = {};
|
|
2498
|
+
for (var prop in source)
|
|
2499
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2500
|
+
target[prop] = source[prop];
|
|
2501
|
+
if (source != null && __getOwnPropSymbols)
|
|
2502
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
2503
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
2504
|
+
target[prop] = source[prop];
|
|
2458
2505
|
}
|
|
2459
|
-
|
|
2460
|
-
};
|
|
2461
|
-
const COMMON_HELPERS_CONFIG = {
|
|
2462
|
-
helpers: inputHelpers,
|
|
2463
|
-
importName: "inputHelpers",
|
|
2464
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerInput"
|
|
2465
|
-
};
|
|
2466
|
-
const COMMON_STATES = {
|
|
2467
|
-
value: {
|
|
2468
|
-
type: "writable",
|
|
2469
|
-
valueProp: "value",
|
|
2470
|
-
variableType: "text",
|
|
2471
|
-
onChangeProp: "onChange"
|
|
2472
|
-
}
|
|
2473
|
-
};
|
|
2474
|
-
const COMMON_DECORATOR_PROPS = {
|
|
2475
|
-
prefix: {
|
|
2476
|
-
type: "slot",
|
|
2477
|
-
hidePlaceholder: true
|
|
2478
|
-
},
|
|
2479
|
-
suffix: {
|
|
2480
|
-
type: "slot",
|
|
2481
|
-
hidePlaceholder: true
|
|
2482
|
-
},
|
|
2483
|
-
addonAfter: {
|
|
2484
|
-
type: "slot",
|
|
2485
|
-
hidePlaceholder: true
|
|
2486
|
-
},
|
|
2487
|
-
addonBefore: {
|
|
2488
|
-
type: "slot",
|
|
2489
|
-
hidePlaceholder: true
|
|
2490
|
-
}
|
|
2491
|
-
};
|
|
2492
|
-
const COMMON_ADVANCED_PROPS = {
|
|
2493
|
-
maxLength: {
|
|
2494
|
-
type: "number",
|
|
2495
|
-
advanced: true
|
|
2496
|
-
},
|
|
2497
|
-
bordered: {
|
|
2498
|
-
type: "boolean",
|
|
2499
|
-
advanced: true,
|
|
2500
|
-
defaultValueHint: true
|
|
2501
|
-
},
|
|
2502
|
-
allowClear: {
|
|
2503
|
-
type: "boolean",
|
|
2504
|
-
advanced: true
|
|
2505
|
-
},
|
|
2506
|
-
autoFocus: {
|
|
2507
|
-
type: "boolean",
|
|
2508
|
-
advanced: true
|
|
2509
|
-
},
|
|
2510
|
-
readOnly: {
|
|
2511
|
-
type: "boolean",
|
|
2512
|
-
advanced: true
|
|
2513
|
-
}
|
|
2506
|
+
return target;
|
|
2514
2507
|
};
|
|
2515
|
-
const
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2508
|
+
const AntdOption = Select__default.default.Option;
|
|
2509
|
+
const AntdOptionGroup = Select__default.default.OptGroup;
|
|
2510
|
+
function AntdSelect(props) {
|
|
2511
|
+
const _a = props, {
|
|
2512
|
+
popupClassName,
|
|
2513
|
+
popupScopeClassName,
|
|
2514
|
+
defaultStylesClassName,
|
|
2515
|
+
suffixIcon,
|
|
2516
|
+
mode,
|
|
2517
|
+
useChildren
|
|
2518
|
+
} = _a, rest = __objRest(_a, [
|
|
2519
|
+
"popupClassName",
|
|
2520
|
+
"popupScopeClassName",
|
|
2521
|
+
"defaultStylesClassName",
|
|
2522
|
+
"suffixIcon",
|
|
2523
|
+
"mode",
|
|
2524
|
+
"useChildren"
|
|
2525
|
+
]);
|
|
2526
|
+
const curated = __spreadValues({}, rest);
|
|
2527
|
+
if (useChildren) {
|
|
2528
|
+
curated.options = void 0;
|
|
2533
2529
|
}
|
|
2534
|
-
}
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2530
|
+
return /* @__PURE__ */ React__default.default.createElement(Select__default.default, __spreadValues(__spreadProps(__spreadValues({}, curated), {
|
|
2531
|
+
mode: !mode || mode === "single" ? void 0 : mode,
|
|
2532
|
+
popupClassName: `${defaultStylesClassName} ${popupScopeClassName} ${popupClassName}`
|
|
2533
|
+
}), suffixIcon && { suffixIcon }));
|
|
2534
|
+
}
|
|
2535
|
+
function registerSelect(loader) {
|
|
2536
|
+
registerComponentHelper(loader, AntdSelect, {
|
|
2537
|
+
name: "plasmic-antd5-select",
|
|
2538
|
+
displayName: "Select",
|
|
2539
|
+
props: {
|
|
2540
|
+
options: {
|
|
2541
|
+
type: "array",
|
|
2542
|
+
hidden: (ps) => !!ps.useChildren,
|
|
2543
|
+
itemType: {
|
|
2544
|
+
type: "object",
|
|
2545
|
+
nameFunc: (item) => item.label,
|
|
2546
|
+
fields: {
|
|
2547
|
+
value: "string",
|
|
2548
|
+
label: "string"
|
|
2549
|
+
}
|
|
2550
|
+
},
|
|
2551
|
+
defaultValue: [
|
|
2552
|
+
{
|
|
2553
|
+
value: "option1",
|
|
2554
|
+
label: "Option 1"
|
|
2555
|
+
},
|
|
2556
|
+
{
|
|
2557
|
+
value: "option2",
|
|
2558
|
+
label: "Option 2"
|
|
2559
|
+
}
|
|
2560
|
+
]
|
|
2561
|
+
},
|
|
2562
|
+
useChildren: {
|
|
2563
|
+
displayName: "Use slot",
|
|
2564
|
+
type: "boolean",
|
|
2565
|
+
defaultValueHint: false,
|
|
2566
|
+
description: "Instead of configuring a list of options, customize the contents of the Select by dragging and dropping options in the outline/canvas, inside the 'children' slot. Lets you use any content or formatting within the Options, and also use Option Groups."
|
|
2567
|
+
},
|
|
2568
|
+
children: {
|
|
2569
|
+
type: "slot",
|
|
2570
|
+
allowedComponents: [
|
|
2571
|
+
"plasmic-antd5-option",
|
|
2572
|
+
"plasmic-antd5-option-group"
|
|
2573
|
+
],
|
|
2574
|
+
hidden: (ps) => !ps.useChildren
|
|
2575
|
+
},
|
|
2576
|
+
placeholder: {
|
|
2577
|
+
type: "slot",
|
|
2578
|
+
defaultValue: "Select..."
|
|
2579
|
+
},
|
|
2580
|
+
suffixIcon: {
|
|
2581
|
+
type: "slot",
|
|
2582
|
+
hidePlaceholder: true
|
|
2583
|
+
},
|
|
2584
|
+
open: {
|
|
2585
|
+
type: "boolean",
|
|
2586
|
+
editOnly: true,
|
|
2587
|
+
uncontrolledProp: "defaultOpen"
|
|
2588
|
+
},
|
|
2540
2589
|
value: {
|
|
2541
|
-
type: "
|
|
2590
|
+
type: "choice",
|
|
2591
|
+
displayName: "Selected value",
|
|
2592
|
+
editOnly: true,
|
|
2593
|
+
uncontrolledProp: "defaultValue",
|
|
2594
|
+
description: "Initial selected option",
|
|
2595
|
+
multiSelect: (ps) => ps.mode === "multiple",
|
|
2596
|
+
options: (ps) => {
|
|
2597
|
+
var _a;
|
|
2598
|
+
const options = /* @__PURE__ */ new Set();
|
|
2599
|
+
if (!ps.useChildren) {
|
|
2600
|
+
return ((_a = ps.options) != null ? _a : []).map((o) => {
|
|
2601
|
+
var _a2;
|
|
2602
|
+
return {
|
|
2603
|
+
value: o.value || "",
|
|
2604
|
+
label: (_a2 = o.label) != null ? _a2 : o.value || ""
|
|
2605
|
+
};
|
|
2606
|
+
});
|
|
2607
|
+
} else {
|
|
2608
|
+
traverseReactEltTree(ps.children, (elt) => {
|
|
2609
|
+
var _a2;
|
|
2610
|
+
if ((elt == null ? void 0 : elt.type) === Select__default.default.Option && typeof ((_a2 = elt == null ? void 0 : elt.props) == null ? void 0 : _a2.value) === "string") {
|
|
2611
|
+
options.add(elt.props.value);
|
|
2612
|
+
}
|
|
2613
|
+
});
|
|
2614
|
+
}
|
|
2615
|
+
return Array.from(options.keys());
|
|
2616
|
+
}
|
|
2542
2617
|
},
|
|
2543
|
-
|
|
2544
|
-
type: "
|
|
2618
|
+
mode: {
|
|
2619
|
+
type: "choice",
|
|
2620
|
+
options: ["single", "multiple"],
|
|
2621
|
+
defaultValueHint: "single"
|
|
2545
2622
|
},
|
|
2546
2623
|
size: {
|
|
2547
2624
|
type: "choice",
|
|
2548
|
-
options: ["
|
|
2625
|
+
options: ["small", "middle", "large"]
|
|
2549
2626
|
},
|
|
2550
2627
|
disabled: {
|
|
2551
|
-
type: "boolean"
|
|
2552
|
-
|
|
2553
|
-
}, COMMON_ADVANCED_PROPS), COMMON_DECORATOR_PROPS), COMMON_EVENT_HANDLERS),
|
|
2554
|
-
states: __spreadValues({}, COMMON_STATES),
|
|
2555
|
-
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
2556
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2557
|
-
importName: "AntdInput"
|
|
2558
|
-
});
|
|
2559
|
-
}
|
|
2560
|
-
function registerTextArea(loader) {
|
|
2561
|
-
registerComponentHelper(loader, AntdTextArea, {
|
|
2562
|
-
name: "plasmic-antd5-textarea",
|
|
2563
|
-
parentComponentName: "plasmic-antd5-input",
|
|
2564
|
-
displayName: "Text Area",
|
|
2565
|
-
props: __spreadValues({
|
|
2566
|
-
value: {
|
|
2567
|
-
type: "string"
|
|
2568
|
-
},
|
|
2569
|
-
placholder: {
|
|
2570
|
-
type: "string"
|
|
2628
|
+
type: "boolean",
|
|
2629
|
+
defaultValueHint: false
|
|
2571
2630
|
},
|
|
2572
|
-
|
|
2573
|
-
type: "boolean"
|
|
2631
|
+
showSearch: {
|
|
2632
|
+
type: "boolean",
|
|
2633
|
+
defaultValueHint: false,
|
|
2634
|
+
advanced: true
|
|
2574
2635
|
},
|
|
2575
|
-
|
|
2576
|
-
type: "
|
|
2636
|
+
status: {
|
|
2637
|
+
type: "choice",
|
|
2638
|
+
options: ["error", "warning"],
|
|
2577
2639
|
advanced: true
|
|
2578
2640
|
},
|
|
2579
2641
|
bordered: {
|
|
2580
2642
|
type: "boolean",
|
|
2581
|
-
advanced: true,
|
|
2582
2643
|
defaultValueHint: true
|
|
2583
|
-
}
|
|
2584
|
-
}, COMMON_EVENT_HANDLERS),
|
|
2585
|
-
states: __spreadValues({}, COMMON_STATES),
|
|
2586
|
-
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
2587
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2588
|
-
importName: "AntdTextArea"
|
|
2589
|
-
});
|
|
2590
|
-
}
|
|
2591
|
-
function registerPasswordInput(loader) {
|
|
2592
|
-
registerComponentHelper(loader, AntdPassword, {
|
|
2593
|
-
name: "plasmic-antd5-input-password",
|
|
2594
|
-
parentComponentName: "plasmic-antd5-input",
|
|
2595
|
-
displayName: "Password Input",
|
|
2596
|
-
props: __spreadValues({
|
|
2597
|
-
value: {
|
|
2598
|
-
type: "string"
|
|
2599
2644
|
},
|
|
2600
|
-
|
|
2601
|
-
type: "
|
|
2645
|
+
autoFocus: {
|
|
2646
|
+
type: "boolean",
|
|
2647
|
+
displayName: "Focus automatically",
|
|
2648
|
+
defaultValueHint: false,
|
|
2649
|
+
advanced: true
|
|
2602
2650
|
},
|
|
2603
|
-
|
|
2604
|
-
type: "
|
|
2651
|
+
onChange: {
|
|
2652
|
+
type: "eventHandler",
|
|
2653
|
+
argTypes: [
|
|
2654
|
+
{ name: "value", type: "string" },
|
|
2655
|
+
{ name: "option", type: "object" }
|
|
2656
|
+
]
|
|
2605
2657
|
},
|
|
2606
|
-
|
|
2607
|
-
type: "
|
|
2658
|
+
dropdownMatchSelectWidth: {
|
|
2659
|
+
type: "boolean",
|
|
2660
|
+
displayName: "Should dropdown match trigger button width?",
|
|
2661
|
+
defaultValueHint: true,
|
|
2608
2662
|
advanced: true
|
|
2609
2663
|
},
|
|
2610
|
-
|
|
2611
|
-
type: "
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
parentComponentName: "plasmic-antd5-input",
|
|
2626
|
-
displayName: "Number Input",
|
|
2627
|
-
props: __spreadProps(__spreadValues(__spreadValues(__spreadValues({
|
|
2628
|
-
value: {
|
|
2629
|
-
type: "number"
|
|
2664
|
+
triggerClassName: {
|
|
2665
|
+
type: "class",
|
|
2666
|
+
displayName: "Trigger styles",
|
|
2667
|
+
noSelf: true,
|
|
2668
|
+
selectors: [
|
|
2669
|
+
{
|
|
2670
|
+
selector: ":component .ant-select-selector.ant-select-selector",
|
|
2671
|
+
label: "Base"
|
|
2672
|
+
},
|
|
2673
|
+
{
|
|
2674
|
+
selector: ":component .ant-select-selector:hover",
|
|
2675
|
+
label: "Hovered"
|
|
2676
|
+
}
|
|
2677
|
+
],
|
|
2678
|
+
advanced: true
|
|
2630
2679
|
},
|
|
2631
|
-
|
|
2632
|
-
type: "
|
|
2680
|
+
popupScopeClassName: {
|
|
2681
|
+
type: "styleScopeClass",
|
|
2682
|
+
scopeName: "popup"
|
|
2633
2683
|
},
|
|
2634
|
-
|
|
2635
|
-
type: "
|
|
2684
|
+
popupClassName: {
|
|
2685
|
+
type: "class",
|
|
2686
|
+
displayName: "Popup styles",
|
|
2687
|
+
selectors: [],
|
|
2688
|
+
advanced: true
|
|
2636
2689
|
},
|
|
2637
|
-
|
|
2638
|
-
type: "
|
|
2690
|
+
optionClassName: {
|
|
2691
|
+
type: "class",
|
|
2692
|
+
displayName: "Option styles",
|
|
2693
|
+
noSelf: true,
|
|
2694
|
+
selectors: [
|
|
2695
|
+
{
|
|
2696
|
+
selector: ":popup.ant-select-dropdown .ant-select-item-option",
|
|
2697
|
+
label: "Base"
|
|
2698
|
+
},
|
|
2699
|
+
{
|
|
2700
|
+
selector: ":popup.ant-select-dropdown .ant-select-item-option-active",
|
|
2701
|
+
label: "Focused"
|
|
2702
|
+
},
|
|
2703
|
+
{
|
|
2704
|
+
selector: ":popup.ant-select-dropdown .ant-select-item-option-selected",
|
|
2705
|
+
label: "Selected"
|
|
2706
|
+
}
|
|
2707
|
+
],
|
|
2708
|
+
advanced: true
|
|
2639
2709
|
},
|
|
2640
|
-
|
|
2641
|
-
type: "
|
|
2710
|
+
placeholderClassName: {
|
|
2711
|
+
type: "class",
|
|
2712
|
+
displayName: "Placeholder styles",
|
|
2713
|
+
selectors: [
|
|
2714
|
+
{
|
|
2715
|
+
selector: ":component .ant-select-selector .ant-select-selection-placeholder",
|
|
2716
|
+
label: "Base"
|
|
2717
|
+
}
|
|
2718
|
+
],
|
|
2719
|
+
advanced: true
|
|
2642
2720
|
},
|
|
2643
|
-
|
|
2644
|
-
type: "
|
|
2645
|
-
helpText: "Increment or decrement step"
|
|
2721
|
+
defaultStylesClassName: {
|
|
2722
|
+
type: "themeResetClass"
|
|
2646
2723
|
},
|
|
2647
|
-
|
|
2648
|
-
type: "
|
|
2649
|
-
|
|
2650
|
-
|
|
2724
|
+
tagRender: {
|
|
2725
|
+
type: "slot",
|
|
2726
|
+
renderPropParams: ["tagProps"],
|
|
2727
|
+
hidePlaceholder: true
|
|
2651
2728
|
}
|
|
2652
|
-
},
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2729
|
+
},
|
|
2730
|
+
states: {
|
|
2731
|
+
value: {
|
|
2732
|
+
type: "writable",
|
|
2733
|
+
valueProp: "value",
|
|
2734
|
+
onChangeProp: "onChange",
|
|
2735
|
+
variableType: "text"
|
|
2736
|
+
}
|
|
2737
|
+
},
|
|
2738
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerSelect",
|
|
2739
|
+
importName: "AntdSelect"
|
|
2740
|
+
});
|
|
2741
|
+
registerComponentHelper(loader, AntdOption, {
|
|
2742
|
+
name: "plasmic-antd5-option",
|
|
2743
|
+
displayName: "Option",
|
|
2744
|
+
parentComponentName: "plasmic-antd5-select",
|
|
2745
|
+
props: {
|
|
2746
|
+
children: {
|
|
2747
|
+
type: "slot",
|
|
2748
|
+
defaultValue: "Option"
|
|
2749
|
+
},
|
|
2750
|
+
value: {
|
|
2751
|
+
type: "string"
|
|
2752
|
+
}
|
|
2753
|
+
},
|
|
2754
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerSelect",
|
|
2755
|
+
importName: "AntdOption"
|
|
2756
|
+
});
|
|
2757
|
+
registerComponentHelper(loader, AntdOptionGroup, {
|
|
2758
|
+
name: "plasmic-antd5-option-group",
|
|
2759
|
+
displayName: "Option Group",
|
|
2760
|
+
parentComponentName: "plasmic-antd5-select",
|
|
2761
|
+
props: {
|
|
2762
|
+
children: {
|
|
2763
|
+
type: "slot",
|
|
2764
|
+
defaultValue: [
|
|
2656
2765
|
{
|
|
2657
|
-
|
|
2658
|
-
|
|
2766
|
+
type: "component",
|
|
2767
|
+
name: "plasmic-antd5-option",
|
|
2768
|
+
props: {
|
|
2769
|
+
value: "option1",
|
|
2770
|
+
children: {
|
|
2771
|
+
type: "text",
|
|
2772
|
+
value: "Option 1"
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
},
|
|
2776
|
+
{
|
|
2777
|
+
type: "component",
|
|
2778
|
+
name: "plasmic-antd5-option",
|
|
2779
|
+
props: {
|
|
2780
|
+
value: "option2",
|
|
2781
|
+
children: {
|
|
2782
|
+
type: "text",
|
|
2783
|
+
value: "Option 1"
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2659
2786
|
}
|
|
2660
2787
|
]
|
|
2788
|
+
},
|
|
2789
|
+
label: {
|
|
2790
|
+
type: "slot",
|
|
2791
|
+
defaultValue: "Group label"
|
|
2661
2792
|
}
|
|
2662
|
-
}
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
importName: "AntdInputNumber"
|
|
2793
|
+
},
|
|
2794
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerSelect",
|
|
2795
|
+
importName: "AntdOptionGroup"
|
|
2666
2796
|
});
|
|
2667
2797
|
}
|
|
2668
2798
|
|
|
@@ -2670,7 +2800,6 @@ function registerAll(loader) {
|
|
|
2670
2800
|
registerConfigProvider(loader);
|
|
2671
2801
|
registerTokens(loader);
|
|
2672
2802
|
registerSelect(loader);
|
|
2673
|
-
registerTable(loader);
|
|
2674
2803
|
registerCheckbox(loader);
|
|
2675
2804
|
registerRadio(loader);
|
|
2676
2805
|
registerModal(loader);
|