@dao-style/core 0.1.3 → 0.1.4

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.
@@ -10,6 +10,8 @@ declare const _default: import("vue").DefineComponent<{
10
10
  }, {
11
11
  onItemClick: () => void;
12
12
  isExpanded: import("vue").ComputedRef<boolean>;
13
+ expansionType: import("vue").ComputedRef<"line" | "box" | undefined>;
14
+ expansionMode: import("vue").ComputedRef<"manual" | "auto" | undefined>;
13
15
  onBeforeEnter: (el: Element) => void;
14
16
  onEnter: (el: Element) => void;
15
17
  onAfterEnter: (el: Element) => void;
@@ -21,6 +21,8 @@ declare const _default: import("vue").DefineComponent<{
21
21
  state: {
22
22
  expansionRecord: ExpansionName | ExpansionName[] | undefined;
23
23
  accordion: boolean;
24
+ type?: "line" | "box" | undefined;
25
+ mode?: "manual" | "auto" | undefined;
24
26
  };
25
27
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
26
28
  modelValue?: unknown;
@@ -1,5 +1,7 @@
1
1
  import type { PropType, ExtractPropTypes } from 'vue';
2
2
  export declare type ExpansionName = symbol | string | number;
3
+ declare const expansionType: readonly ["line", "box"];
4
+ declare type TypeExpansionType = typeof expansionType[number];
3
5
  export declare const expansionProps: {
4
6
  modelValue: {
5
7
  type: PropType<ExpansionName | ExpansionName[]>;
@@ -31,4 +33,7 @@ export declare type ExpansionPropsType = ExtractPropTypes<typeof expansionProps>
31
33
  export interface ExpansionState {
32
34
  expansionRecord: ExpansionPropsType['modelValue'];
33
35
  accordion: boolean;
36
+ type?: TypeExpansionType;
37
+ mode?: 'auto' | 'manual';
34
38
  }
39
+ export {};
@@ -3303,7 +3303,9 @@ const _sfc_main$x = defineComponent({
3303
3303
  ]);
3304
3304
  const state = reactive({
3305
3305
  expansionRecord: modelValue.value,
3306
- accordion: accordion.value
3306
+ accordion: accordion.value,
3307
+ type: type.value,
3308
+ mode: props.manual ? "manual" : "auto"
3307
3309
  });
3308
3310
  function toggleItem(itemName) {
3309
3311
  if (manual.value) {
@@ -3359,6 +3361,12 @@ const _sfc_main$x = defineComponent({
3359
3361
  }
3360
3362
  state.accordion = newA;
3361
3363
  });
3364
+ watch(() => type.value, (newV) => {
3365
+ state.type = newV;
3366
+ });
3367
+ watch(() => props.manual, (newV) => {
3368
+ state.mode = newV ? "manual" : "auto";
3369
+ });
3362
3370
  provide(ToggleItemKey, toggleItem);
3363
3371
  provide(ExpansionStateKey, state);
3364
3372
  return {
@@ -3582,6 +3590,8 @@ const _sfc_main$t = defineComponent({
3582
3590
  }
3583
3591
  return false;
3584
3592
  });
3593
+ const expansionType = computed(() => parentState == null ? void 0 : parentState.type);
3594
+ const expansionMode = computed(() => parentState == null ? void 0 : parentState.mode);
3585
3595
  function onBeforeEnter(el) {
3586
3596
  if (el instanceof HTMLElement) {
3587
3597
  const { style } = el;
@@ -3623,6 +3633,8 @@ const _sfc_main$t = defineComponent({
3623
3633
  return {
3624
3634
  onItemClick,
3625
3635
  isExpanded,
3636
+ expansionType,
3637
+ expansionMode,
3626
3638
  onBeforeEnter,
3627
3639
  onEnter,
3628
3640
  onAfterEnter,
@@ -3659,9 +3671,11 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
3659
3671
  const _component_dao_icon = resolveComponent("dao-icon");
3660
3672
  const _component_dao_ellipsis = resolveComponent("dao-ellipsis");
3661
3673
  return openBlock(), createElementBlock("div", {
3662
- class: normalizeClass(["dao-expansion-item", {
3663
- "dao-expansion-item--expanded": _ctx.isExpanded
3664
- }])
3674
+ class: normalizeClass(["dao-expansion-item", [
3675
+ `dao-expansion-item--${_ctx.expansionType}`,
3676
+ `dao-expansion-item--${_ctx.expansionMode}`,
3677
+ _ctx.isExpanded && "dao-expansion-item--expanded"
3678
+ ]])
3665
3679
  }, [
3666
3680
  createElementVNode("div", {
3667
3681
  class: "dao-expansion-item-header",