qc-trousse-sdg 1.4.7 → 1.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qc-trousse-sdg",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "description": "Trousse de développement du Système de design gouvernemental du Québec",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1802,6 +1802,26 @@ qc-search-input {
1802
1802
  width: 100%;
1803
1803
  max-width: 54.8rem;
1804
1804
  }
1805
+ qc-search-input[size=xs] {
1806
+ max-width: 100%;
1807
+ width: 6.3rem;
1808
+ }
1809
+ qc-search-input[size=sm] {
1810
+ max-width: 100%;
1811
+ width: 15.6rem;
1812
+ }
1813
+ qc-search-input[size=md] {
1814
+ max-width: 100%;
1815
+ width: 24.9rem;
1816
+ }
1817
+ qc-search-input[size=lg] {
1818
+ max-width: 100%;
1819
+ width: 52.8rem;
1820
+ }
1821
+ qc-search-input[size=xl] {
1822
+ max-width: 100%;
1823
+ width: 82.5rem;
1824
+ }
1805
1825
 
1806
1826
  .qc-search-bar, .qc-search-input {
1807
1827
  display: flex;
@@ -2271,26 +2291,6 @@ qc-textfield textarea:disabled {
2271
2291
  padding: 0.6rem;
2272
2292
  }
2273
2293
 
2274
- [size=xs] {
2275
- max-width: 100%;
2276
- }
2277
-
2278
- [size=sm] {
2279
- max-width: 100%;
2280
- }
2281
-
2282
- [size=md] {
2283
- max-width: 100%;
2284
- }
2285
-
2286
- [size=lg] {
2287
- max-width: 100%;
2288
- }
2289
-
2290
- [size=xl] {
2291
- max-width: 100%;
2292
- }
2293
-
2294
2294
  [size=xs] input, [size=xs] input + .qc-textfield-charcount,
2295
2295
  [size=xs] textarea,
2296
2296
  [size=xs] textarea + .qc-textfield-charcount {
@@ -1802,6 +1802,26 @@ qc-search-input {
1802
1802
  width: 100%;
1803
1803
  max-width: 54.8rem;
1804
1804
  }
1805
+ qc-search-input[size=xs] {
1806
+ max-width: 100%;
1807
+ width: 6.3rem;
1808
+ }
1809
+ qc-search-input[size=sm] {
1810
+ max-width: 100%;
1811
+ width: 15.6rem;
1812
+ }
1813
+ qc-search-input[size=md] {
1814
+ max-width: 100%;
1815
+ width: 24.9rem;
1816
+ }
1817
+ qc-search-input[size=lg] {
1818
+ max-width: 100%;
1819
+ width: 52.8rem;
1820
+ }
1821
+ qc-search-input[size=xl] {
1822
+ max-width: 100%;
1823
+ width: 82.5rem;
1824
+ }
1805
1825
 
1806
1826
  .qc-search-bar, .qc-search-input {
1807
1827
  display: flex;
@@ -2271,26 +2291,6 @@ qc-textfield textarea:disabled {
2271
2291
  padding: 0.6rem;
2272
2292
  }
2273
2293
 
2274
- [size=xs] {
2275
- max-width: 100%;
2276
- }
2277
-
2278
- [size=sm] {
2279
- max-width: 100%;
2280
- }
2281
-
2282
- [size=md] {
2283
- max-width: 100%;
2284
- }
2285
-
2286
- [size=lg] {
2287
- max-width: 100%;
2288
- }
2289
-
2290
- [size=xl] {
2291
- max-width: 100%;
2292
- }
2293
-
2294
2294
  [size=xs] input, [size=xs] input + .qc-textfield-charcount,
2295
2295
  [size=xs] textarea,
2296
2296
  [size=xs] textarea + .qc-textfield-charcount {
package/public/index.html CHANGED
@@ -1952,10 +1952,10 @@
1952
1952
  <qc-doc-exemple caption="Exemples 1 - différents champs de texte. Soumettre le formulaire pour voir les messages d'erreur.">
1953
1953
  <form id="formulaire-champs-textes">
1954
1954
  <qc-textfield
1955
- label="Nom complet"
1956
1955
  size="md"
1957
1956
  required
1958
1957
  >
1958
+ <label>Nom complet</label>
1959
1959
  <input type="text"
1960
1960
  name="code-postal"
1961
1961
  placeholder="ex : Jean Tremblay"
@@ -2191,6 +2191,16 @@
2191
2191
  left-icon
2192
2192
  clear-aria-label="Effacer le texte"
2193
2193
  ></qc-search-input>
2194
+
2195
+ <br>
2196
+
2197
+ <qc-search-input
2198
+ label="Nom de l'article"
2199
+ size="md"
2200
+ placeholder="Rechercher un article"
2201
+ clear-aria-label="Effacer le texte"
2202
+ left-icon
2203
+ ></qc-search-input>
2194
2204
  </qc-doc-exemple>
2195
2205
 
2196
2206
  <h3>Documentation technique</h3>
@@ -2238,10 +2248,16 @@
2238
2248
  <td>Désactive le champ.</td>
2239
2249
  </tr>
2240
2250
  <tr>
2241
- <td>name</td>
2251
+ <td>label</td>
2242
2252
  <td>Texte</td>
2243
2253
  <td>""</td>
2244
- <td>Nom du champ utilisé lors de la soumission du formulaire.</td>
2254
+ <td>Texte du libellé du champ. Remplace automatiquement l'aria-label lorsqu'il est défini.</td>
2255
+ </tr>
2256
+ <tr>
2257
+ <td>size</td>
2258
+ <td>"xs", "sm", "md", "lg", "xl"</td>
2259
+ <td>""</td>
2260
+ <td>Largeur du champ</td>
2245
2261
  </tr>
2246
2262
  </tbody>
2247
2263
  </table>
@@ -79574,7 +79574,7 @@
79574
79574
 
79575
79575
  SearchInput[FILENAME] = 'src/sdg/components/SearchInput/SearchInput.svelte';
79576
79576
 
79577
- var root$4 = add_locations(from_html(`<div><!> <input/> <!></div>`), SearchInput[FILENAME], [[28, 0, [[39, 4]]]]);
79577
+ var root$4 = add_locations(from_html(`<!> <div><!> <input/> <!></div>`, 1), SearchInput[FILENAME], [[38, 0, [[51, 4]]]]);
79578
79578
 
79579
79579
  function SearchInput($$anchor, $$props) {
79580
79580
  check_target(new.target);
@@ -79583,6 +79583,8 @@
79583
79583
  const lang = Utils.getPageLanguage();
79584
79584
 
79585
79585
  let value = prop($$props, 'value', 15, ''),
79586
+ label = prop($$props, 'label', 7, ''),
79587
+ size = prop($$props, 'size', 7, ''),
79586
79588
  ariaLabel = prop($$props, 'ariaLabel', 23, () => strict_equals(lang, "fr") ? "Rechercher..." : "Search..."),
79587
79589
  clearAriaLabel = prop($$props, 'clearAriaLabel', 23, () => strict_equals(lang, "fr") ? "Effacer le texte" : "Clear text"),
79588
79590
  leftIcon = prop($$props, 'leftIcon', 7, false),
@@ -79595,6 +79597,8 @@
79595
79597
  '$$legacy',
79596
79598
  '$$host',
79597
79599
  'value',
79600
+ 'label',
79601
+ 'size',
79598
79602
  'ariaLabel',
79599
79603
  'clearAriaLabel',
79600
79604
  'leftIcon',
@@ -79624,6 +79628,24 @@
79624
79628
  flushSync();
79625
79629
  },
79626
79630
 
79631
+ get label() {
79632
+ return label();
79633
+ },
79634
+
79635
+ set label($$value = '') {
79636
+ label($$value);
79637
+ flushSync();
79638
+ },
79639
+
79640
+ get size() {
79641
+ return size();
79642
+ },
79643
+
79644
+ set size($$value = '') {
79645
+ size($$value);
79646
+ flushSync();
79647
+ },
79648
+
79627
79649
  get ariaLabel() {
79628
79650
  return ariaLabel();
79629
79651
  },
@@ -79665,11 +79687,49 @@
79665
79687
  ...legacy_api()
79666
79688
  };
79667
79689
 
79668
- var div = root$4();
79669
- var node = child(div);
79690
+ var fragment = root$4();
79691
+ var node = first_child(fragment);
79670
79692
 
79671
79693
  {
79672
79694
  var consequent = ($$anchor) => {
79695
+ add_svelte_meta(
79696
+ () => Label($$anchor, {
79697
+ get disabled() {
79698
+ return isDisabled;
79699
+ },
79700
+
79701
+ get text() {
79702
+ return label();
79703
+ },
79704
+
79705
+ get forId() {
79706
+ return id();
79707
+ }
79708
+ }),
79709
+ 'component',
79710
+ SearchInput,
79711
+ 32,
79712
+ 4,
79713
+ { componentTag: 'Label' }
79714
+ );
79715
+ };
79716
+
79717
+ add_svelte_meta(
79718
+ () => if_block(node, ($$render) => {
79719
+ if (label()) $$render(consequent);
79720
+ }),
79721
+ 'if',
79722
+ SearchInput,
79723
+ 31,
79724
+ 0
79725
+ );
79726
+ }
79727
+
79728
+ var div = sibling(node, 2);
79729
+ var node_1 = child(div);
79730
+
79731
+ {
79732
+ var consequent_1 = ($$anchor) => {
79673
79733
  {
79674
79734
  let $0 = user_derived(() => `qc-icon${isDisabled ? ' is-disabled' : ''}`);
79675
79735
 
@@ -79684,7 +79744,7 @@
79684
79744
  }),
79685
79745
  'component',
79686
79746
  SearchInput,
79687
- 34,
79747
+ 46,
79688
79748
  8,
79689
79749
  { componentTag: 'Icon' }
79690
79750
  );
@@ -79692,24 +79752,24 @@
79692
79752
  };
79693
79753
 
79694
79754
  add_svelte_meta(
79695
- () => if_block(node, ($$render) => {
79696
- if (leftIcon()) $$render(consequent);
79755
+ () => if_block(node_1, ($$render) => {
79756
+ if (leftIcon()) $$render(consequent_1);
79697
79757
  }),
79698
79758
  'if',
79699
79759
  SearchInput,
79700
- 33,
79760
+ 45,
79701
79761
  4
79702
79762
  );
79703
79763
  }
79704
79764
 
79705
- var input = sibling(node, 2);
79765
+ var input = sibling(node_1, 2);
79706
79766
 
79707
79767
  attribute_effect(
79708
79768
  input,
79709
79769
  () => ({
79710
79770
  type: 'search',
79711
79771
  autocomplete: 'off',
79712
- 'aria-label': ariaLabel(),
79772
+ 'aria-label': label() ? undefined : ariaLabel(),
79713
79773
  class: isDisabled ? "qc-disabled" : "",
79714
79774
  id: id(),
79715
79775
  ...rest
@@ -79723,10 +79783,10 @@
79723
79783
 
79724
79784
  bind_this(input, ($$value) => searchInput = $$value, () => searchInput);
79725
79785
 
79726
- var node_1 = sibling(input, 2);
79786
+ var node_2 = sibling(input, 2);
79727
79787
 
79728
79788
  {
79729
- var consequent_1 = ($$anchor) => {
79789
+ var consequent_2 = ($$anchor) => {
79730
79790
  add_svelte_meta(
79731
79791
  () => IconButton($$anchor, {
79732
79792
  type: 'button',
@@ -79746,33 +79806,37 @@
79746
79806
  }),
79747
79807
  'component',
79748
79808
  SearchInput,
79749
- 49,
79809
+ 61,
79750
79810
  4,
79751
79811
  { componentTag: 'IconButton' }
79752
79812
  );
79753
79813
  };
79754
79814
 
79755
79815
  add_svelte_meta(
79756
- () => if_block(node_1, ($$render) => {
79757
- if (value()) $$render(consequent_1);
79816
+ () => if_block(node_2, ($$render) => {
79817
+ if (value()) $$render(consequent_2);
79758
79818
  }),
79759
79819
  'if',
79760
79820
  SearchInput,
79761
- 48,
79821
+ 60,
79762
79822
  4
79763
79823
  );
79764
79824
  }
79765
79825
 
79766
79826
  reset(div);
79767
79827
 
79768
- template_effect(() => set_class(div, 1, clsx([
79769
- "qc-search-input",
79770
- leftIcon() && "qc-search-left-icon",
79771
- leftIcon() && isDisabled && "qc-search-left-icon-disabled"
79772
- ])));
79828
+ template_effect(() => {
79829
+ set_class(div, 1, clsx([
79830
+ "qc-search-input",
79831
+ leftIcon() && "qc-search-left-icon",
79832
+ leftIcon() && isDisabled && "qc-search-left-icon-disabled"
79833
+ ]));
79834
+
79835
+ set_attribute(div, 'size', size());
79836
+ });
79773
79837
 
79774
79838
  bind_value(input, value);
79775
- append($$anchor, div);
79839
+ append($$anchor, fragment);
79776
79840
 
79777
79841
  return pop($$exports);
79778
79842
  }
@@ -79781,6 +79845,8 @@
79781
79845
  SearchInput,
79782
79846
  {
79783
79847
  value: {},
79848
+ label: {},
79849
+ size: {},
79784
79850
  ariaLabel: {},
79785
79851
  clearAriaLabel: {},
79786
79852
  leftIcon: {},
@@ -82934,7 +83000,7 @@
82934
83000
  ));
82935
83001
 
82936
83002
  if (document.getElementById("version")) {
82937
- document.getElementById("version").textContent = `v1.4.7`;
83003
+ document.getElementById("version").textContent = `v1.4.8`;
82938
83004
  }
82939
83005
 
82940
83006
  // Show maskable "general alert" component