@licklist/design 0.44.551-dev.5 → 0.44.551-dev.7

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.
@@ -15,6 +15,7 @@ interface NumberInputHorizontalProps {
15
15
  defaultValue?: number;
16
16
  hasCurrency?: boolean;
17
17
  isLoading?: boolean;
18
+ shouldHideButtons?: boolean;
18
19
  }
19
20
  export declare const NumberInputHorizontal: React.ForwardRefExoticComponent<NumberInputHorizontalProps & React.RefAttributes<HTMLInputElement>>;
20
21
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInputHorizontal.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAK1D,KAAK,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC;AAE7B,UAAU,0BAA0B;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,qBAAqB,qGAkHjC,CAAC"}
1
+ {"version":3,"file":"NumberInputHorizontal.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAK1D,KAAK,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC;AAE7B,UAAU,0BAA0B;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,eAAO,MAAM,qBAAqB,qGAkHjC,CAAC"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),i=e(t),n=require("react-i18next"),a=require("react-bootstrap"),l=require("../../../static/Icon.js"),s=e(require("clsx"));require("../../../static/index.js");var r=t.forwardRef((function(e,t){var r=e.disabled,o=void 0!==r&&r,u=e.className,c=void 0===u?"":u,m=e.value,d=e.step,b=e.size,p=void 0===b?"small":b,v=e.hasCurrency,f=e.onChange,N=e.onPlusClick,z=e.onMinusClick,g=e.onSelect,y=e.min,_=e.max,x=e.defaultValue,C=e.isLoading,k=void 0!==C&&C,E=(0,n.useTranslation(["Sale"]).t)("Sale:soldOut"),j="big"===p,h=s(c,"licklist-number-input-horizontal");return i.createElement("div",{className:h},i.createElement("button",{type:"button",onClick:function(){void 0!==y&&m>y&&z(m-1),void 0===y&&z(m-1)},className:["licklist-number-input-horizontal__btn-minus",j?"big-sizes-btn":"small-sizes-btn"].join(" "),disabled:o},i.createElement(l.default,{type:"minus",className:j?"big_icon":"small_icon"})),i.createElement("div",{className:["position-relative d-flex",o&&j&&"w-100"].join(" ")},v&&i.createElement("div",{className:"currency"},"£"),i.createElement(a.FormControl,{ref:t,onClick:function(e){g&&g(e),e.target.select()},type:o&&j?"text":"number",className:s(j?"big-sizes-input":"small-sizes-input",o&&"border-0"),onChange:function(e){return f(Number(e.target.value))},value:o&&j&&!k?E:m,min:y,max:_,step:d,defaultValue:x,disabled:o&&!g})),i.createElement("button",{type:"button",onClick:function(){void 0!==_&&m<_&&N(m+1),void 0===_&&N(m+1)},className:["licklist-number-input-horizontal__btn-plus",j?"big-sizes-btn":"small-sizes-btn"].join(" "),disabled:o},i.createElement(l.default,{type:"plus",className:j?"big_icon":"small_icon"})))}));r.displayName="NumberInputHorizontal",exports.NumberInputHorizontal=r;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),i=e(t),n=require("react-i18next"),a=require("react-bootstrap"),l=require("../../../static/Icon.js"),s=e(require("clsx"));require("../../../static/index.js");var o=t.forwardRef((function(e,t){var o=e.disabled,r=void 0!==o&&o,u=e.shouldHideButtons,c=e.className,m=void 0===c?"":c,d=e.value,b=e.step,p=e.size,v=void 0===p?"small":p,f=e.hasCurrency,N=e.onChange,z=e.onPlusClick,g=e.onMinusClick,y=e.onSelect,_=e.min,x=e.max,C=e.defaultValue,k=e.isLoading,E=void 0!==k&&k,h=(0,n.useTranslation(["Sale"]).t)("Sale:soldOut"),j="big"===v,q=s(m,"licklist-number-input-horizontal");return i.createElement("div",{className:q},i.createElement("button",{type:"button",onClick:function(){void 0!==_&&d>_&&g(d-1),void 0===_&&g(d-1)},className:["licklist-number-input-horizontal__btn-minus",j?"big-sizes-btn":"small-sizes-btn"].join(" "),disabled:r||u},i.createElement(l.default,{type:"minus",className:j?"big_icon":"small_icon"})),i.createElement("div",{className:["position-relative d-flex",r&&j&&"w-100"].join(" ")},f&&i.createElement("div",{className:"currency"},"£"),i.createElement(a.FormControl,{ref:t,onClick:function(e){y&&y(e),e.target.select()},type:r&&j?"text":"number",className:s(j?"big-sizes-input":"small-sizes-input"),onChange:function(e){return N(Number(e.target.value))},value:r&&j&&!E?h:d,min:_,max:x,step:b,defaultValue:C,disabled:r})),i.createElement("button",{type:"button",onClick:function(){void 0!==x&&d<x&&z(d+1),void 0===x&&z(d+1)},className:["licklist-number-input-horizontal__btn-plus",j?"big-sizes-btn":"small-sizes-btn"].join(" "),disabled:r||u},i.createElement(l.default,{type:"plus",className:j?"big_icon":"small_icon"})))}));o.displayName="NumberInputHorizontal",exports.NumberInputHorizontal=o;
@@ -31,10 +31,6 @@
31
31
  font-size: 0.7rem;
32
32
  }
33
33
 
34
- &.today:first-of-type {
35
- min-width: 7.5rem;
36
- }
37
-
38
34
  &.disabled {
39
35
  border: 2px solid $snippet-calendar-disabled-button-border-color;
40
36
  background-color: $snippet-calendar-disabled-button-background-color;
@@ -291,10 +291,7 @@
291
291
  width: 7rem;
292
292
  height: 2.6rem;
293
293
  }
294
- .small-sizes-input:disabled {
295
- border: none;
296
- background-color: white !important;
297
- }
294
+
298
295
  .big-sizes-input {
299
296
  height: 3.75rem;
300
297
  font-size: 1.7rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.551-dev.5",
3
+ "version": "0.44.551-dev.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -1 +1 @@
1
- export * from "./DataFieldsSelector";
1
+ export * from "./DataFieldsSelector";
@@ -161,7 +161,7 @@ export const ReportRunnerModal = ({
161
161
  if (!dateFrom) return true;
162
162
  if (value > dateFrom) return true;
163
163
  return t("toDateAfterFrom") as string;
164
- }
164
+ },
165
165
  })}
166
166
  />
167
167
  <Form.Control.Feedback type="invalid">
@@ -1 +1 @@
1
- export * from "./ReportTypeSelect";
1
+ export * from "./ReportTypeSelect";
@@ -21,6 +21,7 @@ interface NumberInputHorizontalProps {
21
21
  defaultValue?: number;
22
22
  hasCurrency?: boolean;
23
23
  isLoading?: boolean;
24
+ shouldHideButtons?: boolean;
24
25
  }
25
26
 
26
27
  export const NumberInputHorizontal = forwardRef<
@@ -30,6 +31,7 @@ export const NumberInputHorizontal = forwardRef<
30
31
  (
31
32
  {
32
33
  disabled = false,
34
+ shouldHideButtons,
33
35
  className = "",
34
36
  value,
35
37
  step,
@@ -88,7 +90,7 @@ export const NumberInputHorizontal = forwardRef<
88
90
  "licklist-number-input-horizontal__btn-minus",
89
91
  hasBigSize ? "big-sizes-btn" : "small-sizes-btn",
90
92
  ].join(" ")}
91
- disabled={disabled}
93
+ disabled={disabled || shouldHideButtons}
92
94
  >
93
95
  <Icon
94
96
  type="minus"
@@ -108,8 +110,7 @@ export const NumberInputHorizontal = forwardRef<
108
110
  onClick={onClick}
109
111
  type={disabled && hasBigSize ? "text" : "number"}
110
112
  className={clsx(
111
- hasBigSize ? "big-sizes-input" : "small-sizes-input",
112
- disabled && "border-0"
113
+ hasBigSize ? "big-sizes-input" : "small-sizes-input"
113
114
  )}
114
115
  onChange={(e) => onChange(Number(e.target.value))}
115
116
  value={disabled && hasBigSize && !isLoading ? soldOut : value}
@@ -117,7 +118,7 @@ export const NumberInputHorizontal = forwardRef<
117
118
  max={max}
118
119
  step={step}
119
120
  defaultValue={defaultValue}
120
- disabled={disabled && !onSelect}
121
+ disabled={disabled}
121
122
  />
122
123
  </div>
123
124
  <button
@@ -127,7 +128,7 @@ export const NumberInputHorizontal = forwardRef<
127
128
  "licklist-number-input-horizontal__btn-plus",
128
129
  hasBigSize ? "big-sizes-btn" : "small-sizes-btn",
129
130
  ].join(" ")}
130
- disabled={disabled}
131
+ disabled={disabled || shouldHideButtons}
131
132
  >
132
133
  <Icon
133
134
  type="plus"
@@ -31,10 +31,6 @@
31
31
  font-size: 0.7rem;
32
32
  }
33
33
 
34
- &.today:first-of-type {
35
- min-width: 7.5rem;
36
- }
37
-
38
34
  &.disabled {
39
35
  border: 2px solid $snippet-calendar-disabled-button-border-color;
40
36
  background-color: $snippet-calendar-disabled-button-background-color;
@@ -291,10 +291,7 @@
291
291
  width: 7rem;
292
292
  height: 2.6rem;
293
293
  }
294
- .small-sizes-input:disabled {
295
- border: none;
296
- background-color: white !important;
297
- }
294
+
298
295
  .big-sizes-input {
299
296
  height: 3.75rem;
300
297
  font-size: 1.7rem;