@public-ui/sample-react 2.0.4 → 2.0.6
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/.eslintrc.js +2 -1
- package/dist/104.js +2 -0
- package/dist/{4669.js → 1296.js} +2 -2
- package/dist/{8869.js → 1461.js} +2 -2
- package/dist/1684.js +2 -0
- package/dist/1685.js +2 -0
- package/dist/1888.js +2 -0
- package/dist/1892.js +2 -0
- package/dist/2120.js +2 -0
- package/dist/2240.js +2 -0
- package/dist/2364.js +2 -0
- package/dist/{4279.js → 2392.js} +2 -2
- package/dist/2444.js +2 -0
- package/dist/2628.js +2 -0
- package/dist/{3388.js → 2740.js} +2 -2
- package/dist/2764.js +2 -0
- package/dist/2782.js +2 -0
- package/dist/2812.js +2 -0
- package/dist/{3845.js → 2984.js} +2 -2
- package/dist/{5324.js → 3200.js} +2 -2
- package/dist/3204.js +2 -0
- package/dist/{3034.js → 3384.js} +2 -2
- package/dist/352.js +2 -0
- package/dist/3564.js +2 -0
- package/dist/{8612.js → 3920.js} +2 -2
- package/dist/4064.js +2 -0
- package/dist/4136.js +1 -0
- package/dist/4544.js +2 -0
- package/dist/{9865.js → 4728.js} +2 -2
- package/dist/4915.js +2 -0
- package/dist/4988.js +2 -0
- package/dist/5376.js +2 -0
- package/dist/5456.js +2 -0
- package/dist/5615.js +1 -1
- package/dist/5628.js +2 -0
- package/dist/5744.js +2 -0
- package/dist/5768.js +2 -0
- package/dist/{9330.js → 5839.js} +2 -2
- package/dist/5956.js +2 -0
- package/dist/5972.js +2 -0
- package/dist/6040.js +2 -0
- package/dist/{3600.js → 6112.js} +2 -2
- package/dist/6476.js +2 -0
- package/dist/6488.js +2 -0
- package/dist/7192.js +2 -0
- package/dist/7312.js +2 -0
- package/dist/736.js +2 -0
- package/dist/{8734.js → 7496.js} +2 -2
- package/dist/7508.js +2 -0
- package/dist/7596.js +2 -0
- package/dist/7712.js +2 -0
- package/dist/7804.js +2 -0
- package/dist/{9886.js → 7808.js} +2 -2
- package/dist/80.js +2 -0
- package/dist/8188.js +2 -0
- package/dist/8232.js +2 -0
- package/dist/8248.js +2 -0
- package/dist/828.js +2 -0
- package/dist/8476.js +2 -0
- package/dist/8524.js +2 -0
- package/dist/9072.js +2 -0
- package/dist/9088.js +2 -0
- package/dist/{2079.js → 9224.js} +2 -2
- package/dist/9224.js.LICENSE.txt +3 -0
- package/dist/9404.js +2 -0
- package/dist/9404.js.LICENSE.txt +3 -0
- package/dist/9424.js +2 -0
- package/dist/9424.js.LICENSE.txt +3 -0
- package/dist/9680.js +2 -0
- package/dist/9680.js.LICENSE.txt +3 -0
- package/dist/9888.js +2 -0
- package/dist/9888.js.LICENSE.txt +3 -0
- package/dist/9984.js +1 -1
- package/dist/index.html +1 -1
- package/dist/main.css +1 -1
- package/dist/main.js +10336 -5859
- package/dist/main.js.LICENSE.txt +2 -2
- package/package.json +14 -15
- package/public/index.html +1 -1
- package/src/App.tsx +16 -10
- package/src/components/BackPage.tsx +17 -0
- package/src/components/FocusInput.tsx +4 -2
- package/src/components/FormWrap.tsx +6 -2
- package/src/components/SampleDescription.tsx +4 -1
- package/src/components/Sidebar.tsx +12 -4
- package/src/components/abbr/basic.tsx +2 -1
- package/src/components/abbr/routes.ts +0 -1
- package/src/components/accordion/basic.tsx +3 -2
- package/src/components/accordion/headlines.tsx +2 -1
- package/src/components/accordion/list.tsx +3 -1
- package/src/components/accordion/routes.ts +0 -1
- package/src/components/alert/basic.tsx +3 -2
- package/src/components/alert/card-msg.tsx +2 -1
- package/src/components/alert/html.tsx +4 -3
- package/src/components/alert/routes.ts +0 -3
- package/src/components/avatar/basic.tsx +3 -1
- package/src/components/badge/basic.tsx +2 -1
- package/src/components/badge/button.tsx +2 -1
- package/src/components/badge/routes.ts +0 -2
- package/src/components/breadcrumb/basic.tsx +11 -10
- package/src/components/breadcrumb/routes.ts +0 -1
- package/src/components/button/access-key.tsx +3 -1
- package/src/components/button/baselined.tsx +2 -1
- package/src/components/button/basic.tsx +3 -1
- package/src/components/button/hide-label.tsx +2 -1
- package/src/components/button/icons.tsx +2 -1
- package/src/components/button/partials/cases.tsx +3 -2
- package/src/components/button/partials/variants.tsx +2 -1
- package/src/components/button/routes.ts +2 -6
- package/src/components/button/width.tsx +2 -1
- package/src/components/button-group/basic.tsx +2 -1
- package/src/components/button-group/routes.ts +0 -1
- package/src/components/button-link/basic.tsx +2 -1
- package/src/components/button-link/icons.tsx +2 -1
- package/src/components/button-link/image.tsx +2 -1
- package/src/components/button-link/routes.ts +0 -3
- package/src/components/card/basic.tsx +2 -1
- package/src/components/card/confirm.tsx +2 -1
- package/src/components/card/flex.tsx +2 -1
- package/src/components/card/routes.ts +0 -4
- package/src/components/card/selection.tsx +2 -1
- package/src/components/details/basic.tsx +7 -1
- package/src/components/details/routes.ts +0 -1
- package/src/components/handout/basic.tsx +38 -34
- package/src/components/handout/routes.ts +0 -1
- package/src/components/heading/badged.tsx +2 -1
- package/src/components/heading/basic.tsx +2 -1
- package/src/components/heading/paragraph.tsx +2 -1
- package/src/components/heading/routes.ts +0 -3
- package/src/components/icon/basic.tsx +2 -1
- package/src/components/icon/routes.ts +0 -1
- package/src/components/image/basic.tsx +3 -2
- package/src/components/image/routes.ts +0 -1
- package/src/components/indented-text/basic.tsx +2 -1
- package/src/components/indented-text/routes.ts +0 -1
- package/src/components/input-checkbox/basic.tsx +3 -1
- package/src/components/input-checkbox/button.tsx +3 -1
- package/src/components/input-checkbox/partials/cases.tsx +1 -1
- package/src/components/input-checkbox/partials/variants.tsx +1 -1
- package/src/components/input-checkbox/routes.ts +0 -1
- package/src/components/input-checkbox/switch.tsx +4 -2
- package/src/components/input-color/basic.tsx +3 -1
- package/src/components/input-color/partials/cases.tsx +1 -1
- package/src/components/input-color/partials/variants.tsx +1 -1
- package/src/components/input-color/routes.ts +0 -1
- package/src/components/input-date/basic.tsx +3 -1
- package/src/components/input-date/partials/cases.tsx +1 -1
- package/src/components/input-date/partials/variants.tsx +1 -1
- package/src/components/input-date/routes.ts +0 -1
- package/src/components/input-email/basic.tsx +3 -1
- package/src/components/input-email/partials/cases.tsx +1 -1
- package/src/components/input-email/partials/variants.tsx +1 -1
- package/src/components/input-email/routes.ts +0 -1
- package/src/components/input-file/basic.tsx +3 -1
- package/src/components/input-file/partials/cases.tsx +1 -1
- package/src/components/input-file/partials/variants.tsx +1 -1
- package/src/components/input-file/routes.ts +0 -1
- package/src/components/input-number/basic.tsx +17 -2
- package/src/components/input-number/partials/cases.tsx +1 -1
- package/src/components/input-number/partials/variants.tsx +1 -1
- package/src/components/input-number/routes.ts +0 -1
- package/src/components/input-password/basic.tsx +3 -1
- package/src/components/input-password/partials/cases.tsx +1 -1
- package/src/components/input-password/partials/variants.tsx +1 -1
- package/src/components/input-password/routes.ts +0 -1
- package/src/components/input-password/show-password.tsx +3 -1
- package/src/components/input-radio/basic.tsx +3 -1
- package/src/components/input-radio/horizontal.tsx +4 -2
- package/src/components/input-radio/partials/cases.tsx +1 -1
- package/src/components/input-radio/partials/variants.tsx +1 -1
- package/src/components/input-radio/routes.ts +0 -2
- package/src/components/input-radio/select.tsx +3 -2
- package/src/components/input-range/basic.tsx +3 -1
- package/src/components/input-range/partials/cases.tsx +1 -1
- package/src/components/input-range/partials/variants.tsx +1 -1
- package/src/components/input-range/routes.ts +0 -1
- package/src/components/input-text/basic.tsx +3 -1
- package/src/components/input-text/blur.tsx +3 -1
- package/src/components/input-text/focus.tsx +2 -1
- package/src/components/input-text/hide-errors.tsx +25 -0
- package/src/components/input-text/partials/cases.tsx +1 -1
- package/src/components/input-text/partials/variants.tsx +1 -1
- package/src/components/input-text/routes.ts +2 -1
- package/src/components/kolibri/basic.tsx +5 -2
- package/src/components/kolibri/routes.ts +0 -1
- package/src/components/link/basic.tsx +13 -8
- package/src/components/link/icons.tsx +7 -2
- package/src/components/link/image.tsx +5 -4
- package/src/components/link/routes.ts +0 -4
- package/src/components/link/target.tsx +8 -6
- package/src/components/link-button/basic.tsx +3 -4
- package/src/components/link-button/routes.ts +0 -1
- package/src/components/link-group/basic.tsx +6 -4
- package/src/components/link-group/horizontal.tsx +6 -4
- package/src/components/logo/basic.tsx +4 -2
- package/src/components/logo/routes.ts +0 -1
- package/src/components/modal/basic.tsx +3 -1
- package/src/components/modal/routes.ts +0 -1
- package/src/components/nav/aria-current.tsx +4 -3
- package/src/components/nav/basic.tsx +22 -4
- package/src/components/nav/horizontal.tsx +2 -1
- package/src/components/nav/links.ts +17 -17
- package/src/components/pagination/basic.tsx +2 -1
- package/src/components/pagination/routes.ts +0 -1
- package/src/components/progress/basic.tsx +2 -1
- package/src/components/progress/routes.ts +0 -1
- package/src/components/quote/basic.tsx +3 -1
- package/src/components/quote/block.tsx +3 -1
- package/src/components/quote/routes.ts +0 -1
- package/src/components/select/basic.tsx +3 -1
- package/src/components/select/partials/cases.tsx +3 -3
- package/src/components/select/partials/variants.tsx +1 -1
- package/src/components/select/routes.ts +0 -1
- package/src/components/skip-nav/basic.tsx +4 -1
- package/src/components/skip-nav/routes.ts +0 -1
- package/src/components/spin/basic.tsx +2 -1
- package/src/components/spin/custom.tsx +4 -2
- package/src/components/spin/cycle.tsx +2 -1
- package/src/components/spin/routes.ts +0 -1
- package/src/components/split-button/basic.tsx +3 -1
- package/src/components/table/badge-size.tsx +5 -3
- package/src/components/table/column-alignment.tsx +4 -2
- package/src/components/table/horizontal-scrollbar.tsx +4 -2
- package/src/components/table/pagination-position.tsx +8 -4
- package/src/components/table/render-cell.tsx +4 -3
- package/src/components/table/routes.ts +2 -3
- package/src/components/table/sort-data.tsx +6 -3
- package/src/components/table/with-pagination.tsx +6 -3
- package/src/components/tabs/basic.tsx +3 -1
- package/src/components/tabs/icons-only.tsx +3 -1
- package/src/components/tabs/routes.ts +0 -1
- package/src/components/textarea/adjust-height.tsx +2 -1
- package/src/components/textarea/basic.tsx +3 -1
- package/src/components/textarea/counter.tsx +3 -1
- package/src/components/textarea/disabled.tsx +2 -1
- package/src/components/textarea/partials/cases.tsx +2 -1
- package/src/components/textarea/partials/variants.tsx +1 -1
- package/src/components/textarea/placeholder.tsx +2 -1
- package/src/components/textarea/readonly.tsx +2 -1
- package/src/components/textarea/resize.tsx +2 -1
- package/src/components/textarea/routes.ts +2 -9
- package/src/components/textarea/rows.tsx +3 -2
- package/src/components/toast/basic.tsx +4 -1
- package/src/components/tree/basic.tsx +72 -0
- package/src/components/tree/routes.ts +9 -0
- package/src/components/types.tsx +14 -13
- package/src/components/version/basic.tsx +2 -1
- package/src/components/version/context.tsx +2 -1
- package/src/components/version/routes.ts +0 -2
- package/src/hooks/useSetCurrentLocation.ts +2 -1
- package/src/main.ts +0 -2
- package/src/react.main.tsx +3 -2
- package/src/scenarios/appointment-form/AppointmentForm.tsx +21 -12
- package/src/scenarios/appointment-form/AvailableAppointmentsForm.tsx +13 -13
- package/src/scenarios/appointment-form/DistrictForm.tsx +13 -13
- package/src/scenarios/appointment-form/PersonalInformationForm.tsx +25 -7
- package/src/scenarios/appointment-form/Summary.tsx +4 -2
- package/src/scenarios/appointment-form/formUtils.ts +8 -0
- package/src/scenarios/complex-form/kopfdaten/component.tsx +2 -1
- package/src/scenarios/complex-form/location/component.tsx +3 -2
- package/src/scenarios/complex-form/schedule/component.tsx +1 -0
- package/src/scenarios/custom-tooltip-width.tsx +3 -1
- package/src/scenarios/inputs-get-value.tsx +6 -3
- package/src/scenarios/routes.ts +4 -2
- package/src/scenarios/static-form.tsx +78 -0
- package/src/shares/randomEmoji.ts +4 -0
- package/src/shares/routes.ts +2 -0
- package/src/shares/store.ts +3 -3
- package/dist/1090.js +0 -2
- package/dist/1181.js +0 -2
- package/dist/1218.js +0 -2
- package/dist/1338.js +0 -2
- package/dist/1517.js +0 -2
- package/dist/1596.js +0 -2
- package/dist/2163.js +0 -2
- package/dist/2415.js +0 -2
- package/dist/2594.js +0 -2
- package/dist/2611.js +0 -2
- package/dist/2643.js +0 -2
- package/dist/3099.js +0 -2
- package/dist/3145.js +0 -2
- package/dist/3345.js +0 -2
- package/dist/3466.js +0 -2
- package/dist/3580.js +0 -2
- package/dist/3619.js +0 -2
- package/dist/3776.js +0 -2
- package/dist/4150.js +0 -2
- package/dist/42.js +0 -2
- package/dist/4463.js +0 -2
- package/dist/4686.js +0 -2
- package/dist/4756.js +0 -2
- package/dist/5027.js +0 -2
- package/dist/521.js +0 -2
- package/dist/5373.js +0 -2
- package/dist/5518.js +0 -2
- package/dist/5853.js +0 -2
- package/dist/6010.js +0 -2
- package/dist/6308.js +0 -2
- package/dist/7170.js +0 -2
- package/dist/755.js +0 -2
- package/dist/7654.js +0 -2
- package/dist/8037.js +0 -1
- package/dist/817.js +0 -2
- package/dist/881.js +0 -2
- package/dist/892.js +0 -2
- package/dist/8948.js +0 -2
- package/dist/8951.js +0 -2
- package/dist/9227.js +0 -2
- package/dist/9317.js +0 -2
- package/dist/9670.js +0 -2
- package/dist/9700.js +0 -2
- package/dist/9727.js +0 -2
- package/dist/9797.js +0 -2
- package/dist/9912.js +0 -2
- package/src/scenarios/appointment-form/ErrorList.tsx +0 -35
- /package/dist/{1090.js.LICENSE.txt → 104.js.LICENSE.txt} +0 -0
- /package/dist/{1181.js.LICENSE.txt → 1296.js.LICENSE.txt} +0 -0
- /package/dist/{1218.js.LICENSE.txt → 1461.js.LICENSE.txt} +0 -0
- /package/dist/{1338.js.LICENSE.txt → 1684.js.LICENSE.txt} +0 -0
- /package/dist/{1517.js.LICENSE.txt → 1685.js.LICENSE.txt} +0 -0
- /package/dist/{1596.js.LICENSE.txt → 1888.js.LICENSE.txt} +0 -0
- /package/dist/{2079.js.LICENSE.txt → 1892.js.LICENSE.txt} +0 -0
- /package/dist/{2163.js.LICENSE.txt → 2120.js.LICENSE.txt} +0 -0
- /package/dist/{2415.js.LICENSE.txt → 2240.js.LICENSE.txt} +0 -0
- /package/dist/{2594.js.LICENSE.txt → 2364.js.LICENSE.txt} +0 -0
- /package/dist/{2611.js.LICENSE.txt → 2392.js.LICENSE.txt} +0 -0
- /package/dist/{2643.js.LICENSE.txt → 2444.js.LICENSE.txt} +0 -0
- /package/dist/{3034.js.LICENSE.txt → 2628.js.LICENSE.txt} +0 -0
- /package/dist/{3099.js.LICENSE.txt → 2740.js.LICENSE.txt} +0 -0
- /package/dist/{3145.js.LICENSE.txt → 2764.js.LICENSE.txt} +0 -0
- /package/dist/{3345.js.LICENSE.txt → 2782.js.LICENSE.txt} +0 -0
- /package/dist/{3388.js.LICENSE.txt → 2812.js.LICENSE.txt} +0 -0
- /package/dist/{3466.js.LICENSE.txt → 2984.js.LICENSE.txt} +0 -0
- /package/dist/{3580.js.LICENSE.txt → 3200.js.LICENSE.txt} +0 -0
- /package/dist/{3600.js.LICENSE.txt → 3204.js.LICENSE.txt} +0 -0
- /package/dist/{3619.js.LICENSE.txt → 3384.js.LICENSE.txt} +0 -0
- /package/dist/{3776.js.LICENSE.txt → 352.js.LICENSE.txt} +0 -0
- /package/dist/{3845.js.LICENSE.txt → 3564.js.LICENSE.txt} +0 -0
- /package/dist/{4150.js.LICENSE.txt → 3920.js.LICENSE.txt} +0 -0
- /package/dist/{42.js.LICENSE.txt → 4064.js.LICENSE.txt} +0 -0
- /package/dist/{4279.js.LICENSE.txt → 4544.js.LICENSE.txt} +0 -0
- /package/dist/{4463.js.LICENSE.txt → 4728.js.LICENSE.txt} +0 -0
- /package/dist/{4669.js.LICENSE.txt → 4915.js.LICENSE.txt} +0 -0
- /package/dist/{4686.js.LICENSE.txt → 4988.js.LICENSE.txt} +0 -0
- /package/dist/{4756.js.LICENSE.txt → 5376.js.LICENSE.txt} +0 -0
- /package/dist/{5027.js.LICENSE.txt → 5456.js.LICENSE.txt} +0 -0
- /package/dist/{521.js.LICENSE.txt → 5628.js.LICENSE.txt} +0 -0
- /package/dist/{5324.js.LICENSE.txt → 5744.js.LICENSE.txt} +0 -0
- /package/dist/{5373.js.LICENSE.txt → 5768.js.LICENSE.txt} +0 -0
- /package/dist/{5518.js.LICENSE.txt → 5839.js.LICENSE.txt} +0 -0
- /package/dist/{5853.js.LICENSE.txt → 5956.js.LICENSE.txt} +0 -0
- /package/dist/{6010.js.LICENSE.txt → 5972.js.LICENSE.txt} +0 -0
- /package/dist/{6308.js.LICENSE.txt → 6040.js.LICENSE.txt} +0 -0
- /package/dist/{7170.js.LICENSE.txt → 6112.js.LICENSE.txt} +0 -0
- /package/dist/{755.js.LICENSE.txt → 6476.js.LICENSE.txt} +0 -0
- /package/dist/{7654.js.LICENSE.txt → 6488.js.LICENSE.txt} +0 -0
- /package/dist/{817.js.LICENSE.txt → 7192.js.LICENSE.txt} +0 -0
- /package/dist/{8612.js.LICENSE.txt → 7312.js.LICENSE.txt} +0 -0
- /package/dist/{8734.js.LICENSE.txt → 736.js.LICENSE.txt} +0 -0
- /package/dist/{881.js.LICENSE.txt → 7496.js.LICENSE.txt} +0 -0
- /package/dist/{8869.js.LICENSE.txt → 7508.js.LICENSE.txt} +0 -0
- /package/dist/{892.js.LICENSE.txt → 7596.js.LICENSE.txt} +0 -0
- /package/dist/{8948.js.LICENSE.txt → 7712.js.LICENSE.txt} +0 -0
- /package/dist/{8951.js.LICENSE.txt → 7804.js.LICENSE.txt} +0 -0
- /package/dist/{9227.js.LICENSE.txt → 7808.js.LICENSE.txt} +0 -0
- /package/dist/{9317.js.LICENSE.txt → 80.js.LICENSE.txt} +0 -0
- /package/dist/{9330.js.LICENSE.txt → 8188.js.LICENSE.txt} +0 -0
- /package/dist/{9670.js.LICENSE.txt → 8232.js.LICENSE.txt} +0 -0
- /package/dist/{9700.js.LICENSE.txt → 8248.js.LICENSE.txt} +0 -0
- /package/dist/{9727.js.LICENSE.txt → 828.js.LICENSE.txt} +0 -0
- /package/dist/{9797.js.LICENSE.txt → 8476.js.LICENSE.txt} +0 -0
- /package/dist/{9865.js.LICENSE.txt → 8524.js.LICENSE.txt} +0 -0
- /package/dist/{9886.js.LICENSE.txt → 9072.js.LICENSE.txt} +0 -0
- /package/dist/{9912.js.LICENSE.txt → 9088.js.LICENSE.txt} +0 -0
package/src/components/types.tsx
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { FormWrap } from './FormWrap';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
2
|
+
|
|
3
|
+
import type { ButtonVariants } from './button/partials/variants';
|
|
4
|
+
import type { InputCheckboxVariants } from './input-checkbox/partials/variants';
|
|
5
|
+
import type { InputColorVariants } from './input-color/partials/variants';
|
|
6
|
+
import type { InputDateVariants } from './input-date/partials/variants';
|
|
7
|
+
import type { InputEmailVariants } from './input-email/partials/variants';
|
|
8
|
+
import type { InputFileVariants } from './input-file/partials/variants';
|
|
9
|
+
import type { InputNumberVariants } from './input-number/partials/variants';
|
|
10
|
+
import type { InputPasswordVariants } from './input-password/partials/variants';
|
|
11
|
+
import type { InputRadioVariants } from './input-radio/partials/variants';
|
|
12
|
+
import type { InputRangeVariants } from './input-range/partials/variants';
|
|
13
|
+
import type { InputTextVariants } from './input-text/partials/variants';
|
|
14
|
+
import type { SelectVariants } from './select/partials/variants';
|
|
15
|
+
import type { TextareaVariants } from './textarea/partials/variants';
|
|
15
16
|
|
|
16
17
|
export type RefFormComponent =
|
|
17
18
|
| typeof InputCheckboxVariants
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { setCurrentLocation } from '@public-ui/components';
|
|
2
1
|
import { useLocation } from 'react-router';
|
|
3
2
|
|
|
3
|
+
import { setCurrentLocation } from '@public-ui/components';
|
|
4
|
+
|
|
4
5
|
export const useSetCurrentLocation = () => {
|
|
5
6
|
const routerLocation = useLocation();
|
|
6
7
|
setCurrentLocation('#' + routerLocation.pathname);
|
package/src/main.ts
CHANGED
package/src/react.main.tsx
CHANGED
|
@@ -2,12 +2,13 @@ import React, { StrictMode } from 'react';
|
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import { HashRouter as Router } from 'react-router-dom';
|
|
4
4
|
|
|
5
|
-
import { defineCustomElements } from '@public-ui/components/dist/loader';
|
|
6
|
-
import type { Generic } from 'adopted-style-sheets';
|
|
7
5
|
import { register } from '@public-ui/components';
|
|
6
|
+
import { defineCustomElements } from '@public-ui/components/dist/loader';
|
|
8
7
|
import { BMF, DEFAULT, ECL_EC, ECL_EU, ITZBund } from '@public-ui/themes';
|
|
8
|
+
|
|
9
9
|
import { App } from './App';
|
|
10
10
|
|
|
11
|
+
import type { Generic } from 'adopted-style-sheets';
|
|
11
12
|
type Theme = Generic.Theming.RegisterPatch<string, string, string>;
|
|
12
13
|
|
|
13
14
|
void (async () => {
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Formik } from 'formik';
|
|
2
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
3
|
+
import * as Yup from 'yup';
|
|
4
|
+
|
|
2
5
|
import { KolTabs } from '@public-ui/react';
|
|
6
|
+
|
|
7
|
+
import { checkAppointmentAvailability } from './appointmentService';
|
|
8
|
+
import { AvailableAppointmentsForm } from './AvailableAppointmentsForm';
|
|
3
9
|
import { DistrictForm } from './DistrictForm';
|
|
4
|
-
import { Summary } from './Summary';
|
|
5
10
|
import { PersonalInformationForm } from './PersonalInformationForm';
|
|
6
|
-
import {
|
|
7
|
-
import * as Yup from 'yup';
|
|
8
|
-
import { AvailableAppointmentsForm } from './AvailableAppointmentsForm';
|
|
9
|
-
import { Iso8601 } from '@public-ui/components';
|
|
10
|
-
import { checkAppointmentAvailability } from './appointmentService';
|
|
11
|
+
import { Summary } from './Summary';
|
|
11
12
|
|
|
13
|
+
import type { FormikHelpers, FormikProps } from 'formik';
|
|
14
|
+
import type { Iso8601 } from '@public-ui/components';
|
|
12
15
|
// export interface FormProps {}
|
|
13
16
|
export interface FormValues {
|
|
14
17
|
district: string;
|
|
@@ -46,12 +49,12 @@ const districtSchema = {
|
|
|
46
49
|
};
|
|
47
50
|
const personalInformationSchema = {
|
|
48
51
|
salutation: Yup.string().required('Bitte Anrede auswählen.'),
|
|
49
|
-
name: Yup.string().required('Bitte
|
|
52
|
+
name: Yup.string().required('Bitte Vor- und Zuname eingeben.'),
|
|
50
53
|
company: Yup.string().when('salutation', {
|
|
51
54
|
is: (salutation: string) => salutation === 'Firma',
|
|
52
|
-
then: (schema) => schema.required('Bitte
|
|
55
|
+
then: (schema) => schema.required('Bitte Firma angeben.'),
|
|
53
56
|
}),
|
|
54
|
-
email: Yup.string().required('Bitte E-Mail
|
|
57
|
+
email: Yup.string().required('Bitte E-Mail eingeben.'),
|
|
55
58
|
};
|
|
56
59
|
const availableAppointmentsSchema = {
|
|
57
60
|
date: Yup.string().required('Bitte Datum eingeben.'),
|
|
@@ -64,6 +67,7 @@ const availableAppointmentsSchema = {
|
|
|
64
67
|
export function AppointmentForm() {
|
|
65
68
|
const [activeFormSection, setActiveFormSection] = useState(FormSection.DISTRICT);
|
|
66
69
|
const [selectedTab, setSelectedTab] = useState(activeFormSection);
|
|
70
|
+
const formikRef = useRef<FormikProps<FormValues>>(null);
|
|
67
71
|
|
|
68
72
|
const validationSchema = Yup.object().shape({
|
|
69
73
|
...(activeFormSection === FormSection.DISTRICT ? districtSchema : {}),
|
|
@@ -86,7 +90,7 @@ export function AppointmentForm() {
|
|
|
86
90
|
};
|
|
87
91
|
|
|
88
92
|
return (
|
|
89
|
-
<Formik<FormValues> initialValues={initialValues} validationSchema={validationSchema} onSubmit={handleSubmit}>
|
|
93
|
+
<Formik<FormValues> innerRef={formikRef} initialValues={initialValues} validationSchema={validationSchema} onSubmit={handleSubmit}>
|
|
90
94
|
<KolTabs
|
|
91
95
|
_tabs={[
|
|
92
96
|
{
|
|
@@ -107,7 +111,12 @@ export function AppointmentForm() {
|
|
|
107
111
|
]}
|
|
108
112
|
_label="Formular-Navigation"
|
|
109
113
|
_selected={selectedTab}
|
|
110
|
-
_on={{
|
|
114
|
+
_on={{
|
|
115
|
+
onSelect: (_event, selectedTab) => {
|
|
116
|
+
setActiveFormSection(selectedTab);
|
|
117
|
+
formikRef.current?.setErrors({});
|
|
118
|
+
},
|
|
119
|
+
}}
|
|
111
120
|
>
|
|
112
121
|
<div>
|
|
113
122
|
<DistrictForm />
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { Field, useFormikContext } from 'formik';
|
|
1
2
|
import React, { useEffect, useState } from 'react';
|
|
3
|
+
|
|
2
4
|
import { KolButton, KolForm, KolHeading, KolInputDate, KolInputRadio, KolSpin } from '@public-ui/react';
|
|
3
|
-
|
|
4
|
-
import { ErrorList } from './ErrorList';
|
|
5
|
-
import { Field, FieldProps, useFormikContext } from 'formik';
|
|
5
|
+
|
|
6
6
|
import { fetchAvailableTimes } from './appointmentService';
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import type { FormValues } from './AppointmentForm';
|
|
9
|
+
import type { FieldProps } from 'formik';
|
|
10
|
+
import type { Option } from '@public-ui/components';
|
|
11
|
+
import { createErrorList } from './formUtils';
|
|
8
12
|
|
|
9
13
|
export function AvailableAppointmentsForm() {
|
|
10
14
|
const form = useFormikContext<FormValues>();
|
|
@@ -12,6 +16,8 @@ export function AvailableAppointmentsForm() {
|
|
|
12
16
|
const [sectionSubmitted, setSectionSubmitted] = useState(false);
|
|
13
17
|
const [availableTimes, setAvailableTimes] = useState<Option<string>[] | null>(null);
|
|
14
18
|
|
|
19
|
+
const errorList = createErrorList(form.errors);
|
|
20
|
+
|
|
15
21
|
useEffect(() => {
|
|
16
22
|
let ignoreResponse = false;
|
|
17
23
|
setAvailableTimes(null);
|
|
@@ -36,18 +42,12 @@ export function AvailableAppointmentsForm() {
|
|
|
36
42
|
return (
|
|
37
43
|
<div className="p-2">
|
|
38
44
|
<KolHeading _level={2} _label="Wählen Sie einen Termin aus"></KolHeading>
|
|
39
|
-
|
|
40
|
-
{sectionSubmitted && Object.keys(form.errors).length ? (
|
|
41
|
-
<div className="mt-2">
|
|
42
|
-
<ErrorList errors={form.errors} />
|
|
43
|
-
</div>
|
|
44
|
-
) : null}
|
|
45
|
-
|
|
46
45
|
<KolForm
|
|
46
|
+
_errorList={sectionSubmitted ? errorList : []}
|
|
47
47
|
_on={{
|
|
48
48
|
onSubmit: () => {
|
|
49
|
-
void form.submitForm();
|
|
50
49
|
setSectionSubmitted(true);
|
|
50
|
+
void form.submitForm();
|
|
51
51
|
},
|
|
52
52
|
}}
|
|
53
53
|
>
|
|
@@ -81,7 +81,7 @@ export function AvailableAppointmentsForm() {
|
|
|
81
81
|
<Field name="time">
|
|
82
82
|
{({ field }: FieldProps<FormValues['time']>) => (
|
|
83
83
|
<KolInputRadio
|
|
84
|
-
id="field-
|
|
84
|
+
id="field-time"
|
|
85
85
|
_label="Zeit"
|
|
86
86
|
_orientation="horizontal"
|
|
87
87
|
_options={availableTimes}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Field, useFormikContext } from 'formik';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
|
|
2
4
|
import { KolButton, KolForm, KolHeading, KolSelect } from '@public-ui/react';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
5
|
+
|
|
6
|
+
import type { FieldProps } from 'formik';
|
|
7
|
+
import type { FormValues } from './AppointmentForm';
|
|
8
|
+
import { createErrorList } from './formUtils';
|
|
6
9
|
|
|
7
10
|
const LOCATION_OPTIONS = [
|
|
8
11
|
{
|
|
@@ -30,22 +33,17 @@ const LOCATION_OPTIONS = [
|
|
|
30
33
|
export function DistrictForm() {
|
|
31
34
|
const form = useFormikContext<FormValues>();
|
|
32
35
|
const errorList = createErrorList(form.errors);
|
|
33
|
-
|
|
34
|
-
function createErrorList(formikErrors: Record<string, string>): ErrorListPropType[] {
|
|
35
|
-
return Object.keys(formikErrors).map((fieldName) => ({
|
|
36
|
-
message: formikErrors[fieldName],
|
|
37
|
-
selector: `#field-${fieldName}`,
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
36
|
+
const [sectionSubmitted, setSectionSubmitted] = useState(false);
|
|
40
37
|
|
|
41
38
|
return (
|
|
42
39
|
<div className="p-2">
|
|
43
40
|
<KolHeading _level={2} _label="Wählen Sie einen Stadtteil aus"></KolHeading>
|
|
44
41
|
<KolForm
|
|
45
|
-
_errorList={errorList}
|
|
42
|
+
_errorList={sectionSubmitted ? errorList : []}
|
|
46
43
|
_on={{
|
|
47
44
|
onSubmit: () => {
|
|
48
45
|
void form.submitForm();
|
|
46
|
+
setSectionSubmitted(true);
|
|
49
47
|
},
|
|
50
48
|
}}
|
|
51
49
|
>
|
|
@@ -59,12 +57,14 @@ export function DistrictForm() {
|
|
|
59
57
|
_error={form.errors.district || ''}
|
|
60
58
|
_touched={form.touched.district}
|
|
61
59
|
_required
|
|
60
|
+
onBlur={() => {
|
|
61
|
+
void form.setFieldTouched('district', true);
|
|
62
|
+
}}
|
|
62
63
|
_on={{
|
|
63
64
|
onChange: (event, values: unknown) => {
|
|
64
65
|
// Select und Radio setzen den Wert immer initial.
|
|
65
66
|
if (event.target) {
|
|
66
67
|
const [value] = values as [FormValues['district']];
|
|
67
|
-
void form.setFieldTouched('district', true);
|
|
68
68
|
void form.setFieldValue('district', value, true);
|
|
69
69
|
}
|
|
70
70
|
},
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { Field, useFormikContext } from 'formik';
|
|
1
2
|
import React, { useState } from 'react';
|
|
3
|
+
|
|
2
4
|
import { KolButton, KolForm, KolHeading, KolInputEmail, KolInputText, KolSelect } from '@public-ui/react';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
+
|
|
6
|
+
import type { FieldProps } from 'formik';
|
|
7
|
+
import type { FormValues } from './AppointmentForm';
|
|
8
|
+
import { createErrorList } from './formUtils';
|
|
5
9
|
|
|
6
10
|
const SALUTATION_OPTIONS = [
|
|
7
11
|
{
|
|
@@ -25,12 +29,13 @@ const SALUTATION_OPTIONS = [
|
|
|
25
29
|
export function PersonalInformationForm() {
|
|
26
30
|
const form = useFormikContext<FormValues>();
|
|
27
31
|
const [sectionSubmitted, setSectionSubmitted] = useState(false);
|
|
32
|
+
const errorList = createErrorList(form.errors);
|
|
28
33
|
|
|
29
34
|
return (
|
|
30
35
|
<div className="p-2">
|
|
31
36
|
<KolHeading _level={2} _label="Geben Sie Ihre Kontaktdaten ein"></KolHeading>
|
|
32
|
-
<ul>{sectionSubmitted && Object.entries(form.errors).map(([field, error]) => <li key={field}>{error}</li>)}</ul>
|
|
33
37
|
<KolForm
|
|
38
|
+
_errorList={sectionSubmitted ? errorList : []}
|
|
34
39
|
_on={{
|
|
35
40
|
onSubmit: () => {
|
|
36
41
|
void form.submitForm();
|
|
@@ -41,6 +46,10 @@ export function PersonalInformationForm() {
|
|
|
41
46
|
<Field name="salutation">
|
|
42
47
|
{({ field }: FieldProps<FormValues['salutation']>) => (
|
|
43
48
|
<KolSelect
|
|
49
|
+
onBlur={() => {
|
|
50
|
+
void form.setFieldTouched('salutation', true);
|
|
51
|
+
}}
|
|
52
|
+
id="field-salutation"
|
|
44
53
|
_label="Anrede"
|
|
45
54
|
_value={[field.value]}
|
|
46
55
|
_error={form.errors.salutation || ''}
|
|
@@ -51,7 +60,6 @@ export function PersonalInformationForm() {
|
|
|
51
60
|
onChange: (event, values: unknown) => {
|
|
52
61
|
if (event.target) {
|
|
53
62
|
const [value] = values as [FormValues['salutation']];
|
|
54
|
-
void form.setFieldTouched('salutation', true);
|
|
55
63
|
void form.setFieldValue('salutation', value, true);
|
|
56
64
|
}
|
|
57
65
|
},
|
|
@@ -65,6 +73,10 @@ export function PersonalInformationForm() {
|
|
|
65
73
|
{({ field }: FieldProps<FormValues['company']>) => (
|
|
66
74
|
<div className="block mt-2">
|
|
67
75
|
<KolInputText
|
|
76
|
+
onBlur={() => {
|
|
77
|
+
void form.setFieldTouched('company', true);
|
|
78
|
+
}}
|
|
79
|
+
id="field-company"
|
|
68
80
|
_label="Firma"
|
|
69
81
|
_value={field.value}
|
|
70
82
|
_error={form.errors.company || ''}
|
|
@@ -73,7 +85,6 @@ export function PersonalInformationForm() {
|
|
|
73
85
|
_on={{
|
|
74
86
|
onChange: (event, value: unknown) => {
|
|
75
87
|
if (event.target) {
|
|
76
|
-
void form.setFieldTouched('company', true);
|
|
77
88
|
void form.setFieldValue('company', value, true);
|
|
78
89
|
}
|
|
79
90
|
},
|
|
@@ -88,6 +99,10 @@ export function PersonalInformationForm() {
|
|
|
88
99
|
{({ field }: FieldProps<FormValues['name']>) => (
|
|
89
100
|
<div className="block mt-2">
|
|
90
101
|
<KolInputText
|
|
102
|
+
onBlur={() => {
|
|
103
|
+
void form.setFieldTouched('name', true);
|
|
104
|
+
}}
|
|
105
|
+
id="field-name"
|
|
91
106
|
_label="Vor- und Zuname"
|
|
92
107
|
_value={field.value}
|
|
93
108
|
_error={form.errors.name || ''}
|
|
@@ -96,7 +111,6 @@ export function PersonalInformationForm() {
|
|
|
96
111
|
_on={{
|
|
97
112
|
onChange: (event, value: unknown) => {
|
|
98
113
|
if (event.target) {
|
|
99
|
-
void form.setFieldTouched('name', true);
|
|
100
114
|
void form.setFieldValue('name', value, true);
|
|
101
115
|
}
|
|
102
116
|
},
|
|
@@ -110,6 +124,10 @@ export function PersonalInformationForm() {
|
|
|
110
124
|
{({ field }: FieldProps<FormValues['email']>) => (
|
|
111
125
|
<div className="block mt-2">
|
|
112
126
|
<KolInputEmail
|
|
127
|
+
onBlur={() => {
|
|
128
|
+
void form.setFieldTouched('email', true);
|
|
129
|
+
}}
|
|
130
|
+
id="field-email"
|
|
113
131
|
_label="E-Mail"
|
|
114
132
|
_value={field.value}
|
|
115
133
|
_error={form.errors.email || ''}
|
|
@@ -118,7 +136,6 @@ export function PersonalInformationForm() {
|
|
|
118
136
|
_on={{
|
|
119
137
|
onChange: (event, value: unknown) => {
|
|
120
138
|
if (event.target) {
|
|
121
|
-
void form.setFieldTouched('email', true);
|
|
122
139
|
void form.setFieldValue('email', value, true);
|
|
123
140
|
}
|
|
124
141
|
},
|
|
@@ -132,6 +149,7 @@ export function PersonalInformationForm() {
|
|
|
132
149
|
{({ field }: FieldProps<FormValues['phone']>) => (
|
|
133
150
|
<div className="block mt-2">
|
|
134
151
|
<KolInputText
|
|
152
|
+
id="field-phone"
|
|
135
153
|
_type="tel"
|
|
136
154
|
_label="Telefonnumer"
|
|
137
155
|
_value={field.value}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { useFormikContext } from 'formik';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
3
4
|
import { KolHeading } from '@public-ui/react';
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
import type { FormValues } from './AppointmentForm';
|
|
5
7
|
|
|
6
8
|
const ValueFallback = () => <i>Nicht angegeben</i>;
|
|
7
9
|
const ValueWithFallback = ({ value }: { value: string }) => (value ? value : <ValueFallback />);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ErrorListPropType } from '@public-ui/components';
|
|
2
|
+
|
|
3
|
+
export function createErrorList(formikErrors: Record<string, string>): ErrorListPropType[] {
|
|
4
|
+
return Object.keys(formikErrors).map((fieldName) => ({
|
|
5
|
+
message: formikErrors[fieldName],
|
|
6
|
+
selector: `#field-${fieldName}`,
|
|
7
|
+
}));
|
|
8
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
|
|
3
3
|
import { KolAbbr, KolButton, KolInputEmail, KolInputRadio, KolInputText, KolSpin } from '@public-ui/react';
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { FromComponent } from '../common/form/component';
|
|
6
|
+
import { FormProps } from '../common/form/types';
|
|
6
7
|
|
|
7
8
|
export const TerminKopfdatenComponent: FC<FormProps> = (props) => (
|
|
8
9
|
<FromComponent submitted={true} onSubmit={() => {}}>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
|
|
3
3
|
import { KolButton, KolSelect, KolSpin } from '@public-ui/react';
|
|
4
|
-
|
|
5
|
-
import { FormProps } from '../common/form/types';
|
|
4
|
+
|
|
6
5
|
import { FromComponent } from '../common/form/component';
|
|
6
|
+
import { FormProps } from '../common/form/types';
|
|
7
|
+
import { LOCATION_OPTIONS } from './location.form';
|
|
7
8
|
|
|
8
9
|
export const TerminLocationComponent: FC<FormProps> = () => (
|
|
9
10
|
<FromComponent submitted={true} onSubmit={() => {}}>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
|
|
3
4
|
import {
|
|
4
5
|
KolButton,
|
|
6
|
+
KolButtonLink,
|
|
5
7
|
KolInputCheckbox,
|
|
6
8
|
KolInputColor,
|
|
7
9
|
KolInputDate,
|
|
@@ -14,10 +16,11 @@ import {
|
|
|
14
16
|
KolInputText,
|
|
15
17
|
KolSelect,
|
|
16
18
|
KolTextarea,
|
|
17
|
-
KolButtonLink,
|
|
18
19
|
} from '@public-ui/react';
|
|
20
|
+
|
|
19
21
|
import { SampleDescription } from '../components/SampleDescription';
|
|
20
22
|
|
|
23
|
+
import type { HTMLStencilElement } from '@stencil/core/internal';
|
|
21
24
|
const EventTargetContext = createContext<EventTarget | undefined>(undefined);
|
|
22
25
|
|
|
23
26
|
type Props = {
|
package/src/scenarios/routes.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Routes } from '../shares/types';
|
|
2
|
-
import { TerminComponent } from './complex-form/component';
|
|
3
2
|
import { AppointmentForm } from './appointment-form/AppointmentForm';
|
|
4
|
-
import {
|
|
3
|
+
import { TerminComponent } from './complex-form/component';
|
|
5
4
|
import { CustomTooltipWidth } from './custom-tooltip-width';
|
|
5
|
+
import { InputsGetValue } from './inputs-get-value';
|
|
6
|
+
import { StaticForm } from './static-form';
|
|
6
7
|
|
|
7
8
|
export const SCENARIO_ROUTES: Routes = {
|
|
8
9
|
scenarios: {
|
|
@@ -10,5 +11,6 @@ export const SCENARIO_ROUTES: Routes = {
|
|
|
10
11
|
'appointment-form': AppointmentForm,
|
|
11
12
|
'inputs-get-value': InputsGetValue,
|
|
12
13
|
'custom-tooltip-width': CustomTooltipWidth,
|
|
14
|
+
'static-form': StaticForm,
|
|
13
15
|
},
|
|
14
16
|
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KolButton,
|
|
3
|
+
KolInputCheckbox,
|
|
4
|
+
KolInputColor,
|
|
5
|
+
KolInputDate,
|
|
6
|
+
KolInputEmail,
|
|
7
|
+
KolInputFile,
|
|
8
|
+
KolInputNumber,
|
|
9
|
+
KolInputPassword,
|
|
10
|
+
KolInputRadio,
|
|
11
|
+
KolInputRange,
|
|
12
|
+
KolInputText,
|
|
13
|
+
KolSelect,
|
|
14
|
+
KolTextarea,
|
|
15
|
+
} from '@public-ui/react';
|
|
16
|
+
import type { FC } from 'react';
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import { SampleDescription } from '../components/SampleDescription';
|
|
19
|
+
|
|
20
|
+
export const StaticForm: FC = () => {
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<SampleDescription>
|
|
24
|
+
<p>This sample shows how you can use KoliBri in static form context, too.</p>
|
|
25
|
+
<ol>
|
|
26
|
+
<li>
|
|
27
|
+
First you have to enable the <code>experimental mode</code>:{' '}
|
|
28
|
+
<code className="bg-gray-200"><meta name="kolibri" content="dev-mode=false;experimental-mode=true;" /></code>
|
|
29
|
+
</li>
|
|
30
|
+
<li>
|
|
31
|
+
Currently you have to use a native <code>form</code> element:{' '}
|
|
32
|
+
<code className="bg-gray-200"><form method="GET">...</form></code>
|
|
33
|
+
</li>
|
|
34
|
+
<li>
|
|
35
|
+
It is important in static usage to give every input a <code>name</code> attribute:{' '}
|
|
36
|
+
<code className="bg-gray-200"><KolInputColor _name="color" _label="Color" /></code>
|
|
37
|
+
</li>
|
|
38
|
+
<li>
|
|
39
|
+
Last of all one button should have the type <code>submit</code>:{' '}
|
|
40
|
+
<code className="bg-gray-200"><KolButton _label="Submit" _type="submit" _variant="primary" /></code>
|
|
41
|
+
</li>
|
|
42
|
+
</ol>
|
|
43
|
+
</SampleDescription>
|
|
44
|
+
<form className="grid gap-4" method="get">
|
|
45
|
+
<KolInputCheckbox _name="checkbox" _label="Checkbox" />
|
|
46
|
+
<KolInputColor _name="color" _label="Color" />
|
|
47
|
+
<KolInputDate _name="date" _label="Date" />
|
|
48
|
+
<KolInputEmail _name="email" _label="Email" />
|
|
49
|
+
<KolInputFile _name="file" _label="File" />
|
|
50
|
+
<KolInputNumber _name="number" _label="Number" />
|
|
51
|
+
<KolInputPassword _name="password" _label="Password" />
|
|
52
|
+
<KolInputRadio
|
|
53
|
+
_name="radio"
|
|
54
|
+
_label="Radio"
|
|
55
|
+
_options={[
|
|
56
|
+
{ label: 'Option A', value: 'A' },
|
|
57
|
+
{ label: 'Option B', value: 'B' },
|
|
58
|
+
]}
|
|
59
|
+
/>
|
|
60
|
+
<KolInputRange _name="range" _label="Range" />
|
|
61
|
+
<KolInputText _name="text" _label="Text" />
|
|
62
|
+
<KolSelect
|
|
63
|
+
_name="select"
|
|
64
|
+
_label="Select"
|
|
65
|
+
_options={[
|
|
66
|
+
{ label: 'Option A', value: 'A' },
|
|
67
|
+
{ label: 'Option B', value: 'B' },
|
|
68
|
+
]}
|
|
69
|
+
/>
|
|
70
|
+
<KolTextarea _name="textarea" _label="Textarea" />
|
|
71
|
+
<div className="flex flex-wrap gap-4">
|
|
72
|
+
<KolButton _label="Submit" _type="submit" _variant="primary" />
|
|
73
|
+
<KolButton _label="Reset" _type="reset" />
|
|
74
|
+
</div>
|
|
75
|
+
</form>
|
|
76
|
+
</>
|
|
77
|
+
);
|
|
78
|
+
};
|
package/src/shares/routes.ts
CHANGED
|
@@ -46,6 +46,7 @@ import { TOAST_ROUTES } from '../components/toast/routes';
|
|
|
46
46
|
import { VERSION_ROUTES } from '../components/version/routes';
|
|
47
47
|
import { SCENARIO_ROUTES } from '../scenarios/routes';
|
|
48
48
|
import { Routes } from './types';
|
|
49
|
+
import { TREE_ROUTES } from '../components/tree/routes';
|
|
49
50
|
|
|
50
51
|
export const ROUTES: Routes = {
|
|
51
52
|
...HANDOUT_ROUTES,
|
|
@@ -94,6 +95,7 @@ export const ROUTES: Routes = {
|
|
|
94
95
|
...TABS_ROUTES,
|
|
95
96
|
...TEXTAREA_ROUTES,
|
|
96
97
|
...TOAST_ROUTES,
|
|
98
|
+
...TREE_ROUTES,
|
|
97
99
|
...VERSION_ROUTES,
|
|
98
100
|
...SCENARIO_ROUTES,
|
|
99
101
|
};
|
package/src/shares/store.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isTheme, Store, Theme } from './theme';
|
|
2
|
-
import PackageJson from '@public-ui/components/package.json';
|
|
3
|
-
import { THEME_OPTIONS } from './theme';
|
|
4
1
|
import { Option } from '@public-ui/components';
|
|
2
|
+
import PackageJson from '@public-ui/components/package.json';
|
|
3
|
+
|
|
4
|
+
import { isTheme, Store, Theme, THEME_OPTIONS } from './theme';
|
|
5
5
|
|
|
6
6
|
const STORE_IDENTIFIER = `public-ui.v${PackageJson.version}`;
|
|
7
7
|
|
package/dist/1090.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 1090.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_public_ui_sample_react=self.webpackChunk_public_ui_sample_react||[]).push([[1090],{1090:(t,n,e)=>{e.r(n),e.d(n,{kol_breadcrumb:()=>s});var i=e(1456),l=e(305),o=e(9443),a=e(8659);const s=class{constructor(t){(0,i.r)(this,t),this.renderLink=(t,n)=>{const e=this.state._links.length-1;return(0,i.h)("li",{key:n},0!==n&&(0,i.h)("kol-icon",{_label:"",_icons:"codicon codicon-chevron-right"}),n===e?(0,i.h)("span",null,t._hideLabel?(0,i.h)("kol-icon",{_label:t._label,_icons:"string"==typeof t._icons?t._icons:"codicon codicon-symbol-event"}):(0,i.h)(i.F,null,t._label)):(0,i.h)("kol-link",Object.assign({},t)))},this._label=void 0,this._links=void 0,this.state={_label:"",_links:[]}}render(){return(0,i.h)(i.H,null,(0,i.h)("nav",{"aria-label":this.state._label},(0,i.h)("ul",null,0===this.state._links.length&&(0,i.h)("li",null,(0,i.h)("kol-icon",{_label:"",_icons:"codicon codicon-home"}),"…"),this.state._links.map(this.renderLink))))}validateLabel(t,n,e=!1){e||(0,o.r)(this.state._label),(0,l.v)(this,t,{required:!0}),(0,l.k)(t),(0,o.a)(this.state._label)}validateLinks(t){(0,a.w)("KolBreadcrumb",this,t)}componentWillLoad(){this.validateLabel(this._label,void 0,!0),this.validateLinks(this._links)}disconnectedCallback(){(0,o.r)(this.state._label)}static get watchers(){return{_label:["validateLabel"],_links:["validateLinks"]}}};s.style={default:"/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n\t:host {\n\t\t/*\n\t\t * Minimum size of interactive elements.\n\t\t */\n\t\t--a11y-min-size: 44px;\n\t\t/*\n\t\t * No element should be used without a background and font color whose contrast ratio has\n\t\t * not been checked. By initially setting the background color to white and the font color\n\t\t * to black, the contrast ratio is ensured and explicit adjustment is forced.\n\t\t */\n\t\tbackground-color: white;\n\t\tcolor: black;\n\t\t/*\n\t\t * Verdana is an accessible font that can be used without requiring additional loading time.\n\t\t */\n\t\tfont-family: Verdana;\n\t}\n\n\t* {\n\t\t/*\n\t\t * This rule enables the word dividing for all texts. That is important for high zoom levels.\n\t\t */\n\t\thyphens: auto;\n\t\t/*\n\t\t * Letter spacing is required for all texts.\n\t\t */\n\t\tletter-spacing: inherit;\n\t\t/*\n\t\t * This rule enables the word dividing for all texts. That is important for high zoom levels.\n\t\t */\n\t\tword-break: break-word;\n\t\t/*\n\t\t * Word spacing is required for all texts.\n\t\t */\n\t\tword-spacing: inherit;\n\t}\n\n\t/*\n\t * All interactive elements should have a minimum size of 44px.\n\t */\n\t/* input:not([type='checkbox'], [type='radio'], [type='range']), */\n\t/* option, */\n\t/* select, */\n\t/* textarea, */\n\t[role='button'],\n\tbutton:not([role='link']),\n\tkol-input .input {\n\t\tmin-height: var(--a11y-min-size);\n\t\tmin-width: var(--a11y-min-size);\n\t}\n\n\t/*\n\t * Some interactive elements should not inherit the font-family and font-size.\n\t */\n\ta,\n\tbutton,\n\th1,\n\th2,\n\th3,\n\th4,\n\th5,\n\th6,\n\tinput,\n\toption,\n\tselect,\n\ttextarea {\n\t\t/*\n\t\t * All elements should inherit the font family from his parent element.\n\t\t */\n\t\tfont-family: inherit;\n\t\t/*\n\t\t * All elements should inherit the font size from his parent element.\n\t\t */\n\t\tfont-size: inherit;\n\t}\n}\n\n/**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n.visually-hidden {\n\tclip: rect(0 0 0 0);\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tposition: absolute;\n\twhite-space: nowrap;\n\twidth: 1px;\n}\n\n@layer kol-global {\n\t/*\n\t * Dieses CSS stellt sicher, dass der Standard-Style\n\t * von A und Button resettet werden.\n\t */\n\t:is(a, button) {\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\twidth: 100%; /* 100% needed for custom width from outside */\n\t}\n\n\t/*\n\t * Ensure elements with hidden attribute to be actually not visible\n\t * @see https://meowni.ca/hidden.is.a.lie.html\n\t */\n\t[hidden] {\n\t\tdisplay: none !important;\n\t}\n}\n\n@layer kol-global {\n\t:host {\n\t\t/*\n\t\t * The max-width is needed to prevent the table from overflowing the\n\t\t * parent node, if the table is wider than the parent node.\n\t\t */\n\t\tmax-width: 100%;\n\t}\n\n\t* {\n\t\t/*\n\t\t * We prefer to box-sizing: border-box for all elements.\n\t\t */\n\t\tbox-sizing: border-box;\n\t}\n\n\t/* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n\tkol-span-wc {\n\t\tdisplay: grid;\n\t\tplace-items: center;\n\t}\n\n\t/* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n\tkol-span-wc > span {\n\t\tdisplay: flex;\n\t\tplace-items: center;\n\t}\n\n\ta,\n\tbutton {\n\t\tcursor: pointer;\n\t}\n\n\t/* This is the text label. */\n\t.icon-only > kol-span-wc > span > span {\n\t\tdisplay: none;\n\t}\n}\n\n@layer kol-component {\n\tli,\n\tul {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tlist-style: none;\n\t\tdisplay: flex;\n\t\tgap: 0.5em;\n\t\tflex-wrap: wrap;\n\t\tplace-items: center;\n\t}\n\n\tkol-icon::part(separator) {\n\t\tfont-weight: 900;\n\t\tfont-size: 0.7em;\n\t}\n\n\tkol-icon::part(separator):before {\n\t\tcontent: '\\f054';\n\t\tfont-family: 'Font Awesome 6 Free';\n\t}\n}\n"}},9443:(t,n,e)=>{e.d(n,{a:()=>l,r:()=>o});const i=new Set;function l(t){i.has(t)?console.error(`There already is a nav element with the label "${t}"`):i.add(t)}function o(t){i.delete(t)}},8659:(t,n,e)=>{e.d(n,{w:()=>l});var i=e(305);const l=(t,n,e)=>{(0,i.l)(n,"_links",(t=>"object"==typeof t&&("string"==typeof t._href||"string"==typeof t._label)),e),(0,i.u)(t,n.state._links.length)}}}]);
|