@hitachivantara/uikit-react-core 5.39.4 → 5.40.1

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 (58) hide show
  1. package/dist/cjs/AvatarGroup/AvatarGroup.cjs +103 -0
  2. package/dist/cjs/AvatarGroup/AvatarGroup.cjs.map +1 -0
  3. package/dist/cjs/AvatarGroup/AvatarGroup.styles.cjs +24 -0
  4. package/dist/cjs/AvatarGroup/AvatarGroup.styles.cjs.map +1 -0
  5. package/dist/cjs/QueryBuilder/Context.cjs.map +1 -1
  6. package/dist/cjs/QueryBuilder/QueryBuilder.cjs +5 -2
  7. package/dist/cjs/QueryBuilder/QueryBuilder.cjs.map +1 -1
  8. package/dist/cjs/QueryBuilder/QueryBuilder.styles.cjs +4 -2
  9. package/dist/cjs/QueryBuilder/QueryBuilder.styles.cjs.map +1 -1
  10. package/dist/cjs/QueryBuilder/Rule/Operator/Operator.cjs +1 -1
  11. package/dist/cjs/QueryBuilder/Rule/Operator/Operator.cjs.map +1 -1
  12. package/dist/cjs/QueryBuilder/Rule/Rule.cjs +1 -2
  13. package/dist/cjs/QueryBuilder/Rule/Rule.cjs.map +1 -1
  14. package/dist/cjs/QueryBuilder/Rule/Rule.styles.cjs +1 -1
  15. package/dist/cjs/QueryBuilder/Rule/Rule.styles.cjs.map +1 -1
  16. package/dist/cjs/QueryBuilder/Rule/Value/EmptyValue/EmptyValue.cjs +17 -0
  17. package/dist/cjs/QueryBuilder/Rule/Value/EmptyValue/EmptyValue.cjs.map +1 -0
  18. package/dist/cjs/QueryBuilder/Rule/Value/Value.cjs +29 -19
  19. package/dist/cjs/QueryBuilder/Rule/Value/Value.cjs.map +1 -1
  20. package/dist/cjs/QueryBuilder/RuleGroup/RuleGroup.cjs +2 -0
  21. package/dist/cjs/QueryBuilder/RuleGroup/RuleGroup.cjs.map +1 -1
  22. package/dist/cjs/QueryBuilder/types.cjs +5 -0
  23. package/dist/cjs/QueryBuilder/types.cjs.map +1 -0
  24. package/dist/cjs/TimePicker/TimePicker.cjs.map +1 -1
  25. package/dist/cjs/Typography/Typography.cjs +2 -1
  26. package/dist/cjs/Typography/Typography.cjs.map +1 -1
  27. package/dist/cjs/index.cjs +4 -0
  28. package/dist/cjs/index.cjs.map +1 -1
  29. package/dist/esm/AvatarGroup/AvatarGroup.js +104 -0
  30. package/dist/esm/AvatarGroup/AvatarGroup.js.map +1 -0
  31. package/dist/esm/AvatarGroup/AvatarGroup.styles.js +24 -0
  32. package/dist/esm/AvatarGroup/AvatarGroup.styles.js.map +1 -0
  33. package/dist/esm/QueryBuilder/Context.js.map +1 -1
  34. package/dist/esm/QueryBuilder/QueryBuilder.js +5 -2
  35. package/dist/esm/QueryBuilder/QueryBuilder.js.map +1 -1
  36. package/dist/esm/QueryBuilder/QueryBuilder.styles.js +4 -2
  37. package/dist/esm/QueryBuilder/QueryBuilder.styles.js.map +1 -1
  38. package/dist/esm/QueryBuilder/Rule/Operator/Operator.js +1 -1
  39. package/dist/esm/QueryBuilder/Rule/Operator/Operator.js.map +1 -1
  40. package/dist/esm/QueryBuilder/Rule/Rule.js +1 -2
  41. package/dist/esm/QueryBuilder/Rule/Rule.js.map +1 -1
  42. package/dist/esm/QueryBuilder/Rule/Rule.styles.js +1 -1
  43. package/dist/esm/QueryBuilder/Rule/Rule.styles.js.map +1 -1
  44. package/dist/esm/QueryBuilder/Rule/Value/EmptyValue/EmptyValue.js +17 -0
  45. package/dist/esm/QueryBuilder/Rule/Value/EmptyValue/EmptyValue.js.map +1 -0
  46. package/dist/esm/QueryBuilder/Rule/Value/Value.js +29 -19
  47. package/dist/esm/QueryBuilder/Rule/Value/Value.js.map +1 -1
  48. package/dist/esm/QueryBuilder/RuleGroup/RuleGroup.js +2 -0
  49. package/dist/esm/QueryBuilder/RuleGroup/RuleGroup.js.map +1 -1
  50. package/dist/esm/QueryBuilder/types.js +5 -0
  51. package/dist/esm/QueryBuilder/types.js.map +1 -0
  52. package/dist/esm/TimePicker/TimePicker.js.map +1 -1
  53. package/dist/esm/Typography/Typography.js +2 -1
  54. package/dist/esm/Typography/Typography.js.map +1 -1
  55. package/dist/esm/index.js +194 -190
  56. package/dist/esm/index.js.map +1 -1
  57. package/dist/types/index.d.ts +388 -322
  58. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"RuleGroup.cjs","sources":["../../../../src/QueryBuilder/RuleGroup/RuleGroup.tsx"],"sourcesContent":["import { useCallback } from \"react\";\nimport { Add, Delete, Info } from \"@hitachivantara/uikit-react-icons\";\n\nimport { HvButton } from \"../../Button\";\nimport { HvEmptyState } from \"../../EmptyState\";\nimport { HvMultiButton } from \"../../MultiButton\";\nimport { HvTypography } from \"../../Typography\";\nimport { IconButton } from \"../../utils/IconButton\";\nimport { ExtractNames } from \"../../utils/classes\";\n\nimport { Rule } from \"../Rule\";\nimport { useQueryBuilderContext } from \"../Context\";\nimport { useClasses } from \"../QueryBuilder.styles\";\nimport { HvQueryBuilderQuery, HvQueryBuilderQueryCombinator } from \"../types\";\n\nexport interface RuleGroupProps {\n id: React.Key;\n level?: number;\n combinator?: string;\n rules?: HvQueryBuilderQuery[\"rules\"];\n classes?: ExtractNames<typeof useClasses>;\n}\n\nexport const RuleGroup = ({\n level = 0,\n id,\n combinator = \"and\",\n rules = [],\n classes: classesProp,\n}: RuleGroupProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n const {\n dispatchAction,\n askAction,\n maxDepth,\n combinators,\n labels,\n readOnly,\n disableConfirmation,\n } = useQueryBuilderContext();\n\n const normalizedMaxDepth = maxDepth - 1;\n\n const actionButtons = (\n <>\n <div className={classes.buttonBackground}>\n <HvButton\n variant=\"secondarySubtle\"\n onClick={() => {\n dispatchAction({ type: \"add-rule\", id });\n }}\n disabled={readOnly}\n startIcon={<Add />}\n >\n {level === 0 && labels.query?.addRule?.label != null\n ? labels.query?.addRule?.label\n : labels.group.addRule.label}\n </HvButton>\n </div>\n {level <= normalizedMaxDepth && (\n <div className={classes.buttonBackground}>\n <HvButton\n variant=\"secondarySubtle\"\n onClick={() => {\n dispatchAction({ type: \"add-group\", id });\n }}\n disabled={readOnly}\n startIcon={<Add />}\n >\n {level === 0 && labels.query?.addGroup?.label != null\n ? labels.query?.addGroup?.label\n : labels.group.addGroup.label}\n </HvButton>\n </div>\n )}\n </>\n );\n\n const onClickCombinator = useCallback(\n (item: HvQueryBuilderQueryCombinator) => {\n dispatchAction({\n type: \"set-combinator\",\n id,\n combinator: item.operand,\n });\n },\n [dispatchAction, id]\n );\n\n return (\n <div\n className={cx(classes.root, {\n [classes.topGroup]: level === 0,\n [classes.subGroup]: level > 0,\n })}\n >\n <HvMultiButton\n className={cx(classes.combinator, classes.topCombinator)}\n disabled={readOnly}\n >\n {combinators?.map((item) => (\n <HvButton\n key={item.operand}\n className={classes.combinatorButton}\n selected={item.operand === combinator}\n onClick={() => item.operand && onClickCombinator(item)}\n disabled={readOnly}\n size=\"xs\"\n >\n {item.label}\n </HvButton>\n ))}\n </HvMultiButton>\n <div className={cx(classes.buttonBackground, classes.topRemoveButton)}>\n <IconButton\n className={classes.removeButton}\n onClick={() =>\n disableConfirmation\n ? dispatchAction({ type: \"remove-node\", id })\n : askAction({\n actions: [{ type: \"remove-node\", id }],\n dialog:\n level === 0 && labels.query?.delete != null\n ? labels.query.delete\n : labels.group.delete,\n })\n }\n title={\n (level === 0 && labels.query?.delete?.tooltip) ||\n labels.group.delete.tooltip ||\n (level === 0 && labels.query?.delete?.ariaLabel) ||\n labels.group.delete.ariaLabel\n }\n disabled={readOnly}\n >\n <Delete\n role=\"none\"\n className={cx({ [classes.topRemoveButtonDisabled]: readOnly })}\n />\n </IconButton>\n </div>\n {rules?.length > 0 && (\n <div\n className={cx(classes.rulesContainer, {\n [classes.subRulesContainer]: level > 0,\n [classes.topRulesContainer]: level === 0,\n })}\n >\n {rules.map((rule, index) => {\n if (\"combinator\" in rule) {\n return (\n <RuleGroup\n key={rule.id}\n level={level + 1}\n {...rule}\n id={rule.id}\n classes={classes}\n />\n );\n }\n\n const isInvalid =\n combinator === \"and\" &&\n rules.some((r, i) => {\n if (\"attribute\" in r) {\n if (\n r.attribute === rule.attribute &&\n r.id !== rule.id &&\n i < index\n ) {\n return true;\n }\n }\n return false;\n });\n\n return (\n <Rule\n key={rule.id}\n {...rule}\n isInvalid={isInvalid}\n id={rule.id}\n combinator={combinator}\n />\n );\n })}\n </div>\n )}\n {rules?.length === 0 && (\n <HvEmptyState\n title={labels.empty?.title}\n message={\n <>\n <HvTypography\n link\n component=\"button\"\n onClick={() => {\n dispatchAction({ type: \"add-rule\", id });\n }}\n className={classes.createConditionButton}\n >\n {`${labels.empty?.createCondition}`}\n </HvTypography>\n {level <= normalizedMaxDepth && (\n <>\n {`${labels.empty?.spacer}`}\n <HvTypography\n link\n component=\"button\"\n onClick={() => {\n dispatchAction({ type: \"add-group\", id });\n }}\n className={classes.createGroupButton}\n >\n {`${labels.empty?.createGroup}`}\n </HvTypography>\n </>\n )}\n </>\n }\n icon={<Info />}\n />\n )}\n <div\n className={cx(\n classes.actionButtonContainer,\n classes.topActionButtonContainer\n )}\n >\n {actionButtons}\n </div>\n </div>\n );\n};\n"],"names":["useClasses","useQueryBuilderContext","jsxs","Fragment","jsx","HvButton","Add","useCallback","HvMultiButton","IconButton","Delete","Rule","HvEmptyState","HvTypography","Info"],"mappings":";;;;;;;;;;;;;AAuBO,MAAM,YAAY,CAAC;AAAA,EACxB,QAAQ;AAAA,EACR;AAAA,EACA,aAAa;AAAA,EACb,QAAQ,CAAC;AAAA,EACT,SAAS;AACX,MAAsB;AACpB,QAAM,EAAE,SAAS,GAAG,IAAIA,+BAAW,WAAW;AAExC,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACEC,QAAuB,uBAAA;AAE3B,QAAM,qBAAqB,WAAW;AAEtC,QAAM,gBAEFC,2BAAAA,KAAAC,WAAA,UAAA,EAAA,UAAA;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AAA,cACC,SAAS,sBAELX,2BAAAA,KAAAC,WAAA,UAAA,EAAA,UAAA;AAAA,gBAAG,GAAA,OAAO,OAAO,MAAM;AAAA,gBACxBC,2BAAA;AAAA,kBAACS,WAAA;AAAA,kBAAA;AAAA,oBACC,MAAI;AAAA,oBACJ,WAAU;AAAA,oBACV,SAAS,MAAM;AACb,qCAAe,EAAE,MAAM,aAAa,GAAI,CAAA;AAAA,oBAC1C;AAAA,oBACA,WAAW,QAAQ;AAAA,oBAElB,UAAA,GAAG,OAAO,OAAO,WAAW;AAAA,kBAAA;AAAA,gBAC/B;AAAA,cAAA,GACF;AAAA,YAAA,GAEJ;AAAA,YAEF,qCAAOC,gBAAK,MAAA,EAAA;AAAA,UAAA;AAAA,QACd;AAAA,QAEFV,2BAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW;AAAA,cACT,QAAQ;AAAA,cACR,QAAQ;AAAA,YACV;AAAA,YAEC,UAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;;"}
1
+ {"version":3,"file":"RuleGroup.cjs","sources":["../../../../src/QueryBuilder/RuleGroup/RuleGroup.tsx"],"sourcesContent":["import { useCallback } from \"react\";\nimport { Add, Delete, Info } from \"@hitachivantara/uikit-react-icons\";\n\nimport { HvButton } from \"../../Button\";\nimport { HvEmptyState } from \"../../EmptyState\";\nimport { HvMultiButton } from \"../../MultiButton\";\nimport { HvTypography } from \"../../Typography\";\nimport { IconButton } from \"../../utils/IconButton\";\nimport { ExtractNames } from \"../../utils/classes\";\nimport { Rule } from \"../Rule\";\nimport { useQueryBuilderContext } from \"../Context\";\nimport { useClasses } from \"../QueryBuilder.styles\";\nimport { HvQueryBuilderQuery, HvQueryBuilderQueryCombinator } from \"../types\";\n\nexport interface RuleGroupProps {\n id: React.Key;\n level?: number;\n combinator?: string;\n rules?: HvQueryBuilderQuery[\"rules\"];\n classes?: ExtractNames<typeof useClasses>;\n}\n\nexport const RuleGroup = ({\n level = 0,\n id,\n combinator = \"and\",\n rules = [],\n classes: classesProp,\n}: RuleGroupProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n const {\n dispatchAction,\n askAction,\n maxDepth,\n combinators,\n labels,\n readOnly,\n disableConfirmation,\n } = useQueryBuilderContext();\n\n const normalizedMaxDepth = maxDepth - 1;\n\n const actionButtons = (\n <>\n <div className={classes.buttonBackground}>\n <HvButton\n variant=\"secondarySubtle\"\n onClick={() => {\n dispatchAction({ type: \"add-rule\", id });\n }}\n disabled={readOnly}\n startIcon={<Add />}\n >\n {level === 0 && labels.query?.addRule?.label != null\n ? labels.query?.addRule?.label\n : labels.group.addRule.label}\n </HvButton>\n </div>\n {level <= normalizedMaxDepth && (\n <div className={classes.buttonBackground}>\n <HvButton\n variant=\"secondarySubtle\"\n onClick={() => {\n dispatchAction({ type: \"add-group\", id });\n }}\n disabled={readOnly}\n startIcon={<Add />}\n >\n {level === 0 && labels.query?.addGroup?.label != null\n ? labels.query?.addGroup?.label\n : labels.group.addGroup.label}\n </HvButton>\n </div>\n )}\n </>\n );\n\n const onClickCombinator = useCallback(\n (item: HvQueryBuilderQueryCombinator) => {\n dispatchAction({\n type: \"set-combinator\",\n id,\n combinator: item.operand,\n });\n },\n [dispatchAction, id]\n );\n\n return (\n <div\n className={cx(classes.root, {\n [classes.topGroup]: level === 0,\n [classes.subGroup]: level > 0,\n })}\n >\n <HvMultiButton\n className={cx(classes.combinator, classes.topCombinator)}\n disabled={readOnly}\n >\n {combinators?.map((item) => (\n <HvButton\n key={item.operand}\n className={classes.combinatorButton}\n selected={item.operand === combinator}\n onClick={() => item.operand && onClickCombinator(item)}\n disabled={readOnly}\n size=\"xs\"\n >\n {item.label}\n </HvButton>\n ))}\n </HvMultiButton>\n <div className={cx(classes.buttonBackground, classes.topRemoveButton)}>\n <IconButton\n className={classes.removeButton}\n onClick={() =>\n disableConfirmation\n ? dispatchAction({ type: \"remove-node\", id })\n : askAction({\n actions: [{ type: \"remove-node\", id }],\n dialog:\n level === 0 && labels.query?.delete != null\n ? labels.query.delete\n : labels.group.delete,\n })\n }\n title={\n (level === 0 && labels.query?.delete?.tooltip) ||\n labels.group.delete.tooltip ||\n (level === 0 && labels.query?.delete?.ariaLabel) ||\n labels.group.delete.ariaLabel\n }\n disabled={readOnly}\n >\n <Delete\n role=\"none\"\n className={cx({ [classes.topRemoveButtonDisabled]: readOnly })}\n />\n </IconButton>\n </div>\n {rules?.length > 0 && (\n <div\n className={cx(classes.rulesContainer, {\n [classes.subRulesContainer]: level > 0,\n [classes.topRulesContainer]: level === 0,\n })}\n >\n {rules.map((rule, index) => {\n if (\"combinator\" in rule) {\n return (\n <RuleGroup\n key={rule.id}\n level={level + 1}\n {...rule}\n id={rule.id}\n classes={classes}\n />\n );\n }\n\n const isInvalid =\n combinator === \"and\" &&\n rules.some((r, i) => {\n if (\"attribute\" in r) {\n if (\n r.attribute === rule.attribute &&\n r.id !== rule.id &&\n i < index\n ) {\n return true;\n }\n }\n return false;\n });\n\n return (\n <Rule\n key={rule.id}\n {...rule}\n isInvalid={isInvalid}\n id={rule.id}\n combinator={combinator}\n />\n );\n })}\n </div>\n )}\n {rules?.length === 0 && (\n <HvEmptyState\n title={labels.empty?.title}\n message={\n <>\n <HvTypography\n link\n component=\"button\"\n onClick={() => {\n dispatchAction({ type: \"add-rule\", id });\n }}\n className={classes.createConditionButton}\n disabled={readOnly}\n >\n {`${labels.empty?.createCondition}`}\n </HvTypography>\n {level <= normalizedMaxDepth && (\n <>\n {`${labels.empty?.spacer}`}\n <HvTypography\n link\n component=\"button\"\n onClick={() => {\n dispatchAction({ type: \"add-group\", id });\n }}\n className={classes.createGroupButton}\n disabled={readOnly}\n >\n {`${labels.empty?.createGroup}`}\n </HvTypography>\n </>\n )}\n </>\n }\n icon={<Info />}\n />\n )}\n <div\n className={cx(\n classes.actionButtonContainer,\n classes.topActionButtonContainer\n )}\n >\n {actionButtons}\n </div>\n </div>\n );\n};\n"],"names":["useClasses","useQueryBuilderContext","jsxs","Fragment","jsx","HvButton","Add","useCallback","HvMultiButton","IconButton","Delete","Rule","HvEmptyState","HvTypography","Info"],"mappings":";;;;;;;;;;;;;AAsBO,MAAM,YAAY,CAAC;AAAA,EACxB,QAAQ;AAAA,EACR;AAAA,EACA,aAAa;AAAA,EACb,QAAQ,CAAC;AAAA,EACT,SAAS;AACX,MAAsB;AACpB,QAAM,EAAE,SAAS,GAAG,IAAIA,+BAAW,WAAW;AAExC,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACEC,QAAuB,uBAAA;AAE3B,QAAM,qBAAqB,WAAW;AAEtC,QAAM,gBAEFC,2BAAAA,KAAAC,WAAA,UAAA,EAAA,UAAA;AAAA,IAACC,2BAAA,IAAA,OAAA,EAAI,WAAW,QAAQ,kBACtB,UAAAA,2BAAA;AAAA,MAACC,OAAA;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,yBAAe,EAAE,MAAM,YAAY,GAAI,CAAA;AAAA,QACzC;AAAA,QACA,UAAU;AAAA,QACV,0CAAYC,gBAAI,KAAA,EAAA;AAAA,QAEf,UAAU,UAAA,KAAK,OAAO,OAAO,SAAS,SAAS,OAC5C,OAAO,OAAO,SAAS,QACvB,OAAO,MAAM,QAAQ;AAAA,MAAA;AAAA,IAAA,GAE7B;AAAA,IACC,SAAS,sBACRF,2BAAAA,IAAC,OAAI,EAAA,WAAW,QAAQ,kBACtB,UAAAA,2BAAA;AAAA,MAACC,OAAA;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,yBAAe,EAAE,MAAM,aAAa,GAAI,CAAA;AAAA,QAC1C;AAAA,QACA,UAAU;AAAA,QACV,0CAAYC,gBAAI,KAAA,EAAA;AAAA,QAEf,UAAU,UAAA,KAAK,OAAO,OAAO,UAAU,SAAS,OAC7C,OAAO,OAAO,UAAU,QACxB,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Property(exports, Symbol.toStringTag, { value: "Module" });
3
+ const defaultRendererKey = "DEFAULT";
4
+ exports.defaultRendererKey = defaultRendererKey;
5
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.cjs","sources":["../../../src/QueryBuilder/types.ts"],"sourcesContent":["export const defaultRendererKey = \"DEFAULT\";\n\nconst defaultAttributes = [\n \"boolean\",\n \"numeric\",\n \"dateandtime\",\n \"text\",\n \"textarea\",\n] as const;\ntype DefaultAttributes = (typeof defaultAttributes)[number];\n\nexport interface HvQueryBuilderAttribute extends Record<string, unknown> {\n id?: string;\n label: string;\n type: DefaultAttributes | (string & {});\n}\n\nexport interface HvQueryBuilderNumericRange {\n from: number | string;\n to: number | string;\n}\n\nexport interface HvQueryBuilderDateTimeStrings {\n date?: string;\n time?: string;\n}\n\nexport interface HvQueryBuilderDateTimeRange {\n start?: HvQueryBuilderDateTimeStrings;\n end?: HvQueryBuilderDateTimeStrings;\n}\n\nexport type HvQueryBuilderQueryRuleValue =\n | string\n | number\n | boolean\n | HvQueryBuilderNumericRange\n | HvQueryBuilderDateTimeStrings\n | HvQueryBuilderDateTimeRange;\n\nexport interface HvQueryBuilderQueryRule {\n id: React.Key;\n attribute?: string;\n operator?: string;\n value?: HvQueryBuilderQueryRuleValue;\n}\n\nexport interface HvQueryBuilderQueryGroup {\n id: React.Key;\n combinator: string;\n rules: Array<HvQueryBuilderQueryRule | HvQueryBuilderQueryGroup>;\n}\n\nexport type HvQueryBuilderQuery = HvQueryBuilderQueryGroup;\n\nexport interface HvQueryBuilderChangedQuery\n extends Omit<HvQueryBuilderQuery, \"id\" | \"rules\"> {\n rules: Array<\n Omit<HvQueryBuilderQueryRule, \"id\"> | HvQueryBuilderChangedQuery\n >;\n}\n\nexport interface HvQueryBuilderQueryCombinator {\n operand: string;\n label: string;\n}\n\nexport interface HvQueryBuilderQueryOperator {\n operator: string;\n label: string;\n combinators: string[];\n}\n\ninterface DialogLabels {\n dialogTitle: string;\n dialogMessage: string;\n dialogConfirm: string;\n dialogCancel: string;\n dialogCloseTooltip: string;\n}\n\n/** @private label structure action icon buttons */\ninterface ActionIconLabels extends DialogLabels {\n // TODO: remove in v6 - duplicated labels - `tooltip` *is* the aria-label\n /** @deprecated use `tooltip` label instead */\n ariaLabel: string;\n tooltip?: string;\n}\n\nexport type QueryAction =\n | {\n type: \"reset-query\";\n }\n | {\n type: \"reset-group\";\n id: React.Key;\n }\n | {\n type: \"add-rule\" | \"add-group\" | \"remove-node\";\n id: React.Key;\n }\n | {\n type: \"set-combinator\";\n id: React.Key;\n combinator: string;\n }\n | {\n type: \"set-attribute\";\n id: React.Key;\n attribute?: string | null;\n operator?: string | null;\n value?: HvQueryBuilderQueryRuleValue | null;\n }\n | {\n type: \"set-operator\";\n id: React.Key;\n operator: string | null;\n value?: HvQueryBuilderQueryRuleValue | null;\n }\n | {\n type: \"set-value\";\n id: React.Key;\n value: HvQueryBuilderQueryRuleValue | null | any;\n };\n\nexport interface AskAction {\n actions: QueryAction[];\n dialog: DialogLabels;\n}\n\nexport interface HvQueryBuilderLabels {\n query?: {\n delete?: ActionIconLabels;\n addRule?: {\n label: string;\n };\n addGroup?: {\n label: string;\n };\n };\n rule: {\n attribute: {\n exists: string;\n label: string;\n placeholder: string;\n };\n operator: {\n label: string;\n placeholder: string;\n };\n value: {\n distance: {\n label: string;\n placeholder?: string;\n connectorText: string;\n button: string;\n validation: {\n required: string;\n invalid: string;\n };\n };\n text: {\n label: string;\n placeholder: string;\n validation: {\n required: string;\n };\n };\n boolean: {\n label: string;\n placeholder: string;\n options: Record<string, string>;\n };\n numeric: {\n label: string;\n placeholder: string;\n validation: {\n required: string;\n invalid: string;\n equal: string;\n greaterThan: string;\n };\n range: {\n leftLabel: string;\n rightLabel: string;\n };\n };\n datetime: {\n dateLabel: string;\n datePlaceholder: string;\n timeLabel: string;\n timePlaceholder: string;\n startDateLabel: string;\n startDatePlaceholder: string;\n startTimeLabel: string;\n startTimePlaceholder: string;\n endDateLabel: string;\n endDatePlaceholder: string;\n endTimeLabel: string;\n endTimePlaceholder: string;\n validation: {\n required: string;\n invalidInterval: string;\n };\n };\n };\n delete: ActionIconLabels;\n };\n group: {\n delete: ActionIconLabels;\n reset: ActionIconLabels;\n addRule: {\n label: string;\n };\n addGroup: {\n label: string;\n };\n };\n empty: {\n title: string;\n createCondition: string;\n createGroup: string;\n spacer: string;\n };\n}\n\nexport interface HvQueryBuilderRendererProps<V = any> {\n id: React.Key;\n attribute: string;\n operator?: string;\n value?: V;\n}\n\nexport type ValueRenderer =\n | React.FC<HvQueryBuilderRendererProps>\n | Record<string, React.FC<HvQueryBuilderRendererProps>>;\n\nexport type HvQueryBuilderRenderers = Record<string, ValueRenderer>;\n"],"names":[],"mappings":";;AAAO,MAAM,qBAAqB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.cjs","sources":["../../../src/TimePicker/TimePicker.tsx"],"sourcesContent":["import { useState, useRef, useMemo, forwardRef } from \"react\";\n\nimport { Time } from \"@internationalized/date\";\n\nimport { useForkRef } from \"@mui/material/utils\";\n\nimport { useTimeField } from \"@react-aria/datepicker\";\nimport {\n TimeFieldStateOptions,\n useTimeFieldState,\n} from \"@react-stately/datepicker\";\n\nimport { Time as TimeIcon } from \"@hitachivantara/uikit-react-icons\";\n\nimport {\n HvFormElement,\n HvLabel,\n HvWarningText,\n HvInfoMessage,\n HvFormElementProps,\n} from \"../Forms\";\nimport { HvBaseDropdown, HvBaseDropdownProps } from \"../BaseDropdown\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { setId } from \"../utils/setId\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\n\nimport { Unit } from \"./Unit\";\nimport { Placeholder } from \"./Placeholder\";\nimport { staticClasses, useClasses } from \"./TimePicker.styles\";\n\nconst toTime = (value?: HvTimePickerValue) => {\n if (!value) return undefined;\n const { hours, minutes, seconds } = value;\n return new Time(hours, minutes, seconds);\n};\n\nconst getFormat = (timeFormat?: TimeFormat) => {\n if (timeFormat == null) return 24;\n return timeFormat === \"12\" ? 12 : 24;\n};\n\nexport { staticClasses as timePickerClasses };\n\nexport type TimeFormat = \"12\" | \"24\";\n\nexport type HvTimePickerClasses = ExtractNames<typeof useClasses>;\n\nexport type HvTimePickerClassKey =\n | \"root\"\n | \"input\"\n | \"label\"\n | \"placeholder\"\n | \"timePopperContainer\"\n | \"separator\"\n | \"periodContainer\"\n | \"formElementRoot\"\n | \"dropdownPlaceholder\"\n | \"iconBaseRoot\"\n | \"error\"\n | \"labelContainer\"\n | \"description\"\n | \"dropdownHeaderInvalid\"\n | \"dropdownPlaceholderDisabled\"\n | \"dropdownHeaderOpen\";\n\nexport type HvTimePickerValue = {\n hours: number;\n minutes: number;\n seconds: number;\n};\n\nexport interface HvTimePickerProps\n extends Omit<\n HvFormElementProps,\n \"classes\" | \"value\" | \"defaultValue\" | \"onChange\" | \"onFocus\" | \"onBlur\"\n > {\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTimePickerClasses;\n /** Current value of the element when _controlled_. Follows the 24-hour format. */\n value?: HvTimePickerValue;\n /** Initial value of the element when _uncontrolled_. Follows the 24-hour format. */\n defaultValue?: HvTimePickerValue;\n /** The placeholder value when no time is selected. */\n placeholder?: string;\n /** The placeholder of the hours input. */\n hoursPlaceholder?: string;\n /** The placeholder of the minutes input. */\n minutesPlaceholder?: string;\n /** The placeholder of the seconds input. */\n secondsPlaceholder?: string;\n /**\n * Whether the time picker should show the AM/PM 12-hour clock or the 24-hour one.\n * If undefined, the component will use a format according to the passed locale.\n */\n timeFormat?: TimeFormat;\n /** Whether to show the seconds when using the native time picker */\n showSeconds?: boolean;\n /** Locale that will provide the time format(12 or 24 hour format). It is \"overwritten\" by `showAmPm` */\n locale?: string;\n /** Whether the dropdown is expandable. */\n disableExpand?: boolean;\n /**\n * Callback function to be triggered when the input value is changed.\n * It is invoked with a `{hours, minutes, seconds}` object, always in the 24h format\n */\n onChange?: (value: HvTimePickerValue) => void;\n /** Callback called when dropdown changes the expanded state. */\n onToggle?: (event: Event, isOpen: boolean) => void;\n /** Disable the portal behavior. The children stay within it's parent DOM hierarchy. */\n disablePortal?: boolean;\n /** Sets if the calendar container should follow the date picker input out of the screen or stay visible. */\n escapeWithReference?: boolean;\n /** Extra properties to be passed to the TimePicker's dropdown. */\n dropdownProps?: Partial<HvBaseDropdownProps>;\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be provided instead.\n */\n label?: React.ReactNode;\n /**\n * Provide additional descriptive text for the form element.\n */\n description?: React.ReactNode;\n}\n\n/**\n * A Time Picker allows the user to choose a specific time or a time range.\n */\nexport const HvTimePicker = forwardRef<HTMLDivElement, HvTimePickerProps>(\n (props, ref) => {\n const {\n classes: classesProp,\n className,\n\n id: idProp,\n name,\n required = false,\n disabled = false,\n readOnly = false,\n label,\n\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n description,\n \"aria-describedby\": ariaDescribedBy,\n status,\n statusMessage,\n \"aria-errormessage\": ariaErrorMessage,\n\n placeholder,\n hoursPlaceholder = \"hh\",\n minutesPlaceholder = \"mm\",\n secondsPlaceholder = \"ss\",\n\n value: valueProp,\n defaultValue: defaultValueProp,\n\n timeFormat,\n showSeconds,\n disableExpand,\n locale = \"en\",\n\n onToggle,\n onChange,\n\n // misc properties:\n disablePortal = true,\n escapeWithReference = true,\n dropdownProps = {},\n ...others\n } = useDefaultProps(\"HvTimePicker\", props);\n\n const id = useUniqueId(idProp, \"hvtimepicker\");\n\n const { classes, cx } = useClasses(classesProp);\n\n const timeFieldRef = useRef<HTMLDivElement>(null);\n\n const { ref: refProp, ...otherDropdownProps } = dropdownProps;\n const dropdownForkedRef = useForkRef(ref, refProp);\n\n const stateProps: TimeFieldStateOptions = {\n value: toTime(valueProp),\n defaultValue: toTime(defaultValueProp),\n label,\n locale,\n isRequired: required,\n isReadOnly: readOnly,\n isDisabled: disabled,\n granularity: \"second\",\n hourCycle: getFormat(timeFormat),\n onChange: (value) => {\n const { hour: hours, minute: minutes, second: seconds } = value;\n onChange?.({ hours, minutes, seconds });\n },\n };\n const state = useTimeFieldState(stateProps);\n const { labelProps, fieldProps, descriptionProps } = useTimeField(\n {\n ...stateProps,\n id,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n },\n state,\n timeFieldRef\n );\n\n const [open, setOpen] = useState(false);\n\n const [validationMessage] = useControlled(statusMessage, \"Required\");\n const [validationState] = useControlled(status, \"standBy\");\n\n const placeholders = useMemo(\n () => ({\n hour: hoursPlaceholder,\n minute: minutesPlaceholder,\n second: secondsPlaceholder,\n }),\n [hoursPlaceholder, minutesPlaceholder, secondsPlaceholder]\n );\n\n // the error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and required is true\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) ||\n (status === undefined && required));\n\n const isStateInvalid = validationState === \"invalid\";\n const errorMessageId = isStateInvalid\n ? canShowError\n ? setId(id, \"error\")\n : ariaErrorMessage\n : undefined;\n\n return (\n <HvFormElement\n name={name}\n required={required}\n disabled={disabled}\n status={validationState}\n className={cx(classes.root, className)}\n {...others}\n >\n {(label || description) && (\n <div className={classes.labelContainer}>\n {label && (\n <HvLabel\n label={label}\n className={classes.label}\n {...labelProps}\n />\n )}\n {description && (\n <HvInfoMessage\n className={classes.description}\n {...descriptionProps}\n >\n {description}\n </HvInfoMessage>\n )}\n </div>\n )}\n\n <HvBaseDropdown\n ref={dropdownForkedRef}\n role=\"combobox\"\n variableWidth\n disabled={disabled}\n readOnly={readOnly}\n placeholder={\n placeholder && !state.value ? (\n placeholder\n ) : (\n <Placeholder\n ref={timeFieldRef}\n name={name}\n state={state}\n placeholders={placeholders}\n className={cx(classes.placeholder, {\n [classes.placeholderDisabled]: disabled,\n })}\n {...fieldProps}\n />\n )\n }\n classes={{\n header: cx(classes.dropdownHeader, {\n [classes.dropdownHeaderInvalid]: isStateInvalid,\n }),\n panel: classes.dropdownPanel,\n headerOpen: classes.dropdownHeaderOpen,\n }}\n placement=\"right\"\n adornment={\n <TimeIcon\n color={disabled ? \"secondary_60\" : undefined}\n className={classes.icon}\n />\n }\n expanded={open}\n onToggle={(evt, newOpen) => {\n if (disableExpand) return;\n setOpen(newOpen);\n onToggle?.(evt, newOpen);\n }}\n onContainerCreation={(containerRef) => {\n containerRef?.getElementsByTagName(\"input\")[0]?.focus();\n }}\n aria-haspopup=\"dialog\"\n aria-label={ariaLabel}\n aria-labelledby={fieldProps[\"aria-labelledby\"]}\n aria-describedby={fieldProps[\"aria-describedby\"]}\n aria-invalid={isStateInvalid ? true : undefined}\n aria-errormessage={errorMessageId}\n disablePortal={disablePortal}\n popperProps={{\n modifiers: [\n { name: \"preventOverflow\", enabled: escapeWithReference },\n ],\n }}\n {...otherDropdownProps}\n >\n <div ref={timeFieldRef} className={classes.timePopperContainer}>\n {state.segments.map((segment, i) => (\n <Unit\n key={i}\n state={state}\n segment={segment}\n placeholder={placeholders[segment.type]}\n onAdd={() => state.increment(segment.type)}\n onSub={() => state.decrement(segment.type)}\n onChange={(evt, val) => {\n state.setSegment(segment.type, Number(val));\n }}\n />\n ))}\n </div>\n </HvBaseDropdown>\n\n {canShowError && (\n <HvWarningText\n id={setId(id, \"error\")}\n disableBorder\n className={classes.error}\n >\n {validationMessage}\n </HvWarningText>\n )}\n </HvFormElement>\n );\n }\n);\n"],"names":["Time","forwardRef","useDefaultProps","useUniqueId","useClasses","useRef","useForkRef","useTimeFieldState","useTimeField","useState","useControlled","useMemo","setId","jsxs","HvFormElement","jsx","HvLabel","HvInfoMessage","HvBaseDropdown","Placeholder","TimeIcon","Unit","HvWarningText"],"mappings":";;;;;;;;;;;;;;;;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C,GAAG,MAAM;AAAA,cACxD;AAAA,cACA,iBAAc;AAAA,cACd,cAAY;AAAA,cACZ,mBAAiB,WAAW,iBAAiB;AAAA,cAC7C,oBAAkB,WAAW,kBAAkB;AAAA,cAC/C,gBAAc,iBAAiB,OAAO;AAAA,cACtC,qBAAmB;AAAA,cACnB;AAAA,cACA,aAAa;AAAA,gBACX,WAAW;AAAA,kBACT,EAAE,MAAM,mBAAmB,SAAS,oBAAoB;AAAA,gBAC1D;AAAA,cACF;AAAA,cACC,GAAG;AAAA,cAEJ,UAACL,2BAAA,IAAA,OAAA,EAAI,KAAK,cAAc,WAAW,QAAQ,qBACxC,UAAA,MAAM,SAAS,IAAI,CAAC,SAAS,MAC5BA,2BAAA;AAAA,gBAACM,KAAA;AAAA,gBAAA;AAAA,kBAEC;AAAA,kBACA;AAAA,kBACA,aAAa,aAAa,QAAQ,IAAI;AAAA,kBACtC,OAAO,MAAM,MAAM,UAAU,QAAQ,IAAI;AAAA,kBACzC,OAAO,MAAM,MAAM,UAAU,QAAQ,IAAI;AAAA,kBACzC,UAAU,CAAC,KAAK,QAAQ;AACtB,0BAAM,WAAW,QAAQ,MAAM,OAAO,GAAG,CAAC;AAAA,kBAC5C;AAAA,gBAAA;AAAA,gBARK;AAAA,cAUR,CAAA,GACH;AAAA,YAAA;AAAA,UACF;AAAA,UAEC,gBACCN,2BAAA;AAAA,YAACO,YAAA;AAAA,YAAA;AAAA,cACC,IAAIV,MAAAA,MAAM,IAAI,OAAO;AAAA,cACrB,eAAa;AAAA,cACb,WAAW,QAAQ;AAAA,cAElB,UAAA;AAAA,YAAA;AAAA,UACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;;;"}
1
+ {"version":3,"file":"TimePicker.cjs","sources":["../../../src/TimePicker/TimePicker.tsx"],"sourcesContent":["import { useState, useRef, useMemo, forwardRef } from \"react\";\n\nimport { Time } from \"@internationalized/date\";\n\nimport { useForkRef } from \"@mui/material/utils\";\n\nimport { useTimeField } from \"@react-aria/datepicker\";\nimport {\n TimeFieldStateOptions,\n useTimeFieldState,\n} from \"@react-stately/datepicker\";\n\nimport { Time as TimeIcon } from \"@hitachivantara/uikit-react-icons\";\n\nimport {\n HvFormElement,\n HvLabel,\n HvWarningText,\n HvInfoMessage,\n HvFormElementProps,\n} from \"../Forms\";\nimport { HvBaseDropdown, HvBaseDropdownProps } from \"../BaseDropdown\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { setId } from \"../utils/setId\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\n\nimport { Unit } from \"./Unit\";\nimport { Placeholder } from \"./Placeholder\";\nimport { staticClasses, useClasses } from \"./TimePicker.styles\";\n\nconst toTime = (value?: HvTimePickerValue) => {\n if (!value) return undefined;\n const { hours, minutes, seconds } = value;\n return new Time(hours, minutes, seconds);\n};\n\nconst getFormat = (timeFormat?: TimeFormat) => {\n if (timeFormat == null) return 24;\n return timeFormat === \"12\" ? 12 : 24;\n};\n\nexport { staticClasses as timePickerClasses };\n\nexport type TimeFormat = \"12\" | \"24\";\n\nexport type HvTimePickerClasses = ExtractNames<typeof useClasses>;\n\nexport type HvTimePickerClassKey =\n | \"root\"\n | \"input\"\n | \"label\"\n | \"placeholder\"\n | \"timePopperContainer\"\n | \"separator\"\n | \"periodContainer\"\n | \"formElementRoot\"\n | \"dropdownPlaceholder\"\n | \"iconBaseRoot\"\n | \"error\"\n | \"labelContainer\"\n | \"description\"\n | \"dropdownHeaderInvalid\"\n | \"dropdownPlaceholderDisabled\"\n | \"dropdownHeaderOpen\";\n\nexport type HvTimePickerValue = {\n hours: number;\n minutes: number;\n seconds: number;\n};\n\nexport interface HvTimePickerProps\n extends Omit<\n HvFormElementProps,\n \"classes\" | \"value\" | \"defaultValue\" | \"onChange\"\n > {\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTimePickerClasses;\n /** Current value of the element when _controlled_. Follows the 24-hour format. */\n value?: HvTimePickerValue;\n /** Initial value of the element when _uncontrolled_. Follows the 24-hour format. */\n defaultValue?: HvTimePickerValue;\n /** The placeholder value when no time is selected. */\n placeholder?: string;\n /** The placeholder of the hours input. */\n hoursPlaceholder?: string;\n /** The placeholder of the minutes input. */\n minutesPlaceholder?: string;\n /** The placeholder of the seconds input. */\n secondsPlaceholder?: string;\n /**\n * Whether the time picker should show the AM/PM 12-hour clock or the 24-hour one.\n * If undefined, the component will use a format according to the passed locale.\n */\n timeFormat?: TimeFormat;\n /** Whether to show the seconds when using the native time picker */\n showSeconds?: boolean;\n /** Locale that will provide the time format(12 or 24 hour format). It is \"overwritten\" by `showAmPm` */\n locale?: string;\n /** Whether the dropdown is expandable. */\n disableExpand?: boolean;\n /**\n * Callback function to be triggered when the input value is changed.\n * It is invoked with a `{hours, minutes, seconds}` object, always in the 24h format\n */\n onChange?: (value: HvTimePickerValue) => void;\n /** Callback called when dropdown changes the expanded state. */\n onToggle?: (event: Event, isOpen: boolean) => void;\n /** Disable the portal behavior. The children stay within it's parent DOM hierarchy. */\n disablePortal?: boolean;\n /** Sets if the calendar container should follow the date picker input out of the screen or stay visible. */\n escapeWithReference?: boolean;\n /** Extra properties to be passed to the TimePicker's dropdown. */\n dropdownProps?: Partial<HvBaseDropdownProps>;\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be provided instead.\n */\n label?: React.ReactNode;\n /**\n * Provide additional descriptive text for the form element.\n */\n description?: React.ReactNode;\n}\n\n/**\n * A Time Picker allows the user to choose a specific time or a time range.\n */\nexport const HvTimePicker = forwardRef<HTMLDivElement, HvTimePickerProps>(\n (props, ref) => {\n const {\n classes: classesProp,\n className,\n\n id: idProp,\n name,\n required = false,\n disabled = false,\n readOnly = false,\n label,\n\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n description,\n \"aria-describedby\": ariaDescribedBy,\n status,\n statusMessage,\n \"aria-errormessage\": ariaErrorMessage,\n\n placeholder,\n hoursPlaceholder = \"hh\",\n minutesPlaceholder = \"mm\",\n secondsPlaceholder = \"ss\",\n\n value: valueProp,\n defaultValue: defaultValueProp,\n\n timeFormat,\n showSeconds,\n disableExpand,\n locale = \"en\",\n\n onToggle,\n onChange,\n\n // misc properties:\n disablePortal = true,\n escapeWithReference = true,\n dropdownProps = {},\n ...others\n } = useDefaultProps(\"HvTimePicker\", props);\n\n const id = useUniqueId(idProp, \"hvtimepicker\");\n\n const { classes, cx } = useClasses(classesProp);\n\n const timeFieldRef = useRef<HTMLDivElement>(null);\n\n const { ref: refProp, ...otherDropdownProps } = dropdownProps;\n const dropdownForkedRef = useForkRef(ref, refProp);\n\n const stateProps: TimeFieldStateOptions = {\n value: toTime(valueProp),\n defaultValue: toTime(defaultValueProp),\n label,\n locale,\n isRequired: required,\n isReadOnly: readOnly,\n isDisabled: disabled,\n granularity: \"second\",\n hourCycle: getFormat(timeFormat),\n onChange: (value) => {\n const { hour: hours, minute: minutes, second: seconds } = value;\n onChange?.({ hours, minutes, seconds });\n },\n };\n const state = useTimeFieldState(stateProps);\n const { labelProps, fieldProps, descriptionProps } = useTimeField(\n {\n ...stateProps,\n id,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n },\n state,\n timeFieldRef\n );\n\n const [open, setOpen] = useState(false);\n\n const [validationMessage] = useControlled(statusMessage, \"Required\");\n const [validationState] = useControlled(status, \"standBy\");\n\n const placeholders = useMemo(\n () => ({\n hour: hoursPlaceholder,\n minute: minutesPlaceholder,\n second: secondsPlaceholder,\n }),\n [hoursPlaceholder, minutesPlaceholder, secondsPlaceholder]\n );\n\n // the error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and required is true\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) ||\n (status === undefined && required));\n\n const isStateInvalid = validationState === \"invalid\";\n const errorMessageId = isStateInvalid\n ? canShowError\n ? setId(id, \"error\")\n : ariaErrorMessage\n : undefined;\n\n return (\n <HvFormElement\n name={name}\n required={required}\n disabled={disabled}\n status={validationState}\n className={cx(classes.root, className)}\n {...others}\n >\n {(label || description) && (\n <div className={classes.labelContainer}>\n {label && (\n <HvLabel\n label={label}\n className={classes.label}\n {...labelProps}\n />\n )}\n {description && (\n <HvInfoMessage\n className={classes.description}\n {...descriptionProps}\n >\n {description}\n </HvInfoMessage>\n )}\n </div>\n )}\n\n <HvBaseDropdown\n ref={dropdownForkedRef}\n role=\"combobox\"\n variableWidth\n disabled={disabled}\n readOnly={readOnly}\n placeholder={\n placeholder && !state.value ? (\n placeholder\n ) : (\n <Placeholder\n ref={timeFieldRef}\n name={name}\n state={state}\n placeholders={placeholders}\n className={cx(classes.placeholder, {\n [classes.placeholderDisabled]: disabled,\n })}\n {...fieldProps}\n />\n )\n }\n classes={{\n header: cx(classes.dropdownHeader, {\n [classes.dropdownHeaderInvalid]: isStateInvalid,\n }),\n panel: classes.dropdownPanel,\n headerOpen: classes.dropdownHeaderOpen,\n }}\n placement=\"right\"\n adornment={\n <TimeIcon\n color={disabled ? \"secondary_60\" : undefined}\n className={classes.icon}\n />\n }\n expanded={open}\n onToggle={(evt, newOpen) => {\n if (disableExpand) return;\n setOpen(newOpen);\n onToggle?.(evt, newOpen);\n }}\n onContainerCreation={(containerRef) => {\n containerRef?.getElementsByTagName(\"input\")[0]?.focus();\n }}\n aria-haspopup=\"dialog\"\n aria-label={ariaLabel}\n aria-labelledby={fieldProps[\"aria-labelledby\"]}\n aria-describedby={fieldProps[\"aria-describedby\"]}\n aria-invalid={isStateInvalid ? true : undefined}\n aria-errormessage={errorMessageId}\n disablePortal={disablePortal}\n popperProps={{\n modifiers: [\n { name: \"preventOverflow\", enabled: escapeWithReference },\n ],\n }}\n {...otherDropdownProps}\n >\n <div ref={timeFieldRef} className={classes.timePopperContainer}>\n {state.segments.map((segment, i) => (\n <Unit\n key={i}\n state={state}\n segment={segment}\n placeholder={placeholders[segment.type]}\n onAdd={() => state.increment(segment.type)}\n onSub={() => state.decrement(segment.type)}\n onChange={(evt, val) => {\n state.setSegment(segment.type, Number(val));\n }}\n />\n ))}\n </div>\n </HvBaseDropdown>\n\n {canShowError && (\n <HvWarningText\n id={setId(id, \"error\")}\n disableBorder\n className={classes.error}\n >\n {validationMessage}\n </HvWarningText>\n )}\n </HvFormElement>\n );\n }\n);\n"],"names":["Time","forwardRef","useDefaultProps","useUniqueId","useClasses","useRef","useForkRef","useTimeFieldState","useTimeField","useState","useControlled","useMemo","setId","jsxs","HvFormElement","jsx","HvLabel","HvInfoMessage","HvBaseDropdown","Placeholder","TimeIcon","Unit","HvWarningText"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgCA,MAAM,SAAS,CAAC,UAA8B;AAC5C,MAAI,CAAC;AAAc,WAAA;AACnB,QAAM,EAAE,OAAO,SAAS,QAAA,IAAY;AACpC,SAAO,IAAIA,KAAAA,KAAK,OAAO,SAAS,OAAO;AACzC;AAEA,MAAM,YAAY,CAAC,eAA4B;AAC7C,MAAI,cAAc;AAAa,WAAA;AACxB,SAAA,eAAe,OAAO,KAAK;AACpC;AA2FO,MAAM,eAAeC,MAAA;AAAA,EAC1B,CAAC,OAAO,QAAQ;AACR,UAAA;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MAEA,IAAI;AAAA,MACJ;AAAA,MACA,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX;AAAA,MAEA,cAAc;AAAA,MACd,mBAAmB;AAAA,MACnB;AAAA,MACA,oBAAoB;AAAA,MACpB;AAAA,MACA;AAAA,MACA,qBAAqB;AAAA,MAErB;AAAA,MACA,mBAAmB;AAAA,MACnB,qBAAqB;AAAA,MACrB,qBAAqB;AAAA,MAErB,OAAO;AAAA,MACP,cAAc;AAAA,MAEd;AAAA,MACA;AAAA,MACA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AAQ,MAAM,OAAO,GAAG,CAAC;AAAA,kBAC5C;AAAA,gBAAA;AAAA,gBARK;AAAA,cAUR,CAAA,GACH;AAAA,YAAA;AAAA,UACF;AAAA,UAEC,gBACCN,2BAAA;AAAA,YAACO,YAAA;AAAA,YAAA;AAAA,cACC,IAAIV,MAAAA,MAAM,IAAI,OAAO;AAAA,cACrB,eAAa;AAAA,cACb,WAAW,QAAQ;AAAA,cAElB,UAAA;AAAA,YAAA;AAAA,UACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;;;"}
@@ -46,9 +46,9 @@ const HvTypography = React.forwardRef(
46
46
  classes: classesProp,
47
47
  variant: variantProp = "body",
48
48
  link = false,
49
- disabled = false,
50
49
  noWrap = false,
51
50
  paragraph = false,
51
+ disabled = false,
52
52
  ...others
53
53
  } = useDefaultProps.useDefaultProps("HvTypography", props);
54
54
  const { classes, cx } = Typography_styles.useClasses(classesProp);
@@ -69,6 +69,7 @@ const HvTypography = React.forwardRef(
69
69
  },
70
70
  className
71
71
  ),
72
+ disabled,
72
73
  ...others
73
74
  }
74
75
  );
@@ -1 +1 @@
1
- {"version":3,"file":"Typography.cjs","sources":["../../../src/Typography/Typography.tsx"],"sourcesContent":["import { ElementType, forwardRef } from \"react\";\n\nimport { PolymorphicComponentRef, PolymorphicRef } from \"../types/generic\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { useTheme } from \"../hooks/useTheme\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\n\nimport {\n HvTypographyLegacyVariants,\n HvTypographyVariants,\n mapVariant,\n} from \"./utils\";\nimport { staticClasses, useClasses } from \"./Typography.styles\";\n\nexport { staticClasses as typographyClasses };\n\nexport type HvTypographyClasses = ExtractNames<typeof useClasses>;\n\nconst HvTypographyMap = {\n display: \"h1\",\n title1: \"h1\",\n title2: \"h2\",\n title3: \"h3\",\n title4: \"h4\",\n body: \"p\",\n label: \"span\",\n caption1: \"p\",\n caption2: \"p\",\n // LEGACY\n \"5xlTitle\": \"h1\",\n \"4xlTitle\": \"h1\",\n \"3xlTitle\": \"h1\",\n xxlTitle: \"h1\",\n xlTitle: \"h1\",\n lTitle: \"h2\",\n mTitle: \"h3\",\n sTitle: \"h4\",\n xsTitle: \"h5\",\n xxsTitle: \"h6\",\n sectionTitle: \"p\",\n highlightText: \"p\",\n normalText: \"p\",\n placeholderText: \"p\",\n link: \"p\",\n disabledText: \"p\",\n selectedNavText: \"p\",\n vizText: \"p\",\n vizTextDisabled: \"p\",\n xsInlineLink: \"p\",\n} satisfies Record<\n HvTypographyVariants | HvTypographyLegacyVariants,\n ElementType\n>;\n\nexport type HvTypographyProps<C extends React.ElementType = \"p\"> =\n PolymorphicComponentRef<\n C,\n {\n /** Use the variant prop to change the visual style of the Typography. */\n variant?: HvTypographyVariants | HvTypographyLegacyVariants;\n /** If `true` the typography will display the look of a link. */\n link?: boolean;\n /** If `true` the typography will display the look of a disabled state. */\n disabled?: boolean;\n /** If `true`, the text will have a bottom margin. */\n paragraph?: boolean;\n /**\n * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.\n *\n * Note that text overflow can only happen with block or inline-block level elements\n * (the element needs to have a width in order to overflow).\n */\n noWrap?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTypographyClasses;\n }\n >;\n\n/**\n * Typography component is used to render text and paragraphs within an interface.\n */\nexport const HvTypography: <C extends React.ElementType = \"p\">(\n props: HvTypographyProps<C>\n) => React.ReactElement | null = forwardRef(\n <C extends React.ElementType = \"p\">(\n props: HvTypographyProps<C>,\n ref: PolymorphicRef<C>\n ) => {\n const {\n className,\n component: ComponentProp,\n classes: classesProp,\n variant: variantProp = \"body\",\n link = false,\n disabled = false,\n noWrap = false,\n paragraph = false,\n ...others\n } = useDefaultProps(\"HvTypography\", props);\n const { classes, cx } = useClasses(classesProp);\n const { activeTheme } = useTheme();\n\n const variant = mapVariant(variantProp, activeTheme?.name);\n\n const Component =\n ComponentProp || (paragraph && \"p\") || HvTypographyMap[variant] || \"span\";\n\n return (\n <Component\n ref={ref}\n className={cx(\n classes.root,\n classes[variant],\n {\n [classes.isLink]: link,\n [classes.noWrap]: noWrap,\n [classes.disabled]: disabled,\n },\n className\n )}\n {...others}\n />\n );\n }\n);\n"],"names":["forwardRef","useDefaultProps","useClasses","useTheme","mapVariant","jsx"],"mappings":";;;;;;;;AAkBA,MAAM,kBAAkB;AAAA,EACtB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA;AAAA,EAEV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,cAAc;AAChB;AAgCO,MAAM,eAEoBA,MAAA;AAAA,EAC/B,CACE,OACA,QACG;AACG,UAAA;AAAA,MACJ;AAAA,MACA,WAAW;AAAA,MACX,SAAS;AAAA,MACT,SAAS,cAAc;AAAA,MACvB,OAAO;AAAA,MACP,WAAW;AAAA,MACX,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,GAAG;AAAA,IAAA,IACDC,gBAAgB,gBAAA,gBAAgB,KAAK;AACzC,UAAM,EAAE,SAAS,GAAG,IAAIC,6BAAW,WAAW;AACxC,UAAA,EAAE,gBAAgBC,SAAAA;AAExB,UAAM,UAAUC,MAAA,WAAW,aAAa,aAAa,IAAI;AAEzD,UAAM,YACJ,iBAAkB,aAAa,OAAQ,gBAAgB,OAAO,KAAK;AAGnE,WAAAC,2BAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ,OAAO;AAAA,UACf;AAAA,YACE,CAAC,QAAQ,MAAM,GAAG;AAAA,YAClB,CAAC,QAAQ,MAAM,GAAG;AAAA,YAClB,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACtB;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;;;"}
1
+ {"version":3,"file":"Typography.cjs","sources":["../../../src/Typography/Typography.tsx"],"sourcesContent":["import { ElementType, forwardRef } from \"react\";\n\nimport { PolymorphicComponentRef, PolymorphicRef } from \"../types/generic\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { useTheme } from \"../hooks/useTheme\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport {\n HvTypographyLegacyVariants,\n HvTypographyVariants,\n mapVariant,\n} from \"./utils\";\nimport { staticClasses, useClasses } from \"./Typography.styles\";\n\nexport { staticClasses as typographyClasses };\n\nexport type HvTypographyClasses = ExtractNames<typeof useClasses>;\n\nconst HvTypographyMap = {\n display: \"h1\",\n title1: \"h1\",\n title2: \"h2\",\n title3: \"h3\",\n title4: \"h4\",\n body: \"p\",\n label: \"span\",\n caption1: \"p\",\n caption2: \"p\",\n // LEGACY\n \"5xlTitle\": \"h1\",\n \"4xlTitle\": \"h1\",\n \"3xlTitle\": \"h1\",\n xxlTitle: \"h1\",\n xlTitle: \"h1\",\n lTitle: \"h2\",\n mTitle: \"h3\",\n sTitle: \"h4\",\n xsTitle: \"h5\",\n xxsTitle: \"h6\",\n sectionTitle: \"p\",\n highlightText: \"p\",\n normalText: \"p\",\n placeholderText: \"p\",\n link: \"p\",\n disabledText: \"p\",\n selectedNavText: \"p\",\n vizText: \"p\",\n vizTextDisabled: \"p\",\n xsInlineLink: \"p\",\n} satisfies Record<\n HvTypographyVariants | HvTypographyLegacyVariants,\n ElementType\n>;\n\nexport type HvTypographyProps<C extends React.ElementType = \"p\"> =\n PolymorphicComponentRef<\n C,\n {\n /** Use the variant prop to change the visual style of the Typography. */\n variant?: HvTypographyVariants | HvTypographyLegacyVariants;\n /** If `true` the typography will display the look of a link. */\n link?: boolean;\n /** If `true` the typography will display the look of a disabled state. */\n disabled?: boolean;\n /** If `true`, the text will have a bottom margin. */\n paragraph?: boolean;\n /**\n * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.\n *\n * Note that text overflow can only happen with block or inline-block level elements\n * (the element needs to have a width in order to overflow).\n */\n noWrap?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTypographyClasses;\n }\n >;\n\n/**\n * Typography component is used to render text and paragraphs within an interface.\n */\nexport const HvTypography: <C extends React.ElementType = \"p\">(\n props: HvTypographyProps<C>\n) => React.ReactElement | null = forwardRef(\n <C extends React.ElementType = \"p\">(\n props: HvTypographyProps<C>,\n ref: PolymorphicRef<C>\n ) => {\n const {\n className,\n component: ComponentProp,\n classes: classesProp,\n variant: variantProp = \"body\",\n link = false,\n noWrap = false,\n paragraph = false,\n disabled = false,\n ...others\n } = useDefaultProps(\"HvTypography\", props);\n const { classes, cx } = useClasses(classesProp);\n const { activeTheme } = useTheme();\n\n const variant = mapVariant(variantProp, activeTheme?.name);\n\n const Component =\n ComponentProp || (paragraph && \"p\") || HvTypographyMap[variant] || \"span\";\n\n return (\n <Component\n ref={ref}\n className={cx(\n classes.root,\n classes[variant],\n {\n [classes.isLink]: link,\n [classes.noWrap]: noWrap,\n [classes.disabled]: disabled,\n },\n className\n )}\n disabled={disabled}\n {...others}\n />\n );\n }\n);\n"],"names":["forwardRef","useDefaultProps","useClasses","useTheme","mapVariant","jsx"],"mappings":";;;;;;;;AAiBA,MAAM,kBAAkB;AAAA,EACtB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,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;AAAA,EAGV;AACF;;;"}
@@ -83,6 +83,8 @@ const Action_styles = require("./AppSwitcher/Action/Action.styles.cjs");
83
83
  const Action = require("./AppSwitcher/Action/Action.cjs");
84
84
  const Avatar_styles = require("./Avatar/Avatar.styles.cjs");
85
85
  const Avatar = require("./Avatar/Avatar.cjs");
86
+ const AvatarGroup_styles = require("./AvatarGroup/AvatarGroup.styles.cjs");
87
+ const AvatarGroup = require("./AvatarGroup/AvatarGroup.cjs");
86
88
  const Badge_styles = require("./Badge/Badge.styles.cjs");
87
89
  const Badge = require("./Badge/Badge.cjs");
88
90
  const Banner_styles = require("./Banner/Banner.styles.cjs");
@@ -421,6 +423,8 @@ exports.appSwitcherActionClasses = Action_styles.staticClasses;
421
423
  exports.HvAppSwitcherAction = Action.HvAppSwitcherAction;
422
424
  exports.avatarClasses = Avatar_styles.staticClasses;
423
425
  exports.HvAvatar = Avatar.HvAvatar;
426
+ exports.avatarGroupClasses = AvatarGroup_styles.staticClasses;
427
+ exports.HvAvatarGroup = AvatarGroup.HvAvatarGroup;
424
428
  exports.badgeClasses = Badge_styles.staticClasses;
425
429
  exports.HvBadge = Badge.HvBadge;
426
430
  exports.bannerClasses = Banner_styles.staticClasses;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,104 @@
1
+ import { jsxs, jsx } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef, Children, cloneElement } from "react";
3
+ import { css } from "@emotion/css";
4
+ import { theme } from "@hitachivantara/uikit-styles";
5
+ import { useDefaultProps } from "../hooks/useDefaultProps.js";
6
+ import { useClasses } from "./AvatarGroup.styles.js";
7
+ import { staticClasses } from "./AvatarGroup.styles.js";
8
+ import { HvAvatar } from "../Avatar/Avatar.js";
9
+ const getSpacingValue = (spacing, size) => {
10
+ switch (size) {
11
+ case "xs":
12
+ return spacing === "compact" ? 24 : 16;
13
+ case "sm":
14
+ return spacing === "compact" ? 30 : 18;
15
+ case "md":
16
+ return spacing === "compact" ? 36 : 20;
17
+ case "lg":
18
+ return spacing === "compact" ? 44 : 24;
19
+ case "xl":
20
+ return spacing === "compact" ? 72 : 34;
21
+ default:
22
+ return spacing === "compact" ? 30 : 18;
23
+ }
24
+ };
25
+ const HvAvatarGroup = forwardRef(
26
+ (props, ref) => {
27
+ const {
28
+ className,
29
+ classes: classesProp,
30
+ children,
31
+ size = "sm",
32
+ spacing = "loose",
33
+ direction = "row",
34
+ toBack = true,
35
+ maxVisible = 3,
36
+ overflowComponent,
37
+ ...others
38
+ } = useDefaultProps("HvAvatarGroup", props);
39
+ const { classes, cx } = useClasses(classesProp);
40
+ const spacingValue = getSpacingValue(spacing, size);
41
+ const totalChildren = Children.count(children);
42
+ const zIndexMultiplier = toBack ? -1 : 1;
43
+ const willOverflow = totalChildren > maxVisible;
44
+ return /* @__PURE__ */ jsxs(
45
+ "div",
46
+ {
47
+ className: cx(classes.root, classes[direction], className),
48
+ ref,
49
+ ...others,
50
+ children: [
51
+ Children.map(children, (child, index) => {
52
+ if (index < maxVisible) {
53
+ return cloneElement(child, {
54
+ style: {
55
+ zIndex: 100 + index * zIndexMultiplier
56
+ },
57
+ classes: {
58
+ container: css({
59
+ marginLeft: direction === "row" ? index !== 0 ? -spacingValue : 0 : 0,
60
+ marginTop: direction === "column" ? index !== 0 ? -spacingValue : 0 : 0
61
+ })
62
+ },
63
+ size
64
+ });
65
+ }
66
+ }),
67
+ willOverflow && /* @__PURE__ */ jsx(
68
+ "div",
69
+ {
70
+ style: {
71
+ marginLeft: direction === "row" ? -spacingValue : 0,
72
+ marginTop: direction === "column" ? -spacingValue : 0,
73
+ zIndex: 100 + maxVisible * zIndexMultiplier
74
+ },
75
+ children: overflowComponent ? overflowComponent(totalChildren - maxVisible) : /* @__PURE__ */ jsxs(
76
+ HvAvatar,
77
+ {
78
+ size,
79
+ backgroundColor: theme.colors.atmo4,
80
+ classes: {
81
+ avatar: css({
82
+ [`&.HvAvatar-${size}`]: {
83
+ fontSize: "unset"
84
+ }
85
+ })
86
+ },
87
+ children: [
88
+ "+",
89
+ totalChildren - maxVisible
90
+ ]
91
+ }
92
+ )
93
+ }
94
+ )
95
+ ]
96
+ }
97
+ );
98
+ }
99
+ );
100
+ export {
101
+ HvAvatarGroup,
102
+ staticClasses as avatarGroupClasses
103
+ };
104
+ //# sourceMappingURL=AvatarGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarGroup.js","sources":["../../../src/AvatarGroup/AvatarGroup.tsx"],"sourcesContent":["import { Children, cloneElement, forwardRef } from \"react\";\n\nimport { css } from \"@emotion/css\";\n\nimport { HvSize, theme } from \"@hitachivantara/uikit-styles\";\n\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\n\nimport { HvBaseProps } from \"../types/generic\";\n\nimport { ExtractNames } from \"../utils/classes\";\n\nimport { staticClasses, useClasses } from \"./AvatarGroup.styles\";\n\nimport { HvAvatar } from \"../Avatar/Avatar\";\n\nexport { staticClasses as avatarGroupClasses };\n\nexport type HvAvatarGroupClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAvatarGroupProps extends HvBaseProps {\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAvatarGroupClasses;\n /** The avatar size. */\n size?: HvSize;\n /** The spacing between avatars. */\n spacing?: \"compact\" | \"loose\";\n /** The direction of the group. */\n direction?: \"row\" | \"column\";\n /** Whether the avatars display behind the previous avatar or on top. */\n toBack?: boolean;\n /**\n * The maximum number of visible avatars. If there are more avatars then the value of this property, an added avatar will\n * be added to the end of the list, indicating the number of hidden avatars.\n */\n maxVisible?: number;\n /**\n * What to show as an overflow representation.\n * If `undefined` a default `HvAvatar` will be displayed along with a HvTooltip with the count of overflowing items.\n * */\n overflowComponent?: (overflowCount: number) => React.ReactNode;\n}\n\nconst getSpacingValue = (\n spacing: HvAvatarGroupProps[\"spacing\"],\n size: HvAvatarGroupProps[\"size\"]\n) => {\n switch (size) {\n case \"xs\":\n return spacing === \"compact\" ? 24 : 16;\n case \"sm\":\n return spacing === \"compact\" ? 30 : 18;\n case \"md\":\n return spacing === \"compact\" ? 36 : 20;\n case \"lg\":\n return spacing === \"compact\" ? 44 : 24;\n case \"xl\":\n return spacing === \"compact\" ? 72 : 34;\n default:\n return spacing === \"compact\" ? 30 : 18;\n }\n};\n\n/**\n * The AvatarGroup component is used to group multiple avatars.\n */\nexport const HvAvatarGroup = forwardRef<HTMLDivElement, HvAvatarGroupProps>(\n (props, ref) => {\n const {\n className,\n classes: classesProp,\n children,\n size = \"sm\",\n spacing = \"loose\",\n direction = \"row\",\n toBack = true,\n maxVisible = 3,\n overflowComponent,\n ...others\n } = useDefaultProps(\"HvAvatarGroup\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const spacingValue = getSpacingValue(spacing, size);\n\n const totalChildren = Children.count(children);\n const zIndexMultiplier = toBack ? -1 : 1;\n const willOverflow = totalChildren > maxVisible;\n\n return (\n <div\n className={cx(classes.root, classes[direction], className)}\n ref={ref}\n {...others}\n >\n {Children.map(children, (child: any, index: number) => {\n if (index < maxVisible) {\n return cloneElement(child, {\n style: {\n zIndex: 100 + index * zIndexMultiplier,\n },\n classes: {\n container: css({\n marginLeft:\n direction === \"row\" ? (index !== 0 ? -spacingValue : 0) : 0,\n marginTop:\n direction === \"column\"\n ? index !== 0\n ? -spacingValue\n : 0\n : 0,\n }),\n },\n size,\n });\n }\n })}\n {willOverflow && (\n <div\n style={{\n marginLeft: direction === \"row\" ? -spacingValue : 0,\n marginTop: direction === \"column\" ? -spacingValue : 0,\n zIndex: 100 + maxVisible * zIndexMultiplier,\n }}\n >\n {overflowComponent ? (\n overflowComponent(totalChildren - maxVisible)\n ) : (\n <HvAvatar\n size={size}\n backgroundColor={theme.colors.atmo4}\n classes={{\n avatar: css({\n [`&.HvAvatar-${size}`]: {\n fontSize: \"unset\",\n },\n }),\n }}\n >\n +{totalChildren - maxVisible}\n </HvAvatar>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;AA2CA,MAAM,kBAAkB,CACtB,SACA,SACG;AACH,UAAQ,MAAM;AAAA,IACZ,KAAK;AACI,aAAA,YAAY,YAAY,KAAK;AAAA,IACtC,KAAK;AACI,aAAA,YAAY,YAAY,KAAK;AAAA,IACtC,KAAK;AACI,aAAA,YAAY,YAAY,KAAK;AAAA,IACtC,KAAK;AACI,aAAA,YAAY,YAAY,KAAK;AAAA,IACtC,KAAK;AACI,aAAA,YAAY,YAAY,KAAK;AAAA,IACtC;AACS,aAAA,YAAY,YAAY,KAAK;AAAA,EACxC;AACF;AAKO,MAAM,gBAAgB;AAAA,EAC3B,CAAC,OAAO,QAAQ;AACR,UAAA;AAAA,MACJ;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA,OAAO;AAAA,MACP,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,aAAa;AAAA,MACb;AAAA,MACA,GAAG;AAAA,IAAA,IACD,gBAAgB,iBAAiB,KAAK;AAC1C,UAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAExC,UAAA,eAAe,gBAAgB,SAAS,IAAI;AAE5C,UA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,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;"}
@@ -0,0 +1,24 @@
1
+ import { theme } from "@hitachivantara/uikit-styles";
2
+ import { createClasses } from "../utils/classes.js";
3
+ import "../Avatar/Avatar.js";
4
+ import { staticClasses as staticClasses$1 } from "../Avatar/Avatar.styles.js";
5
+ const { staticClasses, useClasses } = createClasses("HvAvatarGroup", {
6
+ root: {
7
+ display: "flex",
8
+ [`& .${staticClasses$1.root}`]: {
9
+ border: `2px solid ${theme.colors.atmo2}`,
10
+ boxSizing: "content-box"
11
+ }
12
+ },
13
+ row: {
14
+ flexDirection: "row"
15
+ },
16
+ column: {
17
+ flexDirection: "column"
18
+ }
19
+ });
20
+ export {
21
+ staticClasses,
22
+ useClasses
23
+ };
24
+ //# sourceMappingURL=AvatarGroup.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarGroup.styles.js","sources":["../../../src/AvatarGroup/AvatarGroup.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nimport { avatarClasses } from \"../Avatar/Avatar\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvAvatarGroup\", {\n root: {\n display: \"flex\",\n [`& .${avatarClasses.root}`]: {\n border: `2px solid ${theme.colors.atmo2}`,\n boxSizing: \"content-box\",\n },\n },\n row: {\n flexDirection: \"row\",\n },\n column: {\n flexDirection: \"column\",\n },\n});\n"],"names":["avatarClasses"],"mappings":";;;;AAMO,MAAM,EAAE,eAAe,eAAe,cAAc,iBAAiB;AAAA,EAC1E,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,CAAC,MAAMA,gBAAc,IAAI,EAAE,GAAG;AAAA,MAC5B,QAAQ,aAAa,MAAM,OAAO,KAAK;AAAA,MACvC,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,eAAe;AAAA,EACjB;AAAA,EACA,QAAQ;AAAA,IACN,eAAe;AAAA,EACjB;AACF,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Context.js","sources":["../../../src/QueryBuilder/Context.tsx"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\nimport {\n AskAction,\n HvQueryBuilderAttribute,\n QueryAction,\n HvQueryBuilderLabels,\n HvQueryBuilderQueryCombinator,\n HvQueryBuilderQueryOperator,\n HvQueryBuilderRenderers,\n} from \"./types\";\n\nexport const defaultOperators = {\n numeric: [\n {\n operator: \"greaterThan\",\n label: \"Greater than (>)\",\n combinators: [\"and\"],\n },\n {\n operator: \"lessThan\",\n label: \"Less than (<)\",\n combinators: [\"and\"],\n },\n {\n operator: \"equalsTo\",\n label: \"Equal to (=)\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"greaterThanEq\",\n label: \"Greater than or equal to (>=)\",\n combinators: [\"and\"],\n },\n {\n operator: \"lessThanEq\",\n label: \"Less than or equal to (<=)\",\n combinators: [\"and\"],\n },\n {\n operator: \"notEqual\",\n label: \"Not equal to (!=)\",\n combinators: [\"and\"],\n },\n {\n operator: \"range\",\n label: \"Range\",\n combinators: [\"and\"],\n },\n ],\n text: [\n {\n operator: \"equals\",\n label: \"Equals\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"equalsIgnoreCase\",\n label: \"Equals Ignore Case\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"Contains\",\n label: \"Contains\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"StartsWith\",\n label: \"A string begins with\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"EndsWith\",\n label: \"A string ends with\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"IsNotEmpty\",\n label: \"Is Not empty\",\n combinators: [\"and\"],\n },\n {\n operator: \"IsNot\",\n label: \"Is Not\",\n combinators: [\"and\"],\n },\n {\n operator: \"Empty\",\n label: \"Empty\",\n combinators: [\"and\"],\n },\n ],\n textarea: [\n {\n operator: \"equals\",\n label: \"Equals\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"equalsIgnoreCase\",\n label: \"Equals Ignore Case\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"Contains\",\n label: \"Contains\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"StartsWith\",\n label: \"A string begins with\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"EndsWith\",\n label: \"A string ends with\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"IsNotEmpty\",\n label: \"Is Not empty\",\n combinators: [\"and\"],\n },\n {\n operator: \"IsNot\",\n label: \"Is Not\",\n combinators: [\"and\"],\n },\n {\n operator: \"Empty\",\n label: \"Empty\",\n combinators: [\"and\"],\n },\n ],\n boolean: [\n {\n operator: \"equalsTo\",\n label: \"=\",\n combinators: [\"and\", \"or\"],\n },\n ],\n dateandtime: [\n {\n operator: \"greaterThan\",\n label: \"Greater than\",\n combinators: [\"and\"],\n },\n {\n operator: \"lessThan\",\n label: \"Less than\",\n combinators: [\"and\"],\n },\n {\n operator: \"equalsTo\",\n label: \"Equal to\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"greaterThanEq\",\n label: \"Greater than or equal to\",\n combinators: [\"and\"],\n },\n {\n operator: \"lessThanEq\",\n label: \"Less than or equal to\",\n combinators: [\"and\"],\n },\n {\n operator: \"notEqual\",\n label: \"Not equal to\",\n combinators: [\"and\"],\n },\n {\n operator: \"range\",\n label: \"Range\",\n combinators: [\"and\"],\n },\n ],\n};\n\nexport const defaultCombinators = [\n { operand: \"and\", label: \"AND\" },\n { operand: \"or\", label: \"OR\" },\n];\n\nexport const defaultLabels = {\n query: {\n delete: {\n ariaLabel: \"Reset query\",\n tooltip: \"Reset query\",\n dialogTitle: \"Remove all conditions?\",\n dialogMessage:\n \"Are you sure you want to remove all the conditions? They will be removed permanently.\",\n dialogConfirm: \"Yes\",\n dialogCancel: \"No\",\n dialogCloseTooltip: \"Close\",\n },\n },\n rule: {\n attribute: {\n label: \"Attribute\",\n placeholder: \"Select attribute...\",\n exists: \"Attribute already exists.\",\n },\n operator: {\n label: \"Operator\",\n placeholder: \"Select operator...\",\n },\n value: {\n distance: {\n label: \"Value\",\n connectorText: \"radius miles from\",\n button: \"Select location\",\n validation: {\n required: \"The value is required.\",\n invalid: \"Value must be a positive number.\",\n },\n },\n text: {\n label: \"Value\",\n placeholder: \"Enter value...\",\n validation: {\n required: \"The value is required.\",\n },\n },\n boolean: {\n label: \"Value\",\n placeholder: \"Enter value\",\n options: {\n true: \"True\",\n false: \"False\",\n },\n },\n numeric: {\n label: \"Value\",\n placeholder: \"Enter value\",\n validation: {\n required: \"The value is required.\",\n invalid: \"Value must be a number.\",\n equal: \"Cannot be equal.\",\n greaterThan: \"Needs to be greater.\",\n },\n range: {\n leftLabel: \"From\",\n rightLabel: \"To\",\n },\n },\n datetime: {\n dateLabel: \"Date\",\n datePlaceholder: \"Select Date\",\n timeLabel: \"Time\",\n timePlaceholder: \"Select Time\",\n startDateLabel: \"Start Date\",\n startDatePlaceholder: \"Select Start Date\",\n startTimeLabel: \"Start Time\",\n startTimePlaceholder: \"Select Start Time\",\n endDateLabel: \"End Date\",\n endDatePlaceholder: \"Select End Date\",\n endTimeLabel: \"End Time\",\n endTimePlaceholder: \"Select End Time\",\n validation: {\n required: \"The value is required.\",\n invalidInterval:\n \"End date and time must be after start date and time.\",\n },\n },\n },\n delete: {\n ariaLabel: \"Remove condition\",\n tooltip: \"Remove condition\",\n dialogTitle: \"Remove condition?\",\n dialogMessage:\n \"Are you sure you want to remove the condition? It will be removed permanently.\",\n dialogConfirm: \"Yes\",\n dialogCancel: \"No\",\n dialogCloseTooltip: \"Close\",\n },\n },\n group: {\n delete: {\n ariaLabel: \"Remove group\",\n tooltip: \"Remove group\",\n dialogTitle: \"Remove group?\",\n dialogMessage:\n \"Are you sure you want to remove the group? It will be removed permanently.\",\n dialogConfirm: \"Yes\",\n dialogCancel: \"No\",\n dialogCloseTooltip: \"Close\",\n },\n reset: {\n ariaLabel: \"Change operator\",\n tooltip: \"Change operator query\",\n dialogTitle: \"Change conditional operator?\",\n dialogMessage:\n \"Do you want to change conditional operator? You won't be able to undo this operation. Conditions and/or groups will be removed.\",\n dialogConfirm: \"Yes\",\n dialogCancel: \"No\",\n dialogCloseTooltip: \"Close\",\n },\n addRule: {\n label: \"Add condition\",\n },\n addGroup: {\n label: \"Add group\",\n },\n },\n empty: {\n title: \"No conditions created yet\",\n createCondition: \"Create a condition\",\n createGroup: \"condition group\",\n spacer: \" or a \",\n },\n};\n\nexport interface HvQueryBuilderContextValue {\n dispatchAction: React.Dispatch<QueryAction>;\n askAction: React.Dispatch<React.SetStateAction<AskAction | undefined>>;\n selectLocation?: React.Dispatch<unknown>;\n attributes?: Record<string, HvQueryBuilderAttribute>;\n operators: Record<string, HvQueryBuilderQueryOperator[]>;\n combinators: HvQueryBuilderQueryCombinator[];\n maxDepth: number;\n labels: HvQueryBuilderLabels;\n initialTouched: boolean;\n readOnly: boolean;\n disableConfirmation: boolean;\n renderers?: HvQueryBuilderRenderers;\n}\n\nexport const HvQueryBuilderContext = createContext<HvQueryBuilderContextValue>({\n dispatchAction: () => ({}),\n askAction: () => ({}),\n selectLocation: () => ({}),\n attributes: {},\n operators: defaultOperators,\n combinators: defaultCombinators,\n maxDepth: 1,\n labels: defaultLabels,\n initialTouched: false,\n disableConfirmation: false,\n readOnly: false,\n});\n\nexport interface HvQueryBuilderProviderProps {\n value: HvQueryBuilderContextValue;\n children: React.ReactNode;\n}\n\nexport const HvQueryBuilderProvider = ({\n children,\n value,\n}: HvQueryBuilderProviderProps) => {\n return (\n <HvQueryBuilderContext.Provider value={value}>\n {children}\n </HvQueryBuilderContext.Provider>\n );\n};\n\nexport const useQueryBuilderContext = () => {\n return useContext(HvQueryBuilderContext);\n};\n"],"names":[],"mappings":";;AAYO,MAAM,mBAAmB;AAAA,EAC9B,SAAS;AAAA,IACP;AAAA,MACE,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa,CAAC,KAAK;AAAA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B,OAAO,CAAA;AAAA,EACvB,WAAW,OAAO,CAAA;AAAA,EAClB,gBAAgB,OAAO,CAAA;AAAA,EACvB,YAAY,CAAC;AAAA,EACb,WAAW;AAAA,EACX,aAAa;AAAA,EACb,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,UAAU;AACZ,CAAC;AAOM,MAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AACF,MAAmC;AACjC,SACG,oBAAA,sBAAsB,UAAtB,EAA+B,OAC7B,SACH,CAAA;AAEJ;AAEO,MAAM,yBAAyB,MAAM;AAC1C,SAAO,WAAW,qBAAqB;AACzC;"}
1
+ {"version":3,"file":"Context.js","sources":["../../../src/QueryBuilder/Context.tsx"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\nimport {\n AskAction,\n HvQueryBuilderAttribute,\n QueryAction,\n HvQueryBuilderLabels,\n HvQueryBuilderQueryCombinator,\n HvQueryBuilderQueryOperator,\n HvQueryBuilderRenderers,\n} from \"./types\";\n\nexport const defaultOperators = {\n numeric: [\n {\n operator: \"greaterThan\",\n label: \"Greater than (>)\",\n combinators: [\"and\"],\n },\n {\n operator: \"lessThan\",\n label: \"Less than (<)\",\n combinators: [\"and\"],\n },\n {\n operator: \"equalsTo\",\n label: \"Equal to (=)\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"greaterThanEq\",\n label: \"Greater than or equal to (>=)\",\n combinators: [\"and\"],\n },\n {\n operator: \"lessThanEq\",\n label: \"Less than or equal to (<=)\",\n combinators: [\"and\"],\n },\n {\n operator: \"notEqual\",\n label: \"Not equal to (!=)\",\n combinators: [\"and\"],\n },\n {\n operator: \"range\",\n label: \"Range\",\n combinators: [\"and\"],\n },\n ],\n text: [\n {\n operator: \"equals\",\n label: \"Equals\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"equalsIgnoreCase\",\n label: \"Equals Ignore Case\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"Contains\",\n label: \"Contains\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"StartsWith\",\n label: \"A string begins with\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"EndsWith\",\n label: \"A string ends with\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"IsNotEmpty\",\n label: \"Is Not empty\",\n combinators: [\"and\"],\n },\n {\n operator: \"IsNot\",\n label: \"Is Not\",\n combinators: [\"and\"],\n },\n {\n operator: \"Empty\",\n label: \"Empty\",\n combinators: [\"and\"],\n },\n ],\n textarea: [\n {\n operator: \"equals\",\n label: \"Equals\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"equalsIgnoreCase\",\n label: \"Equals Ignore Case\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"Contains\",\n label: \"Contains\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"StartsWith\",\n label: \"A string begins with\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"EndsWith\",\n label: \"A string ends with\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"IsNotEmpty\",\n label: \"Is Not empty\",\n combinators: [\"and\"],\n },\n {\n operator: \"IsNot\",\n label: \"Is Not\",\n combinators: [\"and\"],\n },\n {\n operator: \"Empty\",\n label: \"Empty\",\n combinators: [\"and\"],\n },\n ],\n boolean: [\n {\n operator: \"equalsTo\",\n label: \"=\",\n combinators: [\"and\", \"or\"],\n },\n ],\n dateandtime: [\n {\n operator: \"greaterThan\",\n label: \"Greater than\",\n combinators: [\"and\"],\n },\n {\n operator: \"lessThan\",\n label: \"Less than\",\n combinators: [\"and\"],\n },\n {\n operator: \"equalsTo\",\n label: \"Equal to\",\n combinators: [\"and\", \"or\"],\n },\n {\n operator: \"greaterThanEq\",\n label: \"Greater than or equal to\",\n combinators: [\"and\"],\n },\n {\n operator: \"lessThanEq\",\n label: \"Less than or equal to\",\n combinators: [\"and\"],\n },\n {\n operator: \"notEqual\",\n label: \"Not equal to\",\n combinators: [\"and\"],\n },\n {\n operator: \"range\",\n label: \"Range\",\n combinators: [\"and\"],\n },\n ],\n};\n\nexport const defaultCombinators = [\n { operand: \"and\", label: \"AND\" },\n { operand: \"or\", label: \"OR\" },\n];\n\nexport const defaultLabels = {\n query: {\n delete: {\n ariaLabel: \"Reset query\",\n tooltip: \"Reset query\",\n dialogTitle: \"Remove all conditions?\",\n dialogMessage:\n \"Are you sure you want to remove all the conditions? They will be removed permanently.\",\n dialogConfirm: \"Yes\",\n dialogCancel: \"No\",\n dialogCloseTooltip: \"Close\",\n },\n },\n rule: {\n attribute: {\n label: \"Attribute\",\n placeholder: \"Select attribute...\",\n exists: \"Attribute already exists.\",\n },\n operator: {\n label: \"Operator\",\n placeholder: \"Select operator...\",\n },\n value: {\n distance: {\n label: \"Value\",\n connectorText: \"radius miles from\",\n button: \"Select location\",\n validation: {\n required: \"The value is required.\",\n invalid: \"Value must be a positive number.\",\n },\n },\n text: {\n label: \"Value\",\n placeholder: \"Enter value...\",\n validation: {\n required: \"The value is required.\",\n },\n },\n boolean: {\n label: \"Value\",\n placeholder: \"Enter value\",\n options: {\n true: \"True\",\n false: \"False\",\n },\n },\n numeric: {\n label: \"Value\",\n placeholder: \"Enter value\",\n validation: {\n required: \"The value is required.\",\n invalid: \"Value must be a number.\",\n equal: \"Cannot be equal.\",\n greaterThan: \"Needs to be greater.\",\n },\n range: {\n leftLabel: \"From\",\n rightLabel: \"To\",\n },\n },\n datetime: {\n dateLabel: \"Date\",\n datePlaceholder: \"Select Date\",\n timeLabel: \"Time\",\n timePlaceholder: \"Select Time\",\n startDateLabel: \"Start Date\",\n startDatePlaceholder: \"Select Start Date\",\n startTimeLabel: \"Start Time\",\n startTimePlaceholder: \"Select Start Time\",\n endDateLabel: \"End Date\",\n endDatePlaceholder: \"Select End Date\",\n endTimeLabel: \"End Time\",\n endTimePlaceholder: \"Select End Time\",\n validation: {\n required: \"The value is required.\",\n invalidInterval:\n \"End date and time must be after start date and time.\",\n },\n },\n },\n delete: {\n ariaLabel: \"Remove condition\",\n tooltip: \"Remove condition\",\n dialogTitle: \"Remove condition?\",\n dialogMessage:\n \"Are you sure you want to remove the condition? It will be removed permanently.\",\n dialogConfirm: \"Yes\",\n dialogCancel: \"No\",\n dialogCloseTooltip: \"Close\",\n },\n },\n group: {\n delete: {\n ariaLabel: \"Remove group\",\n tooltip: \"Remove group\",\n dialogTitle: \"Remove group?\",\n dialogMessage:\n \"Are you sure you want to remove the group? It will be removed permanently.\",\n dialogConfirm: \"Yes\",\n dialogCancel: \"No\",\n dialogCloseTooltip: \"Close\",\n },\n reset: {\n ariaLabel: \"Change operator\",\n tooltip: \"Change operator query\",\n dialogTitle: \"Change conditional operator?\",\n dialogMessage:\n \"Do you want to change conditional operator? You won't be able to undo this operation. Conditions and/or groups will be removed.\",\n dialogConfirm: \"Yes\",\n dialogCancel: \"No\",\n dialogCloseTooltip: \"Close\",\n },\n addRule: {\n label: \"Add condition\",\n },\n addGroup: {\n label: \"Add group\",\n },\n },\n empty: {\n title: \"No conditions created yet\",\n createCondition: \"Create a condition\",\n createGroup: \"condition group\",\n spacer: \" or a \",\n },\n};\n\nexport interface HvQueryBuilderContextValue {\n dispatchAction: React.Dispatch<QueryAction>;\n askAction: React.Dispatch<React.SetStateAction<AskAction | undefined>>;\n selectLocation?: React.Dispatch<unknown>;\n attributes?: Record<string, HvQueryBuilderAttribute>;\n operators: Record<string, HvQueryBuilderQueryOperator[]>;\n combinators: HvQueryBuilderQueryCombinator[];\n maxDepth: number;\n labels: HvQueryBuilderLabels;\n initialTouched: boolean;\n readOnly: boolean;\n disableConfirmation: boolean;\n renderers?: HvQueryBuilderRenderers;\n emptyRenderer?: string[];\n}\n\nexport const HvQueryBuilderContext = createContext<HvQueryBuilderContextValue>({\n dispatchAction: () => ({}),\n askAction: () => ({}),\n selectLocation: () => ({}),\n attributes: {},\n operators: defaultOperators,\n combinators: defaultCombinators,\n maxDepth: 1,\n labels: defaultLabels,\n initialTouched: false,\n disableConfirmation: false,\n readOnly: false,\n});\n\nexport interface HvQueryBuilderProviderProps {\n value: HvQueryBuilderContextValue;\n children: React.ReactNode;\n}\n\nexport const HvQueryBuilderProvider = ({\n children,\n value,\n}: HvQueryBuilderProviderProps) => {\n return (\n <HvQueryBuilderContext.Provider value={value}>\n {children}\n </HvQueryBuilderContext.Provider>\n );\n};\n\nexport const useQueryBuilderContext = () => {\n return useContext(HvQueryBuilderContext);\n};\n"],"names":[],"mappings":";;AAYO,MAAM,mBAAmB;AAAA,EAC9B,SAAS;AAAA,IACP;AAAA,MACE,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa,CAAC,KAAK;AAAA,IACrB;AAAA,IACA;AAAA,MACE,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa,CAAC,KAAK;AAAA,IACrB;AAAA,IACA;AAAA,MACE,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa,CAAC,OAAO,IAAI;AAAA,IAC3B;AAAA,IACA;AAAA,MACE,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa,CAAC,KAAK;AAAA,IACrB;AAAA,IACA;AAAA,MACE,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa,CAAC,KAAK;AAAA,IACrB;AAAA,IACA;AAAA,MACE,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa,CAAC,KAAK;AAAA,IACrB;AAAA,IACA;AAAA,MACE,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa,CAAC,KAAK;AAAA,IACrB;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ;AAAA,MACE,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa,CAAC,OAAO,IAAI;AAAA,IAC3B;AAAA,IACA;AAAA,MACE,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa,CAAC,OAAO,IAAI;AAAA,IAC3B;AAAA,IACA;AAAA,MACE,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa,CAAC,OAAO,IAAI;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AAA,IACtB;AAAA,IACA,OAAO;AAAA,MACL,WAAW;AAAA,MACX,SAAS;AAAA,MACT,aAAa;AAAA,MACb,eACE;AAAA,MACF,eAAe;AAAA,MACf,cAAc;AAAA,MACd,oBAAoB;AAAA,IACtB;AAAA,IACA,SAAS;AAAA,MACP,OAAO;AAAA,IACT;AAAA,IACA,UAAU;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,QAAQ;AAAA,EACV;AACF;AAkBO,MAAM,wBAAwB,cAA0C;AAAA,EAC7E,gBAAgB,OAAO,CAAA;AAAA,EACvB,WAAW,OAAO,CAAA;AAAA,EAClB,gBAAgB,OAAO,CAAA;AAAA,EACvB,YAAY,CAAC;AAAA,EACb,WAAW;AAAA,EACX,aAAa;AAAA,EACb,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,UAAU;AACZ,CAAC;AAOM,MAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AACF,MAAmC;AACjC,SACG,oBAAA,sBAAsB,UAAtB,EAA+B,OAC7B,SACH,CAAA;AAEJ;AAEO,MAAM,yBAAyB,MAAM;AAC1C,SAAO,WAAW,qBAAqB;AACzC;"}
@@ -22,6 +22,7 @@ const HvQueryBuilder = (props) => {
22
22
  maxDepth = 1,
23
23
  labels = defaultLabels,
24
24
  readOnly = false,
25
+ emptyRenderer = ["Empty", "IsNotEmpty"],
25
26
  classes: classesProp
26
27
  } = useDefaultProps("HvQueryBuilder", props);
27
28
  const { classes } = useClasses(classesProp);
@@ -49,7 +50,8 @@ const HvQueryBuilder = (props) => {
49
50
  initialTouched: initialState,
50
51
  readOnly,
51
52
  renderers,
52
- disableConfirmation
53
+ disableConfirmation,
54
+ emptyRenderer
53
55
  }),
54
56
  [
55
57
  attributes,
@@ -60,7 +62,8 @@ const HvQueryBuilder = (props) => {
60
62
  readOnly,
61
63
  initialState,
62
64
  renderers,
63
- disableConfirmation
65
+ disableConfirmation,
66
+ emptyRenderer
64
67
  ]
65
68
  );
66
69
  useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilder.js","sources":["../../../src/QueryBuilder/QueryBuilder.tsx"],"sourcesContent":["import { useEffect, useMemo, useReducer, useRef, useState } from \"react\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport isEqual from \"lodash/isEqual\";\n\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport { ExtractNames } from \"../utils/classes\";\n\nimport { ConfirmationDialog } from \"./ConfirmationDialog\";\nimport {\n HvQueryBuilderProvider,\n defaultCombinators,\n defaultLabels,\n defaultOperators,\n} from \"./Context\";\nimport { RuleGroup } from \"./RuleGroup\";\nimport {\n AskAction,\n HvQueryBuilderAttribute,\n HvQueryBuilderQuery,\n HvQueryBuilderLabels,\n HvQueryBuilderQueryCombinator,\n HvQueryBuilderQueryOperator,\n HvQueryBuilderChangedQuery,\n HvQueryBuilderRenderers,\n} from \"./types\";\nimport { clearNodeIds, emptyGroup } from \"./utils\";\nimport reducer from \"./utils/reducer\";\nimport { useClasses, staticClasses } from \"./QueryBuilder.styles\";\n\nexport { staticClasses as queryBuilderClasses };\n\nexport type HvQueryBuilderClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvQueryBuilderProps {\n /** The query attribute types. */\n attributes?: Record<string, HvQueryBuilderAttribute>;\n /** The query rules operators by attribute type and combinator. */\n operators?: Record<string, HvQueryBuilderQueryOperator[]>;\n /** The query combinators operands. */\n combinators?: HvQueryBuilderQueryCombinator[];\n /** The initial query representation. */\n query?: HvQueryBuilderQuery;\n /** Callback fired when query changes. */\n onChange?: (value: HvQueryBuilderChangedQuery) => void;\n /** Max depth of nested query groups. */\n maxDepth?: number;\n /** Object containing all the labels. */\n labels?: HvQueryBuilderLabels;\n /** Whether the query builder is in read-only mode. */\n readOnly?: boolean;\n /** Renderers for custom attribute types. */\n renderers?: HvQueryBuilderRenderers;\n /** Whether to opt-out of the confirmation dialogs shown before removing rules and rule groups. Default to `false`. */\n disableConfirmation?: boolean;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvQueryBuilderClasses;\n}\n\n// TODO - v6\n// - uncontrolled vs controlled: users should be able to control the state\n// - \"query\" renamed to \"initialQuery\" and \"query\" used to control the state\n// - \"query\" provided with ids by the user but removed through \"onChange\"\n\n/**\n * This component allows you to create conditions and group them using logical operators.\n * It outputs a structured set of rules which can be easily parsed to create SQL/NoSQL/whatever queries.\n */\nexport const HvQueryBuilder = (props: HvQueryBuilderProps) => {\n const {\n attributes,\n renderers,\n query,\n onChange,\n disableConfirmation = false,\n operators = defaultOperators,\n combinators = defaultCombinators,\n maxDepth = 1,\n labels = defaultLabels,\n readOnly = false,\n classes: classesProp,\n } = useDefaultProps(\"HvQueryBuilder\", props);\n\n const { classes } = useClasses(classesProp);\n\n const currentAttributes = useRef<HvQueryBuilderProps[\"attributes\"] | null>(\n null\n );\n\n const initialQuery = useRef(query ?? emptyGroup());\n\n const [pendingAction, setPendingAction] = useState<AskAction>();\n const [prevState, setPrevState] = useState(initialQuery.current);\n const [initialState, setInitialState] = useState(true);\n\n const [state, dispatchAction] = useReducer(\n reducer,\n // Deep clone is needed to make sure that the \"query\" prop and \"initialQuery\" are not mutated\n cloneDeep(initialQuery.current)\n );\n\n const value = useMemo(\n () => ({\n dispatchAction,\n askAction: setPendingAction,\n attributes,\n operators,\n combinators,\n maxDepth,\n labels,\n initialTouched: initialState,\n readOnly,\n renderers,\n disableConfirmation,\n }),\n [\n attributes,\n operators,\n combinators,\n maxDepth,\n labels,\n readOnly,\n initialState,\n renderers,\n disableConfirmation,\n ]\n );\n\n // Keep track of attributes\n useEffect(() => {\n if (currentAttributes.current == null) {\n // First run, nothing to do\n currentAttributes.current = attributes;\n } else if (currentAttributes.current !== attributes) {\n // Attributes changed. The existing query is almost certainly invalid, so reset it\n currentAttributes.current = attributes;\n dispatchAction({ type: \"reset-query\" });\n }\n }, [attributes]);\n\n // Propagate the change if the query is modified\n useEffect(() => {\n if (!isEqual(state, prevState)) {\n if (initialState) {\n setInitialState(false);\n }\n\n onChange?.(clearNodeIds(state) as HvQueryBuilderChangedQuery);\n setPrevState(cloneDeep(state));\n }\n }, [initialState, onChange, prevState, state]);\n\n const handleConfirm = () => {\n if (pendingAction) {\n setPendingAction(undefined);\n pendingAction.actions.forEach((action) => dispatchAction(action));\n }\n };\n\n const handleCancel = () => {\n setPendingAction(undefined);\n };\n\n return (\n <HvQueryBuilderProvider value={value}>\n <RuleGroup\n level={0}\n id={state.id}\n combinator={state.combinator}\n rules={state.rules}\n classes={classes}\n />\n <ConfirmationDialog\n isOpen={pendingAction != null}\n onConfirm={handleConfirm}\n onCancel={handleCancel}\n title={pendingAction?.dialog.dialogTitle || \"\"}\n message={pendingAction?.dialog.dialogMessage || \"\"}\n confirmButtonLabel={pendingAction?.dialog.dialogConfirm || \"\"}\n cancelButtonLabel={pendingAction?.dialog.dialogCancel || \"\"}\n closeButtonTooltip={pendingAction?.dialog.dialogCloseTooltip || \"\"}\n />\n </HvQueryBuilderProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAmEa,MAAA,iBAAiB,CAAC,UAA+B;AACtD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,WAAW;AAAA,IACX,SAAS;AAAA,IACT,WAAW;AAAA,IACX,SAAS;AAAA,EAAA,IACP,gBAAgB,kBAAkB,KAAK;AAE3C,QAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AAE1C,QAAM,oBAAoB;AAAA,IACxB;AAAA,EAAA;AAGF,QAAM,eAAe,OAAO,SAAS,WAAY,CAAA;AAEjD,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAoB;AAC9D,QAAM,CAAC,WAAW,YAAY,IAAI,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O;AAAA,QACP,IAAI,MAAM;AAAA,QACV,YAAY,MAAM;AAAA,QAClB,OAAO,MAAM;AAAA,QACb;AAAA,MAAA;AAAA,IACF;AAAA,IACA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAQ,iBAAiB;AAAA,QACzB,WAAW;AAAA,QACX,UAAU;AAAA,QACV,OAAO,eAAe,OAAO,eAAe;AAAA,QAC5C,SAAS,eAAe,OAAO,iBAAiB;AAAA,QAChD,oBAAoB,eAAe,OAAO,iBAAiB;AAAA,QAC3D,mBAAmB,eAAe,OAAO,gBAAgB;AAAA,QACzD,oBAAoB,eAAe,OAAO,sBAAsB;AAAA,MAAA;AAAA,IAClE;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"QueryBuilder.js","sources":["../../../src/QueryBuilder/QueryBuilder.tsx"],"sourcesContent":["import { useEffect, useMemo, useReducer, useRef, useState } from \"react\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport isEqual from \"lodash/isEqual\";\n\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport { ExtractNames } from \"../utils/classes\";\n\nimport { ConfirmationDialog } from \"./ConfirmationDialog\";\nimport {\n HvQueryBuilderProvider,\n defaultCombinators,\n defaultLabels,\n defaultOperators,\n} from \"./Context\";\nimport { RuleGroup } from \"./RuleGroup\";\nimport {\n AskAction,\n HvQueryBuilderAttribute,\n HvQueryBuilderQuery,\n HvQueryBuilderLabels,\n HvQueryBuilderQueryCombinator,\n HvQueryBuilderQueryOperator,\n HvQueryBuilderChangedQuery,\n HvQueryBuilderRenderers,\n defaultRendererKey,\n} from \"./types\";\nimport { clearNodeIds, emptyGroup } from \"./utils\";\nimport reducer from \"./utils/reducer\";\nimport { useClasses, staticClasses } from \"./QueryBuilder.styles\";\n\nexport { staticClasses as queryBuilderClasses };\n\nexport type HvQueryBuilderClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvQueryBuilderProps {\n /** The query attribute types. */\n attributes?: Record<string, HvQueryBuilderAttribute>;\n /** The query rules operators by attribute type and combinator. */\n operators?: Record<string, HvQueryBuilderQueryOperator[]>;\n /** The query combinators operands. */\n combinators?: HvQueryBuilderQueryCombinator[];\n /** The initial query representation. */\n query?: HvQueryBuilderQuery;\n /** Callback fired when query changes. */\n onChange?: (value: HvQueryBuilderChangedQuery) => void;\n /** Max depth of nested query groups. */\n maxDepth?: number;\n /** Object containing all the labels. */\n labels?: HvQueryBuilderLabels;\n /** Whether the query builder is in read-only mode. */\n readOnly?: boolean;\n /**\n * Operators that should use the empty value renderer when selected.\n *\n * When one of the listed operators is selected, the rule value is reset and an empty component is rendered.\n * This property takes priority over `renderers`.\n *\n * @default [\"Empty\", \"IsNotEmpty\"]\n * */\n emptyRenderer?: string[];\n /** Custom renderers for the rules' value. */\n renderers?: HvQueryBuilderRenderers;\n /** Whether to opt-out of the confirmation dialogs shown before removing rules and rule groups. @default false. */\n disableConfirmation?: boolean;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvQueryBuilderClasses;\n}\n\n// TODO - v6\n// - uncontrolled vs controlled: users should be able to control the state\n// - \"query\" renamed to \"initialQuery\" and \"query\" used to control the state\n// - \"query\" provided with ids by the user but removed through \"onChange\"\n// - \"range\", \"Empty\", and \"IsNotEmpty\" operators with internal/built-in logic\n\n/**\n * This component allows you to create conditions and group them using logical operators.\n * It outputs a structured set of rules which can be easily parsed to create SQL/NoSQL/whatever queries.\n *\n * Take a look at the [usage page](https://lumada-design.github.io/uikit/master/?path=/docs/widgets-query-builder-usage--docs) to learn more about this component.\n */\nexport const HvQueryBuilder = (props: HvQueryBuilderProps) => {\n const {\n attributes,\n renderers,\n query,\n onChange,\n disableConfirmation = false,\n operators = defaultOperators,\n combinators = defaultCombinators,\n maxDepth = 1,\n labels = defaultLabels,\n readOnly = false,\n emptyRenderer = [\"Empty\", \"IsNotEmpty\"],\n classes: classesProp,\n } = useDefaultProps(\"HvQueryBuilder\", props);\n\n if (\n import.meta.env.DEV &&\n [\n Object.values(attributes || {}).map(({ type }) => type),\n Object.values(operators || {})\n .map((ops) => ops.map(({ operator }) => operator))\n .flat(),\n ]\n .flat()\n ?.find((key) => key === defaultRendererKey)\n ) {\n // eslint-disable-next-line no-console\n console.error(\n `${defaultRendererKey} is a restricted key and shouldn't be used as an attribute or operator type. Update the key to avoid unexpected behaviors.`\n );\n }\n\n const { classes } = useClasses(classesProp);\n\n const currentAttributes = useRef<HvQueryBuilderProps[\"attributes\"] | null>(\n null\n );\n\n const initialQuery = useRef(query ?? emptyGroup());\n\n const [pendingAction, setPendingAction] = useState<AskAction>();\n const [prevState, setPrevState] = useState(initialQuery.current);\n const [initialState, setInitialState] = useState(true);\n\n const [state, dispatchAction] = useReducer(\n reducer,\n // Deep clone is needed to make sure that the \"query\" prop and \"initialQuery\" are not mutated\n cloneDeep(initialQuery.current)\n );\n\n const value = useMemo(\n () => ({\n dispatchAction,\n askAction: setPendingAction,\n attributes,\n operators,\n combinators,\n maxDepth,\n labels,\n initialTouched: initialState,\n readOnly,\n renderers,\n disableConfirmation,\n emptyRenderer,\n }),\n [\n attributes,\n operators,\n combinators,\n maxDepth,\n labels,\n readOnly,\n initialState,\n renderers,\n disableConfirmation,\n emptyRenderer,\n ]\n );\n\n // Keep track of attributes\n useEffect(() => {\n if (currentAttributes.current == null) {\n // First run, nothing to do\n currentAttributes.current = attributes;\n } else if (currentAttributes.current !== attributes) {\n // Attributes changed. The existing query is almost certainly invalid, so reset it\n currentAttributes.current = attributes;\n dispatchAction({ type: \"reset-query\" });\n }\n }, [attributes]);\n\n // Propagate the change if the query is modified\n useEffect(() => {\n if (!isEqual(state, prevState)) {\n if (initialState) {\n setInitialState(false);\n }\n\n onChange?.(clearNodeIds(state) as HvQueryBuilderChangedQuery);\n setPrevState(cloneDeep(state));\n }\n }, [initialState, onChange, prevState, state]);\n\n const handleConfirm = () => {\n if (pendingAction) {\n setPendingAction(undefined);\n pendingAction.actions.forEach((action) => dispatchAction(action));\n }\n };\n\n const handleCancel = () => {\n setPendingAction(undefined);\n };\n\n return (\n <HvQueryBuilderProvider value={value}>\n <RuleGroup\n level={0}\n id={state.id}\n combinator={state.combinator}\n rules={state.rules}\n classes={classes}\n />\n <ConfirmationDialog\n isOpen={pendingAction != null}\n onConfirm={handleConfirm}\n onCancel={handleCancel}\n title={pendingAction?.dialog.dialogTitle || \"\"}\n message={pendingAction?.dialog.dialogMessage || \"\"}\n confirmButtonLabel={pendingAction?.dialog.dialogConfirm || \"\"}\n cancelButtonLabel={pendingAction?.dialog.dialogCancel || \"\"}\n closeButtonTooltip={pendingAction?.dialog.dialogCloseTooltip || \"\"}\n />\n </HvQueryBuilderProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAgFa,MAAA,iBAAiB,CAAC,UAA+B;AACtD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,WAAW;AAAA,IACX,SAAS;AAAA,IACT,WAAW;AAAA,IACX,gBAAgB,CAAC,SAAS,YAAY;AAAA,IACtC,SAAS;AAAA,EAAA,IACP,gBAAgB,kBAAkB,KAAK;AAmB3C,QAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AAE1C,QAAM,oBAAoB;AAAA,IACxB;AAAA,EAAA;AAGF,QAAM,eAAe,OAAO,SAAS,WAAY,CAAA;AAEjD,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAoB;AAC9D,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,aAAa,OAAO;AAC/D,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,IAAI;AAE/C,QAAA,CAAC,OAAO,cAAc,IAAI;AAAA,IAC9B;AAAA;AAAA,IAEA,UAAU,aAAa,OAAO;AAAA,EAAA;AAGhC,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,MACL;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AA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eAAe,OAAO,iBAAiB;AAAA,QAChD,oBAAoB,eAAe,OAAO,iBAAiB;AAAA,QAC3D,mBAAmB,eAAe,OAAO,gBAAgB;AAAA,QACzD,oBAAoB,eAAe,OAAO,sBAAsB;AAAA,MAAA;AAAA,IAClE;AAAA,EACF,EAAA,CAAA;AAEJ;"}
@@ -95,12 +95,14 @@ const { useClasses, staticClasses } = createClasses("HvQueryBuilder", {
95
95
  createConditionButton: {
96
96
  cursor: "pointer",
97
97
  backgroundColor: "transparent",
98
- padding: 0
98
+ padding: 0,
99
+ "&:disabled": { cursor: "not-allowed", pointerEvents: "none" }
99
100
  },
100
101
  createGroupButton: {
101
102
  cursor: "pointer",
102
103
  backgroundColor: "transparent",
103
- padding: 0
104
+ padding: 0,
105
+ "&:disabled": { cursor: "not-allowed", pointerEvents: "none" }
104
106
  }
105
107
  });
106
108
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilder.styles.js","sources":["../../../src/QueryBuilder/QueryBuilder.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvQueryBuilder\", {\n /** Styles applied to the component root class. */\n root: {\n position: \"relative\",\n padding: theme.space.sm,\n marginTop: 12,\n marginBottom: 32,\n border: `1px solid ${theme.colors.atmo4}`,\n },\n /** Styles applied to the top group container. */\n topGroup: {\n margin: theme.space.sm,\n backgroundColor: \"transparent\",\n maxWidth: \"100%\",\n paddingBottom: theme.space.lg,\n },\n /** Styles applied to the sub group containers. */\n subGroup: {\n margin: \"40px 14px 32px 20px\",\n minHeight: 120,\n paddingBottom: theme.space.md,\n\n \"&::before\": {\n content: '\"\"',\n position: \"absolute\",\n zIndex: 2,\n\n width: 21,\n height: 36,\n\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n\n top: -38,\n left: -38,\n },\n \":not($topRulesContainer)>&:last-child::after\": {\n content: '\"\"',\n position: \"absolute\",\n zIndex: 1,\n\n width: 32,\n height: \"100%\",\n\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n\n top: 0,\n left: `calc(${theme.space.sm} + 2)`,\n },\n },\n /** Styles applied to the radio button+label topGroup when the radio button is disabled. */\n combinator: { minWidth: 80 },\n /** Styles applied to the multi-button combinator container on the top group. */\n topCombinator: {\n position: \"absolute\",\n top: `calc(-1 * ${theme.space.sm})`,\n left: `calc(-1 * ${theme.space.sm})`,\n },\n /** Styles applied to each combinator button. */\n combinatorButton: {},\n /** Styles applied to the remove button. */\n removeButton: {},\n /** Styles applied to the remove button on the top group. */\n topRemoveButton: { position: \"absolute\", top: -16, right: -16 },\n /** Styles applied to the remove button when disabled on the top group. */\n topRemoveButtonDisabled: { backgroundColor: theme.colors.atmo2 },\n /** Styles applied to the rules container. */\n rulesContainer: {},\n /** Styles applied to the sub rules container. */\n subRulesContainer: {\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n marginLeft: theme.space.sm,\n marginBottom: theme.space.md,\n paddingLeft: theme.space.sm,\n paddingTop: 7,\n position: \"relative\",\n left: -33,\n width: \"100%\",\n },\n /** Styles applied to the action button container. */\n actionButtonContainer: {\n marginLeft: \"auto\",\n\n \"&>*\": {\n marginLeft: theme.space.sm,\n },\n },\n /** Styles applied to the top action button container. */\n topActionButtonContainer: {\n position: \"absolute\",\n bottom: `calc(-1 * ${theme.space.md} * 0.5 - 3px)`,\n right: `calc(${theme.space.sm} * 1.75 + 2px)`,\n },\n /** Styles applied to the top rules container. */\n topRulesContainer: {},\n /** Styles applied to the background of buttons to remove transparency */\n buttonBackground: {\n backgroundColor: theme.colors.atmo2,\n display: \"inline-flex\",\n },\n createConditionButton: {\n cursor: \"pointer\",\n backgroundColor: \"transparent\",\n padding: 0,\n },\n createGroupButton: {\n cursor: \"pointer\",\n backgroundColor: \"transparent\",\n padding: 0,\n },\n});\n"],"names":[],"mappings":";;AAIO,MAAM,EAAE,YAAY,kB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AM,OAAO,MAAM;AAAA;AAAA,EAE/D,gBAAgB,CAAC;AAAA;AAAA,EAEjB,mBAAmB;AAAA,IACjB,YAAY,aAAa,MAAM,OAAO,KAAK;AAAA,IAC3C,YAAY,MAAM,MAAM;AAAA,IACxB,cAAc,MAAM,MAAM;AAAA,IAC1B,aAAa,MAAM,MAAM;AAAA,IACzB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAAA;AAAA,EAEA,uBAAuB;AAAA,IACrB,YAAY;AAAA,IAEZ,OAAO;AAAA,MACL,YAAY,MAAM,MAAM;AAAA,IAC1B;AAAA,EACF;AAAA;AAAA,EAEA,0BAA0B;AAAA,IACxB,UAAU;AAAA,IACV,QAAQ,aAAa,MAAM,MAAM,EAAE;AAAA,IACnC,OAAO,QAAQ,MAAM,MAAM,EAAE;AAAA,EAC/B;AAAA;AAAA,EAEA,mBAAmB,CAAC;AAAA;AAAA,EAEpB,kBAAkB;AAAA,IAChB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,SAAS;AAAA,EACX;AAAA,EACA,uBAAuB;AAAA,IACrB,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,SAAS;AAAA,EACX;AAAA,EACA,mBAAmB;AAAA,IACjB,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,SAAS;AAAA,EACX;AACF,CAAC;"}
1
+ {"version":3,"file":"QueryBuilder.styles.js","sources":["../../../src/QueryBuilder/QueryBuilder.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvQueryBuilder\", {\n /** Styles applied to the component root class. */\n root: {\n position: \"relative\",\n padding: theme.space.sm,\n marginTop: 12,\n marginBottom: 32,\n border: `1px solid ${theme.colors.atmo4}`,\n },\n /** Styles applied to the top group container. */\n topGroup: {\n margin: theme.space.sm,\n backgroundColor: \"transparent\",\n maxWidth: \"100%\",\n paddingBottom: theme.space.lg,\n },\n /** Styles applied to the sub group containers. */\n subGroup: {\n margin: \"40px 14px 32px 20px\",\n minHeight: 120,\n paddingBottom: theme.space.md,\n\n \"&::before\": {\n content: '\"\"',\n position: \"absolute\",\n zIndex: 2,\n\n width: 21,\n height: 36,\n\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n\n top: -38,\n left: -38,\n },\n \":not($topRulesContainer)>&:last-child::after\": {\n content: '\"\"',\n position: \"absolute\",\n zIndex: 1,\n\n width: 32,\n height: \"100%\",\n\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n\n top: 0,\n left: `calc(${theme.space.sm} + 2)`,\n },\n },\n /** Styles applied to the radio button+label topGroup when the radio button is disabled. */\n combinator: { minWidth: 80 },\n /** Styles applied to the multi-button combinator container on the top group. */\n topCombinator: {\n position: \"absolute\",\n top: `calc(-1 * ${theme.space.sm})`,\n left: `calc(-1 * ${theme.space.sm})`,\n },\n /** Styles applied to each combinator button. */\n combinatorButton: {},\n /** Styles applied to the remove button. */\n removeButton: {},\n /** Styles applied to the remove button on the top group. */\n topRemoveButton: { position: \"absolute\", top: -16, right: -16 },\n /** Styles applied to the remove button when disabled on the top group. */\n topRemoveButtonDisabled: { backgroundColor: theme.colors.atmo2 },\n /** Styles applied to the rules container. */\n rulesContainer: {},\n /** Styles applied to the sub rules container. */\n subRulesContainer: {\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n marginLeft: theme.space.sm,\n marginBottom: theme.space.md,\n paddingLeft: theme.space.sm,\n paddingTop: 7,\n position: \"relative\",\n left: -33,\n width: \"100%\",\n },\n /** Styles applied to the action button container. */\n actionButtonContainer: {\n marginLeft: \"auto\",\n\n \"&>*\": {\n marginLeft: theme.space.sm,\n },\n },\n /** Styles applied to the top action button container. */\n topActionButtonContainer: {\n position: \"absolute\",\n bottom: `calc(-1 * ${theme.space.md} * 0.5 - 3px)`,\n right: `calc(${theme.space.sm} * 1.75 + 2px)`,\n },\n /** Styles applied to the top rules container. */\n topRulesContainer: {},\n /** Styles applied to the background of buttons to remove transparency */\n buttonBackground: {\n backgroundColor: theme.colors.atmo2,\n display: \"inline-flex\",\n },\n createConditionButton: {\n cursor: \"pointer\",\n backgroundColor: \"transparent\",\n padding: 0,\n\n \"&:disabled\": { cursor: \"not-allowed\", pointerEvents: \"none\" },\n },\n createGroupButton: {\n cursor: \"pointer\",\n backgroundColor: \"transparent\",\n padding: 0,\n\n \"&:disabled\": { cursor: \"not-allowed\", pointerEvents: \"none\" },\n },\n});\n"],"names":[],"mappings":";;AAIO,MAAM,EAAE,YAAY,kBAAkB,cAAc,kBAAkB;AAAA;AAAA,EAE3E,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,SAAS,MAAM,MAAM;AAAA,IACrB,WAAW;AAAA,IACX,cAAc;AAAA,IACd,QAAQ,aAAa,MAAM,OAAO,KAAK;AAAA,EACzC;AAAA;AAAA,EAEA,UAAU;AAAA,IACR,QAAQ,MAAM,MAAM;AAAA,IACpB,iBAAiB;AAAA,IACjB,UAAU;AAAA,IACV,eAAe,MAAM,MAAM;AAAA,EAC7B;AAAA;AAAA,EAEA,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,eAAe,MAAM,MAAM;AAAA,IAE3B,aAAa;AAAA,MACX,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,MAER,OAAO;AAAA,MACP,QAAQ;AAAA,MAER,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,MAC7C,YAAY,aAAa,MAAM,OAAO,KAAK;AAAA,MAE3C,KAAK;AAAA,MACL,MAAM;AAAA,IACR;AAAA,IACA,gDAAgD;AAAA,MAC9C,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,MAER,OAAO;AAAA,MACP,QAAQ;AAAA,MAER,YAAY,aAAa,MAAM,OAAO,KAAK;AAAA,MAE3C,KAAK;AAAA,MACL,MAAM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AAmB;AAAA,IACjB,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,SAAS;AAAA,IAET,cAAc,EAAE,QAAQ,eAAe,eAAe,OAAO;AAAA,EAC/D;AACF,CAAC;"}
@@ -39,7 +39,7 @@ const Operator = ({
39
39
  type: "set-operator",
40
40
  id,
41
41
  operator: selected.id.toString(),
42
- value: value === "range" || selected.id === "range" || selected.id === "IsNotEmpty" || selected.id === "Empty" ? null : void 0
42
+ value: value === "range" || selected.id === "range" ? null : void 0
43
43
  });
44
44
  } else {
45
45
  dispatchAction({