@uva-glass/component-library 1.62.5 → 1.62.7
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/{ListPlugin-B-2w9EIN.js → ListPlugin-DsPphjdE.js} +2 -2
- package/dist/{ListPlugin-B-2w9EIN.js.map → ListPlugin-DsPphjdE.js.map} +1 -1
- package/dist/RteEditor.module-CHbWzGpE.js +28 -0
- package/dist/RteEditor.module-CHbWzGpE.js.map +1 -0
- package/dist/TablePlugin-hmwPCCLn.js +310 -0
- package/dist/TablePlugin-hmwPCCLn.js.map +1 -0
- package/dist/assets/EditorHeader.css +1 -1
- package/dist/assets/FormInput.css +1 -1
- package/dist/assets/PeriodSelector.css +1 -1
- package/dist/assets/RteEditor.css +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FormInput/FormInput.js +27 -24
- package/dist/components/FormInput/FormInput.js.map +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +32 -33
- package/dist/components/PeriodSelector/PeriodSelector.js.map +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +7 -7
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +75 -75
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.js +3 -3
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/RteEditor.module-XCAFrP3U.js +0 -28
- package/dist/RteEditor.module-XCAFrP3U.js.map +0 -1
- package/dist/TablePlugin-CMsi2UDH.js +0 -308
- package/dist/TablePlugin-CMsi2UDH.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
._form-
|
|
1
|
+
._form-field__container_c9jem_1{align-items:center;display:flex;flex-wrap:wrap}._form-field__container--label-left_c9jem_7{align-items:flex-start;flex-direction:row;gap:1rem;line-height:2.5rem}._form-field__container--label-left_c9jem_7>label:after{line-height:3.6}._form-field__container--label-top_c9jem_18{align-items:flex-start;flex-direction:column;gap:.5rem;line-height:normal}._form-field__input-feedback-container_c9jem_25{display:flex;flex:1;flex-direction:column;line-height:1.5;position:relative;width:100%}._form-field__input-container_c9jem_34{display:flex;flex:1}._form-field__input_c9jem_25{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:1px solid;border-radius:.5rem;color:var(--color-black);flex:1;font-family:inherit;font-size:inherit;height:2.75rem;margin:0 0 .5rem;min-height:2.5rem;padding:0 1rem;text-align:inherit}._form-field__input_c9jem_25::-webkit-outer-spin-button,._form-field__input_c9jem_25::-webkit-inner-spin-button{margin:0}._form-field__input--error_c9jem_60{border-color:var(--color-red-500)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
._period-
|
|
1
|
+
._period-selector__container_10t7p_1{display:flex;flex-wrap:wrap}._period-selector__container--label-left_10t7p_6{flex-direction:row;gap:1rem;line-height:2.5rem}._period-selector__container--label-top_10t7p_12{align-items:flex-start;flex-direction:column;gap:.5rem;line-height:normal}._period-selector__selector-container_10t7p_19{display:flex;flex-direction:column;line-height:1.5}._period-selector__selector-row_10t7p_25{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:.5rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._editor__container_akhe4_1{background-color:var(--color-white);display:flex;flex-direction:column}._editor__header_akhe4_7{align-items:center;display:flex;justify-content:space-between;margin-bottom:.5rem;min-height:1.5rem}._editor__header-word-count_akhe4_15{align-self:flex-end;font-size:.875rem;margin-left:.5rem;text-align:right;white-space:nowrap;width:4.5rem}._editor__header-word-count--alert_akhe4_24{color:var(--color-red-500);font-weight:700}._editor_akhe4_1{border:1px solid var(--color-grey-400);border-radius:4px;margin-bottom:.5rem;padding:.25rem}._editor_akhe4_1:has(._editor__field_akhe4_36:focus-visible){outline:1px solid var(--color-blue-500)}._editor__toolbar_akhe4_40{align-items:center;display:flex;gap:.25rem;justify-content:flex-start;margin-bottom:.25rem;padding:.25rem}._editor__toolbar-button-group_akhe4_49{align-items:center;display:flex;gap:.125rem;justify-content:center}._editor__toolbar-button_akhe4_49{align-items:center;background-color:var(--color-white);border:none;border-radius:.25rem;cursor:pointer;display:flex;font-size:1.1rem;height:2rem;justify-content:center;width:2rem}._editor__toolbar-button_akhe4_49:hover{background-color:var(--color-grey-200);border:1px solid var(--color-grey-500)}._editor__toolbar-button_akhe4_49:focus-visible{outline:.125rem dotted var(--color-cobalt);outline-offset:.125rem;z-index:1}._editor__toolbar-button--active_akhe4_80,._editor__toolbar-button_akhe4_49:active{background-color:var(--color-black);border-color:var(--color-black);color:var(--color-white)}._editor__toolbar-button_akhe4_49:disabled{border-color:var(--color-grey-100);color:var(--color-grey-200);cursor:not-allowed}._editor__toolbar-button_akhe4_49:hover:disabled{background-color:var(--color-grey-100);border-color:var(--color-grey-100);color:var(--color-grey-300);cursor:not-allowed}._editor__toolbar-button--bold_akhe4_100{font-weight:700}._editor__toolbar-button--italic_akhe4_104{font-style:italic}._editor__toolbar-button_akhe4_49:active:hover{color:var(--color-white)}._editor__toolbar-button--active_akhe4_80:hover{color:var(--color-black)}._editor__toolbar-button--active_akhe4_80:disabled{background-color:var(--color-grey-100);border-color:var(--color-grey-100);color:var(--color-grey-300);cursor:not-allowed}._editor__toolbar-button-flyoutwrapper_akhe4_123,._editor__field-wrapper_akhe4_127{position:relative}._editor__field-wrapper_akhe4_127:before{border-top:1px solid var(--color-grey-400);content:"";display:block;height:0;left:-.25rem;position:absolute;top:-.3rem;width:calc(100% + .5rem);z-index:1}._editor__field_akhe4_36{background-color:var(--color-white);margin-top:.5rem;min-height:8rem;overflow-x:hidden;padding:0 .5rem .5rem;position:relative}._editor__field_akhe4_36::-webkit-scrollbar{cursor:default;width:12px}._editor__field_akhe4_36::-webkit-scrollbar-track{background:var(--color-white)}._editor__field_akhe4_36::-webkit-scrollbar-thumb{background-color:var(--color-grey-300);border:3px solid var(--color-white);border-radius:20px;cursor:default}._editor__field_akhe4_36:focus-visible{outline:none}._editor__placeholder_akhe4_172{color:var(--color-grey-300);left:.5rem;pointer-events:none;position:absolute;top:0}._editor__field_akhe4_36 p{margin:0}._editor__text--bold_akhe4_185{font-weight:700}._editor__text--italic_akhe4_189{font-style:italic}._editor__list--ul_akhe4_193,._editor__list--ol_akhe4_194{margin:0;padding:0}._editor__list--ul_akhe4_193>._editor__listitem_akhe4_199{list-style-type:disc;margin-left:1rem}._editor__list--ol_akhe4_194>._editor__listitem_akhe4_199{list-style-type:decimal;margin-left:1rem}._editor__link_akhe4_209{color:var(--color-blue-500);cursor:pointer;text-decoration:underline}._editor__table_akhe4_215{border:1px solid var(--color-grey-300);border-collapse:collapse;margin:.5rem 0;width:100%}._editor__table_akhe4_215 tr{width:100%}._editor__table_akhe4_215 td{border:1px solid var(--color-grey-300);padding:.125rem .25rem;vertical-align:top;width:auto}
|
|
@@ -17,7 +17,7 @@ import "../IconButton/IconButton.js";
|
|
|
17
17
|
import "../Input/Input.js";
|
|
18
18
|
import "../InputField/InputField.js";
|
|
19
19
|
import "react-router-dom";
|
|
20
|
-
import "../../TablePlugin-
|
|
20
|
+
import "../../TablePlugin-hmwPCCLn.js";
|
|
21
21
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
22
22
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
23
23
|
import "../SelectListbox/SelectListbox.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as f, jsx as
|
|
1
|
+
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { c as l } from "../../clsx-OuTLNxxd.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../Buttons/Button.js";
|
|
@@ -15,7 +15,7 @@ import "../IconButton/IconButton.js";
|
|
|
15
15
|
import "../Input/Input.js";
|
|
16
16
|
import "../InputField/InputField.js";
|
|
17
17
|
import "react-router-dom";
|
|
18
|
-
import "../../TablePlugin-
|
|
18
|
+
import "../../TablePlugin-hmwPCCLn.js";
|
|
19
19
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
20
20
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
21
21
|
import "../SelectListbox/SelectListbox.js";
|
|
@@ -23,38 +23,41 @@ import "../SelectListbox/SelectProvider.js";
|
|
|
23
23
|
import "../Sortable/components/SortableItem.js";
|
|
24
24
|
import "../../SortableProvider-BUsvniX7.js";
|
|
25
25
|
import '../../assets/FormInput.css';const r = {
|
|
26
|
-
"form-field__container": "_form-
|
|
27
|
-
"form-field__container--label-left": "_form-field__container--label-
|
|
28
|
-
"form-field__container--label-top": "_form-field__container--label-
|
|
29
|
-
"form-field__input-container": "_form-field__input-
|
|
30
|
-
"form-field__input": "_form-
|
|
31
|
-
"form-field__input
|
|
26
|
+
"form-field__container": "_form-field__container_c9jem_1",
|
|
27
|
+
"form-field__container--label-left": "_form-field__container--label-left_c9jem_7",
|
|
28
|
+
"form-field__container--label-top": "_form-field__container--label-top_c9jem_18",
|
|
29
|
+
"form-field__input-feedback-container": "_form-field__input-feedback-container_c9jem_25",
|
|
30
|
+
"form-field__input-container": "_form-field__input-container_c9jem_34",
|
|
31
|
+
"form-field__input": "_form-field__input_c9jem_25",
|
|
32
|
+
"form-field__input--error": "_form-field__input--error_c9jem_60"
|
|
32
33
|
}, J = ({
|
|
33
34
|
id: t,
|
|
34
|
-
label:
|
|
35
|
-
labelPosition:
|
|
36
|
-
type:
|
|
37
|
-
required:
|
|
38
|
-
notValidatedText:
|
|
35
|
+
label: m,
|
|
36
|
+
labelPosition: c = "top",
|
|
37
|
+
type: _ = "text",
|
|
38
|
+
required: p = !1,
|
|
39
|
+
notValidatedText: i = "",
|
|
39
40
|
onChange: n
|
|
40
41
|
}) => {
|
|
41
|
-
const
|
|
42
|
-
typeof n == "function" && n(
|
|
42
|
+
const a = (e) => ["e", "E", "+", "-"].includes(e.key) && e.preventDefault(), d = (e) => {
|
|
43
|
+
typeof n == "function" && n(e.target.value);
|
|
43
44
|
};
|
|
44
|
-
return /* @__PURE__ */ f("div", { className: l(r["form-field__container"], r[`form-field__container--label-${
|
|
45
|
-
|
|
46
|
-
/* @__PURE__ */ f("div", { className: r["form-field__input-container"], children: [
|
|
47
|
-
/* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ f("div", { className: l(r["form-field__container"], r[`form-field__container--label-${c}`]), children: [
|
|
46
|
+
m && /* @__PURE__ */ o(s, { htmlFor: t, required: p, children: m }),
|
|
47
|
+
/* @__PURE__ */ f("div", { className: r["form-field__input-feedback-container"], children: [
|
|
48
|
+
/* @__PURE__ */ o("div", { className: r["form-field__input-container"], children: /* @__PURE__ */ o(
|
|
48
49
|
"input",
|
|
49
50
|
{
|
|
50
51
|
id: t,
|
|
51
|
-
type:
|
|
52
|
-
...
|
|
52
|
+
type: _,
|
|
53
|
+
..._ === "number" && { onKeyDown: a },
|
|
53
54
|
onChange: d,
|
|
54
|
-
className: l(r["form-field__input"], [
|
|
55
|
+
className: l(r["form-field__input"], [
|
|
56
|
+
i !== "" && r["form-field__input--error"]
|
|
57
|
+
])
|
|
55
58
|
}
|
|
56
|
-
),
|
|
57
|
-
|
|
59
|
+
) }),
|
|
60
|
+
i !== "" && /* @__PURE__ */ o(u, { level: "error", feedback: i })
|
|
58
61
|
] })
|
|
59
62
|
] });
|
|
60
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormInput.js","sources":["../../../src/components/FormInput/FormInput.tsx"],"sourcesContent":["import clsx from 'clsx';\n\nimport styles from './FormInput.module.css';\n\nimport { FeedbackBox, Label } from 'components';\n\nexport interface FormInputProps {\n /** The id of the input element. */\n id: string;\n /** label text if empthy the label is not renderd */\n label: string;\n /** label position `top` or `left`. The default is `top`. */\n labelPosition?: 'top' | 'left';\n /** The type of the input element. */\n type?: 'text' | 'password' | 'email' | 'number';\n /** Shows red * */\n required?: boolean;\n /** error text to display if set */\n notValidatedText?: string;\n /** Returns array of selected values as number */\n onChange: (value: string) => void;\n}\n\nexport const FormInput = ({\n id,\n label,\n labelPosition = 'top',\n type = 'text',\n required = false,\n notValidatedText = '',\n onChange,\n}: FormInputProps) => {\n const blockInvalidChar = (event: React.KeyboardEvent<HTMLInputElement>) =>\n ['e', 'E', '+', '-'].includes(event.key) && event.preventDefault();\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (typeof onChange === 'function') {\n onChange(event.target.value);\n }\n };\n\n return (\n <div className={clsx(styles['form-field__container'], styles[`form-field__container--label-${labelPosition}`])}>\n {label && (\n <Label htmlFor={id} required={required}>\n {label}\n </Label>\n )}\n\n <div className={styles['form-field__input-container']}>\n <input\n
|
|
1
|
+
{"version":3,"file":"FormInput.js","sources":["../../../src/components/FormInput/FormInput.tsx"],"sourcesContent":["import clsx from 'clsx';\n\nimport styles from './FormInput.module.css';\n\nimport { FeedbackBox, Label } from 'components';\n\nexport interface FormInputProps {\n /** The id of the input element. */\n id: string;\n /** label text if empthy the label is not renderd */\n label: string;\n /** label position `top` or `left`. The default is `top`. */\n labelPosition?: 'top' | 'left';\n /** The type of the input element. */\n type?: 'text' | 'password' | 'email' | 'number';\n /** Shows red * */\n required?: boolean;\n /** error text to display if set */\n notValidatedText?: string;\n /** Returns array of selected values as number */\n onChange: (value: string) => void;\n}\n\nexport const FormInput = ({\n id,\n label,\n labelPosition = 'top',\n type = 'text',\n required = false,\n notValidatedText = '',\n onChange,\n}: FormInputProps) => {\n const blockInvalidChar = (event: React.KeyboardEvent<HTMLInputElement>) =>\n ['e', 'E', '+', '-'].includes(event.key) && event.preventDefault();\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (typeof onChange === 'function') {\n onChange(event.target.value);\n }\n };\n\n return (\n <div className={clsx(styles['form-field__container'], styles[`form-field__container--label-${labelPosition}`])}>\n {label && (\n <Label htmlFor={id} required={required}>\n {label}\n </Label>\n )}\n\n <div className={styles['form-field__input-feedback-container']}>\n <div className={styles['form-field__input-container']}>\n <input\n id={id}\n type={type}\n {...(type === 'number' && { onKeyDown: blockInvalidChar })}\n onChange={handleChange}\n className={clsx(styles['form-field__input'], [\n notValidatedText !== '' && styles['form-field__input--error'],\n ])}\n />\n </div>\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n </div>\n );\n};\n"],"names":["FormInput","id","label","labelPosition","type","required","notValidatedText","onChange","blockInvalidChar","event","handleChange","jsxs","clsx","styles","jsx","Label","FeedbackBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuBaA,IAAY,CAAC;AAAA,EACxB,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,kBAAAC,IAAmB;AAAA,EACnB,UAAAC;AACF,MAAsB;AACpB,QAAMC,IAAmB,CAACC,MACxB,CAAC,KAAK,KAAK,KAAK,GAAG,EAAE,SAASA,EAAM,GAAG,KAAKA,EAAM,eAAe,GAE7DC,IAAe,CAACD,MAA+C;AAC/D,IAAA,OAAOF,KAAa,cACbA,EAAAE,EAAM,OAAO,KAAK;AAAA,EAC7B;AAGF,SACG,gBAAAE,EAAA,OAAA,EAAI,WAAWC,EAAKC,EAAO,uBAAuB,GAAGA,EAAO,gCAAgCV,CAAa,EAAE,CAAC,GAC1G,UAAA;AAAA,IAAAD,KACE,gBAAAY,EAAAC,GAAA,EAAM,SAASd,GAAI,UAAAI,GACjB,UACHH,GAAA;AAAA,IAGD,gBAAAS,EAAA,OAAA,EAAI,WAAWE,EAAO,sCAAsC,GAC3D,UAAA;AAAA,MAAA,gBAAAC,EAAC,OAAI,EAAA,WAAWD,EAAO,6BAA6B,GAClD,UAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAAb;AAAA,UACA,MAAAG;AAAA,UACC,GAAIA,MAAS,YAAY,EAAE,WAAWI,EAAiB;AAAA,UACxD,UAAUE;AAAA,UACV,WAAWE,EAAKC,EAAO,mBAAmB,GAAG;AAAA,YAC3CP,MAAqB,MAAMO,EAAO,0BAA0B;AAAA,UAAA,CAC7D;AAAA,QAAA;AAAA,MAAA,GAEL;AAAA,MACCP,MAAqB,MAAM,gBAAAQ,EAACE,KAAY,OAAM,SAAQ,UAAUV,GAAkB;AAAA,IAAA,GACrF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -15,7 +15,7 @@ import "../GridRow/GridRow.js";
|
|
|
15
15
|
import "../IconButton/IconButton.js";
|
|
16
16
|
import "../Input/Input.js";
|
|
17
17
|
import "react-router-dom";
|
|
18
|
-
import "../../TablePlugin-
|
|
18
|
+
import "../../TablePlugin-hmwPCCLn.js";
|
|
19
19
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
20
20
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
21
21
|
import "../SelectListbox/SelectListbox.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as S, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { fn as d } from "../../index-C9QoqAAt.js";
|
|
3
3
|
import { useState as p } from "react";
|
|
4
|
-
import { M as e } from "../../TablePlugin-
|
|
4
|
+
import { M as e } from "../../TablePlugin-hmwPCCLn.js";
|
|
5
5
|
import { Container as M } from "../../storyComponents/Container/Container.js";
|
|
6
6
|
const C = `
|
|
7
7
|
// MultiSelectHeader can be added optionally
|
|
@@ -14,7 +14,7 @@ import "../../IconButton/IconButton.js";
|
|
|
14
14
|
import "../../Input/Input.js";
|
|
15
15
|
import "../../InputField/InputField.js";
|
|
16
16
|
import "react-router-dom";
|
|
17
|
-
import { a as q } from "../../../TablePlugin-
|
|
17
|
+
import { a as q } from "../../../TablePlugin-hmwPCCLn.js";
|
|
18
18
|
import "../../RteEditor/Providers/LanguageProvider.js";
|
|
19
19
|
import "../../RteEditor/hooks/components/Flyout.js";
|
|
20
20
|
import "../../SelectListbox/SelectListbox.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { useRef as M, useState as
|
|
1
|
+
import { jsxs as h, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as v } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { useRef as M, useState as $, useEffect as N } from "react";
|
|
4
4
|
import "../Buttons/Button.js";
|
|
5
5
|
import "../Buttons/LinkButton.js";
|
|
6
6
|
import "@react-aria/button";
|
|
@@ -16,68 +16,67 @@ import "../Input/Input.js";
|
|
|
16
16
|
import "../InputField/InputField.js";
|
|
17
17
|
import { Label as D } from "../Label/Label.js";
|
|
18
18
|
import "react-router-dom";
|
|
19
|
-
import "../../TablePlugin-
|
|
19
|
+
import "../../TablePlugin-hmwPCCLn.js";
|
|
20
20
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
21
21
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
22
22
|
import "../SelectListbox/SelectListbox.js";
|
|
23
23
|
import "../SelectListbox/SelectProvider.js";
|
|
24
24
|
import "../Sortable/components/SortableItem.js";
|
|
25
25
|
import "../../SortableProvider-BUsvniX7.js";
|
|
26
|
-
import '../../assets/PeriodSelector.css';const
|
|
27
|
-
"period-selector__container": "_period-
|
|
28
|
-
"period-selector__container--label-left": "_period-selector__container--label-
|
|
29
|
-
"period-selector__container--label-top": "_period-selector__container--label-
|
|
30
|
-
"period-selector__selector-container": "_period-selector__selector-
|
|
31
|
-
"period-selector__selector-row": "_period-selector__selector-
|
|
32
|
-
}, S = 0, f = 1, E = 2,
|
|
26
|
+
import '../../assets/PeriodSelector.css';const l = {
|
|
27
|
+
"period-selector__container": "_period-selector__container_10t7p_1",
|
|
28
|
+
"period-selector__container--label-left": "_period-selector__container--label-left_10t7p_6",
|
|
29
|
+
"period-selector__container--label-top": "_period-selector__container--label-top_10t7p_12",
|
|
30
|
+
"period-selector__selector-container": "_period-selector__selector-container_10t7p_19",
|
|
31
|
+
"period-selector__selector-row": "_period-selector__selector-row_10t7p_25"
|
|
32
|
+
}, S = 0, f = 1, E = 2, p = 3, I = 7, T = (i) => {
|
|
33
33
|
const c = [];
|
|
34
|
-
for (let t = 0; t <
|
|
35
|
-
c.push(
|
|
34
|
+
for (let t = 0; t < i.length; t += p)
|
|
35
|
+
c.push(i.slice(t, t + p));
|
|
36
36
|
return c;
|
|
37
37
|
}, nr = ({
|
|
38
|
-
maxPeriods:
|
|
38
|
+
maxPeriods: i = I,
|
|
39
39
|
defaultValues: c,
|
|
40
40
|
label: t,
|
|
41
41
|
labelPosition: b = "top",
|
|
42
|
-
required:
|
|
42
|
+
required: _ = !1,
|
|
43
43
|
notValidatedText: m = "",
|
|
44
|
-
onChange:
|
|
44
|
+
onChange: g
|
|
45
45
|
}) => {
|
|
46
|
-
const
|
|
47
|
-
label: `${e + 1}${r.length === 1 ? "" : `.${(o - 1) %
|
|
46
|
+
const R = Array.from({ length: i }, (r, e) => e + 1), a = T(R), x = a.map((r, e) => r.map((o) => ({
|
|
47
|
+
label: `${e + 1}${r.length === 1 ? "" : `.${(o - 1) % p + 1}`}`,
|
|
48
48
|
value: o.toString()
|
|
49
49
|
}))), n = M(
|
|
50
50
|
a.map(
|
|
51
51
|
(r) => r.reduce((e, o) => (c != null && c.includes(o) && e.push(o), e), [])
|
|
52
52
|
)
|
|
53
|
-
), [
|
|
54
|
-
n.current[e] = r.map((o) => Number(o)), d(
|
|
53
|
+
), [P, u] = $([]), d = (r) => r[S].length !== 0 || r[f].length !== 0 ? [E] : r[E].length !== 0 ? [S, f] : [], k = (r, e) => {
|
|
54
|
+
n.current[e] = r.map((o) => Number(o)), u(d(n.current)), g([...n.current.flat()].sort());
|
|
55
55
|
};
|
|
56
|
-
return
|
|
57
|
-
d(
|
|
56
|
+
return N(() => {
|
|
57
|
+
u(d(n.current));
|
|
58
58
|
}, []), /* @__PURE__ */ h(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
|
-
className:
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
className: v(
|
|
62
|
+
l["period-selector__container"],
|
|
63
|
+
l[`period-selector__container--label-${b}`]
|
|
64
64
|
),
|
|
65
65
|
children: [
|
|
66
|
-
t && /* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */ h("div", { className:
|
|
68
|
-
/* @__PURE__ */
|
|
66
|
+
t && /* @__PURE__ */ s(D, { htmlFor: "", required: _, children: t }),
|
|
67
|
+
/* @__PURE__ */ h("div", { className: l["period-selector__selector-container"], children: [
|
|
68
|
+
/* @__PURE__ */ s("div", { className: l["period-selector__selector-row"], children: x.map((r, e) => /* @__PURE__ */ s(
|
|
69
69
|
w,
|
|
70
70
|
{
|
|
71
71
|
checkboxes: r,
|
|
72
72
|
defaultValues: n.current[e].map((o) => o.toString()),
|
|
73
|
-
disableGroup:
|
|
74
|
-
required:
|
|
75
|
-
onSetValues: (o) =>
|
|
73
|
+
disableGroup: P.includes(e),
|
|
74
|
+
required: _,
|
|
75
|
+
onSetValues: (o) => k(o, e)
|
|
76
76
|
},
|
|
77
77
|
`group_${e}`
|
|
78
78
|
)) }),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
m !== "" && /* @__PURE__ */ i(B, { level: "error", feedback: m })
|
|
79
|
+
m !== "" && /* @__PURE__ */ s(B, { level: "error", feedback: m })
|
|
81
80
|
] })
|
|
82
81
|
]
|
|
83
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeriodSelector.js","sources":["../../../src/components/PeriodSelector/PeriodSelector.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport styles from './PeriodSelector.module.css';\n\nimport { Label, CheckboxButtonBar, FeedbackBox } from 'components';\n\nexport interface PeriodSelectorProps {\n /** Indicates how many periods are shown. */\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n maxPeriods: 6 | 7;\n /** array of period values [3, 5 ...] */\n defaultValues?: number[];\n label: string;\n labelPosition?: 'top' | 'left';\n /** Shows red * */\n required?: boolean;\n /** error text to display if set */\n notValidatedText?: string;\n /** Returns array of selected values as number */\n onChange: (values: number[]) => void;\n}\n\nconst SEMESTER_1 = 0;\nconst SEMESTER_2 = 1;\nconst SEMESTER_3 = 2;\n\nconst PERIODS_PER_SEMESTER = 3;\nconst MAX_PERIODS = 7;\n\nconst chunkPeriods = (array: number[]): number[][] => {\n const result: number[][] = [];\n for (let count = 0; count < array.length; count += PERIODS_PER_SEMESTER) {\n result.push(array.slice(count, count + PERIODS_PER_SEMESTER));\n }\n return result;\n};\n\n/** Checkbox group for selecting periods */\nexport const PeriodSelector = ({\n maxPeriods = MAX_PERIODS,\n defaultValues,\n label,\n labelPosition = 'top',\n required = false,\n notValidatedText = '',\n onChange,\n}: PeriodSelectorProps) => {\n const maxPeriodsList = Array.from({ length: maxPeriods }, (_, index) => index + 1);\n const chunkedPeriods = chunkPeriods(maxPeriodsList);\n\n const checkboxItems = chunkedPeriods.map((periods, semester) => {\n return periods.map((period) => ({\n label: `${semester + 1}${periods.length === 1 ? '' : `.${((period - 1) % PERIODS_PER_SEMESTER) + 1}`}`,\n value: period.toString(),\n }));\n });\n\n const returnValues = useRef<number[][]>(\n chunkedPeriods.map((semester) =>\n semester.reduce((periods, period) => {\n if (defaultValues?.includes(period)) periods.push(period);\n return periods;\n }, [] as number[])\n )\n );\n const [disableSemesters, setDisableSemesters] = useState<number[]>([]);\n\n const disableGroups = (selects: number[][]) => {\n if (selects[SEMESTER_1].length !== 0 || selects[SEMESTER_2].length !== 0) return [SEMESTER_3];\n if (selects[SEMESTER_3].length !== 0) return [SEMESTER_1, SEMESTER_2];\n return [];\n };\n\n const handleChange = (values: string[], index: number) => {\n returnValues.current[index] = values.map((num) => Number(num));\n setDisableSemesters(disableGroups(returnValues.current));\n onChange([...returnValues.current.flat()].sort());\n };\n\n useEffect(() => {\n setDisableSemesters(disableGroups(returnValues.current));\n }, []);\n\n return (\n <div\n className={clsx(\n styles['period-selector__container'],\n styles[`period-selector__container--label-${labelPosition}`]\n )}\n >\n {label && (\n <Label htmlFor=\"\" required={required}>\n {label}\n </Label>\n )}\n <div className={styles['period-selector__selector-container']}>\n <div className={styles['period-selector__selector-row']}>\n {checkboxItems.map((checkboxes, semester) => (\n <CheckboxButtonBar\n key={`group_${semester}`}\n checkboxes={checkboxes}\n defaultValues={returnValues.current[semester].map((num) => num.toString())}\n disableGroup={disableSemesters.includes(semester)}\n required={required}\n onSetValues={(event) => handleChange(event, semester)}\n />\n ))}\n </div>\n
|
|
1
|
+
{"version":3,"file":"PeriodSelector.js","sources":["../../../src/components/PeriodSelector/PeriodSelector.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport styles from './PeriodSelector.module.css';\n\nimport { Label, CheckboxButtonBar, FeedbackBox } from 'components';\n\nexport interface PeriodSelectorProps {\n /** Indicates how many periods are shown. */\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n maxPeriods: 6 | 7;\n /** array of period values [3, 5 ...] */\n defaultValues?: number[];\n label: string;\n labelPosition?: 'top' | 'left';\n /** Shows red * */\n required?: boolean;\n /** error text to display if set */\n notValidatedText?: string;\n /** Returns array of selected values as number */\n onChange: (values: number[]) => void;\n}\n\nconst SEMESTER_1 = 0;\nconst SEMESTER_2 = 1;\nconst SEMESTER_3 = 2;\n\nconst PERIODS_PER_SEMESTER = 3;\nconst MAX_PERIODS = 7;\n\nconst chunkPeriods = (array: number[]): number[][] => {\n const result: number[][] = [];\n for (let count = 0; count < array.length; count += PERIODS_PER_SEMESTER) {\n result.push(array.slice(count, count + PERIODS_PER_SEMESTER));\n }\n return result;\n};\n\n/** Checkbox group for selecting periods */\nexport const PeriodSelector = ({\n maxPeriods = MAX_PERIODS,\n defaultValues,\n label,\n labelPosition = 'top',\n required = false,\n notValidatedText = '',\n onChange,\n}: PeriodSelectorProps) => {\n const maxPeriodsList = Array.from({ length: maxPeriods }, (_, index) => index + 1);\n const chunkedPeriods = chunkPeriods(maxPeriodsList);\n\n const checkboxItems = chunkedPeriods.map((periods, semester) => {\n return periods.map((period) => ({\n label: `${semester + 1}${periods.length === 1 ? '' : `.${((period - 1) % PERIODS_PER_SEMESTER) + 1}`}`,\n value: period.toString(),\n }));\n });\n\n const returnValues = useRef<number[][]>(\n chunkedPeriods.map((semester) =>\n semester.reduce((periods, period) => {\n if (defaultValues?.includes(period)) periods.push(period);\n return periods;\n }, [] as number[])\n )\n );\n const [disableSemesters, setDisableSemesters] = useState<number[]>([]);\n\n const disableGroups = (selects: number[][]) => {\n if (selects[SEMESTER_1].length !== 0 || selects[SEMESTER_2].length !== 0) return [SEMESTER_3];\n if (selects[SEMESTER_3].length !== 0) return [SEMESTER_1, SEMESTER_2];\n return [];\n };\n\n const handleChange = (values: string[], index: number) => {\n returnValues.current[index] = values.map((num) => Number(num));\n setDisableSemesters(disableGroups(returnValues.current));\n onChange([...returnValues.current.flat()].sort());\n };\n\n useEffect(() => {\n setDisableSemesters(disableGroups(returnValues.current));\n }, []);\n\n return (\n <div\n className={clsx(\n styles['period-selector__container'],\n styles[`period-selector__container--label-${labelPosition}`]\n )}\n >\n {label && (\n <Label htmlFor=\"\" required={required}>\n {label}\n </Label>\n )}\n <div className={styles['period-selector__selector-container']}>\n <div className={styles['period-selector__selector-row']}>\n {checkboxItems.map((checkboxes, semester) => (\n <CheckboxButtonBar\n key={`group_${semester}`}\n checkboxes={checkboxes}\n defaultValues={returnValues.current[semester].map((num) => num.toString())}\n disableGroup={disableSemesters.includes(semester)}\n required={required}\n onSetValues={(event) => handleChange(event, semester)}\n />\n ))}\n </div>\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n </div>\n );\n};\n"],"names":["SEMESTER_1","SEMESTER_2","SEMESTER_3","PERIODS_PER_SEMESTER","MAX_PERIODS","chunkPeriods","array","result","count","PeriodSelector","maxPeriods","defaultValues","label","labelPosition","required","notValidatedText","onChange","maxPeriodsList","_","index","chunkedPeriods","checkboxItems","periods","semester","period","returnValues","useRef","disableSemesters","setDisableSemesters","useState","disableGroups","selects","handleChange","values","num","useEffect","jsxs","clsx","styles","jsx","Label","checkboxes","CheckboxButtonBar","event","FeedbackBox"],"mappings":"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"}
|
|
@@ -16,7 +16,7 @@ import "../IconButton/IconButton.js";
|
|
|
16
16
|
import "../Input/Input.js";
|
|
17
17
|
import "../InputField/InputField.js";
|
|
18
18
|
import "react-router-dom";
|
|
19
|
-
import "../../TablePlugin-
|
|
19
|
+
import "../../TablePlugin-hmwPCCLn.js";
|
|
20
20
|
import { Repeater as i } from "../Repeater/Repeater.js";
|
|
21
21
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
22
22
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
@@ -3,7 +3,7 @@ import { useId as p } from "react";
|
|
|
3
3
|
import "../../Buttons/Button.js";
|
|
4
4
|
import "../../Buttons/LinkButton.js";
|
|
5
5
|
import "@react-aria/button";
|
|
6
|
-
import { Label as
|
|
6
|
+
import { Label as n } from "../../Label/Label.js";
|
|
7
7
|
import "@react-aria/dialog";
|
|
8
8
|
import "@react-aria/focus";
|
|
9
9
|
import "@react-aria/overlays";
|
|
@@ -13,7 +13,7 @@ import "../../IconButton/IconButton.js";
|
|
|
13
13
|
import "../../Input/Input.js";
|
|
14
14
|
import "../../InputField/InputField.js";
|
|
15
15
|
import "react-router-dom";
|
|
16
|
-
import "../../../TablePlugin-
|
|
16
|
+
import "../../../TablePlugin-hmwPCCLn.js";
|
|
17
17
|
import "../Providers/LanguageProvider.js";
|
|
18
18
|
import "../hooks/components/Flyout.js";
|
|
19
19
|
import "../../SelectListbox/SelectListbox.js";
|
|
@@ -21,13 +21,13 @@ import "../../SelectListbox/SelectProvider.js";
|
|
|
21
21
|
import "../../Sortable/components/SortableItem.js";
|
|
22
22
|
import "../../../SortableProvider-BUsvniX7.js";
|
|
23
23
|
import '../../../assets/EditorHeader.css';const t = {
|
|
24
|
-
"editor-header__container": "_editor-
|
|
25
|
-
"editor-header__info": "_editor-
|
|
26
|
-
}, q = ({ label:
|
|
24
|
+
"editor-header__container": "_editor-header__container_nsi6h_1",
|
|
25
|
+
"editor-header__info": "_editor-header__info_nsi6h_10"
|
|
26
|
+
}, q = ({ label: i, info: o = "", required: e = !1 }) => {
|
|
27
27
|
const m = `info_${p()}`;
|
|
28
28
|
return /* @__PURE__ */ d("div", { className: t["editor-header__container"], children: [
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
i !== "" && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(n, { htmlFor: m, required: e, children: i }) }),
|
|
30
|
+
o !== "" && /* @__PURE__ */ r("div", { className: t["editor-header__info"], children: o })
|
|
31
31
|
] });
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
@@ -4,7 +4,7 @@ import { c as f } from "../../../../clsx-OuTLNxxd.js";
|
|
|
4
4
|
import { A as _, x as p, d as h } from "../../../../Lexical.prod-eo-UKDld.js";
|
|
5
5
|
import { useState as l, useEffect as k } from "react";
|
|
6
6
|
import { Icon as I } from "../../../Icon/Icon.js";
|
|
7
|
-
import { s as a } from "../../../../RteEditor.module-
|
|
7
|
+
import { s as a } from "../../../../RteEditor.module-CHbWzGpE.js";
|
|
8
8
|
import { useTranslation as B } from "../../hooks/useTranslation.js";
|
|
9
9
|
const x = {
|
|
10
10
|
bold: "Bold",
|
|
@@ -16,8 +16,8 @@ import "../../../IconButton/IconButton.js";
|
|
|
16
16
|
import "../../../Input/Input.js";
|
|
17
17
|
import "../../../InputField/InputField.js";
|
|
18
18
|
import "react-router-dom";
|
|
19
|
-
import "../../../../TablePlugin-
|
|
20
|
-
import { s as r } from "../../../../RteEditor.module-
|
|
19
|
+
import "../../../../TablePlugin-hmwPCCLn.js";
|
|
20
|
+
import { s as r } from "../../../../RteEditor.module-CHbWzGpE.js";
|
|
21
21
|
import { useTranslation as g } from "../../hooks/useTranslation.js";
|
|
22
22
|
import "../../hooks/components/Flyout.js";
|
|
23
23
|
import "../../Providers/LanguageProvider.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../../../helpers-BD3Y_bqE.js";
|
|
4
|
-
import { A as z } from "../../../../TablePlugin-
|
|
4
|
+
import { A as z } from "../../../../TablePlugin-hmwPCCLn.js";
|
|
5
5
|
import "../../../Icon/Icon.js";
|
|
6
6
|
import "../../../Buttons/Button.js";
|
|
7
7
|
import "../../../Buttons/LinkButton.js";
|