@workday/canvas-kit-preview-react 9.0.0-alpha.364-next.3 → 9.0.0-alpha.382-next.2

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.
Files changed (97) hide show
  1. package/dist/commonjs/color-picker/lib/ColorPicker.js +24 -47
  2. package/dist/commonjs/color-picker/lib/parts/ColorReset.js +32 -23
  3. package/dist/commonjs/color-picker/lib/parts/SwatchBook.js +26 -39
  4. package/dist/commonjs/form-field/lib/FormField.js +10 -33
  5. package/dist/commonjs/form-field/lib/FormFieldHint.js +8 -31
  6. package/dist/commonjs/form-field/lib/FormFieldInput.js +6 -17
  7. package/dist/commonjs/form-field/lib/FormFieldLabel.js +8 -31
  8. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.js +4 -5
  9. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.js +5 -6
  10. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.js +4 -5
  11. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.js +8 -16
  12. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.js +3 -3
  13. package/dist/commonjs/menu/lib/Menu.js +96 -129
  14. package/dist/commonjs/menu/lib/MenuItem.js +94 -109
  15. package/dist/commonjs/pill/lib/Pill.js +55 -60
  16. package/dist/commonjs/pill/lib/PillAvatar.js +6 -17
  17. package/dist/commonjs/pill/lib/PillCount.js +7 -30
  18. package/dist/commonjs/pill/lib/PillIcon.js +8 -31
  19. package/dist/commonjs/pill/lib/PillIconButton.js +13 -36
  20. package/dist/commonjs/pill/lib/PillLabel.js +10 -33
  21. package/dist/commonjs/pill/lib/usePillModel.js +8 -16
  22. package/dist/commonjs/segmented-control/lib/SegmentedControl.js +6 -7
  23. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +24 -49
  24. package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +13 -38
  25. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.js +8 -10
  26. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.js +31 -31
  27. package/dist/commonjs/select/lib/Select.js +147 -189
  28. package/dist/commonjs/select/lib/SelectBase.js +106 -101
  29. package/dist/commonjs/select/lib/SelectMenu.js +53 -84
  30. package/dist/commonjs/select/lib/SelectOption.js +33 -47
  31. package/dist/commonjs/select/lib/scrolling.js +6 -7
  32. package/dist/commonjs/select/lib/utils.js +4 -4
  33. package/dist/commonjs/side-panel/lib/SidePanel.js +36 -51
  34. package/dist/commonjs/side-panel/lib/SidePanelToggleButton.js +17 -40
  35. package/dist/commonjs/side-panel/lib/hooks.js +20 -20
  36. package/dist/commonjs/status-indicator/lib/StatusIndicator.js +10 -34
  37. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +9 -21
  38. package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.js +5 -28
  39. package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.js +6 -15
  40. package/dist/commonjs/text-area/lib/TextArea.js +8 -31
  41. package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -1
  42. package/dist/commonjs/text-area/lib/TextAreaField.js +12 -36
  43. package/dist/commonjs/text-input/lib/TextInput.js +8 -31
  44. package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -1
  45. package/dist/commonjs/text-input/lib/TextInputField.js +12 -24
  46. package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +3 -3
  47. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +1 -1
  48. package/dist/es6/color-picker/lib/ColorPicker.js +15 -38
  49. package/dist/es6/color-picker/lib/parts/ColorReset.js +27 -18
  50. package/dist/es6/color-picker/lib/parts/SwatchBook.js +21 -34
  51. package/dist/es6/form-field/lib/FormField.js +4 -27
  52. package/dist/es6/form-field/lib/FormFieldHint.js +4 -27
  53. package/dist/es6/form-field/lib/FormFieldInput.js +3 -14
  54. package/dist/es6/form-field/lib/FormFieldLabel.js +4 -27
  55. package/dist/es6/form-field/lib/hooks/useFormFieldHint.js +2 -3
  56. package/dist/es6/form-field/lib/hooks/useFormFieldInput.js +3 -4
  57. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.js +2 -3
  58. package/dist/es6/form-field/lib/hooks/useFormFieldModel.js +8 -16
  59. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.js +2 -2
  60. package/dist/es6/menu/lib/Menu.js +91 -125
  61. package/dist/es6/menu/lib/MenuItem.js +90 -106
  62. package/dist/es6/pill/lib/Pill.js +45 -50
  63. package/dist/es6/pill/lib/PillAvatar.js +3 -14
  64. package/dist/es6/pill/lib/PillCount.js +4 -27
  65. package/dist/es6/pill/lib/PillIcon.js +3 -26
  66. package/dist/es6/pill/lib/PillIconButton.js +7 -30
  67. package/dist/es6/pill/lib/PillLabel.js +5 -28
  68. package/dist/es6/pill/lib/usePillModel.js +8 -16
  69. package/dist/es6/segmented-control/lib/SegmentedControl.js +2 -3
  70. package/dist/es6/segmented-control/lib/SegmentedControlItem.js +17 -42
  71. package/dist/es6/segmented-control/lib/SegmentedControlList.js +9 -34
  72. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.js +5 -7
  73. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.js +29 -29
  74. package/dist/es6/select/lib/Select.js +144 -186
  75. package/dist/es6/select/lib/SelectBase.js +99 -94
  76. package/dist/es6/select/lib/SelectMenu.js +49 -80
  77. package/dist/es6/select/lib/SelectOption.js +30 -44
  78. package/dist/es6/select/lib/scrolling.js +6 -7
  79. package/dist/es6/select/lib/utils.js +4 -4
  80. package/dist/es6/side-panel/lib/SidePanel.js +31 -46
  81. package/dist/es6/side-panel/lib/SidePanelToggleButton.js +10 -33
  82. package/dist/es6/side-panel/lib/hooks.js +19 -19
  83. package/dist/es6/status-indicator/lib/StatusIndicator.js +5 -29
  84. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +6 -18
  85. package/dist/es6/status-indicator/lib/StatusIndicatorLabel.js +3 -26
  86. package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.js +6 -15
  87. package/dist/es6/text-area/lib/TextArea.js +4 -27
  88. package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -1
  89. package/dist/es6/text-area/lib/TextAreaField.js +9 -33
  90. package/dist/es6/text-input/lib/TextInput.js +4 -27
  91. package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -1
  92. package/dist/es6/text-input/lib/TextInputField.js +9 -21
  93. package/dist/es6/text-input/lib/hooks/useTextInputField.js +1 -1
  94. package/dist/es6/text-input/lib/hooks/useTextInputModel.js +1 -1
  95. package/package.json +3 -4
  96. package/text-area/lib/TextAreaField.tsx +6 -2
  97. package/text-input/lib/TextInputField.tsx +6 -2
@@ -1,16 +1,5 @@
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
1
  import { createModelHook, useUniqueId } from '@workday/canvas-kit-react/common';
13
- export var usePillModel = createModelHook({
2
+ export const usePillModel = createModelHook({
14
3
  defaultConfig: {
15
4
  /**
16
5
  * Determines the max width of the pill. If the pill text is longer than the max width,
@@ -27,8 +16,11 @@ export var usePillModel = createModelHook({
27
16
  */
28
17
  id: '',
29
18
  },
30
- })(function (config) {
31
- var id = useUniqueId(config.id);
32
- var state = __assign(__assign({}, config), { id: id });
33
- return { state: state, events: {} };
19
+ })(config => {
20
+ const id = useUniqueId(config.id);
21
+ const state = {
22
+ ...config,
23
+ id,
24
+ };
25
+ return { state, events: {} };
34
26
  });
@@ -23,7 +23,7 @@ import { SegmentedControlItem } from './SegmentedControlItem';
23
23
  * <SegmentedControl model={model}>{Child components}</SegmentedControl>;
24
24
  * ```
25
25
  */
26
- export var SegmentedControl = createContainer()({
26
+ export const SegmentedControl = createContainer()({
27
27
  displayName: 'SegmentedControl',
28
28
  modelHook: useSegmentedControlModel,
29
29
  subComponents: {
@@ -46,7 +46,6 @@ export var SegmentedControl = createContainer()({
46
46
  */
47
47
  Item: SegmentedControlItem,
48
48
  },
49
- })(function (_a) {
50
- var children = _a.children;
49
+ })(({ children }) => {
51
50
  return React.createElement(React.Fragment, null, children);
52
51
  });
@@ -1,25 +1,3 @@
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
1
  import * as React from 'react';
24
2
  import { colors, type, space } from '@workday/canvas-kit-react/tokens';
25
3
  import { createSubcomponent, useIsRTL } from '@workday/canvas-kit-react/common';
@@ -28,7 +6,7 @@ import { BaseButton, getMinWidthStyles, } from '@workday/canvas-kit-react/button
28
6
  import { useSegmentedControlModel } from './hooks/useSegmentedControlModel';
29
7
  import { Text } from '@workday/canvas-kit-react/text';
30
8
  import { useSegmentedControlItem } from './hooks/useSegmentedControlItem';
31
- var getButtonSize = function (size) {
9
+ const getButtonSize = (size) => {
32
10
  switch (size) {
33
11
  case 'large':
34
12
  return 'medium';
@@ -40,7 +18,7 @@ var getButtonSize = function (size) {
40
18
  return 'medium';
41
19
  }
42
20
  };
43
- var getIconButtonColors = function (toggled) {
21
+ const getIconButtonColors = (toggled) => {
44
22
  return {
45
23
  default: {
46
24
  background: toggled ? colors.frenchVanilla100 : colors.soap200,
@@ -65,44 +43,41 @@ var getIconButtonColors = function (toggled) {
65
43
  },
66
44
  };
67
45
  };
68
- var getPaddingStyles = function (children, size, icon) {
46
+ const getPaddingStyles = (children, size, icon) => {
69
47
  if (!children) {
70
48
  return 0;
71
49
  }
72
50
  switch (size) {
73
51
  case 'large':
74
- return icon ? "0 " + space.m + " 0 20px" : "0 " + space.m;
52
+ return icon ? `0 ${space.m} 0 20px` : `0 ${space.m}`;
75
53
  case 'medium':
76
- return icon ? "0 20px 0 " + space.s : "0 " + space.s;
54
+ return icon ? `0 20px 0 ${space.s}` : `0 ${space.s}`;
77
55
  case 'small':
78
- return icon ? "0 " + space.xs + " 0 " + space.xxs : "0 " + space.xs;
56
+ return icon ? `0 ${space.xs} 0 ${space.xxs}` : `0 ${space.xs}`;
79
57
  default:
80
- return icon ? "0 20px 0 " + space.s : "0 " + space.s;
58
+ return icon ? `0 20px 0 ${space.s}` : `0 ${space.s}`;
81
59
  }
82
60
  };
83
- var geButtonStyles = function (size, children, icon) {
84
- var buttonSize = getButtonSize(size);
85
- var minWidthValue = getMinWidthStyles(children, children ? size : buttonSize);
61
+ const geButtonStyles = (size, children, icon) => {
62
+ const buttonSize = getButtonSize(size);
63
+ const minWidthValue = getMinWidthStyles(children, children ? size : buttonSize);
86
64
  return {
87
65
  height: getMinWidthStyles(false, buttonSize),
88
66
  minWidth: minWidthValue,
89
67
  padding: getPaddingStyles(children, size, icon),
90
68
  };
91
69
  };
92
- var Container = function (_a) {
93
- var tooltipProps = _a.tooltipProps, children = _a.children;
94
- return tooltipProps ? (React.createElement(Tooltip, __assign({}, tooltipProps), children)) : (React.createElement(React.Fragment, null, children));
70
+ const Container = ({ tooltipProps, children, }) => {
71
+ return tooltipProps ? (React.createElement(Tooltip, Object.assign({}, tooltipProps), children)) : (React.createElement(React.Fragment, null, children));
95
72
  };
96
- export var SegmentedControlItem = createSubcomponent('button')({
73
+ export const SegmentedControlItem = createSubcomponent('button')({
97
74
  displayName: 'SegmentedControl.Item',
98
75
  modelHook: useSegmentedControlModel,
99
76
  elemPropsHook: useSegmentedControlItem,
100
- })(function (_a, Element, _b) {
101
- var size = _b.state.size;
102
- var children = _a.children, icon = _a.icon, tooltipProps = _a.tooltipProps, elemProps = __rest(_a, ["children", "icon", "tooltipProps"]);
103
- var _c = type.levels.subtext[size === 'small' ? 'medium' : 'large'], color = _c.color, textStyles = __rest(_c, ["color"]);
77
+ })(({ children, icon, tooltipProps, ...elemProps }, Element, { state: { size } }) => {
78
+ const { color, ...textStyles } = type.levels.subtext[size === 'small' ? 'medium' : 'large'];
104
79
  return (React.createElement(Container, { tooltipProps: tooltipProps },
105
- React.createElement(BaseButton, __assign({ as: Element, borderRadius: "m", colors: getIconButtonColors(elemProps['aria-pressed']) }, geButtonStyles(size, children, icon), elemProps),
80
+ React.createElement(BaseButton, Object.assign({ as: Element, borderRadius: "m", colors: getIconButtonColors(elemProps['aria-pressed']) }, geButtonStyles(size, children, icon), elemProps),
106
81
  icon && (React.createElement(BaseButton.Icon, { size: size === 'small' ? 'extraSmall' : 'medium', icon: icon, shouldMirrorIcon: useIsRTL() })),
107
- children && (React.createElement(Text, __assign({}, textStyles, { fontWeight: "bold", textAlign: "left" }), children)))));
82
+ children && (React.createElement(Text, Object.assign({}, textStyles, { fontWeight: "bold", textAlign: "left" }), children)))));
108
83
  });
@@ -1,44 +1,19 @@
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
1
  import * as React from 'react';
24
2
  import { createSubcomponent, createElemPropsHook, } from '@workday/canvas-kit-react/common';
25
3
  import { Grid } from '@workday/canvas-kit-react/layout';
26
4
  import { useListRenderItems } from '@workday/canvas-kit-react/collection';
27
5
  import { useSegmentedControlModel } from './hooks/useSegmentedControlModel';
28
- export var useSegmentedControlList = createElemPropsHook(useSegmentedControlModel)(function (_a) {
29
- var _b;
30
- var _c = _a.state, orientation = _c.orientation, disabled = _c.disabled, items = _c.items;
31
- var directionName = orientation === 'vertical' ? 'Row' : 'Column';
32
- return _b = {},
33
- _b["gridTemplate" + directionName + "s"] = "repeat(" + items.length + ", 1fr)",
34
- _b.opacity = disabled ? 0.4 : undefined,
35
- _b;
6
+ export const useSegmentedControlList = createElemPropsHook(useSegmentedControlModel)(({ state: { orientation, disabled, items } }) => {
7
+ const directionName = orientation === 'vertical' ? 'Row' : 'Column';
8
+ return {
9
+ [`gridTemplate${directionName}s`]: `repeat(${items.length}, 1fr)`,
10
+ opacity: disabled ? 0.4 : undefined,
11
+ };
36
12
  });
37
- export var SegmentedControlList = createSubcomponent('div')({
13
+ export const SegmentedControlList = createSubcomponent('div')({
38
14
  displayName: 'SegmentedControl.List',
39
15
  modelHook: useSegmentedControlModel,
40
16
  elemPropsHook: useSegmentedControlList,
41
- })(function (_a, Element, model) {
42
- var children = _a.children, elemProps = __rest(_a, ["children"]);
43
- return (React.createElement(Grid, __assign({ as: Element, display: "inline-grid", role: "group", backgroundColor: "soap200", border: "1px solid transparent", borderColor: "licorice200", borderRadius: "l", padding: "3px", gridGap: "xxs" }, elemProps), useListRenderItems(model, children)));
17
+ })(({ children, ...elemProps }, Element, model) => {
18
+ return (React.createElement(Grid, Object.assign({ as: Element, display: "inline-grid", role: "group", backgroundColor: "soap200", border: "1px solid transparent", borderColor: "licorice200", borderRadius: "l", padding: "3px", gridGap: "xxs" }, elemProps), useListRenderItems(model, children)));
44
19
  });
@@ -1,16 +1,14 @@
1
1
  import { createElemPropsHook, composeHooks } from '@workday/canvas-kit-react/common';
2
2
  import { useListItemRegister, isSelected, useListItemSelect, } from '@workday/canvas-kit-react/collection';
3
3
  import { useSegmentedControlModel } from './useSegmentedControlModel';
4
- export var useSegmentedControlItem = composeHooks(useListItemSelect, createElemPropsHook(useSegmentedControlModel)(function (model, _, elemProps) {
5
- if (elemProps === void 0) { elemProps = {}; }
6
- var name = elemProps['data-id'] || '';
7
- var selected = !!name && isSelected(name, model.state);
4
+ export const useSegmentedControlItem = composeHooks(useListItemSelect, createElemPropsHook(useSegmentedControlModel)((model, _, elemProps = {}) => {
5
+ const name = elemProps['data-id'] || '';
6
+ const selected = !!name && isSelected(name, model.state);
8
7
  return {
9
- id: model.state.id + "-" + name,
8
+ id: `${model.state.id}-${name}`,
10
9
  'aria-pressed': selected,
11
10
  };
12
- }), useListItemRegister, createElemPropsHook(useSegmentedControlModel)(function (_a) {
13
- var state = _a.state;
11
+ }), useListItemRegister, createElemPropsHook(useSegmentedControlModel)(({ state }) => {
14
12
  return {
15
13
  // override the default disabled functionality of `useListItemRegister`
16
14
  // it shouldn't allow to set disabled state only for one button
@@ -1,55 +1,46 @@
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
1
  import React from 'react';
13
2
  import { createModelHook } from '@workday/canvas-kit-react/common';
14
3
  import { defaultGetId, useListModel } from '@workday/canvas-kit-react/collection';
15
- export var useSegmentedControlModel = createModelHook({
16
- defaultConfig: __assign(__assign({}, useListModel.defaultConfig), {
4
+ export const useSegmentedControlModel = createModelHook({
5
+ defaultConfig: {
6
+ ...useListModel.defaultConfig,
17
7
  /**
18
8
  * Optional id for the whole `SegmentedControl` group. If not provided, a unique id will be created.
19
9
  * @default useUniqueId()
20
10
  */
21
- id: '',
11
+ id: '',
22
12
  /**
23
13
  * An initially selected value. This value must match the `data-id` of the `SegmentedControl.Item` component.
24
14
  * If not provided, the first value will be selected.
25
15
  */
26
- initialValue: '',
16
+ initialValue: '',
27
17
  /**
28
18
  * Sets disabled state for all segmented control buttons
29
19
  * @default false
30
20
  */
31
- disabled: false,
21
+ disabled: false,
32
22
  /**
33
23
  * Sets the size of the segmented control container and its buttons. Can be `small`, `medium` or `large`.
34
24
  * @default 'medium'
35
25
  */
36
- size: 'medium',
26
+ size: 'medium',
37
27
  /**
38
28
  * The SegmentedControl can rendered in a horizontal or vertical orientation.
39
29
  * We suggest to use the `vertical` orientation only for icon only variant.
40
30
  * @default 'horizontal'
41
31
  */
42
- orientation: 'horizontal' }),
32
+ orientation: 'horizontal',
33
+ },
43
34
  requiredConfig: useListModel.requiredConfig,
44
- })(function (config) {
35
+ })(config => {
45
36
  var _a;
46
- var getId = config.getId || defaultGetId;
47
- var initialSelectedRef = React.useRef(config.initialValue);
48
- var items = config.items;
49
- var model = useListModel(useListModel.mergeConfig(config, {
37
+ const getId = config.getId || defaultGetId;
38
+ const initialSelectedRef = React.useRef(config.initialValue);
39
+ const items = config.items;
40
+ const model = useListModel(useListModel.mergeConfig(config, {
50
41
  orientation: config.orientation || 'horizontal',
51
- items: items,
52
- onRegisterItem: function (data) {
42
+ items,
43
+ onRegisterItem(data) {
53
44
  if (!initialSelectedRef.current) {
54
45
  initialSelectedRef.current = getId(data.item);
55
46
  events.select({ id: initialSelectedRef.current });
@@ -62,8 +53,17 @@ export var useSegmentedControlModel = createModelHook({
62
53
  : [],
63
54
  shouldVirtualize: false,
64
55
  }));
65
- var state = __assign(__assign({}, model.state), { disabled: config.disabled, size: config.size });
66
- var events = __assign({}, model.events);
67
- return __assign(__assign({}, model), { state: state,
68
- events: events });
56
+ const state = {
57
+ ...model.state,
58
+ disabled: config.disabled,
59
+ size: config.size,
60
+ };
61
+ const events = {
62
+ ...model.events,
63
+ };
64
+ return {
65
+ ...model,
66
+ state,
67
+ events,
68
+ };
69
69
  });