@lowdefy/blocks-antd 4.0.0-alpha.26 → 4.0.0-alpha.29
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/package.json +9 -10
- package/dist/blocks/Affix/Affix.js +0 -43
- package/dist/blocks/Affix/schema.json +0 -34
- package/dist/blocks/Affix/style.less +0 -17
- package/dist/blocks/Alert/Alert.js +0 -78
- package/dist/blocks/Alert/schema.json +0 -62
- package/dist/blocks/Alert/style.less +0 -17
- package/dist/blocks/AutoComplete/AutoComplete.js +0 -86
- package/dist/blocks/AutoComplete/schema.json +0 -148
- package/dist/blocks/AutoComplete/style.less +0 -17
- package/dist/blocks/Avatar/Avatar.js +0 -49
- package/dist/blocks/Avatar/schema.json +0 -71
- package/dist/blocks/Avatar/style.less +0 -17
- package/dist/blocks/Badge/Badge.js +0 -44
- package/dist/blocks/Badge/schema.json +0 -70
- package/dist/blocks/Badge/style.less +0 -17
- package/dist/blocks/Breadcrumb/Breadcrumb.js +0 -79
- package/dist/blocks/Breadcrumb/schema.json +0 -78
- package/dist/blocks/Breadcrumb/style.less +0 -17
- package/dist/blocks/Button/Button.js +0 -77
- package/dist/blocks/Button/schema.json +0 -91
- package/dist/blocks/Button/style.less +0 -17
- package/dist/blocks/ButtonSelector/ButtonSelector.js +0 -91
- package/dist/blocks/ButtonSelector/schema.json +0 -188
- package/dist/blocks/ButtonSelector/style.less +0 -18
- package/dist/blocks/Card/Card.js +0 -50
- package/dist/blocks/Card/schema.json +0 -58
- package/dist/blocks/Card/style.less +0 -17
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +0 -97
- package/dist/blocks/CheckboxSelector/schema.json +0 -193
- package/dist/blocks/CheckboxSelector/style.less +0 -19
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +0 -74
- package/dist/blocks/CheckboxSwitch/schema.json +0 -105
- package/dist/blocks/CheckboxSwitch/style.less +0 -19
- package/dist/blocks/Collapse/Collapse.js +0 -89
- package/dist/blocks/Collapse/schema.json +0 -90
- package/dist/blocks/Collapse/style.less +0 -17
- package/dist/blocks/Comment/Comment.js +0 -56
- package/dist/blocks/Comment/schema.json +0 -39
- package/dist/blocks/Comment/style.less +0 -18
- package/dist/blocks/ConfirmModal/ConfirmModal.js +0 -96
- package/dist/blocks/ConfirmModal/schema.json +0 -122
- package/dist/blocks/ConfirmModal/style.less +0 -17
- package/dist/blocks/Content/Content.js +0 -31
- package/dist/blocks/Content/schema.json +0 -16
- package/dist/blocks/Content/style.less +0 -17
- package/dist/blocks/ControlledList/ControlledList.js +0 -137
- package/dist/blocks/ControlledList/schema.json +0 -68
- package/dist/blocks/ControlledList/style.less +0 -19
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +0 -102
- package/dist/blocks/DateRangeSelector/schema.json +0 -221
- package/dist/blocks/DateRangeSelector/style.less +0 -18
- package/dist/blocks/DateSelector/DateSelector.js +0 -90
- package/dist/blocks/DateSelector/schema.json +0 -183
- package/dist/blocks/DateSelector/style.less +0 -18
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +0 -98
- package/dist/blocks/DateTimeSelector/schema.json +0 -215
- package/dist/blocks/DateTimeSelector/style.less +0 -18
- package/dist/blocks/Descriptions/Descriptions.js +0 -83
- package/dist/blocks/Descriptions/schema.json +0 -186
- package/dist/blocks/Descriptions/style.less +0 -17
- package/dist/blocks/Divider/Divider.js +0 -37
- package/dist/blocks/Divider/schema.json +0 -35
- package/dist/blocks/Divider/style.less +0 -17
- package/dist/blocks/Drawer/Drawer.js +0 -104
- package/dist/blocks/Drawer/schema.json +0 -113
- package/dist/blocks/Drawer/style.less +0 -17
- package/dist/blocks/Footer/Footer.js +0 -36
- package/dist/blocks/Footer/schema.json +0 -16
- package/dist/blocks/Footer/style.less +0 -17
- package/dist/blocks/Header/Header.js +0 -36
- package/dist/blocks/Header/schema.json +0 -22
- package/dist/blocks/Header/style.less +0 -17
- package/dist/blocks/Label/Label.js +0 -116
- package/dist/blocks/Label/getLabelCol.js +0 -55
- package/dist/blocks/Label/getWrapperCol.js +0 -69
- package/dist/blocks/Label/labelLogic.js +0 -106
- package/dist/blocks/Label/schema.json +0 -62
- package/dist/blocks/Label/style.less +0 -34
- package/dist/blocks/Layout/Layout.js +0 -30
- package/dist/blocks/Layout/schema.json +0 -16
- package/dist/blocks/Layout/style.less +0 -17
- package/dist/blocks/Menu/Menu.js +0 -209
- package/dist/blocks/Menu/schema.json +0 -236
- package/dist/blocks/Menu/style.less +0 -17
- package/dist/blocks/Message/Message.js +0 -53
- package/dist/blocks/Message/schema.json +0 -48
- package/dist/blocks/Message/style.less +0 -17
- package/dist/blocks/MobileMenu/MobileMenu.js +0 -128
- package/dist/blocks/MobileMenu/schema.json +0 -236
- package/dist/blocks/MobileMenu/style.less +0 -19
- package/dist/blocks/Modal/Modal.js +0 -130
- package/dist/blocks/Modal/schema.json +0 -118
- package/dist/blocks/Modal/style.less +0 -17
- package/dist/blocks/MonthSelector/MonthSelector.js +0 -90
- package/dist/blocks/MonthSelector/schema.json +0 -183
- package/dist/blocks/MonthSelector/style.less +0 -18
- package/dist/blocks/MultipleSelector/MultipleSelector.js +0 -146
- package/dist/blocks/MultipleSelector/schema.json +0 -239
- package/dist/blocks/MultipleSelector/style.less +0 -18
- package/dist/blocks/Notification/Notification.js +0 -77
- package/dist/blocks/Notification/schema.json +0 -85
- package/dist/blocks/Notification/style.less +0 -18
- package/dist/blocks/NumberInput/NumberInput.js +0 -82
- package/dist/blocks/NumberInput/schema.json +0 -157
- package/dist/blocks/NumberInput/style.less +0 -18
- package/dist/blocks/PageHCF/PageHCF.js +0 -70
- package/dist/blocks/PageHCF/schema.json +0 -64
- package/dist/blocks/PageHCF/style.less +0 -20
- package/dist/blocks/PageHCSF/PageHCSF.js +0 -98
- package/dist/blocks/PageHCSF/schema.json +0 -148
- package/dist/blocks/PageHCSF/style.less +0 -21
- package/dist/blocks/PageHSCF/PageHSCF.js +0 -98
- package/dist/blocks/PageHSCF/schema.json +0 -147
- package/dist/blocks/PageHSCF/style.less +0 -21
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +0 -290
- package/dist/blocks/PageHeaderMenu/schema.json +0 -215
- package/dist/blocks/PageHeaderMenu/style.less +0 -23
- package/dist/blocks/PageSHCF/PageSHCF.js +0 -98
- package/dist/blocks/PageSHCF/schema.json +0 -148
- package/dist/blocks/PageSHCF/style.less +0 -21
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +0 -406
- package/dist/blocks/PageSiderMenu/schema.json +0 -283
- package/dist/blocks/PageSiderMenu/style.less +0 -26
- package/dist/blocks/Pagination/Pagination.js +0 -98
- package/dist/blocks/Pagination/schema.json +0 -75
- package/dist/blocks/Pagination/style.less +0 -17
- package/dist/blocks/Paragraph/Paragraph.js +0 -102
- package/dist/blocks/Paragraph/schema.json +0 -131
- package/dist/blocks/Paragraph/style.less +0 -17
- package/dist/blocks/ParagraphInput/ParagraphInput.js +0 -125
- package/dist/blocks/ParagraphInput/schema.json +0 -162
- package/dist/blocks/ParagraphInput/style.less +0 -17
- package/dist/blocks/PasswordInput/PasswordInput.js +0 -78
- package/dist/blocks/PasswordInput/schema.json +0 -123
- package/dist/blocks/PasswordInput/style.less +0 -18
- package/dist/blocks/Progress/Progress.js +0 -42
- package/dist/blocks/Progress/schema.json +0 -76
- package/dist/blocks/Progress/style.less +0 -17
- package/dist/blocks/RadioSelector/RadioSelector.js +0 -96
- package/dist/blocks/RadioSelector/schema.json +0 -190
- package/dist/blocks/RadioSelector/style.less +0 -19
- package/dist/blocks/RatingSlider/RatingSlider.js +0 -240
- package/dist/blocks/RatingSlider/schema.json +0 -169
- package/dist/blocks/RatingSlider/style.less +0 -19
- package/dist/blocks/Result/Result.js +0 -48
- package/dist/blocks/Result/schema.json +0 -30
- package/dist/blocks/Result/style.less +0 -17
- package/dist/blocks/Selector/Selector.js +0 -140
- package/dist/blocks/Selector/schema.json +0 -236
- package/dist/blocks/Selector/style.less +0 -18
- package/dist/blocks/Sider/Sider.js +0 -85
- package/dist/blocks/Sider/schema.json +0 -71
- package/dist/blocks/Sider/style.less +0 -17
- package/dist/blocks/Statistic/Statistic.js +0 -51
- package/dist/blocks/Statistic/schema.json +0 -74
- package/dist/blocks/Statistic/style.less +0 -17
- package/dist/blocks/Switch/Switch.js +0 -101
- package/dist/blocks/Switch/schema.json +0 -136
- package/dist/blocks/Switch/style.less +0 -18
- package/dist/blocks/Tabs/Tabs.js +0 -108
- package/dist/blocks/Tabs/schema.json +0 -97
- package/dist/blocks/Tabs/style.less +0 -17
- package/dist/blocks/TextArea/TextArea.js +0 -87
- package/dist/blocks/TextArea/schema.json +0 -164
- package/dist/blocks/TextArea/style.less +0 -18
- package/dist/blocks/TextInput/TextInput.js +0 -92
- package/dist/blocks/TextInput/schema.json +0 -149
- package/dist/blocks/TextInput/style.less +0 -18
- package/dist/blocks/TimelineList/TimelineList.js +0 -102
- package/dist/blocks/TimelineList/schema.json +0 -65
- package/dist/blocks/TimelineList/style.less +0 -17
- package/dist/blocks/Title/Title.js +0 -109
- package/dist/blocks/Title/schema.json +0 -136
- package/dist/blocks/Title/style.less +0 -17
- package/dist/blocks/TitleInput/TitleInput.js +0 -122
- package/dist/blocks/TitleInput/schema.json +0 -171
- package/dist/blocks/TitleInput/style.less +0 -17
- package/dist/blocks/Tooltip/Tooltip.js +0 -48
- package/dist/blocks/Tooltip/schema.json +0 -91
- package/dist/blocks/Tooltip/style.less +0 -17
- package/dist/blocks/WeekSelector/WeekSelector.js +0 -91
- package/dist/blocks/WeekSelector/schema.json +0 -183
- package/dist/blocks/WeekSelector/style.less +0 -18
- package/dist/blocks.js +0 -74
- package/dist/color.js +0 -85
- package/dist/disabledDate.js +0 -45
- package/dist/getUniqueValues.js +0 -30
- package/dist/getValueIndex.js +0 -42
- package/dist/style.less +0 -17
- package/dist/types.js +0 -31
- package/dist/useRunAfterUpdate.js +0 -29
- package/dist/validationExamples.js +0 -40
package/dist/blocks.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ export { default as Affix } from './blocks/Affix/Affix.js';
|
|
16
|
-
export { default as Alert } from './blocks/Alert/Alert.js';
|
|
17
|
-
export { default as AutoComplete } from './blocks/AutoComplete/AutoComplete.js';
|
|
18
|
-
export { default as Avatar } from './blocks/Avatar/Avatar.js';
|
|
19
|
-
export { default as Badge } from './blocks/Badge/Badge.js';
|
|
20
|
-
export { default as Breadcrumb } from './blocks/Breadcrumb/Breadcrumb.js';
|
|
21
|
-
export { default as Button } from './blocks/Button/Button.js';
|
|
22
|
-
export { default as ButtonSelector } from './blocks/ButtonSelector/ButtonSelector.js';
|
|
23
|
-
export { default as Card } from './blocks/Card/Card.js';
|
|
24
|
-
export { default as CheckboxSelector } from './blocks/CheckboxSelector/CheckboxSelector.js';
|
|
25
|
-
export { default as CheckboxSwitch } from './blocks/CheckboxSwitch/CheckboxSwitch.js';
|
|
26
|
-
export { default as Collapse } from './blocks/Collapse/Collapse.js';
|
|
27
|
-
export { default as Comment } from './blocks/Comment/Comment.js';
|
|
28
|
-
export { default as ConfirmModal } from './blocks/ConfirmModal/ConfirmModal.js';
|
|
29
|
-
export { default as Content } from './blocks/Content/Content.js';
|
|
30
|
-
export { default as ControlledList } from './blocks/ControlledList/ControlledList.js';
|
|
31
|
-
export { default as DateRangeSelector } from './blocks/DateRangeSelector/DateRangeSelector.js';
|
|
32
|
-
export { default as DateSelector } from './blocks/DateSelector/DateSelector.js';
|
|
33
|
-
export { default as DateTimeSelector } from './blocks/DateTimeSelector/DateTimeSelector.js';
|
|
34
|
-
export { default as Descriptions } from './blocks/Descriptions/Descriptions.js';
|
|
35
|
-
export { default as Divider } from './blocks/Divider/Divider.js';
|
|
36
|
-
export { default as Drawer } from './blocks/Drawer/Drawer.js';
|
|
37
|
-
export { default as Footer } from './blocks/Footer/Footer.js';
|
|
38
|
-
export { default as Header } from './blocks/Header/Header.js';
|
|
39
|
-
export { default as Label } from './blocks/Label/Label.js';
|
|
40
|
-
export { default as Layout } from './blocks/Layout/Layout.js';
|
|
41
|
-
export { default as Menu } from './blocks/Menu/Menu.js';
|
|
42
|
-
export { default as Message } from './blocks/Message/Message.js';
|
|
43
|
-
export { default as MobileMenu } from './blocks/MobileMenu/MobileMenu.js';
|
|
44
|
-
export { default as Modal } from './blocks/Modal/Modal.js';
|
|
45
|
-
export { default as MonthSelector } from './blocks/MonthSelector/MonthSelector.js';
|
|
46
|
-
export { default as MultipleSelector } from './blocks/MultipleSelector/MultipleSelector.js';
|
|
47
|
-
export { default as Notification } from './blocks/Notification/Notification.js';
|
|
48
|
-
export { default as NumberInput } from './blocks/NumberInput/NumberInput.js';
|
|
49
|
-
export { default as PageHCF } from './blocks/PageHCF/PageHCF.js';
|
|
50
|
-
export { default as PageHCSF } from './blocks/PageHCSF/PageHCSF.js';
|
|
51
|
-
export { default as PageHeaderMenu } from './blocks/PageHeaderMenu/PageHeaderMenu.js';
|
|
52
|
-
export { default as PageHSCF } from './blocks/PageHSCF/PageHSCF.js';
|
|
53
|
-
export { default as PageSHCF } from './blocks/PageSHCF/PageSHCF.js';
|
|
54
|
-
export { default as PageSiderMenu } from './blocks/PageSiderMenu/PageSiderMenu.js';
|
|
55
|
-
export { default as Pagination } from './blocks/Pagination/Pagination.js';
|
|
56
|
-
export { default as Paragraph } from './blocks/Paragraph/Paragraph.js';
|
|
57
|
-
export { default as ParagraphInput } from './blocks/ParagraphInput/ParagraphInput.js';
|
|
58
|
-
export { default as PasswordInput } from './blocks/PasswordInput/PasswordInput.js';
|
|
59
|
-
export { default as Progress } from './blocks/Progress/Progress.js';
|
|
60
|
-
export { default as RadioSelector } from './blocks/RadioSelector/RadioSelector.js';
|
|
61
|
-
export { default as RatingSlider } from './blocks/RatingSlider/RatingSlider.js';
|
|
62
|
-
export { default as Result } from './blocks/Result/Result.js';
|
|
63
|
-
export { default as Selector } from './blocks/Selector/Selector.js';
|
|
64
|
-
export { default as Sider } from './blocks/Sider/Sider.js';
|
|
65
|
-
export { default as Statistic } from './blocks/Statistic/Statistic.js';
|
|
66
|
-
export { default as Switch } from './blocks/Switch/Switch.js';
|
|
67
|
-
export { default as Tabs } from './blocks/Tabs/Tabs.js';
|
|
68
|
-
export { default as TimelineList } from './blocks/TimelineList/TimelineList.js';
|
|
69
|
-
export { default as TextArea } from './blocks/TextArea/TextArea.js';
|
|
70
|
-
export { default as TextInput } from './blocks/TextInput/TextInput.js';
|
|
71
|
-
export { default as Title } from './blocks/Title/Title.js';
|
|
72
|
-
export { default as TitleInput } from './blocks/TitleInput/TitleInput.js';
|
|
73
|
-
export { default as Tooltip } from './blocks/Tooltip/Tooltip.js';
|
|
74
|
-
export { default as WeekSelector } from './blocks/WeekSelector/WeekSelector.js';
|
package/dist/color.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ // antd v4.5.6
|
|
16
|
-
// https://github.com/ant-design/ant-design/blob/master/components/style/color/tinyColor.less
|
|
17
|
-
// 2020-09-23, MIT License
|
|
18
|
-
// TinyColor v1.4.1
|
|
19
|
-
// https://github.com/bgrins/TinyColor
|
|
20
|
-
// 2016-07-07, Brian Grinstead, MIT License
|
|
21
|
-
import tinycolor from 'tinycolor2';
|
|
22
|
-
const hueStep = 2;
|
|
23
|
-
const saturationStep = 0.16;
|
|
24
|
-
const saturationStep2 = 0.05;
|
|
25
|
-
const brightnessStep1 = 0.05;
|
|
26
|
-
const brightnessStep2 = 0.15;
|
|
27
|
-
const lightColorCount = 5;
|
|
28
|
-
const darkColorCount = 4;
|
|
29
|
-
const getHue = (hsv, i, isLight)=>{
|
|
30
|
-
let hue;
|
|
31
|
-
if (hsv.h >= 60 && hsv.h <= 240) {
|
|
32
|
-
hue = isLight ? hsv.h - hueStep * i : hsv.h + hueStep * i;
|
|
33
|
-
} else {
|
|
34
|
-
hue = isLight ? hsv.h + hueStep * i : hsv.h - hueStep * i;
|
|
35
|
-
}
|
|
36
|
-
if (hue < 0) {
|
|
37
|
-
hue += 360;
|
|
38
|
-
} else if (hue >= 360) {
|
|
39
|
-
hue -= 360;
|
|
40
|
-
}
|
|
41
|
-
return Math.round(hue);
|
|
42
|
-
};
|
|
43
|
-
const getSaturation = (hsv, i, isLight)=>{
|
|
44
|
-
let saturation;
|
|
45
|
-
if (isLight) {
|
|
46
|
-
saturation = hsv.s - saturationStep * i;
|
|
47
|
-
} else if (i === darkColorCount) {
|
|
48
|
-
saturation = hsv.s + saturationStep;
|
|
49
|
-
} else {
|
|
50
|
-
saturation = hsv.s + saturationStep2 * i;
|
|
51
|
-
}
|
|
52
|
-
if (saturation > 1) {
|
|
53
|
-
saturation = 1;
|
|
54
|
-
}
|
|
55
|
-
if (isLight && i === lightColorCount && saturation > 0.1) {
|
|
56
|
-
saturation = 0.1;
|
|
57
|
-
}
|
|
58
|
-
if (saturation < 0.06) {
|
|
59
|
-
saturation = 0.06;
|
|
60
|
-
}
|
|
61
|
-
return Number(saturation.toFixed(2));
|
|
62
|
-
};
|
|
63
|
-
const getValue = (hsv, i, isLight)=>{
|
|
64
|
-
let value;
|
|
65
|
-
if (isLight) {
|
|
66
|
-
value = hsv.v + brightnessStep1 * i;
|
|
67
|
-
} else {
|
|
68
|
-
value = hsv.v - brightnessStep2 * i;
|
|
69
|
-
}
|
|
70
|
-
if (value > 1) {
|
|
71
|
-
value = 1;
|
|
72
|
-
}
|
|
73
|
-
return Number(value.toFixed(2));
|
|
74
|
-
};
|
|
75
|
-
const colorPalette = (color, index)=>{
|
|
76
|
-
const isLight = index <= 6;
|
|
77
|
-
const hsv = tinycolor(color).toHsv();
|
|
78
|
-
const i = isLight ? lightColorCount + 1 - index : index - lightColorCount - 1;
|
|
79
|
-
return tinycolor({
|
|
80
|
-
h: getHue(hsv, i, isLight),
|
|
81
|
-
s: getSaturation(hsv, i, isLight),
|
|
82
|
-
v: getValue(hsv, i, isLight)
|
|
83
|
-
}).toHexString();
|
|
84
|
-
};
|
|
85
|
-
export default colorPalette;
|
package/dist/disabledDate.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ import moment from 'moment';
|
|
16
|
-
import { type } from '@lowdefy/helpers';
|
|
17
|
-
const disabledDate = (disabledDates = {})=>{
|
|
18
|
-
const min = type.isNone(disabledDates.min) ? undefined : moment(disabledDates.min).utc().startOf('day');
|
|
19
|
-
const max = type.isNone(disabledDates.max) ? undefined : moment(disabledDates.max).utc().endOf('day');
|
|
20
|
-
const dates = (disabledDates.dates || []).map((date)=>moment(date).utc().startOf('day'));
|
|
21
|
-
const ranges = (disabledDates.ranges || []).map((range)=>{
|
|
22
|
-
if (type.isArray(range) && range.length === 2) {
|
|
23
|
-
return [
|
|
24
|
-
moment(range[0]).utc().startOf('day'),
|
|
25
|
-
moment(range[1]).utc().endOf('day')
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
return null;
|
|
29
|
-
}).filter((range)=>range !== null);
|
|
30
|
-
return (currentDate)=>{
|
|
31
|
-
const utcCurrentData = currentDate.clone().utc();
|
|
32
|
-
if (min && utcCurrentData.isBefore(min)) return true;
|
|
33
|
-
if (max && utcCurrentData.isAfter(max)) return true;
|
|
34
|
-
let match = dates.find((date)=>date.isSame(utcCurrentData.startOf('day')));
|
|
35
|
-
if (match) return true;
|
|
36
|
-
ranges.forEach((range)=>{
|
|
37
|
-
if (utcCurrentData.startOf('day').isSameOrAfter(range[0]) && utcCurrentData.endOf('day').isSameOrBefore(range[1])) {
|
|
38
|
-
match = true;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
if (match) return true;
|
|
42
|
-
return false;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
export default disabledDate;
|
package/dist/getUniqueValues.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
-
const getUniqueValues = (arr, key = 'value')=>{
|
|
17
|
-
const arr2 = arr.map((o)=>{
|
|
18
|
-
if (type.isPrimitive(o)) {
|
|
19
|
-
return JSON.stringify(o);
|
|
20
|
-
}
|
|
21
|
-
return JSON.stringify(o[key]);
|
|
22
|
-
});
|
|
23
|
-
return arr.filter((opt, i)=>{
|
|
24
|
-
if (type.isPrimitive(opt)) {
|
|
25
|
-
return arr2.indexOf(JSON.stringify(opt)) === i;
|
|
26
|
-
}
|
|
27
|
-
return arr2.indexOf(JSON.stringify(opt[key])) === i;
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
export default getUniqueValues;
|
package/dist/getValueIndex.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ import { serializer, type } from '@lowdefy/helpers';
|
|
16
|
-
// eslint-disable-next-line consistent-return
|
|
17
|
-
const getIndex = (value, options, key = 'value')=>{
|
|
18
|
-
// eslint-disable-next-line no-plusplus
|
|
19
|
-
for(let i = 0; i < options.length; i++){
|
|
20
|
-
if (type.isPrimitive(options[i]) && options[i] === value) {
|
|
21
|
-
return `${i}`;
|
|
22
|
-
}
|
|
23
|
-
if (type.isObject(options[i]) && serializer.serializeToString(options[i][key], {
|
|
24
|
-
stable: true
|
|
25
|
-
}) === serializer.serializeToString(value, {
|
|
26
|
-
stable: true
|
|
27
|
-
})) {
|
|
28
|
-
return `${i}`;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
const getValueIndex = (value, options, multiple, key)=>{
|
|
33
|
-
if (!multiple) {
|
|
34
|
-
return getIndex(value, options, key);
|
|
35
|
-
}
|
|
36
|
-
const index = [];
|
|
37
|
-
value.forEach((val)=>{
|
|
38
|
-
index.push(getIndex(val, options, key));
|
|
39
|
-
});
|
|
40
|
-
return index;
|
|
41
|
-
};
|
|
42
|
-
export default getValueIndex;
|
package/dist/style.less
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
@import 'antd/lib/style/index.less';
|
package/dist/types.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/namespace */ /*
|
|
2
|
-
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ import * as blocks from './blocks.js';
|
|
16
|
-
const icons = {};
|
|
17
|
-
const styles = {};
|
|
18
|
-
Object.keys(blocks).forEach((block)=>{
|
|
19
|
-
icons[block] = blocks[block].meta.icons || [];
|
|
20
|
-
styles[block] = blocks[block].meta.styles || [];
|
|
21
|
-
});
|
|
22
|
-
export default {
|
|
23
|
-
blocks: Object.keys(blocks),
|
|
24
|
-
icons,
|
|
25
|
-
styles: {
|
|
26
|
-
default: [
|
|
27
|
-
'style.less'
|
|
28
|
-
],
|
|
29
|
-
...styles
|
|
30
|
-
}
|
|
31
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ // FIX: should be removed: block components should not be recreated.
|
|
16
|
-
import { useLayoutEffect, useRef } from 'react';
|
|
17
|
-
const useRunAfterUpdate = ()=>{
|
|
18
|
-
const afterPaintRef = useRef(null);
|
|
19
|
-
useLayoutEffect(()=>{
|
|
20
|
-
if (afterPaintRef.current) {
|
|
21
|
-
afterPaintRef.current();
|
|
22
|
-
afterPaintRef.current = null;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
return (fn)=>{
|
|
26
|
-
afterPaintRef.current = fn;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export default useRunAfterUpdate;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ export default [
|
|
16
|
-
{
|
|
17
|
-
status: null,
|
|
18
|
-
errors: [],
|
|
19
|
-
warnings: []
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
status: 'success',
|
|
23
|
-
errors: [],
|
|
24
|
-
warnings: []
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
status: 'error',
|
|
28
|
-
errors: [
|
|
29
|
-
'validation error'
|
|
30
|
-
],
|
|
31
|
-
warnings: []
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
status: 'warning',
|
|
35
|
-
warnings: [
|
|
36
|
-
'validation warning'
|
|
37
|
-
],
|
|
38
|
-
errors: []
|
|
39
|
-
},
|
|
40
|
-
];
|