@plasmicpkgs/antd 0.0.75 → 0.0.78
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/antd.cjs.development.js +5 -5
- package/dist/antd.cjs.development.js.map +1 -1
- package/dist/antd.cjs.production.min.js +1 -1
- package/dist/antd.cjs.production.min.js.map +1 -1
- package/dist/antd.esm.js +5 -5
- package/dist/antd.esm.js.map +1 -1
- package/package.json +7 -6
- package/skinny/customControls-8143c119.js +27 -0
- package/skinny/customControls-8143c119.js.map +1 -0
- package/skinny/customControls.d.ts +17 -0
- package/skinny/index.d.ts +15 -0
- package/skinny/package.json +3 -0
- package/skinny/registerButton.d.ts +5 -0
- package/skinny/registerButton.js +98 -0
- package/skinny/registerButton.js.map +1 -0
- package/skinny/registerCarousel.d.ts +5 -0
- package/skinny/registerCarousel.js +84 -0
- package/skinny/registerCarousel.js.map +1 -0
- package/skinny/registerCheckbox.d.ts +8 -0
- package/skinny/registerCheckbox.js +144 -0
- package/skinny/registerCheckbox.js.map +1 -0
- package/skinny/registerCollapse.d.ts +14 -0
- package/skinny/registerCollapse.js +177 -0
- package/skinny/registerCollapse.js.map +1 -0
- package/skinny/registerDropdown.d.ts +11 -0
- package/skinny/registerDropdown.js +194 -0
- package/skinny/registerDropdown.js.map +1 -0
- package/skinny/registerInput.d.ts +14 -0
- package/skinny/registerInput.js +345 -0
- package/skinny/registerInput.js.map +1 -0
- package/skinny/registerMenu.d.ts +15 -0
- package/skinny/registerMenu.js +330 -0
- package/skinny/registerMenu.js.map +1 -0
- package/skinny/registerOption.d.ts +8 -0
- package/skinny/registerOption.js +99 -0
- package/skinny/registerOption.js.map +1 -0
- package/skinny/registerSelect.d.ts +8 -0
- package/skinny/registerSelect.js +148 -0
- package/skinny/registerSelect.js.map +1 -0
- package/skinny/registerSlider.d.ts +19 -0
- package/skinny/registerSlider.js +124 -0
- package/skinny/registerSlider.js.map +1 -0
- package/skinny/registerSwitch.d.ts +5 -0
- package/skinny/registerSwitch.js +73 -0
- package/skinny/registerSwitch.js.map +1 -0
- package/skinny/registerTabs.d.ts +13 -0
- package/skinny/registerTabs.js +259 -0
- package/skinny/registerTabs.js.map +1 -0
- package/skinny/registerable.d.ts +4 -0
- package/skinny/tslib.es6-40998fef.js +59 -0
- package/skinny/tslib.es6-40998fef.js.map +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
+
import type { SliderRangeProps, SliderSingleProps } from "antd/lib/slider";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Registerable } from "./registerable";
|
|
5
|
+
declare type SliderProps = Omit<SliderSingleProps | SliderRangeProps, "value" | "defaultValue"> & {
|
|
6
|
+
value?: number;
|
|
7
|
+
defaultValue?: number;
|
|
8
|
+
value2?: number;
|
|
9
|
+
defaultValue2?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const Slider: React.ForwardRefExoticComponent<Pick<SliderSingleProps | SliderRangeProps, "range" | "onChange" | "onAfterChange" | "handleStyle" | "trackStyle" | "prefixCls" | "tooltipPrefixCls" | "reverse" | "min" | "max" | "step" | "marks" | "dots" | "included" | "disabled" | "vertical" | "tipFormatter" | "className" | "id" | "style" | "tooltipVisible" | "tooltipPlacement" | "getTooltipPopupContainer" | "autoFocus"> & {
|
|
12
|
+
value?: number | undefined;
|
|
13
|
+
defaultValue?: number | undefined;
|
|
14
|
+
value2?: number | undefined;
|
|
15
|
+
defaultValue2?: number | undefined;
|
|
16
|
+
} & React.RefAttributes<unknown>>;
|
|
17
|
+
export declare const sliderMeta: ComponentMeta<SliderProps>;
|
|
18
|
+
export declare function registerSlider(loader?: Registerable, customSliderMeta?: ComponentMeta<SliderProps>): void;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('./tslib.es6-40998fef.js');
|
|
6
|
+
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
7
|
+
var AntdSlider = require('antd/lib/slider');
|
|
8
|
+
var React = require('react');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var registerComponent__default = /*#__PURE__*/_interopDefaultLegacy(registerComponent);
|
|
13
|
+
var AntdSlider__default = /*#__PURE__*/_interopDefaultLegacy(AntdSlider);
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
+
|
|
16
|
+
var Slider = React__default['default'].forwardRef(function (_a, ref) {
|
|
17
|
+
var value = _a.value, defaultValue = _a.defaultValue, value2 = _a.value2, defaultValue2 = _a.defaultValue2, props = tslib_es6.__rest(_a, ["value", "defaultValue", "value2", "defaultValue2"]);
|
|
18
|
+
var newProps = tslib_es6.__assign({}, props);
|
|
19
|
+
if (props.range) {
|
|
20
|
+
if (typeof value === "number" || typeof value2 === "number") {
|
|
21
|
+
newProps.value = [value !== null && value !== void 0 ? value : 0, value2 !== null && value2 !== void 0 ? value2 : 0];
|
|
22
|
+
}
|
|
23
|
+
if (typeof defaultValue === "number" ||
|
|
24
|
+
typeof defaultValue2 === "number") {
|
|
25
|
+
newProps.defaultValue = [defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0, defaultValue2 !== null && defaultValue2 !== void 0 ? defaultValue2 : 0];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
if (typeof value === "number") {
|
|
30
|
+
newProps.value = value;
|
|
31
|
+
}
|
|
32
|
+
if (typeof defaultValue === "number") {
|
|
33
|
+
newProps.defaultValue = defaultValue;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return React__default['default'].createElement(AntdSlider__default['default'], tslib_es6.__assign({}, newProps, { ref: ref }));
|
|
37
|
+
});
|
|
38
|
+
var sliderMeta = {
|
|
39
|
+
name: "AntdSlider",
|
|
40
|
+
displayName: "Antd Slider",
|
|
41
|
+
props: {
|
|
42
|
+
max: {
|
|
43
|
+
type: "number",
|
|
44
|
+
description: "The maximum value the slider can slide to",
|
|
45
|
+
defaultValueHint: 100,
|
|
46
|
+
},
|
|
47
|
+
min: {
|
|
48
|
+
type: "number",
|
|
49
|
+
description: "The minimum value the slider can slide to",
|
|
50
|
+
defaultValueHint: 0,
|
|
51
|
+
},
|
|
52
|
+
included: {
|
|
53
|
+
type: "boolean",
|
|
54
|
+
description: "Make effect when marks not null, true means containment and false means coordinative",
|
|
55
|
+
defaultValueHint: true,
|
|
56
|
+
},
|
|
57
|
+
disabled: {
|
|
58
|
+
type: "boolean",
|
|
59
|
+
description: "If true, the slider will not be interactable",
|
|
60
|
+
defaultValueHint: false,
|
|
61
|
+
},
|
|
62
|
+
range: {
|
|
63
|
+
type: "boolean",
|
|
64
|
+
description: "Dual thumb mode",
|
|
65
|
+
defaultValueHint: false,
|
|
66
|
+
},
|
|
67
|
+
reverse: {
|
|
68
|
+
type: "boolean",
|
|
69
|
+
description: "Reverse the component",
|
|
70
|
+
defaultValueHint: false,
|
|
71
|
+
},
|
|
72
|
+
vertical: {
|
|
73
|
+
type: "boolean",
|
|
74
|
+
description: "If true, the slider will be vertical",
|
|
75
|
+
defaultValueHint: false,
|
|
76
|
+
},
|
|
77
|
+
value: {
|
|
78
|
+
type: "number",
|
|
79
|
+
editOnly: true,
|
|
80
|
+
uncontrolledProp: "defaultValue",
|
|
81
|
+
description: "The default value of slider",
|
|
82
|
+
},
|
|
83
|
+
value2: {
|
|
84
|
+
type: "number",
|
|
85
|
+
displayName: "value 2",
|
|
86
|
+
editOnly: true,
|
|
87
|
+
uncontrolledProp: "defaultValue2",
|
|
88
|
+
description: "The default value for the second value of the slider",
|
|
89
|
+
hidden: function (props) { return !props.range; },
|
|
90
|
+
},
|
|
91
|
+
step: {
|
|
92
|
+
type: "number",
|
|
93
|
+
description: "The granularity the slider can step through values. Must greater than 0, and be divided by (max - min)." +
|
|
94
|
+
" When marks no null, step can be null",
|
|
95
|
+
defaultValueHint: 1,
|
|
96
|
+
},
|
|
97
|
+
marks: {
|
|
98
|
+
type: "object",
|
|
99
|
+
description: "Tick mark of Slider, type of key must be number, and must in closed interval [min, max]," +
|
|
100
|
+
" each mark can declare its own style",
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
defaultStyles: {
|
|
104
|
+
width: "200px",
|
|
105
|
+
maxWidth: "100%",
|
|
106
|
+
},
|
|
107
|
+
importPath: "@plasmicpkgs/antd/skinny/registerSlider",
|
|
108
|
+
importName: "Slider",
|
|
109
|
+
};
|
|
110
|
+
function registerSlider(loader, customSliderMeta) {
|
|
111
|
+
var doRegisterComponent = function () {
|
|
112
|
+
var args = [];
|
|
113
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
114
|
+
args[_i] = arguments[_i];
|
|
115
|
+
}
|
|
116
|
+
return loader ? loader.registerComponent.apply(loader, args) : registerComponent__default['default'].apply(void 0, args);
|
|
117
|
+
};
|
|
118
|
+
doRegisterComponent(Slider, customSliderMeta !== null && customSliderMeta !== void 0 ? customSliderMeta : sliderMeta);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
exports.Slider = Slider;
|
|
122
|
+
exports.registerSlider = registerSlider;
|
|
123
|
+
exports.sliderMeta = sliderMeta;
|
|
124
|
+
//# sourceMappingURL=registerSlider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerSlider.js","sources":["../src/registerSlider.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { default as AntdSlider } from \"antd/lib/slider\";\nimport type { SliderRangeProps, SliderSingleProps } from \"antd/lib/slider\";\nimport React from \"react\";\nimport { Registerable } from \"./registerable\";\n\ntype SliderProps = Omit<\n SliderSingleProps | SliderRangeProps,\n \"value\" | \"defaultValue\"\n> & {\n value?: number;\n defaultValue?: number;\n value2?: number;\n defaultValue2?: number;\n};\n\nexport const Slider = React.forwardRef<unknown, SliderProps>(\n ({ value, defaultValue, value2, defaultValue2, ...props }, ref) => {\n const newProps = { ...props } as SliderSingleProps | SliderRangeProps;\n if (props.range) {\n if (typeof value === \"number\" || typeof value2 === \"number\") {\n newProps.value = [value ?? 0, value2 ?? 0];\n }\n if (\n typeof defaultValue === \"number\" ||\n typeof defaultValue2 === \"number\"\n ) {\n newProps.defaultValue = [defaultValue ?? 0, defaultValue2 ?? 0];\n }\n } else {\n if (typeof value === \"number\") {\n newProps.value = value;\n }\n if(typeof defaultValue === \"number\") {\n newProps.defaultValue = defaultValue;\n }\n }\n return <AntdSlider {...newProps} ref={ref} />;\n }\n);\n\nexport const sliderMeta: ComponentMeta<SliderProps> = {\n name: \"AntdSlider\",\n displayName: \"Antd Slider\",\n props: {\n max: {\n type: \"number\",\n description: \"The maximum value the slider can slide to\",\n defaultValueHint: 100,\n },\n min: {\n type: \"number\",\n description: \"The minimum value the slider can slide to\",\n defaultValueHint: 0,\n },\n included: {\n type: \"boolean\",\n description:\n \"Make effect when marks not null, true means containment and false means coordinative\",\n defaultValueHint: true,\n },\n disabled: {\n type: \"boolean\",\n description: \"If true, the slider will not be interactable\",\n defaultValueHint: false,\n },\n range: {\n type: \"boolean\",\n description: \"Dual thumb mode\",\n defaultValueHint: false,\n },\n reverse: {\n type: \"boolean\",\n description: \"Reverse the component\",\n defaultValueHint: false,\n },\n vertical: {\n type: \"boolean\",\n description: \"If true, the slider will be vertical\",\n defaultValueHint: false,\n },\n value: {\n type: \"number\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The default value of slider\",\n },\n value2: {\n type: \"number\",\n displayName: \"value 2\",\n editOnly: true,\n uncontrolledProp: \"defaultValue2\",\n description: \"The default value for the second value of the slider\",\n hidden: (props) => !props.range,\n },\n step: {\n type: \"number\",\n description:\n \"The granularity the slider can step through values. Must greater than 0, and be divided by (max - min).\" +\n \" When marks no null, step can be null\",\n defaultValueHint: 1,\n },\n marks: {\n type: \"object\",\n description:\n \"Tick mark of Slider, type of key must be number, and must in closed interval [min, max],\" +\n \" each mark can declare its own style\",\n },\n },\n defaultStyles: {\n width: \"200px\",\n maxWidth: \"100%\",\n },\n importPath: \"@plasmicpkgs/antd/skinny/registerSlider\",\n importName: \"Slider\",\n};\n\nexport function registerSlider(\n loader?: Registerable,\n customSliderMeta?: ComponentMeta<SliderProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Slider, customSliderMeta ?? sliderMeta);\n}\n"],"names":["React","__assign","AntdSlider","registerComponent"],"mappings":";;;;;;;;;;;;;;;IAkBa,MAAM,GAAGA,yBAAK,CAAC,UAAU,CACpC,UAAC,EAAwD,EAAE,GAAG;IAA3D,IAAA,KAAK,WAAA,EAAE,YAAY,kBAAA,EAAE,MAAM,YAAA,EAAE,aAAa,mBAAA,EAAK,KAAK,wBAAtD,oDAAwD,CAAF;IACrD,IAAM,QAAQ,GAAGC,uBAAK,KAAK,CAA0C,CAAC;IACtE,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAC3D,QAAQ,CAAC,KAAK,GAAG,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,CAAC,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,CAAC,CAAC,CAAC;SAC5C;QACD,IACE,OAAO,YAAY,KAAK,QAAQ;YAChC,OAAO,aAAa,KAAK,QAAQ,EACjC;YACA,QAAQ,CAAC,YAAY,GAAG,CAAC,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,CAAC,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,CAAC,CAAC,CAAC;SACjE;KACF;SAAM;QACL,IAAI,OAAO,KAAK,KAAK,QAAQ,EAA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YACd,gBAAgB,EAAE,eAAe;YACjC,WAAW,EAAE,sDAAsD;YACnE,MAAM,EAAE,UAAC,KAAK,IAAK,OAAA,CAAC,KAAK,CAAC,KAAK,GAAA;SAChC;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,yGAAyG;gBACzG,uCAAuC;YACzC,gBAAgB,EAAE,CAAC;SACpB;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,0FAA0F;gBAC1F,sCAAsC;SACzC;KACF;IACD,aAAa,EAAE;QACb,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,MAAM;KACjB;IACD,UAAU,EAAE,yCAAyC;IACrD,UAAU,EAAE,QAAQ;EACpB;SAEc,cAAc,CAC5B,MAAqB,EACrB,gBAA6C;IAE7C,IAAM,mBAAmB,GAA6B;QAAC,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QAC5D,OAAA,MAAM,GAAG,MAAM,CAAC,iBAAiB,OAAxB,MAAM,EAAsB,IAAI,IAAIC,qCAAiB,eAAI,IAAI,CAAC;KAAA,CAAC;IAC1E,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,UAAU,CAAC,CAAC;AAC9D;;;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
+
import { SwitchProps } from "antd/lib/switch";
|
|
3
|
+
import { Registerable } from "./registerable";
|
|
4
|
+
export declare const switchMeta: ComponentMeta<SwitchProps>;
|
|
5
|
+
export declare function registerSwitch(loader?: Registerable, customSwitchMeta?: ComponentMeta<SwitchProps>): void;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
6
|
+
var Switch = require('antd/lib/switch');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var registerComponent__default = /*#__PURE__*/_interopDefaultLegacy(registerComponent);
|
|
11
|
+
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
12
|
+
|
|
13
|
+
var switchMeta = {
|
|
14
|
+
name: "AntdSwitch",
|
|
15
|
+
displayName: "Antd Switch",
|
|
16
|
+
props: {
|
|
17
|
+
autoFocus: {
|
|
18
|
+
type: "boolean",
|
|
19
|
+
description: "Whether get focus when component mounted",
|
|
20
|
+
defaultValueHint: false,
|
|
21
|
+
},
|
|
22
|
+
checked: {
|
|
23
|
+
type: "boolean",
|
|
24
|
+
editOnly: true,
|
|
25
|
+
uncontrolledProp: "defaultChecked",
|
|
26
|
+
description: "Whether to set the initial state",
|
|
27
|
+
defaultValueHint: false,
|
|
28
|
+
},
|
|
29
|
+
disabled: {
|
|
30
|
+
type: "boolean",
|
|
31
|
+
description: "Disable switch",
|
|
32
|
+
defaultValueHint: false,
|
|
33
|
+
},
|
|
34
|
+
loading: {
|
|
35
|
+
type: "boolean",
|
|
36
|
+
description: "Loading state of switch",
|
|
37
|
+
defaultValueHint: false,
|
|
38
|
+
},
|
|
39
|
+
checkedChildren: {
|
|
40
|
+
type: "slot",
|
|
41
|
+
defaultValue: [],
|
|
42
|
+
hidePlaceholder: true,
|
|
43
|
+
},
|
|
44
|
+
unCheckedChildren: {
|
|
45
|
+
type: "slot",
|
|
46
|
+
defaultValue: [],
|
|
47
|
+
hidePlaceholder: true,
|
|
48
|
+
},
|
|
49
|
+
size: {
|
|
50
|
+
type: "choice",
|
|
51
|
+
options: ["small", "default"],
|
|
52
|
+
description: "The size of the Switch",
|
|
53
|
+
defaultValueHint: "default",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
importPath: "antd/lib/switch",
|
|
57
|
+
importName: "Switch",
|
|
58
|
+
isDefaultExport: true,
|
|
59
|
+
};
|
|
60
|
+
function registerSwitch(loader, customSwitchMeta) {
|
|
61
|
+
var doRegisterComponent = function () {
|
|
62
|
+
var args = [];
|
|
63
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
64
|
+
args[_i] = arguments[_i];
|
|
65
|
+
}
|
|
66
|
+
return loader ? loader.registerComponent.apply(loader, args) : registerComponent__default['default'].apply(void 0, args);
|
|
67
|
+
};
|
|
68
|
+
doRegisterComponent(Switch__default['default'], customSwitchMeta !== null && customSwitchMeta !== void 0 ? customSwitchMeta : switchMeta);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
exports.registerSwitch = registerSwitch;
|
|
72
|
+
exports.switchMeta = switchMeta;
|
|
73
|
+
//# sourceMappingURL=registerSwitch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerSwitch.js","sources":["../src/registerSwitch.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport Switch, { SwitchProps } from \"antd/lib/switch\";\nimport { Registerable } from \"./registerable\";\n\nexport const switchMeta: ComponentMeta<SwitchProps> = {\n name: \"AntdSwitch\",\n displayName: \"Antd Switch\",\n props: {\n autoFocus: {\n type: \"boolean\",\n description: \"Whether get focus when component mounted\",\n defaultValueHint: false,\n },\n checked: {\n type: \"boolean\",\n editOnly: true,\n uncontrolledProp: \"defaultChecked\",\n description: \"Whether to set the initial state\",\n defaultValueHint: false,\n },\n disabled: {\n type: \"boolean\",\n description: \"Disable switch\",\n defaultValueHint: false,\n },\n loading: {\n type: \"boolean\",\n description: \"Loading state of switch\",\n defaultValueHint: false,\n },\n checkedChildren: {\n type: \"slot\",\n defaultValue: [],\n hidePlaceholder: true,\n },\n unCheckedChildren: {\n type: \"slot\",\n defaultValue: [],\n hidePlaceholder: true,\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"default\"],\n description: \"The size of the Switch\",\n defaultValueHint: \"default\",\n },\n },\n importPath: \"antd/lib/switch\",\n importName: \"Switch\",\n isDefaultExport: true,\n};\n\nexport function registerSwitch(\n loader?: Registerable,\n customSwitchMeta?: ComponentMeta<SwitchProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Switch, customSwitchMeta ?? switchMeta);\n}\n"],"names":["registerComponent","Switch"],"mappings":";;;;;;;;;;;;IAMa,UAAU,GAA+B;IACpD,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE;QACL,SAAS,EAAE;YACT,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,0CAA0C;YACvD,gBAAgB,EAAE,KAAK;SACxB;QACD,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,gBAAgB,EAAE,gBAAgB;YAClC,WAAW,EAAE,kCAAkC;YAC/C,gBAAgB,EAAE,KAAK;SACxB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,gBAAgB;YAC7B,gBAAgB,EAAE,KAAK;SACxB;QACD,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,yBAAyB;YACtC,gBAAgB,EAAE,KAAK;SACxB;QACD,eAAe,EAAE;YACf,IAAI,EAAE,MAAM;YACZ,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,IAAI;SACtB;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,MAAM;YACZ,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,IAAI;SACtB;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;YAC7B,WAAW,EAAE,wBAAwB;YACrC,gBAAgB,EAAE,SAAS;SAC5B;KACF;IACD,UAAU,EAAE,iBAAiB;IAC7B,UAAU,EAAE,QAAQ;IACpB,eAAe,EAAE,IAAI;EACrB;SAEc,cAAc,CAC5B,MAAqB,EACrB,gBAA6C;IAE7C,IAAM,mBAAmB,GAA6B;QAAC,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QAC5D,OAAA,MAAM,GAAG,MAAM,CAAC,iBAAiB,OAAxB,MAAM,EAAsB,IAAI,IAAIA,qCAAiB,eAAI,IAAI,CAAC;KAAA,CAAC;IAC1E,mBAAmB,CAACC,0BAAM,EAAE,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,UAAU,CAAC,CAAC;AAC9D;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
+
import { TabPaneProps, TabsProps as AntdTabsProps } from "antd/lib/tabs";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Registerable } from "./registerable";
|
|
5
|
+
export declare const tabPaneMeta: ComponentMeta<TabPaneProps>;
|
|
6
|
+
export declare function registerTabPane(loader?: Registerable, customTabPaneMeta?: ComponentMeta<TabPaneProps>): void;
|
|
7
|
+
export declare type TabsProps = Omit<AntdTabsProps, "tabBarExtraContent"> & {
|
|
8
|
+
leftTabBarExtraContent?: React.ReactNode;
|
|
9
|
+
rightTabBarExtraContent?: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare function Tabs(props: TabsProps): JSX.Element;
|
|
12
|
+
export declare const tabsMeta: ComponentMeta<TabsProps>;
|
|
13
|
+
export declare function registerTabs(loader?: Registerable, customTabsMeta?: ComponentMeta<TabsProps>): void;
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('./tslib.es6-40998fef.js');
|
|
6
|
+
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
7
|
+
var antd = require('antd');
|
|
8
|
+
var AntdTabs = require('antd/lib/tabs');
|
|
9
|
+
var rcTabs = require('rc-tabs');
|
|
10
|
+
var React = require('react');
|
|
11
|
+
var customControls = require('./customControls-8143c119.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var registerComponent__default = /*#__PURE__*/_interopDefaultLegacy(registerComponent);
|
|
16
|
+
var AntdTabs__default = /*#__PURE__*/_interopDefaultLegacy(AntdTabs);
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
+
|
|
19
|
+
var tabPaneMeta = {
|
|
20
|
+
name: "AntdTabPane",
|
|
21
|
+
displayName: "Antd Tab Pane",
|
|
22
|
+
props: {
|
|
23
|
+
tab: {
|
|
24
|
+
type: "slot",
|
|
25
|
+
defaultValue: [
|
|
26
|
+
{
|
|
27
|
+
type: "text",
|
|
28
|
+
value: "Tab",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
key: {
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "Unique TabPane's key",
|
|
35
|
+
defaultValue: "tabPaneKey",
|
|
36
|
+
},
|
|
37
|
+
closable: {
|
|
38
|
+
type: "boolean",
|
|
39
|
+
description: "Wether the tab can be closed or not. Only works for editable tabs",
|
|
40
|
+
defaultValueHint: true,
|
|
41
|
+
},
|
|
42
|
+
disabled: {
|
|
43
|
+
type: "boolean",
|
|
44
|
+
description: "Disabled state of tab",
|
|
45
|
+
defaultValueHint: false,
|
|
46
|
+
},
|
|
47
|
+
forceRender: {
|
|
48
|
+
type: "boolean",
|
|
49
|
+
description: "Forced render of content in tabs, not lazy render after clicking on tabs",
|
|
50
|
+
defaultValueHint: false,
|
|
51
|
+
},
|
|
52
|
+
closeIcon: {
|
|
53
|
+
type: "slot",
|
|
54
|
+
hidePlaceholder: true,
|
|
55
|
+
},
|
|
56
|
+
children: {
|
|
57
|
+
type: "slot",
|
|
58
|
+
defaultValue: [
|
|
59
|
+
{
|
|
60
|
+
type: "text",
|
|
61
|
+
value: "Tab Content",
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
parentComponentName: "AntdTabs",
|
|
67
|
+
importPath: "rc-tabs",
|
|
68
|
+
importName: "TabPane",
|
|
69
|
+
};
|
|
70
|
+
function registerTabPane(loader, customTabPaneMeta) {
|
|
71
|
+
var doRegisterComponent = function () {
|
|
72
|
+
var args = [];
|
|
73
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
74
|
+
args[_i] = arguments[_i];
|
|
75
|
+
}
|
|
76
|
+
return loader ? loader.registerComponent.apply(loader, args) : registerComponent__default['default'].apply(void 0, args);
|
|
77
|
+
};
|
|
78
|
+
doRegisterComponent(rcTabs.TabPane, customTabPaneMeta !== null && customTabPaneMeta !== void 0 ? customTabPaneMeta : tabPaneMeta);
|
|
79
|
+
}
|
|
80
|
+
function Tabs(props) {
|
|
81
|
+
var leftTabBarExtraContent = props.leftTabBarExtraContent, rightTabBarExtraContent = props.rightTabBarExtraContent, otherProps = tslib_es6.__rest(props, ["leftTabBarExtraContent", "rightTabBarExtraContent"]);
|
|
82
|
+
return (React__default['default'].createElement(AntdTabs__default['default'], tslib_es6.__assign({}, otherProps, { tabBarExtraContent: {
|
|
83
|
+
left: leftTabBarExtraContent,
|
|
84
|
+
right: rightTabBarExtraContent,
|
|
85
|
+
} })));
|
|
86
|
+
}
|
|
87
|
+
function AddTab(_a) {
|
|
88
|
+
var studioOps = _a.studioOps;
|
|
89
|
+
var _b = React__default['default'].useState(""), tabKey = _b[0], setTabKey = _b[1];
|
|
90
|
+
var appendNewTab = function (tabKey) {
|
|
91
|
+
if (tabKey !== "") {
|
|
92
|
+
studioOps.appendToSlot({
|
|
93
|
+
type: "component",
|
|
94
|
+
name: "AntdTabPane",
|
|
95
|
+
props: {
|
|
96
|
+
key: tabKey,
|
|
97
|
+
},
|
|
98
|
+
}, "children");
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
return (React__default['default'].createElement("div", { style: {
|
|
102
|
+
width: "100%",
|
|
103
|
+
display: "flex",
|
|
104
|
+
flexDirection: "row",
|
|
105
|
+
gap: "10px",
|
|
106
|
+
justifyContent: "space-between",
|
|
107
|
+
} },
|
|
108
|
+
React__default['default'].createElement(antd.Input, { placeholder: "Tab key", onChange: function (e) { return setTabKey(e.target.value); }, value: tabKey }),
|
|
109
|
+
React__default['default'].createElement(antd.Button, { onClick: function () {
|
|
110
|
+
appendNewTab(tabKey);
|
|
111
|
+
setTabKey("");
|
|
112
|
+
} }, "Add tab")));
|
|
113
|
+
}
|
|
114
|
+
var tabsMeta = {
|
|
115
|
+
name: "AntdTabs",
|
|
116
|
+
displayName: "Antd Tabs",
|
|
117
|
+
props: {
|
|
118
|
+
type: {
|
|
119
|
+
type: "choice",
|
|
120
|
+
options: ["line", "card", "editable-card"],
|
|
121
|
+
defaultValueHint: "line",
|
|
122
|
+
description: "Basic style of tabs",
|
|
123
|
+
},
|
|
124
|
+
addIcon: {
|
|
125
|
+
type: "slot",
|
|
126
|
+
hidePlaceholder: true,
|
|
127
|
+
},
|
|
128
|
+
animated: {
|
|
129
|
+
type: "object",
|
|
130
|
+
hidden: function (props) { return props.tabPosition !== "top" && !!props.tabPosition; },
|
|
131
|
+
defaultValueHint: { inkBar: true, tabPane: false },
|
|
132
|
+
description: "Whether to change tabs with animation. Can be either a boolean or specify for inkBar and tabPane",
|
|
133
|
+
},
|
|
134
|
+
hideAdd: {
|
|
135
|
+
type: "boolean",
|
|
136
|
+
hidden: function (props) { return props.type !== "editable-card"; },
|
|
137
|
+
defaultValueHint: false,
|
|
138
|
+
description: "Hide plus icon or not",
|
|
139
|
+
},
|
|
140
|
+
moreIcon: {
|
|
141
|
+
type: "slot",
|
|
142
|
+
hidePlaceholder: true,
|
|
143
|
+
},
|
|
144
|
+
size: {
|
|
145
|
+
type: "choice",
|
|
146
|
+
options: ["large", "default", "small"],
|
|
147
|
+
defaultValueHint: "default",
|
|
148
|
+
description: "Preset tab bar size",
|
|
149
|
+
},
|
|
150
|
+
tabPosition: {
|
|
151
|
+
type: "choice",
|
|
152
|
+
options: ["top", "right", "bottom", "left"],
|
|
153
|
+
defaultValueHint: "top",
|
|
154
|
+
description: "Position of tabs",
|
|
155
|
+
},
|
|
156
|
+
tabBarGutter: {
|
|
157
|
+
type: "number",
|
|
158
|
+
description: "The gap between tabs",
|
|
159
|
+
},
|
|
160
|
+
centered: {
|
|
161
|
+
type: "boolean",
|
|
162
|
+
description: "Centers tabs",
|
|
163
|
+
defaultValueHint: false,
|
|
164
|
+
},
|
|
165
|
+
leftTabBarExtraContent: {
|
|
166
|
+
type: "slot",
|
|
167
|
+
hidePlaceholder: true,
|
|
168
|
+
},
|
|
169
|
+
rightTabBarExtraContent: {
|
|
170
|
+
type: "slot",
|
|
171
|
+
hidePlaceholder: true,
|
|
172
|
+
},
|
|
173
|
+
tabBarStyle: {
|
|
174
|
+
type: "object",
|
|
175
|
+
description: "CSS for the Tab Bar style",
|
|
176
|
+
},
|
|
177
|
+
activeKey: {
|
|
178
|
+
type: "choice",
|
|
179
|
+
editOnly: true,
|
|
180
|
+
uncontrolledProp: "defaultActiveKey",
|
|
181
|
+
description: "Initial active TabPane's key",
|
|
182
|
+
options: function (props) {
|
|
183
|
+
var options = new Set();
|
|
184
|
+
customControls.traverseReactEltTree(props.children, function (elt) {
|
|
185
|
+
if ((elt === null || elt === void 0 ? void 0 : elt.type) === rcTabs.TabPane && typeof (elt === null || elt === void 0 ? void 0 : elt.key) === "string") {
|
|
186
|
+
options.add(elt.key);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
return Array.from(options.keys());
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
children: {
|
|
193
|
+
type: "slot",
|
|
194
|
+
allowedComponents: ["AntdTabPane"],
|
|
195
|
+
defaultValue: [
|
|
196
|
+
{
|
|
197
|
+
type: "component",
|
|
198
|
+
name: "AntdTabPane",
|
|
199
|
+
props: {
|
|
200
|
+
key: "1",
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
type: "component",
|
|
205
|
+
name: "AntdTabPane",
|
|
206
|
+
props: {
|
|
207
|
+
key: "2",
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
actions: [
|
|
214
|
+
{
|
|
215
|
+
type: "custom-action",
|
|
216
|
+
control: AddTab,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
type: "button-action",
|
|
220
|
+
label: "Delete current tab",
|
|
221
|
+
onClick: function (_a) {
|
|
222
|
+
var componentProps = _a.componentProps, studioOps = _a.studioOps;
|
|
223
|
+
if (componentProps.activeKey) {
|
|
224
|
+
var tabPanes_1 = [];
|
|
225
|
+
customControls.traverseReactEltTree(componentProps.children, function (elt) {
|
|
226
|
+
if ((elt === null || elt === void 0 ? void 0 : elt.type) === rcTabs.TabPane && typeof (elt === null || elt === void 0 ? void 0 : elt.key) === "string") {
|
|
227
|
+
tabPanes_1.push(elt.key);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
var currentTabPos = tabPanes_1.findIndex(function (tabKey) {
|
|
231
|
+
return tabKey === componentProps.activeKey;
|
|
232
|
+
});
|
|
233
|
+
if (currentTabPos !== -1) {
|
|
234
|
+
studioOps.removeFromSlotAt(currentTabPos, "children");
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
importPath: "@plasmicpkgs/antd/skinny/registerTabs",
|
|
241
|
+
importName: "Tabs",
|
|
242
|
+
};
|
|
243
|
+
function registerTabs(loader, customTabsMeta) {
|
|
244
|
+
var doRegisterComponent = function () {
|
|
245
|
+
var args = [];
|
|
246
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
247
|
+
args[_i] = arguments[_i];
|
|
248
|
+
}
|
|
249
|
+
return loader ? loader.registerComponent.apply(loader, args) : registerComponent__default['default'].apply(void 0, args);
|
|
250
|
+
};
|
|
251
|
+
doRegisterComponent(Tabs, customTabsMeta !== null && customTabsMeta !== void 0 ? customTabsMeta : tabsMeta);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
exports.Tabs = Tabs;
|
|
255
|
+
exports.registerTabPane = registerTabPane;
|
|
256
|
+
exports.registerTabs = registerTabs;
|
|
257
|
+
exports.tabPaneMeta = tabPaneMeta;
|
|
258
|
+
exports.tabsMeta = tabsMeta;
|
|
259
|
+
//# sourceMappingURL=registerTabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerTabs.js","sources":["../src/registerTabs.tsx"],"sourcesContent":["import registerComponent, {\n ActionProps,\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { Button, Input } from \"antd\";\nimport {\n default as AntdTabs,\n TabPaneProps,\n TabsProps as AntdTabsProps,\n} from \"antd/lib/tabs\";\nimport { TabPane } from \"rc-tabs\";\nimport React from \"react\";\nimport { traverseReactEltTree } from \"./customControls\";\nimport { Registerable } from \"./registerable\";\n\nexport const tabPaneMeta: ComponentMeta<TabPaneProps> = {\n name: \"AntdTabPane\",\n displayName: \"Antd Tab Pane\",\n props: {\n tab: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Tab\",\n },\n ],\n },\n key: {\n type: \"string\",\n description: \"Unique TabPane's key\",\n defaultValue: \"tabPaneKey\",\n },\n closable: {\n type: \"boolean\",\n description:\n \"Wether the tab can be closed or not. Only works for editable tabs\",\n defaultValueHint: true,\n },\n disabled: {\n type: \"boolean\",\n description: \"Disabled state of tab\",\n defaultValueHint: false,\n },\n forceRender: {\n type: \"boolean\",\n description:\n \"Forced render of content in tabs, not lazy render after clicking on tabs\",\n defaultValueHint: false,\n },\n closeIcon: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Tab Content\",\n },\n ],\n },\n },\n parentComponentName: \"AntdTabs\",\n importPath: \"rc-tabs\",\n importName: \"TabPane\",\n};\n\nexport function registerTabPane(\n loader?: Registerable,\n customTabPaneMeta?: ComponentMeta<TabPaneProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(TabPane, customTabPaneMeta ?? tabPaneMeta);\n}\n\nexport type TabsProps = Omit<AntdTabsProps, \"tabBarExtraContent\"> & {\n leftTabBarExtraContent?: React.ReactNode;\n rightTabBarExtraContent?: React.ReactNode;\n};\n\nexport function Tabs(props: TabsProps) {\n const {\n leftTabBarExtraContent,\n rightTabBarExtraContent,\n ...otherProps\n } = props;\n return (\n <AntdTabs\n {...otherProps}\n tabBarExtraContent={{\n left: leftTabBarExtraContent,\n right: rightTabBarExtraContent,\n }}\n />\n );\n}\n\nfunction AddTab({ studioOps }: ActionProps<any>) {\n const [tabKey, setTabKey] = React.useState<string>(\"\");\n\n const appendNewTab = (tabKey: string) => {\n if (tabKey !== \"\") {\n studioOps.appendToSlot(\n {\n type: \"component\",\n name: \"AntdTabPane\",\n props: {\n key: tabKey,\n },\n },\n \"children\"\n );\n }\n };\n\n return (\n <div\n style={{\n width: \"100%\",\n display: \"flex\",\n flexDirection: \"row\",\n gap: \"10px\",\n justifyContent: \"space-between\",\n }}\n >\n <Input\n placeholder=\"Tab key\"\n onChange={(e) => setTabKey(e.target.value)}\n value={tabKey}\n />\n <Button\n onClick={() => {\n appendNewTab(tabKey);\n setTabKey(\"\");\n }}\n >\n Add tab\n </Button>\n </div>\n );\n}\n\nexport const tabsMeta: ComponentMeta<TabsProps> = {\n name: \"AntdTabs\",\n displayName: \"Antd Tabs\",\n props: {\n type: {\n type: \"choice\",\n options: [\"line\", \"card\", \"editable-card\"],\n defaultValueHint: \"line\",\n description: \"Basic style of tabs\",\n },\n addIcon: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n animated: {\n type: \"object\",\n hidden: (props) => props.tabPosition !== \"top\" && !!props.tabPosition,\n defaultValueHint: { inkBar: true, tabPane: false },\n description:\n \"Whether to change tabs with animation. Can be either a boolean or specify for inkBar and tabPane\",\n },\n hideAdd: {\n type: \"boolean\",\n hidden: (props) => props.type !== \"editable-card\",\n defaultValueHint: false,\n description: \"Hide plus icon or not\",\n },\n moreIcon: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n size: {\n type: \"choice\",\n options: [\"large\", \"default\", \"small\"],\n defaultValueHint: \"default\",\n description: \"Preset tab bar size\",\n },\n tabPosition: {\n type: \"choice\",\n options: [\"top\", \"right\", \"bottom\", \"left\"],\n defaultValueHint: \"top\",\n description: \"Position of tabs\",\n },\n tabBarGutter: {\n type: \"number\",\n description: \"The gap between tabs\",\n },\n centered: {\n type: \"boolean\",\n description: \"Centers tabs\",\n defaultValueHint: false,\n },\n leftTabBarExtraContent: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n rightTabBarExtraContent: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n tabBarStyle: {\n type: \"object\",\n description: \"CSS for the Tab Bar style\",\n },\n activeKey: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultActiveKey\",\n description: \"Initial active TabPane's key\",\n options: (props) => {\n const options = new Set<string>();\n traverseReactEltTree(props.children, (elt) => {\n if (elt?.type === TabPane && typeof elt?.key === \"string\") {\n options.add(elt.key);\n }\n });\n return Array.from(options.keys());\n },\n },\n children: {\n type: \"slot\",\n allowedComponents: [\"AntdTabPane\"],\n defaultValue: [\n {\n type: \"component\",\n name: \"AntdTabPane\",\n props: {\n key: \"1\",\n },\n },\n {\n type: \"component\",\n name: \"AntdTabPane\",\n props: {\n key: \"2\",\n },\n },\n ],\n },\n },\n actions: [\n {\n type: \"custom-action\",\n control: AddTab,\n },\n {\n type: \"button-action\",\n label: \"Delete current tab\",\n onClick: ({ componentProps, studioOps }) => {\n if (componentProps.activeKey) {\n const tabPanes: string[] = [];\n traverseReactEltTree(componentProps.children, (elt) => {\n if (elt?.type === TabPane && typeof elt?.key === \"string\") {\n tabPanes.push(elt.key);\n }\n });\n const currentTabPos = tabPanes.findIndex((tabKey) => {\n return tabKey === componentProps.activeKey;\n });\n if (currentTabPos !== -1) {\n studioOps.removeFromSlotAt(currentTabPos, \"children\");\n }\n }\n },\n },\n ],\n importPath: \"@plasmicpkgs/antd/skinny/registerTabs\",\n importName: \"Tabs\",\n};\n\nexport function registerTabs(\n loader?: Registerable,\n customTabsMeta?: ComponentMeta<TabsProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Tabs, customTabsMeta ?? tabsMeta);\n}\n"],"names":["registerComponent","TabPane","React","AntdTabs","Input","Button","traverseReactEltTree"],"mappings":";;;;;;;;;;;;;;;;;;IAea,WAAW,GAAgC;IACtD,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,eAAe;IAC5B,KAAK,EAAE;QACL,GAAG,EAAE;YACH,IAAI,EAAE,MAAM;YACZ,YAAY,EAAE;gBACZ;oBACE,IAAI,EAAE,MAAM;oBACZ,KAAK,EAAE,KAAK;iBACb;aACF;SACF;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,sBAAsB;YACnC,YAAY,EAAE,YAAY;SAC3B;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,WAAW,EACT,mEAAmE;YACrE,gBAAgB,EAAE,IAAI;SACvB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,uBAAuB;YACpC,gBAAgB,EAAE,KAAK;SACxB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,SAAS;YACf,WAAW,EACT,0EAA0E;YAC5E,gBAAgB,EAAE,KAAK;SACxB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,MAAM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qBAC5C,CAAC,CAAC;oBACH,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE;wBACxB,SAAS,CAAC,gBAAgB,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;qBACvD;iBACF;aACF;SACF;KACF;IACD,UAAU,EAAE,uCAAuC;IACnD,UAAU,EAAE,MAAM;EAClB;SAEc,YAAY,CAC1B,MAAqB,EACrB,cAAyC;IAEzC,IAAM,mBAAmB,GAA6B;QAAC,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QAC5D,OAAA,MAAM,GAAG,MAAM,CAAC,iBAAiB,OAAxB,MAAM,EAAsB,IAAI,IAAID,qCAAiB,eAAI,IAAI,CAAC;KAAA,CAAC;IAC1E,mBAAmB,CAAC,IAAI,EAAE,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,QAAQ,CAAC,CAAC;AACxD;;;;;;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/*! *****************************************************************************
|
|
4
|
+
Copyright (c) Microsoft Corporation.
|
|
5
|
+
|
|
6
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
+
purpose with or without fee is hereby granted.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
***************************************************************************** */
|
|
17
|
+
/* global Reflect, Promise */
|
|
18
|
+
|
|
19
|
+
var extendStatics = function(d, b) {
|
|
20
|
+
extendStatics = Object.setPrototypeOf ||
|
|
21
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
22
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
23
|
+
return extendStatics(d, b);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function __extends(d, b) {
|
|
27
|
+
if (typeof b !== "function" && b !== null)
|
|
28
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
29
|
+
extendStatics(d, b);
|
|
30
|
+
function __() { this.constructor = d; }
|
|
31
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
exports.__assign = function() {
|
|
35
|
+
exports.__assign = Object.assign || function __assign(t) {
|
|
36
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37
|
+
s = arguments[i];
|
|
38
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
39
|
+
}
|
|
40
|
+
return t;
|
|
41
|
+
};
|
|
42
|
+
return exports.__assign.apply(this, arguments);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
function __rest(s, e) {
|
|
46
|
+
var t = {};
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
+
t[p] = s[p];
|
|
49
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
+
t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
exports.__extends = __extends;
|
|
58
|
+
exports.__rest = __rest;
|
|
59
|
+
//# sourceMappingURL=tslib.es6-40998fef.js.map
|