@oneblink/apps-react 5.5.1-beta.6 → 5.5.1-beta.8

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.
@@ -18,13 +18,10 @@ const ToggleAllCheckbox = ({ id, element, options, selected, onChange, disabled,
18
18
  });
19
19
  }
20
20
  }, [element, options, onChange]);
21
- return (React.createElement("label", { className: "checkbox ob-checkbox__input-label cypress-checkbox-label", htmlFor: `${id}_select-all`, style: {
22
- fontStyle: 'italic',
23
- marginBottom: '1.25rem',
24
- } },
21
+ return (React.createElement("label", { className: "checkbox ob-checkbox__input-label ob-label__input-toggle-all cypress-checkbox-label", htmlFor: `${id}_select-all` },
25
22
  React.createElement(Checkbox, { color: "default", classes: {
26
23
  checked: 'ob-checkbox__input-checked',
27
- }, className: "ob-checkbox__input cypress-checkbox-control", id: `${id}_select-all`, checked: allSelected, indeterminate: !!selected.length && !allSelected, onChange: (e) => handleToggleAll(e.target.checked), disabled: disabled }),
24
+ }, className: "ob-checkbox__input cypress-checkbox-control", id: `${id}_select-all`, checked: allSelected, indeterminate: !!selected.length && !allSelected, onChange: (e) => handleToggleAll(e.target.checked), disabled: disabled, edge: "start" }),
28
25
  allSelected ? 'Deselect All' : 'Select All'));
29
26
  };
30
27
  export default React.memo(ToggleAllCheckbox);
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleAllCheckbox.js","sourceRoot":"","sources":["../../../src/components/renderer/ToggleAllCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAWxC,MAAM,iBAAiB,GAAG,CAAC,EACzB,EAAE,EACF,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,GACF,EAAE,EAAE;IACV,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACrC,OAAO,OAAO,CAAC,KAAK,CA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IAAI,CAAQ,iBAAiB,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { Checkbox } from '@mui/material'\nimport { FormTypes } from '@oneblink/types'\nimport { FormElementValueChangeHandler } from '../../types/form'\ninterface Props {\n id: string\n element: FormTypes.CheckboxElement | FormTypes.SelectElement\n options: FormTypes.ChoiceElementOption[]\n selected: string[]\n onChange: FormElementValueChangeHandler<string[]>\n disabled?: boolean\n}\nconst ToggleAllCheckbox = ({\n id,\n element,\n options,\n selected,\n onChange,\n disabled,\n}: Props) => {\n const allSelected = React.useMemo(() => {\n return options.every((option) => {\n return selected.includes(option.value)\n })\n }, [options, selected])\n\n const handleToggleAll = React.useCallback(\n (isSelectingAll: boolean) => {\n if (isSelectingAll) {\n onChange(element, {\n value: options.map((opt) => opt.value),\n })\n } else {\n onChange(element, {\n value: undefined,\n })\n }\n },\n [element, options, onChange],\n )\n\n return (\n <label\n className=\"checkbox ob-checkbox__input-label cypress-checkbox-label\"\n htmlFor={`${id}_select-all`}\n style={{\n fontStyle: 'italic',\n marginBottom: '1.25rem',\n }}\n >\n <Checkbox\n color=\"default\"\n classes={{\n checked: 'ob-checkbox__input-checked',\n }}\n className=\"ob-checkbox__input cypress-checkbox-control\"\n id={`${id}_select-all`}\n checked={allSelected}\n indeterminate={!!selected.length && !allSelected}\n onChange={(e) => handleToggleAll(e.target.checked)}\n disabled={disabled}\n />\n {allSelected ? 'Deselect All' : 'Select All'}\n </label>\n )\n}\n\nexport default React.memo<Props>(ToggleAllCheckbox)\n"]}
1
+ {"version":3,"file":"ToggleAllCheckbox.js","sourceRoot":"","sources":["../../../src/components/renderer/ToggleAllCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAWxC,MAAM,iBAAiB,GAAG,CAAC,EACzB,EAAE,EACF,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ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,YAAY,CACtC,CACT,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAQ,iBAAiB,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { Checkbox } from '@mui/material'\nimport { FormTypes } from '@oneblink/types'\nimport { FormElementValueChangeHandler } from '../../types/form'\ninterface Props {\n id: string\n element: FormTypes.CheckboxElement | FormTypes.SelectElement\n options: FormTypes.ChoiceElementOption[]\n selected: string[]\n onChange: FormElementValueChangeHandler<string[]>\n disabled?: boolean\n}\nconst ToggleAllCheckbox = ({\n id,\n element,\n options,\n selected,\n onChange,\n disabled,\n}: Props) => {\n const allSelected = React.useMemo(() => {\n return options.every((option) => {\n return selected.includes(option.value)\n })\n }, [options, selected])\n\n const handleToggleAll = React.useCallback(\n (isSelectingAll: boolean) => {\n if (isSelectingAll) {\n onChange(element, {\n value: options.map((opt) => opt.value),\n })\n } else {\n onChange(element, {\n value: undefined,\n })\n }\n },\n [element, options, onChange],\n )\n\n return (\n <label\n className=\"checkbox ob-checkbox__input-label ob-label__input-toggle-all cypress-checkbox-label\"\n htmlFor={`${id}_select-all`}\n >\n <Checkbox\n color=\"default\"\n classes={{\n checked: 'ob-checkbox__input-checked',\n }}\n className=\"ob-checkbox__input cypress-checkbox-control\"\n id={`${id}_select-all`}\n checked={allSelected}\n indeterminate={!!selected.length && !allSelected}\n onChange={(e) => handleToggleAll(e.target.checked)}\n disabled={disabled}\n edge=\"start\"\n />\n {allSelected ? 'Deselect All' : 'Select All'}\n </label>\n )\n}\n\nexport default React.memo<Props>(ToggleAllCheckbox)\n"]}
@@ -1,3 +1,8 @@
1
+ .ob-label__input-toggle-all {
2
+ font-style: italic;
3
+ margin-bottom: $size-8;
4
+ }
5
+
1
6
  .ob-radio__input-label,
2
7
  .ob-checkbox__input-label {
3
8
  display: inline-flex;
@@ -41,8 +41,15 @@
41
41
  }
42
42
  }
43
43
 
44
+ // While these are identical CSS attributes, they need to be kept
45
+ // separated, if a browser cannot understand one of these properties,
46
+ // the css will not be applied.
47
+
44
48
  // Works for all other major browser except Firefox
45
- input[type="range"]:focus-visible::-webkit-slider-thumb,
49
+ input[type="range"]:focus-visible::-webkit-slider-thumb {
50
+ outline-offset: $size-9;
51
+ outline: $input-focus-border-color auto 3px;
52
+ }
46
53
  // Works for Firefox
47
54
  input[type="range"]:focus-visible::-moz-range-thumb {
48
55
  outline-offset: $size-9;
package/dist/styles.css CHANGED
@@ -8039,6 +8039,11 @@ button on-loading {
8039
8039
  height: 100px;
8040
8040
  }
8041
8041
 
8042
+ .ob-label__input-toggle-all {
8043
+ font-style: italic;
8044
+ margin-bottom: 0.5rem;
8045
+ }
8046
+
8042
8047
  .ob-radio__input-label,
8043
8048
  .ob-checkbox__input-label {
8044
8049
  display: inline-flex;
@@ -8749,7 +8754,11 @@ button on-loading {
8749
8754
  border-top-color: #407E8C;
8750
8755
  }
8751
8756
 
8752
- input[type=range]:focus-visible::-webkit-slider-thumb,
8757
+ input[type=range]:focus-visible::-webkit-slider-thumb {
8758
+ outline-offset: 0.25rem;
8759
+ outline: hsl(229, 53%, 53%) auto 3px;
8760
+ }
8761
+
8753
8762
  input[type=range]:focus-visible::-moz-range-thumb {
8754
8763
  outline-offset: 0.25rem;
8755
8764
  outline: hsl(229, 53%, 53%) auto 3px;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oneblink/apps-react",
3
3
  "description": "Helper functions for OneBlink apps in ReactJS.",
4
- "version": "5.5.1-beta.6",
4
+ "version": "5.5.1-beta.8",
5
5
  "author": "OneBlink <developers@oneblink.io> (https://oneblink.io)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/oneblink/apps-react/issues"