@oneblink/apps-react 8.0.0-beta.2 → 8.0.0-beta.3

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/dist/styles.css CHANGED
@@ -8790,6 +8790,15 @@ button on-loading {
8790
8790
  width: 25%;
8791
8791
  }
8792
8792
  }
8793
+ .ob-input[type=date]::-webkit-calendar-picker-indicator,
8794
+ .ob-input[type=time]::-webkit-calendar-picker-indicator,
8795
+ .ob-input[type=datetime-local]::-webkit-calendar-picker-indicator {
8796
+ right: 0;
8797
+ position: absolute;
8798
+ padding: 11px;
8799
+ opacity: 0;
8800
+ }
8801
+
8793
8802
  .ob-number__output {
8794
8803
  background-color: #757575;
8795
8804
  color: hsl(0, 0%, 100%);
package/dist/styles.scss CHANGED
@@ -117,6 +117,7 @@ $section-padding-mobile: $section-padding-mobile-y $section-padding-mobile-x;
117
117
  @import './styles/repeatable-set.scss';
118
118
  @import './styles/ob-image.scss';
119
119
  @import './styles/ob-files.scss';
120
+ @import './styles/date.scss';
120
121
  @import './styles/number.scss';
121
122
  @import './styles/autocomplete.scss';
122
123
  @import './styles/lookup.scss';
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": "8.0.0-beta.2",
4
+ "version": "8.0.0-beta.3",
5
5
  "author": "OneBlink <developers@oneblink.io> (https://oneblink.io)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/oneblink/apps-react/issues"
@@ -47,7 +47,7 @@
47
47
  "@mui/lab": "^5.0.0-alpha.152",
48
48
  "@mui/material": "^5.15.6",
49
49
  "@mui/x-date-pickers": "^6.19.2",
50
- "@oneblink/apps": "^20.0.0-beta.1",
50
+ "@oneblink/apps": "^21.0.0-beta.1",
51
51
  "@oneblink/release-cli": "^3.3.0",
52
52
  "@oneblink/types": "github:oneblink/types",
53
53
  "@types/blueimp-load-image": "^5.16.6",
@@ -1,27 +0,0 @@
1
- import * as React from 'react';
2
- import { TextFieldProps } from '@mui/material';
3
- import { PickersActionBarAction } from '@mui/x-date-pickers';
4
- export default function useFormDatePickerProps({ id, value, maxDate, minDate, icon, ariaDescribedby, autocompleteAttributes, placeholder, className, }: {
5
- id: string;
6
- value: string | undefined;
7
- maxDate: string | undefined;
8
- minDate: string | undefined;
9
- icon: 'event' | 'date_range' | 'schedule';
10
- ariaDescribedby: string | undefined;
11
- autocompleteAttributes: string | undefined;
12
- placeholder: string | undefined;
13
- className: string;
14
- }): {
15
- slots: {
16
- textField: (params: React.PropsWithChildren<TextFieldProps>) => React.JSX.Element;
17
- openPickerIcon: () => React.JSX.Element;
18
- };
19
- slotProps: {
20
- actionBar: {
21
- actions: PickersActionBarAction[];
22
- };
23
- };
24
- maxDate: Date | null;
25
- minDate: Date | null;
26
- value: Date | null;
27
- };
@@ -1,56 +0,0 @@
1
- import * as React from 'react';
2
- import { TextField, styled } from '@mui/material';
3
- import clsx from 'clsx';
4
- import MaterialIcon from '../../components/MaterialIcon';
5
- const StyledTextField = styled(TextField)(() => ({
6
- '& .MuiOutlinedInput-root': {
7
- fontFamily: 'inherit',
8
- '& fieldset': {
9
- borderColor: '#dbdbdb',
10
- },
11
- '&:hover fieldset': {
12
- borderColor: '#b5b5b5',
13
- },
14
- '&.Mui-focused fieldset': {
15
- borderColor: '#485fc7',
16
- borderWidth: '1px',
17
- },
18
- },
19
- }));
20
- export default function useFormDatePickerProps({ id, value, maxDate, minDate, icon, ariaDescribedby, autocompleteAttributes, placeholder, className, }) {
21
- const valueMemo = React.useMemo(() => {
22
- return value ? new Date(value) : null;
23
- }, [value]);
24
- const maxDateMemo = React.useMemo(() => (maxDate ? new Date(maxDate) : null), [maxDate]);
25
- const minDateMemo = React.useMemo(() => (minDate ? new Date(minDate) : null), [minDate]);
26
- //must be a fuction
27
- const openPickerIcon = React.useCallback(() => React.createElement(MaterialIcon, { className: "is-size-5" }, icon), [icon]);
28
- return {
29
- slots: {
30
- textField: (params) => {
31
- var _a;
32
- return (React.createElement(StyledTextField, { ...params, id: id, variant: "outlined", margin: "dense", size: "small", label: undefined, placeholder: placeholder, autoComplete: autocompleteAttributes, "aria-describedby": ariaDescribedby, inputProps: {
33
- ...params.inputProps,
34
- className: clsx((_a = params.inputProps) === null || _a === void 0 ? void 0 : _a.className, 'input ob-input', className),
35
- }, fullWidth: true,
36
- //we have our own error and helper text state
37
- error: undefined }));
38
- },
39
- openPickerIcon,
40
- },
41
- slotProps: {
42
- actionBar: {
43
- actions: [
44
- 'clear',
45
- 'today',
46
- 'cancel',
47
- 'accept',
48
- ],
49
- },
50
- },
51
- maxDate: maxDateMemo,
52
- minDate: minDateMemo,
53
- value: valueMemo,
54
- };
55
- }
56
- //# sourceMappingURL=useFormDatePickerProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFormDatePickerProps.js","sourceRoot":"","sources":["../../../src/hooks/form-date-picker/useFormDatePickerProps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAkB,MAAM,EAAE,MAAM,eAAe,CAAA;AAEjE,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,YAAY,MAAM,+BAA+B,CAAA;AAExD,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/C,0BAA0B,EAAE;QAC1B,UAAU,EAAE,SAAS;QACrB,YAAY,EAAE;YACZ,WAAW,EAAE,SAAS;SACvB;QACD,kBAAkB,EAAE;YAClB,WAAW,EAAE,SAAS;SACvB;QACD,wBAAwB,EAAE;YACxB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,KAAK;SACnB;KACF;CACF,CAAC,CAAC,CAAA;AAEH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,EAAE,EACF,KAAK,EACL,OAAO,EACP,OAAO,EACP,IAAI,EACJ,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AgB,EAChB,SAAS,CACV;qBACF,EACD,SAAS;oBACT,6CAA6C;oBAC7C,KAAK,EAAE,SAAS,GAChB,CACH,CAAA;aAAA;YACD,cAAc;SACf;QACD,SAAS,EAAE;YACT,SAAS,EAAE;gBACT,OAAO,EAAE;oBACP,OAAO;oBACP,OAAO;oBACP,QAAQ;oBACR,QAAQ;iBACmB;aAC9B;SACF;QACD,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,SAAS;KACjB,CAAA;AACH,CAAC","sourcesContent":["import * as React from 'react'\nimport { TextField, TextFieldProps, styled } from '@mui/material'\nimport { PickersActionBarAction } from '@mui/x-date-pickers'\nimport clsx from 'clsx'\nimport MaterialIcon from '../../components/MaterialIcon'\n\nconst StyledTextField = styled(TextField)(() => ({\n '& .MuiOutlinedInput-root': {\n fontFamily: 'inherit',\n '& fieldset': {\n borderColor: '#dbdbdb',\n },\n '&:hover fieldset': {\n borderColor: '#b5b5b5',\n },\n '&.Mui-focused fieldset': {\n borderColor: '#485fc7',\n borderWidth: '1px',\n },\n },\n}))\n\nexport default function useFormDatePickerProps({\n id,\n value,\n maxDate,\n minDate,\n icon,\n ariaDescribedby,\n autocompleteAttributes,\n placeholder,\n className,\n}: {\n id: string\n value: string | undefined\n maxDate: string | undefined\n minDate: string | undefined\n icon: 'event' | 'date_range' | 'schedule'\n ariaDescribedby: string | undefined\n autocompleteAttributes: string | undefined\n placeholder: string | undefined\n className: string\n}) {\n const valueMemo = React.useMemo(() => {\n return value ? new Date(value) : null\n }, [value])\n\n const maxDateMemo = React.useMemo(\n () => (maxDate ? new Date(maxDate) : null),\n [maxDate],\n )\n const minDateMemo = React.useMemo(\n () => (minDate ? new Date(minDate) : null),\n [minDate],\n )\n\n //must be a fuction\n const openPickerIcon = React.useCallback(\n () => <MaterialIcon className=\"is-size-5\">{icon}</MaterialIcon>,\n [icon],\n )\n\n return {\n slots: {\n textField: (params: React.PropsWithChildren<TextFieldProps>) => (\n <StyledTextField\n {...params}\n id={id}\n variant=\"outlined\"\n margin=\"dense\"\n size=\"small\"\n label={undefined}\n placeholder={placeholder}\n autoComplete={autocompleteAttributes}\n aria-describedby={ariaDescribedby}\n inputProps={{\n ...params.inputProps,\n className: clsx(\n params.inputProps?.className,\n 'input ob-input',\n className,\n ),\n }}\n fullWidth\n //we have our own error and helper text state\n error={undefined}\n />\n ),\n openPickerIcon,\n },\n slotProps: {\n actionBar: {\n actions: [\n 'clear',\n 'today',\n 'cancel',\n 'accept',\n ] as PickersActionBarAction[],\n },\n },\n maxDate: maxDateMemo,\n minDate: minDateMemo,\n value: valueMemo,\n }\n}\n"]}