@salutejs/plasma-sb-utils 0.226.1-next-sbcom.0 → 0.227.0-dev.0
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/lib/components/Combobox/Combobox.d.ts +408 -0
- package/lib/components/Combobox/Combobox.js +94 -0
- package/lib/components/Combobox/Combobox.js.map +1 -0
- package/lib/components/Combobox/fixtures.d.ts +42 -0
- package/lib/components/Combobox/fixtures.js +364 -0
- package/lib/components/Combobox/fixtures.js.map +1 -0
- package/lib/components/Combobox/index.d.ts +1 -0
- package/lib/components/Combobox/index.js +2 -0
- package/lib/components/Combobox/index.js.map +1 -0
- package/lib/components/Combobox/meta.d.ts +357 -0
- package/lib/components/Combobox/meta.js +149 -0
- package/lib/components/Combobox/meta.js.map +1 -0
- package/lib/components/Combobox/stories.d.ts +4 -0
- package/lib/components/Combobox/stories.js +109 -0
- package/lib/components/Combobox/stories.js.map +1 -0
- package/lib/components/DatePicker/DatePicker.d.ts +1 -0
- package/lib/components/DatePicker/DatePicker.js +4 -4
- package/lib/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/components/DatePicker/stories.d.ts +4 -2
- package/lib/components/DatePicker/stories.js +18 -5
- package/lib/components/DatePicker/stories.js.map +1 -1
- package/lib/components/DateTimePicker/DateTimePicker.d.ts +24 -0
- package/lib/components/DateTimePicker/DateTimePicker.js +2 -2
- package/lib/components/DateTimePicker/DateTimePicker.js.map +1 -1
- package/lib/components/DateTimePicker/fixtures.d.ts +1 -0
- package/lib/components/DateTimePicker/fixtures.js +1 -0
- package/lib/components/DateTimePicker/fixtures.js.map +1 -1
- package/lib/components/DateTimePicker/meta.d.ts +23 -0
- package/lib/components/DateTimePicker/meta.js +13 -3
- package/lib/components/DateTimePicker/meta.js.map +1 -1
- package/lib/components/DateTimePicker/stories.d.ts +1 -1
- package/lib/components/DateTimePicker/stories.js +8 -3
- package/lib/components/DateTimePicker/stories.js.map +1 -1
- package/lib/components/Dropzone/Dropzone.d.ts +122 -0
- package/lib/components/Dropzone/Dropzone.js +40 -0
- package/lib/components/Dropzone/Dropzone.js.map +1 -0
- package/lib/components/Dropzone/fixtures.d.ts +1 -0
- package/lib/components/Dropzone/fixtures.js +2 -0
- package/lib/components/Dropzone/fixtures.js.map +1 -0
- package/lib/components/Dropzone/index.d.ts +1 -0
- package/lib/components/Dropzone/index.js +2 -0
- package/lib/components/Dropzone/index.js.map +1 -0
- package/lib/components/Dropzone/meta.d.ts +117 -0
- package/lib/components/Dropzone/meta.js +81 -0
- package/lib/components/Dropzone/meta.js.map +1 -0
- package/lib/components/Dropzone/stories.d.ts +1 -0
- package/lib/components/Dropzone/stories.js +36 -0
- package/lib/components/Dropzone/stories.js.map +1 -0
- package/lib/components/InformationWrapper/InformationWrapper.d.ts +270 -0
- package/lib/components/InformationWrapper/InformationWrapper.js +40 -0
- package/lib/components/InformationWrapper/InformationWrapper.js.map +1 -0
- package/lib/components/InformationWrapper/fixtures.d.ts +6 -0
- package/lib/components/InformationWrapper/fixtures.js +21 -0
- package/lib/components/InformationWrapper/fixtures.js.map +1 -0
- package/lib/components/InformationWrapper/index.d.ts +1 -0
- package/lib/components/InformationWrapper/index.js +2 -0
- package/lib/components/InformationWrapper/index.js.map +1 -0
- package/lib/components/InformationWrapper/meta.d.ts +265 -0
- package/lib/components/InformationWrapper/meta.js +118 -0
- package/lib/components/InformationWrapper/meta.js.map +1 -0
- package/lib/components/InformationWrapper/stories.d.ts +1 -0
- package/lib/components/InformationWrapper/stories.js +42 -0
- package/lib/components/InformationWrapper/stories.js.map +1 -0
- package/lib/components/NumberInput/fixtures.js +1 -1
- package/lib/components/NumberInput/fixtures.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +195 -0
- package/lib/components/Popover/Popover.js +50 -0
- package/lib/components/Popover/Popover.js.map +1 -0
- package/lib/components/Popover/fixtures.d.ts +5 -0
- package/lib/components/Popover/fixtures.js +29 -0
- package/lib/components/Popover/fixtures.js.map +1 -0
- package/lib/components/Popover/index.d.ts +1 -0
- package/lib/components/Popover/index.js +2 -0
- package/lib/components/Popover/index.js.map +1 -0
- package/lib/components/Popover/meta.d.ts +110 -0
- package/lib/components/Popover/meta.js +78 -0
- package/lib/components/Popover/meta.js.map +1 -0
- package/lib/components/Popover/stories.d.ts +80 -0
- package/lib/components/Popover/stories.js +125 -0
- package/lib/components/Popover/stories.js.map +1 -0
- package/lib/components/Progress/Progress.d.ts +159 -0
- package/lib/components/Progress/Progress.js +38 -0
- package/lib/components/Progress/Progress.js.map +1 -0
- package/lib/components/Progress/fixtures.d.ts +5 -0
- package/lib/components/Progress/fixtures.js +6 -0
- package/lib/components/Progress/fixtures.js.map +1 -0
- package/lib/components/Progress/index.d.ts +1 -0
- package/lib/components/Progress/index.js +2 -0
- package/lib/components/Progress/index.js.map +1 -0
- package/lib/components/Progress/meta.d.ts +154 -0
- package/lib/components/Progress/meta.js +87 -0
- package/lib/components/Progress/meta.js.map +1 -0
- package/lib/components/Progress/stories.d.ts +2 -0
- package/lib/components/Progress/stories.js +59 -0
- package/lib/components/Progress/stories.js.map +1 -0
- package/lib/components/Range/Range.d.ts +1 -0
- package/lib/components/Range/Range.js +2 -2
- package/lib/components/Range/Range.js.map +1 -1
- package/lib/components/Range/stories.d.ts +1 -1
- package/lib/components/Range/stories.js +11 -2
- package/lib/components/Range/stories.js.map +1 -1
- package/lib/components/Select/Select.d.ts +1 -0
- package/lib/components/Select/Select.js +4 -4
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Select/stories.d.ts +5 -3
- package/lib/components/Select/stories.js +10 -7
- package/lib/components/Select/stories.js.map +1 -1
- package/lib/components/Skeleton/Skeleton.d.ts +28 -1
- package/lib/components/Skeleton/stories.d.ts +28 -1
- package/lib/components/Skeleton/stories.js +34 -1
- package/lib/components/Skeleton/stories.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +154 -19
- package/lib/components/TextArea/meta.d.ts +154 -19
- package/lib/components/TextArea/meta.js +92 -141
- package/lib/components/TextArea/meta.js.map +1 -1
- package/lib/components/TextArea/stories.js +8 -9
- package/lib/components/TextArea/stories.js.map +1 -1
- package/lib/components/TextFieldSlider/TextFieldSlider.d.ts +9 -0
- package/lib/components/TextFieldSlider/meta.d.ts +9 -0
- package/lib/components/TextFieldSlider/meta.js +4 -1
- package/lib/components/TextFieldSlider/meta.js.map +1 -1
- package/lib/components/TextFieldSlider/stories.d.ts +1 -1
- package/lib/components/TextFieldSlider/stories.js +13 -4
- package/lib/components/TextFieldSlider/stories.js.map +1 -1
- package/lib/components/TimePicker/TimePicker.d.ts +24 -0
- package/lib/components/TimePicker/TimePicker.js +2 -2
- package/lib/components/TimePicker/TimePicker.js.map +1 -1
- package/lib/components/TimePicker/fixtures.d.ts +1 -0
- package/lib/components/TimePicker/fixtures.js +1 -0
- package/lib/components/TimePicker/fixtures.js.map +1 -1
- package/lib/components/TimePicker/meta.d.ts +23 -0
- package/lib/components/TimePicker/meta.js +13 -3
- package/lib/components/TimePicker/meta.js.map +1 -1
- package/lib/components/TimePicker/stories.d.ts +1 -1
- package/lib/components/TimePicker/stories.js +11 -3
- package/lib/components/TimePicker/stories.js.map +1 -1
- package/lib/components/index.d.ts +5 -0
- package/lib/components/index.js +5 -0
- package/lib/components/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { getConfigVariations } from '../../helpers';
|
|
24
|
+
import { createMeta } from './meta';
|
|
25
|
+
import { createDefaultStory } from './stories';
|
|
26
|
+
export var getProgressStories = function (config) {
|
|
27
|
+
var component = config.component, componentConfig = config.componentConfig, rest = __rest(config, ["component", "componentConfig"]);
|
|
28
|
+
var progressConfig = getConfigVariations(componentConfig);
|
|
29
|
+
var meta = createMeta(__assign({ component: component, componentConfig: progressConfig, defaultArgs: componentConfig.defaults }, rest));
|
|
30
|
+
var Default = {
|
|
31
|
+
render: createDefaultStory(component),
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
meta: meta,
|
|
35
|
+
Default: Default,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=Progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progress.js","sourceRoot":"","sources":["../../../src/components/Progress/Progress.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAW/C,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAAC,MAAkC;IACzD,IAAA,SAAS,GAA+B,MAAM,UAArC,EAAE,eAAe,GAAc,MAAM,gBAApB,EAAK,IAAI,UAAK,MAAM,EAAhD,gCAAuC,CAAF,CAAY;IAEvD,IAAM,cAAc,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAE5D,IAAM,IAAI,GAAG,UAAU,YACnB,SAAS,WAAA,EACT,eAAe,EAAE,cAAc,EAC/B,WAAW,EAAE,eAAe,CAAC,QAAQ,IAClC,IAAI,EACT,CAAC;IAEH,IAAM,OAAO,GAAG;QACZ,MAAM,EAAE,kBAAkB,CAAC,SAAS,CAAC;KACxC,CAAC;IAEF,OAAO;QACH,IAAI,MAAA;QACJ,OAAO,SAAA;KACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export var labelPlacements = ['top', 'left', 'none'];
|
|
2
|
+
export var valuePlacements = ['top', 'right', 'none'];
|
|
3
|
+
export var labelTextPlacements = ['left', 'right', 'none'];
|
|
4
|
+
export var progressTrackSizes = ['2', '4', '6', '8'];
|
|
5
|
+
export var valueAligns = ['start', 'center', 'end'];
|
|
6
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../src/components/Progress/fixtures.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,eAAe,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACvD,MAAM,CAAC,IAAM,eAAe,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACxD,MAAM,CAAC,IAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC7D,MAAM,CAAC,IAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACvD,MAAM,CAAC,IAAM,WAAW,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Progress';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Progress/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
type CreateMetaProps = {
|
|
2
|
+
component: any;
|
|
3
|
+
componentConfig: any;
|
|
4
|
+
title?: string;
|
|
5
|
+
defaultArgs?: {};
|
|
6
|
+
additionalArgTypes?: {};
|
|
7
|
+
disablePropsList?: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare const createMeta: ({ component, componentConfig, title, defaultArgs, additionalArgTypes, disablePropsList, }: CreateMetaProps) => {
|
|
10
|
+
title: string;
|
|
11
|
+
decorators: import("@storybook/react").Decorator[];
|
|
12
|
+
component: any;
|
|
13
|
+
args: {
|
|
14
|
+
value: number;
|
|
15
|
+
view: string;
|
|
16
|
+
size: string;
|
|
17
|
+
progressSize: string;
|
|
18
|
+
hasValue: boolean;
|
|
19
|
+
label: string;
|
|
20
|
+
hasLabelIcon: boolean;
|
|
21
|
+
labelTextPlacement: string;
|
|
22
|
+
labelPlacement: string;
|
|
23
|
+
valuePlacement: string;
|
|
24
|
+
valueAlign: string;
|
|
25
|
+
showValueAlign: boolean;
|
|
26
|
+
caption: string;
|
|
27
|
+
};
|
|
28
|
+
argTypes: {
|
|
29
|
+
view: {
|
|
30
|
+
options: any;
|
|
31
|
+
control: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
table: {
|
|
35
|
+
category: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
size: {
|
|
39
|
+
options: any;
|
|
40
|
+
control: {
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
table: {
|
|
44
|
+
category: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
progressSize: {
|
|
48
|
+
options: string[];
|
|
49
|
+
control: {
|
|
50
|
+
type: string;
|
|
51
|
+
};
|
|
52
|
+
table: {
|
|
53
|
+
category: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
hasValue: {
|
|
57
|
+
control: {
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
table: {
|
|
61
|
+
category: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
value: {
|
|
65
|
+
control: {
|
|
66
|
+
type: string;
|
|
67
|
+
min: number;
|
|
68
|
+
max: number;
|
|
69
|
+
step: number;
|
|
70
|
+
};
|
|
71
|
+
table: {
|
|
72
|
+
category: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
label: {
|
|
76
|
+
control: {
|
|
77
|
+
type: string;
|
|
78
|
+
};
|
|
79
|
+
table: {
|
|
80
|
+
category: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
hasLabelIcon: {
|
|
84
|
+
control: {
|
|
85
|
+
type: string;
|
|
86
|
+
};
|
|
87
|
+
table: {
|
|
88
|
+
category: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
labelTextPlacement: {
|
|
92
|
+
options: string[];
|
|
93
|
+
control: {
|
|
94
|
+
type: string;
|
|
95
|
+
};
|
|
96
|
+
table: {
|
|
97
|
+
category: string;
|
|
98
|
+
};
|
|
99
|
+
if: {
|
|
100
|
+
arg: string;
|
|
101
|
+
truthy: boolean;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
labelPlacement: {
|
|
105
|
+
options: string[];
|
|
106
|
+
control: {
|
|
107
|
+
type: string;
|
|
108
|
+
};
|
|
109
|
+
table: {
|
|
110
|
+
category: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
valuePlacement: {
|
|
114
|
+
options: string[];
|
|
115
|
+
control: {
|
|
116
|
+
type: string;
|
|
117
|
+
};
|
|
118
|
+
table: {
|
|
119
|
+
category: string;
|
|
120
|
+
};
|
|
121
|
+
if: {
|
|
122
|
+
arg: string;
|
|
123
|
+
truthy: boolean;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
showValueAlign: {
|
|
127
|
+
table: {
|
|
128
|
+
disable: boolean;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
valueAlign: {
|
|
132
|
+
options: string[];
|
|
133
|
+
control: {
|
|
134
|
+
type: string;
|
|
135
|
+
};
|
|
136
|
+
table: {
|
|
137
|
+
category: string;
|
|
138
|
+
};
|
|
139
|
+
if: {
|
|
140
|
+
arg: string;
|
|
141
|
+
truthy: boolean;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
caption: {
|
|
145
|
+
control: {
|
|
146
|
+
type: string;
|
|
147
|
+
};
|
|
148
|
+
table: {
|
|
149
|
+
category: string;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
21
|
+
import { disableProps, InSpacingDecorator } from '../../index';
|
|
22
|
+
import { labelPlacements, labelTextPlacements, progressTrackSizes, valueAligns, valuePlacements } from './fixtures';
|
|
23
|
+
var commonDisabledArgs = ['labelIcon', 'status'];
|
|
24
|
+
export var createMeta = function (_a) {
|
|
25
|
+
var component = _a.component, componentConfig = _a.componentConfig, _b = _a.title, title = _b === void 0 ? 'Overlay/Progress' : _b, _c = _a.defaultArgs, defaultArgs = _c === void 0 ? {} : _c, _d = _a.additionalArgTypes, additionalArgTypes = _d === void 0 ? {} : _d, _e = _a.disablePropsList, disablePropsList = _e === void 0 ? [] : _e;
|
|
26
|
+
return {
|
|
27
|
+
title: title,
|
|
28
|
+
decorators: [InSpacingDecorator],
|
|
29
|
+
component: component,
|
|
30
|
+
args: __assign({ value: 25, view: 'default', size: 'm', progressSize: '4', hasValue: true, label: 'Лейбл', hasLabelIcon: true, labelTextPlacement: 'right', labelPlacement: 'top', valuePlacement: 'right', valueAlign: 'start', showValueAlign: false, caption: 'Подпись' }, defaultArgs),
|
|
31
|
+
argTypes: __assign(__assign({ view: {
|
|
32
|
+
options: componentConfig.views,
|
|
33
|
+
control: { type: 'select' },
|
|
34
|
+
table: { category: 'variation' },
|
|
35
|
+
}, size: {
|
|
36
|
+
options: componentConfig.sizes,
|
|
37
|
+
control: { type: 'select' },
|
|
38
|
+
table: { category: 'variation' },
|
|
39
|
+
}, progressSize: {
|
|
40
|
+
options: progressTrackSizes,
|
|
41
|
+
control: { type: 'select' },
|
|
42
|
+
table: { category: 'variation' },
|
|
43
|
+
}, hasValue: {
|
|
44
|
+
control: { type: 'boolean' },
|
|
45
|
+
table: { category: 'variation' },
|
|
46
|
+
}, value: {
|
|
47
|
+
control: {
|
|
48
|
+
type: 'range',
|
|
49
|
+
min: 0,
|
|
50
|
+
max: 100,
|
|
51
|
+
step: 1,
|
|
52
|
+
},
|
|
53
|
+
table: { category: 'progress' },
|
|
54
|
+
}, label: {
|
|
55
|
+
control: { type: 'text' },
|
|
56
|
+
table: { category: 'layout' },
|
|
57
|
+
}, hasLabelIcon: {
|
|
58
|
+
control: { type: 'boolean' },
|
|
59
|
+
table: { category: 'layout' },
|
|
60
|
+
}, labelTextPlacement: {
|
|
61
|
+
options: labelTextPlacements,
|
|
62
|
+
control: { type: 'select' },
|
|
63
|
+
table: { category: 'layout' },
|
|
64
|
+
if: { arg: 'hasLabelIcon', truthy: true },
|
|
65
|
+
}, labelPlacement: {
|
|
66
|
+
options: labelPlacements,
|
|
67
|
+
control: { type: 'select' },
|
|
68
|
+
table: { category: 'layout' },
|
|
69
|
+
}, valuePlacement: {
|
|
70
|
+
options: valuePlacements,
|
|
71
|
+
control: { type: 'select' },
|
|
72
|
+
table: { category: 'layout' },
|
|
73
|
+
if: { arg: 'hasValue', truthy: true },
|
|
74
|
+
}, showValueAlign: {
|
|
75
|
+
table: { disable: true },
|
|
76
|
+
}, valueAlign: {
|
|
77
|
+
options: valueAligns,
|
|
78
|
+
control: { type: 'select' },
|
|
79
|
+
table: { category: 'layout' },
|
|
80
|
+
if: { arg: 'showValueAlign', truthy: true },
|
|
81
|
+
}, caption: {
|
|
82
|
+
control: { type: 'text' },
|
|
83
|
+
table: { category: 'layout' },
|
|
84
|
+
} }, additionalArgTypes), disableProps(__spreadArray(__spreadArray([], commonDisabledArgs, true), disablePropsList, true))),
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/Progress/meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAWpH,IAAM,kBAAkB,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAEnD,MAAM,CAAC,IAAM,UAAU,GAAG,UAAC,EAOT;QANd,SAAS,eAAA,EACT,eAAe,qBAAA,EACf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AAE,QAAQ,EAAE,QAAQ,EAAE;gBAC7B,EAAE,EAAE,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE;aAC9C,EACD,OAAO,EAAE;gBACL,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBACzB,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;aAChC,IACE,kBAAkB,GAClB,YAAY,iCAAK,kBAAkB,SAAK,gBAAgB,QAAE,CAChE;KACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { useArgs, useEffect, useRef } from 'storybook/preview-api';
|
|
25
|
+
import { IconPlasma } from '@salutejs/plasma-icons';
|
|
26
|
+
export var getIconSize = function (size) {
|
|
27
|
+
return size === 's' ? 'xs' : 's';
|
|
28
|
+
};
|
|
29
|
+
export var createDefaultStory = function (Progress) {
|
|
30
|
+
return function (_a) {
|
|
31
|
+
var label = _a.label, hasLabelIcon = _a.hasLabelIcon, caption = _a.caption, labelTextPlacement = _a.labelTextPlacement, labelPlacement = _a.labelPlacement, valuePlacement = _a.valuePlacement, hasValue = _a.hasValue, size = _a.size, rest = __rest(_a, ["label", "hasLabelIcon", "caption", "labelTextPlacement", "labelPlacement", "valuePlacement", "hasValue", "size"]);
|
|
32
|
+
var _b = useArgs(), setArgs = _b[1];
|
|
33
|
+
var prevLabelPlacement = useRef(labelPlacement);
|
|
34
|
+
var prevValuePlacement = useRef(valuePlacement);
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
if (valuePlacement === 'none' && hasValue) {
|
|
37
|
+
setArgs({ hasValue: false });
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
var nextShowValueAlign = valuePlacement === 'top' && !label && !hasLabelIcon;
|
|
41
|
+
setArgs({ showValueAlign: nextShowValueAlign });
|
|
42
|
+
var labelChanged = labelPlacement !== prevLabelPlacement.current;
|
|
43
|
+
prevLabelPlacement.current = labelPlacement;
|
|
44
|
+
prevValuePlacement.current = valuePlacement;
|
|
45
|
+
if (labelChanged) {
|
|
46
|
+
var expected = labelPlacement === 'left' ? 'right' : 'top';
|
|
47
|
+
if (valuePlacement !== expected)
|
|
48
|
+
setArgs({ valuePlacement: expected });
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
var expected = valuePlacement === 'right' ? 'left' : 'top';
|
|
52
|
+
if (labelPlacement !== expected)
|
|
53
|
+
setArgs({ labelPlacement: expected });
|
|
54
|
+
}
|
|
55
|
+
}, [labelPlacement, valuePlacement, hasValue, label, hasLabelIcon]);
|
|
56
|
+
return (React.createElement(Progress, __assign({ size: size, label: label, caption: caption, labelPlacement: labelPlacement, valuePlacement: valuePlacement, hasValue: hasValue, labelIcon: hasLabelIcon ? React.createElement(IconPlasma, { size: getIconSize(size) }) : undefined, labelTextPlacement: labelTextPlacement }, rest)));
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/Progress/stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,IAAa;IACrC,OAAO,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAAC,QAAa;IAC5C,OAAO,UAAC,EAUF;QATF,IAAA,KAAK,WAAA,EACL,YAAY,kBAAA,EACZ,OAAO,aAAA,EACP,kBAAkB,wBAAA,EAClB,cAAc,oBAAA,EACd,cAAc,oBAAA,EACd,QAAQ,cAAA,EACR,IAAI,UAAA,EACD,IAAI,cATH,kHAUP,CADU;QAED,IAAA,KAAc,OAAO,EAAE,EAApB,OAAO,QAAa,CAAC;QAC9B,IAAM,kBAAkB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;QAClD,IAAM,kBAAkB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;QAElD,SAAS,CAAC;YACN,IAAI,cAAc,KAAK,MAAM,IAAI,QAAQ,EAAE,CAAC;gBACxC,OAAO,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;gBAC7B,OAAO;YACX,CAAC;YAED,IAAM,kBAAkB,GAAG,cAAc,KAAK,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC;YAC/E,OAAO,CAAC,EAAE,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ArgTypes?: {};
|
|
8
8
|
additionalComponents?: {};
|
|
9
|
+
customIcon?: (size: string, type?: 'left' | 'right', disabled?: boolean, readOnly?: boolean) => JSX.Element;
|
|
9
10
|
};
|
|
10
11
|
export declare const getRangeStories: (config: CreateStoriesProps) => {
|
|
11
12
|
meta: {
|
|
@@ -25,10 +25,10 @@ import { getConfigVariations } from '../../helpers';
|
|
|
25
25
|
import { createMeta } from './meta';
|
|
26
26
|
import { createDefaultStory } from './stories';
|
|
27
27
|
export var getRangeStories = function (config) {
|
|
28
|
-
var component = config.component, componentConfig = config.componentConfig, rest = __rest(config, ["component", "componentConfig"]);
|
|
28
|
+
var component = config.component, componentConfig = config.componentConfig, customIcon = config.customIcon, rest = __rest(config, ["component", "componentConfig", "customIcon"]);
|
|
29
29
|
var rangeConfig = getConfigVariations(componentConfig);
|
|
30
30
|
var meta = createMeta(__assign({ component: component, componentConfig: rangeConfig }, rest));
|
|
31
|
-
var DefaultStoryComponent = createDefaultStory(component);
|
|
31
|
+
var DefaultStoryComponent = createDefaultStory(component, customIcon);
|
|
32
32
|
var Default = {
|
|
33
33
|
render: function (args) { return React.createElement(DefaultStoryComponent, __assign({}, args)); },
|
|
34
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Range.js","sourceRoot":"","sources":["../../../src/components/Range/Range.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Range.js","sourceRoot":"","sources":["../../../src/components/Range/Range.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAa/C,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,MAA0B;IAC9C,IAAA,SAAS,GAA2C,MAAM,UAAjD,EAAE,eAAe,GAA0B,MAAM,gBAAhC,EAAE,UAAU,GAAc,MAAM,WAApB,EAAK,IAAI,UAAK,MAAM,EAA5D,8CAAmD,CAAF,CAAY;IAEnE,IAAM,WAAW,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAEzD,IAAM,IAAI,GAAG,UAAU,YACnB,SAAS,WAAA,EACT,eAAe,EAAE,WAAW,IACzB,IAAI,EACT,CAAC;IAEH,IAAM,qBAAqB,GAAG,kBAAkB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAExE,IAAM,OAAO,GAAG;QACZ,MAAM,EAAE,UAAC,IAAS,IAAK,OAAA,oBAAC,qBAAqB,eAAK,IAAI,EAAI,EAAnC,CAAmC;KAC7D,CAAC;IAEF,OAAO;QACH,IAAI,MAAA;QACJ,OAAO,SAAA;KACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createDefaultStory: (Range: any) => ({ dividerVariant, enableContentLeft, enableContentRight, firstTextfieldTextBefore, secondTextfieldTextBefore, enableFirstTextfieldContentLeft, enableSecondTextfieldContentLeft, enableFirstTextfieldContentRight, enableSecondTextfieldContentRight, size, hasRequiredIndicator, firstInputView, secondInputView, appearance, ...rest }: any) => JSX.Element;
|
|
1
|
+
export declare const createDefaultStory: (Range: any, customIcon?: (size: string, type?: "left" | "right", disabled?: boolean, readOnly?: boolean) => JSX.Element) => ({ dividerVariant, enableContentLeft, enableContentRight, firstTextfieldTextBefore, secondTextfieldTextBefore, enableFirstTextfieldContentLeft, enableSecondTextfieldContentLeft, enableFirstTextfieldContentRight, enableSecondTextfieldContentRight, size, hasRequiredIndicator, firstInputView, secondInputView, appearance, ...rest }: any) => JSX.Element;
|
|
@@ -34,7 +34,10 @@ var onBlurSecondTextfield = action('onBlurSecondTextfield');
|
|
|
34
34
|
var getIconSize = function (size) {
|
|
35
35
|
return size === 'xs' ? 'xs' : 's';
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
var getIcon = function (IconComponent, size) {
|
|
38
|
+
return React.createElement(IconComponent, { size: getIconSize(size), color: "inherit" });
|
|
39
|
+
};
|
|
40
|
+
export var createDefaultStory = function (Range, customIcon) {
|
|
38
41
|
return function (_a) {
|
|
39
42
|
var dividerVariant = _a.dividerVariant, enableContentLeft = _a.enableContentLeft, enableContentRight = _a.enableContentRight, firstTextfieldTextBefore = _a.firstTextfieldTextBefore, secondTextfieldTextBefore = _a.secondTextfieldTextBefore, enableFirstTextfieldContentLeft = _a.enableFirstTextfieldContentLeft, enableSecondTextfieldContentLeft = _a.enableSecondTextfieldContentLeft, enableFirstTextfieldContentRight = _a.enableFirstTextfieldContentRight, enableSecondTextfieldContentRight = _a.enableSecondTextfieldContentRight, size = _a.size, hasRequiredIndicator = _a.hasRequiredIndicator, firstInputView = _a.firstInputView, secondInputView = _a.secondInputView, appearance = _a.appearance, rest = __rest(_a, ["dividerVariant", "enableContentLeft", "enableContentRight", "firstTextfieldTextBefore", "secondTextfieldTextBefore", "enableFirstTextfieldContentLeft", "enableSecondTextfieldContentLeft", "enableFirstTextfieldContentRight", "enableSecondTextfieldContentRight", "size", "hasRequiredIndicator", "firstInputView", "secondInputView", "appearance"]);
|
|
40
43
|
var _b = useState(''), firstValue = _b[0], setFirstValue = _b[1];
|
|
@@ -42,6 +45,12 @@ export var createDefaultStory = function (Range) {
|
|
|
42
45
|
var iconSize = getIconSize(size);
|
|
43
46
|
var showDividerIcon = dividerVariant === 'icon';
|
|
44
47
|
var showDefaultTextBefore = dividerVariant === 'none';
|
|
48
|
+
var defaultIconsByType = { left: IconPlasma, right: IconDisclosureRight };
|
|
49
|
+
var innerGetIcon = function (type) {
|
|
50
|
+
return customIcon
|
|
51
|
+
? customIcon(size, type, rest.disabled, rest.readOnly)
|
|
52
|
+
: getIcon(defaultIconsByType[type], size);
|
|
53
|
+
};
|
|
45
54
|
var dividerIconProps = {
|
|
46
55
|
dividerIcon: showDividerIcon ? React.createElement(IconArrowRight, { color: "inherit", size: iconSize }) : null,
|
|
47
56
|
dividerVariant: dividerVariant,
|
|
@@ -52,7 +61,7 @@ export var createDefaultStory = function (Range) {
|
|
|
52
61
|
firstValueError: firstInputView === 'negative',
|
|
53
62
|
secondValueError: secondInputView === 'negative',
|
|
54
63
|
};
|
|
55
|
-
return (React.createElement(Range, __assign({ appearance: appearance, size: size, hasRequiredIndicator: rest.required && hasRequiredIndicator, firstValue: firstValue, secondValue: secondValue, contentLeft: enableContentLeft ?
|
|
64
|
+
return (React.createElement(Range, __assign({ appearance: appearance, size: size, hasRequiredIndicator: rest.required && hasRequiredIndicator, firstValue: firstValue, secondValue: secondValue, contentLeft: enableContentLeft ? innerGetIcon('left') : undefined, contentRight: enableContentRight ? innerGetIcon('right') : undefined, firstTextfieldContentLeft: enableFirstTextfieldContentLeft ? React.createElement(IconPlasma, { color: "inherit", size: iconSize }) : undefined, firstTextfieldContentRight: enableFirstTextfieldContentRight ? React.createElement(IconPlasma, { color: "inherit", size: iconSize }) : undefined, secondTextfieldContentLeft: enableSecondTextfieldContentLeft ? React.createElement(IconPlasma, { color: "inherit", size: iconSize }) : undefined, secondTextfieldContentRight: enableSecondTextfieldContentRight ? React.createElement(IconPlasma, { color: "inherit", size: iconSize }) : undefined, firstTextfieldTextBefore: showDefaultTextBefore ? firstTextfieldTextBefore || 'С' : firstTextfieldTextBefore, secondTextfieldTextBefore: showDefaultTextBefore ? secondTextfieldTextBefore || 'ПО' : secondTextfieldTextBefore, onChangeFirstValue: function (e) {
|
|
56
65
|
setFirstValue(e.target.value);
|
|
57
66
|
onChangeFirstValue(e, e.target.value);
|
|
58
67
|
}, onChangeSecondValue: function (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/Range/stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/Range/stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAGzF,IAAM,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AACxD,IAAM,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAC1D,IAAM,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AACxD,IAAM,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAC1D,IAAM,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAC9D,IAAM,sBAAsB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAChE,IAAM,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAC5D,IAAM,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAE9D,IAAM,WAAW,GAAG,UAAC,IAAa;IAC9B,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;A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A2B,EACvB,iCAAiC,CAAC,CAAC,CAAC,oBAAC,UAAU,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,EAAE,QAAQ,GAAI,CAAC,CAAC,CAAC,SAAS,EAElG,wBAAwB,EACpB,qBAAqB,CAAC,CAAC,CAAC,wBAAwB,IAAI,GAAG,CAAC,CAAC,CAAC,wBAAwB,EAEtF,yBAAyB,EACrB,qBAAqB,CAAC,CAAC,CAAC,yBAAyB,IAAI,IAAI,CAAC,CAAC,CAAC,yBAAyB,EAEzF,kBAAkB,EAAE,UAAC,CAAgC;gBACjD,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC9B,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC1C,CAAC,EACD,mBAAmB,EAAE,UAAC,CAAgC;gBAClD,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC/B,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC3C,CAAC,EACD,kBAAkB,EAAE,kBAAkB,EACtC,mBAAmB,EAAE,mBAAmB,EACxC,qBAAqB,EAAE,qBAAqB,EAC5C,sBAAsB,EAAE,sBAAsB,EAC9C,oBAAoB,EAAE,oBAAoB,EAC1C,qBAAqB,EAAE,qBAAqB,IACxC,WAAW,EACX,gBAAgB,EAChB,IAAI,EACV,CACL,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -3,6 +3,7 @@ type CreateStoriesProps = {
|
|
|
3
3
|
componentConfig: any;
|
|
4
4
|
disablePropsList?: string[];
|
|
5
5
|
defaultArgs?: {};
|
|
6
|
+
customGetContentRight?: (size: string, disabled?: boolean, readOnly?: boolean) => JSX.Element | undefined;
|
|
6
7
|
};
|
|
7
8
|
export declare const getSelectStories: (config: CreateStoriesProps) => {
|
|
8
9
|
meta: {
|
|
@@ -25,10 +25,10 @@ import { getConfigVariations } from '../../helpers';
|
|
|
25
25
|
import { createMeta } from './meta';
|
|
26
26
|
import { createSingleStory, createMultipleStory, createPredefinedStory, createCommonStory, createSelectAllStory, } from './stories';
|
|
27
27
|
export var getSelectStories = function (config) {
|
|
28
|
-
var component = config.component, componentConfig = config.componentConfig, rest = __rest(config, ["component", "componentConfig"]);
|
|
28
|
+
var component = config.component, componentConfig = config.componentConfig, customGetContentRight = config.customGetContentRight, rest = __rest(config, ["component", "componentConfig", "customGetContentRight"]);
|
|
29
29
|
var selectConfig = getConfigVariations(componentConfig);
|
|
30
30
|
var meta = createMeta(__assign({ component: component, componentConfig: selectConfig }, rest));
|
|
31
|
-
var SingleStoryComponent = createSingleStory(component);
|
|
31
|
+
var SingleStoryComponent = createSingleStory(component, customGetContentRight);
|
|
32
32
|
var Single = {
|
|
33
33
|
render: function (args) { return React.createElement(SingleStoryComponent, __assign({}, args)); },
|
|
34
34
|
args: {
|
|
@@ -40,7 +40,7 @@ export var getSelectStories = function (config) {
|
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
|
-
var MultipleStoryComponent = createMultipleStory(component);
|
|
43
|
+
var MultipleStoryComponent = createMultipleStory(component, customGetContentRight);
|
|
44
44
|
var Multiselect = {
|
|
45
45
|
render: function (args) { return React.createElement(MultipleStoryComponent, __assign({}, args)); },
|
|
46
46
|
args: {
|
|
@@ -52,7 +52,7 @@ export var getSelectStories = function (config) {
|
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
54
|
};
|
|
55
|
-
var PredefinedStoryComponent = createPredefinedStory(component);
|
|
55
|
+
var PredefinedStoryComponent = createPredefinedStory(component, customGetContentRight);
|
|
56
56
|
var Predefined = {
|
|
57
57
|
render: function (args) { return React.createElement(PredefinedStoryComponent, __assign({}, args)); },
|
|
58
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],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,EAAE,MAAM;aAClB;SACJ;QACD,IAAI,EAAE;YACF,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,aAAa;SAChC;QACD,UAAU,EAAE;YACR,QAAQ,EAAE;gBACN,OAAO,EAAE,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;aACjD;SACJ;KACJ,CAAC;IAEF,OAAO;QACH,IAAI,MAAA;QACJ,MAAM,QAAA;QACN,WAAW,aAAA;QACX,UAAU,YAAA;QACV,MAAM,QAAA;QACN,SAAS,WAAA;KACZ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
1
|
+
type CustomGetContentType = (size: string, disabled?: boolean, readOnly?: boolean) => JSX.Element | undefined;
|
|
2
|
+
export declare const createSingleStory: (Select: any, customGetContentRight?: CustomGetContentType) => ({ enableContentLeft, ...rest }: any) => JSX.Element;
|
|
3
|
+
export declare const createMultipleStory: (Select: any, customGetContentRight?: CustomGetContentType) => ({ enableContentLeft, ...rest }: any) => JSX.Element;
|
|
4
|
+
export declare const createPredefinedStory: (Select: any, customGetContentRight?: CustomGetContentType) => ({ enableContentLeft, ...rest }: any) => JSX.Element;
|
|
4
5
|
export declare const createCommonStory: (Select: any) => ({ enableContentLeft, ...rest }: any) => JSX.Element;
|
|
5
6
|
export declare const createSelectAllStory: (Select: any) => ({ ...rest }: any) => JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -41,33 +41,36 @@ var getIcon = function (size, disabled, readOnly) {
|
|
|
41
41
|
}
|
|
42
42
|
return undefined;
|
|
43
43
|
};
|
|
44
|
-
export var createSingleStory = function (Select) {
|
|
44
|
+
export var createSingleStory = function (Select, customGetContentRight) {
|
|
45
45
|
return function (_a) {
|
|
46
46
|
var enableContentLeft = _a.enableContentLeft, rest = __rest(_a, ["enableContentLeft"]);
|
|
47
47
|
var _b = useState(''), value = _b[0], setValue = _b[1];
|
|
48
|
+
var resolveIcon = customGetContentRight !== null && customGetContentRight !== void 0 ? customGetContentRight : getIcon;
|
|
48
49
|
return (React.createElement("div", { style: {
|
|
49
50
|
width: '300px',
|
|
50
51
|
} },
|
|
51
|
-
React.createElement(Select, __assign({}, rest, { items: items, value: value, onChange: setValue, contentLeft: enableContentLeft ? React.createElement(IconPlasma, { size: getIconSize(rest.size), color: "inherit" }) : undefined, contentRight:
|
|
52
|
+
React.createElement(Select, __assign({}, rest, { items: items, value: value, onChange: setValue, contentLeft: enableContentLeft ? React.createElement(IconPlasma, { size: getIconSize(rest.size), color: "inherit" }) : undefined, contentRight: resolveIcon(rest.size, rest.disabled, rest.readOnly) }))));
|
|
52
53
|
};
|
|
53
54
|
};
|
|
54
|
-
export var createMultipleStory = function (Select) {
|
|
55
|
+
export var createMultipleStory = function (Select, customGetContentRight) {
|
|
55
56
|
return function (_a) {
|
|
56
57
|
var enableContentLeft = _a.enableContentLeft, rest = __rest(_a, ["enableContentLeft"]);
|
|
57
58
|
var _b = useState([]), value = _b[0], setValue = _b[1];
|
|
59
|
+
var resolveIcon = customGetContentRight !== null && customGetContentRight !== void 0 ? customGetContentRight : getIcon;
|
|
58
60
|
return (React.createElement("div", { style: { width: '300px' } },
|
|
59
|
-
React.createElement(Select, __assign({}, rest, { multiselect: true, items: items, value: value, onChange: setValue, contentLeft: enableContentLeft ? React.createElement(IconPlasma, { size: getIconSize(rest.size), color: "inherit" }) : undefined, contentRight:
|
|
61
|
+
React.createElement(Select, __assign({}, rest, { multiselect: true, items: items, value: value, onChange: setValue, contentLeft: enableContentLeft ? React.createElement(IconPlasma, { size: getIconSize(rest.size), color: "inherit" }) : undefined, contentRight: resolveIcon(rest.size, rest.disabled, rest.readOnly) }))));
|
|
60
62
|
};
|
|
61
63
|
};
|
|
62
|
-
export var createPredefinedStory = function (Select) {
|
|
64
|
+
export var createPredefinedStory = function (Select, customGetContentRight) {
|
|
63
65
|
return function (_a) {
|
|
64
66
|
var enableContentLeft = _a.enableContentLeft, rest = __rest(_a, ["enableContentLeft"]);
|
|
65
67
|
var _b = useState('paris'), valueSingle = _b[0], setValueSingle = _b[1];
|
|
66
68
|
var _c = useState(['paris', 'north_america']), valueMultiple = _c[0], setValueMultiple = _c[1];
|
|
69
|
+
var resolveIcon = customGetContentRight !== null && customGetContentRight !== void 0 ? customGetContentRight : getIcon;
|
|
67
70
|
return (React.createElement("div", { style: { width: '300px' } },
|
|
68
|
-
React.createElement(Select, __assign({}, rest, { items: items, value: valueSingle, onChange: setValueSingle, contentLeft: enableContentLeft ? React.createElement(IconPlasma, { size: getIconSize(rest.size), color: "inherit" }) : undefined, contentRight:
|
|
71
|
+
React.createElement(Select, __assign({}, rest, { items: items, value: valueSingle, onChange: setValueSingle, contentLeft: enableContentLeft ? React.createElement(IconPlasma, { size: getIconSize(rest.size), color: "inherit" }) : undefined, contentRight: resolveIcon(rest.size, rest.disabled, rest.readOnly) })),
|
|
69
72
|
React.createElement("br", null),
|
|
70
|
-
React.createElement(Select, __assign({}, rest, { items: items, multiselect: true, value: valueMultiple, onChange: setValueMultiple, contentLeft: enableContentLeft ? React.createElement(IconPlasma, { size: getIconSize(rest.size), color: "inherit" }) : undefined, contentRight:
|
|
73
|
+
React.createElement(Select, __assign({}, rest, { items: items, multiselect: true, value: valueMultiple, onChange: setValueMultiple, contentLeft: enableContentLeft ? React.createElement(IconPlasma, { size: getIconSize(rest.size), color: "inherit" }) : undefined, contentRight: resolveIcon(rest.size, rest.disabled, rest.readOnly) }))));
|
|
71
74
|
};
|
|
72
75
|
};
|
|
73
76
|
export var createCommonStory = function (Select) {
|