0.1.4 • Published 7 months ago

@temporal-picker/react-router v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@temporal-picker/react-router

The DatePicker (RangePicker) component base on React-Router and temporal-picker.

How to Use

Step 1.

npm i @temporal-picker/react-router

Step 2.

import { DatePicker, RangePicker } from "@temporal-picker/react-router";

function Demo() {
  return (
    <>
      <DatePicker param="date" defaultValue="2023-01-01" resetButton aria-selected="false" />
      <RangePicker
        startParam="start"
        endParam="end"
        placement="bottom-end"
        autoApply
        resetButton
        extraSelect
        presets={[
          { label: "Preset 1", start: "2023-01-01", end: "2023-02-15" },
          { label: "Preset 2", start: "2023-01-01" },
        ]}
      />
    </>
  );
}

export default Demo;

Props

export type PickerProps = {
  className?: string;
  plain?: "date" | "time" | "datetime" | "month";
  disabled?: boolean;
  readonly?: boolean;
  max?: string;
  min?: string;
  native?: boolean;
  placement?: "bottom-start" | "bottom-end";
  autoApply?: boolean;
  resetButton?: boolean;
  extraSelect?: boolean;
  customLayout?: boolean;
  firstDay?: number;
  locale?: string;
  localeApply?: string;
  localeCancel?: string;
  localeClear?: string;
  rowHeader?: boolean;
  pickLabel?: boolean;
  testId?: string;
  onViewChange?: (event: CustomEvent<ViewDetail>) => void;
};

export type PlainPickerProps = PickerProps & {
  param: string; // search param name
  defaultValue?: string;
};

export type RangePickerProps = PickerProps & {
  startParam: string; // search param name
  endParam: string; // search param name
  defaultStart?: string;
  defaultEnd?: string;
  presets?: {
    label: string;
    start?: string;
    end?: string;
  }[];
  presetPosition?: "bottom" | "left" | "right" | "top";
  tooltip?: boolean;
  strict?: boolean;
  reselect?: boolean;
};
0.1.4

7 months ago

0.1.3

9 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

11 months ago

0.0.1

11 months ago