@innspel/react-native 0.10.1 → 0.11.0
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/index.cjs +1327 -780
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -61
- package/dist/index.d.ts +117 -61
- package/dist/index.js +1220 -673
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/InnspelProvider.tsx
|
|
2
2
|
import { createContext as createContext3, useCallback as useCallback3, useContext as useContext4, useMemo as useMemo4, useRef as useRef5, useState as useState5 } from "react";
|
|
3
|
-
import { View as
|
|
3
|
+
import { View as View10 } from "react-native";
|
|
4
4
|
|
|
5
5
|
// src/skjermbilde.ts
|
|
6
6
|
import { createContext, useContext } from "react";
|
|
@@ -356,7 +356,7 @@ import {
|
|
|
356
356
|
InnspelQueueFullError
|
|
357
357
|
} from "@innspel/core";
|
|
358
358
|
import { useCallback as useCallback2, useContext as useContext3, useEffect as useEffect2, useRef as useRef4, useState as useState4 } from "react";
|
|
359
|
-
import { KeyboardAvoidingView, Modal, Pressable as
|
|
359
|
+
import { KeyboardAvoidingView, Modal, Pressable as Pressable5, View as View9 } from "react-native";
|
|
360
360
|
import { initialWindowMetrics, SafeAreaInsetsContext } from "react-native-safe-area-context";
|
|
361
361
|
|
|
362
362
|
// src/Ikon.tsx
|
|
@@ -387,12 +387,21 @@ var calendar_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox=
|
|
|
387
387
|
// ../../node_modules/ionicons/dist/svg/camera-outline.svg
|
|
388
388
|
var camera_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><path d="m350.54 148.68-26.62-42.06C318.31 100.08 310.62 96 302 96h-92c-8.62 0-16.31 4.08-21.92 10.62l-26.62 42.06C155.85 155.23 148.62 160 140 160H80a32 32 0 0 0-32 32v192a32 32 0 0 0 32 32h352a32 32 0 0 0 32-32V192a32 32 0 0 0-32-32h-59c-8.65 0-16.85-4.77-22.46-11.32" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32px"/><circle cx="256" cy="272" r="80" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32px"/><path d="M124 158v-22h-24v22" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32px"/></svg>';
|
|
389
389
|
|
|
390
|
+
// ../../node_modules/ionicons/dist/svg/chatbox-outline.svg
|
|
391
|
+
var chatbox_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><path d="M408 64H104a56.16 56.16 0 0 0-56 56v192a56.16 56.16 0 0 0 56 56h40v80l93.72-78.14a8 8 0 0 1 5.13-1.86H408a56.16 56.16 0 0 0 56-56V120a56.16 56.16 0 0 0-56-56Z" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32px"/></svg>';
|
|
392
|
+
|
|
390
393
|
// ../../node_modules/ionicons/dist/svg/checkmark-circle-outline.svg
|
|
391
394
|
var checkmark_circle_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><path d="M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192Z" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32px"/><path d="M352 176 217.6 336 160 272" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32px"/></svg>';
|
|
392
395
|
|
|
396
|
+
// ../../node_modules/ionicons/dist/svg/checkmark-outline.svg
|
|
397
|
+
var checkmark_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><path d="M416 128 192 384l-96-96" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32px"/></svg>';
|
|
398
|
+
|
|
393
399
|
// ../../node_modules/ionicons/dist/svg/chevron-down-outline.svg
|
|
394
400
|
var chevron_down_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><path d="m112 184 144 144 144-144" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48px"/></svg>';
|
|
395
401
|
|
|
402
|
+
// ../../node_modules/ionicons/dist/svg/chevron-forward-outline.svg
|
|
403
|
+
var chevron_forward_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><path d="m184 112 144 144-144 144" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48px"/></svg>';
|
|
404
|
+
|
|
396
405
|
// ../../node_modules/ionicons/dist/svg/chevron-up-outline.svg
|
|
397
406
|
var chevron_up_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><path d="m112 328 144-144 144 144" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48px"/></svg>';
|
|
398
407
|
|
|
@@ -470,8 +479,14 @@ var IKONER = Object.fromEntries(
|
|
|
470
479
|
"bug-outline": bug_outline_default,
|
|
471
480
|
"calendar-outline": calendar_outline_default,
|
|
472
481
|
"camera-outline": camera_outline_default,
|
|
482
|
+
// «Send» og «Send nytt innspill» — ikonkartet i wireframen (R8.3).
|
|
483
|
+
"chatbox-outline": chatbox_outline_default,
|
|
473
484
|
"checkmark-circle-outline": checkmark_circle_outline_default,
|
|
485
|
+
// Haken ALENE: sporingslinjens passerte ledd er allerede en sirkel (R8.3).
|
|
486
|
+
"checkmark-outline": checkmark_outline_default,
|
|
474
487
|
"chevron-down-outline": chevron_down_outline_default,
|
|
488
|
+
// Sporvalgets rader peker videre (R8.3, DD-63) — dekorativ, etiketten bærer meningen.
|
|
489
|
+
"chevron-forward-outline": chevron_forward_outline_default,
|
|
475
490
|
"chevron-up-outline": chevron_up_outline_default,
|
|
476
491
|
"close-circle-outline": close_circle_outline_default,
|
|
477
492
|
"close-outline": close_outline_default,
|
|
@@ -544,9 +559,9 @@ function Btn({
|
|
|
544
559
|
const tema = useTema();
|
|
545
560
|
const c = tema.color;
|
|
546
561
|
const forbi = useTrykkForbiForelder(onPress, !!disabled, tema.touch / 2);
|
|
547
|
-
const bakgrunn = variant === "primary" ? c.actionPrimary : variant === "secondary" ? c.surfaceRaised : "transparent";
|
|
548
|
-
const tekstfarge = variant === "primary" ? c.onActionPrimary : variant === "danger" ? c.danger : c.actionSecondaryText;
|
|
549
|
-
const kant = variant === "ghost" ? "transparent" : variant === "primary" ? c.actionPrimary : c.actionSecondaryBorder;
|
|
562
|
+
const bakgrunn = variant === "primary" ? c.actionPrimary : variant === "tonet" ? c.brandBg : variant === "secondary" ? c.surfaceRaised : "transparent";
|
|
563
|
+
const tekstfarge = variant === "primary" ? c.onActionPrimary : variant === "tonet" ? c.brand : variant === "danger" ? c.danger : c.actionSecondaryText;
|
|
564
|
+
const kant = variant === "ghost" || variant === "tonet" ? "transparent" : variant === "primary" ? c.actionPrimary : c.actionSecondaryBorder;
|
|
550
565
|
return /* @__PURE__ */ jsxs(View, { style: grow ? { flex: 1 } : void 0, children: [
|
|
551
566
|
/* @__PURE__ */ jsxs(
|
|
552
567
|
Pressable,
|
|
@@ -621,35 +636,142 @@ function useTrykkForbiForelder(onPress, laast, slingring) {
|
|
|
621
636
|
[slingring]
|
|
622
637
|
);
|
|
623
638
|
}
|
|
624
|
-
function H({
|
|
639
|
+
function H({
|
|
640
|
+
children,
|
|
641
|
+
sub,
|
|
642
|
+
meta,
|
|
643
|
+
nivaa = 2,
|
|
644
|
+
testID
|
|
645
|
+
}) {
|
|
625
646
|
const tema = useTema();
|
|
626
647
|
return /* @__PURE__ */ jsxs(View, { style: { gap: tema.space.xs }, children: [
|
|
627
648
|
/* @__PURE__ */ jsx2(
|
|
628
649
|
Text,
|
|
629
650
|
{
|
|
651
|
+
testID,
|
|
630
652
|
accessibilityRole: "header",
|
|
631
653
|
style: {
|
|
632
654
|
color: tema.color.textPrimary,
|
|
633
|
-
fontSize: tema.font.h2,
|
|
634
|
-
lineHeight: tema.lineHeight.h2,
|
|
635
|
-
fontWeight: tema.weight.
|
|
655
|
+
fontSize: nivaa === 2 ? tema.font.h2 : tema.font.h3,
|
|
656
|
+
lineHeight: nivaa === 2 ? tema.lineHeight.h2 : tema.lineHeight.h3,
|
|
657
|
+
fontWeight: tema.weight.bold
|
|
636
658
|
},
|
|
637
659
|
children
|
|
638
660
|
}
|
|
639
661
|
),
|
|
640
|
-
sub ? /* @__PURE__ */ jsx2(
|
|
641
|
-
|
|
642
|
-
{
|
|
643
|
-
style: {
|
|
644
|
-
color: tema.color.textSecondary,
|
|
645
|
-
fontSize: tema.font.small,
|
|
646
|
-
lineHeight: tema.lineHeight.small
|
|
647
|
-
},
|
|
648
|
-
children: sub
|
|
649
|
-
}
|
|
650
|
-
) : null
|
|
662
|
+
sub ? /* @__PURE__ */ jsx2(Sek, { children: sub }) : null,
|
|
663
|
+
meta ? /* @__PURE__ */ jsx2(Meta, { children: meta }) : null
|
|
651
664
|
] });
|
|
652
665
|
}
|
|
666
|
+
function Brodtekst({ children, testID }) {
|
|
667
|
+
const tema = useTema();
|
|
668
|
+
return /* @__PURE__ */ jsx2(
|
|
669
|
+
Text,
|
|
670
|
+
{
|
|
671
|
+
testID,
|
|
672
|
+
style: { color: tema.color.textPrimary, fontSize: tema.font.body, lineHeight: tema.lineHeight.body },
|
|
673
|
+
children
|
|
674
|
+
}
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
function Sek({ children, testID }) {
|
|
678
|
+
const tema = useTema();
|
|
679
|
+
return /* @__PURE__ */ jsx2(
|
|
680
|
+
Text,
|
|
681
|
+
{
|
|
682
|
+
testID,
|
|
683
|
+
style: { color: tema.color.textSecondary, fontSize: tema.font.body, lineHeight: tema.lineHeight.body },
|
|
684
|
+
children
|
|
685
|
+
}
|
|
686
|
+
);
|
|
687
|
+
}
|
|
688
|
+
function Helt({
|
|
689
|
+
children,
|
|
690
|
+
testID,
|
|
691
|
+
farge,
|
|
692
|
+
live
|
|
693
|
+
}) {
|
|
694
|
+
const tema = useTema();
|
|
695
|
+
return /* @__PURE__ */ jsx2(
|
|
696
|
+
Text,
|
|
697
|
+
{
|
|
698
|
+
testID,
|
|
699
|
+
...live ? { accessibilityRole: "alert", accessibilityLiveRegion: "polite" } : {},
|
|
700
|
+
style: {
|
|
701
|
+
color: farge ?? tema.color.textPrimary,
|
|
702
|
+
fontSize: tema.font.h1,
|
|
703
|
+
lineHeight: tema.lineHeight.h1,
|
|
704
|
+
fontWeight: tema.weight.bold
|
|
705
|
+
},
|
|
706
|
+
children
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
}
|
|
710
|
+
function Meta({ children, testID, farge }) {
|
|
711
|
+
const tema = useTema();
|
|
712
|
+
return /* @__PURE__ */ jsx2(
|
|
713
|
+
Text,
|
|
714
|
+
{
|
|
715
|
+
testID,
|
|
716
|
+
style: { color: farge ?? tema.color.textMuted, fontSize: tema.font.small, lineHeight: tema.lineHeight.small },
|
|
717
|
+
children
|
|
718
|
+
}
|
|
719
|
+
);
|
|
720
|
+
}
|
|
721
|
+
function Tekstknapp({
|
|
722
|
+
label,
|
|
723
|
+
ikon,
|
|
724
|
+
onPress,
|
|
725
|
+
noytral,
|
|
726
|
+
disabled,
|
|
727
|
+
testID,
|
|
728
|
+
accessibilityLabel
|
|
729
|
+
}) {
|
|
730
|
+
const tema = useTema();
|
|
731
|
+
const farge = disabled ? tema.color.textDisabled : noytral ? tema.color.textPrimary : tema.color.actionSecondaryText;
|
|
732
|
+
return /* @__PURE__ */ jsxs(
|
|
733
|
+
Pressable,
|
|
734
|
+
{
|
|
735
|
+
testID,
|
|
736
|
+
accessibilityRole: "button",
|
|
737
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
738
|
+
accessibilityState: { disabled: !!disabled },
|
|
739
|
+
disabled,
|
|
740
|
+
onPress,
|
|
741
|
+
style: {
|
|
742
|
+
alignSelf: "flex-start",
|
|
743
|
+
minHeight: tema.touch,
|
|
744
|
+
flexDirection: "row",
|
|
745
|
+
alignItems: "center",
|
|
746
|
+
gap: tema.space.sm
|
|
747
|
+
},
|
|
748
|
+
children: [
|
|
749
|
+
ikon ? /* @__PURE__ */ jsx2(Ikon, { navn: ikon, storrelse: "minste", farge }) : null,
|
|
750
|
+
/* @__PURE__ */ jsx2(Text, { style: { color: farge, fontSize: tema.font.body, fontWeight: tema.weight.semibold }, children: label })
|
|
751
|
+
]
|
|
752
|
+
}
|
|
753
|
+
);
|
|
754
|
+
}
|
|
755
|
+
function Pille({ children, testID }) {
|
|
756
|
+
const tema = useTema();
|
|
757
|
+
return /* @__PURE__ */ jsx2(
|
|
758
|
+
Text,
|
|
759
|
+
{
|
|
760
|
+
testID,
|
|
761
|
+
style: {
|
|
762
|
+
color: tema.color.info,
|
|
763
|
+
backgroundColor: tema.color.infoBg,
|
|
764
|
+
fontSize: tema.font.small,
|
|
765
|
+
lineHeight: tema.lineHeight.small,
|
|
766
|
+
fontWeight: tema.weight.semibold,
|
|
767
|
+
borderRadius: tema.radius.pill,
|
|
768
|
+
paddingHorizontal: tema.space.sm,
|
|
769
|
+
overflow: "hidden"
|
|
770
|
+
},
|
|
771
|
+
children
|
|
772
|
+
}
|
|
773
|
+
);
|
|
774
|
+
}
|
|
653
775
|
function Hint({ children }) {
|
|
654
776
|
const tema = useTema();
|
|
655
777
|
return /* @__PURE__ */ jsx2(
|
|
@@ -667,12 +789,16 @@ function Hint({ children }) {
|
|
|
667
789
|
function Card({
|
|
668
790
|
children,
|
|
669
791
|
dashed,
|
|
670
|
-
style
|
|
792
|
+
style,
|
|
793
|
+
testID,
|
|
794
|
+
accessibilityLabel
|
|
671
795
|
}) {
|
|
672
796
|
const tema = useTema();
|
|
673
797
|
return /* @__PURE__ */ jsx2(
|
|
674
798
|
View,
|
|
675
799
|
{
|
|
800
|
+
testID,
|
|
801
|
+
...accessibilityLabel ? { accessibilityLabel } : {},
|
|
676
802
|
style: [
|
|
677
803
|
{
|
|
678
804
|
backgroundColor: tema.color.surface,
|
|
@@ -689,12 +815,19 @@ function Card({
|
|
|
689
815
|
}
|
|
690
816
|
);
|
|
691
817
|
}
|
|
692
|
-
function StatusPill({
|
|
818
|
+
function StatusPill({
|
|
819
|
+
ikon,
|
|
820
|
+
etikett,
|
|
821
|
+
fg,
|
|
822
|
+
bg,
|
|
823
|
+
testID
|
|
824
|
+
}) {
|
|
693
825
|
const tema = useTema();
|
|
694
826
|
const farge = (navn, reserve) => tema.color[navn] ?? reserve;
|
|
695
827
|
return /* @__PURE__ */ jsxs(
|
|
696
828
|
View,
|
|
697
829
|
{
|
|
830
|
+
testID,
|
|
698
831
|
style: {
|
|
699
832
|
flexDirection: "row",
|
|
700
833
|
alignItems: "center",
|
|
@@ -741,8 +874,8 @@ function Banner({
|
|
|
741
874
|
style: {
|
|
742
875
|
flex: 1,
|
|
743
876
|
color: tema.color[tone],
|
|
744
|
-
fontSize: tema.font.
|
|
745
|
-
lineHeight: tema.lineHeight.
|
|
877
|
+
fontSize: tema.font.body,
|
|
878
|
+
lineHeight: tema.lineHeight.body
|
|
746
879
|
},
|
|
747
880
|
children
|
|
748
881
|
}
|
|
@@ -759,30 +892,82 @@ function saksnr(id) {
|
|
|
759
892
|
return rest.length > 8 ? rest.slice(-4) : rest;
|
|
760
893
|
}
|
|
761
894
|
var stor = (s) => s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
|
|
895
|
+
var PLATTFORM_ORD = {
|
|
896
|
+
android: "Android",
|
|
897
|
+
ios: "iOS",
|
|
898
|
+
web: "Web",
|
|
899
|
+
tvos: "TV"
|
|
900
|
+
};
|
|
901
|
+
var SPRAAK_ORD = {
|
|
902
|
+
nb: "Norsk (bokm\xE5l)",
|
|
903
|
+
nn: "Norsk (nynorsk)",
|
|
904
|
+
no: "Norsk",
|
|
905
|
+
se: "Nordsamisk",
|
|
906
|
+
en: "Engelsk",
|
|
907
|
+
sv: "Svensk",
|
|
908
|
+
da: "Dansk",
|
|
909
|
+
fi: "Finsk",
|
|
910
|
+
is: "Islandsk",
|
|
911
|
+
de: "Tysk",
|
|
912
|
+
nl: "Nederlandsk",
|
|
913
|
+
fr: "Fransk",
|
|
914
|
+
es: "Spansk",
|
|
915
|
+
it: "Italiensk",
|
|
916
|
+
pt: "Portugisisk",
|
|
917
|
+
pl: "Polsk",
|
|
918
|
+
lt: "Litauisk",
|
|
919
|
+
ru: "Russisk",
|
|
920
|
+
uk: "Ukrainsk",
|
|
921
|
+
ar: "Arabisk",
|
|
922
|
+
so: "Somali",
|
|
923
|
+
ti: "Tigrinja",
|
|
924
|
+
tr: "Tyrkisk",
|
|
925
|
+
ur: "Urdu",
|
|
926
|
+
fa: "Persisk",
|
|
927
|
+
th: "Thai",
|
|
928
|
+
vi: "Vietnamesisk",
|
|
929
|
+
zh: "Kinesisk",
|
|
930
|
+
ja: "Japansk",
|
|
931
|
+
ko: "Koreansk"
|
|
932
|
+
};
|
|
933
|
+
function plattformOrd(verdi) {
|
|
934
|
+
return PLATTFORM_ORD[verdi.toLowerCase()] ?? stor(verdi);
|
|
935
|
+
}
|
|
936
|
+
function spraakOrd(verdi) {
|
|
937
|
+
const hoved = verdi.toLowerCase().split(/[-_]/)[0] ?? verdi;
|
|
938
|
+
return SPRAAK_ORD[hoved] ?? stor(hoved);
|
|
939
|
+
}
|
|
940
|
+
var TALLORD = ["null", "\xE9n", "to", "tre"];
|
|
941
|
+
var tallord = (n) => TALLORD[n] ?? String(n);
|
|
762
942
|
var tekst = {
|
|
763
943
|
// 2b — første valg
|
|
764
944
|
valgTittel: "Hva gjelder det?",
|
|
765
945
|
sporFeil: "Noe virker ikke",
|
|
946
|
+
/** DD-67, produkteier 2026-09-20: dette er VALGETS tekst, ikke en hjelpetekst. */
|
|
766
947
|
sporFeilUnder: "Noe er galt eller virker rart",
|
|
767
948
|
sporOnske: "Jeg \xF8nsker meg noe",
|
|
768
949
|
sporOnskeUnder: "Noe du savner eller vil ha annerledes",
|
|
769
|
-
|
|
950
|
+
/**
|
|
951
|
+
* Anonym modus (DD-62 (3)). Portalens ordlyd, med widgetens ord. ALDRI «du er ikke logget
|
|
952
|
+
* inn»: anonym modus er leietakerens valg ved `init()`, og widgeten vet ikke om
|
|
953
|
+
* innsenderen er logget inn i vertsappen.
|
|
954
|
+
*/
|
|
955
|
+
sendAnonymtHint: "Innspillet kobles ikke til deg, og du kan ikke f\xF8lge det etterp\xE5.",
|
|
956
|
+
// 2c — kjente feil (DD-29, DD-30). Ingen undertittel: overskriften stiller spørsmålet.
|
|
770
957
|
kjenteFeilTittelFeil: "Er det dette du ser?",
|
|
771
|
-
kjenteFeilUnderFeil: "Kjenner du igjen en av disse?",
|
|
772
958
|
kjenteFeilTittelOnske: "Har noen \xF8nsket dette?",
|
|
773
|
-
kjenteFeilUnderOnske: "Ett trykk legger deg til p\xE5 \xF8nsket \u2014 ingen ny sak.",
|
|
774
959
|
svarJa: "Ja, jeg ogs\xE5",
|
|
775
960
|
svarLigner: "Ligner, men ikke helt",
|
|
776
961
|
svarNei: "Nei, det er noe annet",
|
|
777
962
|
omvei: "Omvei:",
|
|
778
963
|
rettesI: (versjon) => `Rettes i ${versjon}`,
|
|
779
964
|
rettetI: (versjon) => `Rettet i ${versjon}`,
|
|
965
|
+
/** Hvert kort er ÉN gruppe med samlet navn; de tre svarene er knapper i den. */
|
|
966
|
+
kjentFeilGruppe: (tittel, status, versjon) => versjon ? `Kjent feil: ${tittel}, ${status}, ${versjon}` : `Kjent feil: ${tittel}, ${status}`,
|
|
780
967
|
// 2d + 2e — feltet og kontekstlinja
|
|
781
968
|
/**
|
|
782
|
-
* «Ditt innspill», ikke «Din feil» (DD-54). «Din» festet saken til personen, og
|
|
783
|
-
*
|
|
784
|
-
* skyld. Ønskesporet beholder «Ditt ønske»: et ønske er ingen feil, og der finnes
|
|
785
|
-
* ikke problemet. De to står aldri ved siden av hverandre; sporet velges før dette.
|
|
969
|
+
* «Ditt innspill», ikke «Din feil» (DD-54). «Din» festet saken til personen, og «feil»
|
|
970
|
+
* karakteriserte den før noen hadde lest den — innsenderen leste det som skyld.
|
|
786
971
|
*/
|
|
787
972
|
feltLabelFeil: "Ditt innspill",
|
|
788
973
|
feltLabelOnske: "Ditt \xF8nske",
|
|
@@ -794,10 +979,30 @@ var tekst = {
|
|
|
794
979
|
/** DD-44: minimum tegn er det ENESTE kravet. */
|
|
795
980
|
forKort: (min) => `Minst ${min} tegn. Ingenting annet er obligatorisk.`,
|
|
796
981
|
tellerFull: " \u2014 kort og konkret holder",
|
|
797
|
-
|
|
798
|
-
|
|
982
|
+
/**
|
|
983
|
+
* DD-05 ordrett: «Én linje «Vis» under feltet ekspanderer». Lukket er linja en
|
|
984
|
+
* OPPSUMMERING — den navngir det innsenderen kjenner igjen; lista er hele sannheten.
|
|
985
|
+
*/
|
|
986
|
+
kontekstLinjeLukket: "Skjerm og enhet legges ved",
|
|
987
|
+
kontekstLinjeApen: "Dette legges ved",
|
|
988
|
+
kontekstVis: "Vis",
|
|
989
|
+
kontekstSkjul: "Skjul",
|
|
799
990
|
kontekstFjern: "Fjern",
|
|
800
|
-
|
|
991
|
+
kontekstFjernA11y: (etikett) => `Fjern ${etikett.toLowerCase()} fra innsendingen`,
|
|
992
|
+
/** K5 — skjermens ene hjelpesetning, og bare når lista står. */
|
|
993
|
+
kontekstAldri: "Aldri navn, e-post, telefon, posisjon eller det som st\xE5r p\xE5 skjermen.",
|
|
994
|
+
/**
|
|
995
|
+
* Etikettene er portalens: samme felt, samme ord i begge flater (DD-50, presisert
|
|
996
|
+
* 2026-09-20). Fram til R8.3 sto det «Plattform» og «OS» her.
|
|
997
|
+
*/
|
|
998
|
+
kontekstEtiketter: {
|
|
999
|
+
screen: "Skjerm",
|
|
1000
|
+
appVersion: "Appversjon",
|
|
1001
|
+
platform: "Enhet",
|
|
1002
|
+
os: "System",
|
|
1003
|
+
build: "Bygg",
|
|
1004
|
+
locale: "Spr\xE5k"
|
|
1005
|
+
},
|
|
801
1006
|
lenketTil: (tittel) => `Lenket til: \xAB${tittel}\xBB`,
|
|
802
1007
|
fjernLenke: "Fjern lenken til den kjente feilen",
|
|
803
1008
|
// 2f — skjermbilde (K4, DD-39, DD-40, DD-42)
|
|
@@ -835,11 +1040,15 @@ var tekst = {
|
|
|
835
1040
|
monsterFjern: "Fjern",
|
|
836
1041
|
monsterBehold: "Behold",
|
|
837
1042
|
monsterForklaring: "Teksten endres bare hvis du trykker Fjern. Vi fjerner aldri noe stille.",
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
1043
|
+
/* 2g — kvitteringen som KORT (DD-07, P1 (a) 2026-09-20).
|
|
1044
|
+
Etiketten sier hva som skjedde; HELTEN er løftets setning. */
|
|
1045
|
+
kvitteringSendtDato: (dato) => `Sendt ${dato}`,
|
|
1046
|
+
kvitteringSendtAnonymtDato: (dato) => `Sendt anonymt ${dato}`,
|
|
1047
|
+
kvitteringRegistrertDato: (dato) => `Registrert ${dato}`,
|
|
1048
|
+
kvitteringLagretDato: (dato) => `Lagret ${dato}`,
|
|
841
1049
|
kvitteringFeil: "Du f\xE5r beskjed n\xE5r den er rettet, eller hvis vi trenger mer.",
|
|
842
1050
|
kvitteringJaOgsa: "Du f\xE5r beskjed n\xE5r den er rettet.",
|
|
1051
|
+
kvitteringUnder: "Ligger under \xABMine innspill\xBB og oppdaterer seg selv.",
|
|
843
1052
|
saksnummer: (nr) => `Sak ${saksnr(nr)}`,
|
|
844
1053
|
tilbakeTilAppen: "Tilbake til appen",
|
|
845
1054
|
/** DD-42: saken er sendt, bildet kom ikke med — aldri en blokkert innsending. */
|
|
@@ -847,9 +1056,12 @@ var tekst = {
|
|
|
847
1056
|
tekstenErLagret: "Teksten din er lagret.",
|
|
848
1057
|
vedleggFeiletBanner: "Bildet ble ikke lastet opp. Saken er sendt uten det \u2014 vil du, kan du sende et nytt innspill med bilde.",
|
|
849
1058
|
saksnummerUtenVedlegg: (nr) => `Sak ${saksnr(nr)} \xB7 uten vedlegg`,
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
1059
|
+
/* 2i — køet uten nett (DD-41, presisert 2026-09-20). Kortet lover ikke svar, og det er
|
|
1060
|
+
derfor ikke kvitteringen: kvitteringen kommer når køen tømmes. */
|
|
1061
|
+
koIngenNett: "Ingen nett",
|
|
1062
|
+
koHelt: "Sendes n\xE5r du er p\xE5 nett.",
|
|
1063
|
+
koUnder: "Du ser den under \xABMine innspill\xBB til den er sendt.",
|
|
1064
|
+
offlineBanner: "Ingen nett. Lagres og sendes automatisk.",
|
|
853
1065
|
offlineLagre: "Lagre \u2014 sendes n\xE5r du er p\xE5 nett",
|
|
854
1066
|
/** DD-41: et skjermbilde køes aldri. */
|
|
855
1067
|
offlineUtenBilde: "Skjermbilde kan ikke legges ved uten nett. Teksten sendes; bildet ble ikke lagret.",
|
|
@@ -860,18 +1072,23 @@ var tekst = {
|
|
|
860
1072
|
/** Knappen på første steg med innspill fra før (DD-62): tallet er det som gjør den til en inngang. */
|
|
861
1073
|
mineMedAntall: (n) => `Mine innspill \xB7 ${n}`,
|
|
862
1074
|
mineEtikett: (n) => `Mine innspill, ${n} innspill`,
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
1075
|
+
mineLaster: "Henter innspillene dine",
|
|
1076
|
+
/** DD-19: tomheten er OVERSKRIFTEN, ikke en grå linje under tittelen. */
|
|
1077
|
+
mineTomTittel: "Du har ikke sendt noe enn\xE5",
|
|
1078
|
+
/** Ordrett portalens `mineTomHint` — én innsender, to flater, samme setning. */
|
|
1079
|
+
mineTomHint: (leietaker) => `Det f\xF8rste innspillet tar under et minutt. Feil eller \xF8nske \u2014 ${leietaker} svarer p\xE5 begge.`,
|
|
1080
|
+
mineTomHintGenerisk: "Det f\xF8rste innspillet tar under et minutt. Feil eller \xF8nske \u2014 du f\xE5r svar p\xE5 begge.",
|
|
1081
|
+
/** Køraden har ingen saksnummer å vise — hodet sier hva den er i stedet (DD-41). */
|
|
1082
|
+
mineIkkeSendtHode: (spor) => `${stor(spor)} \xB7 ikke sendt enn\xE5`,
|
|
1083
|
+
mineFeil: "Innspillene dine kunne ikke hentes n\xE5.",
|
|
867
1084
|
/** «Feil · sak 2041» — sporet først, aldri rå id og aldri kontraktens type (DD-50). */
|
|
868
1085
|
sakHode: (spor, nr) => `${stor(spor)} \xB7 sak ${saksnr(nr)}`,
|
|
869
1086
|
/** F14: svaret kom siden forrige gang denne enheten viste lista. */
|
|
870
1087
|
nyttSvar: "Nytt svar",
|
|
871
1088
|
// Leietakeren fjernet vedlegget. Bare AT — aldri hvorfor, av hvem eller når.
|
|
872
1089
|
bildeFjernet: "Bildet er fjernet.",
|
|
873
|
-
svarFra: (leietaker) => `Svar fra ${leietaker}`,
|
|
874
|
-
svarFraGenerisk:
|
|
1090
|
+
svarFra: (leietaker, dato) => `Svar fra ${leietaker} \xB7 ${dato}`,
|
|
1091
|
+
svarFraGenerisk: (dato) => `Svar \xB7 ${dato}`,
|
|
875
1092
|
// DD-69 — «Legg til mer»: innsenderens egne ord, ikke et svar på svaret.
|
|
876
1093
|
leggTilMer: "Legg til mer",
|
|
877
1094
|
leggTilMerLabel: "Legg til mer p\xE5 denne saken",
|
|
@@ -889,76 +1106,108 @@ var tekst = {
|
|
|
889
1106
|
sendNytt: "Send nytt innspill",
|
|
890
1107
|
/** Tom tilstand: det finnes ikke noe «nytt» å sende når ingenting er sendt. */
|
|
891
1108
|
sendForste: "Send innspill",
|
|
892
|
-
|
|
1109
|
+
/* Sporingslinjen (DD-08/DD-28 presisert 2026-09-20). Ordene er innsenderens, aldri
|
|
1110
|
+
kontraktens: ingen status-enum, ingen «deadline». Samme ord som portalen. */
|
|
1111
|
+
sporEtikett: "Sakens gang",
|
|
1112
|
+
sporSvarInnen: "Svar innen",
|
|
1113
|
+
/** Mottatt: fristen finnes ikke ennå, og vi lover ingen dato på en sak ingen har åpnet. */
|
|
1114
|
+
sporDatoenSettes: "dato kommer",
|
|
1115
|
+
/** Planlagt/Bygges: kontrakten har ingen leveringsdato, og DD-28 forbyr en ETA. */
|
|
1116
|
+
sporIngenDato: "ingen dato lovet",
|
|
1117
|
+
sporNaarTenantTarDen: (leietaker) => `n\xE5r ${leietaker} tar den`,
|
|
1118
|
+
sporNaarDenTasOpp: "n\xE5r de tar den",
|
|
1119
|
+
/** P3 (a), produkteier 2026-09-20. Klientregel på `deadlineAt` — ingen ny status. */
|
|
1120
|
+
sporFristenErGatt: "Fristen er g\xE5tt",
|
|
1121
|
+
// 3a — invitasjonsbanneret (DD-12). Kontakttaket står IKKE her (DD-14).
|
|
893
1122
|
invitasjonRegion: "Invitasjon til betaprogram",
|
|
894
1123
|
invitasjonHva: (navn) => `Vil du teste \xAB${navn}\xBB?`,
|
|
895
|
-
|
|
1124
|
+
/** Én meta-linje med det kontrakten har: antall oppgaver og perioden. */
|
|
1125
|
+
invitasjonMeta: (oppgaver, periode2) => `${oppgaver} oppgaver \xB7 ${periode2}`,
|
|
896
1126
|
lesMer: "Les mer og bli med",
|
|
897
1127
|
avvisInvitasjon: "Avvis invitasjonen",
|
|
898
1128
|
// 3b — aksepten (DD-13, DD-32, DD-37)
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
1129
|
+
/**
|
|
1130
|
+
* DD-32, presisert 2026-09-20: tallene skal være SANNE. Summen når anslagene er ulike —
|
|
1131
|
+
* et snitt av 5, 3 og 2 er ikke sant for noen av oppgavene.
|
|
1132
|
+
*/
|
|
1133
|
+
akseptTallSum: (oppgaver, minutter, periode2) => `${oppgaver} oppgaver \xB7 ca. ${minutter} min i alt \xB7 ${periode2}`,
|
|
1134
|
+
akseptTallHver: (oppgaver, minutter, periode2) => `${oppgaver} oppgaver \xB7 ca. ${minutter} min hver \xB7 ${periode2}`,
|
|
902
1135
|
akseptOppgaver: "Hva vi ber om",
|
|
903
1136
|
akseptOppgaveTid: (minutter) => `ca. ${minutter} min`,
|
|
904
|
-
akseptKjenteFeil:
|
|
905
|
-
akseptKjenteFeilUnder: "Disse trenger du ikke melde \u2014 vi vet om dem.",
|
|
1137
|
+
akseptKjenteFeil: "Kjente feil vi vet om",
|
|
906
1138
|
akseptInnsamling: "Hva som samles inn",
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
1139
|
+
/** Samme ord som kontekstlista (DD-50): «enhet», ikke «plattform». */
|
|
1140
|
+
akseptInnsamlingTekst: "Skjerm, appversjon, enhet og det du svarer. Aldri navn, e-post, telefon eller posisjon.",
|
|
1141
|
+
akseptVilkar: "Les vilk\xE5rene",
|
|
1142
|
+
/**
|
|
1143
|
+
* Skjermens ENE hjelpesetning: taket og utgangen i én (DD-67). «høyst N» — tallet er
|
|
1144
|
+
* `maxContacts`, et TAK som kan senkes og aldri heves, og antall oppfølginger er malene,
|
|
1145
|
+
* som kan være færre. «Vi spør tre ganger» lover noe som ikke er sant (DD-14).
|
|
1146
|
+
*/
|
|
1147
|
+
akseptTakOgUtgang: (maks) => `Vi sp\xF8r h\xF8yst ${tallord(maks)} ${maks === 1 ? "gang" : "ganger"} underveis. Du kan g\xE5 ut n\xE5r som helst \u2014 ingen vilk\xE5r, ingen avtale.`,
|
|
1148
|
+
akseptTakOgUtgangVilkar: (maks) => `Vi sp\xF8r h\xF8yst ${tallord(maks)} ${maks === 1 ? "gang" : "ganger"} underveis. Du kan g\xE5 ut n\xE5r som helst.`,
|
|
912
1149
|
bliMed: "Bli med",
|
|
913
1150
|
bliMedHint: "Samtykket gjelder bare dette programmet.",
|
|
914
1151
|
/** DD-12: tokenet er engangs og kom i leietakerens egen kanal — plattformen sender aldri. */
|
|
915
1152
|
bliMedUtenToken: "\xC5pne lenken vi sendte deg for \xE5 bli med.",
|
|
916
1153
|
akseptFeil: (arsak) => `Kunne ikke bli med: ${arsak}`,
|
|
917
|
-
// 3c
|
|
1154
|
+
// 3c — deltakelsen og «Gå ut» (DD-36). Kontakttaket står IKKE her (DD-14).
|
|
918
1155
|
deltakelseRegion: "Ditt betaprogram",
|
|
919
|
-
deltakelsePeriode: (periode2, brukt, maks) => `${periode2} \xB7 Vi tar kontakt maks ${maks} ganger \u2014 ${brukt} brukt`,
|
|
920
|
-
deltakelseOppgaverKommer: "Oppgavene kan gj\xF8res n\xE5r det passer deg.",
|
|
921
1156
|
gaaUt: "G\xE5 ut av programmet",
|
|
922
1157
|
gaaUtTittel: "G\xE5 ut av programmet?",
|
|
923
1158
|
gaaUtTekst: (navn) => `Du tas ut av testgruppen med en gang. \xAB${navn}\xBB sl\xE5s av for deg, og vi tar ikke kontakt igjen. Det du allerede har svart, beholdes.`,
|
|
924
1159
|
bliVaerende: "Bli v\xE6rende",
|
|
925
1160
|
gaaUtBekreft: "G\xE5 ut",
|
|
926
|
-
|
|
1161
|
+
/* Programmets sporingslinje (P1 (a), produkteier 2026-09-20): deltakelsen bæres av
|
|
1162
|
+
linjen, ikke av et kvitteringskort — merkefargen er for det som er SENDT (DD-41). */
|
|
1163
|
+
programSporEtikett: "Programmets gang",
|
|
1164
|
+
programBleMed: "Du ble med",
|
|
1165
|
+
programGjort: (gjort, av) => `${gjort} av ${av} gjort`,
|
|
1166
|
+
programOver: "Programmet er over",
|
|
1167
|
+
/** Under nå-leddet, ÉN linje. Aldri «to igjen»: «1 av 3» sier alt tallet sier (DD-08). */
|
|
1168
|
+
programNaarDetPasser: "n\xE5r det passer",
|
|
1169
|
+
// 3c — oppgavene
|
|
927
1170
|
oppgaverTittel: "Oppgavene",
|
|
928
|
-
oppgaveIkkeBegynt: "Ikke begynt",
|
|
929
1171
|
oppgaveGjort: "Gjort",
|
|
930
1172
|
oppgaveGjortLabel: (tittel) => `Gjort: ${tittel}`,
|
|
931
|
-
|
|
1173
|
+
/** Oppgavens ENE meta-linje i `small` (DD-67). Setningen hennes står i `body` under. */
|
|
1174
|
+
oppgaveGjortMeta: (dato, utfall) => `Gjort ${dato} \xB7 ${utfall.toLowerCase()}`,
|
|
1175
|
+
oppgaveTid: (minutter, skjerm) => `ca. ${minutter} min${skjerm ? ` \xB7 ${skjerm}` : ""}`,
|
|
1176
|
+
oppgaveUbekreftet: "Svaret ble ikke bekreftet \u2014 merk den p\xE5 nytt",
|
|
1177
|
+
oppgaveRadA11y: (nr, tittel, status) => `Oppgave ${nr}: ${tittel}, ${status}`,
|
|
1178
|
+
oppgaveIkkeGjort: "ikke gjort",
|
|
1179
|
+
// 3e — «Hvordan gikk det?»: tre lukkede valg, aldri en skala (DD-15)
|
|
932
1180
|
hvordanGikkDet: "Hvordan gikk det?",
|
|
933
1181
|
utfallFungerte: "Fungerte",
|
|
934
1182
|
utfallDelvis: "Fungerte delvis",
|
|
935
1183
|
utfallIkke: "Fungerte ikke",
|
|
936
|
-
setningLabel: "Vil du si \xE9n setning om det?
|
|
937
|
-
|
|
1184
|
+
setningLabel: "Vil du si \xE9n setning om det?",
|
|
1185
|
+
setningValgfritt: "Valgfritt",
|
|
938
1186
|
lagre: "Lagre",
|
|
939
|
-
lagreHint: "Ferdig \u2014 ingen flere sp\xF8rsm\xE5l n\xE5.",
|
|
940
1187
|
/** Etter «Ikke»: feilsporet er vertens — plattformen navigerer aldri selv. */
|
|
941
1188
|
meldFeil: "Meld det som feil",
|
|
942
|
-
meldFeilHint: "Gikk det ikke? Et innspill hjelper oss \xE5 finne ut hvorfor.",
|
|
943
1189
|
svarFeil: (arsak) => `Kunne ikke lagre svaret: ${arsak}`,
|
|
944
|
-
// 3d
|
|
1190
|
+
// 3d — oppfølgingskortene (DD-34): arten avgjør knappene. Ingen kontaktnummer (DD-14).
|
|
945
1191
|
oppfolgingRegion: "Oppf\xF8lging fra betaprogrammet",
|
|
946
|
-
|
|
947
|
-
oppfolgingPaaminnelseHint: (nr, maks) => `Kontakt ${nr} av ${maks} \xB7 planlagt p\xE5minnelse`,
|
|
948
|
-
oppfolgingUtgangHint: (nr, maks) => `Kontakt ${nr} av ${maks} \xB7 den siste vi sender`,
|
|
1192
|
+
oppfolgingKost: "Ett sp\xF8rsm\xE5l \xB7 tar under ett minutt",
|
|
949
1193
|
senere: "Senere",
|
|
950
1194
|
svarNaa: "Svar n\xE5",
|
|
951
1195
|
aapneOppgavene: "\xC5pne oppgavene",
|
|
952
1196
|
// Felles
|
|
953
1197
|
tilbake: "Tilbake",
|
|
954
1198
|
lukk: "Lukk",
|
|
955
|
-
venterPaaNett: "Venter p\xE5 nett
|
|
1199
|
+
venterPaaNett: "Venter p\xE5 nett",
|
|
956
1200
|
feil: "feil",
|
|
957
1201
|
onske: "\xF8nske"
|
|
958
1202
|
};
|
|
959
1203
|
var lofte = {
|
|
960
|
-
venterNett: "Sendes automatisk n\xE5r du er p\xE5 nett
|
|
1204
|
+
venterNett: "Sendes automatisk n\xE5r du er p\xE5 nett."
|
|
961
1205
|
};
|
|
1206
|
+
function kontekstVerdi(felt, verdi) {
|
|
1207
|
+
if (felt === "platform") return plattformOrd(verdi);
|
|
1208
|
+
if (felt === "locale") return spraakOrd(verdi);
|
|
1209
|
+
return verdi;
|
|
1210
|
+
}
|
|
962
1211
|
|
|
963
1212
|
// src/widget/Felt.tsx
|
|
964
1213
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -992,20 +1241,13 @@ function Felt({
|
|
|
992
1241
|
const full = brukt >= textMaxLength;
|
|
993
1242
|
const visTeller = brukt >= textMaxLength * 0.8;
|
|
994
1243
|
const uavklart = funn.find((f) => !beholdt.includes(f.match));
|
|
995
|
-
const linjer = useMemo2(
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
locale: "Spr\xE5k"
|
|
1003
|
-
};
|
|
1004
|
-
return Object.entries(etiketter).map(([felt, etikett]) => {
|
|
1005
|
-
const verdi2 = kontekst[felt];
|
|
1006
|
-
return verdi2 && !fjernedeFelter.includes(felt) ? { felt, etikett, verdi: verdi2 } : null;
|
|
1007
|
-
}).filter((x) => x !== null);
|
|
1008
|
-
}, [kontekst, fjernedeFelter]);
|
|
1244
|
+
const linjer = useMemo2(
|
|
1245
|
+
() => Object.entries(tekst.kontekstEtiketter).map(([felt, etikett]) => {
|
|
1246
|
+
const r\u00E5 = kontekst[felt];
|
|
1247
|
+
return r\u00E5 && !fjernedeFelter.includes(felt) ? { felt, etikett, verdi: kontekstVerdi(felt, r\u00E5) } : null;
|
|
1248
|
+
}).filter((x) => x !== null),
|
|
1249
|
+
[kontekst, fjernedeFelter]
|
|
1250
|
+
);
|
|
1009
1251
|
return /* @__PURE__ */ jsxs2(View2, { testID: "skjema", style: { flexGrow: 1, flexShrink: 1, gap: tema.space.md }, children: [
|
|
1010
1252
|
/* @__PURE__ */ jsxs2(
|
|
1011
1253
|
ScrollView,
|
|
@@ -1062,8 +1304,8 @@ function Felt({
|
|
|
1062
1304
|
accessibilityLiveRegion: "polite",
|
|
1063
1305
|
style: {
|
|
1064
1306
|
color: tema.color.warning,
|
|
1065
|
-
fontSize: tema.font.
|
|
1066
|
-
lineHeight: tema.lineHeight.
|
|
1307
|
+
fontSize: tema.font.body,
|
|
1308
|
+
lineHeight: tema.lineHeight.body,
|
|
1067
1309
|
fontWeight: tema.weight.medium
|
|
1068
1310
|
},
|
|
1069
1311
|
children: tekst.monsterSpm[uavklart.kind]
|
|
@@ -1200,17 +1442,16 @@ function Felt({
|
|
|
1200
1442
|
bildeNotat ? /* @__PURE__ */ jsx3(View2, { testID: "bilde-notat", children: /* @__PURE__ */ jsx3(Hint, { children: bildeNotat }) }) : null
|
|
1201
1443
|
] })
|
|
1202
1444
|
) : null,
|
|
1203
|
-
/* @__PURE__ */ jsxs2(View2, { style: { borderTopWidth: tema.hairline, borderTopColor: tema.color.border, paddingTop: tema.space.
|
|
1204
|
-
/* @__PURE__ */
|
|
1445
|
+
/* @__PURE__ */ jsxs2(View2, { style: { borderTopWidth: tema.hairline, borderTopColor: tema.color.border, paddingTop: tema.space.xs }, children: [
|
|
1446
|
+
/* @__PURE__ */ jsxs2(
|
|
1205
1447
|
Pressable2,
|
|
1206
1448
|
{
|
|
1207
1449
|
testID: "kontekst-bryter",
|
|
1208
1450
|
accessibilityRole: "button",
|
|
1209
1451
|
accessibilityState: { expanded: apen },
|
|
1210
|
-
accessibilityLabel: `${tekst.kontekstLinje}${apen ? "" : tekst.kontekstVis}`,
|
|
1211
1452
|
onPress: () => setApen((a) => !a),
|
|
1212
|
-
style: { minHeight: tema.touch,
|
|
1213
|
-
children:
|
|
1453
|
+
style: { minHeight: tema.touch, flexDirection: "row", alignItems: "center", gap: tema.space.sm },
|
|
1454
|
+
children: [
|
|
1214
1455
|
/* @__PURE__ */ jsx3(
|
|
1215
1456
|
Ikon,
|
|
1216
1457
|
{
|
|
@@ -1219,11 +1460,9 @@ function Felt({
|
|
|
1219
1460
|
farge: tema.color.textSecondary
|
|
1220
1461
|
}
|
|
1221
1462
|
),
|
|
1222
|
-
/* @__PURE__ */
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
] })
|
|
1226
|
-
] })
|
|
1463
|
+
/* @__PURE__ */ jsx3(Text2, { style: { flex: 1, color: tema.color.textSecondary, fontSize: tema.font.body, lineHeight: tema.lineHeight.body }, children: apen ? tekst.kontekstLinjeApen : tekst.kontekstLinjeLukket }),
|
|
1464
|
+
/* @__PURE__ */ jsx3(Text2, { style: { color: tema.color.actionSecondaryText, fontSize: tema.font.body, fontWeight: tema.weight.semibold }, children: apen ? tekst.kontekstSkjul : tekst.kontekstVis })
|
|
1465
|
+
]
|
|
1227
1466
|
}
|
|
1228
1467
|
),
|
|
1229
1468
|
apen ? /* @__PURE__ */ jsxs2(View2, { children: [
|
|
@@ -1233,26 +1472,29 @@ function Felt({
|
|
|
1233
1472
|
style: {
|
|
1234
1473
|
flexDirection: "row",
|
|
1235
1474
|
alignItems: "center",
|
|
1236
|
-
gap: tema.space.
|
|
1475
|
+
gap: tema.space.md,
|
|
1237
1476
|
minHeight: tema.touch,
|
|
1238
|
-
|
|
1239
|
-
|
|
1477
|
+
borderTopWidth: tema.hairline,
|
|
1478
|
+
borderTopColor: tema.color.border
|
|
1240
1479
|
},
|
|
1241
1480
|
children: [
|
|
1242
|
-
/* @__PURE__ */ jsx3(
|
|
1243
|
-
/* @__PURE__ */ jsx3(
|
|
1481
|
+
/* @__PURE__ */ jsx3(Meta, { testID: `kontekst-etikett-${l.felt}`, children: l.etikett }),
|
|
1482
|
+
/* @__PURE__ */ jsx3(View2, { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsx3(
|
|
1483
|
+
Text2,
|
|
1484
|
+
{
|
|
1485
|
+
testID: `kontekst-verdi-${l.felt}`,
|
|
1486
|
+
style: { color: tema.color.textPrimary, fontSize: tema.font.body, lineHeight: tema.lineHeight.body, fontWeight: tema.weight.semibold },
|
|
1487
|
+
children: l.verdi
|
|
1488
|
+
}
|
|
1489
|
+
) }),
|
|
1244
1490
|
/* @__PURE__ */ jsx3(
|
|
1245
|
-
|
|
1491
|
+
Tekstknapp,
|
|
1246
1492
|
{
|
|
1247
1493
|
testID: `fjern-${l.felt}`,
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
children: /* @__PURE__ */ jsxs2(View2, { style: { flexDirection: "row", alignItems: "center", gap: tema.space.xs }, children: [
|
|
1253
|
-
/* @__PURE__ */ jsx3(Ikon, { navn: "close-outline", storrelse: "minste", farge: tema.color.textSecondary }),
|
|
1254
|
-
/* @__PURE__ */ jsx3(Text2, { style: { color: tema.color.textSecondary, fontSize: tema.font.small }, children: tekst.kontekstFjern })
|
|
1255
|
-
] })
|
|
1494
|
+
ikon: "close-outline",
|
|
1495
|
+
label: tekst.kontekstFjern,
|
|
1496
|
+
accessibilityLabel: tekst.kontekstFjernA11y(l.etikett),
|
|
1497
|
+
onPress: () => onFjernKontekst(l.felt)
|
|
1256
1498
|
}
|
|
1257
1499
|
)
|
|
1258
1500
|
]
|
|
@@ -1284,26 +1526,23 @@ function Felt({
|
|
|
1284
1526
|
import "react";
|
|
1285
1527
|
import { Pressable as Pressable3, Text as Text3, View as View3 } from "react-native";
|
|
1286
1528
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1287
|
-
function Valg({ onVelg }) {
|
|
1529
|
+
function Valg({ onVelg, anonym }) {
|
|
1288
1530
|
const tema = useTema();
|
|
1289
|
-
const
|
|
1531
|
+
const rad = (spor, ikon, label, under, forst) => /* @__PURE__ */ jsxs3(
|
|
1290
1532
|
Pressable3,
|
|
1291
1533
|
{
|
|
1292
1534
|
testID: `spor-${spor}`,
|
|
1293
1535
|
accessibilityRole: "button",
|
|
1294
|
-
accessibilityLabel: `${label}
|
|
1536
|
+
accessibilityLabel: `${label}, ${under}`,
|
|
1295
1537
|
onPress: () => onVelg(spor),
|
|
1296
1538
|
style: {
|
|
1297
|
-
|
|
1298
|
-
minHeight: tema.touch * 3,
|
|
1299
|
-
backgroundColor: tema.color.surface,
|
|
1300
|
-
borderWidth: tema.hairline,
|
|
1301
|
-
borderColor: tema.color.borderStrong,
|
|
1302
|
-
borderRadius: tema.radius.lg,
|
|
1539
|
+
flexDirection: "row",
|
|
1303
1540
|
alignItems: "center",
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1541
|
+
gap: tema.space.md,
|
|
1542
|
+
minHeight: tema.touch + tema.space.lg,
|
|
1543
|
+
paddingVertical: tema.space.sm,
|
|
1544
|
+
borderTopWidth: forst ? 0 : tema.hairline,
|
|
1545
|
+
borderTopColor: tema.color.border
|
|
1307
1546
|
},
|
|
1308
1547
|
children: [
|
|
1309
1548
|
/* @__PURE__ */ jsx4(
|
|
@@ -1311,8 +1550,8 @@ function Valg({ onVelg }) {
|
|
|
1311
1550
|
{
|
|
1312
1551
|
testID: `spor-${spor}-ikonflate`,
|
|
1313
1552
|
style: {
|
|
1314
|
-
width:
|
|
1315
|
-
height:
|
|
1553
|
+
width: tema.touch + tema.space.sm,
|
|
1554
|
+
height: tema.touch + tema.space.sm,
|
|
1316
1555
|
borderRadius: tema.radius.pill,
|
|
1317
1556
|
backgroundColor: tema.color.brandBg,
|
|
1318
1557
|
alignItems: "center",
|
|
@@ -1321,28 +1560,21 @@ function Valg({ onVelg }) {
|
|
|
1321
1560
|
children: /* @__PURE__ */ jsx4(Ikon, { navn: ikon, storrelse: "stor", farge: tema.color.brand })
|
|
1322
1561
|
}
|
|
1323
1562
|
),
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
-
Text3,
|
|
1326
|
-
{
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
fontSize: tema.font.h3,
|
|
1330
|
-
fontWeight: tema.weight.semibold,
|
|
1331
|
-
textAlign: "center"
|
|
1332
|
-
},
|
|
1333
|
-
children: label
|
|
1334
|
-
}
|
|
1335
|
-
),
|
|
1336
|
-
/* @__PURE__ */ jsx4(Text3, { style: { color: tema.color.textMuted, fontSize: tema.font.small, textAlign: "center" }, children: under })
|
|
1563
|
+
/* @__PURE__ */ jsxs3(View3, { style: { flex: 1, minWidth: 0 }, children: [
|
|
1564
|
+
/* @__PURE__ */ jsx4(Text3, { style: { color: tema.color.textPrimary, fontSize: tema.font.body, lineHeight: tema.lineHeight.body, fontWeight: tema.weight.semibold }, children: label }),
|
|
1565
|
+
/* @__PURE__ */ jsx4(Text3, { style: { color: tema.color.textMuted, fontSize: tema.font.small, lineHeight: tema.lineHeight.small }, children: under })
|
|
1566
|
+
] }),
|
|
1567
|
+
/* @__PURE__ */ jsx4(Ikon, { navn: "chevron-forward-outline", storrelse: "minste", farge: tema.color.textMuted })
|
|
1337
1568
|
]
|
|
1338
1569
|
}
|
|
1339
1570
|
);
|
|
1340
|
-
return /* @__PURE__ */ jsxs3(View3, { style: {
|
|
1571
|
+
return /* @__PURE__ */ jsxs3(View3, { style: { gap: tema.space.lg }, children: [
|
|
1341
1572
|
/* @__PURE__ */ jsx4(H, { children: tekst.valgTittel }),
|
|
1342
|
-
/* @__PURE__ */
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
] })
|
|
1573
|
+
/* @__PURE__ */ jsxs3(View3, { children: [
|
|
1574
|
+
rad("feil", "bug", tekst.sporFeil, tekst.sporFeilUnder, true),
|
|
1575
|
+
rad("onske", "bulb", tekst.sporOnske, tekst.sporOnskeUnder, false)
|
|
1576
|
+
] }),
|
|
1577
|
+
anonym ? /* @__PURE__ */ jsx4(Hint, { children: tekst.sendAnonymtHint }) : null
|
|
1346
1578
|
] });
|
|
1347
1579
|
}
|
|
1348
1580
|
|
|
@@ -1361,84 +1593,102 @@ function KjenteFeil({
|
|
|
1361
1593
|
onNei
|
|
1362
1594
|
}) {
|
|
1363
1595
|
const tema = useTema();
|
|
1596
|
+
const tittel = spor === "onske" ? tekst.kjenteFeilTittelOnske : tekst.kjenteFeilTittelFeil;
|
|
1364
1597
|
if (laster) {
|
|
1365
1598
|
return /* @__PURE__ */ jsxs4(View4, { style: { flex: 1, gap: tema.space.md }, children: [
|
|
1366
|
-
/* @__PURE__ */ jsx5(H, {
|
|
1599
|
+
/* @__PURE__ */ jsx5(H, { children: tittel }),
|
|
1367
1600
|
/* @__PURE__ */ jsx5(ActivityIndicator, { accessibilityLabel: "Sjekker kjente feil", color: tema.color.textSecondary })
|
|
1368
1601
|
] });
|
|
1369
1602
|
}
|
|
1370
1603
|
return /* @__PURE__ */ jsxs4(View4, { testID: "kjente-feil", style: { flexGrow: 1, flexShrink: 1, gap: tema.space.md }, children: [
|
|
1371
|
-
/* @__PURE__ */ jsx5(H, {
|
|
1604
|
+
/* @__PURE__ */ jsx5(H, { children: tittel }),
|
|
1372
1605
|
/* @__PURE__ */ jsx5(
|
|
1373
1606
|
ScrollView2,
|
|
1374
1607
|
{
|
|
1375
1608
|
testID: "kjente-feil-liste",
|
|
1376
1609
|
style: { flexGrow: 0, flexShrink: 1 },
|
|
1377
|
-
contentContainerStyle: { gap: tema.space.md },
|
|
1378
1610
|
keyboardShouldPersistTaps: "handled",
|
|
1379
|
-
children: kort.slice(0, MAKS_KORT).map((k) => {
|
|
1611
|
+
children: kort.slice(0, MAKS_KORT).map((k, i) => {
|
|
1380
1612
|
const o = knownIssueStatus[k.status] ?? knownIssueStatus.aktiv;
|
|
1381
|
-
const
|
|
1382
|
-
const
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1613
|
+
const rettet = k.status === "fikset";
|
|
1614
|
+
const statusOrd = rettet && k.fixedIn ? tekst.rettetI(k.fixedIn) : o.etikett;
|
|
1615
|
+
const tillegg = !rettet && k.fixedIn ? `\xB7 ${tekst.rettesI(k.fixedIn).toLowerCase()}` : void 0;
|
|
1616
|
+
const gruppe = tekst.kjentFeilGruppe(k.title, statusOrd, tillegg?.replace("\xB7 ", ""));
|
|
1617
|
+
return /* @__PURE__ */ jsxs4(
|
|
1618
|
+
View4,
|
|
1619
|
+
{
|
|
1620
|
+
testID: `kjent-feil-${k.id}`,
|
|
1621
|
+
style: {
|
|
1622
|
+
gap: tema.space.sm,
|
|
1623
|
+
paddingVertical: tema.space.md,
|
|
1624
|
+
borderTopWidth: i === 0 ? 0 : tema.hairline,
|
|
1625
|
+
borderTopColor: tema.color.border
|
|
1626
|
+
},
|
|
1627
|
+
children: [
|
|
1628
|
+
/* @__PURE__ */ jsx5(
|
|
1629
|
+
Text4,
|
|
1630
|
+
{
|
|
1631
|
+
testID: `kjent-feil-tittel-${k.id}`,
|
|
1632
|
+
style: {
|
|
1633
|
+
color: tema.color.textPrimary,
|
|
1634
|
+
fontSize: tema.font.body,
|
|
1635
|
+
lineHeight: tema.lineHeight.body,
|
|
1636
|
+
fontWeight: tema.weight.semibold
|
|
1637
|
+
},
|
|
1638
|
+
children: k.title
|
|
1639
|
+
}
|
|
1640
|
+
),
|
|
1641
|
+
k.workaround ? /* @__PURE__ */ jsxs4(Sek, { testID: `kjent-feil-omvei-${k.id}`, children: [
|
|
1405
1642
|
tekst.omvei,
|
|
1406
1643
|
" ",
|
|
1407
1644
|
k.workaround
|
|
1408
|
-
]
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1645
|
+
] }) : null,
|
|
1646
|
+
/* @__PURE__ */ jsxs4(View4, { style: { flexDirection: "row", alignItems: "center", gap: tema.space.sm, flexWrap: "wrap" }, children: [
|
|
1647
|
+
/* @__PURE__ */ jsxs4(View4, { style: { flexDirection: "row", alignItems: "center", gap: tema.space.xs }, children: [
|
|
1648
|
+
/* @__PURE__ */ jsx5(Ikon, { navn: o.ikon, storrelse: "minste", farge: tema.color[o.fg] }),
|
|
1649
|
+
/* @__PURE__ */ jsx5(
|
|
1650
|
+
Text4,
|
|
1651
|
+
{
|
|
1652
|
+
style: {
|
|
1653
|
+
color: tema.color[o.fg],
|
|
1654
|
+
fontSize: tema.font.small,
|
|
1655
|
+
lineHeight: tema.lineHeight.small,
|
|
1656
|
+
fontWeight: tema.weight.semibold
|
|
1657
|
+
},
|
|
1658
|
+
children: statusOrd
|
|
1659
|
+
}
|
|
1660
|
+
)
|
|
1661
|
+
] }),
|
|
1662
|
+
tillegg ? /* @__PURE__ */ jsx5(Text4, { style: { color: tema.color.textMuted, fontSize: tema.font.small, lineHeight: tema.lineHeight.small }, children: tillegg }) : null
|
|
1663
|
+
] }),
|
|
1664
|
+
/* @__PURE__ */ jsxs4(View4, { style: { flexDirection: "row", alignItems: "center", gap: tema.space.md }, children: [
|
|
1665
|
+
/* @__PURE__ */ jsx5(
|
|
1666
|
+
Btn,
|
|
1667
|
+
{
|
|
1668
|
+
variant: "tonet",
|
|
1669
|
+
testID: `ja-ogsa-${k.id}`,
|
|
1670
|
+
label: tekst.svarJa,
|
|
1671
|
+
accessibilityLabel: `${tekst.svarJa}. ${gruppe}`,
|
|
1672
|
+
disabled: sender,
|
|
1673
|
+
busy: sender,
|
|
1674
|
+
onPress: () => onJaOgsa(k)
|
|
1675
|
+
}
|
|
1676
|
+
),
|
|
1677
|
+
/* @__PURE__ */ jsx5(
|
|
1678
|
+
Tekstknapp,
|
|
1679
|
+
{
|
|
1680
|
+
testID: `ligner-${k.id}`,
|
|
1681
|
+
label: tekst.svarLigner,
|
|
1682
|
+
accessibilityLabel: `${tekst.svarLigner}. ${gruppe}`,
|
|
1683
|
+
disabled: sender,
|
|
1684
|
+
onPress: () => onLigner(k)
|
|
1685
|
+
}
|
|
1686
|
+
)
|
|
1687
|
+
] })
|
|
1688
|
+
]
|
|
1689
|
+
},
|
|
1690
|
+
k.id
|
|
1691
|
+
);
|
|
1442
1692
|
})
|
|
1443
1693
|
}
|
|
1444
1694
|
),
|
|
@@ -1448,6 +1698,10 @@ function KjenteFeil({
|
|
|
1448
1698
|
|
|
1449
1699
|
// src/widget/Kvittering.tsx
|
|
1450
1700
|
import "react";
|
|
1701
|
+
import { Text as Text6, View as View6 } from "react-native";
|
|
1702
|
+
|
|
1703
|
+
// src/widget/Sporingslinje.tsx
|
|
1704
|
+
import "react";
|
|
1451
1705
|
import { Text as Text5, View as View5 } from "react-native";
|
|
1452
1706
|
|
|
1453
1707
|
// src/widget/status.ts
|
|
@@ -1456,6 +1710,12 @@ function formaterFrist(iso) {
|
|
|
1456
1710
|
if (Number.isNaN(d.getTime())) return iso;
|
|
1457
1711
|
return new Intl.DateTimeFormat("nb-NO", { day: "numeric", month: "long" }).format(d);
|
|
1458
1712
|
}
|
|
1713
|
+
var KORT_MANED = ["jan", "feb", "mar", "apr", "mai", "jun", "jul", "aug", "sep", "okt", "nov", "des"];
|
|
1714
|
+
function formaterKortFrist(iso) {
|
|
1715
|
+
const d = new Date(iso);
|
|
1716
|
+
if (Number.isNaN(d.getTime())) return iso;
|
|
1717
|
+
return `${d.getDate()}. ${KORT_MANED[d.getMonth()]}`;
|
|
1718
|
+
}
|
|
1459
1719
|
function statusVisning(status, type, deadlineAt) {
|
|
1460
1720
|
const o = submissionStatus[status];
|
|
1461
1721
|
const spor = type === "onske" ? "onske" : "feil";
|
|
@@ -1479,68 +1739,267 @@ var venterVisning = {
|
|
|
1479
1739
|
lofte: lofte.venterNett
|
|
1480
1740
|
};
|
|
1481
1741
|
|
|
1482
|
-
// src/widget/
|
|
1742
|
+
// src/widget/Sporingslinje.tsx
|
|
1483
1743
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1744
|
+
var HOVEDLINJE = ["ny", "vurderes", "planlagt", "bygges", "levert"];
|
|
1745
|
+
function erApen(rad) {
|
|
1746
|
+
if (rad.pending === true) return false;
|
|
1747
|
+
return rad.statusType === "reviewing" || rad.statusType === "active";
|
|
1748
|
+
}
|
|
1749
|
+
function sporingsledd(rad, tenantName, naa = /* @__PURE__ */ new Date()) {
|
|
1750
|
+
if (rad.pending === true || !erApen(rad)) return [];
|
|
1751
|
+
const type = rad.type;
|
|
1752
|
+
const navn = (status) => statusVisning(status, type).etikett;
|
|
1753
|
+
const ikon = (status) => statusVisning(status, type).ikon;
|
|
1754
|
+
const ledd = [];
|
|
1755
|
+
if (rad.status === "kjent_feil") {
|
|
1756
|
+
ledd.push({ nokkel: "ny", etikett: navn("ny"), tilstand: "gjort", detalj: formaterFrist(rad.createdAt) });
|
|
1757
|
+
ledd.push({ nokkel: "kjent_feil", etikett: navn("kjent_feil"), tilstand: "naa", ikon: ikon("kjent_feil"), detalj: formaterFrist(rad.statusChangedAt) });
|
|
1758
|
+
ledd.push({ nokkel: "slutt", etikett: navn("levert"), tilstand: "kommer", detalj: tekst.sporIngenDato });
|
|
1759
|
+
return ledd;
|
|
1760
|
+
}
|
|
1761
|
+
const naaIndeks = HOVEDLINJE.indexOf(rad.status);
|
|
1762
|
+
if (naaIndeks < 0) return [];
|
|
1763
|
+
for (let i = 0; i <= naaIndeks; i++) {
|
|
1764
|
+
const status = HOVEDLINJE[i];
|
|
1765
|
+
const erNaa = i === naaIndeks;
|
|
1766
|
+
ledd.push({
|
|
1767
|
+
nokkel: status,
|
|
1768
|
+
etikett: navn(status),
|
|
1769
|
+
tilstand: erNaa ? "naa" : "gjort",
|
|
1770
|
+
...erNaa ? { ikon: ikon(status) } : {},
|
|
1771
|
+
// Mottatt har `createdAt`, nå-leddet har `statusChangedAt`. Et passert ledd mellom dem
|
|
1772
|
+
// har ingen dato i kontrakten, og får derfor ingen.
|
|
1773
|
+
...i === 0 ? { detalj: formaterFrist(rad.createdAt) } : erNaa ? { detalj: formaterFrist(rad.statusChangedAt) } : {}
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
if (rad.status === "ny") {
|
|
1777
|
+
ledd.push({
|
|
1778
|
+
nokkel: "vurderes",
|
|
1779
|
+
etikett: navn("vurderes"),
|
|
1780
|
+
tilstand: "kommer",
|
|
1781
|
+
detalj: tenantName ? tekst.sporNaarTenantTarDen(tenantName) : tekst.sporNaarDenTasOpp
|
|
1782
|
+
});
|
|
1783
|
+
}
|
|
1784
|
+
if (rad.statusType === "reviewing") {
|
|
1785
|
+
const frist = rad.deadlineAt;
|
|
1786
|
+
const gatt = frist !== void 0 && rad.status === "vurderes" && new Date(frist).getTime() < naa.getTime();
|
|
1787
|
+
ledd.push(
|
|
1788
|
+
gatt ? { nokkel: "slutt", etikett: tekst.sporFristenErGatt, tilstand: "brutt", ikon: "warning-outline", tall: formaterKortFrist(frist) } : {
|
|
1789
|
+
nokkel: "slutt",
|
|
1790
|
+
etikett: tekst.sporSvarInnen,
|
|
1791
|
+
tilstand: "kommer",
|
|
1792
|
+
...frist ? { tall: formaterKortFrist(frist) } : { detalj: tekst.sporDatoenSettes }
|
|
1793
|
+
}
|
|
1794
|
+
);
|
|
1795
|
+
} else {
|
|
1796
|
+
ledd.push({ nokkel: "slutt", etikett: navn("levert"), tilstand: "kommer", detalj: tekst.sporIngenDato });
|
|
1797
|
+
}
|
|
1798
|
+
return ledd;
|
|
1799
|
+
}
|
|
1800
|
+
function Sporingslinje({
|
|
1801
|
+
ledd,
|
|
1802
|
+
testID,
|
|
1803
|
+
etikett = tekst.sporEtikett
|
|
1804
|
+
}) {
|
|
1805
|
+
const tema = useTema();
|
|
1806
|
+
if (ledd.length === 0) return null;
|
|
1807
|
+
const farge = (l) => l.tilstand === "brutt" ? tema.color.warning : l.tilstand === "gjort" ? tema.color.success : l.tilstand === "naa" ? tema.color.brand : tema.color.borderStrong;
|
|
1808
|
+
return /* @__PURE__ */ jsx6(
|
|
1809
|
+
View5,
|
|
1810
|
+
{
|
|
1811
|
+
testID,
|
|
1812
|
+
accessibilityRole: "list",
|
|
1813
|
+
accessibilityLabel: etikett,
|
|
1814
|
+
style: { flexDirection: "row", alignItems: "flex-start", gap: tema.space.xs },
|
|
1815
|
+
children: ledd.map((l, i) => {
|
|
1816
|
+
const siste = i === ledd.length - 1;
|
|
1817
|
+
const c = farge(l);
|
|
1818
|
+
return /* @__PURE__ */ jsxs5(
|
|
1819
|
+
View5,
|
|
1820
|
+
{
|
|
1821
|
+
testID: testID ? `${testID}-ledd-${l.nokkel}` : void 0,
|
|
1822
|
+
style: siste ? { flexShrink: 0, gap: tema.space.xs } : { flex: 1, minWidth: 0, gap: tema.space.xs },
|
|
1823
|
+
children: [
|
|
1824
|
+
/* @__PURE__ */ jsxs5(View5, { style: { flexDirection: "row", alignItems: "center", gap: tema.space.xs }, children: [
|
|
1825
|
+
/* @__PURE__ */ jsx6(
|
|
1826
|
+
View5,
|
|
1827
|
+
{
|
|
1828
|
+
style: {
|
|
1829
|
+
width: tema.space.lg,
|
|
1830
|
+
height: tema.space.lg,
|
|
1831
|
+
borderRadius: tema.radius.pill,
|
|
1832
|
+
borderWidth: tema.hairline * 2,
|
|
1833
|
+
borderColor: c,
|
|
1834
|
+
borderStyle: l.tilstand === "kommer" ? "dashed" : "solid",
|
|
1835
|
+
backgroundColor: l.tilstand === "gjort" ? tema.color.success : "transparent",
|
|
1836
|
+
alignItems: "center",
|
|
1837
|
+
justifyContent: "center"
|
|
1838
|
+
},
|
|
1839
|
+
children: l.tilstand === "gjort" ? /* @__PURE__ */ jsx6(Ikon, { navn: "checkmark-outline", storrelse: "minste", farge: tema.color.bg }) : l.ikon ? /* @__PURE__ */ jsx6(Ikon, { navn: l.ikon, storrelse: "minste", farge: c }) : null
|
|
1840
|
+
}
|
|
1841
|
+
),
|
|
1842
|
+
!siste ? /* @__PURE__ */ jsx6(
|
|
1843
|
+
View5,
|
|
1844
|
+
{
|
|
1845
|
+
style: {
|
|
1846
|
+
flex: 1,
|
|
1847
|
+
height: tema.hairline * 2,
|
|
1848
|
+
borderRadius: tema.radius.pill,
|
|
1849
|
+
backgroundColor: l.tilstand === "gjort" ? tema.color.success : tema.color.borderStrong
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
) : null
|
|
1853
|
+
] }),
|
|
1854
|
+
/* @__PURE__ */ jsx6(
|
|
1855
|
+
Text5,
|
|
1856
|
+
{
|
|
1857
|
+
style: {
|
|
1858
|
+
color: l.tilstand === "brutt" ? tema.color.warning : l.tilstand === "kommer" ? tema.color.textMuted : tema.color.textPrimary,
|
|
1859
|
+
fontSize: tema.font.small,
|
|
1860
|
+
lineHeight: tema.lineHeight.small,
|
|
1861
|
+
fontWeight: l.tilstand === "naa" || l.tilstand === "brutt" ? tema.weight.semibold : tema.weight.regular
|
|
1862
|
+
},
|
|
1863
|
+
children: l.etikett
|
|
1864
|
+
}
|
|
1865
|
+
),
|
|
1866
|
+
l.tall !== void 0 ? /* @__PURE__ */ jsx6(Helt, { testID: testID ? `${testID}-tall` : void 0, farge: l.tilstand === "brutt" ? tema.color.warning : tema.color.textPrimary, children: l.tall }) : l.detalj !== void 0 ? /* @__PURE__ */ jsx6(Text5, { style: { color: tema.color.textMuted, fontSize: tema.font.small, lineHeight: tema.lineHeight.small }, children: l.detalj }) : null
|
|
1867
|
+
]
|
|
1868
|
+
},
|
|
1869
|
+
l.nokkel
|
|
1870
|
+
);
|
|
1871
|
+
})
|
|
1872
|
+
}
|
|
1873
|
+
);
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
// src/widget/Kvittering.tsx
|
|
1877
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1484
1878
|
function Kvittering({
|
|
1485
1879
|
art,
|
|
1486
1880
|
saksnummer,
|
|
1487
1881
|
vedlegg,
|
|
1488
1882
|
frist,
|
|
1883
|
+
sak,
|
|
1884
|
+
anonym,
|
|
1885
|
+
tenantName,
|
|
1489
1886
|
onLukk
|
|
1490
1887
|
}) {
|
|
1491
1888
|
const tema = useTema();
|
|
1492
|
-
const
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
//
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
k\u00F8: { h: tekst.koKvitteringTittel, p: tekst.offlineBanner }
|
|
1889
|
+
const ko = art === "k\xF8";
|
|
1890
|
+
const helt = {
|
|
1891
|
+
feil: tekst.kvitteringFeil,
|
|
1892
|
+
// Løftet er NØYAKTIG det «Mine innspill» og panelet viser for «Vurderes»: det leses fra
|
|
1893
|
+
// temaet, så kvitteringen og statusen ikke kan si to ting.
|
|
1894
|
+
onske: statusVisning("vurderes", "onske", frist).lofte,
|
|
1895
|
+
jaOgsa: tekst.kvitteringJaOgsa,
|
|
1896
|
+
k\u00F8: tekst.koHelt
|
|
1501
1897
|
}[art];
|
|
1502
|
-
const
|
|
1503
|
-
const
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
style: {
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1898
|
+
const dato = formaterFrist(sak?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString());
|
|
1899
|
+
const etikett = vedlegg === "feilet" ? tekst.kvitteringVedleggFeilet : ko ? tekst.kvitteringLagretDato(dato) : art === "jaOgsa" ? tekst.kvitteringRegistrertDato(dato) : anonym ? tekst.kvitteringSendtAnonymtDato(dato) : tekst.kvitteringSendtDato(dato);
|
|
1900
|
+
const ledd = sak && !ko ? sporingsledd(sak, tenantName) : [];
|
|
1901
|
+
const under = anonym ? void 0 : ko ? tekst.koUnder : saksnummer ? tekst.kvitteringUnder : void 0;
|
|
1902
|
+
return /* @__PURE__ */ jsxs6(View6, { testID: "kvittering", style: { flex: 1, gap: tema.space.md }, children: [
|
|
1903
|
+
vedlegg === "feilet" ? /* @__PURE__ */ jsx7(Banner, { ikon: "warning-outline", tone: "warning", children: tekst.vedleggFeiletBanner }) : null,
|
|
1904
|
+
vedlegg === "forkastet" ? /* @__PURE__ */ jsx7(Banner, { ikon: "image-outline", tone: "info", children: tekst.offlineUtenBilde }) : null,
|
|
1905
|
+
/* @__PURE__ */ jsxs6(
|
|
1906
|
+
View6,
|
|
1907
|
+
{
|
|
1908
|
+
testID: "kvittering-kort",
|
|
1909
|
+
style: {
|
|
1910
|
+
backgroundColor: ko ? tema.color.surface : tema.color.brandFill,
|
|
1911
|
+
borderRadius: tema.radius.lg,
|
|
1912
|
+
borderWidth: ko ? tema.hairline : 0,
|
|
1913
|
+
borderStyle: ko ? "dashed" : "solid",
|
|
1914
|
+
borderColor: tema.color.borderInteractive,
|
|
1915
|
+
padding: tema.space.md,
|
|
1916
|
+
gap: tema.space.md
|
|
1917
|
+
},
|
|
1918
|
+
children: [
|
|
1919
|
+
/* @__PURE__ */ jsxs6(View6, { style: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", gap: tema.space.sm }, children: [
|
|
1920
|
+
/* @__PURE__ */ jsxs6(View6, { style: { flexDirection: "row", alignItems: "center", gap: tema.space.sm, flexShrink: 1 }, children: [
|
|
1921
|
+
/* @__PURE__ */ jsx7(
|
|
1922
|
+
Ikon,
|
|
1923
|
+
{
|
|
1924
|
+
navn: ko ? "swap-vertical-outline" : "checkmark-circle-outline",
|
|
1925
|
+
farge: ko ? tema.color.textSecondary : tema.color.onBrandFill
|
|
1926
|
+
}
|
|
1927
|
+
),
|
|
1928
|
+
tenantName ? /* @__PURE__ */ jsx7(
|
|
1929
|
+
Text6,
|
|
1930
|
+
{
|
|
1931
|
+
style: {
|
|
1932
|
+
color: ko ? tema.color.textPrimary : tema.color.onBrandFill,
|
|
1933
|
+
fontSize: tema.font.body,
|
|
1934
|
+
fontWeight: tema.weight.bold
|
|
1935
|
+
},
|
|
1936
|
+
children: tenantName
|
|
1937
|
+
}
|
|
1938
|
+
) : null
|
|
1939
|
+
] }),
|
|
1940
|
+
ko ? /* @__PURE__ */ jsxs6(View6, { style: { flexDirection: "row", alignItems: "center", gap: tema.space.xs }, children: [
|
|
1941
|
+
/* @__PURE__ */ jsx7(Ikon, { navn: "cloud-offline-outline", storrelse: "minste", farge: tema.color.textMuted }),
|
|
1942
|
+
/* @__PURE__ */ jsx7(Text6, { style: { color: tema.color.textMuted, fontSize: tema.font.small, fontWeight: tema.weight.semibold }, children: tekst.koIngenNett })
|
|
1943
|
+
] }) : saksnummer ? /* @__PURE__ */ jsx7(
|
|
1944
|
+
Text6,
|
|
1945
|
+
{
|
|
1946
|
+
style: { color: tema.color.onBrandFill, fontSize: tema.font.small, fontWeight: tema.weight.semibold },
|
|
1947
|
+
children: vedlegg === "feilet" ? tekst.saksnummerUtenVedlegg(saksnummer) : tekst.saksnummer(saksnummer)
|
|
1948
|
+
}
|
|
1949
|
+
) : null
|
|
1950
|
+
] }),
|
|
1951
|
+
/* @__PURE__ */ jsxs6(View6, { style: { gap: tema.space.xs }, children: [
|
|
1952
|
+
/* @__PURE__ */ jsx7(
|
|
1953
|
+
Text6,
|
|
1954
|
+
{
|
|
1955
|
+
style: {
|
|
1956
|
+
color: ko ? tema.color.textMuted : tema.color.onBrandFill,
|
|
1957
|
+
fontSize: tema.font.small,
|
|
1958
|
+
lineHeight: tema.lineHeight.small
|
|
1959
|
+
},
|
|
1960
|
+
children: etikett
|
|
1961
|
+
}
|
|
1962
|
+
),
|
|
1963
|
+
/* @__PURE__ */ jsx7(Helt, { testID: "kvittering-tekst", live: true, farge: ko ? tema.color.textPrimary : tema.color.onBrandFill, children: vedlegg === "feilet" ? `${tekst.tekstenErLagret} ${helt}` : helt })
|
|
1964
|
+
] }),
|
|
1965
|
+
under ? /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1966
|
+
/* @__PURE__ */ jsx7(
|
|
1967
|
+
View6,
|
|
1968
|
+
{
|
|
1969
|
+
style: {
|
|
1970
|
+
borderTopWidth: tema.hairline,
|
|
1971
|
+
borderTopColor: ko ? tema.color.borderStrong : tema.color.onBrandFill,
|
|
1972
|
+
borderStyle: "dashed"
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
),
|
|
1976
|
+
/* @__PURE__ */ jsx7(
|
|
1977
|
+
Text6,
|
|
1978
|
+
{
|
|
1979
|
+
testID: "kvittering-under",
|
|
1980
|
+
style: {
|
|
1981
|
+
color: ko ? tema.color.textPrimary : tema.color.onBrandFill,
|
|
1982
|
+
fontSize: tema.font.body,
|
|
1983
|
+
lineHeight: tema.lineHeight.body
|
|
1984
|
+
},
|
|
1985
|
+
children: under
|
|
1986
|
+
}
|
|
1987
|
+
)
|
|
1988
|
+
] }) : null
|
|
1989
|
+
]
|
|
1990
|
+
}
|
|
1991
|
+
),
|
|
1992
|
+
ledd.length > 0 ? /* @__PURE__ */ jsx7(Sporingslinje, { ledd, testID: "kvittering-spor" }) : null,
|
|
1993
|
+
/* @__PURE__ */ jsx7(View6, { style: { flex: 1, justifyContent: "flex-end", paddingTop: tema.space.sm }, children: /* @__PURE__ */ jsx7(Btn, { testID: "tilbake-til-appen", label: tekst.tilbakeTilAppen, onPress: onLukk }) })
|
|
1994
|
+
] });
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
// src/widget/MineInnspill.tsx
|
|
1998
|
+
import { InnspelApiError, NettverksFeil } from "@innspel/core";
|
|
1999
|
+
import { forwardRef, useEffect, useImperativeHandle, useRef as useRef2, useState as useState2 } from "react";
|
|
2000
|
+
import { ActivityIndicator as ActivityIndicator2, Keyboard, ScrollView as ScrollView3, Text as Text7, TextInput as TextInput2, View as View7 } from "react-native";
|
|
2001
|
+
|
|
2002
|
+
// src/widget/nyttSvar.ts
|
|
1544
2003
|
var N\u00D8KKEL = "innspel:svar-sett";
|
|
1545
2004
|
async function merkNyeSvar(rader, storage) {
|
|
1546
2005
|
let grense = 0;
|
|
@@ -1561,7 +2020,7 @@ async function markerSvarSett(storage, n\u00E5 = Date.now()) {
|
|
|
1561
2020
|
}
|
|
1562
2021
|
|
|
1563
2022
|
// src/widget/MineInnspill.tsx
|
|
1564
|
-
import { jsx as
|
|
2023
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1565
2024
|
var MineInnspill = forwardRef(function MineInnspill2({
|
|
1566
2025
|
rader,
|
|
1567
2026
|
laster,
|
|
@@ -1645,9 +2104,10 @@ var MineInnspill = forwardRef(function MineInnspill2({
|
|
|
1645
2104
|
useEffect(() => {
|
|
1646
2105
|
if (!laster && rader.length) void markerSvarSett(storage).catch(() => void 0);
|
|
1647
2106
|
}, [storage, laster, rader]);
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
2107
|
+
const tom = !laster && rader.length === 0;
|
|
2108
|
+
return /* @__PURE__ */ jsxs7(View7, { style: { flex: 1, gap: tema.space.md }, children: [
|
|
2109
|
+
tom ? /* @__PURE__ */ jsx8(H, { sub: tenantName ? tekst.mineTomHint(tenantName) : tekst.mineTomHintGenerisk, children: tekst.mineTomTittel }) : /* @__PURE__ */ jsx8(H, { children: tekst.mineTittel }),
|
|
2110
|
+
laster ? /* @__PURE__ */ jsx8(ActivityIndicator2, { accessibilityLabel: tekst.mineLaster, color: tema.color.textSecondary }) : tom ? null : /* @__PURE__ */ jsx8(ScrollView3, { ref: rulleRef, style: { flex: 1 }, contentContainerStyle: { gap: tema.space.md }, keyboardShouldPersistTaps: "handled", children: visning.map(({ rad, nytt }) => {
|
|
1651
2111
|
const venter = rad.pending === true;
|
|
1652
2112
|
const v = venter ? venterVisning : statusVisning(rad.status, rad.type, rad.deadlineAt);
|
|
1653
2113
|
const nokkel = venter ? rad.clientRef : rad.id;
|
|
@@ -1660,69 +2120,69 @@ var MineInnspill = forwardRef(function MineInnspill2({
|
|
|
1660
2120
|
const brukt = utkast.length;
|
|
1661
2121
|
const full = brukt >= maks;
|
|
1662
2122
|
const visTeller = brukt >= maks * 0.8;
|
|
1663
|
-
|
|
1664
|
-
|
|
2123
|
+
const ledd = venter ? [] : sporingsledd(rad, tenantName);
|
|
2124
|
+
return /* @__PURE__ */ jsx8(
|
|
2125
|
+
View7,
|
|
1665
2126
|
{
|
|
1666
2127
|
onLayout: (e) => {
|
|
1667
2128
|
if (sakId !== void 0) kortY.current.set(sakId, e.nativeEvent.layout.y);
|
|
1668
2129
|
},
|
|
1669
|
-
children: /* @__PURE__ */
|
|
1670
|
-
/* @__PURE__ */
|
|
1671
|
-
/* @__PURE__ */
|
|
1672
|
-
|
|
1673
|
-
Text6,
|
|
2130
|
+
children: /* @__PURE__ */ jsxs7(Card, { dashed: venter, testID: `sakskort-${nokkel}`, children: [
|
|
2131
|
+
/* @__PURE__ */ jsxs7(View7, { style: { flexDirection: "row", alignItems: "center", gap: tema.space.sm, flexWrap: "wrap" }, children: [
|
|
2132
|
+
/* @__PURE__ */ jsx8(
|
|
2133
|
+
Ikon,
|
|
1674
2134
|
{
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
backgroundColor: tema.color.infoBg,
|
|
1679
|
-
fontSize: tema.font.tiny,
|
|
1680
|
-
fontWeight: tema.weight.semibold,
|
|
1681
|
-
borderRadius: tema.radius.pill,
|
|
1682
|
-
paddingHorizontal: tema.space.sm
|
|
1683
|
-
},
|
|
1684
|
-
children: tekst.nyttSvar
|
|
2135
|
+
navn: rad.type === "onske" ? "bulb" : "bug",
|
|
2136
|
+
storrelse: "minste",
|
|
2137
|
+
farge: tema.color.brand
|
|
1685
2138
|
}
|
|
1686
|
-
)
|
|
2139
|
+
),
|
|
2140
|
+
/* @__PURE__ */ jsx8(Meta, { children: venter ? tekst.mineIkkeSendtHode(rad.type === "onske" ? tekst.onske : tekst.feil) : tekst.sakHode(rad.type === "onske" ? tekst.onske : tekst.feil, rad.id) }),
|
|
2141
|
+
nytt ? /* @__PURE__ */ jsx8(Pille, { testID: "nytt-svar", children: tekst.nyttSvar }) : null
|
|
1687
2142
|
] }),
|
|
1688
|
-
/* @__PURE__ */
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
style: {
|
|
1692
|
-
color: tema.color.textPrimary,
|
|
1693
|
-
fontSize: tema.font.body,
|
|
1694
|
-
lineHeight: tema.lineHeight.body
|
|
1695
|
-
},
|
|
1696
|
-
children: rad.text
|
|
1697
|
-
}
|
|
1698
|
-
),
|
|
1699
|
-
tillegg.length > 0 ? /* @__PURE__ */ jsx7(View6, { testID: `tillegg-${sakId}`, style: { gap: tema.space.xs }, children: tillegg.map((a) => /* @__PURE__ */ jsxs6(
|
|
1700
|
-
View6,
|
|
2143
|
+
/* @__PURE__ */ jsx8(Brodtekst, { testID: `sakstekst-${nokkel}`, children: rad.text }),
|
|
2144
|
+
tillegg.length > 0 ? /* @__PURE__ */ jsx8(View7, { testID: `tillegg-${sakId}`, style: { gap: tema.space.sm }, children: tillegg.map((a) => /* @__PURE__ */ jsxs7(
|
|
2145
|
+
View7,
|
|
1701
2146
|
{
|
|
1702
2147
|
style: {
|
|
1703
2148
|
borderLeftWidth: tema.hairline * 2,
|
|
1704
2149
|
borderLeftColor: tema.color.border,
|
|
1705
|
-
paddingLeft: tema.space.
|
|
2150
|
+
paddingLeft: tema.space.md,
|
|
1706
2151
|
gap: tema.space.xs
|
|
1707
2152
|
},
|
|
1708
2153
|
children: [
|
|
1709
|
-
/* @__PURE__ */
|
|
1710
|
-
|
|
1711
|
-
/* @__PURE__ */ jsx7(Text6, { style: { color: tema.color.textSecondary, fontSize: tema.font.small }, children: tekst.duLaTil(formaterFrist(a.createdAt)) })
|
|
1712
|
-
] }),
|
|
1713
|
-
/* @__PURE__ */ jsx7(Text6, { style: { color: tema.color.textPrimary, fontSize: tema.font.small, lineHeight: tema.lineHeight.small }, children: a.text })
|
|
2154
|
+
/* @__PURE__ */ jsx8(Meta, { children: tekst.duLaTil(formaterFrist(a.createdAt)) }),
|
|
2155
|
+
/* @__PURE__ */ jsx8(Brodtekst, { testID: `tillegg-tekst-${a.id}`, children: a.text })
|
|
1714
2156
|
]
|
|
1715
2157
|
},
|
|
1716
2158
|
a.id
|
|
1717
2159
|
)) }) : null,
|
|
1718
|
-
/* @__PURE__ */
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
2160
|
+
svar ? /* @__PURE__ */ jsxs7(
|
|
2161
|
+
View7,
|
|
2162
|
+
{
|
|
2163
|
+
testID: `svar-${sakId}`,
|
|
2164
|
+
style: {
|
|
2165
|
+
borderLeftWidth: tema.hairline * 2,
|
|
2166
|
+
borderLeftColor: tema.color.brand,
|
|
2167
|
+
paddingLeft: tema.space.md,
|
|
2168
|
+
gap: tema.space.xs
|
|
2169
|
+
},
|
|
2170
|
+
children: [
|
|
2171
|
+
/* @__PURE__ */ jsx8(Meta, { children: tenantName ? tekst.svarFra(tenantName, formaterFrist(svar.at)) : tekst.svarFraGenerisk(formaterFrist(svar.at)) }),
|
|
2172
|
+
/* @__PURE__ */ jsx8(Brodtekst, { testID: `svar-tekst-${sakId}`, children: svar.text })
|
|
2173
|
+
]
|
|
2174
|
+
}
|
|
2175
|
+
) : null,
|
|
2176
|
+
ledd.length > 0 ? /* @__PURE__ */ jsx8(Sporingslinje, { ledd, testID: `spor-${sakId}` }) : /* @__PURE__ */ jsx8(StatusPill, { testID: `status-pille-${nokkel}`, ikon: v.ikon, etikett: v.etikett, fg: v.fg, bg: v.bg }),
|
|
2177
|
+
/* @__PURE__ */ jsx8(Sek, { testID: `lofte-${nokkel}`, children: v.lofte }),
|
|
2178
|
+
!venter && rad.attachmentRemoved ? /* @__PURE__ */ jsxs7(View7, { testID: `bilde-fjernet-${rad.id}`, style: { flexDirection: "row", gap: tema.space.xs, alignItems: "center" }, children: [
|
|
2179
|
+
/* @__PURE__ */ jsx8(Ikon, { navn: "trash-outline", storrelse: "minste", farge: tema.color.textMuted }),
|
|
2180
|
+
/* @__PURE__ */ jsx8(Hint, { children: tekst.bildeFjernet })
|
|
2181
|
+
] }) : null,
|
|
2182
|
+
sakId !== void 0 && lagtTil === sakId ? /* @__PURE__ */ jsx8(Text7, { accessibilityLiveRegion: "polite", testID: `lagt-til-${sakId}`, style: { color: tema.color.success, fontSize: tema.font.small }, children: tekst.lagtTil }) : null,
|
|
2183
|
+
feltApent ? /* @__PURE__ */ jsxs7(View7, { testID: `tillegg-felt-${sakId}`, style: { gap: tema.space.sm }, children: [
|
|
2184
|
+
/* @__PURE__ */ jsx8(Meta, { children: tekst.leggTilMerLabel }),
|
|
2185
|
+
/* @__PURE__ */ jsx8(
|
|
1726
2186
|
TextInput2,
|
|
1727
2187
|
{
|
|
1728
2188
|
testID: "tillegg-tekst",
|
|
@@ -1749,8 +2209,8 @@ var MineInnspill = forwardRef(function MineInnspill2({
|
|
|
1749
2209
|
}
|
|
1750
2210
|
}
|
|
1751
2211
|
),
|
|
1752
|
-
visTeller ? /* @__PURE__ */
|
|
1753
|
-
|
|
2212
|
+
visTeller ? /* @__PURE__ */ jsxs7(
|
|
2213
|
+
Text7,
|
|
1754
2214
|
{
|
|
1755
2215
|
testID: "tillegg-teller",
|
|
1756
2216
|
accessibilityLiveRegion: full ? "assertive" : "polite",
|
|
@@ -1763,50 +2223,17 @@ var MineInnspill = forwardRef(function MineInnspill2({
|
|
|
1763
2223
|
]
|
|
1764
2224
|
}
|
|
1765
2225
|
) : null,
|
|
1766
|
-
feil?.id === sakId ? /* @__PURE__ */
|
|
1767
|
-
] }) : kanLeggeTil ? /* @__PURE__ */
|
|
1768
|
-
|
|
2226
|
+
feil?.id === sakId ? /* @__PURE__ */ jsx8(Text7, { accessibilityLiveRegion: "assertive", testID: `tillegg-feil-${sakId}`, style: { color: tema.color.danger, fontSize: tema.font.small, lineHeight: tema.lineHeight.small }, children: feil.tekst }) : null
|
|
2227
|
+
] }) : kanLeggeTil ? /* @__PURE__ */ jsx8(
|
|
2228
|
+
Tekstknapp,
|
|
1769
2229
|
{
|
|
1770
2230
|
testID: `legg-til-mer-${sakId}`,
|
|
1771
|
-
|
|
2231
|
+
ikon: "add-outline",
|
|
2232
|
+
label: tekst.leggTilMer,
|
|
1772
2233
|
accessibilityLabel: tekst.leggTilMerLabel,
|
|
1773
|
-
onPress: () => sakId !== void 0 && apneFelt(sakId)
|
|
1774
|
-
style: { alignSelf: "flex-start", minHeight: tema.touch, flexDirection: "row", alignItems: "center", gap: tema.space.xs, paddingHorizontal: tema.space.sm },
|
|
1775
|
-
children: [
|
|
1776
|
-
/* @__PURE__ */ jsx7(Ikon, { navn: "add-outline", storrelse: "minste", farge: tema.color.actionSecondaryText }),
|
|
1777
|
-
/* @__PURE__ */ jsx7(Text6, { style: { color: tema.color.actionSecondaryText, fontSize: tema.font.body, fontWeight: tema.weight.semibold }, children: tekst.leggTilMer })
|
|
1778
|
-
]
|
|
2234
|
+
onPress: () => sakId !== void 0 && apneFelt(sakId)
|
|
1779
2235
|
}
|
|
1780
|
-
) : taketN\u00E5dd ? /* @__PURE__ */
|
|
1781
|
-
!venter && rad.attachmentRemoved ? /* @__PURE__ */ jsxs6(View6, { testID: `bilde-fjernet-${rad.id}`, style: { flexDirection: "row", gap: tema.space.xs, alignItems: "center" }, children: [
|
|
1782
|
-
/* @__PURE__ */ jsx7(Ikon, { navn: "trash-outline", storrelse: "minste", farge: tema.color.textMuted }),
|
|
1783
|
-
/* @__PURE__ */ jsx7(Hint, { children: tekst.bildeFjernet })
|
|
1784
|
-
] }) : null,
|
|
1785
|
-
svar ? /* @__PURE__ */ jsxs6(
|
|
1786
|
-
View6,
|
|
1787
|
-
{
|
|
1788
|
-
style: {
|
|
1789
|
-
borderLeftWidth: tema.hairline * 2,
|
|
1790
|
-
borderLeftColor: tema.color.brand,
|
|
1791
|
-
paddingLeft: tema.space.sm,
|
|
1792
|
-
gap: tema.space.xs
|
|
1793
|
-
},
|
|
1794
|
-
children: [
|
|
1795
|
-
/* @__PURE__ */ jsx7(Text6, { style: { color: tema.color.textSecondary, fontSize: tema.font.small }, children: tenantName ? tekst.svarFra(tenantName) : tekst.svarFraGenerisk }),
|
|
1796
|
-
/* @__PURE__ */ jsx7(
|
|
1797
|
-
Text6,
|
|
1798
|
-
{
|
|
1799
|
-
style: {
|
|
1800
|
-
color: tema.color.textPrimary,
|
|
1801
|
-
fontSize: tema.font.small,
|
|
1802
|
-
lineHeight: tema.lineHeight.small
|
|
1803
|
-
},
|
|
1804
|
-
children: svar.text
|
|
1805
|
-
}
|
|
1806
|
-
)
|
|
1807
|
-
]
|
|
1808
|
-
}
|
|
1809
|
-
) : null
|
|
2236
|
+
) : taketN\u00E5dd ? /* @__PURE__ */ jsx8(Hint, { children: tekst.tilleggTak }) : null
|
|
1810
2237
|
] })
|
|
1811
2238
|
},
|
|
1812
2239
|
nokkel
|
|
@@ -1815,9 +2242,9 @@ var MineInnspill = forwardRef(function MineInnspill2({
|
|
|
1815
2242
|
apen !== null ? (
|
|
1816
2243
|
// F32: fotens plass — én primærhandling om gangen. «Send nytt innspill» er borte til
|
|
1817
2244
|
// tillegget er sendt eller avbrutt, så første trykk aldri treffer feil knapp.
|
|
1818
|
-
/* @__PURE__ */
|
|
1819
|
-
/* @__PURE__ */
|
|
1820
|
-
/* @__PURE__ */
|
|
2245
|
+
/* @__PURE__ */ jsxs7(View7, { testID: "tillegg-fot", style: { gap: tema.space.sm }, children: [
|
|
2246
|
+
/* @__PURE__ */ jsxs7(View7, { style: { flexDirection: "row", gap: tema.space.sm }, children: [
|
|
2247
|
+
/* @__PURE__ */ jsx8(
|
|
1821
2248
|
Btn,
|
|
1822
2249
|
{
|
|
1823
2250
|
testID: "tillegg-send",
|
|
@@ -1829,19 +2256,19 @@ var MineInnspill = forwardRef(function MineInnspill2({
|
|
|
1829
2256
|
grow: true
|
|
1830
2257
|
}
|
|
1831
2258
|
),
|
|
1832
|
-
/* @__PURE__ */
|
|
2259
|
+
/* @__PURE__ */ jsx8(Btn, { testID: "tillegg-avbryt", label: tekst.avbryt, variant: "secondary", onPress: avbryt, grow: true })
|
|
1833
2260
|
] }),
|
|
1834
|
-
/* @__PURE__ */
|
|
2261
|
+
/* @__PURE__ */ jsx8(Hint, { children: tekst.leggTilMerHint })
|
|
1835
2262
|
] })
|
|
1836
|
-
) : /* @__PURE__ */
|
|
2263
|
+
) : /* @__PURE__ */ jsx8(Btn, { testID: "send-nytt", ikon: "chatbox-outline", label: tom ? tekst.sendForste : tekst.sendNytt, onPress: onNytt })
|
|
1837
2264
|
] });
|
|
1838
2265
|
});
|
|
1839
2266
|
|
|
1840
2267
|
// src/widget/Skjermbilde.tsx
|
|
1841
2268
|
import { skaler, strokTilRekter, treffer, trykkTilRekt } from "@innspel/core";
|
|
1842
2269
|
import { useCallback, useMemo as useMemo3, useRef as useRef3, useState as useState3 } from "react";
|
|
1843
|
-
import { Image as Image2, Pressable as
|
|
1844
|
-
import { jsx as
|
|
2270
|
+
import { Image as Image2, Pressable as Pressable4, StyleSheet, Text as Text8, View as View8 } from "react-native";
|
|
2271
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1845
2272
|
function Skjermbilde({
|
|
1846
2273
|
bilde,
|
|
1847
2274
|
automaskerRot,
|
|
@@ -1900,8 +2327,8 @@ function Skjermbilde({
|
|
|
1900
2327
|
};
|
|
1901
2328
|
const knapp = (id, ikon, label) => {
|
|
1902
2329
|
const valgt = id === "allTekst" ? allTekst : verktoy === id && !allTekst;
|
|
1903
|
-
return /* @__PURE__ */
|
|
1904
|
-
|
|
2330
|
+
return /* @__PURE__ */ jsxs8(
|
|
2331
|
+
Pressable4,
|
|
1905
2332
|
{
|
|
1906
2333
|
testID: `verktoy-${id}`,
|
|
1907
2334
|
accessibilityRole: "button",
|
|
@@ -1923,9 +2350,9 @@ function Skjermbilde({
|
|
|
1923
2350
|
backgroundColor: valgt ? tema.color.surfaceRaised : "transparent"
|
|
1924
2351
|
},
|
|
1925
2352
|
children: [
|
|
1926
|
-
/* @__PURE__ */
|
|
1927
|
-
/* @__PURE__ */
|
|
1928
|
-
|
|
2353
|
+
/* @__PURE__ */ jsx9(Ikon, { navn: ikon, farge: tema.color.textPrimary }),
|
|
2354
|
+
/* @__PURE__ */ jsx9(
|
|
2355
|
+
Text8,
|
|
1929
2356
|
{
|
|
1930
2357
|
style: {
|
|
1931
2358
|
color: tema.color.textPrimary,
|
|
@@ -1941,16 +2368,16 @@ function Skjermbilde({
|
|
|
1941
2368
|
);
|
|
1942
2369
|
};
|
|
1943
2370
|
const a11y = tekst.skjermbildeA11y(automasker.length, egne.length, allTekst);
|
|
1944
|
-
return /* @__PURE__ */
|
|
1945
|
-
/* @__PURE__ */
|
|
1946
|
-
notat ? /* @__PURE__ */
|
|
1947
|
-
/* @__PURE__ */
|
|
2371
|
+
return /* @__PURE__ */ jsxs8(View8, { testID: "skjermbilde-steg", style: { flexGrow: 1, flexShrink: 1, gap: tema.space.md }, children: [
|
|
2372
|
+
/* @__PURE__ */ jsx9(H, { sub: kilde === "galleri" ? tekst.skjermbildeUnderGalleri : tekst.skjermbildeUnder, children: tekst.skjermbildeTittel }),
|
|
2373
|
+
notat ? /* @__PURE__ */ jsx9(View8, { testID: "bilde-notat", children: /* @__PURE__ */ jsx9(Hint, { children: notat }) }) : null,
|
|
2374
|
+
/* @__PURE__ */ jsxs8(View8, { accessibilityRole: "toolbar", accessibilityLabel: tekst.maskering, style: { flexDirection: "row", gap: tema.space.sm }, children: [
|
|
1948
2375
|
knapp("felt", "scan-outline", tekst.maskerFelt),
|
|
1949
2376
|
knapp("pensel", "brush-outline", tekst.tegnOver),
|
|
1950
2377
|
knapp("allTekst", "grid-outline", tekst.maskerAllTekst)
|
|
1951
2378
|
] }),
|
|
1952
|
-
/* @__PURE__ */
|
|
1953
|
-
|
|
2379
|
+
/* @__PURE__ */ jsx9(
|
|
2380
|
+
View8,
|
|
1954
2381
|
{
|
|
1955
2382
|
testID: "skjermbilde-ramme",
|
|
1956
2383
|
onLayout,
|
|
@@ -1963,8 +2390,8 @@ function Skjermbilde({
|
|
|
1963
2390
|
borderRadius: tema.radius.md,
|
|
1964
2391
|
overflow: "hidden"
|
|
1965
2392
|
},
|
|
1966
|
-
children: /* @__PURE__ */
|
|
1967
|
-
|
|
2393
|
+
children: /* @__PURE__ */ jsx9(View8, { testID: "skjermbilde-flate", pointerEvents: "box-none", style: [StyleSheet.absoluteFill, { alignItems: "center", justifyContent: "center" }], children: visning ? /* @__PURE__ */ jsxs8(
|
|
2394
|
+
View8,
|
|
1968
2395
|
{
|
|
1969
2396
|
ref: previewRef,
|
|
1970
2397
|
collapsable: false,
|
|
@@ -1979,7 +2406,7 @@ function Skjermbilde({
|
|
|
1979
2406
|
onResponderTerminate: onRelease,
|
|
1980
2407
|
style: { width: visning.width, height: visning.height, backgroundColor: screenRules.previewBackdrop },
|
|
1981
2408
|
children: [
|
|
1982
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ jsx9(
|
|
1983
2410
|
Image2,
|
|
1984
2411
|
{
|
|
1985
2412
|
testID: "skjermbilde-bilde",
|
|
@@ -1989,8 +2416,8 @@ function Skjermbilde({
|
|
|
1989
2416
|
accessibilityIgnoresInvertColors: true
|
|
1990
2417
|
}
|
|
1991
2418
|
),
|
|
1992
|
-
automasker.map((r, i) => /* @__PURE__ */
|
|
1993
|
-
|
|
2419
|
+
automasker.map((r, i) => /* @__PURE__ */ jsx9(
|
|
2420
|
+
View8,
|
|
1994
2421
|
{
|
|
1995
2422
|
testID: `automask-${i}`,
|
|
1996
2423
|
pointerEvents: "none",
|
|
@@ -2011,16 +2438,16 @@ function Skjermbilde({
|
|
|
2011
2438
|
// (skjermKontrastpar i theme.ts). textSecondary var 2,2:1 (C11a).
|
|
2012
2439
|
// Ikonet arver samme farge: det er unntaket i «Styling» — maskeringen
|
|
2013
2440
|
// tegnes i faste signalfarger, ikke i palettens.
|
|
2014
|
-
/* @__PURE__ */
|
|
2015
|
-
/* @__PURE__ */
|
|
2016
|
-
/* @__PURE__ */
|
|
2441
|
+
/* @__PURE__ */ jsxs8(View8, { style: { flexDirection: "row", alignItems: "center", gap: tema.space.xs }, children: [
|
|
2442
|
+
/* @__PURE__ */ jsx9(Ikon, { navn: "lock-closed-outline", storrelse: "minste", farge: screenRules.autoMaskText }),
|
|
2443
|
+
/* @__PURE__ */ jsx9(Text8, { style: { color: screenRules.autoMaskText, fontSize: tema.font.small }, numberOfLines: 1, children: tekst.maskertAvAppen })
|
|
2017
2444
|
] })
|
|
2018
2445
|
) : null
|
|
2019
2446
|
},
|
|
2020
2447
|
`auto-${i}`
|
|
2021
2448
|
)),
|
|
2022
|
-
egne.map((r, i) => /* @__PURE__ */
|
|
2023
|
-
|
|
2449
|
+
egne.map((r, i) => /* @__PURE__ */ jsx9(
|
|
2450
|
+
View8,
|
|
2024
2451
|
{
|
|
2025
2452
|
testID: `maske-${i}`,
|
|
2026
2453
|
pointerEvents: "none",
|
|
@@ -2033,14 +2460,14 @@ function Skjermbilde({
|
|
|
2033
2460
|
) : null })
|
|
2034
2461
|
}
|
|
2035
2462
|
),
|
|
2036
|
-
automasker.length ? /* @__PURE__ */
|
|
2037
|
-
/* @__PURE__ */
|
|
2038
|
-
/* @__PURE__ */
|
|
2463
|
+
automasker.length ? /* @__PURE__ */ jsxs8(View8, { style: { flexDirection: "row", alignItems: "center", gap: tema.space.xs }, children: [
|
|
2464
|
+
/* @__PURE__ */ jsx9(Ikon, { navn: "lock-closed-outline", storrelse: "minste", farge: tema.color.textMuted }),
|
|
2465
|
+
/* @__PURE__ */ jsx9(Hint, { children: tekst.maskertAvAppenHint })
|
|
2039
2466
|
] }) : null,
|
|
2040
|
-
egne.length ? /* @__PURE__ */
|
|
2041
|
-
allTekst ? /* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */
|
|
2043
|
-
/* @__PURE__ */
|
|
2467
|
+
egne.length ? /* @__PURE__ */ jsx9(Hint, { children: tekst.dittStrok }) : null,
|
|
2468
|
+
allTekst ? /* @__PURE__ */ jsx9(Hint, { children: tekst.allTekstHint }) : null,
|
|
2469
|
+
/* @__PURE__ */ jsxs8(View8, { testID: "skjermbilde-fot", style: { flexShrink: 0, gap: tema.space.sm }, children: [
|
|
2470
|
+
/* @__PURE__ */ jsx9(
|
|
2044
2471
|
Btn,
|
|
2045
2472
|
{
|
|
2046
2473
|
variant: "secondary",
|
|
@@ -2051,7 +2478,7 @@ function Skjermbilde({
|
|
|
2051
2478
|
onPress: () => setEgne((x) => x.slice(0, -1))
|
|
2052
2479
|
}
|
|
2053
2480
|
),
|
|
2054
|
-
/* @__PURE__ */
|
|
2481
|
+
/* @__PURE__ */ jsx9(
|
|
2055
2482
|
Btn,
|
|
2056
2483
|
{
|
|
2057
2484
|
variant: "danger",
|
|
@@ -2062,13 +2489,13 @@ function Skjermbilde({
|
|
|
2062
2489
|
disabled: komponerer
|
|
2063
2490
|
}
|
|
2064
2491
|
),
|
|
2065
|
-
/* @__PURE__ */
|
|
2492
|
+
/* @__PURE__ */ jsx9(Btn, { testID: "legg-ved", label: tekst.leggVed, onPress: onLeggVed, disabled: komponerer || !visning })
|
|
2066
2493
|
] })
|
|
2067
2494
|
] });
|
|
2068
2495
|
}
|
|
2069
2496
|
|
|
2070
2497
|
// src/widget/Widget.tsx
|
|
2071
|
-
import { Fragment, jsx as
|
|
2498
|
+
import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2072
2499
|
var FANGST = { format: "jpg", quality: 0.85 };
|
|
2073
2500
|
function Widget({
|
|
2074
2501
|
client,
|
|
@@ -2290,6 +2717,9 @@ function Widget({
|
|
|
2290
2717
|
setKvittering({
|
|
2291
2718
|
art: spor,
|
|
2292
2719
|
nr: res.submission.id,
|
|
2720
|
+
// Kortet får HELE saken: sporingslinjen leser `status`, `createdAt` og
|
|
2721
|
+
// `statusChangedAt` derfra — ingen nye felter, ingen ny kontrakt (DD-28).
|
|
2722
|
+
sak: res.submission,
|
|
2293
2723
|
// Tidsløftet i kvitteringen er DATOEN fra svaret, aldri «innen 90 dager» (DD-07, DD-28).
|
|
2294
2724
|
...res.submission.deadlineAt ? { frist: res.submission.deadlineAt } : {},
|
|
2295
2725
|
...res.attachment?.status === "failed" ? { vedlegg: "feilet" } : {}
|
|
@@ -2310,7 +2740,7 @@ function Widget({
|
|
|
2310
2740
|
setSender(true);
|
|
2311
2741
|
try {
|
|
2312
2742
|
const res = await client.knownIssues.confirm(k.id);
|
|
2313
|
-
setKvittering({ art: "jaOgsa", nr: res.id });
|
|
2743
|
+
setKvittering({ art: "jaOgsa", nr: res.id, sak: res });
|
|
2314
2744
|
setSteg("kvittering");
|
|
2315
2745
|
} catch (e) {
|
|
2316
2746
|
setFeil(e instanceof InnspelApiError2 ? e.message : "tjeneren svarte ikke.");
|
|
@@ -2342,7 +2772,7 @@ function Widget({
|
|
|
2342
2772
|
if (harUtkast) setSteg(stegForMine);
|
|
2343
2773
|
else nullstill();
|
|
2344
2774
|
}, [harUtkast, stegForMine, nullstill]);
|
|
2345
|
-
return /* @__PURE__ */
|
|
2775
|
+
return /* @__PURE__ */ jsx10(
|
|
2346
2776
|
Modal,
|
|
2347
2777
|
{
|
|
2348
2778
|
visible: synlig,
|
|
@@ -2350,14 +2780,14 @@ function Widget({
|
|
|
2350
2780
|
animationType: "slide",
|
|
2351
2781
|
onRequestClose: androidTilbake,
|
|
2352
2782
|
accessibilityViewIsModal: true,
|
|
2353
|
-
children: /* @__PURE__ */
|
|
2783
|
+
children: /* @__PURE__ */ jsx10(
|
|
2354
2784
|
KeyboardAvoidingView,
|
|
2355
2785
|
{
|
|
2356
2786
|
behavior: "padding",
|
|
2357
2787
|
keyboardVerticalOffset: -insets.bottom,
|
|
2358
2788
|
style: { flex: 1, backgroundColor: tema.color.scrim, justifyContent: "flex-end", paddingTop: insets.top },
|
|
2359
|
-
children: /* @__PURE__ */
|
|
2360
|
-
|
|
2789
|
+
children: /* @__PURE__ */ jsxs9(
|
|
2790
|
+
View9,
|
|
2361
2791
|
{
|
|
2362
2792
|
testID: "innspel-widget",
|
|
2363
2793
|
accessibilityViewIsModal: true,
|
|
@@ -2378,37 +2808,37 @@ function Widget({
|
|
|
2378
2808
|
...steg === "skjermbilde" ? { height: "92%" } : {}
|
|
2379
2809
|
},
|
|
2380
2810
|
children: [
|
|
2381
|
-
/* @__PURE__ */
|
|
2382
|
-
steg !== "valg" && steg !== "kvittering" ? /* @__PURE__ */
|
|
2383
|
-
/* @__PURE__ */
|
|
2384
|
-
|
|
2811
|
+
/* @__PURE__ */ jsxs9(View9, { style: { flexDirection: "row", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
2812
|
+
steg !== "valg" && steg !== "kvittering" ? /* @__PURE__ */ jsx10(Btn, { variant: "ghost", testID: "tilbake", ikon: "arrow-back-outline", label: tekst.tilbake, onPress: gaaTilbake }) : /* @__PURE__ */ jsx10(View9, {}),
|
|
2813
|
+
/* @__PURE__ */ jsx10(
|
|
2814
|
+
Pressable5,
|
|
2385
2815
|
{
|
|
2386
2816
|
testID: "lukk",
|
|
2387
2817
|
accessibilityRole: "button",
|
|
2388
2818
|
accessibilityLabel: tekst.lukk,
|
|
2389
2819
|
onPress: steg === "kvittering" ? lukkOgNullstill : lukk,
|
|
2390
2820
|
style: { minWidth: tema.touch, minHeight: tema.touch, alignItems: "center", justifyContent: "center" },
|
|
2391
|
-
children: /* @__PURE__ */
|
|
2821
|
+
children: /* @__PURE__ */ jsx10(Ikon, { navn: "close-outline", farge: tema.color.textSecondary })
|
|
2392
2822
|
}
|
|
2393
2823
|
)
|
|
2394
2824
|
] }),
|
|
2395
|
-
feil ? /* @__PURE__ */
|
|
2396
|
-
!online && steg !== "kvittering" && steg !== "mine" ? /* @__PURE__ */
|
|
2397
|
-
steg === "valg" ? /* @__PURE__ */
|
|
2398
|
-
/* @__PURE__ */
|
|
2399
|
-
!client.isAnonymous ? /* @__PURE__ */
|
|
2825
|
+
feil ? /* @__PURE__ */ jsx10(Banner, { live: true, ikon: "warning-outline", tone: "danger", children: tekst.sendefeilBanner(feil) }) : null,
|
|
2826
|
+
!online && steg !== "kvittering" && steg !== "mine" ? /* @__PURE__ */ jsx10(Banner, { ikon: "cloud-offline-outline", tone: "info", testID: "offline-banner", children: tekst.offlineBanner }) : null,
|
|
2827
|
+
steg === "valg" ? /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
2828
|
+
/* @__PURE__ */ jsx10(Valg, { onVelg: velgSpor, anonym: client.isAnonymous }),
|
|
2829
|
+
!client.isAnonymous ? /* @__PURE__ */ jsx10(View9, { style: { flex: 1, justifyContent: "flex-end" }, children: /* @__PURE__ */ jsx10(
|
|
2400
2830
|
Btn,
|
|
2401
2831
|
{
|
|
2402
|
-
variant:
|
|
2832
|
+
variant: "secondary",
|
|
2403
2833
|
testID: "mine-innspill",
|
|
2404
2834
|
ikon: "list-outline",
|
|
2405
2835
|
label: mine.length > 0 ? tekst.mineMedAntall(mine.length) : tekst.mineTittel,
|
|
2406
2836
|
accessibilityLabel: mine.length > 0 ? tekst.mineEtikett(mine.length) : tekst.mineTittel,
|
|
2407
2837
|
onPress: () => void visMine()
|
|
2408
2838
|
}
|
|
2409
|
-
) : null
|
|
2839
|
+
) }) : null
|
|
2410
2840
|
] }) : null,
|
|
2411
|
-
steg === "kjenteFeil" ? /* @__PURE__ */
|
|
2841
|
+
steg === "kjenteFeil" ? /* @__PURE__ */ jsx10(
|
|
2412
2842
|
KjenteFeil,
|
|
2413
2843
|
{
|
|
2414
2844
|
kort,
|
|
@@ -2423,7 +2853,7 @@ function Widget({
|
|
|
2423
2853
|
onNei: () => setSteg("felt")
|
|
2424
2854
|
}
|
|
2425
2855
|
) : null,
|
|
2426
|
-
steg === "felt" ? /* @__PURE__ */
|
|
2856
|
+
steg === "felt" ? /* @__PURE__ */ jsx10(
|
|
2427
2857
|
Felt,
|
|
2428
2858
|
{
|
|
2429
2859
|
spor,
|
|
@@ -2447,7 +2877,7 @@ function Widget({
|
|
|
2447
2877
|
onFjernVedlegg: fjernBilde
|
|
2448
2878
|
}
|
|
2449
2879
|
) : null,
|
|
2450
|
-
steg === "skjermbilde" && bilde ? /* @__PURE__ */
|
|
2880
|
+
steg === "skjermbilde" && bilde ? /* @__PURE__ */ jsx10(
|
|
2451
2881
|
Skjermbilde,
|
|
2452
2882
|
{
|
|
2453
2883
|
bilde,
|
|
@@ -2461,17 +2891,20 @@ function Widget({
|
|
|
2461
2891
|
onLeggVed: leggVedBilde
|
|
2462
2892
|
}
|
|
2463
2893
|
) : null,
|
|
2464
|
-
steg === "kvittering" && kvittering ? /* @__PURE__ */
|
|
2894
|
+
steg === "kvittering" && kvittering ? /* @__PURE__ */ jsx10(
|
|
2465
2895
|
Kvittering,
|
|
2466
2896
|
{
|
|
2467
2897
|
art: kvittering.art,
|
|
2468
2898
|
...kvittering.nr ? { saksnummer: kvittering.nr } : {},
|
|
2469
2899
|
...kvittering.vedlegg ? { vedlegg: kvittering.vedlegg } : {},
|
|
2470
2900
|
...kvittering.frist ? { frist: kvittering.frist } : {},
|
|
2901
|
+
...kvittering.sak && kvittering.sak.pending !== true ? { sak: kvittering.sak } : {},
|
|
2902
|
+
...tenantName ? { tenantName } : {},
|
|
2903
|
+
anonym: client.isAnonymous,
|
|
2471
2904
|
onLukk: lukkOgNullstill
|
|
2472
2905
|
}
|
|
2473
2906
|
) : null,
|
|
2474
|
-
steg === "mine" ? /* @__PURE__ */
|
|
2907
|
+
steg === "mine" ? /* @__PURE__ */ jsx10(
|
|
2475
2908
|
MineInnspill,
|
|
2476
2909
|
{
|
|
2477
2910
|
ref: mineRef,
|
|
@@ -2515,7 +2948,7 @@ function fjernetKontekst(client, fjernede, skjerm) {
|
|
|
2515
2948
|
}
|
|
2516
2949
|
|
|
2517
2950
|
// src/InnspelProvider.tsx
|
|
2518
|
-
import { jsx as
|
|
2951
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2519
2952
|
var Kontekst = createContext3(null);
|
|
2520
2953
|
function InnspelProvider({
|
|
2521
2954
|
client,
|
|
@@ -2550,9 +2983,9 @@ function InnspelProvider({
|
|
|
2550
2983
|
() => ({ adapter: screenshot ?? null, rootRef, privat }),
|
|
2551
2984
|
[screenshot, privat]
|
|
2552
2985
|
);
|
|
2553
|
-
return /* @__PURE__ */
|
|
2554
|
-
/* @__PURE__ */
|
|
2555
|
-
/* @__PURE__ */
|
|
2986
|
+
return /* @__PURE__ */ jsx11(Kontekst.Provider, { value: verdi, children: /* @__PURE__ */ jsx11(SkjermbildeContext.Provider, { value: skjermbilde, children: /* @__PURE__ */ jsxs10(TemaProvider, { value: tema, children: [
|
|
2987
|
+
/* @__PURE__ */ jsx11(View10, { ref: rootRef, collapsable: false, style: { flex: 1 }, testID: "innspel-rot", children }),
|
|
2988
|
+
/* @__PURE__ */ jsx11(
|
|
2556
2989
|
Widget,
|
|
2557
2990
|
{
|
|
2558
2991
|
client,
|
|
@@ -2578,8 +3011,8 @@ function useInnspel() {
|
|
|
2578
3011
|
|
|
2579
3012
|
// src/InnspelPrivate.tsx
|
|
2580
3013
|
import { useEffect as useEffect3, useRef as useRef6 } from "react";
|
|
2581
|
-
import { View as
|
|
2582
|
-
import { jsx as
|
|
3014
|
+
import { View as View11 } from "react-native";
|
|
3015
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2583
3016
|
function InnspelPrivate({ children, style }) {
|
|
2584
3017
|
const ref = useRef6(null);
|
|
2585
3018
|
const kontekst = useSkjermbilde();
|
|
@@ -2588,7 +3021,7 @@ function InnspelPrivate({ children, style }) {
|
|
|
2588
3021
|
if (!registrer) return;
|
|
2589
3022
|
return registrer(ref);
|
|
2590
3023
|
}, [registrer]);
|
|
2591
|
-
return /* @__PURE__ */
|
|
3024
|
+
return /* @__PURE__ */ jsx12(View11, { ref, collapsable: false, style, testID: "innspel-privat", children });
|
|
2592
3025
|
}
|
|
2593
3026
|
|
|
2594
3027
|
// src/program/InnspelProgram.tsx
|
|
@@ -2596,11 +3029,7 @@ import {
|
|
|
2596
3029
|
InnspelApiError as InnspelApiError3
|
|
2597
3030
|
} from "@innspel/core";
|
|
2598
3031
|
import { useCallback as useCallback4, useEffect as useEffect4, useState as useState7 } from "react";
|
|
2599
|
-
import { Modal as Modal4, Pressable as
|
|
2600
|
-
|
|
2601
|
-
// src/program/Aksept.tsx
|
|
2602
|
-
import "react";
|
|
2603
|
-
import { Linking, Modal as Modal2, Pressable as Pressable7, ScrollView as ScrollView4, Text as Text8, View as View11 } from "react-native";
|
|
3032
|
+
import { Modal as Modal4, Pressable as Pressable8, View as View16 } from "react-native";
|
|
2604
3033
|
|
|
2605
3034
|
// src/program/periode.ts
|
|
2606
3035
|
var MANEDER = [
|
|
@@ -2624,13 +3053,31 @@ function periode(opensAt, closesAt) {
|
|
|
2624
3053
|
const sammeManed = fra.getMonth() === til.getMonth() && fra.getFullYear() === til.getFullYear();
|
|
2625
3054
|
return sammeManed ? `${fra.getDate()}.\u2013${til.getDate()}. ${MANEDER[til.getMonth()]}` : `${fra.getDate()}. ${MANEDER[fra.getMonth()]} \u2013 ${til.getDate()}. ${MANEDER[til.getMonth()]}`;
|
|
2626
3055
|
}
|
|
2627
|
-
function
|
|
2628
|
-
if (tasks.length === 0) return 0;
|
|
2629
|
-
|
|
3056
|
+
function minutterLinje(tasks) {
|
|
3057
|
+
if (tasks.length === 0) return { minutter: 0, like: true };
|
|
3058
|
+
const forste = tasks[0].estimatedMinutes;
|
|
3059
|
+
const like = tasks.every((t2) => t2.estimatedMinutes === forste);
|
|
3060
|
+
return like ? { minutter: forste, like: true } : { minutter: tasks.reduce((sum, t2) => sum + t2.estimatedMinutes, 0), like: false };
|
|
2630
3061
|
}
|
|
2631
3062
|
|
|
2632
3063
|
// src/program/Aksept.tsx
|
|
2633
|
-
import
|
|
3064
|
+
import "react";
|
|
3065
|
+
import { Linking, Modal as Modal2, Pressable as Pressable6, ScrollView as ScrollView4, Text as Text9, View as View12 } from "react-native";
|
|
3066
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3067
|
+
function Seksjon({ tittel, children }) {
|
|
3068
|
+
const tema = useTema();
|
|
3069
|
+
return /* @__PURE__ */ jsxs11(View12, { style: { gap: tema.space.sm }, children: [
|
|
3070
|
+
/* @__PURE__ */ jsx13(
|
|
3071
|
+
Text9,
|
|
3072
|
+
{
|
|
3073
|
+
accessibilityRole: "header",
|
|
3074
|
+
style: { color: tema.color.textPrimary, fontSize: tema.font.body, lineHeight: tema.lineHeight.body, fontWeight: tema.weight.bold },
|
|
3075
|
+
children: tittel
|
|
3076
|
+
}
|
|
3077
|
+
),
|
|
3078
|
+
children
|
|
3079
|
+
] });
|
|
3080
|
+
}
|
|
2634
3081
|
function Aksept({
|
|
2635
3082
|
program,
|
|
2636
3083
|
harToken,
|
|
@@ -2640,14 +3087,15 @@ function Aksept({
|
|
|
2640
3087
|
onLukk
|
|
2641
3088
|
}) {
|
|
2642
3089
|
const tema = useTema();
|
|
2643
|
-
const
|
|
3090
|
+
const { minutter, like } = minutterLinje(program.tasks);
|
|
3091
|
+
const tall = (like ? tekst.akseptTallHver : tekst.akseptTallSum)(
|
|
2644
3092
|
program.tasks.length,
|
|
2645
|
-
|
|
2646
|
-
periode(program.opensAt, program.closesAt)
|
|
2647
|
-
program.maxContacts
|
|
3093
|
+
minutter,
|
|
3094
|
+
periode(program.opensAt, program.closesAt)
|
|
2648
3095
|
);
|
|
2649
|
-
|
|
2650
|
-
|
|
3096
|
+
const medVilkar = !!program.termsUrl && !program.commitmentFree;
|
|
3097
|
+
return /* @__PURE__ */ jsx13(Modal2, { visible: true, transparent: true, animationType: "slide", onRequestClose: onLukk, accessibilityViewIsModal: true, children: /* @__PURE__ */ jsx13(View12, { style: { flex: 1, backgroundColor: tema.color.scrim, justifyContent: "flex-end" }, children: /* @__PURE__ */ jsxs11(
|
|
3098
|
+
View12,
|
|
2651
3099
|
{
|
|
2652
3100
|
testID: "program-aksept",
|
|
2653
3101
|
accessibilityViewIsModal: true,
|
|
@@ -2661,17 +3109,17 @@ function Aksept({
|
|
|
2661
3109
|
minHeight: "60%"
|
|
2662
3110
|
},
|
|
2663
3111
|
children: [
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2666
|
-
/* @__PURE__ */
|
|
3112
|
+
/* @__PURE__ */ jsxs11(View12, { style: { flexDirection: "row", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
3113
|
+
/* @__PURE__ */ jsx13(Btn, { variant: "ghost", testID: "aksept-tilbake", ikon: "arrow-back-outline", label: tekst.tilbake, onPress: onLukk }),
|
|
3114
|
+
/* @__PURE__ */ jsx13(View12, {})
|
|
2667
3115
|
] }),
|
|
2668
|
-
feil ? /* @__PURE__ */
|
|
2669
|
-
/* @__PURE__ */
|
|
2670
|
-
/* @__PURE__ */
|
|
2671
|
-
/* @__PURE__ */
|
|
2672
|
-
|
|
3116
|
+
feil ? /* @__PURE__ */ jsx13(Banner, { live: true, ikon: "warning-outline", tone: "danger", children: tekst.akseptFeil(feil) }) : null,
|
|
3117
|
+
/* @__PURE__ */ jsxs11(ScrollView4, { contentContainerStyle: { gap: tema.space.lg }, children: [
|
|
3118
|
+
/* @__PURE__ */ jsx13(H, { testID: "aksept-tittel", sub: program.hypothesis, children: program.name }),
|
|
3119
|
+
/* @__PURE__ */ jsx13(
|
|
3120
|
+
Text9,
|
|
2673
3121
|
{
|
|
2674
|
-
|
|
3122
|
+
testID: "aksept-tall",
|
|
2675
3123
|
style: {
|
|
2676
3124
|
color: tema.color.textPrimary,
|
|
2677
3125
|
fontSize: tema.font.body,
|
|
@@ -2681,79 +3129,116 @@ function Aksept({
|
|
|
2681
3129
|
children: tall
|
|
2682
3130
|
}
|
|
2683
3131
|
),
|
|
2684
|
-
/* @__PURE__ */
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
return /* @__PURE__ */ jsxs10(View11, { style: { gap: tema.space.xs }, children: [
|
|
2700
|
-
/* @__PURE__ */ jsx12(Text8, { style: { color: tema.color.textPrimary, fontSize: tema.font.small, lineHeight: tema.lineHeight.small }, children: k.title }),
|
|
2701
|
-
k.workaround ? /* @__PURE__ */ jsxs10(Text8, { style: { color: tema.color.textSecondary, fontSize: tema.font.small, lineHeight: tema.lineHeight.small }, children: [
|
|
2702
|
-
tekst.omvei,
|
|
2703
|
-
" ",
|
|
2704
|
-
k.workaround
|
|
2705
|
-
] }) : null,
|
|
2706
|
-
k.fixedIn ? /* @__PURE__ */ jsx12(
|
|
2707
|
-
StatusPill,
|
|
3132
|
+
/* @__PURE__ */ jsx13(Seksjon, { tittel: tekst.akseptOppgaver, children: /* @__PURE__ */ jsx13(View12, { children: program.tasks.map((o, i) => /* @__PURE__ */ jsxs11(
|
|
3133
|
+
View12,
|
|
3134
|
+
{
|
|
3135
|
+
style: {
|
|
3136
|
+
flexDirection: "row",
|
|
3137
|
+
alignItems: "center",
|
|
3138
|
+
gap: tema.space.sm,
|
|
3139
|
+
minHeight: tema.touch + tema.space.sm,
|
|
3140
|
+
paddingVertical: tema.space.sm,
|
|
3141
|
+
borderTopWidth: i === 0 ? 0 : tema.hairline,
|
|
3142
|
+
borderTopColor: tema.color.border
|
|
3143
|
+
},
|
|
3144
|
+
children: [
|
|
3145
|
+
/* @__PURE__ */ jsx13(
|
|
3146
|
+
View12,
|
|
2708
3147
|
{
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
3148
|
+
style: {
|
|
3149
|
+
width: tema.space.lg,
|
|
3150
|
+
height: tema.space.lg,
|
|
3151
|
+
borderRadius: tema.radius.pill,
|
|
3152
|
+
borderWidth: tema.hairline * 2,
|
|
3153
|
+
borderStyle: "dashed",
|
|
3154
|
+
borderColor: tema.color.borderStrong
|
|
3155
|
+
}
|
|
2713
3156
|
}
|
|
2714
|
-
)
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
3157
|
+
),
|
|
3158
|
+
/* @__PURE__ */ jsxs11(View12, { style: { flex: 1, minWidth: 0 }, children: [
|
|
3159
|
+
/* @__PURE__ */ jsx13(
|
|
3160
|
+
Text9,
|
|
3161
|
+
{
|
|
3162
|
+
style: { color: tema.color.textPrimary, fontSize: tema.font.body, lineHeight: tema.lineHeight.body, fontWeight: tema.weight.semibold },
|
|
3163
|
+
children: o.title
|
|
3164
|
+
}
|
|
3165
|
+
),
|
|
3166
|
+
/* @__PURE__ */ jsx13(Meta, { children: tekst.oppgaveTid(o.estimatedMinutes, o.screenHint) })
|
|
3167
|
+
] })
|
|
3168
|
+
]
|
|
3169
|
+
},
|
|
3170
|
+
o.id
|
|
3171
|
+
)) }) }),
|
|
3172
|
+
program.knownIssues.length > 0 ? /* @__PURE__ */ jsx13(Seksjon, { tittel: tekst.akseptKjenteFeil, children: /* @__PURE__ */ jsx13(View12, { children: program.knownIssues.map((k, i) => {
|
|
3173
|
+
const o = knownIssueStatus[k.status] ?? knownIssueStatus.aktiv;
|
|
3174
|
+
const rettet = k.status === "fikset";
|
|
3175
|
+
const statusOrd = rettet && k.fixedIn ? tekst.rettetI(k.fixedIn) : o.etikett;
|
|
3176
|
+
const tillegg = !rettet && k.fixedIn ? `\xB7 ${tekst.rettesI(k.fixedIn).toLowerCase()}` : void 0;
|
|
3177
|
+
return /* @__PURE__ */ jsxs11(
|
|
3178
|
+
View12,
|
|
3179
|
+
{
|
|
3180
|
+
style: {
|
|
3181
|
+
gap: tema.space.xs,
|
|
3182
|
+
paddingVertical: tema.space.sm,
|
|
3183
|
+
borderTopWidth: i === 0 ? 0 : tema.hairline,
|
|
3184
|
+
borderTopColor: tema.color.border
|
|
3185
|
+
},
|
|
3186
|
+
children: [
|
|
3187
|
+
/* @__PURE__ */ jsx13(
|
|
3188
|
+
Text9,
|
|
3189
|
+
{
|
|
3190
|
+
style: { color: tema.color.textPrimary, fontSize: tema.font.body, lineHeight: tema.lineHeight.body, fontWeight: tema.weight.semibold },
|
|
3191
|
+
children: k.title
|
|
3192
|
+
}
|
|
3193
|
+
),
|
|
3194
|
+
k.workaround ? /* @__PURE__ */ jsxs11(Sek, { children: [
|
|
3195
|
+
tekst.omvei,
|
|
3196
|
+
" ",
|
|
3197
|
+
k.workaround
|
|
3198
|
+
] }) : null,
|
|
3199
|
+
/* @__PURE__ */ jsxs11(View12, { style: { flexDirection: "row", alignItems: "center", gap: tema.space.sm, flexWrap: "wrap" }, children: [
|
|
3200
|
+
/* @__PURE__ */ jsxs11(View12, { style: { flexDirection: "row", alignItems: "center", gap: tema.space.xs }, children: [
|
|
3201
|
+
/* @__PURE__ */ jsx13(Ikon, { navn: o.ikon, storrelse: "minste", farge: tema.color[o.fg] }),
|
|
3202
|
+
/* @__PURE__ */ jsx13(
|
|
3203
|
+
Text9,
|
|
3204
|
+
{
|
|
3205
|
+
style: {
|
|
3206
|
+
color: tema.color[o.fg],
|
|
3207
|
+
fontSize: tema.font.small,
|
|
3208
|
+
lineHeight: tema.lineHeight.small,
|
|
3209
|
+
fontWeight: tema.weight.semibold
|
|
3210
|
+
},
|
|
3211
|
+
children: statusOrd
|
|
3212
|
+
}
|
|
3213
|
+
)
|
|
3214
|
+
] }),
|
|
3215
|
+
tillegg ? /* @__PURE__ */ jsx13(Meta, { children: tillegg }) : null
|
|
3216
|
+
] })
|
|
3217
|
+
]
|
|
3218
|
+
},
|
|
3219
|
+
k.id
|
|
3220
|
+
);
|
|
3221
|
+
}) }) }) : null,
|
|
3222
|
+
/* @__PURE__ */ jsxs11(Seksjon, { tittel: tekst.akseptInnsamling, children: [
|
|
3223
|
+
/* @__PURE__ */ jsx13(Sek, { children: tekst.akseptInnsamlingTekst }),
|
|
3224
|
+
medVilkar ? /* @__PURE__ */ jsxs11(
|
|
3225
|
+
Pressable6,
|
|
2725
3226
|
{
|
|
2726
3227
|
testID: "vilkar-lenke",
|
|
2727
3228
|
accessibilityRole: "link",
|
|
2728
3229
|
accessibilityLabel: tekst.akseptVilkar,
|
|
2729
3230
|
onPress: () => void Linking.openURL(String(program.termsUrl)),
|
|
2730
|
-
style: { minHeight: tema.touch,
|
|
2731
|
-
children:
|
|
2732
|
-
/* @__PURE__ */
|
|
2733
|
-
/* @__PURE__ */
|
|
2734
|
-
|
|
2735
|
-
{
|
|
2736
|
-
style: { color: tema.color.textPrimary, fontSize: tema.font.body, textDecorationLine: "underline" },
|
|
2737
|
-
children: tekst.akseptVilkar
|
|
2738
|
-
}
|
|
2739
|
-
)
|
|
2740
|
-
] })
|
|
2741
|
-
}
|
|
2742
|
-
),
|
|
2743
|
-
/* @__PURE__ */ jsx12(Hint, { children: tekst.akseptVilkarHint })
|
|
2744
|
-
] }) : /* @__PURE__ */ jsx12(Hint, { children: tekst.akseptIngenVilkar }),
|
|
2745
|
-
/* @__PURE__ */ jsxs10(View11, { style: { flexDirection: "row", alignItems: "flex-start", gap: tema.space.sm }, children: [
|
|
2746
|
-
/* @__PURE__ */ jsx12(Ikon, { navn: "exit-outline", farge: tema.color.textPrimary }),
|
|
2747
|
-
/* @__PURE__ */ jsx12(
|
|
2748
|
-
Text8,
|
|
2749
|
-
{
|
|
2750
|
-
style: { flex: 1, color: tema.color.textPrimary, fontSize: tema.font.body, lineHeight: tema.lineHeight.body },
|
|
2751
|
-
children: tekst.akseptUtgang
|
|
3231
|
+
style: { minHeight: tema.touch, flexDirection: "row", alignItems: "center", gap: tema.space.sm },
|
|
3232
|
+
children: [
|
|
3233
|
+
/* @__PURE__ */ jsx13(Ikon, { navn: "open-outline", storrelse: "minste", farge: tema.color.actionSecondaryText }),
|
|
3234
|
+
/* @__PURE__ */ jsx13(Text9, { style: { color: tema.color.actionSecondaryText, fontSize: tema.font.body, fontWeight: tema.weight.semibold }, children: tekst.akseptVilkar })
|
|
3235
|
+
]
|
|
2752
3236
|
}
|
|
2753
|
-
)
|
|
3237
|
+
) : null,
|
|
3238
|
+
/* @__PURE__ */ jsx13(Hint, { children: medVilkar ? tekst.akseptTakOgUtgangVilkar(program.maxContacts) : tekst.akseptTakOgUtgang(program.maxContacts) })
|
|
2754
3239
|
] })
|
|
2755
3240
|
] }),
|
|
2756
|
-
/* @__PURE__ */
|
|
3241
|
+
/* @__PURE__ */ jsx13(
|
|
2757
3242
|
Btn,
|
|
2758
3243
|
{
|
|
2759
3244
|
testID: "bli-med",
|
|
@@ -2770,8 +3255,8 @@ function Aksept({
|
|
|
2770
3255
|
|
|
2771
3256
|
// src/program/HvordanGikkDet.tsx
|
|
2772
3257
|
import { useState as useState6 } from "react";
|
|
2773
|
-
import { Modal as Modal3, Pressable as
|
|
2774
|
-
import { jsx as
|
|
3258
|
+
import { Modal as Modal3, Pressable as Pressable7, Text as Text10, TextInput as TextInput3, View as View13 } from "react-native";
|
|
3259
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2775
3260
|
var UTFALL = [
|
|
2776
3261
|
{ verdi: "fungerte", ikon: "checkmark-circle-outline", etikett: tekst.utfallFungerte },
|
|
2777
3262
|
{ verdi: "delvis", ikon: "contrast-outline", etikett: tekst.utfallDelvis },
|
|
@@ -2783,64 +3268,113 @@ function utfallEtikett(verdi) {
|
|
|
2783
3268
|
}
|
|
2784
3269
|
function HvordanGikkDet({
|
|
2785
3270
|
under,
|
|
3271
|
+
spoersmaal,
|
|
2786
3272
|
sender,
|
|
2787
3273
|
feil,
|
|
2788
3274
|
onLagre,
|
|
3275
|
+
onMeldFeil,
|
|
2789
3276
|
onLukk
|
|
2790
3277
|
}) {
|
|
2791
3278
|
const tema = useTema();
|
|
2792
3279
|
const [valgt, setValgt] = useState6();
|
|
2793
3280
|
const [setning, setSetning] = useState6("");
|
|
2794
|
-
|
|
2795
|
-
|
|
3281
|
+
const tekstVerdi = () => {
|
|
3282
|
+
const trimmet = setning.trim();
|
|
3283
|
+
return trimmet.length > 0 ? trimmet : void 0;
|
|
3284
|
+
};
|
|
3285
|
+
return /* @__PURE__ */ jsx14(Modal3, { visible: true, transparent: true, animationType: "slide", onRequestClose: onLukk, accessibilityViewIsModal: true, children: /* @__PURE__ */ jsx14(View13, { style: { flex: 1, backgroundColor: tema.color.scrim, justifyContent: "flex-end" }, children: /* @__PURE__ */ jsxs12(
|
|
3286
|
+
View13,
|
|
2796
3287
|
{
|
|
2797
3288
|
testID: "hvordan-gikk-det",
|
|
2798
3289
|
accessibilityViewIsModal: true,
|
|
2799
3290
|
style: {
|
|
2800
|
-
backgroundColor: tema.color.
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
3291
|
+
backgroundColor: tema.color.bg,
|
|
3292
|
+
borderTopLeftRadius: tema.radius.lg * 2,
|
|
3293
|
+
borderTopRightRadius: tema.radius.lg * 2,
|
|
3294
|
+
padding: tema.screenPadding,
|
|
3295
|
+
gap: tema.space.md,
|
|
3296
|
+
maxHeight: "92%"
|
|
2806
3297
|
},
|
|
2807
3298
|
children: [
|
|
2808
|
-
/* @__PURE__ */
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
3299
|
+
/* @__PURE__ */ jsxs12(View13, { style: { flexDirection: "row", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
3300
|
+
/* @__PURE__ */ jsx14(Btn, { variant: "ghost", testID: "hvordan-tilbake", ikon: "arrow-back-outline", label: tekst.tilbake, onPress: onLukk }),
|
|
3301
|
+
/* @__PURE__ */ jsx14(View13, {})
|
|
3302
|
+
] }),
|
|
3303
|
+
/* @__PURE__ */ jsxs12(View13, { style: { gap: tema.space.xs }, children: [
|
|
3304
|
+
under ? /* @__PURE__ */ jsx14(Meta, { children: under }) : null,
|
|
3305
|
+
/* @__PURE__ */ jsx14(H, { children: spoersmaal ?? tekst.hvordanGikkDet })
|
|
3306
|
+
] }),
|
|
3307
|
+
/* @__PURE__ */ jsx14(
|
|
3308
|
+
View13,
|
|
3309
|
+
{
|
|
3310
|
+
testID: "utfall-gruppe",
|
|
3311
|
+
accessibilityRole: "radiogroup",
|
|
3312
|
+
accessibilityLabel: spoersmaal ?? tekst.hvordanGikkDet,
|
|
3313
|
+
children: UTFALL.map((u, i) => {
|
|
3314
|
+
const aktiv = valgt === u.verdi;
|
|
3315
|
+
return /* @__PURE__ */ jsxs12(
|
|
3316
|
+
Pressable7,
|
|
3317
|
+
{
|
|
3318
|
+
testID: `utfall-${u.verdi}`,
|
|
3319
|
+
accessibilityRole: "radio",
|
|
3320
|
+
accessibilityLabel: u.etikett,
|
|
3321
|
+
accessibilityState: { checked: aktiv },
|
|
3322
|
+
onPress: () => setValgt(u.verdi),
|
|
3323
|
+
style: {
|
|
3324
|
+
flexDirection: "row",
|
|
3325
|
+
alignItems: "center",
|
|
3326
|
+
gap: tema.space.md,
|
|
3327
|
+
minHeight: tema.touch + tema.space.sm,
|
|
3328
|
+
borderTopWidth: i === 0 ? 0 : tema.hairline,
|
|
3329
|
+
borderTopColor: tema.color.border
|
|
3330
|
+
},
|
|
3331
|
+
children: [
|
|
3332
|
+
/* @__PURE__ */ jsx14(
|
|
3333
|
+
View13,
|
|
3334
|
+
{
|
|
3335
|
+
testID: aktiv ? `utfall-merke-${u.verdi}` : void 0,
|
|
3336
|
+
style: {
|
|
3337
|
+
width: tema.space.lg,
|
|
3338
|
+
height: tema.space.lg,
|
|
3339
|
+
borderRadius: tema.radius.pill,
|
|
3340
|
+
alignItems: "center",
|
|
3341
|
+
justifyContent: "center",
|
|
3342
|
+
backgroundColor: aktiv ? tema.color.brand : "transparent",
|
|
3343
|
+
borderWidth: tema.hairline * 2,
|
|
3344
|
+
borderColor: aktiv ? tema.color.brand : tema.color.borderInteractive
|
|
3345
|
+
},
|
|
3346
|
+
children: aktiv ? /* @__PURE__ */ jsx14(Ikon, { navn: "checkmark-outline", storrelse: "minste", farge: tema.color.onBrand }) : null
|
|
3347
|
+
}
|
|
3348
|
+
),
|
|
3349
|
+
/* @__PURE__ */ jsx14(Ikon, { navn: u.ikon, farge: tema.color.textSecondary }),
|
|
3350
|
+
/* @__PURE__ */ jsx14(
|
|
3351
|
+
Text10,
|
|
3352
|
+
{
|
|
3353
|
+
testID: `utfall-etikett-${u.verdi}`,
|
|
3354
|
+
style: {
|
|
3355
|
+
flex: 1,
|
|
3356
|
+
color: tema.color.textPrimary,
|
|
3357
|
+
fontSize: tema.font.body,
|
|
3358
|
+
lineHeight: tema.lineHeight.body,
|
|
3359
|
+
fontWeight: aktiv ? tema.weight.semibold : tema.weight.regular
|
|
3360
|
+
},
|
|
3361
|
+
children: u.etikett
|
|
3362
|
+
}
|
|
3363
|
+
)
|
|
3364
|
+
]
|
|
3365
|
+
},
|
|
3366
|
+
u.verdi
|
|
3367
|
+
);
|
|
3368
|
+
})
|
|
3369
|
+
}
|
|
3370
|
+
),
|
|
3371
|
+
/* @__PURE__ */ jsxs12(View13, { style: { gap: tema.space.sm }, children: [
|
|
3372
|
+
/* @__PURE__ */ jsxs12(Text10, { style: { color: tema.color.textSecondary, fontSize: tema.font.body, lineHeight: tema.lineHeight.body }, children: [
|
|
3373
|
+
tekst.setningLabel,
|
|
3374
|
+
" ",
|
|
3375
|
+
/* @__PURE__ */ jsx14(Text10, { style: { color: tema.color.textMuted }, children: tekst.setningValgfritt })
|
|
3376
|
+
] }),
|
|
3377
|
+
/* @__PURE__ */ jsx14(
|
|
2844
3378
|
TextInput3,
|
|
2845
3379
|
{
|
|
2846
3380
|
testID: "hvordan-setning",
|
|
@@ -2849,9 +3383,7 @@ function HvordanGikkDet({
|
|
|
2849
3383
|
onChangeText: setSetning,
|
|
2850
3384
|
maxLength: SETNING_MAKS,
|
|
2851
3385
|
multiline: true,
|
|
2852
|
-
numberOfLines:
|
|
2853
|
-
placeholder: tekst.setningPlaceholder,
|
|
2854
|
-
placeholderTextColor: tema.color.textMuted,
|
|
3386
|
+
numberOfLines: 2,
|
|
2855
3387
|
style: {
|
|
2856
3388
|
backgroundColor: tema.color.surfaceRaised,
|
|
2857
3389
|
borderWidth: tema.hairline,
|
|
@@ -2861,24 +3393,33 @@ function HvordanGikkDet({
|
|
|
2861
3393
|
color: tema.color.textPrimary,
|
|
2862
3394
|
fontSize: tema.font.body,
|
|
2863
3395
|
lineHeight: tema.lineHeight.body,
|
|
2864
|
-
minHeight: tema.touch *
|
|
3396
|
+
minHeight: tema.touch * 1.5,
|
|
2865
3397
|
textAlignVertical: "top"
|
|
2866
3398
|
}
|
|
2867
3399
|
}
|
|
2868
3400
|
)
|
|
2869
3401
|
] }),
|
|
2870
|
-
|
|
2871
|
-
|
|
3402
|
+
valgt === "ikke" && onMeldFeil ? /* @__PURE__ */ jsx14(
|
|
3403
|
+
Tekstknapp,
|
|
3404
|
+
{
|
|
3405
|
+
testID: "meld-feil",
|
|
3406
|
+
ikon: "bug-outline",
|
|
3407
|
+
label: tekst.meldFeil,
|
|
3408
|
+
disabled: sender,
|
|
3409
|
+
onPress: () => onMeldFeil("ikke", tekstVerdi())
|
|
3410
|
+
}
|
|
3411
|
+
) : null,
|
|
3412
|
+
feil ? /* @__PURE__ */ jsx14(Banner, { live: true, ikon: "warning-outline", tone: "danger", children: tekst.svarFeil(feil) }) : null,
|
|
3413
|
+
/* @__PURE__ */ jsx14(
|
|
2872
3414
|
Btn,
|
|
2873
3415
|
{
|
|
2874
3416
|
testID: "hvordan-lagre",
|
|
2875
3417
|
label: tekst.lagre,
|
|
2876
|
-
hint: tekst.lagreHint,
|
|
2877
3418
|
disabled: valgt === void 0 || sender,
|
|
3419
|
+
busy: sender,
|
|
2878
3420
|
onPress: () => {
|
|
2879
3421
|
if (valgt === void 0) return;
|
|
2880
|
-
|
|
2881
|
-
onLagre(valgt, trimmet.length > 0 ? trimmet : void 0);
|
|
3422
|
+
onLagre(valgt, tekstVerdi());
|
|
2882
3423
|
}
|
|
2883
3424
|
}
|
|
2884
3425
|
)
|
|
@@ -2889,15 +3430,13 @@ function HvordanGikkDet({
|
|
|
2889
3430
|
|
|
2890
3431
|
// src/program/Oppfolging.tsx
|
|
2891
3432
|
import "react";
|
|
2892
|
-
import {
|
|
2893
|
-
import { Fragment as
|
|
3433
|
+
import { View as View14 } from "react-native";
|
|
3434
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2894
3435
|
function tarSvar(kind) {
|
|
2895
3436
|
return kind === "hvordan_gikk_det" || kind === "sjekkpunkt";
|
|
2896
3437
|
}
|
|
2897
3438
|
function Oppfolging({
|
|
2898
3439
|
oppfolging,
|
|
2899
|
-
kontaktNr,
|
|
2900
|
-
maksKontakter,
|
|
2901
3440
|
onSenere,
|
|
2902
3441
|
onSvar,
|
|
2903
3442
|
onAapneOppgavene,
|
|
@@ -2905,45 +3444,28 @@ function Oppfolging({
|
|
|
2905
3444
|
}) {
|
|
2906
3445
|
const tema = useTema();
|
|
2907
3446
|
const art = tarSvar(oppfolging.kind) ? "spoersmaal" : oppfolging.kind === "tilbud_om_utgang" ? "utgang" : "paaminnelse";
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
return /* @__PURE__ */ jsxs12(
|
|
2911
|
-
View13,
|
|
3447
|
+
return /* @__PURE__ */ jsxs13(
|
|
3448
|
+
View14,
|
|
2912
3449
|
{
|
|
2913
3450
|
testID: `oppfolging-${oppfolging.id}`,
|
|
2914
3451
|
accessibilityLabel: tekst.oppfolgingRegion,
|
|
2915
3452
|
style: {
|
|
2916
3453
|
backgroundColor: tema.color.brandBg,
|
|
2917
|
-
borderWidth: tema.hairline,
|
|
2918
|
-
borderColor: tema.color.brand,
|
|
2919
3454
|
borderRadius: tema.radius.lg,
|
|
2920
3455
|
padding: tema.space.md,
|
|
2921
|
-
gap: tema.space.
|
|
3456
|
+
gap: tema.space.md
|
|
2922
3457
|
},
|
|
2923
3458
|
children: [
|
|
2924
|
-
/* @__PURE__ */
|
|
2925
|
-
/* @__PURE__ */
|
|
2926
|
-
/* @__PURE__ */
|
|
2927
|
-
/* @__PURE__ */ jsx14(Text10, { style: { color: tema.color.textPrimary, fontSize: tema.font.body, lineHeight: tema.lineHeight.body }, children: oppfolging.question }),
|
|
2928
|
-
/* @__PURE__ */ jsx14(Hint, { children: hint })
|
|
2929
|
-
] })
|
|
3459
|
+
/* @__PURE__ */ jsxs13(View14, { style: { flexDirection: "row", gap: tema.space.sm, alignItems: "flex-start" }, children: [
|
|
3460
|
+
/* @__PURE__ */ jsx15(View14, { style: { paddingTop: tema.space.xs }, children: /* @__PURE__ */ jsx15(Ikon, { navn: "flask-outline", farge: tema.color.brand }) }),
|
|
3461
|
+
/* @__PURE__ */ jsx15(View14, { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsx15(H, { nivaa: 3, meta: tekst.oppfolgingKost, children: oppfolging.question }) })
|
|
2930
3462
|
] }),
|
|
2931
|
-
/* @__PURE__ */
|
|
2932
|
-
/* @__PURE__ */
|
|
2933
|
-
/* @__PURE__ */
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
variant: "danger",
|
|
2938
|
-
testID: `gaa-ut-${oppfolging.id}`,
|
|
2939
|
-
ikon: "exit-outline",
|
|
2940
|
-
label: tekst.gaaUtBekreft,
|
|
2941
|
-
onPress: onGaaUt
|
|
2942
|
-
}
|
|
2943
|
-
)
|
|
2944
|
-
] }) : /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
2945
|
-
/* @__PURE__ */ jsx14(Btn, { grow: true, variant: "secondary", testID: `senere-${oppfolging.id}`, label: tekst.senere, onPress: onSenere }),
|
|
2946
|
-
art === "spoersmaal" ? /* @__PURE__ */ jsx14(Btn, { grow: true, testID: `svar-naa-${oppfolging.id}`, label: tekst.svarNaa, onPress: onSvar }) : /* @__PURE__ */ jsx14(Btn, { grow: true, testID: `aapne-oppgavene-${oppfolging.id}`, label: tekst.aapneOppgavene, onPress: onAapneOppgavene })
|
|
3463
|
+
/* @__PURE__ */ jsx15(View14, { style: { flexDirection: "row", gap: tema.space.sm }, children: art === "utgang" ? /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
3464
|
+
/* @__PURE__ */ jsx15(Btn, { grow: true, variant: "secondary", testID: `bli-vaerende-${oppfolging.id}`, label: tekst.bliVaerende, onPress: onSenere }),
|
|
3465
|
+
/* @__PURE__ */ jsx15(Btn, { grow: true, variant: "secondary", testID: `gaa-ut-${oppfolging.id}`, ikon: "exit-outline", label: tekst.gaaUtBekreft, onPress: onGaaUt })
|
|
3466
|
+
] }) : /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
3467
|
+
/* @__PURE__ */ jsx15(Btn, { grow: true, variant: "secondary", testID: `senere-${oppfolging.id}`, label: tekst.senere, onPress: onSenere }),
|
|
3468
|
+
art === "spoersmaal" ? /* @__PURE__ */ jsx15(Btn, { grow: true, testID: `svar-naa-${oppfolging.id}`, label: tekst.svarNaa, onPress: onSvar }) : /* @__PURE__ */ jsx15(Btn, { grow: true, testID: `aapne-oppgavene-${oppfolging.id}`, label: tekst.aapneOppgavene, onPress: onAapneOppgavene })
|
|
2947
3469
|
] }) })
|
|
2948
3470
|
]
|
|
2949
3471
|
}
|
|
@@ -2952,52 +3474,73 @@ function Oppfolging({
|
|
|
2952
3474
|
|
|
2953
3475
|
// src/program/Oppgaver.tsx
|
|
2954
3476
|
import "react";
|
|
2955
|
-
import { Text as Text11, View as
|
|
2956
|
-
import { jsx as
|
|
3477
|
+
import { Text as Text11, View as View15 } from "react-native";
|
|
3478
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2957
3479
|
function Oppgaver({
|
|
2958
3480
|
tasks,
|
|
2959
3481
|
completions,
|
|
3482
|
+
over,
|
|
2960
3483
|
onGjort
|
|
2961
3484
|
}) {
|
|
2962
3485
|
const tema = useTema();
|
|
2963
3486
|
const ferdig = new Map(completions.map((c) => [c.taskId, c]));
|
|
2964
|
-
return /* @__PURE__ */
|
|
3487
|
+
return /* @__PURE__ */ jsx16(View15, { testID: "oppgaver", accessibilityLabel: tekst.oppgaverTittel, children: [...tasks].sort((a, b) => a.order - b.order).map((o, i) => {
|
|
2965
3488
|
const c = ferdig.get(o.id);
|
|
2966
|
-
|
|
2967
|
-
|
|
3489
|
+
const meta = c ? tekst.oppgaveGjortMeta(formaterFrist(c.at), utfallEtikett(c.outcome)) : tekst.oppgaveTid(o.estimatedMinutes, o.screenHint);
|
|
3490
|
+
return /* @__PURE__ */ jsxs14(
|
|
3491
|
+
View15,
|
|
2968
3492
|
{
|
|
2969
3493
|
testID: `oppgave-${o.id}`,
|
|
3494
|
+
accessibilityLabel: tekst.oppgaveRadA11y(i + 1, o.title, c ? meta : tekst.oppgaveIkkeGjort),
|
|
2970
3495
|
style: {
|
|
2971
3496
|
flexDirection: "row",
|
|
2972
3497
|
alignItems: "center",
|
|
2973
3498
|
gap: tema.space.sm,
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
3499
|
+
minHeight: tema.touch + tema.space.sm,
|
|
3500
|
+
paddingVertical: tema.space.sm,
|
|
3501
|
+
borderTopWidth: i === 0 ? 0 : tema.hairline,
|
|
3502
|
+
borderTopColor: tema.color.border
|
|
2977
3503
|
},
|
|
2978
3504
|
children: [
|
|
2979
|
-
/* @__PURE__ */
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
3505
|
+
/* @__PURE__ */ jsx16(
|
|
3506
|
+
View15,
|
|
3507
|
+
{
|
|
3508
|
+
style: {
|
|
3509
|
+
width: tema.space.lg,
|
|
3510
|
+
height: tema.space.lg,
|
|
3511
|
+
borderRadius: tema.radius.pill,
|
|
3512
|
+
alignItems: "center",
|
|
3513
|
+
justifyContent: "center",
|
|
3514
|
+
backgroundColor: c ? tema.color.success : "transparent",
|
|
3515
|
+
borderWidth: c ? 0 : tema.hairline * 2,
|
|
3516
|
+
borderStyle: "dashed",
|
|
3517
|
+
borderColor: tema.color.borderStrong
|
|
3518
|
+
},
|
|
3519
|
+
children: c ? /* @__PURE__ */ jsx16(Ikon, { navn: "checkmark-outline", storrelse: "minste", farge: tema.color.bg }) : null
|
|
3520
|
+
}
|
|
3521
|
+
),
|
|
3522
|
+
/* @__PURE__ */ jsxs14(View15, { style: { flex: 1, minWidth: 0 }, children: [
|
|
3523
|
+
/* @__PURE__ */ jsx16(
|
|
3524
|
+
Text11,
|
|
3525
|
+
{
|
|
3526
|
+
testID: `oppgave-tittel-${o.id}`,
|
|
3527
|
+
style: { color: tema.color.textPrimary, fontSize: tema.font.body, lineHeight: tema.lineHeight.body, fontWeight: tema.weight.semibold },
|
|
3528
|
+
children: o.title
|
|
3529
|
+
}
|
|
3530
|
+
),
|
|
3531
|
+
/* @__PURE__ */ jsx16(Meta, { testID: `oppgave-meta-${o.id}`, children: meta }),
|
|
3532
|
+
c?.text ? /* @__PURE__ */ jsx16(Sek, { testID: `oppgave-setning-${o.id}`, children: c.text }) : null
|
|
2985
3533
|
] }),
|
|
2986
|
-
c ? (
|
|
2987
|
-
// Merket er den eneste flaten der ikonet står alene, så etiketten
|
|
2988
|
-
// ligger på containeren: skjermleseren hører utfallet, ikke «hake».
|
|
2989
|
-
/* @__PURE__ */ jsx15(View14, { accessibilityLabel: tekst.oppgaveGjortMed(utfallEtikett(c.outcome)), accessible: true, children: /* @__PURE__ */ jsx15(Ikon, { navn: "checkmark-circle-outline", farge: tema.color.success }) })
|
|
2990
|
-
) : /* @__PURE__ */ jsx15(
|
|
3534
|
+
!c && !over ? /* @__PURE__ */ jsx16(
|
|
2991
3535
|
Btn,
|
|
2992
3536
|
{
|
|
2993
|
-
variant: "
|
|
3537
|
+
variant: "tonet",
|
|
2994
3538
|
testID: `gjort-${o.id}`,
|
|
2995
|
-
ikon: "checkmark-circle-outline",
|
|
2996
3539
|
label: tekst.oppgaveGjort,
|
|
2997
3540
|
accessibilityLabel: tekst.oppgaveGjortLabel(o.title),
|
|
2998
3541
|
onPress: () => onGjort(o)
|
|
2999
3542
|
}
|
|
3000
|
-
)
|
|
3543
|
+
) : null
|
|
3001
3544
|
]
|
|
3002
3545
|
},
|
|
3003
3546
|
o.id
|
|
@@ -3005,8 +3548,33 @@ function Oppgaver({
|
|
|
3005
3548
|
}) });
|
|
3006
3549
|
}
|
|
3007
3550
|
|
|
3551
|
+
// src/program/ProgramSpor.tsx
|
|
3552
|
+
import "react";
|
|
3553
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
3554
|
+
function programErOver(deltakelse, program, naa = /* @__PURE__ */ new Date()) {
|
|
3555
|
+
return deltakelse.status === "fullfoert" || new Date(program.closesAt).getTime() < naa.getTime();
|
|
3556
|
+
}
|
|
3557
|
+
function programledd(deltakelse, program, naa = /* @__PURE__ */ new Date()) {
|
|
3558
|
+
const over = programErOver(deltakelse, program, naa);
|
|
3559
|
+
const gjort = deltakelse.completions.length;
|
|
3560
|
+
const av = program.tasks.length;
|
|
3561
|
+
const alt = av > 0 && gjort >= av;
|
|
3562
|
+
return [
|
|
3563
|
+
{ nokkel: "ble-med", etikett: tekst.programBleMed, tilstand: "gjort", detalj: formaterFrist(deltakelse.joinedAt) },
|
|
3564
|
+
{
|
|
3565
|
+
nokkel: "gjort",
|
|
3566
|
+
etikett: tekst.programGjort(gjort, av),
|
|
3567
|
+
...over || alt ? { tilstand: "gjort" } : { tilstand: "naa", ikon: "flask-outline", detalj: tekst.programNaarDetPasser }
|
|
3568
|
+
},
|
|
3569
|
+
over ? { nokkel: "over", etikett: tekst.programOver, tilstand: "gjort", detalj: formaterFrist(program.closesAt) } : { nokkel: "over", etikett: tekst.programOver, tilstand: "kommer", tall: formaterKortFrist(program.closesAt) }
|
|
3570
|
+
];
|
|
3571
|
+
}
|
|
3572
|
+
function ProgramSpor({ deltakelse, program }) {
|
|
3573
|
+
return /* @__PURE__ */ jsx17(Sporingslinje, { ledd: programledd(deltakelse, program), testID: "program-spor", etikett: tekst.programSporEtikett });
|
|
3574
|
+
}
|
|
3575
|
+
|
|
3008
3576
|
// src/program/InnspelProgram.tsx
|
|
3009
|
-
import { Fragment as
|
|
3577
|
+
import { Fragment as Fragment4, jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3010
3578
|
function InnspelProgram({
|
|
3011
3579
|
invitationToken,
|
|
3012
3580
|
onEndring,
|
|
@@ -3024,10 +3592,9 @@ function InnspelProgram({
|
|
|
3024
3592
|
const [dialog, setDialog] = useState7();
|
|
3025
3593
|
const [svarFeil, setSvarFeil] = useState7();
|
|
3026
3594
|
const [lagtBort, setLagtBort] = useState7(/* @__PURE__ */ new Set());
|
|
3027
|
-
const [meldFeilFor, setMeldFeilFor] = useState7();
|
|
3028
3595
|
const leggBort = useCallback4((id) => setLagtBort((s) => /* @__PURE__ */ new Set([...s, id])), []);
|
|
3029
3596
|
const lagreSvar = useCallback4(
|
|
3030
|
-
async (outcome, text) => {
|
|
3597
|
+
async (outcome, text, meldEtterpaa = false) => {
|
|
3031
3598
|
if (!dialog || !deltakelse) return;
|
|
3032
3599
|
setSender(true);
|
|
3033
3600
|
setSvarFeil(void 0);
|
|
@@ -3035,7 +3602,7 @@ function InnspelProgram({
|
|
|
3035
3602
|
if (dialog.type === "oppgave") {
|
|
3036
3603
|
const ny = await client.programs.completeTask(dialog.task.id, { outcome, ...text ? { text } : {} });
|
|
3037
3604
|
setDeltakelse({ ...deltakelse, completions: [...deltakelse.completions, ny] });
|
|
3038
|
-
if (
|
|
3605
|
+
if (meldEtterpaa && onMeldFeil) onMeldFeil(dialog.task);
|
|
3039
3606
|
} else {
|
|
3040
3607
|
await client.programs.respond(dialog.oppfolging.id, { outcome, ...text ? { text } : {} });
|
|
3041
3608
|
setMine((m) => m ? { ...m, pendingFollowUps: m.pendingFollowUps.filter((f) => f.id !== dialog.oppfolging.id) } : m);
|
|
@@ -3095,14 +3662,12 @@ function InnspelProgram({
|
|
|
3095
3662
|
if (!program) return null;
|
|
3096
3663
|
if (deltakelse) {
|
|
3097
3664
|
const kort = (mine?.pendingFollowUps ?? []).filter((f) => f.programId === program.id && !lagtBort.has(f.id)).sort((a, b) => a.emittedAt.localeCompare(b.emittedAt));
|
|
3098
|
-
const
|
|
3099
|
-
return /* @__PURE__ */
|
|
3100
|
-
kort.map((f
|
|
3665
|
+
const over = programErOver(deltakelse, program);
|
|
3666
|
+
return /* @__PURE__ */ jsxs15(View16, { testID: "program-deltakelse", accessibilityLabel: tekst.deltakelseRegion, style: { gap: tema.space.md }, children: [
|
|
3667
|
+
kort.map((f) => /* @__PURE__ */ jsx18(
|
|
3101
3668
|
Oppfolging,
|
|
3102
3669
|
{
|
|
3103
3670
|
oppfolging: f,
|
|
3104
|
-
kontaktNr: forsteKontaktNr + i,
|
|
3105
|
-
maksKontakter: program.maxContacts,
|
|
3106
3671
|
onSenere: () => leggBort(f.id),
|
|
3107
3672
|
onSvar: () => {
|
|
3108
3673
|
setSvarFeil(void 0);
|
|
@@ -3113,50 +3678,37 @@ function InnspelProgram({
|
|
|
3113
3678
|
},
|
|
3114
3679
|
f.id
|
|
3115
3680
|
)),
|
|
3116
|
-
/* @__PURE__ */
|
|
3117
|
-
/* @__PURE__ */
|
|
3118
|
-
/* @__PURE__ */
|
|
3681
|
+
/* @__PURE__ */ jsxs15(Card, { style: { gap: tema.space.md }, children: [
|
|
3682
|
+
/* @__PURE__ */ jsx18(H, { children: program.name }),
|
|
3683
|
+
/* @__PURE__ */ jsx18(ProgramSpor, { deltakelse, program }),
|
|
3684
|
+
feil ? /* @__PURE__ */ jsx18(Banner, { live: true, ikon: "warning-outline", tone: "warning", children: feil }) : null,
|
|
3685
|
+
/* @__PURE__ */ jsx18(
|
|
3119
3686
|
Oppgaver,
|
|
3120
3687
|
{
|
|
3121
3688
|
tasks: program.tasks,
|
|
3122
3689
|
completions: deltakelse.completions,
|
|
3690
|
+
over,
|
|
3123
3691
|
onGjort: (task) => {
|
|
3124
3692
|
setSvarFeil(void 0);
|
|
3125
3693
|
setDialog({ type: "oppgave", task });
|
|
3126
3694
|
}
|
|
3127
3695
|
}
|
|
3128
3696
|
),
|
|
3129
|
-
|
|
3130
|
-
/* @__PURE__ */ jsx16(Hint, { children: tekst.meldFeilHint }),
|
|
3131
|
-
/* @__PURE__ */ jsx16(
|
|
3132
|
-
Btn,
|
|
3133
|
-
{
|
|
3134
|
-
variant: "secondary",
|
|
3135
|
-
testID: "meld-feil",
|
|
3136
|
-
ikon: "bug-outline",
|
|
3137
|
-
label: tekst.meldFeil,
|
|
3138
|
-
onPress: () => {
|
|
3139
|
-
const task = meldFeilFor;
|
|
3140
|
-
setMeldFeilFor(void 0);
|
|
3141
|
-
onMeldFeil(task);
|
|
3142
|
-
}
|
|
3143
|
-
}
|
|
3144
|
-
)
|
|
3145
|
-
] }) : null,
|
|
3146
|
-
/* @__PURE__ */ jsx16(Btn, { variant: "ghost", testID: "gaa-ut", ikon: "exit-outline", label: tekst.gaaUt, onPress: () => setViserGaaUt(true) })
|
|
3697
|
+
/* @__PURE__ */ jsx18(Tekstknapp, { noytral: true, testID: "gaa-ut", ikon: "exit-outline", label: tekst.gaaUt, onPress: () => setViserGaaUt(true) })
|
|
3147
3698
|
] }),
|
|
3148
|
-
dialog ? /* @__PURE__ */
|
|
3699
|
+
dialog ? /* @__PURE__ */ jsx18(
|
|
3149
3700
|
HvordanGikkDet,
|
|
3150
3701
|
{
|
|
3151
|
-
|
|
3702
|
+
...dialog.type === "oppgave" ? { under: dialog.task.title } : { spoersmaal: dialog.oppfolging.question },
|
|
3152
3703
|
sender,
|
|
3153
3704
|
...svarFeil ? { feil: svarFeil } : {},
|
|
3705
|
+
...dialog.type === "oppgave" && onMeldFeil ? { onMeldFeil: (outcome, text) => void lagreSvar(outcome, text, true) } : {},
|
|
3154
3706
|
onLagre: (outcome, text) => void lagreSvar(outcome, text),
|
|
3155
3707
|
onLukk: () => setDialog(void 0)
|
|
3156
3708
|
}
|
|
3157
3709
|
) : null,
|
|
3158
|
-
viserGaaUt ? /* @__PURE__ */
|
|
3159
|
-
|
|
3710
|
+
viserGaaUt ? /* @__PURE__ */ jsx18(Modal4, { visible: true, transparent: true, animationType: "fade", onRequestClose: () => setViserGaaUt(false), accessibilityViewIsModal: true, children: /* @__PURE__ */ jsx18(View16, { style: { flex: 1, backgroundColor: tema.color.scrim, justifyContent: "flex-end", padding: tema.space.md }, children: /* @__PURE__ */ jsxs15(
|
|
3711
|
+
View16,
|
|
3160
3712
|
{
|
|
3161
3713
|
testID: "gaa-ut-dialog",
|
|
3162
3714
|
accessibilityViewIsModal: true,
|
|
@@ -3169,11 +3721,11 @@ function InnspelProgram({
|
|
|
3169
3721
|
gap: tema.space.md
|
|
3170
3722
|
},
|
|
3171
3723
|
children: [
|
|
3172
|
-
/* @__PURE__ */
|
|
3173
|
-
/* @__PURE__ */
|
|
3174
|
-
/* @__PURE__ */
|
|
3175
|
-
/* @__PURE__ */
|
|
3176
|
-
/* @__PURE__ */
|
|
3724
|
+
/* @__PURE__ */ jsx18(H, { nivaa: 3, children: tekst.gaaUtTittel }),
|
|
3725
|
+
/* @__PURE__ */ jsx18(Brodtekst, { children: tekst.gaaUtTekst(program.name) }),
|
|
3726
|
+
/* @__PURE__ */ jsxs15(View16, { style: { flexDirection: "row", gap: tema.space.sm }, children: [
|
|
3727
|
+
/* @__PURE__ */ jsx18(Btn, { grow: true, variant: "secondary", testID: "bli-vaerende", label: tekst.bliVaerende, onPress: () => setViserGaaUt(false) }),
|
|
3728
|
+
/* @__PURE__ */ jsx18(
|
|
3177
3729
|
Btn,
|
|
3178
3730
|
{
|
|
3179
3731
|
grow: true,
|
|
@@ -3192,45 +3744,40 @@ function InnspelProgram({
|
|
|
3192
3744
|
] });
|
|
3193
3745
|
}
|
|
3194
3746
|
if (!invitasjon || avvist) return null;
|
|
3195
|
-
return /* @__PURE__ */
|
|
3196
|
-
/* @__PURE__ */
|
|
3197
|
-
|
|
3747
|
+
return /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
3748
|
+
/* @__PURE__ */ jsxs15(
|
|
3749
|
+
View16,
|
|
3198
3750
|
{
|
|
3199
3751
|
testID: "program-banner",
|
|
3200
3752
|
accessibilityLabel: tekst.invitasjonRegion,
|
|
3201
3753
|
style: {
|
|
3202
3754
|
backgroundColor: tema.color.brandBg,
|
|
3203
3755
|
borderRadius: tema.radius.lg,
|
|
3204
|
-
borderWidth: tema.hairline,
|
|
3205
|
-
borderColor: tema.color.brand,
|
|
3206
3756
|
padding: tema.space.md,
|
|
3207
|
-
gap: tema.space.
|
|
3757
|
+
gap: tema.space.md
|
|
3208
3758
|
},
|
|
3209
3759
|
children: [
|
|
3210
|
-
/* @__PURE__ */
|
|
3211
|
-
/* @__PURE__ */
|
|
3212
|
-
/* @__PURE__ */
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
] }),
|
|
3216
|
-
/* @__PURE__ */ jsx16(
|
|
3217
|
-
Pressable9,
|
|
3760
|
+
/* @__PURE__ */ jsxs15(View16, { style: { flexDirection: "row", gap: tema.space.sm, alignItems: "flex-start" }, children: [
|
|
3761
|
+
/* @__PURE__ */ jsx18(View16, { style: { paddingTop: tema.space.xs }, children: /* @__PURE__ */ jsx18(Ikon, { navn: "flask-outline", farge: tema.color.brand }) }),
|
|
3762
|
+
/* @__PURE__ */ jsx18(View16, { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsx18(H, { nivaa: 3, meta: tekst.invitasjonMeta(program.tasks.length, periode(program.opensAt, program.closesAt)), children: tekst.invitasjonHva(program.name) }) }),
|
|
3763
|
+
/* @__PURE__ */ jsx18(
|
|
3764
|
+
Pressable8,
|
|
3218
3765
|
{
|
|
3219
3766
|
testID: "avvis-invitasjon",
|
|
3220
3767
|
accessibilityRole: "button",
|
|
3221
3768
|
accessibilityLabel: tekst.avvisInvitasjon,
|
|
3222
3769
|
onPress: () => setAvvist(true),
|
|
3223
3770
|
style: { minWidth: tema.touch, minHeight: tema.touch, alignItems: "center", justifyContent: "center" },
|
|
3224
|
-
children: /* @__PURE__ */
|
|
3771
|
+
children: /* @__PURE__ */ jsx18(Ikon, { navn: "close-outline", farge: tema.color.textSecondary })
|
|
3225
3772
|
}
|
|
3226
3773
|
)
|
|
3227
3774
|
] }),
|
|
3228
|
-
feil && !viserAksept ? /* @__PURE__ */
|
|
3229
|
-
/* @__PURE__ */
|
|
3775
|
+
feil && !viserAksept ? /* @__PURE__ */ jsx18(Banner, { live: true, ikon: "warning-outline", tone: "danger", children: tekst.akseptFeil(feil) }) : null,
|
|
3776
|
+
/* @__PURE__ */ jsx18(Btn, { testID: "les-mer", label: tekst.lesMer, onPress: () => setViserAksept(true) })
|
|
3230
3777
|
]
|
|
3231
3778
|
}
|
|
3232
3779
|
),
|
|
3233
|
-
viserAksept ? /* @__PURE__ */
|
|
3780
|
+
viserAksept ? /* @__PURE__ */ jsx18(
|
|
3234
3781
|
Aksept,
|
|
3235
3782
|
{
|
|
3236
3783
|
program,
|