@innoways/drip-form-theme-antd 9.0.8 → 9.0.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: add id prop support to StyledFlatPicker for better form labelling 9.1.0
8
+ - Updated dependencies
9
+ - @innoways/hooks@9.0.10
10
+ - @innoways/utils@9.0.10
11
+
12
+ ## 9.0.9
13
+
14
+ ### Patch Changes
15
+
16
+ - feat: add id prop support to StyledFlatPicker for better form labelling 9.0.9
17
+ - Updated dependencies
18
+ - @innoways/hooks@9.0.9
19
+ - @innoways/utils@9.0.9
20
+
3
21
  ## 9.0.8
4
22
 
5
23
  ### Patch Changes
package/dist/index.js CHANGED
@@ -21893,6 +21893,7 @@ var TimePickerField = function TimePickerField(_ref) {
21893
21893
  onChange: _onChange,
21894
21894
  style: style,
21895
21895
  locale: locale,
21896
+ format: format,
21896
21897
  use12Hours: use12Hours,
21897
21898
  placeholder: restProps.placeholder || 'Please select a time'
21898
21899
  }, restProps));
@@ -21909,6 +21910,7 @@ var StyledFlatPicker = function StyledFlatPicker(props) {
21909
21910
  _onChange = props.onChange,
21910
21911
  options = props.options,
21911
21912
  className = props.className,
21913
+ id = props.id,
21912
21914
  themeColor = props.themeColor,
21913
21915
  disabled = props.disabled,
21914
21916
  style = props.style,
@@ -22142,7 +22144,12 @@ var StyledFlatPicker = function StyledFlatPicker(props) {
22142
22144
 
22143
22145
  var flatpickrOptions = _objectSpread$5(_objectSpread$5({}, options), {}, {
22144
22146
  onReady: function onReady(selectedDates, dateStr, instance) {
22145
- if (!(instance !== null && instance !== void 0 && instance.calendarContainer)) return;
22147
+ if (!(instance !== null && instance !== void 0 && instance.calendarContainer)) return; // Forward id to the visible altInput so form labelling works correctly
22148
+
22149
+ if (id && instance.altInput) {
22150
+ instance.altInput.name = id;
22151
+ }
22152
+
22146
22153
  var yearInput = instance.calendarContainer.querySelector('.cur-year');
22147
22154
  var numInputWrapper = instance.calendarContainer.querySelector('.numInputWrapper');
22148
22155
  var monthsDropdown = instance.calendarContainer.querySelector('.flatpickr-monthDropdown-months'); // Add id to month dropdown
@@ -22197,6 +22204,7 @@ var StyledFlatPicker = function StyledFlatPicker(props) {
22197
22204
  },
22198
22205
  options: flatpickrOptions,
22199
22206
  disabled: disabled,
22207
+ id: id ? "".concat(id, "-hidden") : undefined,
22200
22208
  className: "".concat(className ? className : '', " form-control flat-date-picker")
22201
22209
  }), allowClear && showClear && /*#__PURE__*/React.createElement(X, {
22202
22210
  type: "button",
@@ -22219,6 +22227,7 @@ StyledFlatPicker.propTypes = {
22219
22227
  value: _pt.any,
22220
22228
  onChange: _pt.func.isRequired,
22221
22229
  className: _pt.string,
22230
+ id: _pt.string,
22222
22231
  themeColor: _pt.string,
22223
22232
  disabled: _pt.bool,
22224
22233
  allowClear: _pt.bool
@@ -22560,7 +22569,7 @@ var DatePickerField = function DatePickerField(_ref) {
22560
22569
  return moment(item).format(format);
22561
22570
  }).join(' ~ ') : moment(fieldData).format(format) : null;
22562
22571
  return /*#__PURE__*/React.createElement(React.Fragment, null, range ? /*#__PURE__*/React.createElement(StyledFlatPicker, {
22563
- id: "range-picker",
22572
+ id: "".concat(fieldKey, "-range-picker"),
22564
22573
  className: "form-control border-0",
22565
22574
  value: fieldData ? [fieldData[0], fieldData[1]] : [],
22566
22575
  onChange: function onChange(date, isCleared) {
@@ -22587,7 +22596,7 @@ var DatePickerField = function DatePickerField(_ref) {
22587
22596
  _onChange(moment(date[0]).format(format));
22588
22597
  }
22589
22598
  },
22590
- id: "default-picker",
22599
+ id: "".concat(fieldKey, "-default-picker"),
22591
22600
  themeColor: themeColor,
22592
22601
  style: style,
22593
22602
  allowClear: allowClear,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innoways/drip-form-theme-antd",
3
- "version": "9.0.8",
3
+ "version": "9.0.10",
4
4
  "author": "JDFED",
5
5
  "description": "drip-form antd主题包",
6
6
  "main": "dist/index.js",
@@ -31,10 +31,10 @@
31
31
  "dependencies": {
32
32
  "@ant-design/icons": "^4.7.0",
33
33
  "@babel/runtime": "^7.10.2",
34
- "@innoways/hooks": "^9.0.8",
35
- "@innoways/utils": "^9.0.8",
34
+ "@innoways/hooks": "^9.0.10",
35
+ "@innoways/utils": "^9.0.10",
36
36
  "antd": "^4.16.13",
37
- "flatpickr": "^4.6.13",
37
+ "flatpickr": "4.6.3",
38
38
  "moment": "^2.26.0",
39
39
  "react-color": "^2.18.1",
40
40
  "react-flatpickr": "^3.10.13",