@woosmap/ui 4.110.5 → 4.111.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@woosmap/ui",
3
- "version": "4.110.5",
3
+ "version": "4.111.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/WebGeoServices/ui.git"
@@ -170,6 +170,7 @@ import { ReactComponent as Members } from '../../icons/members.svg';
170
170
  import { ReactComponent as Member } from '../../icons/member.svg';
171
171
  import { ReactComponent as MenuSandwitch } from '../../icons/menu-sandwitch.svg';
172
172
  import { ReactComponent as MenuVertical } from '../../icons/menu-vertical.svg';
173
+ import { ReactComponent as Minus } from '../../icons/minus.svg';
173
174
  import { ReactComponent as Phone } from '../../icons/phone.svg';
174
175
  import { ReactComponent as Play } from '../../icons/play.svg';
175
176
  import { ReactComponent as ProductActivated } from '../../icons/product-activated.svg';
@@ -489,6 +490,7 @@ const ConsoleIcons = {
489
490
  members: Members,
490
491
  'menu-sandwitch': MenuSandwitch,
491
492
  'menu-vertical': MenuVertical,
493
+ minus: Minus,
492
494
  phone: Phone,
493
495
  play: Play,
494
496
  'product-activated': ProductActivated,
@@ -31,7 +31,7 @@ export default class Input extends Component {
31
31
  const { onChange, value: oldValue, name, step } = this.props;
32
32
  const { value: stateValue } = this.state;
33
33
  const theValue = oldValue || stateValue;
34
- let newValue = !Number.isNaN(theValue) ? parseFloat(theValue) + step : step;
34
+ let newValue = !Number.isNaN(parseFloat(theValue)) ? parseFloat(theValue) + step : step;
35
35
  newValue = this.capValue(newValue);
36
36
 
37
37
  if (onChange) {
@@ -45,7 +45,7 @@ export default class Input extends Component {
45
45
  const { onChange, value: oldValue, name, step } = this.props;
46
46
  const { value: stateValue } = this.state;
47
47
  const theValue = oldValue || stateValue;
48
- let newValue = !Number.isNaN(theValue) ? parseFloat(theValue) - step : 0;
48
+ let newValue = !Number.isNaN(parseFloat(theValue)) ? parseFloat(theValue) - step : 0;
49
49
  newValue = this.capValue(newValue);
50
50
 
51
51
  if (onChange) {
@@ -119,6 +119,16 @@ export default class Input extends Component {
119
119
  return (
120
120
  <div className="input__container">
121
121
  {icon ? <Icon icon={icon} isFill={isInputIconFill} size={iconSize} /> : null}
122
+ {type === 'number' && (
123
+ <button
124
+ className="btn btn--icon btn--secondary"
125
+ onClick={this.increment}
126
+ type="button"
127
+ disabled={disabled}
128
+ >
129
+ <Icon icon="add" />
130
+ </button>
131
+ )}
122
132
  {React.createElement(type === 'textarea' ? 'textarea' : 'input', {
123
133
  className: cl('input__item', {
124
134
  error,
@@ -140,14 +150,14 @@ export default class Input extends Component {
140
150
  onChange: this.onChange,
141
151
  })}
142
152
  {type === 'number' && (
143
- <div>
144
- <button onClick={this.increment} type="button" disabled={disabled}>
145
- +
146
- </button>
147
- <button onClick={this.decrement} type="button" disabled={disabled}>
148
- -
149
- </button>
150
- </div>
153
+ <button
154
+ className="btn btn--icon btn--secondary"
155
+ onClick={this.decrement}
156
+ type="button"
157
+ disabled={disabled}
158
+ >
159
+ <Icon icon="minus" />
160
+ </button>
151
161
  )}
152
162
  {type === 'password' && enableTogglePassword && (
153
163
  <span
@@ -192,6 +202,8 @@ export default class Input extends Component {
192
202
  isFilter && type !== 'checkbox' && type !== 'radio' && type !== 'textarea' ? 'input--filter' : null,
193
203
  isNoBorder && type !== 'checkbox' && type !== 'radio' && type !== 'textarea' ? 'input--noborder' : null,
194
204
  { 'input--iconed': icon },
205
+ { 'input--number': type === 'number' },
206
+ { 'input--color': type === 'color' },
195
207
  { 'input--password-toggle': enableTogglePassword && type === 'password' },
196
208
  `input--${size}`,
197
209
  type === 'checkbox' || type === 'radio' ? `input--${type}` : null,
@@ -94,7 +94,7 @@ const Template = (args) => {
94
94
  enableTogglePassword
95
95
  />
96
96
  <Input placeholder="Type search" type="search" label="Search" />
97
- <Input placeholder="Number input" type="number" label="Number" />
97
+ <Input placeholder="Number input" type="number" label="Number" step={0.1} min={0} />
98
98
  <Input placeholder="Color input" type="color" label="Color" />
99
99
  </div>
100
100
  );
@@ -0,0 +1 @@
1
+ <svg id="a" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><line x1="17.476" y1="12" x2="6.524" y2="12"/></svg>
@@ -121,6 +121,10 @@ input
121
121
  &:not([type=button]):not([type=checkbox]):not([type=radio]):not([type=textarea])
122
122
  height $inputHeight
123
123
  padding $inputPadding
124
+ .input--color &
125
+ -webkit-appearance none
126
+ padding 0
127
+ border none
124
128
  .input--large &
125
129
  height $inputHeightLarge
126
130
  padding $inputPaddingLarge
@@ -210,6 +214,26 @@ input
210
214
  .input
211
215
  &__item
212
216
  border-color $inputBorderColor !important
217
+ &--color
218
+ .input__item
219
+ br()
220
+ overflow hidden
221
+ &::-webkit-color-swatch-wrapper
222
+
223
+ padding 0
224
+ &::-webkit-color-swatch
225
+ border none
226
+ &--number
227
+ .input__container
228
+ display flex
229
+ > :first-child
230
+ border-radius $borderRadius 0 0 $borderRadius !important
231
+ > :nth-child(2)
232
+ border-radius 0 !important
233
+ border-left 0 !important
234
+ border-right 0 !important
235
+ > :nth-child(3)
236
+ border-radius 0 $borderRadius $borderRadius 0 !important
213
237
  input::-webkit-outer-spin-button
214
238
  input::-webkit-inner-spin-button
215
239
  -webkit-appearance none
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="Encoding">
4
- <file url="PROJECT" charset="UTF-8" />
5
- </component>
6
- </project>
@@ -1,18 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
6
- <option name="ignoredPackages">
7
- <value>
8
- <list size="4">
9
- <item index="0" class="java.lang.String" itemvalue="Fabric" />
10
- <item index="1" class="java.lang.String" itemvalue="PyYAML" />
11
- <item index="2" class="java.lang.String" itemvalue="Jinja2" />
12
- <item index="3" class="java.lang.String" itemvalue="github3.py" />
13
- </list>
14
- </value>
15
- </option>
16
- </inspection_tool>
17
- </profile>
18
- </component>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <settings>
3
- <option name="USE_PROJECT_PROFILE" value="false" />
4
- <version value="1.0" />
5
- </settings>
6
- </component>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="EslintConfiguration">
4
- <option name="fix-on-save" value="true" />
5
- </component>
6
- </project>
package/.idea/misc.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
4
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/ui.iml" filepath="$PROJECT_DIR$/.idea/ui.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="PrettierConfiguration">
4
- <option name="myRunOnReformat" value="true" />
5
- </component>
6
- </project>
package/.idea/ui.iml DELETED
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="PYTHON_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$" />
5
- <orderEntry type="inheritedJdk" />
6
- <orderEntry type="sourceFolder" forTests="false" />
7
- </component>
8
- <component name="TemplatesService">
9
- <option name="TEMPLATE_FOLDERS">
10
- <list>
11
- <option value="$MODULE_DIR$/node_modules/@storybook/core/dist/server/templates" />
12
- </list>
13
- </option>
14
- </component>
15
- </module>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>