datastake-daf 0.6.593 → 0.6.595

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.
@@ -7345,7 +7345,7 @@ const Style$J = dt.div`
7345
7345
  }
7346
7346
 
7347
7347
  &.ant-btn-primary {
7348
- background: var(--mmt-primary-70);
7348
+ background: var(--color-primary-70);
7349
7349
 
7350
7350
  &[disabled] {
7351
7351
  opacity: 0.6;
@@ -7359,8 +7359,8 @@ const Style$J = dt.div`
7359
7359
  }
7360
7360
 
7361
7361
  &.ant-btn-default {
7362
- color: var(--mmt-primary-70);
7363
- border: 1.5px solid var(--mmt-primary-70);
7362
+ color: var(--color-primary-70);
7363
+ border: 1.5px solid var(--color-primary-70);
7364
7364
 
7365
7365
  &.default {
7366
7366
  color: #1F2A37;
@@ -7375,8 +7375,8 @@ const Style$J = dt.div`
7375
7375
  }
7376
7376
 
7377
7377
  &.blue-color {
7378
- color: var(--mmt-primary-70);
7379
- border-color: var(--mmt-primary-70);
7378
+ color: var(--color-primary-70);
7379
+ border-color: var(--color-primary-70);
7380
7380
  }
7381
7381
  }
7382
7382
  `;
@@ -40497,6 +40497,14 @@ const Navigation = _ref => {
40497
40497
  }) : null;
40498
40498
  };
40499
40499
 
40500
+ const SelectStyle = dt.div`
40501
+ width: 100%;
40502
+
40503
+ .ant-select-arrow {
40504
+ margin-top: 1px !important;
40505
+ }
40506
+ `;
40507
+
40500
40508
  function AuthForm(_ref) {
40501
40509
  var _steps$currentStep;
40502
40510
  let {
@@ -40508,17 +40516,18 @@ function AuthForm(_ref) {
40508
40516
  form,
40509
40517
  errors,
40510
40518
  t = key => key,
40511
- executeRecaptcha = () => {}
40519
+ executeRecaptcha = () => {},
40520
+ getCurrentStep = () => {}
40512
40521
  } = _ref;
40513
40522
  const [formInstance] = antd.Form.useForm(form);
40514
40523
  const [currentStep, setCurrentStep] = React.useState(0);
40515
40524
  const [allFormValues, setAllFormValues] = React.useState(initialValues);
40516
40525
  const [formErrors, setFormErrors] = React.useState(null);
40517
- console.log({
40518
- errors
40519
- });
40520
40526
  const isMultiStep = !!steps;
40521
40527
  const currentFields = isMultiStep ? steps === null || steps === void 0 || (_steps$currentStep = steps[currentStep]) === null || _steps$currentStep === void 0 ? void 0 : _steps$currentStep.fields : fields || [];
40528
+ React.useEffect(() => {
40529
+ getCurrentStep === null || getCurrentStep === void 0 || getCurrentStep(currentStep);
40530
+ }, [currentStep, getCurrentStep]);
40522
40531
  React.useEffect(() => {
40523
40532
  if (isMultiStep) {
40524
40533
  formInstance.setFieldsValue(allFormValues);
@@ -40616,14 +40625,16 @@ function AuthForm(_ref) {
40616
40625
  }, field.props));
40617
40626
  break;
40618
40627
  case "select":
40619
- inputNode = /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
40620
- placeholder: field.placeholder
40621
- }, field.props), {}, {
40622
- children: (_field$options = field.options) === null || _field$options === void 0 ? void 0 : _field$options.map(opt => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
40623
- value: opt.value,
40624
- children: opt.label
40625
- }, opt.value))
40626
- }));
40628
+ inputNode = /*#__PURE__*/jsxRuntime.jsx(SelectStyle, {
40629
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
40630
+ placeholder: field.placeholder
40631
+ }, field.props), {}, {
40632
+ children: (_field$options = field.options) === null || _field$options === void 0 ? void 0 : _field$options.map(opt => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
40633
+ value: opt.value,
40634
+ children: opt.label
40635
+ }, opt.value))
40636
+ }))
40637
+ });
40627
40638
  break;
40628
40639
  case "custom":
40629
40640
  inputNode = field.component;
@@ -40671,7 +40682,7 @@ function AuthForm(_ref) {
40671
40682
  return /*#__PURE__*/jsxRuntime.jsx("div", {
40672
40683
  className: "buttons",
40673
40684
  style: {
40674
- marginTop: 0
40685
+ marginTop: '16px'
40675
40686
  },
40676
40687
  children: /*#__PURE__*/jsxRuntime.jsx(BorderedButton, {
40677
40688
  type: "primary",
@@ -40686,7 +40697,7 @@ function AuthForm(_ref) {
40686
40697
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
40687
40698
  className: "buttons",
40688
40699
  style: {
40689
- marginTop: 0
40700
+ marginTop: '8px'
40690
40701
  },
40691
40702
  children: /*#__PURE__*/jsxRuntime.jsx(BorderedButton, {
40692
40703
  onClick: prev,
@@ -40698,7 +40709,7 @@ function AuthForm(_ref) {
40698
40709
  }) : /*#__PURE__*/jsxRuntime.jsx("div", {
40699
40710
  className: "buttons",
40700
40711
  style: {
40701
- marginTop: 4
40712
+ marginTop: 0
40702
40713
  },
40703
40714
  children: /*#__PURE__*/jsxRuntime.jsx(BorderedButton, {
40704
40715
  type: "primary",
@@ -6575,7 +6575,7 @@ const Style = dt.div`
6575
6575
  }
6576
6576
 
6577
6577
  &.ant-btn-primary {
6578
- background: var(--mmt-primary-70);
6578
+ background: var(--color-primary-70);
6579
6579
 
6580
6580
  &[disabled] {
6581
6581
  opacity: 0.6;
@@ -6589,8 +6589,8 @@ const Style = dt.div`
6589
6589
  }
6590
6590
 
6591
6591
  &.ant-btn-default {
6592
- color: var(--mmt-primary-70);
6593
- border: 1.5px solid var(--mmt-primary-70);
6592
+ color: var(--color-primary-70);
6593
+ border: 1.5px solid var(--color-primary-70);
6594
6594
 
6595
6595
  &.default {
6596
6596
  color: #1F2A37;
@@ -6605,8 +6605,8 @@ const Style = dt.div`
6605
6605
  }
6606
6606
 
6607
6607
  &.blue-color {
6608
- color: var(--mmt-primary-70);
6609
- border-color: var(--mmt-primary-70);
6608
+ color: var(--color-primary-70);
6609
+ border-color: var(--color-primary-70);
6610
6610
  }
6611
6611
  }
6612
6612
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.593",
3
+ "version": "0.6.595",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -1,6 +1,7 @@
1
1
  import React, { useState, useEffect, useCallback } from "react";
2
2
  import { Form, Input, Select } from "antd";
3
3
  import BorderedButton from "../Button/BorderedButton/index.jsx";
4
+ import { SelectStyle } from "./style";
4
5
 
5
6
  function AuthForm ({
6
7
  steps,
@@ -12,17 +13,20 @@ function AuthForm ({
12
13
  errors,
13
14
  t = (key) => key,
14
15
  executeRecaptcha = () => {},
16
+ getCurrentStep = () => {}
15
17
  }){
16
18
  const [formInstance] = Form.useForm(form);
17
19
  const [currentStep, setCurrentStep] = useState(0);
18
20
  const [allFormValues, setAllFormValues] = useState(initialValues);
19
21
  const [formErrors, setFormErrors] = useState(null);
20
22
 
21
- console.log({errors})
22
-
23
23
  const isMultiStep = !!steps;
24
24
  const currentFields = isMultiStep ? steps?.[currentStep]?.fields : fields || [];
25
25
 
26
+ useEffect(() => {
27
+ getCurrentStep?.(currentStep);
28
+ }, [currentStep, getCurrentStep]);
29
+
26
30
  useEffect(() => {
27
31
  if (isMultiStep) {
28
32
  formInstance.setFieldsValue(allFormValues);
@@ -129,13 +133,15 @@ function AuthForm ({
129
133
  break;
130
134
  case "select":
131
135
  inputNode = (
132
- <Select placeholder={field.placeholder} {...field.props}>
133
- {field.options?.map((opt) => (
134
- <Select.Option key={opt.value} value={opt.value}>
135
- {opt.label}
136
- </Select.Option>
137
- ))}
138
- </Select>
136
+ <SelectStyle>
137
+ <Select placeholder={field.placeholder} {...field.props}>
138
+ {field.options?.map((opt) => (
139
+ <Select.Option key={opt.value} value={opt.value}>
140
+ {opt.label}
141
+ </Select.Option>
142
+ ))}
143
+ </Select>
144
+ </SelectStyle>
139
145
  );
140
146
  break;
141
147
  case "custom":
@@ -191,7 +197,7 @@ function AuthForm ({
191
197
  const allFieldsFilled = checkRequiredFieldsFilled({}, form.getFieldsValue());
192
198
 
193
199
  return (
194
- <div className="buttons" style={{ marginTop: 0}}>
200
+ <div className="buttons" style={{ marginTop: '16px'}}>
195
201
  <BorderedButton
196
202
  type="primary"
197
203
  htmlType="submit"
@@ -204,14 +210,14 @@ function AuthForm ({
204
210
  );
205
211
  }}
206
212
  </Form.Item>
207
- <div className="buttons" style={{ marginTop: 0}}>
213
+ <div className="buttons" style={{ marginTop: '8px'}}>
208
214
  <BorderedButton onClick={prev} block className="normal-br">
209
215
  {t("Back")}
210
216
  </BorderedButton>
211
217
  </div>
212
218
  </div>
213
219
  ) : (
214
- <div className="buttons" style={{ marginTop: 4}}>
220
+ <div className="buttons" style={{ marginTop: 0}}>
215
221
  <BorderedButton type="primary" htmlType="submit" block className="normal-br">
216
222
  {isMultiStep ? t("Next") : submitText}
217
223
  </BorderedButton>
@@ -0,0 +1,9 @@
1
+ import styled from "styled-components";
2
+
3
+ export const SelectStyle = styled.div`
4
+ width: 100%;
5
+
6
+ .ant-select-arrow {
7
+ margin-top: 1px !important;
8
+ }
9
+ `;
@@ -20,7 +20,7 @@ const Style = styled.div`
20
20
  }
21
21
 
22
22
  &.ant-btn-primary {
23
- background: var(--mmt-primary-70);
23
+ background: var(--color-primary-70);
24
24
 
25
25
  &[disabled] {
26
26
  opacity: 0.6;
@@ -34,8 +34,8 @@ const Style = styled.div`
34
34
  }
35
35
 
36
36
  &.ant-btn-default {
37
- color: var(--mmt-primary-70);
38
- border: 1.5px solid var(--mmt-primary-70);
37
+ color: var(--color-primary-70);
38
+ border: 1.5px solid var(--color-primary-70);
39
39
 
40
40
  &.default {
41
41
  color: #1F2A37;
@@ -50,8 +50,8 @@ const Style = styled.div`
50
50
  }
51
51
 
52
52
  &.blue-color {
53
- color: var(--mmt-primary-70);
54
- border-color: var(--mmt-primary-70);
53
+ color: var(--color-primary-70);
54
+ border-color: var(--color-primary-70);
55
55
  }
56
56
  }
57
57
  `;