@react-fabric/superdate 1.0.0-beta.33

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 (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -0
  3. package/dist/cjs/i18n/ar.json.js +86 -0
  4. package/dist/cjs/i18n/en.json.js +93 -0
  5. package/dist/cjs/i18n/index.js +33 -0
  6. package/dist/cjs/index.js +8 -0
  7. package/dist/cjs/superdate/QuickSelect.js +134 -0
  8. package/dist/cjs/superdate/RelativeInput.js +79 -0
  9. package/dist/cjs/superdate/RelativePanel.js +91 -0
  10. package/dist/cjs/superdate/SuperDate.module.css +1 -0
  11. package/dist/cjs/superdate/Superdate.js +175 -0
  12. package/dist/esm/i18n/ar.json.js +79 -0
  13. package/dist/esm/i18n/en.json.js +85 -0
  14. package/dist/esm/i18n/index.js +33 -0
  15. package/dist/esm/index.js +4 -0
  16. package/dist/esm/superdate/QuickSelect.js +134 -0
  17. package/dist/esm/superdate/RelativeInput.js +79 -0
  18. package/dist/esm/superdate/RelativePanel.js +91 -0
  19. package/dist/esm/superdate/SuperDate.module.css +1 -0
  20. package/dist/esm/superdate/Superdate.js +174 -0
  21. package/dist/types/i18n/index.d.ts +1 -0
  22. package/dist/types/index.d.ts +2 -0
  23. package/dist/types/superdate/QuickSelect.d.ts +1 -0
  24. package/dist/types/superdate/RelativeInput.d.ts +1 -0
  25. package/dist/types/superdate/RelativePanel.d.ts +1 -0
  26. package/dist/types/superdate/Superdate.d.ts +17 -0
  27. package/dist/types/types/index.d.ts +34 -0
  28. package/package.json +59 -0
  29. package/src/i18n/ar.json +70 -0
  30. package/src/i18n/en.json +75 -0
  31. package/src/i18n/index.ts +28 -0
  32. package/src/index.ts +26 -0
  33. package/src/superdate/QuickSelect.tsx +121 -0
  34. package/src/superdate/RelativeInput.tsx +64 -0
  35. package/src/superdate/RelativePanel.tsx +103 -0
  36. package/src/superdate/SuperDate.module.css +30 -0
  37. package/src/superdate/Superdate.tsx +196 -0
  38. package/src/types/index.ts +63 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 React Fabric, Adarsh Pastakia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,10 @@
1
+ # React-Fabric Date Module
2
+
3
+ #### Install
4
+
5
+ ```bash
6
+ # Using
7
+ yarn add @react-fabric/date
8
+ ```
9
+
10
+ #### Usage
@@ -0,0 +1,86 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var separator = " ⇽ ";
6
+ var label = {
7
+ quick: "حدد مسرعا",
8
+ relative: "نسبيا",
9
+ events: "الأحداث",
10
+ absolute: "مطلق",
11
+ preset: "المسبقة",
12
+ current: "تيار",
13
+ previous: "السابق",
14
+ from: "من عند",
15
+ to: "إلى",
16
+ "+": "من الان",
17
+ "-": "منذ",
18
+ apply: "يتقدم",
19
+ $now: "الآن",
20
+ $minute: "دقيقة",
21
+ $hour: "ساعة",
22
+ $day: "يوم",
23
+ $week: "أسبوع",
24
+ $month: "شهر",
25
+ $quarter: "ربع",
26
+ $year: "عام",
27
+ $decade: "عقد"
28
+ };
29
+ var now = {
30
+ $day: "اليوم",
31
+ $week: "هذا الاسبوع",
32
+ $month: "هذا الشهر",
33
+ $quarter: "هذا الربع",
34
+ $year: "هذه السنة",
35
+ $decade: "هذا العقد"
36
+ };
37
+ var next = {
38
+ $day: "غدا",
39
+ $week: "الاسبوع القادم",
40
+ $month: "الشهر القادم",
41
+ $quarter: "الربع القادم",
42
+ $year: "العام القادم",
43
+ $decade: "العقد القادم",
44
+ $minute: "بعد دقيقة",
45
+ $hour: "بعد ساعة",
46
+ $minute_plural: "بعد {{count}} دقائق",
47
+ $hour_plural: "بعد {{count}} ساعات",
48
+ $day_plural: "بعد {{count}} أيام",
49
+ $week_plural: "بعد {{count}} أسابيع",
50
+ $month_plural: "بعد {{count}} أشهر",
51
+ $quarter_plural: "بعد {{count}} أرباع",
52
+ $year_plural: "بعد {{count}} سنوات",
53
+ $decade_plural: "بعد {{count}} عقود"
54
+ };
55
+ var prev = {
56
+ $day: "في الامس",
57
+ $week: "الاسبوع الماضي",
58
+ $month: "الشهر الماضي",
59
+ $quarter: "الربع الأخير",
60
+ $year: "العام الماضي",
61
+ $decade: "العقد الماضي",
62
+ $minute: "منذ دقيقة",
63
+ $hour: "منذ ساعة",
64
+ $minute_plural: "منذ {{count}} دقيقة",
65
+ $hour_plural: "منذ {{count}} ساعات",
66
+ $day_plural: "منذ {{count}} أيام",
67
+ $week_plural: "من {{count}} اسابيع",
68
+ $month_plural: "قبل {{count}} أشهر",
69
+ $quarter_plural: "منذ {{count}} أرباع",
70
+ $year_plural: "منذ {{count}} سنوات",
71
+ $decade_plural: "منذ {{count}} عقود"
72
+ };
73
+ var ar = {
74
+ separator: separator,
75
+ label: label,
76
+ now: now,
77
+ next: next,
78
+ prev: prev
79
+ };
80
+
81
+ exports.default = ar;
82
+ exports.label = label;
83
+ exports.next = next;
84
+ exports.now = now;
85
+ exports.prev = prev;
86
+ exports.separator = separator;
@@ -0,0 +1,93 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var separator = " ⇾ ";
6
+ var event = {
7
+ ramadan: "Ramadan",
8
+ christmas: "Christmas",
9
+ newYear: "New Year"
10
+ };
11
+ var label = {
12
+ quick: "Quick Select",
13
+ relative: "Relative",
14
+ absolute: "Absolute",
15
+ events: "Events",
16
+ preset: "Presets",
17
+ current: "Current",
18
+ previous: "Previous",
19
+ from: "From",
20
+ to: "To",
21
+ "+": "From now",
22
+ "-": "Ago",
23
+ apply: "Apply",
24
+ $now: "Now",
25
+ $minute: "Minute",
26
+ $hour: "Hour",
27
+ $day: "Day",
28
+ $week: "Week",
29
+ $month: "Month",
30
+ $quarter: "Quarter",
31
+ $year: "Year",
32
+ $decade: "Decade"
33
+ };
34
+ var now = {
35
+ $day: "Today",
36
+ $week: "This week",
37
+ $month: "This month",
38
+ $quarter: "This quarter",
39
+ $year: "This year",
40
+ $decade: "This decade"
41
+ };
42
+ var next = {
43
+ $day: "Tomorrow",
44
+ $week: "Next week",
45
+ $month: "Next month",
46
+ $quarter: "Next quarter",
47
+ $year: "Next year",
48
+ $decade: "Next decade",
49
+ $minute: "A minute later",
50
+ $hour: "An hour later",
51
+ $minute_other: "{{count}} minutes later",
52
+ $hour_other: "{{count}} hours later",
53
+ $day_other: "{{count}} days later",
54
+ $week_other: "{{count}} weeks later",
55
+ $month_other: "{{count}} months later",
56
+ $quarter_other: "{{count}} quarters later",
57
+ $year_other: "{{count}} years later",
58
+ $decade_other: "{{count}} decades later"
59
+ };
60
+ var prev = {
61
+ $day: "Yesterday",
62
+ $week: "Last week",
63
+ $month: "Last month",
64
+ $quarter: "Last quarter",
65
+ $year: "Last year",
66
+ $decade: "Last decade",
67
+ $minute: "A minute ago",
68
+ $hour: "An hour ago",
69
+ $minute_other: "{{count}} minutes ago",
70
+ $hour_other: "{{count}} hours ago",
71
+ $day_other: "{{count}} days ago",
72
+ $week_other: "{{count}} weeks ago",
73
+ $month_other: "{{count}} months ago",
74
+ $quarter_other: "{{count}} quarters ago",
75
+ $year_other: "{{count}} years ago",
76
+ $decade_other: "{{count}} decades ago"
77
+ };
78
+ var en = {
79
+ separator: separator,
80
+ event: event,
81
+ label: label,
82
+ now: now,
83
+ next: next,
84
+ prev: prev
85
+ };
86
+
87
+ exports.default = en;
88
+ exports.event = event;
89
+ exports.label = label;
90
+ exports.next = next;
91
+ exports.now = now;
92
+ exports.prev = prev;
93
+ exports.separator = separator;
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ var core = require('@react-fabric/core');
4
+ var ar = require('./ar.json.js');
5
+ var en = require('./en.json.js');
6
+
7
+ /*
8
+ * React Fabric
9
+ * @version: 1.0.0
10
+ *
11
+ *
12
+ * The MIT License (MIT)
13
+ * Copyright (c) 2024 Adarsh Pastakia
14
+ *
15
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
16
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
17
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
18
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
19
+ * subject to the following conditions:
20
+ *
21
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
22
+ * portions of the Software.
23
+ *
24
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
25
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ */
29
+
30
+ core.addTranslationBundle("superdate", {
31
+ en: en.default,
32
+ ar: ar.default
33
+ });
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ require('./i18n/index.js');
4
+ var Superdate = require('./superdate/Superdate.js');
5
+
6
+
7
+
8
+ exports.SuperDate = Superdate.SuperDate;
@@ -0,0 +1,134 @@
1
+ 'use strict';
2
+
3
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
+ var core = require('@react-fabric/core');
5
+ var date = require('@react-fabric/date');
6
+ var form = require('@react-fabric/form');
7
+ var utilities = require('@react-fabric/utilities');
8
+ var react = require('react');
9
+ var reactI18next = require('react-i18next');
10
+ var RelativeInput = require('./RelativeInput.js');
11
+ var jsxRuntime = require('react/jsx-runtime');
12
+
13
+ var DEFAULT_PRESETS = [{
14
+ value: "$day",
15
+ label: "superdate:now.$day"
16
+ }, {
17
+ value: "$day-1",
18
+ label: "superdate:prev.$day"
19
+ }, {
20
+ value: "$day+1",
21
+ label: "superdate:next.$day"
22
+ }, {
23
+ value: "$week",
24
+ label: "superdate:now.$week"
25
+ }, {
26
+ value: "$week-1",
27
+ label: "superdate:prev.$week"
28
+ }, {
29
+ value: "$week+1",
30
+ label: "superdate:next.$week"
31
+ }, {
32
+ value: "$month",
33
+ label: "superdate:now.$month"
34
+ }, {
35
+ value: "$month-1",
36
+ label: "superdate:prev.$month"
37
+ }, {
38
+ value: "$month+1",
39
+ label: "superdate:next.$month"
40
+ }, {
41
+ value: "$quarter",
42
+ label: "superdate:now.$quarter"
43
+ }, {
44
+ value: "$quarter-1",
45
+ label: "superdate:prev.$quarter"
46
+ }, {
47
+ value: "$quarter+1",
48
+ label: "superdate:next.$quarter"
49
+ }, {
50
+ value: "$year",
51
+ label: "superdate:now.$year"
52
+ }, {
53
+ value: "$year-1",
54
+ label: "superdate:prev.$year"
55
+ }, {
56
+ value: "$year+1",
57
+ label: "superdate:next.$year"
58
+ }];
59
+ var schema = utilities.yup.object({
60
+ rel: utilities.yup.object({
61
+ diff: utilities.yup.number().required().label("Difference"),
62
+ op: utilities.yup.string().required().oneOf(["+", "-"]).label("Operator"),
63
+ part: utilities.yup.string().required().oneOf(Object.values(date.DatePart)).label("Date part")
64
+ })
65
+ });
66
+ var QuickSelect = function QuickSelect(_ref) {
67
+ var _ref$presets = _ref.presets,
68
+ presets = _ref$presets === void 0 ? DEFAULT_PRESETS : _ref$presets,
69
+ _ref$value = _ref.value,
70
+ value = _ref$value === void 0 ? "" : _ref$value,
71
+ onChange = _ref.onChange;
72
+ var _useTranslation = reactI18next.useTranslation(),
73
+ t = _useTranslation.t;
74
+ var handleChange = react.useCallback(function (_ref2) {
75
+ var _ref2$rel = _ref2.rel,
76
+ part = _ref2$rel.part,
77
+ diff = _ref2$rel.diff,
78
+ op = _ref2$rel.op;
79
+ onChange("".concat(part).concat(op).concat(diff, "|").concat(date.DatePart.NOW));
80
+ }, []);
81
+ var defaultValue = react.useMemo(function () {
82
+ if (value !== null && value !== void 0 && value.endsWith(date.DatePart.NOW)) {
83
+ var _value$split$shift$ma;
84
+ var _ref3 = (_value$split$shift$ma = value.split("|").shift().match(/^(\$\w+)([+-])(\d+)?$/)) !== null && _value$split$shift$ma !== void 0 ? _value$split$shift$ma : [],
85
+ _ref4 = _slicedToArray(_ref3, 4),
86
+ part = _ref4[1],
87
+ op = _ref4[2],
88
+ _ref4$ = _ref4[3],
89
+ diff = _ref4$ === void 0 ? "0" : _ref4$;
90
+ return {
91
+ rel: {
92
+ part: part,
93
+ op: op,
94
+ diff: diff
95
+ }
96
+ };
97
+ }
98
+ }, [value]);
99
+ return /*#__PURE__*/jsxRuntime.jsxs(core.Content, {
100
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
101
+ className: "inline-block origin-left rtl:origin-right",
102
+ style: {
103
+ zoom: 0.85
104
+ },
105
+ children: /*#__PURE__*/jsxRuntime.jsx(form.Form, {
106
+ schema: schema,
107
+ onSubmit: handleChange,
108
+ defaultValues: defaultValue,
109
+ children: /*#__PURE__*/jsxRuntime.jsx(RelativeInput.RelativeInput, {
110
+ label: t("superdate:label.relative"),
111
+ prefix: "rel",
112
+ showApply: true
113
+ })
114
+ })
115
+ }), /*#__PURE__*/jsxRuntime.jsx(core.Divider, {
116
+ children: t("superdate:label.preset")
117
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
118
+ className: "grid grid-cols-3 flex-row text-sm gap-2",
119
+ children: presets.map(function (pr) {
120
+ return /*#__PURE__*/jsxRuntime.jsx("button", {
121
+ className: "link appearance-none text-start",
122
+ onClick: function onClick() {
123
+ return onChange === null || onChange === void 0 ? void 0 : onChange(pr.value);
124
+ },
125
+ children: t(pr.label, {
126
+ defaultValue: pr.label
127
+ })
128
+ }, pr.value);
129
+ })
130
+ })]
131
+ });
132
+ };
133
+
134
+ exports.QuickSelect = QuickSelect;
@@ -0,0 +1,79 @@
1
+ 'use strict';
2
+
3
+ var core = require('@react-fabric/core');
4
+ var date = require('@react-fabric/date');
5
+ var form = require('@react-fabric/form');
6
+ var reactI18next = require('react-i18next');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ /*
10
+ * React Fabric
11
+ * @version: 1.0.0
12
+ *
13
+ *
14
+ * The MIT License (MIT)
15
+ * Copyright (c) 2024 Adarsh Pastakia
16
+ *
17
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
18
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
19
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
20
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
21
+ * subject to the following conditions:
22
+ *
23
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
24
+ * portions of the Software.
25
+ *
26
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
27
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
28
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
29
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30
+ */
31
+
32
+ var RelativeInput = function RelativeInput(_ref) {
33
+ var label = _ref.label,
34
+ prefix = _ref.prefix,
35
+ showApply = _ref.showApply;
36
+ var _useTranslation = reactI18next.useTranslation("superdate"),
37
+ t = _useTranslation.t;
38
+ return /*#__PURE__*/jsxRuntime.jsxs(form.Field, {
39
+ label: label,
40
+ className: "mb-2",
41
+ children: [/*#__PURE__*/jsxRuntime.jsx(form.Controller, {
42
+ name: "".concat(prefix, ".diff"),
43
+ children: /*#__PURE__*/jsxRuntime.jsx(form.Number, {
44
+ width: "5rem",
45
+ min: 1,
46
+ max: 99
47
+ })
48
+ }), /*#__PURE__*/jsxRuntime.jsx(form.Controller, {
49
+ name: "".concat(prefix, ".part"),
50
+ children: /*#__PURE__*/jsxRuntime.jsx(form.Select, {
51
+ width: "6rem",
52
+ options: Object.values(date.DatePart).slice(1).map(function (dt) {
53
+ return {
54
+ id: dt,
55
+ label: t("label.".concat(dt))
56
+ };
57
+ })
58
+ })
59
+ }), /*#__PURE__*/jsxRuntime.jsx(form.Controller, {
60
+ name: "".concat(prefix, ".op"),
61
+ children: /*#__PURE__*/jsxRuntime.jsx(form.Select, {
62
+ width: "7rem",
63
+ options: [{
64
+ id: "-",
65
+ label: t("label.-")
66
+ }, {
67
+ id: "+",
68
+ label: t("label.+")
69
+ }]
70
+ })
71
+ }), showApply && /*#__PURE__*/jsxRuntime.jsx(core.Button, {
72
+ variant: "solid",
73
+ type: "submit",
74
+ children: t("label.apply")
75
+ })]
76
+ });
77
+ };
78
+
79
+ exports.RelativeInput = RelativeInput;
@@ -0,0 +1,91 @@
1
+ 'use strict';
2
+
3
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
+ var core = require('@react-fabric/core');
5
+ var date = require('@react-fabric/date');
6
+ var form = require('@react-fabric/form');
7
+ var utilities = require('@react-fabric/utilities');
8
+ var react = require('react');
9
+ var reactI18next = require('react-i18next');
10
+ var RelativeInput = require('./RelativeInput.js');
11
+ var jsxRuntime = require('react/jsx-runtime');
12
+
13
+ var schema = utilities.yup.object({
14
+ from: utilities.yup.object({
15
+ diff: utilities.yup.number().required().label("Difference"),
16
+ op: utilities.yup.string().required().oneOf(["+", "-"]).label("Operator"),
17
+ part: utilities.yup.string().required().oneOf(Object.values(date.DatePart)).label("Date part")
18
+ }),
19
+ to: utilities.yup.object({
20
+ diff: utilities.yup.number().required().label("Difference"),
21
+ op: utilities.yup.string().required().oneOf(["+", "-"]).label("Operator"),
22
+ part: utilities.yup.string().required().oneOf(Object.values(date.DatePart)).label("Date part")
23
+ })
24
+ });
25
+ var RelativePanel = function RelativePanel(_ref) {
26
+ var _ref$value = _ref.value,
27
+ value = _ref$value === void 0 ? "" : _ref$value,
28
+ onChange = _ref.onChange;
29
+ var _useTranslation = reactI18next.useTranslation("superdate"),
30
+ t = _useTranslation.t;
31
+ var handleChange = react.useCallback(function (_ref2) {
32
+ var to = _ref2.to,
33
+ from = _ref2.from;
34
+ onChange("".concat(from.part).concat(from.op).concat(from.diff, "|").concat(to.part).concat(to.op).concat(to.diff));
35
+ }, []);
36
+ var defaultValue = react.useMemo(function () {
37
+ if (value !== null && value !== void 0 && value.match(/^(\$\w+)([+-])(\d+)?\|(\$\w+)([+-])(\d+)?$/)) {
38
+ var _value$split$shift$ma, _value$split$pop$matc;
39
+ var _ref3 = (_value$split$shift$ma = value.split("|").shift().match(/^(\$\w+)([+-])(\d+)?$/)) !== null && _value$split$shift$ma !== void 0 ? _value$split$shift$ma : [],
40
+ _ref4 = _slicedToArray(_ref3, 4),
41
+ part = _ref4[1],
42
+ op = _ref4[2],
43
+ _ref4$ = _ref4[3],
44
+ diff = _ref4$ === void 0 ? "0" : _ref4$;
45
+ var _ref5 = (_value$split$pop$matc = value.split("|").pop().match(/^(\$\w+)([+-])(\d+)?$/)) !== null && _value$split$pop$matc !== void 0 ? _value$split$pop$matc : [],
46
+ _ref6 = _slicedToArray(_ref5, 4),
47
+ toPart = _ref6[1],
48
+ toOp = _ref6[2],
49
+ _ref6$ = _ref6[3],
50
+ toDiff = _ref6$ === void 0 ? "0" : _ref6$;
51
+ return {
52
+ from: {
53
+ part: part,
54
+ op: op,
55
+ diff: diff
56
+ },
57
+ to: {
58
+ part: toPart,
59
+ op: toOp,
60
+ diff: toDiff
61
+ }
62
+ };
63
+ }
64
+ }, [value]);
65
+ return /*#__PURE__*/jsxRuntime.jsx(core.Content, {
66
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
67
+ className: "scale-90",
68
+ children: /*#__PURE__*/jsxRuntime.jsxs(form.Form, {
69
+ schema: schema,
70
+ defaultValues: defaultValue,
71
+ onSubmit: handleChange,
72
+ children: [/*#__PURE__*/jsxRuntime.jsx(RelativeInput.RelativeInput, {
73
+ label: t("label.from"),
74
+ prefix: "from"
75
+ }), /*#__PURE__*/jsxRuntime.jsx(RelativeInput.RelativeInput, {
76
+ label: t("label.to"),
77
+ prefix: "to"
78
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
79
+ className: "flex justify-end",
80
+ children: /*#__PURE__*/jsxRuntime.jsx(core.Button, {
81
+ variant: "solid",
82
+ type: "submit",
83
+ children: t("label.apply")
84
+ })
85
+ })]
86
+ })
87
+ })
88
+ });
89
+ };
90
+
91
+ exports.RelativePanel = RelativePanel;
@@ -0,0 +1 @@
1
+ @layer comp{.superDate{&:root{font-size:10px}}}