|
1 | 1 | import React, { useEffect } from 'react';
|
2 |
| -import { FormalTheme, SamplesSectionWrapper, SamplesTitle } from './styled'; |
| 2 | +import { FormalTheme, RTLJBDateInput, SamplesSectionWrapper, SamplesTitle, SamplesWrapper } from './styled'; |
3 | 3 | import dynamic from 'next/dynamic';
|
4 |
| -import {JBDateInputValueObject } from 'jb-date-input-react'; |
| 4 | +import { JBDateInputValueObject } from 'jb-date-input-react'; |
5 | 5 | enum InputTypes {
|
6 | 6 | jalali = 'JALALI',
|
7 | 7 | gregorian = 'GREGORIAN'
|
@@ -31,43 +31,47 @@ function Samples() {
|
31 | 31 | <SamplesTitle>
|
32 | 32 | Samples
|
33 | 33 | </SamplesTitle>
|
34 |
| - <JBDateInput label="simple date:">{ }</JBDateInput> |
35 |
| - <JBDateInput label="with persian number" usePersianNumber={true}>{ }</JBDateInput> |
36 |
| - <JBDateInput label="with default value:" value="2020-08-10T08:51:23.176Z">{ }</JBDateInput> |
37 |
| - <JBDateInput label="with min and max value:" value="2020-08-10T08:51:23.176Z" min="2020-08-05T08:51:23.176Z" max="2020-08-15T08:51:23.176Z">{ }</JBDateInput> |
38 |
| - <JBDateInput label="with validation" validationList={validationList}>{ }</JBDateInput> |
39 |
| - <JBDateInput label="gregorian date:" inputType="GREGORIAN">{ }</JBDateInput> |
40 |
| - <JBDateInput label="with default opened calendar date" inputType="JALALI" calendarDefaultDateView={{ year: 1350, month: 3, dateType: InputTypes.jalali }}>{ }</JBDateInput> |
41 |
| - <JBDateInput label="with custom icon"> |
42 |
| - <div slot="calendar-trigger-icon"> |
43 |
| - <svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 610.398 610.398"> |
44 |
| - <g> |
| 34 | + <SamplesWrapper> |
| 35 | + <JBDateInput label="simple date:">{ }</JBDateInput> |
| 36 | + <JBDateInput label="with persian number" usePersianNumber={true}>{ }</JBDateInput> |
| 37 | + <RTLJBDateInput label="راست به چپ" usePersianNumber={true}>{ }</RTLJBDateInput> |
| 38 | + <JBDateInput label="with default value:" value="2020-08-10T08:51:23.176Z">{ }</JBDateInput> |
| 39 | + <JBDateInput label="with min and max value:" value="2020-08-10T08:51:23.176Z" min="2020-08-05T08:51:23.176Z" max="2020-08-15T08:51:23.176Z">{ }</JBDateInput> |
| 40 | + <JBDateInput label="with validation" validationList={validationList}>{ }</JBDateInput> |
| 41 | + <JBDateInput label="gregorian date:" inputType="GREGORIAN">{ }</JBDateInput> |
| 42 | + <JBDateInput label="with default opened calendar date" inputType="JALALI" calendarDefaultDateView={{ year: 1350, month: 3, dateType: InputTypes.jalali }}>{ }</JBDateInput> |
| 43 | + <JBDateInput label="with custom icon"> |
| 44 | + <div slot="calendar-trigger-icon"> |
| 45 | + <svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 610.398 610.398"> |
45 | 46 | <g>
|
46 |
| - <path d="M159.567,0h-15.329c-1.956,0-3.811,0.411-5.608,0.995c-8.979,2.912-15.616,12.498-15.616,23.997v10.552v27.009v14.052 c0,2.611,0.435,5.078,1.066,7.44c2.702,10.146,10.653,17.552,20.158,17.552h15.329c11.724,0,21.224-11.188,21.224-24.992V62.553 V35.544V24.992C180.791,11.188,171.291,0,159.567,0z" /> |
47 |
| - <path d="M461.288,0h-15.329c-11.724,0-21.224,11.188-21.224,24.992v10.552v27.009v14.052c0,13.804,9.5,24.992,21.224,24.992 h15.329c11.724,0,21.224-11.188,21.224-24.992V62.553V35.544V24.992C482.507,11.188,473.007,0,461.288,0z" /> |
48 |
| - <path d="M539.586,62.553h-37.954v14.052c0,24.327-18.102,44.117-40.349,44.117h-15.329c-22.247,0-40.349-19.79-40.349-44.117 V62.553H199.916v14.052c0,24.327-18.102,44.117-40.349,44.117h-15.329c-22.248,0-40.349-19.79-40.349-44.117V62.553H70.818 c-21.066,0-38.15,16.017-38.15,35.764v476.318c0,19.784,17.083,35.764,38.15,35.764h468.763c21.085,0,38.149-15.984,38.149-35.764 V98.322C577.735,78.575,560.671,62.553,539.586,62.553z M527.757,557.9l-446.502-0.172V173.717h446.502V557.9z" /> |
49 |
| - <path d="M353.017,266.258h117.428c10.193,0,18.437-10.179,18.437-22.759s-8.248-22.759-18.437-22.759H353.017 c-10.193,0-18.437,10.179-18.437,22.759C334.58,256.074,342.823,266.258,353.017,266.258z" /> |
50 |
| - <path d="M353.017,348.467h117.428c10.193,0,18.437-10.179,18.437-22.759c0-12.579-8.248-22.758-18.437-22.758H353.017 c-10.193,0-18.437,10.179-18.437,22.758C334.58,338.288,342.823,348.467,353.017,348.467z" /> |
51 |
| - <path d="M353.017,430.676h117.428c10.193,0,18.437-10.18,18.437-22.759s-8.248-22.759-18.437-22.759H353.017 c-10.193,0-18.437,10.18-18.437,22.759S342.823,430.676,353.017,430.676z" /> |
52 |
| - <path d="M353.017,512.89h117.428c10.193,0,18.437-10.18,18.437-22.759c0-12.58-8.248-22.759-18.437-22.759H353.017 c-10.193,0-18.437,10.179-18.437,22.759C334.58,502.71,342.823,512.89,353.017,512.89z" /> |
53 |
| - <path d="M145.032,266.258H262.46c10.193,0,18.436-10.179,18.436-22.759s-8.248-22.759-18.436-22.759H145.032 c-10.194,0-18.437,10.179-18.437,22.759C126.596,256.074,134.838,266.258,145.032,266.258z" /> |
54 |
| - <path d="M145.032,348.467H262.46c10.193,0,18.436-10.179,18.436-22.759c0-12.579-8.248-22.758-18.436-22.758H145.032 c-10.194,0-18.437,10.179-18.437,22.758C126.596,338.288,134.838,348.467,145.032,348.467z" /> |
55 |
| - <path d="M145.032,430.676H262.46c10.193,0,18.436-10.18,18.436-22.759s-8.248-22.759-18.436-22.759H145.032 c-10.194,0-18.437,10.18-18.437,22.759S134.838,430.676,145.032,430.676z" /> |
56 |
| - <path d="M145.032,512.89H262.46c10.193,0,18.436-10.18,18.436-22.759c0-12.58-8.248-22.759-18.436-22.759H145.032 c-10.194,0-18.437,10.179-18.437,22.759C126.596,502.71,134.838,512.89,145.032,512.89z" /> |
| 47 | + <g> |
| 48 | + <path d="M159.567,0h-15.329c-1.956,0-3.811,0.411-5.608,0.995c-8.979,2.912-15.616,12.498-15.616,23.997v10.552v27.009v14.052 c0,2.611,0.435,5.078,1.066,7.44c2.702,10.146,10.653,17.552,20.158,17.552h15.329c11.724,0,21.224-11.188,21.224-24.992V62.553 V35.544V24.992C180.791,11.188,171.291,0,159.567,0z" /> |
| 49 | + <path d="M461.288,0h-15.329c-11.724,0-21.224,11.188-21.224,24.992v10.552v27.009v14.052c0,13.804,9.5,24.992,21.224,24.992 h15.329c11.724,0,21.224-11.188,21.224-24.992V62.553V35.544V24.992C482.507,11.188,473.007,0,461.288,0z" /> |
| 50 | + <path d="M539.586,62.553h-37.954v14.052c0,24.327-18.102,44.117-40.349,44.117h-15.329c-22.247,0-40.349-19.79-40.349-44.117 V62.553H199.916v14.052c0,24.327-18.102,44.117-40.349,44.117h-15.329c-22.248,0-40.349-19.79-40.349-44.117V62.553H70.818 c-21.066,0-38.15,16.017-38.15,35.764v476.318c0,19.784,17.083,35.764,38.15,35.764h468.763c21.085,0,38.149-15.984,38.149-35.764 V98.322C577.735,78.575,560.671,62.553,539.586,62.553z M527.757,557.9l-446.502-0.172V173.717h446.502V557.9z" /> |
| 51 | + <path d="M353.017,266.258h117.428c10.193,0,18.437-10.179,18.437-22.759s-8.248-22.759-18.437-22.759H353.017 c-10.193,0-18.437,10.179-18.437,22.759C334.58,256.074,342.823,266.258,353.017,266.258z" /> |
| 52 | + <path d="M353.017,348.467h117.428c10.193,0,18.437-10.179,18.437-22.759c0-12.579-8.248-22.758-18.437-22.758H353.017 c-10.193,0-18.437,10.179-18.437,22.758C334.58,338.288,342.823,348.467,353.017,348.467z" /> |
| 53 | + <path d="M353.017,430.676h117.428c10.193,0,18.437-10.18,18.437-22.759s-8.248-22.759-18.437-22.759H353.017 c-10.193,0-18.437,10.18-18.437,22.759S342.823,430.676,353.017,430.676z" /> |
| 54 | + <path d="M353.017,512.89h117.428c10.193,0,18.437-10.18,18.437-22.759c0-12.58-8.248-22.759-18.437-22.759H353.017 c-10.193,0-18.437,10.179-18.437,22.759C334.58,502.71,342.823,512.89,353.017,512.89z" /> |
| 55 | + <path d="M145.032,266.258H262.46c10.193,0,18.436-10.179,18.436-22.759s-8.248-22.759-18.436-22.759H145.032 c-10.194,0-18.437,10.179-18.437,22.759C126.596,256.074,134.838,266.258,145.032,266.258z" /> |
| 56 | + <path d="M145.032,348.467H262.46c10.193,0,18.436-10.179,18.436-22.759c0-12.579-8.248-22.758-18.436-22.758H145.032 c-10.194,0-18.437,10.179-18.437,22.758C126.596,338.288,134.838,348.467,145.032,348.467z" /> |
| 57 | + <path d="M145.032,430.676H262.46c10.193,0,18.436-10.18,18.436-22.759s-8.248-22.759-18.436-22.759H145.032 c-10.194,0-18.437,10.18-18.437,22.759S134.838,430.676,145.032,430.676z" /> |
| 58 | + <path d="M145.032,512.89H262.46c10.193,0,18.436-10.18,18.436-22.759c0-12.58-8.248-22.759-18.436-22.759H145.032 c-10.194,0-18.437,10.179-18.437,22.759C126.596,502.71,134.838,512.89,145.032,512.89z" /> |
| 59 | + </g> |
57 | 60 | </g>
|
58 |
| - </g> |
59 |
| - </svg> |
60 |
| - </div> |
61 |
| - </JBDateInput> |
62 |
| - <JBDateInput label="with inner-box section"> |
63 |
| - <jb-date-input-inbox-element slot="end-section"> |
64 |
| - <div>after</div> |
65 |
| - </jb-date-input-inbox-element> |
66 |
| - <jb-date-input-inbox-element slot="start-section"> |
67 |
| - <div>before</div> |
68 |
| - </jb-date-input-inbox-element> |
69 |
| - </JBDateInput> |
70 |
| - <FormalTheme label="more formal look">{ }</FormalTheme> |
| 61 | + </svg> |
| 62 | + </div> |
| 63 | + </JBDateInput> |
| 64 | + <JBDateInput label="with inner-box section"> |
| 65 | + <jb-date-input-inbox-element slot="end-section"> |
| 66 | + <div>a</div> |
| 67 | + </jb-date-input-inbox-element> |
| 68 | + <jb-date-input-inbox-element slot="start-section"> |
| 69 | + <div>b</div> |
| 70 | + </jb-date-input-inbox-element> |
| 71 | + </JBDateInput> |
| 72 | + <FormalTheme label="more formal look">{ }</FormalTheme> |
| 73 | + </SamplesWrapper> |
| 74 | + |
71 | 75 |
|
72 | 76 | </SamplesSectionWrapper>
|
73 | 77 | );
|
|
0 commit comments