@sparrowengg/integrations-templates-frontend 1.9.63 → 1.9.64
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/cjs/_virtual/index10.js +2 -2
- package/dist/cjs/_virtual/index8.js +2 -2
- package/dist/cjs/_virtual/index9.js +2 -2
- package/dist/cjs/node_modules/@internationalized/date/dist/utils.js +1 -2
- package/dist/cjs/node_modules/@internationalized/date/dist/utils.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js +9 -3
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/box/box.js +6 -8
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/box/box.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/button.js +106 -99
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/button.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js +18 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/side-element.js +113 -71
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/side-element.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js +31 -8
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js +19 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js +20 -4
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js +5 -3
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js +43 -13
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js +18 -15
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-timezone-picker.js +60 -52
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-timezone-picker.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js +90 -20
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js +138 -113
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js +71 -13
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js +660 -88
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js +68 -13
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-alert.js +11 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-alert.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-confirm.js +22 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-confirm.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-modal.js +25 -19
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-modal.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js +28 -6
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js +56 -54
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-helper-text/form-helper-text.js +28 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-helper-text/form-helper-text.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js +109 -20
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js +103 -66
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/input/input.js +199 -110
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/input/input.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/loader/circle.js +10 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/loader/circle.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js +4 -4
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/index.js +2 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-down.js +2 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-down.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-left.js +2 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-left.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-right.js +2 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-right.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/close.js +4 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/close.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/search.js +4 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/search.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js +7 -5
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/select/select.js +143 -25
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/select/select.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/stitches.config.js +23 -18
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/stitches.config.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js +2 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js +112 -14
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js +10 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js.map +1 -1
- package/dist/cjs/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
- package/dist/cjs/node_modules/html-dom-parser/node_modules/domutils/lib/index.js +1 -1
- package/dist/cjs/node_modules/html-dom-parser/node_modules/htmlparser2/lib/index.js +1 -1
- package/dist/cjs/node_modules/style-to-js/cjs/index.js +1 -1
- package/dist/cjs/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/es/_virtual/index10.js +2 -2
- package/dist/es/_virtual/index8.js +2 -2
- package/dist/es/_virtual/index9.js +2 -2
- package/dist/es/node_modules/@internationalized/date/dist/utils.js +1 -2
- package/dist/es/node_modules/@internationalized/date/dist/utils.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js +9 -3
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/box/box.js +6 -8
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/box/box.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/button.js +107 -100
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/button.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js +18 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/side-element.js +113 -71
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/side-element.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js +31 -8
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js +19 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js +20 -4
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js +5 -3
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js +43 -13
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js +19 -16
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-timezone-picker.js +60 -52
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-timezone-picker.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js +90 -20
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js +134 -109
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js +71 -13
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js +662 -90
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js +66 -13
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-alert.js +12 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-alert.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-confirm.js +23 -3
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-confirm.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-modal.js +26 -20
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-modal.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js +28 -6
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js +56 -54
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-helper-text/form-helper-text.js +28 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-helper-text/form-helper-text.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js +110 -21
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js +105 -67
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/input/input.js +199 -110
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/input/input.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/loader/circle.js +10 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/loader/circle.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js +2 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/index.js +2 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-down.js +2 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-down.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-left.js +2 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-left.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-right.js +2 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-right.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/close.js +4 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/close.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/search.js +4 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/search.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js +7 -5
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/select/select.js +144 -26
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/select/select.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/stitches.config.js +22 -19
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/stitches.config.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js +2 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js +110 -15
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js +10 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js.map +1 -1
- package/dist/es/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
- package/dist/es/node_modules/html-dom-parser/node_modules/domutils/lib/index.js +1 -1
- package/dist/es/node_modules/html-dom-parser/node_modules/htmlparser2/lib/index.js +1 -1
- package/dist/es/node_modules/style-to-js/cjs/index.js +1 -1
- package/dist/es/node_modules/style-to-object/cjs/index.js +1 -1
- package/package.json +2 -2
package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-years-view.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { useState, useMemo, useId } from 'react';\nimport { Box } from '../box/box.js';\nimport { Button } from '../button/button.js';\nimport { IconButton } from '../button/icon-button.js';\nimport '../button/split-button.js';\nimport { Flex } from '../flex/flex.js';\nimport { Text } from '../text/text.js';\nimport { CALENDAR_VIEW } from './calendar.js';\nimport { MonthYearGridContainer } from './calendar-commons.js';\nimport { CalendarHeader } from './calendar-header.js';\nimport { useCalendarContext, CALENDAR_SIZE_TO_WIDTH, CALENDAR_SIZE_TO_FONT_SIZE, CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT } from './calendar-utils.js';\nimport { ChevronLeftIcon } from '../packages/react-icons/dist/es/icons/chevron-left.js';\nimport { ChevronRightIcon } from '../packages/react-icons/dist/es/icons/chevron-right.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nconst CalendarYearsView = ({\n state,\n range,\n setCurrentCalendarView\n}) => {\n const numYears = 12;\n const [currentYearInView, setCurrentYearInView] = useState(\n state.focusedDate.year\n );\n const dateValue = useMemo(() => {\n var _a;\n if (range && ((_a = state.value) == null ? void 0 : _a[range])) {\n return state.value[range];\n }\n return state.value;\n }, [state, range]);\n const yearsContainerId = useId();\n const calendarContext = useCalendarContext();\n const generateYears = (selectedYear) => {\n const baseYear = selectedYear - selectedYear % numYears - 1;\n return Array.from({ length: numYears }).map((_, index) => {\n const year = baseYear + index;\n const date = state.focusedDate.set({ year });\n return date;\n });\n };\n const years = useMemo(\n () => generateYears(currentYearInView),\n [currentYearInView]\n );\n const handleKeyDown = (e, index) => {\n if (e.key === \"ArrowRight\") {\n e.preventDefault();\n e.stopPropagation();\n const nextYear = years[index + 1];\n if (nextYear && !state.isInvalid(nextYear)) {\n const focusedDate = state.focusedDate.set({\n month: nextYear.year\n });\n state.setFocusedDate(focusedDate);\n const nextButton = e.currentTarget.nextElementSibling;\n if (nextButton) {\n nextButton.setAttribute(\"tabindex\", \"0\");\n nextButton.focus();\n e.currentTarget.setAttribute(\"tabindex\", \"-1\");\n }\n }\n } else if (e.key === \"ArrowLeft\") {\n e.preventDefault();\n e.stopPropagation();\n const prevYear = years[index - 1];\n if (prevYear && !state.isInvalid(prevYear)) {\n const focusedDate = state.focusedDate.set({\n month: prevYear.year\n });\n state.setFocusedDate(focusedDate);\n const prevButton = e.currentTarget.previousElementSibling;\n if (prevButton) {\n prevButton.setAttribute(\"tabindex\", \"0\");\n prevButton.focus();\n e.currentTarget.setAttribute(\"tabindex\", \"-1\");\n }\n }\n }\n };\n return /* @__PURE__ */ jsxs(\n Box,\n {\n css: {\n minWidth: CALENDAR_SIZE_TO_WIDTH[calendarContext.size]\n },\n children: [\n /* @__PURE__ */ jsx(\n CalendarHeader,\n {\n calendarSize: calendarContext.size,\n css: {\n borderBottom: \"1px solid $neutral100\"\n },\n children: /* @__PURE__ */ jsxs(\n Flex,\n {\n css: {\n width: \"100%\"\n },\n alignItems: \"center\",\n children: [\n /* @__PURE__ */ jsx(\n IconButton,\n {\n icon: /* @__PURE__ */ jsx(ChevronLeftIcon, {}),\n color: \"bright\",\n size: \"lg\",\n disabled: state.isInvalid(\n state.focusedDate.set({ year: currentYearInView - numYears })\n ),\n onClick: () => {\n setCurrentYearInView((prev) => prev - numYears);\n }\n }\n ),\n /* @__PURE__ */ jsxs(\n Flex,\n {\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n css: {\n flex: 1\n },\n children: [\n /* @__PURE__ */ jsx(\n Text,\n {\n size: CALENDAR_SIZE_TO_FONT_SIZE[calendarContext.size],\n weight: \"bold\",\n css: {\n color: \"$neutral800\"\n },\n children: \"Choose Year\"\n }\n ),\n /* @__PURE__ */ jsxs(\n Text,\n {\n size: CALENDAR_SIZE_TO_FONT_SIZE[calendarContext.size],\n weight: \"bold\",\n css: {\n color: \"$neutral900\",\n padding: \"0 $6\"\n },\n children: [\n years[0].year,\n \" \",\n \"-\",\n years.at(-1).year\n ]\n }\n )\n ]\n }\n ),\n /* @__PURE__ */ jsx(\n IconButton,\n {\n icon: /* @__PURE__ */ jsx(ChevronRightIcon, {}),\n color: \"bright\",\n size: \"lg\",\n disabled: state.isInvalid(\n state.focusedDate.set({ year: currentYearInView + numYears })\n ),\n onClick: () => {\n setCurrentYearInView((prev) => prev + numYears);\n }\n }\n )\n ]\n }\n )\n }\n ),\n /* @__PURE__ */ jsx(\n MonthYearGridContainer,\n {\n calendarSize: calendarContext.size,\n id: yearsContainerId,\n children: years.map((date, i) => /* @__PURE__ */ jsx(\n Button,\n {\n color: dateValue.year === date.year ? \"default\" : \"bright\",\n \"data-yearId\": date.year,\n tabIndex: dateValue.year === date.year ? 0 : -1,\n disabled: state.isInvalid(date),\n css: __spreadValues({\n padding: \"$6\",\n height: CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT[calendarContext.size]\n }, dateValue.year === date.year && {\n color: \"$secondary600\"\n }),\n onKeyDown: (e) => handleKeyDown(e, i),\n size: calendarContext.size,\n onClick: () => {\n setCurrentCalendarView(CALENDAR_VIEW.GRID);\n if (!range) {\n state.selectDate(date);\n }\n state.setFocusedDate(date);\n },\n children: date.year\n },\n date.year\n ))\n }\n )\n ]\n }\n );\n};\n\nexport { CalendarYearsView };\n//# sourceMappingURL=calendar-years-view.js.map\n"],"names":["useState","useMemo","useId","useCalendarContext","jsxs","Box","CALENDAR_SIZE_TO_WIDTH","jsx","CalendarHeader","Flex","IconButton","ChevronLeftIcon","Text","CALENDAR_SIZE_TO_FONT_SIZE","ChevronRightIcon","MonthYearGridContainer","Button","CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT","CALENDAR_VIEW"],"mappings":";;;;;;;;;;;;;;;;;AAeA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC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C,mBAAmB;AACnB,kBAAkB,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AAC7C,iBAAiB;AACjB,gBAAgB,QAAQ,EAAE,IAAI,CAAC,IAAI;AACnC,eAAe;AACf,cAAc,IAAI,CAAC,IAAI;AACvB,aAAa,CAAC;AACd,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"calendar-years-view.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { useState, useMemo, useId } from 'react';\nimport { Box } from '../box/box.js';\nimport { Button } from '../button/button.js';\nimport { IconButton } from '../button/icon-button.js';\nimport '../button/split-button.js';\nimport { Flex } from '../flex/flex.js';\nimport { Text } from '../text/text.js';\nimport { CALENDAR_VIEW } from './calendar.js';\nimport { MonthYearGridContainer } from './calendar-commons.js';\nimport { CalendarHeader } from './calendar-header.js';\nimport { useCalendarContext, CALENDAR_SIZE_TO_WIDTH, CALENDAR_SIZE_TO_FONT_SIZE, CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT } from './calendar-utils.js';\nimport { ChevronLeftIcon } from '../packages/react-icons/dist/es/icons/chevron-left.js';\nimport { ChevronRightIcon } from '../packages/react-icons/dist/es/icons/chevron-right.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nconst CalendarYearsView = ({\n state,\n range,\n onYearSelect,\n setCurrentCalendarView\n}) => {\n const numYears = 12;\n const [currentYearInView, setCurrentYearInView] = useState(\n state.focusedDate.year\n );\n const dateValue = useMemo(() => {\n var _a;\n if (range && ((_a = state.value) == null ? void 0 : _a[range])) {\n return state.value[range];\n }\n return state.value;\n }, [state, range]);\n const yearsContainerId = useId();\n const calendarContext = useCalendarContext();\n const generateYears = (selectedYear) => {\n const baseYear = selectedYear - selectedYear % numYears - 1;\n return Array.from({ length: numYears }).map((_, index) => {\n const year = baseYear + index;\n const date = state.focusedDate.set({ year });\n return date;\n });\n };\n const years = useMemo(\n () => generateYears(currentYearInView),\n [currentYearInView]\n );\n const handleKeyDown = (e, index) => {\n if (e.key === \"ArrowRight\") {\n e.preventDefault();\n e.stopPropagation();\n const nextYear = years[index + 1];\n if (nextYear && !state.isInvalid(nextYear)) {\n const focusedDate = state.focusedDate.set({\n year: nextYear.year\n });\n state.setFocusedDate(focusedDate);\n const nextButton = e.currentTarget.nextElementSibling;\n if (nextButton) {\n nextButton.setAttribute(\"tabindex\", \"0\");\n nextButton.focus();\n e.currentTarget.setAttribute(\"tabindex\", \"-1\");\n }\n }\n } else if (e.key === \"ArrowLeft\") {\n e.preventDefault();\n e.stopPropagation();\n const prevYear = years[index - 1];\n if (prevYear && !state.isInvalid(prevYear)) {\n const focusedDate = state.focusedDate.set({\n year: prevYear.year\n });\n state.setFocusedDate(focusedDate);\n const prevButton = e.currentTarget.previousElementSibling;\n if (prevButton) {\n prevButton.setAttribute(\"tabindex\", \"0\");\n prevButton.focus();\n e.currentTarget.setAttribute(\"tabindex\", \"-1\");\n }\n }\n }\n };\n const getButtonTabIndex = (index, year) => {\n if (dateValue == null ? void 0 : dateValue.year) {\n return dateValue.year === year ? 0 : -1;\n }\n return index === 0 ? 0 : -1;\n };\n const isPrevButtonDisabled = () => {\n if (!state.minValue)\n return false;\n return state.minValue.year > years[0].year;\n };\n const isNextButtonDisabled = () => {\n if (!state.maxValue)\n return false;\n return state.maxValue.year < years.at(-1).year;\n };\n const isButtonDisabled = (year) => {\n if (state.maxValue && year > state.maxValue.year) {\n return true;\n }\n if (state.minValue && year < state.minValue.year) {\n return true;\n }\n return false;\n };\n const handleYearSelect = (date) => {\n if (state.isInvalid(date)) {\n let updatedDate = date.set({});\n if (state.minValue && state.minValue.year === date.year && (date.month < state.minValue.month || date.month === state.minValue.month && date.day < state.minValue.day)) {\n updatedDate = updatedDate.set({\n year: state.minValue.year,\n month: state.minValue.month,\n day: state.minValue.day\n });\n } else if (\n /**\n * Check if the selected date is greater than the max date\n */\n state.maxValue && date.year === state.maxValue.year && (date.month > state.maxValue.month || date.month === state.maxValue.month && date.day > state.maxValue.day)\n ) {\n updatedDate = updatedDate.set({\n year: state.maxValue.year,\n month: state.maxValue.month,\n day: state.maxValue.day\n });\n } else {\n if (state.minValue) {\n updatedDate = updatedDate.set({\n year: state.minValue.year,\n month: state.minValue.month,\n day: state.minValue.day\n });\n } else if (state.maxValue) {\n updatedDate = updatedDate.set({\n year: state.maxValue.year,\n month: state.maxValue.month,\n day: state.maxValue.day\n });\n }\n }\n if (!range) {\n state.selectDate(updatedDate);\n }\n state.setFocusedDate(updatedDate);\n if (onYearSelect) {\n onYearSelect(updatedDate);\n }\n setCurrentCalendarView(CALENDAR_VIEW.MONTH);\n return;\n }\n setCurrentCalendarView(CALENDAR_VIEW.GRID);\n if (!range) {\n state.selectDate(date);\n }\n state.setFocusedDate(date);\n if (onYearSelect) {\n onYearSelect(date);\n }\n };\n return /* @__PURE__ */ jsxs(\n Box,\n {\n css: {\n minWidth: CALENDAR_SIZE_TO_WIDTH[calendarContext.size]\n },\n children: [\n /* @__PURE__ */ jsx(\n CalendarHeader,\n {\n calendarSize: calendarContext.size,\n css: {\n borderBottom: \"1px solid $neutral100\"\n },\n children: /* @__PURE__ */ jsxs(\n Flex,\n {\n css: {\n width: \"100%\"\n },\n alignItems: \"center\",\n children: [\n /* @__PURE__ */ jsx(\n IconButton,\n {\n icon: /* @__PURE__ */ jsx(ChevronLeftIcon, {}),\n color: \"bright\",\n size: \"lg\",\n disabled: isPrevButtonDisabled(),\n onClick: () => {\n setCurrentYearInView((prev) => prev - numYears);\n }\n }\n ),\n /* @__PURE__ */ jsxs(\n Flex,\n {\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n css: {\n flex: 1\n },\n children: [\n /* @__PURE__ */ jsx(\n Text,\n {\n size: CALENDAR_SIZE_TO_FONT_SIZE[calendarContext.size],\n weight: \"bold\",\n css: {\n color: \"$neutral800\"\n },\n children: \"Choose Year\"\n }\n ),\n /* @__PURE__ */ jsxs(\n Text,\n {\n size: CALENDAR_SIZE_TO_FONT_SIZE[calendarContext.size],\n weight: \"bold\",\n css: {\n color: \"$neutral900\",\n padding: \"0 $6\"\n },\n children: [\n years[0].year,\n \" \",\n \"-\",\n years.at(-1).year\n ]\n }\n )\n ]\n }\n ),\n /* @__PURE__ */ jsx(\n IconButton,\n {\n icon: /* @__PURE__ */ jsx(ChevronRightIcon, {}),\n color: \"bright\",\n size: \"lg\",\n disabled: isNextButtonDisabled(),\n onClick: () => {\n setCurrentYearInView((prev) => prev + numYears);\n }\n }\n )\n ]\n }\n )\n }\n ),\n /* @__PURE__ */ jsx(\n MonthYearGridContainer,\n {\n calendarSize: calendarContext.size,\n id: yearsContainerId,\n children: years.map((date, i) => /* @__PURE__ */ jsx(\n Button,\n {\n color: (dateValue == null ? void 0 : dateValue.year) === date.year ? \"default\" : \"bright\",\n \"data-year-id\": date.year,\n tabIndex: getButtonTabIndex(i, date.year),\n disabled: isButtonDisabled(date.year),\n css: __spreadValues({\n padding: \"$6\",\n height: CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT[calendarContext.size]\n }, (dateValue == null ? void 0 : dateValue.year) === date.year && {\n color: \"$secondary600\"\n }),\n onKeyDown: (e) => handleKeyDown(e, i),\n size: calendarContext.size,\n onClick: () => handleYearSelect(date),\n children: date.year\n },\n date.year\n ))\n }\n )\n ]\n }\n );\n};\n\nexport { CalendarYearsView };\n//# sourceMappingURL=calendar-years-view.js.map\n"],"names":["useState","useMemo","useId","useCalendarContext","CALENDAR_VIEW","jsxs","Box","CALENDAR_SIZE_TO_WIDTH","jsx","CalendarHeader","Flex","IconButton","ChevronLeftIcon","Text","CALENDAR_SIZE_TO_FONT_SIZE","ChevronRightIcon","MonthYearGridContainer","Button","CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT"],"mappings":";;;;;;;;;;;;;;;;;AAeA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IA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I,GAAG,KAAK,CAAC,GAAG,SAAS,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,GAAG,SAAS,GAAG,QAAQ;AACzG,gBAAgB,cAAc,EAAE,IAAI,CAAC,IAAI;AACzC,gBAAgB,QAAQ,EAAE,iBAAiB,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;AACzD,gBAAgB,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;AACrD,gBAAgB,GAAG,EAAE,cAAc,CAAC;AACpC,kBAAkB,OAAO,EAAE,IAAI;AAC/B,kBAAkB,MAAM,EAAEC,oDAAsC,CAAC,eAAe,CAAC,IAAI,CAAC;AACtF,iBAAiB,EAAE,CAAC,SAAS,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,SAAS,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,IAAI;AAClF,kBAAkB,KAAK,EAAE,eAAe;AACxC,iBAAiB,CAAC;AAClB,gBAAgB,SAAS,EAAE,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC;AACrD,gBAAgB,IAAI,EAAE,eAAe,CAAC,IAAI;AAC1C,gBAAgB,OAAO,EAAE,MAAM,gBAAgB,CAAC,IAAI,CAAC;AACrD,gBAAgB,QAAQ,EAAE,IAAI,CAAC,IAAI;AACnC,eAAe;AACf,cAAc,IAAI,CAAC,IAAI;AACvB,aAAa,CAAC;AACd,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var _import
|
|
4
|
+
var _import = require('../node_modules/@internationalized/date/dist/import.js');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var box = require('../box/box.js');
|
|
7
7
|
var button = require('../button/button.js');
|
|
@@ -16,7 +16,7 @@ var calendarTimePicker = require('./calendar-time-picker.js');
|
|
|
16
16
|
var calendarTimezonePicker = require('./calendar-timezone-picker.js');
|
|
17
17
|
var calendarUtils = require('./calendar-utils.js');
|
|
18
18
|
var calendarYearsView = require('./calendar-years-view.js');
|
|
19
|
-
var _import = require('../node_modules/@react-stately/calendar/dist/import.js');
|
|
19
|
+
var _import$1 = require('../node_modules/@react-stately/calendar/dist/import.js');
|
|
20
20
|
var _import$2 = require('../node_modules/@react-aria/calendar/dist/import.js');
|
|
21
21
|
var chevronLeft = require('../packages/react-icons/dist/es/icons/chevron-left.js');
|
|
22
22
|
var chevronRight = require('../packages/react-icons/dist/es/icons/chevron-right.js');
|
|
@@ -63,30 +63,56 @@ const Calendar = (_a) => {
|
|
|
63
63
|
size = "lg",
|
|
64
64
|
showFooter = true,
|
|
65
65
|
footerAction,
|
|
66
|
-
footerActionText = "Select"
|
|
66
|
+
footerActionText = "Select",
|
|
67
|
+
onDaySelect,
|
|
68
|
+
onYearSelect,
|
|
69
|
+
onMonthSelect,
|
|
70
|
+
containerCSS
|
|
67
71
|
} = _b, props = __objRest(_b, [
|
|
68
72
|
"size",
|
|
69
73
|
"showFooter",
|
|
70
74
|
"footerAction",
|
|
71
|
-
"footerActionText"
|
|
75
|
+
"footerActionText",
|
|
76
|
+
"onDaySelect",
|
|
77
|
+
"onYearSelect",
|
|
78
|
+
"onMonthSelect",
|
|
79
|
+
"containerCSS"
|
|
72
80
|
]);
|
|
81
|
+
var _a2;
|
|
73
82
|
const [currentCalendarView, setCurrentCalendarView] = React.useState(CALENDAR_VIEW.GRID);
|
|
83
|
+
const [localDateValue, setLocalDateValue] = React.useState(
|
|
84
|
+
_import.today(_import.getLocalTimeZone())
|
|
85
|
+
);
|
|
86
|
+
const dateValue = (_a2 = props.value) != null ? _a2 : localDateValue;
|
|
74
87
|
const { locale } = realModule.useLocale();
|
|
75
|
-
const state = _import.useCalendarState(__spreadProps(__spreadValues({
|
|
76
|
-
|
|
77
|
-
|
|
88
|
+
const state = _import$1.useCalendarState(__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
89
|
+
defaultValue: dateValue
|
|
90
|
+
}, props), {
|
|
91
|
+
locale
|
|
92
|
+
}), props.value && {
|
|
93
|
+
value: props.value
|
|
94
|
+
}), {
|
|
95
|
+
createCalendar: _import.createCalendar
|
|
78
96
|
}));
|
|
79
97
|
const monthFormatter = realModule.useDateFormatter({
|
|
80
98
|
month: "short"
|
|
81
99
|
});
|
|
100
|
+
const handleChange = (value) => {
|
|
101
|
+
if (props.onChange) {
|
|
102
|
+
setLocalDateValue(value);
|
|
103
|
+
props.onChange(value);
|
|
104
|
+
} else {
|
|
105
|
+
setLocalDateValue(value);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
82
108
|
React.useEffect(() => {
|
|
83
|
-
if (props.showTimePicker && !(props.value instanceof _import
|
|
109
|
+
if (props.showTimePicker && !(props.value instanceof _import.ZonedDateTime || props.value instanceof _import.CalendarDateTime)) {
|
|
84
110
|
console.warn(
|
|
85
111
|
// eslint-disable-next-line max-len
|
|
86
112
|
"The value prop must be an instance of ZonedDateTime or CalendarDateTime when showTimePicker is true. Use parseDateTime or parseZonedDateTime from @internationalized/date. The value type will be changed to CalendarDateTime"
|
|
87
113
|
);
|
|
88
114
|
}
|
|
89
|
-
if (props.showTimezonePicker && !(props.value instanceof _import
|
|
115
|
+
if (props.showTimezonePicker && !(props.value instanceof _import.ZonedDateTime)) {
|
|
90
116
|
console.warn(
|
|
91
117
|
"The value prop must be an instance of ZonedDateTime when showTimezonePicker is true. The value type will be changed to ZonedDateTime"
|
|
92
118
|
);
|
|
@@ -97,117 +123,116 @@ const Calendar = (_a) => {
|
|
|
97
123
|
props,
|
|
98
124
|
state
|
|
99
125
|
);
|
|
100
|
-
const contextValue = React.useMemo(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
calendarHeader.CalendarTitle,
|
|
126
|
-
{
|
|
127
|
-
value: state.focusedDate,
|
|
128
|
-
timezone: state.timeZone,
|
|
129
|
-
setCurrentCalendarView
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
133
|
-
calendarHeader.CalendarNavigationButton,
|
|
134
|
-
__spreadProps(__spreadValues({}, nextButtonProps), {
|
|
135
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(chevronRight.ChevronRightIcon, {})
|
|
136
|
-
})
|
|
137
|
-
)
|
|
138
|
-
] }),
|
|
139
|
-
/* @__PURE__ */ jsxRuntime.jsx(calendarGrid.CalendarGrid, { state }),
|
|
140
|
-
(props.showTimePicker || props.showTimezonePicker) && /* @__PURE__ */ jsxRuntime.jsxs(calendarCommons.TimeAndZonePickerContainer, { calendarSize: size, children: [
|
|
141
|
-
props.showTimePicker && /* @__PURE__ */ jsxRuntime.jsx(
|
|
142
|
-
calendarTimePicker.CalendarTimePicker,
|
|
143
|
-
{
|
|
144
|
-
value: props.value,
|
|
145
|
-
onChange: props.onChange,
|
|
146
|
-
calendarState: state
|
|
147
|
-
}
|
|
148
|
-
),
|
|
149
|
-
props.showTimezonePicker && /* @__PURE__ */ jsxRuntime.jsx(
|
|
150
|
-
calendarTimezonePicker.CalendarTimezonePicker,
|
|
151
|
-
{
|
|
152
|
-
value: props.value,
|
|
153
|
-
onChange: props.onChange,
|
|
154
|
-
calendarState: state
|
|
155
|
-
}
|
|
156
|
-
)
|
|
157
|
-
] })
|
|
158
|
-
] }),
|
|
159
|
-
currentCalendarView === CALENDAR_VIEW.MONTH && /* @__PURE__ */ jsxRuntime.jsx(
|
|
160
|
-
calendarMonthsView.CalendarMonthsView,
|
|
126
|
+
const contextValue = React.useMemo(
|
|
127
|
+
() => ({
|
|
128
|
+
size
|
|
129
|
+
}),
|
|
130
|
+
[size]
|
|
131
|
+
);
|
|
132
|
+
return /* @__PURE__ */ jsxRuntime.jsx(calendarUtils.CalendarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
133
|
+
box.Box,
|
|
134
|
+
__spreadProps(__spreadValues({}, calendarProps), {
|
|
135
|
+
css: __spreadValues({
|
|
136
|
+
borderRadius: calendarUtils.CALENDAR_SIZE_TO_BORDER_RADIUS[size],
|
|
137
|
+
border: "1px solid $black400"
|
|
138
|
+
}, containerCSS),
|
|
139
|
+
ref,
|
|
140
|
+
children: [
|
|
141
|
+
currentCalendarView === CALENDAR_VIEW.GRID && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
142
|
+
/* @__PURE__ */ jsxRuntime.jsxs(calendarHeader.CalendarHeader, { calendarSize: size, children: [
|
|
143
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
144
|
+
calendarHeader.CalendarNavigationButton,
|
|
145
|
+
__spreadProps(__spreadValues({}, prevButtonProps), {
|
|
146
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(chevronLeft.ChevronLeftIcon, {})
|
|
147
|
+
})
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
150
|
+
calendarHeader.CalendarTitle,
|
|
161
151
|
{
|
|
162
|
-
state,
|
|
152
|
+
value: state.focusedDate,
|
|
153
|
+
timezone: state.timeZone,
|
|
163
154
|
setCurrentCalendarView
|
|
164
155
|
}
|
|
165
156
|
),
|
|
166
|
-
|
|
167
|
-
|
|
157
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
158
|
+
calendarHeader.CalendarNavigationButton,
|
|
159
|
+
__spreadProps(__spreadValues({}, nextButtonProps), {
|
|
160
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(chevronRight.ChevronRightIcon, {})
|
|
161
|
+
})
|
|
162
|
+
)
|
|
163
|
+
] }),
|
|
164
|
+
/* @__PURE__ */ jsxRuntime.jsx(calendarGrid.CalendarGrid, { state, onDaySelect }),
|
|
165
|
+
(props.showTimePicker || props.showTimezonePicker) && /* @__PURE__ */ jsxRuntime.jsxs(calendarCommons.TimeAndZonePickerContainer, { calendarSize: size, children: [
|
|
166
|
+
props.showTimePicker && /* @__PURE__ */ jsxRuntime.jsx(
|
|
167
|
+
calendarTimePicker.CalendarTimePicker,
|
|
168
168
|
{
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
value: dateValue,
|
|
170
|
+
onChange: handleChange,
|
|
171
|
+
size
|
|
171
172
|
}
|
|
172
173
|
),
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
174
|
+
props.showTimezonePicker && /* @__PURE__ */ jsxRuntime.jsx(
|
|
175
|
+
calendarTimezonePicker.CalendarTimezonePicker,
|
|
176
|
+
{
|
|
177
|
+
value: dateValue,
|
|
178
|
+
onChange: handleChange,
|
|
179
|
+
size
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
] })
|
|
183
|
+
] }),
|
|
184
|
+
currentCalendarView === CALENDAR_VIEW.MONTH && /* @__PURE__ */ jsxRuntime.jsx(
|
|
185
|
+
calendarMonthsView.CalendarMonthsView,
|
|
186
|
+
{
|
|
187
|
+
state,
|
|
188
|
+
setCurrentCalendarView,
|
|
189
|
+
onMonthSelect
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
currentCalendarView === CALENDAR_VIEW.YEAR && /* @__PURE__ */ jsxRuntime.jsx(
|
|
193
|
+
calendarYearsView.CalendarYearsView,
|
|
194
|
+
{
|
|
195
|
+
state,
|
|
196
|
+
setCurrentCalendarView,
|
|
197
|
+
onYearSelect
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
showFooter && currentCalendarView === CALENDAR_VIEW.GRID && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: props.renderFooter ? props.renderFooter(state) : /* @__PURE__ */ jsxRuntime.jsxs(calendarCommons.FooterContainer, { calendarSize: size, children: [
|
|
201
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
202
|
+
text.Text,
|
|
203
|
+
{
|
|
204
|
+
weight: "bold",
|
|
205
|
+
css: {
|
|
206
|
+
color: "$neutral700"
|
|
207
|
+
},
|
|
208
|
+
children: (state == null ? void 0 : state.value) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
209
|
+
monthFormatter.format(
|
|
210
|
+
state.value.toDate(state.timeZone)
|
|
211
|
+
),
|
|
212
|
+
" ",
|
|
213
|
+
state.value.day.toString().padStart(2, "0"),
|
|
214
|
+
",",
|
|
215
|
+
" ",
|
|
216
|
+
state.value.year.toString()
|
|
217
|
+
] })
|
|
218
|
+
}
|
|
219
|
+
),
|
|
220
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
221
|
+
button.Button,
|
|
222
|
+
{
|
|
223
|
+
size,
|
|
224
|
+
color: "primary",
|
|
225
|
+
onClick: () => {
|
|
226
|
+
if (footerAction)
|
|
227
|
+
footerAction(state);
|
|
228
|
+
},
|
|
229
|
+
children: footerActionText
|
|
230
|
+
}
|
|
231
|
+
)
|
|
232
|
+
] }) })
|
|
233
|
+
]
|
|
234
|
+
})
|
|
235
|
+
) });
|
|
211
236
|
};
|
|
212
237
|
|
|
213
238
|
exports.CALENDAR_VIEW = CALENDAR_VIEW;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js"],"sourcesContent":["import { jsx, jsxs, Fragment } from 'react/jsx-runtime';\nimport { ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, createCalendar as $64244302c3013299$export$dd0bbc9b26defe37 } from '../node_modules/@internationalized/date/dist/import.js';\nimport { useState, useEffect, useRef, useMemo } from 'react';\nimport { Box } from '../box/box.js';\nimport { Button } from '../button/button.js';\nimport '../button/icon-button.js';\nimport '../button/split-button.js';\nimport { Text } from '../text/text.js';\nimport { TimeAndZonePickerContainer, FooterContainer } from './calendar-commons.js';\nimport { CalendarGrid } from './calendar-grid.js';\nimport { CalendarHeader, CalendarNavigationButton, CalendarTitle } from './calendar-header.js';\nimport { CalendarMonthsView } from './calendar-months-view.js';\nimport { CalendarTimePicker } from './calendar-time-picker.js';\nimport { CalendarTimezonePicker } from './calendar-timezone-picker.js';\nimport { CalendarContext, CALENDAR_SIZE_TO_BORDER_RADIUS } from './calendar-utils.js';\nimport { CalendarYearsView } from './calendar-years-view.js';\nimport { useCalendarState as $131cf43a05231e1e$export$6d095e787d2b5e1f } from '../node_modules/@react-stately/calendar/dist/import.js';\nimport { useCalendar as $9942cad8a072a530$export$3ee915f8151bd4f1 } from '../node_modules/@react-aria/calendar/dist/import.js';\nimport { ChevronLeftIcon } from '../packages/react-icons/dist/es/icons/chevron-left.js';\nimport { ChevronRightIcon } from '../packages/react-icons/dist/es/icons/chevron-right.js';\nimport { useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, useDateFormatter as $896ba0a80a8f4d36$export$85fd5fdf27bacc79 } from '../node_modules/@react-aria/i18n/dist/real-module.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst CALENDAR_VIEW = {\n GRID: \"GRID\",\n MONTH: \"MONTH\",\n YEAR: \"YEAR\"\n};\nconst Calendar = (_a) => {\n var _b = _a, {\n size = \"lg\",\n showFooter = true,\n footerAction,\n footerActionText = \"Select\"\n } = _b, props = __objRest(_b, [\n \"size\",\n \"showFooter\",\n \"footerAction\",\n \"footerActionText\"\n ]);\n const [currentCalendarView, setCurrentCalendarView] = useState(CALENDAR_VIEW.GRID);\n const { locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();\n const state = $131cf43a05231e1e$export$6d095e787d2b5e1f(__spreadProps(__spreadValues({}, props), {\n locale,\n createCalendar: $64244302c3013299$export$dd0bbc9b26defe37\n }));\n const monthFormatter = $896ba0a80a8f4d36$export$85fd5fdf27bacc79({\n month: \"short\"\n });\n useEffect(() => {\n if (props.showTimePicker && !(props.value instanceof $35ea8db9cb2ccb90$export$d3b7288e7994edea || props.value instanceof $35ea8db9cb2ccb90$export$ca871e8dbb80966f)) {\n console.warn(\n // eslint-disable-next-line max-len\n \"The value prop must be an instance of ZonedDateTime or CalendarDateTime when showTimePicker is true. Use parseDateTime or parseZonedDateTime from @internationalized/date. The value type will be changed to CalendarDateTime\"\n );\n }\n if (props.showTimezonePicker && !(props.value instanceof $35ea8db9cb2ccb90$export$d3b7288e7994edea)) {\n console.warn(\n \"The value prop must be an instance of ZonedDateTime when showTimezonePicker is true. The value type will be changed to ZonedDateTime\"\n );\n }\n }, [props.showTimePicker]);\n const ref = useRef(null);\n const { calendarProps, prevButtonProps, nextButtonProps } = $9942cad8a072a530$export$3ee915f8151bd4f1(\n props,\n state\n );\n const contextValue = useMemo(() => ({\n size\n }), [size]);\n return /* @__PURE__ */ jsx(\n CalendarContext.Provider,\n {\n value: contextValue,\n children: /* @__PURE__ */ jsxs(\n Box,\n __spreadProps(__spreadValues({}, calendarProps), {\n css: {\n borderRadius: CALENDAR_SIZE_TO_BORDER_RADIUS[size],\n border: \"1px solid $black400\"\n },\n ref,\n children: [\n currentCalendarView === CALENDAR_VIEW.GRID && /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsxs(CalendarHeader, { calendarSize: size, children: [\n /* @__PURE__ */ jsx(\n CalendarNavigationButton,\n __spreadProps(__spreadValues({}, prevButtonProps), {\n icon: /* @__PURE__ */ jsx(ChevronLeftIcon, {})\n })\n ),\n /* @__PURE__ */ jsx(\n CalendarTitle,\n {\n value: state.focusedDate,\n timezone: state.timeZone,\n setCurrentCalendarView\n }\n ),\n /* @__PURE__ */ jsx(\n CalendarNavigationButton,\n __spreadProps(__spreadValues({}, nextButtonProps), {\n icon: /* @__PURE__ */ jsx(ChevronRightIcon, {})\n })\n )\n ] }),\n /* @__PURE__ */ jsx(CalendarGrid, { state }),\n (props.showTimePicker || props.showTimezonePicker) && /* @__PURE__ */ jsxs(TimeAndZonePickerContainer, { calendarSize: size, children: [\n props.showTimePicker && /* @__PURE__ */ jsx(\n CalendarTimePicker,\n {\n value: props.value,\n onChange: props.onChange,\n calendarState: state\n }\n ),\n props.showTimezonePicker && /* @__PURE__ */ jsx(\n CalendarTimezonePicker,\n {\n value: props.value,\n onChange: props.onChange,\n calendarState: state\n }\n )\n ] })\n ] }),\n currentCalendarView === CALENDAR_VIEW.MONTH && /* @__PURE__ */ jsx(\n CalendarMonthsView,\n {\n state,\n setCurrentCalendarView\n }\n ),\n currentCalendarView === CALENDAR_VIEW.YEAR && /* @__PURE__ */ jsx(\n CalendarYearsView,\n {\n state,\n setCurrentCalendarView\n }\n ),\n showFooter && currentCalendarView === CALENDAR_VIEW.GRID && /* @__PURE__ */ jsx(Fragment, { children: props.renderFooter ? props.renderFooter(state) : /* @__PURE__ */ jsxs(FooterContainer, { calendarSize: size, children: [\n /* @__PURE__ */ jsx(\n Text,\n {\n weight: \"bold\",\n css: {\n color: \"$neutral700\"\n },\n children: (state == null ? void 0 : state.value) && /* @__PURE__ */ jsxs(Fragment, { children: [\n monthFormatter.format(\n state.value.toDate(state.timeZone)\n ),\n \" \",\n state.value.day.toString().padStart(2, \"0\"),\n \",\",\n \" \",\n state.value.year.toString()\n ] })\n }\n ),\n /* @__PURE__ */ jsx(\n Button,\n {\n size,\n color: \"primary\",\n onClick: () => {\n if (footerAction)\n footerAction(state);\n },\n children: footerActionText\n }\n )\n ] }) })\n ]\n })\n )\n }\n );\n};\n\nexport { CALENDAR_VIEW, Calendar };\n//# sourceMappingURL=calendar.js.map\n"],"names":["useState","$18f2051aff69b9bf$export$43bb16f9c6d9e3f7","$131cf43a05231e1e$export$6d095e787d2b5e1f","$64244302c3013299$export$dd0bbc9b26defe37","$896ba0a80a8f4d36$export$85fd5fdf27bacc79","useEffect","$35ea8db9cb2ccb90$export$d3b7288e7994edea","$35ea8db9cb2ccb90$export$ca871e8dbb80966f","useRef","$9942cad8a072a530$export$3ee915f8151bd4f1","useMemo","jsx","CalendarContext","jsxs","Box","CALENDAR_SIZE_TO_BORDER_RADIUS","Fragment","CalendarHeader","CalendarNavigationButton","ChevronLeftIcon","CalendarTitle","ChevronRightIcon","CalendarGrid","TimeAndZonePickerContainer","CalendarTimePicker","CalendarTimezonePicker","CalendarMonthsView","CalendarYearsView","FooterContainer","Text","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,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B,aAAM;AACtB,gBAAgB;AAChB,kBAAkB,IAAI;AACtB,kBAAkB,KAAK,EAAE,SAAS;AAClC,kBAAkB,OAAO,EAAE,MAAM;AACjC,oBAAoB,IAAI,YAAY;AACpC,sBAAsB,YAAY,CAAC,KAAK,CAAC,CAAC;AAC1C,mBAAmB;AACnB,kBAAkB,QAAQ,EAAE,gBAAgB;AAC5C,iBAAiB;AACjB,eAAe;AACf,aAAa,EAAE,CAAC,EAAE,CAAC;AACnB,WAAW;AACX,SAAS,CAAC;AACV,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ;;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"calendar.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js"],"sourcesContent":["import { jsx, jsxs, Fragment } from 'react/jsx-runtime';\nimport { today as $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3, getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, createCalendar as $64244302c3013299$export$dd0bbc9b26defe37 } from '../node_modules/@internationalized/date/dist/import.js';\nimport { useState, useEffect, useRef, useMemo } from 'react';\nimport { Box } from '../box/box.js';\nimport { Button } from '../button/button.js';\nimport '../button/icon-button.js';\nimport '../button/split-button.js';\nimport { Text } from '../text/text.js';\nimport { TimeAndZonePickerContainer, FooterContainer } from './calendar-commons.js';\nimport { CalendarGrid } from './calendar-grid.js';\nimport { CalendarHeader, CalendarNavigationButton, CalendarTitle } from './calendar-header.js';\nimport { CalendarMonthsView } from './calendar-months-view.js';\nimport { CalendarTimePicker } from './calendar-time-picker.js';\nimport { CalendarTimezonePicker } from './calendar-timezone-picker.js';\nimport { CalendarContext, CALENDAR_SIZE_TO_BORDER_RADIUS } from './calendar-utils.js';\nimport { CalendarYearsView } from './calendar-years-view.js';\nimport { useCalendarState as $131cf43a05231e1e$export$6d095e787d2b5e1f } from '../node_modules/@react-stately/calendar/dist/import.js';\nimport { useCalendar as $9942cad8a072a530$export$3ee915f8151bd4f1 } from '../node_modules/@react-aria/calendar/dist/import.js';\nimport { ChevronLeftIcon } from '../packages/react-icons/dist/es/icons/chevron-left.js';\nimport { ChevronRightIcon } from '../packages/react-icons/dist/es/icons/chevron-right.js';\nimport { useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, useDateFormatter as $896ba0a80a8f4d36$export$85fd5fdf27bacc79 } from '../node_modules/@react-aria/i18n/dist/real-module.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst CALENDAR_VIEW = {\n GRID: \"GRID\",\n MONTH: \"MONTH\",\n YEAR: \"YEAR\"\n};\nconst Calendar = (_a) => {\n var _b = _a, {\n size = \"lg\",\n showFooter = true,\n footerAction,\n footerActionText = \"Select\",\n onDaySelect,\n onYearSelect,\n onMonthSelect,\n containerCSS\n } = _b, props = __objRest(_b, [\n \"size\",\n \"showFooter\",\n \"footerAction\",\n \"footerActionText\",\n \"onDaySelect\",\n \"onYearSelect\",\n \"onMonthSelect\",\n \"containerCSS\"\n ]);\n var _a2;\n const [currentCalendarView, setCurrentCalendarView] = useState(CALENDAR_VIEW.GRID);\n const [localDateValue, setLocalDateValue] = useState(\n $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2())\n );\n const dateValue = (_a2 = props.value) != null ? _a2 : localDateValue;\n const { locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();\n const state = $131cf43a05231e1e$export$6d095e787d2b5e1f(__spreadProps(__spreadValues(__spreadProps(__spreadValues({\n defaultValue: dateValue\n }, props), {\n locale\n }), props.value && {\n value: props.value\n }), {\n createCalendar: $64244302c3013299$export$dd0bbc9b26defe37\n }));\n const monthFormatter = $896ba0a80a8f4d36$export$85fd5fdf27bacc79({\n month: \"short\"\n });\n const handleChange = (value) => {\n if (props.onChange) {\n setLocalDateValue(value);\n props.onChange(value);\n } else {\n setLocalDateValue(value);\n }\n };\n useEffect(() => {\n if (props.showTimePicker && !(props.value instanceof $35ea8db9cb2ccb90$export$d3b7288e7994edea || props.value instanceof $35ea8db9cb2ccb90$export$ca871e8dbb80966f)) {\n console.warn(\n // eslint-disable-next-line max-len\n \"The value prop must be an instance of ZonedDateTime or CalendarDateTime when showTimePicker is true. Use parseDateTime or parseZonedDateTime from @internationalized/date. The value type will be changed to CalendarDateTime\"\n );\n }\n if (props.showTimezonePicker && !(props.value instanceof $35ea8db9cb2ccb90$export$d3b7288e7994edea)) {\n console.warn(\n \"The value prop must be an instance of ZonedDateTime when showTimezonePicker is true. The value type will be changed to ZonedDateTime\"\n );\n }\n }, [props.showTimePicker]);\n const ref = useRef(null);\n const { calendarProps, prevButtonProps, nextButtonProps } = $9942cad8a072a530$export$3ee915f8151bd4f1(\n props,\n state\n );\n const contextValue = useMemo(\n () => ({\n size\n }),\n [size]\n );\n return /* @__PURE__ */ jsx(CalendarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(\n Box,\n __spreadProps(__spreadValues({}, calendarProps), {\n css: __spreadValues({\n borderRadius: CALENDAR_SIZE_TO_BORDER_RADIUS[size],\n border: \"1px solid $black400\"\n }, containerCSS),\n ref,\n children: [\n currentCalendarView === CALENDAR_VIEW.GRID && /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsxs(CalendarHeader, { calendarSize: size, children: [\n /* @__PURE__ */ jsx(\n CalendarNavigationButton,\n __spreadProps(__spreadValues({}, prevButtonProps), {\n icon: /* @__PURE__ */ jsx(ChevronLeftIcon, {})\n })\n ),\n /* @__PURE__ */ jsx(\n CalendarTitle,\n {\n value: state.focusedDate,\n timezone: state.timeZone,\n setCurrentCalendarView\n }\n ),\n /* @__PURE__ */ jsx(\n CalendarNavigationButton,\n __spreadProps(__spreadValues({}, nextButtonProps), {\n icon: /* @__PURE__ */ jsx(ChevronRightIcon, {})\n })\n )\n ] }),\n /* @__PURE__ */ jsx(CalendarGrid, { state, onDaySelect }),\n (props.showTimePicker || props.showTimezonePicker) && /* @__PURE__ */ jsxs(TimeAndZonePickerContainer, { calendarSize: size, children: [\n props.showTimePicker && /* @__PURE__ */ jsx(\n CalendarTimePicker,\n {\n value: dateValue,\n onChange: handleChange,\n size\n }\n ),\n props.showTimezonePicker && /* @__PURE__ */ jsx(\n CalendarTimezonePicker,\n {\n value: dateValue,\n onChange: handleChange,\n size\n }\n )\n ] })\n ] }),\n currentCalendarView === CALENDAR_VIEW.MONTH && /* @__PURE__ */ jsx(\n CalendarMonthsView,\n {\n state,\n setCurrentCalendarView,\n onMonthSelect\n }\n ),\n currentCalendarView === CALENDAR_VIEW.YEAR && /* @__PURE__ */ jsx(\n CalendarYearsView,\n {\n state,\n setCurrentCalendarView,\n onYearSelect\n }\n ),\n showFooter && currentCalendarView === CALENDAR_VIEW.GRID && /* @__PURE__ */ jsx(Fragment, { children: props.renderFooter ? props.renderFooter(state) : /* @__PURE__ */ jsxs(FooterContainer, { calendarSize: size, children: [\n /* @__PURE__ */ jsx(\n Text,\n {\n weight: \"bold\",\n css: {\n color: \"$neutral700\"\n },\n children: (state == null ? void 0 : state.value) && /* @__PURE__ */ jsxs(Fragment, { children: [\n monthFormatter.format(\n state.value.toDate(state.timeZone)\n ),\n \" \",\n state.value.day.toString().padStart(2, \"0\"),\n \",\",\n \" \",\n state.value.year.toString()\n ] })\n }\n ),\n /* @__PURE__ */ jsx(\n Button,\n {\n size,\n color: \"primary\",\n onClick: () => {\n if (footerAction)\n footerAction(state);\n },\n children: footerActionText\n }\n )\n ] }) })\n ]\n })\n ) });\n};\n\nexport { CALENDAR_VIEW, Calendar };\n//# sourceMappingURL=calendar.js.map\n"],"names":["useState","$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3","$14e0f24ef4ac5c92$export$aa8b41735afcabd2","$18f2051aff69b9bf$export$43bb16f9c6d9e3f7","$131cf43a05231e1e$export$6d095e787d2b5e1f","$64244302c3013299$export$dd0bbc9b26defe37","$896ba0a80a8f4d36$export$85fd5fdf27bacc79","useEffect","$35ea8db9cb2ccb90$export$d3b7288e7994edea","$35ea8db9cb2ccb90$export$ca871e8dbb80966f","useRef","$9942cad8a072a530$export$3ee915f8151bd4f1","useMemo","jsx","CalendarContext","jsxs","Box","CALENDAR_SIZE_TO_BORDER_RADIUS","Fragment","CalendarHeader","CalendarNavigationButton","ChevronLeftIcon","CalendarTitle","ChevronRightIcon","CalendarGrid","TimeAndZonePickerContainer","CalendarTimePicker","CalendarTimezonePicker","CalendarMonthsView","CalendarYearsView","FooterContainer","Text","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,C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,QAAQ,CAAC;AACpD,iBAAiB;AACjB,gBAAgB,GAAG;AACnB,gBAAgB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAC3D,gBAAgB,GAAG;AACnB,gBAAgB,GAAG;AACnB,gBAAgB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE;AAC3C,eAAe,EAAE,CAAC;AAClB,aAAa;AACb,WAAW;AACX,0BAA0BL,cAAG;AAC7B,YAAYmB,aAAM;AAClB,YAAY;AACZ,cAAc,IAAI;AAClB,cAAc,KAAK,EAAE,SAAS;AAC9B,cAAc,OAAO,EAAE,MAAM;AAC7B,gBAAgB,IAAI,YAAY;AAChC,kBAAkB,YAAY,CAAC,KAAK,CAAC,CAAC;AACtC,eAAe;AACf,cAAc,QAAQ,EAAE,gBAAgB;AACxC,aAAa;AACb,WAAW;AACX,SAAS,EAAE,CAAC,EAAE,CAAC;AACf,OAAO;AACP,KAAK,CAAC;AACN,GAAG,EAAE,CAAC,CAAC;AACP;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var React = require('react');
|
|
5
4
|
var index = require('../node_modules/@radix-ui/react-checkbox/dist/index.js');
|
|
6
|
-
var
|
|
5
|
+
var React = require('react');
|
|
7
6
|
var flex = require('../flex/flex.js');
|
|
7
|
+
var stitches_config = require('../stitches.config.js');
|
|
8
8
|
|
|
9
9
|
var __defProp = Object.defineProperty;
|
|
10
10
|
var __defProps = Object.defineProperties;
|
|
@@ -38,10 +38,48 @@ var __objRest = (source, exclude) => {
|
|
|
38
38
|
return target;
|
|
39
39
|
};
|
|
40
40
|
const TickIcon = () => {
|
|
41
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42
|
+
"svg",
|
|
43
|
+
{
|
|
44
|
+
width: "10",
|
|
45
|
+
height: "8",
|
|
46
|
+
viewBox: "0 0 10 8",
|
|
47
|
+
fill: "none",
|
|
48
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
50
|
+
"path",
|
|
51
|
+
{
|
|
52
|
+
d: "M9 1.25L3.5 6.75L1 4.25",
|
|
53
|
+
stroke: "white",
|
|
54
|
+
strokeWidth: "1.8",
|
|
55
|
+
strokeLinecap: "round",
|
|
56
|
+
strokeLinejoin: "round"
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
);
|
|
42
61
|
};
|
|
43
62
|
const HorizontalLineIcon = () => {
|
|
44
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
64
|
+
"svg",
|
|
65
|
+
{
|
|
66
|
+
width: "10",
|
|
67
|
+
height: "2",
|
|
68
|
+
viewBox: "0 0 10 2",
|
|
69
|
+
fill: "none",
|
|
70
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
71
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
"path",
|
|
73
|
+
{
|
|
74
|
+
d: "M9 1H1",
|
|
75
|
+
stroke: "white",
|
|
76
|
+
strokeWidth: "1.8",
|
|
77
|
+
strokeLinecap: "round",
|
|
78
|
+
strokeLinejoin: "round"
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
);
|
|
45
83
|
};
|
|
46
84
|
const StyledCheckbox = stitches_config.styled(index.Root, {
|
|
47
85
|
backgroundColor: "$white900",
|
|
@@ -52,6 +90,7 @@ const StyledCheckbox = stitches_config.styled(index.Root, {
|
|
|
52
90
|
justifyContent: "center",
|
|
53
91
|
border: "$borderWidths$xs solid $neutral700",
|
|
54
92
|
transition: "all $transitions$2",
|
|
93
|
+
cursor: "pointer",
|
|
55
94
|
"&:disabled": {
|
|
56
95
|
cursor: "not-allowed",
|
|
57
96
|
opacity: 0.4
|
|
@@ -103,32 +142,51 @@ const StyledLabelContainer = stitches_config.styled("label", {
|
|
|
103
142
|
display: "inline-flex",
|
|
104
143
|
paddingInlineStart: "$4"
|
|
105
144
|
});
|
|
106
|
-
const Checkbox = (_a) => {
|
|
145
|
+
const Checkbox = React.forwardRef((_a, ref) => {
|
|
107
146
|
var _b = _a, {
|
|
108
147
|
checked,
|
|
109
148
|
disabled,
|
|
110
149
|
required,
|
|
111
150
|
onChange,
|
|
112
151
|
children,
|
|
113
|
-
id
|
|
152
|
+
id,
|
|
153
|
+
containerRef
|
|
114
154
|
} = _b, rest = __objRest(_b, [
|
|
115
155
|
"checked",
|
|
116
156
|
"disabled",
|
|
117
157
|
"required",
|
|
118
158
|
"onChange",
|
|
119
159
|
"children",
|
|
120
|
-
"id"
|
|
160
|
+
"id",
|
|
161
|
+
"containerRef"
|
|
121
162
|
]);
|
|
122
163
|
const isIndeterminate = checked === "indeterminate";
|
|
123
164
|
const uniqueId = id || React.useId();
|
|
124
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(flex.Flex, { alignItems: "center", children: [
|
|
125
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
165
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(flex.Flex, { alignItems: "center", ref: containerRef, children: [
|
|
166
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
167
|
+
StyledCheckbox,
|
|
168
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
169
|
+
checked,
|
|
170
|
+
onCheckedChange: onChange,
|
|
171
|
+
disabled,
|
|
172
|
+
required,
|
|
173
|
+
id: uniqueId
|
|
174
|
+
}, isIndeterminate && { "data-state": "indeterminate" }), rest), {
|
|
175
|
+
ref,
|
|
176
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
177
|
+
StyledIndicator,
|
|
178
|
+
__spreadProps(__spreadValues({}, isIndeterminate && { "data-state": "indeterminate" }), {
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledCheckIconContainer, { className: "check-icon", children: /* @__PURE__ */ jsxRuntime.jsx(TickIcon, {}) }),
|
|
181
|
+
isIndeterminate && /* @__PURE__ */ jsxRuntime.jsx(HorizontalLineIcon, {})
|
|
182
|
+
]
|
|
183
|
+
})
|
|
184
|
+
)
|
|
185
|
+
})
|
|
186
|
+
),
|
|
129
187
|
children && /* @__PURE__ */ jsxRuntime.jsx(StyledLabelContainer, { htmlFor: uniqueId, children })
|
|
130
188
|
] });
|
|
131
|
-
};
|
|
189
|
+
});
|
|
132
190
|
|
|
133
191
|
exports.Checkbox = Checkbox;
|
|
134
192
|
//# sourceMappingURL=checkbox.js.map
|