@elice/material-survey 1.230726.0 → 1.230817.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.
Files changed (25) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +6 -11
  2. package/cjs/components/material-survey/context/MaterialSurveyContext.d.ts +2 -2
  3. package/cjs/components/material-survey-edit/MaterialSurveyEdit.d.ts +2 -2
  4. package/cjs/components/material-survey-edit/context.d.ts +1 -1
  5. package/cjs/components/material-survey-edit/utils/editValue.d.ts +2 -2
  6. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +2 -2
  7. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +1 -0
  8. package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.d.ts +1 -1
  9. package/cjs/components/shared/question-radio/QuestionRadioContext.d.ts +2 -2
  10. package/cjs/components/shared/question-radio/QuestionRadioContext.js +1 -0
  11. package/cjs/components/shared/question-radio/QuestionRadioOption.d.ts +1 -1
  12. package/cjs/helpers/index.d.ts +2 -2
  13. package/es/_virtual/_rollupPluginBabelHelpers.js +6 -11
  14. package/es/components/material-survey/context/MaterialSurveyContext.d.ts +2 -2
  15. package/es/components/material-survey-edit/MaterialSurveyEdit.d.ts +2 -2
  16. package/es/components/material-survey-edit/context.d.ts +1 -1
  17. package/es/components/material-survey-edit/utils/editValue.d.ts +2 -2
  18. package/es/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +2 -2
  19. package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +1 -0
  20. package/es/components/shared/question-checkbox/QuestionCheckboxOption.d.ts +1 -1
  21. package/es/components/shared/question-radio/QuestionRadioContext.d.ts +2 -2
  22. package/es/components/shared/question-radio/QuestionRadioContext.js +1 -0
  23. package/es/components/shared/question-radio/QuestionRadioOption.d.ts +1 -1
  24. package/es/helpers/index.d.ts +2 -2
  25. package/package.json +12 -16
@@ -135,7 +135,10 @@ function _regeneratorRuntime() {
135
135
  if ("executing" === state) throw new Error("Generator is already running");
136
136
  if ("completed" === state) {
137
137
  if ("throw" === method) throw arg;
138
- return doneResult();
138
+ return {
139
+ value: void 0,
140
+ done: !0
141
+ };
139
142
  }
140
143
  for (context.method = method, context.arg = arg;;) {
141
144
  var delegate = context.delegate;
@@ -188,7 +191,7 @@ function _regeneratorRuntime() {
188
191
  }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
189
192
  }
190
193
  function values(iterable) {
191
- if (iterable) {
194
+ if (iterable || "" === iterable) {
192
195
  var iteratorMethod = iterable[iteratorSymbol];
193
196
  if (iteratorMethod) return iteratorMethod.call(iterable);
194
197
  if ("function" == typeof iterable.next) return iterable;
@@ -201,15 +204,7 @@ function _regeneratorRuntime() {
201
204
  return next.next = next;
202
205
  }
203
206
  }
204
- return {
205
- next: doneResult
206
- };
207
- }
208
- function doneResult() {
209
- return {
210
- value: undefined,
211
- done: !0
212
- };
207
+ throw new TypeError(typeof iterable + " is not iterable");
213
208
  }
214
209
  return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
215
210
  value: GeneratorFunctionPrototype,
@@ -9,7 +9,7 @@ export interface State {
9
9
  materialSurvey?: GetOrgMaterialSurveyGetResponses['materialSurvey'];
10
10
  userId?: number;
11
11
  }
12
- export declare type MaterialSurveyProps = {
12
+ export type MaterialSurveyProps = {
13
13
  materialSurveyId: number;
14
14
  userId?: number;
15
15
  locale?: string;
@@ -25,7 +25,7 @@ interface DispatchContextType {
25
25
  setVertical: React.Dispatch<React.SetStateAction<boolean>>;
26
26
  onNext?: () => void;
27
27
  }
28
- declare function MaterialSurveyProvider({ materialSurveyId, userId, onSubmit, onNext, children, }: MaterialSurveyProviderProps): JSX.Element;
28
+ declare function MaterialSurveyProvider({ materialSurveyId, userId, onSubmit, onNext, children, }: MaterialSurveyProviderProps): React.JSX.Element;
29
29
  declare function useMaterialSurveyState(): State;
30
30
  declare function useMaterialSurveyDispatch(): DispatchContextType;
31
31
  export { MaterialSurveyProvider, useMaterialSurveyState, useMaterialSurveyDispatch, };
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import type { MarkdownEditorFileUploadReqFn } from '@elice/markdown';
3
3
  import type { GetOrgMaterialSurveyGetResponses } from '@elice/types';
4
4
  import type { FormState } from 'react-hook-form';
5
- export declare type MaterialSurveyEditValue = Pick<GetOrgMaterialSurveyGetResponses['materialSurvey'], 'id' | 'questionInfoList'>;
6
- export declare type MaterialSurveyEditFormState = Pick<FormState<Record<string, any>>, 'isDirty' | 'isValid'>;
5
+ export type MaterialSurveyEditValue = Pick<GetOrgMaterialSurveyGetResponses['materialSurvey'], 'id' | 'questionInfoList'>;
6
+ export type MaterialSurveyEditFormState = Pick<FormState<Record<string, any>>, 'isDirty' | 'isValid'>;
7
7
  export interface MaterialSurveyEditProps {
8
8
  /** Value of material survey edit form. */
9
9
  value: MaterialSurveyEditValue;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { MaterialSurveyEditProps } from './MaterialSurveyEdit';
3
- declare type MaterialSurveyEditContextValue = Pick<MaterialSurveyEditProps, 'disabled' | 'onFileUploadRequest'>;
3
+ type MaterialSurveyEditContextValue = Pick<MaterialSurveyEditProps, 'disabled' | 'onFileUploadRequest'>;
4
4
  declare const MaterialSurveyEditContext: React.Context<MaterialSurveyEditContextValue>;
5
5
  export declare const useMaterialSurveyEditContext: () => MaterialSurveyEditContextValue;
6
6
  export default MaterialSurveyEditContext;
@@ -1,11 +1,11 @@
1
1
  import type { MaterialSurveyEditValue } from '../MaterialSurveyEdit';
2
- declare type _SurveyEditQuestionInfo = Omit<MaterialSurveyEditValue['questionInfoList'][number], 'optionInfo'> & {
2
+ type _SurveyEditQuestionInfo = Omit<MaterialSurveyEditValue['questionInfoList'][number], 'optionInfo'> & {
3
3
  optionInfo: {
4
4
  id: string;
5
5
  value: string;
6
6
  }[];
7
7
  };
8
- export declare type _SurveyEditValue = Omit<MaterialSurveyEditValue, 'questionInfoList'> & {
8
+ export type _SurveyEditValue = Omit<MaterialSurveyEditValue, 'questionInfoList'> & {
9
9
  questionInfoList: _SurveyEditQuestionInfo[];
10
10
  };
11
11
  /**
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { QuestionCheckboxProps } from './QuestionCheckbox';
3
- declare type Value = Pick<QuestionCheckboxProps, 'selectedOptions' | 'disabled' | 'onSelect'>;
3
+ type Value = Pick<QuestionCheckboxProps, 'selectedOptions' | 'disabled' | 'onSelect'>;
4
4
  interface QuestionCheckboxProviderProps extends QuestionCheckboxProps {
5
5
  children: React.ReactNode;
6
6
  }
7
- declare function QuestionCheckboxContextProvider({ selectedOptions, onSelect, disabled, children, }: QuestionCheckboxProviderProps): JSX.Element;
7
+ declare function QuestionCheckboxContextProvider({ selectedOptions, onSelect, disabled, children, }: QuestionCheckboxProviderProps): React.JSX.Element;
8
8
  declare function useQuestionCheckboxContext(): Value;
9
9
  export { QuestionCheckboxContextProvider, useQuestionCheckboxContext };
@@ -15,6 +15,7 @@ function QuestionCheckboxContextProvider(_ref) {
15
15
  onSelect = _ref.onSelect,
16
16
  disabled = _ref.disabled,
17
17
  children = _ref.children;
18
+ // eslint-disable-next-line react-hooks/exhaustive-deps
18
19
  var onSelectValue = React__default["default"].useCallback(onSelect, []);
19
20
  var value = React__default["default"].useMemo(function () {
20
21
  return {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type Status = 'correct' | 'wrong' | 'answer';
2
+ type Status = 'correct' | 'wrong' | 'answer';
3
3
  interface QuestionCheckboxOptionProps {
4
4
  value: any;
5
5
  status?: Status;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { QuestionRadioProps } from './QuestionRadio';
3
- declare type Value = Pick<QuestionRadioProps, 'selectedValue' | 'disabled' | 'onSelect'>;
3
+ type Value = Pick<QuestionRadioProps, 'selectedValue' | 'disabled' | 'onSelect'>;
4
4
  interface QuestionRadioProviderProps extends QuestionRadioProps {
5
5
  children: React.ReactNode;
6
6
  }
7
- declare function QuestionRadioContextProvider({ selectedValue, onSelect, disabled, children, }: QuestionRadioProviderProps): JSX.Element;
7
+ declare function QuestionRadioContextProvider({ selectedValue, onSelect, disabled, children, }: QuestionRadioProviderProps): React.JSX.Element;
8
8
  declare function useQuestionRadioContext(): Value;
9
9
  export { QuestionRadioContextProvider, useQuestionRadioContext };
@@ -15,6 +15,7 @@ function QuestionRadioContextProvider(_ref) {
15
15
  onSelect = _ref.onSelect,
16
16
  disabled = _ref.disabled,
17
17
  children = _ref.children;
18
+ // eslint-disable-next-line react-hooks/exhaustive-deps
18
19
  var onSelectValue = React__default["default"].useCallback(onSelect, []);
19
20
  var value = React__default["default"].useMemo(function () {
20
21
  return {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type Status = 'correct' | 'wrong' | 'answer';
2
+ type Status = 'correct' | 'wrong' | 'answer';
3
3
  interface QuestionRadioOptionProps {
4
4
  value: any;
5
5
  status?: Status;
@@ -11,8 +11,8 @@ interface AnswerInfo {
11
11
  order: number | null;
12
12
  isSelected: boolean;
13
13
  }
14
- export declare type Option = OptionInfo & Omit<AnswerInfo, 'optionIdent'>;
15
- export declare type OptionList = Option[];
14
+ export type Option = OptionInfo & Omit<AnswerInfo, 'optionIdent'>;
15
+ export type OptionList = Option[];
16
16
  export declare enum SurveyResultStatus {
17
17
  Submitted = 0,
18
18
  NotSubmitted = 1
@@ -131,7 +131,10 @@ function _regeneratorRuntime() {
131
131
  if ("executing" === state) throw new Error("Generator is already running");
132
132
  if ("completed" === state) {
133
133
  if ("throw" === method) throw arg;
134
- return doneResult();
134
+ return {
135
+ value: void 0,
136
+ done: !0
137
+ };
135
138
  }
136
139
  for (context.method = method, context.arg = arg;;) {
137
140
  var delegate = context.delegate;
@@ -184,7 +187,7 @@ function _regeneratorRuntime() {
184
187
  }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
185
188
  }
186
189
  function values(iterable) {
187
- if (iterable) {
190
+ if (iterable || "" === iterable) {
188
191
  var iteratorMethod = iterable[iteratorSymbol];
189
192
  if (iteratorMethod) return iteratorMethod.call(iterable);
190
193
  if ("function" == typeof iterable.next) return iterable;
@@ -197,15 +200,7 @@ function _regeneratorRuntime() {
197
200
  return next.next = next;
198
201
  }
199
202
  }
200
- return {
201
- next: doneResult
202
- };
203
- }
204
- function doneResult() {
205
- return {
206
- value: undefined,
207
- done: !0
208
- };
203
+ throw new TypeError(typeof iterable + " is not iterable");
209
204
  }
210
205
  return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
211
206
  value: GeneratorFunctionPrototype,
@@ -9,7 +9,7 @@ export interface State {
9
9
  materialSurvey?: GetOrgMaterialSurveyGetResponses['materialSurvey'];
10
10
  userId?: number;
11
11
  }
12
- export declare type MaterialSurveyProps = {
12
+ export type MaterialSurveyProps = {
13
13
  materialSurveyId: number;
14
14
  userId?: number;
15
15
  locale?: string;
@@ -25,7 +25,7 @@ interface DispatchContextType {
25
25
  setVertical: React.Dispatch<React.SetStateAction<boolean>>;
26
26
  onNext?: () => void;
27
27
  }
28
- declare function MaterialSurveyProvider({ materialSurveyId, userId, onSubmit, onNext, children, }: MaterialSurveyProviderProps): JSX.Element;
28
+ declare function MaterialSurveyProvider({ materialSurveyId, userId, onSubmit, onNext, children, }: MaterialSurveyProviderProps): React.JSX.Element;
29
29
  declare function useMaterialSurveyState(): State;
30
30
  declare function useMaterialSurveyDispatch(): DispatchContextType;
31
31
  export { MaterialSurveyProvider, useMaterialSurveyState, useMaterialSurveyDispatch, };
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import type { MarkdownEditorFileUploadReqFn } from '@elice/markdown';
3
3
  import type { GetOrgMaterialSurveyGetResponses } from '@elice/types';
4
4
  import type { FormState } from 'react-hook-form';
5
- export declare type MaterialSurveyEditValue = Pick<GetOrgMaterialSurveyGetResponses['materialSurvey'], 'id' | 'questionInfoList'>;
6
- export declare type MaterialSurveyEditFormState = Pick<FormState<Record<string, any>>, 'isDirty' | 'isValid'>;
5
+ export type MaterialSurveyEditValue = Pick<GetOrgMaterialSurveyGetResponses['materialSurvey'], 'id' | 'questionInfoList'>;
6
+ export type MaterialSurveyEditFormState = Pick<FormState<Record<string, any>>, 'isDirty' | 'isValid'>;
7
7
  export interface MaterialSurveyEditProps {
8
8
  /** Value of material survey edit form. */
9
9
  value: MaterialSurveyEditValue;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { MaterialSurveyEditProps } from './MaterialSurveyEdit';
3
- declare type MaterialSurveyEditContextValue = Pick<MaterialSurveyEditProps, 'disabled' | 'onFileUploadRequest'>;
3
+ type MaterialSurveyEditContextValue = Pick<MaterialSurveyEditProps, 'disabled' | 'onFileUploadRequest'>;
4
4
  declare const MaterialSurveyEditContext: React.Context<MaterialSurveyEditContextValue>;
5
5
  export declare const useMaterialSurveyEditContext: () => MaterialSurveyEditContextValue;
6
6
  export default MaterialSurveyEditContext;
@@ -1,11 +1,11 @@
1
1
  import type { MaterialSurveyEditValue } from '../MaterialSurveyEdit';
2
- declare type _SurveyEditQuestionInfo = Omit<MaterialSurveyEditValue['questionInfoList'][number], 'optionInfo'> & {
2
+ type _SurveyEditQuestionInfo = Omit<MaterialSurveyEditValue['questionInfoList'][number], 'optionInfo'> & {
3
3
  optionInfo: {
4
4
  id: string;
5
5
  value: string;
6
6
  }[];
7
7
  };
8
- export declare type _SurveyEditValue = Omit<MaterialSurveyEditValue, 'questionInfoList'> & {
8
+ export type _SurveyEditValue = Omit<MaterialSurveyEditValue, 'questionInfoList'> & {
9
9
  questionInfoList: _SurveyEditQuestionInfo[];
10
10
  };
11
11
  /**
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { QuestionCheckboxProps } from './QuestionCheckbox';
3
- declare type Value = Pick<QuestionCheckboxProps, 'selectedOptions' | 'disabled' | 'onSelect'>;
3
+ type Value = Pick<QuestionCheckboxProps, 'selectedOptions' | 'disabled' | 'onSelect'>;
4
4
  interface QuestionCheckboxProviderProps extends QuestionCheckboxProps {
5
5
  children: React.ReactNode;
6
6
  }
7
- declare function QuestionCheckboxContextProvider({ selectedOptions, onSelect, disabled, children, }: QuestionCheckboxProviderProps): JSX.Element;
7
+ declare function QuestionCheckboxContextProvider({ selectedOptions, onSelect, disabled, children, }: QuestionCheckboxProviderProps): React.JSX.Element;
8
8
  declare function useQuestionCheckboxContext(): Value;
9
9
  export { QuestionCheckboxContextProvider, useQuestionCheckboxContext };
@@ -7,6 +7,7 @@ function QuestionCheckboxContextProvider(_ref) {
7
7
  onSelect = _ref.onSelect,
8
8
  disabled = _ref.disabled,
9
9
  children = _ref.children;
10
+ // eslint-disable-next-line react-hooks/exhaustive-deps
10
11
  var onSelectValue = React.useCallback(onSelect, []);
11
12
  var value = React.useMemo(function () {
12
13
  return {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type Status = 'correct' | 'wrong' | 'answer';
2
+ type Status = 'correct' | 'wrong' | 'answer';
3
3
  interface QuestionCheckboxOptionProps {
4
4
  value: any;
5
5
  status?: Status;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { QuestionRadioProps } from './QuestionRadio';
3
- declare type Value = Pick<QuestionRadioProps, 'selectedValue' | 'disabled' | 'onSelect'>;
3
+ type Value = Pick<QuestionRadioProps, 'selectedValue' | 'disabled' | 'onSelect'>;
4
4
  interface QuestionRadioProviderProps extends QuestionRadioProps {
5
5
  children: React.ReactNode;
6
6
  }
7
- declare function QuestionRadioContextProvider({ selectedValue, onSelect, disabled, children, }: QuestionRadioProviderProps): JSX.Element;
7
+ declare function QuestionRadioContextProvider({ selectedValue, onSelect, disabled, children, }: QuestionRadioProviderProps): React.JSX.Element;
8
8
  declare function useQuestionRadioContext(): Value;
9
9
  export { QuestionRadioContextProvider, useQuestionRadioContext };
@@ -7,6 +7,7 @@ function QuestionRadioContextProvider(_ref) {
7
7
  onSelect = _ref.onSelect,
8
8
  disabled = _ref.disabled,
9
9
  children = _ref.children;
10
+ // eslint-disable-next-line react-hooks/exhaustive-deps
10
11
  var onSelectValue = React.useCallback(onSelect, []);
11
12
  var value = React.useMemo(function () {
12
13
  return {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type Status = 'correct' | 'wrong' | 'answer';
2
+ type Status = 'correct' | 'wrong' | 'answer';
3
3
  interface QuestionRadioOptionProps {
4
4
  value: any;
5
5
  status?: Status;
@@ -11,8 +11,8 @@ interface AnswerInfo {
11
11
  order: number | null;
12
12
  isSelected: boolean;
13
13
  }
14
- export declare type Option = OptionInfo & Omit<AnswerInfo, 'optionIdent'>;
15
- export declare type OptionList = Option[];
14
+ export type Option = OptionInfo & Omit<AnswerInfo, 'optionIdent'>;
15
+ export type OptionList = Option[];
16
16
  export declare enum SurveyResultStatus {
17
17
  Submitted = 0,
18
18
  NotSubmitted = 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-survey",
3
- "version": "1.230726.0",
3
+ "version": "1.230817.0",
4
4
  "description": "User view and editing components of Elice material survey",
5
5
  "repository": "https://git.elicer.io/elice/frontend/library/elice-material",
6
6
  "license": "UNLICENSED",
@@ -14,10 +14,6 @@
14
14
  "README.md"
15
15
  ],
16
16
  "sideEffects": false,
17
- "engines": {
18
- "node": "~16.14",
19
- "yarn": ">=1.20 <2"
20
- },
21
17
  "scripts": {
22
18
  "start": "run-s watch",
23
19
  "prebuild": "run-s clean",
@@ -44,20 +40,20 @@
44
40
  },
45
41
  "dependencies": {
46
42
  "classnames": "^2.2.0",
47
- "react-hook-form": "~7.12.0",
43
+ "react-hook-form": "~7.45.4",
48
44
  "react-transition-group": "^4.4.0",
49
- "tslib": "^2.3.1"
45
+ "tslib": "^2.6.1"
50
46
  },
51
47
  "devDependencies": {
52
- "@elice/api-client": "^1.230522.0",
53
- "@elice/blocks": "1.230522.0",
48
+ "@elice/api-client": "^1.230815.0",
49
+ "@elice/blocks": "^1.230816.0",
54
50
  "@elice/design-tokens": "^1.220803.0",
55
- "@elice/icons": "^1.220803.0",
56
- "@elice/icons-legacy": "npm:@elice/icons@0.220803.1",
57
- "@elice/markdown": "^1.220803.0",
58
- "@elice/material-shared-types": "1.230726.0",
59
- "@elice/material-shared-utils": "1.230726.0",
60
- "@elice/types": "^1.230629.0",
51
+ "@elice/icons": "^1.230814.0",
52
+ "@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
53
+ "@elice/markdown": "^1.220815.0",
54
+ "@elice/material-shared-types": "1.230817.0",
55
+ "@elice/material-shared-utils": "1.230817.0",
56
+ "@elice/types": "^1.230815.0",
61
57
  "@types/classnames": "^2.3.1",
62
58
  "@types/react": "~17.0.9",
63
59
  "@types/react-transition-group": "^4.4.4",
@@ -67,5 +63,5 @@
67
63
  "react-use": "^17.2.4",
68
64
  "styled-components": "^5.3.0"
69
65
  },
70
- "gitHead": "7a5377d83939215c5dfc543c867ffd59300710fe"
66
+ "gitHead": "94d876ab4c04c24349c1c00650758751e53d2785"
71
67
  }